@dxos/plugin-native 0.8.4-main.7ace549 → 0.8.4-main.937b3ca

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/dist/lib/browser/{chunk-SP3MEGKI.mjs → chunk-6374DBU4.mjs} +1 -1
  2. package/dist/lib/browser/chunk-6374DBU4.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +32 -30
  4. package/dist/lib/browser/index.mjs.map +4 -4
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/browser/{ollama-CQE7ZIWL.mjs → ollama-KSB3XG6S.mjs} +13 -15
  7. package/dist/lib/browser/ollama-KSB3XG6S.mjs.map +7 -0
  8. package/dist/lib/browser/{updater-SDBPTCXA.mjs → updater-XQTSH4ZZ.mjs} +45 -50
  9. package/dist/lib/browser/updater-XQTSH4ZZ.mjs.map +7 -0
  10. package/dist/lib/browser/window-JDFVLF4U.mjs +38 -0
  11. package/dist/lib/browser/window-JDFVLF4U.mjs.map +7 -0
  12. package/dist/types/src/NativePlugin.d.ts +2 -1
  13. package/dist/types/src/NativePlugin.d.ts.map +1 -1
  14. package/dist/types/src/capabilities/index.d.ts +3 -3
  15. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  16. package/dist/types/src/capabilities/ollama/index.d.ts +3 -0
  17. package/dist/types/src/capabilities/ollama/index.d.ts.map +1 -0
  18. package/dist/types/src/capabilities/ollama/ollama.d.ts +6 -0
  19. package/dist/types/src/capabilities/ollama/ollama.d.ts.map +1 -0
  20. package/dist/types/src/capabilities/updater/index.d.ts +3 -0
  21. package/dist/types/src/capabilities/updater/index.d.ts.map +1 -0
  22. package/dist/types/src/capabilities/updater/updater.d.ts +5 -0
  23. package/dist/types/src/capabilities/updater/updater.d.ts.map +1 -0
  24. package/dist/types/src/capabilities/window/index.d.ts +3 -0
  25. package/dist/types/src/capabilities/window/index.d.ts.map +1 -0
  26. package/dist/types/src/capabilities/window/window.d.ts +11 -0
  27. package/dist/types/src/capabilities/window/window.d.ts.map +1 -0
  28. package/dist/types/src/index.d.ts +1 -0
  29. package/dist/types/src/index.d.ts.map +1 -1
  30. package/dist/types/src/meta.d.ts +2 -2
  31. package/dist/types/src/meta.d.ts.map +1 -1
  32. package/dist/types/tsconfig.tsbuildinfo +1 -1
  33. package/package.json +18 -13
  34. package/src/NativePlugin.tsx +13 -16
  35. package/src/capabilities/index.ts +3 -5
  36. package/src/capabilities/ollama/index.ts +7 -0
  37. package/src/capabilities/{ollama.ts → ollama/ollama.ts} +25 -20
  38. package/src/capabilities/updater/index.ts +7 -0
  39. package/src/capabilities/updater/updater.ts +82 -0
  40. package/src/capabilities/window/index.ts +7 -0
  41. package/src/capabilities/window/window.ts +72 -0
  42. package/src/index.ts +1 -0
  43. package/src/meta.ts +2 -2
  44. package/dist/lib/browser/chunk-SP3MEGKI.mjs.map +0 -7
  45. package/dist/lib/browser/ollama-CQE7ZIWL.mjs.map +0 -7
  46. package/dist/lib/browser/updater-SDBPTCXA.mjs.map +0 -7
  47. package/dist/lib/browser/window-6G542FZL.mjs +0 -34
  48. package/dist/lib/browser/window-6G542FZL.mjs.map +0 -7
  49. package/dist/types/src/capabilities/ollama.d.ts +0 -4
  50. package/dist/types/src/capabilities/ollama.d.ts.map +0 -1
  51. package/dist/types/src/capabilities/updater.d.ts +0 -4
  52. package/dist/types/src/capabilities/updater.d.ts.map +0 -1
  53. package/dist/types/src/capabilities/window.d.ts +0 -4
  54. package/dist/types/src/capabilities/window.d.ts.map +0 -1
  55. package/src/capabilities/updater.ts +0 -85
  56. package/src/capabilities/window.ts +0 -49
@@ -12,4 +12,4 @@ var meta = {
12
12
  export {
13
13
  meta
14
14
  };
15
- //# sourceMappingURL=chunk-SP3MEGKI.mjs.map
15
+ //# sourceMappingURL=chunk-6374DBU4.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/meta.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: Plugin.Meta = {\n id: 'dxos.org/plugin/native',\n name: 'Native',\n description: trim`\n Native platform integration providing desktop-specific features and system-level capabilities.\n Access native file dialogs, notifications, and OS integrations.\n `,\n};\n"],
5
+ "mappings": ";AAKA,SAASA,YAAY;AAEd,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,aAAaC;;;;AAIf;",
6
+ "names": ["trim", "meta", "id", "name", "description", "trim"]
7
+ }
@@ -1,17 +1,23 @@
1
1
  import {
2
2
  meta
3
- } from "./chunk-SP3MEGKI.mjs";
3
+ } from "./chunk-6374DBU4.mjs";
4
+
5
+ // src/capabilities/ollama/index.ts
6
+ import { Capability } from "@dxos/app-framework";
7
+ var Ollama = Capability.lazy("Ollama", () => import("./ollama-KSB3XG6S.mjs"));
8
+
9
+ // src/capabilities/updater/index.ts
10
+ import { Capability as Capability2 } from "@dxos/app-framework";
11
+ var Updater = Capability2.lazy("Updater", () => import("./updater-XQTSH4ZZ.mjs"));
12
+
13
+ // src/capabilities/window/index.ts
14
+ import { Capability as Capability3 } from "@dxos/app-framework";
15
+ var Window = Capability3.lazy("Window", () => import("./window-JDFVLF4U.mjs"));
4
16
 
5
17
  // src/NativePlugin.tsx
6
- import { Capabilities, Events, contributes, defineModule, definePlugin } from "@dxos/app-framework";
18
+ import { Common, Plugin } from "@dxos/app-framework";
7
19
  import { AssistantEvents } from "@dxos/plugin-assistant";
8
20
 
9
- // src/capabilities/index.ts
10
- import { lazy } from "@dxos/app-framework";
11
- var Ollama = lazy(() => import("./ollama-CQE7ZIWL.mjs"));
12
- var Updater = lazy(() => import("./updater-SDBPTCXA.mjs"));
13
- var Window = lazy(() => import("./window-6G542FZL.mjs"));
14
-
15
21
  // src/translations.ts
