@bendyline/docblocks 2.6.1 → 2.7.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 (62) hide show
  1. package/THIRD_PARTY_NOTICES.txt +33 -33
  2. package/dist/capabilities-CdQAc745.d.ts +1233 -0
  3. package/dist/catalog-BQK05tne.d.ts +122 -0
  4. package/dist/chunk-245W57QP.js +31 -0
  5. package/dist/{chunk-2WDJ27EH.js → chunk-46AGYHDY.js} +8 -0
  6. package/dist/{chunk-4437YWLE.js → chunk-6UPO2GE6.js} +4 -2
  7. package/dist/{chunk-UMWCTEXW.js → chunk-7SN7YQL4.js} +211 -40
  8. package/dist/{chunk-OQCPBOQA.js → chunk-DAPFSEKY.js} +35 -0
  9. package/dist/{chunk-M62ZGJ5I.js → chunk-HABG2JM3.js} +0 -17
  10. package/dist/{chunk-YM7O3PWO.js → chunk-HKOOHM67.js} +20 -12
  11. package/dist/chunk-IDYE73TU.js +77 -0
  12. package/dist/{chunk-KLQKU74Q.js → chunk-IGB2VSRE.js} +124 -330
  13. package/dist/{chunk-BVY7GGNV.js → chunk-L6PRMR7T.js} +137 -95
  14. package/dist/chunk-LPIJ6HKL.js +19 -0
  15. package/dist/{chunk-SJBB5OD7.js → chunk-QS5WTLUZ.js} +10 -8
  16. package/dist/chunk-R2JX5N3F.js +382 -0
  17. package/dist/{chunk-ZO7G53QP.js → chunk-UDEWLHQI.js} +4 -2
  18. package/dist/chunk-UK7R3RC7.js +514 -0
  19. package/dist/chunk-XTNWCNSK.js +464 -0
  20. package/dist/chunk-YHSFRPBS.js +42 -0
  21. package/dist/chunk-YNUQG4GF.js +1173 -0
  22. package/dist/document/index.d.ts +31 -1
  23. package/dist/document/index.js +7 -6
  24. package/dist/filesystem/electron.d.ts +8 -34
  25. package/dist/filesystem/electron.js +7 -4
  26. package/dist/filesystem/host.d.ts +28 -0
  27. package/dist/filesystem/host.js +103 -0
  28. package/dist/filesystem/index.d.ts +52 -6
  29. package/dist/filesystem/index.js +36 -15
  30. package/dist/filesystem/indexeddb.d.ts +8 -1
  31. package/dist/filesystem/indexeddb.js +7 -6
  32. package/dist/filesystem/memory.d.ts +2 -1
  33. package/dist/filesystem/memory.js +3 -2
  34. package/dist/filesystem/native.d.ts +2 -1
  35. package/dist/filesystem/native.js +3 -2
  36. package/dist/filesystem-v2-C8AdSXUN.d.ts +74 -0
  37. package/dist/host/index.d.ts +127 -5
  38. package/dist/host/index.js +100 -4
  39. package/dist/host/mobile.d.ts +389 -0
  40. package/dist/host/mobile.js +315 -0
  41. package/dist/host-provider-v2-CyLTRKJF.d.ts +51 -0
  42. package/dist/index.d.ts +8 -5
  43. package/dist/index.js +153 -34
  44. package/dist/mcp/index.d.ts +2 -2
  45. package/dist/mcp/zod.d.ts +23 -1
  46. package/dist/mcp/zod.js +1 -0
  47. package/dist/settings-HrrCikVX.d.ts +170 -0
  48. package/dist/types-BvDnr3YU.d.ts +88 -0
  49. package/dist/{types-Oy9U5FST.d.ts → types-d0yvHUJz.d.ts} +6 -0
  50. package/dist/{types-Bb3yccTH.d.ts → v2-BVnZZyd4.d.ts} +1 -86
  51. package/dist/vscode/index.d.ts +43 -1
  52. package/dist/vscode/index.js +67 -1
  53. package/dist/workspace/index.d.ts +10 -6
  54. package/dist/workspace/index.js +4 -2
  55. package/dist/workspace-index/index.d.ts +240 -0
  56. package/dist/workspace-index/index.js +1287 -0
  57. package/dist/workspace-settings/index.d.ts +301 -0
  58. package/dist/workspace-settings/index.js +820 -0
  59. package/package.json +22 -2
  60. package/dist/chunk-6XHOOBYF.js +0 -36
  61. package/dist/chunk-QI6YKTQV.js +0 -110
  62. package/dist/types-DBYraXxE.d.ts +0 -557
