@lapis-notes/api 0.1.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.
Files changed (400) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/LICENSE.md +4 -0
  3. package/README.md +43 -0
  4. package/dist/__tests__/data-adapter-conformance.js +205 -0
  5. package/dist/__tests__/lapis-runtime-manifest.js +32 -0
  6. package/dist/__tests__/svelte-internal-client.d.ts +3 -0
  7. package/dist/agent-result-views.d.ts +52 -0
  8. package/dist/agent-result-views.js +89 -0
  9. package/dist/agent-skills.d.ts +99 -0
  10. package/dist/agent-skills.js +182 -0
  11. package/dist/agent-tools.d.ts +92 -0
  12. package/dist/agent-tools.js +139 -0
  13. package/dist/app-database-host.d.ts +4 -0
  14. package/dist/app-database-host.js +4 -0
  15. package/dist/app-shell-plugin-persistence.d.ts +15 -0
  16. package/dist/app-shell-plugin-persistence.js +34 -0
  17. package/dist/app-url.d.ts +54 -0
  18. package/dist/app-url.js +269 -0
  19. package/dist/application-compatibility.d.ts +31 -0
  20. package/dist/application-compatibility.js +64 -0
  21. package/dist/application-state.svelte.d.ts +14 -0
  22. package/dist/application-state.svelte.js +30 -0
  23. package/dist/assets/lapis-logo.svg +471 -0
  24. package/dist/bases.d.ts +281 -0
  25. package/dist/bases.js +475 -0
  26. package/dist/cache.svelte.d.ts +569 -0
  27. package/dist/cache.svelte.js +1433 -0
  28. package/dist/command.svelte.d.ts +337 -0
  29. package/dist/command.svelte.js +571 -0
  30. package/dist/compat.d.ts +29 -0
  31. package/dist/compat.js +30 -0
  32. package/dist/components/configuration/configuration.css +199 -0
  33. package/dist/components/configuration/date-setting.svelte +71 -0
  34. package/dist/components/configuration/date-setting.svelte.d.ts +8 -0
  35. package/dist/components/configuration/list-setting.svelte +128 -0
  36. package/dist/components/configuration/list-setting.svelte.d.ts +13 -0
  37. package/dist/components/configuration/object-array-row-grip.svelte +78 -0
  38. package/dist/components/configuration/object-array-row-grip.svelte.d.ts +9 -0
  39. package/dist/components/configuration/object-array-row.svelte +163 -0
  40. package/dist/components/configuration/object-array-row.svelte.d.ts +19 -0
  41. package/dist/components/configuration/object-array-setting.svelte +196 -0
  42. package/dist/components/configuration/object-array-setting.svelte.d.ts +15 -0
  43. package/dist/components/configuration/object-array-table-dnd.d.ts +8 -0
  44. package/dist/components/configuration/object-array-table-dnd.js +10 -0
  45. package/dist/components/configuration/object-array-utils.d.ts +11 -0
  46. package/dist/components/configuration/object-array-utils.js +103 -0
  47. package/dist/components/configuration/object-grid-setting.svelte +79 -0
  48. package/dist/components/configuration/object-grid-setting.svelte.d.ts +10 -0
  49. package/dist/components/configuration/object-map-row.svelte +147 -0
  50. package/dist/components/configuration/object-map-row.svelte.d.ts +15 -0
  51. package/dist/components/configuration/object-map-setting.svelte +137 -0
  52. package/dist/components/configuration/object-map-setting.svelte.d.ts +14 -0
  53. package/dist/components/configuration/object-map-types.d.ts +5 -0
  54. package/dist/components/configuration/object-map-types.js +1 -0
  55. package/dist/components/configuration/options-combobox-setting.svelte +129 -0
  56. package/dist/components/configuration/options-combobox-setting.svelte.d.ts +12 -0
  57. package/dist/components/copy-button/button.svelte +93 -0
  58. package/dist/components/copy-button/button.svelte.d.ts +13 -0
  59. package/dist/components/copy-button/index.d.ts +2 -0
  60. package/dist/components/copy-button/index.js +2 -0
  61. package/dist/components/editor/editor.css +565 -0
  62. package/dist/components/editor/editor.d.ts +33 -0
  63. package/dist/components/editor/editor.js +132 -0
  64. package/dist/components/editor/editor.svelte +176 -0
  65. package/dist/components/editor/editor.svelte.d.ts +15 -0
  66. package/dist/components/editor/embedded-editor-surface.d.ts +12 -0
  67. package/dist/components/editor/embedded-editor-surface.js +22 -0
  68. package/dist/components/editor/embedded-editor-surface.svelte +115 -0
  69. package/dist/components/editor/embedded-editor-surface.svelte.d.ts +17 -0
  70. package/dist/components/editor/extensions/autocomplete/index.d.ts +2 -0
  71. package/dist/components/editor/extensions/autocomplete/index.js +2 -0
  72. package/dist/components/editor/extensions/autocomplete/lapis-code-mirror-autocomplete.d.ts +16 -0
  73. package/dist/components/editor/extensions/autocomplete/lapis-code-mirror-autocomplete.js +34 -0
  74. package/dist/components/editor/extensions/autocomplete/vault-completion-sources.d.ts +27 -0
  75. package/dist/components/editor/extensions/autocomplete/vault-completion-sources.js +55 -0
  76. package/dist/components/editor/extensions/class-highlighter/index.d.ts +1 -0
  77. package/dist/components/editor/extensions/class-highlighter/index.js +47 -0
  78. package/dist/components/editor/extensions/fold-gutter/index.d.ts +8 -0
  79. package/dist/components/editor/extensions/fold-gutter/index.js +40 -0
  80. package/dist/components/editor/extensions/gutter-line-style-sync/index.d.ts +2 -0
  81. package/dist/components/editor/extensions/gutter-line-style-sync/index.js +118 -0
  82. package/dist/components/editor/extensions/lint/index.d.ts +4 -0
  83. package/dist/components/editor/extensions/lint/index.js +4 -0
  84. package/dist/components/editor/extensions/lint/lapis-code-mirror-lint.d.ts +26 -0
  85. package/dist/components/editor/extensions/lint/lapis-code-mirror-lint.js +101 -0
  86. package/dist/components/editor/extensions/lint/lapis-lint-diagnostic-helpers.d.ts +8 -0
  87. package/dist/components/editor/extensions/lint/lapis-lint-diagnostic-helpers.js +7 -0
  88. package/dist/components/editor/extensions/lint/lapis-lint-diagnostic.d.ts +20 -0
  89. package/dist/components/editor/extensions/lint/lapis-lint-diagnostic.js +47 -0
  90. package/dist/components/editor/extensions/lint/lapis-lint-hover-tooltip.d.ts +9 -0
  91. package/dist/components/editor/extensions/lint/lapis-lint-hover-tooltip.js +373 -0
  92. package/dist/components/editor/extensions/lint/lapis-lint-inline-widget.d.ts +31 -0
  93. package/dist/components/editor/extensions/lint/lapis-lint-inline-widget.js +191 -0
  94. package/dist/components/editor/extensions/lint/lapis-lint-tooltip.svelte +176 -0
  95. package/dist/components/editor/extensions/lint/lapis-lint-tooltip.svelte.d.ts +15 -0
  96. package/dist/components/editor/extensions/lint/lint-tooltip-actions.d.ts +11 -0
  97. package/dist/components/editor/extensions/lint/lint-tooltip-actions.js +21 -0
  98. package/dist/components/editor/extensions/lint/mount-lint-tooltip.d.ts +16 -0
  99. package/dist/components/editor/extensions/lint/mount-lint-tooltip.js +60 -0
  100. package/dist/components/editor/extensions/search/dom.d.ts +2 -0
  101. package/dist/components/editor/extensions/search/dom.js +6 -0
  102. package/dist/components/editor/extensions/search/index.d.ts +35 -0
  103. package/dist/components/editor/extensions/search/index.js +44 -0
  104. package/dist/components/editor/extensions/search/search.svelte +335 -0
  105. package/dist/components/editor/extensions/search/search.svelte.d.ts +8 -0
  106. package/dist/components/editor/index.d.ts +9 -0
  107. package/dist/components/editor/index.js +9 -0
  108. package/dist/components/editor/language-service/dom.d.ts +1 -0
  109. package/dist/components/editor/language-service/dom.js +6 -0
  110. package/dist/components/editor/language-service/index.d.ts +28 -0
  111. package/dist/components/editor/language-service/index.js +342 -0
  112. package/dist/components/empty-view/empty-view.css +39 -0
  113. package/dist/components/empty-view/empty-view.svelte +26 -0
  114. package/dist/components/empty-view/empty-view.svelte.d.ts +9 -0
  115. package/dist/components/empty-view/index.d.ts +2 -0
  116. package/dist/components/empty-view/index.js +2 -0
  117. package/dist/components/icon/icon-list.css +74 -0
  118. package/dist/components/icon/icon-list.svelte +213 -0
  119. package/dist/components/icon/icon-list.svelte.d.ts +11 -0
  120. package/dist/components/icon/icon.svelte +15 -0
  121. package/dist/components/icon/icon.svelte.d.ts +7 -0
  122. package/dist/components/icon/index.d.ts +3 -0
  123. package/dist/components/icon/index.js +3 -0
  124. package/dist/components/menu/context-menu.svelte +89 -0
  125. package/dist/components/menu/context-menu.svelte.d.ts +11 -0
  126. package/dist/components/menu/drawer-menu.svelte +83 -0
  127. package/dist/components/menu/drawer-menu.svelte.d.ts +8 -0
  128. package/dist/components/menu/dropdown-menu.svelte +89 -0
  129. package/dist/components/menu/dropdown-menu.svelte.d.ts +11 -0
  130. package/dist/components/menu/index.d.ts +6 -0
  131. package/dist/components/menu/index.js +6 -0
  132. package/dist/components/menu/menu.css +139 -0
  133. package/dist/components/menu/menu.svelte +37 -0
  134. package/dist/components/menu/menu.svelte.d.ts +11 -0
  135. package/dist/components/menu/mobile-menu-query.svelte.d.ts +3 -0
  136. package/dist/components/menu/mobile-menu-query.svelte.js +21 -0
  137. package/dist/components/menu/popover-menu.svelte +90 -0
  138. package/dist/components/menu/popover-menu.svelte.d.ts +10 -0
  139. package/dist/components/select/index.d.ts +2 -0
  140. package/dist/components/select/index.js +2 -0
  141. package/dist/components/select/select.svelte +72 -0
  142. package/dist/components/select/select.svelte.d.ts +25 -0
  143. package/dist/configuration-option-source-providers.d.ts +17 -0
  144. package/dist/configuration-option-source-providers.js +59 -0
  145. package/dist/configuration-option-source-registry.d.ts +59 -0
  146. package/dist/configuration-option-source-registry.js +123 -0
  147. package/dist/configuration.svelte.d.ts +258 -0
  148. package/dist/configuration.svelte.js +887 -0
  149. package/dist/context-keys.svelte.d.ts +42 -0
  150. package/dist/context-keys.svelte.js +278 -0
  151. package/dist/context.svelte.d.ts +247 -0
  152. package/dist/context.svelte.js +540 -0
  153. package/dist/daily-document-provider.d.ts +38 -0
  154. package/dist/daily-document-provider.js +176 -0
  155. package/dist/design-core-button-types.d.ts +7 -0
  156. package/dist/design-core-button-types.js +1 -0
  157. package/dist/diagnostics.d.ts +93 -0
  158. package/dist/diagnostics.js +84 -0
  159. package/dist/dialog-portal.d.ts +3 -0
  160. package/dist/dialog-portal.js +3 -0
  161. package/dist/docs-api.d.ts +44 -0
  162. package/dist/docs-api.js +29 -0
  163. package/dist/editor-view-registry.d.ts +35 -0
  164. package/dist/editor-view-registry.js +112 -0
  165. package/dist/editor.svelte.d.ts +126 -0
  166. package/dist/editor.svelte.js +454 -0
  167. package/dist/embed-registry.d.ts +15 -0
  168. package/dist/embed-registry.js +16 -0
  169. package/dist/enhance.d.ts +111 -0
  170. package/dist/enhance.js +309 -0
  171. package/dist/events.d.ts +28 -0
  172. package/dist/events.js +49 -0
  173. package/dist/file-manager.d.ts +90 -0
  174. package/dist/file-manager.js +289 -0
  175. package/dist/file-tools/app-tools.d.ts +3 -0
  176. package/dist/file-tools/app-tools.js +242 -0
  177. package/dist/file-tools/index.d.ts +3 -0
  178. package/dist/file-tools/index.js +3 -0
  179. package/dist/file-tools/paths.d.ts +14 -0
  180. package/dist/file-tools/paths.js +33 -0
  181. package/dist/file-tools/vault-operations.d.ts +3 -0
  182. package/dist/file-tools/vault-operations.js +60 -0
  183. package/dist/generated/plugin-host-modules.schema.generated.d.ts +371 -0
  184. package/dist/generated/plugin-host-modules.schema.generated.js +374 -0
  185. package/dist/glob.d.ts +15 -0
  186. package/dist/glob.js +68 -0
  187. package/dist/history.svelte.d.ts +24 -0
  188. package/dist/history.svelte.js +74 -0
  189. package/dist/hooks/createVirtualizer.svelte.d.ts +7 -0
  190. package/dist/hooks/createVirtualizer.svelte.js +70 -0
  191. package/dist/hooks/index.d.ts +5 -0
  192. package/dist/hooks/index.js +5 -0
  193. package/dist/hooks/is-mobile.svelte.d.ts +5 -0
  194. package/dist/hooks/is-mobile.svelte.js +23 -0
  195. package/dist/hooks/mountComponent.svelte.d.ts +7 -0
  196. package/dist/hooks/mountComponent.svelte.js +16 -0
  197. package/dist/hooks/use-text-highlight.d.ts +17 -0
  198. package/dist/hooks/use-text-highlight.js +82 -0
  199. package/dist/hooks/useBoundingRect.svelte.d.ts +11 -0
  200. package/dist/hooks/useBoundingRect.svelte.js +46 -0
  201. package/dist/icons/index.d.ts +57 -0
  202. package/dist/icons/index.js +288 -0
  203. package/dist/index.d.ts +87 -0
  204. package/dist/index.js +87 -0
  205. package/dist/language-service/index.d.ts +9 -0
  206. package/dist/language-service/index.js +7 -0
  207. package/dist/language-service/manager.d.ts +47 -0
  208. package/dist/language-service/manager.js +404 -0
  209. package/dist/language-service/types.d.ts +92 -0
  210. package/dist/language-service/types.js +1 -0
  211. package/dist/language-service/virtual-document.d.ts +11 -0
  212. package/dist/language-service/virtual-document.js +45 -0
  213. package/dist/language-service/worker-protocol.d.ts +63 -0
  214. package/dist/language-service/worker-protocol.js +1 -0
  215. package/dist/language-service/worker-provider.d.ts +9 -0
  216. package/dist/language-service/worker-provider.js +38 -0
  217. package/dist/lapis-extension.d.ts +244 -0
  218. package/dist/lapis-extension.js +591 -0
  219. package/dist/links.d.ts +34 -0
  220. package/dist/links.js +191 -0
  221. package/dist/loaders.d.ts +9 -0
  222. package/dist/loaders.js +59 -0
  223. package/dist/localization-manager.svelte.d.ts +56 -0
  224. package/dist/localization-manager.svelte.js +157 -0
  225. package/dist/logging.d.ts +172 -0
  226. package/dist/logging.js +352 -0
  227. package/dist/markdown-extension-registry.d.ts +31 -0
  228. package/dist/markdown-extension-registry.js +31 -0
  229. package/dist/markdown-file-surface-registry.d.ts +25 -0
  230. package/dist/markdown-file-surface-registry.js +23 -0
  231. package/dist/markdown.d.ts +205 -0
  232. package/dist/markdown.js +147 -0
  233. package/dist/menu-utils.d.ts +1 -0
  234. package/dist/menu-utils.js +47 -0
  235. package/dist/menu.svelte.d.ts +121 -0
  236. package/dist/menu.svelte.js +295 -0
  237. package/dist/metadata-value.d.ts +10 -0
  238. package/dist/metadata-value.js +173 -0
  239. package/dist/metadata.svelte.d.ts +106 -0
  240. package/dist/metadata.svelte.js +608 -0
  241. package/dist/notifications.d.ts +209 -0
  242. package/dist/notifications.js +338 -0
  243. package/dist/open-file.d.ts +23 -0
  244. package/dist/open-file.js +102 -0
  245. package/dist/platform.d.ts +86 -0
  246. package/dist/platform.js +86 -0
  247. package/dist/plugin-asset-server.d.ts +60 -0
  248. package/dist/plugin-asset-server.js +222 -0
  249. package/dist/plugin-assets.d.ts +4 -0
  250. package/dist/plugin-assets.js +3 -0
  251. package/dist/plugin-capability-facade.d.ts +104 -0
  252. package/dist/plugin-capability-facade.js +61 -0
  253. package/dist/plugin-dependency-resolver.d.ts +36 -0
  254. package/dist/plugin-dependency-resolver.js +54 -0
  255. package/dist/plugin-dependency-scanner.d.ts +9 -0
  256. package/dist/plugin-dependency-scanner.js +274 -0
  257. package/dist/plugin-distribution/canonical-json.d.ts +1 -0
  258. package/dist/plugin-distribution/canonical-json.js +40 -0
  259. package/dist/plugin-distribution/compatibility.d.ts +5 -0
  260. package/dist/plugin-distribution/compatibility.js +38 -0
  261. package/dist/plugin-distribution/errors.d.ts +11 -0
  262. package/dist/plugin-distribution/errors.js +13 -0
  263. package/dist/plugin-distribution/hashes.d.ts +2 -0
  264. package/dist/plugin-distribution/hashes.js +17 -0
  265. package/dist/plugin-distribution/index.d.ts +18 -0
  266. package/dist/plugin-distribution/index.js +18 -0
  267. package/dist/plugin-distribution/installed-plugin-state.d.ts +20 -0
  268. package/dist/plugin-distribution/installed-plugin-state.js +73 -0
  269. package/dist/plugin-distribution/installer.d.ts +89 -0
  270. package/dist/plugin-distribution/installer.js +395 -0
  271. package/dist/plugin-distribution/manager.d.ts +128 -0
  272. package/dist/plugin-distribution/manager.js +358 -0
  273. package/dist/plugin-distribution/path-safety.d.ts +2 -0
  274. package/dist/plugin-distribution/path-safety.js +20 -0
  275. package/dist/plugin-distribution/plugin-bundle-verifier.d.ts +28 -0
  276. package/dist/plugin-distribution/plugin-bundle-verifier.js +96 -0
  277. package/dist/plugin-distribution/plugin-bundle-worker.d.ts +34 -0
  278. package/dist/plugin-distribution/plugin-bundle-worker.js +99 -0
  279. package/dist/plugin-distribution/plugin-bundle.d.ts +16 -0
  280. package/dist/plugin-distribution/plugin-bundle.js +244 -0
  281. package/dist/plugin-distribution/plugin-bundle.worker.d.ts +1 -0
  282. package/dist/plugin-distribution/plugin-bundle.worker.js +38 -0
  283. package/dist/plugin-distribution/registry-cache.d.ts +26 -0
  284. package/dist/plugin-distribution/registry-cache.js +85 -0
  285. package/dist/plugin-distribution/registry-client.d.ts +36 -0
  286. package/dist/plugin-distribution/registry-client.js +115 -0
  287. package/dist/plugin-distribution/reserved-ids.d.ts +4 -0
  288. package/dist/plugin-distribution/reserved-ids.js +10 -0
  289. package/dist/plugin-distribution/runtime-validation.d.ts +14 -0
  290. package/dist/plugin-distribution/runtime-validation.js +388 -0
  291. package/dist/plugin-distribution/schemas.d.ts +4895 -0
  292. package/dist/plugin-distribution/schemas.js +299 -0
  293. package/dist/plugin-distribution/signing.d.ts +5 -0
  294. package/dist/plugin-distribution/signing.js +38 -0
  295. package/dist/plugin-distribution/types.d.ts +217 -0
  296. package/dist/plugin-distribution/types.js +1 -0
  297. package/dist/plugin-install-progress.d.ts +15 -0
  298. package/dist/plugin-install-progress.js +86 -0
  299. package/dist/plugin-manager.d.ts +306 -0
  300. package/dist/plugin-manager.js +2848 -0
  301. package/dist/plugin-runtime-entry.d.ts +19 -0
  302. package/dist/plugin-runtime-entry.js +135 -0
  303. package/dist/plugin.d.ts +350 -0
  304. package/dist/plugin.js +754 -0
  305. package/dist/popover.d.ts +20 -0
  306. package/dist/popover.js +32 -0
  307. package/dist/promise-worker.d.ts +22 -0
  308. package/dist/promise-worker.js +65 -0
  309. package/dist/prompt-confirm.d.ts +9 -0
  310. package/dist/prompt-confirm.js +33 -0
  311. package/dist/search-document-provider.d.ts +45 -0
  312. package/dist/search-document-provider.js +54 -0
  313. package/dist/search-query/index.d.ts +78 -0
  314. package/dist/search-query/index.js +426 -0
  315. package/dist/search-query/parser.d.ts +3 -0
  316. package/dist/search-query/parser.js +16 -0
  317. package/dist/search-query/parser.terms.js +26 -0
  318. package/dist/search-query/search-query.grammar +128 -0
  319. package/dist/search.d.ts +19 -0
  320. package/dist/search.js +104 -0
  321. package/dist/setting-section-layout.d.ts +19 -0
  322. package/dist/setting-section-layout.js +194 -0
  323. package/dist/settings.svelte.d.ts +474 -0
  324. package/dist/settings.svelte.js +1421 -0
  325. package/dist/source-text-file-view.d.ts +25 -0
  326. package/dist/source-text-file-view.js +78 -0
  327. package/dist/status-bar.svelte.d.ts +29 -0
  328. package/dist/status-bar.svelte.js +72 -0
  329. package/dist/storage/app-database.d.ts +860 -0
  330. package/dist/storage/app-database.js +2372 -0
  331. package/dist/storage/blob-store.d.ts +12 -0
  332. package/dist/storage/blob-store.js +1 -0
  333. package/dist/storage/browser-app-database-coordination.d.ts +35 -0
  334. package/dist/storage/browser-app-database-coordination.js +207 -0
  335. package/dist/storage/browser-coordinated-app-database.d.ts +109 -0
  336. package/dist/storage/browser-coordinated-app-database.js +704 -0
  337. package/dist/storage/browser.d.ts +153 -0
  338. package/dist/storage/browser.js +794 -0
  339. package/dist/storage/desktop-native.d.ts +184 -0
  340. package/dist/storage/desktop-native.js +415 -0
  341. package/dist/storage/fs.d.ts +188 -0
  342. package/dist/storage/fs.js +307 -0
  343. package/dist/storage/index-projection.d.ts +236 -0
  344. package/dist/storage/index-projection.js +402 -0
  345. package/dist/storage/index.d.ts +17 -0
  346. package/dist/storage/index.js +17 -0
  347. package/dist/storage/keyval.d.ts +94 -0
  348. package/dist/storage/keyval.js +199 -0
  349. package/dist/storage/memory-vault-adapter.d.ts +44 -0
  350. package/dist/storage/memory-vault-adapter.js +351 -0
  351. package/dist/storage/native-vault-bootstrap-kv.d.ts +22 -0
  352. package/dist/storage/native-vault-bootstrap-kv.js +96 -0
  353. package/dist/storage/path.d.ts +22 -0
  354. package/dist/storage/path.js +110 -0
  355. package/dist/storage/search-embedding-provider.d.ts +75 -0
  356. package/dist/storage/search-embedding-provider.js +446 -0
  357. package/dist/storage/search-embedding-worker.d.ts +1 -0
  358. package/dist/storage/search-embedding-worker.js +63 -0
  359. package/dist/storage/search-query-evaluator.d.ts +14 -0
  360. package/dist/storage/search-query-evaluator.js +678 -0
  361. package/dist/storage/task-projection.d.ts +152 -0
  362. package/dist/storage/task-projection.js +154 -0
  363. package/dist/storage/turso-app-database.d.ts +150 -0
  364. package/dist/storage/turso-app-database.js +2671 -0
  365. package/dist/storage/vault-session.d.ts +37 -0
  366. package/dist/storage/vault-session.js +196 -0
  367. package/dist/storage/vault-state.d.ts +74 -0
  368. package/dist/storage/vault-state.js +181 -0
  369. package/dist/storage/vault.svelte.d.ts +257 -0
  370. package/dist/storage/vault.svelte.js +661 -0
  371. package/dist/suggest.d.ts +193 -0
  372. package/dist/suggest.js +391 -0
  373. package/dist/tasks.d.ts +7 -0
  374. package/dist/tasks.js +18 -0
  375. package/dist/telemetry.d.ts +116 -0
  376. package/dist/telemetry.js +103 -0
  377. package/dist/utils.d.ts +55 -0
  378. package/dist/utils.js +314 -0
  379. package/dist/vault-api.d.ts +5 -0
  380. package/dist/vault-api.js +3 -0
  381. package/dist/vault-maintenance-commands.d.ts +5 -0
  382. package/dist/vault-maintenance-commands.js +32 -0
  383. package/dist/view.svelte.d.ts +215 -0
  384. package/dist/view.svelte.js +381 -0
  385. package/dist/vite-env.d.ts +2 -0
  386. package/dist/workspace-host-internal.d.ts +7 -0
  387. package/dist/workspace-host-internal.js +7 -0
  388. package/dist/workspace-host.d.ts +10 -0
  389. package/dist/workspace-host.js +14 -0
  390. package/dist/workspace-layout-commands.d.ts +3 -0
  391. package/dist/workspace-layout-commands.js +72 -0
  392. package/dist/workspace-layout-normalizer.d.ts +92 -0
  393. package/dist/workspace-layout-normalizer.js +301 -0
  394. package/dist/workspace-layouts.d.ts +7 -0
  395. package/dist/workspace-layouts.js +23 -0
  396. package/dist/workspace-trust.d.ts +32 -0
  397. package/dist/workspace-trust.js +72 -0
  398. package/dist/workspace.svelte.d.ts +796 -0
  399. package/dist/workspace.svelte.js +4380 -0
  400. package/package.json +240 -0
