@dxos/plugin-native 0.8.4-main.c85a9c8dae → 0.8.4-main.dfabb4ec29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/neutral/NativePlugin.mjs +28 -0
- package/dist/lib/neutral/NativePlugin.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +11 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/{browser/chunk-6374DBU4.mjs → neutral/chunk-254JXXJC.mjs} +6 -3
- package/dist/lib/{browser/chunk-6374DBU4.mjs.map → neutral/chunk-254JXXJC.mjs.map} +3 -3
- package/dist/lib/neutral/index.mjs +7 -0
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +7 -0
- package/dist/lib/neutral/meta.mjs.map +7 -0
- package/dist/lib/{browser/ollama-QOB3EVAJ.mjs → neutral/ollama-CYD5M6XB.mjs} +6 -21
- package/dist/lib/{browser/ollama-QOB3EVAJ.mjs.map → neutral/ollama-CYD5M6XB.mjs.map} +3 -3
- package/dist/lib/neutral/plugin.mjs +11 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/spotlight-listener-TRCJXLOQ.mjs +46 -0
- package/dist/lib/neutral/spotlight-listener-TRCJXLOQ.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +18 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/{browser/updater-AR27PYM4.mjs → neutral/updater-ZAJJC24D.mjs} +33 -82
- package/dist/lib/neutral/updater-ZAJJC24D.mjs.map +7 -0
- package/dist/types/src/NativePlugin.d.ts +1 -0
- package/dist/types/src/NativePlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +4 -3
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/ollama.d.ts.map +1 -0
- package/dist/types/src/capabilities/spotlight-listener.d.ts +8 -0
- package/dist/types/src/capabilities/spotlight-listener.d.ts.map +1 -0
- package/dist/types/src/capabilities/updater.d.ts.map +1 -0
- package/dist/types/src/constants.d.ts +2 -0
- package/dist/types/src/constants.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +0 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/plugin.d.ts +3 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +5 -6
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +49 -19
- package/src/NativePlugin.tsx +9 -7
- package/src/capabilities/index.ts +5 -3
- package/src/capabilities/spotlight-listener.ts +58 -0
- package/src/capabilities/{updater/updater.ts → updater.ts} +20 -11
- package/src/constants.ts +7 -0
- package/src/index.ts +0 -2
- package/src/meta.ts +2 -1
- package/src/plugin.ts +9 -0
- package/src/translations.ts +5 -5
- package/dist/lib/browser/index.mjs +0 -59
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/updater-AR27PYM4.mjs.map +0 -7
- package/dist/lib/browser/window-GKYYTCEI.mjs +0 -38
- package/dist/lib/browser/window-GKYYTCEI.mjs.map +0 -7
- package/dist/types/src/capabilities/ollama/index.d.ts +0 -3
- package/dist/types/src/capabilities/ollama/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/ollama/ollama.d.ts.map +0 -1
- package/dist/types/src/capabilities/updater/index.d.ts +0 -3
- package/dist/types/src/capabilities/updater/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/updater/updater.d.ts.map +0 -1
- package/dist/types/src/capabilities/window/index.d.ts +0 -3
- package/dist/types/src/capabilities/window/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/window/window.d.ts +0 -11
- package/dist/types/src/capabilities/window/window.d.ts.map +0 -1
- package/src/capabilities/ollama/index.ts +0 -7
- package/src/capabilities/updater/index.ts +0 -7
- package/src/capabilities/window/index.ts +0 -7
- package/src/capabilities/window/window.ts +0 -72
- /package/dist/types/src/capabilities/{ollama/ollama.d.ts → ollama.d.ts} +0 -0
- /package/dist/types/src/capabilities/{updater/updater.d.ts → updater.d.ts} +0 -0
- /package/src/capabilities/{ollama/ollama.ts → ollama.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-native",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.dfabb4ec29",
|
|
4
4
|
"description": "Composer plugin that runs when on a native device.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -12,17 +12,46 @@
|
|
|
12
12
|
"author": "DXOS.org",
|
|
13
13
|
"sideEffects": true,
|
|
14
14
|
"type": "module",
|
|
15
|
+
"imports": {
|
|
16
|
+
"#capabilities": {
|
|
17
|
+
"source": "./src/capabilities/index.ts",
|
|
18
|
+
"types": "./dist/types/src/capabilities/index.d.ts",
|
|
19
|
+
"default": "./dist/lib/neutral/capabilities/index.mjs"
|
|
20
|
+
},
|
|
21
|
+
"#meta": {
|
|
22
|
+
"source": "./src/meta.ts",
|
|
23
|
+
"types": "./dist/types/src/meta.d.ts",
|
|
24
|
+
"default": "./dist/lib/neutral/meta.mjs"
|
|
25
|
+
},
|
|
26
|
+
"#plugin": {
|
|
27
|
+
"source": "./src/NativePlugin.tsx",
|
|
28
|
+
"types": "./dist/types/src/NativePlugin.d.ts",
|
|
29
|
+
"default": "./dist/lib/neutral/NativePlugin.mjs"
|
|
30
|
+
},
|
|
31
|
+
"#translations": {
|
|
32
|
+
"source": "./src/translations.ts",
|
|
33
|
+
"types": "./dist/types/src/translations.d.ts",
|
|
34
|
+
"default": "./dist/lib/neutral/translations.mjs"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
15
37
|
"exports": {
|
|
16
38
|
".": {
|
|
17
39
|
"source": "./src/index.ts",
|
|
18
40
|
"types": "./dist/types/src/index.d.ts",
|
|
19
|
-
"
|
|
41
|
+
"default": "./dist/lib/neutral/index.mjs"
|
|
42
|
+
},
|
|
43
|
+
"./plugin": {
|
|
44
|
+
"source": "./src/plugin.ts",
|
|
45
|
+
"types": "./dist/types/src/plugin.d.ts",
|
|
46
|
+
"default": "./dist/lib/neutral/plugin.mjs"
|
|
47
|
+
},
|
|
48
|
+
"./translations": {
|
|
49
|
+
"source": "./src/translations.ts",
|
|
50
|
+
"types": "./dist/types/src/translations.d.ts",
|
|
51
|
+
"default": "./dist/lib/neutral/translations.mjs"
|
|
20
52
|
}
|
|
21
53
|
},
|
|
22
54
|
"types": "dist/types/src/index.d.ts",
|
|
23
|
-
"typesVersions": {
|
|
24
|
-
"*": {}
|
|
25
|
-
},
|
|
26
55
|
"files": [
|
|
27
56
|
"dist",
|
|
28
57
|
"src"
|
|
@@ -34,24 +63,25 @@
|
|
|
34
63
|
"@tauri-apps/plugin-process": "^2.3.0",
|
|
35
64
|
"@tauri-apps/plugin-shell": "^2.3.1",
|
|
36
65
|
"@tauri-apps/plugin-updater": "^2.9.0",
|
|
37
|
-
"effect": "3.
|
|
38
|
-
"@dxos/
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/app-
|
|
41
|
-
"@dxos/log": "0.8.4-main.
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/plugin-
|
|
45
|
-
"@dxos/util": "0.8.4-main.
|
|
46
|
-
"@dxos/plugin-
|
|
66
|
+
"effect": "3.20.0",
|
|
67
|
+
"@dxos/app-framework": "0.8.4-main.dfabb4ec29",
|
|
68
|
+
"@dxos/ai": "0.8.4-main.dfabb4ec29",
|
|
69
|
+
"@dxos/app-toolkit": "0.8.4-main.dfabb4ec29",
|
|
70
|
+
"@dxos/log": "0.8.4-main.dfabb4ec29",
|
|
71
|
+
"@dxos/operation": "0.8.4-main.dfabb4ec29",
|
|
72
|
+
"@dxos/plugin-assistant": "0.8.4-main.dfabb4ec29",
|
|
73
|
+
"@dxos/plugin-navtree": "0.8.4-main.dfabb4ec29",
|
|
74
|
+
"@dxos/util": "0.8.4-main.dfabb4ec29",
|
|
75
|
+
"@dxos/plugin-help": "0.8.4-main.dfabb4ec29"
|
|
47
76
|
},
|
|
48
77
|
"devDependencies": {
|
|
49
|
-
"vite": "^
|
|
50
|
-
"@dxos/
|
|
78
|
+
"vite": "^8.0.10",
|
|
79
|
+
"@dxos/plugin-testing": "0.8.4-main.dfabb4ec29",
|
|
80
|
+
"@dxos/react-ui": "0.8.4-main.dfabb4ec29"
|
|
51
81
|
},
|
|
52
82
|
"peerDependencies": {
|
|
53
|
-
"effect": "3.
|
|
54
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
83
|
+
"effect": "3.20.0",
|
|
84
|
+
"@dxos/react-ui": "0.8.4-main.dfabb4ec29"
|
|
55
85
|
},
|
|
56
86
|
"publishConfig": {
|
|
57
87
|
"access": "public"
|
package/src/NativePlugin.tsx
CHANGED
|
@@ -6,21 +6,21 @@ import { ActivationEvents, Plugin } from '@dxos/app-framework';
|
|
|
6
6
|
import { AppPlugin } from '@dxos/app-toolkit';
|
|
7
7
|
import { AssistantEvents } from '@dxos/plugin-assistant';
|
|
8
8
|
|
|
9
|
-
import { Ollama,
|
|
10
|
-
import { meta } from '
|
|
11
|
-
import { translations } from '
|
|
9
|
+
import { Ollama, SpotlightListener, Updater } from '#capabilities';
|
|
10
|
+
import { meta } from '#meta';
|
|
11
|
+
import { translations } from '#translations';
|
|
12
12
|
|
|
13
13
|
export const NativePlugin = Plugin.define(meta).pipe(
|
|
14
14
|
AppPlugin.addTranslationsModule({ translations }),
|
|
15
15
|
Plugin.addModule({
|
|
16
|
-
id: '
|
|
16
|
+
id: 'spotlight-listener',
|
|
17
17
|
activatesOn: ActivationEvents.OperationInvokerReady,
|
|
18
|
-
activate:
|
|
18
|
+
activate: SpotlightListener,
|
|
19
19
|
}),
|
|
20
20
|
Plugin.addModule({
|
|
21
|
-
id: '
|
|
21
|
+
id: 'updater',
|
|
22
22
|
activatesOn: ActivationEvents.OperationInvokerReady,
|
|
23
|
-
activate:
|
|
23
|
+
activate: Updater,
|
|
24
24
|
}),
|
|
25
25
|
Plugin.addModule({
|
|
26
26
|
id: 'ollama',
|
|
@@ -29,3 +29,5 @@ export const NativePlugin = Plugin.define(meta).pipe(
|
|
|
29
29
|
}),
|
|
30
30
|
Plugin.make,
|
|
31
31
|
);
|
|
32
|
+
|
|
33
|
+
export default NativePlugin;
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export
|
|
5
|
+
import { Capability } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
export const Ollama = Capability.lazy('Ollama', () => import('./ollama'));
|
|
8
|
+
export const SpotlightListener = Capability.lazy('SpotlightListener', () => import('./spotlight-listener'));
|
|
9
|
+
export const Updater = Capability.lazy('Updater', () => import('./updater'));
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
9
|
+
import { log } from '@dxos/log';
|
|
10
|
+
|
|
11
|
+
// TODO(wittjosiah): Formalize with a stricter schema if we evolve this protocol.
|
|
12
|
+
type SpotlightInvokePayload = {
|
|
13
|
+
operation: string;
|
|
14
|
+
payload?: Record<string, any>;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Listens for spotlight:invoke events from the popover window and dispatches the corresponding operation.
|
|
19
|
+
*/
|
|
20
|
+
export default Capability.makeModule(
|
|
21
|
+
Effect.fnUntraced(function* () {
|
|
22
|
+
const { invokePromise } = yield* Capability.get(Capabilities.OperationInvoker);
|
|
23
|
+
|
|
24
|
+
const unlisten = yield* Effect.promise(async () => {
|
|
25
|
+
const { listen } = await import('@tauri-apps/api/event');
|
|
26
|
+
const { getCurrentWindow } = await import('@tauri-apps/api/window');
|
|
27
|
+
|
|
28
|
+
return listen<SpotlightInvokePayload>('spotlight:invoke', async (event) => {
|
|
29
|
+
const { operation, payload } = event.payload;
|
|
30
|
+
log.info('Received spotlight invoke event', { operation, payload });
|
|
31
|
+
try {
|
|
32
|
+
switch (operation) {
|
|
33
|
+
case 'open':
|
|
34
|
+
await invokePromise(LayoutOperation.Open, payload as any);
|
|
35
|
+
break;
|
|
36
|
+
case 'switch-workspace':
|
|
37
|
+
await invokePromise(LayoutOperation.SwitchWorkspace, payload as any);
|
|
38
|
+
break;
|
|
39
|
+
default:
|
|
40
|
+
log.warn('Unknown spotlight operation', { operation });
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const mainWindow = getCurrentWindow();
|
|
44
|
+
await mainWindow.show();
|
|
45
|
+
await mainWindow.setFocus();
|
|
46
|
+
} catch (err) {
|
|
47
|
+
log.catch(err);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
return Capability.contributes(Capabilities.Null, null, () =>
|
|
53
|
+
Effect.sync(() => {
|
|
54
|
+
unlisten();
|
|
55
|
+
}),
|
|
56
|
+
);
|
|
57
|
+
}),
|
|
58
|
+
);
|
|
@@ -15,7 +15,9 @@ import { Capabilities, Capability } from '@dxos/app-framework';
|
|
|
15
15
|
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
16
16
|
import { log } from '@dxos/log';
|
|
17
17
|
|
|
18
|
-
import { meta } from '
|
|
18
|
+
import { meta } from '#meta';
|
|
19
|
+
|
|
20
|
+
import { TAURI_LOCALHOST_PORT } from '../constants';
|
|
19
21
|
|
|
20
22
|
const SUPPORTS_OTA = ['linux', 'macos', 'windows'];
|
|
21
23
|
|
|
@@ -51,20 +53,22 @@ export default Capability.makeModule(
|
|
|
51
53
|
Effect.fnUntraced(function* () {
|
|
52
54
|
// Skip updates if not supported or in dev mode.
|
|
53
55
|
const platform = type();
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
const isDevServer = window.location.port !== TAURI_LOCALHOST_PORT;
|
|
57
|
+
if (!SUPPORTS_OTA.includes(platform) || isDevServer) {
|
|
58
|
+
log.info('skipping updater', { platform, port: window.location.port });
|
|
56
59
|
return;
|
|
57
60
|
}
|
|
58
61
|
|
|
59
62
|
const { invoke } = yield* Capability.get(Capabilities.OperationInvoker);
|
|
60
63
|
|
|
61
64
|
// https://tauri.app/plugin/updater/#checking-for-updates
|
|
65
|
+
// Returns true to keep checking, false to stop.
|
|
62
66
|
const action = Effect.gen(function* () {
|
|
63
67
|
log.info('checking for updates');
|
|
64
68
|
const update = yield* Effect.promise(() => check());
|
|
65
69
|
if (!update) {
|
|
66
70
|
log.info('no update available');
|
|
67
|
-
return;
|
|
71
|
+
return true;
|
|
68
72
|
}
|
|
69
73
|
log.info('update check complete', {
|
|
70
74
|
available: update.available,
|
|
@@ -97,20 +101,25 @@ export default Capability.makeModule(
|
|
|
97
101
|
|
|
98
102
|
if (downloadSuccess) {
|
|
99
103
|
yield* invoke(LayoutOperation.AddToast, {
|
|
100
|
-
id: `${meta.id}
|
|
101
|
-
title: ['update
|
|
102
|
-
description: ['update
|
|
104
|
+
id: `${meta.id}.update-ready`,
|
|
105
|
+
title: ['update-ready.label', { ns: meta.id }],
|
|
106
|
+
description: ['update-ready.description', { ns: meta.id }],
|
|
103
107
|
duration: Infinity,
|
|
104
|
-
actionLabel: ['update
|
|
105
|
-
actionAlt: ['update
|
|
108
|
+
actionLabel: ['update.label', { ns: meta.id }],
|
|
109
|
+
actionAlt: ['update.alt', { ns: meta.id }],
|
|
106
110
|
onAction: () => relaunch(),
|
|
107
111
|
});
|
|
112
|
+
return false;
|
|
108
113
|
}
|
|
109
114
|
}
|
|
115
|
+
return true;
|
|
110
116
|
});
|
|
111
117
|
|
|
112
|
-
// Run immediately on startup, then repeat every hour.
|
|
113
|
-
const
|
|
118
|
+
// Run immediately on startup, then repeat every hour. Stop once an update is found.
|
|
119
|
+
const schedule = Schedule.fixed(Duration.hours(1)).pipe(
|
|
120
|
+
Schedule.whileInput((keepChecking: boolean) => keepChecking),
|
|
121
|
+
);
|
|
122
|
+
const fiber = yield* action.pipe(Effect.repeat(schedule), Effect.forkDaemon);
|
|
114
123
|
log.info('updater module initialized, update check scheduled');
|
|
115
124
|
|
|
116
125
|
return Capability.contributes(Capabilities.Null, null, () =>
|
package/src/constants.ts
ADDED
package/src/index.ts
CHANGED
package/src/meta.ts
CHANGED
|
@@ -6,10 +6,11 @@ import { type Plugin } from '@dxos/app-framework';
|
|
|
6
6
|
import { trim } from '@dxos/util';
|
|
7
7
|
|
|
8
8
|
export const meta: Plugin.Meta = {
|
|
9
|
-
id: 'dxos.
|
|
9
|
+
id: 'org.dxos.plugin.native',
|
|
10
10
|
name: 'Native',
|
|
11
11
|
description: trim`
|
|
12
12
|
Native platform integration providing desktop-specific features and system-level capabilities.
|
|
13
13
|
Access native file dialogs, notifications, and OS integrations.
|
|
14
14
|
`,
|
|
15
|
+
tags: ['system'],
|
|
15
16
|
};
|
package/src/plugin.ts
ADDED
package/src/translations.ts
CHANGED
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
import { type Resource } from '@dxos/react-ui';
|
|
6
6
|
|
|
7
|
-
import { meta } from '
|
|
7
|
+
import { meta } from '#meta';
|
|
8
8
|
|
|
9
9
|
export const translations = [
|
|
10
10
|
{
|
|
11
11
|
'en-US': {
|
|
12
12
|
[meta.id]: {
|
|
13
|
-
'update
|
|
14
|
-
'update
|
|
15
|
-
'update
|
|
16
|
-
'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
17
|
},
|
|
18
18
|
},
|
|
19
19
|
},
|
|
@@ -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,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": "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",
|
|
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 +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 +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 +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 +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"}
|