@psnext/lscg 0.1.5 → 0.1.6

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.
@@ -40,6 +40,7 @@ export interface GraphEdge {
40
40
  sourceId: string;
41
41
  targetId: string;
42
42
  kind: GraphEdgeKind;
43
+ type?: string;
43
44
  confidence: number;
44
45
  metadata: Record<string, unknown>;
45
46
  }
@@ -84,13 +85,17 @@ export type AttributionOutcome = {
84
85
  status: 'failed';
85
86
  diagnostic: string;
86
87
  };
87
- export type EnrichmentState = 'pending' | 'complete' | 'failed';
88
+ export type EnrichmentState = 'disabled' | 'pending' | 'complete' | 'failed';
89
+ export type EnrichmentOutcomeKind = 'complete' | 'unavailable' | 'failed';
88
90
  /** Durable, hash-bound optional-enrichment work for a scanned file. */
89
91
  export interface FileEnrichmentState {
90
92
  repositoryId: string;
91
93
  fileId: string;
94
+ pluginName: string;
92
95
  sourceHash: string;
93
- state: EnrichmentState;
96
+ historyFingerprint: string | null;
97
+ state: Exclude<EnrichmentState, 'disabled'>;
98
+ outcome: EnrichmentOutcomeKind | null;
94
99
  diagnostic: string | null;
95
100
  queuedAt: string;
96
101
  updatedAt: string;
@@ -116,6 +121,8 @@ export interface EnrichmentSummary {
116
121
  pending: number;
117
122
  complete: number;
118
123
  failed: number;
124
+ unavailable?: number;
125
+ notApplicable?: number;
119
126
  diagnostics: string[];
120
127
  }
121
128
  export interface ScanSummary {
@@ -203,6 +210,7 @@ export interface GraphNodeTextRow extends GraphNodeRow {
203
210
  export interface GraphEdgeRow {
204
211
  id: string;
205
212
  kind: GraphEdgeKind;
213
+ type?: string;
206
214
  sourceId: string;
207
215
  targetId: string;
208
216
  fileId: string | null;
@@ -1,8 +1,11 @@
1
1
  import { drainRepositoryEnrichment, scanRepository } from './graph/repository.js';
2
2
  import type { EnrichmentSummary, ProgressReporter, RepositoryRecord, StorageScope } from './types.js';
3
+ import type { ScannerPlugin } from './scanner/plugins.js';
3
4
  export interface WatchCommandOptions {
4
5
  root?: string | undefined;
5
6
  scope?: StorageScope | 'both' | undefined;
7
+ attribution?: boolean | undefined;
8
+ plugins?: readonly ScannerPlugin[] | undefined;
6
9
  intervalMs?: number | undefined;
7
10
  debounceMs?: number | undefined;
8
11
  }
package/dist/src/watch.js CHANGED
@@ -102,11 +102,14 @@ export async function watchRepository(options = {}, dependencies = {}) {
102
102
  const phase = scans === 0 ? 'initial-scan' : 'rescan';
103
103
  reportWatchProgress(progress, { event: phase, mode, repository, scope, detail: scans === 0 ? 'starting initial scan' : 'starting rescan' });
104
104
  const scanStartFingerprint = polling ? await fingerprintFn(repository.root) : undefined;
105
- const structuralSummary = await scanFn({ root: repository.root, scope, progress });
105
+ const structuralSummary = await scanFn({ root: repository.root, scope, attribution: options.attribution, plugins: options.plugins, progress });
106
106
  // A watch owns in-process enrichment. Awaiting it while `scanning` is
107
107
  // true serializes durable work with structural replacement; a filesystem
108
108
  // event during either phase queues exactly one follow-up structural scan.
109
- const enrichment = await drainEnrichment({ root: repository.root, scope });
109
+ const shouldDrainEnrichment = options.attribution === true || dependencies.drainEnrichment !== undefined;
110
+ const enrichment = shouldDrainEnrichment
111
+ ? await drainEnrichment({ root: repository.root, scope, historyFingerprint: undefined })
112
+ : { state: 'disabled', pending: 0, complete: 0, failed: 0, unavailable: 0, notApplicable: 0, diagnostics: [] };
110
113
  reportWatchProgress(progress, { event: 'enrichment', mode, repository, scope, detail: `state=${enrichment.state} pending=${enrichment.pending} complete=${enrichment.complete} failed=${enrichment.failed}` });
111
114
  const summary = { ...structuralSummary, enrichment };
112
115
  scanning = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@psnext/lscg",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Local source context graphs for repositories, exposed as a CLI and MCP server.",
5
5
  "type": "module",
6
6
  "bin": {