@snappedly-tools/shipyard 0.7.0-staging.36082887921 → 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 (41) hide show
  1. package/README.md +41 -34
  2. package/dist/MountConfig-bZoCs4Dd.d.ts +26 -0
  3. package/dist/SandboxProvider-XJQqEdSf.d.ts +261 -0
  4. package/dist/{chunk-JI3HDDMS.js → chunk-56TDSWFU.js} +3 -3
  5. package/dist/{chunk-JI3HDDMS.js.map → chunk-56TDSWFU.js.map} +1 -1
  6. package/dist/chunk-ACD46ZM4.js +136 -0
  7. package/dist/chunk-ACD46ZM4.js.map +1 -0
  8. package/dist/{chunk-L6PX5QTU.js → chunk-FDYOTN55.js} +887 -262
  9. package/dist/chunk-FDYOTN55.js.map +1 -0
  10. package/dist/chunk-KMGNFXKN.js +38 -0
  11. package/dist/chunk-KMGNFXKN.js.map +1 -0
  12. package/dist/chunk-SOJTAJTF.js +78 -0
  13. package/dist/chunk-SOJTAJTF.js.map +1 -0
  14. package/dist/{chunk-44I2BL6E.js → chunk-WAXEMZUV.js} +33 -225
  15. package/dist/chunk-WAXEMZUV.js.map +1 -0
  16. package/dist/index.d.ts +97 -117
  17. package/dist/index.js +344 -322
  18. package/dist/index.js.map +1 -1
  19. package/dist/main.js +139 -235
  20. package/dist/main.js.map +1 -1
  21. package/dist/sandboxes/docker.d.ts +3 -1
  22. package/dist/sandboxes/docker.js +4 -2
  23. package/dist/sandboxes/no-sandbox.d.ts +37 -0
  24. package/dist/sandboxes/no-sandbox.js +4 -0
  25. package/dist/sandboxes/no-sandbox.js.map +1 -0
  26. package/dist/sandboxes/vercel.d.ts +104 -0
  27. package/dist/sandboxes/vercel.js +166 -0
  28. package/dist/sandboxes/vercel.js.map +1 -0
  29. package/dist/templates/blank/main.mts +13 -0
  30. package/dist/templates/blank/prompt.md +12 -0
  31. package/dist/templates/blank/template.json +4 -0
  32. package/dist/templates/parallel-planner/main.mts +9 -67
  33. package/dist/templates/parallel-planner-with-review/main.mts +12 -70
  34. package/dist/templates/sequential-reviewer/main.mts +3 -52
  35. package/dist/templates/simple-loop/main.mts +2 -51
  36. package/package.json +17 -1
  37. package/dist/MountConfig-BHnKnA4h.d.ts +0 -145
  38. package/dist/chunk-44I2BL6E.js.map +0 -1
  39. package/dist/chunk-L6PX5QTU.js.map +0 -1
  40. package/dist/templates/parallel-planner/planner-branch.mts +0 -151
  41. package/dist/templates/parallel-planner-with-review/planner-branch.mts +0 -151
@@ -1,4 +1,5 @@
1
- import { M as MountConfig, I as IsolatedSandboxProvider } from '../MountConfig-BHnKnA4h.js';
1
+ import { I as IsolatedSandboxProvider } from '../SandboxProvider-XJQqEdSf.js';
2
+ import { M as MountConfig } from '../MountConfig-bZoCs4Dd.js';
2
3
 
3
4
  /**
4
5
  * Shared mount utilities for the Docker sandbox provider.
@@ -15,6 +16,7 @@ import { M as MountConfig, I as IsolatedSandboxProvider } from '../MountConfig-B
15
16
  * - `false` — disable labeling entirely.
16
17
  */
17
18
  type SelinuxLabel = "z" | "Z" | false;
