@ai-hero/sandcastle 0.6.5 → 0.7.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 (229) hide show
  1. package/README.md +137 -62
  2. package/dist/{MountConfig.d.ts → MountConfig-CmXclHA5.d.ts} +3 -2
  3. package/dist/{SandboxProvider.d.ts → SandboxProvider-EkSMuBp8.d.ts} +25 -39
  4. package/dist/chunk-52CIJF45.js +25569 -0
  5. package/dist/chunk-52CIJF45.js.map +1 -0
  6. package/dist/chunk-5VM5QZ26.js +26988 -0
  7. package/dist/chunk-5VM5QZ26.js.map +1 -0
  8. package/dist/chunk-72UVAC7B.js +99 -0
  9. package/dist/chunk-72UVAC7B.js.map +1 -0
  10. package/dist/chunk-BIWNFKGV.js +22 -0
  11. package/dist/chunk-BIWNFKGV.js.map +1 -0
  12. package/dist/chunk-NGBM7T3E.js +76 -0
  13. package/dist/chunk-NGBM7T3E.js.map +1 -0
  14. package/dist/chunk-NSFQW6ML.js +362 -0
  15. package/dist/chunk-NSFQW6ML.js.map +1 -0
  16. package/dist/index.d.ts +920 -22
  17. package/dist/index.js +3212 -9
  18. package/dist/index.js.map +1 -1
  19. package/dist/main.d.ts +0 -2
  20. package/dist/main.js +19349 -13
  21. package/dist/main.js.map +1 -1
  22. package/dist/mountUtils-CCA-bbpK.d.ts +25 -0
  23. package/dist/sandboxes/daytona.d.ts +8 -5
  24. package/dist/sandboxes/daytona.js +118 -124
  25. package/dist/sandboxes/daytona.js.map +1 -1
  26. package/dist/sandboxes/docker.d.ts +10 -8
  27. package/dist/sandboxes/docker.js +8 -255
  28. package/dist/sandboxes/docker.js.map +1 -1
  29. package/dist/sandboxes/no-sandbox.d.ts +7 -4
  30. package/dist/sandboxes/no-sandbox.js +6 -114
  31. package/dist/sandboxes/no-sandbox.js.map +1 -1
  32. package/dist/sandboxes/podman.d.ts +10 -8
  33. package/dist/sandboxes/podman.js +287 -297
  34. package/dist/sandboxes/podman.js.map +1 -1
  35. package/dist/sandboxes/vercel.d.ts +7 -4
  36. package/dist/sandboxes/vercel.js +144 -165
  37. package/dist/sandboxes/vercel.js.map +1 -1
  38. package/dist/templates/sequential-reviewer/implement-prompt.md +2 -2
  39. package/dist/templates/simple-loop/prompt.md +2 -2
  40. package/package.json +15 -14
  41. package/dist/AgentProvider.d.ts +0 -134
  42. package/dist/AgentProvider.d.ts.map +0 -1
  43. package/dist/AgentProvider.js +0 -647
  44. package/dist/AgentProvider.js.map +0 -1
  45. package/dist/AgentStreamEmitter.d.ts +0 -36
  46. package/dist/AgentStreamEmitter.d.ts.map +0 -1
  47. package/dist/AgentStreamEmitter.js +0 -21
  48. package/dist/AgentStreamEmitter.js.map +0 -1
  49. package/dist/CopyToWorktree.d.ts +0 -15
  50. package/dist/CopyToWorktree.d.ts.map +0 -1
  51. package/dist/CopyToWorktree.js +0 -60
  52. package/dist/CopyToWorktree.js.map +0 -1
  53. package/dist/Display.d.ts +0 -58
  54. package/dist/Display.d.ts.map +0 -1
  55. package/dist/Display.js +0 -142
  56. package/dist/Display.js.map +0 -1
  57. package/dist/DockerLifecycle.d.ts +0 -54
  58. package/dist/DockerLifecycle.d.ts.map +0 -1
  59. package/dist/DockerLifecycle.js +0 -123
  60. package/dist/DockerLifecycle.js.map +0 -1
  61. package/dist/EnvResolver.d.ts +0 -11
  62. package/dist/EnvResolver.d.ts.map +0 -1
  63. package/dist/EnvResolver.js +0 -63
  64. package/dist/EnvResolver.js.map +0 -1
  65. package/dist/ErrorHandler.d.ts +0 -15
  66. package/dist/ErrorHandler.d.ts.map +0 -1
  67. package/dist/ErrorHandler.js +0 -85
  68. package/dist/ErrorHandler.js.map +0 -1
  69. package/dist/InitService.d.ts +0 -92
  70. package/dist/InitService.d.ts.map +0 -1
  71. package/dist/InitService.js +0 -836
  72. package/dist/InitService.js.map +0 -1
  73. package/dist/MountConfig.d.ts.map +0 -1
  74. package/dist/MountConfig.js +0 -7
  75. package/dist/MountConfig.js.map +0 -1
  76. package/dist/Orchestrator.d.ts +0 -56
  77. package/dist/Orchestrator.d.ts.map +0 -1
  78. package/dist/Orchestrator.js +0 -293
  79. package/dist/Orchestrator.js.map +0 -1
  80. package/dist/Output.d.ts +0 -107
  81. package/dist/Output.d.ts.map +0 -1
  82. package/dist/Output.js +0 -95
  83. package/dist/Output.js.map +0 -1
  84. package/dist/PodmanLifecycle.d.ts +0 -17
  85. package/dist/PodmanLifecycle.d.ts.map +0 -1
  86. package/dist/PodmanLifecycle.js +0 -45
  87. package/dist/PodmanLifecycle.js.map +0 -1
  88. package/dist/PromptArgumentSubstitution.d.ts +0 -32
  89. package/dist/PromptArgumentSubstitution.d.ts.map +0 -1
  90. package/dist/PromptArgumentSubstitution.js +0 -104
  91. package/dist/PromptArgumentSubstitution.js.map +0 -1
  92. package/dist/PromptPreprocessor.d.ts +0 -15
  93. package/dist/PromptPreprocessor.d.ts.map +0 -1
  94. package/dist/PromptPreprocessor.js +0 -55
  95. package/dist/PromptPreprocessor.js.map +0 -1
  96. package/dist/PromptResolver.d.ts +0 -21
  97. package/dist/PromptResolver.d.ts.map +0 -1
  98. package/dist/PromptResolver.js +0 -27
  99. package/dist/PromptResolver.js.map +0 -1
  100. package/dist/RecoveryMessage.d.ts +0 -15
  101. package/dist/RecoveryMessage.d.ts.map +0 -1
  102. package/dist/RecoveryMessage.js +0 -81
  103. package/dist/RecoveryMessage.js.map +0 -1
  104. package/dist/SandboxFactory.d.ts +0 -90
  105. package/dist/SandboxFactory.d.ts.map +0 -1
  106. package/dist/SandboxFactory.js +0 -324
  107. package/dist/SandboxFactory.js.map +0 -1
  108. package/dist/SandboxLifecycle.d.ts +0 -65
  109. package/dist/SandboxLifecycle.d.ts.map +0 -1
  110. package/dist/SandboxLifecycle.js +0 -296
  111. package/dist/SandboxLifecycle.js.map +0 -1
  112. package/dist/SandboxProvider.d.ts.map +0 -1
  113. package/dist/SandboxProvider.js +0 -28
  114. package/dist/SandboxProvider.js.map +0 -1
  115. package/dist/SessionStore.d.ts +0 -110
  116. package/dist/SessionStore.d.ts.map +0 -1
  117. package/dist/SessionStore.js +0 -330
  118. package/dist/SessionStore.js.map +0 -1
  119. package/dist/TextDeltaBuffer.d.ts +0 -24
  120. package/dist/TextDeltaBuffer.d.ts.map +0 -1
  121. package/dist/TextDeltaBuffer.js +0 -68
  122. package/dist/TextDeltaBuffer.js.map +0 -1
  123. package/dist/WorktreeManager.d.ts +0 -79
  124. package/dist/WorktreeManager.d.ts.map +0 -1
  125. package/dist/WorktreeManager.js +0 -283
  126. package/dist/WorktreeManager.js.map +0 -1
  127. package/dist/boundedTail.d.ts +0 -48
  128. package/dist/boundedTail.d.ts.map +0 -1
  129. package/dist/boundedTail.js +0 -64
  130. package/dist/boundedTail.js.map +0 -1
  131. package/dist/cli.d.ts +0 -30
  132. package/dist/cli.d.ts.map +0 -1
  133. package/dist/cli.js +0 -340
  134. package/dist/cli.js.map +0 -1
  135. package/dist/createSandbox.d.ts +0 -154
  136. package/dist/createSandbox.d.ts.map +0 -1
  137. package/dist/createSandbox.js +0 -476
  138. package/dist/createSandbox.js.map +0 -1
  139. package/dist/createWorktree.d.ts +0 -154
  140. package/dist/createWorktree.d.ts.map +0 -1
  141. package/dist/createWorktree.js +0 -391
  142. package/dist/createWorktree.js.map +0 -1
  143. package/dist/errors.d.ts +0 -227
  144. package/dist/errors.d.ts.map +0 -1
  145. package/dist/errors.js +0 -81
  146. package/dist/errors.js.map +0 -1
  147. package/dist/extractStructuredOutput.d.ts +0 -23
  148. package/dist/extractStructuredOutput.d.ts.map +0 -1
  149. package/dist/extractStructuredOutput.js +0 -102
  150. package/dist/extractStructuredOutput.js.map +0 -1
  151. package/dist/index.d.ts.map +0 -1
  152. package/dist/interactive.d.ts +0 -74
  153. package/dist/interactive.d.ts.map +0 -1
  154. package/dist/interactive.js +0 -279
  155. package/dist/interactive.js.map +0 -1
  156. package/dist/main.d.ts.map +0 -1
  157. package/dist/mergeProviderEnv.d.ts +0 -13
  158. package/dist/mergeProviderEnv.d.ts.map +0 -1
  159. package/dist/mergeProviderEnv.js +0 -23
  160. package/dist/mergeProviderEnv.js.map +0 -1
  161. package/dist/mountUtils.d.ts +0 -146
  162. package/dist/mountUtils.d.ts.map +0 -1
  163. package/dist/mountUtils.js +0 -301
  164. package/dist/mountUtils.js.map +0 -1
  165. package/dist/raceAbortSignal.d.ts +0 -18
  166. package/dist/raceAbortSignal.d.ts.map +0 -1
  167. package/dist/raceAbortSignal.js +0 -32
  168. package/dist/raceAbortSignal.js.map +0 -1
  169. package/dist/resolveCwd.d.ts +0 -24
  170. package/dist/resolveCwd.d.ts.map +0 -1
  171. package/dist/resolveCwd.js +0 -32
  172. package/dist/resolveCwd.js.map +0 -1
  173. package/dist/resumePrecheck.d.ts +0 -26
  174. package/dist/resumePrecheck.d.ts.map +0 -1
  175. package/dist/resumePrecheck.js +0 -40
  176. package/dist/resumePrecheck.js.map +0 -1
  177. package/dist/run.d.ts +0 -216
  178. package/dist/run.d.ts.map +0 -1
  179. package/dist/run.js +0 -313
  180. package/dist/run.js.map +0 -1
  181. package/dist/sandboxExec.d.ts +0 -12
  182. package/dist/sandboxExec.d.ts.map +0 -1
  183. package/dist/sandboxExec.js +0 -26
  184. package/dist/sandboxExec.js.map +0 -1
  185. package/dist/sandboxes/daytona.d.ts.map +0 -1
  186. package/dist/sandboxes/docker.d.ts.map +0 -1
  187. package/dist/sandboxes/no-sandbox.d.ts.map +0 -1
  188. package/dist/sandboxes/podman.d.ts.map +0 -1
  189. package/dist/sandboxes/test-bind-mount.d.ts +0 -17
  190. package/dist/sandboxes/test-bind-mount.d.ts.map +0 -1
  191. package/dist/sandboxes/test-bind-mount.js +0 -92
  192. package/dist/sandboxes/test-bind-mount.js.map +0 -1
  193. package/dist/sandboxes/test-isolated.d.ts +0 -17
  194. package/dist/sandboxes/test-isolated.d.ts.map +0 -1
  195. package/dist/sandboxes/test-isolated.js +0 -98
  196. package/dist/sandboxes/test-isolated.js.map +0 -1
  197. package/dist/sandboxes/vercel.d.ts.map +0 -1
  198. package/dist/shutdownRegistry.d.ts +0 -30
  199. package/dist/shutdownRegistry.d.ts.map +0 -1
  200. package/dist/shutdownRegistry.js +0 -73
  201. package/dist/shutdownRegistry.js.map +0 -1
  202. package/dist/startSandbox.d.ts +0 -50
  203. package/dist/startSandbox.d.ts.map +0 -1
  204. package/dist/startSandbox.js +0 -117
  205. package/dist/startSandbox.js.map +0 -1
  206. package/dist/syncIn.d.ts +0 -24
  207. package/dist/syncIn.d.ts.map +0 -1
  208. package/dist/syncIn.js +0 -107
  209. package/dist/syncIn.js.map +0 -1
  210. package/dist/syncOut.d.ts +0 -27
  211. package/dist/syncOut.d.ts.map +0 -1
  212. package/dist/syncOut.js +0 -271
  213. package/dist/syncOut.js.map +0 -1
  214. package/dist/templates.d.ts +0 -2
  215. package/dist/templates.d.ts.map +0 -1
  216. package/dist/templates.js +0 -26
  217. package/dist/templates.js.map +0 -1
  218. package/dist/terminalCleanup.d.ts +0 -30
  219. package/dist/terminalCleanup.d.ts.map +0 -1
  220. package/dist/terminalCleanup.js +0 -37
  221. package/dist/terminalCleanup.js.map +0 -1
  222. package/dist/testSandbox.d.ts +0 -8
  223. package/dist/testSandbox.d.ts.map +0 -1
  224. package/dist/testSandbox.js +0 -109
  225. package/dist/testSandbox.js.map +0 -1
  226. package/dist/testSetup.d.ts +0 -2
  227. package/dist/testSetup.d.ts.map +0 -1
  228. package/dist/testSetup.js +0 -29
  229. package/dist/testSetup.js.map +0 -1
