operon-agents-core 0.1.0-alpha.2 → 0.1.0-alpha.21

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 (289) hide show
  1. package/dist/agent/agent.d.ts +8 -7
  2. package/dist/agent/compose-hooks.d.ts +10 -1
  3. package/dist/agent/compose-hooks.js +61 -6
  4. package/dist/agent/concurrency.js +1 -1
  5. package/dist/agent/context-report.d.ts +2 -2
  6. package/dist/agent/durable-state.d.ts +22 -0
  7. package/dist/agent/durable-state.js +54 -0
  8. package/dist/agent/index.d.ts +2 -2
  9. package/dist/agent/index.js +1 -1
  10. package/dist/agent/instruction-context.d.ts +6 -6
  11. package/dist/agent/instruction-context.js +23 -23
  12. package/dist/agent/profile-builtins.js +1 -1
  13. package/dist/agent/run-support.d.ts +1 -1
  14. package/dist/agent/run-support.js +6 -5
  15. package/dist/agent/runner.d.ts +25 -22
  16. package/dist/agent/runner.js +217 -121
  17. package/dist/agent/session.d.ts +262 -156
  18. package/dist/agent/session.js +590 -418
  19. package/dist/agent/subagent-tools.js +3 -3
  20. package/dist/agent/subagent.js +28 -13
  21. package/dist/agent/toolset.d.ts +1 -0
  22. package/dist/agent/toolset.js +13 -7
  23. package/dist/agent/workflow/journal.d.ts +2 -2
  24. package/dist/agent/workflow/journal.js +2 -2
  25. package/dist/agent/workflow/manager.d.ts +1 -1
  26. package/dist/agent/workflow/manager.js +1 -1
  27. package/dist/agent/workflow/prompt.js +2 -2
  28. package/dist/agent/workflow/sandbox.d.ts +1 -1
  29. package/dist/agent/workflow/sandbox.js +1 -1
  30. package/dist/agent/workflow/tool.js +30 -43
  31. package/dist/agent/worktree.d.ts +8 -8
  32. package/dist/agent/worktree.js +15 -15
  33. package/dist/capabilities/assembler.d.ts +29 -5
  34. package/dist/capabilities/assembler.js +85 -9
  35. package/dist/capabilities/background/code-task.d.ts +43 -0
  36. package/dist/capabilities/background/code-task.js +75 -0
  37. package/dist/capabilities/background/command-task.d.ts +9 -2
  38. package/dist/capabilities/background/command-task.js +22 -6
  39. package/dist/capabilities/background/index.d.ts +6 -1
  40. package/dist/capabilities/background/index.js +26 -20
  41. package/dist/capabilities/background/manager.d.ts +57 -1
  42. package/dist/capabilities/background/manager.js +210 -45
  43. package/dist/capabilities/background/persist-disk.d.ts +1 -1
  44. package/dist/capabilities/background/persist-disk.js +1 -1
  45. package/dist/capabilities/background/persist.js +4 -2
  46. package/dist/capabilities/background/projections.d.ts +16 -0
  47. package/dist/capabilities/background/projections.js +86 -0
  48. package/dist/capabilities/background/stall-watchdog.d.ts +41 -0
  49. package/dist/capabilities/background/stall-watchdog.js +85 -0
  50. package/dist/capabilities/background/task.d.ts +8 -7
  51. package/dist/capabilities/background/tools.js +33 -7
  52. package/dist/capabilities/capability-data.d.ts +52 -0
  53. package/dist/capabilities/capability-data.js +88 -0
  54. package/dist/capabilities/capability-state.d.ts +2 -4
  55. package/dist/capabilities/capability-state.js +5 -23
  56. package/dist/capabilities/capability.d.ts +203 -38
  57. package/dist/capabilities/compaction/index.js +10 -4
  58. package/dist/capabilities/compaction/service.d.ts +20 -5
  59. package/dist/capabilities/compaction/service.js +27 -11
  60. package/dist/capabilities/goal/goal-store.d.ts +76 -12
  61. package/dist/capabilities/goal/goal-store.js +137 -53
  62. package/dist/capabilities/goal/index.d.ts +1 -1
  63. package/dist/capabilities/goal/index.js +30 -7
  64. package/dist/capabilities/index.d.ts +9 -6
  65. package/dist/capabilities/index.js +4 -3
  66. package/dist/capabilities/plan/index.js +22 -5
  67. package/dist/capabilities/plan/plan-mode.d.ts +30 -9
  68. package/dist/capabilities/plan/plan-mode.js +57 -32
  69. package/dist/capabilities/plan/tools.js +1 -1
  70. package/dist/capabilities/skills/flow-provider.js +3 -3
  71. package/dist/capabilities/skills/index.d.ts +13 -1
  72. package/dist/capabilities/skills/index.js +30 -21
  73. package/dist/capabilities/skills/parser.d.ts +2 -2
  74. package/dist/capabilities/skills/parser.js +3 -3
  75. package/dist/capabilities/skills/registry.d.ts +5 -6
  76. package/dist/capabilities/skills/registry.js +6 -9
  77. package/dist/capabilities/skills/scanner.d.ts +3 -3
  78. package/dist/capabilities/skills/scanner.js +14 -14
  79. package/dist/capabilities/skills/service.d.ts +2 -1
  80. package/dist/capabilities/skills/service.js +3 -3
  81. package/dist/capabilities/skills/skill-tool.d.ts +2 -0
  82. package/dist/capabilities/skills/skill-tool.js +1 -1
  83. package/dist/capabilities/task/index.js +2 -1
  84. package/dist/capabilities/task/persist-disk.d.ts +1 -1
  85. package/dist/capabilities/task/persist-disk.js +1 -1
  86. package/dist/capabilities/task/persist.js +1 -1
  87. package/dist/capabilities/todo/index.js +11 -6
  88. package/dist/capabilities/todo/injector.js +2 -1
  89. package/dist/capabilities/todo/todo-store.d.ts +28 -7
  90. package/dist/capabilities/todo/todo-store.js +44 -11
  91. package/dist/capabilities/todo/tools.js +8 -3
  92. package/dist/capabilities/tool-provider.d.ts +3 -3
  93. package/dist/capabilities/user-hooks/engine.d.ts +3 -3
  94. package/dist/capabilities/user-hooks/engine.js +7 -7
  95. package/dist/capabilities/user-hooks/index.js +2 -1
  96. package/dist/capabilities/workflow/index.d.ts +5 -3
  97. package/dist/capabilities/workflow/index.js +3 -2
  98. package/dist/commands/index.js +34 -32
  99. package/dist/config/index.d.ts +1 -1
  100. package/dist/config/provider-manager.js +0 -28
  101. package/dist/config/schema.d.ts +53 -4
  102. package/dist/config/schema.js +53 -1
  103. package/dist/events/events.d.ts +43 -11
  104. package/dist/events/events.js +1 -0
  105. package/dist/events/index.d.ts +2 -2
  106. package/dist/events/index.js +1 -1
  107. package/dist/events/projection.d.ts +49 -1
  108. package/dist/events/projection.js +144 -19
  109. package/dist/events/publisher.js +2 -21
  110. package/dist/home.d.ts +1 -1
  111. package/dist/home.js +1 -1
  112. package/dist/index.d.ts +3 -2
  113. package/dist/index.js +2 -1
  114. package/dist/internal.d.ts +5 -2
  115. package/dist/internal.js +5 -2
  116. package/dist/llm/define-model.d.ts +4 -0
  117. package/dist/llm/define-model.js +63 -25
  118. package/dist/llm/index.d.ts +1 -0
  119. package/dist/llm/index.js +1 -0
  120. package/dist/llm/model.d.ts +2 -0
  121. package/dist/llm/provider.d.ts +17 -0
  122. package/dist/llm/provider.js +14 -0
  123. package/dist/llm/retry.js +1 -1
  124. package/dist/loop/context.d.ts +21 -1
  125. package/dist/loop/context.js +47 -9
  126. package/dist/loop/events.d.ts +5 -1
  127. package/dist/loop/index.d.ts +2 -2
  128. package/dist/loop/index.js +1 -1
  129. package/dist/loop/interruption.d.ts +9 -4
  130. package/dist/loop/interruption.js +11 -25
  131. package/dist/loop/run-turn.d.ts +16 -3
  132. package/dist/loop/run-turn.js +13 -4
  133. package/dist/loop/steer.d.ts +78 -12
  134. package/dist/loop/steer.js +101 -38
  135. package/dist/loop/tool-call.d.ts +13 -2
  136. package/dist/loop/tool-call.js +135 -5
  137. package/dist/loop/turn-step.d.ts +13 -2
  138. package/dist/loop/turn-step.js +29 -7
  139. package/dist/loop/types.d.ts +6 -0
  140. package/dist/mcp/auth-tool.d.ts +3 -1
  141. package/dist/mcp/auth-tool.js +2 -2
  142. package/dist/mcp/capability.d.ts +13 -0
  143. package/dist/mcp/capability.js +36 -17
  144. package/dist/mcp/config-loader.d.ts +5 -5
  145. package/dist/mcp/config-loader.js +17 -17
  146. package/dist/mcp/credentials.d.ts +35 -0
  147. package/dist/mcp/credentials.js +2 -0
  148. package/dist/mcp/filter.d.ts +2 -2
  149. package/dist/mcp/index.d.ts +4 -3
  150. package/dist/mcp/index.js +1 -1
  151. package/dist/mcp/manager.d.ts +108 -6
  152. package/dist/mcp/manager.js +262 -18
  153. package/dist/mcp/oauth/callback-server.d.ts +10 -1
  154. package/dist/mcp/oauth/callback-server.js +82 -16
  155. package/dist/mcp/oauth/index.d.ts +2 -2
  156. package/dist/mcp/oauth/provider.d.ts +18 -0
  157. package/dist/mcp/oauth/provider.js +31 -1
  158. package/dist/mcp/oauth/service.d.ts +9 -3
  159. package/dist/mcp/oauth/service.js +29 -4
  160. package/dist/mcp/sdk-transport.js +1 -1
  161. package/dist/mcp/server.js +1 -1
  162. package/dist/permission/auto-approver/prompts-data.d.ts +1 -1
  163. package/dist/permission/auto-approver/prompts-data.js +1 -1
  164. package/dist/permission/manager.d.ts +5 -3
  165. package/dist/permission/manager.js +7 -3
  166. package/dist/permission/policies.d.ts +2 -2
  167. package/dist/permission/policies.js +4 -4
  168. package/dist/plugins/fields.d.ts +14 -0
  169. package/dist/plugins/fields.js +30 -0
  170. package/dist/plugins/hooks.d.ts +2 -2
  171. package/dist/plugins/hooks.js +12 -12
  172. package/dist/plugins/index.js +1 -0
  173. package/dist/plugins/manager.d.ts +8 -3
  174. package/dist/plugins/manager.js +18 -7
  175. package/dist/plugins/manifest.d.ts +2 -2
  176. package/dist/plugins/manifest.js +101 -91
  177. package/dist/plugins/marketplace.js +76 -57
  178. package/dist/plugins/store.d.ts +3 -3
  179. package/dist/plugins/store.js +6 -6
  180. package/dist/protocol/index.d.ts +1 -1
  181. package/dist/store/catalog-store.d.ts +4 -1
  182. package/dist/store/catalog-store.js +5 -1
  183. package/dist/store/checkpointing-store.d.ts +41 -0
  184. package/dist/store/checkpointing-store.js +86 -0
  185. package/dist/store/disk-store.d.ts +8 -0
  186. package/dist/store/disk-store.js +127 -5
  187. package/dist/store/index.d.ts +3 -2
  188. package/dist/store/index.js +2 -1
  189. package/dist/store/log-store.d.ts +9 -1
  190. package/dist/store/log-store.js +68 -4
  191. package/dist/store/migrate.d.ts +8 -2
  192. package/dist/store/migrate.js +9 -2
  193. package/dist/store/origin.d.ts +31 -6
  194. package/dist/store/origin.js +0 -14
  195. package/dist/store/pg.d.ts +1 -0
  196. package/dist/store/pg.js +37 -2
  197. package/dist/store/redis.d.ts +1 -0
  198. package/dist/store/redis.js +30 -0
  199. package/dist/store/repository.d.ts +13 -1
  200. package/dist/store/repository.js +45 -2
  201. package/dist/store/session-catalog.d.ts +4 -0
  202. package/dist/store/session-catalog.js +6 -0
  203. package/dist/store/storage.js +3 -0
  204. package/dist/store/store.d.ts +97 -34
  205. package/dist/store/store.js +64 -10
  206. package/dist/telemetry/appender.d.ts +43 -0
  207. package/dist/telemetry/appender.js +46 -0
  208. package/dist/telemetry/events.d.ts +142 -0
  209. package/dist/telemetry/events.js +141 -0
  210. package/dist/telemetry/index.d.ts +10 -0
  211. package/dist/telemetry/index.js +6 -0
  212. package/dist/telemetry/projection.d.ts +23 -0
  213. package/dist/telemetry/projection.js +185 -0
  214. package/dist/telemetry/redact.d.ts +20 -0
  215. package/dist/telemetry/redact.js +40 -0
  216. package/dist/telemetry/service.d.ts +49 -0
  217. package/dist/telemetry/service.js +137 -0
  218. package/dist/testing.d.ts +58 -0
  219. package/dist/testing.js +123 -0
  220. package/dist/tool/background.d.ts +9 -6
  221. package/dist/tool/background.js +7 -1
  222. package/dist/tool/builtin/ask-user-question.js +6 -5
  223. package/dist/tool/builtin/bash.d.ts +6 -0
  224. package/dist/tool/builtin/bash.js +79 -42
  225. package/dist/tool/builtin/edit.js +82 -109
  226. package/dist/tool/builtin/glob.js +13 -13
  227. package/dist/tool/builtin/grep.js +13 -13
  228. package/dist/tool/builtin/read.js +25 -15
  229. package/dist/tool/builtin/write.js +49 -33
  230. package/dist/tool/define.d.ts +14 -8
  231. package/dist/tool/define.js +8 -2
  232. package/dist/tool/{machine-base.d.ts → environment-base.d.ts} +37 -37
  233. package/dist/tool/{machine-base.js → environment-base.js} +45 -119
  234. package/dist/tool/{machine-local.d.ts → environment-local.d.ts} +9 -8
  235. package/dist/tool/{machine-local.js → environment-local.js} +60 -81
  236. package/dist/tool/{machine-null.d.ts → environment-null.d.ts} +9 -9
  237. package/dist/tool/{machine-null.js → environment-null.js} +9 -9
  238. package/dist/tool/{machine-ssh.d.ts → environment-ssh.d.ts} +33 -18
  239. package/dist/tool/{machine-ssh.js → environment-ssh.js} +118 -149
  240. package/dist/tool/{machine.d.ts → environment.d.ts} +53 -82
  241. package/dist/tool/environment.js +2 -0
  242. package/dist/tool/file-freshness.d.ts +33 -19
  243. package/dist/tool/file-freshness.js +39 -30
  244. package/dist/tool/filesystem-tools.d.ts +1 -1
  245. package/dist/tool/filesystem-tools.js +1 -1
  246. package/dist/tool/git-context.d.ts +2 -2
  247. package/dist/tool/git-context.js +8 -8
  248. package/dist/tool/index.d.ts +12 -12
  249. package/dist/tool/index.js +12 -10
  250. package/dist/tool/policies/path-access.d.ts +4 -4
  251. package/dist/tool/policies/path-access.js +12 -12
  252. package/dist/tool/questions.d.ts +8 -0
  253. package/dist/tool/search/catalog.d.ts +37 -0
  254. package/dist/tool/search/catalog.js +182 -0
  255. package/dist/tool/search/deferral.d.ts +3 -2
  256. package/dist/tool/search/loaded.d.ts +32 -0
  257. package/dist/tool/search/loaded.js +96 -0
  258. package/dist/tool/search/search-tool.d.ts +2 -6
  259. package/dist/tool/search/search-tool.js +16 -15
  260. package/dist/tool/shell-env.js +4 -0
  261. package/dist/tool/support/bash-paths.js +38 -7
  262. package/dist/tool/support/{machine-ops.d.ts → environment-ops.d.ts} +12 -14
  263. package/dist/tool/support/{machine-ops.js → environment-ops.js} +21 -2
  264. package/dist/tool/support/git-worktree.d.ts +3 -3
  265. package/dist/tool/support/git-worktree.js +6 -6
  266. package/dist/tool/support/rg-locator.d.ts +6 -6
  267. package/dist/tool/support/rg-locator.js +6 -6
  268. package/dist/tool/support/ripgrep-run.d.ts +5 -5
  269. package/dist/tool/support/ripgrep-run.js +3 -3
  270. package/dist/tool/support/tool-path.d.ts +3 -3
  271. package/dist/tool/support/tool-path.js +7 -7
  272. package/dist/tool/types.d.ts +54 -10
  273. package/dist/tool/web/fetch-url.js +1 -1
  274. package/dist/tool/web/web-search.js +1 -1
  275. package/dist/tool/workspace-spec.d.ts +3 -3
  276. package/dist/tool/workspace-spec.js +27 -27
  277. package/dist/tracing/bridge.d.ts +9 -1
  278. package/dist/tracing/bridge.js +307 -77
  279. package/dist/tracing/index.d.ts +2 -2
  280. package/dist/tracing/otel.d.ts +28 -1
  281. package/dist/tracing/otel.js +150 -38
  282. package/dist/tracing/processor.d.ts +22 -0
  283. package/dist/tracing/processor.js +2 -0
  284. package/dist/tracing/spans.d.ts +54 -0
  285. package/dist/tracing/spans.js +5 -0
  286. package/package.json +6 -2
  287. package/dist/tool/machine.js +0 -15
  288. package/dist/tool/search/activation.d.ts +0 -13
  289. package/dist/tool/search/activation.js +0 -31