19
+
18
20
  /**
19
21
  * Derive the default image name from the repo directory.
20
22
  * Returns `shipyard:<dir-name>` where dir-name is the last path segment,
@@ -1,4 +1,6 @@
1
- export { defaultImageName, docker } from '../chunk-44I2BL6E.js';
2
- import '../chunk-L6PX5QTU.js';
1
+ export { docker } from '../chunk-WAXEMZUV.js';
2
+ export { defaultImageName } from '../chunk-FDYOTN55.js';
3
+ import '../chunk-KMGNFXKN.js';
4
+ import '../chunk-ACD46ZM4.js';
3
5
  //# sourceMappingURL=docker.js.map
4
6
  //# sourceMappingURL=docker.js.map
@@ -0,0 +1,37 @@
1
+ import { N as NoSandboxProvider } from '../SandboxProvider-XJQqEdSf.js';
2
+
3
+ /**
4
+ * No-sandbox provider — runs the agent directly on the host with no container isolation.
5
+ *
6
+ * Usage:
7
+ * import { noSandbox } from "@snappedly-tools/shipyard/sandboxes/no-sandbox";
8
+ * await run({ agent: codex(CODEX_MODELS.routine), sandbox: noSandbox(), prompt: "..." });
9
+ *
10
+ * Accepted by `run()`, `interactive()`, and `createSandbox()`. It skips
11
+ * container isolation entirely and does not pass
12
+ * `--dangerously-skip-permissions` to the agent.
13
+ */
14
+
15
+ interface NoSandboxOptions {
16
+ /** Environment variables injected by this provider. Merged at launch time. */
17
+ readonly env?: Record<string, string>;
18
+ /**
19
+ * Maximum number of characters of streamed `exec` output retained per stream
20
+ * (stdout and stderr) when an `onLine` callback is supplied (default: 64KiB).
21
+ *
22
+ * Output is delivered live to `onLine` regardless; this only bounds the tail
23
+ * returned in `ExecResult`, preventing a long-running agent's output from
24
+ * overflowing V8's max string length and crashing the run.
25
+ */
26
+ readonly maxOutputTailChars?: number;
27
+ }
28
+ /**
29
+ * Create a no-sandbox provider.
30
+ *
31
+ * The returned provider runs the agent directly on the host. All three
32
+ * branch strategies are supported (head, merge-to-head, branch),
33
+ * defaulting to head.
34
+ */
35
+ declare const noSandbox: (options?: NoSandboxOptions) => NoSandboxProvider;
36
+
37
+ export { type NoSandboxOptions, noSandbox };
@@ -0,0 +1,4 @@
1
+ export { noSandbox } from '../chunk-SOJTAJTF.js';
2
+ import '../chunk-ACD46ZM4.js';
3
+ //# sourceMappingURL=no-sandbox.js.map
4
+ //# sourceMappingURL=no-sandbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"no-sandbox.js"}
@@ -0,0 +1,104 @@
1
+ import { I as IsolatedSandboxProvider } from '../SandboxProvider-XJQqEdSf.js';
2
+
3
+ /**
4
+ * Vercel isolated sandbox provider — wraps `@vercel/sandbox` into a SandboxProvider.
5
+ *
6
+ * Usage:
7
+ * import { vercel } from "@snappedly-tools/shipyard/sandboxes/vercel";
8
+ * await run({ agent: codex(CODEX_MODELS.routine), sandbox: vercel() });
9
+ */
10
+
11
+ /**
12
+ * Options for creating a Vercel sandbox provider.
13
+ *
14
+ * All `@vercel/sandbox` `Sandbox.create()` options are accepted as pass-through,
15
+ * plus Shipyard-specific options for auth and branch strategy.
16
+ */
17
+ interface VercelOptions {
18
+ /**
19
+ * Vercel access token.
20
+ *
21
+ * Falls back to the SDK's default auth behavior, which reads
22
+ * `VERCEL_OIDC_TOKEN` (recommended for Vercel-hosted environments) or
23
+ * `VERCEL_TOKEN` from the environment.
24
+ */
25
+ readonly token?: string;
26
+ /**
27
+ * The source of the sandbox (git repo, tarball, or snapshot).
28
+ * Omit to start an empty sandbox.
29
+ */
30
+ readonly source?: {
31
+ type: "git";
32
+ url: string;
33
+ depth?: number;
34
+ revision?: string;
35
+ username?: string;
36
+ password?: string;
37
+ } | {
38
+ type: "tarball";
39
+ url: string;
40
+ } | {
41
+ type: "snapshot";
42
+ snapshotId: string;
43
+ };
44
+ /** Array of port numbers to expose from the sandbox (up to 4). */
45
+ readonly ports?: number[];
46
+ /** Timeout in milliseconds before the sandbox auto-terminates. */
47
+ readonly timeout?: number;
48
+ /**
49
+ * Resources to allocate to the sandbox.
50
+ * Each vCPU gets 2048 MB of memory.
51
+ */
52
+ readonly resources?: {
53
+ vcpus: number;
54
+ };
55
+ /**
56
+ * The runtime of the sandbox (e.g. `"node24"`, `"node22"`, `"python3.13"`).
57
+ * Defaults to `"node24"`.
58
+ */
59
+ readonly runtime?: string;
60
+ /**
61
+ * Network policy for the sandbox.
62
+ * Defaults to full internet access if not specified.
63
+ */
64
+ readonly networkPolicy?: Record<string, unknown>;
65
+ /**
66
+ * Vercel project ID to associate sandbox operations with.
67
+ */
68
+ readonly projectId?: string;
69
+ /**
70
+ * Vercel team ID to associate sandbox operations with.
71
+ */
72
+ readonly teamId?: string;
73
+ /**
74
+ * Timeout in milliseconds (alias for `timeout`, kept for discoverability).
75
+ */
76
+ readonly timeoutMs?: number;
77
+ /**
78
+ * Sandbox template shorthand (e.g. `"node-22"`).
79
+ * Maps to the `runtime` option.
80
+ */
81
+ readonly template?: string;
82
+ /** Environment variables injected by this provider. Merged at launch time with env resolver and agent provider env. */
83
+ readonly env?: Record<string, string>;
84
+ /**
85
+ * Maximum number of characters of streamed `exec` output retained per stream
86
+ * (stdout and stderr) when an `onLine` callback is supplied (default: 64KiB).
87
+ *
88
+ * Output is delivered live to `onLine` regardless; this only bounds the tail
89
+ * returned in `ExecResult`, preventing a long-running agent's output from
90
+ * overflowing V8's max string length and crashing the run.
91
+ */
92
+ readonly maxOutputTailChars?: number;
93
+ }
94
+ /**
95
+ * Create a Vercel isolated sandbox provider.
96
+ *
97
+ * The returned provider creates Vercel Firecracker microVM sandboxes via
98
+ * the `@vercel/sandbox` SDK. Each sandbox is ephemeral — one sandbox per run.
99
+ *
100
+ * Requires `@vercel/sandbox` to be installed as a peer dependency.
101
+ */
102
+ declare const vercel: (options?: VercelOptions) => IsolatedSandboxProvider;
103
+
104
+ export { type VercelOptions, vercel };
@@ -0,0 +1,166 @@
1
+ import { createIsolatedSandboxProvider, shellQuote } from '../chunk-KMGNFXKN.js';
2
+ import { MAX_TAIL_CHARS, StreamedProcessOutput } from '../chunk-ACD46ZM4.js';
3
+ import { execFileSync } from 'child_process';
4
+ import { mkdir, lstat, writeFile, chmod, mkdtemp, readFile, rm } from 'fs/promises';
5
+ import { randomUUID } from 'crypto';
6
+ import { tmpdir } from 'os';
7
+ import { dirname, join } from 'path';
8
+ import { Writable } from 'stream';
9
+
10
+ var VERCEL_REPO_PATH = "/vercel/sandbox/workspace";
11
+ var vercel = (options) => createIsolatedSandboxProvider({
12
+ name: "vercel",
13
+ env: options?.env,
14
+ create: async (createOptions) => {
15
+ const maxOutputTailChars = options?.maxOutputTailChars ?? MAX_TAIL_CHARS;
16
+ const { Sandbox } = await import('@vercel/sandbox');
17
+ const createParams = {};
18
+ if (options?.source) createParams.source = options.source;
19
+ if (options?.ports) createParams.ports = options.ports;
20
+ if (options?.resources) createParams.resources = options.resources;
21
+ if (options?.networkPolicy)
22
+ createParams.networkPolicy = options.networkPolicy;
23
+ const resolvedRuntime = options?.runtime ?? options?.template;
24
+ if (resolvedRuntime) createParams.runtime = resolvedRuntime;
25
+ const timeoutValue = options?.timeout ?? options?.timeoutMs;
26
+ if (timeoutValue !== void 0) createParams.timeout = timeoutValue;
27
+ createParams.env = createOptions.env;
28
+ if (options?.token) createParams.token = options.token;
29
+ if (options?.projectId) createParams.projectId = options.projectId;
30
+ if (options?.teamId) createParams.teamId = options.teamId;
31
+ const sandbox = await Sandbox.create(
32
+ createParams
33
+ );
34
+ await sandbox.mkDir(VERCEL_REPO_PATH);
35
+ const handle = {
36
+ worktreePath: VERCEL_REPO_PATH,
37
+ exec: async (command, opts) => {
38
+ if (opts?.onLine || opts?.maxOutputBytes !== void 0) {
39
+ const output = new StreamedProcessOutput({
40
+ ...opts,
41
+ maxOutputTailChars
42
+ });
43
+ let partial = "";
44
+ const stdoutWritable = new Writable({
45
+ write(chunk, _encoding, callback) {
46
+ const error = output.checkLimit(chunk.toString());
47
+ if (error !== void 0) {
48
+ callback(error);
49
+ return;
50
+ }
51
+ const text = partial + chunk.toString();
52
+ const lines = text.split("\n");
53
+ partial = lines.pop() ?? "";
54
+ for (const line of lines) {
55
+ output.addStdoutLine(line);
56
+ }
57
+ callback();
58
+ },
59
+ final(callback) {
60
+ if (partial) {
61
+ output.addStdoutLine(partial);
62
+ partial = "";
63
+ }
64
+ callback();
65
+ }
66
+ });
67
+ const stderrWritable = new Writable({
68
+ write(chunk, _encoding, callback) {
69
+ const error = output.checkLimit(chunk.toString());
70
+ if (error !== void 0) {
71
+ callback(error);
72
+ return;
73
+ }
74
+ output.addStderr(chunk.toString());
75
+ callback();
76
+ }
77
+ });
78
+ const result2 = await sandbox.runCommand({
79
+ cmd: "sh",
80
+ args: ["-c", command],
81
+ cwd: opts?.cwd ?? VERCEL_REPO_PATH,
82
+ stdout: stdoutWritable,
83
+ stderr: stderrWritable,
84
+ ...opts?.sudo ? { sudo: true } : {}
85
+ });
86
+ if (output.error !== void 0) throw output.error;
87
+ return output.result(result2.exitCode);
88
+ }
89
+ const result = await sandbox.runCommand({
90
+ cmd: "sh",
91
+ args: ["-c", command],
92
+ cwd: opts?.cwd ?? VERCEL_REPO_PATH,
93
+ ...opts?.sudo ? { sudo: true } : {}
94
+ });
95
+ const stdout = await result.stdout();
96
+ const stderr = await result.stderr();
97
+ return {
98
+ stdout,
99
+ stderr,
100
+ exitCode: result.exitCode
101
+ };
102
+ },
103
+ copyIn: async (hostPath, sandboxPath) => {
104
+ const info = await lstat(hostPath);
105
+ if (info.isSymbolicLink()) {
106
+ throw new Error(`Refusing to copy a symbolic link: ${hostPath}`);
107
+ }
108
+ if (info.isDirectory()) {
109
+ const tempDir = await mkdtemp(join(tmpdir(), "shipyard-copyin-"));
110
+ const tarPath = join(tempDir, "archive.tar.gz");
111
+ try {
112
+ execFileSync("tar", ["-czf", tarPath, "-C", hostPath, "."]);
113
+ const tarContent = await readFile(tarPath);
114
+ const sandboxTarPath = `/tmp/shipyard-copyin-${randomUUID()}.tar.gz`;
115
+ await sandbox.writeFiles([
116
+ { path: sandboxTarPath, content: tarContent }
117
+ ]);
118
+ await sandbox.runCommand({
119
+ cmd: "sh",
120
+ args: [
121
+ "-c",
122
+ `mkdir -p ${shellQuote(sandboxPath)} && tar -xzf ${shellQuote(sandboxTarPath)} -C ${shellQuote(sandboxPath)} && rm -f ${shellQuote(sandboxTarPath)}`
123
+ ]
124
+ });
125
+ } finally {
126
+ await rm(tempDir, { recursive: true, force: true }).catch(
127
+ () => {
128
+ }
129
+ );
130
+ }
131
+ } else {
132
+ const content = await readFile(hostPath);
133
+ await sandbox.writeFiles([{ path: sandboxPath, content }]);
134
+ }
135
+ },
136
+ copyFileOut: async (sandboxPath, hostPath) => {
137
+ const buffer = await sandbox.readFileToBuffer({
138
+ path: sandboxPath
139
+ });
140
+ if (!buffer) {
141
+ throw new Error(`File not found in Vercel sandbox: ${sandboxPath}`);
142
+ }
143
+ await mkdir(dirname(hostPath), { recursive: true, mode: 448 });
144
+ try {
145
+ if ((await lstat(hostPath)).isSymbolicLink()) {
146
+ throw new Error(
147
+ `Refusing to overwrite symbolic link: ${hostPath}`
148
+ );
149
+ }
150
+ } catch (error) {
151
+ if (error.code !== "ENOENT") throw error;
152
+ }
153
+ await writeFile(hostPath, buffer, { mode: 384 });
154
+ await chmod(hostPath, 384);
155
+ },
156
+ close: async () => {
157
+ await sandbox.stop();
158
+ }
159
+ };
160
+ return handle;
161
+ }
162
+ });
163
+
164
+ export { vercel };
165
+ //# sourceMappingURL=vercel.js.map
166
+ //# sourceMappingURL=vercel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/sandboxes/vercel.ts"],"names":["result"],"mappings":";;;;;;;;;AAiCA,IAAM,gBAAA,GAAmB,2BAAA;AA+GlB,IAAM,MAAA,GAAS,CAAC,OAAA,KACrB,6BAAA,CAA8B;AAAA,EAC5B,IAAA,EAAM,QAAA;AAAA,EACN,KAAK,OAAA,EAAS,GAAA;AAAA,EACd,MAAA,EAAQ,OAAO,aAAA,KAAkD;AAC/D,IAAA,MAAM,kBAAA,GAAqB,SAAS,kBAAA,IAAsB,cAAA;AAE1D,IAAA,MAAM,EAAE,OAAA,EAAQ,GAAI,MAAM,OAAO,iBAAiB,CAAA;AAElD,IAAA,MAAM,eAAwC,EAAC;AAG/C,IAAA,IAAI,OAAA,EAAS,MAAA,EAAQ,YAAA,CAAa,MAAA,GAAS,OAAA,CAAQ,MAAA;AACnD,IAAA,IAAI,OAAA,EAAS,KAAA,EAAO,YAAA,CAAa,KAAA,GAAQ,OAAA,CAAQ,KAAA;AACjD,IAAA,IAAI,OAAA,EAAS,SAAA,EAAW,YAAA,CAAa,SAAA,GAAY,OAAA,CAAQ,SAAA;AACzD,IAAA,IAAI,OAAA,EAAS,aAAA;AACX,MAAA,YAAA,CAAa,gBAAgB,OAAA,CAAQ,aAAA;AAEvC,IAAA,MAAM,eAAA,GAAkB,OAAA,EAAS,OAAA,IAAW,OAAA,EAAS,QAAA;AACrD,IAAA,IAAI,eAAA,eAA8B,OAAA,GAAU,eAAA;AAG5C,IAAA,MAAM,YAA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AAA,MAAM,KAAA,CAAM,QAAQ,QAAQ,CAAA,EAAG,EAAE,SAAA,EAAW,IAAA,EAAM,IAAA,EAAM,GAAA,EAAO,CAAA;AAC/D,QAAA,IAAI;AACF,UAAA,IAAA,CAAK,MAAM,KAAA,CAAM,QAAQ,CAAA,EAAG,gBAAe,EAAG;AAC5C,YAAA,MAAM,IAAI,KAAA;AAAA,cACR,wCAAwC,QAAQ,CAAA;AAAA,aAClD;AAAA,UACF;AAAA,QACF,SAAS,KAAA,EAAO;AACd,UAAA,IAAK,KAAA,CAAgC,IAAA,KAAS,QAAA,EAAU,MAAM,KAAA;AAAA,QAChE;AACA,QAAA,MAAM,UAAU,QAAA,EAAU,MAAA,EAAQ,EAAE,IAAA,EAAM,KAAO,CAAA;AACjD,QAAA,MAAM,KAAA,CAAM,UAAU,GAAK,CAAA;AAAA,MAC7B,CAAA;AAAA,MAEA,OAAO,YAA2B;AAChC,QAAA,MAAM,QAAQ,IAAA,EAAK;AAAA,MACrB;AAAA,KACF;AAEA,IAAA,OAAO,MAAA;AAAA,EACT;AACF,CAAC","file":"vercel.js","sourcesContent":["/**\n * Vercel isolated sandbox provider — wraps `@vercel/sandbox` into a SandboxProvider.\n *\n * Usage:\n * import { vercel } from \"@snappedly-tools/shipyard/sandboxes/vercel\";\n * await run({ agent: codex(CODEX_MODELS.routine), sandbox: vercel() });\n */\n\nimport { execFileSync } from \"node:child_process\";\nimport {\n lstat,\n chmod,\n mkdir,\n mkdtemp,\n readFile,\n rm,\n writeFile,\n} from \"node:fs/promises\";\nimport { randomUUID } from \"node:crypto\";\nimport { tmpdir } from \"node:os\";\nimport { dirname, join } from \"node:path\";\nimport { Writable } from \"node:stream\";\nimport {\n createIsolatedSandboxProvider,\n type ExecResult,\n type IsolatedSandboxHandle,\n type IsolatedSandboxProvider,\n} from \"../SandboxProvider.js\";\nimport { MAX_TAIL_CHARS } from \"../boundedTail.js\";\nimport { StreamedProcessOutput } from \"../processOutput.js\";\nimport { shellQuote } from \"../shellQuote.js\";\n\n/** Worktree path inside the Vercel sandbox. */\nconst VERCEL_REPO_PATH = \"/vercel/sandbox/workspace\";\n\n/**\n * Options for creating a Vercel sandbox provider.\n *\n * All `@vercel/sandbox` `Sandbox.create()` options are accepted as pass-through,\n * plus Shipyard-specific options for auth and branch strategy.\n */\nexport interface VercelOptions {\n /**\n * Vercel access token.\n *\n * Falls back to the SDK's default auth behavior, which reads\n * `VERCEL_OIDC_TOKEN` (recommended for Vercel-hosted environments) or\n * `VERCEL_TOKEN` from the environment.\n */\n readonly token?: string;\n\n // ---- Pass-through @vercel/sandbox Sandbox.create() options ----\n\n /**\n * The source of the sandbox (git repo, tarball, or snapshot).\n * Omit to start an empty sandbox.\n */\n readonly source?:\n | {\n type: \"git\";\n url: string;\n depth?: number;\n revision?: string;\n username?: string;\n password?: string;\n }\n | {\n type: \"tarball\";\n url: string;\n }\n | {\n type: \"snapshot\";\n snapshotId: string;\n };\n\n /** Array of port numbers to expose from the sandbox (up to 4). */\n readonly ports?: number[];\n\n /** Timeout in milliseconds before the sandbox auto-terminates. */\n readonly timeout?: number;\n\n /**\n * Resources to allocate to the sandbox.\n * Each vCPU gets 2048 MB of memory.\n */\n readonly resources?: {\n vcpus: number;\n };\n\n /**\n * The runtime of the sandbox (e.g. `\"node24\"`, `\"node22\"`, `\"python3.13\"`).\n * Defaults to `\"node24\"`.\n */\n readonly runtime?: string;\n\n /**\n * Network policy for the sandbox.\n * Defaults to full internet access if not specified.\n */\n readonly networkPolicy?: Record<string, unknown>;\n\n /**\n * Vercel project ID to associate sandbox operations with.\n */\n readonly projectId?: string;\n\n /**\n * Vercel team ID to associate sandbox operations with.\n */\n readonly teamId?: string;\n\n /**\n * Timeout in milliseconds (alias for `timeout`, kept for discoverability).\n */\n readonly timeoutMs?: number;\n\n /**\n * Sandbox template shorthand (e.g. `\"node-22\"`).\n * Maps to the `runtime` option.\n */\n readonly template?: string;\n\n /** Environment variables injected by this provider. Merged at launch time with env resolver and agent provider env. */\n readonly env?: Record<string, string>;\n\n /**\n * Maximum number of characters of streamed `exec` output retained per stream\n * (stdout and stderr) when an `onLine` callback is supplied (default: 64KiB).\n *\n * Output is delivered live to `onLine` regardless; this only bounds the tail\n * returned in `ExecResult`, preventing a long-running agent's output from\n * overflowing V8's max string length and crashing the run.\n */\n readonly maxOutputTailChars?: number;\n}\n\n/**\n * Create a Vercel isolated sandbox provider.\n *\n * The returned provider creates Vercel Firecracker microVM sandboxes via\n * the `@vercel/sandbox` SDK. Each sandbox is ephemeral — one sandbox per run.\n *\n * Requires `@vercel/sandbox` to be installed as a peer dependency.\n */\nexport const vercel = (options?: VercelOptions): IsolatedSandboxProvider =>\n createIsolatedSandboxProvider({\n name: \"vercel\",\n env: options?.env,\n create: async (createOptions): Promise<IsolatedSandboxHandle> => {\n const maxOutputTailChars = options?.maxOutputTailChars ?? MAX_TAIL_CHARS;\n // Dynamic import so the peer dependency is only loaded at runtime\n const { Sandbox } = await import(\"@vercel/sandbox\");\n\n const createParams: Record<string, unknown> = {};\n\n // Pass through SDK options\n if (options?.source) createParams.source = options.source;\n if (options?.ports) createParams.ports = options.ports;\n if (options?.resources) createParams.resources = options.resources;\n if (options?.networkPolicy)\n createParams.networkPolicy = options.networkPolicy;\n // runtime takes precedence over the template convenience alias\n const resolvedRuntime = options?.runtime ?? options?.template;\n if (resolvedRuntime) createParams.runtime = resolvedRuntime;\n\n // Timeout: prefer explicit timeout, fall back to timeoutMs alias\n const timeoutValue = options?.timeout ?? options?.timeoutMs;\n if (timeoutValue !== undefined) createParams.timeout = timeoutValue;\n\n // Merge provider env with Shipyard env\n createParams.env = createOptions.env;\n\n // Auth: pass token and team/project IDs if provided\n if (options?.token) createParams.token = options.token;\n if (options?.projectId) createParams.projectId = options.projectId;\n if (options?.teamId) createParams.teamId = options.teamId;\n\n const sandbox = await Sandbox.create(\n createParams as Parameters<typeof Sandbox.create>[0],\n );\n\n // Ensure worktree directory exists\n await sandbox.mkDir(VERCEL_REPO_PATH);\n\n const handle: IsolatedSandboxHandle = {\n worktreePath: VERCEL_REPO_PATH,\n\n exec: async (\n command: string,\n opts?: {\n onLine?: (line: string) => void;\n cwd?: string;\n sudo?: boolean;\n maxOutputBytes?: number;\n },\n ): Promise<ExecResult> => {\n if (opts?.onLine || opts?.maxOutputBytes !== undefined) {\n const output = new StreamedProcessOutput({\n ...opts,\n maxOutputTailChars,\n });\n let partial = \"\";\n\n const stdoutWritable = new Writable({\n write(chunk, _encoding, callback) {\n const error = output.checkLimit(chunk.toString());\n if (error !== undefined) {\n callback(error);\n return;\n }\n const text = partial + chunk.toString();\n const lines = text.split(\"\\n\");\n partial = lines.pop() ?? \"\";\n for (const line of lines) {\n output.addStdoutLine(line);\n }\n callback();\n },\n final(callback) {\n if (partial) {\n output.addStdoutLine(partial);\n partial = \"\";\n }\n callback();\n },\n });\n\n const stderrWritable = new Writable({\n write(chunk, _encoding, callback) {\n const error = output.checkLimit(chunk.toString());\n if (error !== undefined) {\n callback(error);\n return;\n }\n output.addStderr(chunk.toString());\n callback();\n },\n });\n\n const result = await sandbox.runCommand({\n cmd: \"sh\",\n args: [\"-c\", command],\n cwd: opts?.cwd ?? VERCEL_REPO_PATH,\n stdout: stdoutWritable,\n stderr: stderrWritable,\n ...(opts?.sudo ? { sudo: true } : {}),\n });\n\n if (output.error !== undefined) throw output.error;\n return output.result(result.exitCode);\n }\n\n const result = await sandbox.runCommand({\n cmd: \"sh\",\n args: [\"-c\", command],\n cwd: opts?.cwd ?? VERCEL_REPO_PATH,\n ...(opts?.sudo ? { sudo: true } : {}),\n });\n\n const stdout = await result.stdout();\n const stderr = await result.stderr();\n\n return {\n stdout,\n stderr,\n exitCode: result.exitCode,\n };\n },\n\n copyIn: async (\n hostPath: string,\n sandboxPath: string,\n ): Promise<void> => {\n const info = await lstat(hostPath);\n if (info.isSymbolicLink()) {\n throw new Error(`Refusing to copy a symbolic link: ${hostPath}`);\n }\n if (info.isDirectory()) {\n const tempDir = await mkdtemp(join(tmpdir(), \"shipyard-copyin-\"));\n const tarPath = join(tempDir, \"archive.tar.gz\");\n try {\n execFileSync(\"tar\", [\"-czf\", tarPath, \"-C\", hostPath, \".\"]);\n const tarContent = await readFile(tarPath);\n const sandboxTarPath = `/tmp/shipyard-copyin-${randomUUID()}.tar.gz`;\n await sandbox.writeFiles([\n { path: sandboxTarPath, content: tarContent },\n ]);\n await sandbox.runCommand({\n cmd: \"sh\",\n args: [\n \"-c\",\n `mkdir -p ${shellQuote(sandboxPath)} && tar -xzf ${shellQuote(sandboxTarPath)} -C ${shellQuote(sandboxPath)} && rm -f ${shellQuote(sandboxTarPath)}`,\n ],\n });\n } finally {\n await rm(tempDir, { recursive: true, force: true }).catch(\n () => {},\n );\n }\n } else {\n const content = await readFile(hostPath);\n await sandbox.writeFiles([{ path: sandboxPath, content }]);\n }\n },\n\n copyFileOut: async (\n sandboxPath: string,\n hostPath: string,\n ): Promise<void> => {\n const buffer = await sandbox.readFileToBuffer({\n path: sandboxPath,\n });\n if (!buffer) {\n throw new Error(`File not found in Vercel sandbox: ${sandboxPath}`);\n }\n await mkdir(dirname(hostPath), { recursive: true, mode: 0o700 });\n try {\n if ((await lstat(hostPath)).isSymbolicLink()) {\n throw new Error(\n `Refusing to overwrite symbolic link: ${hostPath}`,\n );\n }\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== \"ENOENT\") throw error;\n }\n await writeFile(hostPath, buffer, { mode: 0o600 });\n await chmod(hostPath, 0o600);\n },\n\n close: async (): Promise<void> => {\n await sandbox.stop();\n },\n };\n\n return handle;\n },\n });\n"]}
@@ -0,0 +1,13 @@
1
+ import { CODEX_MODELS, run, codex } from "@snappedly-tools/shipyard";
2
+ import { docker } from "@snappedly-tools/shipyard/sandboxes/docker";
3
+
4
+ // Blank template: customize this to build your own orchestration.
5
+ // Generated entrypoint: .shipyard/main.mts
6
+ // Run this with: npx shipyard run
7
+ // Or add to package.json scripts: "shipyard": "shipyard run"
8
+
9
+ await run({
10
+ agent: codex(CODEX_MODELS.routine),
11
+ sandbox: docker(),
12
+ promptFile: "./.shipyard/prompt.md",
13
+ });
@@ -0,0 +1,12 @@
1
+ # Context
2
+
3
+ <!-- Use !`command` to pull in dynamic context. Commands run inside the sandbox. -->
4
+ <!-- Example: !`git log --oneline -10` or !`{{LIST_TASKS_COMMAND}}` -->
5
+
6
+ # Task
7
+
8
+ <!-- Describe what the agent should do. -->
9
+
10
+ # Done
11
+
12
+ <!-- When the task is complete, output <promise>COMPLETE</promise> to signal early termination. -->
@@ -0,0 +1,4 @@
1
+ {
2
+ "name": "blank",
3
+ "description": "Bare scaffold — write your own prompt and orchestration"
4
+ }
@@ -5,59 +5,9 @@ import { existsSync } from "node:fs";
5
5
  import * as shipyard from "@snappedly-tools/shipyard";
