@lmzhen/dsh-evolution-merge 0.30.16 → 0.30.18

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.
Files changed (90) hide show
  1. package/README.md +4 -3
  2. package/lib/index.js +2325 -855
  3. package/lib/types/adapters/library.js +4 -1
  4. package/lib/types/adapters/model.d.ts +31 -0
  5. package/lib/types/adapters/model.js +46 -0
  6. package/lib/types/approve-command.d.ts +2 -0
  7. package/lib/types/approve-command.js +41 -46
  8. package/lib/types/authoring-flow.d.ts +3 -1
  9. package/lib/types/authoring-flow.js +15 -5
  10. package/lib/types/command-surface.d.ts +5 -0
  11. package/lib/types/command-surface.js +44 -0
  12. package/lib/types/commit-assembly.d.ts +2 -0
  13. package/lib/types/commit-assembly.js +7 -2
  14. package/lib/types/commit-execute.d.ts +7 -1
  15. package/lib/types/commit-execute.js +40 -10
  16. package/lib/types/commit-recovery.d.ts +7 -2
  17. package/lib/types/commit-recovery.js +73 -96
  18. package/lib/types/contracts.d.ts +1 -1
  19. package/lib/types/contracts.js +1 -1
  20. package/lib/types/coordinator.d.ts +3 -2
  21. package/lib/types/coordinator.js +4 -3
  22. package/lib/types/decision.js +1 -1
  23. package/lib/types/doctor.d.ts +7 -0
  24. package/lib/types/doctor.js +104 -4
  25. package/lib/types/domain/claim.d.ts +4 -1
  26. package/lib/types/domain/claim.js +2 -2
  27. package/lib/types/domain/commit-journal-store.js +5 -1
  28. package/lib/types/domain/commit-journal.js +1 -1
  29. package/lib/types/domain/consistency.d.ts +22 -0
  30. package/lib/types/domain/consistency.js +50 -0
  31. package/lib/types/domain/ledger.js +10 -1
  32. package/lib/types/domain/migrate-v3.d.ts +20 -0
  33. package/lib/types/domain/migrate-v3.js +68 -0
  34. package/lib/types/domain/row-tx.d.ts +27 -0
  35. package/lib/types/domain/row-tx.js +31 -0
  36. package/lib/types/domain/row-v3-bridge.d.ts +6 -0
  37. package/lib/types/domain/row-v3-bridge.js +47 -0
  38. package/lib/types/domain/row-v3.d.ts +113 -0
  39. package/lib/types/domain/row-v3.js +107 -0
  40. package/lib/types/domain/row.d.ts +1 -0
  41. package/lib/types/domain/staging-index.d.ts +14 -0
  42. package/lib/types/domain/staging-index.js +41 -0
  43. package/lib/types/domain/state-v3.d.ts +15 -0
  44. package/lib/types/domain/state-v3.js +80 -0
  45. package/lib/types/facts.d.ts +24 -0
  46. package/lib/types/facts.js +68 -0
  47. package/lib/types/gate-filter.d.ts +31 -0
  48. package/lib/types/gate-filter.js +64 -0
  49. package/lib/types/index.d.ts +5 -2
  50. package/lib/types/index.js +16 -26
  51. package/lib/types/ladder.js +1 -1
  52. package/lib/types/merge-routes.d.ts +2 -2
  53. package/lib/types/merge-routes.js +21 -22
  54. package/lib/types/metrics.d.ts +16 -0
  55. package/lib/types/metrics.js +27 -0
  56. package/lib/types/new-child-authoring.d.ts +3 -1
  57. package/lib/types/new-child-authoring.js +14 -3
  58. package/lib/types/pending-actions.d.ts +2 -2
  59. package/lib/types/pending-actions.js +17 -17
  60. package/lib/types/propose.d.ts +26 -0
  61. package/lib/types/propose.js +69 -0
  62. package/lib/types/read-commands.d.ts +2 -2
  63. package/lib/types/read-commands.js +5 -3
  64. package/lib/types/resume-command.d.ts +2 -0
  65. package/lib/types/resume-command.js +4 -1
  66. package/lib/types/round2-outcome.js +17 -9
  67. package/lib/types/runtime.d.ts +4 -1
  68. package/lib/types/runtime.js +99 -29
  69. package/lib/types/scan-ports.d.ts +3 -1
  70. package/lib/types/scan-ports.js +2 -0
  71. package/lib/types/scan-run.js +116 -51
  72. package/lib/types/screening-port.d.ts +47 -0
  73. package/lib/types/screening-port.js +93 -0
  74. package/lib/types/screening.d.ts +30 -0
  75. package/lib/types/screening.js +75 -0
  76. package/lib/types/state.d.ts +14 -0
  77. package/lib/types/state.js +72 -1
  78. package/lib/types/status.d.ts +3 -0
  79. package/lib/types/status.js +17 -0
  80. package/lib/types/target-claim.d.ts +1 -0
  81. package/lib/types/target-claim.js +63 -18
  82. package/lib/types/unit-claim.d.ts +5 -0
  83. package/lib/types/unit-claim.js +15 -0
  84. package/lib/types/wire-projection.d.ts +36 -0
  85. package/lib/types/wire-projection.js +69 -0
  86. package/lib/types/wire.d.ts +254 -0
  87. package/lib/types/wire.js +3 -0
  88. package/package.json +8 -4
  89. package/lib/types/routes.d.ts +0 -70
  90. package/lib/types/routes.js +0 -78
