@dxos/plugin-native 0.8.4-main.c85a9c8dae → 0.8.4-main.d9fc60f731

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 (121) hide show
  1. package/LICENSE +102 -5
  2. package/PLUGIN.mdl +284 -0
  3. package/README.md +1 -1
  4. package/dist/lib/neutral/NativePlugin.mjs +46 -0
  5. package/dist/lib/neutral/NativePlugin.mjs.map +7 -0
  6. package/dist/lib/neutral/NativeSettings-CLYG5TJH.mjs +113 -0
  7. package/dist/lib/neutral/NativeSettings-CLYG5TJH.mjs.map +7 -0
  8. package/dist/lib/neutral/capabilities/index.mjs +17 -0
  9. package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
  10. package/dist/lib/neutral/chunk-75E24KAJ.mjs +34 -0
  11. package/dist/lib/neutral/chunk-75E24KAJ.mjs.map +7 -0
  12. package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
  13. package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +7 -0
  14. package/dist/lib/neutral/components/index.mjs +9 -0
  15. package/dist/lib/neutral/components/index.mjs.map +7 -0
  16. package/dist/lib/neutral/index.mjs +8 -0
  17. package/dist/lib/neutral/index.mjs.map +7 -0
  18. package/dist/lib/neutral/meta.json +1 -0
  19. package/dist/lib/neutral/meta.mjs +8 -0
  20. package/dist/lib/neutral/meta.mjs.map +7 -0
  21. package/dist/lib/{browser/ollama-QOB3EVAJ.mjs → neutral/ollama-BHWFTROM.mjs} +8 -21
  22. package/dist/lib/{browser/ollama-QOB3EVAJ.mjs.map → neutral/ollama-BHWFTROM.mjs.map} +3 -3
  23. package/dist/lib/neutral/plugin.mjs +12 -0
  24. package/dist/lib/neutral/plugin.mjs.map +7 -0
  25. package/dist/lib/neutral/react-surface-ETNGHN4X.mjs +27 -0
  26. package/dist/lib/neutral/react-surface-ETNGHN4X.mjs.map +7 -0
  27. package/dist/lib/neutral/settings-HF6TQNU4.mjs +28 -0
  28. package/dist/lib/neutral/settings-HF6TQNU4.mjs.map +7 -0
  29. package/dist/lib/neutral/spotlight-listener-K7S6LGL3.mjs +48 -0
  30. package/dist/lib/neutral/spotlight-listener-K7S6LGL3.mjs.map +7 -0
  31. package/dist/lib/neutral/translations.mjs +35 -0
  32. package/dist/lib/neutral/translations.mjs.map +7 -0
  33. package/dist/lib/neutral/types/index.mjs +31 -0
  34. package/dist/lib/neutral/types/index.mjs.map +7 -0
  35. package/dist/lib/neutral/updater-JEBXWSSK.mjs +244 -0
  36. package/dist/lib/neutral/updater-JEBXWSSK.mjs.map +7 -0
  37. package/dist/types/src/NativePlugin.d.ts +1 -0
  38. package/dist/types/src/NativePlugin.d.ts.map +1 -1
  39. package/dist/types/src/capabilities/index.d.ts +6 -3
  40. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  41. package/dist/types/src/capabilities/ollama.d.ts.map +1 -0
  42. package/dist/types/src/capabilities/react-surface.d.ts +5 -0
  43. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  44. package/dist/types/src/capabilities/settings.d.ts +7 -0
  45. package/dist/types/src/capabilities/settings.d.ts.map +1 -0
  46. package/dist/types/src/capabilities/spotlight-listener.d.ts +8 -0
  47. package/dist/types/src/capabilities/spotlight-listener.d.ts.map +1 -0
  48. package/dist/types/src/capabilities/updater.d.ts +6 -0
  49. package/dist/types/src/capabilities/updater.d.ts.map +1 -0
  50. package/dist/types/src/components/NativeSettings/NativeSettings.d.ts +6 -0
  51. package/dist/types/src/components/NativeSettings/NativeSettings.d.ts.map +1 -0
  52. package/dist/types/src/components/NativeSettings/index.d.ts +2 -0
  53. package/dist/types/src/components/NativeSettings/index.d.ts.map +1 -0
  54. package/dist/types/src/components/index.d.ts +3 -0
  55. package/dist/types/src/components/index.d.ts.map +1 -0
  56. package/dist/types/src/constants.d.ts +2 -0
  57. package/dist/types/src/constants.d.ts.map +1 -0
  58. package/dist/types/src/index.d.ts +0 -2
  59. package/dist/types/src/index.d.ts.map +1 -1
  60. package/dist/types/src/meta.d.ts +1 -1
  61. package/dist/types/src/meta.d.ts.map +1 -1
  62. package/dist/types/src/plugin.d.ts +3 -0
  63. package/dist/types/src/plugin.d.ts.map +1 -0
  64. package/dist/types/src/translations.d.ts +20 -6
  65. package/dist/types/src/translations.d.ts.map +1 -1
  66. package/dist/types/src/types/NativeCapabilities.d.ts +5 -0
  67. package/dist/types/src/types/NativeCapabilities.d.ts.map +1 -0
  68. package/dist/types/src/types/Settings.d.ts +5 -0
  69. package/dist/types/src/types/Settings.d.ts.map +1 -0
  70. package/dist/types/src/types/Update.d.ts +30 -0
  71. package/dist/types/src/types/Update.d.ts.map +1 -0
  72. package/dist/types/src/types/index.d.ts +4 -0
  73. package/dist/types/src/types/index.d.ts.map +1 -0
  74. package/dist/types/tsconfig.tsbuildinfo +1 -1
  75. package/package.json +75 -27
  76. package/src/NativePlugin.tsx +19 -9
  77. package/src/capabilities/index.ts +7 -3
  78. package/src/capabilities/react-surface.tsx +29 -0
  79. package/src/capabilities/settings.ts +31 -0
  80. package/src/capabilities/spotlight-listener.ts +58 -0
  81. package/src/capabilities/updater.ts +194 -0
  82. package/src/components/NativeSettings/NativeSettings.tsx +132 -0
  83. package/src/components/NativeSettings/index.ts +5 -0
  84. package/src/components/index.ts +7 -0
  85. package/src/constants.ts +7 -0
  86. package/src/index.ts +0 -2
  87. package/src/meta.ts +24 -7
  88. package/src/plugin.ts +9 -0
  89. package/src/translations.ts +20 -5
  90. package/src/types/NativeCapabilities.ts +16 -0
  91. package/src/types/Settings.ts +11 -0
  92. package/src/types/Update.ts +24 -0
  93. package/src/types/index.ts +7 -0
  94. package/src/vite-env.d.ts +10 -0
  95. package/dist/lib/browser/chunk-6374DBU4.mjs +0 -15
  96. package/dist/lib/browser/chunk-6374DBU4.mjs.map +0 -7
  97. package/dist/lib/browser/index.mjs +0 -59
  98. package/dist/lib/browser/index.mjs.map +0 -7
  99. package/dist/lib/browser/meta.json +0 -1
  100. package/dist/lib/browser/updater-AR27PYM4.mjs +0 -190
  101. package/dist/lib/browser/updater-AR27PYM4.mjs.map +0 -7
  102. package/dist/lib/browser/window-GKYYTCEI.mjs +0 -38
  103. package/dist/lib/browser/window-GKYYTCEI.mjs.map +0 -7
  104. package/dist/types/src/capabilities/ollama/index.d.ts +0 -3
  105. package/dist/types/src/capabilities/ollama/index.d.ts.map +0 -1
  106. package/dist/types/src/capabilities/ollama/ollama.d.ts.map +0 -1
  107. package/dist/types/src/capabilities/updater/index.d.ts +0 -3
  108. package/dist/types/src/capabilities/updater/index.d.ts.map +0 -1
  109. package/dist/types/src/capabilities/updater/updater.d.ts +0 -5
  110. package/dist/types/src/capabilities/updater/updater.d.ts.map +0 -1
  111. package/dist/types/src/capabilities/window/index.d.ts +0 -3
  112. package/dist/types/src/capabilities/window/index.d.ts.map +0 -1
  113. package/dist/types/src/capabilities/window/window.d.ts +0 -11
  114. package/dist/types/src/capabilities/window/window.d.ts.map +0 -1
  115. package/src/capabilities/ollama/index.ts +0 -7
  116. package/src/capabilities/updater/index.ts +0 -7
  117. package/src/capabilities/updater/updater.ts +0 -120
  118. package/src/capabilities/window/index.ts +0 -7
  119. package/src/capabilities/window/window.ts +0 -72
  120. /package/dist/types/src/capabilities/{ollama/ollama.d.ts → ollama.d.ts} +0 -0
  121. /package/src/capabilities/{ollama/ollama.ts → ollama.ts} +0 -0
