@hachej/boring-agent 0.1.63 → 0.1.65
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/dist/{agentPluginEvents-Ddn5DQ5E.d.ts → agentPluginEvents-ChUzG2Lh.d.ts} +3 -134
- package/dist/chatSubmitPayload-DwOHyiqR.d.ts +22 -0
- package/dist/chunk-4LXA7OOV.js +290 -0
- package/dist/chunk-AJZHR626.js +85 -0
- package/dist/chunk-AQBXNPMD.js +17 -0
- package/dist/chunk-HHW2UNBK.js +1812 -0
- package/dist/chunk-NKP5AR4C.js +2755 -0
- package/dist/chunk-WSQ5QNIY.js +18 -0
- package/dist/chunk-XZKU7FBV.js +96 -0
- package/dist/{chunk-HDOSWEXG.js → chunk-ZD7MM2LQ.js} +0 -15
- package/dist/core/index.d.ts +9 -0
- package/dist/core/index.js +15 -0
- package/dist/createHarness-LA2OO2DL.js +17 -0
- package/dist/front/index.d.ts +32 -27
- package/dist/front/index.js +84 -30
- package/dist/front/styles.css +67 -70
- package/dist/harness-DN9KdrT7.d.ts +265 -0
- package/dist/piChatCommand-C5ZM-AMG.d.ts +40 -0
- package/dist/{piChatEvent-B6GDifo2.d.ts → piChatEvent-B6Lg9ft-.d.ts} +88 -98
- package/dist/server/index.d.ts +238 -6
- package/dist/server/index.js +3294 -6225
- package/dist/shared/index.d.ts +212 -208
- package/dist/shared/index.js +21 -9
- package/docs/ERROR_CODES.md +3 -0
- package/docs/plans/archive/harness-followup-capabilities.md +1 -1
- package/docs/plans/archive/pi-tools-migration.md +1 -1
- package/docs/plans/archive/vercel-persistent-sandbox-adapter.md +1 -1
- package/docs/runtime.md +22 -9
- package/package.json +39 -34
- package/dist/chatSubmitPayload-DHqQL2wD.d.ts +0 -48
- package/dist/chunk-G6YPXDHR.js +0 -376
package/dist/shared/index.js
CHANGED
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
|
-
noopTelemetry,
|
|
3
|
-
safeCapture,
|
|
4
2
|
validateTool
|
|
5
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-ZD7MM2LQ.js";
|
|
4
|
+
import {
|
|
5
|
+
AGENT_NOT_IMPLEMENTED_UNTIL_T1,
|
|
6
|
+
AgentNotImplementedError,
|
|
7
|
+
sessionStreamPath
|
|
8
|
+
} from "../chunk-WSQ5QNIY.js";
|
|
6
9
|
import {
|
|
7
10
|
WORKSPACE_AGENT_PLUGINS_RELOADED_EVENT,
|
|
8
11
|
WORKSPACE_COMMAND_NOTIFY_EVENT
|
|
9
12
|
} from "../chunk-DGRKMMXO.js";
|
|
10
13
|
import {
|
|
11
|
-
ApiErrorPayloadSchema,
|
|
12
|
-
ApiErrorResponseSchema,
|
|
13
14
|
BoringChatMessageSchema,
|
|
14
15
|
BoringChatPartSchema,
|
|
15
16
|
ChatAttachmentPayloadSchema,
|
|
16
17
|
ChatErrorSchema,
|
|
17
18
|
ChatModelSelectionSchema,
|
|
18
19
|
CommandReceiptSchema,
|
|
19
|
-
ERROR_CODES,
|
|
20
|
-
ErrorCode,
|
|
21
|
-
ErrorLogFieldsSchema,
|
|
22
20
|
FollowUpPayloadSchema,
|
|
23
21
|
FollowUpReceiptSchema,
|
|
24
22
|
InterruptPayloadSchema,
|
|
@@ -39,7 +37,18 @@ import {
|
|
|
39
37
|
extractToolUiMetadata,
|
|
40
38
|
isToolUiMetadata,
|
|
41
39
|
sanitizeToolUiMetadata2 as sanitizeToolUiMetadata
|
|
42
|
-
} from "../chunk-
|
|
40
|
+
} from "../chunk-4LXA7OOV.js";
|
|
41
|
+
import {
|
|
42
|
+
noopTelemetry,
|
|
43
|
+
safeCapture
|
|
44
|
+
} from "../chunk-AQBXNPMD.js";
|
|
45
|
+
import {
|
|
46
|
+
ApiErrorPayloadSchema,
|
|
47
|
+
ApiErrorResponseSchema,
|
|
48
|
+
ERROR_CODES,
|
|
49
|
+
ErrorCode,
|
|
50
|
+
ErrorLogFieldsSchema
|
|
51
|
+
} from "../chunk-XZKU7FBV.js";
|
|
43
52
|
|
|
44
53
|
// src/shared/config-schema.ts
|
|
45
54
|
import { z } from "zod";
|
|
@@ -105,6 +114,8 @@ var PI_AGENT_RUNTIME_CAPABILITIES = {
|
|
|
105
114
|
aiSdkOwnsHistory: false
|
|
106
115
|
};
|
|
107
116
|
export {
|
|
117
|
+
AGENT_NOT_IMPLEMENTED_UNTIL_T1,
|
|
118
|
+
AgentNotImplementedError,
|
|
108
119
|
ApiErrorPayloadSchema,
|
|
109
120
|
ApiErrorResponseSchema,
|
|
110
121
|
BoringChatMessageSchema,
|
|
@@ -145,6 +156,7 @@ export {
|
|
|
145
156
|
noopTelemetry,
|
|
146
157
|
safeCapture,
|
|
147
158
|
sanitizeToolUiMetadata,
|
|
159
|
+
sessionStreamPath,
|
|
148
160
|
validateConfig,
|
|
149
161
|
validateTool
|
|
150
162
|
};
|
package/docs/ERROR_CODES.md
CHANGED
|
@@ -49,6 +49,8 @@ All API failures must use the response envelope:
|
|
|
49
49
|
| `CIRCUIT_OPEN` | Circuit breaker open; request fast-failed | 503 | retry | warn | stable (public API) |
|
|
50
50
|
| `ABORTED` | Request cancelled via `AbortSignal` | 499 | retry | warn | stable (public API) |
|
|
51
51
|
| `PAYMENT_REQUIRED` | Billing/metering sink rejected the run (e.g. credits exhausted) | 402 | user-fix | warn | stable (public API) |
|
|
52
|
+
| `MODEL_BUDGET_EXCEEDED` | Governance model budget for this user/model is exhausted | 402 | user-fix | warn | stable (public API) |
|
|
53
|
+
| `METERING_UNSUPPORTED_COMMAND` | Slash-command execution is disabled because metering cannot yet reserve/settle that path | 409 | user-fix | warn | stable (public API) |
|
|
52
54
|
| `SESSION_NOT_FOUND` | Session id does not exist | 404 | user-fix | warn | stable (public API) |
|
|
53
55
|
| `SESSION_LOCKED` | Session currently locked by concurrent writer | 409 | retry | warn | stable (public API) |
|
|
54
56
|
| `STREAM_BUFFER_EVICTED` | Resume cursor evicted from in-memory stream buffer | 410 | retry | warn | stable (public API) |
|
|
@@ -76,6 +78,7 @@ All API failures must use the response envelope:
|
|
|
76
78
|
| `PROVISIONING_UV_BOOTSTRAP_FAILED` | uv bootstrap/preflight failed for Python runtime packages | 500 | user-fix | error | stable (public API) |
|
|
77
79
|
| `PROVISIONING_UV_INSTALL_FAILED` | uv venv or uv pip install failed | 500 | user-fix | error | stable (public API) |
|
|
78
80
|
| `PROVISIONING_ARTIFACT_FAILED` | Runtime-mode adapter failed to prepare/upload install artifact | 500 | retry | error | stable (public API) |
|
|
81
|
+
| `ERR_NOT_IMPLEMENTED_UNTIL_T1` | Headless core method exists but the durable T1 implementation has not landed yet | 501 | retry-after-upgrade | warn | stable (public API) |
|
|
79
82
|
| `INTERNAL_ERROR` | Catch-all internal failure | 500 | report-bug | error | internal (may change) |
|
|
80
83
|
|
|
81
84
|
## Readiness error details
|
|
@@ -178,7 +178,7 @@ Locked implementation choices for the first pass:
|
|
|
178
178
|
- Keep current pi projection as temporary, adapter-owned compatibility behind `aiSdkOwnsHistory === false`.
|
|
179
179
|
- Add a stable unsupported-follow-up error code: `FOLLOWUP_UNSUPPORTED`.
|
|
180
180
|
|
|
181
|
-
This means the next implementation
|
|
181
|
+
This means the next implementation task should transform the already-working pi follow-up branch into a pluggable design:
|
|
182
182
|
|
|
183
183
|
```txt
|
|
184
184
|
pi runtime:
|
|
@@ -822,7 +822,7 @@ convenience accessors `command.stdout()` + `command.stderr()` by choice,
|
|
|
822
822
|
not necessity. `DirectSandbox` and `BwrapSandbox` use `child_process`
|
|
823
823
|
which has streamed via `child.stdout.on('data', ...)` since forever.
|
|
824
824
|
|
|
825
|
-
**Mitigation:
|
|
825
|
+
**Mitigation: task `uhwx.5b` (a new precursor)** extends `ExecOptions`
|
|
826
826
|
with optional `onStdout`/`onStderr` callbacks and updates all three
|
|
827
827
|
sandbox adapters to invoke them as bytes arrive. ~4-6 hours total. Gates
|
|
828
828
|
`uhwx.6` (vercel*Ops) and `uhwx.7` (buildHarnessAgentTools) since both
|
|
@@ -475,7 +475,7 @@ Acceptance:
|
|
|
475
475
|
no longer needed.
|
|
476
476
|
- Decide whether to rename channel from `persistent-beta` to `persistent`.
|
|
477
477
|
- Keep backwards compatibility for old stable records until an explicit cleanup
|
|
478
|
-
|
|
478
|
+
task removes it.
|
|
479
479
|
|
|
480
480
|
## Test Matrix
|
|
481
481
|
|
package/docs/runtime.md
CHANGED
|
@@ -2,7 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
# Runtime Modes and Provisioning
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
When a boring-bash filesystem/exec environment is attached, the agent supports
|
|
6
|
+
three execution modes controlling how `bash` and filesystem tools run.
|
|
7
|
+
|
|
8
|
+
Pure/headless agents use `runtime: 'none'` instead. That mode has no
|
|
9
|
+
`Workspace`, no `Sandbox`, no cwd, no file routes, no file tools, and no bash
|
|
10
|
+
tools. It is not selected with `BORING_AGENT_MODE`; the host composes a
|
|
11
|
+
runtime-free agent and supplies only non-bash tools plus session/model
|
|
12
|
+
configuration. If the host later attaches a filesystem/exec environment, that
|
|
13
|
+
attachment enters the boring-bash runtime contract below.
|
|
6
14
|
|
|
7
15
|
## Modes
|
|
8
16
|
|
|
@@ -22,7 +30,7 @@ Defaults to `direct` when unset.
|
|
|
22
30
|
|
|
23
31
|
## Runtime cwd contract
|
|
24
32
|
|
|
25
|
-
Every adapter must preserve this invariant:
|
|
33
|
+
Every boring-bash runtime adapter must preserve this invariant:
|
|
26
34
|
|
|
27
35
|
```txt
|
|
28
36
|
file tree root == shell cwd == model-visible cwd == BORING_AGENT_WORKSPACE_ROOT
|
|
@@ -36,7 +44,7 @@ interface WorkspaceRuntimeContext {
|
|
|
36
44
|
}
|
|
37
45
|
```
|
|
38
46
|
|
|
39
|
-
Adapter rules:
|
|
47
|
+
Adapter rules for attached filesystem/exec environments:
|
|
40
48
|
|
|
41
49
|
- `Workspace.root` must equal `runtimeContext.runtimeCwd`.
|
|
42
50
|
- `Sandbox.runtimeContext.runtimeCwd` must equal the same value.
|
|
@@ -228,12 +236,17 @@ default this to the sibling `/data/pi-sessions` path when the env var is absent.
|
|
|
228
236
|
|
|
229
237
|
## Adding a custom runtime mode
|
|
230
238
|
|
|
231
|
-
A mode is a `RuntimeModeAdapter` (defined in
|
|
232
|
-
There is no registry to edit: pass your adapter
|
|
233
|
-
option to `createAgentApp(opts)` or
|
|
234
|
-
precedence over
|
|
235
|
-
`registerAgentRoutes.ts`).
|
|
236
|
-
throws for unknown ids,
|
|
239
|
+
A boring-bash-active mode is a `RuntimeModeAdapter` (defined in
|
|
240
|
+
`src/server/runtime/mode.ts`). There is no registry to edit: pass your adapter
|
|
241
|
+
as the `runtimeModeAdapter` option to `createAgentApp(opts)` or
|
|
242
|
+
`registerAgentRoutes(app, opts)` — it takes precedence over
|
|
243
|
+
`mode`/auto-detection (`createAgentApp.ts`, `registerAgentRoutes.ts`).
|
|
244
|
+
`resolveMode()` only knows the three built-ins and throws for unknown ids,
|
|
245
|
+
telling you to pass `runtimeModeAdapter`.
|
|
246
|
+
|
|
247
|
+
This interface is for environments that intentionally provide a workspace,
|
|
248
|
+
filesystem/search, and sandbox/execution substrate. Pure `runtime: 'none'`
|
|
249
|
+
agents do not construct a `RuntimeBundle`.
|
|
237
250
|
|
|
238
251
|
```ts
|
|
239
252
|
interface RuntimeModeAdapter {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hachej/boring-agent",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.65",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Pane-embeddable coding agent. Ships direct/local/vercel-sandbox execution modes behind one interface.",
|
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
"types": "./dist/shared/index.d.ts",
|
|
19
19
|
"import": "./dist/shared/index.js"
|
|
20
20
|
},
|
|
21
|
+
"./core": {
|
|
22
|
+
"types": "./dist/core/index.d.ts",
|
|
23
|
+
"import": "./dist/core/index.js"
|
|
24
|
+
},
|
|
21
25
|
"./server": {
|
|
22
26
|
"types": "./dist/server/index.d.ts",
|
|
23
27
|
"import": "./dist/server/index.js",
|
|
@@ -42,57 +46,58 @@
|
|
|
42
46
|
],
|
|
43
47
|
"dependencies": {
|
|
44
48
|
"@mariozechner/pi-coding-agent": "npm:@earendil-works/pi-coding-agent@0.75.5",
|
|
45
|
-
"@
|
|
46
|
-
"@radix-ui/react-
|
|
47
|
-
"@radix-ui/react-
|
|
48
|
-
"@radix-ui/react-
|
|
49
|
-
"@radix-ui/react-
|
|
50
|
-
"@radix-ui/react-
|
|
51
|
-
"@radix-ui/react-
|
|
52
|
-
"@radix-ui/react-
|
|
53
|
-
"@radix-ui/react-
|
|
49
|
+
"@modelcontextprotocol/sdk": "1.29.0",
|
|
50
|
+
"@radix-ui/react-collapsible": "^1.1.14",
|
|
51
|
+
"@radix-ui/react-dialog": "^1.1.17",
|
|
52
|
+
"@radix-ui/react-dropdown-menu": "^2.1.18",
|
|
53
|
+
"@radix-ui/react-hover-card": "^1.1.17",
|
|
54
|
+
"@radix-ui/react-select": "^2.3.1",
|
|
55
|
+
"@radix-ui/react-separator": "^1.1.10",
|
|
56
|
+
"@radix-ui/react-slot": "^1.3.0",
|
|
57
|
+
"@radix-ui/react-tooltip": "^1.2.10",
|
|
58
|
+
"@radix-ui/react-use-controllable-state": "^1.2.3",
|
|
54
59
|
"@streamdown/cjk": "^1.0.3",
|
|
55
60
|
"@streamdown/code": "^1.1.1",
|
|
56
61
|
"@streamdown/math": "^1.0.2",
|
|
57
62
|
"@streamdown/mermaid": "^1.0.2",
|
|
58
|
-
"@tanstack/react-query": "^5.
|
|
59
|
-
"@vercel/blob": "^2.
|
|
60
|
-
"@vercel/sandbox": "2.
|
|
61
|
-
"ai": "^
|
|
62
|
-
"chokidar": "^
|
|
63
|
+
"@tanstack/react-query": "^5.101.1",
|
|
64
|
+
"@vercel/blob": "^2.5.0",
|
|
65
|
+
"@vercel/sandbox": "2.2.1",
|
|
66
|
+
"ai": "^7.0.2",
|
|
67
|
+
"chokidar": "^5.0.0",
|
|
63
68
|
"class-variance-authority": "^0.7.1",
|
|
64
69
|
"clsx": "^2.1.1",
|
|
65
70
|
"cmdk": "^1.1.1",
|
|
66
71
|
"diff": "^9.0.0",
|
|
67
|
-
"fastify": "^5.
|
|
68
|
-
"lucide-react": "^1.
|
|
69
|
-
"motion": "^12.
|
|
70
|
-
"nanoid": "^5.1.
|
|
71
|
-
"shiki": "^4.0
|
|
72
|
+
"fastify": "^5.9.0",
|
|
73
|
+
"lucide-react": "^1.21.0",
|
|
74
|
+
"motion": "^12.42.0",
|
|
75
|
+
"nanoid": "^5.1.16",
|
|
76
|
+
"shiki": "^4.3.0",
|
|
72
77
|
"streamdown": "^2.5.0",
|
|
73
78
|
"tailwind-merge": "^3.5.0",
|
|
74
|
-
"use-stick-to-bottom": "^1.1.
|
|
75
|
-
"yaml": "^2.
|
|
79
|
+
"use-stick-to-bottom": "^1.1.6",
|
|
80
|
+
"yaml": "^2.9.0",
|
|
76
81
|
"zod": "^3.25.76",
|
|
77
|
-
"@hachej/boring-ui-kit": "0.1.
|
|
82
|
+
"@hachej/boring-ui-kit": "0.1.65"
|
|
78
83
|
},
|
|
79
84
|
"devDependencies": {
|
|
80
|
-
"@antithesishq/bombadil": "0.
|
|
85
|
+
"@antithesishq/bombadil": "0.6.1",
|
|
81
86
|
"@opentelemetry/api": "^1.9.1",
|
|
82
|
-
"@tailwindcss/postcss": "^4.
|
|
83
|
-
"@types/node": "^22.
|
|
84
|
-
"@types/react": "^19.
|
|
87
|
+
"@tailwindcss/postcss": "^4.3.1",
|
|
88
|
+
"@types/node": "^22.20.0",
|
|
89
|
+
"@types/react": "^19.2.17",
|
|
85
90
|
"@types/react-dom": "^19.1.3",
|
|
86
91
|
"@vitejs/plugin-react": "^4.7.0",
|
|
87
|
-
"ajv": "^8.
|
|
88
|
-
"postcss": "^8.5.
|
|
89
|
-
"react": "^19.
|
|
90
|
-
"react-dom": "^19.
|
|
92
|
+
"ajv": "^8.20.0",
|
|
93
|
+
"postcss": "^8.5.15",
|
|
94
|
+
"react": "^19.2.7",
|
|
95
|
+
"react-dom": "^19.2.7",
|
|
91
96
|
"tsup": "^8.4.0",
|
|
92
|
-
"tsx": "^4.
|
|
93
|
-
"typescript": "^
|
|
97
|
+
"tsx": "^4.22.4",
|
|
98
|
+
"typescript": "^6.0.3",
|
|
94
99
|
"vite": "^6.3.3",
|
|
95
|
-
"vitest": "^
|
|
100
|
+
"vitest": "^4.1.9"
|
|
96
101
|
},
|
|
97
102
|
"peerDependencies": {
|
|
98
103
|
"react": "^18.0.0 || ^19.0.0",
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
interface SessionStore {
|
|
2
|
-
list(ctx: SessionCtx, options?: SessionListOptions): Promise<SessionSummary[]>;
|
|
3
|
-
create(ctx: SessionCtx, init?: {
|
|
4
|
-
title?: string;
|
|
5
|
-
}): Promise<SessionSummary>;
|
|
6
|
-
load(ctx: SessionCtx, sessionId: string): Promise<SessionDetail>;
|
|
7
|
-
delete(ctx: SessionCtx, sessionId: string): Promise<void>;
|
|
8
|
-
}
|
|
9
|
-
interface SessionCtx {
|
|
10
|
-
workspaceId: string;
|
|
11
|
-
userId?: string;
|
|
12
|
-
}
|
|
13
|
-
interface SessionListOptions {
|
|
14
|
-
limit?: number;
|
|
15
|
-
offset?: number;
|
|
16
|
-
includeId?: string;
|
|
17
|
-
}
|
|
18
|
-
interface SessionSummary {
|
|
19
|
-
id: string;
|
|
20
|
-
title: string;
|
|
21
|
-
createdAt: string;
|
|
22
|
-
updatedAt: string;
|
|
23
|
-
turnCount: number;
|
|
24
|
-
}
|
|
25
|
-
type SessionDetail = SessionSummary;
|
|
26
|
-
|
|
27
|
-
type ThinkingLevel = 'off' | 'low' | 'medium' | 'high';
|
|
28
|
-
interface ChatModelSelection {
|
|
29
|
-
provider: string;
|
|
30
|
-
id: string;
|
|
31
|
-
}
|
|
32
|
-
interface ChatAttachmentPayload {
|
|
33
|
-
filename?: string;
|
|
34
|
-
mediaType?: string;
|
|
35
|
-
url: string;
|
|
36
|
-
/** Workspace-relative path when the browser upload endpoint persisted the attachment. */
|
|
37
|
-
path?: string;
|
|
38
|
-
}
|
|
39
|
-
interface ChatSubmitPayload {
|
|
40
|
-
message: string;
|
|
41
|
-
displayMessage?: string;
|
|
42
|
-
clientNonce: string;
|
|
43
|
-
model?: ChatModelSelection;
|
|
44
|
-
thinkingLevel?: ThinkingLevel;
|
|
45
|
-
attachments?: ChatAttachmentPayload[];
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export type { ChatAttachmentPayload as C, SessionCtx as S, ThinkingLevel as T, ChatModelSelection as a, ChatSubmitPayload as b, SessionDetail as c, SessionStore as d, SessionSummary as e };
|