@clipboard-health/groundcrew 4.3.2 → 4.3.4
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeback.d.ts","sourceRoot":"","sources":["../../../../src/lib/adapters/linear/writeback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAIhD,UAAU,oBAAoB;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,wBAAwB;IAChC,cAAc,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5D;AAED,wBAAgB,8BAA8B,CAAC,UAAU,EAAE;IACzD,MAAM,EAAE,YAAY,CAAC;CACtB,GAAG,wBAAwB,
|
|
1
|
+
{"version":3,"file":"writeback.d.ts","sourceRoot":"","sources":["../../../../src/lib/adapters/linear/writeback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAIhD,UAAU,oBAAoB;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,wBAAwB;IAChC,cAAc,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5D;AAED,wBAAgB,8BAA8B,CAAC,UAAU,EAAE;IACzD,MAAM,EAAE,YAAY,CAAC;CACtB,GAAG,wBAAwB,CAuD3B"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { log } from "../../util.js";
|
|
2
2
|
export function createLinearIssueStatusUpdater(arguments_) {
|
|
3
3
|
const { client } = arguments_;
|
|
4
|
-
// Positive cache only. Keyed by teamId because the
|
|
5
|
-
//
|
|
4
|
+
// Positive cache only. Keyed by teamId because the in-progress-state
|
|
5
|
+
// resolution yields a single stateId per team — independent of which
|
|
6
6
|
// project the ticket belongs to. State ids don't change for misconfig
|
|
7
7
|
// reasons, so caching successful resolutions is safe across the process.
|
|
8
8
|
//
|
|
@@ -23,10 +23,16 @@ export function createLinearIssueStatusUpdater(arguments_) {
|
|
|
23
23
|
}
|
|
24
24
|
const team = await client.team(teamId);
|
|
25
25
|
const states = await team.states();
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
//
|
|
29
|
-
|
|
26
|
+
// Linear's default workflow has MULTIPLE `started`-type states — both
|
|
27
|
+
// "In Progress" and "In Review" are `started`. `team.states()` orders by
|
|
28
|
+
// updatedAt (the connection has no position ordering), so array order
|
|
29
|
+
// can't disambiguate them. Prefer the state literally named "In Progress";
|
|
30
|
+
// otherwise fall back to the lowest-position (leftmost) `started` column,
|
|
31
|
+
// which by Linear convention is the in-progress one. This survives teams
|
|
32
|
+
// that rename the column ("Doing", "WIP", ...).
|
|
33
|
+
const startedStates = states.nodes.filter((state) => state.type === "started");
|
|
34
|
+
const inProgress = startedStates.find((state) => state.name.trim().toLowerCase() === "in progress") ??
|
|
35
|
+
startedStates.toSorted((a, b) => a.position - b.position).at(0);
|
|
30
36
|
if (inProgress?.id === undefined) {
|
|
31
37
|
return undefined;
|
|
32
38
|
}
|
|
@@ -188,7 +188,7 @@ function buildUnwrappedHostLaunchCommand(arguments_) {
|
|
|
188
188
|
* strips them); they're `unset` on the host after setup and not passed to the
|
|
189
189
|
* agent wrap. The host keeps `cd`, the prompt read, and a temporary
|
|
190
190
|
* command-named shim so Safehouse can select the intended agent profile while
|
|
191
|
-
* the actual agent command remains `sh -
|
|
191
|
+
* the actual agent command remains `sh -c`.
|
|
192
192
|
*/
|
|
193
193
|
function buildSafehouseLaunchCommand(arguments_) {
|
|
194
194
|
const promptDir = dirname(arguments_.promptFile);
|
|
@@ -207,16 +207,16 @@ function buildSafehouseLaunchCommand(arguments_) {
|
|
|
207
207
|
if (arguments_.secretsFile !== undefined) {
|
|
208
208
|
lines.push(sourceSecretsLine(arguments_.secretsFile));
|
|
209
209
|
}
|
|
210
|
-
lines.push(`_p=$(cat ${shellSingleQuote(arguments_.promptFile)})`, `rm -rf ${shellSingleQuote(promptDir)}`, `${safehouseWrapper} ${envPassFlag}sh -
|
|
210
|
+
lines.push(`_p=$(cat ${shellSingleQuote(arguments_.promptFile)})`, `rm -rf ${shellSingleQuote(promptDir)}`, `${safehouseWrapper} ${envPassFlag}sh -c ${shellSingleQuote(setupCommand)}`);
|
|
211
211
|
if (arguments_.secretsFile !== undefined) {
|
|
212
212
|
lines.push(unsetSecretsLine());
|
|
213
213
|
}
|
|
214
214
|
lines.push(`_safehouse_shim_dir=$(mktemp -d "\${TMPDIR:-/tmp}/groundcrew-safehouse-XXXXXX")`, `trap 'rm -rf "$_safehouse_shim_dir"' EXIT`, `_safehouse_shim="$_safehouse_shim_dir/${safehouseCommandName}"`, `ln -s /bin/sh "$_safehouse_shim"`,
|
|
215
215
|
// Safehouse selects an agent profile from the wrapped command's basename.
|
|
216
|
-
// Running the real launch chain as `sh -
|
|
216
|
+
// Running the real launch chain as `sh -c` would make it see `sh`, so use
|
|
217
217
|
// an agent-named symlink to /bin/sh. This preserves per-agent profile
|
|
218
218
|
// selection without enabling every agent profile.
|
|
219
|
-
`${safehouseWrapper} "$_safehouse_shim" -
|
|
219
|
+
`${safehouseWrapper} "$_safehouse_shim" -c ${shellSingleQuote(agentCommand)} sh "$_p"; _safehouse_status=$?; rm -rf "$_safehouse_shim_dir"; trap - EXIT; exit "$_safehouse_status"`);
|
|
220
220
|
return lines.join(" && ");
|
|
221
221
|
}
|
|
222
222
|
function buildSdxLaunchCommand(arguments_) {
|
|
@@ -248,6 +248,6 @@ function buildSdxLaunchCommand(arguments_) {
|
|
|
248
248
|
if (arguments_.secretsFile !== undefined) {
|
|
249
249
|
lines.push(sourceSecretsLine(arguments_.secretsFile));
|
|
250
250
|
}
|
|
251
|
-
lines.push(`_p=$(cat ${shellSingleQuote(arguments_.promptFile)})`, `rm -rf ${shellSingleQuote(promptDir)}`, `exec sbx exec -it ${sbxEnvironmentFlags}-w ${shellSingleQuote(arguments_.worktreeDir)} ${shellSingleQuote(arguments_.sandboxName)} sh -
|
|
251
|
+
lines.push(`_p=$(cat ${shellSingleQuote(arguments_.promptFile)})`, `rm -rf ${shellSingleQuote(promptDir)}`, `exec sbx exec -it ${sbxEnvironmentFlags}-w ${shellSingleQuote(arguments_.worktreeDir)} ${shellSingleQuote(arguments_.sandboxName)} sh -c ${shellSingleQuote(innerCommand)} sh "$_p"`);
|
|
252
252
|
return lines.join(" && ");
|
|
253
253
|
}
|
package/package.json
CHANGED