@ai-hero/sandcastle 0.1.8 → 0.2.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 (46) hide show
  1. package/README.md +151 -30
  2. package/dist/AgentProvider.d.ts +28 -4
  3. package/dist/AgentProvider.d.ts.map +1 -1
  4. package/dist/AgentProvider.js +193 -49
  5. package/dist/AgentProvider.js.map +1 -1
  6. package/dist/InitService.d.ts +16 -3
  7. package/dist/InitService.d.ts.map +1 -1
  8. package/dist/InitService.js +166 -19
  9. package/dist/InitService.js.map +1 -1
  10. package/dist/Orchestrator.d.ts +7 -34
  11. package/dist/Orchestrator.d.ts.map +1 -1
  12. package/dist/Orchestrator.js +32 -104
  13. package/dist/Orchestrator.js.map +1 -1
  14. package/dist/SandboxFactory.d.ts +8 -4
  15. package/dist/SandboxFactory.d.ts.map +1 -1
  16. package/dist/SandboxFactory.js +65 -26
  17. package/dist/SandboxFactory.js.map +1 -1
  18. package/dist/WorktreeManager.d.ts +5 -5
  19. package/dist/WorktreeManager.d.ts.map +1 -1
  20. package/dist/WorktreeManager.js +8 -8
  21. package/dist/WorktreeManager.js.map +1 -1
  22. package/dist/cli.d.ts +3 -0
  23. package/dist/cli.d.ts.map +1 -1
  24. package/dist/cli.js +75 -27
  25. package/dist/cli.js.map +1 -1
  26. package/dist/createSandbox.d.ts +82 -0
  27. package/dist/createSandbox.d.ts.map +1 -0
  28. package/dist/createSandbox.js +192 -0
  29. package/dist/createSandbox.js.map +1 -0
  30. package/dist/index.d.ts +5 -1
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +2 -0
  33. package/dist/index.js.map +1 -1
  34. package/dist/run.d.ts +20 -6
  35. package/dist/run.d.ts.map +1 -1
  36. package/dist/run.js +36 -31
  37. package/dist/run.js.map +1 -1
  38. package/dist/templates/blank/.env.example +4 -0
  39. package/dist/templates/blank/main.ts +2 -1
  40. package/dist/templates/parallel-planner/.env.example +4 -0
  41. package/dist/templates/parallel-planner/main.ts +4 -4
  42. package/dist/templates/sequential-reviewer/.env.example +4 -0
  43. package/dist/templates/sequential-reviewer/main.ts +3 -3
  44. package/dist/templates/simple-loop/.env.example +4 -0
  45. package/dist/templates/simple-loop/main.ts +6 -5
  46. package/package.json +1 -1
@@ -59,7 +59,7 @@ for (let iteration = 1; iteration <= MAX_ITERATIONS; iteration++) {
59
59
  copyToSandbox,
60
60
  name: "implementer",
61
61
  maxIterations: 100,
62
- model: "claude-sonnet-4-6",
62
+ agent: sandcastle.claudeCode("claude-sonnet-4-6"),
63
63
  promptFile: "./.sandcastle/implement-prompt.md",
64
64
  });
65
65
 
@@ -86,14 +86,14 @@ for (let iteration = 1; iteration <= MAX_ITERATIONS; iteration++) {
86
86
  copyToSandbox,
87
87
  name: "reviewer",
88
88
  maxIterations: 10,
89
- model: "claude-sonnet-4-6",
89
+ agent: sandcastle.claudeCode("claude-sonnet-4-6"),
90
90
  promptFile: "./.sandcastle/review-prompt.md",
91
91
  // Prompt arguments substitute {{BRANCH}} in review-prompt.md before the
92
92
  // agent sees the prompt.
93
93
  promptArgs: {
94
94
  BRANCH: branch,
95
95
  },
96
- branch,
96
+ worktree: { mode: "branch", branch },
97
97
  });
98
98
 
99
99
  console.log("\nReview complete.");
@@ -0,0 +1,4 @@
1
+ # Anthropic API key
2
+ ANTHROPIC_API_KEY=
3
+ # GitHub personal access token
4
+ GH_TOKEN=
@@ -1,4 +1,4 @@
1
- import { run } from "@ai-hero/sandcastle";
1
+ import { run, claudeCode } from "@ai-hero/sandcastle";
2
2
 
3
3
  // Simple loop: an agent that picks open GitHub issues one by one and closes them.
4
4
  // Run this with: npx tsx .sandcastle/main.ts
@@ -8,6 +8,11 @@ await run({
8
8
  // A name for this run, shown as a prefix in log output.
9
9
  name: "worker",
10
10
 
11
+ // The agent provider. Pass a model string to claudeCode() — sonnet balances
12
+ // capability and speed for most tasks. Switch to claude-opus-4-6 for harder
13
+ // problems, or claude-haiku-4-5-20251001 for speed.
14
+ agent: claudeCode("claude-sonnet-4-6"),
15
+
11
16
  // Path to the prompt file. Shell expressions inside are evaluated inside the
12
17
  // sandbox at the start of each iteration, so the agent always sees fresh data.
13
18
  promptFile: "./.sandcastle/prompt.md",
@@ -17,10 +22,6 @@ await run({
17
22
  // per run, or set it to 1 for a single-shot mode.
18
23
  maxIterations: 3,
19
24
 
20
- // The Claude model to use. Sonnet balances capability and speed for most tasks.
21
- // Switch to claude-opus-4-6 for harder problems, or claude-haiku-4-5 for speed.
22
- model: "claude-sonnet-4-6",
23
-
24
25
  // Copy node_modules from the host into the worktree before the sandbox
25
26
  // starts. This avoids a full npm install from scratch on every iteration.
26
27
  // The onSandboxReady hook still runs npm install as a safety net to handle
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-hero/sandcastle",
3
- "version": "0.1.8",
3
+ "version": "0.2.0",
4
4
  "description": "CLI for orchestrating AI agents in isolated sandbox environments",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",