6
6
  import { docker } from "@snappedly-tools/shipyard/sandboxes/docker";
7
7
  import { z } from "zod";
8
- import { resolvePlannerBranch } from "./planner-branch.mjs";
9
8
 
10
9
  if (process.loadEnvFile && existsSync(".shipyard/.env"))
11
10
  process.loadEnvFile(".shipyard/.env");
12
- type ModelRole = "routine" | "strong";
13
- const CODEX_PROVIDER = true;
14
- const agentFactory = shipyard.codex;
15
- type AgentModel = Parameters<typeof agentFactory>[0];
16
- const readRoleModel = (role: ModelRole): string | undefined => {
17
- const envName = `SHIPYARD_${role.toUpperCase()}_MODEL`;
18
- const model = process.env[envName];
19
- if (model !== undefined && model.trim().length === 0)
20
- throw new Error(`${envName} must not be empty`);
21
- return model;
22
- };
23
- const roleModels = {
24
- routine: readRoleModel("routine"),
25
- strong: readRoleModel("strong"),
26
- };
27
- const CODEX_REASONING_EFFORTS = shipyard.CODEX_REASONING_EFFORTS;
28
- type CodexReasoningEffort = shipyard.CodexReasoningEffort;
29
- const readCodexReasoningEffort = (
30
- role: ModelRole,
31
- ): CodexReasoningEffort | undefined => {
32
- if (!CODEX_PROVIDER) return undefined;
33
- const envName = `SHIPYARD_CODEX_${role.toUpperCase()}_REASONING_EFFORT`;
34
- const effort = process.env[envName]?.trim();
35
- if (!effort) return undefined;
36
- if (!(CODEX_REASONING_EFFORTS as readonly string[]).includes(effort))
37
- throw new Error(
38
- `${envName} must be one of ${CODEX_REASONING_EFFORTS.join(", ")}; received "${effort}"`,
39
- );
40
- return effort as CodexReasoningEffort;
41
- };
42
- const roleEfforts = {
43
- routine: readCodexReasoningEffort("routine"),
44
- strong: readCodexReasoningEffort("strong"),
45
- };
46
- const readCodexRoleModel = (role: ModelRole, defaultModel: AgentModel) => {
47
- if (!CODEX_PROVIDER || typeof defaultModel === "string") return defaultModel;
48
- const envName = `SHIPYARD_CODEX_${role.toUpperCase()}_MODEL`;
49
- const model = process.env[envName]?.trim();
50
- return model ? { ...defaultModel, model } : defaultModel;
51
- };
52
- const roleAgent = (role: ModelRole, defaultModel: AgentModel) => {
53
- const model = roleModels[role] ?? readCodexRoleModel(role, defaultModel);
54
- const effort = roleEfforts[role];
55
- if (typeof model !== "string")
56
- return effort === undefined
57
- ? agentFactory(model)
58
- : agentFactory(model, { effort });
59
- return agentFactory(model, { effort: effort ?? null });
60
- };
61
11
  const targetBranch = execFileSync("git", ["branch", "--show-current"], {
62
12
  encoding: "utf8",
63
13
  }).trim();
