@dxos/plugin-wnfs 0.8.4-main.72ec0f3 → 0.8.4-main.74a063c4e0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/dist/lib/browser/chunk-BM3MEFES.mjs +69 -0
  2. package/dist/lib/browser/chunk-BM3MEFES.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-D6VTEQIE.mjs → chunk-N6Y4QPNF.mjs} +23 -32
  4. package/dist/lib/browser/chunk-N6Y4QPNF.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-VXUCZHVZ.mjs +69 -0
  6. package/dist/lib/browser/chunk-VXUCZHVZ.mjs.map +7 -0
  7. package/dist/lib/browser/create-NOHKWE67.mjs +24 -0
  8. package/dist/lib/browser/create-NOHKWE67.mjs.map +7 -0
  9. package/dist/lib/browser/create-file-N7ADCFOF.mjs +49 -0
  10. package/dist/lib/browser/create-file-N7ADCFOF.mjs.map +7 -0
  11. package/dist/lib/browser/index.mjs +92 -91
  12. package/dist/lib/browser/index.mjs.map +4 -4
  13. package/dist/lib/browser/meta.json +1 -1
  14. package/dist/lib/browser/operations/index.mjs +13 -0
  15. package/dist/lib/browser/operations/index.mjs.map +7 -0
  16. package/dist/lib/browser/types/index.mjs +4 -3
  17. package/dist/lib/browser/upload-DA7GBOXF.mjs +42 -0
  18. package/dist/lib/browser/upload-DA7GBOXF.mjs.map +7 -0
  19. package/dist/types/src/WnfsPlugin.d.ts +2 -1
  20. package/dist/types/src/WnfsPlugin.d.ts.map +1 -1
  21. package/dist/types/src/capabilities/blockstore.d.ts +3 -2
  22. package/dist/types/src/capabilities/blockstore.d.ts.map +1 -1
  23. package/dist/types/src/capabilities/file-uploader.d.ts +4 -2
  24. package/dist/types/src/capabilities/file-uploader.d.ts.map +1 -1
  25. package/dist/types/src/capabilities/index.d.ts +7 -6
  26. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  27. package/dist/types/src/capabilities/markdown.d.ts +3 -2
  28. package/dist/types/src/capabilities/markdown.d.ts.map +1 -1
  29. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  30. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  31. package/dist/types/src/capabilities/react-surface.d.ts +3 -2
  32. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  33. package/dist/types/src/components/FileInput/FileInput.d.ts.map +1 -0
  34. package/dist/types/src/components/FileInput/index.d.ts +2 -0
  35. package/dist/types/src/components/FileInput/index.d.ts.map +1 -0
  36. package/dist/types/src/components/FilePreview/FilePreview.d.ts +16 -0
  37. package/dist/types/src/components/FilePreview/FilePreview.d.ts.map +1 -0
  38. package/dist/types/src/components/FilePreview/index.d.ts +2 -0
  39. package/dist/types/src/components/FilePreview/index.d.ts.map +1 -0
  40. package/dist/types/src/components/index.d.ts +1 -1
  41. package/dist/types/src/components/index.d.ts.map +1 -1
  42. package/dist/types/src/containers/FileContainer/FileContainer.d.ts +7 -0
  43. package/dist/types/src/containers/FileContainer/FileContainer.d.ts.map +1 -0
  44. package/dist/types/src/containers/FileContainer/index.d.ts +2 -0
  45. package/dist/types/src/containers/FileContainer/index.d.ts.map +1 -0
  46. package/dist/types/src/containers/index.d.ts +3 -0
  47. package/dist/types/src/containers/index.d.ts.map +1 -0
  48. package/dist/types/src/extensions/image.d.ts +1 -1
  49. package/dist/types/src/extensions/image.d.ts.map +1 -1
  50. package/dist/types/src/extensions/image.stories.d.ts.map +1 -1
  51. package/dist/types/src/helpers/load.d.ts +1 -1
  52. package/dist/types/src/helpers/load.d.ts.map +1 -1
  53. package/dist/types/src/helpers/upload.d.ts +1 -1
  54. package/dist/types/src/helpers/upload.d.ts.map +1 -1
  55. package/dist/types/src/index.d.ts +1 -1
  56. package/dist/types/src/index.d.ts.map +1 -1
  57. package/dist/types/src/meta.d.ts +2 -2
  58. package/dist/types/src/meta.d.ts.map +1 -1
  59. package/dist/types/src/operations/create-file.d.ts +5 -0
  60. package/dist/types/src/operations/create-file.d.ts.map +1 -0
  61. package/dist/types/src/operations/create.d.ts +5 -0
  62. package/dist/types/src/operations/create.d.ts.map +1 -0
  63. package/dist/types/src/operations/definitions.d.ts +38 -0
  64. package/dist/types/src/operations/definitions.d.ts.map +1 -0
  65. package/dist/types/src/operations/index.d.ts +4 -0
  66. package/dist/types/src/operations/index.d.ts.map +1 -0
  67. package/dist/types/src/operations/upload.d.ts +5 -0
  68. package/dist/types/src/operations/upload.d.ts.map +1 -0
  69. package/dist/types/src/translations.d.ts +13 -9
  70. package/dist/types/src/translations.d.ts.map +1 -1
  71. package/dist/types/src/types/File.d.ts +11 -11
  72. package/dist/types/src/types/File.d.ts.map +1 -1
  73. package/dist/types/src/{capabilities → types}/capabilities.d.ts +3 -2
  74. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  75. package/dist/types/src/types/index.d.ts +1 -0
  76. package/dist/types/src/types/index.d.ts.map +1 -1
  77. package/dist/types/src/types/types.d.ts +4 -50
  78. package/dist/types/src/types/types.d.ts.map +1 -1
  79. package/dist/types/tsconfig.tsbuildinfo +1 -1
  80. package/package.json +59 -36
  81. package/src/WnfsPlugin.tsx +53 -73
  82. package/src/blockstore.ts +1 -1
  83. package/src/capabilities/blockstore.ts +15 -11
  84. package/src/capabilities/file-uploader.ts +24 -17
  85. package/src/capabilities/index.ts +10 -8
  86. package/src/capabilities/markdown.ts +22 -14
  87. package/src/capabilities/operation-handler.ts +16 -0
  88. package/src/capabilities/react-surface.tsx +40 -34
  89. package/src/components/{FileInput.tsx → FileInput/FileInput.tsx} +6 -6
  90. package/src/components/FileInput/index.ts +5 -0
  91. package/src/components/FilePreview/FilePreview.tsx +43 -0
  92. package/src/components/FilePreview/index.ts +5 -0
  93. package/src/components/index.ts +1 -4
  94. package/src/{components → containers/FileContainer}/FileContainer.tsx +13 -15
  95. package/src/containers/FileContainer/index.ts +5 -0
  96. package/src/containers/index.ts +7 -0
  97. package/src/extensions/image.stories.tsx +8 -9
  98. package/src/extensions/image.tsx +4 -3
  99. package/src/helpers/load.ts +12 -7
  100. package/src/helpers/upload.ts +5 -2
  101. package/src/index.ts +1 -1
  102. package/src/meta.ts +3 -3
  103. package/src/operations/create-file.ts +31 -0
  104. package/src/operations/create.ts +22 -0
  105. package/src/operations/definitions.ts +41 -0
  106. package/src/operations/index.ts +13 -0
  107. package/src/operations/upload.ts +29 -0
  108. package/src/translations.ts +13 -9
  109. package/src/types/File.ts +11 -7
  110. package/src/{capabilities → types}/capabilities.ts +4 -4
  111. package/src/types/index.ts +1 -0
  112. package/src/types/types.ts +3 -20
  113. package/dist/lib/browser/FileContainer-LLNI7WXR.mjs +0 -103
  114. package/dist/lib/browser/FileContainer-LLNI7WXR.mjs.map +0 -7
  115. package/dist/lib/browser/blockstore-2JFU4NBU.mjs +0 -191
  116. package/dist/lib/browser/blockstore-2JFU4NBU.mjs.map +0 -7
  117. package/dist/lib/browser/chunk-CWMKN2F6.mjs +0 -71
  118. package/dist/lib/browser/chunk-CWMKN2F6.mjs.map +0 -7
  119. package/dist/lib/browser/chunk-D6VTEQIE.mjs.map +0 -7
  120. package/dist/lib/browser/chunk-F4QHZWQD.mjs +0 -16
  121. package/dist/lib/browser/chunk-F4QHZWQD.mjs.map +0 -7
  122. package/dist/lib/browser/chunk-OGPGLJCV.mjs +0 -25
  123. package/dist/lib/browser/chunk-OGPGLJCV.mjs.map +0 -7
  124. package/dist/lib/browser/chunk-ZFPJA5F4.mjs +0 -16
  125. package/dist/lib/browser/chunk-ZFPJA5F4.mjs.map +0 -7
  126. package/dist/lib/browser/file-uploader-W6TJLAAK.mjs +0 -30
  127. package/dist/lib/browser/file-uploader-W6TJLAAK.mjs.map +0 -7
  128. package/dist/lib/browser/intent-resolver-FSW2EQF4.mjs +0 -48
  129. package/dist/lib/browser/intent-resolver-FSW2EQF4.mjs.map +0 -7
  130. package/dist/lib/browser/markdown-WYQDCVFQ.mjs +0 -198
  131. package/dist/lib/browser/markdown-WYQDCVFQ.mjs.map +0 -7
  132. package/dist/lib/browser/react-surface-DMU47U3X.mjs +0 -88
  133. package/dist/lib/browser/react-surface-DMU47U3X.mjs.map +0 -7
  134. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  135. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  136. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  137. package/dist/types/src/components/FileContainer.d.ts +0 -9
  138. package/dist/types/src/components/FileContainer.d.ts.map +0 -1
  139. package/dist/types/src/components/FileInput.d.ts.map +0 -1
  140. package/dist/types/src/components/FilePreview.d.ts +0 -11
  141. package/dist/types/src/components/FilePreview.d.ts.map +0 -1
  142. package/src/capabilities/intent-resolver.ts +0 -32
  143. package/src/components/FilePreview.tsx +0 -23
  144. /package/dist/types/src/components/{FileInput.d.ts → FileInput/FileInput.d.ts} +0 -0
