@dynamicagents/plugins 0.11.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -13
- package/dist/arc-agi/analysis.d.ts +16 -30
- package/dist/arc-agi/analysis.js +20 -47
- package/dist/arc-agi/client.d.ts +3 -2
- package/dist/arc-agi/game-tools.d.ts +5 -6
- package/dist/arc-agi/index.d.ts +6 -8
- package/dist/arc-agi/index.js +3 -3
- package/dist/arc-agi/main-agent.d.ts +5 -8
- package/dist/arc-agi/main-agent.js +5 -8
- package/dist/arc-agi/recipe.d.ts +17 -20
- package/dist/arc-agi/recipe.js +17 -20
- package/dist/arc-agi/soul.d.ts +16 -27
- package/dist/arc-agi/soul.js +16 -27
- package/dist/arc-agi/store.d.ts +4 -5
- package/dist/arc-agi/store.js +4 -5
- package/dist/arc-agi/tools.d.ts +1 -1
- package/dist/arc-agi/tools.js +26 -19
- package/dist/arc-agi/types.d.ts +6 -7
- package/dist/claude-code/config.d.ts +88 -11
- package/dist/claude-code/config.js +11 -2
- package/dist/claude-code/credentials.d.ts +21 -9
- package/dist/claude-code/credentials.js +43 -9
- package/dist/claude-code/egress.d.ts +7 -13
- package/dist/claude-code/egress.js +9 -10
- package/dist/claude-code/events.d.ts +47 -0
- package/dist/claude-code/events.js +96 -10
- package/dist/claude-code/index.d.ts +31 -13
- package/dist/claude-code/index.js +62 -15
- package/dist/claude-code/run.d.ts +135 -41
- package/dist/claude-code/run.js +366 -61
- package/dist/computer/advisory.d.ts +31 -18
- package/dist/computer/advisory.js +30 -5
- package/dist/computer/context.d.ts +23 -0
- package/dist/computer/context.js +225 -0
- package/dist/computer/file-lock.d.ts +5 -0
- package/dist/computer/file-lock.js +39 -0
- package/dist/computer/gate.d.ts +8 -8
- package/dist/computer/gate.js +7 -7
- package/dist/computer/host/ca-trust.d.ts +88 -0
- package/dist/computer/host/ca-trust.js +303 -0
- package/dist/computer/host/container-deps.d.ts +54 -0
- package/dist/computer/host/container-deps.js +224 -0
- package/dist/computer/host/container-fault.d.ts +38 -0
- package/dist/computer/host/container-fault.js +58 -0
- package/dist/computer/host/git-host.d.ts +62 -0
- package/dist/computer/host/git-host.js +156 -0
- package/dist/computer/host/git-identity.d.ts +57 -0
- package/dist/computer/host/git-identity.js +147 -0
- package/dist/computer/host/install-job.d.ts +121 -0
- package/dist/computer/host/install-job.js +766 -0
- package/dist/computer/host/sync.d.ts +111 -0
- package/dist/computer/host/sync.js +124 -0
- package/dist/computer/host/wake.d.ts +19 -0
- package/dist/computer/host/wake.js +10 -0
- package/dist/computer/host/workspace.d.ts +424 -0
- package/dist/computer/host/workspace.js +1258 -0
- package/dist/computer/index.d.ts +70 -50
- package/dist/computer/index.js +79 -767
- package/dist/computer/install.d.ts +8 -12
- package/dist/computer/install.js +6 -9
- package/dist/computer/paths.d.ts +21 -16
- package/dist/computer/paths.js +40 -38
- package/dist/computer/read.d.ts +18 -22
- package/dist/computer/read.js +24 -27
- package/dist/computer/render.d.ts +28 -0
- package/dist/computer/render.js +34 -1
- package/dist/computer/shell.d.ts +45 -0
- package/dist/computer/shell.js +80 -0
- package/dist/computer/tools-exec.d.ts +3 -0
- package/dist/computer/tools-exec.js +269 -0
- package/dist/computer/tools-file.d.ts +4 -0
- package/dist/computer/tools-file.js +124 -0
- package/dist/computer/tools-find.d.ts +3 -0
- package/dist/computer/tools-find.js +216 -0
- package/dist/recall/index.d.ts +9 -3
- package/dist/recall/index.js +22 -12
- package/dist/repo/checkout.d.ts +34 -4
- package/dist/repo/checkout.js +36 -1
- package/dist/repo/context.d.ts +109 -0
- package/dist/repo/context.js +530 -0
- package/dist/repo/index.d.ts +6 -29
- package/dist/repo/index.js +17 -1027
- package/dist/repo/tools-clone.d.ts +4 -0
- package/dist/repo/tools-clone.js +192 -0
- package/dist/repo/tools-forge.d.ts +4 -0
- package/dist/repo/tools-forge.js +179 -0
- package/dist/repo/tools-review.d.ts +3 -0
- package/dist/repo/tools-review.js +373 -0
- package/dist/repo/tools-worktree.d.ts +4 -0
- package/dist/repo/tools-worktree.js +221 -0
- package/dist/triage/index.d.ts +6 -1
- package/dist/triage/index.js +32 -23
- package/dist/workspace/index.d.ts +3 -3
- package/dist/workspace/index.js +3 -3
- package/package.json +21 -15
package/dist/computer/index.d.ts
CHANGED
|
@@ -15,18 +15,13 @@ import type { WorkspaceAdvisory } from "./advisory.js";
|
|
|
15
15
|
* filesystem plugin — an agent holding two gives the model no way to know which
|
|
16
16
|
* one a path refers to.
|
|
17
17
|
*
|
|
18
|
-
* ##
|
|
18
|
+
* ## The dependency tree is not in the workspace
|
|
19
19
|
*
|
|
20
|
-
* The one thing to internalise before reading further.
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* So dependencies live in the container and die with it, while source and `.git`
|
|
27
|
-
* are durable. Two consequences run through everything below: an install has to
|
|
28
|
-
* be re-run on a cold container, and `sb_read` cannot see a path under
|
|
29
|
-
* `node_modules` even though a shell in the same container can.
|
|
20
|
+
* The one thing to internalise before reading further. A package root's
|
|
21
|
+
* `node_modules` is a bind mount of the container's disk, so installs never
|
|
22
|
+
* sync, and a new container reinstalls — see `./host/container-deps.ts`. The file tools read
|
|
23
|
+
* the workspace, so they refuse it; `sb_exec` reaches it. `paths.ts` owns what a
|
|
24
|
+
* path may be and what walks drop.
|
|
30
25
|
*
|
|
31
26
|
* Requires the Workers **Paid** plan (containers) and a Durable Object binding
|
|
32
27
|
* whose class owns the workspace — see the README for the wrangler block.
|
|
@@ -49,8 +44,8 @@ export { DEFAULT_INSTALL_PLAN, installFingerprint, resolveInstallCommand, type I
|
|
|
49
44
|
* `verify:exports` treats `./computer` as one realm, and everything below stays
|
|
50
45
|
* inside `dist/computer/`.
|
|
51
46
|
*/
|
|
52
|
-
export {
|
|
53
|
-
export { cancelledNote, packBlocks, renderGrepMatches, renderResult, truncateOutput } from "./render.js";
|
|
47
|
+
export { isGitInternal, WALK_SKIPS } from "./paths.js";
|
|
48
|
+
export { cancelledNote, packBlocks, renderGrepMatches, renderResult, syncPendingNote, truncateOutput } from "./render.js";
|
|
54
49
|
export { execGate, needsDependencies, writeGate, type ExecGate } from "./gate.js";
|
|
55
50
|
/**
|
|
56
51
|
* The workspace-advisory vocabulary, which a host needs all of: the type to
|
|
@@ -97,6 +92,7 @@ export declare const WORKSPACE_RUNTIME_KEY = "workspaceName";
|
|
|
97
92
|
* is right there.
|
|
98
93
|
*/
|
|
99
94
|
export declare function workspaceNameFromRuntime(runtime: unknown): string | undefined;
|
|
95
|
+
export { withShell, withShellTranscript } from "./shell.js";
|
|
100
96
|
/**
|
|
101
97
|
* The Durable Object the workspace lives in, as this plugin needs to see it.
|
|
102
98
|
*
|
|
@@ -109,6 +105,19 @@ export declare function workspaceNameFromRuntime(runtime: unknown): string | und
|
|
|
109
105
|
*/
|
|
110
106
|
export interface WorkspaceHost extends Rpc.DurableObjectBranded {
|
|
111
107
|
__getWorkspaceStub(): Promise<WorkspaceStub>;
|
|
108
|
+
/**
|
|
109
|
+
* The same workspace for filesystem-only work, which the host must serve
|
|
110
|
+
* **without starting a container**.
|
|
111
|
+
*
|
|
112
|
+
* The filesystem is the Durable Object's own SQLite, while the first command
|
|
113
|
+
* in a fresh container waits for the whole tree to be pushed into it — so a
|
|
114
|
+
* file tool served the other way waits minutes for a local `readdir`. See
|
|
115
|
+
* `WorkspaceObjectBase.__getWorkspaceFsStub` in `./host/workspace.ts`.
|
|
116
|
+
*
|
|
117
|
+
* Required rather than optional, for the reason {@link advisories} gives. A
|
|
118
|
+
* host with nothing to distinguish returns its own `__getWorkspaceStub()`.
|
|
119
|
+
*/
|
|
120
|
+
__getWorkspaceFsStub(): Promise<WorkspaceStub>;
|
|
112
121
|
/**
|
|
113
122
|
* Everything currently true about the workspace that a caller must not assume
|
|
114
123
|
* away — see {@link file://./advisory.ts}. An empty array is the good case.
|
|
@@ -120,52 +129,33 @@ export interface WorkspaceHost extends Rpc.DurableObjectBranded {
|
|
|
120
129
|
* `node_modules`, or against a workspace whose writes are being dropped.
|
|
121
130
|
*
|
|
122
131
|
* `deriveAdvisories` builds the array from what the host already knows, so
|
|
123
|
-
* implementing this is gathering
|
|
132
|
+
* implementing this is gathering what the host has rather than writing policy.
|
|
124
133
|
*/
|
|
125
134
|
advisories(): Promise<readonly WorkspaceAdvisory[]>;
|
|
126
135
|
}
|
|
127
136
|
/**
|
|
128
|
-
*
|
|
129
|
-
* left as they are, or hand it back untouched when no shell is configured.
|
|
130
|
-
*
|
|
131
|
-
* This is the variant for a caller that **reads the result in code**: `stdout` is
|
|
132
|
-
* a data channel it compares or parses, and `stderr` is a separate diagnostic.
|
|
133
|
-
* {@link computerExec} is that caller, on behalf of `@dynamicagents/plugins/repo`,
|
|
134
|
-
* which asks git questions like `symbolic-ref --short refs/remotes/origin/HEAD`
|
|
135
|
-
* and `rev-list --count` and needs the answer alone.
|
|
137
|
+
* Open the workspace behind a Durable Object stub.
|
|
136
138
|
*
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
139
|
+
* The cast is unavoidable, and narrow enough to be worth isolating here rather
|
|
140
|
+
* than repeating. `getWorkspace` wants a handle whose `__getWorkspaceStub()`
|
|
141
|
+
* resolves to a `WorkspaceStub` — the concrete class, private fields and all.
|
|
142
|
+
* Across a Durable Object boundary Workers RPC hands back a structural
|
|
143
|
+
* `Stub<WorkspaceStub>`, which forwards every method faithfully but carries none
|
|
144
|
+
* of the class's private brand: runtime-compatible, type-incompatible. This is
|
|
145
|
+
* the only place in the plugin that gap is crossed.
|
|
143
146
|
*/
|
|
144
|
-
export declare function
|
|
147
|
+
export declare function openWorkspace(host: DurableObjectStub<WorkspaceHost>): Promise<WorkspaceClient>;
|
|
145
148
|
/**
|
|
146
|
-
*
|
|
147
|
-
* merged into one transcript, in the order they were written.
|
|
148
|
-
*
|
|
149
|
-
* This is the variant for a caller whose consumer is **a model reading output**.
|
|
150
|
-
* `sb_exec` is that caller. A project's check is a chain — `wrangler types &&
|
|
151
|
-
* prettier && eslint && tsc` — and *which tool spoke last* is how you know which
|
|
152
|
-
* one failed. A stdout block and a separate stderr block destroy that ordering,
|
|
153
|
-
* and a model that wants it back re-runs the whole gate as
|
|
154
|
-
* `npm run check > /tmp/out 2>&1; cat /tmp/out`. This is that workaround, done
|
|
155
|
-
* once, for free.
|
|
149
|
+
* The same workspace, opened for filesystem work alone.
|
|
156
150
|
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
* of its own.
|
|
151
|
+
* `getWorkspace` calls exactly one method on what it is handed, so the host is
|
|
152
|
+
* wrapped in an object answering it from the other side of the seam — see
|
|
153
|
+
* {@link WorkspaceHost.__getWorkspaceFsStub}. Everything past that is identical.
|
|
161
154
|
*
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
* That is not a gap: {@link renderResult} renders them as a labelled
|
|
165
|
-
* `--- stderr ---` block for exactly this case. The transcript is the better
|
|
166
|
-
* answer, not the only supported one.
|
|
155
|
+
* **Only the file tools take this.** `sb_exec` and {@link computerExec} need the
|
|
156
|
+
* container started and its CA installed, so they open it the other way.
|
|
167
157
|
*/
|
|
168
|
-
export declare function
|
|
158
|
+
export declare function openWorkspaceFs(host: DurableObjectStub<WorkspaceHost>): Promise<WorkspaceClient>;
|
|
169
159
|
export interface ComputerConfig {
|
|
170
160
|
/**
|
|
171
161
|
* The Durable Object namespace holding workspaces, closed over at
|
|
@@ -261,7 +251,16 @@ export interface ComputerConfig {
|
|
|
261
251
|
*/
|
|
262
252
|
env?: () => Record<string, string | undefined>;
|
|
263
253
|
}
|
|
264
|
-
|
|
254
|
+
/**
|
|
255
|
+
* @param workspace Opens the workspace for a command: container started, CA
|
|
256
|
+
* installed.
|
|
257
|
+
* @param fsWorkspace Opens it for the file tools, which touch nothing but the
|
|
258
|
+
* host's SQLite. Defaults to {@link workspace}, so a host with one way in
|
|
259
|
+
* behaves as before. See {@link openWorkspaceFs}.
|
|
260
|
+
* @param lockScope Names the workspace a write locks within — see
|
|
261
|
+
* {@link file://./file-lock.ts}. Defaults to this tool set alone.
|
|
262
|
+
*/
|
|
263
|
+
export declare function buildComputerTools(workspace: () => Promise<WorkspaceClient>, config: ComputerConfig, advisories?: () => Promise<readonly WorkspaceAdvisory[]>, fsWorkspace?: () => Promise<WorkspaceClient>, lockScope?: () => string): ToolSet;
|
|
265
264
|
/**
|
|
266
265
|
* An `exec` bound to this workspace, for plugins that need a shell but should
|
|
267
266
|
* not own a container.
|
|
@@ -309,3 +308,24 @@ export declare function computerExec(config: ComputerConfig): (command: string,
|
|
|
309
308
|
exitCode: number;
|
|
310
309
|
}>;
|
|
311
310
|
export declare function computer(config: ComputerConfig): AgentPlugin;
|
|
311
|
+
/**
|
|
312
|
+
* The Durable Object everything above talks to.
|
|
313
|
+
*
|
|
314
|
+
* `./host/` is a directory rather than a subpath of its own, and that is the
|
|
315
|
+
* point: one capability is one import path, so a consumer cannot install the
|
|
316
|
+
* tools and miss the object they address. The two halves have opposite bundle
|
|
317
|
+
* costs — an agent that only calls `sb_exec` carries no container backend and no
|
|
318
|
+
* isomorphic-git — and `"sideEffects": false` is what keeps that true, since
|
|
319
|
+
* nothing here references the host unless the consumer does.
|
|
320
|
+
*
|
|
321
|
+
* The dependency runs one way for a mechanical reason: `./host/` imports the
|
|
322
|
+
* leaf modules beside this file, never this barrel, because this barrel
|
|
323
|
+
* re-exports `./host/` and a cycle through a module that builds a class at
|
|
324
|
+
* import time is a base that evaluates `undefined`.
|
|
325
|
+
*/
|
|
326
|
+
export { WorkspaceObjectBase, WORKSPACE_DIR, workspaceName, type WorkspaceObjectConfig, type WorkspaceGitConfig } from "./host/workspace.js";
|
|
327
|
+
export { InstallJob, type InstallJobDeps } from "./host/install-job.js";
|
|
328
|
+
export { WorkspaceSync, SYNC_DRAIN_BUDGET_MS, SYNC_DRAIN_RESUME_MS, SYNC_DRAIN_MAX_BACKOFF_MS, syncRetryDelayMs, type DrainOutcome, type SyncDrainIntent, type WorkspaceSyncDeps } from "./host/sync.js";
|
|
329
|
+
export { ContainerTrust, TRUST_CA_COMMAND, type ContainerTrustDeps } from "./host/ca-trust.js";
|
|
330
|
+
export { WorkspaceGitHost, type GitHostDeps } from "./host/git-host.js";
|
|
331
|
+
export type { WorkspaceWakeHandlers } from "./host/wake.js";
|