@git-stunts/git-warp 11.2.1 → 11.3.3
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/bin/cli/commands/check.js +2 -2
- package/bin/cli/commands/doctor/checks.js +12 -12
- package/bin/cli/commands/doctor/index.js +2 -2
- package/bin/cli/commands/doctor/types.js +1 -1
- package/bin/cli/commands/history.js +12 -5
- package/bin/cli/commands/install-hooks.js +5 -5
- package/bin/cli/commands/materialize.js +2 -2
- package/bin/cli/commands/patch.js +142 -0
- package/bin/cli/commands/path.js +4 -4
- package/bin/cli/commands/query.js +54 -13
- package/bin/cli/commands/registry.js +4 -0
- package/bin/cli/commands/seek.js +17 -11
- package/bin/cli/commands/tree.js +230 -0
- package/bin/cli/commands/trust.js +3 -3
- package/bin/cli/commands/verify-audit.js +8 -7
- package/bin/cli/commands/view.js +6 -5
- package/bin/cli/infrastructure.js +26 -12
- package/bin/cli/shared.js +2 -2
- package/bin/cli/types.js +19 -8
- package/bin/presenters/index.js +35 -9
- package/bin/presenters/json.js +14 -12
- package/bin/presenters/text.js +155 -33
- package/index.d.ts +82 -22
- package/package.json +3 -2
- package/src/domain/WarpGraph.js +4 -1
- package/src/domain/crdt/ORSet.js +8 -8
- package/src/domain/errors/EmptyMessageError.js +2 -2
- package/src/domain/errors/ForkError.js +1 -1
- package/src/domain/errors/IndexError.js +1 -1
- package/src/domain/errors/OperationAbortedError.js +1 -1
- package/src/domain/errors/QueryError.js +1 -1
- package/src/domain/errors/SchemaUnsupportedError.js +1 -1
- package/src/domain/errors/ShardCorruptionError.js +2 -2
- package/src/domain/errors/ShardLoadError.js +2 -2
- package/src/domain/errors/ShardValidationError.js +4 -4
- package/src/domain/errors/StorageError.js +2 -2
- package/src/domain/errors/SyncError.js +1 -1
- package/src/domain/errors/TraversalError.js +1 -1
- package/src/domain/errors/TrustError.js +1 -1
- package/src/domain/errors/WarpError.js +2 -2
- package/src/domain/errors/WormholeError.js +1 -1
- package/src/domain/services/AuditReceiptService.js +6 -6
- package/src/domain/services/AuditVerifierService.js +52 -38
- package/src/domain/services/BitmapIndexBuilder.js +3 -3
- package/src/domain/services/BitmapIndexReader.js +28 -19
- package/src/domain/services/BoundaryTransitionRecord.js +18 -17
- package/src/domain/services/CheckpointSerializerV5.js +17 -16
- package/src/domain/services/CheckpointService.js +2 -2
- package/src/domain/services/CommitDagTraversalService.js +13 -13
- package/src/domain/services/DagPathFinding.js +7 -7
- package/src/domain/services/DagTopology.js +1 -1
- package/src/domain/services/DagTraversal.js +1 -1
- package/src/domain/services/HealthCheckService.js +1 -1
- package/src/domain/services/HookInstaller.js +1 -1
- package/src/domain/services/HttpSyncServer.js +92 -41
- package/src/domain/services/IndexRebuildService.js +7 -7
- package/src/domain/services/IndexStalenessChecker.js +4 -3
- package/src/domain/services/JoinReducer.js +11 -11
- package/src/domain/services/LogicalTraversal.js +1 -1
- package/src/domain/services/MessageCodecInternal.js +1 -1
- package/src/domain/services/MigrationService.js +1 -1
- package/src/domain/services/ObserverView.js +8 -8
- package/src/domain/services/PatchBuilderV2.js +42 -26
- package/src/domain/services/ProvenanceIndex.js +1 -1
- package/src/domain/services/ProvenancePayload.js +1 -1
- package/src/domain/services/QueryBuilder.js +3 -3
- package/src/domain/services/StateDiff.js +14 -11
- package/src/domain/services/StateSerializerV5.js +2 -2
- package/src/domain/services/StreamingBitmapIndexBuilder.js +26 -24
- package/src/domain/services/SyncAuthService.js +3 -2
- package/src/domain/services/SyncProtocol.js +25 -11
- package/src/domain/services/TemporalQuery.js +9 -6
- package/src/domain/services/TranslationCost.js +7 -5
- package/src/domain/services/WormholeService.js +16 -7
- package/src/domain/trust/TrustCanonical.js +3 -3
- package/src/domain/trust/TrustEvaluator.js +18 -3
- package/src/domain/trust/TrustRecordService.js +30 -23
- package/src/domain/trust/TrustStateBuilder.js +21 -8
- package/src/domain/trust/canonical.js +6 -6
- package/src/domain/types/TickReceipt.js +1 -1
- package/src/domain/types/WarpErrors.js +45 -0
- package/src/domain/types/WarpOptions.js +29 -0
- package/src/domain/types/WarpPersistence.js +41 -0
- package/src/domain/types/WarpTypes.js +2 -2
- package/src/domain/types/WarpTypesV2.js +2 -2
- package/src/domain/utils/MinHeap.js +6 -5
- package/src/domain/utils/canonicalStringify.js +5 -4
- package/src/domain/utils/roaring.js +31 -5
- package/src/domain/warp/PatchSession.js +9 -18
- package/src/domain/warp/_wiredMethods.d.ts +199 -45
- package/src/domain/warp/checkpoint.methods.js +5 -1
- package/src/domain/warp/fork.methods.js +2 -2
- package/src/domain/warp/materialize.methods.js +55 -5
- package/src/domain/warp/materializeAdvanced.methods.js +15 -4
- package/src/domain/warp/patch.methods.js +54 -29
- package/src/domain/warp/provenance.methods.js +5 -3
- package/src/domain/warp/query.methods.js +6 -5
- package/src/domain/warp/sync.methods.js +16 -11
- package/src/globals.d.ts +64 -0
- package/src/infrastructure/adapters/BunHttpAdapter.js +14 -9
- package/src/infrastructure/adapters/CasSeekCacheAdapter.js +9 -4
- package/src/infrastructure/adapters/DenoHttpAdapter.js +5 -6
- package/src/infrastructure/adapters/GitGraphAdapter.js +14 -12
- package/src/infrastructure/adapters/NodeHttpAdapter.js +2 -2
- package/src/infrastructure/adapters/WebCryptoAdapter.js +2 -2
- package/src/visualization/layouts/converters.js +2 -2
- package/src/visualization/layouts/elkAdapter.js +1 -1
- package/src/visualization/layouts/elkLayout.js +10 -7
- package/src/visualization/layouts/index.js +1 -1
- package/src/visualization/renderers/ascii/seek.js +16 -6
- package/src/visualization/renderers/svg/index.js +1 -1
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* @typedef {{ id: string, label: string, props?: Record<string,
|
|
10
|
+
* @typedef {{ id: string, label: string, props?: Record<string, unknown> }} GraphDataNode
|
|
11
11
|
* @typedef {{ from: string, to: string, label?: string }} GraphDataEdge
|
|
12
12
|
* @typedef {{ nodes: GraphDataNode[], edges: GraphDataEdge[] }} GraphData
|
|
13
13
|
*/
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* Converts a query result payload + edge array into graph data.
|
|
17
17
|
* Edges are filtered to only those connecting matched nodes.
|
|
18
18
|
*
|
|
19
|
-
* @param {{ nodes?: Array<{ id: string, props?: Record<string,
|
|
19
|
+
* @param {{ nodes?: Array<{ id: string, props?: Record<string, unknown> }> } | null} payload - Query result
|
|
20
20
|
* @param {Array<{ from: string, to: string, label?: string }>} edges - Edge array from graph.getEdges()
|
|
21
21
|
* @returns {GraphData}
|
|
22
22
|
*/
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* @typedef {{ id: string, label: string, props?: Record<string,
|
|
6
|
+
* @typedef {{ id: string, label: string, props?: Record<string, unknown> }} GraphDataNode
|
|
7
7
|
* @typedef {{ from: string, to: string, label?: string }} GraphDataEdge
|
|
8
8
|
* @typedef {{ nodes: GraphDataNode[], edges: GraphDataEdge[] }} GraphData
|
|
9
9
|
* @typedef {{ text: string }} ElkLabel
|
|
@@ -7,20 +7,23 @@
|
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* @typedef {{ id: string, x?: number, y?: number, width?: number, height?: number, labels?: Array<{ text: string }> }} ElkResultChild
|
|
10
|
-
* @typedef {{ id: string, sources?: string[], targets?: string[], labels?: Array<{ text: string }>, sections?:
|
|
10
|
+
* @typedef {{ id: string, sources?: string[], targets?: string[], labels?: Array<{ text: string }>, sections?: unknown[] }} ElkResultEdge
|
|
11
11
|
* @typedef {{ children?: ElkResultChild[], edges?: ElkResultEdge[], width?: number, height?: number }} ElkResult
|
|
12
|
-
* @typedef {{ id: string, x: number, y: number, width: number, height: number, label
|
|
13
|
-
* @typedef {{
|
|
12
|
+
* @typedef {{ id: string, x: number, y: number, width: number, height: number, label?: string }} PosNode
|
|
13
|
+
* @typedef {{ x: number, y: number }} LayoutPoint
|
|
14
|
+
* @typedef {{ startPoint?: LayoutPoint, endPoint?: LayoutPoint, bendPoints?: LayoutPoint[] }} LayoutSection
|
|
15
|
+
* @typedef {{ id: string, source: string, target: string, label?: string, sections?: LayoutSection[] }} PosEdge
|
|
14
16
|
* @typedef {{ nodes: PosNode[], edges: PosEdge[], width: number, height: number }} PositionedGraph
|
|
15
17
|
* @typedef {{ id: string, children?: Array<{ id: string, width?: number, height?: number, labels?: Array<{ text: string }> }>, edges?: Array<{ id: string, sources?: string[], targets?: string[], labels?: Array<{ text: string }> }>, layoutOptions?: Record<string, string> }} ElkGraphInput
|
|
18
|
+
* @typedef {{ layout: (graph: ElkGraphInput) => Promise<ElkResult> }} ElkEngine
|
|
16
19
|
*/
|
|
17
20
|
|
|
18
|
-
/** @type {Promise<
|
|
21
|
+
/** @type {Promise<unknown> | null} */
|
|
19
22
|
let elkPromise = null;
|
|
20
23
|
|
|
21
24
|
/**
|
|
22
25
|
* Returns (or creates) a singleton ELK instance.
|
|
23
|
-
* @returns {Promise<
|
|
26
|
+
* @returns {Promise<unknown>} ELK instance
|
|
24
27
|
*/
|
|
25
28
|
function getElk() {
|
|
26
29
|
if (!elkPromise) {
|
|
@@ -39,7 +42,7 @@ export async function runLayout(elkGraph) {
|
|
|
39
42
|
/** @type {ElkResult | undefined} */
|
|
40
43
|
let result;
|
|
41
44
|
try {
|
|
42
|
-
const elk = await getElk();
|
|
45
|
+
const elk = /** @type {ElkEngine} */ (await getElk());
|
|
43
46
|
result = await elk.layout(elkGraph);
|
|
44
47
|
} catch {
|
|
45
48
|
return fallbackLayout(elkGraph);
|
|
@@ -67,7 +70,7 @@ function toPositionedGraph(result) {
|
|
|
67
70
|
source: e.sources?.[0] ?? '',
|
|
68
71
|
target: e.targets?.[0] ?? '',
|
|
69
72
|
label: e.labels?.[0]?.text,
|
|
70
|
-
sections: e.sections ?? [],
|
|
73
|
+
sections: /** @type {LayoutSection[]} */ (e.sections ?? []),
|
|
71
74
|
}));
|
|
72
75
|
|
|
73
76
|
return {
|
|
@@ -21,7 +21,7 @@ import { runLayout } from './elkLayout.js';
|
|
|
21
21
|
*
|
|
22
22
|
* @param {{ nodes: Array<{ id: string, label: string }>, edges: Array<{ from: string, to: string, label?: string }> }} graphData - Normalised graph data
|
|
23
23
|
* @param {{ type?: 'query'|'path'|'slice', layoutOptions?: Record<string, string> }} [options]
|
|
24
|
-
* @returns {Promise<
|
|
24
|
+
* @returns {Promise<import('./elkLayout.js').PositionedGraph>} PositionedGraph
|
|
25
25
|
*/
|
|
26
26
|
export async function layoutGraph(graphData, options = {}) {
|
|
27
27
|
const elkGraph = toElkGraph(graphData, options);
|
|
@@ -30,7 +30,7 @@ import { formatOpSummary } from './opSummary.js';
|
|
|
30
30
|
* @property {number} patchCount
|
|
31
31
|
* @property {Map<string, WriterInfo> | Record<string, WriterInfo>} perWriter
|
|
32
32
|
* @property {{ nodes?: number, edges?: number }} [diff]
|
|
33
|
-
* @property {Record<string,
|
|
33
|
+
* @property {Record<string, unknown>} [tickReceipt]
|
|
34
34
|
* @property {import('../../../domain/services/StateDiff.js').StateDiffResult | null} [structuralDiff]
|
|
35
35
|
* @property {string} [diffBaseline]
|
|
36
36
|
* @property {number | null} [baselineTick]
|
|
@@ -73,7 +73,7 @@ function pluralize(n, singular, plural) {
|
|
|
73
73
|
return n === 1 ? singular : plural;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
/** @param {Record<string,
|
|
76
|
+
/** @param {Record<string, unknown> | undefined} tickReceipt @returns {string[]} */
|
|
77
77
|
function buildReceiptLines(tickReceipt) {
|
|
78
78
|
if (!tickReceipt || typeof tickReceipt !== 'object') {
|
|
79
79
|
return [];
|
|
@@ -85,8 +85,12 @@ function buildReceiptLines(tickReceipt) {
|
|
|
85
85
|
|
|
86
86
|
const lines = [];
|
|
87
87
|
for (const [writerId, entry] of entries) {
|
|
88
|
-
|
|
89
|
-
const
|
|
88
|
+
/** @type {Record<string, unknown>} */
|
|
89
|
+
const rec = /** @type {Record<string, unknown>} */ (entry);
|
|
90
|
+
const sha = typeof rec.sha === 'string' ? rec.sha : null;
|
|
91
|
+
const opSummary = rec.opSummary && typeof rec.opSummary === 'object'
|
|
92
|
+
? /** @type {Record<string, number>} */ (rec.opSummary)
|
|
93
|
+
: /** @type {Record<string, number>} */ (rec);
|
|
90
94
|
const name = padRight(formatWriterName(writerId, NAME_W), NAME_W);
|
|
91
95
|
const shaStr = sha ? ` ${formatSha(sha)}` : '';
|
|
92
96
|
lines.push(` ${name}${shaStr} ${formatOpSummary(opSummary, 40)}`);
|
|
@@ -443,14 +447,20 @@ function collectDiffEntries(diff) {
|
|
|
443
447
|
|
|
444
448
|
/**
|
|
445
449
|
* Formats a property value for display (truncated if too long).
|
|
446
|
-
* @param {
|
|
450
|
+
* @param {unknown} value
|
|
447
451
|
* @returns {string}
|
|
448
452
|
*/
|
|
449
453
|
function formatPropValue(value) {
|
|
450
454
|
if (value === undefined) {
|
|
451
455
|
return 'undefined';
|
|
452
456
|
}
|
|
453
|
-
|
|
457
|
+
if (typeof value === 'string') {
|
|
458
|
+
const s = `"${value}"`;
|
|
459
|
+
return s.length > 40 ? `${s.slice(0, 37)}...` : s;
|
|
460
|
+
}
|
|
461
|
+
const s = typeof value === 'number' || typeof value === 'boolean'
|
|
462
|
+
? String(value)
|
|
463
|
+
: JSON.stringify(value) ?? '';
|
|
454
464
|
return s.length > 40 ? `${s.slice(0, 37)}...` : s;
|
|
455
465
|
}
|
|
456
466
|
|
|
@@ -119,7 +119,7 @@ function renderEdge(edge) {
|
|
|
119
119
|
/**
|
|
120
120
|
* Renders a PositionedGraph as an SVG string.
|
|
121
121
|
*
|
|
122
|
-
* @param {{ nodes?: Array<{ id: string, x: number, y: number, width: number, height: number, label?: string }>, edges?: Array<{ sections?: Array<
|
|
122
|
+
* @param {{ nodes?: Array<{ id: string, x: number, y: number, width: number, height: number, label?: string }>, edges?: Array<{ sections?: Array<{ startPoint?: { x: number, y: number }, endPoint?: { x: number, y: number }, bendPoints?: Array<{ x: number, y: number }> }>, label?: string }>, width?: number, height?: number }} positionedGraph - PositionedGraph from runLayout()
|
|
123
123
|
* @param {{ title?: string }} [options]
|
|
124
124
|
* @returns {string} Complete SVG markup
|
|
125
125
|
*/
|