@reqlan/analytical 0.4.0

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 (97) hide show
  1. package/out/analysis/analyser-registry.d.ts +21 -0
  2. package/out/analysis/analyser-registry.js +33 -0
  3. package/out/analysis/analyser-registry.js.map +1 -0
  4. package/out/analysis/completion-tracking-analyser.d.ts +3 -0
  5. package/out/analysis/completion-tracking-analyser.js +37 -0
  6. package/out/analysis/completion-tracking-analyser.js.map +1 -0
  7. package/out/analysis/deprecation-impact-analyser.d.ts +3 -0
  8. package/out/analysis/deprecation-impact-analyser.js +21 -0
  9. package/out/analysis/deprecation-impact-analyser.js.map +1 -0
  10. package/out/analysis/file-related-analyser.d.ts +5 -0
  11. package/out/analysis/file-related-analyser.js +41 -0
  12. package/out/analysis/file-related-analyser.js.map +1 -0
  13. package/out/analysis/git-dates-analyser.d.ts +9 -0
  14. package/out/analysis/git-dates-analyser.js +39 -0
  15. package/out/analysis/git-dates-analyser.js.map +1 -0
  16. package/out/analysis/list-ideas-analyser.d.ts +3 -0
  17. package/out/analysis/list-ideas-analyser.js +7 -0
  18. package/out/analysis/list-ideas-analyser.js.map +1 -0
  19. package/out/analysis/local-graph-analyser.d.ts +6 -0
  20. package/out/analysis/local-graph-analyser.js +42 -0
  21. package/out/analysis/local-graph-analyser.js.map +1 -0
  22. package/out/analysis/semantic-search-analyser.d.ts +8 -0
  23. package/out/analysis/semantic-search-analyser.js +51 -0
  24. package/out/analysis/semantic-search-analyser.js.map +1 -0
  25. package/out/analysis-api.d.ts +31 -0
  26. package/out/analysis-api.js +136 -0
  27. package/out/analysis-api.js.map +1 -0
  28. package/out/core/analytical-store.d.ts +78 -0
  29. package/out/core/analytical-store.js +141 -0
  30. package/out/core/analytical-store.js.map +1 -0
  31. package/out/core/context-model.d.ts +187 -0
  32. package/out/core/context-model.js +36 -0
  33. package/out/core/context-model.js.map +1 -0
  34. package/out/core/context-signals.d.ts +149 -0
  35. package/out/core/context-signals.js +397 -0
  36. package/out/core/context-signals.js.map +1 -0
  37. package/out/core/file-path-match.d.ts +7 -0
  38. package/out/core/file-path-match.js +39 -0
  39. package/out/core/file-path-match.js.map +1 -0
  40. package/out/core/file-reference-resolve.d.ts +8 -0
  41. package/out/core/file-reference-resolve.js +28 -0
  42. package/out/core/file-reference-resolve.js.map +1 -0
  43. package/out/core/idea-references.d.ts +13 -0
  44. package/out/core/idea-references.js +25 -0
  45. package/out/core/idea-references.js.map +1 -0
  46. package/out/core/index-error.d.ts +23 -0
  47. package/out/core/index-error.js +33 -0
  48. package/out/core/index-error.js.map +1 -0
  49. package/out/core/types.d.ts +172 -0
  50. package/out/core/types.js +48 -0
  51. package/out/core/types.js.map +1 -0
  52. package/out/core/workspace-paths.d.ts +4 -0
  53. package/out/core/workspace-paths.js +92 -0
  54. package/out/core/workspace-paths.js.map +1 -0
  55. package/out/create-runtime.d.ts +21 -0
  56. package/out/create-runtime.js +39 -0
  57. package/out/create-runtime.js.map +1 -0
  58. package/out/export/build-export-snapshot.d.ts +3 -0
  59. package/out/export/build-export-snapshot.js +573 -0
  60. package/out/export/build-export-snapshot.js.map +1 -0
  61. package/out/export/html-export-assets.d.ts +3 -0
  62. package/out/export/html-export-assets.js +1066 -0
  63. package/out/export/html-export-assets.js.map +1 -0
  64. package/out/export/html-export-template.d.ts +17 -0
  65. package/out/export/html-export-template.js +930 -0
  66. package/out/export/html-export-template.js.map +1 -0
  67. package/out/export/html-export-utils.d.ts +45 -0
  68. package/out/export/html-export-utils.js +262 -0
  69. package/out/export/html-export-utils.js.map +1 -0
  70. package/out/export/types.d.ts +187 -0
  71. package/out/export/types.js +2 -0
  72. package/out/export/types.js.map +1 -0
  73. package/out/export/write-html-export.d.ts +2 -0
  74. package/out/export/write-html-export.js +143 -0
  75. package/out/export/write-html-export.js.map +1 -0
  76. package/out/headless-index-service.d.ts +23 -0
  77. package/out/headless-index-service.js +171 -0
  78. package/out/headless-index-service.js.map +1 -0
  79. package/out/index-store/idea-extractor.d.ts +6 -0
  80. package/out/index-store/idea-extractor.js +271 -0
  81. package/out/index-store/idea-extractor.js.map +1 -0
  82. package/out/index-store/schema.d.ts +10 -0
  83. package/out/index-store/schema.js +54 -0
  84. package/out/index-store/schema.js.map +1 -0
  85. package/out/index-store/sqlite-store.d.ts +66 -0
  86. package/out/index-store/sqlite-store.js +964 -0
  87. package/out/index-store/sqlite-store.js.map +1 -0
  88. package/out/index-store/webview-graph-queries.d.ts +62 -0
  89. package/out/index-store/webview-graph-queries.js +256 -0
  90. package/out/index-store/webview-graph-queries.js.map +1 -0
  91. package/out/index-store/webview-table-queries.d.ts +57 -0
  92. package/out/index-store/webview-table-queries.js +199 -0
  93. package/out/index-store/webview-table-queries.js.map +1 -0
  94. package/out/index.d.ts +40 -0
  95. package/out/index.js +27 -0
  96. package/out/index.js.map +1 -0
  97. package/package.json +52 -0