package/src/meta.ts CHANGED
@@ -2,14 +2,31 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { type Plugin } from '@dxos/app-framework';
5
+ import { Plugin } from '@dxos/app-framework';
6
+ import { DXN } from '@dxos/keys';
6
7
  import { trim } from '@dxos/util';
7
8
 
8
- export const meta: Plugin.Meta = {
9
- id: 'dxos.org/plugin/native',
10
- name: 'Native',
9
+ // TODO(wittjosiah): Rename plugin (package + id) from `native` to `app` to match the user-facing name.
10
+ export const meta = Plugin.makeMeta({
11
+ key: DXN.make('org.dxos.plugin.native'),
12
+ name: 'App',
13
+ author: 'DXOS',
14
+ spec: 'PLUGIN.mdl',
11
15
  description: trim`
12
- Native platform integration providing desktop-specific features and system-level capabilities.
13
- Access native file dialogs, notifications, and OS integrations.
16
+ Tauri-based native platform integration for DXOS Composer on macOS, Linux, and Windows.
17
+
18
+ Provides Spotlight window integration that forwards spotlight:invoke Tauri events to
19
+ Composer operations, letting the OS-level launcher open spaces and switch workspaces
20
+ without the main window being focused first.
21
+
22
+ Manages over-the-air application updates via the Tauri updater plugin, automatically
23
+ checking for new releases in the background, streaming download progress, and surfacing
24
+ a toast notification with a one-click Relaunch action when an update is ready.
25
+
26
+ Spawns an Ollama sidecar process on localhost for local AI model inference, registering
27
+ it as an AiModelResolver so Assistant features can resolve model requests without any
28
+ external server dependency.
14
29
  `,
15
- };
30
+ icon: 'ph--app-window--regular',
31
+ tags: ['system'],
32
+ });
package/src/plugin.ts ADDED
@@ -0,0 +1,9 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import { Plugin } from '@dxos/app-framework';
6
+
7
+ import { meta } from './meta';
8
+
9
+ export const NativePlugin = Plugin.lazy(meta, () => import('#plugin'));
@@ -4,16 +4,31 @@
4
4
 