@@ -164,7 +114,7 @@ const runWorker = async (scope: Scope, ticket: Ticket) => {
164
114
  await sandbox.run({
165
115
  name: `triage #${ticket.id}`,
166
116
  maxIterations: 1,
167
- agent: roleAgent("routine", shipyard.CODEX_MODELS.routine),
117
+ agent: shipyard.codex(shipyard.CODEX_MODELS.strong),
168
118
  promptFile: "./.shipyard/triage-prompt.md",
169
119
  promptArgs: { TASK_ID: ticket.id },
170
120
  });
@@ -172,7 +122,7 @@ const runWorker = async (scope: Scope, ticket: Ticket) => {
172
122
  const implementation = await sandbox.run({
173
123
  name: "implementer",
174
124
  maxIterations: 100,
175
- agent: roleAgent("routine", shipyard.CODEX_MODELS.routine),
125
+ agent: shipyard.codex(shipyard.CODEX_MODELS.routine),
176
126
  promptFile: "./.shipyard/implement-prompt.md",
177
127
  promptArgs: {
178
128
  TASK_ID: ticket.id,
@@ -193,21 +143,13 @@ for (let iteration = 0; iteration < 10; iteration++) {
193
143
  execFileSync("node", [".shipyard/select-issues.mjs"], { encoding: "utf8" }),
194
144
  ) as Scope[];
195
145
  if (!scopes.length) break;
196
- const localBranches = execFileSync(
197
- "git",
198
- ["for-each-ref", "--format=%(refname:short)", "refs/heads"],
199
- { encoding: "utf8" },
200
- )
201
- .split(/\r?\n/)
202
- .filter(Boolean);
203
- const plannerBranch = await resolvePlannerBranch(localBranches);
204
146
  const plan = await shipyard.run({
205
147
  hooks,
206
148
  sandbox: docker(),
207
149
  name: "planner",
208
- branchStrategy: { type: "branch", branch: plannerBranch },
150
+ branchStrategy: { type: "branch", branch: "shipyard/planner" },
209
151
  maxIterations: 1,
210
- agent: roleAgent("strong", shipyard.CODEX_MODELS.strong),
152
+ agent: shipyard.codex(shipyard.CODEX_MODELS.strong),
211
153
  promptFile: "./.shipyard/plan-prompt.md",
212
154
  output: shipyard.Output.object({ tag: "plan", schema: planSchema }),
213
155
  });
@@ -335,7 +277,7 @@ for (let iteration = 0; iteration < 10; iteration++) {
335
277
  const resolution = await wave.run({
336
278
  name: "conflict-resolver",
337
279
  maxIterations: 10,
338
- agent: roleAgent("strong", shipyard.CODEX_MODELS.strong),
280
+ agent: shipyard.codex(shipyard.CODEX_MODELS.strong),
339
281
  promptFile: "./.shipyard/conflict-prompt.md",
340
282
  promptArgs: {
341
283
  TASK_ID: ready[index]!.id,
@@ -389,7 +331,7 @@ for (let iteration = 0; iteration < 10; iteration++) {
389
331
  const integrated = await wave.run({
390
332
  name: "spec-integrator",
391
333
  maxIterations: 10,
392
- agent: roleAgent("strong", shipyard.CODEX_MODELS.strong),
334
+ agent: shipyard.codex(shipyard.CODEX_MODELS.strong),
393
335
  promptFile: "./.shipyard/spec-wave-prompt.md",
394
336
  promptArgs: {
395
337
  TASK_ID: id,
@@ -429,7 +371,7 @@ for (let iteration = 0; iteration < 10; iteration++) {
429
371
  await integration.run({
430
372
  name: `triage #${id}`,
431
373
  maxIterations: 1,
432
- agent: roleAgent("routine", shipyard.CODEX_MODELS.routine),
374
+ agent: shipyard.codex(shipyard.CODEX_MODELS.strong),
433
375
  promptFile: "./.shipyard/triage-prompt.md",
434
376
  promptArgs: { TASK_ID: id },
435
377
  });
@@ -437,7 +379,7 @@ for (let iteration = 0; iteration < 10; iteration++) {
437
379
  const standalone = await integration.run({
438
380
  name: "implementer",
439
381
  maxIterations: 100,
440
- agent: roleAgent("routine", shipyard.CODEX_MODELS.routine),
382
+ agent: shipyard.codex(shipyard.CODEX_MODELS.routine),
441
383
  promptFile: "./.shipyard/implement-prompt.md",
442
384
  promptArgs: {
443
385
  TASK_ID: id,
@@ -451,7 +393,7 @@ for (let iteration = 0; iteration < 10; iteration++) {
451
393
  const final = await integration.run({
452
394
  name: "merger",
453
395
  maxIterations: 1,
454
- agent: roleAgent("strong", shipyard.CODEX_MODELS.strong),
396
+ agent: shipyard.codex(shipyard.CODEX_MODELS.strong),
455
397
  promptFile: "./.shipyard/merge-prompt.md",
456
398
  promptArgs: {
457
399
  TASK_ID: id,