@bendyline/docblocks 1.1.2 → 2.0.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/README.md +76 -11
- package/dist/chunk-2D7Y4IR3.js +1293 -0
- package/dist/chunk-2D7Y4IR3.js.map +1 -0
- package/dist/chunk-5MYAICRE.js +957 -0
- package/dist/chunk-5MYAICRE.js.map +1 -0
- package/dist/chunk-75UUF6C4.js +802 -0
- package/dist/chunk-75UUF6C4.js.map +1 -0
- package/dist/chunk-AEHCVWU5.js +25 -0
- package/dist/chunk-AEHCVWU5.js.map +1 -0
- package/dist/chunk-AYZ4HN5M.js +20 -0
- package/dist/chunk-AYZ4HN5M.js.map +1 -0
- package/dist/chunk-EGNDADXB.js +111 -0
- package/dist/chunk-EGNDADXB.js.map +1 -0
- package/dist/chunk-EZKJZUNJ.js +13 -0
- package/dist/chunk-EZKJZUNJ.js.map +1 -0
- package/dist/chunk-FNW556FN.js +75 -0
- package/dist/chunk-FNW556FN.js.map +1 -0
- package/dist/chunk-GCPBEMMH.js +563 -0
- package/dist/chunk-GCPBEMMH.js.map +1 -0
- package/dist/chunk-J32GU3F3.js +1664 -0
- package/dist/chunk-J32GU3F3.js.map +1 -0
- package/dist/chunk-PGR7LK6D.js +1062 -0
- package/dist/chunk-PGR7LK6D.js.map +1 -0
- package/dist/chunk-RQJRQF46.js +787 -0
- package/dist/chunk-RQJRQF46.js.map +1 -0
- package/dist/{chunk-ME76RUMR.js → chunk-RVQHY3XU.js} +15 -1
- package/dist/chunk-RVQHY3XU.js.map +1 -0
- package/dist/chunk-SI2LU2RP.js +224 -0
- package/dist/chunk-SI2LU2RP.js.map +1 -0
- package/dist/chunk-W5UUUII5.js +142 -0
- package/dist/chunk-W5UUUII5.js.map +1 -0
- package/dist/document/document-session.d.ts +127 -0
- package/dist/document/document-session.d.ts.map +1 -0
- package/dist/document/document-session.js +749 -0
- package/dist/document/document-session.js.map +1 -0
- package/dist/document/filesystem-target.d.ts +17 -0
- package/dist/document/filesystem-target.d.ts.map +1 -0
- package/dist/document/filesystem-target.js +70 -0
- package/dist/document/filesystem-target.js.map +1 -0
- package/dist/document/index.d.ts +6 -0
- package/dist/document/index.d.ts.map +1 -0
- package/dist/document/index.js +4 -0
- package/dist/document/index.js.map +1 -0
- package/dist/document/recovery-journal.d.ts +125 -0
- package/dist/document/recovery-journal.d.ts.map +1 -0
- package/dist/document/recovery-journal.js +385 -0
- package/dist/document/recovery-journal.js.map +1 -0
- package/dist/document/types.d.ts +89 -0
- package/dist/document/types.d.ts.map +1 -0
- package/dist/document/types.js +9 -0
- package/dist/document/types.js.map +1 -0
- package/dist/filesystem/commit-lock.d.ts +3 -0
- package/dist/filesystem/commit-lock.d.ts.map +1 -0
- package/dist/filesystem/commit-lock.js +20 -0
- package/dist/filesystem/commit-lock.js.map +1 -0
- package/dist/filesystem/dbk-workspace.d.ts +34 -0
- package/dist/filesystem/dbk-workspace.d.ts.map +1 -0
- package/dist/filesystem/dbk-workspace.js +85 -0
- package/dist/filesystem/dbk-workspace.js.map +1 -0
- package/dist/filesystem/electron-provider-v2.d.ts +36 -0
- package/dist/filesystem/electron-provider-v2.d.ts.map +1 -0
- package/dist/filesystem/electron-provider-v2.js +503 -0
- package/dist/filesystem/electron-provider-v2.js.map +1 -0
- package/dist/filesystem/electron-provider.d.ts +6 -3
- package/dist/filesystem/electron-provider.d.ts.map +1 -1
- package/dist/filesystem/electron-provider.js +18 -13
- package/dist/filesystem/electron-provider.js.map +1 -1
- package/dist/filesystem/electron.d.ts +4 -0
- package/dist/filesystem/electron.d.ts.map +1 -0
- package/dist/filesystem/electron.js +4 -0
- package/dist/filesystem/electron.js.map +1 -0
- package/dist/filesystem/filesystem-content-container.d.ts +1 -1
- package/dist/filesystem/filesystem-content-container.d.ts.map +1 -1
- package/dist/filesystem/filesystem-content-container.js +50 -13
- package/dist/filesystem/filesystem-content-container.js.map +1 -1
- package/dist/filesystem/fs-error.d.ts +46 -0
- package/dist/filesystem/fs-error.d.ts.map +1 -0
- package/dist/filesystem/fs-error.js +170 -0
- package/dist/filesystem/fs-error.js.map +1 -0
- package/dist/filesystem/index.d.ts +15 -1
- package/dist/filesystem/index.d.ts.map +1 -1
- package/dist/filesystem/index.js +13 -0
- package/dist/filesystem/index.js.map +1 -1
- package/dist/filesystem/indexeddb-content-container.d.ts +3 -1
- package/dist/filesystem/indexeddb-content-container.d.ts.map +1 -1
- package/dist/filesystem/indexeddb-content-container.js +18 -11
- package/dist/filesystem/indexeddb-content-container.js.map +1 -1
- package/dist/filesystem/indexeddb-provider-v2.d.ts +96 -0
- package/dist/filesystem/indexeddb-provider-v2.d.ts.map +1 -0
- package/dist/filesystem/indexeddb-provider-v2.js +1241 -0
- package/dist/filesystem/indexeddb-provider-v2.js.map +1 -0
- package/dist/filesystem/indexeddb-provider.d.ts +21 -14
- package/dist/filesystem/indexeddb-provider.d.ts.map +1 -1
- package/dist/filesystem/indexeddb-provider.js +111 -261
- package/dist/filesystem/indexeddb-provider.js.map +1 -1
- package/dist/filesystem/indexeddb-store.d.ts +34 -0
- package/dist/filesystem/indexeddb-store.d.ts.map +1 -0
- package/dist/filesystem/indexeddb-store.js +165 -0
- package/dist/filesystem/indexeddb-store.js.map +1 -0
- package/dist/filesystem/indexeddb.d.ts +5 -0
- package/dist/filesystem/indexeddb.d.ts.map +1 -0
- package/dist/filesystem/indexeddb.js +5 -0
- package/dist/filesystem/indexeddb.js.map +1 -0
- package/dist/filesystem/legacy-v2-adapter.d.ts +62 -0
- package/dist/filesystem/legacy-v2-adapter.d.ts.map +1 -0
- package/dist/filesystem/legacy-v2-adapter.js +499 -0
- package/dist/filesystem/legacy-v2-adapter.js.map +1 -0
- package/dist/filesystem/memory-provider-v2.d.ts +92 -0
- package/dist/filesystem/memory-provider-v2.d.ts.map +1 -0
- package/dist/filesystem/memory-provider-v2.js +615 -0
- package/dist/filesystem/memory-provider-v2.js.map +1 -0
- package/dist/filesystem/memory-provider.d.ts +54 -0
- package/dist/filesystem/memory-provider.d.ts.map +1 -0
- package/dist/filesystem/memory-provider.js +132 -0
- package/dist/filesystem/memory-provider.js.map +1 -0
- package/dist/filesystem/memory.d.ts +4 -0
- package/dist/filesystem/memory.d.ts.map +1 -0
- package/dist/filesystem/memory.js +4 -0
- package/dist/filesystem/memory.js.map +1 -0
- package/dist/filesystem/move-entry.d.ts +9 -0
- package/dist/filesystem/move-entry.d.ts.map +1 -0
- package/dist/filesystem/move-entry.js +103 -0
- package/dist/filesystem/move-entry.js.map +1 -0
- package/dist/filesystem/move-error.d.ts +53 -0
- package/dist/filesystem/move-error.d.ts.map +1 -0
- package/dist/filesystem/move-error.js +99 -0
- package/dist/filesystem/move-error.js.map +1 -0
- package/dist/filesystem/native-provider-v2.d.ts +75 -0
- package/dist/filesystem/native-provider-v2.d.ts.map +1 -0
- package/dist/filesystem/native-provider-v2.js +849 -0
- package/dist/filesystem/native-provider-v2.js.map +1 -0
- package/dist/filesystem/native-provider.d.ts +9 -1
- package/dist/filesystem/native-provider.d.ts.map +1 -1
- package/dist/filesystem/native-provider.js +172 -37
- package/dist/filesystem/native-provider.js.map +1 -1
- package/dist/filesystem/native.d.ts +4 -0
- package/dist/filesystem/native.d.ts.map +1 -0
- package/dist/filesystem/native.js +4 -0
- package/dist/filesystem/native.js.map +1 -0
- package/dist/filesystem/types.d.ts +37 -4
- package/dist/filesystem/types.d.ts.map +1 -1
- package/dist/filesystem/types.js +11 -3
- package/dist/filesystem/types.js.map +1 -1
- package/dist/filesystem/v2.d.ts +172 -0
- package/dist/filesystem/v2.d.ts.map +1 -0
- package/dist/filesystem/v2.js +16 -0
- package/dist/filesystem/v2.js.map +1 -0
- package/dist/filesystem/workspace-path.d.ts +21 -0
- package/dist/filesystem/workspace-path.d.ts.map +1 -0
- package/dist/filesystem/workspace-path.js +80 -0
- package/dist/filesystem/workspace-path.js.map +1 -0
- package/dist/host/filesystem-v2.d.ts +45 -0
- package/dist/host/filesystem-v2.d.ts.map +1 -0
- package/dist/host/filesystem-v2.js +13 -0
- package/dist/host/filesystem-v2.js.map +1 -0
- package/dist/host/git.d.ts +200 -0
- package/dist/host/git.d.ts.map +1 -0
- package/dist/host/git.js +15 -0
- package/dist/host/git.js.map +1 -0
- package/dist/host/index.d.ts +4 -1
- package/dist/host/index.d.ts.map +1 -1
- package/dist/host/index.js +2 -0
- package/dist/host/index.js.map +1 -1
- package/dist/host/types.d.ts +114 -31
- package/dist/host/types.d.ts.map +1 -1
- package/dist/host/wire-policy.d.ts +22 -0
- package/dist/host/wire-policy.d.ts.map +1 -0
- package/dist/host/wire-policy.js +92 -0
- package/dist/host/wire-policy.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp/index.d.ts +4 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +4 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/types.d.ts +466 -0
- package/dist/mcp/types.d.ts.map +1 -0
- package/dist/mcp/types.js +25 -0
- package/dist/mcp/types.js.map +1 -0
- package/dist/mcp/wire.d.ts +29 -0
- package/dist/mcp/wire.d.ts.map +1 -0
- package/dist/mcp/wire.js +1046 -0
- package/dist/mcp/wire.js.map +1 -0
- package/dist/mcp/zod.d.ts +5763 -0
- package/dist/mcp/zod.d.ts.map +1 -0
- package/dist/mcp/zod.js +908 -0
- package/dist/mcp/zod.js.map +1 -0
- package/dist/types-CX893hgH.d.ts +468 -0
- package/dist/types-CsX6EN2t.d.ts +301 -0
- package/dist/types-eOlt9J7n.d.ts +478 -0
- package/dist/vscode/index.d.ts +3 -0
- package/dist/vscode/index.d.ts.map +1 -0
- package/dist/vscode/index.js +3 -0
- package/dist/vscode/index.js.map +1 -0
- package/dist/vscode/messages.d.ts +204 -0
- package/dist/vscode/messages.d.ts.map +1 -0
- package/dist/vscode/messages.js +494 -0
- package/dist/vscode/messages.js.map +1 -0
- package/dist/workspace/index.d.ts +3 -2
- package/dist/workspace/index.d.ts.map +1 -1
- package/dist/workspace/index.js +2 -1
- package/dist/workspace/index.js.map +1 -1
- package/dist/workspace/reconcile-electron.d.ts +19 -0
- package/dist/workspace/reconcile-electron.d.ts.map +1 -0
- package/dist/workspace/reconcile-electron.js +42 -0
- package/dist/workspace/reconcile-electron.js.map +1 -0
- package/dist/workspace/types.d.ts +41 -1
- package/dist/workspace/types.d.ts.map +1 -1
- package/dist/workspace/types.js +0 -4
- package/dist/workspace/types.js.map +1 -1
- package/dist/workspace/workspace-manager.d.ts +17 -5
- package/dist/workspace/workspace-manager.d.ts.map +1 -1
- package/dist/workspace/workspace-manager.js +55 -11
- package/dist/workspace/workspace-manager.js.map +1 -1
- package/dist/workspace-path-CWVrcuPL.d.ts +21 -0
- package/package.json +43 -2
- package/src/document/document-session.ts +834 -0
- package/src/document/filesystem-target.ts +109 -0
- package/src/document/index.ts +41 -0
- package/src/document/recovery-journal.ts +536 -0
- package/src/document/types.ts +116 -0
- package/src/filesystem/commit-lock.ts +29 -0
- package/src/filesystem/dbk-workspace.ts +135 -0
- package/src/filesystem/electron-provider-v2.ts +630 -0
- package/src/filesystem/electron-provider.ts +25 -14
- package/src/filesystem/electron.ts +3 -0
- package/src/filesystem/filesystem-content-container.ts +53 -15
- package/src/filesystem/fs-error.ts +234 -0
- package/src/filesystem/index.ts +119 -0
- package/src/filesystem/indexeddb-content-container.ts +20 -12
- package/src/filesystem/indexeddb-provider-v2.ts +1740 -0
- package/src/filesystem/indexeddb-provider.ts +126 -300
- package/src/filesystem/indexeddb-store.ts +207 -0
- package/src/filesystem/indexeddb.ts +12 -0
- package/src/filesystem/legacy-v2-adapter.ts +779 -0
- package/src/filesystem/memory-provider-v2.ts +896 -0
- package/src/filesystem/memory-provider.ts +180 -0
- package/src/filesystem/memory.ts +15 -0
- package/src/filesystem/move-entry.ts +142 -0
- package/src/filesystem/move-error.ts +159 -0
- package/src/filesystem/native-provider-v2.ts +1165 -0
- package/src/filesystem/native-provider.ts +194 -41
- package/src/filesystem/native.ts +16 -0
- package/src/filesystem/types.ts +49 -4
- package/src/filesystem/v2.ts +231 -0
- package/src/filesystem/workspace-path.ts +92 -0
- package/src/host/filesystem-v2.ts +104 -0
- package/src/host/git.ts +246 -0
- package/src/host/index.ts +46 -0
- package/src/host/types.ts +155 -34
- package/src/host/wire-policy.ts +103 -0
- package/src/index.ts +2 -1
- package/src/mcp/index.ts +3 -0
- package/src/mcp/types.ts +594 -0
- package/src/mcp/wire.ts +1280 -0
- package/src/mcp/zod.ts +1000 -0
- package/src/vscode/index.ts +2 -0
- package/src/vscode/messages.ts +704 -0
- package/src/workspace/index.ts +8 -1
- package/src/workspace/reconcile-electron.ts +65 -0
- package/src/workspace/types.ts +39 -1
- package/src/workspace/workspace-manager.ts +71 -10
- package/dist/chunk-GUNM43XZ.js +0 -63
- package/dist/chunk-GUNM43XZ.js.map +0 -1
- package/dist/chunk-IM7LCQJ6.js +0 -850
- package/dist/chunk-IM7LCQJ6.js.map +0 -1
- package/dist/chunk-ME76RUMR.js.map +0 -1
- package/dist/index-pgBHBQ9G.d.ts +0 -213
|
@@ -0,0 +1,563 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ELECTRON_FILE_SYSTEM_V2_CAPABILITIES,
|
|
3
|
+
maybeGetDocBlocksHost
|
|
4
|
+
} from "./chunk-RVQHY3XU.js";
|
|
5
|
+
import {
|
|
6
|
+
parseFileSystemVersion
|
|
7
|
+
} from "./chunk-AYZ4HN5M.js";
|
|
8
|
+
import {
|
|
9
|
+
FsError,
|
|
10
|
+
WORKSPACE_ROOT,
|
|
11
|
+
deserializeFsError,
|
|
12
|
+
fsErrorFromUnknown,
|
|
13
|
+
isSerializedFsError,
|
|
14
|
+
parseWorkspacePath,
|
|
15
|
+
workspacePathBasename,
|
|
16
|
+
workspacePathDirname
|
|
17
|
+
} from "./chunk-SI2LU2RP.js";
|
|
18
|
+
|
|
19
|
+
// src/filesystem/electron-provider-v2.ts
|
|
20
|
+
var fallbackInstanceSequence = 0;
|
|
21
|
+
function getHostFsV2(operation) {
|
|
22
|
+
const host = maybeGetDocBlocksHost();
|
|
23
|
+
if (!host?.fsV2) {
|
|
24
|
+
throw new FsError("not-supported", "Electron filesystem v2 host is unavailable.", {
|
|
25
|
+
operation
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return host.fsV2;
|
|
29
|
+
}
|
|
30
|
+
var ElectronFileSystemProviderV2 = class {
|
|
31
|
+
constructor(id, label, rootPath) {
|
|
32
|
+
this.capabilities = ELECTRON_FILE_SYSTEM_V2_CAPABILITIES;
|
|
33
|
+
this.instanceId = createInstanceId();
|
|
34
|
+
this.watchers = /* @__PURE__ */ new Map();
|
|
35
|
+
this.subscriptions = /* @__PURE__ */ new Set();
|
|
36
|
+
this.inFlight = /* @__PURE__ */ new Set();
|
|
37
|
+
this.openPromise = null;
|
|
38
|
+
this.removeWatchBridge = null;
|
|
39
|
+
this.disposePromise = null;
|
|
40
|
+
this.hostOpened = false;
|
|
41
|
+
this.disposed = false;
|
|
42
|
+
this.id = id;
|
|
43
|
+
this.label = label;
|
|
44
|
+
this.rootPath = rootPath;
|
|
45
|
+
}
|
|
46
|
+
getRootPath() {
|
|
47
|
+
return this.rootPath;
|
|
48
|
+
}
|
|
49
|
+
async stat(path) {
|
|
50
|
+
const canonical = parseWorkspacePath(String(path));
|
|
51
|
+
return this.request(
|
|
52
|
+
"stat",
|
|
53
|
+
() => getHostFsV2("stat").stat(this.instanceId, canonical),
|
|
54
|
+
(value) => value ? normalizeEntry(value) : null
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
async readFile(path) {
|
|
58
|
+
const canonical = parseWorkspacePath(String(path));
|
|
59
|
+
return this.request(
|
|
60
|
+
"read",
|
|
61
|
+
() => getHostFsV2("read").readFile(this.instanceId, canonical),
|
|
62
|
+
(value) => {
|
|
63
|
+
if (!value) return null;
|
|
64
|
+
const entry = normalizeFile(value.entry);
|
|
65
|
+
const data = copyWireBuffer(value.data);
|
|
66
|
+
if (data.byteLength !== entry.size) {
|
|
67
|
+
throw new TypeError("Filesystem transport returned file bytes with the wrong size.");
|
|
68
|
+
}
|
|
69
|
+
return Object.freeze({ entry, data });
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
async readDirectory(path) {
|
|
74
|
+
const canonical = parseWorkspacePath(String(path));
|
|
75
|
+
return this.request(
|
|
76
|
+
"list",
|
|
77
|
+
() => getHostFsV2("list").readDirectory(this.instanceId, canonical),
|
|
78
|
+
(value) => normalizeDirectoryListing(value, canonical)
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
async writeFile(path, data, options) {
|
|
82
|
+
const canonical = parseWorkspacePath(String(path));
|
|
83
|
+
const owned = copyBytes(data);
|
|
84
|
+
return this.request(
|
|
85
|
+
"write",
|
|
86
|
+
() => getHostFsV2("write").writeFile(this.instanceId, canonical, owned, options),
|
|
87
|
+
normalizeFile
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
async createDirectory(path, options) {
|
|
91
|
+
const canonical = parseWorkspacePath(String(path));
|
|
92
|
+
return this.request(
|
|
93
|
+
"create-directory",
|
|
94
|
+
() => getHostFsV2("create-directory").createDirectory(this.instanceId, canonical, options),
|
|
95
|
+
normalizeDirectory
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
async remove(path, options) {
|
|
99
|
+
const canonical = parseWorkspacePath(String(path));
|
|
100
|
+
return this.request(
|
|
101
|
+
"remove",
|
|
102
|
+
() => getHostFsV2("remove").remove(this.instanceId, canonical, options),
|
|
103
|
+
normalizeRemoveResult
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
async move(oldPath, newPath, options) {
|
|
107
|
+
const source = parseWorkspacePath(String(oldPath));
|
|
108
|
+
const destination = parseWorkspacePath(String(newPath));
|
|
109
|
+
return this.request(
|
|
110
|
+
"move",
|
|
111
|
+
() => getHostFsV2("move").move(this.instanceId, source, destination, options),
|
|
112
|
+
normalizeEntry
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
async snapshot() {
|
|
116
|
+
return this.request(
|
|
117
|
+
"snapshot",
|
|
118
|
+
() => getHostFsV2("snapshot").snapshot(this.instanceId),
|
|
119
|
+
normalizeSnapshot
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
watch(listener, options = {}) {
|
|
123
|
+
this.assertOpen("watch");
|
|
124
|
+
this.ensureWatchBridge();
|
|
125
|
+
const subscriptionId = createInstanceId();
|
|
126
|
+
const watcher = { listener, onError: options.onError };
|
|
127
|
+
this.watchers.set(subscriptionId, watcher);
|
|
128
|
+
let closed = false;
|
|
129
|
+
let subscribed = false;
|
|
130
|
+
let closePromise = null;
|
|
131
|
+
const ready = this.ensureOpen("watch").then(async () => {
|
|
132
|
+
if (closed) return;
|
|
133
|
+
unwrap(await getHostFsV2("watch").watchSubscribe(this.instanceId, subscriptionId), "watch");
|
|
134
|
+
subscribed = true;
|
|
135
|
+
}).catch((error) => {
|
|
136
|
+
closed = true;
|
|
137
|
+
this.watchers.delete(subscriptionId);
|
|
138
|
+
const typed = error instanceof FsError ? error : new FsError("io", String(error));
|
|
139
|
+
try {
|
|
140
|
+
watcher.onError?.(typed);
|
|
141
|
+
} catch {
|
|
142
|
+
}
|
|
143
|
+
throw typed;
|
|
144
|
+
});
|
|
145
|
+
const subscription = {
|
|
146
|
+
get closed() {
|
|
147
|
+
return closed;
|
|
148
|
+
},
|
|
149
|
+
ready,
|
|
150
|
+
dispose: () => {
|
|
151
|
+
if (closePromise) return closePromise;
|
|
152
|
+
closed = true;
|
|
153
|
+
this.watchers.delete(subscriptionId);
|
|
154
|
+
this.subscriptions.delete(subscription);
|
|
155
|
+
closePromise = (async () => {
|
|
156
|
+
await ready.catch(() => void 0);
|
|
157
|
+
if (subscribed) {
|
|
158
|
+
unwrap(
|
|
159
|
+
await getHostFsV2("watch").watchUnsubscribe(this.instanceId, subscriptionId),
|
|
160
|
+
"watch"
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
})();
|
|
164
|
+
return closePromise;
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
this.subscriptions.add(subscription);
|
|
168
|
+
return subscription;
|
|
169
|
+
}
|
|
170
|
+
dispose() {
|
|
171
|
+
if (this.disposePromise) return this.disposePromise;
|
|
172
|
+
this.disposed = true;
|
|
173
|
+
this.disposePromise = (async () => {
|
|
174
|
+
await Promise.allSettled([...this.inFlight]);
|
|
175
|
+
await Promise.all([...this.subscriptions].map((subscription) => subscription.dispose()));
|
|
176
|
+
try {
|
|
177
|
+
if (this.openPromise) {
|
|
178
|
+
try {
|
|
179
|
+
await this.openPromise;
|
|
180
|
+
} catch {
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
if (this.hostOpened) {
|
|
184
|
+
try {
|
|
185
|
+
unwrap(await getHostFsV2("dispose").dispose(this.instanceId), "dispose");
|
|
186
|
+
} catch (error) {
|
|
187
|
+
if (!(error instanceof FsError && error.code === "closed")) throw error;
|
|
188
|
+
} finally {
|
|
189
|
+
this.hostOpened = false;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
} finally {
|
|
193
|
+
this.removeWatchBridge?.();
|
|
194
|
+
this.removeWatchBridge = null;
|
|
195
|
+
}
|
|
196
|
+
})();
|
|
197
|
+
return this.disposePromise;
|
|
198
|
+
}
|
|
199
|
+
request(operation, send, normalize) {
|
|
200
|
+
this.assertOpen(operation);
|
|
201
|
+
const promise = this.ensureOpen(operation).then(async () => {
|
|
202
|
+
try {
|
|
203
|
+
return normalize(unwrap(await send(), operation));
|
|
204
|
+
} catch (error) {
|
|
205
|
+
throw transportErrorFromUnknown(error, operation);
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
this.inFlight.add(promise);
|
|
209
|
+
void promise.then(
|
|
210
|
+
() => this.inFlight.delete(promise),
|
|
211
|
+
() => this.inFlight.delete(promise)
|
|
212
|
+
);
|
|
213
|
+
return promise;
|
|
214
|
+
}
|
|
215
|
+
ensureOpen(operation) {
|
|
216
|
+
this.assertOpen(operation);
|
|
217
|
+
if (!this.openPromise) {
|
|
218
|
+
const attempt = getHostFsV2(operation).open({
|
|
219
|
+
instanceId: this.instanceId,
|
|
220
|
+
providerId: this.id,
|
|
221
|
+
label: this.label
|
|
222
|
+
}).then((result) => {
|
|
223
|
+
if (isRecord(result) && result.ok === true) this.hostOpened = true;
|
|
224
|
+
const capabilities = unwrap(result, operation);
|
|
225
|
+
assertCapabilities(capabilities, operation);
|
|
226
|
+
}).catch((error) => {
|
|
227
|
+
const typed = withOperation(fsErrorFromUnknown(error, { operation }), operation);
|
|
228
|
+
if (typed.retryable && this.openPromise === attempt) this.openPromise = null;
|
|
229
|
+
throw typed;
|
|
230
|
+
});
|
|
231
|
+
this.openPromise = attempt;
|
|
232
|
+
}
|
|
233
|
+
return this.openPromise;
|
|
234
|
+
}
|
|
235
|
+
ensureWatchBridge() {
|
|
236
|
+
if (this.removeWatchBridge) return;
|
|
237
|
+
this.removeWatchBridge = getHostFsV2("watch").onWatchMessage(
|
|
238
|
+
(message) => this.handleWatchMessage(message)
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
handleWatchMessage(message) {
|
|
242
|
+
if (message.instanceId !== this.instanceId) return;
|
|
243
|
+
const watcher = this.watchers.get(message.subscriptionId);
|
|
244
|
+
if (!watcher) return;
|
|
245
|
+
if (message.kind === "error") {
|
|
246
|
+
const typed = isSerializedFsError(message.error) ? deserializeFsError(message.error) : invalidTransport("watch", "Filesystem transport returned an invalid watch error.");
|
|
247
|
+
try {
|
|
248
|
+
watcher.onError?.(typed);
|
|
249
|
+
} catch {
|
|
250
|
+
}
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
let event;
|
|
254
|
+
try {
|
|
255
|
+
event = normalizeWatchEvent(message.event);
|
|
256
|
+
} catch (error) {
|
|
257
|
+
try {
|
|
258
|
+
watcher.onError?.(transportErrorFromUnknown(error, "watch"));
|
|
259
|
+
} catch {
|
|
260
|
+
}
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
try {
|
|
264
|
+
watcher.listener(event);
|
|
265
|
+
} catch {
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
assertOpen(operation) {
|
|
269
|
+
if (!this.disposed) return;
|
|
270
|
+
throw new FsError("disposed", "Filesystem provider is disposed.", { operation });
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
function unwrap(result, operation) {
|
|
274
|
+
if (!isRecord(result) || typeof result.ok !== "boolean") {
|
|
275
|
+
throw invalidTransport(operation, "Filesystem transport returned an invalid result envelope.");
|
|
276
|
+
}
|
|
277
|
+
if (result.ok) {
|
|
278
|
+
if (!("value" in result)) {
|
|
279
|
+
throw invalidTransport(operation, "Filesystem transport omitted a result value.");
|
|
280
|
+
}
|
|
281
|
+
return result.value;
|
|
282
|
+
}
|
|
283
|
+
if (!isSerializedFsError(result.error)) {
|
|
284
|
+
throw invalidTransport(operation, "Filesystem transport returned an invalid error envelope.");
|
|
285
|
+
}
|
|
286
|
+
throw deserializeFsError(result.error);
|
|
287
|
+
}
|
|
288
|
+
function normalizeEntry(entry) {
|
|
289
|
+
if (!isRecord(entry)) throw new TypeError("Expected a filesystem entry object.");
|
|
290
|
+
if (typeof entry.path !== "string")
|
|
291
|
+
throw new TypeError("Filesystem entry path must be a string.");
|
|
292
|
+
if (typeof entry.name !== "string")
|
|
293
|
+
throw new TypeError("Filesystem entry name must be a string.");
|
|
294
|
+
if (typeof entry.lastModified !== "string") {
|
|
295
|
+
throw new TypeError("Filesystem entry timestamp must be a string.");
|
|
296
|
+
}
|
|
297
|
+
const path = parseWorkspacePath(entry.path);
|
|
298
|
+
if (entry.name !== workspacePathBasename(path)) {
|
|
299
|
+
throw new TypeError("Filesystem entry name does not match its canonical path.");
|
|
300
|
+
}
|
|
301
|
+
const common = {
|
|
302
|
+
path,
|
|
303
|
+
name: entry.name,
|
|
304
|
+
version: parseFileSystemVersion(entry.version),
|
|
305
|
+
lastModified: new Date(entry.lastModified).toISOString()
|
|
306
|
+
};
|
|
307
|
+
if (entry.kind === "file") {
|
|
308
|
+
if (!isNonNegativeSafeInteger(entry.size)) {
|
|
309
|
+
throw new TypeError("Filesystem file size must be a non-negative safe integer.");
|
|
310
|
+
}
|
|
311
|
+
return Object.freeze({ ...common, kind: "file", size: entry.size });
|
|
312
|
+
}
|
|
313
|
+
if (entry.kind === "directory") {
|
|
314
|
+
if (entry.size !== null) throw new TypeError("Filesystem directory size must be null.");
|
|
315
|
+
return Object.freeze({ ...common, kind: "directory", size: null });
|
|
316
|
+
}
|
|
317
|
+
throw new TypeError("Unknown filesystem entry kind.");
|
|
318
|
+
}
|
|
319
|
+
function normalizeDirectoryListing(value, parent) {
|
|
320
|
+
if (!Array.isArray(value)) throw new TypeError("Expected a filesystem directory listing.");
|
|
321
|
+
const entries = value.map(normalizeEntry);
|
|
322
|
+
const seen = /* @__PURE__ */ new Set();
|
|
323
|
+
for (const entry of entries) {
|
|
324
|
+
if (entry.path === WORKSPACE_ROOT || workspacePathDirname(entry.path) !== parent) {
|
|
325
|
+
throw new TypeError("Filesystem listing contained a non-child entry.");
|
|
326
|
+
}
|
|
327
|
+
if (seen.has(entry.path)) throw new TypeError("Filesystem listing contained a duplicate path.");
|
|
328
|
+
seen.add(entry.path);
|
|
329
|
+
}
|
|
330
|
+
const ordered = [...entries].sort(compareDirectoryEntries);
|
|
331
|
+
if (ordered.some((entry, index) => entry.path !== entries[index]?.path)) {
|
|
332
|
+
throw new TypeError("Filesystem listing was not in canonical deterministic order.");
|
|
333
|
+
}
|
|
334
|
+
return Object.freeze(entries);
|
|
335
|
+
}
|
|
336
|
+
function normalizeFile(entry) {
|
|
337
|
+
const normalized = normalizeEntry(entry);
|
|
338
|
+
if (normalized.kind !== "file") throw new TypeError("Expected a file snapshot.");
|
|
339
|
+
return normalized;
|
|
340
|
+
}
|
|
341
|
+
function normalizeDirectory(entry) {
|
|
342
|
+
const normalized = normalizeEntry(entry);
|
|
343
|
+
if (normalized.kind !== "directory") throw new TypeError("Expected a directory snapshot.");
|
|
344
|
+
return normalized;
|
|
345
|
+
}
|
|
346
|
+
function normalizeSnapshot(snapshot) {
|
|
347
|
+
if (!isRecord(snapshot) || !Array.isArray(snapshot.entries)) {
|
|
348
|
+
throw new TypeError("Expected a filesystem snapshot object.");
|
|
349
|
+
}
|
|
350
|
+
const version = parseFileSystemVersion(snapshot.version);
|
|
351
|
+
const entries = snapshot.entries.map((entry) => {
|
|
352
|
+
if (entry.kind === "file") {
|
|
353
|
+
const file = normalizeFile(entry);
|
|
354
|
+
const data = copyWireBuffer(entry.data);
|
|
355
|
+
if (data.byteLength !== file.size) {
|
|
356
|
+
throw new TypeError("Filesystem snapshot file bytes have the wrong size.");
|
|
357
|
+
}
|
|
358
|
+
return Object.freeze({ ...file, data });
|
|
359
|
+
}
|
|
360
|
+
if (entry.kind === "directory") return normalizeDirectory(entry);
|
|
361
|
+
throw new TypeError("Unknown filesystem snapshot entry kind.");
|
|
362
|
+
});
|
|
363
|
+
const roots = entries.filter((entry) => entry.path === WORKSPACE_ROOT);
|
|
364
|
+
if (roots.length !== 1 || roots[0]?.kind !== "directory" || roots[0].version !== version) {
|
|
365
|
+
throw new TypeError("Filesystem snapshot must contain one matching root directory.");
|
|
366
|
+
}
|
|
367
|
+
const seen = /* @__PURE__ */ new Set();
|
|
368
|
+
for (const entry of entries) {
|
|
369
|
+
if (seen.has(entry.path))
|
|
370
|
+
throw new TypeError("Filesystem snapshot contained a duplicate path.");
|
|
371
|
+
seen.add(entry.path);
|
|
372
|
+
}
|
|
373
|
+
const ordered = [...entries].sort((left, right) => compareText(left.path, right.path));
|
|
374
|
+
if (ordered.some((entry, index) => entry.path !== entries[index]?.path)) {
|
|
375
|
+
throw new TypeError("Filesystem snapshot was not in canonical deterministic order.");
|
|
376
|
+
}
|
|
377
|
+
return Object.freeze({
|
|
378
|
+
version,
|
|
379
|
+
entries: Object.freeze(entries)
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
function normalizeWatchEvent(event) {
|
|
383
|
+
if (!isRecord(event)) throw new TypeError("Expected a filesystem watch event object.");
|
|
384
|
+
if (!isPositiveSafeInteger(event.sequence)) {
|
|
385
|
+
throw new TypeError("Filesystem watch sequence must be a positive safe integer.");
|
|
386
|
+
}
|
|
387
|
+
if (!isWatchOrigin(event.origin)) throw new TypeError("Unknown filesystem watch origin.");
|
|
388
|
+
if (typeof event.path !== "string") throw new TypeError("Watch event path must be a string.");
|
|
389
|
+
const path = parseWorkspacePath(event.path);
|
|
390
|
+
if (event.type === "overflow") {
|
|
391
|
+
if (event.kind !== null || event.destinationPath !== null || event.version !== null || event.previousVersion !== null) {
|
|
392
|
+
throw new TypeError("Filesystem overflow event has entry-specific fields.");
|
|
393
|
+
}
|
|
394
|
+
return Object.freeze({
|
|
395
|
+
sequence: event.sequence,
|
|
396
|
+
origin: event.origin,
|
|
397
|
+
type: "overflow",
|
|
398
|
+
kind: null,
|
|
399
|
+
path,
|
|
400
|
+
destinationPath: null,
|
|
401
|
+
version: null,
|
|
402
|
+
previousVersion: null
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
if (!isEntryWatchType(event.type)) throw new TypeError("Unknown filesystem watch event type.");
|
|
406
|
+
if (event.kind !== "file" && event.kind !== "directory") {
|
|
407
|
+
throw new TypeError("Unknown filesystem watch entry kind.");
|
|
408
|
+
}
|
|
409
|
+
const destinationPath = event.destinationPath === null ? null : typeof event.destinationPath === "string" ? parseWorkspacePath(event.destinationPath) : (() => {
|
|
410
|
+
throw new TypeError("Watch destination path must be a string or null.");
|
|
411
|
+
})();
|
|
412
|
+
if (event.type === "moved" !== (destinationPath !== null)) {
|
|
413
|
+
throw new TypeError("Only moved watch events may have a destination path.");
|
|
414
|
+
}
|
|
415
|
+
return Object.freeze({
|
|
416
|
+
sequence: event.sequence,
|
|
417
|
+
origin: event.origin,
|
|
418
|
+
type: event.type,
|
|
419
|
+
kind: event.kind,
|
|
420
|
+
path,
|
|
421
|
+
destinationPath,
|
|
422
|
+
version: event.version === null ? null : parseFileSystemVersion(event.version),
|
|
423
|
+
previousVersion: event.previousVersion === null ? null : parseFileSystemVersion(event.previousVersion)
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
function normalizeRemoveResult(value) {
|
|
427
|
+
if (!isRecord(value) || typeof value.removed !== "boolean") {
|
|
428
|
+
throw new TypeError("Filesystem transport returned an invalid remove result.");
|
|
429
|
+
}
|
|
430
|
+
return Object.freeze({ removed: value.removed, version: parseFileSystemVersion(value.version) });
|
|
431
|
+
}
|
|
432
|
+
function assertCapabilities(value, operation) {
|
|
433
|
+
if (!isRecord(value)) {
|
|
434
|
+
throw invalidTransport(operation, "Filesystem host returned invalid capabilities.");
|
|
435
|
+
}
|
|
436
|
+
for (const key of Object.keys(ELECTRON_FILE_SYSTEM_V2_CAPABILITIES)) {
|
|
437
|
+
if (value[key] !== ELECTRON_FILE_SYSTEM_V2_CAPABILITIES[key]) {
|
|
438
|
+
throw invalidTransport(operation, `Filesystem host capability mismatch: ${key}.`);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
function compareDirectoryEntries(left, right) {
|
|
443
|
+
if (left.kind !== right.kind) return left.kind === "directory" ? -1 : 1;
|
|
444
|
+
return compareText(left.path, right.path);
|
|
445
|
+
}
|
|
446
|
+
function compareText(left, right) {
|
|
447
|
+
return left < right ? -1 : left > right ? 1 : 0;
|
|
448
|
+
}
|
|
449
|
+
function isWatchOrigin(value) {
|
|
450
|
+
return value === "local" || value === "external" || value === "unknown";
|
|
451
|
+
}
|
|
452
|
+
function isEntryWatchType(value) {
|
|
453
|
+
return value === "created" || value === "modified" || value === "removed" || value === "moved";
|
|
454
|
+
}
|
|
455
|
+
function isNonNegativeSafeInteger(value) {
|
|
456
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
|
|
457
|
+
}
|
|
458
|
+
function isPositiveSafeInteger(value) {
|
|
459
|
+
return isNonNegativeSafeInteger(value) && value > 0;
|
|
460
|
+
}
|
|
461
|
+
function isRecord(value) {
|
|
462
|
+
return typeof value === "object" && value !== null;
|
|
463
|
+
}
|
|
464
|
+
function invalidTransport(operation, message) {
|
|
465
|
+
return new FsError("io", message, { operation, retryable: false });
|
|
466
|
+
}
|
|
467
|
+
function transportErrorFromUnknown(error, operation) {
|
|
468
|
+
if (error instanceof TypeError) return invalidTransport(operation, error.message);
|
|
469
|
+
return withOperation(fsErrorFromUnknown(error, { operation }), operation);
|
|
470
|
+
}
|
|
471
|
+
function withOperation(error, operation) {
|
|
472
|
+
if (error.operation === operation) return error;
|
|
473
|
+
return new FsError(error.code, error.message, {
|
|
474
|
+
operation,
|
|
475
|
+
path: error.path ?? void 0,
|
|
476
|
+
destinationPath: error.destinationPath ?? void 0,
|
|
477
|
+
retryable: error.retryable
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
function copyBytes(data) {
|
|
481
|
+
const source = ArrayBuffer.isView(data) ? new Uint8Array(data.buffer, data.byteOffset, data.byteLength) : new Uint8Array(data);
|
|
482
|
+
const copy = new Uint8Array(source.byteLength);
|
|
483
|
+
copy.set(source);
|
|
484
|
+
return copy.buffer;
|
|
485
|
+
}
|
|
486
|
+
function copyWireBuffer(data) {
|
|
487
|
+
if (Object.prototype.toString.call(data) !== "[object ArrayBuffer]") {
|
|
488
|
+
throw new TypeError("Expected an ArrayBuffer from the filesystem transport.");
|
|
489
|
+
}
|
|
490
|
+
return data.slice(0);
|
|
491
|
+
}
|
|
492
|
+
function createInstanceId() {
|
|
493
|
+
const randomUUID = globalThis.crypto?.randomUUID;
|
|
494
|
+
if (typeof randomUUID === "function") return randomUUID.call(globalThis.crypto);
|
|
495
|
+
fallbackInstanceSequence += 1;
|
|
496
|
+
return `electron-fs-v2-${Date.now()}-${fallbackInstanceSequence}`;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
// src/filesystem/electron-provider.ts
|
|
500
|
+
function getHostFs() {
|
|
501
|
+
const host = maybeGetDocBlocksHost();
|
|
502
|
+
if (!host) {
|
|
503
|
+
throw new Error(
|
|
504
|
+
"ElectronFileSystemProvider: docBlocksHost is not available \u2014 not running under Electron?"
|
|
505
|
+
);
|
|
506
|
+
}
|
|
507
|
+
return host.fs;
|
|
508
|
+
}
|
|
509
|
+
var ElectronFileSystemProvider = class {
|
|
510
|
+
constructor(id, label, rootPath) {
|
|
511
|
+
this.id = id;
|
|
512
|
+
this.label = label;
|
|
513
|
+
this.rootPath = rootPath;
|
|
514
|
+
this.v2 = new ElectronFileSystemProviderV2(id, label, rootPath);
|
|
515
|
+
}
|
|
516
|
+
/** Absolute path this provider is rooted at. */
|
|
517
|
+
getRootPath() {
|
|
518
|
+
return this.rootPath;
|
|
519
|
+
}
|
|
520
|
+
readFile(path) {
|
|
521
|
+
return getHostFs().readFile(this.id, path);
|
|
522
|
+
}
|
|
523
|
+
writeFile(path, content) {
|
|
524
|
+
return getHostFs().writeFile(this.id, path, content);
|
|
525
|
+
}
|
|
526
|
+
commitFile(path, content, expectedContent) {
|
|
527
|
+
return getHostFs().commitFile(this.id, path, content, expectedContent);
|
|
528
|
+
}
|
|
529
|
+
delete(path) {
|
|
530
|
+
return getHostFs().delete(this.id, path);
|
|
531
|
+
}
|
|
532
|
+
rename(oldPath, newPath) {
|
|
533
|
+
return getHostFs().rename(this.id, oldPath, newPath);
|
|
534
|
+
}
|
|
535
|
+
readDirectory(path) {
|
|
536
|
+
return getHostFs().readDirectory(this.id, path);
|
|
537
|
+
}
|
|
538
|
+
exists(path) {
|
|
539
|
+
return getHostFs().exists(this.id, path);
|
|
540
|
+
}
|
|
541
|
+
createDirectory(path) {
|
|
542
|
+
return getHostFs().createDirectory(this.id, path);
|
|
543
|
+
}
|
|
544
|
+
stat(path) {
|
|
545
|
+
return getHostFs().stat(this.id, path);
|
|
546
|
+
}
|
|
547
|
+
readBinary(path) {
|
|
548
|
+
return getHostFs().readBinary(this.id, path);
|
|
549
|
+
}
|
|
550
|
+
writeBinary(path, data) {
|
|
551
|
+
return getHostFs().writeBinary(this.id, path, data);
|
|
552
|
+
}
|
|
553
|
+
/** Subscribe to external change notifications under this root. */
|
|
554
|
+
watch(onChange) {
|
|
555
|
+
return getHostFs().watch(this.id, onChange);
|
|
556
|
+
}
|
|
557
|
+
};
|
|
558
|
+
|
|
559
|
+
export {
|
|
560
|
+
ElectronFileSystemProviderV2,
|
|
561
|
+
ElectronFileSystemProvider
|
|
562
|
+
};
|
|
563
|
+
//# sourceMappingURL=chunk-GCPBEMMH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/filesystem/electron-provider-v2.ts","../src/filesystem/electron-provider.ts"],"sourcesContent":["import {\n ELECTRON_FILE_SYSTEM_V2_CAPABILITIES,\n maybeGetDocBlocksHost,\n type DocBlocksHostFsV2API,\n type HostFileSystemV2Result,\n type HostFileSystemV2WatchMessage,\n} from '../host/index.js';\nimport {\n FsError,\n deserializeFsError,\n fsErrorFromUnknown,\n isSerializedFsError,\n type FsOperation,\n} from './fs-error.js';\nimport {\n WORKSPACE_ROOT,\n parseWorkspacePath,\n workspacePathBasename,\n workspacePathDirname,\n type WorkspacePath,\n} from './workspace-path.js';\nimport {\n parseFileSystemVersion,\n type FileSystemCreateDirectoryOptions,\n type FileSystemDirectorySnapshot,\n type FileSystemEntrySnapshot,\n type FileSystemFileRead,\n type FileSystemFileSnapshot,\n type FileSystemMoveOptions,\n type FileSystemProviderCapabilities,\n type FileSystemProviderV2,\n type FileSystemRemoveOptions,\n type FileSystemRemoveResult,\n type FileSystemSnapshot,\n type FileSystemSnapshotEntry,\n type FileSystemWatchEvent,\n type FileSystemWatchOptions,\n type FileSystemWatchSubscription,\n type FileSystemWriteOptions,\n} from './v2.js';\n\ninterface ClientWatcher {\n readonly listener: (event: FileSystemWatchEvent) => void;\n readonly onError: FileSystemWatchOptions['onError'];\n}\n\nlet fallbackInstanceSequence = 0;\n\nfunction getHostFsV2(operation: FsOperation): DocBlocksHostFsV2API {\n const host = maybeGetDocBlocksHost();\n if (!host?.fsV2) {\n throw new FsError('not-supported', 'Electron filesystem v2 host is unavailable.', {\n operation,\n });\n }\n return host.fsV2;\n}\n\n/** Pure renderer-side client for the typed Electron filesystem v2 transport. */\nexport class ElectronFileSystemProviderV2 implements FileSystemProviderV2 {\n public readonly id: string;\n public readonly label: string;\n public readonly capabilities = ELECTRON_FILE_SYSTEM_V2_CAPABILITIES;\n\n private readonly rootPath: string;\n private readonly instanceId = createInstanceId();\n private readonly watchers = new Map<string, ClientWatcher>();\n private readonly subscriptions = new Set<FileSystemWatchSubscription>();\n private readonly inFlight = new Set<Promise<unknown>>();\n private openPromise: Promise<void> | null = null;\n private removeWatchBridge: (() => void) | null = null;\n private disposePromise: Promise<void> | null = null;\n private hostOpened = false;\n private disposed = false;\n\n public constructor(id: string, label: string, rootPath: string) {\n this.id = id;\n this.label = label;\n this.rootPath = rootPath;\n }\n\n public getRootPath(): string {\n return this.rootPath;\n }\n\n public async stat(path: WorkspacePath): Promise<FileSystemEntrySnapshot | null> {\n const canonical = parseWorkspacePath(String(path));\n return this.request(\n 'stat',\n () => getHostFsV2('stat').stat(this.instanceId, canonical),\n (value) => (value ? normalizeEntry(value) : null),\n );\n }\n\n public async readFile(path: WorkspacePath): Promise<FileSystemFileRead | null> {\n const canonical = parseWorkspacePath(String(path));\n return this.request(\n 'read',\n () => getHostFsV2('read').readFile(this.instanceId, canonical),\n (value) => {\n if (!value) return null;\n const entry = normalizeFile(value.entry);\n const data = copyWireBuffer(value.data);\n if (data.byteLength !== entry.size) {\n throw new TypeError('Filesystem transport returned file bytes with the wrong size.');\n }\n return Object.freeze({ entry, data });\n },\n );\n }\n\n public async readDirectory(path: WorkspacePath): Promise<readonly FileSystemEntrySnapshot[]> {\n const canonical = parseWorkspacePath(String(path));\n return this.request(\n 'list',\n () => getHostFsV2('list').readDirectory(this.instanceId, canonical),\n (value) => normalizeDirectoryListing(value, canonical),\n );\n }\n\n public async writeFile(\n path: WorkspacePath,\n data: ArrayBuffer | Uint8Array,\n options?: FileSystemWriteOptions,\n ): Promise<FileSystemFileSnapshot> {\n const canonical = parseWorkspacePath(String(path));\n const owned = copyBytes(data);\n return this.request(\n 'write',\n () => getHostFsV2('write').writeFile(this.instanceId, canonical, owned, options),\n normalizeFile,\n );\n }\n\n public async createDirectory(\n path: WorkspacePath,\n options?: FileSystemCreateDirectoryOptions,\n ): Promise<FileSystemDirectorySnapshot> {\n const canonical = parseWorkspacePath(String(path));\n return this.request(\n 'create-directory',\n () => getHostFsV2('create-directory').createDirectory(this.instanceId, canonical, options),\n normalizeDirectory,\n );\n }\n\n public async remove(\n path: WorkspacePath,\n options?: FileSystemRemoveOptions,\n ): Promise<FileSystemRemoveResult> {\n const canonical = parseWorkspacePath(String(path));\n return this.request(\n 'remove',\n () => getHostFsV2('remove').remove(this.instanceId, canonical, options),\n normalizeRemoveResult,\n );\n }\n\n public async move(\n oldPath: WorkspacePath,\n newPath: WorkspacePath,\n options?: FileSystemMoveOptions,\n ): Promise<FileSystemEntrySnapshot> {\n const source = parseWorkspacePath(String(oldPath));\n const destination = parseWorkspacePath(String(newPath));\n return this.request(\n 'move',\n () => getHostFsV2('move').move(this.instanceId, source, destination, options),\n normalizeEntry,\n );\n }\n\n public async snapshot(): Promise<FileSystemSnapshot> {\n return this.request(\n 'snapshot',\n () => getHostFsV2('snapshot').snapshot(this.instanceId),\n normalizeSnapshot,\n );\n }\n\n public watch(\n listener: (event: FileSystemWatchEvent) => void,\n options: FileSystemWatchOptions = {},\n ): FileSystemWatchSubscription {\n this.assertOpen('watch');\n this.ensureWatchBridge();\n const subscriptionId = createInstanceId();\n const watcher: ClientWatcher = { listener, onError: options.onError };\n this.watchers.set(subscriptionId, watcher);\n let closed = false;\n let subscribed = false;\n let closePromise: Promise<void> | null = null;\n const ready = this.ensureOpen('watch')\n .then(async () => {\n if (closed) return;\n unwrap(await getHostFsV2('watch').watchSubscribe(this.instanceId, subscriptionId), 'watch');\n subscribed = true;\n })\n .catch((error: unknown) => {\n closed = true;\n this.watchers.delete(subscriptionId);\n const typed = error instanceof FsError ? error : new FsError('io', String(error));\n try {\n watcher.onError?.(typed);\n } catch {\n // Isolate observers.\n }\n throw typed;\n });\n\n const subscription: FileSystemWatchSubscription = {\n get closed() {\n return closed;\n },\n ready,\n dispose: () => {\n if (closePromise) return closePromise;\n closed = true;\n this.watchers.delete(subscriptionId);\n this.subscriptions.delete(subscription);\n closePromise = (async () => {\n await ready.catch(() => undefined);\n if (subscribed) {\n unwrap(\n await getHostFsV2('watch').watchUnsubscribe(this.instanceId, subscriptionId),\n 'watch',\n );\n }\n })();\n return closePromise;\n },\n };\n this.subscriptions.add(subscription);\n return subscription;\n }\n\n public dispose(): Promise<void> {\n if (this.disposePromise) return this.disposePromise;\n this.disposed = true;\n this.disposePromise = (async () => {\n await Promise.allSettled([...this.inFlight]);\n await Promise.all([...this.subscriptions].map((subscription) => subscription.dispose()));\n try {\n if (this.openPromise) {\n try {\n await this.openPromise;\n } catch {\n // A failed request normally creates no host record. `hostOpened`\n // separately tracks a successful open whose response validation\n // failed after the main-side record had already been published.\n }\n }\n if (this.hostOpened) {\n try {\n unwrap(await getHostFsV2('dispose').dispose(this.instanceId), 'dispose');\n } catch (error: unknown) {\n if (!(error instanceof FsError && error.code === 'closed')) throw error;\n } finally {\n this.hostOpened = false;\n }\n }\n } finally {\n this.removeWatchBridge?.();\n this.removeWatchBridge = null;\n }\n })();\n return this.disposePromise;\n }\n\n private request<T, U>(\n operation: FsOperation,\n send: () => Promise<HostFileSystemV2Result<T>>,\n normalize: (value: T) => U,\n ): Promise<U> {\n this.assertOpen(operation);\n const promise = this.ensureOpen(operation).then(async () => {\n try {\n return normalize(unwrap(await send(), operation));\n } catch (error: unknown) {\n throw transportErrorFromUnknown(error, operation);\n }\n });\n this.inFlight.add(promise);\n void promise.then(\n () => this.inFlight.delete(promise),\n () => this.inFlight.delete(promise),\n );\n return promise;\n }\n\n private ensureOpen(operation: FsOperation): Promise<void> {\n this.assertOpen(operation);\n if (!this.openPromise) {\n const attempt = getHostFsV2(operation)\n .open({\n instanceId: this.instanceId,\n providerId: this.id,\n label: this.label,\n })\n .then((result) => {\n if (isRecord(result) && result.ok === true) this.hostOpened = true;\n const capabilities = unwrap(result, operation);\n assertCapabilities(capabilities, operation);\n })\n .catch((error: unknown) => {\n const typed = withOperation(fsErrorFromUnknown(error, { operation }), operation);\n if (typed.retryable && this.openPromise === attempt) this.openPromise = null;\n throw typed;\n });\n this.openPromise = attempt;\n }\n return this.openPromise;\n }\n\n private ensureWatchBridge(): void {\n if (this.removeWatchBridge) return;\n this.removeWatchBridge = getHostFsV2('watch').onWatchMessage((message) =>\n this.handleWatchMessage(message),\n );\n }\n\n private handleWatchMessage(message: HostFileSystemV2WatchMessage): void {\n if (message.instanceId !== this.instanceId) return;\n const watcher = this.watchers.get(message.subscriptionId);\n if (!watcher) return;\n if (message.kind === 'error') {\n const typed = isSerializedFsError(message.error)\n ? deserializeFsError(message.error)\n : invalidTransport('watch', 'Filesystem transport returned an invalid watch error.');\n try {\n watcher.onError?.(typed);\n } catch {\n // Isolate observers.\n }\n return;\n }\n\n let event: FileSystemWatchEvent;\n try {\n event = normalizeWatchEvent(message.event);\n } catch (error: unknown) {\n try {\n watcher.onError?.(transportErrorFromUnknown(error, 'watch'));\n } catch {\n // Isolate observers.\n }\n return;\n }\n try {\n watcher.listener(event);\n } catch {\n // Watch callbacks are observational.\n }\n }\n\n private assertOpen(operation: FsOperation): void {\n if (!this.disposed) return;\n throw new FsError('disposed', 'Filesystem provider is disposed.', { operation });\n }\n}\n\nfunction unwrap<T>(result: HostFileSystemV2Result<T>, operation: FsOperation): T {\n if (!isRecord(result) || typeof result.ok !== 'boolean') {\n throw invalidTransport(operation, 'Filesystem transport returned an invalid result envelope.');\n }\n if (result.ok) {\n if (!('value' in result)) {\n throw invalidTransport(operation, 'Filesystem transport omitted a result value.');\n }\n return result.value;\n }\n if (!isSerializedFsError(result.error)) {\n throw invalidTransport(operation, 'Filesystem transport returned an invalid error envelope.');\n }\n throw deserializeFsError(result.error);\n}\n\nfunction normalizeEntry(entry: FileSystemEntrySnapshot): FileSystemEntrySnapshot {\n if (!isRecord(entry)) throw new TypeError('Expected a filesystem entry object.');\n if (typeof entry.path !== 'string')\n throw new TypeError('Filesystem entry path must be a string.');\n if (typeof entry.name !== 'string')\n throw new TypeError('Filesystem entry name must be a string.');\n if (typeof entry.lastModified !== 'string') {\n throw new TypeError('Filesystem entry timestamp must be a string.');\n }\n const path = parseWorkspacePath(entry.path);\n if (entry.name !== workspacePathBasename(path)) {\n throw new TypeError('Filesystem entry name does not match its canonical path.');\n }\n const common = {\n path,\n name: entry.name,\n version: parseFileSystemVersion(entry.version),\n lastModified: new Date(entry.lastModified).toISOString(),\n };\n if (entry.kind === 'file') {\n if (!isNonNegativeSafeInteger(entry.size)) {\n throw new TypeError('Filesystem file size must be a non-negative safe integer.');\n }\n return Object.freeze({ ...common, kind: 'file', size: entry.size });\n }\n if (entry.kind === 'directory') {\n if (entry.size !== null) throw new TypeError('Filesystem directory size must be null.');\n return Object.freeze({ ...common, kind: 'directory', size: null });\n }\n throw new TypeError('Unknown filesystem entry kind.');\n}\n\nfunction normalizeDirectoryListing(\n value: readonly FileSystemEntrySnapshot[],\n parent: WorkspacePath,\n): readonly FileSystemEntrySnapshot[] {\n if (!Array.isArray(value)) throw new TypeError('Expected a filesystem directory listing.');\n const entries = value.map(normalizeEntry);\n const seen = new Set<WorkspacePath>();\n for (const entry of entries) {\n if (entry.path === WORKSPACE_ROOT || workspacePathDirname(entry.path) !== parent) {\n throw new TypeError('Filesystem listing contained a non-child entry.');\n }\n if (seen.has(entry.path)) throw new TypeError('Filesystem listing contained a duplicate path.');\n seen.add(entry.path);\n }\n const ordered = [...entries].sort(compareDirectoryEntries);\n if (ordered.some((entry, index) => entry.path !== entries[index]?.path)) {\n throw new TypeError('Filesystem listing was not in canonical deterministic order.');\n }\n return Object.freeze(entries);\n}\n\nfunction normalizeFile(entry: FileSystemFileSnapshot): FileSystemFileSnapshot {\n const normalized = normalizeEntry(entry);\n if (normalized.kind !== 'file') throw new TypeError('Expected a file snapshot.');\n return normalized;\n}\n\nfunction normalizeDirectory(entry: FileSystemDirectorySnapshot): FileSystemDirectorySnapshot {\n const normalized = normalizeEntry(entry);\n if (normalized.kind !== 'directory') throw new TypeError('Expected a directory snapshot.');\n return normalized;\n}\n\nfunction normalizeSnapshot(snapshot: FileSystemSnapshot): FileSystemSnapshot {\n if (!isRecord(snapshot) || !Array.isArray(snapshot.entries)) {\n throw new TypeError('Expected a filesystem snapshot object.');\n }\n const version = parseFileSystemVersion(snapshot.version);\n const entries: FileSystemSnapshotEntry[] = snapshot.entries.map((entry) => {\n if (entry.kind === 'file') {\n const file = normalizeFile(entry);\n const data = copyWireBuffer(entry.data);\n if (data.byteLength !== file.size) {\n throw new TypeError('Filesystem snapshot file bytes have the wrong size.');\n }\n return Object.freeze({ ...file, data });\n }\n if (entry.kind === 'directory') return normalizeDirectory(entry);\n throw new TypeError('Unknown filesystem snapshot entry kind.');\n });\n const roots = entries.filter((entry) => entry.path === WORKSPACE_ROOT);\n if (roots.length !== 1 || roots[0]?.kind !== 'directory' || roots[0].version !== version) {\n throw new TypeError('Filesystem snapshot must contain one matching root directory.');\n }\n const seen = new Set<WorkspacePath>();\n for (const entry of entries) {\n if (seen.has(entry.path))\n throw new TypeError('Filesystem snapshot contained a duplicate path.');\n seen.add(entry.path);\n }\n const ordered = [...entries].sort((left, right) => compareText(left.path, right.path));\n if (ordered.some((entry, index) => entry.path !== entries[index]?.path)) {\n throw new TypeError('Filesystem snapshot was not in canonical deterministic order.');\n }\n return Object.freeze({\n version,\n entries: Object.freeze(entries),\n });\n}\n\nfunction normalizeWatchEvent(event: FileSystemWatchEvent): FileSystemWatchEvent {\n if (!isRecord(event)) throw new TypeError('Expected a filesystem watch event object.');\n if (!isPositiveSafeInteger(event.sequence)) {\n throw new TypeError('Filesystem watch sequence must be a positive safe integer.');\n }\n if (!isWatchOrigin(event.origin)) throw new TypeError('Unknown filesystem watch origin.');\n if (typeof event.path !== 'string') throw new TypeError('Watch event path must be a string.');\n const path = parseWorkspacePath(event.path);\n if (event.type === 'overflow') {\n if (\n event.kind !== null ||\n event.destinationPath !== null ||\n event.version !== null ||\n event.previousVersion !== null\n ) {\n throw new TypeError('Filesystem overflow event has entry-specific fields.');\n }\n return Object.freeze({\n sequence: event.sequence,\n origin: event.origin,\n type: 'overflow',\n kind: null,\n path,\n destinationPath: null,\n version: null,\n previousVersion: null,\n });\n }\n if (!isEntryWatchType(event.type)) throw new TypeError('Unknown filesystem watch event type.');\n if (event.kind !== 'file' && event.kind !== 'directory') {\n throw new TypeError('Unknown filesystem watch entry kind.');\n }\n const destinationPath =\n event.destinationPath === null\n ? null\n : typeof event.destinationPath === 'string'\n ? parseWorkspacePath(event.destinationPath)\n : (() => {\n throw new TypeError('Watch destination path must be a string or null.');\n })();\n if ((event.type === 'moved') !== (destinationPath !== null)) {\n throw new TypeError('Only moved watch events may have a destination path.');\n }\n return Object.freeze({\n sequence: event.sequence,\n origin: event.origin,\n type: event.type,\n kind: event.kind,\n path,\n destinationPath,\n version: event.version === null ? null : parseFileSystemVersion(event.version),\n previousVersion:\n event.previousVersion === null ? null : parseFileSystemVersion(event.previousVersion),\n });\n}\n\nfunction normalizeRemoveResult(value: FileSystemRemoveResult): FileSystemRemoveResult {\n if (!isRecord(value) || typeof value.removed !== 'boolean') {\n throw new TypeError('Filesystem transport returned an invalid remove result.');\n }\n return Object.freeze({ removed: value.removed, version: parseFileSystemVersion(value.version) });\n}\n\nfunction assertCapabilities(value: FileSystemProviderCapabilities, operation: FsOperation): void {\n if (!isRecord(value)) {\n throw invalidTransport(operation, 'Filesystem host returned invalid capabilities.');\n }\n for (const key of Object.keys(ELECTRON_FILE_SYSTEM_V2_CAPABILITIES) as Array<\n keyof FileSystemProviderCapabilities\n >) {\n if (value[key] !== ELECTRON_FILE_SYSTEM_V2_CAPABILITIES[key]) {\n throw invalidTransport(operation, `Filesystem host capability mismatch: ${key}.`);\n }\n }\n}\n\nfunction compareDirectoryEntries(\n left: FileSystemEntrySnapshot,\n right: FileSystemEntrySnapshot,\n): number {\n if (left.kind !== right.kind) return left.kind === 'directory' ? -1 : 1;\n return compareText(left.path, right.path);\n}\n\nfunction compareText(left: string, right: string): number {\n return left < right ? -1 : left > right ? 1 : 0;\n}\n\nfunction isWatchOrigin(value: unknown): value is FileSystemWatchEvent['origin'] {\n return value === 'local' || value === 'external' || value === 'unknown';\n}\n\nfunction isEntryWatchType(\n value: unknown,\n): value is Exclude<FileSystemWatchEvent['type'], 'overflow'> {\n return value === 'created' || value === 'modified' || value === 'removed' || value === 'moved';\n}\n\nfunction isNonNegativeSafeInteger(value: unknown): value is number {\n return typeof value === 'number' && Number.isSafeInteger(value) && value >= 0;\n}\n\nfunction isPositiveSafeInteger(value: unknown): value is number {\n return isNonNegativeSafeInteger(value) && value > 0;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null;\n}\n\nfunction invalidTransport(operation: FsOperation, message: string): FsError {\n return new FsError('io', message, { operation, retryable: false });\n}\n\nfunction transportErrorFromUnknown(error: unknown, operation: FsOperation): FsError {\n if (error instanceof TypeError) return invalidTransport(operation, error.message);\n return withOperation(fsErrorFromUnknown(error, { operation }), operation);\n}\n\nfunction withOperation(error: FsError, operation: FsOperation): FsError {\n if (error.operation === operation) return error;\n return new FsError(error.code, error.message, {\n operation,\n path: error.path ?? undefined,\n destinationPath: error.destinationPath ?? undefined,\n retryable: error.retryable,\n });\n}\n\nfunction copyBytes(data: ArrayBuffer | Uint8Array): ArrayBuffer {\n const source = ArrayBuffer.isView(data)\n ? new Uint8Array(data.buffer, data.byteOffset, data.byteLength)\n : new Uint8Array(data);\n const copy = new Uint8Array(source.byteLength);\n copy.set(source);\n return copy.buffer as ArrayBuffer;\n}\n\nfunction copyWireBuffer(data: ArrayBuffer): ArrayBuffer {\n if (Object.prototype.toString.call(data) !== '[object ArrayBuffer]') {\n throw new TypeError('Expected an ArrayBuffer from the filesystem transport.');\n }\n return data.slice(0);\n}\n\nfunction createInstanceId(): string {\n const randomUUID = globalThis.crypto?.randomUUID;\n if (typeof randomUUID === 'function') return randomUUID.call(globalThis.crypto);\n fallbackInstanceSequence += 1;\n return `electron-fs-v2-${Date.now()}-${fallbackInstanceSequence}`;\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 opaque workspace id that the main process resolves against its\n * registered workspace authority.\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 { FileCommitResult, FileSystemProvider, FileSystemEntry, FileMeta } from './types.js';\nimport { maybeGetDocBlocksHost } from '../host/index.js';\nimport type { DocBlocksHostFsAPI } from '../host/types.js';\nimport { ElectronFileSystemProviderV2 } from './electron-provider-v2.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 readonly v2: ElectronFileSystemProviderV2;\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 this.v2 = new ElectronFileSystemProviderV2(id, label, 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.id, path);\n }\n\n writeFile(path: string, content: string): Promise<void> {\n return getHostFs().writeFile(this.id, path, content);\n }\n\n commitFile(\n path: string,\n content: string,\n expectedContent: string | null,\n ): Promise<FileCommitResult> {\n return getHostFs().commitFile(this.id, path, content, expectedContent);\n }\n\n delete(path: string): Promise<void> {\n return getHostFs().delete(this.id, path);\n }\n\n rename(oldPath: string, newPath: string): Promise<void> {\n return getHostFs().rename(this.id, oldPath, newPath);\n }\n\n readDirectory(path: string): Promise<FileSystemEntry[]> {\n return getHostFs().readDirectory(this.id, path);\n }\n\n exists(path: string): Promise<boolean> {\n return getHostFs().exists(this.id, path);\n }\n\n createDirectory(path: string): Promise<void> {\n return getHostFs().createDirectory(this.id, path);\n }\n\n stat(path: string): Promise<FileMeta | null> {\n return getHostFs().stat(this.id, path);\n }\n\n readBinary(path: string): Promise<ArrayBuffer | null> {\n return getHostFs().readBinary(this.id, path);\n }\n\n writeBinary(path: string, data: ArrayBuffer | Uint8Array): Promise<void> {\n return getHostFs().writeBinary(this.id, 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.id, onChange);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA8CA,IAAI,2BAA2B;AAE/B,SAAS,YAAY,WAA8C;AACjE,QAAM,OAAO,sBAAsB;AACnC,MAAI,CAAC,MAAM,MAAM;AACf,UAAM,IAAI,QAAQ,iBAAiB,+CAA+C;AAAA,MAChF;AAAA,IACF,CAAC;AAAA,EACH;AACA,SAAO,KAAK;AACd;AAGO,IAAM,+BAAN,MAAmE;AAAA,EAgBjE,YAAY,IAAY,OAAe,UAAkB;AAbhE,SAAgB,eAAe;AAG/B,SAAiB,aAAa,iBAAiB;AAC/C,SAAiB,WAAW,oBAAI,IAA2B;AAC3D,SAAiB,gBAAgB,oBAAI,IAAiC;AACtE,SAAiB,WAAW,oBAAI,IAAsB;AACtD,SAAQ,cAAoC;AAC5C,SAAQ,oBAAyC;AACjD,SAAQ,iBAAuC;AAC/C,SAAQ,aAAa;AACrB,SAAQ,WAAW;AAGjB,SAAK,KAAK;AACV,SAAK,QAAQ;AACb,SAAK,WAAW;AAAA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