@lmzhen/dsh-evolution-merge 0.30.9 → 0.30.10

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
@@ -1531,7 +1531,7 @@ function mergeUsage() {
1531
1531
  }
1532
1532
  //#endregion
1533
1533
  //#region lib/types/read-commands.js
1534
- async function handleReadOnlyMergeCommand(command, io, home) {
1534
+ async function handleReadOnlyMergeCommand(command, io, home, cards) {
1535
1535
  const withNote = (text, note) => note === void 0 ? text : "note: " + note + "\n" + text;
1536
1536
  if (command.verb === "status") {
1537
1537
  const loaded = await loadMergeState(io, home);
@@ -1544,7 +1544,8 @@ async function handleReadOnlyMergeCommand(command, io, home) {
1544
1544
  if (command.verb === "pending") {
1545
1545
  const loaded = await loadMergeState(io, home);
1546
1546
  const rows = command.expired === true ? loaded.state.rows.filter((row) => row.expired !== void 0) : loaded.state.rows;
1547
- return withNote(command.expired === true ? formatStatus(rows) : formatQueue(rows, "pending"), loaded.note);
1547
+ const live = cards === void 0 ? rows : rows.filter((row) => cards.some((card) => card.name === row.a) && cards.some((card) => card.name === row.b));
1548
+ return withNote(command.expired === true ? formatStatus(live) : formatQueue(live, "pending"), loaded.note);
1548
1549
  }
1549
1550
  if (command.verb === "candidates") {
1550
1551
  const loaded = await loadMergeState(io, home);
@@ -3224,6 +3225,9 @@ async function commitStagedRun(io, home, runId, port, options) {
3224
3225
  };
3225
3226
  try {
3226
3227
  await writeCommitReceipt(io, home, receipt);
3228
+ try {
3229
+ await io.remove(snapshotPath(home, runId));
3230
+ } catch {}
3227
3231
  return {
3228
3232
  ok: true,
3229
3233
  plan: assembled.plan,
@@ -4114,7 +4118,8 @@ function createMergeRuntime(deps) {
4114
4118
  text: "merge approve 完成:merged " + String(result.report.totals.merged)
4115
4119
  };
4116
4120
  }
4117
- const text = await handleReadOnlyMergeCommand(command, deps.io, deps.home);
4121
+ const cards = command.verb === "pending" ? await deps.cards(new AbortController().signal) : void 0;
4122
+ const text = await handleReadOnlyMergeCommand(command, deps.io, deps.home, cards);
4118
4123
  if (text !== null) return {
4119
4124
  ok: true,
4120
4125
  text
@@ -2,7 +2,7 @@ import { assembleStagedCommit } from "./commit-assembly.js";
2
2
  import { writeCommitReceipt } from "./commit-receipt.js";
3
3
  import { pairKey } from "./contracts.js";
4
4
  import { writeJournal } from "./domain/commit-journal-store.js";
5
- import { writeCommitSnapshot } from "./commit-snapshot.js";
5
+ import { snapshotPath, writeCommitSnapshot } from "./commit-snapshot.js";
6
6
  export async function commitStagedRun(io, home, runId, port, options) {
7
7
  const assembled = await assembleStagedCommit(io, home, runId, port, { origin: options.origin, summary: options.summary });
8
8
  if (!assembled.ok)
@@ -46,6 +46,10 @@ export async function commitStagedRun(io, home, runId, port, options) {
46
46
  };
47
47
  try {
48
48
  await writeCommitReceipt(io, home, receipt);
49
+ try {
50
+ await io.remove(snapshotPath(home, runId));
51
+ }
52
+ catch { /* committed journal is the record */ }
49
53
  return { ok: true, plan: assembled.plan, result, receipt };
50
54
  }
51
55
  catch (error) {
@@ -4,6 +4,8 @@
4
4
  */
5
5
  import type { EvolutionIoLike } from '@lmzhen/dsh-evolution-core';
6
6
  import type { MergeCliCommand } from './commands.ts';
7
- export declare function handleReadOnlyMergeCommand(command: MergeCliCommand, io: EvolutionIoLike, home: string): Promise<string | null>;
7
+ export declare function handleReadOnlyMergeCommand(command: MergeCliCommand, io: EvolutionIoLike, home: string, cards?: readonly {
8
+ readonly name: string;
9
+ }[]): Promise<string | null>;
8
10
  export declare function mergeCommandHelp(): string;
9
11
  //# sourceMappingURL=read-commands.d.ts.map
@@ -1,7 +1,7 @@
1
1
  import { loadMergeState } from "./state.js";
2
2
  import { formatQueue, formatStatus } from "./status.js";
3
3
  import { mergeUsage } from "./commands.js";
4
- export async function handleReadOnlyMergeCommand(command, io, home) {
4
+ export async function handleReadOnlyMergeCommand(command, io, home, cards) {
5
5
  const withNote = (text, note) => note === undefined ? text : 'note: ' + note + '\n' + text;
6
6
  if (command.verb === 'status') {
7
7
  const loaded = await loadMergeState(io, home);
@@ -14,7 +14,8 @@ export async function handleReadOnlyMergeCommand(command, io, home) {
14
14
  if (command.verb === 'pending') {
15
15
  const loaded = await loadMergeState(io, home);
16
16
  const rows = command.expired === true ? loaded.state.rows.filter(row => row.expired !== undefined) : loaded.state.rows;
17
- return withNote(command.expired === true ? formatStatus(rows) : formatQueue(rows, 'pending'), loaded.note);
17
+ const live = cards === undefined ? rows : rows.filter(row => cards.some(card => card.name === row.a) && cards.some(card => card.name === row.b));
18
+ return withNote(command.expired === true ? formatStatus(live) : formatQueue(live, 'pending'), loaded.note);
18
19
  }
19
20
  if (command.verb === 'candidates') {
20
21
  const loaded = await loadMergeState(io, home);
@@ -314,7 +314,8 @@ export function createMergeRuntime(deps) {
314
314
  return { ok: false, text: 'merge approve started without a report' };
315
315
  return { ok: true, text: 'merge approve 完成:merged ' + String(result.report.totals.merged) };
316
316
  }
317
- const text = await handleReadOnlyMergeCommand(command, deps.io, deps.home);
317
+ const cards = command.verb === 'pending' ? await deps.cards(new AbortController().signal) : undefined;
318
+ const text = await handleReadOnlyMergeCommand(command, deps.io, deps.home, cards);
318
319
  if (text !== null)
319
320
  return { ok: true, text };
320
321
  return readOnly.execute(command);
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.9",
4
+ "version": "0.30.10",
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.9",
31
- "@lmzhen/dsh-evolution-merge-engine": "^0.30.9"
30
+ "@lmzhen/dsh-evolution-core": "^0.30.10",
31
+ "@lmzhen/dsh-evolution-merge-engine": "^0.30.10"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "@deepseek-ai/cordis": "^4.0.5"