@suco/su-auggie-mcp 0.1.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.
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Per-workspace manager: DirectContext + chokidar + ignore + FileIndexer
3
+ *
4
+ * All indexing is delegated to FileIndexer for centralized file-level error handling.
5
+ */
6
+ import type { WorkspaceStatus } from './types.js';
7
+ /** Workspace manager for a single workspace root */
8
+ export declare class Workspace {
9
+ readonly root: string;
10
+ private context;
11
+ private watcher;
12
+ private ignoreFilter;
13
+ private status;
14
+ private error;
15
+ private lastIndexed;
16
+ private progress;
17
+ private changeQueue;
18
+ private debounceTimer;
19
+ private initialScanComplete;
20
+ private fileIndexer;
21
+ private indexingStartTime;
22
+ private initialIndexSeconds;
23
+ private lastDeltaSeconds;
24
+ private driftDeletedFiles;
25
+ private driftModifiedFiles;
26
+ private driftReconciled;
27
+ private driftReconcileTimeMs;
28
+ private restoredFromPersistence;
29
+ private fileMetadata;
30
+ private restoredMetadata;
31
+ private constructor();
32
+ /** Create and initialize a workspace */
33
+ static create(root: string): Promise<Workspace>;
34
+ /** Initialize the workspace: restore state, start watcher, initial index */
35
+ private initialize;
36
+ /**
37
+ * Re-initialize workspace after auth becomes available.
38
+ * Called when credentials are detected after initial startup failure.
39
+ */
40
+ reinitialize(): Promise<void>;
41
+ /** Get path to state file */
42
+ private getStatePath;
43
+ /** Get path to metadata file */
44
+ private getMetadataPath;
45
+ /** Ensure state directory exists */
46
+ private ensureStateDir;
47
+ /** Save state to disk (if persistence enabled) */
48
+ private saveState;
49
+ /** Save file metadata to disk (if persistence enabled) */
50
+ private saveMetadata;
51
+ /** Load file metadata from disk (returns null if not found or invalid) */
52
+ private loadMetadata;
53
+ /** Start file watcher */
54
+ private startWatcher;
55
+ /** Queue a file change for debounced processing */
56
+ private queueChange;
57
+ /** Schedule a debounced flush of the change queue */
58
+ private scheduleFlush;
59
+ /** Flush the change queue and process changes using FileIndexer */
60
+ private flushChangeQueue;
61
+ /**
62
+ * Reconcile drift between persisted index and current filesystem state.
63
+ * Detects files deleted or modified while MCP was offline.
64
+ * Only runs when persistence is enabled and we restored from persisted state.
65
+ * @returns Set of paths that are still valid and unchanged (not deleted or modified)
66
+ */
67
+ private reconcileDrift;
68
+ /** Perform initial indexing using FileIndexer */
69
+ private performInitialIndex;
70
+ /**
71
+ * Generator that discovers files for indexing.
72
+ * Yields absolute paths of files that need indexing.
73
+ */
74
+ private discoverFiles;
75
+ /** Get drift reconciliation statistics */
76
+ private getDriftStats;
77
+ /** Handle errors */
78
+ private handleError;
79
+ /** Get workspace status */
80
+ getStatus(): WorkspaceStatus;
81
+ /** Get indexed paths */
82
+ getIndexedPaths(): string[];
83
+ /** Search the codebase */
84
+ search(query: string): Promise<string>;
85
+ /** Search and ask */
86
+ searchAndAsk(query: string, prompt?: string): Promise<string>;
87
+ /**
88
+ * Trigger retry of failed files if conditions are met.
89
+ * This is a "hit and run" call - triggers async retry and returns immediately.
90
+ */
91
+ triggerRetryIfNeeded(): void;
92
+ /** Force reindex */
93
+ reindex(full?: boolean): Promise<void>;
94
+ /** Close the workspace */
95
+ close(): Promise<void>;
96
+ }