@lmzhen/dsh-evolution-merge 0.34.0 → 0.36.0

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
@@ -5041,14 +5041,17 @@ function toHistoryView(items, readAt) {
5041
5041
  return {
5042
5042
  wireVersion: 1,
5043
5043
  readAt,
5044
- items: items.map((item) => ({
5045
- name: item.name,
5046
- kind: item.kind,
5047
- reason: item.reason,
5048
- lastVersion: item.lastVersion,
5049
- archivedAt: Date.parse(item.archivedAt),
5050
- ...item.sourceRunId === void 0 ? {} : { sourceRunId: item.sourceRunId }
5051
- }))
5044
+ items: items.map((item) => {
5045
+ const parsed = item.archivedAt === null ? null : typeof item.archivedAt === "number" ? item.archivedAt : Date.parse(item.archivedAt);
5046
+ return {
5047
+ name: item.name,
5048
+ kind: item.kind,
5049
+ reason: item.reason,
5050
+ lastVersion: item.lastVersion,
5051
+ archivedAt: parsed === null || Number.isFinite(parsed) ? parsed : null,
5052
+ ...item.sourceRunId === void 0 ? {} : { sourceRunId: item.sourceRunId }
5053
+ };
5054
+ })
5052
5055
  };
5053
5056
  }
5054
5057
  //#endregion
@@ -10840,18 +10843,20 @@ function apply(ctx, rawConfig = {}) {
10840
10843
  });
10841
10844
  const archived = await skills.archivedNames?.() ?? [];
10842
10845
  const reasonOf = skills.readArchiveReason;
10846
+ const archivedAtOf = skills.readArchivedAt;
10843
10847
  for (const name of archived) {
10844
10848
  if (items.has(name)) continue;
10845
10849
  const rawReason = reasonOf === void 0 ? null : await reasonOf.call(skills, name).catch(() => null);
10846
10850
  const lower = (rawReason ?? "").toLowerCase();
10847
10851
  const kind = lower.includes("split") ? "split" : lower.includes("delet") || lower.includes("remove") ? "deleted" : "other";
10852
+ const archivedAt = archivedAtOf === void 0 ? null : await archivedAtOf.call(skills, name).catch(() => null);
10848
10853
  items.set(name, {
10849
10854
  name,
10850
10855
  kind,
10851
10856
  reason: rawReason ?? "技能已归档,最后一版保留可查。",
10852
10857
  reasonCode: kind === "other" ? "archived" : kind,
10853
10858
  lastVersion: 1,
10854
- archivedAt: Date.now()
10859
+ archivedAt
10855
10860
  });
10856
10861
  }
10857
10862
  const out = [];