@@ -0,0 +1,72 @@
1
+ import { promptConfirm } from "./prompt-confirm";
2
+ import { FuzzySuggestModal, SuggestModal } from "./suggest";
3
+ class SaveWorkspaceLayoutModal extends SuggestModal {
4
+ existingNames;
5
+ onSave;
6
+ constructor(app, existingNames, onSave) {
7
+ super(app);
8
+ this.existingNames = existingNames;
9
+ this.onSave = onSave;
10
+ this.setPlaceholder("Layout name");
11
+ this.emptyStateText = "Type a name to save this layout";
12
+ this.setInstructions([
13
+ { command: "↵", purpose: "Save" },
14
+ { command: "esc", purpose: "Cancel" },
15
+ ]);
16
+ }
17
+ getSuggestions(query) {
18
+ const name = query.trim();
19
+ const matches = this.existingNames.filter((existing) => existing.toLocaleLowerCase().includes(name.toLocaleLowerCase()));
20
+ if (name && !matches.includes(name))
21
+ return [name, ...matches];
22
+ return matches.length > 0 ? matches : this.existingNames;
23
+ }
24
+ renderSuggestion(value, el) {
25
+ el.textContent = this.existingNames.includes(value)
26
+ ? `Replace “${value}”`
27
+ : `Save as “${value}”`;
28
+ }
29
+ onChooseSuggestion(item) {
30
+ const name = item.trim();
31
+ if (!name)
32
+ return;
33
+ void (async () => {
34
+ if (this.existingNames.includes(name)) {
35
+ const replace = await promptConfirm(this.app.workspace.getCommandHostDocument(), {
36
+ title: "Replace workspace layout",
37
+ description: `Replace the saved layout “${name}” with the current workspace?`,
38
+ confirmLabel: "Replace",
39
+ });
40
+ if (!replace)
41
+ return;
42
+ }
43
+ await this.onSave(name);
44
+ })();
45
+ }
46
+ }
47
+ class LoadWorkspaceLayoutModal extends FuzzySuggestModal {
48
+ names;
49
+ onLoad;
50
+ constructor(app, names, onLoad) {
51
+ super(app);
52
+ this.names = names;
53
+ this.onLoad = onLoad;
54
+ this.setPlaceholder("Load workspace layout");
55
+ this.emptyStateText = "No saved workspace layouts";
56
+ }
57
+ getItems() {
58
+ return this.names;
59
+ }
60
+ getItemText(item) {
61
+ return item;
62
+ }
63
+ onChooseItem(item) {
64
+ void this.onLoad(item);
65
+ }
66
+ }
67
+ export function promptSaveWorkspaceLayout(app, existingNames, onSave) {
68
+ new SaveWorkspaceLayoutModal(app, existingNames, onSave).open();
69
+ }
70
+ export function promptLoadWorkspaceLayout(app, names, onLoad) {
71
+ new LoadWorkspaceLayoutModal(app, names, onLoad).open();
72
+ }
@@ -0,0 +1,92 @@
1
+ /**
2
+ * Pure workspace layout normalizer.
3
+ *
4
+ * Repairs common corruption in workspace JSON before it is hydrated into the
5
+ * live Svelte model:
6
+ *
7
+ * - Mismatched sizes arrays (length ≠ children count, non-finite values)
8
+ * - Out-of-range or non-integer currentTab indices
9
+ * - Empty floating / popout windows (dropped — popout windows cannot be restored
10
+ * across sessions)
11
+ * - Stale hiddenLeafIds / collapsed / panelSizes entries in sidebar groups that
12
+ * refer to leaf ids no longer present in the group's children
13
+ * - Unknown or malformed child node types (dropped gracefully)
14
+ * - Missing required fields filled with safe defaults
15
+ *
16
+ * The function is pure (no side effects, no imports from the live model) and
17
+ * always returns a structurally valid WorkspaceJson even when the input is
18
+ * empty, partial, or fully corrupted.
19
+ */
20
+ type WorkspaceLeafJson = {
21
+ id: string;
22
+ type: "leaf";
23
+ state: {
24
+ type: string;
25
+ state: Record<string, unknown>;
26
+ icon: string;
27
+ title: string;
28
+ };
29
+ };
30
+ type WorkspaceSidebarGroupJson = {
31
+ id: string;
32
+ type: "sidebar-group";
33
+ name: string;
34
+ icon?: string;
35
+ hiddenLeafIds?: string[];
36
+ collapsed?: Record<string, boolean>;
37
+ panelSizes?: Record<string, number>;
38
+ selectedLeafId?: string;
39
+ children: WorkspaceLeafJson[];
40
+ };
41
+ type WorkspaceTabsChildJson = WorkspaceLeafJson | WorkspaceSidebarGroupJson;
42
+ type WorkspaceTabsJson = {
43
+ id: string;
44
+ type: "tabs";
45
+ stacked: boolean;
46
+ children: WorkspaceTabsChildJson[];
47
+ currentTab: number;
48
+ };
49
+ type WorkspaceSplitJson = {
50
+ id: string;
51
+ type: "split";
52
+ direction: "horizontal" | "vertical";
53
+ sizes: number[];
54
+ children: Array<WorkspaceSplitJson | WorkspaceTabsJson>;
55
+ };
56
+ type WorkspaceSidedockJson = WorkspaceSplitJson & {
57
+ width: string;
58
+ };
59
+ type WorkspaceBottomPanelJson = WorkspaceTabsJson & {
60
+ height: string;
61
+ };
62
+ type WorkspaceWindowJson = {
63
+ id: string;
64
+ type: "floating";
65
+ mode?: "floating";
66
+ displayState?: "collapsed" | "minimized";
67
+ direction: "horizontal" | "vertical";
68
+ sizes: number[];
69
+ x: number;
70
+ y: number;
71
+ width: number;
72
+ height: number;
73
+ children: Array<WorkspaceSplitJson | WorkspaceTabsJson>;
74
+ };
75
+ /** Canonical workspace layout shape returned by the normalizer. */
76
+ export type WorkspaceJson = {
77
+ main: WorkspaceSplitJson;
78
+ left: WorkspaceSidedockJson;
79
+ right: WorkspaceSidedockJson;
80
+ bottom: WorkspaceBottomPanelJson;
81
+ floating?: WorkspaceWindowJson[];
82
+ active?: string;
83
+ };
84
+ /**
85
+ * Normalizes raw workspace layout JSON before it is loaded into the live
86
+ * workspace model.
87
+ *
88
+ * Always returns a structurally valid {@link WorkspaceJson} even when the input
89
+ * is `null`, empty, partial, or corrupted.
90
+ */
91
+ export declare function normalizeWorkspaceJson(raw: unknown): WorkspaceJson;
92
+ export {};
@@ -0,0 +1,301 @@
1
+ /**
2
+ * Pure workspace layout normalizer.
3
+ *
4
+ * Repairs common corruption in workspace JSON before it is hydrated into the
5
+ * live Svelte model:
6
+ *
7
+ * - Mismatched sizes arrays (length ≠ children count, non-finite values)
8
+ * - Out-of-range or non-integer currentTab indices
9
+ * - Empty floating / popout windows (dropped — popout windows cannot be restored
10
+ * across sessions)
11
+ * - Stale hiddenLeafIds / collapsed / panelSizes entries in sidebar groups that
12
+ * refer to leaf ids no longer present in the group's children
13
+ * - Unknown or malformed child node types (dropped gracefully)
14
+ * - Missing required fields filled with safe defaults
15
+ *
16
+ * The function is pure (no side effects, no imports from the live model) and
17
+ * always returns a structurally valid WorkspaceJson even when the input is
18
+ * empty, partial, or fully corrupted.
19
+ */
20
+ import { uniqueId } from "./utils";
21
+ // ---------------------------------------------------------------------------
22
+ // Low-level helpers
23
+ // ---------------------------------------------------------------------------
24
+ function ensureId(raw) {
25
+ return typeof raw === "string" && raw.length > 0 ? raw : uniqueId();
26
+ }
27
+ function ensureDirection(raw) {
28
+ return raw === "horizontal" ? "horizontal" : "vertical";
29
+ }
30
+ /**
31
+ * Returns a sizes array of exactly `count` positive finite numbers. Any missing
32
+ * or invalid slot is filled with 50 (equal-weight default).
33
+ */
34
+ function repairSizes(sizes, count) {
35
+ const arr = Array.isArray(sizes) ? sizes : [];
36
+ const result = [];
37
+ for (let i = 0; i < count; i++) {
38
+ const v = arr[i];
39
+ result.push(typeof v === "number" && isFinite(v) && v > 0 ? v : 50);
40
+ }
41
+ return result;
42
+ }
43
+ // ---------------------------------------------------------------------------
44
+ // Node normalizers
45
+ // ---------------------------------------------------------------------------
46
+ function normalizeLeaf(raw) {
47
+ if (!raw || typeof raw !== "object")
48
+ return null;
49
+ const r = raw;
50
+ if (r.type !== "leaf")
51
+ return null;
52
+ const s = r.state && typeof r.state === "object"
53
+ ? r.state
54
+ : {};
55
+ return {
56
+ id: ensureId(r.id),
57
+ type: "leaf",
58
+ state: {
59
+ type: typeof s.type === "string" ? s.type : "empty",
60
+ state: s.state && typeof s.state === "object"
61
+ ? s.state
62
+ : {},
63
+ icon: typeof s.icon === "string" ? s.icon : "",
64
+ title: typeof s.title === "string" ? s.title : "",
65
+ },
66
+ };
67
+ }
68
+ function normalizeSidebarGroup(raw) {
69
+ if (!raw || typeof raw !== "object")
70
+ return null;
71
+ const r = raw;
72
+ if (r.type !== "sidebar-group")
73
+ return null;
74
+ const children = (Array.isArray(r.children) ? r.children : [])
75
+ .map(normalizeLeaf)
76
+ .filter((c) => c !== null);
77
+ const childIds = new Set(children.map((c) => c.id));
78
+ const hiddenLeafIds = Array.isArray(r.hiddenLeafIds)
79
+ ? r.hiddenLeafIds.filter((id) => typeof id === "string" && childIds.has(id))
80
+ : undefined;
81
+ const collapsed = r.collapsed && typeof r.collapsed === "object"
82
+ ? Object.fromEntries(Object.entries(r.collapsed)
83
+ .filter(([k]) => childIds.has(k))
84
+ .map(([k, v]) => [k, Boolean(v)]))
85
+ : undefined;
86
+ const panelSizes = r.panelSizes && typeof r.panelSizes === "object"
87
+ ? Object.fromEntries(Object.entries(r.panelSizes)
88
+ .filter(([k]) => childIds.has(k))
89
+ .map(([k, v]) => [k, typeof v === "number" ? v : 50]))
90
+ : undefined;
91
+ return {
92
+ id: ensureId(r.id),
93
+ type: "sidebar-group",
94
+ name: typeof r.name === "string" ? r.name : "",
95
+ ...(r.icon !== undefined
96
+ ? { icon: typeof r.icon === "string" ? r.icon : "" }
97
+ : {}),
98
+ ...(hiddenLeafIds && hiddenLeafIds.length > 0 ? { hiddenLeafIds } : {}),
99
+ ...(collapsed && Object.keys(collapsed).length > 0 ? { collapsed } : {}),
100
+ ...(panelSizes && Object.keys(panelSizes).length > 0 ? { panelSizes } : {}),
101
+ ...(typeof r.selectedLeafId === "string" &&
102
+ r.selectedLeafId.length > 0 &&
103
+ children.some((child) => child.id === r.selectedLeafId)
104
+ ? { selectedLeafId: r.selectedLeafId }
105
+ : {}),
106
+ children,
107
+ };
108
+ }
109
+ function normalizeTabsChild(raw) {
110
+ if (!raw || typeof raw !== "object")
111
+ return null;
112
+ const r = raw;
113
+ if (r.type === "sidebar-group")
114
+ return normalizeSidebarGroup(raw);
115
+ return normalizeLeaf(raw);
116
+ }
117
+ function normalizeTabs(raw) {
118
+ if (!raw || typeof raw !== "object")
119
+ return null;
120
+ const r = raw;
121
+ if (r.type !== "tabs")
122
+ return null;
123
+ const children = (Array.isArray(r.children) ? r.children : [])
124
+ .map(normalizeTabsChild)
125
+ .filter((c) => c !== null);
126
+ const rawIndex = r.currentTab;
127
+ const currentTab = typeof rawIndex === "number" &&
128
+ Number.isInteger(rawIndex) &&
129
+ rawIndex >= 0 &&
130
+ rawIndex < children.length
131
+ ? rawIndex
132
+ : 0;
133
+ return {
134
+ id: ensureId(r.id),
135
+ type: "tabs",
136
+ stacked: r.stacked === true,
137
+ children,
138
+ currentTab,
139
+ };
140
+ }
141
+ function normalizeSplitChild(raw) {
142
+ if (!raw || typeof raw !== "object")
143
+ return null;
144
+ const r = raw;
145
+ if (r.type === "split")
146
+ return normalizeSplitInner(raw);
147
+ if (r.type === "tabs")
148
+ return normalizeTabs(raw);
149
+ return null;
150
+ }
151
+ function normalizeSplitInner(raw) {
152
+ if (!raw || typeof raw !== "object")
153
+ return null;
154
+ const r = raw;
155
+ if (r.type !== "split")
156
+ return null;
157
+ const direction = ensureDirection(r.direction);
158
+ const children = (Array.isArray(r.children) ? r.children : [])
159
+ .map(normalizeSplitChild)
160
+ .filter((c) => c !== null);
161
+ if (children.length === 0)
162
+ return null;
163
+ return {
164
+ id: ensureId(r.id),
165
+ type: "split",
166
+ direction,
167
+ sizes: repairSizes(r.sizes, children.length),
168
+ children,
169
+ };
170
+ }
171
+ function normalizeRootSplit(raw) {
172
+ const result = normalizeSplitInner(raw);
173
+ if (result)
174
+ return result;
175
+ // Fallback: a single empty-children tabs group. WorkspaceTabs.loadJson
176
+ // creates an empty leaf automatically when children is empty.
177
+ return {
178
+ id: uniqueId(),
179
+ type: "split",
180
+ direction: "vertical",
181
+ sizes: [100],
182
+ children: [
183
+ {
184
+ id: uniqueId(),
185
+ type: "tabs",
186
+ stacked: false,
187
+ children: [],
188
+ currentTab: 0,
189
+ },
190
+ ],
191
+ };
192
+ }
193
+ function normalizeSidedock(raw, defaultWidth) {
194
+ const width = raw && typeof raw === "object" && typeof raw.width === "string"
195
+ ? raw.width
196
+ : defaultWidth;
197
+ const result = normalizeSplitInner(raw);
198
+ if (result)
199
+ return { ...result, width };
200
+ // Fallback: empty sidedock. WorkspaceSidedock.loadJson tolerates no children.
201
+ return {
202
+ id: uniqueId(),
203
+ type: "split",
204
+ direction: "vertical",
205
+ sizes: [],
206
+ children: [],
207
+ width,
208
+ };
209
+ }
210
+ function normalizeBottomPanel(raw) {
211
+ const input = raw && typeof raw === "object" ? raw : {};
212
+ const tabs = normalizeTabs(raw) ?? {
213
+ id: typeof input.id === "string" && input.id.length > 0
214
+ ? input.id
215
+ : "bottom-panel",
216
+ type: "tabs",
217
+ stacked: false,
218
+ children: [],
219
+ currentTab: 0,
220
+ };
221
+ return {
222
+ ...tabs,
223
+ height: typeof input.height === "string" &&
224
+ /^(?:\d+(?:\.\d+)?)(?:px|rem|em|%)?$/iu.test(input.height.trim())
225
+ ? input.height
226
+ : "0px",
227
+ };
228
+ }
229
+ function normalizeFloatingWindow(raw) {
230
+ if (!raw || typeof raw !== "object")
231
+ return null;
232
+ const r = raw;
233
+ if (r.type !== "floating")
234
+ return null;
235
+ // Popout windows cannot be restored across sessions — drop them.
236
+ if (r.mode === "popout")
237
+ return null;
238
+ const children = (Array.isArray(r.children) ? r.children : [])
239
+ .map(normalizeSplitChild)
240
+ .filter((c) => c !== null);
241
+ // Drop windows with no leaf content.
242
+ if (!hasAnyLeaf(children))
243
+ return null;
244
+ const toNum = (v, fallback) => typeof v === "number" && isFinite(v) ? v : fallback;
245
+ const rawDisplayState = r.displayState;
246
+ const displayState = rawDisplayState === "collapsed" || rawDisplayState === "minimized"
247
+ ? rawDisplayState
248
+ : undefined;
249
+ return {
250
+ id: ensureId(r.id),
251
+ type: "floating",
252
+ mode: "floating",
253
+ ...(displayState !== undefined ? { displayState } : {}),
254
+ direction: ensureDirection(r.direction),
255
+ sizes: repairSizes(r.sizes, children.length),
256
+ x: toNum(r.x, 100),
257
+ y: toNum(r.y, 100),
258
+ width: toNum(r.width, 800),
259
+ height: toNum(r.height, 600),
260
+ children,
261
+ };
262
+ }
263
+ function hasAnyLeaf(nodes) {
264
+ for (const node of nodes) {
265
+ if (node.type === "tabs") {
266
+ if (node.children.length > 0)
267
+ return true;
268
+ }
269
+ else {
270
+ if (hasAnyLeaf(node.children))
271
+ return true;
272
+ }
273
+ }
274
+ return false;
275
+ }
276
+ // ---------------------------------------------------------------------------
277
+ // Public API
278
+ // ---------------------------------------------------------------------------
279
+ /**
280
+ * Normalizes raw workspace layout JSON before it is loaded into the live
281
+ * workspace model.
282
+ *
283
+ * Always returns a structurally valid {@link WorkspaceJson} even when the input
284
+ * is `null`, empty, partial, or corrupted.
285
+ */
286
+ export function normalizeWorkspaceJson(raw) {
287
+ const r = raw && typeof raw === "object" ? raw : {};
288
+ const floating = Array.isArray(r.floating)
289
+ ? r.floating
290
+ .map(normalizeFloatingWindow)
291
+ .filter((w) => w !== null)
292
+ : [];
293
+ return {
294
+ main: normalizeRootSplit(r.main),
295
+ left: normalizeSidedock(r.left, "22rem"),
296
+ right: normalizeSidedock(r.right, "0px"),
297
+ bottom: normalizeBottomPanel(r.bottom),
298
+ ...(floating.length > 0 ? { floating } : {}),
299
+ ...(typeof r.active === "string" && r.active ? { active: r.active } : {}),
300
+ };
301
+ }
@@ -0,0 +1,7 @@
1
+ export declare const NAMED_WORKSPACES_FILE = "workspaces.json";
2
+ export interface NamedWorkspaceStore {
3
+ workspaces: Record<string, unknown>;
4
+ active?: string;
5
+ }
6
+ export declare function parseNamedWorkspaceStore(raw: string): NamedWorkspaceStore;
7
+ export declare function serializeNamedWorkspaceStore(store: NamedWorkspaceStore): string;
@@ -0,0 +1,23 @@
1
+ export const NAMED_WORKSPACES_FILE = "workspaces.json";
2
+ export function parseNamedWorkspaceStore(raw) {
3
+ try {
4
+ const parsed = JSON.parse(raw);
5
+ const workspaces = parsed.workspaces &&
6
+ typeof parsed.workspaces === "object" &&
7
+ !Array.isArray(parsed.workspaces)
8
+ ? parsed.workspaces
9
+ : {};
10
+ return {
11
+ workspaces,
12
+ ...(typeof parsed.active === "string" && parsed.active
13
+ ? { active: parsed.active }
14
+ : {}),
15
+ };
16
+ }
17
+ catch {
18
+ return { workspaces: {} };
19
+ }
20
+ }
21
+ export function serializeNamedWorkspaceStore(store) {
22
+ return `${JSON.stringify(store, null, 2)}\n`;
23
+ }
@@ -0,0 +1,32 @@
1
+ import { EventDispatcher } from "./events";
2
+ import { type DataAdapter, type KeyValueStore } from "./storage";
3
+ export interface WorkspaceTrustState {
4
+ trusted: boolean;
5
+ identity: string;
6
+ updatedAt: number | null;
7
+ }
8
+ export interface WorkspaceTrustRequest {
9
+ reason?: string;
10
+ pluginId?: string | null;
11
+ capability?: string | null;
12
+ }
13
+ type WorkspaceTrustEvents = {
14
+ changed: [state: WorkspaceTrustState];
15
+ requested: [request: WorkspaceTrustRequest];
16
+ };
17
+ export declare class WorkspaceTrustService extends EventDispatcher<WorkspaceTrustEvents> {
18
+ readonly identity: string;
19
+ private readonly storage;
20
+ private readyPromise;
21
+ private state;
22
+ constructor(adapter: DataAdapter, store?: KeyValueStore);
23
+ get trusted(): boolean;
24
+ getState(): WorkspaceTrustState;
25
+ ready(): Promise<WorkspaceTrustState>;
26
+ grant(): Promise<WorkspaceTrustState>;
27
+ revoke(): Promise<WorkspaceTrustState>;
28
+ request(request?: WorkspaceTrustRequest): Promise<boolean>;
29
+ private load;
30
+ private updateState;
31
+ }
32
+ export {};
@@ -0,0 +1,72 @@
1
+ import { EventDispatcher } from "./events";
2
+ import { getAdapterVaultId, getDefaultVaultStateStore, ScopedVaultStore, } from "./storage";
3
+ const WORKSPACE_TRUST_KEY = "state";
4
+ export class WorkspaceTrustService extends EventDispatcher {
5
+ identity;
6
+ storage;
7
+ readyPromise = null;
8
+ state;
9
+ constructor(adapter, store = getDefaultVaultStateStore()) {
10
+ super();
11
+ this.identity = getAdapterVaultId(adapter);
12
+ this.storage = new ScopedVaultStore(this.identity, "workspace-trust", store);
13
+ this.state = {
14
+ trusted: true,
15
+ identity: this.identity,
16
+ updatedAt: null,
17
+ };
18
+ }
19
+ get trusted() {
20
+ return this.state.trusted;
21
+ }
22
+ getState() {
23
+ return { ...this.state };
24
+ }
25
+ async ready() {
26
+ this.readyPromise ??= this.load();
27
+ return this.readyPromise;
28
+ }
29
+ async grant() {
30
+ await this.ready();
31
+ return this.updateState(true);
32
+ }
33
+ async revoke() {
34
+ await this.ready();
35
+ return this.updateState(false);
36
+ }
37
+ async request(request = {}) {
38
+ await this.ready();
39
+ if (this.state.trusted) {
40
+ return true;
41
+ }
42
+ this.emit("requested", {
43
+ reason: request.reason,
44
+ pluginId: request.pluginId ?? null,
45
+ capability: request.capability ?? null,
46
+ });
47
+ return false;
48
+ }
49
+ async load() {
50
+ const persisted = await this.storage.get(WORKSPACE_TRUST_KEY);
51
+ this.state = {
52
+ trusted: persisted?.trusted !== false,
53
+ identity: this.identity,
54
+ updatedAt: typeof persisted?.updatedAt === "number" ? persisted.updatedAt : null,
55
+ };
56
+ return this.getState();
57
+ }
58
+ async updateState(trusted) {
59
+ const next = {
60
+ trusted,
61
+ identity: this.identity,
62
+ updatedAt: Date.now(),
63
+ };
64
+ await this.storage.set(WORKSPACE_TRUST_KEY, {
65
+ trusted: next.trusted,
66
+ updatedAt: next.updatedAt,
67
+ });
68
+ this.state = next;
69
+ this.emit("changed", this.getState());
70
+ return this.getState();
71
+ }
72
+ }