@clipboard-health/groundcrew 4.44.1 → 4.44.2

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":"interruptWorkspace.d.ts","sourceRoot":"","sources":["../../src/commands/interruptWorkspace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAMnE,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAqGD,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,IAAI,CAAC,CAyBf;AAED,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAGzE"}
1
+ {"version":3,"file":"interruptWorkspace.d.ts","sourceRoot":"","sources":["../../src/commands/interruptWorkspace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAMnE,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAqGD,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,IAAI,CAAC,CA6Bf;AAiBD,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAGzE"}
@@ -61,7 +61,7 @@ function resolveInterruptSource(arguments_) {
61
61
  if (arguments_.entry !== undefined) {
62
62
  return sourceFromWorktree(arguments_.config, arguments_.task, arguments_.entry);
63
63
  }
64
- throw new Error(`No run state or worktree found for ${arguments_.task}; nothing to interrupt.`);
64
+ return undefined;
65
65
  }
66
66
  function interruptDetail(result) {
67
67
  if (result.kind === "missing") {
@@ -81,6 +81,10 @@ export async function interruptWorkspace(config, options) {
81
81
  const state = readRunState(config, task);
82
82
  const [entry] = worktrees.findByTask(config, task);
83
83
  const source = resolveInterruptSource({ config, task, state, entry });
84
+ if (source === undefined) {
85
+ await interruptOrphanWorkspace(config, task);
86
+ return;
87
+ }
84
88
  const result = await workspaces.interrupt(config, source.workspaceName);
85
89
  failOnUnavailable(result);
86
90
  const detail = interruptDetail(result);
@@ -102,6 +106,18 @@ export async function interruptWorkspace(config, options) {
102
106
  log(`Interrupted ${task}; worktree preserved at ${source.worktreeDir}`);
103
107
  log(`Next: crew status ${task}`);
104
108
  }
109
+ // Orphan path: a tmux session/window for `task` exists but neither a run-state
110
+ // record nor a worktree does, so there's no lifecycle to record `interrupted`
111
+ // against — just close the workspace. Reported in `crew status` under
112
+ // "Orphaned sessions" and pointed at `crew stop`.
113
+ async function interruptOrphanWorkspace(config, task) {
114
+ const result = await workspaces.interrupt(config, task);
115
+ failOnUnavailable(result);
116
+ if (result.kind === "missing") {
117
+ throw new Error(`No run state, worktree, or live workspace found for ${task}; nothing to interrupt.`);
118
+ }
119
+ log(`Closed orphaned workspace ${task}`);
120
+ }
105
121
  export async function interruptWorkspaceCli(argv) {
106
122
  const config = await loadConfig();
107
123
  await interruptWorkspace(config, parseArguments(argv));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clipboard-health/groundcrew",
3
- "version": "4.44.1",
3
+ "version": "4.44.2",
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",