@spexcode/spec-core 0.6.2 → 0.6.4
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/dist/anchors.d.ts +94 -0
- package/dist/anchors.js +730 -0
- package/dist/git.d.ts +166 -0
- package/dist/git.js +2736 -0
- package/dist/graph-delta.d.ts +44 -0
- package/dist/graph-delta.js +72 -0
- package/dist/graph.d.ts +34 -0
- package/dist/graph.js +237 -0
- package/dist/graphDelta.d.ts +3 -0
- package/dist/graphDelta.js +13 -0
- package/dist/harness-identity.d.ts +31 -0
- package/dist/harness-identity.js +20 -0
- package/dist/identity-presets.d.ts +152 -0
- package/dist/identity-presets.js +132 -0
- package/dist/index.d.ts +45 -0
- package/dist/index.js +19 -0
- package/dist/layout.d.ts +183 -0
- package/dist/layout.js +548 -0
- package/dist/process-identity.d.ts +37 -0
- package/dist/process-identity.js +214 -0
- package/dist/project-identity.d.ts +12 -0
- package/dist/project-identity.js +71 -0
- package/dist/project-store.d.ts +3 -0
- package/dist/project-store.js +14 -0
- package/dist/resilience.d.ts +2 -0
- package/dist/resilience.js +40 -0
- package/dist/review/index.d.ts +3 -0
- package/{src → dist}/review/index.js +3 -3
- package/dist/review/reviewFilters.d.ts +77 -0
- package/dist/review/reviewFilters.js +308 -0
- package/dist/review/reviewQuery.d.ts +66 -0
- package/dist/review/reviewQuery.js +180 -0
- package/dist/review/session.d.ts +4 -0
- package/dist/review/session.js +8 -0
- package/dist/reviewSnapshot.d.ts +15 -0
- package/dist/reviewSnapshot.js +12 -0
- package/dist/root-lru.d.ts +4 -0
- package/{src/root-lru.ts → dist/root-lru.js} +26 -30
- package/dist/specs.d.ts +117 -0
- package/dist/specs.js +489 -0
- package/package.json +23 -8
- package/src/anchors.ts +0 -728
- package/src/git.ts +0 -2556
- package/src/graph.ts +0 -251
- package/src/harness-identity.ts +0 -26
- package/src/identity-presets.d.ts +0 -13
- package/src/identity-presets.js +0 -138
- package/src/index.ts +0 -20
- package/src/layout.ts +0 -637
- package/src/process-identity.ts +0 -207
- package/src/project-identity.ts +0 -73
- package/src/project-store.ts +0 -17
- package/src/resilience.ts +0 -41
- package/src/review/reviewFilters.js +0 -324
- package/src/review/reviewQuery.js +0 -174
- package/src/review/session.js +0 -13
- package/src/reviewSnapshot.ts +0 -28
- package/src/specs.ts +0 -498
package/dist/git.d.ts
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
export declare const BOARD_GIT_CONCURRENCY = 4;
|
|
2
|
+
export declare function gitBinary(env?: NodeJS.ProcessEnv): string;
|
|
3
|
+
export declare function gitAbortError(): Error;
|
|
4
|
+
export declare function withGitAbortSignal<T>(signal: AbortSignal, run: () => Promise<T>): Promise<T>;
|
|
5
|
+
export declare function currentGitBuildAbortSignal(): AbortSignal | undefined;
|
|
6
|
+
export declare function git(args: string[]): string;
|
|
7
|
+
export type GitObjectFormat = 'sha1' | 'sha256';
|
|
8
|
+
export declare function gitObjectFormat(root: string): GitObjectFormat;
|
|
9
|
+
export declare function isGitObjectId(root: string, value: string): boolean;
|
|
10
|
+
export declare function batchRevisionOids(root: string, revisions: string[], options?: {
|
|
11
|
+
replaceObjects?: boolean;
|
|
12
|
+
}): Promise<(string | null)[]>;
|
|
13
|
+
export declare function batchBlobTexts(root: string, oids: string[]): Promise<Map<string, string>>;
|
|
14
|
+
export declare function treeTextFiles(root: string, tip: string, pathspec?: string): Map<string, string>;
|
|
15
|
+
export declare function treeFilePaths(root: string, tip: string): Set<string>;
|
|
16
|
+
export declare function treeFileText(root: string, tip: string, path: string): string | null;
|
|
17
|
+
export declare function gitA(args: string[], input?: string): Promise<string>;
|
|
18
|
+
export type ImmutableHunkRanges = {
|
|
19
|
+
after: DiffLineRange[];
|
|
20
|
+
before: DiffLineRange[][];
|
|
21
|
+
};
|
|
22
|
+
type EventLedgerDiagnostics = {
|
|
23
|
+
reads: number;
|
|
24
|
+
locks: number;
|
|
25
|
+
replaces: number;
|
|
26
|
+
};
|
|
27
|
+
export declare function gitObjectInterpretation(root: string): {
|
|
28
|
+
identity: string;
|
|
29
|
+
objectFormat: GitObjectFormat;
|
|
30
|
+
replacements: ReadonlyMap<string, string>;
|
|
31
|
+
};
|
|
32
|
+
export declare function gitInterpretationIdentity(root: string): string;
|
|
33
|
+
export declare function withEventLedgerBuild<T>(root: string, run: () => Promise<T>): Promise<T>;
|
|
34
|
+
export declare function withEventLedgerDemand<T>(root: string, run: () => Promise<T>): Promise<T>;
|
|
35
|
+
export declare function eventLedgerDiagnosticsForTests(): EventLedgerDiagnostics;
|
|
36
|
+
export declare function resetEventLedgerDiagnosticsForTests(): void;
|
|
37
|
+
export declare function readImmutableHunkFacts(root: string, keys: Iterable<string>): Map<string, ImmutableHunkRanges>;
|
|
38
|
+
export declare function persistImmutableHunkFacts(root: string, facts: ReadonlyMap<string, ImmutableHunkRanges>): Promise<void>;
|
|
39
|
+
export type GitTryFailure = 'exit' | 'spawn' | 'timeout';
|
|
40
|
+
export declare function gitTry(args: string[], options?: {
|
|
41
|
+
indexFile?: string;
|
|
42
|
+
extraEnv?: Record<string, string | undefined>;
|
|
43
|
+
input?: string;
|
|
44
|
+
}): Promise<{
|
|
45
|
+
ok: boolean;
|
|
46
|
+
stdout: string;
|
|
47
|
+
stderr: string;
|
|
48
|
+
failure?: GitTryFailure;
|
|
49
|
+
}>;
|
|
50
|
+
export declare function gitRequiredA(args: string[], purpose: string, options?: {
|
|
51
|
+
input?: string;
|
|
52
|
+
extraEnv?: Record<string, string | undefined>;
|
|
53
|
+
}): Promise<string>;
|
|
54
|
+
export declare function repoRoot(): string;
|
|
55
|
+
export declare function headSha(root: string): string;
|
|
56
|
+
export declare function worktreeSpecSig(wtPath: string): string;
|
|
57
|
+
export type Version = {
|
|
58
|
+
hash: string;
|
|
59
|
+
date: string;
|
|
60
|
+
reason: string;
|
|
61
|
+
session: string | null;
|
|
62
|
+
};
|
|
63
|
+
export type DiffStat = {
|
|
64
|
+
additions: number;
|
|
65
|
+
deletions: number;
|
|
66
|
+
files: number;
|
|
67
|
+
};
|
|
68
|
+
export type HistoryIndex = {
|
|
69
|
+
versions: Map<string, Version[]>;
|
|
70
|
+
contentVersions: Set<string>;
|
|
71
|
+
versionPaths: Map<string, string>;
|
|
72
|
+
mergeVersions?: Set<string>;
|
|
73
|
+
};
|
|
74
|
+
export declare function historyIndex(root: string, tip?: string): Promise<HistoryIndex>;
|
|
75
|
+
export declare function rowsFor(idx: HistoryIndex, relPath: string): Version[];
|
|
76
|
+
export declare function pathsStats(root: string, paths: string[]): Promise<Map<string, DiffStat>>;
|
|
77
|
+
export declare function historyStats(root: string, idx: HistoryIndex, relPath: string): Promise<Map<string, DiffStat>>;
|
|
78
|
+
export declare function fileDiffAt(root: string, relPath: string, hash: string): Promise<string>;
|
|
79
|
+
export type DriftIndex = {
|
|
80
|
+
tip?: string;
|
|
81
|
+
ord: Map<string, number>;
|
|
82
|
+
parents: Map<string, string[]>;
|
|
83
|
+
fileEvents: Map<string, DriftPathEvent[]>;
|
|
84
|
+
lineageEvents: Map<string, DriftPathEvent[]>;
|
|
85
|
+
lineageKeys: (path: string, revision: string) => string[];
|
|
86
|
+
resolutionEvents?: Map<string, DriftPathEvent[]>;
|
|
87
|
+
acks: Map<string, Set<string>>;
|
|
88
|
+
selfAcks?: Map<string, Set<string>>;
|
|
89
|
+
specNodes: Map<string, Set<string>>;
|
|
90
|
+
anc: Map<string, Uint8Array>;
|
|
91
|
+
};
|
|
92
|
+
export type DriftPathEvent = {
|
|
93
|
+
commit: string;
|
|
94
|
+
historicalPath: string;
|
|
95
|
+
parents: {
|
|
96
|
+
commit: string;
|
|
97
|
+
historicalPath: string;
|
|
98
|
+
}[];
|
|
99
|
+
};
|
|
100
|
+
export type Reachability = {
|
|
101
|
+
ord: Map<string, number>;
|
|
102
|
+
parents: Map<string, string[]>;
|
|
103
|
+
anc: Map<string, Uint8Array>;
|
|
104
|
+
};
|
|
105
|
+
export type DiffLineRange = [number, number];
|
|
106
|
+
export type CombinedDiffOwnedChanges = {
|
|
107
|
+
after: DiffLineRange[];
|
|
108
|
+
before: DiffLineRange[][];
|
|
109
|
+
parentPaths: string[];
|
|
110
|
+
};
|
|
111
|
+
export declare function combinedDiffOwnedChanges(patch: string): Map<string, CombinedDiffOwnedChanges>;
|
|
112
|
+
export declare function driftIndex(root: string, tip?: string): Promise<DriftIndex>;
|
|
113
|
+
export declare function sourceIndexesFull(root: string, tip?: string): Promise<[HistoryIndex, DriftIndex]>;
|
|
114
|
+
export declare function sourceIndexes(root: string, tip?: string): Promise<[HistoryIndex, DriftIndex]>;
|
|
115
|
+
export declare function historyCacheStats(): {
|
|
116
|
+
historyHeads: number;
|
|
117
|
+
driftHeads: number;
|
|
118
|
+
historyRoots: number;
|
|
119
|
+
driftRoots: number;
|
|
120
|
+
};
|
|
121
|
+
export declare function resetHistoryCachesForTests(): void;
|
|
122
|
+
export declare function historyEventCachePathForTests(root: string): string;
|
|
123
|
+
export declare function ancestorsOf(idx: Reachability, sha: string): Uint8Array | undefined;
|
|
124
|
+
export declare function primeAncestorClosures(idx: Reachability, shas: Iterable<string>): void;
|
|
125
|
+
export declare function inAncestors(idx: Reachability, bits: Uint8Array, sha: string): boolean;
|
|
126
|
+
export declare function unionTopology(root: string, revisions: readonly string[]): Promise<Reachability>;
|
|
127
|
+
export declare function commitReachable(idx: DriftIndex, sha: string): boolean;
|
|
128
|
+
export declare function ackCoverFor(idx: DriftIndex, sinceHash: string, nodeId?: string): Uint8Array[];
|
|
129
|
+
export declare function selfAckCovers(idx: DriftIndex, sinceHash: string, hash: string, nodeId?: string): boolean;
|
|
130
|
+
export declare function pathEvents(idx: DriftIndex, path: string): DriftPathEvent[];
|
|
131
|
+
export declare function pathRangeEvents(idx: DriftIndex, sinceHash: string, path: string, identityRevision?: string): DriftPathEvent[] | null;
|
|
132
|
+
export declare function eventsSince(idx: DriftIndex, sinceHash: string, path: string): DriftPathEvent[] | null;
|
|
133
|
+
export declare function driftPathWindow(idx: DriftIndex, sinceHash: string, path: string, nodeId?: string): DriftPathEvent[] | null;
|
|
134
|
+
export declare function driftFor(idx: DriftIndex, sinceHash: string, path: string, nodeId?: string): number;
|
|
135
|
+
export declare function stagedFiles(root: string): string[];
|
|
136
|
+
export type NodeOp = {
|
|
137
|
+
nodeId: string;
|
|
138
|
+
op: 'added' | 'edited' | 'deleted' | 'moved';
|
|
139
|
+
path: string;
|
|
140
|
+
fromPath?: string;
|
|
141
|
+
toPath?: string;
|
|
142
|
+
committed: boolean;
|
|
143
|
+
dirty: boolean;
|
|
144
|
+
};
|
|
145
|
+
export type ReviewDiffFile = {
|
|
146
|
+
path: string;
|
|
147
|
+
oldPath?: string;
|
|
148
|
+
status: string;
|
|
149
|
+
additions: number;
|
|
150
|
+
deletions: number;
|
|
151
|
+
};
|
|
152
|
+
export declare function mergeBaseDiff(wtPath: string, mainRef?: string, headRef?: string): Promise<ReviewDiffFile[]>;
|
|
153
|
+
export declare function mergeConflicts(wtPath: string, mainRef?: string, headRef?: string): Promise<boolean>;
|
|
154
|
+
type WorktreeSpecDemand = {
|
|
155
|
+
path: string;
|
|
156
|
+
head: string;
|
|
157
|
+
};
|
|
158
|
+
export type WorktreeSpecDeltaOutcome = {
|
|
159
|
+
base: string;
|
|
160
|
+
ops: NodeOp[];
|
|
161
|
+
} | {
|
|
162
|
+
error: unknown;
|
|
163
|
+
};
|
|
164
|
+
export declare function worktreeSpecDeltas(root: string, mainSha: string, demands: WorktreeSpecDemand[], interpretation?: string): Promise<Map<string, WorktreeSpecDeltaOutcome>>;
|
|
165
|
+
export declare function worktreeSpecDelta(wtPath: string, mainRef: string, baseHint?: string): Promise<NodeOp[]>;
|
|
166
|
+
export {};
|