@@ -1,17 +0,0 @@
1
- import { Effect } from "effect";
2
- import { PodmanError } from "./errors.js";
3
- /**
4
- * Build the sandcastle Podman image.
5
- *
6
- * When `containerfile` is provided, uses `podman build -f <containerfile> <cwd>`
7
- * so COPY instructions resolve relative to the current working directory.
8
- * Otherwise, uses `podman build <containerfileDir>` (the default .sandcastle/ directory).
9
- */
10
- export declare const buildImage: (imageName: string, containerfileDir: string, options?: {
11
- readonly containerfile?: string | undefined;
12
- } | undefined) => Effect.Effect<void, PodmanError, never>;
13
- /**
14
- * Remove a Podman image.
15
- */
16
- export declare const removeImage: (imageName: string) => Effect.Effect<void, PodmanError, never>;
17
- //# sourceMappingURL=PodmanLifecycle.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PodmanLifecycle.d.ts","sourceRoot":"","sources":["../src/PodmanLifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAwB1C;;;;;;GAMG;AACH,eAAO,MAAM,UAAU;;yDAkBnB,CAAC;AAEL;;GAEG;AACH,eAAO,MAAM,WAAW,gEAKpB,CAAC"}
@@ -1,45 +0,0 @@
1
- import { Effect } from "effect";
2
- import { execFile } from "node:child_process";
3
- import { resolve } from "node:path";
4
- import { PodmanError } from "./errors.js";
5
- const podmanExec = (args) => Effect.async((resume) => {
6
- execFile("podman", args, { maxBuffer: 10 * 1024 * 1024 }, (error, stdout, stderr) => {
7
- if (error) {
8
- resume(Effect.fail(new PodmanError({
9
- message: `podman ${args[0]} failed: ${stderr?.toString() || error.message}`,
10
- })));
11
- }
12
- else {
13
- resume(Effect.succeed(stdout.toString()));
14
- }
15
- });
16
- });
17
- /**
18
- * Build the sandcastle Podman image.
19
- *
20
- * When `containerfile` is provided, uses `podman build -f <containerfile> <cwd>`
21
- * so COPY instructions resolve relative to the current working directory.
22
- * Otherwise, uses `podman build <containerfileDir>` (the default .sandcastle/ directory).
23
- */
24
- export const buildImage = (imageName, containerfileDir, options) => Effect.gen(function* () {
25
- if (options?.containerfile) {
26
- yield* podmanExec([
27
- "build",
28
- "-t",
29
- imageName,
30
- "-f",
31
- resolve(options.containerfile),
32
- process.cwd(),
33
- ]);
34
- }
35
- else {
36
- yield* podmanExec(["build", "-t", imageName, resolve(containerfileDir)]);
37
- }
38
- });
39
- /**
40
- * Remove a Podman image.
41
- */
42
- export const removeImage = (imageName) => Effect.gen(function* () {
43
- yield* podmanExec(["rmi", imageName]);
44
- });
45
- //# sourceMappingURL=PodmanLifecycle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PodmanLifecycle.js","sourceRoot":"","sources":["../src/PodmanLifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,UAAU,GAAG,CAAC,IAAc,EAAsC,EAAE,CACxE,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,EAAE;IACtB,QAAQ,CACN,QAAQ,EACR,IAAI,EACJ,EAAE,SAAS,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI,EAAE,EAC/B,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;QACxB,IAAI,KAAK,EAAE,CAAC;YACV,MAAM,CACJ,MAAM,CAAC,IAAI,CACT,IAAI,WAAW,CAAC;gBACd,OAAO,EAAE,UAAU,IAAI,CAAC,CAAC,CAAC,YAAY,MAAM,EAAE,QAAQ,EAAE,IAAI,KAAK,CAAC,OAAO,EAAE;aAC5E,CAAC,CACH,CACF,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;QAC5C,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEL;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,SAAiB,EACjB,gBAAwB,EACxB,OAA6C,EACX,EAAE,CACpC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,IAAI,OAAO,EAAE,aAAa,EAAE,CAAC;QAC3B,KAAK,CAAC,CAAC,UAAU,CAAC;YAChB,OAAO;YACP,IAAI;YACJ,SAAS;YACT,IAAI;YACJ,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC;YAC9B,OAAO,CAAC,GAAG,EAAE;SACd,CAAC,CAAC;IACL,CAAC;SAAM,CAAC;QACN,KAAK,CAAC,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAC3E,CAAC;AACH,CAAC,CAAC,CAAC;AAEL;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,SAAiB,EACiB,EAAE,CACpC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,KAAK,CAAC,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC;AACxC,CAAC,CAAC,CAAC"}
@@ -1,32 +0,0 @@
1
- import { Effect } from "effect";
2
- import { Display } from "./Display.js";
3
- import { PromptError } from "./errors.js";
4
- /**
5
- * A map of named values used for prompt argument substitution.
6
- * Each key corresponds to a `{{KEY}}` placeholder in the prompt; the value
7
- * replaces it before the prompt is passed to the agent.
8
- */
9
- export type PromptArgs = Record<string, string | number | boolean>;
10
- /**
11
- * Prompt argument keys that Sandcastle injects automatically.
12
- * These cannot be overridden via `promptArgs`.
13
- */
14
- export declare const BUILT_IN_PROMPT_ARG_KEYS: readonly ["SOURCE_BRANCH", "TARGET_BRANCH"];
15
- /**
16
- * Validates that the user has not provided any built-in prompt argument keys.
17
- * Fails with a PromptError if any built-in key is found in `args`.
18
- */
19
- /**
20
- * Fails if the user passed any `promptArgs` alongside an inline prompt.
21
- * Inline prompts are delivered to the agent verbatim, so `promptArgs` would
22
- * silently do nothing. An empty object is treated as absent.
23
- */
24
- export declare const validateNoArgsWithInlinePrompt: (args: PromptArgs) => Effect.Effect<void, PromptError, never>;
25
- export declare const validateNoBuiltInArgOverride: (args: PromptArgs) => Effect.Effect<void, PromptError, never>;
26
- /**
27
- * Scans a prompt for `{{KEY}}` placeholders and returns the keys that are
28
- * missing from `providedArgs`, excluding built-in keys.
29
- */
30
- export declare const findMissingPromptArgKeys: (prompt: string, providedArgs: PromptArgs) => string[];
31
- export declare const substitutePromptArgs: (prompt: string, args: PromptArgs, silentKeys?: ReadonlySet<string> | undefined) => Effect.Effect<string, PromptError, Display>;
32
- //# sourceMappingURL=PromptArgumentSubstitution.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PromptArgumentSubstitution.d.ts","sourceRoot":"","sources":["../src/PromptArgumentSubstitution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAK1C;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;AAEnE;;;GAGG;AACH,eAAO,MAAM,wBAAwB,6CAG3B,CAAC;AAIX;;;GAGG;AACH;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,+DAU1C,CAAC;AAEF,eAAO,MAAM,4BAA4B,+DAaxC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,wBAAwB,wDAmBpC,CAAC;AAEF,eAAO,MAAM,oBAAoB,iIA4DhC,CAAC"}
@@ -1,104 +0,0 @@
1
- import { Effect } from "effect";
2
- import { Display } from "./Display.js";
3
- import { PromptError } from "./errors.js";
4
- import { SHELL_BLOCK_MARKER } from "./PromptPreprocessor.js";
5
- const SHELL_BLOCK_PATTERN = /!`([^`]+)`/g;
6
- /**
7
- * Prompt argument keys that Sandcastle injects automatically.
8
- * These cannot be overridden via `promptArgs`.
9
- */
10
- export const BUILT_IN_PROMPT_ARG_KEYS = [
11
- "SOURCE_BRANCH",
12
- "TARGET_BRANCH",
13
- ];
14
- const PLACEHOLDER_PATTERN = /\{\{\s*([A-Za-z_][A-Za-z0-9_]*)\s*\}\}/g;
15
- /**
16
- * Validates that the user has not provided any built-in prompt argument keys.
17
- * Fails with a PromptError if any built-in key is found in `args`.
18
- */
19
- /**
20
- * Fails if the user passed any `promptArgs` alongside an inline prompt.
21
- * Inline prompts are delivered to the agent verbatim, so `promptArgs` would
22
- * silently do nothing. An empty object is treated as absent.
23
- */
24
- export const validateNoArgsWithInlinePrompt = (args) => {
25
- if (Object.keys(args).length === 0)
26
- return Effect.void;
27
- return Effect.fail(new PromptError({
28
- message: 'promptArgs is only supported with promptFile. Inline prompts (prompt: "...") are passed to the agent as-is — interpolate values directly in JavaScript, or switch to promptFile to use {{KEY}} substitution.',
29
- }));
30
- };
31
- export const validateNoBuiltInArgOverride = (args) => {
32
- for (const key of BUILT_IN_PROMPT_ARG_KEYS) {
33
- if (key in args) {
34
- return Effect.fail(new PromptError({
35
- message: `"${key}" is a built-in prompt argument and cannot be overridden via promptArgs`,
36
- }));
37
- }
38
- }
39
- return Effect.void;
40
- };
41
- /**
42
- * Scans a prompt for `{{KEY}}` placeholders and returns the keys that are
43
- * missing from `providedArgs`, excluding built-in keys.
44
- */
45
- export const findMissingPromptArgKeys = (prompt, providedArgs) => {
46
- const matches = [...prompt.matchAll(PLACEHOLDER_PATTERN)];
47
- const builtInSet = new Set(BUILT_IN_PROMPT_ARG_KEYS);
48
- const seen = new Set();
49
- const missing = [];
50
- for (const m of matches) {
51
- const key = m[1];
52
- if (seen.has(key))
53
- continue;
54
- seen.add(key);
55
- if (builtInSet.has(key))
56
- continue;
57
- if (key in providedArgs)
58
- continue;
59
- missing.push(key);
60
- }
61
- return missing;
62
- };
63
- export const substitutePromptArgs = (prompt, args, silentKeys) => {
64
- // Mark shell blocks written in the raw template so the preprocessor can
65
- // distinguish them from `!`...`` patterns that arrive via arg substitution.
66
- // Strip any markers already present in raw input so they can't be forged.
67
- const markedPrompt = prompt
68
- .replaceAll(SHELL_BLOCK_MARKER, "")
69
- .replace(SHELL_BLOCK_PATTERN, `!${SHELL_BLOCK_MARKER}\`$1\``);
70
- const sanitizedArgs = Object.fromEntries(Object.entries(args).map(([key, value]) => [
71
- key,
72
- typeof value === "string"
73
- ? value.replaceAll(SHELL_BLOCK_MARKER, "")
74
- : value,
75
- ]));
76
- const matches = [...markedPrompt.matchAll(PLACEHOLDER_PATTERN)];
77
- if (matches.length === 0 && Object.keys(sanitizedArgs).length === 0) {
78
- return Effect.succeed(markedPrompt);
79
- }
80
- return Effect.gen(function* () {
81
- const display = yield* Display;
82
- // Collect all keys referenced in the prompt
83
- const referencedKeys = new Set(matches.map((m) => m[1]));
84
- // Check for missing keys (placeholder in prompt but no matching arg)
85
- for (const key of referencedKeys) {
86
- if (!(key in sanitizedArgs)) {
87
- return yield* Effect.fail(new PromptError({
88
- message: `Prompt argument "{{${key}}}" has no matching value in promptArgs`,
89
- }));
90
- }
91
- }
92
- // Warn about unused keys (arg provided but no matching placeholder)
93
- // Skip keys listed in silentKeys (e.g. built-in args)
94
- for (const key of Object.keys(sanitizedArgs)) {
95
- if (!referencedKeys.has(key) && !silentKeys?.has(key)) {
96
- yield* display.status(`Prompt argument "${key}" was provided but not referenced in the prompt`, "warn");
97
- }
98
- }
99
- // Replace all placeholders with their values
100
- const result = markedPrompt.replace(PLACEHOLDER_PATTERN, (_match, key) => sanitizedArgs[key].toString());
101
- return result;
102
- });
103
- };
104
- //# sourceMappingURL=PromptArgumentSubstitution.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PromptArgumentSubstitution.js","sourceRoot":"","sources":["../src/PromptArgumentSubstitution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,MAAM,mBAAm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,CAAC;QACzB,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,OAAO,CAAC;QAE/B,4CAA4C;QAC5C,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAE,CAAC,CAAC,CAAC;QAE1D,qEAAqE;QACrE,KAAK,MAAM,GAAG,IAAI,cAAc,EAAE,CAAC;YACjC,IAAI,CAAC,CAAC,GAAG,IAAI,aAAa,CAAC,EAAE,CAAC;gBAC5B,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CACvB,IAAI,WAAW,CAAC;oBACd,OAAO,EAAE,sBAAsB,GAAG,yCAAyC;iBAC5E,CAAC,CACH,CAAC;YACJ,CAAC;QACH,CAAC;QAED,oEAAoE;QACpE,sDAAsD;QACtD,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC;YAC7C,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;gBACtD,KAAK,CAAC,CAAC,OAAO,CAAC,MAAM,CACnB,oBAAoB,GAAG,iDAAiD,EACxE,MAAM,CACP,CAAC;YACJ,CAAC;QACH,CAAC;QAED,6CAA6C;QAC7C,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,mBAAmB,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,CACvE,aAAa,CAAC,GAAa,CAAE,CAAC,QAAQ,EAAE,CACzC,CAAC;QAEF,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
@@ -1,15 +0,0 @@
1
- import { Effect } from "effect";
2
- import { Display } from "./Display.js";
3
- import { PromptError, PromptExpansionTimeoutError } from "./errors.js";
4
- import type { ExecError } from "./errors.js";
5
- import type { SandboxService } from "./SandboxFactory.js";
6
- /**
7
- * @internal
8
- * Marker inserted between `!` and the opening backtick for shell blocks that
9
- * appear in the raw template. The preprocessor only executes marked blocks, so
10
- * `!`...`` patterns arriving via argument substitution are treated as data.
11
- * Used only by `substitutePromptArgs`; not part of the public API.
12
- */
13
- export declare const SHELL_BLOCK_MARKER = "\u0001";
14
- export declare const preprocessPrompt: (prompt: string, sandbox: SandboxService, cwd: string) => Effect.Effect<string, ExecError | PromptError | PromptExpansionTimeoutError, Display>;
15
- //# sourceMappingURL=PromptPreprocessor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PromptPreprocessor.d.ts","sourceRoot":"","sources":["../src/PromptPreprocessor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EACL,WAAW,EACX,2BAA2B,EAE5B,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAI1D;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,WAAS,CAAC;AAOzC,eAAO,MAAM,gBAAgB,iJAqE5B,CAAC"}
@@ -1,55 +0,0 @@
1
- import { Effect } from "effect";
2
- import { Display } from "./Display.js";
3
- import { PromptError, PromptExpansionTimeoutError, withTimeout, } from "./errors.js";
4
- const PROMPT_EXPANSION_TIMEOUT_MS = 30_000;
5
- /**
6
- * @internal
7
- * Marker inserted between `!` and the opening backtick for shell blocks that
8
- * appear in the raw template. The preprocessor only executes marked blocks, so
9
- * `!`...`` patterns arriving via argument substitution are treated as data.
10
- * Used only by `substitutePromptArgs`; not part of the public API.
11
- */
12
- export const SHELL_BLOCK_MARKER = "\x01";
13
- const MARKED_SHELL_BLOCK_PATTERN = new RegExp(`!${SHELL_BLOCK_MARKER}\`([^\`]+)\``, "g");
14
- export const preprocessPrompt = (prompt, sandbox, cwd) => {
15
- const matches = [...prompt.matchAll(MARKED_SHELL_BLOCK_PATTERN)];
16
- if (matches.length === 0) {
17
- return Effect.succeed(prompt.replaceAll(SHELL_BLOCK_MARKER, ""));
18
- }
19
- return Effect.gen(function* () {
20
- const display = yield* Display;
21
- return yield* display.taskLog("Expanding shell expressions", (message) => Effect.gen(function* () {
22
- // Execute all commands in parallel
23
- const results = yield* Effect.all(matches.map((match) => {
24
- const command = match[1];
25
- return Effect.flatMap(sandbox.exec(command, { cwd }), (execResult) => execResult.exitCode !== 0
26
- ? Effect.fail(new PromptError({
27
- message: `Command \`${command}\` exited with code ${execResult.exitCode}: ${execResult.stderr}`,
28
- }))
29
- : Effect.succeed(execResult.stdout.trimEnd())).pipe(withTimeout(PROMPT_EXPANSION_TIMEOUT_MS, () => new PromptExpansionTimeoutError({
30
- message: `Shell expression \`${command}\` timed out after ${PROMPT_EXPANSION_TIMEOUT_MS}ms`,
31
- timeoutMs: PROMPT_EXPANSION_TIMEOUT_MS,
32
- expression: command,
33
- })));
34
- }), { concurrency: "unbounded" });
35
- // Log per-command token counts
36
- for (let i = 0; i < matches.length; i++) {
37
- const command = matches[i][1];
38
- const tokens = Math.ceil(results[i].length / 4);
39
- message(`${command} → ~${tokens} tokens`);
40
- }
41
- // Replace all matches using original indices (process in reverse to preserve positions)
42
- let result = prompt;
43
- for (let i = matches.length - 1; i >= 0; i--) {
44
- const match = matches[i];
45
- const index = match.index;
46
- result =
47
- result.slice(0, index) +
48
- results[i] +
49
- result.slice(index + match[0].length);
50
- }
51
- return result.replaceAll(SHELL_BLOCK_MARKER, "");
52
- }));
53
- });
54
- };
55
- //# sourceMappingURL=PromptPreprocessor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PromptPreprocessor.js","sourceRoot":"","sources":["../src/PromptPreprocessor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAA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AK,CAAC,CAAC,EAAE,KAAK,CAAC;wBACtB,OAAO,CAAC,CAAC,CAAC;wBACV,MAAM,CAAC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;YAC1C,CAAC;YACD,OAAO,MAAM,CAAC,UAAU,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;QACnD,CAAC,CAAC,CACH,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
@@ -1,21 +0,0 @@
1
- import { FileSystem } from "@effect/platform";
2
- import { Effect } from "effect";
3
- import { PromptError } from "./errors.js";
4
- export interface ResolvePromptOptions {
5
- readonly prompt?: string;
6
- readonly promptFile?: string;
7
- }
8
- /**
9
- * The resolved prompt text plus the source it came from.
10
- *
11
- * - `inline`: came from `prompt: "..."` — delivered to the agent verbatim.
12
- * No prompt argument substitution, no prompt expansion, no built-in args.
13
- * - `template`: came from `promptFile` — eligible for `{{KEY}}` substitution
14
- * and `` !`command` `` expansion.
15
- */
16
- export interface ResolvedPrompt {
17
- readonly text: string;
18
- readonly source: "inline" | "template";
19
- }
20
- export declare const resolvePrompt: (options: ResolvePromptOptions) => Effect.Effect<ResolvedPrompt, PromptError, FileSystem.FileSystem>;
21
- //# sourceMappingURL=PromptResolver.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PromptResolver.d.ts","sourceRoot":"","sources":["../src/PromptResolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,UAAU,CAAC;CACxC;AAED,eAAO,MAAM,aAAa,sGAuCzB,CAAC"}
@@ -1,27 +0,0 @@
1
- import { FileSystem } from "@effect/platform";
2
- import { Effect } from "effect";
3
- import { PromptError } from "./errors.js";
4
- export const resolvePrompt = (options) => {
5
- const { prompt, promptFile } = options;
6
- if (prompt !== undefined && promptFile !== undefined) {
7
- return Effect.fail(new PromptError({
8
- message: "Cannot provide both --prompt and --prompt-file",
9
- }));
10
- }
11
- if (prompt !== undefined) {
12
- return Effect.succeed({ text: prompt, source: "inline" });
13
- }
14
- if (promptFile === undefined) {
15
- return Effect.fail(new PromptError({
16
- message: "Must provide either prompt or promptFile. Pass prompt: '...' or promptFile: './.sandcastle/prompt.md' to run().",
17
- }));
18
- }
19
- return Effect.gen(function* () {
20
- const fs = yield* FileSystem.FileSystem;
21
- const text = yield* fs.readFileString(promptFile).pipe(Effect.catchAll((e) => Effect.fail(new PromptError({
22
- message: `Failed to read prompt from ${promptFile}: ${e}`,
23
- }))));
24
- return { text, source: "template" };
25
- });
26
- };
27
- //# sourceMappingURL=PromptResolver.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PromptResolver.js","sourceRoot":"","sources":["../src/PromptResolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAoB1C,MAAM,CAAC,MAAM,aAAa,GAAG,CAC3B,OAA6B,EACsC,EAAE;IACrE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IAEvC,IAAI,MAAM,KAAK,SAAS,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QACrD,OAAO,MAAM,CAAC,IAAI,CAChB,IAAI,WAAW,CAAC;YACd,OAAO,EAAE,gDAAgD;SAC1D,CAAC,CACH,CAAC;IACJ,CAAC;IAED,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,MAAM,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC5D,CAAC;IAED,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAO,MAAM,CAAC,IAAI,CAChB,IAAI,WAAW,CAAC;YACd,OAAO,EACL,iHAAiH;SACpH,CAAC,CACH,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;QACzB,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC;QACxC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,EAAE,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,IAAI,CACpD,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,CACpB,MAAM,CAAC,IAAI,CACT,IAAI,WAAW,CAAC;YACd,OAAO,EAAE,8BAA8B,UAAU,KAAK,CAAC,EAAE;SAC1D,CAAC,CACH,CACF,CACF,CAAC;QACF,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,UAAmB,EAAE,CAAC;IAC/C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
@@ -1,15 +0,0 @@
1
- export type FailedStep = "commits" | "diff" | "untracked";
2
- export interface RecoveryInput {
3
- readonly patchDir: string;
4
- readonly failedStep: FailedStep;
5
- readonly hasCommits: boolean;
6
- readonly hasDiff: boolean;
7
- readonly hasUntracked: boolean;
8
- readonly branch?: string;
9
- }
10
- /**
11
- * Build copy-pastable recovery commands for a failed sync-out.
12
- * Pure function: takes failure state, returns formatted terminal output.
13
- */
14
- export declare const buildRecoveryMessage: (input: RecoveryInput) => string;
15
- //# sourceMappingURL=RecoveryMessage.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RecoveryMessage.d.ts","sourceRoot":"","sources":["../src/RecoveryMessage.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,MAAM,GAAG,WAAW,CAAC;AAE1D,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,eAAO,MAAM,oBAAoB,kCAmEhC,CAAC"}
@@ -1,81 +0,0 @@
1
- /**
2
- * Build copy-pastable recovery commands for a failed sync-out.
3
- * Pure function: takes failure state, returns formatted terminal output.
4
- */
5
- export const buildRecoveryMessage = (input) => {
6
- const { patchDir, failedStep, hasCommits, hasDiff, hasUntracked, branch } = input;
7
- // When --branch is set, commands run inside .sandcastle/worktree,
8
- // so patch paths need ../../ prefix to reach repo root
9
- const cmdPatchDir = branch ? `../../${patchDir}` : patchDir;
10
- // Determine the step number for the failed step
11
- const steps = [];
12
- if (hasCommits)
13
- steps.push({ key: "commits", label: "committed changes", has: true });
14
- if (hasDiff)
15
- steps.push({ key: "diff", label: "uncommitted changes", has: true });
16
- if (hasUntracked)
17
- steps.push({ key: "untracked", label: "untracked files", has: true });
18
- const failedIndex = steps.findIndex((s) => s.key === failedStep);
19
- const failedStepInfo = steps[failedIndex];
20
- const stepNumber = failedIndex + 1;
21
- const lines = [];
22
- lines.push(`Patch application failed at step ${stepNumber} (${failedStepInfo.label}).`);
23
- lines.push("");
24
- // Add worktree setup preamble for --branch
25
- if (branch) {
26
- lines.push("Set up worktree, then resolve:");
27
- lines.push(formatCommandBlock([
28
- `git worktree add .sandcastle/worktree ${branch}`,
29
- `cd .sandcastle/worktree`,
30
- ]));
31
- lines.push("");
32
- }
33
- if (failedStep === "commits") {
34
- // git am failure — lean on git's built-in workflow
35
- lines.push("Resolve conflicts, then continue with:");
36
- lines.push(` git am --continue`);
37
- // Remaining steps after git am resolves
38
- const remaining = buildRemainingCommands(cmdPatchDir, steps.slice(failedIndex + 1));
39
- if (remaining.length > 0) {
40
- lines.push("");
41
- lines.push("After all commits are applied, run the remaining steps:");
42
- lines.push(formatCommandBlock(remaining));
43
- }
44
- }
45
- else {
46
- // diff or untracked failure — print remaining commands from failed step onward
47
- const remaining = buildRemainingCommands(cmdPatchDir, steps.slice(failedIndex));
48
- if (remaining.length > 0) {
49
- lines.push("Run the remaining steps:");
50
- lines.push(formatCommandBlock(remaining));
51
- }
52
- }
53
- return lines.join("\n");
54
- };
55
- const buildRemainingCommands = (patchDir, steps) => {
56
- const commands = [];
57
- for (const step of steps) {
58
- if (!step.has)
59
- continue;
60
- if (step.key === "commits") {
61
- commands.push(`git am --3way ${patchDir}/*.patch`);
62
- }
63
- else if (step.key === "diff") {
64
- commands.push(`git apply ${patchDir}/changes.patch`);
65
- }
66
- else if (step.key === "untracked") {
67
- commands.push(`cp -r ${patchDir}/untracked/* .`);
68
- }
69
- }
70
- return commands;
71
- };
72
- const formatCommandBlock = (commands) => {
73
- if (commands.length === 1) {
74
- return ` ${commands[0]}`;
75
- }
76
- // Join with && \ continuation
77
- return commands
78
- .map((cmd, i) => (i < commands.length - 1 ? ` ${cmd} && \\` : ` ${cmd}`))
79
- .join("\n");
80
- };
81
- //# sourceMappingURL=RecoveryMessage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RecoveryMessage.js","sourceRoot":"","sources":["../src/RecoveryMessage.ts"],"names":[],"mappings":"AAWA;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,KAAoB,EAAU,EAAE;IACnE,MAAM,EAAE,QAAQ,EAAE,UAAU,EA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,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;YAC3B,QAAQ,CAAC,IAAI,CAAC,iBAAiB,QAAQ,UAAU,CAAC,CAAC;QACrD,CAAC;aAAM,IAAI,IAAI,CAAC,GAAG,KAAK,MAAM,EAAE,CAAC;YAC/B,QAAQ,CAAC,IAAI,CAAC,aAAa,QAAQ,gBAAgB,CAAC,CAAC;QACvD,CAAC;aAAM,IAAI,IAAI,CAAC,GAAG,KAAK,WAAW,EAAE,CAAC;YACpC,QAAQ,CAAC,IAAI,CAAC,SAAS,QAAQ,gBAAgB,CAAC,CAAC;QACnD,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAC,QAAkB,EAAU,EAAE;IACxD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5B,CAAC;IACD,8BAA8B;IAC9B,OAAO,QAAQ;SACZ,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC;SAC1E,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC,CAAC"}
@@ -1,90 +0,0 @@
1
- import { Context, Effect, Layer } from "effect";
2
- import { FileSystem } from "@effect/platform";
3
- import type { PlatformError } from "@effect/platform/Error";
4
- import { CopyError, ExecError, SyncError, type SandboxError } from "./errors.js";
5
- import type { Timeouts } from "./run.js";
6
- import { Display } from "./Display.js";
7
- import type { SandboxProvider, BranchStrategy, BindMountSandboxHandle, IsolatedSandboxHandle, NoSandboxHandle } from "./SandboxProvider.js";
8
- import { type SandboxHooks } from "./SandboxLifecycle.js";
9
- export interface ExecResult {
10
- readonly stdout: string;
11
- readonly stderr: string;
12
- readonly exitCode: number;
13
- }
14
- export interface SandboxService {
15
- readonly exec: (command: string, options?: {
16
- onLine?: (line: string) => void;
17
- cwd?: string;
18
- sudo?: boolean;
19
- stdin?: string;
20
- }) => Effect.Effect<ExecResult, ExecError>;
21
- /** Copy a file or directory from the host into the sandbox. */
22
- readonly copyIn: (hostPath: string, sandboxPath: string) => Effect.Effect<void, CopyError>;
23
- /** Copy a single file from the sandbox to the host. */
24
- readonly copyFileOut: (sandboxPath: string, hostPath: string) => Effect.Effect<void, CopyError>;
25
- }
26
- declare const Sandbox_base: Context.TagClass<Sandbox, "Sandbox", SandboxService>;
27
- export declare class Sandbox extends Sandbox_base {
28
- }
29
- /**
30
- * Wrap a Promise-based sandbox handle into an Effect-based SandboxService layer.
31
- * Delegates copyIn/copyFileOut to the handle when available.
32
- */
33
- export declare const makeSandboxLayerFromHandle: (handle: BindMountSandboxHandle | IsolatedSandboxHandle | NoSandboxHandle) => Layer.Layer<Sandbox, never, never>;
34
- /** The mount point inside the sandbox where the project worktree is bound. */
35
- export declare const SANDBOX_REPO_DIR = "/home/agent/workspace";
36
- export interface SandboxInfo {
37
- /** Host-side path to the worktree directory (worktree/branch mode only). */
38
- readonly hostWorktreePath?: string;
39
- /** Absolute path to the worktree inside the sandbox, as reported by the provider. */
40
- readonly sandboxRepoPath: string;
41
- /** Sync changes from the sandbox to the host worktree (isolated providers only). */
42
- readonly applyToHost?: () => Effect.Effect<void, SyncError>;
43
- /** The bind-mount sandbox handle, available when the provider is a bind-mount provider. Used for session capture. */
44
- readonly bindMountHandle?: BindMountSandboxHandle;
45
- }
46
- export interface WithSandboxResult<A> {
47
- readonly value: A;
48
- /** Host path to the preserved worktree, set when the worktree was left behind due to uncommitted changes. */
49
- readonly preservedWorktreePath?: string;
50
- }
51
- declare const SandboxFactory_base: Context.TagClass<SandboxFactory, "SandboxFactory", {
52
- readonly withSandbox: <A, E, R>(makeEffect: (info: SandboxInfo) => Effect.Effect<A, E, R | Sandbox>) => Effect.Effect<WithSandboxResult<A>, E | SandboxError, Exclude<R, Sandbox>>;
53
- }>;
54
- export declare class SandboxFactory extends SandboxFactory_base {
55
- }
56
- declare const SandboxConfig_base: Context.TagClass<SandboxConfig, "SandboxConfig", {
57
- readonly env: Record<string, string>;
58
- readonly hostRepoDir: string;
59
- /** Paths relative to the host repo root to copy into the worktree before sandbox start. */
60
- readonly copyToWorktree?: string[] | undefined;
61
- /** When specified, the run name is included in the auto-generated branch and worktree names. */
62
- readonly name?: string | undefined;
63
- /** Sandbox provider — delegates sandbox lifecycle to the provider. */
64
- readonly sandboxProvider: SandboxProvider;
65
- /** Branch strategy — controls how the agent's changes relate to branches. */
66
- readonly branchStrategy: BranchStrategy;
67
- /** Lifecycle hooks grouped by execution location (host or sandbox). */
68
- readonly hooks?: SandboxHooks | undefined;
69
- /** AbortSignal threaded to lifecycle hooks so they can cooperatively cancel. */
70
- readonly signal?: AbortSignal | undefined;
71
- /** Override default timeouts for built-in lifecycle steps. */
72
- readonly timeouts?: Timeouts | undefined;
73
- }>;
74
- export declare class SandboxConfig extends SandboxConfig_base {
75
- }
76
- export interface MountEntry {
77
- readonly hostPath: string;
78
- readonly sandboxPath: string;
79
- }
80
- /**
81
- * Resolves the git-related mounts needed for the sandbox.
82
- * Handles both normal repos (where .git is a directory) and worktrees
83
- * (where .git is a file pointing to the parent repo's .git/worktrees/<name>).
84
- */
85
- export declare const resolveGitMounts: (gitPath: string) => Effect.Effect<MountEntry[], PlatformError, FileSystem.FileSystem>;
86
- export declare const WorktreeDockerSandboxFactory: {
87
- layer: Layer.Layer<SandboxFactory, never, Display | FileSystem.FileSystem | SandboxConfig>;
88
- };
89
- export {};
90
- //# sourceMappingURL=SandboxFactory.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SandboxFactory.d.ts","sourceRoot":"","sources":["../src/SandboxFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAQ,KAAK,E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