@snappedly-tools/shipyard 0.7.0-staging.36147705170 → 0.7.0-staging.36173540685
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 +17 -30
- package/dist/MountConfig-K5ILnfht.d.ts +26 -0
- package/dist/{MountConfig-BHnKnA4h.d.ts → SandboxProvider-oUAwYlWm.d.ts} +1 -26
- package/dist/{chunk-QT6J252L.js → chunk-57EEKW3R.js} +20 -49
- package/dist/chunk-57EEKW3R.js.map +1 -0
- package/dist/{chunk-LOIAZ5KH.js → chunk-HXSZM52J.js} +3 -3
- package/dist/{chunk-LOIAZ5KH.js.map → chunk-HXSZM52J.js.map} +1 -1
- package/dist/{chunk-K2D7D32P.js → chunk-JZUBT4WG.js} +4 -4
- package/dist/chunk-JZUBT4WG.js.map +1 -0
- package/dist/chunk-NQRFVKCU.js +1840 -0
- package/dist/chunk-NQRFVKCU.js.map +1 -0
- package/dist/chunk-Z5C4LHVP.js +137 -0
- package/dist/chunk-Z5C4LHVP.js.map +1 -0
- package/dist/createSandbox-DmbnWAZv.d.ts +739 -0
- package/dist/index.d.ts +7 -2534
- package/dist/index.js +216 -7269
- package/dist/index.js.map +1 -1
- package/dist/integrations/github.d.ts +52 -0
- package/dist/integrations/github.js +1049 -0
- package/dist/integrations/github.js.map +1 -0
- package/dist/integrations/releases.d.ts +136 -0
- package/dist/integrations/releases.js +500 -0
- package/dist/integrations/releases.js.map +1 -0
- package/dist/main.js +6 -8
- package/dist/main.js.map +1 -1
- package/dist/publication-BPoy_M9M.d.ts +1200 -0
- package/dist/sandboxes/docker.d.ts +2 -1
- package/dist/sandboxes/docker.js +2 -2
- package/dist/workflow/coordinator/migrations/002_workflow_phase_records.sql +11 -0
- package/dist/workflow/coordinator/migrations/003_phase_record_schema_version.sql +6 -0
- package/dist/workflow.d.ts +472 -0
- package/dist/workflow.js +4345 -0
- package/dist/workflow.js.map +1 -0
- package/package.json +13 -1
- package/dist/chunk-K2D7D32P.js.map +0 -1
- package/dist/chunk-QT6J252L.js.map +0 -1
package/README.md
CHANGED
|
@@ -42,12 +42,7 @@ npx shipyard init
|
|
|
42
42
|
During `shipyard init`, choose your agent and template, then follow the
|
|
43
43
|
authentication prompts. GitHub Issues is the built-in tracker. Init builds the
|
|
44
44
|
Docker image and automatically installs the
|
|
45
|
-
[repository runner](docs/content/docs/repository-runner.mdx)
|
|
46
|
-
Apple Silicon Macs. Init offers to commit and push the generated Shipyard setup
|
|
47
|
-
to the current branch. The offer stages `.shipyard/` and
|
|
48
|
-
`.github/workflows/shipyard-wake.yml`. It leaves
|
|
49
|
-
`.shipyard/.env` untracked. Non-interactive init skips the commit offer; pass
|
|
50
|
-
`--commit-setup true` to commit and push the generated files.
|
|
45
|
+
[repository runner](docs/content/docs/repository-runner.mdx).
|
|
51
46
|
|
|
52
47
|
On a local Mac, the repository runner automatically wakes Shipyard when you label an issue.
|
|
53
48
|
It runs as long as its terminal stays open.
|
|
@@ -58,30 +53,25 @@ branch options.
|
|
|
58
53
|
Fill in any credentials required in `.shipyard/.env`.
|
|
59
54
|
`GH_TOKEN` in `.shipyard/.env` to a GH token with Contents, Issues, and Pull
|
|
60
55
|
Requests read/write access and Metadata read access.
|
|
56
|
+
|
|
61
57
|
Set `SHIPYARD_ROUTINE_MODEL` and `SHIPYARD_STRONG_MODEL` in `.shipyard/.env`
|
|
62
|
-
for the roles your template uses.
|
|
58
|
+
for the roles your template uses.
|
|
59
|
+
|
|
60
|
+
`simple-loop` uses routine for triage and
|
|
63
61
|
implementation. `sequential-reviewer` also uses strong for issue reviews.
|
|
64
62
|
Parallel planner templates use routine for ticket work and strong for planning,
|
|
65
63
|
conflict resolution, and integration. The review-enabled planner also uses
|
|
66
64
|
strong for ticket and final specification reviews. See
|
|
67
65
|
[agent setup](docs/content/docs/agents.mdx).
|
|
68
66
|
|
|
69
|
-
If you decline the commit, commit `.shipyard/` before running Shipyard. Docker
|
|
70
|
-
sandboxes read setup files from Git history. Keep `.shipyard/.env` untracked.
|
|
71
|
-
Init completes only after the repository runner installs. If that step fails,
|
|
72
|
-
init exits with the error and keeps the generated configuration and image. Fix
|
|
73
|
-
the issue and retry with `npx shipyard runner install`; then commit and push
|
|
74
|
-
`.shipyard/` and `.github/workflows/shipyard-wake.yml` before starting the
|
|
75
|
-
runner. Runner installation currently requires Apple Silicon macOS.
|
|
76
|
-
|
|
77
67
|
```sh
|
|
78
|
-
npx shipyard
|
|
68
|
+
npx shipyard runner start
|
|
79
69
|
```
|
|
80
70
|
|
|
81
|
-
|
|
71
|
+
To start Shipyard for a single run without the active runner, use:
|
|
82
72
|
|
|
83
73
|
```sh
|
|
84
|
-
npx shipyard
|
|
74
|
+
npx shipyard run
|
|
85
75
|
```
|
|
86
76
|
|
|
87
77
|
To remove Shipyard from the repository:
|
|
@@ -90,20 +80,14 @@ To remove Shipyard from the repository:
|
|
|
90
80
|
npx shipyard uninstall
|
|
91
81
|
```
|
|
92
82
|
|
|
93
|
-
Uninstall confirms before removing the repository runner, the entire
|
|
94
|
-
`.shipyard/` folder (including `.env` and runtime data), the generated wake
|
|
95
|
-
workflow, and the `@snappedly-tools/shipyard` dependency. It leaves GitHub issues
|
|
96
|
-
and labels unchanged. Commit and push the workflow deletion to disable it on
|
|
97
|
-
GitHub. Use `--yes` to confirm in a non-interactive shell.
|
|
98
|
-
|
|
99
83
|
## Turn GitHub issues into pull requests
|
|
100
84
|
|
|
101
85
|
Then:
|
|
102
86
|
|
|
103
87
|
1. Write an issue with a clear goal and add the `shipyard` and
|
|
104
88
|
`ready-for-agent` labels.
|
|
105
|
-
2.
|
|
106
|
-
|
|
89
|
+
2. Run Shipyard to check for the issue, implement it in Docker,
|
|
90
|
+
review the work, and open a pull request.
|
|
107
91
|
3. Inspect the pull request and merge it when you are happy with the result.
|
|
108
92
|
|
|
109
93
|
## Choose a workflow
|
|
@@ -115,10 +99,13 @@ Then:
|
|
|
115
99
|
| `parallel-planner` | Plans and works on independent issues in parallel. |
|
|
116
100
|
| `parallel-planner-with-review` | Adds review to the parallel workflow. |
|
|
117
101
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
102
|
+
The package root exports the core run, interactive, and sandbox APIs. Import
|
|
103
|
+
hosted workflow coordination and GitHub integration APIs from
|
|
104
|
+
`@snappedly-tools/shipyard/workflow` and
|
|
105
|
+
`@snappedly-tools/shipyard/integrations/github`. Configure prompts, branches,
|
|
106
|
+
limits, and hooks in the generated `.shipyard/main.ts` or `.shipyard/main.mts`.
|
|
107
|
+
See [configuration](docs/content/docs/configuration.mdx) and
|
|
108
|
+
[agent setup](docs/content/docs/agents.mdx).
|
|
122
109
|
|
|
123
110
|
## Safety and license
|
|
124
111
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User-facing mount configuration for Docker.
|
|
3
|
+
*
|
|
4
|
+
* Each entry describes a host directory to mount into the sandbox container.
|
|
5
|
+
*/
|
|
6
|
+
/** A single bind-mount descriptor for the Docker provider. */
|
|
7
|
+
interface MountConfig {
|
|
8
|
+
/**
|
|
9
|
+
* Path on the host. Supports:
|
|
10
|
+
* - Absolute paths (`/data/cache`)
|
|
11
|
+
* - Tilde-expanded paths (`~/data` → `<home>/data`)
|
|
12
|
+
* - Relative paths (`data` or `./data`) — resolved from `process.cwd()`
|
|
13
|
+
*/
|
|
14
|
+
readonly hostPath: string;
|
|
15
|
+
/**
|
|
16
|
+
* Path inside the sandbox container. Supports:
|
|
17
|
+
* - Absolute paths (`/mnt/data`)
|
|
18
|
+
* - Tilde-expanded paths (`~/.npm` → `/home/agent/.npm`) — expanded using the provider's sandbox home directory
|
|
19
|
+
* - Relative paths (`data` or `./data`) — resolved from the worktree directory (`/home/agent/workspace`)
|
|
20
|
+
*/
|
|
21
|
+
readonly sandboxPath: string;
|
|
22
|
+
/** Mount as read-only. Defaults to `false`. */
|
|
23
|
+
readonly readonly?: boolean;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type { MountConfig as M };
|
|
@@ -117,29 +117,4 @@ type BranchStrategy = MergeToHeadBranchStrategy | NamedBranchStrategy;
|
|
|
117
117
|
/** Construct the isolated provider contract used by Docker. */
|
|
118
118
|
declare const createIsolatedSandboxProvider: (config: IsolatedSandboxProviderConfig) => IsolatedSandboxProvider;
|
|
119
119
|
|
|
120
|
-
|
|
121
|
-
* User-facing mount configuration for Docker.
|
|
122
|
-
*
|
|
123
|
-
* Each entry describes a host directory to mount into the sandbox container.
|
|
124
|
-
*/
|
|
125
|
-
/** A single bind-mount descriptor for the Docker provider. */
|
|
126
|
-
interface MountConfig {
|
|
127
|
-
/**
|
|
128
|
-
* Path on the host. Supports:
|
|
129
|
-
* - Absolute paths (`/data/cache`)
|
|
130
|
-
* - Tilde-expanded paths (`~/data` → `<home>/data`)
|
|
131
|
-
* - Relative paths (`data` or `./data`) — resolved from `process.cwd()`
|
|
132
|
-
*/
|
|
133
|
-
readonly hostPath: string;
|
|
134
|
-
/**
|
|
135
|
-
* Path inside the sandbox container. Supports:
|
|
136
|
-
* - Absolute paths (`/mnt/data`)
|
|
137
|
-
* - Tilde-expanded paths (`~/.npm` → `/home/agent/.npm`) — expanded using the provider's sandbox home directory
|
|
138
|
-
* - Relative paths (`data` or `./data`) — resolved from the worktree directory (`/home/agent/workspace`)
|
|
139
|
-
*/
|
|
140
|
-
readonly sandboxPath: string;
|
|
141
|
-
/** Mount as read-only. Defaults to `false`. */
|
|
142
|
-
readonly readonly?: boolean;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
export { type BranchStrategy as B, type ExecResult as E, type IsolatedSandboxProvider as I, type MountConfig as M, type NamedBranchStrategy as N, type SessionTransferHandle as S, type SandboxProvider as a, type MergeToHeadBranchStrategy as b, type InteractiveExecOptions as c, type IsolatedCreateOptions as d, type IsolatedSandboxHandle as e, type IsolatedSandboxProviderConfig as f, createIsolatedSandboxProvider as g };
|
|
120
|
+
export { type BranchStrategy as B, type ExecResult as E, type IsolatedSandboxProvider as I, type MergeToHeadBranchStrategy as M, type NamedBranchStrategy as N, type SandboxProvider as S, type InteractiveExecOptions as a, type IsolatedCreateOptions as b, type IsolatedSandboxHandle as c, type IsolatedSandboxProviderConfig as d, createIsolatedSandboxProvider as e, type SessionTransferHandle as f };
|
|
@@ -1084,22 +1084,21 @@ var formatCommandBlock = (commands) => {
|
|
|
1084
1084
|
}
|
|
1085
1085
|
return commands.map((cmd, i) => i < commands.length - 1 ? ` ${cmd} && \\` : ` ${cmd}`).join("\n");
|
|
1086
1086
|
};
|
|
1087
|
-
|
|
1088
|
-
// src/syncOut.ts
|
|
1089
1087
|
var execHostGit2 = (args, cwd) => Effect.tryPromise({
|
|
1090
1088
|
try: () => execHostGit(args, cwd),
|
|
1091
|
-
catch: (
|
|
1089
|
+
catch: (error) => new SyncError({
|
|
1092
1090
|
message: `Host command failed: git ${args.join(" ")}
|
|
1093
|
-
${
|
|
1091
|
+
${error instanceof Error ? error.message : String(error)}`
|
|
1094
1092
|
})
|
|
1095
1093
|
});
|
|
1096
|
-
var
|
|
1094
|
+
var execSandbox = (handle, command, options) => Effect.tryPromise({
|
|
1097
1095
|
try: () => handle.exec(command, options),
|
|
1098
|
-
catch: (
|
|
1096
|
+
catch: (error) => new SyncError({
|
|
1099
1097
|
message: `Sandbox exec failed: ${command}
|
|
1100
|
-
${
|
|
1098
|
+
${error instanceof Error ? error.message : String(error)}`
|
|
1101
1099
|
})
|
|
1102
|
-
})
|
|
1100
|
+
});
|
|
1101
|
+
var execOk = (handle, command, options) => execSandbox(handle, command, options).pipe(
|
|
1103
1102
|
Effect.flatMap(
|
|
1104
1103
|
(result) => result.exitCode !== 0 ? Effect.fail(
|
|
1105
1104
|
new SyncError({
|
|
@@ -1109,13 +1108,8 @@ ${result.stderr}`
|
|
|
1109
1108
|
) : Effect.succeed(result)
|
|
1110
1109
|
)
|
|
1111
1110
|
);
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
catch: (e) => new SyncError({
|
|
1115
|
-
message: `Sandbox exec failed: ${command}
|
|
1116
|
-
${e instanceof Error ? e.message : String(e)}`
|
|
1117
|
-
})
|
|
1118
|
-
});
|
|
1111
|
+
|
|
1112
|
+
// src/syncOut.ts
|
|
1119
1113
|
var isEmptyPatch = (patchPath) => Effect.tryPromise({
|
|
1120
1114
|
try: async () => {
|
|
1121
1115
|
const info = await stat(patchPath);
|
|
@@ -2008,32 +2002,9 @@ var WorktreeDockerSandboxFactory = {
|
|
|
2008
2002
|
})
|
|
2009
2003
|
)
|
|
2010
2004
|
};
|
|
2011
|
-
var execHostGit3 = (args, cwd) => Effect.tryPromise({
|
|
2012
|
-
try: () => execHostGit(args, cwd),
|
|
2013
|
-
catch: (e) => new SyncError({
|
|
2014
|
-
message: `Host command failed: git ${args.join(" ")}
|
|
2015
|
-
${e instanceof Error ? e.message : String(e)}`
|
|
2016
|
-
})
|
|
2017
|
-
});
|
|
2018
|
-
var execOk3 = (handle, command, options) => Effect.tryPromise({
|
|
2019
|
-
try: () => handle.exec(command, options),
|
|
2020
|
-
catch: (e) => new SyncError({
|
|
2021
|
-
message: `Sandbox exec failed: ${command}
|
|
2022
|
-
${e instanceof Error ? e.message : String(e)}`
|
|
2023
|
-
})
|
|
2024
|
-
}).pipe(
|
|
2025
|
-
Effect.flatMap(
|
|
2026
|
-
(result) => result.exitCode !== 0 ? Effect.fail(
|
|
2027
|
-
new SyncError({
|
|
2028
|
-
message: `Sandbox command failed (exit ${result.exitCode}): ${command}
|
|
2029
|
-
${result.stderr}`
|
|
2030
|
-
})
|
|
2031
|
-
) : Effect.succeed(result)
|
|
2032
|
-
)
|
|
2033
|
-
);
|
|
2034
2005
|
var syncIn = (hostRepoDir, handle) => Effect.gen(function* () {
|
|
2035
2006
|
const protectedRunnerPath = `${CONFIG_DIR}/${RUNNER_DIR}`;
|
|
2036
|
-
const runnerObjects = yield*
|
|
2007
|
+
const runnerObjects = yield* execHostGit2(
|
|
2037
2008
|
["rev-list", "--objects", "--all", "--", protectedRunnerPath],
|
|
2038
2009
|
hostRepoDir
|
|
2039
2010
|
);
|
|
@@ -2044,7 +2015,7 @@ var syncIn = (hostRepoDir, handle) => Effect.gen(function* () {
|
|
|
2044
2015
|
})
|
|
2045
2016
|
);
|
|
2046
2017
|
}
|
|
2047
|
-
const branch = (yield*
|
|
2018
|
+
const branch = (yield* execHostGit2(
|
|
2048
2019
|
["rev-parse", "--abbrev-ref", "HEAD"],
|
|
2049
2020
|
hostRepoDir
|
|
2050
2021
|
)).trim();
|
|
@@ -2057,11 +2028,11 @@ var syncIn = (hostRepoDir, handle) => Effect.gen(function* () {
|
|
|
2057
2028
|
const bundleHostPath = join(bundleDir, "repo.bundle");
|
|
2058
2029
|
yield* Effect.ensuring(
|
|
2059
2030
|
Effect.gen(function* () {
|
|
2060
|
-
yield*
|
|
2031
|
+
yield* execHostGit2(
|
|
2061
2032
|
["bundle", "create", bundleHostPath, "--all"],
|
|
2062
2033
|
hostRepoDir
|
|
2063
2034
|
);
|
|
2064
|
-
const mkTempResult = yield*
|
|
2035
|
+
const mkTempResult = yield* execOk(
|
|
2065
2036
|
handle,
|
|
2066
2037
|
`mktemp -d -t ${RUNTIME_NAMESPACE}-XXXXXX`
|
|
2067
2038
|
);
|
|
@@ -2074,26 +2045,26 @@ var syncIn = (hostRepoDir, handle) => Effect.gen(function* () {
|
|
|
2074
2045
|
})
|
|
2075
2046
|
});
|
|
2076
2047
|
const worktreePath = handle.worktreePath;
|
|
2077
|
-
yield*
|
|
2048
|
+
yield* execOk(
|
|
2078
2049
|
handle,
|
|
2079
2050
|
`git clone ${shellQuote(bundleSandboxPath)} ${shellQuote(`${worktreePath}_clone`)}`
|
|
2080
2051
|
);
|
|
2081
|
-
yield*
|
|
2052
|
+
yield* execOk(
|
|
2082
2053
|
handle,
|
|
2083
2054
|
`rm -rf ${shellQuote(worktreePath)} && mv ${shellQuote(`${worktreePath}_clone`)} ${shellQuote(worktreePath)}`
|
|
2084
2055
|
);
|
|
2085
|
-
yield*
|
|
2056
|
+
yield* execOk(handle, `git checkout ${shellQuote(branch)}`, {
|
|
2086
2057
|
cwd: worktreePath
|
|
2087
2058
|
});
|
|
2088
2059
|
yield* Effect.tryPromise({
|
|
2089
2060
|
try: () => handle.exec(`rm -rf ${shellQuote(sandboxTmpDir)}`),
|
|
2090
2061
|
catch: () => new SyncError({ message: "Failed to clean up sandbox temp dir" })
|
|
2091
2062
|
});
|
|
2092
|
-
const hostHead = (yield*
|
|
2063
|
+
const hostHead = (yield* execHostGit2(
|
|
2093
2064
|
["rev-parse", "HEAD"],
|
|
2094
2065
|
hostRepoDir
|
|
2095
2066
|
)).trim();
|
|
2096
|
-
const sandboxHead = (yield*
|
|
2067
|
+
const sandboxHead = (yield* execOk(handle, "git rev-parse HEAD", {
|
|
2097
2068
|
cwd: worktreePath
|
|
2098
2069
|
})).stdout.trim();
|
|
2099
2070
|
if (hostHead !== sandboxHead) {
|
|
@@ -2212,5 +2183,5 @@ var startSandbox = (options) => Effect.gen(function* () {
|
|
|
2212
2183
|
});
|
|
2213
2184
|
|
|
2214
2185
|
export { ACTIVATION_LABEL, AgentError, AgentIdleTimeoutError, CLI_NAME, CONFIG_DIR, ClackDisplay, ConfigDirError, CopyToWorktreeError, CopyToWorktreeTimeoutError, CwdError, Display, DockerError, ExecHostError, FileDisplay, InitError, LOCKS_DIR, LOGS_DIR, PRODUCT_NAME, PromptError, PromptExpansionTimeoutError, RUNNER_DIR, RUNTIME_NAMESPACE, SANDBOX_REPO_DIR, SandboxConfig, SandboxFactory, SessionCaptureError, SilentDisplay, WorktreeDockerSandboxFactory, assertExcludesRepositoryRunner, assertNoSymlinkComponents, assertProtectedDirectoryIdentities, create, createIsolatedSandboxProvider, generateTempBranchName, getCurrentBranch, hasUncommittedChanges, makeSandboxFromHandle, pruneStale, registerShutdown, remove, repositoryRunnerEnvironment, resolveCwd, resolveSafeRelativePath, runHostHooks, shellQuote, startSandbox, syncOut, toSessionTransferHandle, withSandboxLifecycle, withTimeout };
|
|
2215
|
-
//# sourceMappingURL=chunk-
|
|
2216
|
-
//# sourceMappingURL=chunk-
|
|
2186
|
+
//# sourceMappingURL=chunk-57EEKW3R.js.map
|
|
2187
|
+
//# sourceMappingURL=chunk-57EEKW3R.js.map
|