@lmzhen/dsh-evolution-merge 0.30.14 → 0.30.15

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/lib/index.js CHANGED
@@ -2498,13 +2498,18 @@ async function runResumeCommand(options) {
2498
2498
  }])
2499
2499
  };
2500
2500
  } },
2501
- ...options.timeoutMinutes === void 0 ? {} : { timeoutMinutes: options.timeoutMinutes }
2501
+ ...options.timeoutMinutes === void 0 ? {} : { timeoutMinutes: options.timeoutMinutes },
2502
+ ...options.isOwnerActive === void 0 ? {} : { isOwnerActive: options.isOwnerActive }
2502
2503
  });
2503
2504
  }
2504
2505
  if (row.state !== "fuse" && row.state !== "approved") return {
2505
2506
  ok: false,
2506
2507
  message: "row is not resumable from state " + row.state
2507
2508
  };
2509
+ if (row.runId !== void 0 && await options.isOwnerActive?.(row.runId) === true) return {
2510
+ ok: false,
2511
+ message: "merge run still owns this fuse row: " + row.runId
2512
+ };
2508
2513
  const decision = row.decision;
2509
2514
  if (decision === void 0) return {
2510
2515
  ok: false,
@@ -4071,7 +4076,13 @@ function createMergeRuntime(deps) {
4071
4076
  };
4072
4077
  }
4073
4078
  const loaded = await loadMergeState(deps.io, deps.home);
4074
- const row = command.id === void 0 ? loaded.state.rows.find((item) => item.state === "fuse" || item.state === "verify" || command.retry === true && item.state === "approved") : loaded.state.rows.find((item) => item.id === command.id);
4079
+ let row = command.id === void 0 ? void 0 : loaded.state.rows.find((item) => item.id === command.id);
4080
+ if (command.id === void 0) for (const item of loaded.state.rows) {
4081
+ if (item.state !== "fuse" && item.state !== "verify" && !(command.retry === true && item.state === "approved")) continue;
4082
+ if (item.runId !== void 0 && await deps.isOwnerActive?.(item.runId) === true) continue;
4083
+ row = item;
4084
+ break;
4085
+ }
4075
4086
  if (row === void 0) return {
4076
4087
  ok: false,
4077
4088
  text: "merge row not found: " + (command.id ?? "(auto)")
@@ -25,10 +25,14 @@ export async function runResumeCommand(options) {
25
25
  },
26
26
  }),
27
27
  ...(options.timeoutMinutes === undefined ? {} : { timeoutMinutes: options.timeoutMinutes }),
28
+ ...(options.isOwnerActive === undefined ? {} : { isOwnerActive: options.isOwnerActive }),
28
29
  });
29
30
  }
30
31
  if (row.state !== 'fuse' && row.state !== 'approved')
31
32
  return { ok: false, message: 'row is not resumable from state ' + row.state };
33
+ if (row.runId !== undefined && (await options.isOwnerActive?.(row.runId)) === true) {
34
+ return { ok: false, message: 'merge run still owns this fuse row: ' + row.runId };
35
+ }
32
36
  const decision = row.decision;
33
37
  if (decision === undefined)
34
38
  return { ok: false, message: 'fuse row has no decision' };
@@ -232,9 +232,17 @@ export function createMergeRuntime(deps) {
232
232
  return { ok: true, text: '已清除合并行:' + cleared.id };
233
233
  }
234
234
  const loaded = await loadMergeState(deps.io, deps.home);
235
- const row = command.id === undefined
236
- ? loaded.state.rows.find(item => item.state === 'fuse' || item.state === 'verify' || (command.retry === true && item.state === 'approved'))
237
- : loaded.state.rows.find(item => item.id === command.id);
235
+ let row = command.id === undefined ? undefined : loaded.state.rows.find(item => item.id === command.id);
236
+ if (command.id === undefined) {
237
+ for (const item of loaded.state.rows) {
238
+ if (item.state !== 'fuse' && item.state !== 'verify' && !(command.retry === true && item.state === 'approved'))
239
+ continue;
240
+ if (item.runId !== undefined && (await deps.isOwnerActive?.(item.runId)) === true)
241
+ continue;
242
+ row = item;
243
+ break;
244
+ }
245
+ }
238
246
  if (row === undefined)
239
247
  return { ok: false, text: 'merge row not found: ' + (command.id ?? '(auto)') };
240
248
  const signal = new AbortController().signal;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lmzhen/dsh-evolution-merge",
3
3
  "description": "Skill auto-merge domain: screening, two-round authoring, queues and commit orchestration (community build)",
4
- "version": "0.30.14",
4
+ "version": "0.30.15",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -27,8 +27,8 @@
27
27
  "license": "MIT",
28
28
  "dependencies": {
29
29
  "@deepseek-ai/schemastery": "^3.18.5",
30
- "@lmzhen/dsh-evolution-core": "^0.30.14",
31
- "@lmzhen/dsh-evolution-merge-engine": "^0.30.14"
30
+ "@lmzhen/dsh-evolution-core": "^0.30.15",
31
+ "@lmzhen/dsh-evolution-merge-engine": "^0.30.15"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "@deepseek-ai/cordis": "^4.0.5"