@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
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { type DriftIndex, type DriftPathEvent } from './git.js';
|
|
2
|
+
export type Unit = {
|
|
3
|
+
name: string;
|
|
4
|
+
kind: string;
|
|
5
|
+
start: number;
|
|
6
|
+
end: number;
|
|
7
|
+
typeOnly?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export type Extractor = {
|
|
10
|
+
id: string;
|
|
11
|
+
claims(ext: string): boolean;
|
|
12
|
+
ready(): true | string;
|
|
13
|
+
extract(content: string, filename: string): Unit[];
|
|
14
|
+
memoKey: (filename: string) => string;
|
|
15
|
+
};
|
|
16
|
+
export type CodeEntry = {
|
|
17
|
+
path: string;
|
|
18
|
+
anchor: string | null;
|
|
19
|
+
};
|
|
20
|
+
export declare function parseCodeEntry(raw: string): CodeEntry;
|
|
21
|
+
export type RelationEntry = {
|
|
22
|
+
path: string;
|
|
23
|
+
selectors: string[];
|
|
24
|
+
};
|
|
25
|
+
export type RelationParse = {
|
|
26
|
+
entries: RelationEntry[];
|
|
27
|
+
problems: string[];
|
|
28
|
+
};
|
|
29
|
+
export declare function relationClaimsPath(claim: string, file: string): boolean;
|
|
30
|
+
export declare function parseRelation(raws: string[], relation: 'code' | 'related'): RelationParse;
|
|
31
|
+
export declare function tsAstExtractor(root: string): Extractor;
|
|
32
|
+
export type LangSpec = {
|
|
33
|
+
id: string;
|
|
34
|
+
extensions: string[];
|
|
35
|
+
decls: {
|
|
36
|
+
re: RegExp;
|
|
37
|
+
kind: string;
|
|
38
|
+
typeOnly?: boolean;
|
|
39
|
+
classOpener?: boolean;
|
|
40
|
+
declList?: boolean;
|
|
41
|
+
scopeOpener?: boolean;
|
|
42
|
+
memberOf?: {
|
|
43
|
+
parentKind: string;
|
|
44
|
+
kind: string;
|
|
45
|
+
};
|
|
46
|
+
}[];
|
|
47
|
+
member?: {
|
|
48
|
+
re: RegExp;
|
|
49
|
+
blacklist?: RegExp;
|
|
50
|
+
};
|
|
51
|
+
indentScopes?: {
|
|
52
|
+
decorator?: RegExp;
|
|
53
|
+
};
|
|
54
|
+
boundary: RegExp;
|
|
55
|
+
};
|
|
56
|
+
export declare function heuristicExtractor(spec: LangSpec): Extractor;
|
|
57
|
+
export declare const JS_LANG_R5B: LangSpec;
|
|
58
|
+
export declare const PYTHON_LANG: LangSpec;
|
|
59
|
+
export declare function extractors(root: string): Extractor[];
|
|
60
|
+
export declare function extractorFor(regs: Extractor[], ext: string): Extractor | null;
|
|
61
|
+
export declare const extOf: (path: string) => string;
|
|
62
|
+
export type AnchorResolution = {
|
|
63
|
+
ok: Unit;
|
|
64
|
+
} | {
|
|
65
|
+
dead: true;
|
|
66
|
+
} | {
|
|
67
|
+
ambiguous: number;
|
|
68
|
+
};
|
|
69
|
+
export type SelectorVerdict = {
|
|
70
|
+
selector: string;
|
|
71
|
+
} & ({
|
|
72
|
+
ok: Unit;
|
|
73
|
+
} | {
|
|
74
|
+
dead: true;
|
|
75
|
+
} | {
|
|
76
|
+
ambiguous: number;
|
|
77
|
+
});
|
|
78
|
+
export declare function resolveSelectors(units: Unit[], selectors: readonly string[]): SelectorVerdict[];
|
|
79
|
+
export declare function resolveAnchor(units: Unit[], symbol: string): AnchorResolution;
|
|
80
|
+
export declare function selectorsHitRanges(units: readonly Unit[], symbols: readonly string[], ranges: readonly [number, number][]): string[];
|
|
81
|
+
export declare function diffHunkRanges(patch: string, side?: 'old' | 'new'): [number, number][];
|
|
82
|
+
export declare function windowEvents(idx: DriftIndex, sinceHash: string, path: string, nodeId?: string): DriftPathEvent[];
|
|
83
|
+
export type AnchorHit = {
|
|
84
|
+
commit: string;
|
|
85
|
+
selectors: string[];
|
|
86
|
+
unparseable?: string;
|
|
87
|
+
};
|
|
88
|
+
export type AnchorHitQuery = {
|
|
89
|
+
win: DriftPathEvent[];
|
|
90
|
+
symbols: string[];
|
|
91
|
+
};
|
|
92
|
+
export declare function anchorHitQueries(root: string, queries: AnchorHitQuery[], regs: Extractor[]): Promise<AnchorHit[][]>;
|
|
93
|
+
export declare function anchorHitExists(root: string, queries: AnchorHitQuery[], regs: Extractor[]): Promise<boolean[]>;
|
|
94
|
+
export declare function anchorHitCommits(root: string, win: DriftPathEvent[], symbols: string[], regs: Extractor[]): Promise<AnchorHit[]>;
|