@@ -1,191 +0,0 @@
1
- import {
2
- storeName
3
- } from "./chunk-D6VTEQIE.mjs";
4
- import {
5
- WnfsCapabilities
6
- } from "./chunk-F4QHZWQD.mjs";
7
- import "./chunk-OGPGLJCV.mjs";
8
-
9
- // src/capabilities/blockstore.ts
10
- import { contributes } from "@dxos/app-framework";
11
- import { ClientCapabilities } from "@dxos/plugin-client";
12
-
13
- // src/blockstore.ts
14
- import { CarWriter } from "@ipld/car";
15
- import { BaseBlockstore } from "blockstore-core";
16
- import { IDBBlockstore } from "blockstore-idb";
17
- import debounce from "debounce";
18
- import * as IDB from "idb-keyval";
19
- import all from "it-all";
20
- import { CID } from "multiformats";
21
- import * as Uint8Arrays from "uint8arrays";
22
- var create = (apiHost) => {
23
- return new MixedBlockstore(apiHost);
24
- };
25
- var MixedBlockstore = class extends BaseBlockstore {
26
- #apiHost;
27
- #localStore;
28
- #isConnected;
29
- #flushQueue;
30
- #queue;
31
- constructor(apiHost) {
32
- super();
33
- this.#apiHost = apiHost ? apiHost.replace(/\/?$/, "") : void 0;
34
- this.#localStore = new IDBBlockstore(storeName());
35
- this.#isConnected = navigator.onLine;
36
- this.#queue = [];
37
- this.#flushQueue = debounce(this.#flushQueueInt, 5e3);
38
- }
39
- async open() {
40
- await this.#localStore.open();
41
- await this.#restoreQueue();
42
- window.addEventListener("offline", async () => {
43
- this.#isConnected = false;
44
- });
45
- window.addEventListener("online", async () => {
46
- this.#isConnected = true;
47
- this.#flushQueue();
48
- });
49
- }
50
- url(apiHost, cid) {
51
- const path = cid ? cid.toString() : "";
52
- return `${apiHost}/api/file${path.length ? "/" + path : ""}`;
53
- }
54
- // BLOCKSTORE IMPLEMENTATION
55
- async delete(key) {
56
- await this.#localStore.delete(key);
57
- if (this.#isConnected && this.#apiHost) {
58
- await fetch(this.url(this.#apiHost, key), {
59
- method: "DELETE"
60
- });
61
- }
62
- }
63
- async get(key) {
64
- if (await this.#localStore.has(key)) {
65
- return await this.#localStore.get(key);
66
- }
67
- if (this.#isConnected && this.#apiHost) {
68
- const block = await fetch(this.url(this.#apiHost, key), {
69
- method: "GET"
70
- }).then((r) => r.arrayBuffer()).then((r) => new Uint8Array(r));
71
- await this.#localStore.put(key, block);
72
- return block;
73
- }
74
- return await this.#localStore.get(key);
75
- }
76
- async has(key) {
77
- if (await this.#localStore.has(key)) {
78
- return true;
79
- }
80
- if (this.#isConnected && this.#apiHost) {
81
- return await fetch(this.url(this.#apiHost, key), {
82
- method: "HEAD"
83
- }).then((r) => r.ok);
84
- }
85
- return false;
86
- }
87
- async put(key, val) {
88
- await this.#localStore.put(key, val);
89
- await this.#addToQueue(key);
90
- this.#flushQueue();
91
- return key;
92
- }
93
- async destroy() {
94
- await this.#localStore.destroy();
95
- }
96
- // REMOTE
97
- async putRemote(key, val) {
98
- if (this.#apiHost) {
99
- await fetch(this.url(this.#apiHost, key), {
100
- method: "POST",
101
- body: val
102
- });
103
- }
104
- }
105
- async putCarRemote(car) {
106
- if (this.#apiHost) {
107
- await fetch(this.url(this.#apiHost), {
108
- method: "POST",
109
- headers: {
110
- "Content-Type": "application/vnd.ipld.car"
111
- },
112
- body: car
113
- });
114
- }
115
- }
116
- // QUEUE
117
- queueCacheName = `${storeName()}/state/queue`;
118
- async #addToQueue(key) {
119
- await this.#saveQueue([
120
- ...this.#queue,
121
- key.toString()
122
- ]);
123
- }
124
- async #flushQueueInt() {
125
- if (!this.#isConnected || !this.#apiHost) {
126
- return;
127
- }
128
- const keys = [
129
- ...this.#queue
130
- ];
131
- if (keys.length === 0) {
132
- return;
133
- }
134
- const blocks = await Promise.all(keys.map(async (key) => {
135
- const cid = CID.parse(key);
136
- const bytes = await this.#localStore.get(cid);
137
- return {
138
- cid,
139
- bytes
140
- };
141
- }));
142
- const car = await this.#createCar(blocks);
143
- await this.putCarRemote(car);
144
- const queue = [
145
- ...this.#queue
146
- ].filter((k) => {
147
- if (keys.includes(k)) {
148
- return false;
149
- }
150
- return true;
151
- });
152
- await this.#saveQueue(queue);
153
- }
154
- async #restoreQueue() {
155
- const fromCache = await IDB.get(this.queueCacheName);
156
- if (fromCache && Array.isArray(fromCache)) {
157
- this.#queue = fromCache;
158
- this.#flushQueue();
159
- }
160
- }
161
- async #saveQueue(items) {
162
- const arr = [
163
- ...items
164
- ];
165
- this.#queue = arr;
166
- await IDB.set(this.queueCacheName, arr);
167
- }
168
- // 🛠️
169
- async #createCar(blocks) {
170
- const { writer, out } = CarWriter.create();
171
- const outPromise = all(out);
172
- await Promise.all(blocks.map((block) => {
173
- return writer.put(block);
174
- }));
175
- await writer.close();
176
- return Uint8Arrays.concat(await outPromise);
177
- }
178
- };
179
-
180
- // src/capabilities/blockstore.ts
181
- var blockstore_default = (async (context) => {
182
- const client = context.getCapability(ClientCapabilities.Client);
183
- const apiHost = client.config.values.runtime?.services?.edge?.url || "http://localhost:8787";
184
- const blockstore = create(apiHost);
185
- await blockstore.open();
186
- return contributes(WnfsCapabilities.Blockstore, blockstore);
187
- });
188
- export {
189
- blockstore_default as default
190
- };
191
- //# sourceMappingURL=blockstore-2JFU4NBU.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/blockstore.ts", "../../../src/blockstore.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type PluginContext, contributes } from '@dxos/app-framework';\nimport { ClientCapabilities } from '@dxos/plugin-client';\n\nimport * as Blockstore from '../blockstore';\n\nimport { WnfsCapabilities } from './capabilities';\n\nexport default async (context: PluginContext) => {\n const client = context.getCapability(ClientCapabilities.Client);\n const apiHost = client.config.values.runtime?.services?.edge?.url || 'http://localhost:8787';\n const blockstore = Blockstore.create(apiHost);\n await blockstore.open();\n\n return contributes(WnfsCapabilities.Blockstore, blockstore);\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { CarWriter } from '@ipld/car';\nimport type { Block } from '@ipld/car/reader';\nimport { BaseBlockstore } from 'blockstore-core';\nimport { IDBBlockstore } from 'blockstore-idb';\nimport debounce from 'debounce';\nimport * as IDB from 'idb-keyval';\nimport all from 'it-all';\nimport { CID } from 'multiformats';\nimport * as Uint8Arrays from 'uint8arrays';\n\nimport { storeName } from './helpers';\n\nexport const create = (apiHost?: string) => {\n return new MixedBlockstore(apiHost);\n};\n\n/**\n * A blockstore that communicates with the DXOS blob service,\n * and which uses an indexedDB blockstore as a client cache.\n */\nexport class MixedBlockstore extends BaseBlockstore {\n readonly #apiHost: string | undefined;\n readonly #localStore: IDBBlockstore;\n\n #isConnected: boolean;\n #flushQueue: () => void;\n #queue: string[];\n\n constructor(apiHost?: string) {\n super();\n\n this.#apiHost = apiHost ? apiHost.replace(/\\/?$/, '') : undefined;\n this.#localStore = new IDBBlockstore(storeName());\n this.#isConnected = navigator.onLine;\n this.#queue = [];\n\n this.#flushQueue = debounce(this.#flushQueueInt, 5000);\n }\n\n async open(): Promise<void> {\n await this.#localStore.open();\n await this.#restoreQueue();\n\n window.addEventListener('offline', async () => {\n this.#isConnected = false;\n });\n\n window.addEventListener('online', async () => {\n this.#isConnected = true;\n this.#flushQueue();\n });\n }\n\n url(apiHost: string, cid?: CID): string {\n const path = cid ? cid.toString() : '';\n return `${apiHost}/api/file${path.length ? '/' + path : ''}`;\n }\n\n // BLOCKSTORE IMPLEMENTATION\n\n override async delete(key: CID): Promise<void> {\n await this.#localStore.delete(key);\n\n if (this.#isConnected && this.#apiHost) {\n await fetch(this.url(this.#apiHost, key), {\n method: 'DELETE',\n });\n }\n }\n\n override async get(key: CID): Promise<Uint8Array> {\n if (await this.#localStore.has(key)) {\n return await this.#localStore.get(key);\n }\n\n if (this.#isConnected && this.#apiHost) {\n const block = await fetch(this.url(this.#apiHost, key), {\n method: 'GET',\n })\n .then((r) => r.arrayBuffer())\n .then((r) => new Uint8Array(r));\n\n // Make sure it is cached locally\n await this.#localStore.put(key, block);\n\n return block;\n }\n\n return await this.#localStore.get(key);\n }\n\n override async has(key: CID): Promise<boolean> {\n if (await this.#localStore.has(key)) {\n return true;\n }\n\n if (this.#isConnected && this.#apiHost) {\n return await fetch(this.url(this.#apiHost, key), {\n method: 'HEAD',\n }).then((r) => r.ok);\n }\n\n return false;\n }\n\n override async put(key: CID, val: Uint8Array): Promise<CID> {\n await this.#localStore.put(key, val);\n\n await this.#addToQueue(key);\n this.#flushQueue();\n\n return key;\n }\n\n async destroy(): Promise<void> {\n await this.#localStore.destroy();\n }\n\n // REMOTE\n\n async putRemote(key: CID, val: Uint8Array): Promise<void> {\n if (this.#apiHost) {\n await fetch(this.url(this.#apiHost, key), {\n method: 'POST',\n body: val as Uint8Array<ArrayBuffer>,\n });\n }\n }\n\n async putCarRemote(car: Uint8Array): Promise<void> {\n if (this.#apiHost) {\n await fetch(this.url(this.#apiHost), {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/vnd.ipld.car',\n },\n body: car as Uint8Array<ArrayBuffer>,\n });\n }\n }\n\n // QUEUE\n\n readonly queueCacheName = `${storeName()}/state/queue`;\n\n async #addToQueue(key: CID): Promise<void> {\n await this.#saveQueue([...this.#queue, key.toString()]);\n }\n\n async #flushQueueInt(): Promise<void> {\n if (!this.#isConnected || !this.#apiHost) {\n return;\n }\n\n const keys = [...this.#queue];\n if (keys.length === 0) {\n return;\n }\n\n // Collect blocks\n const blocks = await Promise.all(\n keys.map(async (key) => {\n const cid = CID.parse(key);\n const bytes = await this.#localStore.get(cid);\n return { cid, bytes };\n }),\n );\n\n // Create & submit CAR\n const car = await this.#createCar(blocks);\n await this.putCarRemote(car);\n\n // Adjust queue\n const queue = [...this.#queue].filter((k) => {\n if (keys.includes(k)) {\n return false;\n }\n\n return true;\n });\n\n await this.#saveQueue(queue);\n }\n\n async #restoreQueue(): Promise<void> {\n const fromCache = await IDB.get(this.queueCacheName);\n if (fromCache && Array.isArray(fromCache)) {\n this.#queue = fromCache;\n this.#flushQueue();\n }\n }\n\n async #saveQueue(items: string[]): Promise<void> {\n const arr = [...items];\n this.#queue = arr;\n await IDB.set(this.queueCacheName, arr);\n }\n\n // 🛠️\n\n async #createCar(blocks: Block[]): Promise<Uint8Array> {\n const { writer, out } = CarWriter.create();\n const outPromise = all(out);\n\n await Promise.all(\n blocks.map((block) => {\n return writer.put(block);\n }),\n );\n\n await writer.close();\n return Uint8Arrays.concat(await outPromise);\n }\n}\n"],
5
- "mappings": ";;;;;;;;;AAIA,SAA6BA,mBAAmB;AAChD,SAASC,0BAA0B;;;ACDnC,SAASC,iBAAiB;AAE1B,SAASC,sBAAsB;AAC/B,SAASC,qBAAqB;AAC9B,OAAOC,cAAc;AACrB,YAAYC,SAAS;AACrB,OAAOC,SAAS;AAChB,SAASC,WAAW;AACpB,YAAYC,iBAAiB;AAItB,IAAMC,SAAS,CAACC,YAAAA;AACrB,SAAO,IAAIC,gBAAgBD,OAAAA;AAC7B;AAMO,IAAMC,kBAAN,cAA8BC,eAAAA;EAC1B;EACA;EAET;EACA;EACA;EAEA,YAAYF,SAAkB;AAC5B,UAAK;AAEL,SAAK,WAAWA,UAAUA,QAAQG,QAAQ,QAAQ,EAAA,IAAMC;AACxD,SAAK,cAAc,IAAIC,cAAcC,UAAAA,CAAAA;AACrC,SAAK,eAAeC,UAAUC;AA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DBBlockstore", "debounce", "IDB", "all", "CID", "Uint8Arrays", "create", "apiHost", "MixedBlockstore", "BaseBlockstore", "replace", "undefined", "IDBBlockstore", "storeName", "navigator", "onLine", "debounce", "open", "window", "addEventListener", "url", "cid", "path", "toString", "length", "delete", "key", "fetch", "method", "get", "has", "block", "then", "r", "arrayBuffer", "Uint8Array", "put", "ok", "val", "destroy", "putRemote", "body", "putCarRemote", "car", "headers", "queueCacheName", "keys", "blocks", "Promise", "all", "map", "CID", "parse", "bytes", "queue", "filter", "k", "includes", "fromCache", "Array", "isArray", "items", "arr", "set", "writer", "out", "CarWriter", "outPromise", "close", "concat", "context", "client", "getCapability", "ClientCapabilities", "Client", "apiHost", "config", "values", "runtime", "services", "edge", "url", "blockstore", "create", "open", "contributes", "WnfsCapabilities", "Blockstore"]
7
- }
@@ -1,71 +0,0 @@
1
- import {
2
- __export,
3
- meta
4
- } from "./chunk-OGPGLJCV.mjs";
5
-
6
- // src/types/File.ts
7
- var File_exports = {};
8
- __export(File_exports, {
9
- File: () => File,
10
- make: () => make
11
- });
12
- import * as Schema from "effect/Schema";
13
- import { Obj, Type } from "@dxos/echo";
14
- import { FormAnnotation } from "@dxos/echo/internal";
15
- var File = Schema.Struct({
16
- name: Schema.String.pipe(Schema.optional),
17
- type: Schema.String.pipe(FormAnnotation.set(false)),
18
- cid: Schema.String.pipe(FormAnnotation.set(false)),
19
- timestamp: Schema.String.pipe(FormAnnotation.set(false), Schema.optional)
20
- }).pipe(Type.Obj({
21
- typename: "dxos.org/type/File",
22
- version: "0.1.0"
23
- }));
24
- var make = (props) => Obj.make(File, props);
25
-
26
- // src/types/types.ts
27
- import * as Schema2 from "effect/Schema";
28
- import { FileInfoSchema } from "@dxos/app-framework";
29
- import { SpaceSchema } from "@dxos/react-client/echo";
30
- (function(WnfsAction2) {
31
- class Create extends Schema2.TaggedClass()(`${meta.id}/action/create`, {
32
- input: FileInfoSchema.pick("name", "type", "cid").pipe(Schema2.required),
33
- output: Schema2.Struct({
34
- object: File
35
- })
36
- }) {
37
- }
38
- WnfsAction2.Create = Create;
39
- WnfsAction2.UploadAnnotationId = Symbol.for(`${meta.id}/annotation/upload`);
40
- WnfsAction2.UploadFileSchema = Schema2.Struct({
41
- file: Schema2.instanceOf(File).annotations({
42
- [WnfsAction2.UploadAnnotationId]: {
43
- // Accept file types.
44
- "image/*": [
45
- ".jpg",
46
- ".jpeg",
47
- ".png",
48
- ".gif"
49
- ],
50
- "application/pdf": [
51
- ".pdf"
52
- ]
53
- }
54
- })
55
- });
56
- class Upload extends Schema2.TaggedClass()(`${meta.id}/action/upload`, {
57
- input: Schema2.extend(WnfsAction2.UploadFileSchema, Schema2.Struct({
58
- space: SpaceSchema
59
- })),
60
- output: Schema2.required(FileInfoSchema)
61
- }) {
62
- }
63
- WnfsAction2.Upload = Upload;
64
- })(WnfsAction || (WnfsAction = {}));
65
- var WnfsAction;
66
-
67
- export {
68
- File_exports,
69
- WnfsAction
70
- };
71
- //# sourceMappingURL=chunk-CWMKN2F6.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types/File.ts", "../../../src/types/types.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Obj, Type } from '@dxos/echo';\nimport { FormAnnotation } from '@dxos/echo/internal';\n\nexport const File = Schema.Struct({\n name: Schema.String.pipe(Schema.optional),\n type: Schema.String.pipe(FormAnnotation.set(false)),\n cid: Schema.String.pipe(FormAnnotation.set(false)),\n timestamp: Schema.String.pipe(FormAnnotation.set(false), Schema.optional),\n}).pipe(\n Type.Obj({\n typename: 'dxos.org/type/File',\n version: '0.1.0',\n }),\n);\n\nexport type File = Schema.Schema.Type<typeof File>;\n\nexport const make = (props: Obj.MakeProps<typeof File>) => Obj.make(File, props);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { FileInfoSchema } from '@dxos/app-framework';\nimport { SpaceSchema } from '@dxos/react-client/echo';\n\nimport { meta } from '../meta';\n\nimport * as File from './File';\n\nexport namespace WnfsAction {\n export class Create extends Schema.TaggedClass<Create>()(`${meta.id}/action/create`, {\n input: FileInfoSchema.pick('name', 'type', 'cid').pipe(Schema.required),\n output: Schema.Struct({\n object: File.File,\n }),\n }) {}\n\n export const UploadAnnotationId = Symbol.for(`${meta.id}/annotation/upload`);\n\n export const UploadFileSchema = Schema.Struct({\n file: Schema.instanceOf(File.File).annotations({\n [UploadAnnotationId]: {\n // Accept file types.\n 'image/*': ['.jpg', '.jpeg', '.png', '.gif'],\n 'application/pdf': ['.pdf'],\n // TODO(wittjosiah): Add more file types.\n },\n }),\n });\n\n export type UploadFileForm = Schema.Schema.Type<typeof UploadFileSchema>;\n\n export class Upload extends Schema.TaggedClass<Upload>()(`${meta.id}/action/upload`, {\n input: Schema.extend(UploadFileSchema, Schema.Struct({ space: SpaceSchema })),\n output: Schema.required(FileInfoSchema),\n }) {}\n}\n"],
5
- "mappings": ";;;;;;AAAA;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,KAAKC,YAAY;AAC1B,SAASC,sBAAsB;AAExB,IAAMC,OAAcC,cAAO;EAChCC,MAAaC,cAAOC,KAAYC,eAAQ;EACxCC,MAAaH,cAAOC,KAAKG,eAAeC,IAAI,KAAA,CAAA;EAC5CC,KAAYN,cAAOC,KAAKG,eAAeC,IAAI,KAAA,CAAA;EAC3CE,WAAkBP,cAAOC,KAAKG,eAAeC,IAAI,KAAA,GAAeH,eAAQ;AAC1E,CAAA,EAAGD,KACDO,KAAKC,IAAI;EACPC,UAAU;EACVC,SAAS;AACX,CAAA,CAAA;AAKK,IAAMC,OAAO,CAACC,UAAsCJ,IAAIG,KAAKf,MAAMgB,KAAAA;;;ACnB1E,YAAYC,aAAY;AAExB,SAASC,sBAAsB;AAC/B,SAASC,mBAAmB;UAMXC,aAAAA;EACR,MAAMC,eAAsBC,oBAAW,EAAW,GAAGC,KAAKC,EAAE,kBAAkB;IACnFC,OAAOC,eAAeC,KAAK,QAAQ,QAAQ,KAAA,EAAOC,KAAYC,gBAAQ;IACtEC,QAAeC,eAAO;MACpBC,QAAaC;IACf,CAAA;EACF,CAAA,EAAA;EAAI;cALSZ,SAAAA;cAOAa,qBAAqBC,OAAOC,IAAI,GAAGb,KAAKC,EAAE,oBAAoB;cAE9Da,mBAA0BN,eAAO;IAC5CO,MAAaC,mBAAgBN,IAAI,EAAEO,YAAY;MAC7C,CAAApB,YAACc,kBAAAA,GAAqB;;QAEpB,WAAW;UAAC;UAAQ;UAAS;UAAQ;;QACrC,mBAAmB;UAAC;;MAEtB;IACF,CAAA;EACF,CAAA;EAIO,MAAMO,eAAsBnB,oBAAW,EAAW,GAAGC,KAAKC,EAAE,kBAAkB;IACnFC,OAAciB,eAAMtB,YAACiB,kBAAyBN,eAAO;MAAEY,OAAOC;IAAY,CAAA,CAAA;IAC1Ed,QAAeD,iBAASH,cAAAA;EAC1B,CAAA,EAAA;EAAI;cAHSe,SAAAA;AAIf,GA3BiBrB,eAAAA,aAAAA,CAAAA,EAAAA;;",
6
- "names": ["Schema", "Obj", "Type", "FormAnnotation", "File", "Struct", "name", "String", "pipe", "optional", "type", "FormAnnotation", "set", "cid", "timestamp", "Type", "Obj", "typename", "version", "make", "props", "Schema", "FileInfoSchema", "SpaceSchema", "WnfsAction", "Create", "TaggedClass", "meta", "id", "input", "FileInfoSchema", "pick", "pipe", "required", "output", "Struct", "object", "File", "UploadAnnotationId", "Symbol", "for", "UploadFileSchema", "file", "instanceOf", "annotations", "Upload", "extend", "space", "SpaceSchema"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/helpers/common.ts", "../../../src/helpers/load.ts", "../../../src/helpers/wnfs-url.ts", "../../../src/helpers/upload.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport type { Blockstore } from 'interface-blockstore';\nimport { CID } from 'multiformats/cid';\nimport { sha256 } from 'multiformats/hashes/sha2';\nimport { type BlockStore as WnfsBlockStore } from 'wnfs';\n\nimport * as crypto from '@dxos/crypto';\nimport { type Space } from '@dxos/react-client/echo';\n\n//\n// PATH\n//\n\nexport const filePath = (fileName: string, space: Space) => {\n return ['spaces', space.id, 'files', fileName];\n};\n\n//\n// RNG\n//\n\nexport class Rng {\n randomBytes(count: number): Uint8Array {\n return new Uint8Array(crypto.randomBytes(count));\n }\n}\n\n//\n// STORE\n//\n\nexport const store = (blockstore: Blockstore): WnfsBlockStore => {\n const getBlock = async (cid: Uint8Array): Promise<Uint8Array | undefined> => {\n const decodedCid = CID.decode(cid);\n return await blockstore.get(decodedCid);\n };\n\n const hasBlock = async (cid: Uint8Array): Promise<boolean> => {\n const decodedCid = CID.decode(cid);\n return await blockstore.has(decodedCid);\n };\n\n const putBlockKeyed = async (cid: Uint8Array, bytes: Uint8Array): Promise<void> => {\n const decodedCid = CID.decode(cid);\n await blockstore.put(decodedCid, bytes);\n };\n\n // Don't hash blocks with the rs-wnfs default Blake 3, sha256 has better support.\n const putBlock = async (bytes: Uint8Array, codec: number): Promise<Uint8Array> => {\n const hash = await sha256.digest(bytes);\n const cid = CID.create(1, codec, hash);\n await blockstore.put(cid, bytes);\n return cid.bytes;\n };\n\n return { getBlock, hasBlock, putBlockKeyed, putBlock };\n};\n\nexport const storeName = () => 'dxos/wnfs';\n\n//\n// OTHER\n//\n\nexport const readFile = (file: File): Promise<Uint8Array> => {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = (event) => {\n const result = event.target?.result;\n if (result === null || result === undefined || typeof result === 'string') {\n reject(new Error('Expected an ArrayBuffer'));\n return;\n }\n resolve(new Uint8Array(result));\n };\n reader.onerror = (err) => {\n reject(err);\n };\n reader.readAsArrayBuffer(file);\n });\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport type { Blockstore } from 'interface-blockstore';\nimport { CID } from 'multiformats';\nimport * as Uint8Arrays from 'uint8arrays';\nimport { AccessKey, PrivateDirectory, PrivateForest, PrivateNode } from 'wnfs';\n\nimport { type Space } from '@dxos/react-client/echo';\n\nimport { type WnfsCapabilities } from '../capabilities';\n\nimport { Rng, store } from './common';\n\n//\n// LOAD\n//\n\nexport const loadWnfs = async ({\n space,\n blockstore,\n instances,\n}: {\n space: Space;\n blockstore: Blockstore;\n instances?: WnfsCapabilities.Instances;\n}) => {\n // TODO(wittjosiah): Remove.\n // Delete old properties if they exist.\n if (space.properties.wnfs_access_key !== undefined && space.properties.wnfs_private_forest_cid !== undefined) {\n delete space.properties.wnfs_access_key;\n delete space.properties.wnfs_private_forest_cid;\n }\n\n const cacheKey = space.properties.wnfs?.privateForestCid;\n if (instances?.[cacheKey]) {\n return instances[cacheKey];\n }\n\n const exists = !!space.properties.wnfs;\n const instance = exists ? await loadWnfsDir(blockstore, space) : await createWnfsDir(blockstore, space);\n if (instances) {\n instances[cacheKey] = instance;\n }\n\n return instance;\n};\n\n//\n// PRIVATE\n//\n\nconst createWnfsDir = async (blockstore: Blockstore, space: Space) => {\n const wnfsStore = store(blockstore);\n const rng = new Rng();\n const forest = new PrivateForest(rng);\n\n const dirResult = await PrivateDirectory.newAndStore(forest.emptyName(), new Date(), forest, wnfsStore, rng);\n const dir = dirResult.rootDir as PrivateDirectory;\n\n const [accessKeyRaw, newForest]: [AccessKey, PrivateForest] = await dir\n .asNode()\n .store(dirResult.forest as PrivateForest, wnfsStore, rng);\n\n const cidBytes = await newForest.store(wnfsStore);\n\n space.properties.wnfs = {\n accessKey: Uint8Arrays.toString(accessKeyRaw.toBytes(), 'base64'),\n privateForestCid: CID.decode(cidBytes).toString(),\n };\n\n return {\n directory: dir,\n forest: newForest,\n };\n};\n\nconst loadWnfsDir = async (blockstore: Blockstore, space: Space) => {\n const wnfsStore = store(blockstore);\n\n const accessKey = AccessKey.fromBytes(Uint8Arrays.fromString(space.properties.wnfs.accessKey, 'base64'));\n const forest: PrivateForest = await PrivateForest.load(\n CID.parse(space.properties.wnfs.privateForestCid).bytes,\n wnfsStore,\n );\n const node: PrivateNode = await PrivateNode.load(accessKey, forest, wnfsStore);\n\n return {\n directory: node.asDir(),\n forest,\n };\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport type { Blockstore } from 'interface-blockstore';\nimport { type PrivateDirectory, type PrivateForest } from 'wnfs';\n\nimport { store } from './common';\n\nexport const wnfsUrl = (filePath: string[]) => {\n return 'wnfs://' + filePath.map((f) => encodeURIComponent(f)).join('/');\n};\n\nexport const getPathFromUrl = (wnfsUrl: string) =>\n wnfsUrl\n .replace(/^wnfs:\\/\\//, '')\n .split('/')\n .map((p) => decodeURIComponent(p));\n\nexport const getBlobUrl = async ({\n wnfsUrl,\n blockstore,\n forest,\n directory,\n type,\n}: {\n wnfsUrl: string;\n blockstore: Blockstore;\n forest: PrivateForest;\n directory: PrivateDirectory;\n type?: string;\n}) => {\n const path = getPathFromUrl(wnfsUrl);\n const wnfsStore = store(blockstore);\n const { result } = await directory.read(path, true, forest, wnfsStore);\n const blob = new Blob([result], { type });\n return URL.createObjectURL(blob);\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport type { Blockstore } from 'interface-blockstore';\nimport { CID } from 'multiformats';\nimport * as Raw from 'multiformats/codecs/raw';\nimport { sha256 } from 'multiformats/hashes/sha2';\n\nimport type { Space } from '@dxos/client/echo';\nimport { log } from '@dxos/log';\n\nimport { type WnfsCapabilities } from '../capabilities';\n\nimport { Rng, filePath, store } from './common';\nimport { loadWnfs } from './load';\nimport { wnfsUrl } from './wnfs-url';\n\nexport const upload = async ({\n file,\n blockstore,\n instances,\n space,\n}: {\n file: File;\n blockstore: Blockstore;\n instances?: WnfsCapabilities.Instances;\n space: Space;\n}) => {\n const { directory, forest } = await loadWnfs({ blockstore, instances, space });\n const wnfsStore = store(blockstore);\n\n const bytes = new Uint8Array(await file.arrayBuffer());\n const hash = await sha256.digest(bytes);\n const cid = CID.create(1, Raw.code, hash);\n\n const path = filePath(cid.toString(), space);\n\n // Given the root directory of the private file system,\n // write the file contents to `path` in said directory.\n const result = await directory.write(path, true, bytes, new Date(), forest, wnfsStore, new Rng());\n\n // Given the new immutable instance of the root directory after writing to it,\n // **store** the changes in the \"dark forest\" and the associated (block) store.\n const [_, updatedForest] = await result.rootDir.store(result.forest, wnfsStore, new Rng());\n const cidBytes = await updatedForest.store(wnfsStore);\n\n // Update the forest pointer on the associated space.\n space.properties.wnfs.privateForestCid = CID.decode(cidBytes).toString();\n\n // Generate `wnfs://` URL & return the info.\n const info = {\n name: file.name,\n type: file.type,\n url: wnfsUrl(path),\n cid: cid.toString(),\n };\n\n log('upload', { file, info });\n return info;\n};\n"],
5
- "mappings": ";AAKA,SAASA,WAAW;AACpB,SAASC,cAAc;AAGvB,YAAYC,YAAY;AAOjB,IAAMC,WAAW,CAACC,UAAkBC,UAAAA;AACzC,SAAO;IAAC;IAAUA,MAAMC;IAAI;IAASF;;AACvC;AAMO,IAAMG,MAAN,MAAMA;EACXC,YAAYC,OAA2B;AACrC,WAAO,IAAIC,WAAkBF,mBAAYC,KAAAA,CAAAA;EAC3C;AACF;AAMO,IAAME,QAAQ,CAACC,eAAAA;AACpB,QAAMC,WAAW,OAAOC,QAAAA;AACtB,UAAMC,aAAaC,IAAIC,OAAOH,GAAAA;AAC9B,WAAO,MAAMF,WAAWM,IAAIH,UAAAA;EAC9B;AAEA,QAAMI,WAAW,OAAOL,QAAAA;AACtB,UAAMC,aAAaC,IAAIC,OAAOH,GAAAA;AAC9B,WAAO,MAAMF,WAAWQ,IAAIL,UAAAA;EAC9B;AAEA,QAAMM,gBAAgB,OAAOP,KAAiBQ,UAAAA;AAC5C,UAAMP,aAAaC,IAAIC,OAAOH,GAAAA;AAC9B,UAAMF,WAAWW,IAAIR,YAAYO,KAAAA;EACnC;AAGA,QAAME,WAAW,OAAOF,OAAmBG,UAAAA;AACzC,UAAMC,OAAO,MAAMC,OAAOC,OAAON,KAAAA;AACjC,UAAMR,MAAME,IAAIa,OAAO,GAAGJ,OAAOC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AASC,UAAAA,eAAc;AAGvB,SAASC,WAAW;;AAQb,IAAMC,SAAS,OAAO,EAC3BC,MACAC,YACAC,WACAC,MAAK,MAMN;AACC,QAAM,EAAEC,WAAWC,OAAM,IAAK,MAAMC,SAAS;IAAEL;IAAYC;IAAWC;EAAM,CAAA;AAC5E,QAAMI,YAAYC,MAAMP,UAAAA;AAExB,QAAMQ,QAAQ,IAAIC,WAAW,MAAMV,KAAKW,YAAW,CAAA;AACnD,QAAMC,OAAO,MAAMC,QAAOC,OAAOL,KAAAA;AACjC,QAAMM,MAAMC,KAAIC,OAAO,GAAOC,UAAMN,IAAAA;AAEpC,QAAMO,OAAOC,SAASL,IAAIM,SAAQ,GAAIlB,KAAAA;AAItC,QAAMmB,SAAS,MAAMlB,UAAUmB,MAAMJ,MAAM,MAAMV,OAAO,oBAAIe,KAAAA,GAAQnB,QAAQE,WAAW,IAAIkB,IAAAA,CAAAA;AAI3F,QAAM,CAACC,GAAGC,aAAAA,IAAiB,MAAML,OAAOM,QAAQpB,MAAMc,OAAOjB,QAAQE,WAAW,IAAIkB,IAAAA,CAAAA;AACpF,QAAMI,WAAW,MAAMF,cAAcnB,MAAMD,SAAAA;AAG3CJ,QAAM2B,WAAWC,KAAKC,mBAAmBhB,KAAIiB,OAAOJ,QAAAA,EAAUR,SAAQ;AAGtE,QAAMa,OAAO;IACXC,MAAMnC,KAAKmC;IACXC,MAAMpC,KAAKoC;IACXC,KAAKC,QAAQnB,IAAAA;IACbJ,KAAKA,IAAIM,SAAQ;EACnB;AAEAkB,MAAI,UAAU;IAAEvC;IAAMkC;EAAK,GAAA;;;;;;AAC3B,SAAOA;AACT;",
6
- "names": ["CID", "sha256", "crypto", "filePath", "fileName", "space", "id", "Rng", "randomBytes", "count", "Uint8Array", "store", "blockstore", "getBlock", "cid", "decodedCid", "CID", "decode", "get", "hasBlock", "has", "putBlockKeyed", "bytes", "put", "putBlock", "codec", "hash", "sha256", "digest", "create", "storeName", "CID", "Uint8Arrays", "AccessKey", "PrivateDirectory", "PrivateForest", "PrivateNode", "loadWnfs", "space", "blockstore", "instances", "properties", "wnfs_access_key", "undefined", "wnfs_private_forest_cid", "cacheKey", "wnfs", "privateForestCid", "exists", "instance", "loadWnfsDir", "createWnfsDir", "wnfsStore", "store", "rng", "Rng", "forest", "PrivateForest", "dirResult", "PrivateDirectory", "newAndStore", "emptyName", "Date", "dir", "rootDir", "accessKeyRaw", "newForest", "asNode", "cidBytes", "accessKey", "toString", "toBytes", "CID", "decode", "directory", "AccessKey", "fromBytes", "fromString", "load", "parse", "bytes", "node", "PrivateNode", "asDir", "wnfsUrl", "filePath", "map", "f", "encodeURIComponent", "join", "getPathFromUrl", "replace", "split", "p", "decodeURIComponent", "getBlobUrl", "blockstore", "forest", "directory", "type", "path", "wnfsStore", "store", "result", "read", "blob", "Blob", "URL", "createObjectURL", "CID", "Raw", "sha256", "log", "upload", "file", "blockstore", "instances", "space", "directory", "forest", "loadWnfs", "wnfsStore", "store", "bytes", "Uint8Array", "arrayBuffer", "hash", "sha256", "digest", "cid", "CID", "create", "code", "path", "filePath", "toString", "result", "write", "Date", "Rng", "_", "updatedForest", "rootDir", "cidBytes", "properties", "wnfs", "privateForestCid", "decode", "info", "name", "type", "url", "wnfsUrl", "log"]
7
- }
@@ -1,16 +0,0 @@
1
- import {
2
- meta
3
- } from "./chunk-OGPGLJCV.mjs";
4
-
5
- // src/capabilities/capabilities.ts
6
- import { defineCapability } from "@dxos/app-framework";
7
- (function(WnfsCapabilities2) {
8
- WnfsCapabilities2.Blockstore = defineCapability(`${meta.id}/capability/blockstore`);
9
- WnfsCapabilities2.Instances = defineCapability(`${meta.id}/capability/instances`);
10
- })(WnfsCapabilities || (WnfsCapabilities = {}));
11
- var WnfsCapabilities;
12
-
13
- export {
14
- WnfsCapabilities
15
- };
16
- //# sourceMappingURL=chunk-F4QHZWQD.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/capabilities.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Blockstore } from 'interface-blockstore';\nimport { type PrivateDirectory, type PrivateForest } from 'wnfs';\n\nimport { defineCapability } from '@dxos/app-framework';\nimport { type SpaceId } from '@dxos/keys';\n\nimport { meta } from '../meta';\n\nexport namespace WnfsCapabilities {\n export const Blockstore = defineCapability<Blockstore>(`${meta.id}/capability/blockstore`);\n\n export type Instances = Record<SpaceId, { directory: PrivateDirectory; forest: PrivateForest }>;\n export const Instances = defineCapability<Instances>(`${meta.id}/capability/instances`);\n}\n"],
5
- "mappings": ";;;;;AAOA,SAASA,wBAAwB;UAKhBC,mBAAAA;oBACFC,aAAaC,iBAA6B,GAAGC,KAAKC,EAAE,wBAAwB;oBAG5EC,YAAYH,iBAA4B,GAAGC,KAAKC,EAAE,uBAAuB;AACxF,GALiBJ,qBAAAA,mBAAAA,CAAAA,EAAAA;;",
6
- "names": ["defineCapability", "WnfsCapabilities", "Blockstore", "defineCapability", "meta", "id", "Instances"]
7
- }
@@ -1,25 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __export = (target, all) => {
3
- for (var name in all)
4
- __defProp(target, name, { get: all[name], enumerable: true });
5
- };
6
-
7
- // src/meta.ts
8
- import { trim } from "@dxos/util";
9
- var meta = {
10
- id: "dxos.org/plugin/wnfs",
11
- name: "WNFS",
12
- description: trim`
13
- Decentralized file storage using the Web Native File System protocol.
14
- Store and sync files with end-to-end encryption across devices without central servers.
15
- `,
16
- icon: "ph--file-cloud--regular",
17
- iconHue: "teal",
18
- source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-wnfs"
19
- };
20
-
21
- export {
22
- __export,
23
- meta
24
- };
25
- //# sourceMappingURL=chunk-OGPGLJCV.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/meta.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: PluginMeta = {\n id: 'dxos.org/plugin/wnfs',\n name: 'WNFS',\n description: trim`\n Decentralized file storage using the Web Native File System protocol.\n Store and sync files with end-to-end encryption across devices without central servers.\n `,\n icon: 'ph--file-cloud--regular',\n iconHue: 'teal',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-wnfs',\n};\n"],
5
- "mappings": ";;;;;;;AAKA,SAASA,YAAY;AAEd,IAAMC,OAAmB;EAC9BC,IAAI;EACJC,MAAM;EACNC,aAAaC;;;;EAIbC,MAAM;EACNC,SAAS;EACTC,QAAQ;AACV;",
6
- "names": ["trim", "meta", "id", "name", "description", "trim", "icon", "iconHue", "source"]
7
- }
@@ -1,16 +0,0 @@
1
- // src/capabilities/index.ts
2
- import { lazy } from "@dxos/app-framework";
3
- var Blockstore = lazy(() => import("./blockstore-2JFU4NBU.mjs"));
4
- var FileUploader = lazy(() => import("./file-uploader-W6TJLAAK.mjs"));
5
- var IntentResolver = lazy(() => import("./intent-resolver-FSW2EQF4.mjs"));
6
- var Markdown = lazy(() => import("./markdown-WYQDCVFQ.mjs"));
7
- var ReactSurface = lazy(() => import("./react-surface-DMU47U3X.mjs"));
8
-
9
- export {
10
- Blockstore,
11
- FileUploader,
12
- IntentResolver,
13
- Markdown,
14
- ReactSurface
15
- };
16
- //# sourceMappingURL=chunk-ZFPJA5F4.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/index.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const Blockstore = lazy(() => import('./blockstore'));\nexport const FileUploader = lazy(() => import('./file-uploader'));\nexport const IntentResolver = lazy(() => import('./intent-resolver'));\nexport const Markdown = lazy(() => import('./markdown'));\nexport const ReactSurface = lazy(() => import('./react-surface'));\n\nexport * from './capabilities';\n"],
5
- "mappings": ";AAIA,SAASA,YAAY;AAEd,IAAMC,aAAaC,KAAK,MAAM,OAAO,2BAAA,CAAA;AACrC,IAAMC,eAAeD,KAAK,MAAM,OAAO,8BAAA,CAAA;AACvC,IAAME,iBAAiBF,KAAK,MAAM,OAAO,gCAAA,CAAA;AACzC,IAAMG,WAAWH,KAAK,MAAM,OAAO,yBAAA,CAAA;AACnC,IAAMI,eAAeJ,KAAK,MAAM,OAAO,8BAAA,CAAA;",
6
- "names": ["lazy", "Blockstore", "lazy", "FileUploader", "IntentResolver", "Markdown", "ReactSurface"]
7
- }
@@ -1,30 +0,0 @@
1
- import {
2
- WnfsAction
3
- } from "./chunk-CWMKN2F6.mjs";
4
- import "./chunk-OGPGLJCV.mjs";
5
-
6
- // src/capabilities/file-uploader.ts
7
- import * as Effect from "effect/Effect";
8
- import * as Function from "effect/Function";
9
- import { Capabilities, chain, contributes, createIntent } from "@dxos/app-framework";
10
- import { SpaceAction } from "@dxos/plugin-space/types";
11
- var file_uploader_default = ((context) => {
12
- return contributes(Capabilities.FileUploader, (space, file) => {
13
- const { dispatch } = context.getCapability(Capabilities.IntentDispatcher);
14
- const program = Effect.gen(function* () {
15
- const fileInfo = yield* dispatch(createIntent(WnfsAction.Upload, {
16
- space,
17
- file
18
- }));
19
- yield* dispatch(Function.pipe(createIntent(WnfsAction.Create, fileInfo), chain(SpaceAction.AddObject, {
20
- target: space
21
- })));
22
- return fileInfo;
23
- });
24
- return Effect.runPromise(program);
25
- });
26
- });
27
- export {
28
- file_uploader_default as default
29
- };
30
- //# sourceMappingURL=file-uploader-W6TJLAAK.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/file-uploader.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Function from 'effect/Function';\n\nimport { Capabilities, type PluginContext, chain, contributes, createIntent } from '@dxos/app-framework';\nimport { SpaceAction } from '@dxos/plugin-space/types';\n\nimport { WnfsAction } from '../types';\n\nexport default (context: PluginContext) => {\n return contributes(Capabilities.FileUploader, (space, file) => {\n const { dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n const program = Effect.gen(function* () {\n const fileInfo = yield* dispatch(createIntent(WnfsAction.Upload, { space, file }));\n yield* dispatch(\n Function.pipe(createIntent(WnfsAction.Create, fileInfo), chain(SpaceAction.AddObject, { target: space })),\n );\n\n return fileInfo;\n });\n\n return Effect.runPromise(program);\n });\n};\n"],
5
- "mappings": ";;;;;;AAIA,YAAYA,YAAY;AACxB,YAAYC,cAAc;AAE1B,SAASC,cAAkCC,OAAOC,aAAaC,oBAAoB;AACnF,SAASC,mBAAmB;AAI5B,IAAA,yBAAe,CAACC,YAAAA;AACd,SAAOC,YAAYC,aAAaC,cAAc,CAACC,OAAOC,SAAAA;AACpD,UAAM,EAAEC,SAAQ,IAAKN,QAAQO,cAAcL,aAAaM,gBAAgB;AACxE,UAAMC,UAAiBC,WAAI,aAAA;AACzB,YAAMC,WAAW,OAAOL,SAASM,aAAaC,WAAWC,QAAQ;QAAEV;QAAOC;MAAK,CAAA,CAAA;AAC/E,aAAOC,SACIS,cAAKH,aAAaC,WAAWG,QAAQL,QAAAA,GAAWM,MAAMC,YAAYC,WAAW;QAAEC,QAAQhB;MAAM,CAAA,CAAA,CAAA;AAGxG,aAAOO;IACT,CAAA;AAEA,WAAcU,kBAAWZ,OAAAA;EAC3B,CAAA;AACF;",
6
- "names": ["Effect", "Function", "Capabilities", "chain", "contributes", "createIntent", "SpaceAction", "context", "contributes", "Capabilities", "FileUploader", "space", "file", "dispatch", "getCapability", "IntentDispatcher", "program", "gen", "fileInfo", "createIntent", "WnfsAction", "Upload", "pipe", "Create", "chain", "SpaceAction", "AddObject", "target", "runPromise"]
7
- }
@@ -1,48 +0,0 @@
1
- import {
2
- upload
3
- } from "./chunk-D6VTEQIE.mjs";
4
- import {
5
- WnfsCapabilities
6
- } from "./chunk-F4QHZWQD.mjs";
7
- import {
8
- File_exports,
9
- WnfsAction
10
- } from "./chunk-CWMKN2F6.mjs";
11
- import "./chunk-OGPGLJCV.mjs";
12
-
13
- // src/capabilities/intent-resolver.ts
14
- import { Capabilities, contributes, createResolver } from "@dxos/app-framework";
15
- var intent_resolver_default = ((context) => contributes(Capabilities.IntentResolver, [
16
- // TODO(wittjosiah): Deleting the object doesn't delete the wnfs blob.
17
- // Consider ways to trigger blob deletion based on object deletion and/or adding file system manager.
18
- createResolver({
19
- intent: WnfsAction.Create,
20
- resolve: ({ name, type, cid }) => ({
21
- data: {
22
- object: File_exports.make({
23
- name,
24
- type,
25
- cid
26
- })
27
- }
28
- })
29
- }),
30
- createResolver({
31
- intent: WnfsAction.Upload,
32
- resolve: async ({ file, space }) => {
33
- const blockstore = context.getCapability(WnfsCapabilities.Blockstore);
34
- const info = await upload({
35
- file,
36
- blockstore,
37
- space
38
- });
39
- return {
40
- data: info
41
- };
42
- }
43
- })
44
- ]));
45
- export {
46
- intent_resolver_default as default
47
- };
48
- //# sourceMappingURL=intent-resolver-FSW2EQF4.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/intent-resolver.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, type PluginContext, contributes, createResolver } from '@dxos/app-framework';\n\nimport { upload } from '../helpers';\nimport { WnfsAction, WnfsFile } from '../types';\n\nimport { WnfsCapabilities } from './capabilities';\n\nexport default (context: PluginContext) =>\n contributes(Capabilities.IntentResolver, [\n // TODO(wittjosiah): Deleting the object doesn't delete the wnfs blob.\n // Consider ways to trigger blob deletion based on object deletion and/or adding file system manager.\n createResolver({\n intent: WnfsAction.Create,\n resolve: ({ name, type, cid }) => ({\n data: {\n object: WnfsFile.make({ name, type, cid }),\n },\n }),\n }),\n createResolver({\n intent: WnfsAction.Upload,\n resolve: async ({ file, space }) => {\n const blockstore = context.getCapability(WnfsCapabilities.Blockstore);\n const info = await upload({ file, blockstore, space });\n return { data: info };\n },\n }),\n ]);\n"],
5
- "mappings": ";;;;;;;;;;;;;AAIA,SAASA,cAAkCC,aAAaC,sBAAsB;AAO9E,IAAA,2BAAe,CAACC,YACdC,YAAYC,aAAaC,gBAAgB;;;EAGvCC,eAAe;IACbC,QAAQC,WAAWC;IACnBC,SAAS,CAAC,EAAEC,MAAMC,MAAMC,IAAG,OAAQ;MACjCC,MAAM;QACJC,QAAQC,aAASC,KAAK;UAAEN;UAAMC;UAAMC;QAAI,CAAA;MAC1C;IACF;EACF,CAAA;EACAP,eAAe;IACbC,QAAQC,WAAWU;IACnBR,SAAS,OAAO,EAAES,MAAMC,MAAK,MAAE;AAC7B,YAAMC,aAAanB,QAAQoB,cAAcC,iBAAiBC,UAAU;AACpE,YAAMC,OAAO,MAAMC,OAAO;QAAEP;QAAME;QAAYD;MAAM,CAAA;AACpD,aAAO;QAAEN,MAAMW;MAAK;IACtB;EACF,CAAA;CACD;",
6
- "names": ["Capabilities", "contributes", "createResolver", "context", "contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "WnfsAction", "Create", "resolve", "name", "type", "cid", "data", "object", "WnfsFile", "make", "Upload", "file", "space", "blockstore", "getCapability", "WnfsCapabilities", "Blockstore", "info", "upload"]
7
- }