Compare commits

..

No commits in common. "9994782748cd103bd3567de73436b2d36db1a4e8" and "9c078ab2a49ecc9cc97638263032a8d0f3ecd612" have entirely different histories.

2 changed files with 3 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@because/sandlot",
"version": "0.0.29",
"version": "0.0.28",
"description": "Sandboxed, branch-based development with Claude",
"type": "module",
"bin": {

View File

@ -334,13 +334,12 @@ export async function exec(workdir: string, command: string): Promise<{ exitCode
/** Pipe input text to Claude in the container with a prompt, returning the output. */
export async function claudePipe(input: string, prompt: string): Promise<{ exitCode: number; stdout: string; stderr: string }> {
const tmpName = `.claude-pipe-${crypto.randomUUID()}`
const tmpPath = join(homedir(), '.sandlot', tmpName)
const tmpPath = join(homedir(), '.sandlot', '.claude-pipe-tmp')
try {
await Bun.write(tmpPath, input)
return await exec(
join(homedir(), '.sandlot'),
`cat /sandlot/${tmpName} | claude -p "${prompt.replace(/"/g, '\\"')}"`,
`cat /sandlot/.claude-pipe-tmp | claude -p "${prompt.replace(/"/g, '\\"')}"`,
)
} finally {
await Bun.file(tmpPath).unlink().catch(() => {})