@autorag/librarian 2.13.4 → 2.13.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.
Files changed (91) hide show
  1. package/NOTICE +3 -0
  2. package/README.md +50 -18
  3. package/dist/agent/agent.d.ts +111 -40
  4. package/dist/agent/cloud-release-extension.d.ts +43 -0
  5. package/dist/agent/decision-backends.d.ts +49 -0
  6. package/dist/agent/decision-model-check.d.ts +92 -0
  7. package/dist/agent/dupey-tool.d.ts +2 -0
  8. package/dist/agent/everything-search-tool.d.ts +1 -0
  9. package/dist/agent/fsearch-search-tool.d.ts +1 -0
  10. package/dist/agent/index.d.ts +4 -1
  11. package/dist/agent/jev-extension.d.ts +27 -32
  12. package/dist/agent/jikji-find-tool.d.ts +5 -0
  13. package/dist/agent/name-candidates.d.ts +88 -0
  14. package/dist/agent/permission-gate.d.ts +2 -5
  15. package/dist/agent/query-routing.d.ts +1 -1
  16. package/dist/agent/search-documents.d.ts +1 -1
  17. package/dist/agent/sllm-decision.d.ts +34 -0
  18. package/dist/cli/commands/duplicates.d.ts +3 -2
  19. package/dist/cli/commands/models.d.ts +2 -0
  20. package/dist/cli/commands/search.d.ts +2 -0
  21. package/dist/cli/config.d.ts +49 -30
  22. package/dist/cli/index.js +13522 -10169
  23. package/dist/cli/setup.d.ts +27 -1
  24. package/dist/cloud/jev-backend.d.ts +26 -4
  25. package/dist/core.js +6079 -2840
  26. package/dist/datasource/index.d.ts +2 -2
  27. package/dist/datasource/skills/obsidian/index.d.ts +1 -1
  28. package/dist/datasource/skills/obsidian/methods.d.ts +1 -1
  29. package/dist/datasource/skills/obsidian/skill.d.ts +1 -0
  30. package/dist/datasource/skills/obsidian/vault-index.d.ts +1 -1
  31. package/dist/datasource/skills/wombat/client.d.ts +17 -0
  32. package/dist/datasource/skills/wombat/index.d.ts +4 -0
  33. package/dist/datasource/skills/wombat/methods.d.ts +15 -0
  34. package/dist/datasource/skills/wombat/skill.d.ts +38 -0
  35. package/dist/datasource/skills/wombat/types.d.ts +89 -0
  36. package/dist/dupey/cli.d.ts +21 -1
  37. package/dist/dupey/filter.d.ts +8 -1
  38. package/dist/dupey/index.d.ts +1 -0
  39. package/dist/dupey/scan-plan.d.ts +23 -0
  40. package/dist/embedding/index.d.ts +3 -1
  41. package/dist/everything/client.d.ts +1 -2
  42. package/dist/filesystem/cloud-placeholder.d.ts +313 -21
  43. package/dist/filesystem/shared-exclusive-queue.d.ts +16 -0
  44. package/dist/fsearch/client.d.ts +3 -2
  45. package/dist/index.d.ts +1 -1
  46. package/dist/index.js +6184 -2905
  47. package/dist/jikji/answer-pack.d.ts +7 -1
  48. package/dist/jikji/client.d.ts +28 -14
  49. package/dist/jikji/diagnostics.d.ts +16 -2
  50. package/dist/jikji/index.d.ts +3 -3
  51. package/dist/jikji/installer.d.ts +11 -5
  52. package/dist/jikji/retry-command.d.ts +10 -0
  53. package/dist/jikji/types.d.ts +47 -1
  54. package/dist/jikji/version.d.ts +20 -0
  55. package/dist/mcp/index.js +6154 -2902
  56. package/dist/mcp/server.d.ts +3 -0
  57. package/dist/minsync/binary.d.ts +10 -5
  58. package/dist/minsync/client.d.ts +7 -10
  59. package/dist/minsync/embedder-config.d.ts +11 -10
  60. package/dist/minsync/errors.d.ts +3 -0
  61. package/dist/minsync/index.d.ts +1 -1
  62. package/dist/minsync/installer.d.ts +1 -1
  63. package/dist/minsync/method.d.ts +1 -0
  64. package/dist/minsync/types.d.ts +0 -9
  65. package/dist/minsync/version.d.ts +20 -0
  66. package/dist/mirror/cloud-fingerprints.d.ts +30 -0
  67. package/dist/mirror/cloud.d.ts +79 -0
  68. package/dist/mirror/index.d.ts +4 -0
  69. package/dist/mirror/sync.d.ts +79 -1
  70. package/dist/parser/csv.d.ts +26 -0
  71. package/dist/parser/defaults.d.ts +1 -1
  72. package/dist/parser/index.d.ts +2 -0
  73. package/dist/parser/kordoc.d.ts +6 -3
  74. package/dist/parser/parse-worker.js +668 -28
  75. package/dist/parser/spreadsheet-render.d.ts +53 -0
  76. package/dist/parser/spreadsheet.d.ts +27 -0
  77. package/dist/profiles/loop-guard.d.ts +8 -2
  78. package/dist/profiles/retrieval-tools.d.ts +2 -1
  79. package/dist/profiles.js +13520 -10280
  80. package/dist/retrieval/skip.d.ts +1 -1
  81. package/dist/retrieval/types.d.ts +1 -1
  82. package/package.json +3 -3
  83. package/skills/autorag/SKILL.md +7 -4
  84. package/skills/autorag-doctor/SKILL.md +8 -3
  85. package/skills/autorag-lite-setup/SKILL.md +4 -4
  86. package/skills/autorag-setup/SKILL.md +53 -30
  87. package/dist/datasource/skills/cloud-drive/index.d.ts +0 -2
  88. package/dist/datasource/skills/cloud-drive/rclone-connector.d.ts +0 -49
  89. package/dist/datasource/skills/cloud-drive/skill.d.ts +0 -14
  90. package/dist/minsync/kiwi.d.ts +0 -17
  91. package/dist/minsync/lexical-language.d.ts +0 -18