@@ -47,7 +47,7 @@ export interface HistoryItem {
47
47
  readonly reason: string;
48
48
  readonly reasonCode?: string;
49
49
  readonly lastVersion: number;
50
- readonly archivedAt: number;
50
+ readonly archivedAt: number | null;
51
51
  readonly sourceRunId?: string;
52
52
  readonly runId?: string;
53
53
  readonly absorbedInto?: string;
@@ -303,13 +303,15 @@ export function apply(ctx, rawConfig = {}) {
303
303
  items.set(name, { name, kind: 'merged', reason: '已合并进「' + receipt.target + '」,最后一版保留可查。', reasonCode: 'merged', lastVersion: 1, archivedAt: receipt.at, sourceRunId: receipt.runId, runId: receipt.runId, absorbedInto: receipt.target, generation: generationOf.get(receipt.runId) ?? 1 });
304
304
  const archived = await skills.archivedNames?.() ?? [];
305
305
  const reasonOf = skills.readArchiveReason;
306
+ const archivedAtOf = skills.readArchivedAt;
306
307
  for (const name of archived) {
307
308
  if (items.has(name))
308
309
  continue;
309
310
  const rawReason = reasonOf === undefined ? null : await reasonOf.call(skills, name).catch(() => null);
310
311
  const lower = (rawReason ?? '').toLowerCase();
311
312
  const kind = lower.includes('split') ? 'split' : lower.includes('delet') || lower.includes('remove') ? 'deleted' : 'other';
312
- items.set(name, { name, kind, reason: rawReason ?? '技能已归档,最后一版保留可查。', reasonCode: kind === 'other' ? 'archived' : kind, lastVersion: 1, archivedAt: Date.now() });
313
+ const archivedAt = archivedAtOf === undefined ? null : await archivedAtOf.call(skills, name).catch(() => null);
314
+ items.set(name, { name, kind, reason: rawReason ?? '技能已归档,最后一版保留可查。', reasonCode: kind === 'other' ? 'archived' : kind, lastVersion: 1, archivedAt });
313
315
  }
314
316
  const out = [];
315
317
  for (const item of items.values()) {
@@ -30,7 +30,7 @@ export interface MergeHistoryItem {
30
30
  readonly kind: 'merged' | 'deleted' | 'split' | 'other';
31
31
  readonly reason: string;
32
32
  readonly lastVersion: number;
33
- readonly archivedAt: string;
33
+ readonly archivedAt: string | null;
34
34
  readonly sourceRunId?: string;
35
35
  }
36
36
  export interface MergeRouteSource {
@@ -30,7 +30,7 @@ export declare function toHistoryView(items: readonly {
30
30
  kind: 'merged' | 'deleted' | 'split' | 'other';
31
31
  reason: string;
32
32
  lastVersion: number;
33
- archivedAt: string;
33
+ archivedAt: string | number | null;
34
34
  sourceRunId?: string;
35
35
  }[], readAt: number): HistoryView;
36
36
  //# sourceMappingURL=wire-projection.d.ts.map
@@ -69,6 +69,9 @@ export function toBodyView(name, side, text, readAt) {
69
69
  return { wireVersion: 1, readAt, name, side, text, markdown: true, truncated: false, totalBytes: Buffer.byteLength(text, 'utf8') };
70
70
  }
71
71
  export function toHistoryView(items, readAt) {
72
- return { wireVersion: 1, readAt, items: items.map(item => ({ name: item.name, kind: item.kind, reason: item.reason, lastVersion: item.lastVersion, archivedAt: Date.parse(item.archivedAt), ...(item.sourceRunId === undefined ? {} : { sourceRunId: item.sourceRunId }) })) };
72
+ return { wireVersion: 1, readAt, items: items.map(item => {
73
+ const parsed = item.archivedAt === null ? null : typeof item.archivedAt === 'number' ? item.archivedAt : Date.parse(item.archivedAt);
74
+ return { name: item.name, kind: item.kind, reason: item.reason, lastVersion: item.lastVersion, archivedAt: parsed === null || Number.isFinite(parsed) ? parsed : null, ...(item.sourceRunId === undefined ? {} : { sourceRunId: item.sourceRunId }) };
75
+ }) };
73
76
  }
74
77
  //# sourceMappingURL=wire-projection.js.map
@@ -184,7 +184,7 @@ export interface HistoryItem {
184
184
  readonly reasonCode?: string;
185
185
  readonly generation?: number;
186
186
  readonly lastVersion: number;
187
- readonly archivedAt: number;
187
+ readonly archivedAt: number | null;
188
188
  readonly sourceRunId?: string;
189
189
  readonly runId?: string;
190
190
  readonly absorbedInto?: string;
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.34.0",
4
+ "version": "0.36.0",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -32,9 +32,9 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@deepseek-ai/schemastery": "^3.18.5",
35
- "@lmzhen/dsh-evolution-core": "^0.34.0",
36
- "@lmzhen/dsh-evolution-commands": "^0.34.0",
37
- "@lmzhen/dsh-evolution-merge-engine": "0.34.0"
35
+ "@lmzhen/dsh-evolution-core": "^0.36.0",
36
+ "@lmzhen/dsh-evolution-commands": "^0.36.0",
37
+ "@lmzhen/dsh-evolution-merge-engine": "0.36.0"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "@deepseek-ai/cordis": "^4.0.5"