@dxos/plugin-native 0.8.3 → 0.8.4-main.03d5cd7b56
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/neutral/chunk-254JXXJC.mjs +18 -0
- 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/neutral/ollama-CYD5M6XB.mjs +60 -0
- 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 +5 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/ollama.d.ts +7 -0
- 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 +5 -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 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -3
- 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 +11 -0
- package/dist/types/src/translations.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +60 -14
- package/src/NativePlugin.tsx +26 -16
- package/src/capabilities/index.ts +9 -0
- package/src/capabilities/ollama.ts +88 -0
- package/src/capabilities/spotlight-listener.ts +58 -0
- package/src/capabilities/updater.ts +129 -0
- package/src/constants.ts +7 -0
- package/src/index.ts +0 -1
- package/src/meta.ts +9 -5
- package/src/plugin.ts +9 -0
- package/src/translations.ts +20 -0
- package/dist/lib/browser/index.mjs +0 -26
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/initialize-OGKEIRPC.mjs +0 -161
- package/dist/lib/browser/initialize-OGKEIRPC.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/types/src/initialize.d.ts +0 -3
- package/dist/types/src/initialize.d.ts.map +0 -1
- package/src/initialize.ts +0 -175
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// src/meta.ts
|
|
2
|
+
import { trim } from "@dxos/util";
|
|
3
|
+
var meta = {
|
|
4
|
+
id: "org.dxos.plugin.native",
|
|
5
|
+
name: "Native",
|
|
6
|
+
description: trim`
|
|
7
|
+
Native platform integration providing desktop-specific features and system-level capabilities.
|
|
8
|
+
Access native file dialogs, notifications, and OS integrations.
|
|
9
|
+
`,
|
|
10
|
+
tags: [
|
|
11
|
+
"system"
|
|
12
|
+
]
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
meta
|
|
17
|
+
};
|
|
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}}}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// src/capabilities/ollama.ts
|
|
2
|
+
import * as FetchHttpClient from "@effect/platform/FetchHttpClient";
|
|
3
|
+
import * as HttpClient from "@effect/platform/HttpClient";
|
|
4
|
+
import { Command } from "@tauri-apps/plugin-shell";
|
|
5
|
+
import * as Context from "effect/Context";
|
|
6
|
+
import * as Effect from "effect/Effect";
|
|
7
|
+
import * as Layer from "effect/Layer";
|
|
8
|
+
import * as ManagedRuntime from "effect/ManagedRuntime";
|
|
9
|
+
import { OllamaResolver } from "@dxos/ai/resolvers";
|
|
10
|
+
import { Capability } from "@dxos/app-framework";
|
|
11
|
+
import { AppCapabilities } from "@dxos/app-toolkit";
|
|
12
|
+
import { log } from "@dxos/log";
|
|
13
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-native/src/capabilities/ollama.ts";
|
|
14
|
+
var OLLAMA_HOST = "http://localhost:21434";
|
|
15
|
+
var ollama_default = Capability.makeModule(() => Effect.sync(() => {
|
|
16
|
+
const runtime = ManagedRuntime.make(OllamaSidecar.layerLive);
|
|
17
|
+
const sidecarLayer = Layer.effectContext(runtime.runtimeEffect.pipe(Effect.map((rt) => rt.context.pipe(Context.pick(OllamaSidecar)))));
|
|
18
|
+
return Capability.contributes(AppCapabilities.AiModelResolver, OllamaSidecarModelResolver.pipe(Layer.provide(sidecarLayer)), () => Effect.tryPromise(() => runtime.dispose()));
|
|
19
|
+
}));
|
|
20
|
+
var OllamaSidecar = class _OllamaSidecar extends Context.Tag("@dxos/plugin-native/OllamaSidecar")() {
|
|
21
|
+
static layerLive = Layer.scoped(_OllamaSidecar, Effect.gen(function* () {
|
|
22
|
+
const command = Command.sidecar("sidecar/ollama", [
|
|
23
|
+
"serve"
|
|
24
|
+
], {
|
|
25
|
+
env: {
|
|
26
|
+
OLLAMA_HOST,
|
|
27
|
+
OLLAMA_ORIGINS: "*"
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
command.stdout.on("data", (data) => console.log("[ollama]", data.toString()));
|
|
31
|
+
command.stderr.on("data", (data) => console.error("[ollama]", data.toString()));
|
|
32
|
+
command.on("close", (code) => log.info("Ollama process exited", {
|
|
33
|
+
code
|
|
34
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 38, S: this }));
|
|
35
|
+
command.on("error", (error) => log.error("Ollama error", {
|
|
36
|
+
error
|
|
37
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 41, S: this }));
|
|
38
|
+
const child = yield* Effect.promise(() => command.spawn());
|
|
39
|
+
yield* Effect.addFinalizer(Effect.fn(function* () {
|
|
40
|
+
yield* Effect.promise(() => child.kill());
|
|
41
|
+
}));
|
|
42
|
+
log.info("Running ollama", {
|
|
43
|
+
pid: child.pid
|
|
44
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 48, S: this });
|
|
45
|
+
return {
|
|
46
|
+
endpoint: OLLAMA_HOST
|
|
47
|
+
};
|
|
48
|
+
}));
|
|
49
|
+
};
|
|
50
|
+
var OllamaSidecarModelResolver = Layer.unwrapEffect(Effect.gen(function* () {
|
|
51
|
+
const { endpoint } = yield* OllamaSidecar;
|
|
52
|
+
return OllamaResolver.make({
|
|
53
|
+
endpoint,
|
|
54
|
+
transformClient: HttpClient.withTracerPropagation(false)
|
|
55
|
+
});
|
|
56
|
+
})).pipe(Layer.provide(FetchHttpClient.layer));
|
|
57
|
+
export {
|
|
58
|
+
ollama_default as default
|
|
59
|
+
};
|
|
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,sB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AAA,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
|
|
@@ -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,IAAA,eAAMC;IAAyB,eAAA;EAAS;EAAU;EAElD;;IAKIC,SAAO,YAAMC;AACf,MA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AAOqB,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":"
|
|
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"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Capability } from '@dxos/app-framework';
|
|
2
|
+
export declare const Ollama: Capability.LazyCapability<[], import("./ollama").OllamaCapabilities, Error>;
|
|
3
|
+
export declare const SpotlightListener: Capability.LazyCapability<void, Capability.Capability<Capability.InterfaceDef<null>>, Error>;
|
|
4
|
+
export declare const Updater: Capability.LazyCapability<void, Capability.Capability<Capability.InterfaceDef<null>> | undefined, Error>;
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,eAAO,MAAM,MAAM,6EAAsD,CAAC;AAC1E,eAAO,MAAM,iBAAiB,8FAA6E,CAAC;AAC5G,eAAO,MAAM,OAAO,0GAAwD,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as Effect from 'effect/Effect';
|
|
2
|
+
import { Capability } from '@dxos/app-framework';
|
|
3
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
4
|
+
export type OllamaCapabilities = Capability.Capability<typeof AppCapabilities.AiModelResolver>;
|
|
5
|
+
declare const _default: (props: []) => Effect.Effect<OllamaCapabilities, Error, Capability.Service>;
|
|
6
|
+
export default _default;
|
|
7
|
+
//# sourceMappingURL=ollama.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ollama.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/ollama.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAMxC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAMpD,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,UAAU,CAAC,OAAO,eAAe,CAAC,eAAe,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as Effect from 'effect/Effect';
|
|
2
|
+
import { Capability } from '@dxos/app-framework';
|
|
3
|
+
/**
|
|
4
|
+
* Listens for spotlight:invoke events from the popover window and dispatches the corresponding operation.
|
|
5
|
+
*/
|
|
6
|
+
declare const _default: (props: void) => Effect.Effect<Capability.Capability<Capability.InterfaceDef<null>>, Error, Capability.Service>;
|
|
7
|
+
export default _default;
|
|
8
|
+
//# sourceMappingURL=spotlight-listener.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spotlight-listener.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/spotlight-listener.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAgB,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAU/D;;GAEG"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as Effect from 'effect/Effect';
|
|
2
|
+
import { Capability } from '@dxos/app-framework';
|
|
3
|
+
declare const _default: (props: void) => Effect.Effect<Capability.Capability<Capability.InterfaceDef<null>> | undefined, Error, Capability.Service>;
|
|
4
|
+
export default _default;
|
|
5
|
+
//# sourceMappingURL=updater.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updater.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/updater.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAKxC,OAAO,EAAgB,UAAU,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/constants.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,oBAAoB,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,QAAQ,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,QAAQ,CAAC"}
|
package/dist/types/src/meta.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const meta: PluginMeta;
|
|
1
|
+
import { type Plugin } from '@dxos/app-framework';
|
|
2
|
+
export declare const meta: Plugin.Meta;
|
|
4
3
|
//# sourceMappingURL=meta.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAGlD,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,IAQzB,CAAC"}
|