@clipboard-health/groundcrew 4.48.4 → 4.49.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/dist/commands/dispatcher.d.ts.map +1 -1
- package/dist/commands/dispatcher.js +5 -1
- package/dist/commands/openWorkspace.d.ts.map +1 -1
- package/dist/commands/openWorkspace.js +4 -10
- package/dist/commands/setupWorkspace.d.ts +3 -0
- package/dist/commands/setupWorkspace.d.ts.map +1 -1
- package/dist/commands/setupWorkspace.js +28 -12
- package/dist/lib/adapters/linear/factory.d.ts.map +1 -1
- package/dist/lib/adapters/linear/factory.js +6 -0
- package/dist/lib/adapters/linear/fetch.d.ts +3 -0
- package/dist/lib/adapters/linear/fetch.d.ts.map +1 -1
- package/dist/lib/adapters/linear/fetch.js +7 -1
- package/dist/lib/adapters/linear/parsing.d.ts +6 -0
- package/dist/lib/adapters/linear/parsing.d.ts.map +1 -1
- package/dist/lib/adapters/linear/parsing.js +6 -0
- package/dist/lib/adapters/shell/factory.d.ts.map +1 -1
- package/dist/lib/adapters/shell/factory.js +3 -0
- package/dist/lib/adapters/shell/schema.d.ts +2 -0
- package/dist/lib/adapters/shell/schema.d.ts.map +1 -1
- package/dist/lib/adapters/shell/schema.js +1 -0
- package/dist/lib/repositoryHooks.d.ts +11 -1
- package/dist/lib/repositoryHooks.d.ts.map +1 -1
- package/dist/lib/repositoryHooks.js +11 -0
- package/dist/lib/taskSource.d.ts +3 -0
- package/dist/lib/taskSource.d.ts.map +1 -1
- package/docs/setup-hooks.md +14 -0
- package/docs/task-sources.md +9 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatcher.d.ts","sourceRoot":"","sources":["../../src/commands/dispatcher.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kB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C;CACd;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,CAAC,UAAU,EAAE;QACpB,KAAK,EAAE,UAAU,CAAC;QAClB,eAAe,EAAE,SAAS,aAAa,EAAE,CAAC;QAC1C,+FAA+F;QAC/F,KAAK,EAAE,CAAC,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;QACvD,MAAM,EAAE,OAAO,CAAC;QAChB,MAAM,CAAC,EAAE,WAAW,CAAC;QACrB;;;;WAIG;QACH,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACrB;AAiCD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,cAAc,GAAG,UAAU,CA8OjE;AA8BD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,GAAG,MAAM,CAQrE"}
|
|
@@ -53,9 +53,10 @@ export function createDispatcher(deps) {
|
|
|
53
53
|
log(`Resolved agent-any for ${taskId} → ${issue.agent}`);
|
|
54
54
|
}
|
|
55
55
|
if (dryRun) {
|
|
56
|
+
const preparationSuffix = issue.worktreePreparation === "skip" ? "; prepareWorktree skipped" : "";
|
|
56
57
|
log(
|
|
57
58
|
/* v8 ignore next @preserve -- classifyTodo forces recovery=false in dry-run, so the resume branch can't fire here */
|
|
58
|
-
`[dry-run] Would ${recovery ? "resume" : "start"} ${taskId} in ${issue.repository} (${issue.agent})`);
|
|
59
|
+
`[dry-run] Would ${recovery ? "resume" : "start"} ${taskId} in ${issue.repository} (${issue.agent})${preparationSuffix}`);
|
|
59
60
|
logEvent("dispatch", {
|
|
60
61
|
outcome: "skipped",
|
|
61
62
|
reason: "dry_run",
|
|
@@ -79,6 +80,9 @@ export function createDispatcher(deps) {
|
|
|
79
80
|
sourceName: issue.source,
|
|
80
81
|
}),
|
|
81
82
|
agent: issue.agent,
|
|
83
|
+
...(issue.worktreePreparation === undefined
|
|
84
|
+
? {}
|
|
85
|
+
: { worktreePreparation: issue.worktreePreparation }),
|
|
82
86
|
details: {
|
|
83
87
|
title: issue.title,
|
|
84
88
|
description: issue.description,
|
|
@@ -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;AAgBtF,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;AAwJD,wBAAsB,aAAa,CACjC,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,IAAI,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;AAgBtF,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;AAwJD,wBAAsB,aAAa,CACjC,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,IAAI,CAAC,CAoHf;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"}
|
|
@@ -4,7 +4,7 @@ import { composeAgentLaunch, openAgentWorkspace, prepareAgentLaunch } from "../l
|
|
|
4
4
|
import { inferAgentCommandName } from "../lib/launchCommand.js";
|
|
5
5
|
import { loadConfig, repositoryBaseDir } from "../lib/config.js";
|
|
6
6
|
import { resolvePullRequest } from "../lib/pullRequests.js";
|
|
7
|
-
import {
|
|
7
|
+
import { resolveRepositoryPreparationCommands } from "../lib/repositoryHooks.js";
|
|
8
8
|
import { recordRunState, readRunState } from "../lib/runState.js";
|
|
9
9
|
import { seedLaunchWorkspaceTrust } from "../lib/seedLaunchWorkspaceTrust.js";
|
|
10
10
|
import { removeStagedPrompt, stageBuildSecrets, stagePromptText, stageWorkspaceLaunchCommand, } from "../lib/stagedLaunch.js";
|
|
@@ -152,17 +152,11 @@ export async function openWorkspace(config, options) {
|
|
|
152
152
|
});
|
|
153
153
|
let cleanupAgentLaunch;
|
|
154
154
|
try {
|
|
155
|
-
const
|
|
156
|
-
|
|
155
|
+
const { prepareWorktreeCommand, prepareWorktreeUnsandboxedCommand } = resolveRepositoryPreparationCommands({
|
|
156
|
+
config,
|
|
157
|
+
repository,
|
|
157
158
|
worktreeDir: launchDir,
|
|
158
|
-
// Spread-conditional: exactOptionalPropertyTypes forbids an explicit
|
|
159
|
-
// `undefined` for an optional field, and the lookup yields undefined for
|
|
160
|
-
// repos with no hooks. Mirrors setupWorkspace so `crew open` honors the
|
|
161
|
-
// same per-repo operator hooks as `crew setup`.
|
|
162
|
-
...(repositoryEntry?.hooks === undefined ? {} : { perRepoHooks: repositoryEntry.hooks }),
|
|
163
|
-
defaultHooks: config.defaults.hooks,
|
|
164
159
|
});
|
|
165
|
-
const prepareWorktreeUnsandboxedCommand = repositoryEntry?.unsandboxedHooks?.prepareWorktree;
|
|
166
160
|
const secretsFile = prepareWorktreeCommand === undefined && prepareWorktreeUnsandboxedCommand === undefined
|
|
167
161
|
? undefined
|
|
168
162
|
: stageBuildSecrets(stagedPrompt.directory);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ResolvedConfig } from "../lib/config.ts";
|
|
2
|
+
import { type WorktreePreparation } from "../lib/taskSource.ts";
|
|
2
3
|
export interface TaskDetails {
|
|
3
4
|
title: string;
|
|
4
5
|
description: string;
|
|
@@ -13,6 +14,8 @@ export interface SetupWorkspaceOptions {
|
|
|
13
14
|
completionMarkDoneSupported?: boolean;
|
|
14
15
|
repository: string;
|
|
15
16
|
agent: string;
|
|
17
|
+
/** Set to `skip` to bypass configured prepareWorktree hooks. */
|
|
18
|
+
worktreePreparation?: WorktreePreparation;
|
|
16
19
|
details: TaskDetails;
|
|
17
20
|
}
|
|
18
21
|
export interface SetupWorkspaceRunOptions {
|
|
@@ -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;
|
|
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;AAUxF,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,CA0Jf;AAiOD,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GACjC,OAAO,CAAC,IAAI,CAAC,CAyDf"}
|
|
@@ -3,7 +3,7 @@ import { composeAgentLaunch, openAgentWorkspace, prepareAgentLaunch } from "../l
|
|
|
3
3
|
import { inferAgentCommandName, workerEnvironmentForTask } from "../lib/launchCommand.js";
|
|
4
4
|
import { createBoard } from "../lib/board.js";
|
|
5
5
|
import { buildSources, sourcesFromConfig } from "../lib/buildSources.js";
|
|
6
|
-
import {
|
|
6
|
+
import { resolveRepositoryPreparationCommands } from "../lib/repositoryHooks.js";
|
|
7
7
|
import { recordRunState } from "../lib/runState.js";
|
|
8
8
|
import { seedLaunchWorkspaceTrust } from "../lib/seedLaunchWorkspaceTrust.js";
|
|
9
9
|
import { sourceSupportsMarkDone } from "../lib/sourceCapabilities.js";
|
|
@@ -84,17 +84,16 @@ export async function setupWorkspace(config, options, runOptions = {}) {
|
|
|
84
84
|
workspaceContinuationInstruction: renderWorkspaceContinuationInstruction(accessHint),
|
|
85
85
|
});
|
|
86
86
|
promptDir = stagedPrompt.directory;
|
|
87
|
-
const
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
// exactOptionalPropertyTypes an optional field can't take an explicit
|
|
94
|
-
// `undefined`, and the lookup yields undefined for repos with no hooks.
|
|
95
|
-
...(perRepoHooks === undefined ? {} : { perRepoHooks }),
|
|
96
|
-
defaultHooks: config.defaults.hooks,
|
|
87
|
+
const shouldPrepareWorktree = options.worktreePreparation !== "skip";
|
|
88
|
+
const { prepareWorktreeCommand, prepareWorktreeUnsandboxedCommand } = resolveTaskPreparationCommands({
|
|
89
|
+
config,
|
|
90
|
+
repository,
|
|
91
|
+
launchDir,
|
|
92
|
+
shouldPrepareWorktree,
|
|
97
93
|
});
|
|
94
|
+
if (!shouldPrepareWorktree) {
|
|
95
|
+
log(`Skipping prepareWorktree for ${task} (task policy)`);
|
|
96
|
+
}
|
|
98
97
|
const secretsFile = prepareWorktreeCommand === undefined && prepareWorktreeUnsandboxedCommand === undefined
|
|
99
98
|
? undefined
|
|
100
99
|
: stageBuildSecrets(promptDir);
|
|
@@ -172,6 +171,19 @@ export async function setupWorkspace(config, options, runOptions = {}) {
|
|
|
172
171
|
throw error;
|
|
173
172
|
}
|
|
174
173
|
}
|
|
174
|
+
function resolveTaskPreparationCommands(arguments_) {
|
|
175
|
+
if (!arguments_.shouldPrepareWorktree) {
|
|
176
|
+
return {
|
|
177
|
+
prepareWorktreeCommand: undefined,
|
|
178
|
+
prepareWorktreeUnsandboxedCommand: undefined,
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
return resolveRepositoryPreparationCommands({
|
|
182
|
+
config: arguments_.config,
|
|
183
|
+
repository: arguments_.repository,
|
|
184
|
+
worktreeDir: arguments_.launchDir,
|
|
185
|
+
});
|
|
186
|
+
}
|
|
175
187
|
/**
|
|
176
188
|
* Bail out before any state-write when the worktree already exists, then
|
|
177
189
|
* record a "provisioning" row so `crew status` can surface the in-flight
|
|
@@ -352,7 +364,8 @@ export async function setupWorkspaceCli(task, options = {}) {
|
|
|
352
364
|
}
|
|
353
365
|
log(`Resolved ${task}: repository=${resolved.repository}, agent=${resolved.agent}`);
|
|
354
366
|
if (options.dryRun === true) {
|
|
355
|
-
|
|
367
|
+
const preparationSuffix = resolved.worktreePreparation === "skip" ? "; prepareWorktree skipped" : "";
|
|
368
|
+
log(`[dry-run] Would launch ${task} in ${resolved.repository} (${resolved.agent})${preparationSuffix}`);
|
|
356
369
|
return;
|
|
357
370
|
}
|
|
358
371
|
const naturalId = naturalIdFromCanonical(resolved.id);
|
|
@@ -365,6 +378,9 @@ export async function setupWorkspaceCli(task, options = {}) {
|
|
|
365
378
|
}),
|
|
366
379
|
repository: resolved.repository,
|
|
367
380
|
agent: resolved.agent,
|
|
381
|
+
...(resolved.worktreePreparation === undefined
|
|
382
|
+
? {}
|
|
383
|
+
: { worktreePreparation: resolved.worktreePreparation }),
|
|
368
384
|
details: {
|
|
369
385
|
title: resolved.title,
|
|
370
386
|
description: resolved.description,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../../src/lib/adapters/linear/factory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAIL,KAAK,KAAK,IAAI,cAAc,EAG5B,KAAK,UAAU,EAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD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AC3D,cAAc,CA+BhB;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,mBAAmB,EAC3B,OAAO,EAAE,cAAc,GACtB,UAAU,CAqIZ"}
|
|
@@ -85,6 +85,9 @@ export function toCanonicalIssue(linearIssue, sourceName, statusNames = DEFAULT_
|
|
|
85
85
|
hasMoreBlockers: linearIssue.hasMoreBlockers,
|
|
86
86
|
url: linearIssue.url,
|
|
87
87
|
...(linearIssue.priority === 0 ? {} : { priority: linearIssue.priority }),
|
|
88
|
+
...(linearIssue.worktreePreparation === undefined
|
|
89
|
+
? {}
|
|
90
|
+
: { worktreePreparation: linearIssue.worktreePreparation }),
|
|
88
91
|
sourceRef,
|
|
89
92
|
};
|
|
90
93
|
}
|
|
@@ -156,6 +159,9 @@ export function createLinearTaskSource(config, context) {
|
|
|
156
159
|
hasMoreBlockers: resolved.hasMoreBlockers,
|
|
157
160
|
url: resolved.url,
|
|
158
161
|
...(resolved.priority === 0 ? {} : { priority: resolved.priority }),
|
|
162
|
+
...(resolved.worktreePreparation === undefined
|
|
163
|
+
? {}
|
|
164
|
+
: { worktreePreparation: resolved.worktreePreparation }),
|
|
159
165
|
sourceRef,
|
|
160
166
|
};
|
|
161
167
|
}
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import type { LinearClient } from "@linear/sdk";
|
|
11
11
|
import type { ResolvedConfig } from "../../config.ts";
|
|
12
|
+
import { type WorktreePreparation } from "../../taskSource.ts";
|
|
12
13
|
import { type AgentResolution } from "./parsing.ts";
|
|
13
14
|
export declare const ISSUES_PAGE_SIZE = 250;
|
|
14
15
|
export interface Blocker {
|
|
@@ -49,6 +50,7 @@ export interface Issue {
|
|
|
49
50
|
url: string;
|
|
50
51
|
/** Linear priority: 1=Urgent, 2=High, 3=Medium, 4=Low, 0=No priority. */
|
|
51
52
|
priority: number;
|
|
53
|
+
worktreePreparation?: WorktreePreparation;
|
|
52
54
|
}
|
|
53
55
|
/**
|
|
54
56
|
* `Issue` narrowed to "this task is for groundcrew". Consumers operate on
|
|
@@ -122,6 +124,7 @@ interface ResolvedIssue {
|
|
|
122
124
|
hasMoreBlockers: boolean;
|
|
123
125
|
url: string;
|
|
124
126
|
priority: number;
|
|
127
|
+
worktreePreparation?: WorktreePreparation;
|
|
125
128
|
}
|
|
126
129
|
export interface RawLinearIssue {
|
|
127
130
|
uuid: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../../src/lib/adapters/linear/fetch.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../../src/lib/adapters/linear/fetch.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAA6B,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1F,OAAO,EAKL,KAAK,eAAe,EACrB,MAAM,cAAc,CAAC;AAEtB,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAYpC,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B;;;;OAIG;IACH,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B;AAED,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf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M,CAAC;CACd,GAAG,OAAO,CAAC,aAAa,CAAC,CAyCzB;AAED,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,MAAM,EACZ,eAAe,EAAE,eAAe,EAChC,MAAM,EAAE,cAAc,GACrB,IAAI,CAON;AAED,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,iBAAiB,EAAE,GAAG,OAAO,EAAE,CAS/E"}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { RepositoryResolutionError } from "../../taskSource.js";
|
|
11
11
|
import { log, styleWarning } from "../../util.js";
|
|
12
|
-
import { AGENT_LABEL_PREFIX, resolveAgentFor, resolveRepositoryFor, } from "./parsing.js";
|
|
12
|
+
import { AGENT_LABEL_PREFIX, resolveAgentFor, resolveRepositoryFor, resolveWorktreePreparation, } from "./parsing.js";
|
|
13
13
|
export const ISSUES_PAGE_SIZE = 250;
|
|
14
14
|
// `state.type` values surfaced by `fetch()`. `backlog` / `triage` are dropped
|
|
15
15
|
// at the GraphQL filter; everything else is post-classified by these names.
|
|
@@ -182,6 +182,9 @@ function buildLinearIssue(input) {
|
|
|
182
182
|
priority: input.priority,
|
|
183
183
|
blockers: blockersFromRelations(input.inverseRelations?.nodes ?? []),
|
|
184
184
|
hasMoreBlockers: input.inverseRelations?.pageInfo.hasNextPage ?? false,
|
|
185
|
+
...(input.worktreePreparation === undefined
|
|
186
|
+
? {}
|
|
187
|
+
: { worktreePreparation: input.worktreePreparation }),
|
|
185
188
|
};
|
|
186
189
|
}
|
|
187
190
|
function issueFromNode(node, config) {
|
|
@@ -214,6 +217,7 @@ function issueFromNode(node, config) {
|
|
|
214
217
|
teamId: node.team?.id ?? "",
|
|
215
218
|
url: node.url,
|
|
216
219
|
priority: node.priority,
|
|
220
|
+
worktreePreparation: resolveWorktreePreparation({ labels: node.labels.nodes }),
|
|
217
221
|
inverseRelations: node.inverseRelations,
|
|
218
222
|
});
|
|
219
223
|
}
|
|
@@ -374,6 +378,7 @@ export async function fetchResolvedIssue(arguments_) {
|
|
|
374
378
|
else if (agentResolution.kind === "not-enabled-fallback") {
|
|
375
379
|
agent = agentResolution.fallbackAgent;
|
|
376
380
|
}
|
|
381
|
+
const worktreePreparation = resolveWorktreePreparation({ labels: raw.labels });
|
|
377
382
|
return {
|
|
378
383
|
uuid: raw.uuid,
|
|
379
384
|
title: raw.title,
|
|
@@ -390,6 +395,7 @@ export async function fetchResolvedIssue(arguments_) {
|
|
|
390
395
|
hasMoreBlockers: raw.hasMoreBlockers,
|
|
391
396
|
url: raw.url,
|
|
392
397
|
priority: raw.priority,
|
|
398
|
+
...(worktreePreparation === undefined ? {} : { worktreePreparation }),
|
|
393
399
|
};
|
|
394
400
|
}
|
|
395
401
|
export function warnIfNotEnabledFallback(task, agentResolution, config) {
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* issue labels and descriptions. Extracted from boardSource.ts (Task 10).
|
|
4
4
|
*/
|
|
5
5
|
import { type ResolvedConfig } from "../../config.ts";
|
|
6
|
+
import { type WorktreePreparation } from "../../taskSource.ts";
|
|
6
7
|
export declare const AGENT_LABEL_PREFIX = "agent-";
|
|
7
8
|
export type RepositoryResolution = {
|
|
8
9
|
kind: "ok";
|
|
@@ -22,6 +23,11 @@ export type AgentResolution = {
|
|
|
22
23
|
requestedAgent: string;
|
|
23
24
|
fallbackAgent: string;
|
|
24
25
|
};
|
|
26
|
+
export declare function resolveWorktreePreparation(arguments_: {
|
|
27
|
+
labels: Array<{
|
|
28
|
+
name: string;
|
|
29
|
+
}>;
|
|
30
|
+
}): WorktreePreparation | undefined;
|
|
25
31
|
export declare function buildRepositoryRegex(config: ResolvedConfig): RegExp;
|
|
26
32
|
export declare function resolveRepositoryFor(arguments_: {
|
|
27
33
|
description: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parsing.d.ts","sourceRoot":"","sources":["../../../../src/lib/adapters/linear/parsing.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OA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AE,MAAM,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,eAAe,CAAC,UAAU,EAAE,wBAAwB,GAAG,MAAM,CA2B5E;AAkDD,wBAAgB,eAAe,CAAC,UAAU,EAAE;IAC1C,MAAM,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAChC,MAAM,EAAE,cAAc,CAAC;CACxB,GAAG,eAAe,CAiBlB"}
|
|
@@ -5,6 +5,12 @@
|
|
|
5
5
|
import { AGENT_ANY, isBuiltInAgentNotEnabled } from "../../config.js";
|
|
6
6
|
import { RepositoryResolutionError } from "../../taskSource.js";
|
|
7
7
|
export const AGENT_LABEL_PREFIX = "agent-";
|
|
8
|
+
const SKIP_PREPARE_WORKTREE_LABEL = "groundcrew-skip-prepare";
|
|
9
|
+
export function resolveWorktreePreparation(arguments_) {
|
|
10
|
+
return arguments_.labels.some((label) => label.name === SKIP_PREPARE_WORKTREE_LABEL)
|
|
11
|
+
? "skip"
|
|
12
|
+
: undefined;
|
|
13
|
+
}
|
|
8
14
|
function escapeRegex(value) {
|
|
9
15
|
return value.replaceAll(/[$()*+.?[\\\]^{|}]/g, String.raw `\$&`);
|
|
10
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../../src/lib/adapters/shell/factory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAIL,KAAK,KAAK,IAAI,cAAc,EAG5B,KAAK,UAAU,EAChB,MAAM,qBAAqB,CAAC;AAK7B,OAAO,EACL,KAAK,kBAAkB,EAEvB,KAAK,UAAU,EAGhB,MAAM,aAAa,CAAC;AAyErB,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,GAAG,cAAc,
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../../src/lib/adapters/shell/factory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAIL,KAAK,KAAK,IAAI,cAAc,EAG5B,KAAK,UAAU,EAChB,MAAM,qBAAqB,CAAC;AAK7B,OAAO,EACL,KAAK,kBAAkB,EAEvB,KAAK,UAAU,EAGhB,MAAM,aAAa,CAAC;AAyErB,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,GAAG,cAAc,CA0B3F;AA8BD,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,kBAAkB,EAC1B,QAAQ,EAAE,cAAc,GACvB,UAAU,CAsMZ"}
|
|
@@ -92,6 +92,9 @@ export function toCanonicalIssue(shellIssue, sourceName) {
|
|
|
92
92
|
blockers,
|
|
93
93
|
hasMoreBlockers: shellIssue.hasMoreBlockers,
|
|
94
94
|
...(shellIssue.url === undefined ? {} : { url: shellIssue.url }),
|
|
95
|
+
...(shellIssue.worktreePreparation === undefined
|
|
96
|
+
? {}
|
|
97
|
+
: { worktreePreparation: shellIssue.worktreePreparation }),
|
|
95
98
|
sourceRef: shellIssue.sourceRef,
|
|
96
99
|
};
|
|
97
100
|
}
|
|
@@ -42,6 +42,7 @@ export declare const shellIssueSchema: z.ZodObject<{
|
|
|
42
42
|
}, z.core.$strip>>;
|
|
43
43
|
hasMoreBlockers: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
44
44
|
url: z.ZodOptional<z.ZodURL>;
|
|
45
|
+
worktreePreparation: z.ZodOptional<z.ZodLiteral<"skip">>;
|
|
45
46
|
sourceRef: z.ZodUnknown;
|
|
46
47
|
}, z.core.$strip>;
|
|
47
48
|
export type ShellIssue = z.infer<typeof shellIssueSchema>;
|
|
@@ -78,6 +79,7 @@ export declare const shellFetchOutputSchema: z.ZodArray<z.ZodObject<{
|
|
|
78
79
|
}, z.core.$strip>>;
|
|
79
80
|
hasMoreBlockers: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
80
81
|
url: z.ZodOptional<z.ZodURL>;
|
|
82
|
+
worktreePreparation: z.ZodOptional<z.ZodLiteral<"skip">>;
|
|
81
83
|
sourceRef: z.ZodUnknown;
|
|
82
84
|
}, z.core.$strip>>;
|
|
83
85
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/lib/adapters/shell/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,eAAO,MAAM,gBAAgB
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/lib/adapters/shell/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkB3B,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAA4B,CAAC;AAEhE;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,yBAAsB,CAAC;AAE7D,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8EnC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
|
|
@@ -33,6 +33,7 @@ export const shellIssueSchema = z.object({
|
|
|
33
33
|
* breaking; `crew status` falls back to displaying just the id.
|
|
34
34
|
*/
|
|
35
35
|
url: z.url().optional(),
|
|
36
|
+
worktreePreparation: z.literal("skip").optional(),
|
|
36
37
|
sourceRef: z.unknown(),
|
|
37
38
|
});
|
|
38
39
|
export const shellFetchOutputSchema = z.array(shellIssueSchema);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { HookCommands } from "./config.ts";
|
|
1
|
+
import type { HookCommands, ResolvedConfig } from "./config.ts";
|
|
2
2
|
interface ResolvePrepareWorktreeCommandArguments {
|
|
3
3
|
worktreeDir: string;
|
|
4
4
|
/**
|
|
@@ -10,6 +10,16 @@ interface ResolvePrepareWorktreeCommandArguments {
|
|
|
10
10
|
perRepoHooks?: HookCommands;
|
|
11
11
|
defaultHooks: HookCommands;
|
|
12
12
|
}
|
|
13
|
+
interface ResolveRepositoryPreparationCommandsArguments {
|
|
14
|
+
config: ResolvedConfig;
|
|
15
|
+
repository: string;
|
|
16
|
+
worktreeDir: string;
|
|
17
|
+
}
|
|
18
|
+
interface RepositoryPreparationCommands {
|
|
19
|
+
prepareWorktreeCommand: string | undefined;
|
|
20
|
+
prepareWorktreeUnsandboxedCommand: string | undefined;
|
|
21
|
+
}
|
|
22
|
+
export declare function resolveRepositoryPreparationCommands(arguments_: ResolveRepositoryPreparationCommandsArguments): RepositoryPreparationCommands;
|
|
13
23
|
export declare function resolvePrepareWorktreeCommand(arguments_: ResolvePrepareWorktreeCommandArguments): string | undefined;
|
|
14
24
|
export {};
|
|
15
25
|
//# sourceMappingURL=repositoryHooks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repositoryHooks.d.ts","sourceRoot":"","sources":["../../src/lib/repositoryHooks.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"repositoryHooks.d.ts","sourceRoot":"","sources":["../../src/lib/repositoryHooks.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAIhE,UAAU,sCAAsC;IAC9C,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED,UAAU,6CAA6C;IACrD,MAAM,EAAE,cAAc,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,6BAA6B;IACrC,sBAAsB,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3C,iCAAiC,EAAE,MAAM,GAAG,SAAS,CAAC;CACvD;AAED,wBAAgB,oCAAoC,CAClD,UAAU,EAAE,6CAA6C,GACxD,6BAA6B,CAY/B;AAMD,wBAAgB,6BAA6B,CAC3C,UAAU,EAAE,sCAAsC,GACjD,MAAM,GAAG,SAAS,CAOpB"}
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import { readFileSync } from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
const REPOSITORY_CONFIG_RELATIVE_PATH = ".groundcrew/config.json";
|
|
4
|
+
export function resolveRepositoryPreparationCommands(arguments_) {
|
|
5
|
+
const repositoryEntry = arguments_.config.workspace.repositories.find((entry) => entry.name === arguments_.repository);
|
|
6
|
+
return {
|
|
7
|
+
prepareWorktreeCommand: resolvePrepareWorktreeCommand({
|
|
8
|
+
worktreeDir: arguments_.worktreeDir,
|
|
9
|
+
...(repositoryEntry?.hooks === undefined ? {} : { perRepoHooks: repositoryEntry.hooks }),
|
|
10
|
+
defaultHooks: arguments_.config.defaults.hooks,
|
|
11
|
+
}),
|
|
12
|
+
prepareWorktreeUnsandboxedCommand: repositoryEntry?.unsandboxedHooks?.prepareWorktree,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
4
15
|
// Flat precedence cascade, highest priority first: the repo-committed
|
|
5
16
|
// `.groundcrew/config.json` wins (closest to the code), then the per-repo
|
|
6
17
|
// operator layer, then the global `defaults.hooks` fallback. All three reuse
|
package/dist/lib/taskSource.d.ts
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
* `backlog`/`triage`, blockers with no resolvable state).
|
|
22
22
|
*/
|
|
23
23
|
export type CanonicalStatus = "todo" | "in-progress" | "in-review" | "done" | "other";
|
|
24
|
+
export type WorktreePreparation = "skip";
|
|
24
25
|
export interface Blocker {
|
|
25
26
|
/** Canonical (source-prefixed) id of the blocking task. */
|
|
26
27
|
id: string;
|
|
@@ -82,6 +83,8 @@ export interface Issue {
|
|
|
82
83
|
priority?: number;
|
|
83
84
|
/** Adapter-private. Consumers MUST NOT inspect; only the producing adapter reads it. */
|
|
84
85
|
sourceRef: unknown;
|
|
86
|
+
/** Task-level opt-out from configured worktree preparation hooks. */
|
|
87
|
+
worktreePreparation?: WorktreePreparation;
|
|
85
88
|
}
|
|
86
89
|
export type Task = Issue;
|
|
87
90
|
/** Narrowed form: an Issue confirmed to be groundcrew-eligible. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taskSource.d.ts","sourceRoot":"","sources":["../../src/lib/taskSource.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,aAAa,GAAG,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC;AAEtF,MAAM,WAAW,OAAO;IACtB,2DAA2D;IAC3D,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,eAAe,CAAC;IACxB;;;;;;;;;;;;;OAaG;IACH,YAAY,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;IACtC;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,KAAK;IACpB,kFAAkF;IAClF,EAAE,EAAE,MAAM,CAAC;IACX,oEAAoE;IACpE,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE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docs/setup-hooks.md
CHANGED
|
@@ -33,6 +33,20 @@ Hook failures are advisory. Groundcrew logs the non-zero exit and still launches
|
|
|
33
33
|
the agent so a flaky package registry or stale lockfile does not block the
|
|
34
34
|
session.
|
|
35
35
|
|
|
36
|
+
## Task-level opt-out
|
|
37
|
+
|
|
38
|
+
Some tasks need the repository checkout but not its dependency installation or
|
|
39
|
+
code generation. Add the exact Linear label `groundcrew-skip-prepare` to skip
|
|
40
|
+
worktree preparation for that task. Shell task sources can emit
|
|
41
|
+
`"worktreePreparation": "skip"` in the issue JSON for the same behavior.
|
|
42
|
+
|
|
43
|
+
The opt-out skips every preparation layer, including the operator-only
|
|
44
|
+
`unsandboxedHooks.prepareWorktree` hook. Groundcrew still creates the worktree
|
|
45
|
+
and launches the agent normally. This policy does not make the worktree
|
|
46
|
+
read-only; it only skips preparation commands.
|
|
47
|
+
|
|
48
|
+
Dry-run output includes `prepareWorktree skipped` when the policy applies.
|
|
49
|
+
|
|
36
50
|
## Precedence
|
|
37
51
|
|
|
38
52
|
`prepareWorktree` resolves through three layers, highest priority first:
|
package/docs/task-sources.md
CHANGED
|
@@ -69,12 +69,17 @@ declared paths. The `sdx` runner does not mount these host paths.
|
|
|
69
69
|
"updatedAt": "2026-05-22T15:00:00Z",
|
|
70
70
|
"blockers": [{ "id": "JIRA-122", "title": "Schema migration", "status": "done" }],
|
|
71
71
|
"hasMoreBlockers": false,
|
|
72
|
+
"worktreePreparation": "skip",
|
|
72
73
|
"sourceRef": { "nativeId": "10042" }
|
|
73
74
|
}
|
|
74
75
|
]
|
|
75
76
|
```
|
|
76
77
|
|
|
77
78
|
Allowed `status` values are `todo`, `in-progress`, `in-review`, `done`, and `other`. In shell-script JSON output, emit both `repository` and `agent`; use `null` when a task should not be groundcrew-eligible. `hasMoreBlockers` is optional and defaults to `false`; `sourceRef` is opaque data that groundcrew passes back to your writeback command.
|
|
79
|
+
`worktreePreparation` is optional. Set it to `skip` when the task should create
|
|
80
|
+
its worktree without running any configured `prepareWorktree` or
|
|
81
|
+
`unsandboxedHooks.prepareWorktree` command; omission preserves the default
|
|
82
|
+
preparation behavior.
|
|
78
83
|
|
|
79
84
|
## Todo.txt
|
|
80
85
|
|
|
@@ -144,6 +149,10 @@ crew task create "Fix cancellation retry race" \
|
|
|
144
149
|
|
|
145
150
|
Created Linear issues are assigned to the API key's viewer, moved into a Todo workflow state, labeled with exactly one `agent-*` label, and given a description that includes `Repository: <repo>` near the top. Repeated `--dep <ISSUE>` values create Linear blocked-by relations when the dependency is a Linear issue id.
|
|
146
151
|
|
|
152
|
+
Add the exact `groundcrew-skip-prepare` label to an existing Linear task when it
|
|
153
|
+
should create a worktree without running configured worktree preparation hooks.
|
|
154
|
+
The label does not make the worktree read-only.
|
|
155
|
+
|
|
147
156
|
## The `description` is the agent's prompt
|
|
148
157
|
|
|
149
158
|
Groundcrew wraps each issue's `description` in its generic unattended-execution prompt and hands it to the agent as the task. It does not pick a different prompt per source or task type. Specialized behavior belongs in the `description` your adapter emits, not in groundcrew.
|
package/package.json
CHANGED