@dxos/plugin-native 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/NativePlugin.mjs +30 -0
- package/dist/lib/NativePlugin.mjs.map +1 -0
- package/dist/lib/capabilities.mjs +11 -0
- package/dist/lib/capabilities.mjs.map +1 -0
- package/dist/lib/chunk-NativeSettings.mjs +102 -0
- package/dist/lib/chunk-NativeSettings.mjs.map +1 -0
- package/dist/lib/{neutral/chunk-WU6IZ56J.mjs → chunk-meta.mjs} +15 -24
- package/dist/lib/chunk-meta.mjs.map +1 -0
- package/dist/lib/chunk-ollama.mjs +307 -0
- package/dist/lib/chunk-ollama.mjs.map +1 -0
- package/dist/lib/chunk-react-surface.mjs +16 -0
- package/dist/lib/chunk-react-surface.mjs.map +1 -0
- package/dist/lib/chunk-settings.mjs +23 -0
- package/dist/lib/chunk-settings.mjs.map +1 -0
- package/dist/lib/chunk-spotlight-listener.mjs +61 -0
- package/dist/lib/chunk-spotlight-listener.mjs.map +1 -0
- package/dist/lib/chunk-updater.mjs +212 -0
- package/dist/lib/chunk-updater.mjs.map +1 -0
- package/dist/lib/containers.mjs +7 -0
- package/dist/lib/containers.mjs.map +1 -0
- package/dist/lib/index.mjs +2 -0
- package/dist/lib/meta.mjs +2 -0
- package/dist/lib/plugin.mjs +8 -0
- package/dist/lib/plugin.mjs.map +1 -0
- package/dist/lib/translations.mjs +26 -0
- package/dist/lib/translations.mjs.map +1 -0
- package/dist/lib/types.mjs +33 -0
- package/dist/lib/types.mjs.map +1 -0
- package/dist/types/src/capabilities/ollama.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +1 -1
- package/dist/types/src/capabilities/spotlight-listener.d.ts +1 -1
- package/dist/types/src/capabilities/updater.d.ts +1 -1
- package/dist/types/src/containers/NativeSettings/NativeSettings.d.ts +4 -4
- package/dist/types/src/containers/NativeSettings/NativeSettings.d.ts.map +1 -1
- package/dist/types/src/types/NativeCapabilities.d.ts +1 -1
- package/dist/types/src/types/NativeCapabilities.d.ts.map +1 -1
- package/dist/types/src/types/Update.d.ts +1 -1
- package/dist/types/src/types/Update.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +26 -25
- package/src/capabilities/ollama.ts +1 -1
- package/src/capabilities/{react-surface.tsx → react-surface.ts} +2 -7
- package/src/capabilities/updater.ts +1 -1
- package/src/containers/NativeSettings/NativeSettings.tsx +9 -6
- package/src/types/NativeCapabilities.ts +1 -1
- package/src/types/Update.ts +1 -1
- package/dist/lib/neutral/NativePlugin.mjs +0 -46
- package/dist/lib/neutral/NativePlugin.mjs.map +0 -7
- package/dist/lib/neutral/NativeSettings-33K63AVG.mjs +0 -120
- package/dist/lib/neutral/NativeSettings-33K63AVG.mjs.map +0 -7
- package/dist/lib/neutral/capabilities/index.mjs +0 -17
- package/dist/lib/neutral/capabilities/index.mjs.map +0 -7
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +0 -10
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +0 -7
- package/dist/lib/neutral/chunk-WU6IZ56J.mjs.map +0 -7
- package/dist/lib/neutral/containers/index.mjs +0 -9
- package/dist/lib/neutral/containers/index.mjs.map +0 -7
- package/dist/lib/neutral/index.mjs +0 -8
- package/dist/lib/neutral/index.mjs.map +0 -7
- package/dist/lib/neutral/meta.json +0 -1
- package/dist/lib/neutral/meta.mjs +0 -8
- package/dist/lib/neutral/meta.mjs.map +0 -7
- package/dist/lib/neutral/ollama-HZEXAT2P.mjs +0 -312
- package/dist/lib/neutral/ollama-HZEXAT2P.mjs.map +0 -7
- package/dist/lib/neutral/plugin.mjs +0 -12
- package/dist/lib/neutral/plugin.mjs.map +0 -7
- package/dist/lib/neutral/react-surface-YST5DQA3.mjs +0 -27
- package/dist/lib/neutral/react-surface-YST5DQA3.mjs.map +0 -7
- package/dist/lib/neutral/settings-S5MFUI42.mjs +0 -28
- package/dist/lib/neutral/settings-S5MFUI42.mjs.map +0 -7
- package/dist/lib/neutral/spotlight-listener-K7S6LGL3.mjs +0 -48
- package/dist/lib/neutral/spotlight-listener-K7S6LGL3.mjs.map +0 -7
- package/dist/lib/neutral/translations.mjs +0 -34
- package/dist/lib/neutral/translations.mjs.map +0 -7
- package/dist/lib/neutral/types/index.mjs +0 -31
- package/dist/lib/neutral/types/index.mjs.map +0 -7
- package/dist/lib/neutral/updater-5ETKR4S3.mjs +0 -244
- package/dist/lib/neutral/updater-5ETKR4S3.mjs.map +0 -7
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"inputs":{"dx.config.ts":{"bytes":3550,"imports":[{"path":"@dxos/app-framework/config","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/meta.ts":{"bytes":1063,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dx.config.ts","kind":"import-statement","original":"../dx.config"}],"format":"esm"},"src/index.ts":{"bytes":368,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"raw-loader:/__w/dxos/dxos/packages/plugins/plugin-native/PLUGIN.mdl":{"bytes":9088,"imports":[]},"src/NativePlugin.tsx":{"bytes":5043,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/plugin-assistant","kind":"import-statement","external":true},{"path":"#capabilities","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#translations","kind":"import-statement","external":true},{"path":"raw-loader:/__w/dxos/dxos/packages/plugins/plugin-native/PLUGIN.mdl","kind":"import-statement","original":"../PLUGIN.mdl?raw"}],"format":"esm"},"src/capabilities/settings.ts":{"bytes":3132,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/ollama.ts":{"bytes":50796,"imports":[{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"@effect/platform/FetchHttpClient","kind":"import-statement","external":true},{"path":"@effect/platform/HttpClient","kind":"import-statement","external":true},{"path":"@tauri-apps/plugin-shell","kind":"import-statement","external":true},{"path":"effect/Cause","kind":"import-statement","external":true},{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Duration","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Either","kind":"import-statement","external":true},{"path":"effect/Exit","kind":"import-statement","external":true},{"path":"effect/Fiber","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/ManagedRuntime","kind":"import-statement","external":true},{"path":"effect/Schedule","kind":"import-statement","external":true},{"path":"effect/Stream","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/ai/resolvers","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-assistant","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/react-surface.tsx":{"bytes":3619,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit/ui","kind":"import-statement","external":true},{"path":"#containers","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/spotlight-listener.ts":{"bytes":6502,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@tauri-apps/api/event","kind":"dynamic-import","external":true},{"path":"@tauri-apps/api/window","kind":"dynamic-import","external":true}],"format":"esm"},"src/constants.ts":{"bytes":807,"imports":[],"format":"esm"},"src/capabilities/updater.ts":{"bytes":25131,"imports":[{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"@tauri-apps/plugin-os","kind":"import-statement","external":true},{"path":"@tauri-apps/plugin-process","kind":"import-statement","external":true},{"path":"@tauri-apps/plugin-updater","kind":"import-statement","external":true},{"path":"effect/Duration","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Fiber","kind":"import-statement","external":true},{"path":"effect/Match","kind":"import-statement","external":true},{"path":"effect/Schedule","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true},{"path":"src/constants.ts","kind":"import-statement","original":"../constants"}],"format":"esm"},"src/capabilities/index.ts":{"bytes":2057,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/settings.ts","kind":"dynamic-import","original":"./settings"},{"path":"src/capabilities/ollama.ts","kind":"dynamic-import","original":"./ollama"},{"path":"src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"},{"path":"src/capabilities/spotlight-listener.ts","kind":"dynamic-import","original":"./spotlight-listener"},{"path":"src/capabilities/updater.ts","kind":"dynamic-import","original":"./updater"}],"format":"esm"},"src/containers/NativeSettings/NativeSettings.tsx":{"bytes":17124,"imports":[{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"date-fns/formatDistanceToNow","kind":"import-statement","external":true},{"path":"effect/Match","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"format":"esm"},"src/containers/NativeSettings/index.ts":{"bytes":518,"imports":[{"path":"src/containers/NativeSettings/NativeSettings.tsx","kind":"import-statement","original":"./NativeSettings"}],"format":"esm"},"src/containers/index.ts":{"bytes":714,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/containers/NativeSettings/index.ts","kind":"dynamic-import","original":"./NativeSettings"}],"format":"esm"},"src/plugin.ts":{"bytes":855,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"#plugin","kind":"dynamic-import","external":true}],"format":"esm"},"src/translations.ts":{"bytes":4415,"imports":[{"path":"#meta","kind":"import-statement","external":true}],"format":"esm"},"src/types/NativeCapabilities.ts":{"bytes":1933,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"format":"esm"},"src/types/Settings.ts":{"bytes":880,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true}],"format":"esm"},"src/types/Update.ts":{"bytes":1080,"imports":[],"format":"esm"},"src/types/index.ts":{"bytes":796,"imports":[{"path":"src/types/NativeCapabilities.ts","kind":"import-statement","original":"./NativeCapabilities"},{"path":"src/types/Settings.ts","kind":"import-statement","original":"./Settings"},{"path":"src/types/Update.ts","kind":"import-statement","original":"./Update"}],"format":"esm"}},"outputs":{"dist/lib/neutral/settings-S5MFUI42.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1598},"dist/lib/neutral/settings-S5MFUI42.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/settings.ts","inputs":{"src/capabilities/settings.ts":{"bytesInOutput":724}},"bytes":877},"dist/lib/neutral/ollama-HZEXAT2P.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":23591},"dist/lib/neutral/ollama-HZEXAT2P.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"@effect/platform/FetchHttpClient","kind":"import-statement","external":true},{"path":"@effect/platform/HttpClient","kind":"import-statement","external":true},{"path":"@tauri-apps/plugin-shell","kind":"import-statement","external":true},{"path":"effect/Cause","kind":"import-statement","external":true},{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Duration","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Either","kind":"import-statement","external":true},{"path":"effect/Exit","kind":"import-statement","external":true},{"path":"effect/Fiber","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/ManagedRuntime","kind":"import-statement","external":true},{"path":"effect/Schedule","kind":"import-statement","external":true},{"path":"effect/Stream","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/ai/resolvers","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-assistant","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/ollama.ts","inputs":{"src/capabilities/ollama.ts":{"bytesInOutput":11181}},"bytes":11328},"dist/lib/neutral/react-surface-YST5DQA3.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1887},"dist/lib/neutral/react-surface-YST5DQA3.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit/ui","kind":"import-statement","external":true},{"path":"#containers","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/react-surface.tsx","inputs":{"src/capabilities/react-surface.tsx":{"bytesInOutput":838}},"bytes":1007},"dist/lib/neutral/spotlight-listener-K7S6LGL3.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3118},"dist/lib/neutral/spotlight-listener-K7S6LGL3.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@tauri-apps/api/event","kind":"dynamic-import","external":true},{"path":"@tauri-apps/api/window","kind":"dynamic-import","external":true}],"exports":["default"],"entryPoint":"src/capabilities/spotlight-listener.ts","inputs":{"src/capabilities/spotlight-listener.ts":{"bytesInOutput":1750}},"bytes":1933},"dist/lib/neutral/updater-5ETKR4S3.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":11859},"dist/lib/neutral/updater-5ETKR4S3.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"@tauri-apps/plugin-os","kind":"import-statement","external":true},{"path":"@tauri-apps/plugin-process","kind":"import-statement","external":true},{"path":"@tauri-apps/plugin-updater","kind":"import-statement","external":true},{"path":"effect/Duration","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Fiber","kind":"import-statement","external":true},{"path":"effect/Match","kind":"import-statement","external":true},{"path":"effect/Schedule","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/updater.ts","inputs":{"src/capabilities/updater.ts":{"bytesInOutput":6475},"src/constants.ts":{"bytesInOutput":36}},"bytes":6714},"dist/lib/neutral/NativeSettings-33K63AVG.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":8958},"dist/lib/neutral/NativeSettings-33K63AVG.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"date-fns/formatDistanceToNow","kind":"import-statement","external":true},{"path":"effect/Match","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/containers/NativeSettings/index.ts","inputs":{"src/containers/NativeSettings/NativeSettings.tsx":{"bytesInOutput":4275},"src/containers/NativeSettings/index.ts":{"bytesInOutput":0}},"bytes":4452},"dist/lib/neutral/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-WU6IZ56J.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"}],"exports":["meta"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0}},"bytes":132},"dist/lib/neutral/NativePlugin.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":12637},"dist/lib/neutral/NativePlugin.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/plugin-assistant","kind":"import-statement","external":true},{"path":"#capabilities","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#translations","kind":"import-statement","external":true}],"exports":["NativePlugin","default"],"entryPoint":"src/NativePlugin.tsx","inputs":{"src/NativePlugin.tsx":{"bytesInOutput":1146},"raw-loader:/__w/dxos/dxos/packages/plugins/plugin-native/PLUGIN.mdl":{"bytesInOutput":9802}},"bytes":11205},"dist/lib/neutral/capabilities/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1081},"dist/lib/neutral/capabilities/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/neutral/settings-S5MFUI42.mjs","kind":"dynamic-import"},{"path":"dist/lib/neutral/ollama-HZEXAT2P.mjs","kind":"dynamic-import"},{"path":"dist/lib/neutral/react-surface-YST5DQA3.mjs","kind":"dynamic-import"},{"path":"dist/lib/neutral/spotlight-listener-K7S6LGL3.mjs","kind":"dynamic-import"},{"path":"dist/lib/neutral/updater-5ETKR4S3.mjs","kind":"dynamic-import"}],"exports":["NativeSettings","Ollama","ReactSurface","SpotlightListener","Updater"],"entryPoint":"src/capabilities/index.ts","inputs":{"src/capabilities/index.ts":{"bytesInOutput":524}},"bytes":708},"dist/lib/neutral/containers/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":404},"dist/lib/neutral/containers/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"dist/lib/neutral/NativeSettings-33K63AVG.mjs","kind":"dynamic-import"}],"exports":["NativeSettings"],"entryPoint":"src/containers/index.ts","inputs":{"src/containers/index.ts":{"bytesInOutput":105}},"bytes":229},"dist/lib/neutral/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/meta.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-WU6IZ56J.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"}],"exports":["meta"],"entryPoint":"src/meta.ts","inputs":{},"bytes":131},"dist/lib/neutral/plugin.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":440},"dist/lib/neutral/plugin.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-WU6IZ56J.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"#plugin","kind":"dynamic-import","external":true}],"exports":["NativePlugin"],"entryPoint":"src/plugin.ts","inputs":{"src/plugin.ts":{"bytesInOutput":109}},"bytes":268},"dist/lib/neutral/chunk-WU6IZ56J.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2076},"dist/lib/neutral/chunk-WU6IZ56J.mjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/config","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["meta"],"inputs":{"src/meta.ts":{"bytesInOutput":102},"dx.config.ts":{"bytesInOutput":1183}},"bytes":1397},"dist/lib/neutral/translations.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2036},"dist/lib/neutral/translations.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"#meta","kind":"import-statement","external":true}],"exports":["translations"],"entryPoint":"src/translations.ts","inputs":{"src/translations.ts":{"bytesInOutput":1390}},"bytes":1514},"dist/lib/neutral/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2053},"dist/lib/neutral/types/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true}],"exports":["NativeCapabilities","Settings","Update"],"entryPoint":"src/types/index.ts","inputs":{"src/types/NativeCapabilities.ts":{"bytesInOutput":386},"src/types/index.ts":{"bytesInOutput":0},"src/types/Settings.ts":{"bytesInOutput":180},"src/types/Update.ts":{"bytesInOutput":25}},"bytes":887},"dist/lib/neutral/chunk-J5LGTIGS.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/chunk-J5LGTIGS.mjs":{"imports":[],"exports":["__export"],"inputs":{},"bytes":235}}}
|
|
@@ -1,312 +0,0 @@
|
|
|
1
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
-
|
|
3
|
-
// src/capabilities/ollama.ts
|
|
4
|
-
import { Atom } from "@effect-atom/atom-react";
|
|
5
|
-
import * as FetchHttpClient from "@effect/platform/FetchHttpClient";
|
|
6
|
-
import * as HttpClient from "@effect/platform/HttpClient";
|
|
7
|
-
import { Command } from "@tauri-apps/plugin-shell";
|
|
8
|
-
import * as Cause from "effect/Cause";
|
|
9
|
-
import * as Context from "effect/Context";
|
|
10
|
-
import * as Duration from "effect/Duration";
|
|
11
|
-
import * as Effect from "effect/Effect";
|
|
12
|
-
import * as Either from "effect/Either";
|
|
13
|
-
import * as Exit from "effect/Exit";
|
|
14
|
-
import * as Fiber from "effect/Fiber";
|
|
15
|
-
import * as Layer from "effect/Layer";
|
|
16
|
-
import * as ManagedRuntime from "effect/ManagedRuntime";
|
|
17
|
-
import * as Schedule from "effect/Schedule";
|
|
18
|
-
import * as Stream from "effect/Stream";
|
|
19
|
-
import { Provider } from "@dxos/ai";
|
|
20
|
-
import { OllamaAdmin, OllamaResolver } from "@dxos/ai/resolvers";
|
|
21
|
-
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
22
|
-
import { AppCapabilities } from "@dxos/app-toolkit";
|
|
23
|
-
import { log } from "@dxos/log";
|
|
24
|
-
import { AssistantCapabilities } from "@dxos/plugin-assistant";
|
|
25
|
-
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-native/src/capabilities/ollama.ts";
|
|
26
|
-
var OLLAMA_HOST = "http://localhost:21434";
|
|
27
|
-
var ollama_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
28
|
-
const registry = yield* Capability.get(Capabilities.AtomRegistry);
|
|
29
|
-
const runtime = ManagedRuntime.make(OllamaSidecar.layerLive);
|
|
30
|
-
const sidecarLayer = Layer.effectContext(runtime.runtimeEffect.pipe(Effect.map((rt) => rt.context.pipe(Context.pick(OllamaSidecar)))));
|
|
31
|
-
const admin = OllamaAdmin.make({
|
|
32
|
-
endpoint: OLLAMA_HOST
|
|
33
|
-
});
|
|
34
|
-
const stateAtom = Atom.make({
|
|
35
|
-
kind: "idle",
|
|
36
|
-
models: [],
|
|
37
|
-
loaded: [],
|
|
38
|
-
pulls: {},
|
|
39
|
-
errors: {}
|
|
40
|
-
}).pipe(Atom.keepAlive);
|
|
41
|
-
const getState = Effect.sync(() => registry.get(stateAtom));
|
|
42
|
-
const updateState = (f) => Effect.sync(() => registry.set(stateAtom, f(registry.get(stateAtom))));
|
|
43
|
-
const fail = (error) => updateState((state) => ({
|
|
44
|
-
...state,
|
|
45
|
-
kind: "failed",
|
|
46
|
-
error
|
|
47
|
-
}));
|
|
48
|
-
const setError = (name, error) => updateState((state) => {
|
|
49
|
-
const errors = {
|
|
50
|
-
...state.errors
|
|
51
|
-
};
|
|
52
|
-
if (error) {
|
|
53
|
-
errors[name] = error;
|
|
54
|
-
} else {
|
|
55
|
-
delete errors[name];
|
|
56
|
-
}
|
|
57
|
-
return {
|
|
58
|
-
...state,
|
|
59
|
-
errors
|
|
60
|
-
};
|
|
61
|
-
});
|
|
62
|
-
const setProgress = (name, progress) => updateState((state) => {
|
|
63
|
-
const pulls = {
|
|
64
|
-
...state.pulls
|
|
65
|
-
};
|
|
66
|
-
if (progress) {
|
|
67
|
-
pulls[name] = progress;
|
|
68
|
-
} else {
|
|
69
|
-
delete pulls[name];
|
|
70
|
-
}
|
|
71
|
-
return {
|
|
72
|
-
...state,
|
|
73
|
-
pulls
|
|
74
|
-
};
|
|
75
|
-
});
|
|
76
|
-
const ensureRunning = Effect.asVoid(OllamaSidecar).pipe(Effect.provide(sidecarLayer));
|
|
77
|
-
const runAdmin = (effect) => effect.pipe(Effect.provide(clientLayer), Effect.either, Effect.map(Either.mapLeft((error) => error.message)));
|
|
78
|
-
const pullFibers = /* @__PURE__ */ new Map();
|
|
79
|
-
const refreshLoaded = Effect.gen(function* () {
|
|
80
|
-
const result = yield* runAdmin(admin.ps);
|
|
81
|
-
if (Either.isLeft(result)) {
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
const before = (yield* getState).loaded.map((model) => model.name);
|
|
85
|
-
const after = result.right.map((model) => model.name);
|
|
86
|
-
if (before.join() !== after.join()) {
|
|
87
|
-
yield* Effect.sync(() => log.info("ollama loaded models changed", {
|
|
88
|
-
loaded: after
|
|
89
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 102, S: this }));
|
|
90
|
-
}
|
|
91
|
-
yield* updateState((state) => ({
|
|
92
|
-
...state,
|
|
93
|
-
loaded: result.right
|
|
94
|
-
}));
|
|
95
|
-
});
|
|
96
|
-
const refresh = Effect.gen(function* () {
|
|
97
|
-
yield* updateState((state) => ({
|
|
98
|
-
...state,
|
|
99
|
-
kind: "loading",
|
|
100
|
-
error: void 0
|
|
101
|
-
}));
|
|
102
|
-
const started = yield* Effect.exit(ensureRunning);
|
|
103
|
-
if (Exit.isFailure(started)) {
|
|
104
|
-
return yield* fail(formatError(Cause.squash(started.cause)));
|
|
105
|
-
}
|
|
106
|
-
const result = yield* runAdmin(admin.list.pipe(Effect.retry({
|
|
107
|
-
schedule: Schedule.spaced(Duration.millis(300)),
|
|
108
|
-
times: 29
|
|
109
|
-
})));
|
|
110
|
-
if (Either.isLeft(result)) {
|
|
111
|
-
return yield* fail(result.left);
|
|
112
|
-
}
|
|
113
|
-
yield* updateState((state) => ({
|
|
114
|
-
...state,
|
|
115
|
-
kind: "ready",
|
|
116
|
-
models: result.right,
|
|
117
|
-
error: void 0
|
|
118
|
-
}));
|
|
119
|
-
yield* Effect.sync(() => log.info("ollama models", {
|
|
120
|
-
installed: result.right.map((model) => model.name)
|
|
121
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 136, S: this }));
|
|
122
|
-
yield* refreshLoaded;
|
|
123
|
-
});
|
|
124
|
-
const pull = (name) => Effect.gen(function* () {
|
|
125
|
-
const started = yield* Effect.exit(ensureRunning);
|
|
126
|
-
if (Exit.isFailure(started)) {
|
|
127
|
-
return yield* fail(formatError(Cause.squash(started.cause)));
|
|
128
|
-
}
|
|
129
|
-
yield* setError(name, void 0);
|
|
130
|
-
yield* Effect.sync(() => log.info("ollama pull started", {
|
|
131
|
-
name
|
|
132
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 147, S: this }));
|
|
133
|
-
yield* setProgress(name, {
|
|
134
|
-
status: "starting"
|
|
135
|
-
});
|
|
136
|
-
const downloaded = /* @__PURE__ */ new Map();
|
|
137
|
-
const onProgress = (progress) => Effect.suspend(() => {
|
|
138
|
-
if (progress.digest && progress.total) {
|
|
139
|
-
downloaded.set(progress.digest, {
|
|
140
|
-
completed: progress.completed ?? 0,
|
|
141
|
-
total: progress.total
|
|
142
|
-
});
|
|
143
|
-
let completed = 0;
|
|
144
|
-
let total = 0;
|
|
145
|
-
for (const layer2 of downloaded.values()) {
|
|
146
|
-
completed += layer2.completed;
|
|
147
|
-
total += layer2.total;
|
|
148
|
-
}
|
|
149
|
-
return setProgress(name, {
|
|
150
|
-
status: progress.status,
|
|
151
|
-
completed,
|
|
152
|
-
total
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
return setProgress(name, {
|
|
156
|
-
status: progress.status
|
|
157
|
-
});
|
|
158
|
-
});
|
|
159
|
-
const work = admin.pull(name).pipe(Stream.runForEach(onProgress), Effect.provide(clientLayer), Effect.matchCauseEffect({
|
|
160
|
-
onFailure: (cause) => Cause.isInterruptedOnly(cause) ? Effect.sync(() => log.info("ollama pull finished", {
|
|
161
|
-
name,
|
|
162
|
-
cancelled: true
|
|
163
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 182, S: this })) : Effect.gen(function* () {
|
|
164
|
-
const message = formatError(Cause.squash(cause));
|
|
165
|
-
yield* Effect.sync(() => log.warn("ollama pull failed", {
|
|
166
|
-
name,
|
|
167
|
-
error: message
|
|
168
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 187, S: this }));
|
|
169
|
-
yield* setError(name, message);
|
|
170
|
-
}),
|
|
171
|
-
onSuccess: () => Effect.gen(function* () {
|
|
172
|
-
yield* Effect.sync(() => log.info("ollama pull finished", {
|
|
173
|
-
name,
|
|
174
|
-
cancelled: false
|
|
175
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 194, S: this }));
|
|
176
|
-
yield* refresh;
|
|
177
|
-
})
|
|
178
|
-
}), Effect.ensuring(setProgress(name, void 0)), Effect.ensuring(Effect.sync(() => pullFibers.delete(name))));
|
|
179
|
-
const fiber = yield* Effect.forkDaemon(work);
|
|
180
|
-
yield* Effect.sync(() => pullFibers.set(name, fiber));
|
|
181
|
-
});
|
|
182
|
-
const cancel = (name) => Effect.gen(function* () {
|
|
183
|
-
yield* Effect.sync(() => log.info("ollama pull cancelled", {
|
|
184
|
-
name
|
|
185
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 205, S: this }));
|
|
186
|
-
const fiber = pullFibers.get(name);
|
|
187
|
-
if (fiber) {
|
|
188
|
-
yield* Fiber.interrupt(fiber);
|
|
189
|
-
}
|
|
190
|
-
});
|
|
191
|
-
const load = (name) => Effect.gen(function* () {
|
|
192
|
-
yield* setError(name, void 0);
|
|
193
|
-
const started = yield* Effect.exit(ensureRunning);
|
|
194
|
-
if (Exit.isFailure(started)) {
|
|
195
|
-
return yield* setError(name, formatError(Cause.squash(started.cause)));
|
|
196
|
-
}
|
|
197
|
-
yield* Effect.sync(() => log.info("ollama load", {
|
|
198
|
-
name
|
|
199
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 220, S: this }));
|
|
200
|
-
const result = yield* runAdmin(admin.load(name));
|
|
201
|
-
if (Either.isLeft(result)) {
|
|
202
|
-
yield* Effect.sync(() => log.warn("ollama load failed", {
|
|
203
|
-
name,
|
|
204
|
-
error: result.left
|
|
205
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 225, S: this }));
|
|
206
|
-
return yield* setError(name, result.left);
|
|
207
|
-
}
|
|
208
|
-
yield* refreshLoaded;
|
|
209
|
-
});
|
|
210
|
-
const unload = (name) => Effect.gen(function* () {
|
|
211
|
-
yield* setError(name, void 0);
|
|
212
|
-
const started = yield* Effect.exit(ensureRunning);
|
|
213
|
-
if (Exit.isFailure(started)) {
|
|
214
|
-
return yield* setError(name, formatError(Cause.squash(started.cause)));
|
|
215
|
-
}
|
|
216
|
-
yield* Effect.sync(() => log.info("ollama unload", {
|
|
217
|
-
name
|
|
218
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 239, S: this }));
|
|
219
|
-
const result = yield* runAdmin(admin.unload(name));
|
|
220
|
-
if (Either.isLeft(result)) {
|
|
221
|
-
return yield* setError(name, result.left);
|
|
222
|
-
}
|
|
223
|
-
yield* refreshLoaded;
|
|
224
|
-
});
|
|
225
|
-
const remove = (name) => Effect.gen(function* () {
|
|
226
|
-
yield* setError(name, void 0);
|
|
227
|
-
const started = yield* Effect.exit(ensureRunning);
|
|
228
|
-
if (Exit.isFailure(started)) {
|
|
229
|
-
return yield* setError(name, formatError(Cause.squash(started.cause)));
|
|
230
|
-
}
|
|
231
|
-
const result = yield* runAdmin(admin.remove(name));
|
|
232
|
-
if (Either.isLeft(result)) {
|
|
233
|
-
return yield* setError(name, result.left);
|
|
234
|
-
}
|
|
235
|
-
yield* refresh;
|
|
236
|
-
});
|
|
237
|
-
const manager = {
|
|
238
|
-
endpoint: OLLAMA_HOST,
|
|
239
|
-
state: stateAtom,
|
|
240
|
-
refresh,
|
|
241
|
-
refreshLoaded,
|
|
242
|
-
pull,
|
|
243
|
-
cancel,
|
|
244
|
-
load,
|
|
245
|
-
unload,
|
|
246
|
-
remove
|
|
247
|
-
};
|
|
248
|
-
return [
|
|
249
|
-
// The runtime-dispose finalizer lives on the resolver contribution only; the manager closes
|
|
250
|
-
// over the same runtime, so there is a single disposal path.
|
|
251
|
-
Capability.contributes(AppCapabilities.AiModelResolver, OllamaSidecarModelResolver.pipe(Layer.provide(sidecarLayer)), () => Effect.tryPromise(() => runtime.dispose())),
|
|
252
|
-
Capability.contributes(AssistantCapabilities.OllamaManager, manager)
|
|
253
|
-
];
|
|
254
|
-
}));
|
|
255
|
-
var OllamaSidecar = class _OllamaSidecar extends Context.Tag("@dxos/plugin-native/OllamaSidecar")() {
|
|
256
|
-
static layerLive = Layer.scoped(_OllamaSidecar, Effect.gen(function* () {
|
|
257
|
-
const command = Command.sidecar("sidecar/ollama", [
|
|
258
|
-
"serve"
|
|
259
|
-
], {
|
|
260
|
-
env: {
|
|
261
|
-
OLLAMA_HOST,
|
|
262
|
-
OLLAMA_ORIGINS: "*"
|
|
263
|
-
}
|
|
264
|
-
});
|
|
265
|
-
command.stdout.on("data", (data) => logSidecar(data.toString()));
|
|
266
|
-
command.stderr.on("data", (data) => logSidecar(data.toString()));
|
|
267
|
-
command.on("close", (code) => log.info("Ollama process exited", {
|
|
268
|
-
code
|
|
269
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 296, S: this }));
|
|
270
|
-
command.on("error", (error) => log.error("Ollama error", {
|
|
271
|
-
error
|
|
272
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 299, S: this }));
|
|
273
|
-
const child = yield* Effect.promise(() => command.spawn());
|
|
274
|
-
yield* Effect.addFinalizer(Effect.fn(function* () {
|
|
275
|
-
yield* Effect.promise(() => child.kill());
|
|
276
|
-
}));
|
|
277
|
-
log.info("Running ollama", {
|
|
278
|
-
pid: child.pid
|
|
279
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 306, S: this });
|
|
280
|
-
return {
|
|
281
|
-
endpoint: OLLAMA_HOST
|
|
282
|
-
};
|
|
283
|
-
}));
|
|
284
|
-
};
|
|
285
|
-
var OllamaSidecarModelResolver = Layer.unwrapEffect(Effect.gen(function* () {
|
|
286
|
-
const { endpoint } = yield* OllamaSidecar;
|
|
287
|
-
return OllamaResolver.make({
|
|
288
|
-
endpoint,
|
|
289
|
-
provider: Provider.builtIn.id,
|
|
290
|
-
transformClient: HttpClient.withTracerPropagation(false)
|
|
291
|
-
});
|
|
292
|
-
})).pipe(Layer.provide(FetchHttpClient.layer));
|
|
293
|
-
var formatError = (error) => typeof error === "string" ? error : error instanceof Error ? error.message : String(error);
|
|
294
|
-
var clientLayer = FetchHttpClient.layer;
|
|
295
|
-
var logSidecar = (chunk) => {
|
|
296
|
-
for (const line of chunk.split("\n")) {
|
|
297
|
-
if (line.trim().length === 0) {
|
|
298
|
-
continue;
|
|
299
|
-
}
|
|
300
|
-
if (line.includes("level=ERROR")) {
|
|
301
|
-
console.error("[ollama]", line);
|
|
302
|
-
} else if (line.includes("level=WARN")) {
|
|
303
|
-
console.warn("[ollama]", line);
|
|
304
|
-
} else {
|
|
305
|
-
console.log("[ollama]", line);
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
};
|
|
309
|
-
export {
|
|
310
|
-
ollama_default as default
|
|
311
|
-
};
|
|
312
|
-
//# sourceMappingURL=ollama-HZEXAT2P.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/ollama.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Atom } from '@effect-atom/atom-react';\nimport * as FetchHttpClient from '@effect/platform/FetchHttpClient';\nimport * as HttpClient from '@effect/platform/HttpClient';\nimport { Command } from '@tauri-apps/plugin-shell';\nimport * as Cause from 'effect/Cause';\nimport * as Context from 'effect/Context';\nimport * as Duration from 'effect/Duration';\nimport * as Effect from 'effect/Effect';\nimport * as Either from 'effect/Either';\nimport * as Exit from 'effect/Exit';\nimport * as Fiber from 'effect/Fiber';\nimport * as Layer from 'effect/Layer';\nimport * as ManagedRuntime from 'effect/ManagedRuntime';\nimport * as Schedule from 'effect/Schedule';\nimport * as Stream from 'effect/Stream';\n\nimport { type AiModelResolver, Provider } from '@dxos/ai';\nimport { OllamaAdmin, OllamaResolver } from '@dxos/ai/resolvers';\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { AppCapabilities } from '@dxos/app-toolkit';\nimport { log } from '@dxos/log';\nimport { AssistantCapabilities, type Ollama } from '@dxos/plugin-assistant';\n\n// NOTE: Running ollama on non-standard port (config Tauri).\nconst OLLAMA_HOST = 'http://localhost:21434';\n\nexport type OllamaCapabilities =\n | Capability.Capability<typeof AppCapabilities.AiModelResolver>\n | Capability.Capability<typeof AssistantCapabilities.OllamaManager>;\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const registry = yield* Capability.get(Capabilities.AtomRegistry);\n\n const runtime = ManagedRuntime.make(OllamaSidecar.layerLive);\n\n // Layer for the sidecar but the lifecycle is managed by the runtime.\n const sidecarLayer = Layer.effectContext(\n runtime.runtimeEffect.pipe(Effect.map((rt) => rt.context.pipe(Context.pick(OllamaSidecar)))),\n );\n\n const admin = OllamaAdmin.make({ endpoint: OLLAMA_HOST });\n const stateAtom = Atom.make<Ollama.ModelsState>({\n kind: 'idle',\n models: [],\n loaded: [],\n pulls: {},\n errors: {},\n }).pipe(Atom.keepAlive);\n\n // Read/update the reactive state atom as Effects.\n const getState = Effect.sync(() => registry.get(stateAtom));\n const updateState = (f: (state: Ollama.ModelsState) => Ollama.ModelsState): Effect.Effect<void> =>\n Effect.sync(() => registry.set(stateAtom, f(registry.get(stateAtom))));\n\n // Connection-level failure (reaching the service); shown at the section, not tied to a model.\n const fail = (error: string): Effect.Effect<void> => updateState((state) => ({ ...state, kind: 'failed', error }));\n\n // Per-model action error (load/unload/remove/pull); shown inline on that model's row. Pass\n // `undefined` to clear.\n const setError = (name: string, error: string | undefined): Effect.Effect<void> =>\n updateState((state) => {\n const errors = { ...state.errors };\n if (error) {\n errors[name] = error;\n } else {\n delete errors[name];\n }\n return { ...state, errors };\n });\n\n // Write (or clear, when `progress` is undefined) the in-flight progress for `name`.\n const setProgress = (name: string, progress: OllamaAdmin.PullProgress | undefined): Effect.Effect<void> =>\n updateState((state) => {\n const pulls = { ...state.pulls };\n if (progress) {\n pulls[name] = progress;\n } else {\n delete pulls[name];\n }\n return { ...state, pulls };\n });\n\n // Force the scoped sidecar layer, spawning the process idempotently — the runtime is lazy and\n // only spawns on first force, so opening settings starts Ollama rather than hitting a refused\n // connection, and a chat already using the resolver does not spawn a second process. The endpoint\n // is unused; forcing `OllamaSidecar` is what triggers the spawn. Failures surface as defects.\n const ensureRunning: Effect.Effect<void> = Effect.asVoid(OllamaSidecar).pipe(Effect.provide(sidecarLayer));\n\n // Run an admin effect with the HttpClient provided, folding its typed failure into an Either so\n // callers branch on the result without a typed error channel.\n const runAdmin = <A, E extends { readonly message: string }>(\n effect: Effect.Effect<A, E, HttpClient.HttpClient>,\n ): Effect.Effect<Either.Either<A, string>> =>\n effect.pipe(Effect.provide(clientLayer), Effect.either, Effect.map(Either.mapLeft((error) => error.message)));\n\n // In-flight pull fibers, so a pull can be cancelled via interruption.\n const pullFibers = new Map<string, Fiber.RuntimeFiber<void>>();\n\n // Refresh only the loaded-into-memory set (cheap; no spawn). Logs load/unload transitions so the\n // console reflects which model is resident when a chat request triggers a load.\n const refreshLoaded: Effect.Effect<void> = Effect.gen(function* () {\n const result = yield* runAdmin(admin.ps);\n if (Either.isLeft(result)) {\n return;\n }\n const before = (yield* getState).loaded.map((model) => model.name);\n const after = result.right.map((model) => model.name);\n if (before.join() !== after.join()) {\n yield* Effect.sync(() => log.info('ollama loaded models changed', { loaded: after }));\n }\n yield* updateState((state) => ({ ...state, loaded: result.right }));\n });\n\n const refresh: Effect.Effect<void> = Effect.gen(function* () {\n yield* updateState((state) => ({ ...state, kind: 'loading', error: undefined }));\n const started = yield* Effect.exit(ensureRunning);\n if (Exit.isFailure(started)) {\n return yield* fail(formatError(Cause.squash(started.cause)));\n }\n // The sidecar process spawns before its HTTP server is listening, so retry until the first\n // `list` succeeds rather than reporting a spurious failure on startup.\n const result = yield* runAdmin(\n admin.list.pipe(Effect.retry({ schedule: Schedule.spaced(Duration.millis(300)), times: 29 })),\n );\n if (Either.isLeft(result)) {\n return yield* fail(result.left);\n }\n yield* updateState((state) => ({ ...state, kind: 'ready', models: result.right, error: undefined }));\n yield* Effect.sync(() => log.info('ollama models', { installed: result.right.map((model) => model.name) }));\n yield* refreshLoaded;\n });\n\n const pull = (name: string): Effect.Effect<void> =>\n Effect.gen(function* () {\n const started = yield* Effect.exit(ensureRunning);\n if (Exit.isFailure(started)) {\n return yield* fail(formatError(Cause.squash(started.cause)));\n }\n yield* setError(name, undefined);\n yield* Effect.sync(() => log.info('ollama pull started', { name }));\n yield* setProgress(name, { status: 'starting' });\n\n // Ollama reports `completed`/`total` per layer (digest); aggregate across layers so the\n // overall percent is monotonic rather than resetting to 0 as each layer starts.\n const downloaded = new Map<string, { completed: number; total: number }>();\n const onProgress = (progress: OllamaAdmin.PullProgress): Effect.Effect<void> =>\n Effect.suspend(() => {\n if (progress.digest && progress.total) {\n downloaded.set(progress.digest, { completed: progress.completed ?? 0, total: progress.total });\n let completed = 0;\n let total = 0;\n for (const layer of downloaded.values()) {\n completed += layer.completed;\n total += layer.total;\n }\n return setProgress(name, { status: progress.status, completed, total });\n }\n // Non-download phase (manifest, verifying, writing): keep the status label, drop totals.\n return setProgress(name, { status: progress.status });\n });\n\n // Run the pull on a daemon fiber so `cancel` can interrupt it; clear progress and drop the\n // fiber on every exit path. A cancelled pull interrupts the fiber — treated as a no-op.\n const work = admin.pull(name).pipe(\n Stream.runForEach(onProgress),\n Effect.provide(clientLayer),\n Effect.matchCauseEffect({\n onFailure: (cause) =>\n Cause.isInterruptedOnly(cause)\n ? Effect.sync(() => log.info('ollama pull finished', { name, cancelled: true }))\n : Effect.gen(function* () {\n const message = formatError(Cause.squash(cause));\n yield* Effect.sync(() => log.warn('ollama pull failed', { name, error: message }));\n yield* setError(name, message);\n }),\n onSuccess: () =>\n Effect.gen(function* () {\n yield* Effect.sync(() => log.info('ollama pull finished', { name, cancelled: false }));\n yield* refresh;\n }),\n }),\n Effect.ensuring(setProgress(name, undefined)),\n Effect.ensuring(Effect.sync(() => pullFibers.delete(name))),\n );\n\n const fiber = yield* Effect.forkDaemon(work);\n yield* Effect.sync(() => pullFibers.set(name, fiber));\n });\n\n const cancel = (name: string): Effect.Effect<void> =>\n Effect.gen(function* () {\n yield* Effect.sync(() => log.info('ollama pull cancelled', { name }));\n const fiber = pullFibers.get(name);\n if (fiber) {\n // The pull's `ensuring` clears progress and drops the fiber on interruption.\n yield* Fiber.interrupt(fiber);\n }\n });\n\n const load = (name: string): Effect.Effect<void> =>\n Effect.gen(function* () {\n yield* setError(name, undefined);\n const started = yield* Effect.exit(ensureRunning);\n if (Exit.isFailure(started)) {\n return yield* setError(name, formatError(Cause.squash(started.cause)));\n }\n yield* Effect.sync(() => log.info('ollama load', { name }));\n const result = yield* runAdmin(admin.load(name));\n if (Either.isLeft(result)) {\n yield* Effect.sync(() => log.warn('ollama load failed', { name, error: result.left }));\n return yield* setError(name, result.left);\n }\n yield* refreshLoaded;\n });\n\n const unload = (name: string): Effect.Effect<void> =>\n Effect.gen(function* () {\n yield* setError(name, undefined);\n const started = yield* Effect.exit(ensureRunning);\n if (Exit.isFailure(started)) {\n return yield* setError(name, formatError(Cause.squash(started.cause)));\n }\n yield* Effect.sync(() => log.info('ollama unload', { name }));\n const result = yield* runAdmin(admin.unload(name));\n if (Either.isLeft(result)) {\n return yield* setError(name, result.left);\n }\n yield* refreshLoaded;\n });\n\n const remove = (name: string): Effect.Effect<void> =>\n Effect.gen(function* () {\n yield* setError(name, undefined);\n const started = yield* Effect.exit(ensureRunning);\n if (Exit.isFailure(started)) {\n return yield* setError(name, formatError(Cause.squash(started.cause)));\n }\n const result = yield* runAdmin(admin.remove(name));\n if (Either.isLeft(result)) {\n return yield* setError(name, result.left);\n }\n yield* refresh;\n });\n\n const manager: Ollama.Manager = {\n endpoint: OLLAMA_HOST,\n state: stateAtom,\n refresh,\n refreshLoaded,\n pull,\n cancel,\n load,\n unload,\n remove,\n };\n\n return [\n // The runtime-dispose finalizer lives on the resolver contribution only; the manager closes\n // over the same runtime, so there is a single disposal path.\n Capability.contributes(\n AppCapabilities.AiModelResolver,\n OllamaSidecarModelResolver.pipe(Layer.provide(sidecarLayer)),\n () => Effect.tryPromise(() => runtime.dispose()),\n ),\n Capability.contributes(AssistantCapabilities.OllamaManager, manager),\n ];\n }),\n);\n\nclass OllamaSidecar extends Context.Tag('@dxos/plugin-native/OllamaSidecar')<\n OllamaSidecar,\n {\n endpoint: string;\n }\n>() {\n static layerLive = Layer.scoped(\n OllamaSidecar,\n Effect.gen(function* () {\n // The `ollama` launcher discovers `llama-server` + its libraries relative to its own\n // executable (`<exe>/lib/ollama/`), ignoring OLLAMA_LIBRARY_PATH, so the runtime ships into\n // `Contents/MacOS/lib/ollama` next to the signed sidecar (see tauri.conf bundle.macOS.files).\n const command = Command.sidecar('sidecar/ollama', ['serve'], {\n env: {\n OLLAMA_HOST,\n OLLAMA_ORIGINS: '*', // CORS\n },\n });\n\n // Ollama writes nearly all of its output (including normal startup/inference logs) to stderr,\n // so route by the structured `level=` field rather than the stream to avoid flooding the\n // console with red errors. Kept on `console.*` for Ollama's own line formatting.\n command.stdout.on('data', (data) => logSidecar(data.toString()));\n command.stderr.on('data', (data) => logSidecar(data.toString()));\n command.on('close', (code) => log.info('Ollama process exited', { code }));\n command.on('error', (error) => log.error('Ollama error', { error }));\n const child = yield* Effect.promise(() => command.spawn());\n yield* Effect.addFinalizer(\n Effect.fn(function* () {\n yield* Effect.promise(() => child.kill());\n }),\n );\n log.info('Running ollama', { pid: child.pid });\n\n return {\n endpoint: OLLAMA_HOST,\n };\n }),\n );\n}\n\nconst OllamaSidecarModelResolver: Layer.Layer<AiModelResolver.AiModelResolver, never, OllamaSidecar> =\n Layer.unwrapEffect(\n Effect.gen(function* () {\n const { endpoint } = yield* OllamaSidecar;\n return OllamaResolver.make({\n endpoint,\n provider: Provider.builtIn.id,\n transformClient: HttpClient.withTracerPropagation(false),\n });\n }),\n ).pipe(Layer.provide(FetchHttpClient.layer));\n\nconst formatError = (error: unknown): string =>\n typeof error === 'string' ? error : error instanceof Error ? error.message : String(error);\n\n/** Effect HttpClient layer shared by every admin call. */\nconst clientLayer = FetchHttpClient.layer;\n\n/**\n * Route a chunk of Ollama process output to the console by its structured log level. Ollama emits\n * `INFO`/`WARN` to stderr alongside genuine errors, so only `level=ERROR` lines surface as errors.\n */\nconst logSidecar = (chunk: string): void => {\n for (const line of chunk.split('\\n')) {\n if (line.trim().length === 0) {\n continue;\n }\n /* eslint-disable no-console */\n if (line.includes('level=ERROR')) {\n console.error('[ollama]', line);\n } else if (line.includes('level=WARN')) {\n console.warn('[ollama]', line);\n } else {\n console.log('[ollama]', line);\n }\n /* eslint-enable no-console */\n }\n};\n"],
|
|
5
|
-
"mappings": ";;;AAIA,SAASA,YAAY;AACrB,YAAYC,qBAAqB;AACjC,YAAYC,gBAAgB;AAC5B,SAASC,eAAe;AACxB,YAAYC,WAAW;AACvB,YAAYC,aAAa;AACzB,YAAYC,cAAc;AAC1B,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AAA,GAAAA,cAAAA,GAAAA,KAAAA,GAAAA,KAAAA,CAAAA;AACZ,WAAA;MAEF,UAAA;IACJ;EAEA,CAAA,CAAM+D;;IAIA,6BAA2B,mBAAA,WAAA,aAAA;QACzBhE,EAAAA,SAAAA,IAAAA,OAAAA;SACAiE,eAAUhF,KAASiF;IACnBC;IACF,UAAA,SAAA,QAAA;IAEE,iBAAehG,iCAAqB,KAAA;EAE5C,CAAA;AAGA,CAAA,CAAA,EAAA,KAAA,cAAA,qBAAA,CAAA;AAGA,IAAA,cAAA,CAAA,UAAA,OAAA,UAAA,WAAA,QAAA,iBAAA,QAAA,MAAA,UAAA,OAAA,KAAA;;IAMI,aAAa,CAAGiG,UAAM;aACpB,QAAA,MAAA,MAAA,IAAA,GAAA;AACF,QAAA,KAAA,KAAA,EAAA,WAAA,GAAA;AACA;;AAGyB,QAAA,KAAe,SAAA,aAAA,GAAA;AACtCC,cAAQ5B,MAAK,YAAY6B,IAAAA;IAC3B,WAAO,KAAA,SAAA,YAAA,GAAA;AACLD,cAAQ9E,KAAI,YAAY+E,IAAAA;IAC1B,OAAA;AACA,cAAA,IAAA,YACF,IAAA;IACF;;;",
|
|
6
|
-
"names": ["Atom", "FetchHttpClient", "HttpClient", "Command", "Cause", "Context", "Duration", "Effect", "Either", "Exit", "Fiber", "Layer", "ManagedRuntime", "Schedule", "Stream", "Provider", "OllamaAdmin", "OllamaResolver", "Capabilities", "Capability", "AppCapabilities", "log", "AssistantCapabilities", "registry", "runtime", "OllamaSidecar", "layerLive", "sidecarLayer", "effectContext", "runtimeEffect", "endpoint", "OLLAMA_HOST", "stateAtom", "models", "loaded", "pulls", "errors", "pipe", "getState", "fail", "error", "updateState", "state", "kind", "name", "progress", "pullFibers", "Map", "result", "before", "after", "sync", "info", "refresh", "started", "formatError", "times", "isLeft", "refreshLoaded", "pull", "setError", "undefined", "setProgress", "status", "digest", "downloaded", "completed", "total", "layer", "cancelled", "message", "warn", "onSuccess", "gen", "ensuring", "fiber", "cancel", "load", "ensureRunning", "isFailure", "left", "unload", "remove", "runAdmin", "admin", "manager", "env", "OLLAMA_ORIGINS", "command", "on", "code", "child", "addFinalizer", "kill", "OllamaSidecarModelResolver", "provider", "builtIn", "transformClient", "length", "console", "line"]
|
|
7
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
meta
|
|
3
|
-
} from "./chunk-WU6IZ56J.mjs";
|
|
4
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
5
|
-
|
|
6
|
-
// src/plugin.ts
|
|
7
|
-
import { Plugin } from "@dxos/app-framework";
|
|
8
|
-
var NativePlugin = Plugin.lazy(meta, () => import("#plugin"));
|
|
9
|
-
export {
|
|
10
|
-
NativePlugin
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=plugin.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/plugin.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\n\nimport { meta } from './meta';\n\nexport const NativePlugin = Plugin.lazy(meta, () => import('#plugin'));\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,SAASA,cAAc;AAIhB,IAAMC,eAAeC,OAAOC,KAAKC,MAAM,MAAM,OAAO,SAAA,CAAA;",
|
|
6
|
-
"names": ["Plugin", "NativePlugin", "Plugin", "lazy", "meta"]
|
|
7
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
-
|
|
3
|
-
// src/capabilities/react-surface.tsx
|
|
4
|
-
import * as Effect from "effect/Effect";
|
|
5
|
-
import React from "react";
|
|
6
|
-
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
7
|
-
import { Surface, useSettingsState } from "@dxos/app-framework/ui";
|
|
8
|
-
import { AppSurface } from "@dxos/app-toolkit/ui";
|
|
9
|
-
import { NativeSettings } from "#containers";
|
|
10
|
-
import { meta } from "#meta";
|
|
11
|
-
var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(Capabilities.ReactSurface, [
|
|
12
|
-
Surface.create({
|
|
13
|
-
id: "pluginSettings",
|
|
14
|
-
filter: AppSurface.settings(AppSurface.Article, meta.profile.key),
|
|
15
|
-
component: ({ data: { subject } }) => {
|
|
16
|
-
const { settings, updateSettings } = useSettingsState(subject.atom);
|
|
17
|
-
return /* @__PURE__ */ React.createElement(NativeSettings, {
|
|
18
|
-
settings,
|
|
19
|
-
onSettingsChange: updateSettings
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
})
|
|
23
|
-
])));
|
|
24
|
-
export {
|
|
25
|
-
react_surface_default as default
|
|
26
|
-
};
|
|
27
|
-
//# sourceMappingURL=react-surface-YST5DQA3.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/react-surface.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport React from 'react';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { Surface, useSettingsState } from '@dxos/app-framework/ui';\nimport { AppSurface } from '@dxos/app-toolkit/ui';\n\nimport { NativeSettings } from '#containers';\nimport { meta } from '#meta';\nimport { type Settings } from '#types';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(Capabilities.ReactSurface, [\n Surface.create({\n id: 'pluginSettings',\n filter: AppSurface.settings(AppSurface.Article, meta.profile.key),\n component: ({ data: { subject } }) => {\n const { settings, updateSettings } = useSettingsState<Settings.Settings>(subject.atom);\n return <NativeSettings settings={settings} onSettingsChange={updateSettings} />;\n },\n }),\n ]),\n ),\n);\n"],
|
|
5
|
-
"mappings": ";;;AAIA,YAAYA,YAAY;AACxB,OAAOC,WAAW;AAElB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,SAASC,wBAAwB;AAC1C,SAASC,kBAAkB;AAE3B,SAASC,sBAAsB;AAC/B,SAASC,YAAY;AAGrB,IAAA,wBAAeL,WAAWM,WAAW,MAC5BC,eACLP,WAAWQ,YAAYT,aAAaU,cAAc;EAChDR,QAAQS,OAAO;IACbC,IAAI;IACJC,QAAQT,WAAWU,SAASV,WAAWW,SAAST,KAAKU,QAAQC,GAAG;IAChEC,WAAW,CAAC,EAAEC,MAAM,EAAEC,QAAO,EAAE,MAAE;AAC/B,YAAM,EAAEN,UAAUO,eAAc,IAAKlB,iBAAoCiB,QAAQE,IAAI;AACrF,aAAO,sBAAA,cAACjB,gBAAAA;QAAeS;QAAoBS,kBAAkBF;;IAC/D;EACF,CAAA;CACD,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "React", "Capabilities", "Capability", "Surface", "useSettingsState", "AppSurface", "NativeSettings", "meta", "makeModule", "succeed", "contributes", "ReactSurface", "create", "id", "filter", "settings", "Article", "profile", "key", "component", "data", "subject", "updateSettings", "atom", "onSettingsChange"]
|
|
7
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
-
|
|
3
|
-
// src/capabilities/settings.ts
|
|
4
|
-
import * as Effect from "effect/Effect";
|
|
5
|
-
import { Capability } from "@dxos/app-framework";
|
|
6
|
-
import { AppCapabilities } from "@dxos/app-toolkit";
|
|
7
|
-
import { createKvsStore } from "@dxos/effect";
|
|
8
|
-
import { meta } from "#meta";
|
|
9
|
-
import { NativeCapabilities, Settings } from "#types";
|
|
10
|
-
var settings_default = Capability.makeModule(() => Effect.sync(() => {
|
|
11
|
-
const settingsAtom = createKvsStore({
|
|
12
|
-
key: meta.profile.key,
|
|
13
|
-
schema: Settings.Settings,
|
|
14
|
-
defaultValue: () => ({})
|
|
15
|
-
});
|
|
16
|
-
return [
|
|
17
|
-
Capability.contributes(NativeCapabilities.Settings, settingsAtom),
|
|
18
|
-
Capability.contributes(AppCapabilities.Settings, {
|
|
19
|
-
prefix: meta.profile.key,
|
|
20
|
-
schema: Settings.Settings,
|
|
21
|
-
atom: settingsAtom
|
|
22
|
-
})
|
|
23
|
-
];
|
|
24
|
-
}));
|
|
25
|
-
export {
|
|
26
|
-
settings_default as default
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=settings-S5MFUI42.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/settings.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { AppCapabilities } from '@dxos/app-toolkit';\nimport { createKvsStore } from '@dxos/effect';\n\nimport { meta } from '#meta';\nimport { NativeCapabilities, Settings } from '#types';\n\nexport default Capability.makeModule(() =>\n Effect.sync(() => {\n const settingsAtom = createKvsStore({\n key: meta.profile.key,\n schema: Settings.Settings,\n defaultValue: () => ({}),\n });\n\n return [\n Capability.contributes(NativeCapabilities.Settings, settingsAtom),\n Capability.contributes(AppCapabilities.Settings, {\n prefix: meta.profile.key,\n schema: Settings.Settings,\n atom: settingsAtom,\n }),\n ];\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;AAIA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,uBAAuB;AAChC,SAASC,sBAAsB;AAE/B,SAASC,YAAY;AACrB,SAASC,oBAAoBC,gBAAgB;AAE7C,IAAA,mBAAeL,WAAWM,WAAW,MAC5BC,YAAK,MAAA;AACV,QAAMC,eAAeN,eAAe;IAClCO,KAAKN,KAAKO,QAAQD;IAClBE,QAAQN,SAASA;IACjBO,cAAc,OAAO,CAAC;EACxB,CAAA;AAEA,SAAO;IACLZ,WAAWa,YAAYT,mBAAmBC,UAAUG,YAAAA;IACpDR,WAAWa,YAAYZ,gBAAgBI,UAAU;MAC/CS,QAAQX,KAAKO,QAAQD;MACrBE,QAAQN,SAASA;MACjBU,MAAMP;IACR,CAAA;;AAEJ,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "Capability", "AppCapabilities", "createKvsStore", "meta", "NativeCapabilities", "Settings", "makeModule", "sync", "settingsAtom", "key", "profile", "schema", "defaultValue", "contributes", "prefix", "atom"]
|
|
7
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
-
|
|
3
|
-
// src/capabilities/spotlight-listener.ts
|
|
4
|
-
import * as Effect from "effect/Effect";
|
|
5
|
-
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
6
|
-
import { LayoutOperation } from "@dxos/app-toolkit";
|
|
7
|
-
import { log } from "@dxos/log";
|
|
8
|
-
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-native/src/capabilities/spotlight-listener.ts";
|
|
9
|
-
var spotlight_listener_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
10
|
-
const { invokePromise } = yield* Capability.get(Capabilities.OperationInvoker);
|
|
11
|
-
const unlisten = yield* Effect.promise(async () => {
|
|
12
|
-
const { listen } = await import("@tauri-apps/api/event");
|
|
13
|
-
const { getCurrentWindow } = await import("@tauri-apps/api/window");
|
|
14
|
-
return listen("spotlight:invoke", async (event) => {
|
|
15
|
-
const { operation, payload } = event.payload;
|
|
16
|
-
log.info("Received spotlight invoke event", {
|
|
17
|
-
operation,
|
|
18
|
-
payload
|
|
19
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 17, S: this });
|
|
20
|
-
try {
|
|
21
|
-
switch (operation) {
|
|
22
|
-
case "open":
|
|
23
|
-
await invokePromise(LayoutOperation.Open, payload);
|
|
24
|
-
break;
|
|
25
|
-
case "switch-workspace":
|
|
26
|
-
await invokePromise(LayoutOperation.SwitchWorkspace, payload);
|
|
27
|
-
break;
|
|
28
|
-
default:
|
|
29
|
-
log.warn("Unknown spotlight operation", {
|
|
30
|
-
operation
|
|
31
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 30, S: this });
|
|
32
|
-
}
|
|
33
|
-
const mainWindow = getCurrentWindow();
|
|
34
|
-
await mainWindow.show();
|
|
35
|
-
await mainWindow.setFocus();
|
|
36
|
-
} catch (err) {
|
|
37
|
-
log.catch(err, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 38, S: this });
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
return Capability.contributes(Capabilities.Null, null, () => Effect.sync(() => {
|
|
42
|
-
unlisten();
|
|
43
|
-
}));
|
|
44
|
-
}));
|
|
45
|
-
export {
|
|
46
|
-
spotlight_listener_default as default
|
|
47
|
-
};
|
|
48
|
-
//# sourceMappingURL=spotlight-listener-K7S6LGL3.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/spotlight-listener.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { LayoutOperation } from '@dxos/app-toolkit';\nimport { log } from '@dxos/log';\n\n// TODO(wittjosiah): Formalize with a stricter schema if we evolve this protocol.\ntype SpotlightInvokePayload = {\n operation: string;\n payload?: Record<string, any>;\n};\n\n/**\n * Listens for spotlight:invoke events from the popover window and dispatches the corresponding operation.\n */\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const { invokePromise } = yield* Capability.get(Capabilities.OperationInvoker);\n\n const unlisten = yield* Effect.promise(async () => {\n const { listen } = await import('@tauri-apps/api/event');\n const { getCurrentWindow } = await import('@tauri-apps/api/window');\n\n return listen<SpotlightInvokePayload>('spotlight:invoke', async (event) => {\n const { operation, payload } = event.payload;\n log.info('Received spotlight invoke event', { operation, payload });\n try {\n switch (operation) {\n case 'open':\n await invokePromise(LayoutOperation.Open, payload as any);\n break;\n case 'switch-workspace':\n await invokePromise(LayoutOperation.SwitchWorkspace, payload as any);\n break;\n default:\n log.warn('Unknown spotlight operation', { operation });\n }\n\n const mainWindow = getCurrentWindow();\n await mainWindow.show();\n await mainWindow.setFocus();\n } catch (err) {\n log.catch(err);\n }\n });\n });\n\n return Capability.contributes(Capabilities.Null, null, () =>\n Effect.sync(() => {\n unlisten();\n }),\n );\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,uBAAuB;AAChC,SAASC,WAAW;AAQpB,IAAA,eAAA;AAOI,IAAMC,6BAAAA,WAAkBL,WAAe,kBAAA,aAAA;QACrC,EAAA,cAAgB,IAAG,OAAM,WAAO,IAAA,aAAA,gBAAA;QAChC,WAAQM,OAAkB,eAAS,YAAO;AAE1C,UAAA,EAAOC,OAA+B,IAAA,MAAA,OAAA,uBAA2BC;UAC/D,EAAA,iBAAmBC,IAAAA,MAAYD,OAAMC,wBAAO;WAC5CL,OAAS,oBAAA,OAAA,UAAmC;YAAEM,EAAAA,WAAAA,QAAAA,IAAAA,MAAAA;UAAWD,KAAAA,mCAAAA;QAAQ;QAC7D;uBACMC,YAAAA,GAAAA,cAAAA,GAAAA,IAAAA,GAAAA,KAAAA,CAAAA;;2BAEEC;eACN;AACF,kBAAK,cAAA,gBAAA,MAAA,OAAA;AACH;eACA;AACF,kBAAA,cAAA,gBAAA,iBAAA,OAAA;AACEP;;AAAoD,gBAAA,KAAA,+BAAA;cACxD;YAEMQ,GAAAA,EAAAA,YAAaN,YAAAA,GAAAA,cAAAA,GAAAA,IAAAA,GAAAA,KAAAA,CAAAA;QACnB;AACA,cAAMM,aAAWC,iBAAQ;AACzB,cAAOC,WAAK,KAAA;AACZV,cAAIW,WAAMD,SAAAA;MACZ,SAAA,KAAA;AACF,YAAA,MAAA,KAAA,QAAA,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,KAAA,CAAA;MACF;IAEA,CAAA;;SAGE,WAAA,YAAA,aAAA,MAAA,MAAA,MAAA,YAAA,MAAA;AAGJ,aAAA;;;",
|
|
6
|
-
"names": ["Effect", "Capabilities", "Capability", "LayoutOperation", "log", "unlisten", "getCurrentWindow", "listen", "event", "payload", "operation", "invokePromise", "mainWindow", "setFocus", "err", "catch"]
|
|
7
|
-
}
|