@ai-hero/sandcastle 0.10.0 → 0.12.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.
- package/README.md +100 -48
- package/dist/{chunk-72UVAC7B.js → chunk-62WN33RK.js} +10 -5
- package/dist/chunk-62WN33RK.js.map +1 -0
- package/dist/{chunk-NSFQW6ML.js → chunk-CP3TYXZA.js} +3 -3
- package/dist/{chunk-NSFQW6ML.js.map → chunk-CP3TYXZA.js.map} +1 -1
- package/dist/{chunk-52CIJF45.js → chunk-DJRHWPEH.js} +3 -3
- package/dist/{chunk-52CIJF45.js.map → chunk-DJRHWPEH.js.map} +1 -1
- package/dist/{chunk-5VM5QZ26.js → chunk-VOG34SRF.js} +72 -48
- package/dist/{chunk-5VM5QZ26.js.map → chunk-VOG34SRF.js.map} +1 -1
- package/dist/index.d.ts +102 -17
- package/dist/index.js +199 -55
- package/dist/index.js.map +1 -1
- package/dist/main.js +6 -6
- package/dist/main.js.map +1 -1
- package/dist/sandboxes/docker.d.ts +1 -1
- package/dist/sandboxes/docker.js +2 -2
- package/dist/sandboxes/no-sandbox.d.ts +1 -1
- package/dist/sandboxes/no-sandbox.js +1 -1
- package/dist/sandboxes/podman.d.ts +1 -1
- package/dist/sandboxes/podman.js +2 -2
- package/dist/sandboxes/podman.js.map +1 -1
- package/dist/sandboxes/vercel.d.ts +1 -1
- package/dist/sandboxes/vercel.js.map +1 -1
- package/dist/templates/blank/main.mts +1 -1
- package/dist/templates/parallel-planner/main.mts +1 -1
- package/dist/templates/parallel-planner-with-review/main.mts +1 -1
- package/dist/templates/simple-loop/main.mts +1 -1
- package/package.json +1 -1
- package/dist/chunk-72UVAC7B.js.map +0 -1
|
@@ -24911,6 +24911,10 @@ var SilentDisplay = {
|
|
|
24911
24911
|
...entries2,
|
|
24912
24912
|
{ _tag: "text", message }
|
|
24913
24913
|
]),
|
|
24914
|
+
textChunk: (chunk4) => Ref_exports.update(ref, (entries2) => [
|
|
24915
|
+
...entries2,
|
|
24916
|
+
{ _tag: "textChunk", message: chunk4 }
|
|
24917
|
+
]),
|
|
24914
24918
|
toolCall: (name, formattedArgs) => Ref_exports.update(ref, (entries2) => [
|
|
24915
24919
|
...entries2,
|
|
24916
24920
|
{ _tag: "toolCall", name, formattedArgs }
|
|
@@ -24927,7 +24931,18 @@ var FileDisplay = {
|
|
|
24927
24931
|
--- Run started: ${(/* @__PURE__ */ new Date()).toISOString()} ---
|
|
24928
24932
|
`;
|
|
24929
24933
|
yield* fs.writeFileString(filePath, delimiter, { flag: "a" }).pipe(Effect_exports.orDie);
|
|
24930
|
-
|
|
24934
|
+
let midLine = false;
|
|
24935
|
+
const appendToLog = (line) => Effect_exports.suspend(() => {
|
|
24936
|
+
const prefix = midLine ? "\n" : "";
|
|
24937
|
+
midLine = false;
|
|
24938
|
+
return fs.writeFileString(filePath, `${prefix}${line}
|
|
24939
|
+
`, { flag: "a" }).pipe(Effect_exports.ignore);
|
|
24940
|
+
});
|
|
24941
|
+
const appendRaw = (chunk4) => Effect_exports.suspend(() => {
|
|
24942
|
+
if (chunk4.length === 0) return Effect_exports.void;
|
|
24943
|
+
midLine = !chunk4.endsWith("\n");
|
|
24944
|
+
return fs.writeFileString(filePath, chunk4, { flag: "a" }).pipe(Effect_exports.ignore);
|
|
24945
|
+
});
|
|
24931
24946
|
return {
|
|
24932
24947
|
intro: () => Effect_exports.void,
|
|
24933
24948
|
status: (message, _severity) => appendToLog(message.replace(/^\[[^\]]+\] /, "")),
|
|
@@ -24959,6 +24974,7 @@ ${lines2}`);
|
|
|
24959
24974
|
return result;
|
|
24960
24975
|
}),
|
|
24961
24976
|
text: (message) => appendToLog(message),
|
|
24977
|
+
textChunk: (chunk4) => appendRaw(chunk4),
|
|
24962
24978
|
toolCall: (name, formattedArgs) => appendToLog(`${name}(${formattedArgs})`)
|
|
24963
24979
|
};
|
|
24964
24980
|
})
|
|
@@ -25013,6 +25029,7 @@ var ClackDisplay = {
|
|
|
25013
25029
|
})
|
|
25014
25030
|
),
|
|
25015
25031
|
text: (message) => Effect_exports.sync(() => clack.log.message(message)),
|
|
25032
|
+
textChunk: (chunk4) => Effect_exports.sync(() => clack.log.message(chunk4)),
|
|
25016
25033
|
toolCall: (name, formattedArgs) => Effect_exports.sync(
|
|
25017
25034
|
() => clack.log.step(terminalStyle.toolCall(`${name}(${formattedArgs})`))
|
|
25018
25035
|
)
|
|
@@ -25284,7 +25301,7 @@ var create = (repoDir, opts) => Effect_exports.gen(function* () {
|
|
|
25284
25301
|
}
|
|
25285
25302
|
yield* Effect_exports.fail(
|
|
25286
25303
|
new WorktreeError({
|
|
25287
|
-
message: `Branch '${branch}' is already checked out in worktree at '${collision.path}'.
|
|
25304
|
+
message: `Branch '${branch}' is already checked out in worktree at '${collision.path}'. Sandcastle's branch and merge-to-head strategies run the agent in a git worktree under .sandcastle/worktrees/, and git refuses to check out the same branch in two worktrees at once (HEAD would become ambiguous). Pick a different branch, or switch the main working tree to a different branch before re-running.`
|
|
25288
25305
|
})
|
|
25289
25306
|
);
|
|
25290
25307
|
}
|
|
@@ -26020,7 +26037,11 @@ ${err instanceof Error ? err.message : String(err)}`
|
|
|
26020
26037
|
return false;
|
|
26021
26038
|
}
|
|
26022
26039
|
});
|
|
26023
|
-
|
|
26040
|
+
if (!options.keepSourceBranch) {
|
|
26041
|
+
yield* execOk2(sandbox3, "git checkout --detach", {
|
|
26042
|
+
cwd: sandboxRepoDir
|
|
26043
|
+
});
|
|
26044
|
+
}
|
|
26024
26045
|
if (hasNewCommits) {
|
|
26025
26046
|
yield* display.taskLog(
|
|
26026
26047
|
`Merging to ${hostCurrentBranch}`,
|
|
@@ -26052,12 +26073,14 @@ ${err instanceof Error ? err.message : String(err)}`
|
|
|
26052
26073
|
)
|
|
26053
26074
|
);
|
|
26054
26075
|
}
|
|
26055
|
-
|
|
26056
|
-
|
|
26057
|
-
|
|
26058
|
-
|
|
26059
|
-
|
|
26060
|
-
|
|
26076
|
+
if (!options.keepSourceBranch) {
|
|
26077
|
+
yield* Effect_exports.promise(
|
|
26078
|
+
() => execAsync(`git branch -D "${resolvedBranch}"`, {
|
|
26079
|
+
cwd: hostRepoDir
|
|
26080
|
+
}).catch(() => {
|
|
26081
|
+
})
|
|
26082
|
+
);
|
|
26083
|
+
}
|
|
26061
26084
|
commits = yield* display.taskLog(
|
|
26062
26085
|
"Collecting commits",
|
|
26063
26086
|
() => Effect_exports.promise(async () => {
|
|
@@ -26640,16 +26663,11 @@ var WorktreeDockerSandboxFactory = {
|
|
|
26640
26663
|
Effect_exports.flatMap(
|
|
26641
26664
|
(gitMounts) => (
|
|
26642
26665
|
// Patch git mounts for Windows worktree compatibility (ADR-0006)
|
|
26643
|
-
|
|
26644
|
-
|
|
26645
|
-
|
|
26646
|
-
|
|
26647
|
-
|
|
26648
|
-
),
|
|
26649
|
-
catch: (e) => new WorktreeError({
|
|
26650
|
-
message: `Failed to patch git mounts: ${e instanceof Error ? e.message : String(e)}`
|
|
26651
|
-
})
|
|
26652
|
-
})
|
|
26666
|
+
patchGitMountsForWindows(
|
|
26667
|
+
gitMounts,
|
|
26668
|
+
hostRepoDir,
|
|
26669
|
+
SANDBOX_REPO_DIR
|
|
26670
|
+
)
|
|
26653
26671
|
)
|
|
26654
26672
|
),
|
|
26655
26673
|
Effect_exports.flatMap(
|
|
@@ -26719,16 +26737,11 @@ var WorktreeDockerSandboxFactory = {
|
|
|
26719
26737
|
),
|
|
26720
26738
|
// Patch git mounts for Windows worktree compatibility (ADR-0006)
|
|
26721
26739
|
Effect_exports.flatMap(
|
|
26722
|
-
(gitMounts) =>
|
|
26723
|
-
|
|
26724
|
-
|
|
26725
|
-
|
|
26726
|
-
|
|
26727
|
-
),
|
|
26728
|
-
catch: (e) => new WorktreeError({
|
|
26729
|
-
message: `Failed to patch git mounts: ${e instanceof Error ? e.message : String(e)}`
|
|
26730
|
-
})
|
|
26731
|
-
})
|
|
26740
|
+
(gitMounts) => patchGitMountsForWindows(
|
|
26741
|
+
gitMounts,
|
|
26742
|
+
worktreeInfo.path,
|
|
26743
|
+
SANDBOX_REPO_DIR
|
|
26744
|
+
)
|
|
26732
26745
|
),
|
|
26733
26746
|
Effect_exports.flatMap(
|
|
26734
26747
|
(gitMounts) => Effect_exports.acquireUseRelease(
|
|
@@ -26850,7 +26863,7 @@ var parseGitdirPath = (gitdirPath) => {
|
|
|
26850
26863
|
const parentGitDir = segments.join("/");
|
|
26851
26864
|
return { worktreeName, parentGitDir };
|
|
26852
26865
|
};
|
|
26853
|
-
var patchGitMountsForWindows =
|
|
26866
|
+
var patchGitMountsForWindows = (gitMounts, worktreeHostPath, sandboxRepoDir, readFile2, statFile, platform = process.platform) => Effect_exports.gen(function* () {
|
|
26854
26867
|
if (platform !== "win32") return gitMounts;
|
|
26855
26868
|
const _readFile = readFile2 ?? (async (p) => {
|
|
26856
26869
|
const { readFile: rf } = await import('fs/promises');
|
|
@@ -26862,28 +26875,39 @@ var patchGitMountsForWindows = async (gitMounts, worktreeHostPath, sandboxRepoDi
|
|
|
26862
26875
|
return s.isDirectory() ? "directory" : "file";
|
|
26863
26876
|
});
|
|
26864
26877
|
const gitEntryPath = join$1(worktreeHostPath, ".git");
|
|
26865
|
-
|
|
26866
|
-
|
|
26867
|
-
|
|
26868
|
-
}
|
|
26869
|
-
|
|
26870
|
-
}
|
|
26878
|
+
const gitEntryType = yield* Effect_exports.tryPromise({
|
|
26879
|
+
try: () => _statFile(gitEntryPath),
|
|
26880
|
+
catch: () => null
|
|
26881
|
+
}).pipe(Effect_exports.catchAll(() => Effect_exports.succeed(null)));
|
|
26882
|
+
if (gitEntryType === null) return gitMounts;
|
|
26871
26883
|
if (gitEntryType === "directory") return gitMounts;
|
|
26872
|
-
|
|
26873
|
-
|
|
26874
|
-
|
|
26875
|
-
}
|
|
26876
|
-
|
|
26877
|
-
|
|
26884
|
+
const content = yield* Effect_exports.tryPromise({
|
|
26885
|
+
try: () => _readFile(gitEntryPath),
|
|
26886
|
+
catch: () => null
|
|
26887
|
+
}).pipe(
|
|
26888
|
+
Effect_exports.map((s) => s.trim()),
|
|
26889
|
+
Effect_exports.catchAll(() => Effect_exports.succeed(null))
|
|
26890
|
+
);
|
|
26891
|
+
if (content === null) return gitMounts;
|
|
26878
26892
|
const match18 = content.match(/^gitdir:\s*(.+)$/);
|
|
26879
26893
|
if (!match18) return gitMounts;
|
|
26880
26894
|
const gitdirPath = match18[1];
|
|
26881
26895
|
const { parentGitDir, worktreeName } = parseGitdirPath(gitdirPath);
|
|
26882
26896
|
const correctedGitdir = `${PARENT_GIT_SANDBOX_DIR}/worktrees/${worktreeName}`;
|
|
26883
|
-
const tempDir =
|
|
26897
|
+
const tempDir = yield* Effect_exports.tryPromise({
|
|
26898
|
+
try: () => mkdtemp(join$1(tmpdir(), "sandcastle-git-")),
|
|
26899
|
+
catch: (e) => new WorktreeError({
|
|
26900
|
+
message: `Failed to create temp dir for git override: ${e instanceof Error ? e.message : String(e)}`
|
|
26901
|
+
})
|
|
26902
|
+
});
|
|
26884
26903
|
const tempGitFile = join$1(tempDir, "git-override");
|
|
26885
|
-
|
|
26886
|
-
`
|
|
26904
|
+
yield* Effect_exports.tryPromise({
|
|
26905
|
+
try: () => writeFile(tempGitFile, `gitdir: ${correctedGitdir}
|
|
26906
|
+
`),
|
|
26907
|
+
catch: (e) => new WorktreeError({
|
|
26908
|
+
message: `Failed to write git override file: ${e instanceof Error ? e.message : String(e)}`
|
|
26909
|
+
})
|
|
26910
|
+
});
|
|
26887
26911
|
const normalizedParentGitDir = parentGitDir.replace(/\\/g, "/");
|
|
26888
26912
|
const gitFileHostPath = gitEntryPath.replace(/\\/g, "/");
|
|
26889
26913
|
const correctedMounts = [];
|
|
@@ -26910,7 +26934,7 @@ var patchGitMountsForWindows = async (gitMounts, worktreeHostPath, sandboxRepoDi
|
|
|
26910
26934
|
});
|
|
26911
26935
|
}
|
|
26912
26936
|
return correctedMounts;
|
|
26913
|
-
};
|
|
26937
|
+
});
|
|
26914
26938
|
var formatVolumeMount = (mount, selinuxLabel) => {
|
|
26915
26939
|
const base = `${mount.hostPath}:${mount.sandboxPath}`;
|
|
26916
26940
|
const options = [mount.readonly ? "ro" : void 0, selinuxLabel || void 0].filter((option5) => option5 !== void 0).join(",");
|
|
@@ -26984,5 +27008,5 @@ var registerShutdown = (teardown) => {
|
|
|
26984
27008
|
};
|
|
26985
27009
|
|
|
26986
27010
|
export { AgentError, AgentIdleTimeoutError, BadArgument, BaseProto, ClackDisplay, Clock_exports, CommandExecutor2 as CommandExecutor, CommitPrototype2 as CommitPrototype, ConfigDirError, Context_exports, CwdError, Date$, Deferred_exports, Display, DockerError, Duration_exports, Effect_exports, ExitCode2 as ExitCode, Fiber_exports, FileDescriptor, FileDisplay, FileSystem, FileSystem_exports, FileTypeId, GenericTag, InitError, Int, Layer_exports, Literal2 as Literal, NumberFromString, Option_exports, Path2 as Path, PlatformWorker2 as PlatformWorker, PodmanError, ProcessId2 as ProcessId, ProcessTypeId2 as ProcessTypeId, PromptError, PromptExpansionTimeoutError, QuitException, Ref_exports, SANDBOX_REPO_DIR, SandboxConfig, SandboxFactory, SessionCaptureError, SilentDisplay, Size2 as Size, String$, SystemError, Terminal, TreeFormatter, TypeId28 as TypeId, WatchBackend, WatchEventCreate, WatchEventRemove, WatchEventUpdate, WorkerError, WorktreeDockerSandboxFactory, _await3 as _await, _void, acquireRelease2 as acquireRelease, addFinalizer2 as addFinalizer, addFinalizer3 as addFinalizer2, allLevels, allocate, append, appendAll, as7 as as, asVoid5 as asVoid, async2 as async, asyncScoped2 as asyncScoped, boolean, cached, catchAll3 as catchAll, catchAllCause3 as catchAllCause, catchIf2 as catchIf, catchSome2 as catchSome, catchTag2 as catchTag, catchTags2 as catchTags, combine, complete2 as complete, compose4 as compose, cons, constUndefined, constVoid, contains2 as contains, contextWithEffect2 as contextWithEffect, copyToWorktree, create, decode2 as decode, decodeUnknown3 as decodeUnknown, defaultImageName, die7 as die, dieMessage2 as dieMessage, drain3 as drain, drop, dual, effect, effectify2 as effectify, embedInput2 as embedInput, empty2 as empty, empty10 as empty2, ensuring3 as ensuring, ensuring6 as ensuring2, equals, error2 as error, every, fail3 as fail, fail10 as fail2, failCause7 as failCause, failSync4 as failSync, filter2 as filter, filter8 as filter2, filterMap2 as filterMap, filterOrDieMessage2 as filterOrDieMessage, findFirst2 as findFirst, findFirstIndex, findLast, flatMap, flatMap2, flatMap11 as flatMap3, flatMap16 as flatMap4, flatten8 as flatten, flatten15 as flatten2, fnUntraced2 as fnUntraced, forEach8 as forEach, forkDaemon2 as forkDaemon, formatVolumeMount, fromChannel4 as fromChannel, fromChannel3 as fromChannel2, fromEffect9 as fromEffect, fromIterable2 as fromIterable, fromIterable6 as fromIterable2, fromIterable7 as fromIterable3, fromNullable, fromString2 as fromString, gen3 as gen, generateTempBranchName, get7 as get, get11 as get2, get14 as get3, get15 as get4, getCurrentBranch, getOption2 as getOption, getOrElse, getOrThrow2 as getOrThrow, getSomes, globalValue, has4 as has, hasUncommittedChanges, hash, head, headNonEmpty, identity, ignore2 as ignore, int, interruptible4 as interruptible, is, isArray, isConfig2 as isConfig, isConfigError2 as isConfigError, isDone5 as isDone, isEffect2 as isEffect, isEmpty4 as isEmpty, isEmptyReadonlyArray, isMissingDataOnly2 as isMissingDataOnly, isNil, isNonEmptyReadonlyArray, isNone2 as isNone, isObject, isOption2 as isOption, isQuitException, isSome2 as isSome, isTagged, join, layerManager2 as layerManager, left2 as left, log4 as log, make4 as make, make57 as make10, make13 as make2, make16 as make3, make25 as make4, make42 as make5, make47 as make6, make54 as make7, make60 as make8, make53 as make9, makeExecutor2 as makeExecutor, makePlatform2 as makePlatform, makeRunMain, makeSandboxFromHandle, map2 as map, map3 as map2, map18 as map3, mapBoth5 as mapBoth, mapError4 as mapError, mapInput2 as mapInput, match2 as match, match3 as match2, match14 as match3, matchEffect3 as matchEffect, matchLeft, matchRight, merge, mergeAll6 as mergeAll, negate2 as negate, none2 as none, of, of3 as of2, orDie3 as orDie, orElse, orElse6 as orElse2, orElse12 as orElse3, orElseFail2 as orElseFail, patchGitMountsForWindows, pipe, pipeArguments, prepend, processFileMountParents, provide2 as provide, provide3 as provide2, provideMerge2 as provideMerge, provideService3 as provideService, provideServiceEffect2 as provideServiceEffect, pruneStale, reduce, reduceRight, registerShutdown, remove8 as remove, repeatN2 as repeatN, resolveCwd, resolveGitMounts, resolveUserMounts, right2 as right, round, run5 as run, runHostHooks, runSync, scoped3 as scoped, scoped4 as scoped2, serviceOption2 as serviceOption, set3 as set, some2 as some, some3 as some2, sort, span, splitAt, startSandbox, stdin2 as stdin, string, string2, succeed10 as succeed, succeed11 as succeed2, suspend4 as suspend, suspend9 as suspend2, symbol, symbol2, sync6 as sync, syncOut, taggedEnum, tailNonEmpty, take, tap4 as tap, timeout2 as timeout, toStringUnknown, transduce2 as transduce, tryPromise2 as tryPromise, try_2 as try_, unify2 as unify, uninterruptible2 as uninterruptible, unlessEffect2 as unlessEffect, unsafeDone, unsafeFromArray, unsafeGet, unsafeMakeLatch2 as unsafeMakeLatch, unsafeMakeSemaphore2 as unsafeMakeSemaphore, unwrap5 as unwrap, unwrapScoped7 as unwrapScoped, update3 as update, updateAndGet2 as updateAndGet, updateEffect2 as updateEffect, value2 as value, void_4 as void_, void_8 as void_2, when2 as when, when4 as when2, withMinimumLogLevel2 as withMinimumLogLevel, withSandboxLifecycle, write2 as write, zip6 as zip, zipLeft6 as zipLeft, zipRight6 as zipRight, zipWith8 as zipWith };
|
|
26987
|
-
//# sourceMappingURL=chunk-
|
|
26988
|
-
//# sourceMappingURL=chunk-
|
|
27011
|
+
//# sourceMappingURL=chunk-VOG34SRF.js.map
|
|
27012
|
+
//# sourceMappingURL=chunk-VOG34SRF.js.map
|