5
5
  import { type Resource } from '@dxos/react-ui';
6
6
 
7
- import { meta } from './meta';
7
+ import { meta } from '#meta';
8
8
 
9
9
  export const translations = [
10
10
  {
11
11
  'en-US': {
12
12
  [meta.id]: {
13
- 'update ready label': 'Ready to update',
14
- 'update ready description': 'A new version of Composer is available.',
15
- 'update label': 'Update',
16
- 'update alt': 'Relaunch the app to update',
13
+ 'update-ready.label': 'Ready to update',
14
+ 'update-ready.description': 'A new version of Composer is available.',
15
+ 'update.label': 'Update',
16
+ 'update.alt': 'Relaunch the app to update',
17
+ 'settings.title': 'App',
18
+ 'settings.updates.label': 'Updates',
19
+ 'settings.updates.check.label': 'Check for updates',
20
+ 'settings.updates.checking.label': 'Checking…',
21
+ 'settings.updates.update-now.label': 'Update now',
22
+ 'settings.updates.downloading.label': 'Downloading…',
23
+ 'settings.updates.relaunch.label': 'Restart to install',
24
+ 'settings.updates.idle.message': 'Check now for a newer version of Composer.',
25
+ 'settings.updates.checking.message': 'Checking for updates…',
26
+ 'settings.updates.up-to-date.message': 'You are running the latest version of Composer. Checked {{checkedAt}}.',
27
+ 'settings.updates.available.message': 'Version {{version}} is available.',
28
+ 'settings.updates.downloading.message': 'Downloading… {{percent}}%',
29
+ 'settings.updates.ready.message': 'Update ready. Restart Composer to apply.',
30
+ 'settings.updates.failed.message': 'Update failed: {{error}}',
31
+ 'settings.updates.unsupported.message': 'Updates are not available on this platform.',
17
32
  },
18
33
  },
19
34
  },
@@ -0,0 +1,16 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ // @import-as-namespace
6
+
7
+ import type { Atom } from '@effect-atom/atom-react';
8
+
9
+ import { Capability } from '@dxos/app-framework';
10
+
11
+ import { meta } from '#meta';
12
+
13
+ // Inline imports to avoid `Settings` / `Update` namespace aliases colliding with the
14
+ // capability constants exported below.
15
+ export const Settings = Capability.make<Atom.Writable<import('./Settings').Settings>>(`${meta.id}.capability.settings`);
16
+ export const UpdateManager = Capability.make<import('./Update').Manager>(`${meta.id}.capability.update-manager`);
@@ -0,0 +1,11 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ // @import-as-namespace
6
+
7
+ import * as Schema from 'effect/Schema';
8
+
9
+ export const Settings = Schema.mutable(Schema.Struct({}));
10
+
11
+ export interface Settings extends Schema.Schema.Type<typeof Settings> {}
@@ -0,0 +1,24 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { type Atom } from '@effect-atom/atom-react';
6
+
7
+ // @import-as-namespace
8
+
9
+ export type Status =
10
+ | { kind: 'unsupported' }
11
+ | { kind: 'idle' }
12
+ | { kind: 'checking' }
13
+ | { kind: 'up-to-date'; checkedAt: number }
14
+ | { kind: 'available'; version: string }
15
+ | { kind: 'downloading'; downloaded: number; contentLength: number }
16
+ | { kind: 'ready' }
17
+ | { kind: 'failed'; error: string };
18
+
19
+ export type Manager = {
20
+ status: Atom.Writable<Status>;
21
+ check: () => Promise<void>;
22
+ install: () => Promise<void>;
23
+ relaunch: () => Promise<void>;
24
+ };
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export * as NativeCapabilities from './NativeCapabilities';
6
+ export * as Settings from './Settings';
7
+ export * as Update from './Update';
@@ -0,0 +1,10 @@
1
+ /// <reference types="vite/client" />
2
+
3
+ //
4
+ // Copyright 2026 DXOS.org
5
+ //
6
+
7
+ declare module '*.mdl?raw' {
8
+ const content: string;
9
+ export default content;
10
+ }
@@ -1,15 +0,0 @@
1
- // src/meta.ts
2
- import { trim } from "@dxos/util";
3
- var meta = {
4
- id: "dxos.org/plugin/native",
5
- name: "Native",
6
- description: trim`
7
- Native platform integration providing desktop-specific features and system-level capabilities.
8
- Access native file dialogs, notifications, and OS integrations.
9
- `
10
- };
11
-
12
- export {
13
- meta
14
- };
15
- //# sourceMappingURL=chunk-6374DBU4.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/meta.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type 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,59 +0,0 @@
1
- import {
2
- meta
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-QOB3EVAJ.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-AR27PYM4.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-GKYYTCEI.mjs"));
16
-
17
- // src/NativePlugin.tsx
18
- import { ActivationEvents, Plugin } from "@dxos/app-framework";
19
- import { AppPlugin } from "@dxos/app-toolkit";
20
- import { AssistantEvents } from "@dxos/plugin-assistant";
21
-
22
- // src/translations.ts
23
- var translations = [
24
- {
25
- "en-US": {
26
- [meta.id]: {
27
- "update ready label": "Ready to update",
28
- "update ready description": "A new version of Composer is available.",
29
- "update label": "Update",
30
- "update alt": "Relaunch the app to update"
31
- }
32
- }
33
- }
34
- ];
35
-
36
- // src/NativePlugin.tsx
37
- var NativePlugin = Plugin.define(meta).pipe(AppPlugin.addTranslationsModule({
38
- translations
39
- }), Plugin.addModule({
40
- id: "updater",
41
- activatesOn: ActivationEvents.OperationInvokerReady,
42
- activate: Updater
43
- }), Plugin.addModule({
44
- id: "window",
45
- activatesOn: ActivationEvents.OperationInvokerReady,
46
- activate: Window
47
- }), Plugin.addModule({
48
- id: "ollama",
49
- activatesOn: AssistantEvents.SetupAiServiceProviders,
50
- activate: Ollama
51
- }), Plugin.make);
52
- export {
53
- NativePlugin,
54
- Ollama,
55
- Updater,
56
- Window,
57
- meta
58
- };
59
- //# sourceMappingURL=index.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
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 { ActivationEvents, Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\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 AppPlugin.addTranslationsModule({ translations }),\n Plugin.addModule({\n id: 'updater',\n activatesOn: ActivationEvents.OperationInvokerReady,\n activate: Updater,\n }),\n Plugin.addModule({\n id: 'window',\n activatesOn: ActivationEvents.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,kBAAkBC,cAAc;AACzC,SAASC,iBAAiB;AAC1B,SAASC,uBAAuB;;;ACEzB,IAAMC,eAAe;EAC1B;IACE,SAAS;MACP,CAACC,KAAKC,EAAE,GAAG;QACT,sBAAsB;QACtB,4BAA4B;QAC5B,gBAAgB;QAChB,cAAc;MAChB;IACF;EACF;;;;ADNK,IAAMC,eAAeC,OAAOC,OAAOC,IAAAA,EAAMC,KAC9CC,UAAUC,sBAAsB;EAAEC;AAAa,CAAA,GAC/CN,OAAOO,UAAU;EACfC,IAAI;EACJC,aAAaC,iBAAiBC;EAC9BC,UAAUC;AACZ,CAAA,GACAb,OAAOO,UAAU;EACfC,IAAI;EACJC,aAAaC,iBAAiBC;EAC9BC,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", "ActivationEvents", "Plugin", "AppPlugin", "AssistantEvents", "translations", "meta", "id", "NativePlugin", "Plugin", "define", "meta", "pipe", "AppPlugin", "addTranslationsModule", "translations", "addModule", "id", "activatesOn", "ActivationEvents", "OperationInvokerReady", "activate", "Updater", "Window", "AssistantEvents", "SetupAiServiceProviders", "Ollama", "make"]
7
- }
@@ -1 +0,0 @@
1
- {"inputs":{"src/capabilities/ollama/ollama.ts":{"bytes":10906,"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/app-toolkit","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":16552,"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/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":"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":6830,"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":3376,"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":"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":3415},"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-QOB3EVAJ.mjs","kind":"dynamic-import"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/browser/updater-AR27PYM4.mjs","kind":"dynamic-import"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/browser/window-GKYYTCEI.mjs","kind":"dynamic-import"},{"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}],"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":622},"src/translations.ts":{"bytesInOutput":293}},"bytes":1671},"dist/lib/browser/ollama-QOB3EVAJ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5474},"dist/lib/browser/ollama-QOB3EVAJ.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/app-toolkit","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":2668}},"bytes":2790},"dist/lib/browser/updater-AR27PYM4.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":7410},"dist/lib/browser/updater-AR27PYM4.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/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}],"exports":["default"],"entryPoint":"src/capabilities/updater/updater.ts","inputs":{"src/capabilities/updater/updater.ts":{"bytesInOutput":4868}},"bytes":5042},"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-GKYYTCEI.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3464},"dist/lib/browser/window-GKYYTCEI.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":1215}},"bytes":1337}}}
@@ -1,190 +0,0 @@
1
- import {
2
- meta
3
- } from "./chunk-6374DBU4.mjs";
4
-
5
- // src/capabilities/updater/updater.ts
6
- import { type } from "@tauri-apps/plugin-os";
7
- import { relaunch } from "@tauri-apps/plugin-process";
8
- import * as Updater from "@tauri-apps/plugin-updater";
9
- import * as Duration from "effect/Duration";
10
- import * as Effect from "effect/Effect";
11
- import * as Fiber from "effect/Fiber";
12
- import * as Match from "effect/Match";
13
- import * as Schedule from "effect/Schedule";
14
- import { Capabilities, Capability } from "@dxos/app-framework";
15
- import { LayoutOperation } from "@dxos/app-toolkit";
16
- import { log } from "@dxos/log";
17
- var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-native/src/capabilities/updater/updater.ts";
18
- var SUPPORTS_OTA = [
19
- "linux",
20
- "macos",
21
- "windows"
22
- ];
23
- var check2 = async () => {
24
- try {
25
- return await Updater.check();
26
- } catch (error) {
27
- log.error("failed to check for updates", {
28
- error
29
- }, {
30
- F: __dxlog_file,
31
- L: 29,
32
- S: void 0,
33
- C: (f, a) => f(...a)
34
- });
35
- return null;
36
- }
37
- };
38
- var downloadAndInstall = async (update, handleDownload) => {
39
- try {
40
- await update.downloadAndInstall(handleDownload);
41
- return true;
42
- } catch (error) {
43
- log.error("failed to download and install update", {
44
- error
45
- }, {
46
- F: __dxlog_file,
47
- L: 45,
48
- S: void 0,
49
- C: (f, a) => f(...a)
50
- });
51
- return false;
52
- }
53
- };
54
- var updater_default = Capability.makeModule(Effect.fnUntraced(function* () {
55
- const platform = type();
56
- if (!SUPPORTS_OTA.includes(platform) || window.location.hostname === "localhost") {
57
- log.info("skipping updater", {
58
- platform,
59
- hostname: window.location.hostname
60
- }, {
61
- F: __dxlog_file,
62
- L: 55,
63
- S: this,
64
- C: (f, a) => f(...a)
65
- });
66
- return;
67
- }
68
- const { invoke } = yield* Capability.get(Capabilities.OperationInvoker);
69
- const action = Effect.gen(function* () {
70
- log.info("checking for updates", void 0, {
71
- F: __dxlog_file,
72
- L: 63,
73
- S: this,
74
- C: (f, a) => f(...a)
75
- });
76
- const update = yield* Effect.promise(() => check2());
77
- if (!update) {
78
- log.info("no update available", void 0, {
79
- F: __dxlog_file,
80
- L: 66,
81
- S: this,
82
- C: (f, a) => f(...a)
83
- });
84
- return;
85
- }
86
- log.info("update check complete", {
87
- available: update.available,
88
- currentVersion: update.currentVersion,
89
- version: update.version,
90
- date: update.date,
91
- body: update.body
92
- }, {
93
- F: __dxlog_file,
94
- L: 69,
95
- S: this,
96
- C: (f, a) => f(...a)
97
- });
98
- if (update.available) {
99
- log.info("update available, starting download", {
100
- version: update.version
101
- }, {
102
- F: __dxlog_file,
103
- L: 77,
104
- S: this,
105
- C: (f, a) => f(...a)
106
- });
107
- let downloaded = 0;
108
- let contentLength = 0;
109
- const handleDownload = Match.type().pipe(Match.when({
110
- event: "Started"
111
- }, (event) => {
112
- contentLength = event.data.contentLength ?? 0;
113
- log.info("download started", {
114
- contentLength
115
- }, {
116
- F: __dxlog_file,
117
- L: 84,
118
- S: this,
119
- C: (f, a) => f(...a)
120
- });
121
- }), Match.when({
122
- event: "Progress"
123
- }, (event) => {
124
- downloaded += event.data.chunkLength;
125
- log.verbose("download progress", {
126
- downloaded,
127
- contentLength
128
- }, {
129
- F: __dxlog_file,
130
- L: 88,
131
- S: this,
132
- C: (f, a) => f(...a)
133
- });
134
- }), Match.when({
135
- event: "Finished"
136
- }, () => {
137
- log.info("download completed", void 0, {
138
- F: __dxlog_file,
139
- L: 91,
140
- S: this,
141
- C: (f, a) => f(...a)
142
- });
143
- }), Match.exhaustive);
144
- const downloadSuccess = yield* Effect.promise(() => downloadAndInstall(update, handleDownload));
145
- if (downloadSuccess) {
146
- yield* invoke(LayoutOperation.AddToast, {
147
- id: `${meta.id}/update-ready`,
148
- title: [
149
- "update ready label",
150
- {
151
- ns: meta.id
152
- }
153
- ],
154
- description: [
155
- "update ready description",
156
- {
157
- ns: meta.id
158
- }
159
- ],
160
- duration: Infinity,
161
- actionLabel: [
162
- "update label",
163
- {
164
- ns: meta.id
165
- }
166
- ],
167
- actionAlt: [
168
- "update alt",
169
- {
170
- ns: meta.id
171
- }
172
- ],
173
- onAction: () => relaunch()
174
- });
175
- }
176
- }
177
- });
178
- const fiber = yield* action.pipe(Effect.repeat(Schedule.fixed(Duration.hours(1))), Effect.forkDaemon);
179
- log.info("updater module initialized, update check scheduled", void 0, {
180
- F: __dxlog_file,
181
- L: 114,
182
- S: this,
183
- C: (f, a) => f(...a)
184
- });
185
- return Capability.contributes(Capabilities.Null, null, () => Effect.sync(() => Effect.runSync(Fiber.interrupt(fiber))));
186
- }));
187
- export {
188
- updater_default as default
189
- };
190
- //# sourceMappingURL=updater-AR27PYM4.mjs.map
@@ -1,7 +0,0 @@
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 * as Updater 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 Match from 'effect/Match';\nimport * as Schedule from 'effect/Schedule';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { LayoutOperation } from '@dxos/app-toolkit';\nimport { log } from '@dxos/log';\n\nimport { meta } from '../../meta';\n\nconst SUPPORTS_OTA = ['linux', 'macos', 'windows'];\n\n/**\n * Safely check for updates with error logging.\n */\nconst check = async (): Promise<Updater.Update | null> => {\n try {\n return await Updater.check();\n } catch (error) {\n log.error('failed to check for updates', { error });\n return null;\n }\n};\n\n/**\n * Safely download and install update with error logging.\n */\nconst downloadAndInstall = async (\n update: Updater.Update,\n handleDownload: (event: Updater.DownloadEvent) => void,\n): Promise<boolean> => {\n try {\n await update.downloadAndInstall(handleDownload);\n return true;\n } catch (error) {\n log.error('failed to download and install update', { error });\n return false;\n }\n};\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 log.info('skipping updater', { platform, hostname: window.location.hostname });\n return;\n }\n\n const { invoke } = yield* Capability.get(Capabilities.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.promise(() => check());\n if (!update) {\n log.info('no update available');\n return;\n }\n log.info('update check complete', {\n available: update.available,\n currentVersion: update.currentVersion,\n version: update.version,\n date: update.date,\n body: update.body,\n });\n if (update.available) {\n log.info('update available, starting download', { version: update.version });\n let downloaded = 0;\n let contentLength = 0;\n\n const handleDownload = Match.type<Updater.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 const downloadSuccess = yield* Effect.promise(() => downloadAndInstall(update, handleDownload));\n\n if (downloadSuccess) {\n yield* invoke(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\n // Run immediately on startup, then repeat every hour.\n const fiber = yield* action.pipe(Effect.repeat(Schedule.fixed(Duration.hours(1))), Effect.forkDaemon);\n log.info('updater module initialized, update check scheduled');\n\n return Capability.contributes(Capabilities.Null, null, () =>\n Effect.sync(() => Effect.runSync(Fiber.interrupt(fiber))),\n );\n }),\n);\n"],
5
- "mappings": ";;;;;AAIA,SAASA,YAAY;AACrB,SAASC,gBAAgB;AACzB,YAAYC,aAAa;AACzB,YAAYC,cAAc;AAC1B,YAAYC,YAAY;AACxB,YAAYC,WAAW;AACvB,YAAYC,WAAW;AACvB,YAAYC,cAAc;AAE1B,SAASC,cAAcC,kBAAkB;AACzC,SAASC,uBAAuB;AAChC,SAASC,WAAW;;AAIpB,IAAMC,eAAe;EAAC;EAAS;EAAS;;AAKxC,IAAMC,SAAQ,YAAA;AACZ,MAAI;AACF,WAAO,MAAcA,cAAK;EAC5B,SAASC,OAAO;AACdC,QAAID,MAAM,+BAA+B;MAAEA;IAAM,GAAA;;;;;;AACjD,WAAO;EACT;AACF;AAKA,IAAME,qBAAqB,OACzBC,QACAC,mBAAAA;AAEA,MAAI;AACF,UAAMD,OAAOD,mBAAmBE,cAAAA;AAChC,WAAO;EACT,SAASJ,OAAO;AACdC,QAAID,MAAM,yCAAyC;MAAEA;IAAM,GAAA;;;;;;AAC3D,WAAO;EACT;AACF;AAEA,IAAA,kBAAeK,WAAWC,WACjBC,kBAAW,aAAA;AAEhB,QAAMC,WAAWC,KAAAA;AACjB,MAAI,CAACX,aAAaY,SAASF,QAAAA,KAAaG,OAAOC,SAASC,aAAa,aAAa;AAChFZ,QAAIa,KAAK,oBAAoB;MAAEN;MAAUK,UAAUF,OAAOC,SAASC;IAAS,GAAA;;;;;;AAC5E;EACF;AAEA,QAAM,EAAEE,OAAM,IAAK,OAAOV,WAAWW,IAAIC,aAAaC,gBAAgB;AAGtE,QAAMC,SAAgBC,WAAI,aAAA;AACxBnB,QAAIa,KAAK,wBAAA,QAAA;;;;;;AACT,UAAMX,SAAS,OAAckB,eAAQ,MAAMtB,OAAAA,CAAAA;AAC3C,QAAI,CAACI,QAAQ;AACXF,UAAIa,KAAK,uBAAA,QAAA;;;;;;AACT;IACF;AACAb,QAAIa,KAAK,yBAAyB;MAChCQ,WAAWnB,OAAOmB;MAClBC,gBAAgBpB,OAAOoB;MACvBC,SAASrB,OAAOqB;MAChBC,MAAMtB,OAAOsB;MACbC,MAAMvB,OAAOuB;IACf,GAAA;;;;;;AACA,QAAIvB,OAAOmB,WAAW;AACpBrB,UAAIa,KAAK,uCAAuC;QAAEU,SAASrB,OAAOqB;MAAQ,GAAA;;;;;;AAC1E,UAAIG,aAAa;AACjB,UAAIC,gBAAgB;AAEpB,YAAMxB,iBAAuBK,WAAI,EAA0BoB,KACnDC,WAAK;QAAEC,OAAO;MAAU,GAAG,CAACA,UAAAA;AAChCH,wBAAgBG,MAAMC,KAAKJ,iBAAiB;AAC5C3B,YAAIa,KAAK,oBAAoB;UAAEc;QAAc,GAAA;;;;;;MAC/C,CAAA,GACME,WAAK;QAAEC,OAAO;MAAW,GAAG,CAACA,UAAAA;AACjCJ,sBAAcI,MAAMC,KAAKC;AACzBhC,YAAIiC,QAAQ,qBAAqB;UAAEP;UAAYC;QAAc,GAAA;;;;;;MAC/D,CAAA,GACME,WAAK;QAAEC,OAAO;MAAW,GAAG,MAAA;AAChC9B,YAAIa,KAAK,sBAAA,QAAA;;;;;;MACX,CAAA,GACMqB,gBAAU;AAGlB,YAAMC,kBAAkB,OAAcf,eAAQ,MAAMnB,mBAAmBC,QAAQC,cAAAA,CAAAA;AAE/E,UAAIgC,iBAAiB;AACnB,eAAOrB,OAAOsB,gBAAgBC,UAAU;UACtCC,IAAI,GAAGC,KAAKD,EAAE;UACdE,OAAO;YAAC;YAAsB;cAAEC,IAAIF,KAAKD;YAAG;;UAC5CI,aAAa;YAAC;YAA4B;cAAED,IAAIF,KAAKD;YAAG;;UACxDK,UAAUC;UACVC,aAAa;YAAC;YAAgB;cAAEJ,IAAIF,KAAKD;YAAG;;UAC5CQ,WAAW;YAAC;YAAc;cAAEL,IAAIF,KAAKD;YAAG;;UACxCS,UAAU,MAAMC,SAAAA;QAClB,CAAA;MACF;IACF;EACF,CAAA;AAGA,QAAMC,QAAQ,OAAO/B,OAAOU,KAAYsB,cAAgBC,eAAeC,eAAM,CAAA,CAAA,CAAA,GAAaC,iBAAU;AACpGrD,MAAIa,KAAK,sDAAA,QAAA;;;;;;AAET,SAAOT,WAAWkD,YAAYtC,aAAauC,MAAM,MAAM,MAC9CC,YAAK,MAAaC,eAAcC,gBAAUT,KAAAA,CAAAA,CAAAA,CAAAA;AAErD,CAAA,CAAA;",
6
- "names": ["type", "relaunch", "Updater", "Duration", "Effect", "Fiber", "Match", "Schedule", "Capabilities", "Capability", "LayoutOperation", "log", "SUPPORTS_OTA", "check", "error", "log", "downloadAndInstall", "update", "handleDownload", "Capability", "makeModule", "fnUntraced", "platform", "type", "includes", "window", "location", "hostname", "info", "invoke", "get", "Capabilities", "OperationInvoker", "action", "gen", "promise", "available", "currentVersion", "version", "date", "body", "downloaded", "contentLength", "pipe", "when", "event", "data", "chunkLength", "verbose", "exhaustive", "downloadSuccess", "LayoutOperation", "AddToast", "id", "meta", "title", "ns", "description", "duration", "Infinity", "actionLabel", "actionAlt", "onAction", "relaunch", "fiber", "repeat", "fixed", "hours", "forkDaemon", "contributes", "Null", "sync", "runSync", "interrupt"]
7
- }
@@ -1,38 +0,0 @@
1
- // src/capabilities/window/window.ts
2
- import { getCurrentWindow } from "@tauri-apps/api/window";
3
- import * as Effect from "effect/Effect";
4
- import { Capabilities, Capability } 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(Capabilities.Null, null, Effect.fnUntraced(function* () {
9
- cleanupDragRegions();
10
- }));
11
- }));
12
- var INTERACTIVE_SELECTORS = '.dx-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(".dx-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-GKYYTCEI.mjs.map
@@ -1,7 +0,0 @@
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 { Capabilities, Capability } 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 Capabilities.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 = '.dx-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 `dx-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 dx-app-drag class.\n const dragElement = target.closest('.dx-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,cAAcC,kBAAkB;AAQzC,IAAA,iBAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAChB,QAAMC,YAAYC,iBAAAA;AAGlB,QAAMC,qBAAqBC,gBAAgBH,SAAAA;AAE3C,SAAOH,WAAWO,YAChBC,aAAaC,MACb,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,cAAA;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", "Capabilities", "Capability", "Capability", "makeModule", "fnUntraced", "appWindow", "getCurrentWindow", "cleanupDragRegions", "setupWindowDrag", "contributes", "Capabilities", "Null", "INTERACTIVE_SELECTORS", "handleMouseDown", "event", "target", "dragElement", "closest", "interactiveElement", "contains", "preventDefault", "startDragging", "document", "addEventListener", "removeEventListener"]
7
- }
@@ -1,3 +0,0 @@
1
- import { Capability } from '@dxos/app-framework';
2
- export declare const Ollama: Capability.LazyCapability<[], import("./ollama").OllamaCapabilities, Error>;
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
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"}
@@ -1 +0,0 @@
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,qBAAqB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAMpD,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,UAAU,CAAC,OAAO,eAAe,CAAC,eAAe,CAAC,CAAC;;AAE/F,wBAeE"}
@@ -1,3 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,5 +0,0 @@
1
- import * as Effect from 'effect/Effect';
2
- import { Capability } from '@dxos/app-framework';
3
- declare const _default: (props: void) => Effect.Effect<Capability.Capability<Capability.InterfaceDef<null>> | undefined, Error, Capability.Service>;
4
- export default _default;
5
- //# sourceMappingURL=updater.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"updater.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/updater/updater.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAKxC,OAAO,EAAgB,UAAU,EAAE,MAAM,qBAAqB,CAAC;;AAoC/D,wBAsEE"}
@@ -1,3 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,11 +0,0 @@
1
- import * as Effect from 'effect/Effect';
2
- import { Capability } from '@dxos/app-framework';
3
- /**
4
- * Window capability module.
5
- * Sets up window drag regions for Tauri windows.
6
- * Note: Window state persistence (size/position) is handled on the Rust side
7
- * in src-tauri/src/window_state.rs for instant restoration on startup.
8
- */
9
- declare const _default: (props: void) => Effect.Effect<Capability.Capability<Capability.InterfaceDef<null>>, never, never>;
10
- export default _default;
11
- //# sourceMappingURL=window.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"window.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/window/window.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAgB,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAE/D;;;;;GAKG;;AACH,wBAeE"}
@@ -1,7 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { Capability } from '@dxos/app-framework';
6
-
7
- export const Ollama = Capability.lazy('Ollama', () => import('./ollama'));