@@ -1,78 +0,0 @@
1
- import { queueOf, stageOf } from "./contracts.js";
2
- import { countRows } from "./status.js";
3
- export function toRowView(row) {
4
- return {
5
- id: row.id,
6
- pairKey: row.pairKey,
7
- a: row.a,
8
- b: row.b,
9
- state: row.state,
10
- queue: queueOf(row.state),
11
- stage: stageOf(row.state),
12
- label: row.a + ' + ' + row.b,
13
- updatedAt: row.updatedAt,
14
- createdAt: row.createdAt,
15
- ...(row.decision?.target === undefined ? {} : { target: row.decision.target }),
16
- ...(row.decision?.confidence === undefined ? {} : { confidence: row.decision.confidence }),
17
- ...(row.decision?.aSummary === undefined ? {} : { aSummary: row.decision.aSummary }),
18
- ...(row.decision?.bSummary === undefined ? {} : { bSummary: row.decision.bSummary }),
19
- ...(row.decision?.rationale === undefined ? {} : { rationale: row.decision.rationale }),
20
- ...(row.failure === undefined ? {} : {
21
- failure: { stage: row.failure.stage, code: row.failure.code, message: row.failure.message, retryable: row.failure.retryable },
22
- }),
23
- ...(row.attempts === undefined ? {} : { attempts: row.attempts }),
24
- ...(row.origin === undefined ? {} : { origin: row.origin }),
25
- ...(row.stagingExpiresAt === undefined ? {} : { stagingExpiresAt: row.stagingExpiresAt }),
26
- ...(row.expired === undefined ? {} : { expired: row.expired }),
27
- ...(row.reason === undefined ? {} : { reason: row.reason }),
28
- summary: [
29
- row.decision?.aSummary ?? '未提供技能1摘要',
30
- row.decision?.bSummary ?? '未提供技能2摘要',
31
- row.decision?.rationale ?? row.reason ?? '未提供融合原因',
32
- ],
33
- actions: row.state === 'pending'
34
- ? ['/evolution merge approve ' + row.id, '/evolution merge reject ' + row.id]
35
- : row.state === 'skipped'
36
- ? ['/evolution merge skipped --restore ' + row.id]
37
- : ['/evolution merge resume ' + row.id],
38
- };
39
- }
40
- export function buildMergeView(rows, commands, latestRun, approval) {
41
- const counts = countRows(rows);
42
- return {
43
- schemaVersion: 2,
44
- counts,
45
- tabs: [
46
- { queue: 'verify', count: counts.verify },
47
- { queue: 'pending', count: counts.pending },
48
- { queue: 'fuse', count: counts.fuse },
49
- { queue: 'skipped', count: counts.skipped },
50
- ],
51
- commands,
52
- ...(latestRun === undefined ? {} : { latestRun }),
53
- ...(approval === undefined ? {} : { approval }),
54
- };
55
- }
56
- export function pageQueue(rows, queue, cursor = 0, limit = 50) {
57
- const filtered = rows.filter(row => queueOf(row.state) === queue);
58
- const size = Math.max(1, Math.min(200, limit));
59
- const start = Math.max(0, cursor);
60
- const items = filtered.slice(start, start + size).map(toRowView);
61
- const next = start + size < filtered.length ? String(start + size) : undefined;
62
- return { queue, items, ...(next === undefined ? {} : { nextCursor: next }) };
63
- }
64
- export function toRunFact(run) {
65
- return {
66
- id: run.id,
67
- state: run.state,
68
- ...(run.command === undefined ? {} : { command: run.command }),
69
- ...(run.stage === undefined ? {} : { stage: run.stage }),
70
- ...(run.progress === undefined ? {} : { progress: run.progress }),
71
- startedAt: run.startedAt,
72
- ...(run.endedAt === undefined ? {} : { endedAt: run.endedAt }),
73
- ...(run.resultRef === undefined ? {} : { resultRef: run.resultRef }),
74
- ...(run.failure === undefined ? {} : { failure: run.failure }),
75
- ...(run.supersededAt === undefined ? {} : { supersededAt: run.supersededAt }),
76
- };
77
- }
78
- //# sourceMappingURL=routes.js.map