@@ -1,26 +1,318 @@
1
- /** Darwin st_flags bit used by iCloud/File Provider data-less placeholders. */
2
- export declare const UF_DATALESS = 32768;
1
+ /**
2
+ * Darwin `SF_DATALESS` (st_flags): the file's data lives only in the cloud. `UF_DATALESS` is not a flag;
3
+ * `0x8000` is `UF_HIDDEN`, which dotfiles carry, so it must never be read as a placeholder marker.
4
+ */
5
+ export declare const SF_DATALESS = 1073741824;
3
6
  export declare const FILE_PROVIDER_XATTR = "com.apple.file-provider-domain-id";
4
- /** Windows FILE_ATTRIBUTE_* bits commonly used by Cloud Files placeholders. */
5
- export declare const WINDOWS_FILE_ATTRIBUTE_OFFLINE = 4096;
6
- export declare const WINDOWS_FILE_ATTRIBUTE_RECALL_ON_OPEN = 262144;
7
+ /** Windows FILE_ATTRIBUTE_* bits carried by Cloud Files placeholders and their pin state. */
8
+ export declare const WINDOWS_FILE_ATTRIBUTE_PINNED = 524288;
9
+ export declare const WINDOWS_FILE_ATTRIBUTE_UNPINNED = 1048576;
7
10
  export declare const WINDOWS_FILE_ATTRIBUTE_RECALL_ON_DATA_ACCESS = 4194304;
8
- export type FilesystemKind = "local" | "file-provider";
9
- export interface FilesystemClassification {
10
- readonly kind: FilesystemKind;
11
- readonly provider?: string;
12
- readonly reason: "path-marker" | "file-provider-xattr" | "cloud-volume" | "placeholder-attribute" | "local";
13
- }
14
11
  export declare function pathLooksLikeCloudRoot(target: string): boolean;
15
12
  export declare function homeCloudRoots(home?: string): readonly string[];