@@ -0,0 +1,172 @@
1
+ /**
2
+ * Shared domain types for the idea graph index and analysers.
3
+ */
4
+ export type IdeaKind = 'block' | 'oneliner' | 'ideaset';
5
+ export type EdgeKind = 'references' | 'file_reference' | 'ideaset_member' | 'import' | 'comment_link';
6
+ export interface IdeaRecord {
7
+ id: string;
8
+ name: string;
9
+ kind: IdeaKind;
10
+ fileUri: string;
11
+ lineStart: number;
12
+ lineEnd: number;
13
+ summary: string;
14
+ attributesJson: string;
15
+ contentHash: string;
16
+ gitCreatedAt?: string;
17
+ gitModifiedAt?: string;
18
+ }
19
+ export interface EdgeRecord {
20
+ id: string;
21
+ sourceId: string;
22
+ targetId?: string;
23
+ targetFile?: string;
24
+ kind: EdgeKind;
25
+ label?: string;
26
+ sourceLine?: number;
27
+ snippet?: string;
28
+ isResolved?: boolean;
29
+ }
30
+ export interface IdeaAttributeMap {
31
+ [name: string]: string | string[] | boolean;
32
+ }
33
+ export interface IndexedDocument {
34
+ fileUri: string;
35
+ contentHash: string;
36
+ ideas: IdeaRecord[];
37
+ edges: EdgeRecord[];
38
+ }
39
+ export interface IdeaSummary {
40
+ id: string;
41
+ name: string;
42
+ kind: IdeaKind;
43
+ fileUri: string;
44
+ lineStart: number;
45
+ summary: string;
46
+ status?: string;
47
+ tags: string[];
48
+ gitCreatedAt?: string;
49
+ gitModifiedAt?: string;
50
+ }
51
+ export interface IdeaWithRange extends IdeaSummary {
52
+ lineEnd: number;
53
+ }
54
+ export interface ReferenceListRow {
55
+ edgeId: string;
56
+ direction: 'inbound' | 'outbound';
57
+ kind: EdgeKind;
58
+ label: string;
59
+ targetName: string;
60
+ targetPath: string;
61
+ targetLine?: number;
62
+ sourceLine?: number;
63
+ snippet?: string;
64
+ isResolved: boolean;
65
+ sourceIdeaId: string;
66
+ targetIdeaId?: string;
67
+ }
68
+ export interface AncestorChainResult {
69
+ ideaId: string;
70
+ ancestors: IdeaSummary[];
71
+ statusRollup: Record<string, number>;
72
+ blocking: IdeaSummary[];
73
+ }
74
+ export interface OutlineNode {
75
+ id: string;
76
+ name: string;
77
+ lineStart: number;
78
+ lineEnd: number;
79
+ children: OutlineNode[];
80
+ }
81
+ export type { ActivityBarScope, CurrentFileSlice, ReqlanContextModel } from './context-model.js';
82
+ export { CONTEXT_DIMENSION_LABELS, CONTEXT_DIMENSION_WEIGHTS, DEFAULT_ENABLED_DIMENSIONS } from './context-model.js';
83
+ export type { ContextAnomaly, ContextDimensionContribution, ContextDimensionId, ContextFileEntry, ContextFocus, ContextFocusKind, ContextFootprint, ContextIdeaEntry, ContextProvenance, ContextReferencesSlice, GitAuthorRollup, GitContextSlice, GitFocusCommit, GitFocusStats, GitPeerChangeRate, WorkspaceContextSlice } from './context-model.js';
84
+ export declare const ACTIVITY_BAR_MAX_NODES = 40;
85
+ export declare const BLOCKING_STATUSES: Set<string>;
86
+ export interface GraphSlice {
87
+ centerId: string;
88
+ depth: number;
89
+ nodes: IdeaSummary[];
90
+ edges: EdgeRecord[];
91
+ }
92
+ export interface CompletionSummary {
93
+ total: number;
94
+ byStatus: Record<string, number>;
95
+ byTag: Record<string, number>;
96
+ outstanding: IdeaSummary[];
97
+ deprecated: IdeaSummary[];
98
+ }
99
+ export interface DeprecationImpact {
100
+ deprecated: IdeaSummary;
101
+ dependents: IdeaSummary[];
102
+ }
103
+ export interface SemanticMatch {
104
+ idea: IdeaSummary;
105
+ score: number;
106
+ reasons: string[];
107
+ }
108
+ export interface IdeaReferenceChip {
109
+ label: string;
110
+ fileUri: string;
111
+ line: number;
112
+ direction: 'inbound' | 'outbound';
113
+ filterKey: string;
114
+ }
115
+ export interface IdeaTableRow {
116
+ id: string;
117
+ title: string;
118
+ path: string;
119
+ mainAttribute?: string;
120
+ otherAttributes: string;
121
+ otherAttributeItems: string[];
122
+ attributeValues: Record<string, string>;
123
+ referenceCount: number;
124
+ outboundCount: number;
125
+ inboundCount: number;
126
+ outboundReferences: IdeaReferenceChip[];
127
+ inboundReferences: IdeaReferenceChip[];
128
+ fileUri: string;
129
+ lineStart: number;
130
+ stabilityCue?: number;
131
+ stabilityLabel?: string;
132
+ }
133
+ export type IdeasetKind = 'file' | 'explicit';
134
+ export interface IdeasetMemberRow {
135
+ name: string;
136
+ fileUri: string;
137
+ lineStart: number;
138
+ }
139
+ export interface IdeasetTableRow {
140
+ id: string;
141
+ name: string;
142
+ path: string;
143
+ kind: IdeasetKind;
144
+ memberCount: number;
145
+ members: IdeasetMemberRow[];
146
+ fileUri: string;
147
+ lineStart: number;
148
+ }
149
+ export type ReferenceViewType = 'file' | 'comment' | 'sub-idea';
150
+ export interface ReferenceTableRow {
151
+ sourcePath: string;
152
+ sourceName: string;
153
+ targetPath: string;
154
+ targetName: string;
155
+ isInRq: boolean;
156
+ referenceType: ReferenceViewType;
157
+ sourceFileUri: string;
158
+ sourceLineStart: number;
159
+ }
160
+ export interface FileRelatedRequirements {
161
+ fileUri: string;
162
+ ideasInFile: IdeaSummary[];
163
+ referencingIdeas: IdeaSummary[];
164
+ commentLinkedIdeas: IdeaSummary[];
165
+ folderReferencingIdeas: IdeaSummary[];
166
+ }
167
+ export declare function ideaId(fileUri: string, name: string): string;
168
+ export declare function edgeId(sourceId: string, kind: EdgeKind, target: string): string;
169
+ export declare function parseAttributes(json: string): IdeaAttributeMap;
170
+ export declare function ideaTags(attributes: IdeaAttributeMap): string[];
171
+ export declare function ideaStatus(attributes: IdeaAttributeMap): string | undefined;
172
+ export declare function isDeprecated(attributes: IdeaAttributeMap): boolean;
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Shared domain types for the idea graph index and analysers.
3
+ */
4
+ export { CONTEXT_DIMENSION_LABELS, CONTEXT_DIMENSION_WEIGHTS, DEFAULT_ENABLED_DIMENSIONS } from './context-model.js';
5
+ export const ACTIVITY_BAR_MAX_NODES = 40;
6
+ export const BLOCKING_STATUSES = new Set([
7
+ 'pending',
8
+ 'todo',
9
+ 'open',
10
+ 'blocked',
11
+ 'stub',
12
+ 'unspecified'
13
+ ]);
14
+ export function ideaId(fileUri, name) {
15
+ return `${fileUri}#${name}`;
16
+ }
17
+ export function edgeId(sourceId, kind, target) {
18
+ return `${sourceId}->${kind}:${target}`;
19
+ }
20
+ export function parseAttributes(json) {
21
+ try {
22
+ return JSON.parse(json);
23
+ }
24
+ catch {
25
+ return {};
26
+ }
27
+ }
28
+ export function ideaTags(attributes) {
29
+ const tags = attributes.tags;
30
+ if (Array.isArray(tags)) {
31
+ return tags.map(String);
32
+ }
33
+ if (typeof tags === 'string') {
34
+ return tags.split(/[,\s]+/).filter(Boolean);
35
+ }
36
+ return [];
37
+ }
38
+ export function ideaStatus(attributes) {
39
+ const status = attributes.status;
40
+ return typeof status === 'string' ? status : undefined;
41
+ }
42
+ export function isDeprecated(attributes) {
43
+ if (attributes.deprecated === true) {
44
+ return true;
45
+ }
46
+ return ideaTags(attributes).some(tag => tag.toLowerCase() === 'deprecated');
47
+ }
48
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAgGH,OA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M,CAAC,CAAC,CAAC,SAAS,CAAC;AAC3D,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,UAA4B;IACrD,IAAI,UAAU,CAAC,UAAU,KAAK,IAAI,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,OAAO,QAAQ,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,YAAY,CAAC,CAAC;AAChF,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { type IndexedDocument } from './types.js';
2
+ export declare function toWorkspaceRelativePath(fileUri: string, workspaceRoot: string): string;
3
+ export declare function resolveWorkspaceFileUri(relativeOrAbsolute: string, workspaceRoot?: string): string;
4
+ export declare function normalizeIndexedDocument(document: IndexedDocument, workspaceRoot: string): IndexedDocument;
@@ -0,0 +1,92 @@
1
+ /**
2
+ * Normalize file paths and idea ids relative to the workspace root.
3
+ */
4
+ import { URI } from 'langium';
5
+ import { isAbsolute, relative, resolve } from 'node:path';
6
+ import { edgeId, ideaId } from './types.js';
7
+ function normalizeSlashes(filePath) {
8
+ return filePath.replace(/\\/g, '/');
9
+ }
10
+ function relativeWindowsDrivePath(filePath, workspaceRoot) {
11
+ const normalizedFile = normalizeSlashes(filePath);
12
+ const normalizedRoot = normalizeSlashes(workspaceRoot).replace(/\/+$/, '');
13
+ const fileMatch = normalizedFile.match(/^([A-Za-z]:)(\/.*)?$/);
14
+ const rootMatch = normalizedRoot.match(/^([A-Za-z]:)(\/.*)?$/);
15
+ if (!fileMatch || !rootMatch || fileMatch[1].toLowerCase() !== rootMatch[1].toLowerCase()) {
16
+ return undefined;
17
+ }
18
+ const fileRest = (fileMatch[2] ?? '').replace(/^\/+/, '');
19
+ const rootRest = (rootMatch[2] ?? '').replace(/^\/+/, '');
20
+ if (fileRest === rootRest) {
21
+ return '';
22
+ }
23
+ const rootPrefix = rootRest ? `${rootRest}/` : '';
24
+ if (!rootRest || fileRest.startsWith(rootPrefix)) {
25
+ return rootRest ? fileRest.slice(rootPrefix.length) : fileRest;
26
+ }
27
+ return undefined;
28
+ }
29
+ export function toWorkspaceRelativePath(fileUri, workspaceRoot) {
30
+ if (!workspaceRoot) {
31
+ return normalizeSlashes(fileUri);
32
+ }
33
+ const filePath = fileUri.startsWith('file://') ? URI.parse(fileUri).fsPath : fileUri;
34
+ const driveRelative = relativeWindowsDrivePath(filePath, workspaceRoot);
35
+ if (driveRelative !== undefined) {
36
+ return driveRelative;
37
+ }
38
+ if (!isAbsolute(filePath)) {
39
+ return normalizeSlashes(filePath);
40
+ }
41
+ const rel = relative(workspaceRoot, filePath);
42
+ if (rel.startsWith('..')) {
43
+ return normalizeSlashes(fileUri);
44
+ }
45
+ return normalizeSlashes(rel);
46
+ }
47
+ export function resolveWorkspaceFileUri(relativeOrAbsolute, workspaceRoot) {
48
+ if (relativeOrAbsolute.startsWith('file://')) {
49
+ return relativeOrAbsolute;
50
+ }
51
+ if (workspaceRoot) {
52
+ const absolute = resolve(workspaceRoot, relativeOrAbsolute);
53
+ return URI.file(absolute).toString();
54
+ }
55
+ if (relativeOrAbsolute.startsWith('/')) {
56
+ return URI.file(relativeOrAbsolute).toString();
57
+ }
58
+ return relativeOrAbsolute;
59
+ }
60
+ function relativeIdeaId(sourceId, workspaceRoot) {
61
+ const separator = sourceId.lastIndexOf('#');
62
+ if (separator < 0) {
63
+ return sourceId;
64
+ }
65
+ const fileUri = toWorkspaceRelativePath(sourceId.slice(0, separator), workspaceRoot);
66
+ const name = sourceId.slice(separator + 1);
67
+ return ideaId(fileUri, name);
68
+ }
69
+ export function normalizeIndexedDocument(document, workspaceRoot) {
70
+ const fileUri = toWorkspaceRelativePath(document.fileUri, workspaceRoot);
71
+ const ideas = document.ideas.map(idea => {
72
+ const relativeUri = toWorkspaceRelativePath(idea.fileUri, workspaceRoot);
73
+ return {
74
+ ...idea,
75
+ fileUri: relativeUri,
76
+ id: ideaId(relativeUri, idea.name)
77
+ };
78
+ });
79
+ const edges = document.edges.map(edge => {
80
+ const sourceId = relativeIdeaId(edge.sourceId, workspaceRoot);
81
+ const targetId = edge.targetId ? relativeIdeaId(edge.targetId, workspaceRoot) : undefined;
82
+ const targetKey = targetId ?? edge.targetFile ?? edge.label ?? '?';
83
+ return {
84
+ ...edge,
85
+ sourceId,
86
+ targetId,
87
+ id: edgeId(sourceId, edge.kind, targetKey)
88
+ };
89
+ });
90
+ return { fileUri, contentHash: document.contentHash, ideas, edges };
91
+ }
92
+ //# sourceMappingURL=workspace-paths.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-paths.js","sourceRoot":"","sources":["../../src/core/workspace-paths.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,EAAwB,MAAM,YAAY,CAAC;AAElE,SAAS,gBAAgB,CAAC,QAAgB;IACtC,OAAO,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AACxC,CAAC;AAED,SAAS,wBAAwB,CAAC,QAAgB,EAAE,aAAqB;IACrE,MAAM,cAAc,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAClD,MAAM,cAAc,GAAG,gBAAgB,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAE3E,MAAM,SAAS,GAAG,cAAc,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;IAC/D,MAAM,SAAS,GAAG,cAAc,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;IAC/D,IAAI,CAAC,SAAS,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,EAAE,CA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analyser-registry.js';
3
+ import { HeadlessIndexService } from './headless-index-service.js';
4
+ export interface AnalysisRuntimeOptions {
5
+ workspaceRoot: string;
6
+ storagePath?: string;
7
+ }
8
+ export interface AnalysisRuntime {
9
+ store: AnalyticalStore;
10
+ index: HeadlessIndexService;
11
+ analysers: AnalyserRegistry;
12
+ workspaceRoot: string;
13
+ makeContext: () => {
14
+ store: HeadlessIndexService['indexStore'];
15
+ analytical: AnalyticalStore;
16
+ workspaceRoot: string;
17
+ };
18
+ }
19
+ export declare function createAnalysisRuntime(options: AnalysisRuntimeOptions): AnalysisRuntime;
20
+ export declare function activateAnalysisRuntime(runtime: AnalysisRuntime): Promise<void>;
21
+ export declare function deactivateAnalysisRuntime(runtime: AnalysisRuntime): Promise<void>;
@@ -0,0 +1,39 @@
1
+ import { join } from 'node:path';
2
+ import { tmpdir } from 'node:os';
3
+ import { createAnalyticalStore } from './core/analytical-store.js';
4
+ import { AnalyserRegistry } from './analysis/analyser-registry.js';
5
+ import { listAllIdeasAnalyser } from './analysis/list-ideas-analyser.js';
6
+ import { fileRelatedAnalyser } from './analysis/file-related-analyser.js';
7
+ import { deprecationImpactAnalyser } from './analysis/deprecation-impact-analyser.js';
8
+ import { gitDatesAnalyser } from './analysis/git-dates-analyser.js';
9
+ import { completionTrackingAnalyser } from './analysis/completion-tracking-analyser.js';
10
+ import { localGraphAnalyser } from './analysis/local-graph-analyser.js';
11
+ import { semanticSearchAnalyser } from './analysis/semantic-search-analyser.js';
12
+ import { HeadlessIndexService } from './headless-index-service.js';
13
+ export function createAnalysisRuntime(options) {
14
+ const store = createAnalyticalStore();
15
+ const storagePath = options.storagePath ?? join(tmpdir(), 'reqlan-analytical');
16
+ const index = new HeadlessIndexService(store, storagePath, options.workspaceRoot);
17
+ const analysers = new AnalyserRegistry();
18
+ analysers.register(listAllIdeasAnalyser);
19
+ analysers.register(fileRelatedAnalyser);
20
+ analysers.register(deprecationImpactAnalyser);
21
+ analysers.register(gitDatesAnalyser);
22
+ analysers.register(completionTrackingAnalyser);
23
+ analysers.register(localGraphAnalyser);
24
+ analysers.register(semanticSearchAnalyser);
25
+ const makeContext = () => ({
26
+ store: index.indexStore,
27
+ analytical: store,
28
+ workspaceRoot: options.workspaceRoot
29
+ });
30
+ return { store, index, analysers, workspaceRoot: options.workspaceRoot, makeContext };
31
+ }
32
+ export async function activateAnalysisRuntime(runtime) {
33
+ await runtime.index.activate();
34
+ }
35
+ export async function deactivateAnalysisRuntime(runtime) {
36
+ await runtime.index.deactivate();
37
+ runtime.store.getState().reset();
38
+ }
39
+ //# sourceMappingURL=create-runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-runtime.js","sourceRoot":"","sources":["../src/create-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,qBAAqB,EAAwB,MAAM,4BAA4B,CAAC;AACzF,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AACtF,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,0BAA0B,EAAE,MAAM,4CAA4C,CAAC;AACxF,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAmBnE,MAAM,UAAU,qBAAqB,CAAC,OAA+B;IACjE,MAAM,KAAK,GAAG,qBAAqB,EAAE,CAAC;IACtC,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,IAAI,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napshot } from './types.js';
3
+ export declare function buildExportSnapshot(store: SqliteIndexStore, request: ExportRequest): Promise<ExportSnapshot>;