@bendyline/docblocks 2.0.0 → 2.1.1
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 +2 -2
- package/dist/{chunk-2D7Y4IR3.js → chunk-4437YWLE.js} +123 -67
- package/dist/{chunk-5MYAICRE.js → chunk-45T5AFCN.js} +44 -57
- package/dist/{chunk-PGR7LK6D.js → chunk-6L3JRDE7.js} +14 -6
- package/dist/{chunk-RVQHY3XU.js → chunk-6XHOOBYF.js} +0 -1
- package/dist/chunk-73OOROXH.js +8 -0
- package/dist/{chunk-SI2LU2RP.js → chunk-AYWKIZLD.js} +1 -1
- package/dist/{chunk-GCPBEMMH.js → chunk-BVY7GGNV.js} +10 -21
- package/dist/{chunk-AEHCVWU5.js → chunk-DZB666V7.js} +0 -1
- package/dist/{chunk-75UUF6C4.js → chunk-HI7QEWL6.js} +18 -10
- package/dist/chunk-KQ6756AJ.js +28 -0
- package/dist/chunk-LMMOFRGQ.js +148 -0
- package/dist/{chunk-FNW556FN.js → chunk-M2PUNKHS.js} +0 -1
- package/dist/chunk-M5ZNQGR5.js +19 -0
- package/dist/chunk-M62ZGJ5I.js +51 -0
- package/dist/chunk-OQCPBOQA.js +168 -0
- package/dist/{chunk-EGNDADXB.js → chunk-QI6YKTQV.js} +2 -3
- package/dist/chunk-SJBB5OD7.js +227 -0
- package/dist/{chunk-EZKJZUNJ.js → chunk-XAMILHQP.js} +0 -1
- package/dist/{chunk-J32GU3F3.js → chunk-YM7O3PWO.js} +249 -222
- package/dist/{chunk-RQJRQF46.js → chunk-ZO7G53QP.js} +41 -49
- package/dist/document/index.d.ts +358 -6
- package/dist/document/index.js +24 -4
- package/dist/filesystem/electron.d.ts +73 -4
- package/dist/filesystem/electron.js +16 -4
- package/dist/filesystem/index.d.ts +228 -22
- package/dist/filesystem/index.js +133 -20
- package/dist/filesystem/indexeddb.d.ts +284 -5
- package/dist/filesystem/indexeddb.js +22 -5
- package/dist/filesystem/memory.d.ts +152 -4
- package/dist/filesystem/memory.js +12 -4
- package/dist/filesystem/native.d.ts +136 -4
- package/dist/filesystem/native.js +27 -4
- package/dist/host/index.d.ts +32 -9
- package/dist/host/index.js +26 -30
- package/dist/index.d.ts +14 -10
- package/dist/index.js +204 -10
- package/dist/mcp/index.d.ts +33 -4
- package/dist/mcp/index.js +31 -4
- package/dist/mcp/zod.d.ts +645 -643
- package/dist/mcp/zod.js +700 -885
- package/dist/share/index.d.ts +43 -0
- package/dist/share/index.js +12 -0
- package/dist/{types-CsX6EN2t.d.ts → types-BEg5SQ1_.d.ts} +1 -1
- package/dist/{types-eOlt9J7n.d.ts → types-CueK0tvU.d.ts} +34 -11
- package/dist/vscode/index.d.ts +225 -3
- package/dist/vscode/index.js +389 -3
- package/dist/workspace/index.d.ts +141 -4
- package/dist/workspace/index.js +28 -3
- package/package.json +10 -5
- package/dist/chunk-2D7Y4IR3.js.map +0 -1
- package/dist/chunk-5MYAICRE.js.map +0 -1
- package/dist/chunk-75UUF6C4.js.map +0 -1
- package/dist/chunk-AEHCVWU5.js.map +0 -1
- package/dist/chunk-AYZ4HN5M.js +0 -20
- package/dist/chunk-AYZ4HN5M.js.map +0 -1
- package/dist/chunk-EGNDADXB.js.map +0 -1
- package/dist/chunk-EZKJZUNJ.js.map +0 -1
- package/dist/chunk-FNW556FN.js.map +0 -1
- package/dist/chunk-GCPBEMMH.js.map +0 -1
- package/dist/chunk-J32GU3F3.js.map +0 -1
- package/dist/chunk-PGR7LK6D.js.map +0 -1
- package/dist/chunk-RQJRQF46.js.map +0 -1
- package/dist/chunk-RVQHY3XU.js.map +0 -1
- package/dist/chunk-SI2LU2RP.js.map +0 -1
- package/dist/chunk-W5UUUII5.js +0 -142
- package/dist/chunk-W5UUUII5.js.map +0 -1
- package/dist/document/document-session.d.ts +0 -127
- package/dist/document/document-session.d.ts.map +0 -1
- package/dist/document/document-session.js +0 -749
- package/dist/document/document-session.js.map +0 -1
- package/dist/document/filesystem-target.d.ts +0 -17
- package/dist/document/filesystem-target.d.ts.map +0 -1
- package/dist/document/filesystem-target.js +0 -70
- package/dist/document/filesystem-target.js.map +0 -1
- package/dist/document/index.d.ts.map +0 -1
- package/dist/document/index.js.map +0 -1
- package/dist/document/recovery-journal.d.ts +0 -125
- package/dist/document/recovery-journal.d.ts.map +0 -1
- package/dist/document/recovery-journal.js +0 -385
- package/dist/document/recovery-journal.js.map +0 -1
- package/dist/document/types.d.ts +0 -89
- package/dist/document/types.d.ts.map +0 -1
- package/dist/document/types.js +0 -9
- package/dist/document/types.js.map +0 -1
- package/dist/filesystem/commit-lock.d.ts +0 -3
- package/dist/filesystem/commit-lock.d.ts.map +0 -1
- package/dist/filesystem/commit-lock.js +0 -20
- package/dist/filesystem/commit-lock.js.map +0 -1
- package/dist/filesystem/dbk-workspace.d.ts +0 -34
- package/dist/filesystem/dbk-workspace.d.ts.map +0 -1
- package/dist/filesystem/dbk-workspace.js +0 -85
- package/dist/filesystem/dbk-workspace.js.map +0 -1
- package/dist/filesystem/electron-provider-v2.d.ts +0 -36
- package/dist/filesystem/electron-provider-v2.d.ts.map +0 -1
- package/dist/filesystem/electron-provider-v2.js +0 -503
- package/dist/filesystem/electron-provider-v2.js.map +0 -1
- package/dist/filesystem/electron-provider.d.ts +0 -35
- package/dist/filesystem/electron-provider.d.ts.map +0 -1
- package/dist/filesystem/electron-provider.js +0 -69
- package/dist/filesystem/electron-provider.js.map +0 -1
- package/dist/filesystem/electron.d.ts.map +0 -1
- package/dist/filesystem/electron.js.map +0 -1
- package/dist/filesystem/file-media-provider.d.ts +0 -23
- package/dist/filesystem/file-media-provider.d.ts.map +0 -1
- package/dist/filesystem/file-media-provider.js +0 -85
- package/dist/filesystem/file-media-provider.js.map +0 -1
- package/dist/filesystem/filesystem-content-container.d.ts +0 -24
- package/dist/filesystem/filesystem-content-container.d.ts.map +0 -1
- package/dist/filesystem/filesystem-content-container.js +0 -153
- package/dist/filesystem/filesystem-content-container.js.map +0 -1
- package/dist/filesystem/fs-error.d.ts +0 -46
- package/dist/filesystem/fs-error.d.ts.map +0 -1
- package/dist/filesystem/fs-error.js +0 -170
- package/dist/filesystem/fs-error.js.map +0 -1
- package/dist/filesystem/index.d.ts.map +0 -1
- package/dist/filesystem/index.js.map +0 -1
- package/dist/filesystem/indexeddb-content-container.d.ts +0 -22
- package/dist/filesystem/indexeddb-content-container.d.ts.map +0 -1
- package/dist/filesystem/indexeddb-content-container.js +0 -100
- package/dist/filesystem/indexeddb-content-container.js.map +0 -1
- package/dist/filesystem/indexeddb-provider-v2.d.ts +0 -96
- package/dist/filesystem/indexeddb-provider-v2.d.ts.map +0 -1
- package/dist/filesystem/indexeddb-provider-v2.js +0 -1241
- package/dist/filesystem/indexeddb-provider-v2.js.map +0 -1
- package/dist/filesystem/indexeddb-provider.d.ts +0 -39
- package/dist/filesystem/indexeddb-provider.d.ts.map +0 -1
- package/dist/filesystem/indexeddb-provider.js +0 -145
- package/dist/filesystem/indexeddb-provider.js.map +0 -1
- package/dist/filesystem/indexeddb-store.d.ts +0 -34
- package/dist/filesystem/indexeddb-store.d.ts.map +0 -1
- package/dist/filesystem/indexeddb-store.js +0 -165
- package/dist/filesystem/indexeddb-store.js.map +0 -1
- package/dist/filesystem/indexeddb.d.ts.map +0 -1
- package/dist/filesystem/indexeddb.js.map +0 -1
- package/dist/filesystem/legacy-v2-adapter.d.ts +0 -62
- package/dist/filesystem/legacy-v2-adapter.d.ts.map +0 -1
- package/dist/filesystem/legacy-v2-adapter.js +0 -499
- package/dist/filesystem/legacy-v2-adapter.js.map +0 -1
- package/dist/filesystem/memory-provider-v2.d.ts +0 -92
- package/dist/filesystem/memory-provider-v2.d.ts.map +0 -1
- package/dist/filesystem/memory-provider-v2.js +0 -615
- package/dist/filesystem/memory-provider-v2.js.map +0 -1
- package/dist/filesystem/memory-provider.d.ts +0 -54
- package/dist/filesystem/memory-provider.d.ts.map +0 -1
- package/dist/filesystem/memory-provider.js +0 -132
- package/dist/filesystem/memory-provider.js.map +0 -1
- package/dist/filesystem/memory.d.ts.map +0 -1
- package/dist/filesystem/memory.js.map +0 -1
- package/dist/filesystem/move-entry.d.ts +0 -9
- package/dist/filesystem/move-entry.d.ts.map +0 -1
- package/dist/filesystem/move-entry.js +0 -103
- package/dist/filesystem/move-entry.js.map +0 -1
- package/dist/filesystem/move-error.d.ts +0 -53
- package/dist/filesystem/move-error.d.ts.map +0 -1
- package/dist/filesystem/move-error.js +0 -99
- package/dist/filesystem/move-error.js.map +0 -1
- package/dist/filesystem/native-provider-v2.d.ts +0 -75
- package/dist/filesystem/native-provider-v2.d.ts.map +0 -1
- package/dist/filesystem/native-provider-v2.js +0 -849
- package/dist/filesystem/native-provider-v2.js.map +0 -1
- package/dist/filesystem/native-provider.d.ts +0 -53
- package/dist/filesystem/native-provider.d.ts.map +0 -1
- package/dist/filesystem/native-provider.js +0 -471
- package/dist/filesystem/native-provider.js.map +0 -1
- package/dist/filesystem/native.d.ts.map +0 -1
- package/dist/filesystem/native.js.map +0 -1
- package/dist/filesystem/types.d.ts +0 -83
- package/dist/filesystem/types.d.ts.map +0 -1
- package/dist/filesystem/types.js +0 -16
- package/dist/filesystem/types.js.map +0 -1
- package/dist/filesystem/v2.d.ts +0 -172
- package/dist/filesystem/v2.d.ts.map +0 -1
- package/dist/filesystem/v2.js +0 -16
- package/dist/filesystem/v2.js.map +0 -1
- package/dist/filesystem/workspace-path.d.ts +0 -21
- package/dist/filesystem/workspace-path.d.ts.map +0 -1
- package/dist/filesystem/workspace-path.js +0 -80
- package/dist/filesystem/workspace-path.js.map +0 -1
- package/dist/host/filesystem-v2.d.ts +0 -45
- package/dist/host/filesystem-v2.d.ts.map +0 -1
- package/dist/host/filesystem-v2.js +0 -13
- package/dist/host/filesystem-v2.js.map +0 -1
- package/dist/host/git.d.ts +0 -200
- package/dist/host/git.d.ts.map +0 -1
- package/dist/host/git.js +0 -15
- package/dist/host/git.js.map +0 -1
- package/dist/host/index.d.ts.map +0 -1
- package/dist/host/index.js.map +0 -1
- package/dist/host/types.d.ts +0 -232
- package/dist/host/types.d.ts.map +0 -1
- package/dist/host/types.js +0 -10
- package/dist/host/types.js.map +0 -1
- package/dist/host/wire-policy.d.ts +0 -22
- package/dist/host/wire-policy.d.ts.map +0 -1
- package/dist/host/wire-policy.js +0 -92
- package/dist/host/wire-policy.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/mcp/index.d.ts.map +0 -1
- package/dist/mcp/index.js.map +0 -1
- package/dist/mcp/types.d.ts +0 -466
- package/dist/mcp/types.d.ts.map +0 -1
- package/dist/mcp/types.js +0 -25
- package/dist/mcp/types.js.map +0 -1
- package/dist/mcp/wire.d.ts +0 -29
- package/dist/mcp/wire.d.ts.map +0 -1
- package/dist/mcp/wire.js +0 -1046
- package/dist/mcp/wire.js.map +0 -1
- package/dist/mcp/zod.d.ts.map +0 -1
- package/dist/mcp/zod.js.map +0 -1
- package/dist/vscode/index.d.ts.map +0 -1
- package/dist/vscode/index.js.map +0 -1
- package/dist/vscode/messages.d.ts +0 -204
- package/dist/vscode/messages.d.ts.map +0 -1
- package/dist/vscode/messages.js +0 -494
- package/dist/vscode/messages.js.map +0 -1
- package/dist/workspace/index.d.ts.map +0 -1
- package/dist/workspace/index.js.map +0 -1
- package/dist/workspace/reconcile-electron.d.ts +0 -19
- package/dist/workspace/reconcile-electron.d.ts.map +0 -1
- package/dist/workspace/reconcile-electron.js +0 -42
- package/dist/workspace/reconcile-electron.js.map +0 -1
- package/dist/workspace/types.d.ts +0 -69
- package/dist/workspace/types.d.ts.map +0 -1
- package/dist/workspace/types.js +0 -2
- package/dist/workspace/types.js.map +0 -1
- package/dist/workspace/workspace-manager.d.ts +0 -47
- package/dist/workspace/workspace-manager.d.ts.map +0 -1
- package/dist/workspace/workspace-manager.js +0 -126
- package/dist/workspace/workspace-manager.js.map +0 -1
- package/src/document/document-session.ts +0 -834
- package/src/document/filesystem-target.ts +0 -109
- package/src/document/index.ts +0 -41
- package/src/document/recovery-journal.ts +0 -536
- package/src/document/types.ts +0 -116
- package/src/filesystem/commit-lock.ts +0 -29
- package/src/filesystem/dbk-workspace.ts +0 -135
- package/src/filesystem/electron-provider-v2.ts +0 -630
- package/src/filesystem/electron-provider.ts +0 -99
- package/src/filesystem/electron.ts +0 -3
- package/src/filesystem/file-media-provider.ts +0 -103
- package/src/filesystem/filesystem-content-container.ts +0 -164
- package/src/filesystem/fs-error.ts +0 -234
- package/src/filesystem/index.ts +0 -143
- package/src/filesystem/indexeddb-content-container.ts +0 -112
- package/src/filesystem/indexeddb-provider-v2.ts +0 -1740
- package/src/filesystem/indexeddb-provider.ts +0 -171
- package/src/filesystem/indexeddb-store.ts +0 -207
- package/src/filesystem/indexeddb.ts +0 -12
- package/src/filesystem/legacy-v2-adapter.ts +0 -779
- package/src/filesystem/memory-provider-v2.ts +0 -896
- package/src/filesystem/memory-provider.ts +0 -180
- package/src/filesystem/memory.ts +0 -15
- package/src/filesystem/move-entry.ts +0 -142
- package/src/filesystem/move-error.ts +0 -159
- package/src/filesystem/native-provider-v2.ts +0 -1165
- package/src/filesystem/native-provider.ts +0 -537
- package/src/filesystem/native.ts +0 -16
- package/src/filesystem/types.ts +0 -114
- package/src/filesystem/v2.ts +0 -231
- package/src/filesystem/workspace-path.ts +0 -92
- package/src/host/filesystem-v2.ts +0 -104
- package/src/host/git.ts +0 -246
- package/src/host/index.ts +0 -93
- package/src/host/types.ts +0 -274
- package/src/host/wire-policy.ts +0 -103
- package/src/index.ts +0 -10
- package/src/mcp/index.ts +0 -3
- package/src/mcp/types.ts +0 -594
- package/src/mcp/wire.ts +0 -1280
- package/src/mcp/zod.ts +0 -1000
- package/src/vscode/index.ts +0 -2
- package/src/vscode/messages.ts +0 -704
- package/src/workspace/index.ts +0 -17
- package/src/workspace/reconcile-electron.ts +0 -65
- package/src/workspace/types.ts +0 -67
- package/src/workspace/workspace-manager.ts +0 -151
package/src/filesystem/index.ts
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
export type {
|
|
2
|
-
FileSystemProvider,
|
|
3
|
-
FileSystemProviderWithV2,
|
|
4
|
-
FileSystemEntry,
|
|
5
|
-
FileEntry,
|
|
6
|
-
FolderEntry,
|
|
7
|
-
FileMeta,
|
|
8
|
-
FileCommitResult,
|
|
9
|
-
} from './types.js';
|
|
10
|
-
export { getFileSystemProviderV2, hasFileSystemProviderV2 } from './types.js';
|
|
11
|
-
|
|
12
|
-
export {
|
|
13
|
-
WORKSPACE_ROOT,
|
|
14
|
-
parseWorkspacePath,
|
|
15
|
-
tryParseWorkspacePath,
|
|
16
|
-
workspacePathToLegacy,
|
|
17
|
-
workspacePathJoin,
|
|
18
|
-
workspacePathDirname,
|
|
19
|
-
workspacePathBasename,
|
|
20
|
-
workspacePathContains,
|
|
21
|
-
type WorkspacePath,
|
|
22
|
-
} from './workspace-path.js';
|
|
23
|
-
export {
|
|
24
|
-
FsError,
|
|
25
|
-
mapDomExceptionToFsErrorCode,
|
|
26
|
-
mapNodeErrorCodeToFsErrorCode,
|
|
27
|
-
isSerializedFsError,
|
|
28
|
-
isQuotaExceededError,
|
|
29
|
-
serializeFsError,
|
|
30
|
-
deserializeFsError,
|
|
31
|
-
fsErrorFromUnknown,
|
|
32
|
-
type FsErrorCode,
|
|
33
|
-
type FsOperation,
|
|
34
|
-
type SerializedFsError,
|
|
35
|
-
type FsErrorContext,
|
|
36
|
-
} from './fs-error.js';
|
|
37
|
-
export type {
|
|
38
|
-
FileSystemProviderV2,
|
|
39
|
-
FileSystemProviderCapabilities,
|
|
40
|
-
FileSystemVersion,
|
|
41
|
-
FileSystemConditionalWriteStrength,
|
|
42
|
-
FileSystemSymlinkPolicy,
|
|
43
|
-
FileSystemAtomicity,
|
|
44
|
-
FileSystemCaseSensitivity,
|
|
45
|
-
FileSystemDurability,
|
|
46
|
-
FileSystemEntrySnapshot,
|
|
47
|
-
FileSystemFileSnapshot,
|
|
48
|
-
FileSystemDirectorySnapshot,
|
|
49
|
-
FileSystemFileRead,
|
|
50
|
-
FileSystemSnapshot,
|
|
51
|
-
FileSystemSnapshotEntry,
|
|
52
|
-
FileSystemSnapshotFile,
|
|
53
|
-
FileSystemWriteMode,
|
|
54
|
-
FileSystemWriteOptions,
|
|
55
|
-
FileSystemCreateDirectoryMode,
|
|
56
|
-
FileSystemCreateDirectoryOptions,
|
|
57
|
-
FileSystemRemoveOptions,
|
|
58
|
-
FileSystemRemoveResult,
|
|
59
|
-
FileSystemMoveOptions,
|
|
60
|
-
FileSystemWatchEventType,
|
|
61
|
-
FileSystemWatchEventOrigin,
|
|
62
|
-
FileSystemWatchEvent,
|
|
63
|
-
FileSystemEntryWatchEvent,
|
|
64
|
-
FileSystemOverflowWatchEvent,
|
|
65
|
-
FileSystemWatchListener,
|
|
66
|
-
FileSystemWatchErrorListener,
|
|
67
|
-
FileSystemWatchOptions,
|
|
68
|
-
FileSystemWatchSubscription,
|
|
69
|
-
} from './v2.js';
|
|
70
|
-
export { parseFileSystemVersion, tryParseFileSystemVersion } from './v2.js';
|
|
71
|
-
export {
|
|
72
|
-
MemoryFileSystemProviderV2,
|
|
73
|
-
type MemoryFilePayloadKind,
|
|
74
|
-
type MemoryFileSystemV2CompatibilityFile,
|
|
75
|
-
type MemoryFileSystemV2Replacement,
|
|
76
|
-
type MemoryFileSystemV2ReplacementFile,
|
|
77
|
-
type MemoryFileSystemV2State,
|
|
78
|
-
type MemoryFileSystemV2StateFile,
|
|
79
|
-
} from './memory-provider-v2.js';
|
|
80
|
-
export {
|
|
81
|
-
IndexedDBFileSystemProviderV2,
|
|
82
|
-
type IndexedDBFileSystemProviderV2Options,
|
|
83
|
-
type IndexedDBLegacyConflictReason,
|
|
84
|
-
type IndexedDBLegacyConflictResolution,
|
|
85
|
-
type IndexedDBLegacyMigrationConflict,
|
|
86
|
-
type IndexedDBLegacyRecoveryCandidate,
|
|
87
|
-
type IndexedDBLegacyRecoveryKind,
|
|
88
|
-
} from './indexeddb-provider-v2.js';
|
|
89
|
-
export {
|
|
90
|
-
LegacyFileSystemProviderV2Adapter,
|
|
91
|
-
type LegacyFilePayloadModel,
|
|
92
|
-
type LegacyFileSystemProviderV2AdapterOptions,
|
|
93
|
-
} from './legacy-v2-adapter.js';
|
|
94
|
-
|
|
95
|
-
export { IndexedDBFileSystemProvider } from './indexeddb-provider.js';
|
|
96
|
-
export {
|
|
97
|
-
MemoryFileSystemProvider,
|
|
98
|
-
type MemoryFileSystemSnapshot,
|
|
99
|
-
type MemoryFileSystemSnapshotFile,
|
|
100
|
-
} from './memory-provider.js';
|
|
101
|
-
export {
|
|
102
|
-
createDbkWorkspaceSnapshot,
|
|
103
|
-
replaceMemoryWorkspaceFromDbk,
|
|
104
|
-
type DbkWorkspaceAssetLayout,
|
|
105
|
-
type DbkWorkspaceSnapshot,
|
|
106
|
-
type DbkWorkspaceSnapshotOptions,
|
|
107
|
-
} from './dbk-workspace.js';
|
|
108
|
-
export { IndexedDBContentContainer } from './indexeddb-content-container.js';
|
|
109
|
-
export { FileSystemContentContainer } from './filesystem-content-container.js';
|
|
110
|
-
export { createFileMediaProvider } from './file-media-provider.js';
|
|
111
|
-
export { documentCompanionPath, moveFileSystemEntry } from './move-entry.js';
|
|
112
|
-
export {
|
|
113
|
-
FileSystemMoveRecoveryError,
|
|
114
|
-
FileSystemPartialMoveError,
|
|
115
|
-
isFileSystemMoveRecoveryError,
|
|
116
|
-
isFileSystemMoveStateError,
|
|
117
|
-
isFileSystemPartialMoveError,
|
|
118
|
-
describeEntryMove,
|
|
119
|
-
describePartialMove,
|
|
120
|
-
type FileSystemEntryMoveState,
|
|
121
|
-
type FileSystemMoveLocation,
|
|
122
|
-
type FileSystemPartialMoveState,
|
|
123
|
-
type FileSystemPathPresence,
|
|
124
|
-
} from './move-error.js';
|
|
125
|
-
|
|
126
|
-
export {
|
|
127
|
-
NativeFileSystemProvider,
|
|
128
|
-
isNativeFileSystemSupported,
|
|
129
|
-
openNativeFolder,
|
|
130
|
-
restoreNativeFolder,
|
|
131
|
-
storeDirectoryHandle,
|
|
132
|
-
loadDirectoryHandle,
|
|
133
|
-
removeDirectoryHandle,
|
|
134
|
-
} from './native-provider.js';
|
|
135
|
-
export {
|
|
136
|
-
NativeFileSystemProviderV2,
|
|
137
|
-
NativeFileSystemMoveRecoveryError,
|
|
138
|
-
type NativeFileSystemMovePathState,
|
|
139
|
-
type NativeFileSystemMoveRecoveryState,
|
|
140
|
-
} from './native-provider-v2.js';
|
|
141
|
-
|
|
142
|
-
export { ElectronFileSystemProvider, isElectronHost } from './electron-provider.js';
|
|
143
|
-
export { ElectronFileSystemProviderV2 } from './electron-provider-v2.js';
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* IndexedDBContentContainer — a ContentContainer backed by IndexedDB.
|
|
3
|
-
*
|
|
4
|
-
* Uses a dedicated IndexedDBFileSystemProvider instance (separate store)
|
|
5
|
-
* to persist media files across page refreshes.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import type { ContentContainer, ContentEntry } from '@bendyline/squisq/storage';
|
|
9
|
-
import { findDocumentPath } from '@bendyline/squisq/storage';
|
|
10
|
-
import { IndexedDBFileSystemProviderV2 } from './indexeddb-provider-v2.js';
|
|
11
|
-
import { parseWorkspacePath, WORKSPACE_ROOT } from './workspace-path.js';
|
|
12
|
-
|
|
13
|
-
// ── MIME type guessing ─────────────────────────────────────────────
|
|
14
|
-
|
|
15
|
-
const EXTENSION_MIME_MAP: Record<string, string> = {
|
|
16
|
-
'.md': 'text/markdown',
|
|
17
|
-
'.txt': 'text/plain',
|
|
18
|
-
'.json': 'application/json',
|
|
19
|
-
'.jpg': 'image/jpeg',
|
|
20
|
-
'.jpeg': 'image/jpeg',
|
|
21
|
-
'.png': 'image/png',
|
|
22
|
-
'.gif': 'image/gif',
|
|
23
|
-
'.svg': 'image/svg+xml',
|
|
24
|
-
'.webp': 'image/webp',
|
|
25
|
-
'.avif': 'image/avif',
|
|
26
|
-
'.mp4': 'video/mp4',
|
|
27
|
-
'.webm': 'video/webm',
|
|
28
|
-
'.mp3': 'audio/mpeg',
|
|
29
|
-
'.wav': 'audio/wav',
|
|
30
|
-
'.ogg': 'audio/ogg',
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
function guessMimeType(path: string): string {
|
|
34
|
-
const dot = path.lastIndexOf('.');
|
|
35
|
-
if (dot === -1) return 'application/octet-stream';
|
|
36
|
-
const ext = path.slice(dot).toLowerCase();
|
|
37
|
-
return EXTENSION_MIME_MAP[ext] ?? 'application/octet-stream';
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// ── Implementation ─────────────────────────────────────────────────
|
|
41
|
-
|
|
42
|
-
export class IndexedDBContentContainer implements ContentContainer {
|
|
43
|
-
private readonly provider: IndexedDBFileSystemProviderV2;
|
|
44
|
-
|
|
45
|
-
constructor(workspaceId: string) {
|
|
46
|
-
this.provider = new IndexedDBFileSystemProviderV2(`${workspaceId}-media`, 'Media Storage');
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
async readFile(path: string): Promise<ArrayBuffer | null> {
|
|
50
|
-
return (await this.provider.readFile(parseWorkspacePath(path)))?.data ?? null;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
async writeFile(path: string, data: ArrayBuffer | Uint8Array, _mimeType?: string): Promise<void> {
|
|
54
|
-
await this.provider.writeFile(parseWorkspacePath(path), data, {
|
|
55
|
-
mode: 'upsert',
|
|
56
|
-
createParents: true,
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
async removeFile(path: string): Promise<void> {
|
|
61
|
-
await this.provider.remove(parseWorkspacePath(path), { missing: 'ignore' });
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
async listFiles(prefix?: string): Promise<ContentEntry[]> {
|
|
65
|
-
const entries: ContentEntry[] = [];
|
|
66
|
-
const walk = async (dir: string) => {
|
|
67
|
-
const children = await this.provider.readDirectory(parseWorkspacePath(dir));
|
|
68
|
-
for (const child of children) {
|
|
69
|
-
if (child.kind === 'directory') {
|
|
70
|
-
await walk(child.path);
|
|
71
|
-
} else {
|
|
72
|
-
const filePath = child.path;
|
|
73
|
-
if (prefix && !filePath.startsWith(prefix)) continue;
|
|
74
|
-
entries.push({
|
|
75
|
-
path: filePath,
|
|
76
|
-
mimeType: guessMimeType(filePath),
|
|
77
|
-
size: child.size,
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
await walk(WORKSPACE_ROOT);
|
|
83
|
-
return entries;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
async exists(path: string): Promise<boolean> {
|
|
87
|
-
return (await this.provider.stat(parseWorkspacePath(path))) !== null;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
async getDocumentPath(): Promise<string | null> {
|
|
91
|
-
return findDocumentPath(await this.listFiles());
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
async readDocument(): Promise<string | null> {
|
|
95
|
-
const docPath = await this.getDocumentPath();
|
|
96
|
-
if (!docPath) return null;
|
|
97
|
-
const data = await this.readFile(docPath);
|
|
98
|
-
if (!data) return null;
|
|
99
|
-
return new TextDecoder().decode(data);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
async writeDocument(markdown: string, filename?: string): Promise<void> {
|
|
103
|
-
const name = filename ?? 'index.md';
|
|
104
|
-
const data = new TextEncoder().encode(markdown);
|
|
105
|
-
await this.writeFile(name, data, 'text/markdown');
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/** Release the IndexedDB connection when a long-lived container is retired. */
|
|
109
|
-
async dispose(): Promise<void> {
|
|
110
|
-
await this.provider.dispose();
|
|
111
|
-
}
|
|
112
|
-
}
|