@dynamicagents/plugins 0.12.0 → 0.13.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.
Files changed (130) hide show
  1. package/README.md +58 -77
  2. package/dist/browser/index.d.ts +0 -2
  3. package/dist/browser/index.js +21 -27
  4. package/dist/claude-code/cards.d.ts +53 -0
  5. package/dist/claude-code/cards.js +272 -0
  6. package/dist/claude-code/config.d.ts +28 -63
  7. package/dist/claude-code/config.js +0 -11
  8. package/dist/claude-code/egress.d.ts +8 -1
  9. package/dist/claude-code/egress.js +42 -4
  10. package/dist/claude-code/events.d.ts +106 -9
  11. package/dist/claude-code/events.js +201 -56
  12. package/dist/claude-code/github.d.ts +39 -0
  13. package/dist/claude-code/github.js +82 -0
  14. package/dist/claude-code/index.d.ts +16 -90
  15. package/dist/claude-code/index.js +14 -276
  16. package/dist/claude-code/model.d.ts +152 -0
  17. package/dist/claude-code/model.js +342 -0
  18. package/dist/claude-code/run.d.ts +209 -112
  19. package/dist/claude-code/run.js +339 -138
  20. package/dist/claude-code/session.d.ts +131 -0
  21. package/dist/claude-code/session.js +285 -0
  22. package/dist/claude-code/spec.d.ts +46 -0
  23. package/dist/claude-code/spec.js +83 -0
  24. package/dist/claude-code/verified.d.ts +15 -0
  25. package/dist/claude-code/verified.js +15 -0
  26. package/dist/computer/context.d.ts +1 -5
  27. package/dist/computer/context.js +7 -10
  28. package/dist/computer/file-lock.js +5 -4
  29. package/dist/computer/gate.d.ts +4 -4
  30. package/dist/computer/gate.js +5 -5
  31. package/dist/computer/index.d.ts +40 -258
  32. package/dist/computer/index.js +71 -324
  33. package/dist/computer/paths.d.ts +36 -16
  34. package/dist/computer/paths.js +42 -29
  35. package/dist/computer/proxy.d.ts +45 -0
  36. package/dist/computer/proxy.js +234 -0
  37. package/dist/computer/render.d.ts +1 -40
  38. package/dist/computer/render.js +2 -68
  39. package/dist/computer/tools-exec.js +12 -13
  40. package/dist/computer/tools-file.d.ts +9 -1
  41. package/dist/computer/tools-file.js +22 -82
  42. package/dist/computer/{tools-find.d.ts → tools-grep.d.ts} +1 -1
  43. package/dist/computer/tools-grep.js +129 -0
  44. package/dist/repo/checkout.d.ts +4 -5
  45. package/dist/repo/checkout.js +31 -8
  46. package/dist/repo/context.d.ts +35 -9
  47. package/dist/repo/context.js +101 -49
  48. package/dist/repo/index.d.ts +73 -28
  49. package/dist/repo/index.js +112 -96
  50. package/dist/repo/tools-checks.d.ts +3 -0
  51. package/dist/repo/tools-checks.js +112 -0
  52. package/dist/repo/tools-clone.js +1 -1
  53. package/dist/repo/tools-pr.d.ts +14 -0
  54. package/dist/repo/{tools-forge.js → tools-pr.js} +53 -36
  55. package/dist/repo/tools-review.d.ts +9 -0
  56. package/dist/repo/tools-review.js +67 -47
  57. package/dist/repo/tools-worktree.js +144 -60
  58. package/dist/repo/tools-worktrees.d.ts +12 -0
  59. package/dist/repo/tools-worktrees.js +48 -0
  60. package/dist/repo/url.d.ts +2 -2
  61. package/dist/repo/url.js +7 -7
  62. package/dist/scratch/index.d.ts +4 -4
  63. package/dist/scratch/index.js +12 -11
  64. package/dist/{computer → workspace}/advisory.d.ts +4 -4
  65. package/dist/{computer → workspace}/advisory.js +2 -2
  66. package/dist/{computer/host → workspace}/ca-trust.d.ts +8 -1
  67. package/dist/{computer/host → workspace}/ca-trust.js +12 -3
  68. package/dist/{computer/host → workspace}/container-fault.d.ts +3 -3
  69. package/dist/{computer/host → workspace}/container-fault.js +23 -8
  70. package/dist/workspace/exec.d.ts +94 -0
  71. package/dist/workspace/exec.js +153 -0
  72. package/dist/workspace/format.d.ts +36 -0
  73. package/dist/workspace/format.js +57 -0
  74. package/dist/{computer/host → workspace}/git-host.d.ts +21 -4
  75. package/dist/{computer/host → workspace}/git-host.js +72 -2
  76. package/dist/{computer/host → workspace}/git-identity.d.ts +1 -1
  77. package/dist/{computer/host → workspace}/git-identity.js +1 -1
  78. package/dist/workspace/index.d.ts +43 -47
  79. package/dist/workspace/index.js +52 -112
  80. package/dist/{computer/host → workspace}/install-job.d.ts +4 -4
  81. package/dist/{computer/host → workspace}/install-job.js +276 -176
  82. package/dist/{computer → workspace}/install.d.ts +8 -8
  83. package/dist/{computer → workspace}/install.js +3 -3
  84. package/dist/{computer/host/workspace.d.ts → workspace/object.d.ts} +105 -27
  85. package/dist/{computer/host/workspace.js → workspace/object.js} +217 -48
  86. package/dist/workspace/open.d.ts +95 -0
  87. package/dist/workspace/open.js +63 -0
  88. package/dist/workspace/read.d.ts +16 -0
  89. package/dist/workspace/read.js +22 -0
  90. package/dist/{computer → workspace}/shell.d.ts +5 -5
  91. package/dist/{computer → workspace}/shell.js +6 -6
  92. package/dist/{computer/host → workspace}/wake.d.ts +1 -1
  93. package/package.json +16 -36
  94. package/dist/arc-agi/analysis.d.ts +0 -322
  95. package/dist/arc-agi/analysis.js +0 -802
  96. package/dist/arc-agi/client.d.ts +0 -82
  97. package/dist/arc-agi/client.js +0 -113
  98. package/dist/arc-agi/game-tools.d.ts +0 -24
  99. package/dist/arc-agi/game-tools.js +0 -26
  100. package/dist/arc-agi/index.d.ts +0 -40
  101. package/dist/arc-agi/index.js +0 -175
  102. package/dist/arc-agi/main-agent.d.ts +0 -24
  103. package/dist/arc-agi/main-agent.js +0 -62
  104. package/dist/arc-agi/recipe.d.ts +0 -48
  105. package/dist/arc-agi/recipe.js +0 -97
  106. package/dist/arc-agi/scorecard.d.ts +0 -118
  107. package/dist/arc-agi/scorecard.js +0 -163
  108. package/dist/arc-agi/soul.d.ts +0 -29
  109. package/dist/arc-agi/soul.js +0 -79
  110. package/dist/arc-agi/store.d.ts +0 -153
  111. package/dist/arc-agi/store.js +0 -215
  112. package/dist/arc-agi/tools.d.ts +0 -36
  113. package/dist/arc-agi/tools.js +0 -574
  114. package/dist/arc-agi/types.d.ts +0 -211
  115. package/dist/arc-agi/types.js +0 -19
  116. package/dist/claude-code/recipe.d.ts +0 -53
  117. package/dist/claude-code/recipe.js +0 -100
  118. package/dist/computer/read.d.ts +0 -133
  119. package/dist/computer/read.js +0 -200
  120. package/dist/computer/tools-find.js +0 -216
  121. package/dist/recall/index.d.ts +0 -105
  122. package/dist/recall/index.js +0 -181
  123. package/dist/repo/tools-forge.d.ts +0 -4
  124. package/dist/triage/index.d.ts +0 -360
  125. package/dist/triage/index.js +0 -311
  126. /package/dist/{computer/host → workspace}/container-deps.d.ts +0 -0
  127. /package/dist/{computer/host → workspace}/container-deps.js +0 -0
  128. /package/dist/{computer/host → workspace}/sync.d.ts +0 -0
  129. /package/dist/{computer/host → workspace}/sync.js +0 -0
  130. /package/dist/{computer/host → workspace}/wake.js +0 -0
