@gaia-ai/core 0.5.4 → 0.5.5

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.
@@ -66,15 +66,20 @@ export interface GaiaExecutor {
66
66
  */
67
67
  stopRun(branch: string): Promise<void>;
68
68
  /**
69
- * Tear down the run's hosted UI surface — for herdr, close every tab of the
70
- * branch workspace via `herdr tab close <tab_id>` (killing the PTY). Called
71
- * as the LAST finalisation step, strictly after the transcript is captured,
72
- * and again at dispatch to clear a reused workspace's leftover tabs. Does NOT
73
- * touch the branch worktree (that is the reap/{@link removeWorktree}
74
- * lifecycle). Best-effort: one failing tab-close must not abort the others,
75
- * finalisation, or dispatch. A no-op for non-persistent executors.
69
+ * Tear down ONE run's hosted UI surface — for herdr, close only the tab whose
70
+ * label carries the `#<runId>` token (`startRun` labels every tab
71
+ * `<identifier> · <state> #<run.id>`), via `herdr tab close <tab_id>` (killing
72
+ * that PTY). Run-scoped by design (GAIA-183): a sibling run's tab in the same
73
+ * branch workspace a still-open prior-state run or a concurrent re-claim —
74
+ * and any non-run tab are left untouched. Called as the LAST finalisation step,
75
+ * strictly after the transcript is captured, and again at dispatch to clear a
76
+ * reused workspace's leftover tab for the run being (re-)started. No matching
77
+ * tab → a quiet no-op. Does NOT touch the branch worktree (that is the
78
+ * reap/{@link removeWorktree} lifecycle). Best-effort: a failing tab-close is
79
+ * swallowed and never aborts finalisation or dispatch. A no-op for
80
+ * non-persistent executors.
76
81
  */
77
- cleanupRun(branch: string): Promise<void>;
82
+ cleanupRun(branch: string, runId: number): Promise<void>;
78
83
  /**
79
84
  * Tear down the branch's entire worktree (git worktree + hosted workspace),
80
85
  * reclaiming its disk. Called by the conductor's ticket-cleanup pass once a
@@ -237,7 +237,7 @@ export class DrupalGaiaRemote {
237
237
  .where('conductor_id.machine_id', '=', id)
238
238
  .where('state', '=', 'done')
239
239
  .where('closed', '=', '0')
240
- .fields(['worktree_path', 'agent'])
240
+ .fields(['worktree_path', 'agent', 'drupal_internal__id'])
241
241
  .page(100)
242
242
  .list();
243
243
  // No `started_at` read: the run's duration_s is derived from the agent
@@ -245,6 +245,8 @@ export class DrupalGaiaRemote {
245
245
  // the timestamp back through JSON:API.
246
246
  return rows.map((r) => ({
247
247
  runUuid: r.id,
248
+ // The `#<runId>` tab-label token: scopes the run's tab-close (GAIA-183).
249
+ runId: Number(r.attr('drupal_internal__id')),
248
250
  worktreePath: r.attr('worktree_path') ?? '',
249
251
  agent: r.attr('agent') ?? '',
250
252
  }));
@@ -168,6 +168,7 @@ export class FakeGaiaRemote {
168
168
  .filter((r) => r.state === 'done' && !r.closed)
169
169
  .map((r) => ({
170
170
  runUuid: r.runUuid,
171
+ runId: r.runId,
171
172
  worktreePath: r.worktreePath ?? '',
172
173
  agent: r.agent ?? '',
173
174
  }));
@@ -62,6 +62,8 @@ export interface ConductorStatus {
62
62
  }
63
63
  export interface FinalizableRun {
64
64
  runUuid: string;
65
+ /** Numeric run id (the `#<runId>` tab-label token); scopes the run's tab-close at finalise (GAIA-183). */
66
+ runId: number;
65
67
  /** Absolute path of the per-run git worktree, or '' when unset. */
66
68
  worktreePath: string;
67
69
  /** Id of the agent that ran (GAIA-144); routes footprint parsing at finalize. '' / undefined when unset. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gaia-ai/core",
3
- "version": "0.5.4",
3
+ "version": "0.5.5",
4
4
  "description": "GAIA global contract: plugin API, built-in remotes/workspaces/auth, shared primitives.",
5
5
  "type": "module",
6
6
  "license": "MIT",