@dxos/app-framework 0.8.4-main.422d1c7879 → 0.8.4-main.4f23b4e393
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/{capability-DOMNPRJP.mjs → capability-5RRH3WIB.mjs} +11 -11
- package/dist/lib/browser/capability-5RRH3WIB.mjs.map +7 -0
- package/dist/lib/browser/{capability-KSNT34SN.mjs → capability-LUKGKUQH.mjs} +10 -10
- package/dist/lib/browser/{chunk-T3Y4AEKX.mjs → chunk-23D4SJUE.mjs} +3 -3
- package/dist/lib/browser/{chunk-T3Y4AEKX.mjs.map → chunk-23D4SJUE.mjs.map} +1 -1
- package/dist/lib/browser/{chunk-2CKCJ6PN.mjs → chunk-3JWJXGLK.mjs} +1 -1
- package/dist/lib/browser/{chunk-2CKCJ6PN.mjs.map → chunk-3JWJXGLK.mjs.map} +1 -1
- package/dist/lib/browser/{chunk-I34GF4NG.mjs → chunk-45CHLTBV.mjs} +2 -2
- package/dist/lib/browser/{chunk-QSXYHXCE.mjs → chunk-66IXTIVK.mjs} +1 -1
- package/dist/lib/browser/{chunk-QSXYHXCE.mjs.map → chunk-66IXTIVK.mjs.map} +2 -2
- package/dist/lib/browser/{chunk-QRTB4Q3U.mjs → chunk-7VZJR2OA.mjs} +4 -17
- package/dist/lib/browser/chunk-7VZJR2OA.mjs.map +7 -0
- package/dist/lib/browser/chunk-CZ4BIAHH.mjs +422 -0
- package/dist/lib/browser/chunk-CZ4BIAHH.mjs.map +7 -0
- package/dist/lib/browser/{chunk-TGX63LTL.mjs → chunk-FJ4765WW.mjs} +1 -1
- package/dist/lib/browser/{chunk-TGX63LTL.mjs.map → chunk-FJ4765WW.mjs.map} +2 -2
- package/dist/lib/browser/chunk-FO3IYSLV.mjs +68 -0
- package/dist/lib/browser/chunk-FO3IYSLV.mjs.map +7 -0
- package/dist/lib/browser/{chunk-BMIAYUWT.mjs → chunk-JD3Z5NEF.mjs} +147 -75
- package/dist/lib/browser/chunk-JD3Z5NEF.mjs.map +7 -0
- package/dist/lib/browser/chunk-NBXPP7JR.mjs +1174 -0
- package/dist/lib/browser/chunk-NBXPP7JR.mjs.map +7 -0
- package/dist/lib/browser/{chunk-JKWMHZP6.mjs → chunk-WBHCSOBW.mjs} +2 -2
- package/dist/lib/browser/chunk-WBHCSOBW.mjs.map +7 -0
- package/dist/lib/browser/{chunk-GDWTW4ZW.mjs → chunk-Z55LVAGN.mjs} +76 -11
- package/dist/lib/browser/chunk-Z55LVAGN.mjs.map +7 -0
- package/dist/lib/browser/{chunk-F7FW2RK2.mjs → chunk-ZGJAZSNE.mjs} +7 -32
- package/dist/lib/browser/chunk-ZGJAZSNE.mjs.map +7 -0
- package/dist/lib/browser/cli/index.mjs +14 -28
- package/dist/lib/browser/cli/index.mjs.map +3 -3
- package/dist/lib/browser/common/activation-events.mjs +7 -7
- package/dist/lib/browser/common/capabilities.mjs +7 -7
- package/dist/lib/browser/core/activation-event.mjs +1 -1
- package/dist/lib/browser/core/capability.mjs +1 -1
- package/dist/lib/browser/core/plugin-manager.mjs +8 -4
- package/dist/lib/browser/core/plugin.mjs +10 -2
- package/dist/lib/browser/core/url-loader.mjs +13 -5
- package/dist/lib/browser/index.mjs +34 -17
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{invoker-capability-VCMPQOIA.mjs → invoker-capability-K4GHUFXF.mjs} +12 -11
- package/dist/lib/browser/invoker-capability-K4GHUFXF.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +20 -32
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/browser/testing/react.mjs +11 -11
- package/dist/lib/browser/ui/index.mjs +14 -12
- package/dist/lib/node-esm/{capability-EOQTORML.mjs → capability-FCGZVIEG.mjs} +10 -10
- package/dist/lib/node-esm/{capability-KJTQIWDK.mjs → capability-JOIQ2MQE.mjs} +11 -11
- package/dist/lib/node-esm/capability-JOIQ2MQE.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-FKE4Z3D6.mjs → chunk-37Z53PXZ.mjs} +1 -1
- package/dist/lib/node-esm/{chunk-FKE4Z3D6.mjs.map → chunk-37Z53PXZ.mjs.map} +2 -2
- package/dist/lib/node-esm/{chunk-WZCSOX5Q.mjs → chunk-6XW6LET6.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-URWHJQT2.mjs → chunk-D347W3KO.mjs} +7 -32
- package/dist/lib/node-esm/chunk-D347W3KO.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-WZ6DHQER.mjs → chunk-DRZKO5UZ.mjs} +147 -75
- package/dist/lib/node-esm/chunk-DRZKO5UZ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-HI3YBICQ.mjs → chunk-HTBJU5FX.mjs} +76 -11
- package/dist/lib/node-esm/chunk-HTBJU5FX.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-M3HKPRPO.mjs +423 -0
- package/dist/lib/node-esm/chunk-M3HKPRPO.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-MUVUQC3G.mjs +1175 -0
- package/dist/lib/node-esm/chunk-MUVUQC3G.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-VKHGNEDB.mjs → chunk-SBS2YMPT.mjs} +3 -3
- package/dist/lib/node-esm/{chunk-VKHGNEDB.mjs.map → chunk-SBS2YMPT.mjs.map} +1 -1
- package/dist/lib/node-esm/{chunk-42KBWDE4.mjs → chunk-SDJ4B2LU.mjs} +1 -1
- package/dist/lib/node-esm/{chunk-42KBWDE4.mjs.map → chunk-SDJ4B2LU.mjs.map} +1 -1
- package/dist/lib/node-esm/{chunk-JPWVIQ5I.mjs → chunk-V24UWT36.mjs} +4 -17
- package/dist/lib/node-esm/chunk-V24UWT36.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-G3RTFSNG.mjs → chunk-WFSRZKBP.mjs} +2 -2
- package/dist/lib/node-esm/chunk-WFSRZKBP.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-WK7OIQKI.mjs +70 -0
- package/dist/lib/node-esm/chunk-WK7OIQKI.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-ZZ7CKK6W.mjs → chunk-XOCUANHO.mjs} +1 -1
- package/dist/lib/node-esm/{chunk-ZZ7CKK6W.mjs.map → chunk-XOCUANHO.mjs.map} +2 -2
- package/dist/lib/node-esm/cli/index.mjs +14 -28
- package/dist/lib/node-esm/cli/index.mjs.map +3 -3
- package/dist/lib/node-esm/common/activation-events.mjs +7 -7
- package/dist/lib/node-esm/common/capabilities.mjs +7 -7
- package/dist/lib/node-esm/core/activation-event.mjs +1 -1
- package/dist/lib/node-esm/core/capability.mjs +1 -1
- package/dist/lib/node-esm/core/plugin-manager.mjs +8 -4
- package/dist/lib/node-esm/core/plugin.mjs +10 -2
- package/dist/lib/node-esm/core/url-loader.mjs +13 -5
- package/dist/lib/node-esm/index.mjs +34 -17
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{invoker-capability-EGA3XW6J.mjs → invoker-capability-XEPW5LMJ.mjs} +12 -11
- package/dist/lib/node-esm/invoker-capability-XEPW5LMJ.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +20 -32
- package/dist/lib/node-esm/testing/index.mjs.map +3 -3
- package/dist/lib/node-esm/testing/react.mjs +11 -11
- package/dist/lib/node-esm/ui/index.mjs +14 -12
- package/dist/plugin/node-esm/index.mjs +136 -37
- package/dist/plugin/node-esm/index.mjs.map +4 -4
- package/dist/plugin/node-esm/meta.json +1 -1
- package/dist/types/src/common/annotations.d.ts +1 -0
- package/dist/types/src/common/annotations.d.ts.map +1 -0
- package/dist/types/src/common/capabilities.d.ts +2 -1
- package/dist/types/src/common/capabilities.d.ts.map +1 -1
- package/dist/types/src/common/operations.d.ts +1 -1
- package/dist/types/src/common/operations.d.ts.map +1 -1
- package/dist/types/src/core/activation-event.d.ts +4 -4
- package/dist/types/src/core/activation-event.d.ts.map +1 -1
- package/dist/types/src/core/capability-manager.d.ts.map +1 -1
- package/dist/types/src/core/capability.d.ts +2 -2
- package/dist/types/src/core/capability.d.ts.map +1 -1
- package/dist/types/src/core/edge-registry-plugin-provider.d.ts +30 -0
- package/dist/types/src/core/edge-registry-plugin-provider.d.ts.map +1 -0
- package/dist/types/src/core/index.d.ts +5 -0
- package/dist/types/src/core/index.d.ts.map +1 -1
- package/dist/types/src/core/plugin-asset-cache.d.ts +71 -0
- package/dist/types/src/core/plugin-asset-cache.d.ts.map +1 -0
- package/dist/types/src/core/plugin-manager.d.ts +163 -2
- package/dist/types/src/core/plugin-manager.d.ts.map +1 -1
- package/dist/types/src/core/plugin-manifest.d.ts +101 -0
- package/dist/types/src/core/plugin-manifest.d.ts.map +1 -0
- package/dist/types/src/core/plugin-manifest.test.d.ts +2 -0
- package/dist/types/src/core/plugin-manifest.test.d.ts.map +1 -0
- package/dist/types/src/core/plugin.d.ts +80 -0
- package/dist/types/src/core/plugin.d.ts.map +1 -1
- package/dist/types/src/core/registry.d.ts +101 -0
- package/dist/types/src/core/registry.d.ts.map +1 -0
- package/dist/types/src/core/url-loader.d.ts +88 -3
- package/dist/types/src/core/url-loader.d.ts.map +1 -1
- package/dist/types/src/helpers.d.ts.map +1 -1
- package/dist/types/src/plugin-operation/history/capability.d.ts.map +1 -1
- package/dist/types/src/plugin-operation/history/errors.d.ts +6 -6
- package/dist/types/src/plugin-operation/history/errors.d.ts.map +1 -1
- package/dist/types/src/plugin-operation/history/history-tracker.d.ts +1 -1
- package/dist/types/src/plugin-operation/history/history-tracker.d.ts.map +1 -1
- package/dist/types/src/plugin-operation/history/types.d.ts +1 -1
- package/dist/types/src/plugin-operation/history/types.d.ts.map +1 -1
- package/dist/types/src/plugin-operation/history/undo-mapping.d.ts +1 -1
- package/dist/types/src/plugin-operation/history/undo-mapping.d.ts.map +1 -1
- package/dist/types/src/plugin-operation/history/undo-registry.d.ts +1 -1
- package/dist/types/src/plugin-operation/history/undo-registry.d.ts.map +1 -1
- package/dist/types/src/plugin-operation/invoker-capability.d.ts +1 -1
- package/dist/types/src/plugin-operation/invoker-capability.d.ts.map +1 -1
- package/dist/types/src/plugin-operation/meta.d.ts.map +1 -1
- package/dist/types/src/plugin-operation/testing.d.ts +2 -1
- package/dist/types/src/plugin-operation/testing.d.ts.map +1 -1
- package/dist/types/src/plugin-runtime/capability.d.ts +1 -1
- package/dist/types/src/plugin-runtime/capability.d.ts.map +1 -1
- package/dist/types/src/plugin-runtime/meta.d.ts.map +1 -1
- package/dist/types/src/testing/harness.d.ts +1 -1
- package/dist/types/src/testing/harness.d.ts.map +1 -1
- package/dist/types/src/testing/react.d.ts.map +1 -1
- package/dist/types/src/testing/service.d.ts.map +1 -1
- package/dist/types/src/testing/withPluginManager.d.ts.map +1 -1
- package/dist/types/src/testing/withPluginManager.stories.d.ts.map +1 -1
- package/dist/types/src/ui/components/App/App.d.ts.map +1 -1
- package/dist/types/src/ui/components/App/App.stories.d.ts.map +1 -1
- package/dist/types/src/ui/components/Placeholder/Placeholder.d.ts +64 -0
- package/dist/types/src/ui/components/Placeholder/Placeholder.d.ts.map +1 -0
- package/dist/types/src/ui/components/Placeholder/Placeholder.stories.d.ts +19 -0
- package/dist/types/src/ui/components/Placeholder/Placeholder.stories.d.ts.map +1 -0
- package/dist/types/src/ui/components/Placeholder/index.d.ts +2 -0
- package/dist/types/src/ui/components/Placeholder/index.d.ts.map +1 -0
- package/dist/types/src/ui/components/PluginManager/PluginManagerContext.stories.d.ts.map +1 -1
- package/dist/types/src/ui/components/Surface/SurfaceComponent.stories.d.ts.map +1 -1
- package/dist/types/src/ui/components/Surface/SurfaceInfo.d.ts.map +1 -1
- package/dist/types/src/ui/components/Surface/SurfaceProfilerContext.d.ts.map +1 -1
- package/dist/types/src/ui/components/Surface/index.d.ts +1 -1
- package/dist/types/src/ui/components/Surface/index.d.ts.map +1 -1
- package/dist/types/src/ui/components/Surface/types.d.ts.map +1 -1
- package/dist/types/src/ui/components/index.d.ts +1 -0
- package/dist/types/src/ui/components/index.d.ts.map +1 -1
- package/dist/types/src/ui/hooks/useApp.d.ts +30 -3
- package/dist/types/src/ui/hooks/useApp.d.ts.map +1 -1
- package/dist/types/src/ui/hooks/useCapabilities.d.ts.map +1 -1
- package/dist/types/src/ui/hooks/useLoading.d.ts.map +1 -1
- package/dist/types/src/ui/hooks/useSettingsState.d.ts.map +1 -1
- package/dist/types/src/vite-plugin/boot-loader/BootLoader.stories.d.ts +20 -36
- package/dist/types/src/vite-plugin/boot-loader/BootLoader.stories.d.ts.map +1 -1
- package/dist/types/src/vite-plugin/boot-loader/index.d.ts +1 -50
- package/dist/types/src/vite-plugin/boot-loader/index.d.ts.map +1 -1
- package/dist/types/src/vite-plugin/boot-loader/loader.d.ts +51 -0
- package/dist/types/src/vite-plugin/boot-loader/loader.d.ts.map +1 -0
- package/dist/types/src/vite-plugin/composer/index.d.ts +12 -12
- package/dist/types/src/vite-plugin/composer/index.d.ts.map +1 -1
- package/dist/types/src/vite-plugin/import-map/index.d.ts +13 -1
- package/dist/types/src/vite-plugin/import-map/index.d.ts.map +1 -1
- package/dist/types/src/vite-plugin/manifest.d.ts +30 -5
- package/dist/types/src/vite-plugin/manifest.d.ts.map +1 -1
- package/dist/types/src/vite-plugin/packages.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +27 -23
- package/src/cli/cli.ts +1 -1
- package/src/common/annotations.ts +3 -0
- package/src/common/capabilities.ts +2 -1
- package/src/common/operations.ts +1 -1
- package/src/core/capability.ts +1 -1
- package/src/core/edge-registry-plugin-provider.ts +92 -0
- package/src/core/index.ts +5 -0
- package/src/core/plugin-asset-cache.ts +60 -0
- package/src/core/plugin-manager.test.ts +533 -4
- package/src/core/plugin-manager.ts +470 -28
- package/src/core/plugin-manifest.test.ts +75 -0
- package/src/core/plugin-manifest.ts +134 -0
- package/src/core/plugin.ts +103 -0
- package/src/core/registry.ts +157 -0
- package/src/core/url-loader.test.ts +115 -6
- package/src/core/url-loader.ts +253 -43
- package/src/plugin-operation/history/capability.ts +1 -1
- package/src/plugin-operation/history/history-tracker.test.ts +2 -1
- package/src/plugin-operation/history/history-tracker.ts +1 -1
- package/src/plugin-operation/history/types.ts +1 -1
- package/src/plugin-operation/history/undo-mapping.ts +1 -1
- package/src/plugin-operation/history/undo-registry.ts +1 -1
- package/src/plugin-operation/invoker-capability.ts +2 -1
- package/src/plugin-operation/meta.ts +1 -0
- package/src/plugin-operation/testing.ts +2 -1
- package/src/plugin-runtime/meta.ts +1 -0
- package/src/testing/harness.ts +2 -2
- package/src/testing/service.ts +1 -1
- package/src/testing/withPluginManager.stories.tsx +1 -1
- package/src/ui/components/App/App.stories.tsx +2 -6
- package/src/ui/components/App/App.tsx +12 -1
- package/src/ui/components/Placeholder/Placeholder.stories.tsx +77 -0
- package/src/ui/components/Placeholder/Placeholder.tsx +155 -0
- package/src/ui/components/Placeholder/index.ts +5 -0
- package/src/ui/components/PluginManager/PluginManagerContext.stories.tsx +4 -2
- package/src/ui/components/Surface/SurfaceComponent.stories.tsx +1 -1
- package/src/ui/components/Surface/SurfaceComponent.tsx +2 -2
- package/src/ui/components/Surface/SurfaceInfo.tsx +0 -1
- package/src/ui/components/index.ts +1 -0
- package/src/ui/hooks/useApp.test.tsx +1 -1
- package/src/ui/hooks/useApp.tsx +161 -26
- package/src/ui/hooks/useLoading.tsx +14 -6
- package/src/vite-plugin/boot-loader/BootLoader.stories.tsx +208 -100
- package/src/vite-plugin/boot-loader/boot-loader.css +248 -45
- package/src/vite-plugin/boot-loader/boot-loader.js +309 -39
- package/src/vite-plugin/boot-loader/index.ts +1 -95
- package/src/vite-plugin/boot-loader/loader.ts +123 -0
- package/src/vite-plugin/composer/index.ts +61 -39
- package/src/vite-plugin/import-map/index.ts +42 -5
- package/src/vite-plugin/index.ts +2 -2
- package/src/vite-plugin/manifest.test.ts +27 -4
- package/src/vite-plugin/manifest.ts +42 -5
- package/src/vite-plugin/packages.ts +8 -2
- package/tsconfig.json +16 -1
- package/.swc/plugins/linux_x86_64_19.0.0/727453fb3a62f7f1d952a41e051ca8a6f88cadc45cee43c6a4d1aa45f9b75665.wasmer-v7 +0 -0
- package/dist/lib/browser/capability-DOMNPRJP.mjs.map +0 -7
- package/dist/lib/browser/chunk-7B6AJK4D.mjs +0 -964
- package/dist/lib/browser/chunk-7B6AJK4D.mjs.map +0 -7
- package/dist/lib/browser/chunk-BMIAYUWT.mjs.map +0 -7
- package/dist/lib/browser/chunk-F7FW2RK2.mjs.map +0 -7
- package/dist/lib/browser/chunk-GDWTW4ZW.mjs.map +0 -7
- package/dist/lib/browser/chunk-JKWMHZP6.mjs.map +0 -7
- package/dist/lib/browser/chunk-QRTB4Q3U.mjs.map +0 -7
- package/dist/lib/browser/chunk-RFSO3JRG.mjs +0 -1
- package/dist/lib/browser/chunk-RFSO3JRG.mjs.map +0 -7
- package/dist/lib/browser/chunk-Y543KCO7.mjs +0 -174
- package/dist/lib/browser/chunk-Y543KCO7.mjs.map +0 -7
- package/dist/lib/browser/invoker-capability-VCMPQOIA.mjs.map +0 -7
- package/dist/lib/node-esm/capability-KJTQIWDK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-7PJ5OKRB.mjs +0 -965
- package/dist/lib/node-esm/chunk-7PJ5OKRB.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-DXVXOGJ7.mjs +0 -175
- package/dist/lib/node-esm/chunk-DXVXOGJ7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-EL3R25OQ.mjs +0 -2
- package/dist/lib/node-esm/chunk-EL3R25OQ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-G3RTFSNG.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HI3YBICQ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-JPWVIQ5I.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-URWHJQT2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-WZ6DHQER.mjs.map +0 -7
- package/dist/lib/node-esm/invoker-capability-EGA3XW6J.mjs.map +0 -7
- /package/dist/lib/browser/{capability-KSNT34SN.mjs.map → capability-LUKGKUQH.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-I34GF4NG.mjs.map → chunk-45CHLTBV.mjs.map} +0 -0
- /package/dist/lib/node-esm/{capability-EOQTORML.mjs.map → capability-FCGZVIEG.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-WZCSOX5Q.mjs.map → chunk-6XW6LET6.mjs.map} +0 -0
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
isPlugin
|
|
3
|
-
} from "./chunk-GDWTW4ZW.mjs";
|
|
4
|
-
import {
|
|
5
|
-
__export
|
|
6
|
-
} from "./chunk-J5LGTIGS.mjs";
|
|
7
|
-
|
|
8
|
-
// src/core/url-loader.ts
|
|
9
|
-
var url_loader_exports = {};
|
|
10
|
-
__export(url_loader_exports, {
|
|
11
|
-
getRemoteEntries: () => getRemoteEntries,
|
|
12
|
-
isLocalUrl: () => isLocalUrl,
|
|
13
|
-
make: () => make,
|
|
14
|
-
preload: () => preload
|
|
15
|
-
});
|
|
16
|
-
import * as Effect from "effect/Effect";
|
|
17
|
-
import { log } from "@dxos/log";
|
|
18
|
-
var __dxlog_file = "/__w/dxos/dxos/packages/sdk/app-framework/src/core/url-loader.ts";
|
|
19
|
-
var DEFAULT_KEY = "org.dxos.composer.remote-plugins";
|
|
20
|
-
var defaultStorage = () => ({
|
|
21
|
-
get: (key) => localStorage.getItem(key),
|
|
22
|
-
set: (key, value) => localStorage.setItem(key, value)
|
|
23
|
-
});
|
|
24
|
-
var getPersistedRemotePlugins = (storage, key) => {
|
|
25
|
-
try {
|
|
26
|
-
const parsed = JSON.parse(storage.get(key) ?? "[]");
|
|
27
|
-
if (!Array.isArray(parsed)) {
|
|
28
|
-
return [];
|
|
29
|
-
}
|
|
30
|
-
return parsed.filter((entry) => typeof entry === "object" && entry !== null && typeof entry.id === "string" && typeof entry.url === "string");
|
|
31
|
-
} catch {
|
|
32
|
-
return [];
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
var persistRemotePlugin = (storage, key, entry) => {
|
|
36
|
-
try {
|
|
37
|
-
const entries = getPersistedRemotePlugins(storage, key).filter((existing) => existing.id !== entry.id);
|
|
38
|
-
entries.push(entry);
|
|
39
|
-
storage.set(key, JSON.stringify(entries));
|
|
40
|
-
} catch (error) {
|
|
41
|
-
log.warn("failed to persist remote plugin entry", {
|
|
42
|
-
entry,
|
|
43
|
-
error
|
|
44
|
-
}, {
|
|
45
|
-
F: __dxlog_file,
|
|
46
|
-
L: 63,
|
|
47
|
-
S: void 0,
|
|
48
|
-
C: (f, a) => f(...a)
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
var isUrl = (locator) => {
|
|
53
|
-
try {
|
|
54
|
-
const url = new URL(locator);
|
|
55
|
-
return url.protocol === "http:" || url.protocol === "https:";
|
|
56
|
-
} catch {
|
|
57
|
-
return false;
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
var isLocalUrl = (locator) => {
|
|
61
|
-
try {
|
|
62
|
-
const hostname = new URL(locator).hostname.toLowerCase();
|
|
63
|
-
return hostname === "localhost" || hostname === "127.0.0.1" || hostname === "::1" || hostname === "[::1]";
|
|
64
|
-
} catch {
|
|
65
|
-
return false;
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
var getRemoteEntries = (options = {}) => {
|
|
69
|
-
const storage = options.storage ?? defaultStorage();
|
|
70
|
-
const key = options.key ?? DEFAULT_KEY;
|
|
71
|
-
return getPersistedRemotePlugins(storage, key);
|
|
72
|
-
};
|
|
73
|
-
var normalizePluginExport = (mod) => {
|
|
74
|
-
const exported = mod.default;
|
|
75
|
-
if (isPlugin(exported)) {
|
|
76
|
-
return exported;
|
|
77
|
-
}
|
|
78
|
-
if (typeof exported === "function") {
|
|
79
|
-
const result = exported();
|
|
80
|
-
if (isPlugin(result)) {
|
|
81
|
-
return result;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
throw new Error("Remote module default export is not a Plugin or a zero-arg plugin factory.");
|
|
85
|
-
};
|
|
86
|
-
var loadRemotePlugin = async (url) => {
|
|
87
|
-
log.info("loading remote plugin", {
|
|
88
|
-
url
|
|
89
|
-
}, {
|
|
90
|
-
F: __dxlog_file,
|
|
91
|
-
L: 115,
|
|
92
|
-
S: void 0,
|
|
93
|
-
C: (f, a) => f(...a)
|
|
94
|
-
});
|
|
95
|
-
const mod = await import(
|
|
96
|
-
/* @vite-ignore */
|
|
97
|
-
url
|
|
98
|
-
);
|
|
99
|
-
const plugin = normalizePluginExport(mod);
|
|
100
|
-
if (!plugin.meta.id || !plugin.meta.name) {
|
|
101
|
-
throw new Error(`Remote plugin at ${url} is missing required meta.id or meta.name.`);
|
|
102
|
-
}
|
|
103
|
-
return plugin;
|
|
104
|
-
};
|
|
105
|
-
var preload = async (options = {}) => {
|
|
106
|
-
const storage = options.storage ?? defaultStorage();
|
|
107
|
-
const key = options.key ?? DEFAULT_KEY;
|
|
108
|
-
const entries = getPersistedRemotePlugins(storage, key);
|
|
109
|
-
if (entries.length === 0) {
|
|
110
|
-
return [];
|
|
111
|
-
}
|
|
112
|
-
log.info("preloading remote plugins", {
|
|
113
|
-
count: entries.length
|
|
114
|
-
}, {
|
|
115
|
-
F: __dxlog_file,
|
|
116
|
-
L: 135,
|
|
117
|
-
S: void 0,
|
|
118
|
-
C: (f, a) => f(...a)
|
|
119
|
-
});
|
|
120
|
-
const results = await Promise.allSettled(entries.map((entry) => loadRemotePlugin(entry.url)));
|
|
121
|
-
const plugins = [];
|
|
122
|
-
for (let index = 0; index < results.length; index++) {
|
|
123
|
-
const result = results[index];
|
|
124
|
-
if (result.status === "fulfilled") {
|
|
125
|
-
plugins.push(result.value);
|
|
126
|
-
} else {
|
|
127
|
-
log.warn("failed to preload remote plugin", {
|
|
128
|
-
entry: entries[index],
|
|
129
|
-
error: result.reason
|
|
130
|
-
}, {
|
|
131
|
-
F: __dxlog_file,
|
|
132
|
-
L: 143,
|
|
133
|
-
S: void 0,
|
|
134
|
-
C: (f, a) => f(...a)
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
return plugins;
|
|
139
|
-
};
|
|
140
|
-
var make = (builtinPlugins, options = {}) => {
|
|
141
|
-
const storage = options.storage ?? defaultStorage();
|
|
142
|
-
const key = options.key ?? DEFAULT_KEY;
|
|
143
|
-
return (locator) => Effect.gen(function* () {
|
|
144
|
-
const builtin = builtinPlugins.find((plugin2) => plugin2.meta.id === locator);
|
|
145
|
-
if (builtin) {
|
|
146
|
-
return builtin;
|
|
147
|
-
}
|
|
148
|
-
if (!isUrl(locator)) {
|
|
149
|
-
return yield* Effect.fail(new Error(`Plugin not found and locator is not a URL: ${locator}`));
|
|
150
|
-
}
|
|
151
|
-
const plugin = yield* Effect.tryPromise({
|
|
152
|
-
try: () => loadRemotePlugin(locator),
|
|
153
|
-
catch: (error) => new Error(`Failed to load remote plugin from ${locator}: ${error}`)
|
|
154
|
-
});
|
|
155
|
-
const duplicate = builtinPlugins.find((existing) => existing.meta.id === plugin.meta.id);
|
|
156
|
-
if (duplicate) {
|
|
157
|
-
return yield* Effect.fail(new Error(`Remote plugin ${plugin.meta.id} conflicts with built-in plugin of the same id.`));
|
|
158
|
-
}
|
|
159
|
-
persistRemotePlugin(storage, key, {
|
|
160
|
-
id: plugin.meta.id,
|
|
161
|
-
url: locator
|
|
162
|
-
});
|
|
163
|
-
return plugin;
|
|
164
|
-
});
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
export {
|
|
168
|
-
isLocalUrl,
|
|
169
|
-
getRemoteEntries,
|
|
170
|
-
preload,
|
|
171
|
-
make,
|
|
172
|
-
url_loader_exports
|
|
173
|
-
};
|
|
174
|
-
//# sourceMappingURL=chunk-Y543KCO7.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/core/url-loader.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { log } from '@dxos/log';\n\nimport * as Plugin from './plugin';\n\nconst DEFAULT_KEY = 'org.dxos.composer.remote-plugins';\n\n/**\n * Abstraction over key-value storage (defaults to localStorage).\n */\nexport type Storage = {\n get(key: string): string | null;\n set(key: string, value: string): void;\n};\n\n/**\n * Options for configuring the URL loader.\n */\nexport type Options = {\n storage?: Storage;\n key?: string;\n};\n\n/**\n * Persisted record of a remote plugin that has been loaded previously.\n */\nexport type RemotePluginEntry = {\n id: string;\n url: string;\n};\n\nconst defaultStorage = (): Storage => ({\n get: (key) => localStorage.getItem(key),\n set: (key, value) => localStorage.setItem(key, value),\n});\n\nconst getPersistedRemotePlugins = (storage: Storage, key: string): RemotePluginEntry[] => {\n try {\n const parsed: unknown = JSON.parse(storage.get(key) ?? '[]');\n if (!Array.isArray(parsed)) {\n return [];\n }\n return parsed.filter(\n (entry): entry is RemotePluginEntry =>\n typeof entry === 'object' && entry !== null && typeof entry.id === 'string' && typeof entry.url === 'string',\n );\n } catch {\n return [];\n }\n};\n\nconst persistRemotePlugin = (storage: Storage, key: string, entry: RemotePluginEntry): void => {\n try {\n const entries = getPersistedRemotePlugins(storage, key).filter((existing) => existing.id !== entry.id);\n entries.push(entry);\n storage.set(key, JSON.stringify(entries));\n } catch (error) {\n log.warn('failed to persist remote plugin entry', { entry, error });\n }\n};\n\nconst isUrl = (locator: string): boolean => {\n try {\n const url = new URL(locator);\n return url.protocol === 'http:' || url.protocol === 'https:';\n } catch {\n return false;\n }\n};\n\n/**\n * Returns true when the URL's hostname is the local host (localhost, 127.0.0.1, or ::1).\n */\nexport const isLocalUrl = (locator: string): boolean => {\n try {\n const hostname = new URL(locator).hostname.toLowerCase();\n // WHATWG URL returns '::1' without brackets in Node; some browsers return '[::1]'.\n return hostname === 'localhost' || hostname === '127.0.0.1' || hostname === '::1' || hostname === '[::1]';\n } catch {\n return false;\n }\n};\n\n/**\n * Returns the list of remote plugin entries previously persisted by {@link make}.\n * Useful for UI code that needs to know which loaded plugins were installed from a URL\n * (e.g. to surface a tag on remote or localhost-hosted plugins).\n */\nexport const getRemoteEntries = (options: Options = {}): readonly RemotePluginEntry[] => {\n const storage = options.storage ?? defaultStorage();\n const key = options.key ?? DEFAULT_KEY;\n return getPersistedRemotePlugins(storage, key);\n};\n\nconst normalizePluginExport = (mod: Record<string, unknown>): Plugin.Plugin => {\n const exported = mod.default;\n if (Plugin.isPlugin(exported)) {\n return exported;\n }\n if (typeof exported === 'function') {\n const result = (exported as () => unknown)();\n if (Plugin.isPlugin(result)) {\n return result;\n }\n }\n throw new Error('Remote module default export is not a Plugin or a zero-arg plugin factory.');\n};\n\nconst loadRemotePlugin = async (url: string): Promise<Plugin.Plugin> => {\n log.info('loading remote plugin', { url });\n const mod = await import(/* @vite-ignore */ url);\n const plugin = normalizePluginExport(mod);\n if (!plugin.meta.id || !plugin.meta.name) {\n throw new Error(`Remote plugin at ${url} is missing required meta.id or meta.name.`);\n }\n return plugin;\n};\n\n/**\n * Preloads previously persisted remote plugins from storage.\n */\nexport const preload = async (options: Options = {}): Promise<Plugin.Plugin[]> => {\n const storage = options.storage ?? defaultStorage();\n const key = options.key ?? DEFAULT_KEY;\n\n const entries = getPersistedRemotePlugins(storage, key);\n if (entries.length === 0) {\n return [];\n }\n log.info('preloading remote plugins', { count: entries.length });\n const results = await Promise.allSettled(entries.map((entry) => loadRemotePlugin(entry.url)));\n const plugins: Plugin.Plugin[] = [];\n for (let index = 0; index < results.length; index++) {\n const result = results[index];\n if (result.status === 'fulfilled') {\n plugins.push(result.value);\n } else {\n log.warn('failed to preload remote plugin', { entry: entries[index], error: result.reason });\n }\n }\n return plugins;\n};\n\n/**\n * Creates a plugin loader that resolves built-in plugins by ID or loads remote plugins from URLs.\n */\nexport const make = (builtinPlugins: Plugin.Plugin[], options: Options = {}) => {\n const storage = options.storage ?? defaultStorage();\n const key = options.key ?? DEFAULT_KEY;\n\n return (locator: string): Effect.Effect<Plugin.Plugin, Error> =>\n Effect.gen(function* () {\n const builtin = builtinPlugins.find((plugin) => plugin.meta.id === locator);\n if (builtin) {\n return builtin;\n }\n if (!isUrl(locator)) {\n return yield* Effect.fail(new Error(`Plugin not found and locator is not a URL: ${locator}`));\n }\n const plugin = yield* Effect.tryPromise({\n try: () => loadRemotePlugin(locator),\n catch: (error) => new Error(`Failed to load remote plugin from ${locator}: ${error}`),\n });\n const duplicate = builtinPlugins.find((existing) => existing.meta.id === plugin.meta.id);\n if (duplicate) {\n return yield* Effect.fail(\n new Error(`Remote plugin ${plugin.meta.id} conflicts with built-in plugin of the same id.`),\n );\n }\n persistRemotePlugin(storage, key, { id: plugin.meta.id, url: locator });\n return plugin;\n });\n};\n"],
|
|
5
|
-
"mappings": "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",
|
|
6
|
-
"names": ["Effect", "log", "DEFAULT_KEY", "defaultStorage", "get", "key", "localStorage", "getItem", "set", "value", "setItem", "getPersistedRemotePlugins", "storage", "parsed", "JSON", "parse", "Array", "isArray", "filter", "entry", "id", "url", "persistRemotePlugin", "entries", "existing", "push", "stringify", "error", "log", "warn", "isUrl", "locator", "URL", "protocol", "isLocalUrl", "hostname", "toLowerCase", "getRemoteEntries", "options", "normalizePluginExport", "mod", "exported", "default", "isPlugin", "result", "Error", "loadRemotePlugin", "info", "plugin", "meta", "name", "preload", "length", "count", "results", "Promise", "allSettled", "map", "plugins", "index", "status", "reason", "make", "builtinPlugins", "gen", "builtin", "find", "fail", "tryPromise", "try", "catch", "duplicate"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/plugin-operation/invoker-capability.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { OperationHandlerSet, OperationInvoker } from '@dxos/operation';\n\nimport { ActivationEvents, Capabilities } from '../common';\nimport { Capability, Plugin } from '../core';\n\n//\n// Capability Module\n//\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n // Get the services for synchronous access in callbacks.\n const capabilityManager = yield* Capability.Service;\n const pluginManager = yield* Plugin.Service;\n\n // Get the ManagedRuntime capability (should be available since we activate after ManagedRuntimeReady).\n const managedRuntime = yield* Capability.get(Capabilities.ManagedRuntime);\n\n // Cache the merged handler promise to prevent concurrent module loading.\n // Multiple Effects can invoke getHandlers simultaneously; without caching each\n // creates a new merge() which triggers parallel dynamic imports that race in\n // WebKit's module evaluator, causing TDZ errors on export default bindings.\n let cachedSets: readonly OperationHandlerSet.OperationHandlerSet[] | undefined;\n let cachedHandlers: ReturnType<OperationHandlerSet.OperationHandlerSet['getHandlers']> | undefined;\n\n const invoker = OperationInvoker.make(\n () =>\n Effect.gen(function* () {\n yield* Plugin.activate(ActivationEvents.SetupOperationHandler);\n const sets = yield* Capability.getAll(Capabilities.OperationHandler);\n\n if (sets !== cachedSets) {\n cachedSets = sets;\n cachedHandlers = OperationHandlerSet.merge(...sets).getHandlers();\n }\n\n return yield* Effect.promise(() => cachedHandlers!);\n }).pipe(\n Effect.provideService(Capability.Service, capabilityManager),\n Effect.provideService(Plugin.Service, pluginManager),\n Effect.orDie,\n ),\n managedRuntime,\n );\n\n return Capability.contributes(Capabilities.OperationInvoker, invoker);\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,qBAAqBC,wBAAwB;AAStD,IAAA,6BAAeC,mBAAWC,WACjBC,kBAAW,aAAA;AAEhB,QAAMC,oBAAoB,OAAOH,mBAAWI;AAC5C,QAAMC,gBAAgB,OAAOC,eAAOF;AAGpC,QAAMG,iBAAiB,OAAOP,mBAAWQ,IAAIC,qBAAaC,cAAc;AAMxE,MAAIC;AACJ,MAAIC;AAEJ,QAAMC,UAAUC,iBAAiBC,KAC/B,MACSC,WAAI,aAAA;AACT,WAAOV,eAAOW,SAASC,0BAAiBC,qBAAqB;AAC7D,UAAMC,OAAO,OAAOpB,mBAAWqB,OAAOZ,qBAAaa,gBAAgB;AAEnE,QAAIF,SAAST,YAAY;AACvBA,mBAAaS;AACbR,uBAAiBW,oBAAoBC,MAAK,GAAIJ,IAAAA,EAAMK,YAAW;IACjE;AAEA,WAAO,OAAcC,eAAQ,MAAMd,cAAAA;EACrC,CAAA,EAAGe,KACMC,sBAAe5B,mBAAWI,SAASD,iBAAAA,GACnCyB,sBAAetB,eAAOF,SAASC,aAAAA,GAC/BwB,YAAK,GAEhBtB,cAAAA;AAGF,SAAOP,mBAAW8B,YAAYrB,qBAAaK,kBAAkBD,OAAAA;AAC/D,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "OperationHandlerSet", "OperationInvoker", "Capability", "makeModule", "fnUntraced", "capabilityManager", "Service", "pluginManager", "Plugin", "managedRuntime", "get", "Capabilities", "ManagedRuntime", "cachedSets", "cachedHandlers", "invoker", "OperationInvoker", "make", "gen", "activate", "ActivationEvents", "SetupOperationHandler", "sets", "getAll", "OperationHandler", "OperationHandlerSet", "merge", "getHandlers", "promise", "pipe", "provideService", "orDie", "contributes"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/plugin-operation/history/capability.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { type OperationInvoker } from '@dxos/operation';\n\nimport { Capabilities } from '../../common';\nimport { Capability } from '../../core';\nimport * as HistoryTracker from './history-tracker';\nimport * as UndoRegistry from './undo-registry';\n\n//\n// Capability Module - contributes both UndoRegistry and HistoryTracker.\n//\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n // Get the context for synchronous access in callbacks.\n const capabilities = yield* Capability.Service;\n\n // Create UndoRegistry.\n const undoRegistry = UndoRegistry.make(() => capabilities.getAll(Capabilities.UndoMapping).flat());\n\n // Create HistoryTracker (depends on UndoRegistry and OperationInvoker).\n const invoker = yield* Capability.get(Capabilities.OperationInvoker);\n // Cast to internal type - the factory always returns OperationInvokerInternal.\n const historyTracker = HistoryTracker.make(invoker as OperationInvoker.OperationInvokerInternal, undoRegistry);\n\n return [\n Capability.contributes(Capabilities.UndoRegistry, undoRegistry),\n Capability.contributes(Capabilities.HistoryTracker, historyTracker),\n ];\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAIA,YAAYA,YAAY;AAaxB,IAAA,qBAAeC,mBAAWC,WACjBC,kBAAW,aAAA;AAEhB,QAAMC,eAAe,OAAOH,mBAAWI;AAGvC,QAAMC,eAA4BC,KAAK,MAAMH,aAAaI,OAAOC,qBAAaC,WAAW,EAAEC,KAAI,CAAA;AAG/F,QAAMC,UAAU,OAAOX,mBAAWY,IAAIJ,qBAAaK,gBAAgB;AAEnE,QAAMC,iBAAgCR,MAAKK,SAAsDN,YAAAA;AAEjG,SAAO;IACLL,mBAAWe,YAAYP,qBAAaQ,cAAcX,YAAAA;IAClDL,mBAAWe,YAAYP,qBAAaS,gBAAgBH,cAAAA;;AAExD,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "Capability", "makeModule", "fnUntraced", "capabilities", "Service", "undoRegistry", "make", "getAll", "Capabilities", "UndoMapping", "flat", "invoker", "get", "OperationInvoker", "historyTracker", "contributes", "UndoRegistry", "HistoryTracker"]
|
|
7
|
-
}
|