@snappedly-tools/shipyard 0.9.2 → 0.10.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 +4 -2
- package/dist/{chunk-NQRFVKCU.js → chunk-2SEMX2NX.js} +2 -2
- package/dist/{chunk-NQRFVKCU.js.map → chunk-2SEMX2NX.js.map} +1 -1
- package/dist/{chunk-57EEKW3R.js → chunk-BAP7BWQ2.js} +17 -8
- package/dist/chunk-BAP7BWQ2.js.map +1 -0
- package/dist/{chunk-HXSZM52J.js → chunk-IVE7QDGC.js} +17 -11
- package/dist/chunk-IVE7QDGC.js.map +1 -0
- package/dist/{chunk-JZUBT4WG.js → chunk-KSTSHZNH.js} +3 -3
- package/dist/{chunk-JZUBT4WG.js.map → chunk-KSTSHZNH.js.map} +1 -1
- package/dist/{createSandbox-DmbnWAZv.d.ts → createSandbox-Bqopwday.d.ts} +6 -4
- package/dist/index.d.ts +2 -2
- package/dist/index.js +58 -13
- package/dist/index.js.map +1 -1
- package/dist/integrations/github.js +1 -1
- package/dist/main.js +26 -7
- package/dist/main.js.map +1 -1
- package/dist/sandboxes/docker.js +2 -2
- package/dist/templates/parallel-planner/block-scope.sh +6 -0
- package/dist/templates/parallel-planner/handoff.sh +7 -2
- package/dist/templates/parallel-planner/main.mts +25 -14
- package/dist/templates/parallel-planner/setup.sh +8 -1
- package/dist/templates/parallel-planner/triage-prompt.md +3 -1
- package/dist/templates/parallel-planner-with-review/block-scope.sh +6 -0
- package/dist/templates/parallel-planner-with-review/handoff.sh +7 -2
- package/dist/templates/parallel-planner-with-review/main.mts +26 -15
- package/dist/templates/parallel-planner-with-review/setup.sh +8 -1
- package/dist/templates/parallel-planner-with-review/triage-prompt.md +3 -1
- package/dist/templates/sequential-reviewer/block-scope.sh +6 -0
- package/dist/templates/sequential-reviewer/handoff.sh +7 -2
- package/dist/templates/sequential-reviewer/main.mts +21 -14
- package/dist/templates/sequential-reviewer/setup.sh +8 -1
- package/dist/templates/sequential-reviewer/triage-prompt.md +3 -1
- package/dist/templates/shared/block-scope.sh +6 -0
- package/dist/templates/shared/handoff.sh +7 -2
- package/dist/templates/shared/setup.sh +8 -1
- package/dist/templates/shared/triage-prompt.md +3 -1
- package/dist/templates/simple-loop/block-scope.sh +6 -0
- package/dist/templates/simple-loop/handoff.sh +7 -2
- package/dist/templates/simple-loop/main.mts +20 -13
- package/dist/templates/simple-loop/setup.sh +8 -1
- package/dist/templates/simple-loop/triage-prompt.md +3 -1
- package/dist/workflow.d.ts +1 -1
- package/dist/workflow.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-57EEKW3R.js.map +0 -1
- package/dist/chunk-HXSZM52J.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { CODEX_MODELS, resolveEnv, formatErrorMessage, buildLogDirectoryName } from './chunk-
|
|
2
|
-
export { CODEX_MODELS, CODEX_REASONING_EFFORTS } from './chunk-
|
|
3
|
-
import { CwdError, resolveCwd, getCurrentBranch, generateTempBranchName, assertNoSymlinkComponents, FileDisplay, ClackDisplay, WorktreeDockerSandboxFactory, SandboxConfig, Display, CLI_NAME, PRODUCT_NAME, pruneStale, create, runHostHooks, startSandbox, remove, makeSandboxFromHandle, withSandboxLifecycle, hasUncommittedChanges, shellQuote, registerShutdown, toSessionTransferHandle, syncOut, PromptError, CONFIG_DIR, LOGS_DIR, SandboxFactory, AgentError, SessionCaptureError, PromptExpansionTimeoutError, assertExcludesRepositoryRunner, resolveSafeRelativePath, CopyToWorktreeError, withTimeout, CopyToWorktreeTimeoutError, SilentDisplay, AgentIdleTimeoutError } from './chunk-
|
|
4
|
-
export { createIsolatedSandboxProvider } from './chunk-
|
|
1
|
+
import { CODEX_MODELS, resolveEnv, formatErrorMessage, buildLogDirectoryName } from './chunk-IVE7QDGC.js';
|
|
2
|
+
export { CODEX_MODELS, CODEX_REASONING_EFFORTS, REASONING_EFFORTS } from './chunk-IVE7QDGC.js';
|
|
3
|
+
import { CwdError, resolveCwd, getCurrentBranch, generateTempBranchName, assertNoSymlinkComponents, FileDisplay, ClackDisplay, WorktreeDockerSandboxFactory, SandboxConfig, Display, CLI_NAME, PRODUCT_NAME, pruneStale, create, runHostHooks, startSandbox, remove, makeSandboxFromHandle, withSandboxLifecycle, hasUncommittedChanges, shellQuote, registerShutdown, toSessionTransferHandle, syncOut, PromptError, CONFIG_DIR, LOGS_DIR, SandboxFactory, AgentError, SessionCaptureError, PromptExpansionTimeoutError, assertExcludesRepositoryRunner, resolveSafeRelativePath, CopyToWorktreeError, withTimeout, CopyToWorktreeTimeoutError, SilentDisplay, AgentIdleTimeoutError } from './chunk-BAP7BWQ2.js';
|
|
4
|
+
export { createIsolatedSandboxProvider } from './chunk-BAP7BWQ2.js';
|
|
5
5
|
import { extractStructuredOutput, StructuredOutputError } from './chunk-Z5C4LHVP.js';
|
|
6
6
|
export { Output, StructuredOutputError } from './chunk-Z5C4LHVP.js';
|
|
7
7
|
import { NodeContext, NodeFileSystem } from '@effect/platform-node';
|
|
@@ -1282,11 +1282,11 @@ var interactive = async (options) => {
|
|
|
1282
1282
|
)
|
|
1283
1283
|
)
|
|
1284
1284
|
);
|
|
1285
|
-
const
|
|
1285
|
+
const startResult = yield* Effect.gen(function* () {
|
|
1286
1286
|
if (hooks?.host?.onWorktreeReady?.length) {
|
|
1287
1287
|
yield* runHostHooks(hooks.host.onWorktreeReady, worktreeInfo.path);
|
|
1288
1288
|
}
|
|
1289
|
-
const
|
|
1289
|
+
const startResult2 = yield* d.taskLog(
|
|
1290
1290
|
"Starting sandbox",
|
|
1291
1291
|
() => startSandbox({
|
|
1292
1292
|
provider: sandboxProvider,
|
|
@@ -1297,7 +1297,7 @@ var interactive = async (options) => {
|
|
|
1297
1297
|
copyTimeoutMs: options.timeouts?.copyToWorktreeMs
|
|
1298
1298
|
})
|
|
1299
1299
|
);
|
|
1300
|
-
return
|
|
1300
|
+
return startResult2;
|
|
1301
1301
|
}).pipe(
|
|
1302
1302
|
Effect.tapError(
|
|
1303
1303
|
() => worktreeInfo ? remove(worktreeInfo.path).pipe(
|
|
@@ -1305,6 +1305,7 @@ var interactive = async (options) => {
|
|
|
1305
1305
|
) : Effect.void
|
|
1306
1306
|
)
|
|
1307
1307
|
);
|
|
1308
|
+
const handle = startResult.handle;
|
|
1308
1309
|
return yield* Effect.gen(function* () {
|
|
1309
1310
|
if (!handle.interactiveExec) {
|
|
1310
1311
|
throw new Error(
|
|
@@ -1314,7 +1315,7 @@ var interactive = async (options) => {
|
|
|
1314
1315
|
const interactiveExecFn = handle.interactiveExec.bind(handle);
|
|
1315
1316
|
const sandbox = makeSandboxFromHandle(handle);
|
|
1316
1317
|
const worktreePath = handle.worktreePath;
|
|
1317
|
-
const applyToHost = () => syncOut(worktreeInfo.path, handle);
|
|
1318
|
+
const applyToHost = () => syncOut(worktreeInfo.path, handle, startResult.copiedPaths);
|
|
1318
1319
|
const lifecycleEffect = withSandboxLifecycle(
|
|
1319
1320
|
{
|
|
1320
1321
|
hostRepoDir,
|
|
@@ -1439,10 +1440,34 @@ var runRequiredSandboxHook = (sandbox, command, cwd, sudo) => Effect.flatMap(
|
|
|
1439
1440
|
(result) => result.exitCode === 0 ? Effect.succeed(result) : Effect.fail(
|
|
1440
1441
|
new Error(
|
|
1441
1442
|
`Sandbox setup failed (exit ${result.exitCode}): ${command}
|
|
1442
|
-
${result.stderr}`
|
|
1443
|
+
${result.stderr || result.stdout}`
|
|
1443
1444
|
)
|
|
1444
1445
|
)
|
|
1445
1446
|
);
|
|
1447
|
+
var logSetupFailure = async (hostRepoDir, branch, error) => {
|
|
1448
|
+
const logPath = buildDefaultLogPath(hostRepoDir, branch, void 0, "setup");
|
|
1449
|
+
try {
|
|
1450
|
+
await assertNoSymlinkComponents(hostRepoDir, logPath, "setup log path");
|
|
1451
|
+
await Effect.runPromise(
|
|
1452
|
+
Effect.gen(function* () {
|
|
1453
|
+
const display = yield* Display;
|
|
1454
|
+
yield* display.status(
|
|
1455
|
+
error instanceof Error ? error.message : String(error),
|
|
1456
|
+
"error"
|
|
1457
|
+
);
|
|
1458
|
+
}).pipe(
|
|
1459
|
+
Effect.provide(
|
|
1460
|
+
Layer.provide(FileDisplay.layer(logPath), NodeFileSystem.layer)
|
|
1461
|
+
)
|
|
1462
|
+
)
|
|
1463
|
+
);
|
|
1464
|
+
console.error(`Sandbox setup log: ${logPath}`);
|
|
1465
|
+
} catch (logError) {
|
|
1466
|
+
console.error(
|
|
1467
|
+
`Could not write sandbox setup log: ${logError instanceof Error ? logError.message : String(logError)}`
|
|
1468
|
+
);
|
|
1469
|
+
}
|
|
1470
|
+
};
|
|
1446
1471
|
var buildSandboxHandle = (ctx, close) => {
|
|
1447
1472
|
const {
|
|
1448
1473
|
branch,
|
|
@@ -1715,6 +1740,7 @@ var createSandboxFromWorktree = async (options) => {
|
|
|
1715
1740
|
let providerHandle;
|
|
1716
1741
|
let sandbox;
|
|
1717
1742
|
let sandboxRepoDir;
|
|
1743
|
+
let copiedPaths = [];
|
|
1718
1744
|
if (isTestMode) {
|
|
1719
1745
|
sandbox = options._test.buildSandbox(worktreePath);
|
|
1720
1746
|
sandboxRepoDir = worktreePath;
|
|
@@ -1742,6 +1768,7 @@ var createSandboxFromWorktree = async (options) => {
|
|
|
1742
1768
|
providerHandle = startResult.handle;
|
|
1743
1769
|
sandbox = startResult.sandbox;
|
|
1744
1770
|
sandboxRepoDir = startResult.worktreePath;
|
|
1771
|
+
copiedPaths = startResult.copiedPaths;
|
|
1745
1772
|
}
|
|
1746
1773
|
const sandboxOnReady = options.hooks?.sandbox?.onSandboxReady;
|
|
1747
1774
|
const hostOnReady = options.hooks?.host?.onSandboxReady;
|
|
@@ -1767,6 +1794,9 @@ var createSandboxFromWorktree = async (options) => {
|
|
|
1767
1794
|
concurrency: "unbounded"
|
|
1768
1795
|
});
|
|
1769
1796
|
}).pipe(
|
|
1797
|
+
Effect.tapError(
|
|
1798
|
+
(error) => Effect.promise(() => logSetupFailure(hostRepoDir, branch, error))
|
|
1799
|
+
),
|
|
1770
1800
|
Effect.onError(
|
|
1771
1801
|
() => providerHandle ? Effect.promise(() => providerHandle.close().catch(() => {
|
|
1772
1802
|
})) : Effect.void
|
|
@@ -1774,7 +1804,11 @@ var createSandboxFromWorktree = async (options) => {
|
|
|
1774
1804
|
)
|
|
1775
1805
|
);
|
|
1776
1806
|
}
|
|
1777
|
-
const applyToHost = providerHandle ? () => syncOut(
|
|
1807
|
+
const applyToHost = providerHandle ? () => syncOut(
|
|
1808
|
+
worktreePath,
|
|
1809
|
+
providerHandle,
|
|
1810
|
+
copiedPaths
|
|
1811
|
+
) : () => Effect.void;
|
|
1778
1812
|
let closed = false;
|
|
1779
1813
|
const sessionTransferHandle = toSessionTransferHandle(providerHandle);
|
|
1780
1814
|
return buildSandboxHandle(
|
|
@@ -1801,6 +1835,7 @@ var createSandboxFromWorktree = async (options) => {
|
|
|
1801
1835
|
var createSandbox = async (options) => {
|
|
1802
1836
|
const { branch } = options;
|
|
1803
1837
|
const isTestMode = !!options._test?.buildSandbox;
|
|
1838
|
+
let copiedPaths = [];
|
|
1804
1839
|
const { hostRepoDir, worktreePath, providerHandle, sandbox, sandboxRepoDir } = await Effect.runPromise(
|
|
1805
1840
|
Effect.gen(function* () {
|
|
1806
1841
|
const hostRepoDir2 = yield* resolveCwd(options.cwd);
|
|
@@ -1844,6 +1879,7 @@ var createSandbox = async (options) => {
|
|
|
1844
1879
|
providerHandle2 = startResult.handle;
|
|
1845
1880
|
sandbox2 = startResult.sandbox;
|
|
1846
1881
|
sandboxRepoDir2 = startResult.worktreePath;
|
|
1882
|
+
copiedPaths = startResult.copiedPaths;
|
|
1847
1883
|
}
|
|
1848
1884
|
const sandboxOnReady = options.hooks?.sandbox?.onSandboxReady;
|
|
1849
1885
|
const hostOnReady = options.hooks?.host?.onSandboxReady;
|
|
@@ -1866,6 +1902,11 @@ var createSandbox = async (options) => {
|
|
|
1866
1902
|
}
|
|
1867
1903
|
yield* Effect.all(allEffects, { concurrency: "unbounded" });
|
|
1868
1904
|
}).pipe(
|
|
1905
|
+
Effect.tapError(
|
|
1906
|
+
(error) => Effect.promise(
|
|
1907
|
+
() => logSetupFailure(hostRepoDir2, branch, error)
|
|
1908
|
+
)
|
|
1909
|
+
),
|
|
1869
1910
|
Effect.onError(
|
|
1870
1911
|
() => providerHandle2 ? Effect.promise(
|
|
1871
1912
|
() => providerHandle2.close().catch(() => {
|
|
@@ -1885,7 +1926,11 @@ var createSandbox = async (options) => {
|
|
|
1885
1926
|
return { hostRepoDir: hostRepoDir2, worktreePath: worktreePath2, ...prepared };
|
|
1886
1927
|
}).pipe(Effect.provide(NodeContext.layer))
|
|
1887
1928
|
);
|
|
1888
|
-
const applyToHost = providerHandle ? () => syncOut(
|
|
1929
|
+
const applyToHost = providerHandle ? () => syncOut(
|
|
1930
|
+
worktreePath,
|
|
1931
|
+
providerHandle,
|
|
1932
|
+
copiedPaths
|
|
1933
|
+
) : () => Effect.void;
|
|
1889
1934
|
let closed = false;
|
|
1890
1935
|
const forceCleanup = () => {
|
|
1891
1936
|
console.error(`
|
|
@@ -2107,7 +2152,7 @@ var createWorktree = async (options) => {
|
|
|
2107
2152
|
const interactiveExecFn = handle.interactiveExec.bind(handle);
|
|
2108
2153
|
const sandbox = makeSandboxFromHandle(handle);
|
|
2109
2154
|
const worktreePath = handle.worktreePath;
|
|
2110
|
-
const applyToHost = () => syncOut(worktreeInfo.path, handle);
|
|
2155
|
+
const applyToHost = () => syncOut(worktreeInfo.path, handle, startResult.copiedPaths);
|
|
2111
2156
|
const lifecycleEffect = withSandboxLifecycle(
|
|
2112
2157
|
{
|
|
2113
2158
|
hostRepoDir,
|
|
@@ -2225,7 +2270,7 @@ var createWorktree = async (options) => {
|
|
|
2225
2270
|
const handle = startResult.handle;
|
|
2226
2271
|
const sandboxRepoDir = startResult.worktreePath;
|
|
2227
2272
|
const sandbox = makeSandboxFromHandle(handle);
|
|
2228
|
-
const applyToHost = () => syncOut(worktreeInfo.path, handle);
|
|
2273
|
+
const applyToHost = () => syncOut(worktreeInfo.path, handle, startResult.copiedPaths);
|
|
2229
2274
|
const resolvedLogging = opts.logging ?? {
|
|
2230
2275
|
type: "file",
|
|
2231
2276
|
path: buildDefaultLogPath(
|