@bendyline/docblocks 1.1.0 → 1.1.2
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/README.md +38 -12
- package/dist/{chunk-OGJN2J4P.js → chunk-IM7LCQJ6.js} +109 -34
- package/dist/chunk-IM7LCQJ6.js.map +1 -0
- package/dist/chunk-ME76RUMR.js +23 -0
- package/dist/{chunk-AOBPNSU6.js.map → chunk-ME76RUMR.js.map} +1 -1
- package/dist/filesystem/electron-provider.d.ts +1 -1
- package/dist/filesystem/electron-provider.js +4 -4
- package/dist/filesystem/filesystem-content-container.d.ts.map +1 -1
- package/dist/filesystem/filesystem-content-container.js +14 -1
- package/dist/filesystem/filesystem-content-container.js.map +1 -1
- package/dist/filesystem/indexeddb-provider.d.ts.map +1 -1
- package/dist/filesystem/indexeddb-provider.js +60 -18
- package/dist/filesystem/indexeddb-provider.js.map +1 -1
- package/dist/filesystem/native-provider.d.ts +1 -0
- package/dist/filesystem/native-provider.d.ts.map +1 -1
- package/dist/filesystem/native-provider.js +48 -14
- package/dist/filesystem/native-provider.js.map +1 -1
- package/dist/host/index.d.ts +5 -5
- package/dist/host/index.js +7 -7
- package/dist/host/types.d.ts +18 -18
- package/dist/host/types.d.ts.map +1 -1
- package/dist/host/types.js +2 -2
- package/dist/{index-TtDaQ3vS.d.ts → index-pgBHBQ9G.d.ts} +22 -22
- package/dist/workspace/types.d.ts +7 -0
- package/dist/workspace/types.d.ts.map +1 -1
- package/package.json +2 -7
- package/src/filesystem/electron-provider.ts +6 -6
- package/src/filesystem/filesystem-content-container.ts +12 -1
- package/src/filesystem/indexeddb-provider.ts +65 -19
- package/src/filesystem/native-provider.ts +49 -13
- package/src/host/index.ts +14 -14
- package/src/host/types.ts +18 -18
- package/src/workspace/types.ts +7 -0
- package/dist/chunk-AOBPNSU6.js +0 -23
- package/dist/chunk-OGJN2J4P.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @bendyline/docblocks
|
|
2
2
|
|
|
3
|
-
Core
|
|
3
|
+
Core types and abstractions for DocBlocks — the single source of truth for everything that crosses a process or storage boundary (filesystem providers, workspace management, and the Electron host contract).
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -10,16 +10,18 @@ npm install @bendyline/docblocks
|
|
|
10
10
|
|
|
11
11
|
## Exports
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Three subpath modules (also re-exported from the package root):
|
|
14
14
|
|
|
15
15
|
### Filesystem (`@bendyline/docblocks/filesystem`)
|
|
16
16
|
|
|
17
|
-
Pluggable filesystem abstraction
|
|
17
|
+
Pluggable filesystem abstraction — **the single seam for user-document storage**. UI code never touches `indexedDB`, `node:fs`, or `electron` directly; it goes through a provider.
|
|
18
18
|
|
|
19
|
-
- **`FileSystemProvider`** —
|
|
20
|
-
- **`IndexedDBFileSystemProvider`** —
|
|
21
|
-
- **`NativeFileSystemProvider`** —
|
|
22
|
-
- **`
|
|
19
|
+
- **`FileSystemProvider`** — the interface (`readFile`, `writeFile`, `readDirectory`, `delete`, `rename`, `createDirectory`, `stat`)
|
|
20
|
+
- **`IndexedDBFileSystemProvider`** — browser-local persistent storage (site, VS Code webview fallback)
|
|
21
|
+
- **`NativeFileSystemProvider`** — real folders in the browser via the File System Access API
|
|
22
|
+
- **`ElectronFileSystemProvider`** — bridges to the desktop main process over the host API
|
|
23
|
+
- **`IndexedDBContentContainer`** / **`FileSystemContentContainer`** — content-container layer for media alongside documents
|
|
24
|
+
- **`createFileMediaProvider`** — media provider wired to a filesystem provider
|
|
23
25
|
|
|
24
26
|
```ts
|
|
25
27
|
import { IndexedDBFileSystemProvider } from '@bendyline/docblocks/filesystem';
|
|
@@ -29,14 +31,16 @@ await fs.writeFile('/doc.md', '# Hello');
|
|
|
29
31
|
const content = await fs.readFile('/doc.md');
|
|
30
32
|
```
|
|
31
33
|
|
|
34
|
+
Adding a new storage backend means adding a new provider implementation — the rest of the app shouldn't need to change.
|
|
35
|
+
|
|
32
36
|
### Workspace (`@bendyline/docblocks/workspace`)
|
|
33
37
|
|
|
34
|
-
Workspace
|
|
38
|
+
Workspace registry — how DocBlocks tracks the document collections a user has opened.
|
|
35
39
|
|
|
36
|
-
- **`
|
|
37
|
-
- **`getWorkspace`** / **`saveWorkspace`** / **`removeWorkspace`** — CRUD
|
|
38
|
-
- **`touchWorkspace`** —
|
|
39
|
-
- **`ensureDefaultWorkspace`** —
|
|
40
|
+
- **`WorkspaceDescriptor`** — the workspace record type
|
|
41
|
+
- **`listWorkspaces`** / **`getWorkspace`** / **`saveWorkspace`** / **`removeWorkspace`** — registry CRUD
|
|
42
|
+
- **`touchWorkspace`** — update the last-opened timestamp
|
|
43
|
+
- **`ensureDefaultWorkspace`** — create a default workspace if none exist
|
|
40
44
|
|
|
41
45
|
```ts
|
|
42
46
|
import { listWorkspaces, ensureDefaultWorkspace } from '@bendyline/docblocks/workspace';
|
|
@@ -44,6 +48,28 @@ import { listWorkspaces, ensureDefaultWorkspace } from '@bendyline/docblocks/wor
|
|
|
44
48
|
const workspaces = await listWorkspaces();
|
|
45
49
|
```
|
|
46
50
|
|
|
51
|
+
### Host (`@bendyline/docblocks/host`)
|
|
52
|
+
|
|
53
|
+
The canonical contract for what the Electron desktop shell exposes to its renderer (`fs`, `workspaces`, `shell`, `ffmpeg`, `updater`, `menu`, open-file requests).
|
|
54
|
+
|
|
55
|
+
- **`DocBlocksHostAPI`** — the contract type (implemented by `desktop/main/ipc-*.ts`, exposed by `desktop/preload/preload.ts`)
|
|
56
|
+
- **`isElectronHost()`** — feature-detect the desktop shell
|
|
57
|
+
- **`getDocBlocksHost()`** — get the host API (throws outside Electron)
|
|
58
|
+
- **`maybeGetDocBlocksHost()`** — get the host API or `null`, for code that degrades gracefully in the browser
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
import { isElectronHost, maybeGetDocBlocksHost } from '@bendyline/docblocks/host';
|
|
62
|
+
|
|
63
|
+
const host = maybeGetDocBlocksHost();
|
|
64
|
+
if (host) {
|
|
65
|
+
await host.shell.revealInFolder(path);
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Conventions
|
|
70
|
+
|
|
71
|
+
Anything that crosses IPC, postMessage, HTTP, or MCP boundaries belongs in this package — surface packages must not define their own copies of wire types.
|
|
72
|
+
|
|
47
73
|
## License
|
|
48
74
|
|
|
49
75
|
MIT
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
maybeGetDocBlocksHost
|
|
3
|
+
} from "./chunk-ME76RUMR.js";
|
|
4
4
|
|
|
5
5
|
// src/filesystem/indexeddb-provider.ts
|
|
6
6
|
import { LocalForageAdapter } from "@bendyline/squisq/storage";
|
|
@@ -107,6 +107,59 @@ var IndexedDBFileSystemProvider = class {
|
|
|
107
107
|
async rename(oldPath, newPath) {
|
|
108
108
|
const op = normalisePath(oldPath);
|
|
109
109
|
const np = normalisePath(newPath);
|
|
110
|
+
if (op === np) return;
|
|
111
|
+
if (!op || !np) {
|
|
112
|
+
throw new Error("Cannot rename the filesystem root");
|
|
113
|
+
}
|
|
114
|
+
if (np.startsWith(op + "/")) {
|
|
115
|
+
throw new Error("Cannot move a directory into itself");
|
|
116
|
+
}
|
|
117
|
+
const dirs = await this.getDirs();
|
|
118
|
+
if (dirs.has(op)) {
|
|
119
|
+
const newParent2 = parentDir(np);
|
|
120
|
+
if (newParent2) {
|
|
121
|
+
await this.ensureDir(newParent2);
|
|
122
|
+
}
|
|
123
|
+
const allKeys = await this.store.keys();
|
|
124
|
+
const oldKeyPrefix = `fs:${op}/`;
|
|
125
|
+
const newKeyPrefix = `fs:${np}/`;
|
|
126
|
+
const metaSuffix = ":meta";
|
|
127
|
+
const keysToMove = allKeys.filter((k) => k.startsWith(oldKeyPrefix));
|
|
128
|
+
await Promise.all(
|
|
129
|
+
keysToMove.map(async (oldKey) => {
|
|
130
|
+
const newKey = newKeyPrefix + oldKey.slice(oldKeyPrefix.length);
|
|
131
|
+
if (oldKey.endsWith(metaSuffix)) {
|
|
132
|
+
const meta2 = await this.store.get(oldKey);
|
|
133
|
+
if (meta2) {
|
|
134
|
+
const newFilePath = newKey.slice(3, -metaSuffix.length);
|
|
135
|
+
await this.store.set(metaKey(newFilePath), {
|
|
136
|
+
...meta2,
|
|
137
|
+
name: baseName(newFilePath),
|
|
138
|
+
path: newFilePath
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
} else {
|
|
142
|
+
const value = await this.store.get(oldKey);
|
|
143
|
+
if (value !== null) {
|
|
144
|
+
await this.store.set(newKey, value);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
await this.store.remove(oldKey);
|
|
148
|
+
})
|
|
149
|
+
);
|
|
150
|
+
dirs.delete(op);
|
|
151
|
+
dirs.add(np);
|
|
152
|
+
const oldPrefix = op + "/";
|
|
153
|
+
const newPrefix = np + "/";
|
|
154
|
+
for (const d of [...dirs]) {
|
|
155
|
+
if (d.startsWith(oldPrefix)) {
|
|
156
|
+
dirs.delete(d);
|
|
157
|
+
dirs.add(newPrefix + d.slice(oldPrefix.length));
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
await this.saveDirs(dirs);
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
110
163
|
const content = await this.store.get(contentKey(op));
|
|
111
164
|
const binary = await this.store.get(binaryKey(op));
|
|
112
165
|
const meta = await this.store.get(metaKey(op));
|
|
@@ -117,9 +170,11 @@ var IndexedDBFileSystemProvider = class {
|
|
|
117
170
|
await this.store.set(binaryKey(np), binary);
|
|
118
171
|
}
|
|
119
172
|
if (meta) {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
173
|
+
await this.store.set(metaKey(np), {
|
|
174
|
+
...meta,
|
|
175
|
+
name: baseName(np),
|
|
176
|
+
path: np
|
|
177
|
+
});
|
|
123
178
|
}
|
|
124
179
|
const newParent = parentDir(np);
|
|
125
180
|
if (newParent) {
|
|
@@ -128,20 +183,6 @@ var IndexedDBFileSystemProvider = class {
|
|
|
128
183
|
await this.store.remove(contentKey(op));
|
|
129
184
|
await this.store.remove(binaryKey(op));
|
|
130
185
|
await this.store.remove(metaKey(op));
|
|
131
|
-
const dirs = await this.getDirs();
|
|
132
|
-
if (dirs.has(op)) {
|
|
133
|
-
dirs.delete(op);
|
|
134
|
-
dirs.add(np);
|
|
135
|
-
const oldPrefix = op + "/";
|
|
136
|
-
const newPrefix = np + "/";
|
|
137
|
-
for (const d of [...dirs]) {
|
|
138
|
-
if (d.startsWith(oldPrefix)) {
|
|
139
|
-
dirs.delete(d);
|
|
140
|
-
dirs.add(newPrefix + d.slice(oldPrefix.length));
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
await this.saveDirs(dirs);
|
|
144
|
-
}
|
|
145
186
|
}
|
|
146
187
|
async readDirectory(path) {
|
|
147
188
|
const p = normalisePath(path);
|
|
@@ -335,7 +376,12 @@ var FileSystemContentContainer = class {
|
|
|
335
376
|
this.prefix = prefix.replace(/^\/+/, "").replace(/\/+$/, "");
|
|
336
377
|
}
|
|
337
378
|
async readFile(path) {
|
|
338
|
-
|
|
379
|
+
const full = joinPrefix(this.prefix, path);
|
|
380
|
+
const binary = await this.provider.readBinary(full);
|
|
381
|
+
if (binary) return binary;
|
|
382
|
+
const text = await this.provider.readFile(full);
|
|
383
|
+
if (text === null) return null;
|
|
384
|
+
return new TextEncoder().encode(text).buffer;
|
|
339
385
|
}
|
|
340
386
|
async writeFile(path, data, _mimeType) {
|
|
341
387
|
await this.provider.writeBinary(joinPrefix(this.prefix, path), data);
|
|
@@ -547,12 +593,35 @@ function baseName2(p) {
|
|
|
547
593
|
const idx = p.lastIndexOf("/");
|
|
548
594
|
return idx === -1 ? p : p.slice(idx + 1);
|
|
549
595
|
}
|
|
596
|
+
function toWritableBinary(data) {
|
|
597
|
+
if (data instanceof ArrayBuffer) return data;
|
|
598
|
+
const copy = new Uint8Array(data.byteLength);
|
|
599
|
+
copy.set(data);
|
|
600
|
+
return copy.buffer;
|
|
601
|
+
}
|
|
550
602
|
var NativeFileSystemProvider = class {
|
|
551
603
|
constructor(id, root) {
|
|
552
604
|
this.id = id;
|
|
553
605
|
this.label = root.name;
|
|
554
606
|
this.root = root;
|
|
555
607
|
}
|
|
608
|
+
async copyDirectory(oldDirPath, newDirPath) {
|
|
609
|
+
const source = await resolveDir(this.root, oldDirPath);
|
|
610
|
+
if (!source) return false;
|
|
611
|
+
await resolveDirCreate(this.root, newDirPath);
|
|
612
|
+
for await (const [name, handle] of source) {
|
|
613
|
+
const oldChild = oldDirPath ? `${oldDirPath}/${name}` : name;
|
|
614
|
+
const newChild = newDirPath ? `${newDirPath}/${name}` : name;
|
|
615
|
+
if (handle.kind === "directory") {
|
|
616
|
+
await this.copyDirectory(oldChild, newChild);
|
|
617
|
+
} else {
|
|
618
|
+
const fileHandle = await source.getFileHandle(name);
|
|
619
|
+
const file = await fileHandle.getFile();
|
|
620
|
+
await this.writeBinary(newChild, await file.arrayBuffer());
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
return true;
|
|
624
|
+
}
|
|
556
625
|
async readFile(path) {
|
|
557
626
|
const p = normalisePath2(path);
|
|
558
627
|
const dir = await resolveDir(this.root, parentDir2(p));
|
|
@@ -584,15 +653,25 @@ var NativeFileSystemProvider = class {
|
|
|
584
653
|
async rename(oldPath, newPath) {
|
|
585
654
|
const op = normalisePath2(oldPath);
|
|
586
655
|
const np = normalisePath2(newPath);
|
|
587
|
-
|
|
588
|
-
if (
|
|
589
|
-
|
|
656
|
+
if (op === np) return;
|
|
657
|
+
if (!op || !np) {
|
|
658
|
+
throw new Error("Cannot rename the filesystem root");
|
|
659
|
+
}
|
|
660
|
+
if (np.startsWith(op + "/")) {
|
|
661
|
+
throw new Error("Cannot move a directory into itself");
|
|
662
|
+
}
|
|
663
|
+
const oldParent = await resolveDir(this.root, parentDir2(op));
|
|
664
|
+
if (!oldParent) return;
|
|
665
|
+
try {
|
|
666
|
+
const fileHandle = await oldParent.getFileHandle(baseName2(op));
|
|
667
|
+
const file = await fileHandle.getFile();
|
|
668
|
+
await this.writeBinary(np, await file.arrayBuffer());
|
|
590
669
|
await this.delete(op);
|
|
591
670
|
return;
|
|
671
|
+
} catch {
|
|
592
672
|
}
|
|
593
|
-
const
|
|
594
|
-
if (
|
|
595
|
-
await this.writeBinary(np, binary);
|
|
673
|
+
const copied = await this.copyDirectory(op, np);
|
|
674
|
+
if (copied) {
|
|
596
675
|
await this.delete(op);
|
|
597
676
|
}
|
|
598
677
|
}
|
|
@@ -671,11 +750,7 @@ var NativeFileSystemProvider = class {
|
|
|
671
750
|
const dir = await resolveDirCreate(this.root, parentDir2(p));
|
|
672
751
|
const fileHandle = await dir.getFileHandle(baseName2(p), { create: true });
|
|
673
752
|
const writable = await fileHandle.createWritable();
|
|
674
|
-
|
|
675
|
-
await writable.write(data);
|
|
676
|
-
} else {
|
|
677
|
-
await writable.write(data.buffer);
|
|
678
|
-
}
|
|
753
|
+
await writable.write(toWritableBinary(data));
|
|
679
754
|
await writable.close();
|
|
680
755
|
}
|
|
681
756
|
};
|
|
@@ -704,10 +779,10 @@ async function restoreNativeFolder(workspaceId) {
|
|
|
704
779
|
|
|
705
780
|
// src/filesystem/electron-provider.ts
|
|
706
781
|
function getHostFs() {
|
|
707
|
-
const host =
|
|
782
|
+
const host = maybeGetDocBlocksHost();
|
|
708
783
|
if (!host) {
|
|
709
784
|
throw new Error(
|
|
710
|
-
"ElectronFileSystemProvider:
|
|
785
|
+
"ElectronFileSystemProvider: docBlocksHost is not available \u2014 not running under Electron?"
|
|
711
786
|
);
|
|
712
787
|
}
|
|
713
788
|
return host.fs;
|
|
@@ -772,4 +847,4 @@ export {
|
|
|
772
847
|
restoreNativeFolder,
|
|
773
848
|
ElectronFileSystemProvider
|
|
774
849
|
};
|
|
775
|
-
//# sourceMappingURL=chunk-
|
|
850
|
+
//# sourceMappingURL=chunk-IM7LCQJ6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/filesystem/indexeddb-provider.ts","../src/filesystem/indexeddb-content-container.ts","../src/filesystem/filesystem-content-container.ts","../src/filesystem/file-media-provider.ts","../src/filesystem/native-provider.ts","../src/filesystem/electron-provider.ts"],"sourcesContent":["/**\n * IndexedDBFileSystemProvider — virtualises a filesystem on top of IndexedDB\n * using the LocalForageAdapter from @bendyline/squisq/storage.\n *\n * Key schema:\n * fs:{path}:content → string (text file contents)\n * fs:{path}:binary → ArrayBuffer (binary file contents)\n * fs:{path}:meta → FileMeta object\n * fs:dirs → Set<string> of known directory paths\n */\n\nimport { LocalForageAdapter } from '@bendyline/squisq/storage';\nimport type { FileSystemProvider, FileSystemEntry, FileMeta } from './types.js';\n\n// ── Helpers ────────────────────────────────────────────────────────\n\n/** Normalise a path: strip leading/trailing slashes, collapse doubles. */\nfunction normalisePath(p: string): string {\n return p.replace(/\\\\/g, '/').replace(/\\/+/g, '/').replace(/^\\//, '').replace(/\\/$/, '');\n}\n\n/** Get the parent directory of a path, or empty string for root-level. */\nfunction parentDir(p: string): string {\n const idx = p.lastIndexOf('/');\n return idx === -1 ? '' : p.slice(0, idx);\n}\n\n/** Get the filename component of a path. */\nfunction baseName(p: string): string {\n const idx = p.lastIndexOf('/');\n return idx === -1 ? p : p.slice(idx + 1);\n}\n\n// ── Key helpers ────────────────────────────────────────────────────\n\nfunction contentKey(path: string): string {\n return `fs:${path}:content`;\n}\n\nfunction binaryKey(path: string): string {\n return `fs:${path}:binary`;\n}\n\nfunction metaKey(path: string): string {\n return `fs:${path}:meta`;\n}\n\nconst DIRS_KEY = 'fs:dirs';\n\n// ── Implementation ─────────────────────────────────────────────────\n\nexport class IndexedDBFileSystemProvider implements FileSystemProvider {\n readonly id: string;\n readonly label: string;\n\n private store: LocalForageAdapter;\n\n constructor(id: string, label: string) {\n this.id = id;\n this.label = label;\n this.store = new LocalForageAdapter({\n name: `docblocks-fs-${id}`,\n storeName: 'files',\n });\n }\n\n // ── Directory tracking ──────────────────────────────────────────\n\n private async getDirs(): Promise<Set<string>> {\n const raw = await this.store.get<string[]>(DIRS_KEY);\n return new Set(raw ?? []);\n }\n\n private async saveDirs(dirs: Set<string>): Promise<void> {\n await this.store.set(DIRS_KEY, [...dirs]);\n }\n\n /** Ensure a directory (and all ancestors) are tracked. */\n private async ensureDir(dirPath: string): Promise<void> {\n if (!dirPath) return;\n const dirs = await this.getDirs();\n const parts = dirPath.split('/');\n let current = '';\n let changed = false;\n for (const part of parts) {\n current = current ? `${current}/${part}` : part;\n if (!dirs.has(current)) {\n dirs.add(current);\n changed = true;\n }\n }\n if (changed) {\n await this.saveDirs(dirs);\n }\n }\n\n // ── FileSystemProvider implementation ───────────────────────────\n\n async readFile(path: string): Promise<string | null> {\n const p = normalisePath(path);\n return this.store.get<string>(contentKey(p));\n }\n\n async writeFile(path: string, content: string): Promise<void> {\n const p = normalisePath(path);\n const parent = parentDir(p);\n if (parent) {\n await this.ensureDir(parent);\n }\n\n const meta: FileMeta = {\n name: baseName(p),\n path: p,\n size: new Blob([content]).size,\n lastModified: new Date().toISOString(),\n };\n\n await this.store.set(contentKey(p), content);\n await this.store.set(metaKey(p), meta);\n }\n\n async delete(path: string): Promise<void> {\n const p = normalisePath(path);\n\n // Remove file keys\n await this.store.remove(contentKey(p));\n await this.store.remove(binaryKey(p));\n await this.store.remove(metaKey(p));\n\n // If it was a directory, remove it and all children\n const dirs = await this.getDirs();\n if (dirs.has(p)) {\n const prefix = p + '/';\n const toRemove: string[] = [p];\n for (const d of dirs) {\n if (d.startsWith(prefix)) {\n toRemove.push(d);\n }\n }\n for (const d of toRemove) {\n dirs.delete(d);\n }\n await this.saveDirs(dirs);\n\n // Remove all file keys under this directory\n const allKeys = await this.store.keys();\n const filePrefix = `fs:${p}/`;\n const keysToRemove = allKeys.filter((k) => k.startsWith(filePrefix));\n await Promise.all(keysToRemove.map((k) => this.store.remove(k)));\n }\n }\n\n async rename(oldPath: string, newPath: string): Promise<void> {\n const op = normalisePath(oldPath);\n const np = normalisePath(newPath);\n if (op === np) return;\n if (!op || !np) {\n throw new Error('Cannot rename the filesystem root');\n }\n if (np.startsWith(op + '/')) {\n throw new Error('Cannot move a directory into itself');\n }\n\n const dirs = await this.getDirs();\n\n // Handle directory rename by moving every tracked child directory and\n // every file record keyed under the old directory prefix.\n if (dirs.has(op)) {\n const newParent = parentDir(np);\n if (newParent) {\n await this.ensureDir(newParent);\n }\n\n const allKeys = await this.store.keys();\n const oldKeyPrefix = `fs:${op}/`;\n const newKeyPrefix = `fs:${np}/`;\n const metaSuffix = ':meta';\n const keysToMove = allKeys.filter((k) => k.startsWith(oldKeyPrefix));\n\n await Promise.all(\n keysToMove.map(async (oldKey) => {\n const newKey = newKeyPrefix + oldKey.slice(oldKeyPrefix.length);\n if (oldKey.endsWith(metaSuffix)) {\n const meta = await this.store.get<FileMeta>(oldKey);\n if (meta) {\n const newFilePath = newKey.slice(3, -metaSuffix.length);\n await this.store.set(metaKey(newFilePath), {\n ...meta,\n name: baseName(newFilePath),\n path: newFilePath,\n });\n }\n } else {\n const value = await this.store.get<unknown>(oldKey);\n if (value !== null) {\n await this.store.set(newKey, value);\n }\n }\n await this.store.remove(oldKey);\n }),\n );\n\n dirs.delete(op);\n dirs.add(np);\n const oldPrefix = op + '/';\n const newPrefix = np + '/';\n for (const d of [...dirs]) {\n if (d.startsWith(oldPrefix)) {\n dirs.delete(d);\n dirs.add(newPrefix + d.slice(oldPrefix.length));\n }\n }\n await this.saveDirs(dirs);\n return;\n }\n\n // Read existing data\n const content = await this.store.get<string>(contentKey(op));\n const binary = await this.store.get<ArrayBuffer>(binaryKey(op));\n const meta = await this.store.get<FileMeta>(metaKey(op));\n\n // Write to new location\n if (content !== null) {\n await this.store.set(contentKey(np), content);\n }\n if (binary !== null) {\n await this.store.set(binaryKey(np), binary);\n }\n if (meta) {\n await this.store.set(metaKey(np), {\n ...meta,\n name: baseName(np),\n path: np,\n });\n }\n\n // Ensure parent dir of new path exists\n const newParent = parentDir(np);\n if (newParent) {\n await this.ensureDir(newParent);\n }\n\n // Delete old\n await this.store.remove(contentKey(op));\n await this.store.remove(binaryKey(op));\n await this.store.remove(metaKey(op));\n }\n\n async readDirectory(path: string): Promise<FileSystemEntry[]> {\n const p = normalisePath(path);\n const dirs = await this.getDirs();\n const entries: FileSystemEntry[] = [];\n const seen = new Set<string>();\n\n // Find child directories\n const prefix = p ? p + '/' : '';\n for (const d of dirs) {\n if (!p && !d.includes('/')) {\n // Root-level directory\n if (!seen.has(d)) {\n seen.add(d);\n entries.push({ kind: 'directory', name: d, path: d });\n }\n } else if (p && d.startsWith(prefix)) {\n const rest = d.slice(prefix.length);\n if (!rest.includes('/')) {\n // Direct child directory\n if (!seen.has(rest)) {\n seen.add(rest);\n entries.push({ kind: 'directory', name: rest, path: d });\n }\n }\n }\n }\n\n // Find child files by scanning meta keys\n const allKeys = await this.store.keys();\n const metaPrefix = p ? `fs:${p}/` : 'fs:';\n const metaSuffix = ':meta';\n\n for (const key of allKeys) {\n if (!key.startsWith(metaPrefix) || !key.endsWith(metaSuffix)) continue;\n\n const filePath = key.slice(3, -metaSuffix.length); // strip \"fs:\" and \":meta\"\n const rel = p ? filePath.slice(prefix.length) : filePath;\n\n // Only direct children (no further slashes)\n if (rel.includes('/')) continue;\n\n if (!seen.has(rel)) {\n seen.add(rel);\n entries.push({ kind: 'file', name: rel, path: filePath });\n }\n }\n\n // Sort: directories first, then alphabetical\n entries.sort((a, b) => {\n if (a.kind !== b.kind) return a.kind === 'directory' ? -1 : 1;\n return a.name.localeCompare(b.name);\n });\n\n return entries;\n }\n\n async exists(path: string): Promise<boolean> {\n const p = normalisePath(path);\n const dirs = await this.getDirs();\n if (dirs.has(p)) return true;\n const meta = await this.store.get(metaKey(p));\n return meta !== null;\n }\n\n async createDirectory(path: string): Promise<void> {\n const p = normalisePath(path);\n await this.ensureDir(p);\n }\n\n async stat(path: string): Promise<FileMeta | null> {\n const p = normalisePath(path);\n return this.store.get<FileMeta>(metaKey(p));\n }\n\n async readBinary(path: string): Promise<ArrayBuffer | null> {\n const p = normalisePath(path);\n return this.store.get<ArrayBuffer>(binaryKey(p));\n }\n\n async writeBinary(path: string, data: ArrayBuffer | Uint8Array): Promise<void> {\n const p = normalisePath(path);\n const parent = parentDir(p);\n if (parent) {\n await this.ensureDir(parent);\n }\n\n const meta: FileMeta = {\n name: baseName(p),\n path: p,\n size: data.byteLength,\n lastModified: new Date().toISOString(),\n };\n\n await this.store.set(binaryKey(p), data);\n await this.store.set(metaKey(p), meta);\n }\n}\n","/**\n * IndexedDBContentContainer — a ContentContainer backed by IndexedDB.\n *\n * Uses a dedicated IndexedDBFileSystemProvider instance (separate store)\n * to persist media files across page refreshes.\n */\n\nimport type { ContentContainer, ContentEntry } from '@bendyline/squisq/storage';\nimport { findDocumentPath } from '@bendyline/squisq/storage';\nimport { IndexedDBFileSystemProvider } from './indexeddb-provider.js';\n\n// ── MIME type guessing ─────────────────────────────────────────────\n\nconst EXTENSION_MIME_MAP: Record<string, string> = {\n '.md': 'text/markdown',\n '.txt': 'text/plain',\n '.json': 'application/json',\n '.jpg': 'image/jpeg',\n '.jpeg': 'image/jpeg',\n '.png': 'image/png',\n '.gif': 'image/gif',\n '.svg': 'image/svg+xml',\n '.webp': 'image/webp',\n '.avif': 'image/avif',\n '.mp4': 'video/mp4',\n '.webm': 'video/webm',\n '.mp3': 'audio/mpeg',\n '.wav': 'audio/wav',\n '.ogg': 'audio/ogg',\n};\n\nfunction guessMimeType(path: string): string {\n const dot = path.lastIndexOf('.');\n if (dot === -1) return 'application/octet-stream';\n const ext = path.slice(dot).toLowerCase();\n return EXTENSION_MIME_MAP[ext] ?? 'application/octet-stream';\n}\n\n// ── Implementation ─────────────────────────────────────────────────\n\nexport class IndexedDBContentContainer implements ContentContainer {\n private provider: IndexedDBFileSystemProvider;\n\n constructor(workspaceId: string) {\n this.provider = new IndexedDBFileSystemProvider(`${workspaceId}-media`, 'Media Storage');\n }\n\n async readFile(path: string): Promise<ArrayBuffer | null> {\n return this.provider.readBinary(path);\n }\n\n async writeFile(path: string, data: ArrayBuffer | Uint8Array, _mimeType?: string): Promise<void> {\n await this.provider.writeBinary(path, data);\n }\n\n async removeFile(path: string): Promise<void> {\n await this.provider.delete(path);\n }\n\n async listFiles(prefix?: string): Promise<ContentEntry[]> {\n const entries: ContentEntry[] = [];\n const walk = async (dir: string) => {\n const children = await this.provider.readDirectory(dir);\n for (const child of children) {\n if (child.kind === 'directory') {\n await walk(child.path);\n } else {\n const filePath = child.path.replace(/^\\//, '');\n if (prefix && !filePath.startsWith(prefix)) continue;\n const meta = await this.provider.stat(child.path);\n entries.push({\n path: filePath,\n mimeType: guessMimeType(filePath),\n size: meta?.size ?? 0,\n });\n }\n }\n };\n await walk('/');\n return entries;\n }\n\n async exists(path: string): Promise<boolean> {\n return this.provider.exists(path);\n }\n\n async getDocumentPath(): Promise<string | null> {\n return findDocumentPath(await this.listFiles());\n }\n\n async readDocument(): Promise<string | null> {\n const docPath = await this.getDocumentPath();\n if (!docPath) return null;\n const data = await this.readFile(docPath);\n if (!data) return null;\n return new TextDecoder().decode(data);\n }\n\n async writeDocument(markdown: string, filename?: string): Promise<void> {\n const name = filename ?? 'index.md';\n const data = new TextEncoder().encode(markdown);\n await this.writeFile(name, data, 'text/markdown');\n }\n}\n","/**\n * FileSystemContentContainer — a ContentContainer backed by any\n * FileSystemProvider, scoped to a sub-path (e.g., \".docblocks/media/\").\n *\n * Used by the Electron desktop app so media lives inside the workspace\n * folder (visible as regular files) rather than in a separate IndexedDB\n * origin that only the app can see.\n */\n\nimport type { ContentContainer, ContentEntry } from '@bendyline/squisq/storage';\nimport { findDocumentPath } from '@bendyline/squisq/storage';\nimport type { FileSystemProvider } from './types.js';\n\nconst EXTENSION_MIME_MAP: Record<string, string> = {\n '.md': 'text/markdown',\n '.txt': 'text/plain',\n '.json': 'application/json',\n '.jpg': 'image/jpeg',\n '.jpeg': 'image/jpeg',\n '.png': 'image/png',\n '.gif': 'image/gif',\n '.svg': 'image/svg+xml',\n '.webp': 'image/webp',\n '.avif': 'image/avif',\n '.mp4': 'video/mp4',\n '.webm': 'video/webm',\n '.mp3': 'audio/mpeg',\n '.wav': 'audio/wav',\n '.ogg': 'audio/ogg',\n};\n\nfunction guessMimeType(path: string): string {\n const dot = path.lastIndexOf('.');\n if (dot === -1) return 'application/octet-stream';\n const ext = path.slice(dot).toLowerCase();\n return EXTENSION_MIME_MAP[ext] ?? 'application/octet-stream';\n}\n\nfunction joinPrefix(prefix: string, p: string): string {\n const clean = p.replace(/^\\/+/, '');\n return prefix.replace(/\\/+$/, '') + '/' + clean;\n}\n\nexport class FileSystemContentContainer implements ContentContainer {\n private readonly prefix: string;\n\n constructor(\n private readonly provider: FileSystemProvider,\n prefix = '.docblocks/media',\n ) {\n this.prefix = prefix.replace(/^\\/+/, '').replace(/\\/+$/, '');\n }\n\n async readFile(path: string): Promise<ArrayBuffer | null> {\n const full = joinPrefix(this.prefix, path);\n const binary = await this.provider.readBinary(full);\n if (binary) return binary;\n // IndexedDB-backed workspaces store text via `writeFile(string)` and\n // binary via `writeBinary(ArrayBuffer)` under separate keys, so a\n // markdown file written through the text API is invisible to\n // `readBinary`. Fall back to text-then-UTF-8 so consumers like the\n // recursive HTML export can resolve sibling `.md` links uniformly\n // across browser and native workspaces.\n const text = await this.provider.readFile(full);\n if (text === null) return null;\n return new TextEncoder().encode(text).buffer as ArrayBuffer;\n }\n\n async writeFile(path: string, data: ArrayBuffer | Uint8Array, _mimeType?: string): Promise<void> {\n await this.provider.writeBinary(joinPrefix(this.prefix, path), data);\n }\n\n async removeFile(path: string): Promise<void> {\n await this.provider.delete(joinPrefix(this.prefix, path));\n }\n\n async listFiles(prefix?: string): Promise<ContentEntry[]> {\n const entries: ContentEntry[] = [];\n const walk = async (dir: string) => {\n let children;\n try {\n children = await this.provider.readDirectory(dir);\n } catch {\n return;\n }\n for (const child of children) {\n if (child.kind === 'directory') {\n await walk(child.path);\n } else {\n const rel = child.path.replace(new RegExp('^/?' + this.prefix + '/?'), '');\n if (prefix && !rel.startsWith(prefix)) continue;\n const meta = await this.provider.stat(child.path);\n entries.push({\n path: rel,\n mimeType: guessMimeType(rel),\n size: meta?.size ?? 0,\n });\n }\n }\n };\n await walk('/' + this.prefix);\n return entries;\n }\n\n async exists(path: string): Promise<boolean> {\n return this.provider.exists(joinPrefix(this.prefix, path));\n }\n\n async getDocumentPath(): Promise<string | null> {\n return findDocumentPath(await this.listFiles());\n }\n\n async readDocument(): Promise<string | null> {\n const docPath = await this.getDocumentPath();\n if (!docPath) return null;\n const data = await this.readFile(docPath);\n if (!data) return null;\n return new TextDecoder().decode(data);\n }\n\n async writeDocument(markdown: string, filename?: string): Promise<void> {\n const name = filename ?? 'index.md';\n const data = new TextEncoder().encode(markdown);\n await this.writeFile(name, data, 'text/markdown');\n }\n}\n","/**\n * createFileMediaProvider — per-file media storage following the pandoc /\n * Word convention: a markdown file `notes.md` gets a sibling folder\n * `notes_files/` that holds its images, audio, and video.\n *\n * Given:\n * • `container` — a ContentContainer scoped to the markdown file's\n * parent directory (so `readFile('notes_files/image.png')` maps to the\n * parent-relative path)\n * • `markdownBasename` — e.g. `\"notes.md\"`\n *\n * Returns a MediaProvider that:\n * • Writes new media under `{basename}_files/{name}` in the parent dir\n * • Returns the folder-qualified path (`notes_files/image.png`) from\n * addMedia so the markdown stays portable outside DocBlocks\n * • Resolves both bare (`image.png`) and folder-qualified\n * (`notes_files/image.png`) references — so legacy markdown and\n * exports from other tools both work\n */\n\nimport type { MediaProvider, MediaEntry } from '@bendyline/squisq/schemas';\nimport type { ContentContainer } from '@bendyline/squisq/storage';\n\nfunction stripExt(name: string): string {\n return name.replace(/\\.[^.]+$/, '');\n}\n\nexport function createFileMediaProvider(\n container: ContentContainer,\n markdownBasename: string,\n): MediaProvider {\n const folder = stripExt(markdownBasename) + '_files';\n const prefix = folder + '/';\n const blobUrlCache = new Map<string, string>();\n\n function toKey(ref: string): string {\n const clean = ref.replace(/^\\/+/, '');\n return clean.startsWith(prefix) ? clean : prefix + clean;\n }\n\n return {\n async resolveUrl(ref: string): Promise<string> {\n const key = toKey(ref);\n const cached = blobUrlCache.get(key);\n if (cached) return cached;\n\n const data = await container.readFile(key);\n if (!data) return ref;\n\n const entries = await container.listFiles();\n const entry = entries.find((e) => e.path === key);\n const mimeType = entry?.mimeType ?? 'application/octet-stream';\n\n const url = URL.createObjectURL(new Blob([data], { type: mimeType }));\n blobUrlCache.set(key, url);\n return url;\n },\n\n async listMedia(): Promise<MediaEntry[]> {\n const entries = await container.listFiles(prefix);\n return entries\n .filter((e) => !e.path.toLowerCase().endsWith('.md'))\n .map((e) => ({\n name: e.path,\n mimeType: e.mimeType,\n size: e.size,\n }));\n },\n\n async addMedia(\n name: string,\n data: ArrayBuffer | Blob | Uint8Array,\n mimeType: string,\n ): Promise<string> {\n const key = toKey(name);\n const cached = blobUrlCache.get(key);\n if (cached) {\n URL.revokeObjectURL(cached);\n blobUrlCache.delete(key);\n }\n const buffer = data instanceof Blob ? new Uint8Array(await data.arrayBuffer()) : data;\n await container.writeFile(key, buffer, mimeType);\n return key;\n },\n\n async removeMedia(ref: string): Promise<void> {\n const key = toKey(ref);\n const cached = blobUrlCache.get(key);\n if (cached) {\n URL.revokeObjectURL(cached);\n blobUrlCache.delete(key);\n }\n await container.removeFile(key);\n },\n\n dispose(): void {\n for (const url of blobUrlCache.values()) {\n URL.revokeObjectURL(url);\n }\n blobUrlCache.clear();\n },\n };\n}\n","/**\n * NativeFileSystemProvider — wraps the File System Access API\n * (window.showDirectoryPicker / FileSystemDirectoryHandle).\n *\n * Progressive enhancement: only available in browsers that support\n * the API (Chrome, Edge). Feature-detect with `isNativeFileSystemSupported()`.\n */\n\nimport type { FileSystemProvider, FileSystemEntry, FileMeta } from './types.js';\n\n// ── Feature detection ──────────────────────────────────────────────\n\nexport function isNativeFileSystemSupported(): boolean {\n return typeof globalThis !== 'undefined' && 'showDirectoryPicker' in globalThis;\n}\n\n// ── Handle persistence (IndexedDB, structured clone) ───────────────\n\nconst HANDLE_DB_NAME = 'docblocks-handles';\nconst HANDLE_STORE_NAME = 'directory-handles';\n\nfunction openHandleDB(): Promise<IDBDatabase> {\n return new Promise((resolve, reject) => {\n const req = indexedDB.open(HANDLE_DB_NAME, 1);\n req.onupgradeneeded = () => {\n req.result.createObjectStore(HANDLE_STORE_NAME);\n };\n req.onsuccess = () => resolve(req.result);\n req.onerror = () => reject(req.error);\n });\n}\n\n/** Persist a FileSystemDirectoryHandle so it survives page reloads. */\nexport async function storeDirectoryHandle(\n workspaceId: string,\n handle: FileSystemDirectoryHandle,\n): Promise<void> {\n const db = await openHandleDB();\n return new Promise((resolve, reject) => {\n const tx = db.transaction(HANDLE_STORE_NAME, 'readwrite');\n tx.objectStore(HANDLE_STORE_NAME).put(handle, workspaceId);\n tx.oncomplete = () => {\n db.close();\n resolve();\n };\n tx.onerror = () => {\n db.close();\n reject(tx.error);\n };\n });\n}\n\n/** Retrieve a previously stored handle. Returns null if not found. */\nexport async function loadDirectoryHandle(\n workspaceId: string,\n): Promise<FileSystemDirectoryHandle | null> {\n const db = await openHandleDB();\n return new Promise((resolve, reject) => {\n const tx = db.transaction(HANDLE_STORE_NAME, 'readonly');\n const req = tx.objectStore(HANDLE_STORE_NAME).get(workspaceId);\n req.onsuccess = () => {\n db.close();\n resolve(req.result ?? null);\n };\n req.onerror = () => {\n db.close();\n reject(req.error);\n };\n });\n}\n\n/** Remove a stored handle (e.g. when deleting a workspace). */\nexport async function removeDirectoryHandle(workspaceId: string): Promise<void> {\n const db = await openHandleDB();\n return new Promise((resolve, reject) => {\n const tx = db.transaction(HANDLE_STORE_NAME, 'readwrite');\n tx.objectStore(HANDLE_STORE_NAME).delete(workspaceId);\n tx.oncomplete = () => {\n db.close();\n resolve();\n };\n tx.onerror = () => {\n db.close();\n reject(tx.error);\n };\n });\n}\n\n// ── Helpers ────────────────────────────────────────────────────────\n\nfunction normalisePath(p: string): string {\n return p.replace(/\\\\/g, '/').replace(/\\/+/g, '/').replace(/^\\//, '').replace(/\\/$/, '');\n}\n\n/**\n * Walk a chain of path segments to reach a FileSystemDirectoryHandle.\n * Returns null if any segment is missing.\n */\nasync function resolveDir(\n root: FileSystemDirectoryHandle,\n dirPath: string,\n): Promise<FileSystemDirectoryHandle | null> {\n if (!dirPath) return root;\n const parts = dirPath.split('/');\n let current = root;\n for (const part of parts) {\n try {\n current = await current.getDirectoryHandle(part);\n } catch {\n return null;\n }\n }\n return current;\n}\n\n/**\n * Walk path segments, creating directories as needed.\n */\nasync function resolveDirCreate(\n root: FileSystemDirectoryHandle,\n dirPath: string,\n): Promise<FileSystemDirectoryHandle> {\n if (!dirPath) return root;\n const parts = dirPath.split('/');\n let current = root;\n for (const part of parts) {\n current = await current.getDirectoryHandle(part, { create: true });\n }\n return current;\n}\n\nfunction parentDir(p: string): string {\n const idx = p.lastIndexOf('/');\n return idx === -1 ? '' : p.slice(0, idx);\n}\n\nfunction baseName(p: string): string {\n const idx = p.lastIndexOf('/');\n return idx === -1 ? p : p.slice(idx + 1);\n}\n\nfunction toWritableBinary(data: ArrayBuffer | Uint8Array): ArrayBuffer {\n if (data instanceof ArrayBuffer) return data;\n const copy = new Uint8Array(data.byteLength);\n copy.set(data);\n return copy.buffer;\n}\n\n// ── Implementation ─────────────────────────────────────────────────\n\nexport class NativeFileSystemProvider implements FileSystemProvider {\n readonly id: string;\n readonly label: string;\n\n private root: FileSystemDirectoryHandle;\n\n constructor(id: string, root: FileSystemDirectoryHandle) {\n this.id = id;\n this.label = root.name;\n this.root = root;\n }\n\n private async copyDirectory(oldDirPath: string, newDirPath: string): Promise<boolean> {\n const source = await resolveDir(this.root, oldDirPath);\n if (!source) return false;\n await resolveDirCreate(this.root, newDirPath);\n\n for await (const [name, handle] of source as unknown as AsyncIterable<\n [string, FileSystemHandle]\n >) {\n const oldChild = oldDirPath ? `${oldDirPath}/${name}` : name;\n const newChild = newDirPath ? `${newDirPath}/${name}` : name;\n if (handle.kind === 'directory') {\n await this.copyDirectory(oldChild, newChild);\n } else {\n const fileHandle = await source.getFileHandle(name);\n const file = await fileHandle.getFile();\n await this.writeBinary(newChild, await file.arrayBuffer());\n }\n }\n\n return true;\n }\n\n async readFile(path: string): Promise<string | null> {\n const p = normalisePath(path);\n const dir = await resolveDir(this.root, parentDir(p));\n if (!dir) return null;\n try {\n const fileHandle = await dir.getFileHandle(baseName(p));\n const file = await fileHandle.getFile();\n return file.text();\n } catch {\n return null;\n }\n }\n\n async writeFile(path: string, content: string): Promise<void> {\n const p = normalisePath(path);\n const dir = await resolveDirCreate(this.root, parentDir(p));\n const fileHandle = await dir.getFileHandle(baseName(p), { create: true });\n const writable = await fileHandle.createWritable();\n await writable.write(content);\n await writable.close();\n }\n\n async delete(path: string): Promise<void> {\n const p = normalisePath(path);\n const parent = parentDir(p);\n const name = baseName(p);\n const dir = await resolveDir(this.root, parent);\n if (!dir) return;\n await dir.removeEntry(name, { recursive: true });\n }\n\n async rename(oldPath: string, newPath: string): Promise<void> {\n const op = normalisePath(oldPath);\n const np = normalisePath(newPath);\n if (op === np) return;\n if (!op || !np) {\n throw new Error('Cannot rename the filesystem root');\n }\n if (np.startsWith(op + '/')) {\n throw new Error('Cannot move a directory into itself');\n }\n\n // The File System Access API doesn't have a native rename.\n // Copy → delete.\n const oldParent = await resolveDir(this.root, parentDir(op));\n if (!oldParent) return;\n\n try {\n const fileHandle = await oldParent.getFileHandle(baseName(op));\n const file = await fileHandle.getFile();\n await this.writeBinary(np, await file.arrayBuffer());\n await this.delete(op);\n return;\n } catch {\n // Not a file; try directory below.\n }\n\n const copied = await this.copyDirectory(op, np);\n if (copied) {\n await this.delete(op);\n }\n }\n\n async readDirectory(path: string): Promise<FileSystemEntry[]> {\n const p = normalisePath(path);\n const dir = await resolveDir(this.root, p);\n if (!dir) return [];\n\n const entries: FileSystemEntry[] = [];\n for await (const [name, handle] of dir as unknown as AsyncIterable<\n [string, FileSystemHandle]\n >) {\n const entryPath = p ? `${p}/${name}` : name;\n if (handle.kind === 'directory') {\n entries.push({ kind: 'directory', name, path: entryPath });\n } else {\n entries.push({ kind: 'file', name, path: entryPath });\n }\n }\n\n // Sort: directories first, then alphabetical\n entries.sort((a, b) => {\n if (a.kind !== b.kind) return a.kind === 'directory' ? -1 : 1;\n return a.name.localeCompare(b.name);\n });\n\n return entries;\n }\n\n async exists(path: string): Promise<boolean> {\n const p = normalisePath(path);\n const parent = parentDir(p);\n const name = baseName(p);\n const dir = await resolveDir(this.root, parent);\n if (!dir) return false;\n\n try {\n await dir.getFileHandle(name);\n return true;\n } catch {\n try {\n await dir.getDirectoryHandle(name);\n return true;\n } catch {\n return false;\n }\n }\n }\n\n async createDirectory(path: string): Promise<void> {\n const p = normalisePath(path);\n await resolveDirCreate(this.root, p);\n }\n\n async stat(path: string): Promise<FileMeta | null> {\n const p = normalisePath(path);\n const dir = await resolveDir(this.root, parentDir(p));\n if (!dir) return null;\n\n try {\n const fileHandle = await dir.getFileHandle(baseName(p));\n const file = await fileHandle.getFile();\n return {\n name: file.name,\n path: p,\n size: file.size,\n lastModified: new Date(file.lastModified).toISOString(),\n };\n } catch {\n return null;\n }\n }\n\n async readBinary(path: string): Promise<ArrayBuffer | null> {\n const p = normalisePath(path);\n const dir = await resolveDir(this.root, parentDir(p));\n if (!dir) return null;\n try {\n const fileHandle = await dir.getFileHandle(baseName(p));\n const file = await fileHandle.getFile();\n return file.arrayBuffer();\n } catch {\n return null;\n }\n }\n\n async writeBinary(path: string, data: ArrayBuffer | Uint8Array): Promise<void> {\n const p = normalisePath(path);\n const dir = await resolveDirCreate(this.root, parentDir(p));\n const fileHandle = await dir.getFileHandle(baseName(p), { create: true });\n const writable = await fileHandle.createWritable();\n await writable.write(toWritableBinary(data));\n await writable.close();\n }\n}\n\n/**\n * Prompt the user to pick a local folder and return a NativeFileSystemProvider.\n * The directory handle is persisted in IndexedDB so it can be restored later.\n * Throws if the user cancels or the API is unsupported.\n */\nexport async function openNativeFolder(): Promise<NativeFileSystemProvider> {\n if (!isNativeFileSystemSupported()) {\n throw new Error('File System Access API is not supported in this browser');\n }\n\n const handle = await (\n globalThis as unknown as { showDirectoryPicker: () => Promise<FileSystemDirectoryHandle> }\n ).showDirectoryPicker();\n const id = `native-${handle.name}-${Date.now()}`;\n await storeDirectoryHandle(id, handle);\n return new NativeFileSystemProvider(id, handle);\n}\n\n/**\n * Restore a previously opened native folder from a persisted handle.\n * Re-requests read/write permission (browser will show a prompt).\n * Returns null if the handle is not found or permission is denied.\n */\nexport async function restoreNativeFolder(\n workspaceId: string,\n): Promise<NativeFileSystemProvider | null> {\n const handle = await loadDirectoryHandle(workspaceId);\n if (!handle) return null;\n\n // Verify/request permission\n const opts = { mode: 'readwrite' as const };\n const h = handle as FileSystemDirectoryHandle & {\n queryPermission(desc: { mode: string }): Promise<string>;\n requestPermission(desc: { mode: string }): Promise<string>;\n };\n if ((await h.queryPermission(opts)) === 'granted') {\n return new NativeFileSystemProvider(workspaceId, handle);\n }\n if ((await h.requestPermission(opts)) === 'granted') {\n return new NativeFileSystemProvider(workspaceId, handle);\n }\n\n return null;\n}\n","/**\n * ElectronFileSystemProvider — implements FileSystemProvider by delegating\n * to the Electron desktop host's fs IPC bridge. Every operation is scoped\n * to an absolute root path that the main process validates against a\n * whitelist of registered workspace roots.\n *\n * This file has no Electron dependency — it is a pure IPC client that\n * relies on the `docBlocksHost` global installed by the preload script.\n */\n\nimport type { FileSystemProvider, FileSystemEntry, FileMeta } from './types.js';\nimport { maybeGetDocBlocksHost } from '../host/index.js';\nimport type { DocBlocksHostFsAPI } from '../host/types.js';\n\nexport { isElectronHost } from '../host/index.js';\n\nfunction getHostFs(): DocBlocksHostFsAPI {\n const host = maybeGetDocBlocksHost();\n if (!host) {\n throw new Error(\n 'ElectronFileSystemProvider: docBlocksHost is not available — not running under Electron?',\n );\n }\n return host.fs;\n}\n\nexport class ElectronFileSystemProvider implements FileSystemProvider {\n readonly id: string;\n readonly label: string;\n\n private readonly rootPath: string;\n\n constructor(id: string, label: string, rootPath: string) {\n this.id = id;\n this.label = label;\n this.rootPath = rootPath;\n }\n\n /** Absolute path this provider is rooted at. */\n getRootPath(): string {\n return this.rootPath;\n }\n\n readFile(path: string): Promise<string | null> {\n return getHostFs().readFile(this.rootPath, path);\n }\n\n writeFile(path: string, content: string): Promise<void> {\n return getHostFs().writeFile(this.rootPath, path, content);\n }\n\n delete(path: string): Promise<void> {\n return getHostFs().delete(this.rootPath, path);\n }\n\n rename(oldPath: string, newPath: string): Promise<void> {\n return getHostFs().rename(this.rootPath, oldPath, newPath);\n }\n\n readDirectory(path: string): Promise<FileSystemEntry[]> {\n return getHostFs().readDirectory(this.rootPath, path);\n }\n\n exists(path: string): Promise<boolean> {\n return getHostFs().exists(this.rootPath, path);\n }\n\n createDirectory(path: string): Promise<void> {\n return getHostFs().createDirectory(this.rootPath, path);\n }\n\n stat(path: string): Promise<FileMeta | null> {\n return getHostFs().stat(this.rootPath, path);\n }\n\n readBinary(path: string): Promise<ArrayBuffer | null> {\n return getHostFs().readBinary(this.rootPath, path);\n }\n\n writeBinary(path: string, data: ArrayBuffer | Uint8Array): Promise<void> {\n return getHostFs().writeBinary(this.rootPath, path, data);\n }\n\n /** Subscribe to external change notifications under this root. */\n watch(onChange: (changedPath: string) => void): () => void {\n return getHostFs().watch(this.rootPath, onChange);\n }\n}\n"],"mappings":";;;;;AAWA,SAAS,0BAA0B;AAMnC,SAAS,cAAc,GAAmB;AACxC,SAAO,EAAE,QAAQ,OAAO,GAAG,EAAE,QAAQ,QAAQ,GAAG,EAAE,QAAQ,OAAO,EAAE,EAAE,QAAQ,OAAO,EAAE;AACxF;AAGA,SAAS,UAAU,GAAmB;AACpC,QAAM,MAAM,EAAE,YAAY,GAAG;AAC7B,SAAO,QAAQ,KAAK,KAAK,EAAE,MAAM,GAAG,GAAG;AACzC;AAGA,SAAS,SAAS,GAAmB;AACnC,QAAM,MAAM,EAAE,YA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AAI;AAAA,EAC/C;AAAA,EAEA,OAAO,SAAiB,SAAgC;AACtD,WAAO,UAAU,EAAE,OAAO,KAAK,UAAU,SAAS,OAAO;AAAA,EAC3D;AAAA,EAEA,cAAc,MAA0C;AACtD,WAAO,UAAU,EAAE,cAAc,KAAK,UAAU,IAAI;AAAA,EACtD;AAAA,EAEA,OAAO,MAAgC;AACrC,WAAO,UAAU,EAAE,OAAO,KAAK,UAAU,IAAI;AAAA,EAC/C;AAAA,EAEA,gBAAgB,MAA6B;AAC3C,WAAO,UAAU,EAAE,gBAAgB,KAAK,UAAU,IAAI;AAAA,EACxD;AAAA,EAEA,KAAK,MAAwC;AAC3C,WAAO,UAAU,EAAE,KAAK,KAAK,UAAU,IAAI;AAAA,EAC7C;AAAA,EAEA,WAAW,MAA2C;AACpD,WAAO,UAAU,EAAE,WAAW,KAAK,UAAU,IAAI;AAAA,EACnD;AAAA,EAEA,YAAY,MAAc,MAA+C;AACvE,WAAO,UAAU,EAAE,YAAY,KAAK,UAAU,MAAM,IAAI;AAAA,EAC1D;AAAA;AAAA,EAGA,MAAM,UAAqD;AACzD,WAAO,UAAU,EAAE,MAAM,KAAK,UAAU,QAAQ;AAAA,EAClD;AACF;","names":["newParent","meta","findDocumentPath","EXTENSION_MIME_MAP","guessMimeType","normalisePath","parentDir","baseName"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// src/host/index.ts
|
|
2
|
+
function isElectronHost() {
|
|
3
|
+
if (typeof globalThis === "undefined") return false;
|
|
4
|
+
const host = globalThis.docBlocksHost;
|
|
5
|
+
return typeof host === "object" && host !== null && typeof host.fs === "object" && host.fs !== null;
|
|
6
|
+
}
|
|
7
|
+
function getDocBlocksHost() {
|
|
8
|
+
const host = globalThis.docBlocksHost;
|
|
9
|
+
if (!host) {
|
|
10
|
+
throw new Error("docBlocksHost is not available \u2014 not running under Electron?");
|
|
11
|
+
}
|
|
12
|
+
return host;
|
|
13
|
+
}
|
|
14
|
+
function maybeGetDocBlocksHost() {
|
|
15
|
+
return globalThis.docBlocksHost ?? null;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
isElectronHost,
|
|
20
|
+
getDocBlocksHost,
|
|
21
|
+
maybeGetDocBlocksHost
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=chunk-ME76RUMR.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/host/index.ts"],"sourcesContent":["/**\n * Host bridge — shared types + runtime access for the Electron desktop\n * host. The renderer calls `
|
|
1
|
+
{"version":3,"sources":["../src/host/index.ts"],"sourcesContent":["/**\n * Host bridge — shared types + runtime access for the Electron desktop\n * host. The renderer calls `getDocBlocksHost()` to reach the preload\n * contextBridge; `isElectronHost()` gates desktop-only UI branches.\n */\n\nexport type {\n DocBlocksHostAPI,\n DocBlocksHostFsAPI,\n DocBlocksHostWorkspacesAPI,\n DocBlocksHostShellAPI,\n DocBlocksHostFfmpegAPI,\n DocBlocksHostUpdaterAPI,\n ElectronWorkspaceInfo,\n HostEnvironment,\n MenuCommand,\n OpenRequest,\n UpdaterStatus,\n} from './types.js';\n\nimport type { DocBlocksHostAPI } from './types.js';\n\n/** True when running inside the Electron desktop shell. */\nexport function isElectronHost(): boolean {\n if (typeof globalThis === 'undefined') return false;\n const host = (globalThis as { docBlocksHost?: unknown }).docBlocksHost;\n return (\n typeof host === 'object' &&\n host !== null &&\n typeof (host as { fs?: unknown }).fs === 'object' &&\n (host as { fs?: unknown }).fs !== null\n );\n}\n\n/** Return the host API, or throw if not running under Electron. */\nexport function getDocBlocksHost(): DocBlocksHostAPI {\n const host = (globalThis as { docBlocksHost?: DocBlocksHostAPI }).docBlocksHost;\n if (!host) {\n throw new Error('docBlocksHost is not available — not running under Electron?');\n }\n return host;\n}\n\n/** Return the host API, or null if not running under Electron. */\nexport function maybeGetDocBlocksHost(): DocBlocksHostAPI | null {\n return (globalThis as { docBlocksHost?: DocBlocksHostAPI }).docBlocksHost ?? null;\n}\n"],"mappings":";AAuBO,SAAS,iBAA0B;AACxC,MAAI,OAAO,eAAe,YAAa,QAAO;AAC9C,QAAM,OAAQ,WAA2C;AACzD,SACE,OAAO,SAAS,YAChB,SAAS,QACT,OAAQ,KAA0B,OAAO,YACxC,KAA0B,OAAO;AAEtC;AAGO,SAAS,mBAAqC;AACnD,QAAM,OAAQ,WAAoD;AAClE,MAAI,CAAC,MAAM;AACT,UAAM,IAAI,MAAM,mEAA8D;AAAA,EAChF;AACA,SAAO;AACT;AAGO,SAAS,wBAAiD;AAC/D,SAAQ,WAAoD,iBAAiB;AAC/E;","names":[]}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* whitelist of registered workspace roots.
|
|
6
6
|
*
|
|
7
7
|
* This file has no Electron dependency — it is a pure IPC client that
|
|
8
|
-
* relies on the `
|
|
8
|
+
* relies on the `docBlocksHost` global installed by the preload script.
|
|
9
9
|
*/
|
|
10
10
|
import type { FileSystemProvider, FileSystemEntry, FileMeta } from './types.js';
|
|
11
11
|
export { isElectronHost } from '../host/index.js';
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
* whitelist of registered workspace roots.
|
|
6
6
|
*
|
|
7
7
|
* This file has no Electron dependency — it is a pure IPC client that
|
|
8
|
-
* relies on the `
|
|
8
|
+
* relies on the `docBlocksHost` global installed by the preload script.
|
|
9
9
|
*/
|
|
10
|
-
import {
|
|
10
|
+
import { maybeGetDocBlocksHost } from '../host/index.js';
|
|
11
11
|
export { isElectronHost } from '../host/index.js';
|
|
12
12
|
function getHostFs() {
|
|
13
|
-
const host =
|
|
13
|
+
const host = maybeGetDocBlocksHost();
|
|
14
14
|
if (!host) {
|
|
15
|
-
throw new Error('ElectronFileSystemProvider:
|
|
15
|
+
throw new Error('ElectronFileSystemProvider: docBlocksHost is not available — not running under Electron?');
|
|
16
16
|
}
|
|
17
17
|
return host.fs;
|
|
18
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filesystem-content-container.d.ts","sourceRoot":"","sources":["../../src/filesystem/filesystem-content-container.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEhF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAgCrD,qBAAa,0BAA2B,YAAW,gBAAgB;IAI/D,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAH3B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;gBAGb,QAAQ,EAAE,kBAAkB,EAC7C,MAAM,SAAqB;IAKvB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"filesystem-content-container.d.ts","sourceRoot":"","sources":["../../src/filesystem/filesystem-content-container.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEhF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAgCrD,qBAAa,0BAA2B,YAAW,gBAAgB;IAI/D,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAH3B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;gBAGb,QAAQ,EAAE,kBAAkB,EAC7C,MAAM,SAAqB;IAKvB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;IAenD,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,UAAU,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI1F,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIvC,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IA4BnD,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAItC,eAAe,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAIzC,YAAY,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAQtC,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAKxE"}
|
|
@@ -41,7 +41,20 @@ export class FileSystemContentContainer {
|
|
|
41
41
|
this.prefix = prefix.replace(/^\/+/, '').replace(/\/+$/, '');
|
|
42
42
|
}
|
|
43
43
|
async readFile(path) {
|
|
44
|
-
|
|
44
|
+
const full = joinPrefix(this.prefix, path);
|
|
45
|
+
const binary = await this.provider.readBinary(full);
|
|
46
|
+
if (binary)
|
|
47
|
+
return binary;
|
|
48
|
+
// IndexedDB-backed workspaces store text via `writeFile(string)` and
|
|
49
|
+
// binary via `writeBinary(ArrayBuffer)` under separate keys, so a
|
|
50
|
+
// markdown file written through the text API is invisible to
|
|
51
|
+
// `readBinary`. Fall back to text-then-UTF-8 so consumers like the
|
|
52
|
+
// recursive HTML export can resolve sibling `.md` links uniformly
|
|
53
|
+
// across browser and native workspaces.
|
|
54
|
+
const text = await this.provider.readFile(full);
|
|
55
|
+
if (text === null)
|
|
56
|
+
return null;
|
|
57
|
+
return new TextEncoder().encode(text).buffer;
|
|
45
58
|
}
|
|
46
59
|
async writeFile(path, data, _mimeType) {
|
|
47
60
|
await this.provider.writeBinary(joinPrefix(this.prefix, path), data);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filesystem-content-container.js","sourceRoot":"","sources":["../../src/filesystem/filesystem-content-container.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAG7D,MAAM,kBAAkB,GAA2B;IACjD,KAAK,EAAE,eA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