@@ -10,7 +10,7 @@
10
10
  *
11
11
  * ## Why this exists at all
12
12
  *
13
- * The alternative is a sentence in the subagent's soul — "install dependencies
13
+ * The alternative is a sentence in the sub-agent's soul — "install dependencies
14
14
  * before you do anything else" — and a standard with no command attached is one a
15
15
  * model satisfies with whichever check is cheapest: edit a README, run
16
16
  * `prettier --check` on that one file, report the change verified, and never run
@@ -36,16 +36,16 @@ export interface InstallProbe {
36
36
  * Where the install has got to, as the host reports it and the tools read it.
37
37
  *
38
38
  * Declared here rather than in the host because both sides depend on it and
39
- * neither owns the other: the Durable Object runs the job, and `sb_exec` refuses
39
+ * neither owns the other: the Durable Object runs the job, and `bash` refuses
40
40
  * to run against a tree that is still being built. A shape they agreed on
41
41
  * informally would drift, and the drift would show up as a shell command running
42
42
  * halfway through an `npm ci`.
43
43
  *
44
- * ## Why it is core's `JobState` with one field intersected in
44
+ * ## Why it is the host's `JobState` with one field intersected in
45
45
  *
46
- * Core owns the *choreography* around a job a Durable Object drives through its
47
- * alarm — arming, the single-flight guard, the staleness bound, the generation
48
- * marker a drain checks before it writes. This package owns what an install
46
+ * Core's `/job` owns the *choreography* around a job a Durable Object drives
47
+ * through its alarm — arming, the single-flight guard, the staleness bound, the
48
+ * generation a drain writes under. This package owns what an install
49
49
  * specifically **is**: which package manager, which lockfile, what counts as
50
50
  * skippable. Splitting them along that line is what lets a second job on the
51
51
  * same object — a coding-agent run, say — reuse every rule without inheriting
@@ -146,7 +146,7 @@ export declare function resolveInstallCommand(fs: InstallProbe, dir: string, pla
146
146
  * from `pnpm@9` to `pnpm@10`, or add a dependency without regenerating the lock,
147
147
  * and every one of those changes what an install produces while leaving the
148
148
  * lockfile byte-identical. Hashing the lockfile alone calls that a match, skips
149
- * the install, and hands the subagent a `node_modules` that is quietly wrong —
149
+ * the install, and hands the agent a `node_modules` that is quietly wrong —
150
150
  * which surfaces as a missing module in a build, three tool calls later, with
151
151
  * nothing pointing back at the install that never ran.
152
152
  *
@@ -184,6 +184,6 @@ export declare function resolveInstallCommand(fs: InstallProbe, dir: string, pla
184
184
  * A matching fingerprint means "the same install would produce the same tree".
185
185
  * It does **not** mean the tree is there: it is on the container's disk, and
186
186
  * goes with the container. The caller also needs a record that this container
187
- * finished it — see `./host/install-job.ts`.
187
+ * finished it — see `./install-job.ts`.
188
188
  */
189
189
  export declare function installFingerprint(fs: InstallProbe, dir: string, resolution: InstallResolution): Promise<string | null>;
@@ -10,7 +10,7 @@
10
10
  *
11
11
  * ## Why this exists at all
12
12
  *
13
- * The alternative is a sentence in the subagent's soul — "install dependencies
13
+ * The alternative is a sentence in the sub-agent's soul — "install dependencies
14
14
  * before you do anything else" — and a standard with no command attached is one a
15
15
  * model satisfies with whichever check is cheapest: edit a README, run
16
16
  * `prettier --check` on that one file, report the change verified, and never run
@@ -221,7 +221,7 @@ async function firstPresent(fs, dir, names) {
221
221
  * from `pnpm@9` to `pnpm@10`, or add a dependency without regenerating the lock,
222
222
  * and every one of those changes what an install produces while leaving the
223
223
  * lockfile byte-identical. Hashing the lockfile alone calls that a match, skips
224
- * the install, and hands the subagent a `node_modules` that is quietly wrong —
224
+ * the install, and hands the agent a `node_modules` that is quietly wrong —
225
225
  * which surfaces as a missing module in a build, three tool calls later, with
226
226
  * nothing pointing back at the install that never ran.
227
227
  *
@@ -259,7 +259,7 @@ async function firstPresent(fs, dir, names) {
259
259
  * A matching fingerprint means "the same install would produce the same tree".
260
260
  * It does **not** mean the tree is there: it is on the container's disk, and
261
261
  * goes with the container. The caller also needs a record that this container
262
- * finished it — see `./host/install-job.ts`.
262
+ * finished it — see `./install-job.ts`.
263
263
  */
264
264
  export async function installFingerprint(fs, dir, resolution) {
265
265
  if (resolution.kind !== "run")
@@ -1,9 +1,9 @@
1
1
  import { DurableObject } from "cloudflare:workers";
2
2
  import { type WorkspaceEgressPolicy, type WorkspaceStub } from "@cloudflare/computer";
3
- import { CloudflareContainerBackend } from "@cloudflare/computer/backends/container";
4
- import { type WorkspaceAdvisory } from "../advisory.js";
5
- import type { InstallPlan, InstallState } from "../install.js";
6
- import type { RepoGitResult } from "../../repo/index.js";
3
+ import { ContainerBackend, type ContainerInstanceSize } from "@cloudflare/computer/backends/container";
4
+ import { type WorkspaceAdvisory } from "./advisory.js";
5
+ import type { InstallPlan, InstallState } from "./install.js";
6
+ import type { RepoGitResult } from "../repo/index.js";
7
7
  /**
8
8
  * A workspace: one Durable Object, one container, one repository.
9
9
  *
@@ -16,7 +16,7 @@ import type { RepoGitResult } from "../../repo/index.js";
16
16
  * A directory inside the plugin rather than a subpath beside it, so that one
17
17
  * capability stays one import path and a consumer cannot take the tools without
18
18
  * the object they address. The bundle cost of that is nothing: `sideEffects` is
19
- * false, so an agent that only calls `sb_exec` carries no container backend and
19
+ * false, so an agent that only calls `bash` carries no container backend and
20
20
  * no isomorphic-git.
21
21
  *
22
22
  * What this file must not do is import the plugin barrel. The barrel re-exports
@@ -29,7 +29,7 @@ import type { RepoGitResult } from "../../repo/index.js";
29
29
  * FUSE at `/workspace`. Commands run against the same tree the Worker reads over
30
30
  * RPC, and the tree outlives the container.
31
31
  *
32
- * **One repository per object**, because `computer` is strictly 1 DO ↔ 1
32
+ * **One repository per object**, because `@cloudflare/computer` is strictly 1 DO ↔ 1
33
33
  * container: the id derives from caller *and* repository (see `workspaceName`),
34
34
  * so two repositories for one caller are two objects and two containers.
35
35
  *
@@ -52,7 +52,7 @@ import type { RepoGitResult } from "../../repo/index.js";
52
52
  * - `./sync.ts` — the host's half of syncing, which nothing else will do.
53
53
  * - `./ca-trust.ts` — making a container able to speak TLS.
54
54
  * - `./git-identity.ts` — who a container's commits belong to.
55
- * - `./git-host.ts` — the operations that hold the forge credential.
55
+ * - `./git-host.ts` — the operations that hold the GitHub credential.
56
56
  *
57
57
  * Each takes a small explicit seam, and that is the test: a module that needed
58
58
  * the whole object back would be a module that did not want extracting.
@@ -63,7 +63,7 @@ export declare const WORKSPACE_DIR = "/workspace";
63
63
  * The Durable Object name for one caller's checkout of one repository.
64
64
  *
65
65
  * Exported because several places must agree on it and none can see the others:
66
- * the plugin that resolves the stub, the agent that hands it down to subagents,
66
+ * the plugin that resolves the stub, the agent that hands it down to sub-agents,
67
67
  * and the cancellation path. A pipe rather than a slash, so the caller half
68
68
  * cannot forge a repository boundary by containing one.
69
69
  *
@@ -76,10 +76,23 @@ export declare const WORKSPACE_DIR = "/workspace";
76
76
  *
77
77
  * `repo` is not always a repository. A host may pass a sentinel through here as
78
78
  * one — a scratchpad is modelled that way, which is what keys it to its own
79
- * object and its own container. Anything that is not a forge name works, as long
79
+ * object and its own container. Anything that is not a GitHub name works, as long
80
80
  * as no caller could clone something that collides with it.
81
81
  */
82
82
  export declare function workspaceName(callerKey: string, repo?: string): string;
83
+ /**
84
+ * How long a workspace survives without being used.
85
+ *
86
+ * A Durable Object is **never** reclaimed by the platform, and a namespace
87
+ * cannot be enumerated from a Worker, so nothing else is coming to clean up.
88
+ * Source-only workspaces are small (6.3 MB for slack-gatekeeper), which makes
89
+ * this hygiene rather than cost control — but unbounded hygiene is still
90
+ * unbounded.
91
+ *
92
+ * Exported because a host keeping work in a workspace has to say how long that
93
+ * work survives untouched.
94
+ */
95
+ export declare const IDLE_RECLAIM_MS: number;
83
96
  /**
84
97
  * `work`, refused once `ms` pass without it settling. The work itself goes on;
85
98
  * only the wait for it ends — see {@link READY_DEADLINE_MS}.
@@ -97,16 +110,15 @@ declare class WorkspaceContainerHost extends DurableObject<Cloudflare.Env> {
97
110
  }
98
111
  /**
99
112
  * `withWorkspaceContainer` adds one method, `getWorkspaceContainer()`, over
100
- * `this.ctx.container` — the runtime's own container handle. There is no
101
- * `@cloudflare/containers` `Container` subclass here and so no `sleepAfter`:
102
- * idle shutdown is this object's job, and it lands on the wake map with
103
- * everything else.
113
+ * `this.ctx.container` — the runtime's own container handle, started with the
114
+ * image and instance size this object asks for. Stopping it is this object's
115
+ * job — see {@link CONTAINER_IDLE_MS}.
104
116
  */
105
117
  declare const WorkspaceContainerBase: typeof WorkspaceContainerHost & (new (...args: any[]) => WorkspaceContainerHost & {
106
118
  getWorkspaceContainer(): import("@cloudflare/computer/backends/container").WorkspaceContainerAPI;
107
119
  });
108
120
  /**
109
- * The forge credential, and who a commit made on this side is attributed to.
121
+ * The GitHub credential, and who a commit made on this side is attributed to.
110
122
  *
111
123
  * Config rather than an env read, because this class cannot name a consumer's
112
124
  * ambient `Env` — it is an interface `wrangler types` generates into *their*
@@ -120,7 +132,7 @@ declare const WorkspaceContainerBase: typeof WorkspaceContainerHost & (new (...a
120
132
  */
121
133
  export interface WorkspaceGitConfig {
122
134
  /**
123
- * The **name** of the binding holding the forge credential — never the
135
+ * The **name** of the binding holding the GitHub credential — never the
124
136
  * credential itself.
125
137
  *
126
138
  * `workspaceConfig()` is an ordinary method on the prototype, and on a Durable
@@ -196,7 +208,7 @@ export interface WorkspaceObjectConfig {
196
208
  egress: WorkspaceEgressPolicy;
197
209
  /** How this deployment installs dependencies for this agent's checkouts. */
198
210
  installPlan: InstallPlan;
199
- /** Log prefix — `coder-workspace`, `claude-coder-workspace`. */
211
+ /** Log prefix — `coding-workspace`, `claude-coordinator-workspace`. */
200
212
  label: string;
201
213
  /**
202
214
  * How long this agent's container stays up after the last command **started**.
@@ -204,14 +216,23 @@ export interface WorkspaceObjectConfig {
204
216
  * A per-agent value because the invariant on {@link CONTAINER_IDLE_MS} — it
205
217
  * must exceed the longest command the shell allows — is an invariant about the
206
218
  * *agent*, and the two differ by a factor of four. The coder's longest command
207
- * is a tool call; `claude-coder`'s is a whole `claude -p` session that runs
219
+ * is a tool call; `claude-coordinator`'s is a whole `claude -p` session that runs
208
220
  * detached for its entire timeout.
209
221
  *
210
222
  * Omit it for the default. Raise it, never lower it, and raise it whenever the
211
223
  * agent's longest command grows.
212
224
  */
213
225
  containerIdleMs?: number;
214
- /** The forge credential and commit identity — see {@link WorkspaceGitConfig}. */
226
+ /**
227
+ * The size this agent's container starts at — a tier such as `standard-2`, or
228
+ * `{ vcpu, memoryMib, diskMb }`.
229
+ *
230
+ * Requested on every start, and part of what a running container is matched
231
+ * against: change it and the next connect replaces a container started at the
232
+ * old size. Which size, and why there is no default: {@link file://./README.md}.
233
+ */
234
+ instance: ContainerInstanceSize;
235
+ /** The GitHub credential and commit identity — see {@link WorkspaceGitConfig}. */
215
236
  git: WorkspaceGitConfig;
216
237
  }
217
238
  /**
@@ -219,14 +240,13 @@ export interface WorkspaceObjectConfig {
219
240
  *
220
241
  * Abstract because a Durable Object class takes no constructor arguments, so
221
242
  * per-agent configuration cannot arrive that way. {@link workspaceConfig} is the
222
- * seam, and it is the shape core's own `RecipeSubagentBase.subagentRuntime`
223
- * uses for exactly the same reason.
243
+ * seam, for the same reason Think's own hooks are methods rather than options.
224
244
  *
225
245
  * ## Why `backend` and `#workspace` are lazy
226
246
  *
227
247
  * **Base class fields run before subclass fields**, so as plain fields they
228
248
  * would read `undefined` from any `workspaceConfig()` that touches a subclass
229
- * field — which `ClaudeCoderWorkspaceDO`'s does, for its credential store.
249
+ * field — which `ClaudeCoordinatorWorkspace`'s does, for its credential store.
230
250
  * Memoised getters remove the hazard rather than documenting it, which is what
231
251
  * lets a subclass implement the seam however it likes.
232
252
  */
@@ -236,7 +256,7 @@ export declare abstract class WorkspaceObjectBase<TEnv extends Cloudflare.Env =
236
256
  * This Worker's bindings, as the host's own generated `Env` spells them.
237
257
  *
238
258
  * Re-declared rather than inherited so a subclass reading a binding of its own
239
- * — `claude-coder`'s reaches for its credential pool — gets its real type
259
+ * — `claude-coordinator`'s reaches for its credential pool — gets its real type
240
260
  * instead of the base's. `declare` because the field is the runtime's; this
241
261
  * only narrows what TypeScript believes about it.
242
262
  */
@@ -245,11 +265,11 @@ export declare abstract class WorkspaceObjectBase<TEnv extends Cloudflare.Env =
245
265
  * Everything this agent's workspace does differently. Called once, lazily.
246
266
  *
247
267
  * Read through {@link #cfg}, never directly: an implementation may build
248
- * something real — `claude-coder`'s constructs its egress gateway — and this
268
+ * something real — `claude-coordinator`'s constructs its egress gateway — and this
249
269
  * is consulted on the busiest path in the object.
250
270
  */
251
271
  protected abstract workspaceConfig(): WorkspaceObjectConfig;
252
- get backend(): CloudflareContainerBackend;
272
+ get backend(): ContainerBackend;
253
273
  /**
254
274
  * What `getWorkspace(stub)` calls from outside this object.
255
275
  *
@@ -270,11 +290,11 @@ export declare abstract class WorkspaceObjectBase<TEnv extends Cloudflare.Env =
270
290
  *
271
291
  * A stub cannot enforce what the caller does with it: `runtime.exec` on this
272
292
  * one would run against a container with no CA. The exec paths take the other
273
- * method — see `openWorkspaceFs` in `@dynamicagents/plugins/computer`.
293
+ * method — see `openWorkspaceFs` in `./open.ts`.
274
294
  */
275
295
  __getWorkspaceFsStub(): Promise<WorkspaceStub>;
276
296
  /**
277
- * Clone, fetch and push — the operations that need the forge token.
297
+ * Clone, fetch and push — the operations that need the GitHub token.
278
298
  *
279
299
  * The work is `./git-host.ts`, which owns why the credential stays on this
280
300
  * side of the boundary. What stays here is what only this object can do: the
@@ -300,6 +320,12 @@ export declare abstract class WorkspaceObjectBase<TEnv extends Cloudflare.Env =
300
320
  branch: string;
301
321
  allowedHosts: string[];
302
322
  }): Promise<RepoGitResult>;
323
+ /**
324
+ * A checkout's `origin`, from this object's storage. Starts no container and
325
+ * moves no deadline, like {@link checkoutDir}: a pull request polled for its
326
+ * review is not the workspace in use.
327
+ */
328
+ gitOrigin(dir: string): Promise<string | undefined>;
303
329
  /**
304
330
  * Start this checkout's dependency install, and return without waiting.
305
331
  *
@@ -311,6 +337,58 @@ export declare abstract class WorkspaceObjectBase<TEnv extends Cloudflare.Env =
311
337
  dir: string;
312
338
  repo?: string;
313
339
  }): Promise<InstallState>;
340
+ /**
341
+ * Stop the container, and **keep everything on disk**.
342
+ *
343
+ * The counterpart to {@link reclaimIfIdle}, and the difference is the whole
344
+ * reason both exist. A reclaim is for a workspace nobody wants again: it empties
345
+ * storage, so the checkout and the dependency tree go with the container. This is
346
+ * for a workspace that will be worked in again — the next task on the same
347
+ * repository has to skip the clone and the install, which is the cost the whole
348
+ * design is arranged around.
349
+ *
350
+ * **Why a caller needs this at all.** The idle deadline would eventually do it,
351
+ * but it cannot be tuned down to meet a cost target: `containerIdleMs` must
352
+ * exceed the longest command the agent allows, and a container that outlives its
353
+ * work by that much bills for the difference. So a host that knows the work is
354
+ * finished says so, and the deadline goes back to being a backstop for the case
355
+ * where nothing got to say anything.
356
+ *
357
+ * Deliberately does **not** touch: `#touch()` would push the very deadline this
358
+ * is standing in for.
359
+ *
360
+ * `released: false` means the container is still up and the standing deadline
361
+ * still owns it — an install is running, or a pull is still moving blocks. Both
362
+ * resolve themselves: the drain re-arms the deadline to come back and finish,
363
+ * which is the same path `#onContainerIdle` takes. Under a {@link hold} the
364
+ * release is deferred instead, to the last `unhold`.
365
+ */
366
+ releaseContainer(): Promise<{
367
+ released: boolean;
368
+ }>;
369
+ /**
370
+ * Keep the container up for work this object cannot see, until `untilMs` or
371
+ * {@link unhold}.
372
+ *
373
+ * A Claude Code session a host starts here runs detached: nothing calls in
374
+ * while it works, and the runtime cannot list
375
+ * what is running. So a host done with the workspace cannot tell that the
376
+ * container is not, and {@link releaseContainer} would stop the session with
377
+ * it. A hold is the host saying so. It defers a release; it is not use, so it
378
+ * does not touch, and the idle deadline already outlasts a session.
379
+ *
380
+ * `untilMs` bounds a hold whose `unhold` never comes — a run cut between its
381
+ * start and its end. Past it the hold is ignored.
382
+ */
383
+ hold(key: string, untilMs: number): Promise<void>;
384
+ /**
385
+ * The work a {@link hold} stood for is over. When it was the last hold, a
386
+ * release asked for while it stood happens now — unless the workspace was
387
+ * used since, in which case the next release is asked for by whoever used it.
388
+ */
389
+ unhold(key: string): Promise<{
390
+ released: boolean;
391
+ }>;
314
392
  /**
315
393
  * Throw this workspace away if nothing has touched it for `maxIdleMs`.
316
394
  *
@@ -375,7 +453,7 @@ export declare abstract class WorkspaceObjectBase<TEnv extends Cloudflare.Env =
375
453
  checkoutDir(): Promise<string | undefined>;
376
454
  /**
377
455
  * Everything currently true about this workspace that a caller must not assume
378
- * away — the array `sb_exec`, `sb_write` and `sb_edit` all consult.
456
+ * away — the array `bash`, `edit` and the workspace's writes all consult.
379
457
  *
380
458
  * The policy is not here. `deriveAdvisories` decides which facts matter and
381
459
  * how they are worded; this method gathers what only the object can see and