@clipboard-health/groundcrew 4.50.4 → 4.50.6
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 +1 -1
- package/dist/commands/agentLaunchCleanup.d.ts +5 -0
- package/dist/commands/agentLaunchCleanup.d.ts.map +1 -0
- package/dist/commands/agentLaunchCleanup.js +9 -0
- package/dist/commands/openWorkspace.d.ts.map +1 -1
- package/dist/commands/openWorkspace.js +36 -18
- package/dist/commands/resumeWorkspace.d.ts.map +1 -1
- package/dist/commands/resumeWorkspace.js +44 -18
- package/dist/commands/setupWorkspace.d.ts.map +1 -1
- package/dist/commands/setupWorkspace.js +2 -1
- package/dist/commands/statusCollect.js +1 -1
- package/dist/lib/config.d.ts +9 -7
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +5 -0
- package/dist/lib/launchCommand.d.ts.map +1 -1
- package/dist/lib/launchCommand.js +3 -3
- package/dist/lib/preLaunchEmptyCheck.d.ts +3 -8
- package/dist/lib/preLaunchEmptyCheck.d.ts.map +1 -1
- package/dist/lib/preLaunchEmptyCheck.js +3 -8
- package/dist/lib/pullRequests.d.ts.map +1 -1
- package/dist/lib/pullRequests.js +7 -1
- package/docs/configuration.md +1 -1
- package/docs/credentials.md +1 -1
- package/docs/development.md +1 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ Groundcrew watches assigned tasks, creates isolated worktrees, launches agent CL
|
|
|
32
32
|
|
|
33
33
|
`crew doctor` checks all of these, so you can install as you go.
|
|
34
34
|
|
|
35
|
-
- **Node
|
|
35
|
+
- **Node 24.14.1:** [nvm](https://github.com/nvm-sh/nvm): `nvm install 24.14.1`.
|
|
36
36
|
- **git:** e.g., `brew install git`, `apt install git`.
|
|
37
37
|
- **A terminal multiplexer:** [tmux](https://github.com/tmux/tmux/wiki/Installing) (cross-platform), [cmux](https://cmux.com/) (macOS), or [zellij](https://zellij.dev/).
|
|
38
38
|
- **An agent CLI:** [Claude Code](https://code.claude.com/docs/en/quickstart), [Codex](https://developers.openai.com/codex/quickstart?setup=cli), the [Cursor CLI](https://docs.cursor.com/en/cli/overview) (`cursor-agent`, for the `cursor` and `cursor-grok` presets), and/or [Pi](https://pi.dev/).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agentLaunchCleanup.d.ts","sourceRoot":"","sources":["../../src/commands/agentLaunchCleanup.ts"],"names":[],"mappings":"AAEA,wBAAgB,4BAA4B,CAAC,UAAU,EAAE;IACvD,OAAO,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IAClC,OAAO,EAAE,MAAM,CAAC;CACjB,GAAG,IAAI,CAMP"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { errorMessage, log } from "../lib/util.js";
|
|
2
|
+
export function cleanupAgentLaunchBestEffort(arguments_) {
|
|
3
|
+
try {
|
|
4
|
+
arguments_.cleanup?.();
|
|
5
|
+
}
|
|
6
|
+
catch (error) {
|
|
7
|
+
log(`Agent launch cleanup failed during ${arguments_.context}: ${errorMessage(error)}`);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openWorkspace.d.ts","sourceRoot":"","sources":["../../src/commands/openWorkspace.ts"],"names":[],"mappings":"AAKA,OAAO,EAAiC,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"openWorkspace.d.ts","sourceRoot":"","sources":["../../src/commands/openWorkspace.ts"],"names":[],"mappings":"AAKA,OAAO,EAAiC,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAiBtF,UAAU,gBAAgB;IACxB,IAAI,EAAE,IAAI,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,UAAU,WAAW;IACnB,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,gBAAgB,GAAG,WAAW,CAAC;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0EAA0E;IAC1E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AA0KD,wBAAsB,aAAa,CACjC,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,IAAI,CAAC,CA0Hf;AA4ID,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,oBAAoB,CAE3E;AAED,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAIpE"}
|
|
@@ -12,6 +12,7 @@ import { normalizePlainTaskId } from "../lib/taskId.js";
|
|
|
12
12
|
import { debug, errorMessage, log, okMark } from "../lib/util.js";
|
|
13
13
|
import { failIfWorkspaceAlreadyLive } from "../lib/workspaceLiveness.js";
|
|
14
14
|
import { resolveLaunchDir, worktrees } from "../lib/worktrees.js";
|
|
15
|
+
import { cleanupAgentLaunchBestEffort } from "./agentLaunchCleanup.js";
|
|
15
16
|
const OPEN_USAGE = "Usage: crew open <pr> | --branch <name> [--repo <owner/repo>] [--agent <agent>] [--prompt <text> | --prompt-file <path>] [--task <id>] [--dry-run]";
|
|
16
17
|
const PULL_REQUEST_URL_PATTERN = /^https?:\/\/github\.com\/(?<repository>[^/]+\/[^/]+)\/pull\/(?<pr>\d+)/;
|
|
17
18
|
function parsePullRequestReference(reference) {
|
|
@@ -101,7 +102,17 @@ async function resolveTarget(config, options, repository) {
|
|
|
101
102
|
async function rollback(arguments_) {
|
|
102
103
|
log(`Open failed; rolling back worktree ${arguments_.entry.repository}-${arguments_.entry.task}...`);
|
|
103
104
|
try {
|
|
104
|
-
await worktrees.teardown(arguments_.config, [arguments_.entry], { force: true });
|
|
105
|
+
const result = await worktrees.teardown(arguments_.config, [arguments_.entry], { force: true });
|
|
106
|
+
for (const failure of result.failures) {
|
|
107
|
+
log(`Worktree teardown ${failure.step} failed during rollback: ${errorMessage(failure.error)}`);
|
|
108
|
+
}
|
|
109
|
+
const workspaceAbsent = result.workspaceProbe.kind === "ok" &&
|
|
110
|
+
!result.workspaceProbe.names.has(arguments_.entry.task);
|
|
111
|
+
if (arguments_.workspaceOpened &&
|
|
112
|
+
!workspaceAbsent &&
|
|
113
|
+
!result.closed.includes(arguments_.entry.task)) {
|
|
114
|
+
log(`Workspace close was not confirmed during open rollback for ${arguments_.entry.task}. Close it manually in the configured workspace backend.`);
|
|
115
|
+
}
|
|
105
116
|
}
|
|
106
117
|
catch (error) {
|
|
107
118
|
log(`Worktree teardown failed during rollback: ${errorMessage(error)}`);
|
|
@@ -151,6 +162,7 @@ export async function openWorkspace(config, options) {
|
|
|
151
162
|
text: options.promptText ?? "",
|
|
152
163
|
});
|
|
153
164
|
let cleanupAgentLaunch;
|
|
165
|
+
let workspaceOpened = false;
|
|
154
166
|
try {
|
|
155
167
|
const { prepareWorktreeCommand, prepareWorktreeUnsandboxedCommand } = resolveRepositoryPreparationCommands({
|
|
156
168
|
config,
|
|
@@ -191,27 +203,33 @@ export async function openWorkspace(config, options) {
|
|
|
191
203
|
agent,
|
|
192
204
|
color: definition.color,
|
|
193
205
|
});
|
|
206
|
+
workspaceOpened = true;
|
|
207
|
+
recordRunState({
|
|
208
|
+
config,
|
|
209
|
+
state: {
|
|
210
|
+
task: target.task,
|
|
211
|
+
repository,
|
|
212
|
+
agent,
|
|
213
|
+
worktreeDir: created.dir,
|
|
214
|
+
branchName: target.branch,
|
|
215
|
+
workspaceName: target.task,
|
|
216
|
+
state: "running",
|
|
217
|
+
title: target.title,
|
|
218
|
+
adoptedBranch: true,
|
|
219
|
+
...(target.url === undefined ? {} : { url: target.url }),
|
|
220
|
+
},
|
|
221
|
+
});
|
|
194
222
|
}
|
|
195
223
|
catch (error) {
|
|
196
|
-
cleanupAgentLaunch
|
|
197
|
-
await rollback({
|
|
224
|
+
cleanupAgentLaunchBestEffort({ cleanup: cleanupAgentLaunch, context: "open rollback" });
|
|
225
|
+
await rollback({
|
|
226
|
+
config,
|
|
227
|
+
entry: created,
|
|
228
|
+
promptDir: stagedPrompt.directory,
|
|
229
|
+
workspaceOpened,
|
|
230
|
+
});
|
|
198
231
|
throw error;
|
|
199
232
|
}
|
|
200
|
-
recordRunState({
|
|
201
|
-
config,
|
|
202
|
-
state: {
|
|
203
|
-
task: target.task,
|
|
204
|
-
repository,
|
|
205
|
-
agent,
|
|
206
|
-
worktreeDir: created.dir,
|
|
207
|
-
branchName: target.branch,
|
|
208
|
-
workspaceName: target.task,
|
|
209
|
-
state: "running",
|
|
210
|
-
title: target.title,
|
|
211
|
-
adoptedBranch: true,
|
|
212
|
-
...(target.url === undefined ? {} : { url: target.url }),
|
|
213
|
-
},
|
|
214
|
-
});
|
|
215
233
|
log(`${okMark()} "${target.task}" opened on branch ${target.branch} (${agent})`);
|
|
216
234
|
debug(` Worktree: ${launchDir}`);
|
|
217
235
|
if (omitPromptArgument) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resumeWorkspace.d.ts","sourceRoot":"","sources":["../../src/commands/resumeWorkspace.ts"],"names":[],"mappings":"AAGA,OAAO,EAAoC,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"resumeWorkspace.d.ts","sourceRoot":"","sources":["../../src/commands/resumeWorkspace.ts"],"names":[],"mappings":"AAGA,OAAO,EAAoC,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAwBzF,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAoMD,wBAAsB,eAAe,CACnC,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,IAAI,CAAC,CAgIf;AAED,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAGtE"}
|
|
@@ -12,7 +12,9 @@ import { taskSourceWritePathsForCompletion } from "../lib/taskSourceFilesystem.j
|
|
|
12
12
|
import { naturalIdFromCanonical, toCanonicalId } from "../lib/taskSource.js";
|
|
13
13
|
import { errorMessage, log } from "../lib/util.js";
|
|
14
14
|
import { failIfWorkspaceAlreadyLive } from "../lib/workspaceLiveness.js";
|
|
15
|
+
import { workspaces } from "../lib/workspaces.js";
|
|
15
16
|
import { resolveLaunchDir, worktrees } from "../lib/worktrees.js";
|
|
17
|
+
import { cleanupAgentLaunchBestEffort } from "./agentLaunchCleanup.js";
|
|
16
18
|
function parseArguments(argv) {
|
|
17
19
|
let fresh = false;
|
|
18
20
|
const positionals = [];
|
|
@@ -192,6 +194,7 @@ export async function resumeWorkspace(config, options) {
|
|
|
192
194
|
});
|
|
193
195
|
const secretsFile = stageBuildSecrets(stagedPrompt.directory);
|
|
194
196
|
let cleanupAgentLaunch;
|
|
197
|
+
let workspaceOpened = false;
|
|
195
198
|
try {
|
|
196
199
|
const taskSourceWritePaths = runner === "safehouse"
|
|
197
200
|
? taskSourceWritePathsForCompletion({
|
|
@@ -235,28 +238,51 @@ export async function resumeWorkspace(config, options) {
|
|
|
235
238
|
agent: context.agent,
|
|
236
239
|
color: definition.color,
|
|
237
240
|
});
|
|
241
|
+
workspaceOpened = true;
|
|
242
|
+
recordRunState({
|
|
243
|
+
config,
|
|
244
|
+
state: {
|
|
245
|
+
task,
|
|
246
|
+
repository: context.repository,
|
|
247
|
+
agent: context.agent,
|
|
248
|
+
worktreeDir: context.worktree.dir,
|
|
249
|
+
branchName: context.worktree.branchName,
|
|
250
|
+
workspaceName: task,
|
|
251
|
+
state: "resumed",
|
|
252
|
+
resumeCount: context.resumeCount + 1,
|
|
253
|
+
completionTaskId: context.completionTaskId,
|
|
254
|
+
...(context.url === undefined ? {} : { url: context.url }),
|
|
255
|
+
...(context.reason === undefined ? {} : { reason: context.reason }),
|
|
256
|
+
},
|
|
257
|
+
});
|
|
238
258
|
}
|
|
239
259
|
catch (error) {
|
|
240
|
-
|
|
241
|
-
|
|
260
|
+
if (workspaceOpened) {
|
|
261
|
+
try {
|
|
262
|
+
const result = await workspaces.close(config, task);
|
|
263
|
+
if (result.kind === "unavailable") {
|
|
264
|
+
const detail = result.error === undefined
|
|
265
|
+
? "workspace backend unavailable"
|
|
266
|
+
: errorMessage(result.error);
|
|
267
|
+
log(`Workspace close was not confirmed during resume rollback for ${task}: ${detail}. Close it manually in the configured workspace backend.`);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
catch (closeError) {
|
|
271
|
+
log(`Workspace close failed during resume rollback for ${task}: ${errorMessage(closeError)}. Close it manually in the configured workspace backend.`);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
cleanupAgentLaunchBestEffort({
|
|
275
|
+
cleanup: cleanupAgentLaunch,
|
|
276
|
+
context: `resume rollback for ${task}`,
|
|
277
|
+
});
|
|
278
|
+
try {
|
|
279
|
+
removeStagedPrompt(stagedPrompt.directory);
|
|
280
|
+
}
|
|
281
|
+
catch (cleanupError) {
|
|
282
|
+
log(`Staged prompt cleanup failed during resume rollback for ${task}: ${errorMessage(cleanupError)}`);
|
|
283
|
+
}
|
|
242
284
|
throw error;
|
|
243
285
|
}
|
|
244
|
-
recordRunState({
|
|
245
|
-
config,
|
|
246
|
-
state: {
|
|
247
|
-
task,
|
|
248
|
-
repository: context.repository,
|
|
249
|
-
agent: context.agent,
|
|
250
|
-
worktreeDir: context.worktree.dir,
|
|
251
|
-
branchName: context.worktree.branchName,
|
|
252
|
-
workspaceName: task,
|
|
253
|
-
state: "resumed",
|
|
254
|
-
resumeCount: context.resumeCount + 1,
|
|
255
|
-
completionTaskId: context.completionTaskId,
|
|
256
|
-
...(context.url === undefined ? {} : { url: context.url }),
|
|
257
|
-
...(context.reason === undefined ? {} : { reason: context.reason }),
|
|
258
|
-
},
|
|
259
|
-
});
|
|
260
286
|
log(`Resumed ${task} in ${context.worktree.dir} (${context.agent})`);
|
|
261
287
|
}
|
|
262
288
|
export async function resumeWorkspaceCli(argv) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupWorkspace.d.ts","sourceRoot":"","sources":["../../src/commands/setupWorkspace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAiBnE,OAAO,EAA0B,KAAK,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"setupWorkspace.d.ts","sourceRoot":"","sources":["../../src/commands/setupWorkspace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAiBnE,OAAO,EAA0B,KAAK,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAWxF,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,sEAAsE;IACtE,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,6FAA6F;IAC7F,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,gEAAgE;IAChE,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,WAAW,wBAAwB;IACvC,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAuBD,wBAAsB,cAAc,CAClC,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,qBAAqB,EAC9B,UAAU,GAAE,wBAA6B,GACxC,OAAO,CAAC,IAAI,CAAC,CA2Jf;AAiOD,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GACjC,OAAO,CAAC,IAAI,CAAC,CAyDf"}
|
|
@@ -13,6 +13,7 @@ import { naturalIdFromCanonical } from "../lib/taskSource.js";
|
|
|
13
13
|
import { debug, errorMessage, log, okMark } from "../lib/util.js";
|
|
14
14
|
import { workspaces } from "../lib/workspaces.js";
|
|
15
15
|
import { resolveLaunchDir, WorktreeAlreadyExistsError, worktrees, } from "../lib/worktrees.js";
|
|
16
|
+
import { cleanupAgentLaunchBestEffort } from "./agentLaunchCleanup.js";
|
|
16
17
|
function stagePrompt(input) {
|
|
17
18
|
return stagePromptFromTemplate({
|
|
18
19
|
config: input.config,
|
|
@@ -166,7 +167,7 @@ export async function setupWorkspace(config, options, runOptions = {}) {
|
|
|
166
167
|
}
|
|
167
168
|
}
|
|
168
169
|
catch (error) {
|
|
169
|
-
cleanupAgentLaunch
|
|
170
|
+
cleanupAgentLaunchBestEffort({ cleanup: cleanupAgentLaunch, context: "setup rollback" });
|
|
170
171
|
await rollbackWorktree({ config, entry: created, promptDir });
|
|
171
172
|
recordFailedToLaunch({ config, options, paths: { worktreeDir, branchName }, error });
|
|
172
173
|
throw error;
|
|
@@ -362,7 +362,7 @@ function splitLogBuffer(buffer) {
|
|
|
362
362
|
return { first: buffer.subarray(0, firstNewline), rest };
|
|
363
363
|
}
|
|
364
364
|
function hasOpenBlocker(issue) {
|
|
365
|
-
return issue.blockers.some((blocker) => blocker.status !== "done");
|
|
365
|
+
return issue.hasMoreBlockers || issue.blockers.some((blocker) => blocker.status !== "done");
|
|
366
366
|
}
|
|
367
367
|
function toBoardIssue(issue) {
|
|
368
368
|
return {
|
package/dist/lib/config.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { LinearAdapterConfig } from "./adapters/linear/schema.ts";
|
|
|
2
2
|
import type { ShellAdapterConfig } from "./adapters/shell/schema.ts";
|
|
3
3
|
import type { TodoTxtAdapterConfig } from "./adapters/todo-txt/schema.ts";
|
|
4
4
|
export { BUILD_SECRET_NAMES } from "./buildSecrets.ts";
|
|
5
|
+
export declare const WORKER_ENVIRONMENT_NAMES: readonly ["GROUNDCREW_TASK_ID", "GROUNDCREW_COMPLETE"];
|
|
5
6
|
/**
|
|
6
7
|
* Authoring shape for a manifest-backed (discovered) task source: enable by
|
|
7
8
|
* kind, with light overrides. The concrete per-source schema is built at
|
|
@@ -105,13 +106,14 @@ export interface AgentDefinition {
|
|
|
105
106
|
* the agent under the safehouse runner. Companion to `preLaunch` —
|
|
106
107
|
* names exported by `preLaunch` go here so groundcrew appends them to the
|
|
107
108
|
* Safehouse wrap's `--env-pass=` flag without forcing the user to rewrite
|
|
108
|
-
* `cmd`. Under `local.runner: "none"
|
|
109
|
-
* `
|
|
110
|
-
* runner (it forwards zero names,
|
|
111
|
-
* fire). A non-empty list is
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
109
|
+
* `cmd`. Under `local.runner: "none"`, listed names are cleared immediately
|
|
110
|
+
* before `preLaunch`, then its exports flow through unchanged to the agent.
|
|
111
|
+
* An empty array is a uniform no-op in every runner (it forwards zero names,
|
|
112
|
+
* so the unsupported-runner guards do not fire). A non-empty list is
|
|
113
|
+
* rejected when `local.runner` resolves to `sdx` in v1, and when `cmd`
|
|
114
|
+
* already starts with `safehouse` (the user owns env forwarding in that
|
|
115
|
+
* case). Groundcrew-managed worker environment names are also rejected.
|
|
116
|
+
* Each name must match `[A-Za-z_][A-Za-z0-9_]*` (POSIX env var name).
|
|
115
117
|
*/
|
|
116
118
|
preLaunchEnv?: string[];
|
|
117
119
|
color: string;
|
package/dist/lib/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","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,GAAG,SAAS,GAAG,KAAK,CAAC;AAEzD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,gBAAgB,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC;IACjC,MAAM,EAAE,QAAQ,CAAC,YAAY,CAAC,CAAC;CAChC;AA0UD;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,IAAI,CAAC,eAAe,EAAE,cAAc,CAAC,GAAG,OAAO,CAE1F;AAyJD;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAC,EACtC,IAAI,EAAE,MAAM,GACX,OAAO,CAKT;AAumBD,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CA+B5E;AAED,wBAAsB,UAAU,IAAI,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAGpE"}
|
package/dist/lib/config.js
CHANGED
|
@@ -8,6 +8,7 @@ import { debug, log, readEnvironmentVariable, setLogFile } from "./util.js";
|
|
|
8
8
|
import { xdgConfigPath, xdgStatePath } from "./xdg.js";
|
|
9
9
|
import { BUILD_SECRET_NAMES } from "./buildSecrets.js";
|
|
10
10
|
export { BUILD_SECRET_NAMES } from "./buildSecrets.js";
|
|
11
|
+
export const WORKER_ENVIRONMENT_NAMES = ["GROUNDCREW_TASK_ID", "GROUNDCREW_COMPLETE"];
|
|
11
12
|
/**
|
|
12
13
|
* Reserved agent name. A task labeled `agent-any` resolves at runtime
|
|
13
14
|
* to the configured agent with the most available session capacity, so
|
|
@@ -311,6 +312,10 @@ function validatePreLaunchEnv(agentName, value) {
|
|
|
311
312
|
fail(`${configPath}[${index}] cannot be a BUILD_SECRET_NAMES entry (${BUILD_SECRET_NAMES.join(", ")}); ` +
|
|
312
313
|
"those are unset on the host before the agent wrap is exec'd, so forwarding them via --env-pass would be a no-op.");
|
|
313
314
|
}
|
|
315
|
+
if (WORKER_ENVIRONMENT_NAMES.includes(entry)) {
|
|
316
|
+
fail(`${configPath}[${index}] cannot be a managed worker environment name (${WORKER_ENVIRONMENT_NAMES.join(", ")}); ` +
|
|
317
|
+
"groundcrew sets those values for the launched worker, so preLaunchEnv cannot own them.");
|
|
318
|
+
}
|
|
314
319
|
}
|
|
315
320
|
}
|
|
316
321
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launchCommand.d.ts","sourceRoot":"","sources":["../../src/lib/launchCommand.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"launchCommand.d.ts","sourceRoot":"","sources":["../../src/lib/launchCommand.ts"],"names":[],"mappings":"AAGA,OAAO,EAIL,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EAC1B,MAAM,aAAa,CAAC;AAKrB,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,GAAG,eAAe,CAE/F;AAED;;;;;;;;;GASG;AACH,wBAAgB,6BAA6B,CAAC,OAAO,GAAE,MAAwB,GAAG,MAAM,CAcvF;AAqPD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAE9D;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CA8B9D;AAID,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC;IACvC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC,CAAC;AAEH,wBAAgB,wBAAwB,CAAC,UAAU,EAAE;IACnD,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,OAAO,CA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AAC;IACtD;;;;;;;OAOG;IACH,uBAAuB,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;IACxD;;;;OAIG;IACH,6BAA6B,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;IAC9D;;;;;OAKG;IACH,yBAAyB,CAAC,EAAE,yBAAyB,GAAG,SAAS,CAAC;IAClE;;;OAGG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAC;IAClD;;;;;;OAMG;IACH,kBAAkB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC1C;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,sBAAsB,GAAG,MAAM,CAoC7E"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { BUILD_SECRET_NAMES, hasPreLaunchEnv, } from "./config.js";
|
|
3
|
+
import { BUILD_SECRET_NAMES, hasPreLaunchEnv, WORKER_ENVIRONMENT_NAMES, } from "./config.js";
|
|
4
4
|
import { clearanceAllowHostsFilesFromEnvironment } from "./clearanceAllowlist.js";
|
|
5
5
|
import { buildPreLaunchEmptyCheckLines } from "./preLaunchEmptyCheck.js";
|
|
6
6
|
import { shellSingleQuote } from "./shell.js";
|
|
@@ -117,7 +117,8 @@ function hostSourceSecrets(secretsFile) {
|
|
|
117
117
|
function preLaunchPromptAndExec(arguments_) {
|
|
118
118
|
const lines = [];
|
|
119
119
|
if (arguments_.definition.preLaunch !== undefined) {
|
|
120
|
-
|
|
120
|
+
const preLaunchEnv = arguments_.definition.preLaunchEnv ?? [];
|
|
121
|
+
lines.push(...(preLaunchEnv.length === 0 ? [] : [unsetEnvironmentLine(preLaunchEnv)]), renderPreLaunch(arguments_.definition.preLaunch, arguments_.worktreeDir), ...buildPreLaunchEmptyCheckLines(preLaunchEnv));
|
|
121
122
|
}
|
|
122
123
|
lines.push(`_p=$(cat ${shellSingleQuote(arguments_.promptFile)})`, `rm -rf ${shellSingleQuote(arguments_.promptDir)}`, arguments_.execLine);
|
|
123
124
|
return lines;
|
|
@@ -235,7 +236,6 @@ export function inferAgentCommandName(agentCmd) {
|
|
|
235
236
|
}
|
|
236
237
|
return commandName;
|
|
237
238
|
}
|
|
238
|
-
const WORKER_ENVIRONMENT_NAMES = ["GROUNDCREW_TASK_ID", "GROUNDCREW_COMPLETE"];
|
|
239
239
|
export function workerEnvironmentForTask(arguments_) {
|
|
240
240
|
const { taskId, markDoneSupported } = arguments_;
|
|
241
241
|
return {
|
|
@@ -12,14 +12,9 @@
|
|
|
12
12
|
* Returns `[]` for an empty input list so callers can splat unconditionally
|
|
13
13
|
* into their `&&` chain.
|
|
14
14
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* what `preLaunch` produced. On the unwrapped-host chain
|
|
19
|
-
* (`preLaunchPromptAndExec`) no unset happens first, so a value inherited
|
|
20
|
-
* from the parent shell can survive `preLaunch` and mask a failed `export`.
|
|
21
|
-
* That asymmetry is a property of the runners; closing it requires an env
|
|
22
|
-
* scrub on the runner=none path, tracked as a follow-up.
|
|
15
|
+
* The safehouse and unwrapped-host chains both unset each `preLaunchEnv` name
|
|
16
|
+
* before running `preLaunch`, so the check reflects what `preLaunch` produced
|
|
17
|
+
* instead of a value inherited from the parent shell.
|
|
23
18
|
*
|
|
24
19
|
* Names must be POSIX identifiers (`[A-Za-z_][A-Za-z0-9_]*`); groundcrew's
|
|
25
20
|
* `validatePreLaunchEnv` in `src/lib/config.ts` enforces that, so no shell
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preLaunchEmptyCheck.d.ts","sourceRoot":"","sources":["../../src/lib/preLaunchEmptyCheck.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"preLaunchEmptyCheck.d.ts","sourceRoot":"","sources":["../../src/lib/preLaunchEmptyCheck.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAQhF"}
|
|
@@ -12,14 +12,9 @@
|
|
|
12
12
|
* Returns `[]` for an empty input list so callers can splat unconditionally
|
|
13
13
|
* into their `&&` chain.
|
|
14
14
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* what `preLaunch` produced. On the unwrapped-host chain
|
|
19
|
-
* (`preLaunchPromptAndExec`) no unset happens first, so a value inherited
|
|
20
|
-
* from the parent shell can survive `preLaunch` and mask a failed `export`.
|
|
21
|
-
* That asymmetry is a property of the runners; closing it requires an env
|
|
22
|
-
* scrub on the runner=none path, tracked as a follow-up.
|
|
15
|
+
* The safehouse and unwrapped-host chains both unset each `preLaunchEnv` name
|
|
16
|
+
* before running `preLaunch`, so the check reflects what `preLaunch` produced
|
|
17
|
+
* instead of a value inherited from the parent shell.
|
|
23
18
|
*
|
|
24
19
|
* Names must be POSIX identifiers (`[A-Za-z_][A-Za-z0-9_]*`); groundcrew's
|
|
25
20
|
* `validatePreLaunchEnv` in `src/lib/config.ts` enforces that, so no shell
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pullRequests.d.ts","sourceRoot":"","sources":["../../src/lib/pullRequests.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,0DAA0D;IAC1D,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AASD,UAAU,UAAU;IAClB,6EAA6E;IAC7E,GAAG,EAAE,MAAM,CAAC;IACZ,oCAAoC;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAgDD,MAAM,WA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AAO,EAAE,MAAM,CAAC;IAChB,iDAAiD;IACjD,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AA2BD;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CACtC,UAAU,EAAE,sBAAsB,GACjC,OAAO,CAAC,mBAAmB,CAAC,CAsC9B;AAED,wBAAsB,yBAAyB,CAC7C,UAAU,EAAE,UAAU,GACrB,OAAO,CAAC,SAAS,kBAAkB,EAAE,CAAC,CA6BxC"}
|
package/dist/lib/pullRequests.js
CHANGED
|
@@ -88,6 +88,9 @@ export async function resolvePullRequest(arguments_) {
|
|
|
88
88
|
output = await runCommandAsync("gh", ["pr", "view", pr, "--json", "number,headRefName,title,url,state,isCrossRepository"], options);
|
|
89
89
|
}
|
|
90
90
|
catch (error) {
|
|
91
|
+
if (signal?.aborted === true) {
|
|
92
|
+
throw error;
|
|
93
|
+
}
|
|
91
94
|
throw new Error(`Could not look up pull request ${pr} from ${repoDir}. Ensure 'gh' is installed and authenticated (gh auth status) and the PR exists.`, { cause: error });
|
|
92
95
|
}
|
|
93
96
|
let parsed;
|
|
@@ -129,7 +132,10 @@ export async function findPullRequestsForBranch(arguments_) {
|
|
|
129
132
|
], options);
|
|
130
133
|
return parsePullRequests(output);
|
|
131
134
|
}
|
|
132
|
-
catch {
|
|
135
|
+
catch (error) {
|
|
136
|
+
if (signal?.aborted === true) {
|
|
137
|
+
throw error;
|
|
138
|
+
}
|
|
133
139
|
// gh not installed / not authenticated / non-GitHub remote / network
|
|
134
140
|
// error / etc. All resolve to "no PR info available" for display.
|
|
135
141
|
return [];
|
package/docs/configuration.md
CHANGED
|
@@ -337,7 +337,7 @@ and hook contract.
|
|
|
337
337
|
| `agents.definitions.<name>.usage` | preset for built-ins | If set, codexbar usage is fetched for this agent and gated by `sessionLimitPercentage` plus the weekly paced budget when codexbar exposes a weekly window. When `usage.codexbar.source` is omitted, groundcrew uses `oauth` for Codex/Claude on macOS, `auto` for other macOS providers, and `cli` elsewhere. Set to `{ disabled: true }` to disable usage gating while keeping the agent enabled. |
|
|
338
338
|
| `agents.definitions.<name>.sandbox` | optional | Docker Sandboxes binding for the agent. Required at launch when `local.runner` resolves to `sdx`. Field: `agent` (required sbx agent name). Groundcrew assumes the `groundcrew-<agent>` sandbox already exists. |
|
|
339
339
|
| `agents.definitions.<name>.preLaunch` | optional | Host-only shell snippet run before the agent exec and outside Safehouse/sdx. Exports survive into the launch shell; under the default `safehouse` runner they are only forwarded to the agent when listed via `preLaunchEnv` or when `cmd` includes its own `safehouse --env-pass=NAMES`. `{{worktree}}` is substituted. A non-zero exit aborts launch. Not supported when `local.runner` resolves to `sdx` in v1. |
|
|
340
|
-
| `agents.definitions.<name>.preLaunchEnv` | optional | Companion to `preLaunch`: list of env var names to append to groundcrew's Safehouse `--env-pass=` flag, so `preLaunch` exports reach the agent without overriding `cmd`. Each entry must match `[A-Za-z_][A-Za-z0-9_]*`.
|
|
340
|
+
| `agents.definitions.<name>.preLaunchEnv` | optional | Companion to `preLaunch`: list of env var names to append to groundcrew's Safehouse `--env-pass=` flag, so `preLaunch` exports reach the agent without overriding `cmd`. Each entry must match `[A-Za-z_][A-Za-z0-9_]*`. `none` clears those names before `preLaunch`; its exports then inherit as-is. An empty array is a uniform no-op under every runner; non-empty lists reject a Safehouse-prefixed `cmd`, `sdx` runners, or Groundcrew-managed worker env vars. |
|
|
341
341
|
| `agents.definitions.<name>.resumeArgs` | preset default | Shell args appended to `cmd` on `crew resume` so the agent [reopens its previous conversation](#resuming-the-agents-conversation) in the worktree. Defaults to `"--continue"` (claude, cursor, cursor-grok, pi) and `"resume --last"` (codex) on the built-in presets; set it for custom agents or to override. `crew resume --new` ignores it and cold-starts. No session id is stored. |
|
|
342
342
|
| `prompts.initial` | unattended template | First message sent to the agent: the execution wrapper around each task. The task description is the task-specific prompt. Placeholders: `{{task}}`, `{{worktree}}`, `{{title}}`, `{{description}}`. Override only to change the execution contract for every task, such as team-wide review rules or tool conventions. Mutually exclusive with `prompts.promptFile`. |
|
|
343
343
|
| `prompts.promptFile` | optional | Path to a UTF-8 file whose contents become `prompts.initial`, read at load time. Resolved relative to the config file's directory; `~` is expanded and absolute paths are used as-is. The JSON-friendly alternative to inlining a large prompt or `readFileSync`. Mutually exclusive with `prompts.initial`. |
|
package/docs/credentials.md
CHANGED
|
@@ -95,7 +95,7 @@ agents: {
|
|
|
95
95
|
|
|
96
96
|
`&&` ensures `export` only runs when the mint succeeds. A failed mint propagates non-zero out of `preLaunch` and aborts launch before the agent starts. `{{worktree}}` is substituted the same way as in `cmd`.
|
|
97
97
|
|
|
98
|
-
Under `runner: "none"`, exports flow through unchanged and `
|
|
98
|
+
Under `runner: "none"`, groundcrew clears each listed `preLaunchEnv` name immediately before `preLaunch`, then exports from the snippet flow through unchanged to the agent. Clearing inherited values ensures the launch-time empty check reflects what `preLaunch` produced instead of silently reusing an ambient credential. Groundcrew-managed worker metadata (`GROUNDCREW_TASK_ID` and `GROUNDCREW_COMPLETE`) cannot be listed because hooks may read those values and groundcrew owns what the agent receives. A non-empty `preLaunchEnv` is not supported when `local.runner` resolves to `sdx` in v1. An empty `preLaunchEnv: []` is a uniform no-op in every runner.
|
|
99
99
|
|
|
100
100
|
<details>
|
|
101
101
|
<summary>Manual fallback when <code>cmd</code> brings its own <code>safehouse</code> wrap</summary>
|
package/docs/development.md
CHANGED
|
@@ -10,7 +10,7 @@ node --run crew -- doctor
|
|
|
10
10
|
node --run crew:op -- run --watch
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
Both forms discover config through cosmiconfig. Source edits in `src/**` are picked up on the next invocation. Requires Node
|
|
13
|
+
Both forms discover config through cosmiconfig. Source edits in `src/**` are picked up on the next invocation. Requires Node 24.14.1.
|
|
14
14
|
|
|
15
15
|
Regenerate the README demo with VHS:
|
|
16
16
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clipboard-health/groundcrew",
|
|
3
|
-
"version": "4.50.
|
|
3
|
+
"version": "4.50.6",
|
|
4
4
|
"description": "Linear-driven orchestrator that launches AI coding agents in git worktrees, with workspace lifecycle and usage tracking.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"hook:pre-commit": "lint-staged --config config/lintStaged.config.js",
|
|
60
60
|
"hook:pre-push": "node --run verify",
|
|
61
61
|
"knip": "knip --config config/knip.json",
|
|
62
|
-
"lint": "oxlint --config config/oxlint.config.ts --deny-warnings",
|
|
62
|
+
"lint": "oxlint --config config/oxlint.config.ts --deny-warnings --ignore-pattern 'v2/**'",
|
|
63
63
|
"markdown:lint": "markdownlint-cli2 --config config/markdownlint-cli2.jsonc",
|
|
64
64
|
"prepack": "node --run build",
|
|
65
65
|
"prepare": "husky",
|
|
@@ -78,22 +78,22 @@
|
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@clipboard-health/ai-rules": "2.46.0",
|
|
81
|
-
"@clipboard-health/oxlint-config": "1.14.
|
|
81
|
+
"@clipboard-health/oxlint-config": "1.14.3",
|
|
82
82
|
"@nx/js": "23.1.0",
|
|
83
83
|
"@tsconfig/node24": "24.0.4",
|
|
84
84
|
"@tsconfig/strictest": "2.0.8",
|
|
85
85
|
"@types/node": "25.9.5",
|
|
86
86
|
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|
|
87
87
|
"@vitest/coverage-v8": "4.1.10",
|
|
88
|
-
"dependency-cruiser": "18.1.
|
|
88
|
+
"dependency-cruiser": "18.1.1",
|
|
89
89
|
"husky": "9.1.7",
|
|
90
90
|
"jscpd": "5.0.14",
|
|
91
91
|
"knip": "6.31.0",
|
|
92
92
|
"lint-staged": "17.3.0",
|
|
93
93
|
"markdownlint-cli2": "0.23.2",
|
|
94
94
|
"nx": "23.1.0",
|
|
95
|
-
"oxfmt": "0.
|
|
96
|
-
"oxlint": "1.
|
|
95
|
+
"oxfmt": "0.62.0",
|
|
96
|
+
"oxlint": "1.77.0",
|
|
97
97
|
"oxlint-tsgolint": "7.0.2001",
|
|
98
98
|
"syncpack": "15.3.2",
|
|
99
99
|
"vite": "8.2.0",
|