@@ -105,12 +105,12 @@ export const grepTool = defineTool({
105
105
  params: GrepInput,
106
106
  async resolve(args, ctx) {
107
107
  const searchPath = args.path !== undefined
108
- ? await resolveToolPath(args.path, ctx.machine, "search", SEARCH_ACCESS_POLICY)
109
- : ctx.machine.getcwd();
108
+ ? await resolveToolPath(args.path, ctx.environment, "search", SEARCH_ACCESS_POLICY)
109
+ : ctx.environment.getcwd();
110
110
  return {
111
- display: { title: `Searching for '${args.pattern}' in ${args.path ?? "."}` },
111
+ display: { title: `Searching for '${args.pattern}' in ${args.path ?? "."}`, pattern: args.pattern, ...(args.path !== undefined ? { path: args.path } : {}) },
112
112
  ...globApproval("Grep", args.pattern),
113
- run: (runCtx) => execution(args, runCtx.signal, [searchPath], runCtx.machine),
113
+ run: (runCtx) => execution(args, runCtx.signal, [searchPath], runCtx.environment),
114
114
  };
115
115
  },
116
116
  });
@@ -123,14 +123,14 @@ class GrepAbortedError extends Error {
123
123
  function errResult(text) {
124
124
  return { content: [{ type: "text", text }], isError: true };
125
125
  }
126
- async function execution(args, signal, searchPaths, machine) {
126
+ async function execution(args, signal, searchPaths, environment) {
127
127
  if (signal.aborted)
128
128
  return errResult("Aborted before search started");
129
- const pathClass = machine.pathClass();
130
- const workspaceDir = machine.getcwd();
129
+ const pathClass = environment.pathClass();
130
+ const workspaceDir = environment.getcwd();
131
131
  let rgPath;
132
132
  try {
133
- rgPath = await resolveRgCommand(machine, { signal });
133
+ rgPath = await resolveRgCommand(environment, { signal });
134
134
  }
135
135
  catch (error) {
136
136
  if (isAbortError(error))
@@ -138,13 +138,13 @@ async function execution(args, signal, searchPaths, machine) {
138
138
  return errResult(rgUnavailableMessage(error));
139
139
  }
140
140
  const runOptions = { timeoutMs: DEFAULT_TIMEOUT_MS, maxOutputBytes: MAX_OUTPUT_BYTES };
141
- let outcome = await runRipgrep(machine, buildRgArgs(rgPath, args, searchPaths), signal, runOptions);
141
+ let outcome = await runRipgrep(environment, buildRgArgs(rgPath, args, searchPaths), signal, runOptions);
142
142
  const earlyExit = mapNonResult(outcome);
143
143
  if (earlyExit)
144
144
  return earlyExit;
145
145
  let runResult = outcome.result;
146
146
  if (shouldRetryRipgrepEagain(runResult)) {
147
- outcome = await runRipgrep(machine, buildRgArgs(rgPath, args, searchPaths, true), signal, runOptions);
147
+ outcome = await runRipgrep(environment, buildRgArgs(rgPath, args, searchPaths, true), signal, runOptions);
148
148
  const retryExit = mapNonResult(outcome);
149
149
  if (retryExit)
150
150
  return retryExit;
@@ -173,7 +173,7 @@ async function execution(args, signal, searchPaths, machine) {
173
173
  try {
174
174
  orderedLines =
175
175
  mode === "files_with_matches" && !timedOut
176
- ? await sortFilesWithMatchesByMtime(keptLines, machine, signal)
176
+ ? await sortFilesWithMatchesByMtime(keptLines, environment, signal)
177
177
  : keptLines;
178
178
  }
179
179
  catch (error) {
@@ -251,13 +251,13 @@ function shouldRetryRipgrepEagain(result) {
251
251
  function isEagainRipgrepError(stderr) {
252
252
  return stderr.includes("os error 11") || stderr.includes("Resource temporarily unavailable");
253
253
  }
254
- async function sortFilesWithMatchesByMtime(lines, machine, signal) {
254
+ async function sortFilesWithMatchesByMtime(lines, environment, signal) {
255
255
  const entries = await mapWithConcurrency(lines, MTIME_STAT_CONCURRENCY, signal, async (line, index) => {
256
256
  const path = line.kind === "record" ? line.filePath : line.kind === "legacy" ? line.text : undefined;
257
257
  let mtime = 0;
258
258
  if (path !== undefined) {
259
259
  try {
260
- mtime = (await machine.fileInfo(path)).mtimeMs ?? 0;
260
+ mtime = (await environment.fileInfo(path)).mtimeMs ?? 0;
261
261
  }
262
262
  catch {
263
263
  /* mtime=0 → sort after known files */
@@ -4,7 +4,7 @@ import { defineTool } from "../define.js";
4
4
  import { FILE_UNCHANGED_STUB } from "../file-freshness.js";
5
5
  import { detectFileType, MEDIA_SNIFF_BYTES } from "../support/file-type.js";
6
6
  import { compressImageForModel } from "../support/image-compress.js";
7
- import { fileVersionFromInfo, fileVersionsMatch, normalizeForCompare, readTextFile } from "../support/machine-ops.js";
7
+ import { decodeText, fileVersionFromInfo, fileVersionsMatch, normalizeForCompare, readTextFile } from "../support/environment-ops.js";
8
8
  import { pathApproval, resolveToolPath } from "../support/tool-path.js";
9
9
  import { makeCarriageReturnsVisible } from "./line-endings.js";
10
10
  /**
@@ -171,21 +171,21 @@ export const readTool = defineTool({
171
171
  description: READ_DESCRIPTION,
172
172
  params: ReadInput,
173
173
  async resolve(args, ctx) {
174
- const path = await resolveToolPath(args.path, ctx.machine, "read");
174
+ const path = await resolveToolPath(args.path, ctx.environment, "read");
175
175
  return {
176
176
  accesses: ToolAccesses.readFile(path),
177
- display: { title: `Reading ${args.path}` },
178
- ...pathApproval("Read", ctx.machine, path),
177
+ display: { title: `Reading ${args.path}`, path: args.path },
178
+ ...pathApproval("Read", ctx.environment, path),
179
179
  run: (runCtx) => execute(args, path, runCtx),
180
180
  };
181
181
  },
182
182
  });
183
183
  async function execute(args, safePath, ctx) {
184
- const machine = ctx.machine;
184
+ const environment = ctx.environment;
185
185
  try {
186
186
  let info;
187
187
  try {
188
- info = await machine.fileInfo(safePath);
188
+ info = await environment.fileInfo(safePath);
189
189
  }
190
190
  catch (error) {
191
191
  if (isFileNotFoundError(error))
@@ -194,28 +194,36 @@ async function execute(args, safePath, ctx) {
194
194
  }
195
195
  if (info.kind !== "file")
196
196
  return err(`"${args.path}" is not a file.`);
197
- const header = await machine.readBytes(safePath, { length: MEDIA_SNIFF_BYTES });
198
- const fileType = detectFileType(safePath, header);
199
- if (fileType.kind === "image")
200
- return readImageFile(args, safePath, info, machine, fileType.mimeType);
201
- if (fileType.kind === "unknown")
202
- return err(notReadableFileOutput(args.path));
203
197
  const lineOffset = args.line_offset ?? 1;
204
198
  // No `n_lines` means to the end of the file — the byte ceiling is what bounds it.
205
199
  const requestedLines = args.n_lines ?? Number.POSITIVE_INFINITY;
206
200
  const range = rangeKeyForArgs(args);
201
+ // Dedup before anything is read: an unchanged file answers from the stat alone. A record
202
+ // with a range only ever comes from a successful TEXT read, so skipping the type sniff for
203
+ // it cannot serve the stub for an image.
207
204
  const record = ctx.fileLedger?.get(safePath);
208
205
  if (record?.range && rangesEqual(record.range, range)) {
209
206
  const current = fileVersionFromInfo(info);
210
207
  if (fileVersionsMatch(record.version, current))
211
208
  return ok(FILE_UNCHANGED_STUB);
212
209
  }
210
+ // A file small enough to read whole is read ONCE, and its type sniffed off the front of those
211
+ // same bytes. Sniffing first meant two reads of every text file — free locally, but a second
212
+ // round trip (on a sandbox, a whole extra command) on every remote Read. A large file still
213
+ // gets the sniff alone first, so a binary is refused without pulling all of it across.
214
+ const whole = info.size <= MAX_UNPAGED_FILE_BYTES ? await environment.readBytes(safePath) : undefined;
215
+ const header = whole?.subarray(0, MEDIA_SNIFF_BYTES) ?? (await environment.readBytes(safePath, { length: MEDIA_SNIFF_BYTES }));
216
+ const fileType = detectFileType(safePath, header);
217
+ if (fileType.kind === "image")
218
+ return readImageFile(args, safePath, info, environment, fileType.mimeType, whole);
219
+ if (fileType.kind === "unknown")
220
+ return err(notReadableFileOutput(args.path));
213
221
  // After the dedup stub: an unchanged file answers for free no matter how large it is.
214
222
  if (args.line_offset === undefined && args.n_lines === undefined && info.size > MAX_UNPAGED_FILE_BYTES) {
215
223
  return err(`"${args.path}" is ${String(Math.round(info.size / 1024))} KB, over the ${String(MAX_UNPAGED_FILE_BYTES / 1024)} KB limit for reading a whole file at once. ` +
216
224
  "Read a range with `line_offset` (and `n_lines`), or use Grep to find the relevant part first.");
217
225
  }
218
- const rawText = await readTextFile(machine, safePath, { errors: "strict" });
226
+ const rawText = whole !== undefined ? decodeText(whole, { errors: "strict" }) : await readTextFile(environment, safePath, { errors: "strict" });
219
227
  const outcome = lineOffset < 0
220
228
  ? readTail(rawText, args.path, lineOffset, requestedLines, range)
221
229
  : readForward(rawText, args.path, lineOffset, requestedLines, range);
@@ -238,7 +246,9 @@ async function execute(args, safePath, ctx) {
238
246
  return err(error instanceof Error ? error.message : String(error));
239
247
  }
240
248
  }
241
- async function readImageFile(args, safePath, info, machine, mimeType) {
249
+ async function readImageFile(args, safePath, info, environment, mimeType,
250
+ /** The file's bytes when the caller already read them whole. */
251
+ preloaded) {
242
252
  if (args.line_offset !== undefined || args.n_lines !== undefined) {
243
253
  return err("line_offset and n_lines are only supported for text files.");
244
254
  }
@@ -247,7 +257,7 @@ async function readImageFile(args, safePath, info, machine, mimeType) {
247
257
  if (info.size > MAX_IMAGE_BYTES) {
248
258
  return err(`"${args.path}" is ${String(info.size)} bytes, which exceeds the maximum ${String(MAX_IMAGE_MEGABYTES)}MB for image files.`);
249
259
  }
250
- const data = await machine.readBytes(safePath);
260
+ const data = preloaded ?? (await environment.readBytes(safePath));
251
261
  // Downsample/re-encode oversized images before sending to the model (best
252
262
  // effort; the original bytes are returned unchanged on any failure).
253
263
  const compressed = await compressImageForModel(data, mimeType);
@@ -2,9 +2,8 @@ import { dirname } from "node:path";
2
2
  import { z } from "zod";
3
3
  import { ToolAccesses } from "../access.js";
4
4
  import { defineTool } from "../define.js";
5
- import { FileExistsError, StaleFileError } from "../machine.js";
6
5
  import { checkFreshness, FILE_MODIFIED_MESSAGE, FILE_NOT_READ_MESSAGE } from "../file-freshness.js";
7
- import { fileVersionFromInfo, normalizeForCompare } from "../support/machine-ops.js";
6
+ import { fileVersionFromInfo, normalizeForCompare } from "../support/environment-ops.js";
8
7
  import { pathApproval, resolveToolPath } from "../support/tool-path.js";
9
8
  import { detectLineEndingStyle, materializeModelText } from "./line-endings.js";
10
9
  const WriteInput = z.object({
@@ -33,35 +32,49 @@ export const writeTool = defineTool({
33
32
  // payload, an SSH key), projected as `${file_path}: ${content}`.
34
33
  toAutoApprovalInput: (args) => `${args.path}: ${args.content}`,
35
34
  async resolve(args, ctx) {
36
- const path = await resolveToolPath(args.path, ctx.machine, "write");
35
+ const path = await resolveToolPath(args.path, ctx.environment, "write");
37
36
  return {
38
37
  accesses: ToolAccesses.writeFile(path),
39
- display: { title: `Writing ${args.path}` },
40
- ...pathApproval("Write", ctx.machine, path),
38
+ display: { title: `Writing ${args.path}`, path: args.path, content: args.content },
39
+ ...pathApproval("Write", ctx.environment, path),
41
40
  run: (runCtx) => execute(args, path, runCtx),
42
41
  };
43
42
  },
44
43
  });
45
44
  async function execute(args, safePath, ctx) {
46
- const machine = ctx.machine;
47
- const parentError = await checkParentDirectory(safePath, machine);
48
- if (parentError !== undefined)
49
- return errorResult(parentError);
45
+ const environment = ctx.environment;
46
+ let info;
47
+ try {
48
+ // ONE stat for the whole call: it answers "does this file exist" and supplies the
49
+ // version the freshness check needs. The three separate stats this replaced each
50
+ // cost a round trip on a remote backend to re-learn what this one already knows.
51
+ info = await statOrUndefined(environment, safePath);
52
+ }
53
+ catch (error) {
54
+ return errorResult(error instanceof Error ? error.message : String(error));
55
+ }
56
+ // An existing file already proves its parent directory exists; only a new file needs the
57
+ // parent checked — which is the one case the helpful "create it first" message is for.
58
+ if (info === undefined) {
59
+ const parentError = await checkParentDirectory(safePath, environment);
60
+ if (parentError !== undefined)
61
+ return errorResult(parentError);
62
+ }
50
63
  try {
51
64
  const mode = args.mode ?? "overwrite";
52
- const info = await statOrUndefined(machine, safePath);
53
- if (info !== undefined)
54
- await validateWrite(safePath, ctx);
55
- const ledger = ctx.fileLedger;
56
- const record = info !== undefined ? ledger?.get(safePath) : undefined;
57
65
  let nextContent = args.content;
58
66
  let writtenContent = args.content;
67
+ // Append reads the file to concatenate onto it. Reading BEFORE the freshness check
68
+ // lets that one read serve both: chunked writes (overwrite, then append, append…)
69
+ // would otherwise read the whole file twice per chunk.
70
+ let priorText;
59
71
  if (mode === "append") {
60
72
  // Append composed from the core members: read-concat-write. Fine for the
61
73
  // tool's occasional appends; high-frequency log appends belong elsewhere.
62
74
  let prior = "";
63
75
  try {
64
- prior = (await machine.readBytes(safePath)).toString("utf8");
76
+ prior = (await environment.readBytes(safePath)).toString("utf8");
77
+ priorText = prior;
65
78
  }
66
79
  catch (error) {
67
80
  if (error.code !== "ENOENT")
@@ -74,13 +87,17 @@ async function execute(args, safePath, ctx) {
74
87
  : args.content;
75
88
  nextContent = prior + writtenContent;
76
89
  }
77
- const result = await machine.writeTextIfUnchanged(safePath, nextContent, {
78
- expected: info !== undefined ? record.version : "must-not-exist",
79
- // Only a full read's content can be compared against the whole file; a paged
80
- // record's text would differ from it by definition and read as a conflict.
81
- ...(record?.fullRead === true && record.content !== undefined ? { expectedContent: record.content } : {}),
82
- });
83
- ledger?.recordWrite(safePath, result.version, {
90
+ if (info !== undefined)
91
+ await validateWrite(safePath, info, ctx, priorText);
92
+ // Unconditional: `validateWrite` above already decided this write is allowed against
93
+ // the file as the stat found it. A file appearing (or changing) between that check
94
+ // and this write is the gap documented on Environment.writeText — the record below is
95
+ // what surfaces it to the next Read/Write.
96
+ const result = await environment.writeText(safePath, nextContent);
97
+ ctx.fileLedger?.recordWrite(safePath, {
98
+ // Present only where the backend knew it for free (local); elsewhere the record
99
+ // is decided by the digest below.
100
+ ...(result.version !== undefined ? { version: result.version } : {}),
84
101
  content: normalizeForCompare(nextContent),
85
102
  lineEndings: toLedgerLineEndings(detectLineEndingStyle(nextContent)),
86
103
  encoding: "utf8",
@@ -90,8 +107,6 @@ async function execute(args, safePath, ctx) {
90
107
  return textResult(`${mode === "append" ? "Appended" : "Wrote"} ${String(bytesWritten)} bytes to ${args.path}`);
91
108
  }
92
109
  catch (error) {
93
- if (error instanceof StaleFileError || error instanceof FileExistsError)
94
- return errorResult(FILE_MODIFIED_MESSAGE);
95
110
  const code = error?.code;
96
111
  if (code === "ENOENT") {
97
112
  return errorResult(`Failed to write ${args.path}: parent directory does not exist.`);
@@ -105,9 +120,9 @@ function requireLedger(ctx) {
105
120
  }
106
121
  return ctx.fileLedger;
107
122
  }
108
- async function statOrUndefined(machine, path) {
123
+ async function statOrUndefined(environment, path) {
109
124
  try {
110
- return await machine.fileInfo(path);
125
+ return await environment.fileInfo(path);
111
126
  }
112
127
  catch (error) {
113
128
  const code = error.code;
@@ -116,10 +131,7 @@ async function statOrUndefined(machine, path) {
116
131
  throw error;
117
132
  }
118
133
  }
119
- async function validateWrite(path, ctx) {
120
- const info = await statOrUndefined(ctx.machine, path);
121
- if (info === undefined)
122
- return;
134
+ async function validateWrite(path, info, ctx, knownContent) {
123
135
  const ledger = requireLedger(ctx);
124
136
  // "Has this agent seen the file", not "did it see all of it" — see the same gate in
125
137
  // edit.ts. Overwriting a file the model only paged through DOES discard the part it
@@ -133,8 +145,12 @@ async function validateWrite(path, ctx) {
133
145
  path,
134
146
  current: fileVersionFromInfo(info),
135
147
  currentContent: async () => {
148
+ // The caller already has the text (append) — re-reading it would double the
149
+ // I/O of every chunk in a chunked write.
150
+ if (knownContent !== undefined)
151
+ return normalizeForCompare(knownContent);
136
152
  try {
137
- return normalizeForCompare((await ctx.machine.readBytes(path)).toString(record.encoding));
153
+ return normalizeForCompare((await ctx.environment.readBytes(path)).toString(record.encoding));
138
154
  }
139
155
  catch {
140
156
  return undefined;
@@ -153,11 +169,11 @@ function toLedgerLineEndings(style) {
153
169
  return "mixed";
154
170
  return "LF";
155
171
  }
156
- async function checkParentDirectory(safePath, machine) {
172
+ async function checkParentDirectory(safePath, environment) {
157
173
  const parent = dirname(safePath);
158
174
  let info;
159
175
  try {
160
- info = await machine.fileInfo(parent);
176
+ info = await environment.fileInfo(parent);
161
177
  }
162
178
  catch (error) {
163
179
  if (error.code === "ENOENT") {
@@ -12,16 +12,19 @@ import type { Tool, ToolAccesses, ToolDisplay, ToolPlan, ToolResolveContext, Too
12
12
  * `ctx.fileLedger`), plan fields beyond approvalRule/accesses/display, or an
13
13
  * args-dependent plan structure.
14
14
  */
15
- export interface ToolDef<S extends ZodType> {
15
+ export interface ToolDef<S extends ZodType, TContext = unknown> {
16
16
  readonly name: string;
17
17
  readonly description: string;
18
18
  readonly params: S;
19
- readonly resolve: (args: z.infer<S>, ctx: ToolResolveContext) => ToolPlan | Promise<ToolPlan>;
19
+ readonly resolve: (args: z.infer<S>, ctx: ToolResolveContext<TContext>) => ToolPlan | Promise<ToolPlan>;
20
20
  /** Security-relevant projection for the `auto`-mode judge. See `Tool.toAutoApprovalInput`. */
21
21
  readonly toAutoApprovalInput?: (args: z.infer<S>) => unknown;
22
22
  }
23
- /** Build a tool from a {@link ToolDef}. See that type's doc for when to prefer {@link tool}. */
24
- export declare function defineTool<S extends ZodType>(def: ToolDef<S>): Tool;
23
+ /**
24
+ * Build a tool from a {@link ToolDef}. See that type's doc for when to prefer {@link tool}.
25
+ * `TContext` declares the host context `ctx.context` carries (see `ToolContextBase.context`).
26
+ */
27
+ export declare function defineTool<S extends ZodType, TContext = unknown>(def: ToolDef<S, TContext>): Tool;
25
28
  export type ToolReturn = string | ToolResultContent | ToolResult;
26
29
  /**
27
30
  * The simple tool definition (OpenAI-parity function tool): one `execute` plus optional
@@ -30,17 +33,20 @@ export type ToolReturn = string | ToolResultContent | ToolResult;
30
33
  * hand; for resolve-time validation or plan fields not exposed here, use
31
34
  * {@link defineTool} instead.
32
35
  */
33
- export interface FunctionToolDef<S extends ZodType> {
36
+ export interface FunctionToolDef<S extends ZodType, TContext = unknown> {
34
37
  readonly name: string;
35
38
  readonly description: string;
36
39
  readonly parameters: S;
37
- readonly execute: (args: z.infer<S>, ctx: ToolRunContext) => ToolReturn | Promise<ToolReturn>;
40
+ readonly execute: (args: z.infer<S>, ctx: ToolRunContext<TContext>) => ToolReturn | Promise<ToolReturn>;
38
41
  readonly approvalRule?: string | ((args: z.infer<S>) => string);
39
42
  readonly accesses?: ToolAccesses;
40
43
  readonly display?: (args: z.infer<S>) => ToolDisplay;
41
44
  /** Security-relevant projection for the `auto`-mode judge. See `Tool.toAutoApprovalInput`. */
42
45
  readonly toAutoApprovalInput?: (args: z.infer<S>) => unknown;
43
46
  }
44
- /** Build a tool from a {@link FunctionToolDef} — the right default for most tools. */
45
- export declare function tool<S extends ZodType>(def: FunctionToolDef<S>): Tool;
47
+ /**
48
+ * Build a tool from a {@link FunctionToolDef} — the right default for most tools.
49
+ * `TContext` declares the host context `ctx.context` carries (see `ToolContextBase.context`).
50
+ */
51
+ export declare function tool<S extends ZodType, TContext = unknown>(def: FunctionToolDef<S, TContext>): Tool;
46
52
  //# sourceMappingURL=define.d.ts.map
@@ -1,5 +1,8 @@
1
1
  import { z } from "zod";
2
- /** Build a tool from a {@link ToolDef}. See that type's doc for when to prefer {@link tool}. */
2
+ /**
3
+ * Build a tool from a {@link ToolDef}. See that type's doc for when to prefer {@link tool}.
4
+ * `TContext` declares the host context `ctx.context` carries (see `ToolContextBase.context`).
5
+ */
3
6
  export function defineTool(def) {
4
7
  const parameters = z.toJSONSchema(def.params);
5
8
  return {
@@ -15,7 +18,10 @@ export function defineTool(def) {
15
18
  : {}),
16
19
  };
17
20
  }
18
- /** Build a tool from a {@link FunctionToolDef} — the right default for most tools. */
21
+ /**
22
+ * Build a tool from a {@link FunctionToolDef} — the right default for most tools.
23
+ * `TContext` declares the host context `ctx.context` carries (see `ToolContextBase.context`).
24
+ */
19
25
  export function tool(def) {
20
26
  const parameters = z.toJSONSchema(def.parameters);
21
27
  return {
@@ -1,21 +1,17 @@
1
1
  /**
2
- * Implementer-side base for Machine backends.
2
+ * Implementer-side base for Environment backends.
3
3
  *
4
4
  * A backend writes only the dumb primitives (the abstract SPI below); this
5
5
  * class derives the high-level operations from them:
6
6
  *
7
- * - `writeTextIfUnchanged`: per-path lock → fileInfo compare → content review →
8
- * write → version stamp, all inside the lock. The lock is the same-process
9
- * floor of the contract (see Machine docs); the residual gap versus EXTERNAL
10
- * writers is backend-dependent and can't be closed here. Hosts override for
11
- * stronger swaps (local: sync critical section; SSH: EXCL create + tmp/rename).
7
+ * - `run`: spawn → cap both streams → escalating kill on timeout/abort.
12
8
  * - `realpath`: `readlink -f` via `run` on posix, normpath on win32. Hosts with
13
9
  * a native resolver (fs.realpath, SFTP realpath) override for exactness.
14
10
  */
15
11
  import type { Readable, Writable } from "node:stream";
16
- import { type RunCommandResult, type DecodeErrors, type DirEntry, type Environment, type ByteRange, type Machine, type RunCommandOptions, type FileInfo, type WriteFileResult, type WriteTextIfUnchangedOptions, type WriteTextOptions, type WriteTextResult } from "./machine.ts";
12
+ import { type RunCommandResult, type DecodeErrors, type DirEntry, type OsInfo, type ByteRange, type Environment, type RunCommandOptions, type FileInfo, type FileVersion, type WriteTextOptions, type WriteTextResult } from "./environment.ts";
17
13
  /**
18
- * A live OS process, normalized. IMPLEMENTER-SIDE ONLY — this is what {@link BaseMachine.spawn}
14
+ * A live OS process, normalized. IMPLEMENTER-SIDE ONLY — this is what {@link BaseEnvironment.spawn}
19
15
  * hands back so ONE copy of `run`'s read/cap/decode/kill-escalate logic can serve backends
20
16
  * whose native process objects disagree on the details: node's `ChildProcess` kills by signal
21
17
  * name and reports exit on one event, while an ssh2 `ClientChannel` wants the signal without
@@ -31,17 +27,22 @@ export interface SpawnedProcess {
31
27
  /** null while running. Read after a kill to tell "it stopped" from "it ignored us". */
32
28
  readonly exitCode: number | null;
33
29
  wait(): Promise<number>;
30
+ /**
31
+ * Signal the process AND everything it started. A command reaches us as `sh -c '…'`, so the
32
+ * process we hold is usually just the shell — signalling only it leaves the real command
33
+ * running as an orphan while `run` reports it stopped.
34
+ */
34
35
  kill(signal?: NodeJS.Signals): Promise<void>;
35
36
  }
36
- export declare abstract class BaseMachine implements Machine {
37
+ export declare abstract class BaseEnvironment implements Environment {
37
38
  abstract readonly name: string;
38
- abstract readonly osEnv: Environment;
39
+ abstract readonly osInfo: OsInfo;
39
40
  abstract pathClass(): "posix" | "win32";
40
41
  abstract normpath(path: string): string;
41
42
  abstract gethome(): string;
42
43
  abstract getcwd(): string;
43
- abstract withCwd(cwd: string): Machine;
44
- /** Extra workspace roots (see Machine.additionalDirs). Default: cwd only. */
44
+ abstract withCwd(cwd: string): Environment;
45
+ /** Extra workspace roots (see Environment.additionalDirs). Default: cwd only. */
45
46
  additionalDirs(): readonly string[];
46
47
  /**
47
48
  * Spawn a live process. IMPLEMENTER-SIDE ONLY — no caller reaches for this; it exists so
@@ -65,17 +66,6 @@ export declare abstract class BaseMachine implements Machine {
65
66
  abstract readBytes(path: string, range?: ByteRange): Promise<Buffer>;
66
67
  /** Raw unconditional whole-file write — the single write primitive everything else derives from. */
67
68
  protected abstract writeBytesRaw(path: string, data: Buffer): Promise<void>;
68
- /**
69
- * The write half of the compare-and-swap in `writeTextIfUnchanged`. Default: the same raw
70
- * write as anywhere else — correct, but a reader racing it can observe a half-written file,
71
- * and a crash mid-write leaves one behind.
72
- *
73
- * Backends that can swap a complete file into place in one indivisible step (write to a
74
- * sibling temp path, then rename over the target on the same filesystem) override this. It
75
- * is separate from `writeBytesRaw` because the extra round trip only earns its cost where
76
- * torn state is observable — which is the CAS path, not every write.
77
- */
78
- protected writeBytesSwap(path: string, data: Buffer): Promise<void>;
79
69
  /** Decode with the shared contract: strict UTF-8 throws on invalid bytes (binary detection). */
80
70
  protected decodeText(data: Buffer, options?: {
81
71
  encoding?: BufferEncoding;
@@ -102,28 +92,38 @@ export declare abstract class BaseMachine implements Machine {
102
92
  * contract's other half made loud rather than silent.
103
93
  */
104
94
  run(argv: readonly string[], options?: RunCommandOptions): Promise<RunCommandResult>;
105
- /** SIGTERM, then SIGKILL if it does not exit. Returns whether the process actually stopped. */
106
95
  /** How long SIGTERM gets before SIGKILL, and SIGKILL before we give up. Overridable so a
107
96
  * backend (or a test) can tighten it; the default matches the shell's own convention. */
108
97
  protected sigtermGraceMs: number;
98
+ /**
99
+ * SIGTERM, then SIGKILL. Returns whether the process stopped within its grace.
100
+ *
101
+ * The SIGKILL is UNCONDITIONAL, including on the path where the process exited politely, and
102
+ * that is the whole trick. A command arrives as `sh -c '…'`, so what exits on SIGTERM is
103
+ * usually just the shell; anything it started that trapped the signal keeps running, and a
104
+ * stop that judged by the shell alone would report success over a live orphan.
105
+ *
106
+ * Sending it anyway costs nothing — the signal goes to the process GROUP, and a group with
107
+ * nothing left in it is an ESRCH we ignore. And it costs no TIME, which is the point: a
108
+ * survivor check could tell us whether the second signal is needed, but the answer only ever
109
+ * saves a syscall, while asking it needs a poll loop. Waiting out the grace before killing
110
+ * would cost real time, so we do not do that either: a child still alive after its parent
111
+ * died of SIGTERM has already declined to go quietly, and giving it another five seconds to
112
+ * reconsider is five seconds of a stopped command still holding its port.
113
+ */
109
114
  private escalatingKill;
110
115
  /** `spawn` has no cwd parameter; a backend without a native one runs through a subshell. */
111
116
  protected withCwdArgv(argv: readonly string[], cwd: string | undefined): string[];
117
+ /**
118
+ * The version the last write produced, for backends that can answer without a round
119
+ * trip. Default: nothing — a remote backend would have to stat for it, and paying that
120
+ * on every write to save a content comparison on the rare write-after-write is the
121
+ * wrong trade (see WriteTextResult.version).
122
+ */
123
+ protected versionAfterWrite(_path: string): Promise<FileVersion | undefined>;
112
124
  writeText(path: string, data: string, options?: WriteTextOptions): Promise<WriteTextResult>;
113
125
  /** Exact bytes through the same primitive `writeText` uses — no encoding, no CRLF rewrite. */
114
126
  writeBytes(path: string, data: Buffer): Promise<void>;
115
- protected pathLocks: Map<string, Promise<void>>;
116
- /** Key identifying "the same file" for the write lock. Backends with real path
117
- * resolution override so relative and absolute spellings share one lock. */
118
- protected lockKeyFor(path: string): string;
119
- protected withPathLock<T>(path: string, body: () => Promise<T>): Promise<T>;
120
- /**
121
- * The compare half of writeTextIfUnchanged: throws unless the file still matches
122
- * `options.expected`. Shared by the base composition and by backend overrides
123
- * that re-check right before an atomic swap (SshMachine).
124
- */
125
- protected assertUnchanged(path: string, options: WriteTextIfUnchangedOptions, encoding: BufferEncoding): Promise<void>;
126
- writeTextIfUnchanged(path: string, data: string, options: WriteTextIfUnchangedOptions): Promise<WriteFileResult>;
127
127
  /** Deadline for the readlink fallback; a test/backend subclass may shorten it. */
128
128
  protected realpathTimeoutMs: number;
129
129
  /**
@@ -135,4 +135,4 @@ export declare abstract class BaseMachine implements Machine {
135
135
  */
136
136
  realpath(path: string): Promise<string>;
137
137
  }
138
- //# sourceMappingURL=machine-base.d.ts.map
138
+ //# sourceMappingURL=environment-base.d.ts.map