@dxos/plugin-native 0.8.4-main.4a85c3132b → 0.8.4-main.4f23b4e393
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
|
@@ -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
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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.
|
|
5
|
-
"mappings": ";AAKA,SAASA,YAAY;AAEd,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,
|
|
6
|
-
"names": ["trim", "meta", "id", "name", "description", "
|
|
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
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}}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// src/capabilities/ollama
|
|
1
|
+
// src/capabilities/ollama.ts
|
|
2
2
|
import * as FetchHttpClient from "@effect/platform/FetchHttpClient";
|
|
3
3
|
import * as HttpClient from "@effect/platform/HttpClient";
|
|
4
4
|
import { Command } from "@tauri-apps/plugin-shell";
|
|
@@ -10,7 +10,7 @@ import { OllamaResolver } from "@dxos/ai/resolvers";
|
|
|
10
10
|
import { Capability } from "@dxos/app-framework";
|
|
11
11
|
import { AppCapabilities } from "@dxos/app-toolkit";
|
|
12
12
|
import { log } from "@dxos/log";
|
|
13
|
-
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-native/src/capabilities/ollama
|
|
13
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-native/src/capabilities/ollama.ts";
|
|
14
14
|
var OLLAMA_HOST = "http://localhost:21434";
|
|
15
15
|
var ollama_default = Capability.makeModule(() => Effect.sync(() => {
|
|
16
16
|
const runtime = ManagedRuntime.make(OllamaSidecar.layerLive);
|
|
@@ -31,32 +31,17 @@ var OllamaSidecar = class _OllamaSidecar extends Context.Tag("@dxos/plugin-nativ
|
|
|
31
31
|
command.stderr.on("data", (data) => console.error("[ollama]", data.toString()));
|
|
32
32
|
command.on("close", (code) => log.info("Ollama process exited", {
|
|
33
33
|
code
|
|
34
|
-
}, {
|
|
35
|
-
F: __dxlog_file,
|
|
36
|
-
L: 62,
|
|
37
|
-
S: this,
|
|
38
|
-
C: (f, a) => f(...a)
|
|
39
|
-
}));
|
|
34
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 38, S: this }));
|
|
40
35
|
command.on("error", (error) => log.error("Ollama error", {
|
|
41
36
|
error
|
|
42
|
-
}, {
|
|
43
|
-
F: __dxlog_file,
|
|
44
|
-
L: 63,
|
|
45
|
-
S: this,
|
|
46
|
-
C: (f, a) => f(...a)
|
|
47
|
-
}));
|
|
37
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 41, S: this }));
|
|
48
38
|
const child = yield* Effect.promise(() => command.spawn());
|
|
49
39
|
yield* Effect.addFinalizer(Effect.fn(function* () {
|
|
50
40
|
yield* Effect.promise(() => child.kill());
|
|
51
41
|
}));
|
|
52
42
|
log.info("Running ollama", {
|
|
53
43
|
pid: child.pid
|
|
54
|
-
}, {
|
|
55
|
-
F: __dxlog_file,
|
|
56
|
-
L: 70,
|
|
57
|
-
S: this,
|
|
58
|
-
C: (f, a) => f(...a)
|
|
59
|
-
});
|
|
44
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 48, S: this });
|
|
60
45
|
return {
|
|
61
46
|
endpoint: OLLAMA_HOST
|
|
62
47
|
};
|
|
@@ -72,4 +57,4 @@ var OllamaSidecarModelResolver = Layer.unwrapEffect(Effect.gen(function* () {
|
|
|
72
57
|
export {
|
|
73
58
|
ollama_default as default
|
|
74
59
|
};
|
|
75
|
-
//# sourceMappingURL=ollama-
|
|
60
|
+
//# sourceMappingURL=ollama-CYD5M6XB.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/ollama
|
|
3
|
+
"sources": ["../../../src/capabilities/ollama.ts"],
|
|
4
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
|
|
6
|
-
"names": ["FetchHttpClient", "HttpClient", "Command", "Context", "Effect", "Layer", "ManagedRuntime", "OllamaResolver", "Capability", "AppCapabilities", "log", "
|
|
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,K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AeD,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
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
|
+
}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
meta
|
|
3
|
-
} from "./chunk-6374DBU4.mjs";
|
|
4
|
-
|
|
5
|
-
// src/capabilities/updater/updater.ts
|
|
1
|
+
// src/capabilities/updater.ts
|
|
6
2
|
import { type } from "@tauri-apps/plugin-os";
|
|
7
3
|
import { relaunch } from "@tauri-apps/plugin-process";
|
|
8
4
|
import * as Updater from "@tauri-apps/plugin-updater";
|
|
@@ -14,7 +10,13 @@ import * as Schedule from "effect/Schedule";
|
|
|
14
10
|
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
15
11
|
import { LayoutOperation } from "@dxos/app-toolkit";
|
|
16
12
|
import { log } from "@dxos/log";
|
|
17
|
-
|
|
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";
|
|
18
20
|
var SUPPORTS_OTA = [
|
|
19
21
|
"linux",
|
|
20
22
|
"macos",
|
|
@@ -26,12 +28,7 @@ var check2 = async () => {
|
|
|
26
28
|
} catch (error) {
|
|
27
29
|
log.error("failed to check for updates", {
|
|
28
30
|
error
|
|
29
|
-
}, {
|
|
30
|
-
F: __dxlog_file,
|
|
31
|
-
L: 29,
|
|
32
|
-
S: void 0,
|
|
33
|
-
C: (f, a) => f(...a)
|
|
34
|
-
});
|
|
31
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 28, S: void 0 });
|
|
35
32
|
return null;
|
|
36
33
|
}
|
|
37
34
|
};
|
|
@@ -42,46 +39,27 @@ var downloadAndInstall = async (update, handleDownload) => {
|
|
|
42
39
|
} catch (error) {
|
|
43
40
|
log.error("failed to download and install update", {
|
|
44
41
|
error
|
|
45
|
-
}, {
|
|
46
|
-
F: __dxlog_file,
|
|
47
|
-
L: 45,
|
|
48
|
-
S: void 0,
|
|
49
|
-
C: (f, a) => f(...a)
|
|
50
|
-
});
|
|
42
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 41, S: void 0 });
|
|
51
43
|
return false;
|
|
52
44
|
}
|
|
53
45
|
};
|
|
54
46
|
var updater_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
55
47
|
const platform = type();
|
|
56
|
-
|
|
48
|
+
const isDevServer = window.location.port !== TAURI_LOCALHOST_PORT;
|
|
49
|
+
if (!SUPPORTS_OTA.includes(platform) || isDevServer) {
|
|
57
50
|
log.info("skipping updater", {
|
|
58
51
|
platform,
|
|
59
|
-
|
|
60
|
-
}, {
|
|
61
|
-
F: __dxlog_file,
|
|
62
|
-
L: 55,
|
|
63
|
-
S: this,
|
|
64
|
-
C: (f, a) => f(...a)
|
|
65
|
-
});
|
|
52
|
+
port: window.location.port
|
|
53
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 52, S: this });
|
|
66
54
|
return;
|
|
67
55
|
}
|
|
68
56
|
const { invoke } = yield* Capability.get(Capabilities.OperationInvoker);
|
|
69
57
|
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
|
-
});
|
|
58
|
+
log.info("checking for updates", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 62, S: this });
|
|
76
59
|
const update = yield* Effect.promise(() => check2());
|
|
77
60
|
if (!update) {
|
|
78
|
-
log.info("no update available", void 0, {
|
|
79
|
-
|
|
80
|
-
L: 66,
|
|
81
|
-
S: this,
|
|
82
|
-
C: (f, a) => f(...a)
|
|
83
|
-
});
|
|
84
|
-
return;
|
|
61
|
+
log.info("no update available", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 65, S: this });
|
|
62
|
+
return true;
|
|
85
63
|
}
|
|
86
64
|
log.info("update check complete", {
|
|
87
65
|
available: update.available,
|
|
@@ -89,21 +67,11 @@ var updater_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
|
89
67
|
version: update.version,
|
|
90
68
|
date: update.date,
|
|
91
69
|
body: update.body
|
|
92
|
-
}, {
|
|
93
|
-
F: __dxlog_file,
|
|
94
|
-
L: 69,
|
|
95
|
-
S: this,
|
|
96
|
-
C: (f, a) => f(...a)
|
|
97
|
-
});
|
|
70
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 68, S: this });
|
|
98
71
|
if (update.available) {
|
|
99
72
|
log.info("update available, starting download", {
|
|
100
73
|
version: update.version
|
|
101
|
-
}, {
|
|
102
|
-
F: __dxlog_file,
|
|
103
|
-
L: 77,
|
|
104
|
-
S: this,
|
|
105
|
-
C: (f, a) => f(...a)
|
|
106
|
-
});
|
|
74
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 76, S: this });
|
|
107
75
|
let downloaded = 0;
|
|
108
76
|
let contentLength = 0;
|
|
109
77
|
const handleDownload = Match.type().pipe(Match.when({
|
|
@@ -112,12 +80,7 @@ var updater_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
|
112
80
|
contentLength = event.data.contentLength ?? 0;
|
|
113
81
|
log.info("download started", {
|
|
114
82
|
contentLength
|
|
115
|
-
}, {
|
|
116
|
-
F: __dxlog_file,
|
|
117
|
-
L: 84,
|
|
118
|
-
S: this,
|
|
119
|
-
C: (f, a) => f(...a)
|
|
120
|
-
});
|
|
83
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 85, S: this });
|
|
121
84
|
}), Match.when({
|
|
122
85
|
event: "Progress"
|
|
123
86
|
}, (event) => {
|
|
@@ -125,66 +88,54 @@ var updater_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
|
125
88
|
log.verbose("download progress", {
|
|
126
89
|
downloaded,
|
|
127
90
|
contentLength
|
|
128
|
-
}, {
|
|
129
|
-
F: __dxlog_file,
|
|
130
|
-
L: 88,
|
|
131
|
-
S: this,
|
|
132
|
-
C: (f, a) => f(...a)
|
|
133
|
-
});
|
|
91
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 92, S: this });
|
|
134
92
|
}), Match.when({
|
|
135
93
|
event: "Finished"
|
|
136
94
|
}, () => {
|
|
137
|
-
log.info("download completed", void 0, {
|
|
138
|
-
F: __dxlog_file,
|
|
139
|
-
L: 91,
|
|
140
|
-
S: this,
|
|
141
|
-
C: (f, a) => f(...a)
|
|
142
|
-
});
|
|
95
|
+
log.info("download completed", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 99, S: this });
|
|
143
96
|
}), Match.exhaustive);
|
|
144
97
|
const downloadSuccess = yield* Effect.promise(() => downloadAndInstall(update, handleDownload));
|
|
145
98
|
if (downloadSuccess) {
|
|
146
99
|
yield* invoke(LayoutOperation.AddToast, {
|
|
147
|
-
id: `${meta.id}
|
|
100
|
+
id: `${meta.id}.update-ready`,
|
|
148
101
|
title: [
|
|
149
|
-
"update
|
|
102
|
+
"update-ready.label",
|
|
150
103
|
{
|
|
151
104
|
ns: meta.id
|
|
152
105
|
}
|
|
153
106
|
],
|
|
154
107
|
description: [
|
|
155
|
-
"update
|
|
108
|
+
"update-ready.description",
|
|
156
109
|
{
|
|
157
110
|
ns: meta.id
|
|
158
111
|
}
|
|
159
112
|
],
|
|
160
113
|
duration: Infinity,
|
|
161
114
|
actionLabel: [
|
|
162
|
-
"update
|
|
115
|
+
"update.label",
|
|
163
116
|
{
|
|
164
117
|
ns: meta.id
|
|
165
118
|
}
|
|
166
119
|
],
|
|
167
120
|
actionAlt: [
|
|
168
|
-
"update
|
|
121
|
+
"update.alt",
|
|
169
122
|
{
|
|
170
123
|
ns: meta.id
|
|
171
124
|
}
|
|
172
125
|
],
|
|
173
126
|
onAction: () => relaunch()
|
|
174
127
|
});
|
|
128
|
+
return false;
|
|
175
129
|
}
|
|
176
130
|
}
|
|
131
|
+
return true;
|
|
177
132
|
});
|
|
178
|
-
const
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
L: 114,
|
|
182
|
-
S: this,
|
|
183
|
-
C: (f, a) => f(...a)
|
|
184
|
-
});
|
|
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 });
|
|
185
136
|
return Capability.contributes(Capabilities.Null, null, () => Effect.sync(() => Effect.runSync(Fiber.interrupt(fiber))));
|
|
186
137
|
}));
|
|
187
138
|
export {
|
|
188
139
|
updater_default as default
|
|
189
140
|
};
|
|
190
|
-
//# sourceMappingURL=updater-
|
|
141
|
+
//# sourceMappingURL=updater-ZAJJC24D.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/updater.ts", "../../../src/constants.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\nimport { TAURI_LOCALHOST_PORT } from '../constants';\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 const isDevServer = window.location.port !== TAURI_LOCALHOST_PORT;\n if (!SUPPORTS_OTA.includes(platform) || isDevServer) {\n log.info('skipping updater', { platform, port: window.location.port });\n return;\n }\n\n const { invoke } = yield* Capability.get(Capabilities.OperationInvoker);\n\n // https://tauri.app/plugin/updater/#checking-for-updates\n // Returns true to keep checking, false to stop.\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 true;\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 return false;\n }\n }\n return true;\n });\n\n // Run immediately on startup, then repeat every hour. Stop once an update is found.\n const schedule = Schedule.fixed(Duration.hours(1)).pipe(\n Schedule.whileInput((keepChecking: boolean) => keepChecking),\n );\n const fiber = yield* action.pipe(Effect.repeat(schedule), 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", "//\n// Copyright 2025 DXOS.org\n//\n\n/// Stable port for the Tauri localhost asset server in production builds.\n/// Must match LOCALHOST_PORT in src-tauri/src/lib.rs.\nexport const TAURI_LOCALHOST_PORT = '26777';\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;AAEpB,SAASC,YAAY;;;ACXd,IAAMC,uBAAuB;;;ADepC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eAAA,CAAA,CAAA,EAAA,KAAA,oBAAA,CAAA,iBAAA,YAAA,CAAA;AAET,QAAA,QAAOqB,OAAWC,OAAAA,KAAYC,cAAiB,QAAQ,GACrD1B,iBAAkBA;AAGtB,MAAA,KAAA,sDAAA,QAAA,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,KAAA,GAAA,KAAA,CAAA;;;",
|
|
6
|
+
"names": ["type", "relaunch", "Updater", "Duration", "Effect", "Fiber", "Match", "Schedule", "Capabilities", "Capability", "LayoutOperation", "log", "meta", "TAURI_LOCALHOST_PORT", "SUPPORTS_OTA", "check", "Updater", "log", "error", "downloadAndInstall", "handleDownload", "platform", "type", "includes", "port", "Effect", "promise", "update", "info", "currentVersion", "version", "date", "body", "available", "downloaded", "contentLength", "event", "Match", "verbose", "downloadSuccess", "LayoutOperation", "AddToast", "id", "title", "description", "duration", "actionLabel", "actionAlt", "onAction", "Capability", "contributes", "Capabilities"]
|
|
7
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativePlugin.d.ts","sourceRoot":"","sources":["../../../src/NativePlugin.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAoB,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAQ/D,eAAO,MAAM,YAAY,4BAkBxB,CAAC"}
|
|
1
|
+
{"version":3,"file":"NativePlugin.d.ts","sourceRoot":"","sources":["../../../src/NativePlugin.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAoB,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAQ/D,eAAO,MAAM,YAAY,4BAkBxB,CAAC;eAEa,YAAY"}
|