16
- export declare function classifyFilesystemRoot(target: string): Promise<FilesystemClassification>;
17
- export declare function isDatalessPlaceholder(target: string): Promise<boolean>;
18
- export interface MaterializedWalk {
19
- readonly materialized: readonly string[];
20
- readonly skippedDataless: number;
21
- }
22
- export declare function listMaterializedFiles(root: string, options?: {
23
- readonly limit?: number;
13
+ /** Whether `st_flags` (the decimal number `stat -f %f` prints) marks a data-less File Provider placeholder. */
14
+ export declare function datalessFromDarwinFlags(flags: number): boolean;
15
+ /**
16
+ * Whether a decimal `FileAttributes` word marks a Cloud Files placeholder whose bytes live only in the cloud.
17
+ * Measured on Windows 11 with OneDrive: an online-only placeholder carries `FILE_ATTRIBUTE_RECALL_ON_DATA_ACCESS`;
18
+ * `FILE_ATTRIBUTE_OFFLINE` is NOT set on it, so an earlier check that required the offline bit missed every
19
+ * real placeholder (#2043).
20
+ */
21
+ export declare function datalessFromWindowsAttributes(attributes: number): boolean;
22
+ /** Which cloud backs a path. Whether AutoRAG may release a provider's files again is up to {@link CloudFileProbe.canRelease}. */
23
+ export type CloudProvider = "icloud" | "google-drive" | "onedrive" | "dropbox" | "file-provider";
24
+ export declare function cloudProviderFromPath(target: string): CloudProvider;
25
+ /** Provider named by a File Provider domain id such as `com.apple.CloudDocs.iCloudDriveFileProvider/<uuid>`. */
26
+ export declare function cloudProviderFromDomain(domain: string): CloudProvider;
27
+ /** One entry of a cloud-root listing: its name and whether it is a directory. Never carries file contents. */
28
+ export interface CloudDirEntry {
29
+ readonly name: string;
30
+ readonly isDirectory: () => boolean;
31
+ }
32
+ /**
33
+ * Whether `target` is `parent` itself or lies under it. Pure: compares normalized paths only.
34
+ * Case-insensitive on Windows, where a drive letter and file names may differ in case.
35
+ */
36
+ export declare function isPathInside(target: string, parent: string): boolean;
37
+ /**
38
+ * What kind of non-physical location a machine root is:
39
+ * - `file-provider`: a macOS File Provider directory (a `~/Library/CloudStorage` mount, iCloud Drive, or a
40
+ * directory carrying `com.apple.file-provider-domain-id`, such as the iCloud-synced `~/Desktop`/`~/Documents`).
41
+ * - `cloud-files`: a Windows Cloud Files sync root (OneDrive, Dropbox, iCloud for Windows, …).
42
+ * - `network`: a network share or virtual filesystem — an SMB/NFS/AFP/WebDAV/FUSE mount, a mapped network
43
+ * drive, a UNC path, or a Windows network/FUSE volume.
44
+ */
45
+ export type CloudRootKind = "file-provider" | "cloud-files" | "network";
46
+ /** One detected non-physical root on this machine: its absolute path and what it is. */
47
+ export interface CloudRoot {
48
+ readonly path: string;
49
+ readonly kind: CloudRootKind;
50
+ }
51
+ /**
52
+ * Best-effort canonical absolute path: symlinks are resolved when the path exists, and the input is returned
53
+ * unchanged otherwise (a path that does not exist, or one whose lookup fails). macOS reports a mount point at
54
+ * its real path — `mount_webdav … /var/…` shows up as `/private/var/…` — so both sides of a root comparison
55
+ * are canonicalized. Resolving a path reads directory metadata only, never file contents.
56
+ */
57
+ export declare function canonicalPath(value: string): string;
58
+ /**
59
+ * Rewrites a walked path into the same canonical space as {@link CloudRoot.path}: the search root's own
60
+ * symlinks are resolved once, so a file reached through `/var/…` compares against a mount root that `mount`
61
+ * reports at `/private/var/…`. The result is a comparison key, not a path to open: a path under a rewritten
62
+ * search root comes back in the comparable (`/`-separated) form, and a path under no such search root is
63
+ * returned unchanged. Pure apart from one `realpath` per search root.
64
+ */
65
+ export declare function canonicalPathMapper(searchRoots: readonly string[]): (path: string) => string;
66
+ /** What a search root's relationship to this machine's non-physical roots is. */
67
+ export interface CloudScope {
68
+ /** The search root is a cloud or network folder (or lies inside one): readers that open contents skip it. */
69
+ readonly insideCloudRoot: boolean;
70
+ /** Cloud or network folders nested under the search root: readers that must not read them exclude these. */
71
+ readonly nestedCloudRoots: readonly CloudRoot[];
72
+ }
73
+ /**
74
+ * Classify a search root against the machine's non-physical roots. Jikji `prepare`, the dupey exact-duplicate
75
+ * scan, and the cloud fingerprints all use this: a root inside a cloud or network folder is skipped entirely
76
+ * (reading a cloud placeholder downloads it; a network file is re-read over the wire), and folders nested
77
+ * inside a root are excluded. Both sides are canonicalized, so a search root or a mount reported at its real
78
+ * path (`/private/var/…`) still matches; paths that do not exist compare as given.
79
+ */
80
+ export declare function cloudScope(searchRoot: string, cloudRoots: readonly CloudRoot[]): CloudScope;
81
+ export type CloudEvictResult = {
82
+ readonly ok: true;
83
+ } | {
84
+ readonly ok: false;
85
+ readonly message: string;
86
+ };
87
+ /**
88
+ * What a refresh needs to know about cloud files, and the one action it may take on them. Every method
89
+ * is read-only except {@link CloudFileProbe.evict}, which only drops the local copy of a file.
90
+ */
91
+ export interface CloudFileProbe {
92
+ /**
93
+ * Absolute roots of the non-physical folders on this machine (each File Provider mount and File
94
+ * Provider–managed directory on macOS; the registered Cloud Files sync roots, network/FUSE volumes, and the
95
+ * search roots that are UNC paths on Windows). `searchRoots` are the roots a refresh is about to walk, so a
96
+ * folder provider that is not under a known mount (iCloud Desktop/Documents) can be found through the
97
+ * `com.apple.file-provider-domain-id` xattr. Listing reads directory metadata only, never file contents.
98
+ * Readers that open originals — Jikji's prepare pass, the dupey exact-duplicate scan, and the cloud
99
+ * fingerprints — use this to skip or exclude them.
100
+ */
101
+ cloudRoots(searchRoots: readonly string[]): Promise<readonly CloudRoot[]>;
102
+ /** The subset of `paths` whose data is not on disk. Reading one of these downloads it. */
103
+ datalessAmong(paths: readonly string[]): Promise<ReadonlySet<string>>;
104
+ /** Provider behind a placeholder, or `undefined` when the path is not under a File Provider domain. */
105
+ providerOf(path: string): Promise<CloudProvider | undefined>;
106
+ /**
107
+ * Whether {@link CloudFileProbe.evict} is verified to release this provider's files on this platform. A refresh
108
+ * downloads a placeholder only when this is true; any other placeholder is skipped unread.
109
+ */
110
+ canRelease(provider: CloudProvider | undefined): boolean;
111
+ /** Release the local copy of a downloaded file; the file stays in the cloud and keeps its metadata. */
112
+ evict(path: string): Promise<CloudEvictResult>;
113
+ }
114
+ export interface CloudExecOptions {
24
115
  readonly timeoutMs?: number;
25
- }): Promise<MaterializedWalk>;
26
- export declare function relativeCloudHint(root: string, filePath: string): string;
116
+ readonly maxBuffer?: number;
117
+ }
118
+ /** Runs a helper process. Injected by tests so they never need a real File Provider mount. */
119
+ export type CloudExec = (file: string, args: readonly string[], options?: CloudExecOptions) => Promise<{
120
+ readonly stdout: string;
121
+ readonly stderr: string;
122
+ }>;
123
+ /** Paths per `xattr` invocation: keeps argv well under the OS limit while batching whole trees. */
124
+ export declare const XATTR_BATCH = 200;
125
+ /** One line of `/sbin/mount`: `<device> on <mountpoint> (<fstype>, <option>, …)`. */
126
+ export interface DarwinMount {
127
+ readonly device: string;
128
+ readonly mountPoint: string;
129
+ readonly fileSystem: string;
130
+ readonly options: readonly string[];
131
+ }
132
+ /**
133
+ * Parses `/sbin/mount` output. The mount point is everything between the first ` on ` and the final ` (`, so a
134
+ * path or device name containing spaces survives; the parenthesised tail is `<fstype>, <option>, …`.
135
+ */
136
+ export declare function parseDarwinMounts(stdout: string): DarwinMount[];
137
+ /**
138
+ * Mount points of the volumes that are not local storage: a share (SMB/NFS/AFP/WebDAV), a FUSE mount, or any
139
+ * other filesystem that does not carry the `local` option. `autofs` (the `map auto_home` automounter) also
140
+ * lacks `local` but is not a share, so it is skipped. Mount points are canonicalized by the caller.
141
+ */
142
+ export declare function networkMountPoints(mounts: readonly DarwinMount[]): readonly string[];
143
+ /**
144
+ * Parses `xattr -v -p <attr> <path>…` stdout. Each path that carries the attribute is printed as
145
+ * `<path as given>: <value>`; paths without it print nothing to stdout (the `No such xattr` note goes to
146
+ * stderr and the process exits nonzero). A line is matched to its candidate by prefix, longest candidate
147
+ * first, so a path that contains `: ` is not mis-split.
148
+ */
149
+ export declare function parseXattrValues(stdout: string, candidates: readonly string[]): ReadonlyMap<string, string>;
150
+ export interface DarwinCloudProbeOptions {
151
+ /** Process runner for `stat`, the release helper, `/sbin/mount`, and `xattr`. Injected by tests. */
152
+ readonly exec?: CloudExec;
153
+ /** Directory listing for {@link DarwinCloudProbe.cloudRoots}; injected by tests so they need no real mounts. */
154
+ readonly readDir?: (path: string) => Promise<readonly CloudDirEntry[]>;
155
+ /** Home directory holding `Library/CloudStorage` and `Library/Mobile Documents`; defaults to the user's home. */
156
+ readonly home?: string;
157
+ }
158
+ /**
159
+ * The macOS probe. `stat -f %f` reads `st_flags`, which Node's `fs.stat` does not expose; a placeholder is
160
+ * the file whose `SF_DATALESS` bit is set. Released with {@link DarwinCloudProbe.evict}: a Foundation
161
+ * `evictUbiquitousItem` call through `osascript -l JavaScript`, which drops the local copy of iCloud,
162
+ * Google Drive, OneDrive, and Dropbox placeholders alike (measured; `brctl evict` works only for iCloud, so
163
+ * not used).
164
+ */
165
+ export declare class DarwinCloudProbe implements CloudFileProbe {
166
+ private readonly exec;
167
+ private readonly readDir;
168
+ private readonly home;
169
+ constructor(options?: DarwinCloudProbeOptions);
170
+ /**
171
+ * The machine's non-physical roots, without ever reading file contents:
172
+ * - each File Provider mount is its own directory directly under `~/Library/CloudStorage` (for example
173
+ * `GoogleDrive-user`, `OneDrive-Work`, `Dropbox`), and iCloud Drive's own root is `~/Library/Mobile
174
+ * Documents`;
175
+ * - every mount from `/sbin/mount` that lacks the `local` option is a network share, WebDAV, or FUSE
176
+ * mount (`autofs` is not), reported by `mount` at its real path;
177
+ * - a directory managed by a File Provider that is not under a known mount — the iCloud-synced `~/Desktop`
178
+ * and `~/Documents` carry `com.apple.file-provider-domain-id` — is found on each search root and its
179
+ * ancestors (`inside`) and on each direct child directory (`nested`), batched through `xattr`.
180
+ *
181
+ * A helper that fails (no `mount`, no `xattr`, a hung share) contributes no roots rather than failing the
182
+ * refresh: the roots found by the other sources stand.
183
+ */
184
+ cloudRoots(searchRoots?: readonly string[]): Promise<readonly CloudRoot[]>;
185
+ /** Mount points of the volumes `/sbin/mount` reports without the `local` option; `[]` when `mount` fails. */
186
+ private networkMountPoints;
187
+ /**
188
+ * Directories carrying `com.apple.file-provider-domain-id` among each search root's ancestors and direct
189
+ * child directories. One directory listing per search root and as few `xattr` processes as the path count
190
+ * allows; a failure of either contributes no directories.
191
+ */
192
+ private fileProviderDirectories;
193
+ /**
194
+ * The paths carrying {@link FILE_PROVIDER_XATTR}. `xattr` exits nonzero as soon as one path lacks the
195
+ * attribute, so the values it printed before that are read off the rejected helper's stdout; a helper that
196
+ * produced nothing usable contributes no paths.
197
+ */
198
+ private xattrValues;
199
+ private tryReadDir;
200
+ datalessAmong(paths: readonly string[]): Promise<ReadonlySet<string>>;
201
+ providerOf(path: string): Promise<CloudProvider | undefined>;
202
+ canRelease(provider: CloudProvider | undefined): boolean;
203
+ evict(path: string): Promise<CloudEvictResult>;
204
+ }
205
+ /** Paths per PowerShell process: long cloud paths still keep the command line under the Windows limit. */
206
+ export declare const WINDOWS_ATTRIBUTE_BATCH = 100;
207
+ export interface PowerShellResult {
208
+ readonly ok: boolean;
209
+ readonly stdout: string;
210
+ readonly stderr: string;
211
+ }
212
+ /** Runs one PowerShell process. The default is {@link runPowerShell}. */
213
+ export type PowerShellRunner = (script: string, timeoutMs: number) => Promise<PowerShellResult>;
214
+ /** One local sync root registered by a Cloud Files provider, with the name Explorer shows for it. */
215
+ export interface WindowsSyncRoot {
216
+ readonly path: string;
217
+ readonly label: string;
218
+ }
219
+ /**
220
+ * Reads `FileAttributes` for a batch of paths in one process: one decimal attribute word per line, in batch
221
+ * order, and `ERR` for a path that could not be read. The list is passed as a PowerShell array literal.
222
+ */
223
+ export declare function buildWindowsAttributeScript(paths: readonly string[]): string;
224
+ /** Dumps every Cloud Files sync root and its Explorer display name, one `path<TAB>label` line each. */
225
+ export declare function buildWindowsSyncRootsScript(): string;
226
+ /**
227
+ * Opens one file with a Cloud Files oplock and dehydrates it synchronously with `CfDehydratePlaceholder`.
228
+ * Prints `OPEN=` and `DEHYDRATE=` as hex HRESULTs and, on failure, `MSG=` with the OS message. Dehydration
229
+ * is provider-agnostic and does not change the file's pin state; it refuses a file the provider has not
230
+ * finished uploading, which is exactly the refusal a refresh wants to surface.
231
+ */
232
+ export declare function buildWindowsDehydrateScript(path: string): string;
233
+ /** Maps one attribute word per output line back to the batch paths, in order; unparseable lines are dropped. */
234
+ export declare function parseWindowsAttributeOutput(stdout: string, paths: readonly string[]): Map<string, number>;
235
+ /** Parses the `path<TAB>label` lines of {@link buildWindowsSyncRootsScript} into sync roots. */
236
+ export declare function parseWindowsSyncRoots(stdout: string): WindowsSyncRoot[];
237
+ /** Provider a sync root's Explorer display name belongs to, from the names the providers register. */
238
+ export declare function providerFromWindowsSyncRoot(label: string): CloudProvider;
239
+ /** `Win32_LogicalDisk.DriveType` for a mapped network drive. */
240
+ export declare const WINDOWS_DRIVE_TYPE_NETWORK = 4;
241
+ /** One logical disk as `Win32_LogicalDisk` reports it. */
242
+ export interface WindowsLogicalDisk {
243
+ /** The drive letter, for example `C:`. */
244
+ readonly deviceId: string;
245
+ readonly driveType: number;
246
+ readonly fileSystem: string;
247
+ readonly volumeName: string;
248
+ }
249
+ /** Dumps every logical disk, one `deviceId<TAB>driveType<TAB>fileSystem<TAB>volumeName` line each. */
250
+ export declare function buildWindowsDiskScript(): string;
251
+ /** Parses the tab-separated lines of {@link buildWindowsDiskScript}. */
252
+ export declare function parseWindowsLogicalDisks(stdout: string): WindowsLogicalDisk[];
253
+ /**
254
+ * The non-physical roots among a disk list:
255
+ * - `DriveType 4` is a mapped network drive (`X:\`), always `network`;
256
+ * - a FUSE-compatible volume (WinFsp, Dokan, rclone) is a virtual filesystem, treated as `network`;
257
+ * - Google Drive for desktop mounts a drive letter the Cloud Files registry does not list, recognized by its
258
+ * `GoogleDriveFS` filesystem or `Google Drive` volume name — **unverified**: no Windows host with Google
259
+ * Drive for desktop installed has been measured.
260
+ */
261
+ export declare function windowsRootsFromDisks(disks: readonly WindowsLogicalDisk[]): readonly CloudRoot[];
262
+ /**
263
+ * The share root of a UNC path — `\\server\share` for `\\server\share\folder`. Returns `undefined` for a local
264
+ * path and for a device path (`\\?\…`, `\\.\…`), which is not a share.
265
+ */
266
+ export declare function uncShareRoot(target: string): string | undefined;
267
+ /**
268
+ * Maps the `OPEN`/`DEHYDRATE`/`MSG` lines of {@link buildWindowsDehydrateScript} to an eviction result.
269
+ * `HRESULT 0` is success; anything else (including a process that produced no lines) is a failure whose
270
+ * message is the OS text when the script printed one, otherwise the process stderr.
271
+ */
272
+ export declare function parseWindowsDehydrateOutput(result: PowerShellResult): CloudEvictResult;
273
+ export interface WindowsCloudProbeOptions {
274
+ /** Runs PowerShell; tests inject one that returns canned output instead of spawning a process. */
275
+ readonly run?: PowerShellRunner;
276
+ }
277
+ /**
278
+ * The Windows probe. A Cloud Files placeholder carries `FILE_ATTRIBUTE_RECALL_ON_DATA_ACCESS`; the provider is the
279
+ * registered sync root that contains the path (else the path's own marker); the local copy is released with
280
+ * `CfDehydratePlaceholder`. Release is allowed for every Cloud Files sync root because the platform itself refuses
281
+ * to dehydrate a file with unsynced changes or a pinned file (measured: 0x80070179 and 0x80070188). Verified against
282
+ * a synthetic cfapi provider only; OneDrive, Dropbox and other commercial providers were not measured.
283
+ */
284
+ export declare class WindowsCloudProbe implements CloudFileProbe {
285
+ private readonly run;
286
+ private syncRoots;
287
+ private disks;
288
+ constructor(options?: WindowsCloudProbeOptions);
289
+ /**
290
+ * The machine's non-physical roots, none of which reads a file's contents: the registered Cloud Files sync
291
+ * roots (registry), the mapped network and FUSE-compatible volume letters (`Win32_LogicalDisk`, one
292
+ * PowerShell process), and the share root of any search root that is a UNC path (`\\server\share\…`).
293
+ */
294
+ cloudRoots(searchRoots?: readonly string[]): Promise<readonly CloudRoot[]>;
295
+ datalessAmong(paths: readonly string[]): Promise<ReadonlySet<string>>;
296
+ providerOf(path: string): Promise<CloudProvider | undefined>;
297
+ canRelease(provider: CloudProvider | undefined): boolean;
298
+ evict(path: string): Promise<CloudEvictResult>;
299
+ /** The sync roots are read once per probe; a failure falls back to the path markers, never aborts a refresh. */
300
+ private loadSyncRoots;
301
+ /** The disk list is read once per probe in one PowerShell process; a failure contributes no roots. */
302
+ private loadDiskRoots;
303
+ }
304
+ /**
305
+ * How {@link runPowerShell} starts `powershell.exe`. The command line itself is a fixed, ASCII statement that
306
+ * switches the console to UTF-8 and only then evaluates the script, which it reads from the environment. An error in
307
+ * the script itself (a parse error included) is then written in UTF-8. A script passed on the command line is
308
+ * parsed before any statement can run, so a parse error came out in the console code page (CP949 on Korean Windows),
309
+ * which reads as mojibake.
310
+ */
311
+ export declare function powerShellLaunch(script: string): {
312
+ readonly args: readonly string[];
313
+ readonly env: Readonly<Record<string, string>>;
314
+ };
315
+ /** The default {@link PowerShellRunner}. */
316
+ export declare function runPowerShell(script: string, timeoutMs: number): Promise<PowerShellResult>;
317
+ /** The probe for this platform, or `undefined` where AutoRAG has no cloud-aware handling yet. */
318
+ export declare function defaultCloudProbe(): CloudFileProbe | undefined;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Orders async tasks like a read/write lock, in arrival order.
3
+ *
4
+ * `shared` tasks (searches) overlap each other. An `exclusive` task (index,
5
+ * stop) waits for every earlier task and holds back every later one, so a
6
+ * reindex never runs under a search and a search never reads a half-built
7
+ * index. A rejected task rejects its own caller only; the queue keeps going.
8
+ */
9
+ export declare class SharedExclusiveQueue {
10
+ /** Shared tasks queued since the last exclusive one; the next exclusive task waits for all of them. */
11
+ private sharedSinceExclusive;
12
+ /** Settles when the last exclusive task has; every shared task waits for it. */
13
+ private lastExclusive;
14
+ shared<T>(task: () => Promise<T>): Promise<T>;
15
+ exclusive<T>(task: () => Promise<T>): Promise<T>;
16
+ }
@@ -144,7 +144,7 @@ export declare class FSearchClient {
144
144
  private readonly dbPath;
145
145
  private readonly pidPath;
146
146
  private binary;
147
- private operation;
147
+ private readonly queue;
148
148
  constructor(options: FSearchClientOptions);
149
149
  isSupported(): boolean;
150
150
  /**
@@ -174,7 +174,8 @@ export declare class FSearchClient {
174
174
  private socketPath;
175
175
  private readWatchPid;
176
176
  private unsupportedFailure;
177
+ /** The probe is shared: searches run concurrently, and the first few must not each spawn `--version`. */
177
178
  private resolveBinary;
178
- private serialize;
179
+ private probeBinary;
179
180
  private failure;
180
181
  }
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { AutoRAGAgent, type AutoRAGAgentOptions, type AutoRAGRefreshComponentStatus, type AutoRAGRefreshOptions, type AutoRAGRefreshProgress, type AutoRAGRefreshResult, type AutoRAGRefreshStatus, type AutoRAGWatchRefreshHandle, type AutoRAGWatchRefreshOptions, type AutoRefreshOptions, type RefreshMethod, } from "./agent/agent.js";
2
- export { type AutoRAGResultsDetails, reportSchema, type SearchDocumentDiagnostic, type SearchDocumentDiagnosticCode, type SearchDocumentDiagnosticSeverity, type SearchDocumentsResponse, type SearchDocumentsStreamEvent, type SearchDocumentWarning, } from "./agent/index.js";
2
+ export { type AutoRAGResultsDetails, DECISION_MODEL_UNAVAILABLE_CODE, type DecisionModelFailureReason, DecisionModelUnavailableError, reportSchema, type SearchDocumentDiagnostic, type SearchDocumentDiagnosticCode, type SearchDocumentDiagnosticSeverity, type SearchDocumentsResponse, type SearchDocumentsStreamEvent, type SearchDocumentWarning, } from "./agent/index.js";
3
3
  export { buildSystemPrompt, type SystemPromptConfig } from "./agent/system-prompt.js";
4
4
  export * from "./cloud/index.js";
5
5
  export * from "./convert/index.js";