@lmzhen/dsh-evolution-merge 0.30.17 → 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.
- package/README.md +4 -3
- package/lib/index.js +2321 -854
- package/lib/types/adapters/library.js +4 -1
- package/lib/types/adapters/model.d.ts +31 -0
- package/lib/types/adapters/model.js +46 -0
- package/lib/types/approve-command.d.ts +2 -0
- package/lib/types/approve-command.js +41 -46
- package/lib/types/authoring-flow.d.ts +3 -1
- package/lib/types/authoring-flow.js +15 -5
- package/lib/types/command-surface.d.ts +5 -0
- package/lib/types/command-surface.js +44 -0
- package/lib/types/commit-assembly.d.ts +2 -0
- package/lib/types/commit-assembly.js +7 -2
- package/lib/types/commit-execute.d.ts +7 -1
- package/lib/types/commit-execute.js +40 -10
- package/lib/types/commit-recovery.d.ts +7 -2
- package/lib/types/commit-recovery.js +73 -96
- package/lib/types/contracts.d.ts +1 -1
- package/lib/types/contracts.js +1 -1
- package/lib/types/coordinator.d.ts +3 -2
- package/lib/types/coordinator.js +4 -3
- package/lib/types/decision.js +1 -1
- package/lib/types/doctor.d.ts +7 -0
- package/lib/types/doctor.js +104 -4
- package/lib/types/domain/claim.d.ts +4 -1
- package/lib/types/domain/claim.js +2 -2
- package/lib/types/domain/commit-journal-store.js +5 -1
- package/lib/types/domain/commit-journal.js +1 -1
- package/lib/types/domain/consistency.d.ts +22 -0
- package/lib/types/domain/consistency.js +50 -0
- package/lib/types/domain/ledger.js +10 -1
- package/lib/types/domain/migrate-v3.d.ts +20 -0
- package/lib/types/domain/migrate-v3.js +68 -0
- package/lib/types/domain/row-tx.d.ts +27 -0
- package/lib/types/domain/row-tx.js +31 -0
- package/lib/types/domain/row-v3-bridge.d.ts +6 -0
- package/lib/types/domain/row-v3-bridge.js +47 -0
- package/lib/types/domain/row-v3.d.ts +113 -0
- package/lib/types/domain/row-v3.js +107 -0
- package/lib/types/domain/row.d.ts +1 -0
- package/lib/types/domain/staging-index.d.ts +14 -0
- package/lib/types/domain/staging-index.js +41 -0
- package/lib/types/domain/state-v3.d.ts +15 -0
- package/lib/types/domain/state-v3.js +80 -0
- package/lib/types/facts.d.ts +24 -0
- package/lib/types/facts.js +68 -0
- package/lib/types/gate-filter.d.ts +31 -0
- package/lib/types/gate-filter.js +64 -0
- package/lib/types/index.d.ts +5 -2
- package/lib/types/index.js +16 -26
- package/lib/types/ladder.js +1 -1
- package/lib/types/merge-routes.d.ts +2 -2
- package/lib/types/merge-routes.js +21 -22
- package/lib/types/metrics.d.ts +16 -0
- package/lib/types/metrics.js +27 -0
- package/lib/types/new-child-authoring.d.ts +3 -1
- package/lib/types/new-child-authoring.js +14 -3
- package/lib/types/pending-actions.d.ts +2 -2
- package/lib/types/pending-actions.js +17 -17
- package/lib/types/propose.d.ts +26 -0
- package/lib/types/propose.js +69 -0
- package/lib/types/read-commands.d.ts +2 -2
- package/lib/types/read-commands.js +5 -3
- package/lib/types/resume-command.d.ts +2 -0
- package/lib/types/resume-command.js +4 -1
- package/lib/types/round2-outcome.js +17 -9
- package/lib/types/runtime.d.ts +4 -1
- package/lib/types/runtime.js +99 -29
- package/lib/types/scan-ports.d.ts +3 -1
- package/lib/types/scan-ports.js +2 -0
- package/lib/types/scan-run.js +114 -51
- package/lib/types/screening-port.d.ts +47 -0
- package/lib/types/screening-port.js +93 -0
- package/lib/types/screening.d.ts +30 -0
- package/lib/types/screening.js +75 -0
- package/lib/types/state.d.ts +14 -0
- package/lib/types/state.js +70 -1
- package/lib/types/status.d.ts +3 -0
- package/lib/types/status.js +17 -0
- package/lib/types/target-claim.d.ts +1 -0
- package/lib/types/target-claim.js +63 -18
- package/lib/types/unit-claim.d.ts +5 -0
- package/lib/types/unit-claim.js +15 -0
- package/lib/types/wire-projection.d.ts +36 -0
- package/lib/types/wire-projection.js +69 -0
- package/lib/types/wire.d.ts +254 -0
- package/lib/types/wire.js +3 -0
- package/package.json +8 -4
- package/lib/types/routes.d.ts +0 -70
- package/lib/types/routes.js +0 -78
package/lib/types/routes.js
DELETED
|
@@ -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
|