@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.
- package/THIRD_PARTY_NOTICES.txt +33 -33
- package/dist/capabilities-CdQAc745.d.ts +1233 -0
- package/dist/catalog-BQK05tne.d.ts +122 -0
- package/dist/chunk-245W57QP.js +31 -0
- package/dist/{chunk-2WDJ27EH.js → chunk-46AGYHDY.js} +8 -0
- package/dist/{chunk-4437YWLE.js → chunk-6UPO2GE6.js} +4 -2
- package/dist/{chunk-UMWCTEXW.js → chunk-7SN7YQL4.js} +211 -40
- package/dist/{chunk-OQCPBOQA.js → chunk-DAPFSEKY.js} +35 -0
- package/dist/{chunk-M62ZGJ5I.js → chunk-HABG2JM3.js} +0 -17
- package/dist/{chunk-YM7O3PWO.js → chunk-HKOOHM67.js} +20 -12
- package/dist/chunk-IDYE73TU.js +77 -0
- package/dist/{chunk-KLQKU74Q.js → chunk-IGB2VSRE.js} +124 -330
- package/dist/{chunk-BVY7GGNV.js → chunk-L6PRMR7T.js} +137 -95
- package/dist/chunk-LPIJ6HKL.js +19 -0
- package/dist/{chunk-SJBB5OD7.js → chunk-QS5WTLUZ.js} +10 -8
- package/dist/chunk-R2JX5N3F.js +382 -0
- package/dist/{chunk-ZO7G53QP.js → chunk-UDEWLHQI.js} +4 -2
- package/dist/chunk-UK7R3RC7.js +514 -0
- package/dist/chunk-XTNWCNSK.js +464 -0
- package/dist/chunk-YHSFRPBS.js +42 -0
- package/dist/chunk-YNUQG4GF.js +1173 -0
- package/dist/document/index.d.ts +31 -1
- package/dist/document/index.js +7 -6
- package/dist/filesystem/electron.d.ts +8 -34
- package/dist/filesystem/electron.js +7 -4
- package/dist/filesystem/host.d.ts +28 -0
- package/dist/filesystem/host.js +103 -0
- package/dist/filesystem/index.d.ts +52 -6
- package/dist/filesystem/index.js +36 -15
- package/dist/filesystem/indexeddb.d.ts +8 -1
- package/dist/filesystem/indexeddb.js +7 -6
- package/dist/filesystem/memory.d.ts +2 -1
- package/dist/filesystem/memory.js +3 -2
- package/dist/filesystem/native.d.ts +2 -1
- package/dist/filesystem/native.js +3 -2
- package/dist/filesystem-v2-C8AdSXUN.d.ts +74 -0
- package/dist/host/index.d.ts +127 -5
- package/dist/host/index.js +100 -4
- package/dist/host/mobile.d.ts +389 -0
- package/dist/host/mobile.js +315 -0
- package/dist/host-provider-v2-CyLTRKJF.d.ts +51 -0
- package/dist/index.d.ts +8 -5
- package/dist/index.js +153 -34
- package/dist/mcp/index.d.ts +2 -2
- package/dist/mcp/zod.d.ts +23 -1
- package/dist/mcp/zod.js +1 -0
- package/dist/settings-HrrCikVX.d.ts +170 -0
- package/dist/types-BvDnr3YU.d.ts +88 -0
- package/dist/{types-Oy9U5FST.d.ts → types-d0yvHUJz.d.ts} +6 -0
- package/dist/{types-Bb3yccTH.d.ts → v2-BVnZZyd4.d.ts} +1 -86
- package/dist/vscode/index.d.ts +43 -1
- package/dist/vscode/index.js +67 -1
- package/dist/workspace/index.d.ts +10 -6
- package/dist/workspace/index.js +4 -2
- package/dist/workspace-index/index.d.ts +240 -0
- package/dist/workspace-index/index.js +1287 -0
- package/dist/workspace-settings/index.d.ts +301 -0
- package/dist/workspace-settings/index.js +820 -0
- package/package.json +22 -2
- package/dist/chunk-6XHOOBYF.js +0 -36
- package/dist/chunk-QI6YKTQV.js +0 -110
- package/dist/types-DBYraXxE.d.ts +0 -557
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { a as WorkspacePath } from './workspace-path-CWVrcuPL.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Workspace-scoped settings persisted in `<workspace root>/.docblocks/workspace.json`.
|
|
5
|
+
*
|
|
6
|
+
* The file travels with the folder (git, sync, zip download), so every
|
|
7
|
+
* surface — the shell, the VS Code extension host, and the CLI — reads the
|
|
8
|
+
* same exact-shape document through this module. It is a persisted wire
|
|
9
|
+
* payload: it enters as `unknown`, only the exact v1 shape is accepted, and
|
|
10
|
+
* a file written by a newer DocBlocks is reported as unsupported rather than
|
|
11
|
+
* half-applied.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
declare const WORKSPACE_SETTINGS_DIRECTORY = ".docblocks";
|
|
15
|
+
declare const WORKSPACE_SETTINGS_PATH = ".docblocks/workspace.json";
|
|
16
|
+
declare const WORKSPACE_SETTINGS_VERSION = 1;
|
|
17
|
+
declare const DEFAULT_CATALOG_TITLE = "Documents";
|
|
18
|
+
declare const DEFAULT_CATALOG_HTML_PATH = "index.html";
|
|
19
|
+
declare const DEFAULT_CATALOG_JSON_PATH = "catalog.json";
|
|
20
|
+
declare const WORKSPACE_SETTINGS_LIMITS: {
|
|
21
|
+
readonly maxFileBytes: number;
|
|
22
|
+
readonly maxTitleCharacters: 256;
|
|
23
|
+
readonly maxPathCharacters: 1024;
|
|
24
|
+
readonly maxSchemaCharacters: 2048;
|
|
25
|
+
readonly maxExcludes: 64;
|
|
26
|
+
readonly minKeep: 1;
|
|
27
|
+
readonly maxKeep: 1000;
|
|
28
|
+
};
|
|
29
|
+
/** Theme ids are data: unknown ids render as the standard theme. */
|
|
30
|
+
declare const WORKSPACE_THEME_ID_PATTERN: RegExp;
|
|
31
|
+
declare const CATALOG_SORT_ORDERS: readonly ["title", "path", "date"];
|
|
32
|
+
type CatalogSortOrder = (typeof CATALOG_SORT_ORDERS)[number];
|
|
33
|
+
declare const CATALOG_JSON_CONTENT_MODES: readonly ["metadata", "markdown"];
|
|
34
|
+
type CatalogJsonContent = (typeof CATALOG_JSON_CONTENT_MODES)[number];
|
|
35
|
+
interface WorkspaceDocumentSettings {
|
|
36
|
+
/** Theme for documents whose frontmatter names none. */
|
|
37
|
+
readonly defaultTheme?: string;
|
|
38
|
+
}
|
|
39
|
+
interface WorkspaceVersionHistorySettings {
|
|
40
|
+
/** Absent inherits the app-wide preference. */
|
|
41
|
+
readonly enabled?: boolean;
|
|
42
|
+
/** Snapshots kept per document (keep-last-n prune policy). */
|
|
43
|
+
readonly keep?: number;
|
|
44
|
+
}
|
|
45
|
+
interface WorkspaceCatalogHtmlSettings {
|
|
46
|
+
readonly enabled?: boolean;
|
|
47
|
+
readonly path?: string;
|
|
48
|
+
/** Overrides `documents.defaultTheme` for the catalog page only. */
|
|
49
|
+
readonly theme?: string;
|
|
50
|
+
}
|
|
51
|
+
interface WorkspaceCatalogJsonSettings {
|
|
52
|
+
readonly enabled?: boolean;
|
|
53
|
+
readonly path?: string;
|
|
54
|
+
readonly content?: CatalogJsonContent;
|
|
55
|
+
}
|
|
56
|
+
interface WorkspaceCatalogSettings {
|
|
57
|
+
readonly title?: string;
|
|
58
|
+
readonly sort?: CatalogSortOrder;
|
|
59
|
+
/** Workspace-relative folder or file prefixes left out of the catalog. */
|
|
60
|
+
readonly exclude?: readonly string[];
|
|
61
|
+
readonly html?: WorkspaceCatalogHtmlSettings;
|
|
62
|
+
readonly json?: WorkspaceCatalogJsonSettings;
|
|
63
|
+
}
|
|
64
|
+
interface WorkspaceSettings {
|
|
65
|
+
readonly $schema?: string;
|
|
66
|
+
readonly version: typeof WORKSPACE_SETTINGS_VERSION;
|
|
67
|
+
readonly documents?: WorkspaceDocumentSettings;
|
|
68
|
+
readonly versionHistory?: WorkspaceVersionHistorySettings;
|
|
69
|
+
readonly catalog?: WorkspaceCatalogSettings;
|
|
70
|
+
}
|
|
71
|
+
declare const EMPTY_WORKSPACE_SETTINGS: WorkspaceSettings;
|
|
72
|
+
type WorkspaceSettingsParseResult = {
|
|
73
|
+
readonly status: 'ok';
|
|
74
|
+
readonly settings: WorkspaceSettings;
|
|
75
|
+
} | {
|
|
76
|
+
readonly status: 'invalid' | 'unsupported-version';
|
|
77
|
+
readonly message: string;
|
|
78
|
+
};
|
|
79
|
+
type CatalogOutputKind = 'html' | 'json';
|
|
80
|
+
/**
|
|
81
|
+
* Validate a configured catalog output path. Outputs may never land inside
|
|
82
|
+
* hidden folders, outside-in companions, or the shared player runtime, and
|
|
83
|
+
* must carry the extension of what they contain.
|
|
84
|
+
*/
|
|
85
|
+
declare function validateCatalogOutputPath(value: unknown, kind: CatalogOutputKind): WorkspacePath;
|
|
86
|
+
/** Try-form for UI validation messages. */
|
|
87
|
+
declare function checkCatalogOutputPath(value: unknown, kind: CatalogOutputKind): {
|
|
88
|
+
ok: true;
|
|
89
|
+
path: WorkspacePath;
|
|
90
|
+
} | {
|
|
91
|
+
ok: false;
|
|
92
|
+
message: string;
|
|
93
|
+
};
|
|
94
|
+
/** Parse an already-decoded settings value with the exact v1 shape. */
|
|
95
|
+
declare function parseWorkspaceSettings(value: unknown): WorkspaceSettings;
|
|
96
|
+
declare class UnsupportedWorkspaceSettingsVersionError extends Error {
|
|
97
|
+
readonly version: number;
|
|
98
|
+
constructor(version: number);
|
|
99
|
+
}
|
|
100
|
+
/** Decode the settings file text. Never throws for malformed content. */
|
|
101
|
+
declare function parseWorkspaceSettingsText(text: string): WorkspaceSettingsParseResult;
|
|
102
|
+
/** Deterministic, git-friendly serialization: fixed key order, two-space indent, final newline. */
|
|
103
|
+
declare function serializeWorkspaceSettings(settings: WorkspaceSettings): string;
|
|
104
|
+
type FieldPatch<T> = {
|
|
105
|
+
readonly [K in keyof T]?: T[K] | null;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* A field-level change set. `null` removes a field (falling back to the
|
|
109
|
+
* inherited/default behavior); omitted fields are left untouched. Saving a
|
|
110
|
+
* patch rather than a whole document lets a conflicting concurrent edit be
|
|
111
|
+
* merged by re-applying the patch on top of the newer file.
|
|
112
|
+
*/
|
|
113
|
+
interface WorkspaceSettingsPatch {
|
|
114
|
+
readonly documents?: FieldPatch<WorkspaceDocumentSettings>;
|
|
115
|
+
readonly versionHistory?: FieldPatch<WorkspaceVersionHistorySettings>;
|
|
116
|
+
readonly catalog?: FieldPatch<Omit<WorkspaceCatalogSettings, 'html' | 'json'>> & {
|
|
117
|
+
readonly html?: FieldPatch<WorkspaceCatalogHtmlSettings>;
|
|
118
|
+
readonly json?: FieldPatch<WorkspaceCatalogJsonSettings>;
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
/** Apply a patch and re-validate the result. Throws a shape error on invalid output. */
|
|
122
|
+
declare function applyWorkspaceSettingsPatch(base: WorkspaceSettings | null, patch: WorkspaceSettingsPatch): WorkspaceSettings;
|
|
123
|
+
/** Field-level difference from `before` to `after`, suitable for {@link applyWorkspaceSettingsPatch}. */
|
|
124
|
+
declare function diffWorkspaceSettings(before: WorkspaceSettings | null, after: WorkspaceSettings): WorkspaceSettingsPatch;
|
|
125
|
+
declare function isEmptyWorkspaceSettingsPatch(patch: WorkspaceSettingsPatch): boolean;
|
|
126
|
+
/** Exact-shape parser for patches received over a wire boundary (VS Code postMessage). */
|
|
127
|
+
declare function parseWorkspaceSettingsPatch(value: unknown): WorkspaceSettingsPatch;
|
|
128
|
+
/** Try-form of {@link applyWorkspaceSettingsPatch} for UI validation. */
|
|
129
|
+
declare function tryApplyWorkspaceSettingsPatch(base: WorkspaceSettings | null, patch: WorkspaceSettingsPatch): {
|
|
130
|
+
ok: true;
|
|
131
|
+
settings: WorkspaceSettings;
|
|
132
|
+
} | {
|
|
133
|
+
ok: false;
|
|
134
|
+
message: string;
|
|
135
|
+
};
|
|
136
|
+
/**
|
|
137
|
+
* True when settings change nothing about how DocBlocks treats the folder: no
|
|
138
|
+
* default theme, no version-history choice, and no catalog output turned on.
|
|
139
|
+
* Fields that only configure a disabled output (a catalog title, path, order,
|
|
140
|
+
* or page theme) are inert. Such settings are never worth creating a
|
|
141
|
+
* `.docblocks/` folder for.
|
|
142
|
+
*/
|
|
143
|
+
declare function isDefaultWorkspaceSettings(settings: WorkspaceSettings | null | undefined): boolean;
|
|
144
|
+
/** The workspace default theme, or undefined to use the built-in default. */
|
|
145
|
+
declare function resolveWorkspaceDefaultThemeId(settings: WorkspaceSettings | null | undefined): string | undefined;
|
|
146
|
+
/**
|
|
147
|
+
* The theme a renderer should be told about explicitly. Every Squisq
|
|
148
|
+
* exporter lets an explicit theme beat the document's own frontmatter, so a
|
|
149
|
+
* workspace default may only be passed when the document names no theme.
|
|
150
|
+
*/
|
|
151
|
+
declare function resolveFallbackThemeId(frontmatterThemeId: string | undefined, settings: WorkspaceSettings | null | undefined): string | undefined;
|
|
152
|
+
/** `true`/`false` when the workspace decides, `undefined` to inherit. */
|
|
153
|
+
declare function resolveWorkspaceVersioningEnabled(settings: WorkspaceSettings | null | undefined): boolean | undefined;
|
|
154
|
+
interface ResolvedCatalogOutputs {
|
|
155
|
+
readonly title: string;
|
|
156
|
+
readonly sort: CatalogSortOrder;
|
|
157
|
+
readonly exclude: readonly string[];
|
|
158
|
+
readonly html: {
|
|
159
|
+
readonly path: WorkspacePath;
|
|
160
|
+
readonly themeId: string | undefined;
|
|
161
|
+
} | null;
|
|
162
|
+
readonly json: {
|
|
163
|
+
readonly path: WorkspacePath;
|
|
164
|
+
readonly content: CatalogJsonContent;
|
|
165
|
+
} | null;
|
|
166
|
+
}
|
|
167
|
+
/** Effective catalog configuration, or null when no output is enabled. */
|
|
168
|
+
declare function resolveCatalogOutputs(settings: WorkspaceSettings | null | undefined): ResolvedCatalogOutputs | null;
|
|
169
|
+
|
|
170
|
+
export { resolveCatalogOutputs as A, resolveFallbackThemeId as B, type CatalogSortOrder as C, DEFAULT_CATALOG_HTML_PATH as D, EMPTY_WORKSPACE_SETTINGS as E, resolveWorkspaceDefaultThemeId as F, resolveWorkspaceVersioningEnabled as G, serializeWorkspaceSettings as H, tryApplyWorkspaceSettingsPatch as I, validateCatalogOutputPath as J, type ResolvedCatalogOutputs as R, UnsupportedWorkspaceSettingsVersionError as U, type WorkspaceSettings as W, type WorkspaceSettingsPatch as a, CATALOG_JSON_CONTENT_MODES as b, CATALOG_SORT_ORDERS as c, type CatalogJsonContent as d, type CatalogOutputKind as e, DEFAULT_CATALOG_JSON_PATH as f, DEFAULT_CATALOG_TITLE as g, WORKSPACE_SETTINGS_DIRECTORY as h, WORKSPACE_SETTINGS_LIMITS as i, WORKSPACE_SETTINGS_PATH as j, WORKSPACE_SETTINGS_VERSION as k, WORKSPACE_THEME_ID_PATTERN as l, type WorkspaceCatalogHtmlSettings as m, type WorkspaceCatalogJsonSettings as n, type WorkspaceCatalogSettings as o, type WorkspaceDocumentSettings as p, type WorkspaceSettingsParseResult as q, type WorkspaceVersionHistorySettings as r, applyWorkspaceSettingsPatch as s, checkCatalogOutputPath as t, diffWorkspaceSettings as u, isDefaultWorkspaceSettings as v, isEmptyWorkspaceSettingsPatch as w, parseWorkspaceSettings as x, parseWorkspaceSettingsPatch as y, parseWorkspaceSettingsText as z };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { n as FileSystemProviderV2 } from './v2-BVnZZyd4.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* FileSystemProvider — abstract interface for a virtual filesystem.
|
|
5
|
+
*
|
|
6
|
+
* Legacy text-oriented facade retained while consumers migrate to
|
|
7
|
+
* FileSystemProviderV2. New persistence code must use the provider's `v2`
|
|
8
|
+
* contract so paths, errors, operation modes, and capabilities are explicit.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
interface FileEntry {
|
|
12
|
+
kind: 'file';
|
|
13
|
+
name: string;
|
|
14
|
+
path: string;
|
|
15
|
+
/** ISO-8601 timestamp when the provider can supply file metadata while listing. */
|
|
16
|
+
lastModified?: string;
|
|
17
|
+
}
|
|
18
|
+
interface FolderEntry {
|
|
19
|
+
kind: 'directory';
|
|
20
|
+
name: string;
|
|
21
|
+
path: string;
|
|
22
|
+
}
|
|
23
|
+
type FileSystemEntry = FileEntry | FolderEntry;
|
|
24
|
+
interface FileMeta {
|
|
25
|
+
name: string;
|
|
26
|
+
path: string;
|
|
27
|
+
size: number;
|
|
28
|
+
lastModified: string;
|
|
29
|
+
}
|
|
30
|
+
type FileCommitResult = {
|
|
31
|
+
status: 'committed';
|
|
32
|
+
version: string | null;
|
|
33
|
+
} | {
|
|
34
|
+
status: 'conflict';
|
|
35
|
+
content: string | null;
|
|
36
|
+
version: string | null;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated Compatibility facade for external providers and older callers.
|
|
40
|
+
* Implement new backends with `FileSystemProviderV2`; built-in facades expose
|
|
41
|
+
* their authoritative implementation through `v2`.
|
|
42
|
+
*/
|
|
43
|
+
interface FileSystemProvider {
|
|
44
|
+
/** Unique identifier for this provider instance. */
|
|
45
|
+
readonly id: string;
|
|
46
|
+
/** Human-readable label (e.g., folder name or "Browser Storage"). */
|
|
47
|
+
readonly label: string;
|
|
48
|
+
/** Optional correctness-first implementation exposed during the v1-to-v2 migration. */
|
|
49
|
+
readonly v2?: FileSystemProviderV2;
|
|
50
|
+
/** Read the text content of a file. Returns null if the file doesn't exist. */
|
|
51
|
+
readFile(path: string): Promise<string | null>;
|
|
52
|
+
/** Write text content to a file, creating it (and parent dirs) if needed. */
|
|
53
|
+
writeFile(path: string, content: string): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Conditionally replace a text file when it still matches the caller's
|
|
56
|
+
* persisted baseline. Production providers implement this at their
|
|
57
|
+
* strongest available serialization boundary.
|
|
58
|
+
*/
|
|
59
|
+
commitFile?(path: string, content: string, expectedContent: string | null): Promise<FileCommitResult>;
|
|
60
|
+
/**
|
|
61
|
+
* Legacy recursive removal of a file or directory subtree. Workspace root
|
|
62
|
+
* deletion is forbidden. Prefer v2 `remove({ recursive })`.
|
|
63
|
+
*/
|
|
64
|
+
delete(path: string): Promise<void>;
|
|
65
|
+
/** Rename or move an entry. Rejects missing sources and existing destinations. */
|
|
66
|
+
rename(oldPath: string, newPath: string): Promise<void>;
|
|
67
|
+
/** List immediate children of a directory. */
|
|
68
|
+
readDirectory(path: string): Promise<FileSystemEntry[]>;
|
|
69
|
+
/** Check whether a path exists. */
|
|
70
|
+
exists(path: string): Promise<boolean>;
|
|
71
|
+
/** Create a directory (and parents if needed). */
|
|
72
|
+
createDirectory(path: string): Promise<void>;
|
|
73
|
+
/** Get metadata for a file. Returns null if not found. */
|
|
74
|
+
stat(path: string): Promise<FileMeta | null>;
|
|
75
|
+
/** Read raw binary content. Returns null if not found. */
|
|
76
|
+
readBinary(path: string): Promise<ArrayBuffer | null>;
|
|
77
|
+
/** Write raw binary content. */
|
|
78
|
+
writeBinary(path: string, data: ArrayBuffer | Uint8Array): Promise<void>;
|
|
79
|
+
}
|
|
80
|
+
type FileSystemProviderWithV2 = FileSystemProvider & {
|
|
81
|
+
readonly v2: FileSystemProviderV2;
|
|
82
|
+
};
|
|
83
|
+
/** Discover a provider-owned v2 implementation without coupling consumers to a concrete class. */
|
|
84
|
+
declare function hasFileSystemProviderV2(provider: FileSystemProvider): provider is FileSystemProviderWithV2;
|
|
85
|
+
/** Return the provider-owned v2 implementation when migration support is available. */
|
|
86
|
+
declare function getFileSystemProviderV2(provider: FileSystemProvider): FileSystemProviderV2 | null;
|
|
87
|
+
|
|
88
|
+
export { type FileCommitResult as F, type FileEntry as a, type FileMeta as b, type FileSystemEntry as c, type FileSystemProvider as d, type FileSystemProviderWithV2 as e, type FolderEntry as f, getFileSystemProviderV2 as g, hasFileSystemProviderV2 as h };
|
|
@@ -402,6 +402,12 @@ interface TemplateContentProfile {
|
|
|
402
402
|
readonly hasDate: boolean;
|
|
403
403
|
readonly hasNumberHighlight: boolean;
|
|
404
404
|
readonly wordCount: number;
|
|
405
|
+
/**
|
|
406
|
+
* A structural body node (list, table, quote, fence) has top-level siblings.
|
|
407
|
+
* Specialized templates consume one structure, so Squisq recommends only the
|
|
408
|
+
* complete-body `content` template for such a block; this flag is why.
|
|
409
|
+
*/
|
|
410
|
+
readonly hasCompoundBody: boolean;
|
|
405
411
|
readonly hasAsciiDiagram: boolean;
|
|
406
412
|
readonly hasTimeline: boolean;
|
|
407
413
|
readonly hasTree: boolean;
|
|
@@ -215,89 +215,4 @@ interface FileSystemProviderV2 {
|
|
|
215
215
|
dispose(): Promise<void>;
|
|
216
216
|
}
|
|
217
217
|
|
|
218
|
-
|
|
219
|
-
* FileSystemProvider — abstract interface for a virtual filesystem.
|
|
220
|
-
*
|
|
221
|
-
* Legacy text-oriented facade retained while consumers migrate to
|
|
222
|
-
* FileSystemProviderV2. New persistence code must use the provider's `v2`
|
|
223
|
-
* contract so paths, errors, operation modes, and capabilities are explicit.
|
|
224
|
-
*/
|
|
225
|
-
|
|
226
|
-
interface FileEntry {
|
|
227
|
-
kind: 'file';
|
|
228
|
-
name: string;
|
|
229
|
-
path: string;
|
|
230
|
-
/** ISO-8601 timestamp when the provider can supply file metadata while listing. */
|
|
231
|
-
lastModified?: string;
|
|
232
|
-
}
|
|
233
|
-
interface FolderEntry {
|
|
234
|
-
kind: 'directory';
|
|
235
|
-
name: string;
|
|
236
|
-
path: string;
|
|
237
|
-
}
|
|
238
|
-
type FileSystemEntry = FileEntry | FolderEntry;
|
|
239
|
-
interface FileMeta {
|
|
240
|
-
name: string;
|
|
241
|
-
path: string;
|
|
242
|
-
size: number;
|
|
243
|
-
lastModified: string;
|
|
244
|
-
}
|
|
245
|
-
type FileCommitResult = {
|
|
246
|
-
status: 'committed';
|
|
247
|
-
version: string | null;
|
|
248
|
-
} | {
|
|
249
|
-
status: 'conflict';
|
|
250
|
-
content: string | null;
|
|
251
|
-
version: string | null;
|
|
252
|
-
};
|
|
253
|
-
/**
|
|
254
|
-
* @deprecated Compatibility facade for external providers and older callers.
|
|
255
|
-
* Implement new backends with `FileSystemProviderV2`; built-in facades expose
|
|
256
|
-
* their authoritative implementation through `v2`.
|
|
257
|
-
*/
|
|
258
|
-
interface FileSystemProvider {
|
|
259
|
-
/** Unique identifier for this provider instance. */
|
|
260
|
-
readonly id: string;
|
|
261
|
-
/** Human-readable label (e.g., folder name or "Browser Storage"). */
|
|
262
|
-
readonly label: string;
|
|
263
|
-
/** Optional correctness-first implementation exposed during the v1-to-v2 migration. */
|
|
264
|
-
readonly v2?: FileSystemProviderV2;
|
|
265
|
-
/** Read the text content of a file. Returns null if the file doesn't exist. */
|
|
266
|
-
readFile(path: string): Promise<string | null>;
|
|
267
|
-
/** Write text content to a file, creating it (and parent dirs) if needed. */
|
|
268
|
-
writeFile(path: string, content: string): Promise<void>;
|
|
269
|
-
/**
|
|
270
|
-
* Conditionally replace a text file when it still matches the caller's
|
|
271
|
-
* persisted baseline. Production providers implement this at their
|
|
272
|
-
* strongest available serialization boundary.
|
|
273
|
-
*/
|
|
274
|
-
commitFile?(path: string, content: string, expectedContent: string | null): Promise<FileCommitResult>;
|
|
275
|
-
/**
|
|
276
|
-
* Legacy recursive removal of a file or directory subtree. Workspace root
|
|
277
|
-
* deletion is forbidden. Prefer v2 `remove({ recursive })`.
|
|
278
|
-
*/
|
|
279
|
-
delete(path: string): Promise<void>;
|
|
280
|
-
/** Rename or move an entry. Rejects missing sources and existing destinations. */
|
|
281
|
-
rename(oldPath: string, newPath: string): Promise<void>;
|
|
282
|
-
/** List immediate children of a directory. */
|
|
283
|
-
readDirectory(path: string): Promise<FileSystemEntry[]>;
|
|
284
|
-
/** Check whether a path exists. */
|
|
285
|
-
exists(path: string): Promise<boolean>;
|
|
286
|
-
/** Create a directory (and parents if needed). */
|
|
287
|
-
createDirectory(path: string): Promise<void>;
|
|
288
|
-
/** Get metadata for a file. Returns null if not found. */
|
|
289
|
-
stat(path: string): Promise<FileMeta | null>;
|
|
290
|
-
/** Read raw binary content. Returns null if not found. */
|
|
291
|
-
readBinary(path: string): Promise<ArrayBuffer | null>;
|
|
292
|
-
/** Write raw binary content. */
|
|
293
|
-
writeBinary(path: string, data: ArrayBuffer | Uint8Array): Promise<void>;
|
|
294
|
-
}
|
|
295
|
-
type FileSystemProviderWithV2 = FileSystemProvider & {
|
|
296
|
-
readonly v2: FileSystemProviderV2;
|
|
297
|
-
};
|
|
298
|
-
/** Discover a provider-owned v2 implementation without coupling consumers to a concrete class. */
|
|
299
|
-
declare function hasFileSystemProviderV2(provider: FileSystemProvider): provider is FileSystemProviderWithV2;
|
|
300
|
-
/** Return the provider-owned v2 implementation when migration support is available. */
|
|
301
|
-
declare function getFileSystemProviderV2(provider: FileSystemProvider): FileSystemProviderV2 | null;
|
|
302
|
-
|
|
303
|
-
export { tryParseFileSystemVersion as $, type FileSystemVersion as A, type FileSystemWatchErrorListener as B, type FileSystemWatchEvent as C, type FileSystemWatchEventOrigin as D, type FileSystemWatchEventType as E, type FileCommitResult as F, type FileSystemWatchListener as G, type FileSystemWatchOptions as H, type FileSystemWatchSubscription as I, type FileSystemWriteMode as J, type FileSystemWriteOptions as K, type FolderEntry as L, FsError as M, type FsErrorCode as N, type FsErrorContext as O, type FsOperation as P, deserializeFsError as Q, fsErrorFromUnknown as R, type SerializedFsError as S, getFileSystemProviderV2 as T, hasFileSystemProviderV2 as U, isQuotaExceededError as V, isSerializedFsError as W, mapDomExceptionToFsErrorCode as X, mapNodeErrorCodeToFsErrorCode as Y, parseFileSystemVersion as Z, serializeFsError as _, type FileEntry as a, type FileMeta as b, type FileSystemAtomicity as c, type FileSystemCaseSensitivity as d, type FileSystemConditionalWriteStrength as e, type FileSystemCreateDirectoryMode as f, type FileSystemCreateDirectoryOptions as g, type FileSystemDirectorySnapshot as h, type FileSystemDurability as i, type FileSystemEntry as j, type FileSystemEntrySnapshot as k, type FileSystemEntryWatchEvent as l, type FileSystemFileRead as m, type FileSystemFileSnapshot as n, type FileSystemMoveOptions as o, type FileSystemOverflowWatchEvent as p, type FileSystemProvider as q, type FileSystemProviderCapabilities as r, type FileSystemProviderV2 as s, type FileSystemProviderWithV2 as t, type FileSystemRemoveOptions as u, type FileSystemRemoveResult as v, type FileSystemSnapshot as w, type FileSystemSnapshotEntry as x, type FileSystemSnapshotFile as y, type FileSystemSymlinkPolicy as z };
|
|
218
|
+
export { type FileSystemWatchOptions as A, type FileSystemWatchSubscription as B, type FileSystemWriteMode as C, type FileSystemWriteOptions as D, FsError as E, type FileSystemAtomicity as F, type FsErrorCode as G, type FsErrorContext as H, type FsOperation as I, deserializeFsError as J, fsErrorFromUnknown as K, isQuotaExceededError as L, isSerializedFsError as M, mapDomExceptionToFsErrorCode as N, mapNodeErrorCodeToFsErrorCode as O, parseFileSystemVersion as P, serializeFsError as Q, tryParseFileSystemVersion as R, type SerializedFsError as S, type FileSystemCaseSensitivity as a, type FileSystemConditionalWriteStrength as b, type FileSystemCreateDirectoryMode as c, type FileSystemCreateDirectoryOptions as d, type FileSystemDirectorySnapshot as e, type FileSystemDurability as f, type FileSystemEntrySnapshot as g, type FileSystemEntryWatchEvent as h, type FileSystemFileRead as i, type FileSystemFileSnapshot as j, type FileSystemMoveOptions as k, type FileSystemOverflowWatchEvent as l, type FileSystemProviderCapabilities as m, type FileSystemProviderV2 as n, type FileSystemRemoveOptions as o, type FileSystemRemoveResult as p, type FileSystemSnapshot as q, type FileSystemSnapshotEntry as r, type FileSystemSnapshotFile as s, type FileSystemSymlinkPolicy as t, type FileSystemVersion as u, type FileSystemWatchErrorListener as v, type FileSystemWatchEvent as w, type FileSystemWatchEventOrigin as x, type FileSystemWatchEventType as y, type FileSystemWatchListener as z };
|
package/dist/vscode/index.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import { W as WorkspaceSettings, a as WorkspaceSettingsPatch } from '../settings-HrrCikVX.js';
|
|
2
|
+
import '../workspace-path-CWVrcuPL.js';
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* Typed message protocol between the extension host and webview.
|
|
3
6
|
*/
|
|
7
|
+
|
|
4
8
|
/**
|
|
5
9
|
* Bounds for host-persisted proofing state.
|
|
6
10
|
*
|
|
@@ -69,6 +73,28 @@ interface VscodeEditorSettings {
|
|
|
69
73
|
writeCanvasSettings: VscodeWriteCanvasSettings;
|
|
70
74
|
proofingSettings: VscodeProofingSettings;
|
|
71
75
|
}
|
|
76
|
+
declare const VSCODE_WORKSPACE_SETTINGS_STATUSES: readonly ["unavailable", "loading", "missing", "ready", "invalid", "unsupported-version", "error"];
|
|
77
|
+
type VscodeWorkspaceSettingsStatus = (typeof VSCODE_WORKSPACE_SETTINGS_STATUSES)[number];
|
|
78
|
+
declare const VSCODE_CATALOG_STATES: readonly ["idle", "pending", "running", "done", "error"];
|
|
79
|
+
type VscodeCatalogState = (typeof VSCODE_CATALOG_STATES)[number];
|
|
80
|
+
/**
|
|
81
|
+
* The `.docblocks/workspace.json` of the folder containing this panel's
|
|
82
|
+
* document, as the extension host sees it. `settings` is null unless the
|
|
83
|
+
* file is missing (defaults apply) or valid; `writable` is false for
|
|
84
|
+
* untrusted workspaces, read-only file systems, and files DocBlocks cannot
|
|
85
|
+
* safely rewrite (invalid or newer).
|
|
86
|
+
*/
|
|
87
|
+
interface VscodeWorkspaceSettingsState {
|
|
88
|
+
status: VscodeWorkspaceSettingsStatus;
|
|
89
|
+
settings: WorkspaceSettings | null;
|
|
90
|
+
writable: boolean;
|
|
91
|
+
message: string | null;
|
|
92
|
+
catalog: {
|
|
93
|
+
state: VscodeCatalogState;
|
|
94
|
+
message: string | null;
|
|
95
|
+
documentCount: number | null;
|
|
96
|
+
};
|
|
97
|
+
}
|
|
72
98
|
/**
|
|
73
99
|
* An opaque, one-shot authority to write one host-owned export target.
|
|
74
100
|
* The label is presentation-only and must never be interpreted as a path.
|
|
@@ -118,6 +144,14 @@ type ExtensionToWebviewMessage = {
|
|
|
118
144
|
} | {
|
|
119
145
|
type: 'editorSettings';
|
|
120
146
|
settings: VscodeEditorSettings;
|
|
147
|
+
} | {
|
|
148
|
+
type: 'workspaceSettings';
|
|
149
|
+
state: VscodeWorkspaceSettingsState;
|
|
150
|
+
} | {
|
|
151
|
+
type: 'workspaceSettingsResult';
|
|
152
|
+
requestId: number;
|
|
153
|
+
ok: boolean;
|
|
154
|
+
message: string | null;
|
|
121
155
|
} | {
|
|
122
156
|
type: 'codeCopied';
|
|
123
157
|
requestId: number;
|
|
@@ -270,6 +304,13 @@ type WebviewToExtensionMessage = {
|
|
|
270
304
|
} | {
|
|
271
305
|
type: 'saveProofIgnores';
|
|
272
306
|
ignoredJson: string;
|
|
307
|
+
} | {
|
|
308
|
+
type: 'updateWorkspaceSettings';
|
|
309
|
+
requestId: number;
|
|
310
|
+
patch: WorkspaceSettingsPatch;
|
|
311
|
+
} | {
|
|
312
|
+
type: 'refreshWorkspaceOutputs';
|
|
313
|
+
requestId: number;
|
|
273
314
|
};
|
|
274
315
|
interface MediaEntryMessage {
|
|
275
316
|
name: string;
|
|
@@ -289,6 +330,7 @@ declare function parseWebviewToExtensionMessage(value: unknown): WebviewToExtens
|
|
|
289
330
|
* runtime validation.
|
|
290
331
|
*/
|
|
291
332
|
declare function parseExtensionToWebviewMessage(value: unknown): ExtensionToWebviewMessage | null;
|
|
333
|
+
declare function parseVscodeWorkspaceSettingsState(value: unknown): VscodeWorkspaceSettingsState | null;
|
|
292
334
|
declare function isDocBlocksAccentColor(value: unknown): value is DocBlocksAccentColor;
|
|
293
335
|
declare function isDocBlocksWriteCanvasTextSize(value: unknown): value is number;
|
|
294
336
|
declare function isDocBlocksWriteCanvasLineSpacing(value: unknown): value is number;
|
|
@@ -306,4 +348,4 @@ declare function isSafeMimeType(value: unknown): value is string;
|
|
|
306
348
|
*/
|
|
307
349
|
declare function hasSubstantiveTextChange(baseline: string, candidate: string): boolean;
|
|
308
350
|
|
|
309
|
-
export { DEFAULT_VSCODE_PROOFING_SETTINGS, DEFAULT_VSCODE_WRITE_CANVAS_SETTINGS, DOCBLOCKS_ACCENT_COLORS, DOCBLOCKS_WRITE_CANVAS_FONT_SCHEMES, DOCBLOCKS_WRITE_CANVAS_LINE_SPACING_MAX, DOCBLOCKS_WRITE_CANVAS_LINE_SPACING_MIN, DOCBLOCKS_WRITE_CANVAS_TEXT_SIZE_MAX, DOCBLOCKS_WRITE_CANVAS_TEXT_SIZE_MIN, type DocBlocksAccentColor, type DocBlocksWriteCanvasFontScheme, type DocumentConflictChoice, type DocumentConflictDetailsMessage, type DocumentSessionMessageStatus, type ExportTargetGrantMessage, type ExtensionToWebviewMessage, type MediaEntryMessage, PROOF_STATE_LIMITS, type VscodeEditorSettings, type VscodeProofingSettings, type VscodeWriteCanvasSettings, type WebviewToExtensionMessage, hasSubstantiveTextChange, isDocBlocksAccentColor, isDocBlocksWriteCanvasFontScheme, isDocBlocksWriteCanvasLineSpacing, isDocBlocksWriteCanvasTextSize, isSafeExportFilename, isSafeMimeType, parseExtensionToWebviewMessage, parseWebviewToExtensionMessage };
|
|
351
|
+
export { DEFAULT_VSCODE_PROOFING_SETTINGS, DEFAULT_VSCODE_WRITE_CANVAS_SETTINGS, DOCBLOCKS_ACCENT_COLORS, DOCBLOCKS_WRITE_CANVAS_FONT_SCHEMES, DOCBLOCKS_WRITE_CANVAS_LINE_SPACING_MAX, DOCBLOCKS_WRITE_CANVAS_LINE_SPACING_MIN, DOCBLOCKS_WRITE_CANVAS_TEXT_SIZE_MAX, DOCBLOCKS_WRITE_CANVAS_TEXT_SIZE_MIN, type DocBlocksAccentColor, type DocBlocksWriteCanvasFontScheme, type DocumentConflictChoice, type DocumentConflictDetailsMessage, type DocumentSessionMessageStatus, type ExportTargetGrantMessage, type ExtensionToWebviewMessage, type MediaEntryMessage, PROOF_STATE_LIMITS, VSCODE_CATALOG_STATES, VSCODE_WORKSPACE_SETTINGS_STATUSES, type VscodeCatalogState, type VscodeEditorSettings, type VscodeProofingSettings, type VscodeWorkspaceSettingsState, type VscodeWorkspaceSettingsStatus, type VscodeWriteCanvasSettings, type WebviewToExtensionMessage, hasSubstantiveTextChange, isDocBlocksAccentColor, isDocBlocksWriteCanvasFontScheme, isDocBlocksWriteCanvasLineSpacing, isDocBlocksWriteCanvasTextSize, isSafeExportFilename, isSafeMimeType, parseExtensionToWebviewMessage, parseVscodeWorkspaceSettingsState, parseWebviewToExtensionMessage };
|
package/dist/vscode/index.js
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
parseWorkspaceSettings,
|
|
3
|
+
parseWorkspaceSettingsPatch
|
|
4
|
+
} from "../chunk-UK7R3RC7.js";
|
|
1
5
|
import {
|
|
2
6
|
HOST_WIRE_LIMITS,
|
|
3
7
|
isBoundedString
|
|
4
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-46AGYHDY.js";
|
|
9
|
+
import "../chunk-AYWKIZLD.js";
|
|
5
10
|
|
|
6
11
|
// src/vscode/messages.ts
|
|
7
12
|
var MAX_REQUEST_ID = 2147483647;
|
|
@@ -44,6 +49,16 @@ var DEFAULT_VSCODE_PROOFING_SETTINGS = {
|
|
|
44
49
|
spelling: true,
|
|
45
50
|
grammar: true
|
|
46
51
|
};
|
|
52
|
+
var VSCODE_WORKSPACE_SETTINGS_STATUSES = [
|
|
53
|
+
"unavailable",
|
|
54
|
+
"loading",
|
|
55
|
+
"missing",
|
|
56
|
+
"ready",
|
|
57
|
+
"invalid",
|
|
58
|
+
"unsupported-version",
|
|
59
|
+
"error"
|
|
60
|
+
];
|
|
61
|
+
var VSCODE_CATALOG_STATES = ["idle", "pending", "running", "done", "error"];
|
|
47
62
|
function parseWebviewToExtensionMessage(value) {
|
|
48
63
|
if (!isRecord(value) || typeof value.type !== "string") return null;
|
|
49
64
|
switch (value.type) {
|
|
@@ -147,6 +162,13 @@ function parseWebviewToExtensionMessage(value) {
|
|
|
147
162
|
return hasOnlyKeys(value, ["type", "word"]) && hasBoundedString(value, "word", PROOF_STATE_LIMITS.wordCharacters, 1) ? { type: "addProofDictionaryWord", word: value.word } : null;
|
|
148
163
|
case "saveProofIgnores":
|
|
149
164
|
return hasOnlyKeys(value, ["type", "ignoredJson"]) && hasBoundedString(value, "ignoredJson", PROOF_STATE_LIMITS.ignoredJsonCharacters) ? { type: "saveProofIgnores", ignoredJson: value.ignoredJson } : null;
|
|
165
|
+
case "updateWorkspaceSettings": {
|
|
166
|
+
if (!hasOnlyKeys(value, ["type", "requestId", "patch"]) || !hasRequestId(value)) return null;
|
|
167
|
+
const patch = tryParse(() => parseWorkspaceSettingsPatch(value.patch));
|
|
168
|
+
return patch ? { type: "updateWorkspaceSettings", requestId: value.requestId, patch } : null;
|
|
169
|
+
}
|
|
170
|
+
case "refreshWorkspaceOutputs":
|
|
171
|
+
return hasOnlyKeys(value, ["type", "requestId"]) && hasRequestId(value) ? { type: "refreshWorkspaceOutputs", requestId: value.requestId } : null;
|
|
150
172
|
default:
|
|
151
173
|
return null;
|
|
152
174
|
}
|
|
@@ -289,10 +311,51 @@ function parseExtensionToWebviewMessage(value) {
|
|
|
289
311
|
}
|
|
290
312
|
case "workspaceFileRead":
|
|
291
313
|
return hasOnlyKeys(value, ["type", "requestId", "dataBase64"]) && hasRequestId(value) && hasNullableBoundedString(value, "dataBase64", HOST_WIRE_LIMITS.base64Characters) ? { type: "workspaceFileRead", requestId: value.requestId, dataBase64: value.dataBase64 } : null;
|
|
314
|
+
case "workspaceSettings": {
|
|
315
|
+
if (!hasOnlyKeys(value, ["type", "state"])) return null;
|
|
316
|
+
const state = parseVscodeWorkspaceSettingsState(value.state);
|
|
317
|
+
return state ? { type: "workspaceSettings", state } : null;
|
|
318
|
+
}
|
|
319
|
+
case "workspaceSettingsResult":
|
|
320
|
+
return hasOnlyKeys(value, ["type", "requestId", "ok", "message"]) && hasRequestId(value) && typeof value.ok === "boolean" && hasNullableBoundedString(value, "message", HOST_WIRE_LIMITS.messageCharacters) ? {
|
|
321
|
+
type: "workspaceSettingsResult",
|
|
322
|
+
requestId: value.requestId,
|
|
323
|
+
ok: value.ok,
|
|
324
|
+
message: value.message
|
|
325
|
+
} : null;
|
|
292
326
|
default:
|
|
293
327
|
return null;
|
|
294
328
|
}
|
|
295
329
|
}
|
|
330
|
+
function tryParse(parse) {
|
|
331
|
+
try {
|
|
332
|
+
return parse();
|
|
333
|
+
} catch {
|
|
334
|
+
return null;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
function parseVscodeWorkspaceSettingsState(value) {
|
|
338
|
+
if (!isRecord(value) || !hasOnlyKeys(value, ["status", "settings", "writable", "message", "catalog"]) || !VSCODE_WORKSPACE_SETTINGS_STATUSES.some((status) => status === value.status) || typeof value.writable !== "boolean" || !hasNullableBoundedString(value, "message", HOST_WIRE_LIMITS.messageCharacters)) {
|
|
339
|
+
return null;
|
|
340
|
+
}
|
|
341
|
+
const settings = value.settings === null ? null : tryParse(() => parseWorkspaceSettings(value.settings));
|
|
342
|
+
if (value.settings !== null && settings === null) return null;
|
|
343
|
+
const catalog = value.catalog;
|
|
344
|
+
if (!isRecord(catalog) || !hasOnlyKeys(catalog, ["state", "message", "documentCount"]) || !VSCODE_CATALOG_STATES.some((state) => state === catalog.state) || !hasNullableBoundedString(catalog, "message", HOST_WIRE_LIMITS.messageCharacters) || !isNullableNonNegativeInteger(catalog.documentCount)) {
|
|
345
|
+
return null;
|
|
346
|
+
}
|
|
347
|
+
return {
|
|
348
|
+
status: value.status,
|
|
349
|
+
settings,
|
|
350
|
+
writable: value.writable,
|
|
351
|
+
message: value.message,
|
|
352
|
+
catalog: {
|
|
353
|
+
state: catalog.state,
|
|
354
|
+
message: catalog.message,
|
|
355
|
+
documentCount: catalog.documentCount
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
}
|
|
296
359
|
function parseProofDictionaryWords(value) {
|
|
297
360
|
if (!Array.isArray(value) || value.length > PROOF_STATE_LIMITS.dictionaryWords) return null;
|
|
298
361
|
const words = [];
|
|
@@ -477,6 +540,8 @@ export {
|
|
|
477
540
|
DOCBLOCKS_WRITE_CANVAS_TEXT_SIZE_MAX,
|
|
478
541
|
DOCBLOCKS_WRITE_CANVAS_TEXT_SIZE_MIN,
|
|
479
542
|
PROOF_STATE_LIMITS,
|
|
543
|
+
VSCODE_CATALOG_STATES,
|
|
544
|
+
VSCODE_WORKSPACE_SETTINGS_STATUSES,
|
|
480
545
|
hasSubstantiveTextChange,
|
|
481
546
|
isDocBlocksAccentColor,
|
|
482
547
|
isDocBlocksWriteCanvasFontScheme,
|
|
@@ -485,5 +550,6 @@ export {
|
|
|
485
550
|
isSafeExportFilename,
|
|
486
551
|
isSafeMimeType,
|
|
487
552
|
parseExtensionToWebviewMessage,
|
|
553
|
+
parseVscodeWorkspaceSettingsState,
|
|
488
554
|
parseWebviewToExtensionMessage
|
|
489
555
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { d as FileSystemProvider } from '../types-BvDnr3YU.js';
|
|
2
|
+
import { Y as ElectronWorkspaceInfo, ai as HostEnvironment } from '../capabilities-CdQAc745.js';
|
|
3
|
+
import '../v2-BVnZZyd4.js';
|
|
3
4
|
import '../workspace-path-CWVrcuPL.js';
|
|
5
|
+
import '../filesystem-v2-C8AdSXUN.js';
|
|
4
6
|
|
|
5
7
|
/**
|
|
6
8
|
* Origin of a transient workspace — records where its contents came from and
|
|
@@ -50,16 +52,16 @@ interface WorkspaceDescriptor {
|
|
|
50
52
|
* Provider kind:
|
|
51
53
|
* - 'indexeddb' — browser-local storage (web only)
|
|
52
54
|
* - 'native' — File System Access API (web Chrome/Edge only)
|
|
53
|
-
* - '
|
|
55
|
+
* - 'host-native' — Electron main-process native filesystem
|
|
54
56
|
* - 'transient' — session-only, in-memory (a loose file/`.dbk` opened from
|
|
55
57
|
* the OS, or a document copied from a shared URL). Never persisted; its
|
|
56
58
|
* provider lives in an in-memory registry (see workspace-manager). An
|
|
57
59
|
* `origin` is present only when changes can be saved back externally.
|
|
58
60
|
*/
|
|
59
|
-
type: 'indexeddb' | 'native' | '
|
|
61
|
+
type: 'indexeddb' | 'native' | 'host-native' | 'transient';
|
|
60
62
|
/** ISO timestamp of last access. */
|
|
61
63
|
lastOpened: string;
|
|
62
|
-
/** Absolute filesystem path for '
|
|
64
|
+
/** Absolute filesystem path for 'host-native' workspaces. */
|
|
63
65
|
rootPath?: string;
|
|
64
66
|
/** For 'transient' workspaces: where the contents came from / save back to. */
|
|
65
67
|
origin?: TransientOrigin;
|
|
@@ -83,6 +85,8 @@ declare function parsePersistedWorkspaceList(value: unknown): WorkspaceDescripto
|
|
|
83
85
|
* (since native providers need a DirectoryHandle from user interaction).
|
|
84
86
|
*/
|
|
85
87
|
|
|
88
|
+
/** Id of the browser-local workspace `ensureDefaultWorkspace` creates. */
|
|
89
|
+
declare const DEFAULT_WORKSPACE_ID = "default";
|
|
86
90
|
/** Register a transient workspace and its (already-built) provider. */
|
|
87
91
|
declare function registerTransientWorkspace(descriptor: WorkspaceDescriptor, provider: FileSystemProvider): void;
|
|
88
92
|
/** Look up a transient workspace (descriptor + provider) by id, if any. */
|
|
@@ -138,4 +142,4 @@ interface ElectronWorkspaceReconciliation {
|
|
|
138
142
|
*/
|
|
139
143
|
declare function reconcileElectronWorkspaceDescriptors(local: readonly WorkspaceDescriptor[], hostWorkspaces: readonly ElectronWorkspaceInfo[], platform: HostEnvironment['platform'], now: string): ElectronWorkspaceReconciliation;
|
|
140
144
|
|
|
141
|
-
export { type ElectronWorkspaceReconciliation, type TransientOrigin, type WorkspaceDescriptor, ensureDefaultWorkspace, getTransientWorkspace, getWorkspace, listWorkspaces, parsePersistedWorkspaceList, reconcileElectronWorkspaceDescriptors, registerTransientWorkspace, removeWorkspace, saveWorkspace, touchWorkspace, unregisterTransientWorkspace };
|
|
145
|
+
export { DEFAULT_WORKSPACE_ID, type ElectronWorkspaceReconciliation, type TransientOrigin, type WorkspaceDescriptor, ensureDefaultWorkspace, getTransientWorkspace, getWorkspace, listWorkspaces, parsePersistedWorkspaceList, reconcileElectronWorkspaceDescriptors, registerTransientWorkspace, removeWorkspace, saveWorkspace, touchWorkspace, unregisterTransientWorkspace };
|
package/dist/workspace/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
DEFAULT_WORKSPACE_ID,
|
|
2
3
|
ensureDefaultWorkspace,
|
|
3
4
|
getTransientWorkspace,
|
|
4
5
|
getWorkspace,
|
|
@@ -10,10 +11,11 @@ import {
|
|
|
10
11
|
saveWorkspace,
|
|
11
12
|
touchWorkspace,
|
|
12
13
|
unregisterTransientWorkspace
|
|
13
|
-
} from "../chunk-
|
|
14
|
-
import "../chunk-
|
|
14
|
+
} from "../chunk-QS5WTLUZ.js";
|
|
15
|
+
import "../chunk-DAPFSEKY.js";
|
|
15
16
|
import "../chunk-XAMILHQP.js";
|
|
16
17
|
export {
|
|
18
|
+
DEFAULT_WORKSPACE_ID,
|
|
17
19
|
ensureDefaultWorkspace,
|
|
18
20
|
getTransientWorkspace,
|
|
19
21
|
getWorkspace,
|