@dxos/plugin-native 0.8.4-main.70d3990 → 0.8.4-main.765dc60934
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/LICENSE +102 -5
- package/README.md +1 -1
- 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-SP3MEGKI.mjs → neutral/chunk-254JXXJC.mjs} +6 -3
- package/dist/lib/neutral/chunk-254JXXJC.mjs.map +7 -0
- 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-CQE7ZIWL.mjs → neutral/ollama-CYD5M6XB.mjs} +12 -28
- package/dist/lib/neutral/ollama-CYD5M6XB.mjs.map +7 -0
- 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/neutral/updater-ZAJJC24D.mjs +141 -0
- package/dist/lib/neutral/updater-ZAJJC24D.mjs.map +7 -0
- package/dist/types/src/NativePlugin.d.ts +3 -1
- 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 +5 -2
- package/dist/types/src/capabilities/ollama.d.ts.map +1 -1
- 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 +3 -2
- package/dist/types/src/capabilities/updater.d.ts.map +1 -1
- 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 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- 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 +59 -24
- package/src/NativePlugin.tsx +20 -20
- package/src/capabilities/index.ts +4 -4
- package/src/capabilities/ollama.ts +26 -20
- package/src/capabilities/spotlight-listener.ts +58 -0
- package/src/capabilities/updater.ts +102 -58
- package/src/constants.ts +7 -0
- package/src/index.ts +0 -1
- package/src/meta.ts +4 -3
- package/src/plugin.ts +9 -0
- package/src/translations.ts +5 -5
- package/dist/lib/browser/chunk-SP3MEGKI.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -56
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/ollama-CQE7ZIWL.mjs.map +0 -7
- package/dist/lib/browser/updater-SDBPTCXA.mjs +0 -138
- package/dist/lib/browser/updater-SDBPTCXA.mjs.map +0 -7
- package/dist/lib/browser/window-6G542FZL.mjs +0 -34
- package/dist/lib/browser/window-6G542FZL.mjs.map +0 -7
- package/dist/types/src/capabilities/window.d.ts +0 -4
- package/dist/types/src/capabilities/window.d.ts.map +0 -1
- package/src/capabilities/window.ts +0 -49
package/LICENSE
CHANGED
|
@@ -1,8 +1,105 @@
|
|
|
1
|
-
|
|
2
|
-
Copyright (c) 2022 DXOS
|
|
1
|
+
# Functional Source License, Version 1.1, ALv2 Future License
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
## Abbreviation
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
FSL-1.1-Apache-2.0
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
## Notice
|
|
8
|
+
|
|
9
|
+
Copyright 2026 DXOS
|
|
10
|
+
|
|
11
|
+
## Terms and Conditions
|
|
12
|
+
|
|
13
|
+
### Licensor ("We")
|
|
14
|
+
|
|
15
|
+
The party offering the Software under these Terms and Conditions.
|
|
16
|
+
|
|
17
|
+
### The Software
|
|
18
|
+
|
|
19
|
+
The "Software" is each version of the software that we make available under
|
|
20
|
+
these Terms and Conditions, as indicated by our inclusion of these Terms and
|
|
21
|
+
Conditions with the Software.
|
|
22
|
+
|
|
23
|
+
### License Grant
|
|
24
|
+
|
|
25
|
+
Subject to your compliance with this License Grant and the Patents,
|
|
26
|
+
Redistribution and Trademark clauses below, we hereby grant you the right to
|
|
27
|
+
use, copy, modify, create derivative works, publicly perform, publicly display
|
|
28
|
+
and redistribute the Software for any Permitted Purpose identified below.
|
|
29
|
+
|
|
30
|
+
### Permitted Purpose
|
|
31
|
+
|
|
32
|
+
A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
|
|
33
|
+
means making the Software available to others in a commercial product or
|
|
34
|
+
service that:
|
|
35
|
+
|
|
36
|
+
1. substitutes for the Software;
|
|
37
|
+
|
|
38
|
+
2. substitutes for any other product or service we offer using the Software
|
|
39
|
+
that exists as of the date we make the Software available; or
|
|
40
|
+
|
|
41
|
+
3. offers the same or substantially similar functionality as the Software.
|
|
42
|
+
|
|
43
|
+
Permitted Purposes specifically include using the Software:
|
|
44
|
+
|
|
45
|
+
1. for your internal use and access;
|
|
46
|
+
|
|
47
|
+
2. for non-commercial education;
|
|
48
|
+
|
|
49
|
+
3. for non-commercial research; and
|
|
50
|
+
|
|
51
|
+
4. in connection with professional services that you provide to a licensee
|
|
52
|
+
using the Software in accordance with these Terms and Conditions.
|
|
53
|
+
|
|
54
|
+
### Patents
|
|
55
|
+
|
|
56
|
+
To the extent your use for a Permitted Purpose would necessarily infringe our
|
|
57
|
+
patents, the license grant above includes a license under our patents. If you
|
|
58
|
+
make a claim against any party that the Software infringes or contributes to
|
|
59
|
+
the infringement of any patent, then your patent license to the Software ends
|
|
60
|
+
immediately.
|
|
61
|
+
|
|
62
|
+
### Redistribution
|
|
63
|
+
|
|
64
|
+
The Terms and Conditions apply to all copies, modifications and derivatives of
|
|
65
|
+
the Software.
|
|
66
|
+
|
|
67
|
+
If you redistribute any copies, modifications or derivatives of the Software,
|
|
68
|
+
you must include a copy of or a link to these Terms and Conditions and not
|
|
69
|
+
remove any copyright notices provided in or with the Software.
|
|
70
|
+
|
|
71
|
+
### Disclaimer
|
|
72
|
+
|
|
73
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
|
|
74
|
+
IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
|
|
75
|
+
PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
|
|
76
|
+
|
|
77
|
+
IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
|
|
78
|
+
SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
|
|
79
|
+
EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
|
|
80
|
+
|
|
81
|
+
### Trademarks
|
|
82
|
+
|
|
83
|
+
Except for displaying the License Details and identifying us as the origin of
|
|
84
|
+
the Software, you have no right under these Terms and Conditions to use our
|
|
85
|
+
trademarks, trade names, service marks or product names.
|
|
86
|
+
|
|
87
|
+
## Grant of Future License
|
|
88
|
+
|
|
89
|
+
We hereby irrevocably grant you an additional license to use the Software under
|
|
90
|
+
the Apache License, Version 2.0 that is effective on the second anniversary of
|
|
91
|
+
the date we make the Software available. On or after that date, you may use the
|
|
92
|
+
Software under the Apache License, Version 2.0, in which case the following
|
|
93
|
+
will apply:
|
|
94
|
+
|
|
95
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
96
|
+
this file except in compliance with the License.
|
|
97
|
+
|
|
98
|
+
You may obtain a copy of the License at
|
|
99
|
+
|
|
100
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
101
|
+
|
|
102
|
+
Unless required by applicable law or agreed to in writing, software distributed
|
|
103
|
+
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
104
|
+
CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
105
|
+
specific language governing permissions and limitations under the License.
|
package/README.md
CHANGED
|
@@ -12,4 +12,4 @@ Composer plugin that runs when being used by the Socket Supply Co. runtime on a
|
|
|
12
12
|
|
|
13
13
|
Your ideas, issues, and code are most welcome. Please take a look at our [community code of conduct](https://github.com/dxos/dxos/blob/main/CODE_OF_CONDUCT.md), the [issue guide](https://github.com/dxos/dxos/blob/main/CONTRIBUTING.md#submitting-issues), and the [PR contribution guide](https://github.com/dxos/dxos/blob/main/CONTRIBUTING.md#submitting-prs).
|
|
14
14
|
|
|
15
|
-
License: [
|
|
15
|
+
License: [FSL-1.1-Apache-2.0](./LICENSE) Copyright 2023 © DXOS
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// src/NativePlugin.tsx
|
|
2
|
+
import { ActivationEvents, Plugin } from "@dxos/app-framework";
|
|
3
|
+
import { AppPlugin } from "@dxos/app-toolkit";
|
|
4
|
+
import { AssistantEvents } from "@dxos/plugin-assistant";
|
|
5
|
+
import { Ollama, SpotlightListener, Updater } from "#capabilities";
|
|
6
|
+
import { meta } from "#meta";
|
|
7
|
+
import { translations } from "#translations";
|
|
8
|
+
var NativePlugin = Plugin.define(meta).pipe(AppPlugin.addTranslationsModule({
|
|
9
|
+
translations
|
|
10
|
+
}), Plugin.addModule({
|
|
11
|
+
id: "spotlight-listener",
|
|
12
|
+
activatesOn: ActivationEvents.OperationInvokerReady,
|
|
13
|
+
activate: SpotlightListener
|
|
14
|
+
}), Plugin.addModule({
|
|
15
|
+
id: "updater",
|
|
16
|
+
activatesOn: ActivationEvents.OperationInvokerReady,
|
|
17
|
+
activate: Updater
|
|
18
|
+
}), Plugin.addModule({
|
|
19
|
+
id: "ollama",
|
|
20
|
+
activatesOn: AssistantEvents.SetupAiServiceProviders,
|
|
21
|
+
activate: Ollama
|
|
22
|
+
}), Plugin.make);
|
|
23
|
+
var NativePlugin_default = NativePlugin;
|
|
24
|
+
export {
|
|
25
|
+
NativePlugin,
|
|
26
|
+
NativePlugin_default as default
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=NativePlugin.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/NativePlugin.tsx"],
|
|
4
|
+
"sourcesContent": ["//\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, SpotlightListener, Updater } 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: 'spotlight-listener',\n activatesOn: ActivationEvents.OperationInvokerReady,\n activate: SpotlightListener,\n }),\n Plugin.addModule({\n id: 'updater',\n activatesOn: ActivationEvents.OperationInvokerReady,\n activate: Updater,\n }),\n Plugin.addModule({\n id: 'ollama',\n activatesOn: AssistantEvents.SetupAiServiceProviders,\n activate: Ollama,\n }),\n Plugin.make,\n);\n\nexport default NativePlugin;\n"],
|
|
5
|
+
"mappings": ";AAIA,SAASA,kBAAkBC,cAAc;AACzC,SAASC,iBAAiB;AAC1B,SAASC,uBAAuB;AAEhC,SAASC,QAAQC,mBAAmBC,eAAe;AACnD,SAASC,YAAY;AACrB,SAASC,oBAAoB;AAEtB,IAAMC,eAAeR,OAAOS,OAAOH,IAAAA,EAAMI,KAC9CT,UAAUU,sBAAsB;EAAEJ;AAAa,CAAA,GAC/CP,OAAOY,UAAU;EACfC,IAAI;EACJC,aAAaf,iBAAiBgB;EAC9BC,UAAUZ;AACZ,CAAA,GACAJ,OAAOY,UAAU;EACfC,IAAI;EACJC,aAAaf,iBAAiBgB;EAC9BC,UAAUX;AACZ,CAAA,GACAL,OAAOY,UAAU;EACfC,IAAI;EACJC,aAAaZ,gBAAgBe;EAC7BD,UAAUb;AACZ,CAAA,GACAH,OAAOkB,IAAI;AAGb,IAAA,uBAAeV;",
|
|
6
|
+
"names": ["ActivationEvents", "Plugin", "AppPlugin", "AssistantEvents", "Ollama", "SpotlightListener", "Updater", "meta", "translations", "NativePlugin", "define", "pipe", "addTranslationsModule", "addModule", "id", "activatesOn", "OperationInvokerReady", "activate", "SetupAiServiceProviders", "make"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// src/capabilities/index.ts
|
|
2
|
+
import { Capability } from "@dxos/app-framework";
|
|
3
|
+
var Ollama = Capability.lazy("Ollama", () => import("../ollama-CYD5M6XB.mjs"));
|
|
4
|
+
var SpotlightListener = Capability.lazy("SpotlightListener", () => import("../spotlight-listener-TRCJXLOQ.mjs"));
|
|
5
|
+
var Updater = Capability.lazy("Updater", () => import("../updater-ZAJJC24D.mjs"));
|
|
6
|
+
export {
|
|
7
|
+
Ollama,
|
|
8
|
+
SpotlightListener,
|
|
9
|
+
Updater
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/capabilities/index.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'));\nexport const SpotlightListener = Capability.lazy('SpotlightListener', () => import('./spotlight-listener'));\nexport const Updater = Capability.lazy('Updater', () => import('./updater'));\n"],
|
|
5
|
+
"mappings": ";AAIA,SAASA,kBAAkB;AAEpB,IAAMC,SAASD,WAAWE,KAAK,UAAU,MAAM,OAAO,wBAAA,CAAA;AACtD,IAAMC,oBAAoBH,WAAWE,KAAK,qBAAqB,MAAM,OAAO,oCAAA,CAAA;AAC5E,IAAME,UAAUJ,WAAWE,KAAK,WAAW,MAAM,OAAO,yBAAA,CAAA;",
|
|
6
|
+
"names": ["Capability", "Ollama", "lazy", "SpotlightListener", "Updater"]
|
|
7
|
+
}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
// src/meta.ts
|
|
2
2
|
import { trim } from "@dxos/util";
|
|
3
3
|
var meta = {
|
|
4
|
-
id: "dxos.
|
|
4
|
+
id: "org.dxos.plugin.native",
|
|
5
5
|
name: "Native",
|
|
6
6
|
description: trim`
|
|
7
7
|
Native platform integration providing desktop-specific features and system-level capabilities.
|
|
8
8
|
Access native file dialogs, notifications, and OS integrations.
|
|
9
|
-
|
|
9
|
+
`,
|
|
10
|
+
tags: [
|
|
11
|
+
"system"
|
|
12
|
+
]
|
|
10
13
|
};
|
|
11
14
|
|
|
12
15
|
export {
|
|
13
16
|
meta
|
|
14
17
|
};
|
|
15
|
-
//# sourceMappingURL=chunk-
|
|
18
|
+
//# sourceMappingURL=chunk-254JXXJC.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: 'org.dxos.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 tags: ['system'],\n};\n"],
|
|
5
|
+
"mappings": ";AAKA,SAASA,YAAY;AAEd,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,aAAaJ;;;;EAIbK,MAAM;IAAC;;AACT;",
|
|
6
|
+
"names": ["trim", "meta", "id", "name", "description", "tags"]
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"inputs":{"src/meta.ts":{"bytes":1412,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":368,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"src/NativePlugin.tsx":{"bytes":3467,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/plugin-assistant","kind":"import-statement","external":true},{"path":"#capabilities","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#translations","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/ollama.ts":{"bytes":10648,"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/spotlight-listener.ts":{"bytes":6502,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@tauri-apps/api/event","kind":"dynamic-import","external":true},{"path":"@tauri-apps/api/window","kind":"dynamic-import","external":true}],"format":"esm"},"src/constants.ts":{"bytes":807,"imports":[],"format":"esm"},"src/capabilities/updater.ts":{"bytes":16713,"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":"#meta","kind":"import-statement","external":true},{"path":"src/constants.ts","kind":"import-statement","original":"../constants"}],"format":"esm"},"src/capabilities/index.ts":{"bytes":1398,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/ollama.ts","kind":"dynamic-import","original":"./ollama"},{"path":"src/capabilities/spotlight-listener.ts","kind":"dynamic-import","original":"./spotlight-listener"},{"path":"src/capabilities/updater.ts","kind":"dynamic-import","original":"./updater"}],"format":"esm"},"src/plugin.ts":{"bytes":855,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"#plugin","kind":"dynamic-import","external":true}],"format":"esm"},"src/translations.ts":{"bytes":1532,"imports":[{"path":"#meta","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/lib/neutral/updater-ZAJJC24D.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":8008},"dist/lib/neutral/updater-ZAJJC24D.mjs":{"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":"#meta","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/updater.ts","inputs":{"src/capabilities/updater.ts":{"bytesInOutput":4697},"src/constants.ts":{"bytesInOutput":36}},"bytes":4904},"dist/lib/neutral/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-254JXXJC.mjs","kind":"import-statement"}],"exports":["meta"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0}},"bytes":101},"dist/lib/neutral/NativePlugin.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1811},"dist/lib/neutral/NativePlugin.mjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/plugin-assistant","kind":"import-statement","external":true},{"path":"#capabilities","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#translations","kind":"import-statement","external":true}],"exports":["NativePlugin","default"],"entryPoint":"src/NativePlugin.tsx","inputs":{"src/NativePlugin.tsx":{"bytesInOutput":830}},"bytes":958},"dist/lib/neutral/capabilities/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":740},"dist/lib/neutral/capabilities/index.mjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/neutral/ollama-CYD5M6XB.mjs","kind":"dynamic-import"},{"path":"dist/lib/neutral/spotlight-listener-TRCJXLOQ.mjs","kind":"dynamic-import"},{"path":"dist/lib/neutral/updater-ZAJJC24D.mjs","kind":"dynamic-import"}],"exports":["Ollama","SpotlightListener","Updater"],"entryPoint":"src/capabilities/index.ts","inputs":{"src/capabilities/index.ts":{"bytesInOutput":327}},"bytes":444},"dist/lib/neutral/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/meta.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-254JXXJC.mjs","kind":"import-statement"}],"exports":["meta"],"entryPoint":"src/meta.ts","inputs":{},"bytes":100},"dist/lib/neutral/plugin.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":439},"dist/lib/neutral/plugin.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-254JXXJC.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"#plugin","kind":"dynamic-import","external":true}],"exports":["NativePlugin"],"entryPoint":"src/plugin.ts","inputs":{"src/plugin.ts":{"bytesInOutput":109}},"bytes":237},"dist/lib/neutral/chunk-254JXXJC.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":700},"dist/lib/neutral/chunk-254JXXJC.mjs":{"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["meta"],"inputs":{"src/meta.ts":{"bytesInOutput":321}},"bytes":400},"dist/lib/neutral/translations.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":765},"dist/lib/neutral/translations.mjs":{"imports":[{"path":"#meta","kind":"import-statement","external":true}],"exports":["translations"],"entryPoint":"src/translations.ts","inputs":{"src/translations.ts":{"bytesInOutput":323}},"bytes":415},"dist/lib/neutral/ollama-CYD5M6XB.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5091},"dist/lib/neutral/ollama-CYD5M6XB.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.ts","inputs":{"src/capabilities/ollama.ts":{"bytesInOutput":2583}},"bytes":2698},"dist/lib/neutral/spotlight-listener-TRCJXLOQ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3116},"dist/lib/neutral/spotlight-listener-TRCJXLOQ.mjs":{"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@tauri-apps/api/event","kind":"dynamic-import","external":true},{"path":"@tauri-apps/api/window","kind":"dynamic-import","external":true}],"exports":["default"],"entryPoint":"src/capabilities/spotlight-listener.ts","inputs":{"src/capabilities/spotlight-listener.ts":{"bytesInOutput":1750}},"bytes":1901}}}
|
|
@@ -6,18 +6,17 @@ 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
|
|
10
|
-
import {
|
|
9
|
+
import { OllamaResolver } from "@dxos/ai/resolvers";
|
|
10
|
+
import { Capability } from "@dxos/app-framework";
|
|
11
|
+
import { AppCapabilities } from "@dxos/app-toolkit";
|
|
11
12
|
import { log } from "@dxos/log";
|
|
12
13
|
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-native/src/capabilities/ollama.ts";
|
|
13
14
|
var OLLAMA_HOST = "http://localhost:21434";
|
|
14
|
-
var ollama_default = ((
|
|
15
|
+
var ollama_default = Capability.makeModule(() => Effect.sync(() => {
|
|
15
16
|
const runtime = ManagedRuntime.make(OllamaSidecar.layerLive);
|
|
16
17
|
const sidecarLayer = Layer.effectContext(runtime.runtimeEffect.pipe(Effect.map((rt) => rt.context.pipe(Context.pick(OllamaSidecar)))));
|
|
17
|
-
return contributes(
|
|
18
|
-
|
|
19
|
-
});
|
|
20
|
-
});
|
|
18
|
+
return Capability.contributes(AppCapabilities.AiModelResolver, OllamaSidecarModelResolver.pipe(Layer.provide(sidecarLayer)), () => Effect.tryPromise(() => runtime.dispose()));
|
|
19
|
+
}));
|
|
21
20
|
var OllamaSidecar = class _OllamaSidecar extends Context.Tag("@dxos/plugin-native/OllamaSidecar")() {
|
|
22
21
|
static layerLive = Layer.scoped(_OllamaSidecar, Effect.gen(function* () {
|
|
23
22
|
const command = Command.sidecar("sidecar/ollama", [
|
|
@@ -32,32 +31,17 @@ var OllamaSidecar = class _OllamaSidecar extends Context.Tag("@dxos/plugin-nativ
|
|
|
32
31
|
command.stderr.on("data", (data) => console.error("[ollama]", data.toString()));
|
|
33
32
|
command.on("close", (code) => log.info("Ollama process exited", {
|
|
34
33
|
code
|
|
35
|
-
}, {
|
|
36
|
-
F: __dxlog_file,
|
|
37
|
-
L: 56,
|
|
38
|
-
S: this,
|
|
39
|
-
C: (f, a) => f(...a)
|
|
40
|
-
}));
|
|
34
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 38, S: this }));
|
|
41
35
|
command.on("error", (error) => log.error("Ollama error", {
|
|
42
36
|
error
|
|
43
|
-
}, {
|
|
44
|
-
F: __dxlog_file,
|
|
45
|
-
L: 57,
|
|
46
|
-
S: this,
|
|
47
|
-
C: (f, a) => f(...a)
|
|
48
|
-
}));
|
|
37
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 41, S: this }));
|
|
49
38
|
const child = yield* Effect.promise(() => command.spawn());
|
|
50
39
|
yield* Effect.addFinalizer(Effect.fn(function* () {
|
|
51
40
|
yield* Effect.promise(() => child.kill());
|
|
52
41
|
}));
|
|
53
42
|
log.info("Running ollama", {
|
|
54
43
|
pid: child.pid
|
|
55
|
-
}, {
|
|
56
|
-
F: __dxlog_file,
|
|
57
|
-
L: 64,
|
|
58
|
-
S: this,
|
|
59
|
-
C: (f, a) => f(...a)
|
|
60
|
-
});
|
|
44
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 48, S: this });
|
|
61
45
|
return {
|
|
62
46
|
endpoint: OLLAMA_HOST
|
|
63
47
|
};
|
|
@@ -65,12 +49,12 @@ var OllamaSidecar = class _OllamaSidecar extends Context.Tag("@dxos/plugin-nativ
|
|
|
65
49
|
};
|
|
66
50
|
var OllamaSidecarModelResolver = Layer.unwrapEffect(Effect.gen(function* () {
|
|
67
51
|
const { endpoint } = yield* OllamaSidecar;
|
|
68
|
-
return
|
|
69
|
-
|
|
52
|
+
return OllamaResolver.make({
|
|
53
|
+
endpoint,
|
|
70
54
|
transformClient: HttpClient.withTracerPropagation(false)
|
|
71
55
|
});
|
|
72
56
|
})).pipe(Layer.provide(FetchHttpClient.layer));
|
|
73
57
|
export {
|
|
74
58
|
ollama_default as default
|
|
75
59
|
};
|
|
76
|
-
//# sourceMappingURL=ollama-
|
|
60
|
+
//# sourceMappingURL=ollama-CYD5M6XB.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/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 } from '@dxos/app-framework';\nimport { AppCapabilities } from '@dxos/app-toolkit';\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 AppCapabilities.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 AppCapabilities.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,kBAAkB;AAC3B,SAASC,uBAAuB;AAChC,SAASC,WAAW;AAEpB,IAAA,eAAA;kBAOUC;qBAEN,WAAA,WAAA,MAAA,YAAA,MAAA;AACA,QAAMC,UAAqBC,oBAAAA,cACjBC,SAAAA;AASZ,QAAA,eAAA,oBAAA,QAAA,cAAA,KAAA,WAAA,CAAA,OAAA,GAAA,QAAA,KAAA,aAAA,aAAA,CAAA,CAAA,CAAA,CAAA;AAEIC,SAAAA,WAAAA,YAA8BC,gBAAI,iBAAA,2BAAA,KAAA,cAAA,YAAA,CAAA,GAAA,MAAA,kBAAA,MAAA,QAAA,QAAA,CAAA,CAAA;AAMtC,CAAA,CAAA;iDAG4BC,YAAQ,mCAAkB,EAAA,EAAA;qBAAC,aAAA,gBAAA,WAAA,aAAA;UAAU,UAAA,QAAA,QAAA,kBAAA;MAC3DC;;WAEEC;QACF;QACF,gBAAA;MAEA;IACA,CAAA;AAGAC,YAAQC,OAAOC,GAAG,QAAQ,CAACC,SAASC,QAAQC,IAAAA,YAAM,KAAYF,SAAKG,CAAQ,CAAA;YACTC,OAAAA,GAAAA,QAAAA,CAAAA,SAAAA,QAAAA,MAAAA,YAAAA,KAAAA,SAAAA,CAAAA,CAAAA;YAAK,GAAA,SAAA,CAAA,SAAA,IAAA,KAAA,yBAAA;MAC/DL;qBAAmDG,YAAAA,GAAAA,cAAAA,GAAAA,IAAAA,GAAAA,KAAAA,CAAAA,CAAAA;YAAM,GAAA,SAAA,CAAA,UAAA,IAAA,MAAA,gBAAA;MAC3DG;IACN,GAAA,EAAOxB,YAAOyB,YACZzB,GAAAA,cAAU,GAAA,IAAA,GAAA,KAAA,CAAA,CAAA;UACR,QAAOA,OAAe,eAAY0B,MAAI,QAAA,MAAA,CAAA;AACxC,WAAA,oBAAA,UAAA,aAAA;AAEEC,aAAK,eAAA,MAAkB,MAAA,KAAA,CAAA;;AAAiB,QAAA,KAAA,kBAAA;MAE5C,KAAO,MAAA;qBACKC,YAAAA,GAAAA,cAAAA,GAAAA,IAAAA,GAAAA,KAAAA,CAAAA;AACZ,WAAA;MAEF,UAAA;IACJ;EAEA,CAAA,CAAMC;;IAIA,6BAA2B,mBAAA,WAAA,aAAA;QACzBC,EAAAA,SAAAA,IAAAA,OAAAA;SACAC,eAAiBlC,KAAAA;IACnB;IAEE,iBAAeD,iCAAqB,KAAA;;;",
|
|
6
|
+
"names": ["FetchHttpClient", "HttpClient", "Command", "Context", "Effect", "Layer", "ManagedRuntime", "OllamaResolver", "Capability", "AppCapabilities", "log", "runtime", "sidecarLayer", "effectContext", "runtimeEffect", "OllamaSidecar", "Tag", "sidecar", "env", "OLLAMA_ORIGINS", "command", "stderr", "on", "data", "console", "error", "toString", "code", "child", "addFinalizer", "kill", "info", "OLLAMA_HOST", "OllamaSidecarModelResolver", "endpoint", "transformClient"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/plugin.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\n\nimport { meta } from './meta';\n\nexport const NativePlugin = Plugin.lazy(meta, () => import('#plugin'));\n"],
|
|
5
|
+
"mappings": ";;;;;AAIA,SAASA,cAAc;AAIhB,IAAMC,eAAeC,OAAOC,KAAKC,MAAM,MAAM,OAAO,SAAA,CAAA;",
|
|
6
|
+
"names": ["Plugin", "NativePlugin", "Plugin", "lazy", "meta"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// src/capabilities/spotlight-listener.ts
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
4
|
+
import { LayoutOperation } from "@dxos/app-toolkit";
|
|
5
|
+
import { log } from "@dxos/log";
|
|
6
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-native/src/capabilities/spotlight-listener.ts";
|
|
7
|
+
var spotlight_listener_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
8
|
+
const { invokePromise } = yield* Capability.get(Capabilities.OperationInvoker);
|
|
9
|
+
const unlisten = yield* Effect.promise(async () => {
|
|
10
|
+
const { listen } = await import("@tauri-apps/api/event");
|
|
11
|
+
const { getCurrentWindow } = await import("@tauri-apps/api/window");
|
|
12
|
+
return listen("spotlight:invoke", async (event) => {
|
|
13
|
+
const { operation, payload } = event.payload;
|
|
14
|
+
log.info("Received spotlight invoke event", {
|
|
15
|
+
operation,
|
|
16
|
+
payload
|
|
17
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 17, S: this });
|
|
18
|
+
try {
|
|
19
|
+
switch (operation) {
|
|
20
|
+
case "open":
|
|
21
|
+
await invokePromise(LayoutOperation.Open, payload);
|
|
22
|
+
break;
|
|
23
|
+
case "switch-workspace":
|
|
24
|
+
await invokePromise(LayoutOperation.SwitchWorkspace, payload);
|
|
25
|
+
break;
|
|
26
|
+
default:
|
|
27
|
+
log.warn("Unknown spotlight operation", {
|
|
28
|
+
operation
|
|
29
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 30, S: this });
|
|
30
|
+
}
|
|
31
|
+
const mainWindow = getCurrentWindow();
|
|
32
|
+
await mainWindow.show();
|
|
33
|
+
await mainWindow.setFocus();
|
|
34
|
+
} catch (err) {
|
|
35
|
+
log.catch(err, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 38, S: this });
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
return Capability.contributes(Capabilities.Null, null, () => Effect.sync(() => {
|
|
40
|
+
unlisten();
|
|
41
|
+
}));
|
|
42
|
+
}));
|
|
43
|
+
export {
|
|
44
|
+
spotlight_listener_default as default
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=spotlight-listener-TRCJXLOQ.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/spotlight-listener.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { LayoutOperation } from '@dxos/app-toolkit';\nimport { log } from '@dxos/log';\n\n// TODO(wittjosiah): Formalize with a stricter schema if we evolve this protocol.\ntype SpotlightInvokePayload = {\n operation: string;\n payload?: Record<string, any>;\n};\n\n/**\n * Listens for spotlight:invoke events from the popover window and dispatches the corresponding operation.\n */\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const { invokePromise } = yield* Capability.get(Capabilities.OperationInvoker);\n\n const unlisten = yield* Effect.promise(async () => {\n const { listen } = await import('@tauri-apps/api/event');\n const { getCurrentWindow } = await import('@tauri-apps/api/window');\n\n return listen<SpotlightInvokePayload>('spotlight:invoke', async (event) => {\n const { operation, payload } = event.payload;\n log.info('Received spotlight invoke event', { operation, payload });\n try {\n switch (operation) {\n case 'open':\n await invokePromise(LayoutOperation.Open, payload as any);\n break;\n case 'switch-workspace':\n await invokePromise(LayoutOperation.SwitchWorkspace, payload as any);\n break;\n default:\n log.warn('Unknown spotlight operation', { operation });\n }\n\n const mainWindow = getCurrentWindow();\n await mainWindow.show();\n await mainWindow.setFocus();\n } catch (err) {\n log.catch(err);\n }\n });\n });\n\n return Capability.contributes(Capabilities.Null, null, () =>\n Effect.sync(() => {\n unlisten();\n }),\n );\n }),\n);\n"],
|
|
5
|
+
"mappings": ";AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,uBAAuB;AAChC,SAASC,WAAW;AAQpB,IAAA,eAAA;AAOI,IAAMC,6BAAAA,WAAkBL,WAAe,kBAAA,aAAA;QACrC,EAAA,cAAgB,IAAG,OAAM,WAAO,IAAA,aAAA,gBAAA;QAChC,WAAQM,OAAkB,eAAS,YAAO;AAE1C,UAAA,EAAOC,OAA+B,IAAA,MAAA,OAAA,uBAA2BC;UAC/D,EAAA,iBAAmBC,IAAAA,MAAYD,OAAMC,wBAAO;WAC5CL,OAAS,oBAAA,OAAA,UAAmC;YAAEM,EAAAA,WAAAA,QAAAA,IAAAA,MAAAA;UAAWD,KAAAA,mCAAAA;QAAQ;QAC7D;uBACMC,YAAAA,GAAAA,cAAAA,GAAAA,IAAAA,GAAAA,KAAAA,CAAAA;;2BAEEC;eACN;AACF,kBAAK,cAAA,gBAAA,MAAA,OAAA;AACH;eACA;AACF,kBAAA,cAAA,gBAAA,iBAAA,OAAA;AACEP;;AAAoD,gBAAA,KAAA,+BAAA;cACxD;YAEMQ,GAAAA,EAAAA,YAAaN,YAAAA,GAAAA,cAAAA,GAAAA,IAAAA,GAAAA,KAAAA,CAAAA;QACnB;AACA,cAAMM,aAAWC,iBAAQ;AACzB,cAAOC,WAAK,KAAA;AACZV,cAAIW,WAAMD,SAAAA;MACZ,SAAA,KAAA;AACF,YAAA,MAAA,KAAA,QAAA,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,KAAA,CAAA;MACF;IAEA,CAAA;;SAGE,WAAA,YAAA,aAAA,MAAA,MAAA,MAAA,YAAA,MAAA;AAGJ,aAAA;;;",
|
|
6
|
+
"names": ["Effect", "Capabilities", "Capability", "LayoutOperation", "log", "unlisten", "getCurrentWindow", "listen", "event", "payload", "operation", "invokePromise", "mainWindow", "setFocus", "err", "catch"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// src/translations.ts
|
|
2
|
+
import { meta } from "#meta";
|
|
3
|
+
var translations = [
|
|
4
|
+
{
|
|
5
|
+
"en-US": {
|
|
6
|
+
[meta.id]: {
|
|
7
|
+
"update-ready.label": "Ready to update",
|
|
8
|
+
"update-ready.description": "A new version of Composer is available.",
|
|
9
|
+
"update.label": "Update",
|
|
10
|
+
"update.alt": "Relaunch the app to update"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
];
|
|
15
|
+
export {
|
|
16
|
+
translations
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=translations.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/translations.ts"],
|
|
4
|
+
"sourcesContent": ["//\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": ";AAMA,SAASA,YAAY;AAEd,IAAMC,eAAe;EAC1B;IACE,SAAS;MACP,CAACD,KAAKE,EAAE,GAAG;QACT,sBAAsB;QACtB,4BAA4B;QAC5B,gBAAgB;QAChB,cAAc;MAChB;IACF;EACF;;",
|
|
6
|
+
"names": ["meta", "translations", "id"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
// src/capabilities/updater.ts
|
|
2
|
+
import { type } from "@tauri-apps/plugin-os";
|
|
3
|
+
import { relaunch } from "@tauri-apps/plugin-process";
|
|
4
|
+
import * as Updater from "@tauri-apps/plugin-updater";
|
|
5
|
+
import * as Duration from "effect/Duration";
|
|
6
|
+
import * as Effect from "effect/Effect";
|
|
7
|
+
import * as Fiber from "effect/Fiber";
|
|
8
|
+
import * as Match from "effect/Match";
|
|
9
|
+
import * as Schedule from "effect/Schedule";
|
|
10
|
+
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
11
|
+
import { LayoutOperation } from "@dxos/app-toolkit";
|
|
12
|
+
import { log } from "@dxos/log";
|
|
13
|
+
import { meta } from "#meta";
|
|
14
|
+
|
|
15
|
+
// src/constants.ts
|
|
16
|
+
var TAURI_LOCALHOST_PORT = "26777";
|
|
17
|
+
|
|
18
|
+
// src/capabilities/updater.ts
|
|
19
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-native/src/capabilities/updater.ts";
|
|
20
|
+
var SUPPORTS_OTA = [
|
|
21
|
+
"linux",
|
|
22
|
+
"macos",
|
|
23
|
+
"windows"
|
|
24
|
+
];
|
|
25
|
+
var check2 = async () => {
|
|
26
|
+
try {
|
|
27
|
+
return await Updater.check();
|
|
28
|
+
} catch (error) {
|
|
29
|
+
log.error("failed to check for updates", {
|
|
30
|
+
error
|
|
31
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 28, S: void 0 });
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
var downloadAndInstall = async (update, handleDownload) => {
|
|
36
|
+
try {
|
|
37
|
+
await update.downloadAndInstall(handleDownload);
|
|
38
|
+
return true;
|
|
39
|
+
} catch (error) {
|
|
40
|
+
log.error("failed to download and install update", {
|
|
41
|
+
error
|
|
42
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 41, S: void 0 });
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
var updater_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
47
|
+
const platform = type();
|
|
48
|
+
const isDevServer = window.location.port !== TAURI_LOCALHOST_PORT;
|
|
49
|
+
if (!SUPPORTS_OTA.includes(platform) || isDevServer) {
|
|
50
|
+
log.info("skipping updater", {
|
|
51
|
+
platform,
|
|
52
|
+
port: window.location.port
|
|
53
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 52, S: this });
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const { invoke } = yield* Capability.get(Capabilities.OperationInvoker);
|
|
57
|
+
const action = Effect.gen(function* () {
|
|
58
|
+
log.info("checking for updates", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 62, S: this });
|
|
59
|
+
const update = yield* Effect.promise(() => check2());
|
|
60
|
+
if (!update) {
|
|
61
|
+
log.info("no update available", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 65, S: this });
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
log.info("update check complete", {
|
|
65
|
+
available: update.available,
|
|
66
|
+
currentVersion: update.currentVersion,
|
|
67
|
+
version: update.version,
|
|
68
|
+
date: update.date,
|
|
69
|
+
body: update.body
|
|
70
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 68, S: this });
|
|
71
|
+
if (update.available) {
|
|
72
|
+
log.info("update available, starting download", {
|
|
73
|
+
version: update.version
|
|
74
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 76, S: this });
|
|
75
|
+
let downloaded = 0;
|
|
76
|
+
let contentLength = 0;
|
|
77
|
+
const handleDownload = Match.type().pipe(Match.when({
|
|
78
|
+
event: "Started"
|
|
79
|
+
}, (event) => {
|
|
80
|
+
contentLength = event.data.contentLength ?? 0;
|
|
81
|
+
log.info("download started", {
|
|
82
|
+
contentLength
|
|
83
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 85, S: this });
|
|
84
|
+
}), Match.when({
|
|
85
|
+
event: "Progress"
|
|
86
|
+
}, (event) => {
|
|
87
|
+
downloaded += event.data.chunkLength;
|
|
88
|
+
log.verbose("download progress", {
|
|
89
|
+
downloaded,
|
|
90
|
+
contentLength
|
|
91
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 92, S: this });
|
|
92
|
+
}), Match.when({
|
|
93
|
+
event: "Finished"
|
|
94
|
+
}, () => {
|
|
95
|
+
log.info("download completed", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 99, S: this });
|
|
96
|
+
}), Match.exhaustive);
|
|
97
|
+
const downloadSuccess = yield* Effect.promise(() => downloadAndInstall(update, handleDownload));
|
|
98
|
+
if (downloadSuccess) {
|
|
99
|
+
yield* invoke(LayoutOperation.AddToast, {
|
|
100
|
+
id: `${meta.id}.update-ready`,
|
|
101
|
+
title: [
|
|
102
|
+
"update-ready.label",
|
|
103
|
+
{
|
|
104
|
+
ns: meta.id
|
|
105
|
+
}
|
|
106
|
+
],
|
|
107
|
+
description: [
|
|
108
|
+
"update-ready.description",
|
|
109
|
+
{
|
|
110
|
+
ns: meta.id
|
|
111
|
+
}
|
|
112
|
+
],
|
|
113
|
+
duration: Infinity,
|
|
114
|
+
actionLabel: [
|
|
115
|
+
"update.label",
|
|
116
|
+
{
|
|
117
|
+
ns: meta.id
|
|
118
|
+
}
|
|
119
|
+
],
|
|
120
|
+
actionAlt: [
|
|
121
|
+
"update.alt",
|
|
122
|
+
{
|
|
123
|
+
ns: meta.id
|
|
124
|
+
}
|
|
125
|
+
],
|
|
126
|
+
onAction: () => relaunch()
|
|
127
|
+
});
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return true;
|
|
132
|
+
});
|
|
133
|
+
const schedule = Schedule.fixed(Duration.hours(1)).pipe(Schedule.whileInput((keepChecking) => keepChecking));
|
|
134
|
+
const fiber = yield* action.pipe(Effect.repeat(schedule), Effect.forkDaemon);
|
|
135
|
+
log.info("updater module initialized, update check scheduled", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 140, S: this });
|
|
136
|
+
return Capability.contributes(Capabilities.Null, null, () => Effect.sync(() => Effect.runSync(Fiber.interrupt(fiber))));
|
|
137
|
+
}));
|
|
138
|
+
export {
|
|
139
|
+
updater_default as default
|
|
140
|
+
};
|
|
141
|
+
//# sourceMappingURL=updater-ZAJJC24D.mjs.map
|