@@ -0,0 +1,240 @@
1
+ import { n as FileSystemProviderV2, m as FileSystemProviderCapabilities } from '../v2-BVnZZyd4.js';
2
+ import { a as WorkspacePath } from '../workspace-path-CWVrcuPL.js';
3
+ import { d as CatalogDocumentFormat, f as CatalogOutlineEntry } from '../catalog-BQK05tne.js';
4
+ import '@bendyline/squisq/markdown';
5
+ import '../settings-HrrCikVX.js';
6
+
7
+ /**
8
+ * What the index reads from. Only read methods are reachable, so the index
9
+ * cannot write to a workspace by construction.
10
+ */
11
+ type WorkspaceIndexSource = Pick<FileSystemProviderV2, 'stat' | 'readFile' | 'readDirectory'> & {
12
+ readonly capabilities?: Pick<FileSystemProviderCapabilities, 'watch'>;
13
+ readonly watch?: FileSystemProviderV2['watch'];
14
+ };
15
+ interface WorkspaceIndexLimits {
16
+ /** Files and folders listed in total. */
17
+ readonly maxEntries: number;
18
+ readonly maxDirectories: number;
19
+ readonly maxDepth: number;
20
+ /** Documents whose text is analyzed; the rest are searchable by name only. */
21
+ readonly maxDocuments: number;
22
+ /** Larger documents are indexed by name only, without being read. */
23
+ readonly maxDocumentBytes: number;
24
+ /** Larger documents are searched line by line instead of being parsed. */
25
+ readonly maxParseBytes: number;
26
+ /** Total searchable text kept in memory, in UTF-16 code units. */
27
+ readonly maxTextCharacters: number;
28
+ }
29
+ declare const WORKSPACE_INDEX_LIMITS: Readonly<WorkspaceIndexLimits>;
30
+ interface WorkspaceIndexOptions {
31
+ readonly workspaceId: string;
32
+ readonly source: WorkspaceIndexSource;
33
+ /** Read and parse document text (default). `false` indexes names only. */
34
+ readonly analyze?: boolean;
35
+ readonly limits?: Partial<WorkspaceIndexLimits>;
36
+ /** Hands control back to the host between slices of work. */
37
+ readonly yieldControl?: () => Promise<void>;
38
+ /** Monotonic clock in milliseconds, for slicing and refresh pacing. */
39
+ readonly now?: () => number;
40
+ /** Minimum gap between unforced refreshes; default 15 s. */
41
+ readonly minRefreshIntervalMs?: number;
42
+ /** Window that coalesces bursts of change notifications; default 50 ms. */
43
+ readonly changeCoalesceMs?: number;
44
+ }
45
+ type WorkspaceIndexPhase = 'idle' | 'listing' | 'analyzing' | 'ready' | 'error' | 'disposed';
46
+ type WorkspaceIndexTruncation = 'entries' | 'directories' | 'depth' | 'documents' | 'text';
47
+ interface WorkspaceIndexStatus {
48
+ readonly phase: WorkspaceIndexPhase;
49
+ readonly fileCount: number;
50
+ readonly documentCount: number;
51
+ readonly analyzedCount: number;
52
+ readonly pendingCount: number;
53
+ /** True while provider change events keep the index current. */
54
+ readonly watching: boolean;
55
+ /** True once the whole workspace has been listed at least once. */
56
+ readonly listed: boolean;
57
+ readonly truncated: {
58
+ readonly reason: WorkspaceIndexTruncation;
59
+ readonly limit: number;
60
+ } | null;
61
+ /** Folders or documents that could not be read; never reported as absent. */
62
+ readonly issues: number;
63
+ /** Why the workspace root could not be listed. */
64
+ readonly error: string | null;
65
+ /** Advances whenever the published files, documents, or status change. */
66
+ readonly generation: number;
67
+ }
68
+ type WorkspaceIndexFileKind = 'markdown' | 'outside-in' | 'other';
69
+ interface WorkspaceIndexFile {
70
+ readonly path: WorkspacePath;
71
+ readonly name: string;
72
+ readonly size: number;
73
+ readonly lastModified: string;
74
+ readonly kind: WorkspaceIndexFileKind;
75
+ }
76
+ type IndexedDocumentContent = 'full' | 'lines' | 'name-only';
77
+ type IndexedDocumentIssue = 'pending' | 'too-large' | 'parse-limit' | 'not-utf8' | 'read-error' | 'no-companion' | 'over-budget';
78
+ interface IndexedDocument {
79
+ /** Navigation identity: the rendered file for outside-in documents. */
80
+ readonly path: WorkspacePath;
81
+ /** The Markdown actually read (the companion for outside-in documents). */
82
+ readonly sourcePath: WorkspacePath | null;
83
+ readonly format: CatalogDocumentFormat;
84
+ readonly lastModified: string;
85
+ readonly title: string;
86
+ readonly outline: readonly CatalogOutlineEntry[];
87
+ readonly wordCount: number;
88
+ readonly excerpt?: string;
89
+ readonly description?: string;
90
+ readonly tags?: readonly string[];
91
+ /** `full` = parsed text, `lines` = raw source lines, `name-only` = not searchable by content. */
92
+ readonly content: IndexedDocumentContent;
93
+ readonly issue?: IndexedDocumentIssue;
94
+ }
95
+ interface WorkspaceSearchQuery {
96
+ readonly text: string;
97
+ readonly matchCase?: boolean;
98
+ readonly wholeWord?: boolean;
99
+ }
100
+ interface WorkspaceSearchLimits {
101
+ readonly maxQueryCharacters: number;
102
+ readonly maxDocuments: number;
103
+ readonly maxLinesPerDocument: number;
104
+ readonly maxMatchesPerDocument: number;
105
+ readonly maxTotalMatches: number;
106
+ }
107
+ declare const WORKSPACE_SEARCH_LIMITS: Readonly<WorkspaceSearchLimits>;
108
+ type WorkspaceSearchRange = readonly [start: number, end: number];
109
+ type WorkspaceSearchLineKind = 'text' | 'heading' | 'code' | 'frontmatter';
110
+ interface WorkspaceSearchLineMatch {
111
+ /** 1-based source line. */
112
+ readonly line: number;
113
+ readonly kind: WorkspaceSearchLineKind;
114
+ readonly snippet: string;
115
+ /** Match ranges within `snippet`. */
116
+ readonly ranges: readonly WorkspaceSearchRange[];
117
+ /** 0-based index, in document order, of this line's first match. */
118
+ readonly occurrence: number;
119
+ }
120
+ interface WorkspaceSearchDocument {
121
+ readonly path: WorkspacePath;
122
+ readonly title: string;
123
+ readonly format: CatalogDocumentFormat;
124
+ readonly titleMatch: boolean;
125
+ readonly titleRanges: readonly WorkspaceSearchRange[];
126
+ readonly matchCount: number;
127
+ readonly matches: readonly WorkspaceSearchLineMatch[];
128
+ /** More matching lines exist than `matches` lists. */
129
+ readonly moreMatches: boolean;
130
+ readonly lastModified: string;
131
+ /** Not analyzed yet; only its name could be matched. */
132
+ readonly pending: boolean;
133
+ }
134
+ interface WorkspaceSearchResult {
135
+ readonly documents: readonly WorkspaceSearchDocument[];
136
+ readonly totalDocuments: number;
137
+ readonly totalMatches: number;
138
+ /** Result caps were reached; more matches exist than were counted or shown. */
139
+ readonly truncated: boolean;
140
+ /** Documents not analyzed yet, so their content was not searched. */
141
+ readonly pendingDocuments: number;
142
+ /** Documents that will never be content-searched (too large, unreadable, over budget). */
143
+ readonly skippedDocuments: number;
144
+ }
145
+ interface WorkspaceIndex {
146
+ readonly workspaceId: string;
147
+ getStatus(): WorkspaceIndexStatus;
148
+ /** Called after every published change; read state through the getters. */
149
+ subscribe(listener: () => void): () => void;
150
+ /** Begin listing and analysis. Idempotent. */
151
+ start(): void;
152
+ /** Every discoverable file, sorted by path; the same array within a generation. */
153
+ getFiles(): readonly WorkspaceIndexFile[];
154
+ /** Every document (Markdown and outside-in), sorted by path. */
155
+ getDocuments(): readonly IndexedDocument[];
156
+ getDocument(path: string): IndexedDocument | null;
157
+ /** `unknown` while unlisted, beneath an unreadable folder, or outside coverage. */
158
+ has(path: string): 'present' | 'absent' | 'unknown';
159
+ /** Resolves `true` once fully listed, or `false` on timeout. */
160
+ whenListed(options?: {
161
+ readonly signal?: AbortSignal;
162
+ readonly timeoutMs?: number;
163
+ }): Promise<boolean>;
164
+ search(query: WorkspaceSearchQuery, options?: {
165
+ readonly signal?: AbortSignal;
166
+ readonly limits?: Partial<WorkspaceSearchLimits>;
167
+ }): Promise<WorkspaceSearchResult>;
168
+ /** Re-walk the workspace, re-reading only changed documents. Coalesced. */
169
+ refresh(options?: {
170
+ readonly force?: boolean;
171
+ }): void;
172
+ /** Re-check one path (or subtree) that is known to have changed. */
173
+ invalidate(path: string): void;
174
+ /** Analyze these documents before others. */
175
+ prioritize(paths: readonly string[]): void;
176
+ /** Stop issuing provider calls until resumed (e.g. while the page is hidden). */
177
+ setPaused(paused: boolean): void;
178
+ /** Stop all work and release the watch subscription. Never disposes the source. */
179
+ dispose(): void;
180
+ }
181
+
182
+ /**
183
+ * In-memory workspace index: one shared listing of the files people can open,
184
+ * plus each document's title, outline, and searchable text.
185
+ *
186
+ * Every feature that used to walk the workspace on its own (link picker,
187
+ * quick-open, search) reads from here instead, so the workspace is walked once
188
+ * and kept current from provider change events (or explicit refreshes where
189
+ * the provider cannot watch).
190
+ *
191
+ * All provider calls go through one serial work loop, so at most one is ever
192
+ * outstanding: on desktop every read queues behind the same per-workspace
193
+ * lock as the user's saves, and parallel reads would only make saves wait.
194
+ */
195
+
196
+ /** Create an index over one workspace. Call `start()` to begin. */
197
+ declare function createWorkspaceIndex(options: WorkspaceIndexOptions): WorkspaceIndex;
198
+
199
+ /**
200
+ * Literal workspace search over indexed text: exact matches, optional case
201
+ * and whole-word constraints, line snippets with highlight ranges.
202
+ */
203
+
204
+ /**
205
+ * Compile a query, or null when it cannot match anything (empty or too long).
206
+ * Whole word only constrains the query's ends that are themselves word
207
+ * characters, so `c++` still matches before a space.
208
+ */
209
+ declare function buildLiteralMatcher(query: WorkspaceSearchQuery, maxQueryCharacters?: number): RegExp | null;
210
+ /** A display line around its matches, with the ranges shifted to fit. */
211
+ declare function buildSnippet(line: string, ranges: readonly WorkspaceSearchRange[]): {
212
+ readonly snippet: string;
213
+ readonly ranges: readonly WorkspaceSearchRange[];
214
+ };
215
+
216
+ /**
217
+ * Fuzzy subsequence scoring for quick-open: every query character must
218
+ * appear in order. Matches at word starts and in consecutive runs score
219
+ * higher; skipped characters cost a little. Returns highlight ranges.
220
+ */
221
+
222
+ interface FuzzyMatch {
223
+ readonly score: number;
224
+ readonly ranges: readonly WorkspaceSearchRange[];
225
+ }
226
+ /**
227
+ * Score one query token against a target, or null when it does not match.
228
+ * Finds the earliest-ending match, then walks back to the tightest window
229
+ * that still contains it, so `ab` in `a…xab` highlights the `ab` run.
230
+ */
231
+ declare function fuzzyMatch(query: string, target: string): FuzzyMatch | null;
232
+ /**
233
+ * Every whitespace-separated token must match. Scores add up; ranges merge.
234
+ * Returns null when any token misses.
235
+ */
236
+ declare function fuzzyMatchTokens(tokens: readonly string[], target: string): FuzzyMatch | null;
237
+ /** Split a quick-open query into tokens. */
238
+ declare function fuzzyTokens(query: string): string[];
239
+
240
+ export { type FuzzyMatch, type IndexedDocument, type IndexedDocumentContent, type IndexedDocumentIssue, WORKSPACE_INDEX_LIMITS, WORKSPACE_SEARCH_LIMITS, type WorkspaceIndex, type WorkspaceIndexFile, type WorkspaceIndexFileKind, type WorkspaceIndexLimits, type WorkspaceIndexOptions, type WorkspaceIndexPhase, type WorkspaceIndexSource, type WorkspaceIndexStatus, type WorkspaceIndexTruncation, type WorkspaceSearchDocument, type WorkspaceSearchLimits, type WorkspaceSearchLineKind, type WorkspaceSearchLineMatch, type WorkspaceSearchQuery, type WorkspaceSearchRange, type WorkspaceSearchResult, buildLiteralMatcher, buildSnippet, createWorkspaceIndex, fuzzyMatch, fuzzyMatchTokens, fuzzyTokens };