16
22
  var translations = [
17
23
  {
@@ -27,30 +33,26 @@ var translations = [
27
33
  ];
28
34
 
29
35
  // src/NativePlugin.tsx
30
- var NativePlugin = definePlugin(meta, () => [
31
- defineModule({
32
- id: `${meta.id}/module/translations`,
33
- activatesOn: Events.SetupTranslations,
34
- activate: () => contributes(Capabilities.Translations, translations)
35
- }),
36
- defineModule({
37
- id: `${meta.id}/module/updater`,
38
- activatesOn: Events.DispatcherReady,
39
- activate: Updater
40
- }),
41
- defineModule({
42
- id: `${meta.id}/module/window`,
43
- activatesOn: Events.DispatcherReady,
44
- activate: Window
45
- }),
46
- defineModule({
47
- id: `${meta.id}/module/ollama`,
48
- activatesOn: AssistantEvents.SetupAiServiceProviders,
49
- activate: Ollama
50
- })
51
- ]);
36
+ var NativePlugin = Plugin.define(meta).pipe(Common.Plugin.addTranslationsModule({
37
+ translations
38
+ }), Plugin.addModule({
39
+ id: "updater",
40
+ activatesOn: Common.ActivationEvent.OperationInvokerReady,
41
+ activate: Updater
42
+ }), Plugin.addModule({
43
+ id: "window",
44
+ activatesOn: Common.ActivationEvent.OperationInvokerReady,
45
+ activate: Window
46
+ }), Plugin.addModule({
47
+ id: "ollama",
48
+ activatesOn: AssistantEvents.SetupAiServiceProviders,
49
+ activate: Ollama
50
+ }), Plugin.make);
52
51
  export {
53
52
  NativePlugin,
53
+ Ollama,
54
+ Updater,
55
+ Window,
54
56
  meta
55
57
  };
56
58
  //# sourceMappingURL=index.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/NativePlugin.tsx", "../../../src/capabilities/index.ts", "../../../src/translations.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Capabilities, Events, contributes, defineModule, definePlugin } from '@dxos/app-framework';\nimport { AssistantEvents } from '@dxos/plugin-assistant';\n\nimport { Ollama, Updater, Window } from './capabilities';\nimport { meta } from './meta';\nimport { translations } from './translations';\n\nexport const NativePlugin = definePlugin(meta, () => [\n defineModule({\n id: `${meta.id}/module/translations`,\n activatesOn: Events.SetupTranslations,\n activate: () => contributes(Capabilities.Translations, translations),\n }),\n defineModule({\n id: `${meta.id}/module/updater`,\n activatesOn: Events.DispatcherReady,\n activate: Updater,\n }),\n defineModule({\n id: `${meta.id}/module/window`,\n activatesOn: Events.DispatcherReady,\n activate: Window,\n }),\n defineModule({\n id: `${meta.id}/module/ollama`,\n activatesOn: AssistantEvents.SetupAiServiceProviders,\n activate: Ollama,\n }),\n]);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const Ollama = lazy(() => import('./ollama'));\nexport const Updater = lazy(() => import('./updater'));\nexport const Window = lazy(() => import('./window'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Resource } from '@dxos/react-ui';\n\nimport { meta } from './meta';\n\nexport const translations = [\n {\n 'en-US': {\n [meta.id]: {\n 'update ready label': 'Ready to update',\n 'update ready description': 'A new version of Composer is available.',\n 'update label': 'Update',\n 'update alt': 'Relaunch the app to update',\n },\n },\n },\n] as const satisfies Resource[];\n"],
5
- "mappings": ";;;;;AAIA,SAASA,cAAcC,QAAQC,aAAaC,cAAcC,oBAAoB;AAC9E,SAASC,uBAAuB;;;ACDhC,SAASC,YAAY;AAEd,IAAMC,SAASC,KAAK,MAAM,OAAO,uBAAA,CAAA;AACjC,IAAMC,UAAUD,KAAK,MAAM,OAAO,wBAAA,CAAA;AAClC,IAAME,SAASF,KAAK,MAAM,OAAO,uBAAA,CAAA;;;ACAjC,IAAMG,eAAe;EAC1B;IACE,SAAS;MACP,CAACC,KAAKC,EAAE,GAAG;QACT,sBAAsB;QACtB,4BAA4B;QAC5B,gBAAgB;QAChB,cAAc;MAChB;IACF;EACF;;;;AFPK,IAAMC,eAAeC,aAAaC,MAAM,MAAM;EACnDC,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOC;IACpBC,UAAU,MAAMC,YAAYC,aAAaC,cAAcC,YAAAA;EACzD,CAAA;EACAT,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOO;IACpBL,UAAUM;EACZ,CAAA;EACAX,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOO;IACpBL,UAAUO;EACZ,CAAA;EACAZ,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaW,gBAAgBC;IAC7BT,UAAUU;EACZ,CAAA;CACD;",
6
- "names": ["Capabilities", "Events", "contributes", "defineModule", "definePlugin", "AssistantEvents", "lazy", "Ollama", "lazy", "Updater", "Window", "translations", "meta", "id", "NativePlugin", "definePlugin", "meta", "defineModule", "id", "activatesOn", "Events", "SetupTranslations", "activate", "contributes", "Capabilities", "Translations", "translations", "DispatcherReady", "Updater", "Window", "AssistantEvents", "SetupAiServiceProviders", "Ollama"]
3
+ "sources": ["../../../src/capabilities/ollama/index.ts", "../../../src/capabilities/updater/index.ts", "../../../src/capabilities/window/index.ts", "../../../src/NativePlugin.tsx", "../../../src/translations.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nexport const Ollama = Capability.lazy('Ollama', () => import('./ollama'));\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nexport const Updater = Capability.lazy('Updater', () => import('./updater'));\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nexport const Window = Capability.lazy('Window', () => import('./window'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Common, Plugin } from '@dxos/app-framework';\nimport { AssistantEvents } from '@dxos/plugin-assistant';\n\nimport { Ollama, Updater, Window } from './capabilities';\nimport { meta } from './meta';\nimport { translations } from './translations';\n\nexport const NativePlugin = Plugin.define(meta).pipe(\n Common.Plugin.addTranslationsModule({ translations }),\n Plugin.addModule({\n id: 'updater',\n activatesOn: Common.ActivationEvent.OperationInvokerReady,\n activate: Updater,\n }),\n Plugin.addModule({\n id: 'window',\n activatesOn: Common.ActivationEvent.OperationInvokerReady,\n activate: Window,\n }),\n Plugin.addModule({\n id: 'ollama',\n activatesOn: AssistantEvents.SetupAiServiceProviders,\n activate: Ollama,\n }),\n Plugin.make,\n);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Resource } from '@dxos/react-ui';\n\nimport { meta } from './meta';\n\nexport const translations = [\n {\n 'en-US': {\n [meta.id]: {\n 'update ready label': 'Ready to update',\n 'update ready description': 'A new version of Composer is available.',\n 'update label': 'Update',\n 'update alt': 'Relaunch the app to update',\n },\n },\n },\n] as const satisfies Resource[];\n"],
5
+ "mappings": ";;;;;AAIA,SAASA,kBAAkB;AAEpB,IAAMC,SAASC,WAAWC,KAAK,UAAU,MAAM,OAAO,uBAAA,CAAA;;;ACF7D,SAASC,cAAAA,mBAAkB;AAEpB,IAAMC,UAAUC,YAAWC,KAAK,WAAW,MAAM,OAAO,wBAAA,CAAA;;;ACF/D,SAASC,cAAAA,mBAAkB;AAEpB,IAAMC,SAASC,YAAWC,KAAK,UAAU,MAAM,OAAO,uBAAA,CAAA;;;ACF7D,SAASC,QAAQC,cAAc;AAC/B,SAASC,uBAAuB;;;ACGzB,IAAMC,eAAe;EAC1B;IACE,SAAS;MACP,CAACC,KAAKC,EAAE,GAAG;QACT,sBAAsB;QACtB,4BAA4B;QAC5B,gBAAgB;QAChB,cAAc;MAChB;IACF;EACF;;;;ADPK,IAAMC,eAAeC,OAAOC,OAAOC,IAAAA,EAAMC,KAC9CC,OAAOJ,OAAOK,sBAAsB;EAAEC;AAAa,CAAA,GACnDN,OAAOO,UAAU;EACfC,IAAI;EACJC,aAAaL,OAAOM,gBAAgBC;EACpCC,UAAUC;AACZ,CAAA,GACAb,OAAOO,UAAU;EACfC,IAAI;EACJC,aAAaL,OAAOM,gBAAgBC;EACpCC,UAAUE;AACZ,CAAA,GACAd,OAAOO,UAAU;EACfC,IAAI;EACJC,aAAaM,gBAAgBC;EAC7BJ,UAAUK;AACZ,CAAA,GACAjB,OAAOkB,IAAI;",
6
+ "names": ["Capability", "Ollama", "Capability", "lazy", "Capability", "Updater", "Capability", "lazy", "Capability", "Window", "Capability", "lazy", "Common", "Plugin", "AssistantEvents", "translations", "meta", "id", "NativePlugin", "Plugin", "define", "meta", "pipe", "Common", "addTranslationsModule", "translations", "addModule", "id", "activatesOn", "ActivationEvent", "OperationInvokerReady", "activate", "Updater", "Window", "AssistantEvents", "SetupAiServiceProviders", "Ollama", "make"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"src/meta.ts":{"bytes":1396,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/ollama.ts":{"bytes":10161,"imports":[{"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/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/ManagedRuntime","kind":"import-statement","external":true},{"path":"@dxos/ai/AiServiceRouter","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/updater.ts":{"bytes":12408,"imports":[{"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/Function","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/log","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"src/capabilities/window.ts":{"bytes":5689,"imports":[{"path":"@tauri-apps/api/window","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/index.ts":{"bytes":1148,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/ollama.ts","kind":"dynamic-import","original":"./ollama"},{"path":"src/capabilities/updater.ts","kind":"dynamic-import","original":"./updater"},{"path":"src/capabilities/window.ts","kind":"dynamic-import","original":"./window"}],"format":"esm"},"src/translations.ts":{"bytes":1625,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"src/NativePlugin.tsx":{"bytes":3973,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-assistant","kind":"import-statement","external":true},{"path":"src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/translations.ts","kind":"import-statement","original":"./translations"}],"format":"esm"},"src/index.ts":{"bytes":549,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/NativePlugin.tsx","kind":"import-statement","original":"./NativePlugin"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3100},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-SP3MEGKI.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-assistant","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/browser/ollama-CQE7ZIWL.mjs","kind":"dynamic-import"},{"path":"dist/lib/browser/updater-SDBPTCXA.mjs","kind":"dynamic-import"},{"path":"dist/lib/browser/window-6G542FZL.mjs","kind":"dynamic-import"}],"exports":["NativePlugin","meta"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0},"src/NativePlugin.tsx":{"bytesInOutput":771},"src/capabilities/index.ts":{"bytesInOutput":220},"src/translations.ts":{"bytesInOutput":293}},"bytes":1505},"dist/lib/browser/ollama-CQE7ZIWL.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5092},"dist/lib/browser/ollama-CQE7ZIWL.mjs":{"imports":[{"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/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/ManagedRuntime","kind":"import-statement","external":true},{"path":"@dxos/ai/AiServiceRouter","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/ollama.ts","inputs":{"src/capabilities/ollama.ts":{"bytesInOutput":2600}},"bytes":2715},"dist/lib/browser/updater-SDBPTCXA.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5657},"dist/lib/browser/updater-SDBPTCXA.mjs":{"imports":[{"path":"dist/lib/browser/chunk-SP3MEGKI.mjs","kind":"import-statement"},{"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/Function","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/log","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/updater.ts","inputs":{"src/capabilities/updater.ts":{"bytesInOutput":3611}},"bytes":3777},"dist/lib/browser/chunk-SP3MEGKI.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":665},"dist/lib/browser/chunk-SP3MEGKI.mjs":{"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["meta"],"inputs":{"src/meta.ts":{"bytesInOutput":293}},"bytes":372},"dist/lib/browser/window-6G542FZL.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2974},"dist/lib/browser/window-6G542FZL.mjs":{"imports":[{"path":"@tauri-apps/api/window","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/window.ts","inputs":{"src/capabilities/window.ts":{"bytesInOutput":1214}},"bytes":1329}}}
1
+ {"inputs":{"src/capabilities/ollama/ollama.ts":{"bytes":10783,"imports":[{"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/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/ManagedRuntime","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/log","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/ollama/index.ts":{"bytes":848,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/ollama/ollama.ts","kind":"dynamic-import","original":"./ollama"}],"format":"esm"},"src/meta.ts":{"bytes":1392,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/updater/updater.ts":{"bytes":12209,"imports":[{"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/Function","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/log","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"../../meta"}],"format":"esm"},"src/capabilities/updater/index.ts":{"bytes":856,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/updater/updater.ts","kind":"dynamic-import","original":"./updater"}],"format":"esm"},"src/capabilities/window/window.ts":{"bytes":6809,"imports":[{"path":"@tauri-apps/api/window","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/window/index.ts":{"bytes":848,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/window/window.ts","kind":"dynamic-import","original":"./window"}],"format":"esm"},"src/capabilities/index.ts":{"bytes":637,"imports":[{"path":"src/capabilities/ollama/index.ts","kind":"import-statement","original":"./ollama"},{"path":"src/capabilities/updater/index.ts","kind":"import-statement","original":"./updater"},{"path":"src/capabilities/window/index.ts","kind":"import-statement","original":"./window"}],"format":"esm"},"src/translations.ts":{"bytes":1625,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"src/NativePlugin.tsx":{"bytes":3267,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-assistant","kind":"import-statement","external":true},{"path":"src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/translations.ts","kind":"import-statement","original":"./translations"}],"format":"esm"},"src/index.ts":{"bytes":649,"imports":[{"path":"src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/NativePlugin.tsx","kind":"import-statement","original":"./NativePlugin"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3343},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-6374DBU4.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/browser/ollama-KSB3XG6S.mjs","kind":"dynamic-import"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/browser/updater-XQTSH4ZZ.mjs","kind":"dynamic-import"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/browser/window-JDFVLF4U.mjs","kind":"dynamic-import"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-assistant","kind":"import-statement","external":true}],"exports":["NativePlugin","Ollama","Updater","Window","meta"],"entryPoint":"src/index.ts","inputs":{"src/capabilities/ollama/index.ts":{"bytesInOutput":129},"src/capabilities/index.ts":{"bytesInOutput":0},"src/capabilities/updater/index.ts":{"bytesInOutput":148},"src/capabilities/window/index.ts":{"bytesInOutput":145},"src/index.ts":{"bytesInOutput":0},"src/NativePlugin.tsx":{"bytesInOutput":581},"src/translations.ts":{"bytesInOutput":293}},"bytes":1630},"dist/lib/browser/ollama-KSB3XG6S.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5412},"dist/lib/browser/ollama-KSB3XG6S.mjs":{"imports":[{"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/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/ManagedRuntime","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/log","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/ollama/ollama.ts","inputs":{"src/capabilities/ollama/ollama.ts":{"bytesInOutput":2625}},"bytes":2747},"dist/lib/browser/updater-XQTSH4ZZ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5584},"dist/lib/browser/updater-XQTSH4ZZ.mjs":{"imports":[{"path":"dist/lib/browser/chunk-6374DBU4.mjs","kind":"import-statement"},{"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/Function","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/log","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/updater/updater.ts","inputs":{"src/capabilities/updater/updater.ts":{"bytesInOutput":3502}},"bytes":3676},"dist/lib/browser/chunk-6374DBU4.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":662},"dist/lib/browser/chunk-6374DBU4.mjs":{"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["meta"],"inputs":{"src/meta.ts":{"bytesInOutput":293}},"bytes":372},"dist/lib/browser/window-JDFVLF4U.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3444},"dist/lib/browser/window-JDFVLF4U.mjs":{"imports":[{"path":"@tauri-apps/api/window","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/window/window.ts","inputs":{"src/capabilities/window/window.ts":{"bytesInOutput":1208}},"bytes":1330}}}
@@ -1,4 +1,4 @@
1
- // src/capabilities/ollama.ts
1
+ // src/capabilities/ollama/ollama.ts
2
2
  import * as FetchHttpClient from "@effect/platform/FetchHttpClient";
3
3
  import * as HttpClient from "@effect/platform/HttpClient";
4
4
  import { Command } from "@tauri-apps/plugin-shell";
@@ -6,18 +6,16 @@ import * as Context from "effect/Context";
6
6
  import * as Effect from "effect/Effect";
7
7
  import * as Layer from "effect/Layer";
8
8
  import * as ManagedRuntime from "effect/ManagedRuntime";
9
- import * as AiServiceRouter from "@dxos/ai/AiServiceRouter";
10
- import { Capabilities, contributes } from "@dxos/app-framework";
9
+ import { OllamaResolver } from "@dxos/ai/resolvers";
10
+ import { Capability, Common } from "@dxos/app-framework";
11
11
  import { log } from "@dxos/log";
12
- var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-native/src/capabilities/ollama.ts";
12
+ var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-native/src/capabilities/ollama/ollama.ts";
13
13
  var OLLAMA_HOST = "http://localhost:21434";
14
- var ollama_default = ((_context) => {
14
+ var ollama_default = Capability.makeModule(() => Effect.sync(() => {
15
15
  const runtime = ManagedRuntime.make(OllamaSidecar.layerLive);
16
16
  const sidecarLayer = Layer.effectContext(runtime.runtimeEffect.pipe(Effect.map((rt) => rt.context.pipe(Context.pick(OllamaSidecar)))));
17
- return contributes(Capabilities.AiModelResolver, OllamaSidecarModelResolver.pipe(Layer.provide(sidecarLayer)), async () => {
18
- await runtime.dispose();
19
- });
20
- });
17
+ return Capability.contributes(Common.Capability.AiModelResolver, OllamaSidecarModelResolver.pipe(Layer.provide(sidecarLayer)), () => Effect.tryPromise(() => runtime.dispose()));
18
+ }));
21
19
  var OllamaSidecar = class _OllamaSidecar extends Context.Tag("@dxos/plugin-native/OllamaSidecar")() {
22
20
  static layerLive = Layer.scoped(_OllamaSidecar, Effect.gen(function* () {
23
21
  const command = Command.sidecar("sidecar/ollama", [
@@ -34,7 +32,7 @@ var OllamaSidecar = class _OllamaSidecar extends Context.Tag("@dxos/plugin-nativ
34
32
  code
35
33
  }, {
36
34
  F: __dxlog_file,
37
- L: 56,
35
+ L: 61,
38
36
  S: this,
39
37
  C: (f, a) => f(...a)
40
38
  }));
@@ -42,7 +40,7 @@ var OllamaSidecar = class _OllamaSidecar extends Context.Tag("@dxos/plugin-nativ
42
40
  error
43
41
  }, {
44
42
  F: __dxlog_file,
45
- L: 57,
43
+ L: 62,
46
44
  S: this,
47
45
  C: (f, a) => f(...a)
48
46
  }));
@@ -54,7 +52,7 @@ var OllamaSidecar = class _OllamaSidecar extends Context.Tag("@dxos/plugin-nativ
54
52
  pid: child.pid
55
53
  }, {
56
54
  F: __dxlog_file,
57
- L: 64,
55
+ L: 69,
58
56
  S: this,
59
57
  C: (f, a) => f(...a)
60
58
  });
@@ -65,12 +63,12 @@ var OllamaSidecar = class _OllamaSidecar extends Context.Tag("@dxos/plugin-nativ
65
63
  };
66
64
  var OllamaSidecarModelResolver = Layer.unwrapEffect(Effect.gen(function* () {
67
65
  const { endpoint } = yield* OllamaSidecar;
68
- return AiServiceRouter.OllamaResolver({
69
- host: endpoint,
66
+ return OllamaResolver.make({
67
+ endpoint,
70
68
  transformClient: HttpClient.withTracerPropagation(false)
71
69
  });
72
70
  })).pipe(Layer.provide(FetchHttpClient.layer));
73
71
  export {
74
72
  ollama_default as default
75
73
  };
76
- //# sourceMappingURL=ollama-CQE7ZIWL.mjs.map
74
+ //# sourceMappingURL=ollama-KSB3XG6S.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/ollama/ollama.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as FetchHttpClient from '@effect/platform/FetchHttpClient';\nimport * as HttpClient from '@effect/platform/HttpClient';\nimport { Command } from '@tauri-apps/plugin-shell';\nimport * as Context from 'effect/Context';\nimport * as Effect from 'effect/Effect';\nimport * as Layer from 'effect/Layer';\nimport * as ManagedRuntime from 'effect/ManagedRuntime';\n\nimport { type AiModelResolver } from '@dxos/ai';\nimport { OllamaResolver } from '@dxos/ai/resolvers';\nimport { Capability, Common } from '@dxos/app-framework';\nimport { log } from '@dxos/log';\n\n// NOTE: Running ollama on non-standard port (config Tauri).\nconst OLLAMA_HOST = 'http://localhost:21434';\n\nexport type OllamaCapabilities = Capability.Capability<typeof Common.Capability.AiModelResolver>;\n\nexport default Capability.makeModule<[], OllamaCapabilities>(() =>\n Effect.sync(() => {\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 return Capability.contributes(\n Common.Capability.AiModelResolver,\n OllamaSidecarModelResolver.pipe(Layer.provide(sidecarLayer)),\n () => Effect.tryPromise(() => runtime.dispose()),\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 const command = Command.sidecar('sidecar/ollama', ['serve'], {\n env: {\n OLLAMA_HOST,\n OLLAMA_ORIGINS: '*', // CORS\n },\n });\n\n // NOTE: Keeping those as console.log for consistent formatting.\n // eslint-disable-next-line no-console\n command.stdout.on('data', (data) => console.log('[ollama]', data.toString()));\n // eslint-disable-next-line no-console\n command.stderr.on('data', (data) => console.error('[ollama]', 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 transformClient: HttpClient.withTracerPropagation(false),\n });\n }),\n ).pipe(Layer.provide(FetchHttpClient.layer));\n"],
5
+ "mappings": ";AAIA,YAAYA,qBAAqB;AACjC,YAAYC,gBAAgB;AAC5B,SAASC,eAAe;AACxB,YAAYC,aAAa;AACzB,YAAYC,YAAY;AACxB,YAAYC,WAAW;AACvB,YAAYC,oBAAoB;AAGhC,SAASC,sBAAsB;AAC/B,SAASC,YAAYC,cAAc;AACnC,SAASC,WAAW;;AAGpB,IAAMC,cAAc;AAIpB,IAAA,iBAAeH,WAAWI,WAAmC,MACpDC,YAAK,MAAA;AACV,QAAMC,UAAyBC,oBAAKC,cAAcC,SAAS;AAG3D,QAAMC,eAAqBC,oBACzBL,QAAQM,cAAcC,KAAYC,WAAI,CAACC,OAAOA,GAAGC,QAAQH,KAAaI,aAAKT,aAAAA,CAAAA,CAAAA,CAAAA,CAAAA;AAG7E,SAAOR,WAAWkB,YAChBjB,OAAOD,WAAWmB,iBAClBC,2BAA2BP,KAAWQ,cAAQX,YAAAA,CAAAA,GAC9C,MAAaY,kBAAW,MAAMhB,QAAQiB,QAAO,CAAA,CAAA;AAEjD,CAAA,CAAA;AAGF,IAAMf,gBAAN,MAAMA,uBAA8BgB,YAAI,mCAAA,EAAA,EAAA;EAMtC,OAAOf,YAAkBgB,aACvBjB,gBACOkB,WAAI,aAAA;AACT,UAAMC,UAAUjC,QAAQkC,QAAQ,kBAAkB;MAAC;OAAU;MAC3DC,KAAK;QACH1B;QACA2B,gBAAgB;MAClB;IACF,CAAA;AAIAH,YAAQI,OAAOC,GAAG,QAAQ,CAACC,SAASC,QAAQhC,IAAI,YAAY+B,KAAKE,SAAQ,CAAA,CAAA;AAEzER,YAAQS,OAAOJ,GAAG,QAAQ,CAACC,SAASC,QAAQG,MAAM,YAAYJ,KAAKE,SAAQ,CAAA,CAAA;AAC3ER,YAAQK,GAAG,SAAS,CAACM,SAASpC,IAAIqC,KAAK,yBAAyB;MAAED;IAAK,GAAA;;;;;;AACvEX,YAAQK,GAAG,SAAS,CAACK,UAAUnC,IAAImC,MAAM,gBAAgB;MAAEA;IAAM,GAAA;;;;;;AACjE,UAAMG,QAAQ,OAAcC,eAAQ,MAAMd,QAAQe,MAAK,CAAA;AACvD,WAAcC,oBACLC,UAAG,aAAA;AACR,aAAcH,eAAQ,MAAMD,MAAMK,KAAI,CAAA;IACxC,CAAA,CAAA;AAEF3C,QAAIqC,KAAK,kBAAkB;MAAEO,KAAKN,MAAMM;IAAI,GAAA;;;;;;AAE5C,WAAO;MACLC,UAAU5C;IACZ;EACF,CAAA,CAAA;AAEJ;AAEA,IAAMiB,6BACE4B,mBACGtB,WAAI,aAAA;AACT,QAAM,EAAEqB,SAAQ,IAAK,OAAOvC;AAC5B,SAAOT,eAAeQ,KAAK;IACzBwC;IACAE,iBAA4BC,iCAAsB,KAAA;EACpD,CAAA;AACF,CAAA,CAAA,EACArC,KAAWQ,cAAwB8B,qBAAK,CAAA;",
6
+ "names": ["FetchHttpClient", "HttpClient", "Command", "Context", "Effect", "Layer", "ManagedRuntime", "OllamaResolver", "Capability", "Common", "log", "OLLAMA_HOST", "makeModule", "sync", "runtime", "make", "OllamaSidecar", "layerLive", "sidecarLayer", "effectContext", "runtimeEffect", "pipe", "map", "rt", "context", "pick", "contributes", "AiModelResolver", "OllamaSidecarModelResolver", "provide", "tryPromise", "dispose", "Tag", "scoped", "gen", "command", "sidecar", "env", "OLLAMA_ORIGINS", "stdout", "on", "data", "console", "toString", "stderr", "error", "code", "info", "child", "promise", "spawn", "addFinalizer", "fn", "kill", "pid", "endpoint", "unwrapEffect", "transformClient", "withTracerPropagation", "layer"]
7
+ }
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  meta
3
- } from "./chunk-SP3MEGKI.mjs";
3
+ } from "./chunk-6374DBU4.mjs";
4
4
 
5
- // src/capabilities/updater.ts
5
+ // src/capabilities/updater/updater.ts
6
6
  import { type } from "@tauri-apps/plugin-os";
7
7
  import { relaunch } from "@tauri-apps/plugin-process";
8
8
  import { check } from "@tauri-apps/plugin-updater";
@@ -12,24 +12,24 @@ import * as Fiber from "effect/Fiber";
12
12
  import * as Function from "effect/Function";
13
13
  import * as Match from "effect/Match";
14
14
  import * as Schedule from "effect/Schedule";
15
- import { Capabilities, LayoutAction, contributes, createIntent } from "@dxos/app-framework";
15
+ import { Capability, Common } from "@dxos/app-framework";
16
16
  import { log } from "@dxos/log";
17
- var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-native/src/capabilities/updater.ts";
17
+ var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-native/src/capabilities/updater/updater.ts";
18
18
  var SUPPORTS_OTA = [
19
19
  "linux",
20
20
  "macos",
21
21
  "windows"
22
22
  ];
23
- var updater_default = ((context) => {
23
+ var updater_default = Capability.makeModule(Effect.fnUntraced(function* () {
24
24
  const platform = type();
25
25
  if (!SUPPORTS_OTA.includes(platform) || window.location.hostname === "localhost") {
26
- return contributes(Capabilities.Null, null);
26
+ return;
27
27
  }
28
- const { dispatch } = context.getCapability(Capabilities.IntentDispatcher);
28
+ const { invoke } = yield* Capability.get(Common.Capability.OperationInvoker);
29
29
  const action = Effect.gen(function* () {
30
30
  log.info("checking for updates", void 0, {
31
31
  F: __dxlog_file,
32
- L: 33,
32
+ L: 34,
33
33
  S: this,
34
34
  C: (f, a) => f(...a)
35
35
  });
@@ -39,14 +39,14 @@ var updater_default = ((context) => {
39
39
  currentVersion: update?.currentVersion
40
40
  }, {
41
41
  F: __dxlog_file,
42
- L: 35,
42
+ L: 36,
43
43
  S: this,
44
44
  C: (f, a) => f(...a)
45
45
  });
46
46
  if (update) {
47
47
  log.info("update available", update, {
48
48
  F: __dxlog_file,
49
- L: 37,
49
+ L: 38,
50
50
  S: this,
51
51
  C: (f, a) => f(...a)
52
52
  });
@@ -60,7 +60,7 @@ var updater_default = ((context) => {
60
60
  contentLength
61
61
  }, {
62
62
  F: __dxlog_file,
63
- L: 44,
63
+ L: 45,
64
64
  S: this,
65
65
  C: (f, a) => f(...a)
66
66
  });
@@ -73,7 +73,7 @@ var updater_default = ((context) => {
73
73
  contentLength
74
74
  }, {
75
75
  F: __dxlog_file,
76
- L: 48,
76
+ L: 49,
77
77
  S: this,
78
78
  C: (f, a) => f(...a)
79
79
  });
@@ -82,44 +82,41 @@ var updater_default = ((context) => {
82
82
  }, () => {
83
83
  log.info("download completed", void 0, {
84
84
  F: __dxlog_file,
85
- L: 51,
85
+ L: 52,
86
86
  S: this,
87
87
  C: (f, a) => f(...a)
88
88
  });
89
89
  }), Match.exhaustive);
90
90
  yield* Effect.tryPromise(() => update.downloadAndInstall(handleDownload));
91
- yield* dispatch(createIntent(LayoutAction.AddToast, {
92
- part: "toast",
93
- subject: {
94
- id: `${meta.id}/update-ready`,
95
- title: [
96
- "update ready label",
97
- {
98
- ns: meta.id
99
- }
100
- ],
101
- description: [
102
- "update ready description",
103
- {
104
- ns: meta.id
105
- }
106
- ],
107
- duration: Infinity,
108
- actionLabel: [
109
- "update label",
110
- {
111
- ns: meta.id
112
- }
113
- ],
114
- actionAlt: [
115
- "update alt",
116
- {
117
- ns: meta.id
118
- }
119
- ],
120
- onAction: () => relaunch()
121
- }
122
- }));
91
+ yield* invoke(Common.LayoutOperation.AddToast, {
92
+ id: `${meta.id}/update-ready`,
93
+ title: [
94
+ "update ready label",
95
+ {
96
+ ns: meta.id
97
+ }
98
+ ],
99
+ description: [
100
+ "update ready description",
101
+ {
102
+ ns: meta.id
103
+ }
104
+ ],
105
+ duration: Infinity,
106
+ actionLabel: [
107
+ "update label",
108
+ {
109
+ ns: meta.id
110
+ }
111
+ ],
112
+ actionAlt: [
113
+ "update alt",
114
+ {
115
+ ns: meta.id
116
+ }
117
+ ],
118
+ onAction: () => relaunch()
119
+ });
123
120
  }
124
121
  });
125
122
  const fiber = Function.pipe(
@@ -128,11 +125,9 @@ var updater_default = ((context) => {
128
125
  Effect.repeat(Schedule.fixed(Duration.hours(1))),
129
126
  Effect.runFork
130
127
  );
131
- return contributes(Capabilities.Null, null, () => {
132
- Effect.runSync(Fiber.interrupt(fiber));
133
- });
134
- });
128
+ return Capability.contributes(Common.Capability.Null, null, () => Effect.sync(() => Effect.runSync(Fiber.interrupt(fiber))));
129
+ }));
135
130
  export {
136
131
  updater_default as default
137
132
  };
138
- //# sourceMappingURL=updater-SDBPTCXA.mjs.map
133
+ //# sourceMappingURL=updater-XQTSH4ZZ.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/updater/updater.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type } from '@tauri-apps/plugin-os';\nimport { relaunch } from '@tauri-apps/plugin-process';\nimport { type DownloadEvent, check } from '@tauri-apps/plugin-updater';\nimport * as Duration from 'effect/Duration';\nimport * as Effect from 'effect/Effect';\nimport * as Fiber from 'effect/Fiber';\nimport * as Function from 'effect/Function';\nimport * as Match from 'effect/Match';\nimport * as Schedule from 'effect/Schedule';\n\nimport { Capability, Common } from '@dxos/app-framework';\nimport { log } from '@dxos/log';\n\nimport { meta } from '../../meta';\n\nconst SUPPORTS_OTA = ['linux', 'macos', 'windows'];\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n // Skip updates if not supported or in dev mode.\n const platform = type();\n if (!SUPPORTS_OTA.includes(platform) || window.location.hostname === 'localhost') {\n return;\n }\n\n const { invoke } = yield* Capability.get(Common.Capability.OperationInvoker);\n\n // https://tauri.app/plugin/updater/#checking-for-updates\n const action = Effect.gen(function* () {\n log.info('checking for updates');\n const update = yield* Effect.tryPromise(() => check());\n log.info('checked for updates', { version: update?.version, currentVersion: update?.currentVersion });\n if (update) {\n log.info('update available', update);\n let downloaded = 0;\n let contentLength = 0;\n\n const handleDownload = Match.type<DownloadEvent>().pipe(\n Match.when({ event: 'Started' }, (event) => {\n contentLength = event.data.contentLength ?? 0;\n log.info('download started', { contentLength });\n }),\n Match.when({ event: 'Progress' }, (event) => {\n downloaded += event.data.chunkLength;\n log.verbose('download progress', { downloaded, contentLength });\n }),\n Match.when({ event: 'Finished' }, () => {\n log.info('download completed');\n }),\n Match.exhaustive,\n );\n\n yield* Effect.tryPromise(() => update.downloadAndInstall(handleDownload));\n\n yield* invoke(Common.LayoutOperation.AddToast, {\n id: `${meta.id}/update-ready`,\n title: ['update ready label', { ns: meta.id }],\n description: ['update ready description', { ns: meta.id }],\n duration: Infinity,\n actionLabel: ['update label', { ns: meta.id }],\n actionAlt: ['update alt', { ns: meta.id }],\n onAction: () => relaunch(),\n });\n }\n });\n\n const fiber: Fiber.RuntimeFiber<number, unknown> = Function.pipe(\n // prettier-ignore\n action,\n Effect.repeat(Schedule.fixed(Duration.hours(1))),\n Effect.runFork,\n );\n\n return Capability.contributes(Common.Capability.Null, null, () =>\n Effect.sync(() => Effect.runSync(Fiber.interrupt(fiber))),\n );\n }),\n);\n"],
5
+ "mappings": ";;;;;AAIA,SAASA,YAAY;AACrB,SAASC,gBAAgB;AACzB,SAA6BC,aAAa;AAC1C,YAAYC,cAAc;AAC1B,YAAYC,YAAY;AACxB,YAAYC,WAAW;AACvB,YAAYC,cAAc;AAC1B,YAAYC,WAAW;AACvB,YAAYC,cAAc;AAE1B,SAASC,YAAYC,cAAc;AACnC,SAASC,WAAW;;AAIpB,IAAMC,eAAe;EAAC;EAAS;EAAS;;AAExC,IAAA,kBAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAEhB,QAAMC,WAAWC,KAAAA;AACjB,MAAI,CAACL,aAAaM,SAASF,QAAAA,KAAaG,OAAOC,SAASC,aAAa,aAAa;AAChF;EACF;AAEA,QAAM,EAAEC,OAAM,IAAK,OAAOT,WAAWU,IAAIC,OAAOX,WAAWY,gBAAgB;AAG3E,QAAMC,SAAgBC,WAAI,aAAA;AACxBC,QAAIC,KAAK,wBAAA,QAAA;;;;;;AACT,UAAMC,SAAS,OAAcC,kBAAW,MAAMC,MAAAA,CAAAA;AAC9CJ,QAAIC,KAAK,uBAAuB;MAAEI,SAASH,QAAQG;MAASC,gBAAgBJ,QAAQI;IAAe,GAAA;;;;;;AACnG,QAAIJ,QAAQ;AACVF,UAAIC,KAAK,oBAAoBC,QAAAA;;;;;;AAC7B,UAAIK,aAAa;AACjB,UAAIC,gBAAgB;AAEpB,YAAMC,iBAAuBpB,WAAI,EAAkBqB,KAC3CC,WAAK;QAAEC,OAAO;MAAU,GAAG,CAACA,UAAAA;AAChCJ,wBAAgBI,MAAMC,KAAKL,iBAAiB;AAC5CR,YAAIC,KAAK,oBAAoB;UAAEO;QAAc,GAAA;;;;;;MAC/C,CAAA,GACMG,WAAK;QAAEC,OAAO;MAAW,GAAG,CAACA,UAAAA;AACjCL,sBAAcK,MAAMC,KAAKC;AACzBd,YAAIe,QAAQ,qBAAqB;UAAER;UAAYC;QAAc,GAAA;;;;;;MAC/D,CAAA,GACMG,WAAK;QAAEC,OAAO;MAAW,GAAG,MAAA;AAChCZ,YAAIC,KAAK,sBAAA,QAAA;;;;;;MACX,CAAA,GACMe,gBAAU;AAGlB,aAAcb,kBAAW,MAAMD,OAAOe,mBAAmBR,cAAAA,CAAAA;AAEzD,aAAOf,OAAOE,OAAOsB,gBAAgBC,UAAU;QAC7CC,IAAI,GAAGC,KAAKD,EAAE;QACdE,OAAO;UAAC;UAAsB;YAAEC,IAAIF,KAAKD;UAAG;;QAC5CI,aAAa;UAAC;UAA4B;YAAED,IAAIF,KAAKD;UAAG;;QACxDK,UAAUC;QACVC,aAAa;UAAC;UAAgB;YAAEJ,IAAIF,KAAKD;UAAG;;QAC5CQ,WAAW;UAAC;UAAc;YAAEL,IAAIF,KAAKD;UAAG;;QACxCS,UAAU,MAAMC,SAAAA;MAClB,CAAA;IACF;EACF,CAAA;AAEA,QAAMC,QAAsDrB;;IAE1DZ;IACOkC,cAAgBC,eAAeC,eAAM,CAAA,CAAA,CAAA;IACrCC;EAAO;AAGhB,SAAOlD,WAAWmD,YAAYxC,OAAOX,WAAWoD,MAAM,MAAM,MACnDC,YAAK,MAAaC,eAAcC,gBAAUT,KAAAA,CAAAA,CAAAA,CAAAA;AAErD,CAAA,CAAA;",
6
+ "names": ["type", "relaunch", "check", "Duration", "Effect", "Fiber", "Function", "Match", "Schedule", "Capability", "Common", "log", "SUPPORTS_OTA", "Capability", "makeModule", "fnUntraced", "platform", "type", "includes", "window", "location", "hostname", "invoke", "get", "Common", "OperationInvoker", "action", "gen", "log", "info", "update", "tryPromise", "check", "version", "currentVersion", "downloaded", "contentLength", "handleDownload", "pipe", "when", "event", "data", "chunkLength", "verbose", "exhaustive", "downloadAndInstall", "LayoutOperation", "AddToast", "id", "meta", "title", "ns", "description", "duration", "Infinity", "actionLabel", "actionAlt", "onAction", "relaunch", "fiber", "repeat", "fixed", "hours", "runFork", "contributes", "Null", "sync", "runSync", "interrupt"]
7
+ }
@@ -0,0 +1,38 @@
1
+ // src/capabilities/window/window.ts
2
+ import { getCurrentWindow } from "@tauri-apps/api/window";
3
+ import * as Effect from "effect/Effect";
4
+ import { Capability, Common } from "@dxos/app-framework";
5
+ var window_default = Capability.makeModule(Effect.fnUntraced(function* () {
6
+ const appWindow = getCurrentWindow();
7
+ const cleanupDragRegions = setupWindowDrag(appWindow);
8
+ return Capability.contributes(Common.Capability.Null, null, Effect.fnUntraced(function* () {
9
+ cleanupDragRegions();
10
+ }));
11
+ }));
12
+ var INTERACTIVE_SELECTORS = '.app-no-drag, button, a, input, select, textarea, [role="button"], [role="menuitem"]';
13
+ var setupWindowDrag = (appWindow) => {
14
+ const handleMouseDown = (event) => {
15
+ const target = event.target;
16
+ if (!target) {
17
+ return;
18
+ }
19
+ const dragElement = target.closest(".app-drag");
20
+ if (!dragElement) {
21
+ return;
22
+ }
23
+ const interactiveElement = target.closest(INTERACTIVE_SELECTORS);
24
+ if (interactiveElement && dragElement.contains(interactiveElement)) {
25
+ return;
26
+ }
27
+ event.preventDefault();
28
+ void appWindow.startDragging();
29
+ };
30
+ document.addEventListener("mousedown", handleMouseDown);
31
+ return () => {
32
+ document.removeEventListener("mousedown", handleMouseDown);
33
+ };
34
+ };
35
+ export {
36
+ window_default as default
37
+ };
38
+ //# sourceMappingURL=window-JDFVLF4U.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/window/window.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { getCurrentWindow } from '@tauri-apps/api/window';\nimport * as Effect from 'effect/Effect';\n\nimport { Capability, Common } from '@dxos/app-framework';\n\n/**\n * Window capability module.\n * Sets up window drag regions for Tauri windows.\n * Note: Window state persistence (size/position) is handled on the Rust side\n * in src-tauri/src/window_state.rs for instant restoration on startup.\n */\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const appWindow = getCurrentWindow();\n\n // Set up drag regions for window dragging.\n const cleanupDragRegions = setupWindowDrag(appWindow);\n\n return Capability.contributes(\n Common.Capability.Null,\n null,\n Effect.fnUntraced(function* () {\n cleanupDragRegions();\n }),\n );\n }),\n);\n\n/**\n * Interactive element selectors that should not trigger window dragging.\n */\nconst INTERACTIVE_SELECTORS = '.app-no-drag, button, a, input, select, textarea, [role=\"button\"], [role=\"menuitem\"]';\n\n/**\n * Sets up window drag regions.\n *\n * Tauri 2.0 does not support the `-webkit-app-region` CSS property with overlay titlebars.\n * This uses the Tauri window API to enable dragging on elements with the `app-drag` class.\n */\nconst setupWindowDrag = (appWindow: ReturnType<typeof getCurrentWindow>): (() => void) => {\n const handleMouseDown = (event: MouseEvent) => {\n const target = event.target as Element | null;\n if (!target) {\n return;\n }\n\n // Check if the click target or any ancestor has the app-drag class.\n const dragElement = target.closest('.app-drag');\n if (!dragElement) {\n return;\n }\n\n // Don't trigger drag on interactive elements within the drag region.\n const interactiveElement = target.closest(INTERACTIVE_SELECTORS);\n if (interactiveElement && dragElement.contains(interactiveElement)) {\n return;\n }\n\n event.preventDefault();\n void appWindow.startDragging();\n };\n\n document.addEventListener('mousedown', handleMouseDown);\n\n return () => {\n document.removeEventListener('mousedown', handleMouseDown);\n };\n};\n"],
5
+ "mappings": ";AAIA,SAASA,wBAAwB;AACjC,YAAYC,YAAY;AAExB,SAASC,YAAYC,cAAc;AAQnC,IAAA,iBAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAChB,QAAMC,YAAYC,iBAAAA;AAGlB,QAAMC,qBAAqBC,gBAAgBH,SAAAA;AAE3C,SAAOH,WAAWO,YAChBC,OAAOR,WAAWS,MAClB,MACOP,kBAAW,aAAA;AAChBG,uBAAAA;EACF,CAAA,CAAA;AAEJ,CAAA,CAAA;AAMF,IAAMK,wBAAwB;AAQ9B,IAAMJ,kBAAkB,CAACH,cAAAA;AACvB,QAAMQ,kBAAkB,CAACC,UAAAA;AACvB,UAAMC,SAASD,MAAMC;AACrB,QAAI,CAACA,QAAQ;AACX;IACF;AAGA,UAAMC,cAAcD,OAAOE,QAAQ,WAAA;AACnC,QAAI,CAACD,aAAa;AAChB;IACF;AAGA,UAAME,qBAAqBH,OAAOE,QAAQL,qBAAAA;AAC1C,QAAIM,sBAAsBF,YAAYG,SAASD,kBAAAA,GAAqB;AAClE;IACF;AAEAJ,UAAMM,eAAc;AACpB,SAAKf,UAAUgB,cAAa;EAC9B;AAEAC,WAASC,iBAAiB,aAAaV,eAAAA;AAEvC,SAAO,MAAA;AACLS,aAASE,oBAAoB,aAAaX,eAAAA;EAC5C;AACF;",
6
+ "names": ["getCurrentWindow", "Effect", "Capability", "Common", "Capability", "makeModule", "fnUntraced", "appWindow", "getCurrentWindow", "cleanupDragRegions", "setupWindowDrag", "contributes", "Common", "Null", "INTERACTIVE_SELECTORS", "handleMouseDown", "event", "target", "dragElement", "closest", "interactiveElement", "contains", "preventDefault", "startDragging", "document", "addEventListener", "removeEventListener"]
7
+ }
@@ -1,2 +1,3 @@
1
- export declare const NativePlugin: import("@dxos/app-framework").PluginFactory<void>;
1
+ import { Plugin } from '@dxos/app-framework';
2
+ export declare const NativePlugin: Plugin.PluginFactory<void>;
2
3
  //# sourceMappingURL=NativePlugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"NativePlugin.d.ts","sourceRoot":"","sources":["../../../src/NativePlugin.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,YAAY,mDAqBvB,CAAC"}
1
+ {"version":3,"file":"NativePlugin.d.ts","sourceRoot":"","sources":["../../../src/NativePlugin.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAU,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAOrD,eAAO,MAAM,YAAY,4BAkBxB,CAAC"}
@@ -1,4 +1,4 @@
1
- export declare const Ollama: (props?: import("@dxos/app-framework").PluginContext | undefined) => Promise<() => Promise<import("@dxos/app-framework").Capability<any> | import("@dxos/app-framework").AnyCapability[]>>;
2
- export declare const Updater: (props?: import("@dxos/app-framework").PluginContext | undefined) => Promise<() => Promise<import("@dxos/app-framework").Capability<import("@dxos/app-framework").InterfaceDef<null>> | import("@dxos/app-framework").AnyCapability[]>>;
3
- export declare const Window: (props?: import("@dxos/app-framework").PluginContext | undefined) => Promise<() => Promise<import("@dxos/app-framework").Capability<import("@dxos/app-framework").InterfaceDef<null>> | import("@dxos/app-framework").AnyCapability[]>>;
1
+ export * from './ollama';
2
+ export * from './updater';
3
+ export * from './window';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,MAAM,4LAAiC,CAAC;AACrD,eAAO,MAAM,OAAO,yOAAkC,CAAC;AACvD,eAAO,MAAM,MAAM,yOAAiC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Capability } from '@dxos/app-framework';
2
+ export declare const Ollama: Capability.LazyCapability<[], import("./ollama").OllamaCapabilities, Error>;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/ollama/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,eAAO,MAAM,MAAM,6EAAsD,CAAC"}
@@ -0,0 +1,6 @@
1
+ import * as Effect from 'effect/Effect';
2
+ import { Capability, Common } from '@dxos/app-framework';
3
+ export type OllamaCapabilities = Capability.Capability<typeof Common.Capability.AiModelResolver>;
4
+ declare const _default: (props?: [] | undefined) => Effect.Effect<OllamaCapabilities, Error, Capability.Service>;
5
+ export default _default;
6
+ //# sourceMappingURL=ollama.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ollama.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/ollama/ollama.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAMxC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAMzD,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,UAAU,CAAC,OAAO,MAAM,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;;AAEjG,wBAeE"}
@@ -0,0 +1,3 @@
1
+ import { Capability } from '@dxos/app-framework';
2
+ export declare const Updater: Capability.LazyCapability<void, Capability.Capability<Capability.InterfaceDef<null>> | undefined, Error>;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/updater/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,eAAO,MAAM,OAAO,0GAAwD,CAAC"}
@@ -0,0 +1,5 @@
1
+ import * as Effect from 'effect/Effect';
2
+ import { Capability } from '@dxos/app-framework';
3
+ declare const _default: (props?: void | undefined) => Effect.Effect<Capability.Capability<Capability.InterfaceDef<null>> | undefined, Error, Capability.Service>;
4
+ export default _default;
5
+ //# sourceMappingURL=updater.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updater.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/updater/updater.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAMxC,OAAO,EAAE,UAAU,EAAU,MAAM,qBAAqB,CAAC;;AAOzD,wBA4DE"}
@@ -0,0 +1,3 @@
1
+ import { Capability } from '@dxos/app-framework';
2
+ export declare const Window: Capability.LazyCapability<void, Capability.Capability<Capability.InterfaceDef<null>>, Error>;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/window/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,eAAO,MAAM,MAAM,8FAAsD,CAAC"}