@dxos/plugin-native 0.8.3 → 0.8.4-main.28f8d3d

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.
@@ -0,0 +1,12 @@
1
+ // src/meta.ts
2
+ var NATIVE_PLUGIN = "dxos.org/plugin/native";
3
+ var meta = {
4
+ id: NATIVE_PLUGIN,
5
+ name: "Native"
6
+ };
7
+
8
+ export {
9
+ NATIVE_PLUGIN,
10
+ meta
11
+ };
12
+ //# sourceMappingURL=chunk-E2JDGVJI.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 PluginMeta } from '@dxos/app-framework';\n\nexport const NATIVE_PLUGIN = 'dxos.org/plugin/native';\n\nexport const meta: PluginMeta = {\n id: NATIVE_PLUGIN,\n name: 'Native',\n};\n"],
5
+ "mappings": ";AAMO,IAAMA,gBAAgB;AAEtB,IAAMC,OAAmB;EAC9BC,IAAIF;EACJG,MAAM;AACR;",
6
+ "names": ["NATIVE_PLUGIN", "meta", "id", "name"]
7
+ }
@@ -1,21 +1,47 @@
1
- // packages/plugins/plugin-native/src/meta.ts
2
- var NATIVE_PLUGIN = "dxos.org/plugin/native";
3
- var meta = {
4
- id: NATIVE_PLUGIN,
5
- name: "Native"
6
- };
1
+ import {
2
+ NATIVE_PLUGIN,
3
+ meta
4
+ } from "./chunk-E2JDGVJI.mjs";
5
+
6
+ // src/NativePlugin.tsx
7
+ import { Capabilities, Events, contributes, defineModule, definePlugin } from "@dxos/app-framework";
8
+ import { AssistantEvents } from "@dxos/plugin-assistant";
9
+
10
+ // src/capabilities/index.ts
11
+ import { lazy } from "@dxos/app-framework";
12
+ var Updater = lazy(() => import("./updater-MCAQYHED.mjs"));
13
+ var Ollama = lazy(() => import("./ollama-MF7YNEDS.mjs"));
7
14
 
8
- // packages/plugins/plugin-native/src/NativePlugin.tsx
9
- import { definePlugin, Events, defineModule } from "@dxos/app-framework";
15
+ // src/translations.ts
16
+ var translations = [
17
+ {
18
+ "en-US": {
19
+ [meta.id]: {
20
+ "update ready label": "Ready to update",
21
+ "update ready description": "A new version of Composer is available.",
22
+ "update label": "Update",
23
+ "update alt": "Relaunch the app to update"
24
+ }
25
+ }
26
+ }
27
+ ];
28
+
29
+ // src/NativePlugin.tsx
10
30
  var NativePlugin = () => definePlugin(meta, [
11
31
  defineModule({
12
- id: `${meta.id}/module/startup`,
32
+ id: `${meta.id}/module/translations`,
33
+ activatesOn: Events.SetupTranslations,
34
+ activate: () => contributes(Capabilities.Translations, translations)
35
+ }),
36
+ defineModule({
37
+ id: `${meta.id}/module/updater`,
13
38
  activatesOn: Events.DispatcherReady,
14
- activate: async (context) => {
15
- const { initializeNativeApp } = await import("./initialize-OGKEIRPC.mjs");
16
- await initializeNativeApp(context);
17
- return [];
18
- }
39
+ activate: Updater
40
+ }),
41
+ defineModule({
42
+ id: `${meta.id}/module/ollama`,
43
+ activatesOn: AssistantEvents.SetupAiServiceProviders,
44
+ activate: Ollama
19
45
  })
20
46
  ]);
21
47
  export {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/meta.ts", "../../../src/NativePlugin.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const NATIVE_PLUGIN = 'dxos.org/plugin/native';\n\nexport const meta: PluginMeta = {\n id: NATIVE_PLUGIN,\n name: 'Native',\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type { PluginContext } from '@dxos/app-framework';\nimport { definePlugin, Events, defineModule } from '@dxos/app-framework';\n\nimport { meta } from './meta';\n\n// TODO(burdon): Initial url has index.html, which must be caught/redirected.\n\nexport const NativePlugin = () =>\n definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/startup`,\n activatesOn: Events.DispatcherReady,\n activate: async (context: PluginContext) => {\n const { initializeNativeApp } = await import('./initialize');\n await initializeNativeApp(context);\n return [];\n },\n }),\n ]);\n"],
5
- "mappings": ";AAMO,IAAMA,gBAAgB;AAEtB,IAAMC,OAAmB;EAC9BC,IAAIF;EACJG,MAAM;AACR;;;ACNA,SAASC,cAAcC,QAAQC,oBAAoB;AAM5C,IAAMC,eAAe,MAC1BC,aAAaC,MAAM;EACjBC,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOC;IACpBC,UAAU,OAAOC,YAAAA;AACf,YAAM,EAAEC,oBAAmB,IAAK,MAAM,OAAO,2BAAA;AAC7C,YAAMA,oBAAoBD,OAAAA;AAC1B,aAAO,CAAA;IACT;EACF,CAAA;CACD;",
6
- "names": ["NATIVE_PLUGIN", "meta", "id", "name", "definePlugin", "Events", "defineModule", "NativePlugin", "definePlugin", "meta", "defineModule", "id", "activatesOn", "Events", "DispatcherReady", "activate", "context", "initializeNativeApp"]
3
+ "sources": ["../../../src/NativePlugin.tsx", "../../../src/capabilities/index.ts", "../../../src/translations.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Capabilities, Events, contributes, defineModule, definePlugin } from '@dxos/app-framework';\nimport { AssistantEvents } from '@dxos/plugin-assistant';\n\nimport { Ollama, Updater } from './capabilities';\nimport { meta } from './meta';\nimport { translations } from './translations';\n\nexport const NativePlugin = () =>\n definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/translations`,\n activatesOn: Events.SetupTranslations,\n activate: () => contributes(Capabilities.Translations, translations),\n }),\n defineModule({\n id: `${meta.id}/module/updater`,\n activatesOn: Events.DispatcherReady,\n activate: Updater,\n }),\n defineModule({\n id: `${meta.id}/module/ollama`,\n activatesOn: AssistantEvents.SetupAiServiceProviders,\n activate: Ollama,\n }),\n ]);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const Updater = lazy(() => import('./updater'));\nexport const Ollama = lazy(() => import('./ollama'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Resource } from '@dxos/react-ui';\n\nimport { meta } from './meta';\n\nexport const translations = [\n {\n 'en-US': {\n [meta.id]: {\n 'update ready label': 'Ready to update',\n 'update ready description': 'A new version of Composer is available.',\n 'update label': 'Update',\n 'update alt': 'Relaunch the app to update',\n },\n },\n },\n] as const satisfies Resource[];\n"],
5
+ "mappings": ";;;;;;AAIA,SAASA,cAAcC,QAAQC,aAAaC,cAAcC,oBAAoB;AAC9E,SAASC,uBAAuB;;;ACDhC,SAASC,YAAY;AAEd,IAAMC,UAAUC,KAAK,MAAM,OAAO,wBAAA,CAAA;AAClC,IAAMC,SAASD,KAAK,MAAM,OAAO,uBAAA,CAAA;;;ACCjC,IAAME,eAAe;EAC1B;IACE,SAAS;MACP,CAACC,KAAKC,EAAE,GAAG;QACT,sBAAsB;QACtB,4BAA4B;QAC5B,gBAAgB;QAChB,cAAc;MAChB;IACF;EACF;;;;AFPK,IAAMC,eAAe,MAC1BC,aAAaC,MAAM;EACjBC,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOC;IACpBC,UAAU,MAAMC,YAAYC,aAAaC,cAAcC,YAAAA;EACzD,CAAA;EACAT,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOO;IACpBL,UAAUM;EACZ,CAAA;EACAX,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaU,gBAAgBC;IAC7BR,UAAUS;EACZ,CAAA;CACD;",
6
+ "names": ["Capabilities", "Events", "contributes", "defineModule", "definePlugin", "AssistantEvents", "lazy", "Updater", "lazy", "Ollama", "translations", "meta", "id", "NativePlugin", "definePlugin", "meta", "defineModule", "id", "activatesOn", "Events", "SetupTranslations", "activate", "contributes", "Capabilities", "Translations", "translations", "DispatcherReady", "Updater", "AssistantEvents", "SetupAiServiceProviders", "Ollama"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"packages/plugins/plugin-native/src/meta.ts":{"bytes":927,"imports":[],"format":"esm"},"packages/plugins/plugin-native/src/initialize.ts":{"bytes":18786,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-help","kind":"import-statement","external":true},{"path":"@dxos/plugin-navtree","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-native/src/NativePlugin.tsx":{"bytes":2458,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-native/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-native/src/initialize.ts","kind":"dynamic-import","original":"./initialize"}],"format":"esm"},"packages/plugins/plugin-native/src/index.ts":{"bytes":562,"imports":[{"path":"packages/plugins/plugin-native/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-native/src/NativePlugin.tsx","kind":"import-statement","original":"./NativePlugin"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-native/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1607},"packages/plugins/plugin-native/dist/lib/browser/index.mjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-native/dist/lib/browser/initialize-OGKEIRPC.mjs","kind":"dynamic-import"}],"exports":["NATIVE_PLUGIN","NativePlugin","meta"],"entryPoint":"packages/plugins/plugin-native/src/index.ts","inputs":{"packages/plugins/plugin-native/src/meta.ts":{"bytesInOutput":100},"packages/plugins/plugin-native/src/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-native/src/NativePlugin.tsx":{"bytesInOutput":405}},"bytes":694},"packages/plugins/plugin-native/dist/lib/browser/initialize-OGKEIRPC.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":9450},"packages/plugins/plugin-native/dist/lib/browser/initialize-OGKEIRPC.mjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-help","kind":"import-statement","external":true},{"path":"@dxos/plugin-navtree","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["initializeNativeApp"],"entryPoint":"packages/plugins/plugin-native/src/initialize.ts","inputs":{"packages/plugins/plugin-native/src/initialize.ts":{"bytesInOutput":4500}},"bytes":4635}}}
1
+ {"inputs":{"src/meta.ts":{"bytes":914,"imports":[],"format":"esm"},"src/capabilities/updater.ts":{"bytes":11521,"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","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"src/capabilities/ollama.ts":{"bytes":9768,"imports":[{"path":"@effect/platform","kind":"import-statement","external":true},{"path":"@tauri-apps/plugin-shell","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-assistant","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/index.ts":{"bytes":944,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/updater.ts","kind":"dynamic-import","original":"./updater"},{"path":"src/capabilities/ollama.ts","kind":"dynamic-import","original":"./ollama"}],"format":"esm"},"src/translations.ts":{"bytes":1625,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"src/NativePlugin.tsx":{"bytes":3520,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-assistant","kind":"import-statement","external":true},{"path":"src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/translations.ts","kind":"import-statement","original":"./translations"}],"format":"esm"},"src/index.ts":{"bytes":549,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/NativePlugin.tsx","kind":"import-statement","original":"./NativePlugin"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2803},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-E2JDGVJI.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-assistant","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/browser/updater-MCAQYHED.mjs","kind":"dynamic-import"},{"path":"dist/lib/browser/ollama-MF7YNEDS.mjs","kind":"dynamic-import"}],"exports":["NATIVE_PLUGIN","NativePlugin","meta"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0},"src/NativePlugin.tsx":{"bytesInOutput":650},"src/capabilities/index.ts":{"bytesInOutput":162},"src/translations.ts":{"bytesInOutput":293}},"bytes":1360},"dist/lib/browser/updater-MCAQYHED.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5370},"dist/lib/browser/updater-MCAQYHED.mjs":{"imports":[{"path":"dist/lib/browser/chunk-E2JDGVJI.mjs","kind":"import-statement"},{"path":"@tauri-apps/plugin-os","kind":"import-statement","external":true},{"path":"@tauri-apps/plugin-process","kind":"import-statement","external":true},{"path":"@tauri-apps/plugin-updater","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/updater.ts","inputs":{"src/capabilities/updater.ts":{"bytesInOutput":3402}},"bytes":3577},"dist/lib/browser/chunk-E2JDGVJI.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":454},"dist/lib/browser/chunk-E2JDGVJI.mjs":{"imports":[],"exports":["NATIVE_PLUGIN","meta"],"inputs":{"src/meta.ts":{"bytesInOutput":100}},"bytes":196},"dist/lib/browser/ollama-MF7YNEDS.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5020},"dist/lib/browser/ollama-MF7YNEDS.mjs":{"imports":[{"path":"@effect/platform","kind":"import-statement","external":true},{"path":"@tauri-apps/plugin-shell","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-assistant","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/ollama.ts","inputs":{"src/capabilities/ollama.ts":{"bytesInOutput":2461}},"bytes":2576}}}
@@ -0,0 +1,73 @@
1
+ // src/capabilities/ollama.ts
2
+ import { FetchHttpClient, HttpClient } from "@effect/platform";
3
+ import { Command } from "@tauri-apps/plugin-shell";
4
+ import { Context, Effect, Layer, ManagedRuntime } from "effect";
5
+ import { AiServiceRouter } from "@dxos/ai";
6
+ import { contributes } from "@dxos/app-framework";
7
+ import { log } from "@dxos/log";
8
+ import { AssistantCapabilities } from "@dxos/plugin-assistant";
9
+ var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-native/src/capabilities/ollama.ts";
10
+ var OLLAMA_HOST = "http://localhost:21434";
11
+ var ollama_default = (_context) => {
12
+ const runtime = ManagedRuntime.make(OllamaSidecar.layerLive);
13
+ const sidecarLayer = Layer.effectContext(runtime.runtimeEffect.pipe(Effect.map((rt) => rt.context.pipe(Context.pick(OllamaSidecar)))));
14
+ return contributes(AssistantCapabilities.AiModelResolver, OllamaSidecarModelResolver.pipe(Layer.provide(sidecarLayer)), async () => {
15
+ await runtime.dispose();
16
+ });
17
+ };
18
+ var OllamaSidecar = class _OllamaSidecar extends Context.Tag("@dxos/plugin-native/OllamaSidecar")() {
19
+ static layerLive = Layer.scoped(_OllamaSidecar, Effect.gen(function* () {
20
+ const command = Command.sidecar("sidecar/ollama", [
21
+ "serve"
22
+ ], {
23
+ env: {
24
+ OLLAMA_HOST,
25
+ OLLAMA_ORIGINS: "*"
26
+ }
27
+ });
28
+ command.stdout.on("data", (data) => console.log("[ollama]", data.toString()));
29
+ command.stderr.on("data", (data) => console.error("[ollama]", data.toString()));
30
+ command.on("close", (code) => log.info("Ollama process exited", {
31
+ code
32
+ }, {
33
+ F: __dxlog_file,
34
+ L: 53,
35
+ S: this,
36
+ C: (f, a) => f(...a)
37
+ }));
38
+ command.on("error", (error) => log.error("Ollama error", {
39
+ error
40
+ }, {
41
+ F: __dxlog_file,
42
+ L: 54,
43
+ S: this,
44
+ C: (f, a) => f(...a)
45
+ }));
46
+ const child = yield* Effect.promise(() => command.spawn());
47
+ yield* Effect.addFinalizer(Effect.fn(function* () {
48
+ yield* Effect.promise(() => child.kill());
49
+ }));
50
+ log.info("Running ollama", {
51
+ pid: child.pid
52
+ }, {
53
+ F: __dxlog_file,
54
+ L: 61,
55
+ S: this,
56
+ C: (f, a) => f(...a)
57
+ });
58
+ return {
59
+ endpoint: OLLAMA_HOST
60
+ };
61
+ }));
62
+ };
63
+ var OllamaSidecarModelResolver = Layer.unwrapEffect(Effect.gen(function* () {
64
+ const { endpoint } = yield* OllamaSidecar;
65
+ return AiServiceRouter.OllamaResolver({
66
+ host: endpoint,
67
+ transformClient: HttpClient.withTracerPropagation(false)
68
+ });
69
+ })).pipe(Layer.provide(FetchHttpClient.layer));
70
+ export {
71
+ ollama_default as default
72
+ };
73
+ //# sourceMappingURL=ollama-MF7YNEDS.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 { FetchHttpClient, HttpClient } from '@effect/platform';\nimport { Command } from '@tauri-apps/plugin-shell';\nimport { Context, Effect, Layer, ManagedRuntime } from 'effect';\n\nimport { AiServiceRouter } from '@dxos/ai';\nimport { type PluginContext, contributes } from '@dxos/app-framework';\nimport { log } from '@dxos/log';\nimport { AssistantCapabilities } from '@dxos/plugin-assistant';\n\n// Running ollama on non-standard port.\nconst OLLAMA_HOST = 'http://localhost:21434';\n\nexport default (_context: PluginContext) => {\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 contributes(\n AssistantCapabilities.AiModelResolver,\n OllamaSidecarModelResolver.pipe(Layer.provide(sidecarLayer)),\n async () => {\n await 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 command.stdout.on('data', (data) => console.log('[ollama]', data.toString()));\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<AiServiceRouter.AiModelResolver, never, OllamaSidecar> =\n Layer.unwrapEffect(\n Effect.gen(function* () {\n const { endpoint } = yield* OllamaSidecar;\n return AiServiceRouter.OllamaResolver({\n host: endpoint,\n transform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AUjC,IAAIiC,MAAM,gBAAgB;MAAEA;IAAM,GAAA;;;;;;AACjE,UAAMG,QAAQ,OAAOzC,OAAO0C,QAAQ,MAAMd,QAAQe,MAAK,CAAA;AACvD,WAAO3C,OAAO4C,aACZ5C,OAAO6C,GAAG,aAAA;AACR,aAAO7C,OAAO0C,QAAQ,MAAMD,MAAMK,KAAI,CAAA;IACxC,CAAA,CAAA;AAEFzC,QAAImC,KAAK,kBAAkB;MAAEO,KAAKN,MAAMM;IAAI,GAAA;;;;;;AAE5C,WAAO;MACLC,UAAUzC;IACZ;EACF,CAAA,CAAA;AAEJ;AAEA,IAAMe,6BACJrB,MAAMgD,aACJjD,OAAO2B,IAAI,aAAA;AACT,QAAM,EAAEqB,SAAQ,IAAK,OAAOrC;AAC5B,SAAOR,gBAAgB+C,eAAe;IACpCC,MAAMH;IACNI,iBAAiBvD,WAAWwD,sBAAsB,KAAA;EACpD,CAAA;AACF,CAAA,CAAA,EACArC,KAAKf,MAAMsB,QAAQ3B,gBAAgB0D,KAAK,CAAA;",
6
+ "names": ["FetchHttpClient", "HttpClient", "Command", "Context", "Effect", "Layer", "ManagedRuntime", "AiServiceRouter", "contributes", "log", "AssistantCapabilities", "OLLAMA_HOST", "_context", "runtime", "make", "OllamaSidecar", "layerLive", "sidecarLayer", "effectContext", "runtimeEffect", "pipe", "map", "rt", "context", "pick", "AiModelResolver", "OllamaSidecarModelResolver", "provide", "dispose", "Tag", "scoped", "gen", "command", "sidecar", "env", "OLLAMA_ORIGINS", "stdout", "on", "data", "console", "toString", "stderr", "error", "code", "info", "child", "promise", "spawn", "addFinalizer", "fn", "kill", "pid", "endpoint", "unwrapEffect", "OllamaResolver", "host", "transformClient", "withTracerPropagation", "layer"]
7
+ }
@@ -0,0 +1,133 @@
1
+ import {
2
+ NATIVE_PLUGIN
3
+ } from "./chunk-E2JDGVJI.mjs";
4
+
5
+ // src/capabilities/updater.ts
6
+ import { type } from "@tauri-apps/plugin-os";
7
+ import { relaunch } from "@tauri-apps/plugin-process";
8
+ import { check } from "@tauri-apps/plugin-updater";
9
+ import { Duration, Effect, Fiber, Match, Schedule, pipe } from "effect";
10
+ import { Capabilities, LayoutAction, contributes, createIntent } from "@dxos/app-framework";
11
+ import { log } from "@dxos/log";
12
+ var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-native/src/capabilities/updater.ts";
13
+ var SUPPORTS_OTA = [
14
+ "linux",
15
+ "macos",
16
+ "windows"
17
+ ];
18
+ var updater_default = (context) => {
19
+ const platform = type();
20
+ if (!SUPPORTS_OTA.includes(platform)) {
21
+ return contributes(Capabilities.Null, null);
22
+ }
23
+ const { dispatch } = context.getCapability(Capabilities.IntentDispatcher);
24
+ const action = Effect.gen(function* () {
25
+ log.info("checking for updates", void 0, {
26
+ F: __dxlog_file,
27
+ L: 27,
28
+ S: this,
29
+ C: (f, a) => f(...a)
30
+ });
31
+ const update = yield* Effect.tryPromise(() => check());
32
+ log.info("checked for updates", {
33
+ version: update?.version,
34
+ currentVersion: update?.currentVersion
35
+ }, {
36
+ F: __dxlog_file,
37
+ L: 29,
38
+ S: this,
39
+ C: (f, a) => f(...a)
40
+ });
41
+ if (update) {
42
+ log.info("update available", update, {
43
+ F: __dxlog_file,
44
+ L: 31,
45
+ S: this,
46
+ C: (f, a) => f(...a)
47
+ });
48
+ let downloaded = 0;
49
+ let contentLength = 0;
50
+ const handleDownload = Match.type().pipe(Match.when({
51
+ event: "Started"
52
+ }, (event) => {
53
+ contentLength = event.data.contentLength ?? 0;
54
+ log.info("download started", {
55
+ contentLength
56
+ }, {
57
+ F: __dxlog_file,
58
+ L: 38,
59
+ S: this,
60
+ C: (f, a) => f(...a)
61
+ });
62
+ }), Match.when({
63
+ event: "Progress"
64
+ }, (event) => {
65
+ downloaded += event.data.chunkLength;
66
+ log.info("download progress", {
67
+ downloaded,
68
+ contentLength
69
+ }, {
70
+ F: __dxlog_file,
71
+ L: 42,
72
+ S: this,
73
+ C: (f, a) => f(...a)
74
+ });
75
+ }), Match.when({
76
+ event: "Finished"
77
+ }, () => {
78
+ log.info("download completed", void 0, {
79
+ F: __dxlog_file,
80
+ L: 45,
81
+ S: this,
82
+ C: (f, a) => f(...a)
83
+ });
84
+ }), Match.exhaustive);
85
+ yield* Effect.tryPromise(() => update.downloadAndInstall(handleDownload));
86
+ yield* dispatch(createIntent(LayoutAction.AddToast, {
87
+ part: "toast",
88
+ subject: {
89
+ id: `${NATIVE_PLUGIN}/update-ready`,
90
+ title: [
91
+ "update ready label",
92
+ {
93
+ ns: NATIVE_PLUGIN
94
+ }
95
+ ],
96
+ description: [
97
+ "update ready description",
98
+ {
99
+ ns: NATIVE_PLUGIN
100
+ }
101
+ ],
102
+ duration: Infinity,
103
+ actionLabel: [
104
+ "update label",
105
+ {
106
+ ns: NATIVE_PLUGIN
107
+ }
108
+ ],
109
+ actionAlt: [
110
+ "update alt",
111
+ {
112
+ ns: NATIVE_PLUGIN
113
+ }
114
+ ],
115
+ onAction: () => relaunch()
116
+ }
117
+ }));
118
+ }
119
+ });
120
+ const fiber = pipe(
121
+ // prettier-ignore
122
+ action,
123
+ Effect.repeat(Schedule.fixed(Duration.hours(1))),
124
+ Effect.runFork
125
+ );
126
+ return contributes(Capabilities.Null, null, () => {
127
+ Effect.runSync(Fiber.interrupt(fiber));
128
+ });
129
+ };
130
+ export {
131
+ updater_default as default
132
+ };
133
+ //# sourceMappingURL=updater-MCAQYHED.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/updater.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type } from '@tauri-apps/plugin-os';\nimport { relaunch } from '@tauri-apps/plugin-process';\nimport { type DownloadEvent, check } from '@tauri-apps/plugin-updater';\nimport { Duration, Effect, Fiber, Match, Schedule, pipe } from 'effect';\n\nimport { Capabilities, LayoutAction, type PluginContext, contributes, createIntent } from '@dxos/app-framework';\nimport { log } from '@dxos/log';\n\nimport { NATIVE_PLUGIN } from '../meta';\n\nconst SUPPORTS_OTA = ['linux', 'macos', 'windows'];\n\nexport default (context: PluginContext) => {\n const platform = type();\n if (!SUPPORTS_OTA.includes(platform)) {\n return contributes(Capabilities.Null, null);\n }\n\n const { dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n\n // https://tauri.app/plugin/updater/#checking-for-updates\n const action = Effect.gen(function* () {\n log.info('checking for updates');\n const update = yield* Effect.tryPromise(() => check());\n log.info('checked for updates', { version: update?.version, currentVersion: update?.currentVersion });\n if (update) {\n log.info('update available', update);\n let downloaded = 0;\n let contentLength = 0;\n\n const handleDownload = Match.type<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.info('download progress', { downloaded, contentLength });\n }),\n Match.when({ event: 'Finished' }, () => {\n log.info('download completed');\n }),\n Match.exhaustive,\n );\n\n yield* Effect.tryPromise(() => update.downloadAndInstall(handleDownload));\n\n yield* dispatch(\n createIntent(LayoutAction.AddToast, {\n part: 'toast',\n subject: {\n id: `${NATIVE_PLUGIN}/update-ready`,\n title: ['update ready label', { ns: NATIVE_PLUGIN }],\n description: ['update ready description', { ns: NATIVE_PLUGIN }],\n duration: Infinity,\n actionLabel: ['update label', { ns: NATIVE_PLUGIN }],\n actionAlt: ['update alt', { ns: NATIVE_PLUGIN }],\n onAction: () => relaunch(),\n },\n }),\n );\n }\n });\n\n const fiber = pipe(\n // prettier-ignore\n action,\n Effect.repeat(Schedule.fixed(Duration.hours(1))),\n Effect.runFork,\n );\n\n return contributes(Capabilities.Null, null, () => {\n Effect.runSync(Fiber.interrupt(fiber));\n });\n};\n"],
5
+ "mappings": ";;;;;AAIA,SAASA,YAAY;AACrB,SAASC,gBAAgB;AACzB,SAA6BC,aAAa;AAC1C,SAASC,UAAUC,QAAQC,OAAOC,OAAOC,UAAUC,YAAY;AAE/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ACLwB,aAAaC,aAAaC,UAAU;QAClCC,MAAM;QACNC,SAAS;UACPC,IAAI,GAAGC,aAAAA;UACPC,OAAO;YAAC;YAAsB;cAAEC,IAAIF;YAAc;;UAClDG,aAAa;YAAC;YAA4B;cAAED,IAAIF;YAAc;;UAC9DI,UAAUC;UACVC,aAAa;YAAC;YAAgB;cAAEJ,IAAIF;YAAc;;UAClDO,WAAW;YAAC;YAAc;cAAEL,IAAIF;YAAc;;UAC9CQ,UAAU,MAAMC,SAAAA;QAClB;MACF,CAAA,CAAA;IAEJ;EACF,CAAA;AAEA,QAAMC,QAAQvB;;IAEZd;IACAC,OAAOqC,OAAOC,SAASC,MAAMC,SAASC,MAAM,CAAA,CAAA,CAAA;IAC5CzC,OAAO0C;EAAO;AAGhB,SAAOjD,YAAYC,aAAaC,MAAM,MAAM,MAAA;AAC1CK,WAAO2C,QAAQC,MAAMC,UAAUT,KAAAA,CAAAA;EACjC,CAAA;AACF;",
6
+ "names": ["type", "relaunch", "check", "Duration", "Effect", "Fiber", "Match", "Schedule", "pipe", "Capabilities", "LayoutAction", "contributes", "createIntent", "log", "SUPPORTS_OTA", "context", "platform", "type", "includes", "contributes", "Capabilities", "Null", "dispatch", "getCapability", "IntentDispatcher", "action", "Effect", "gen", "log", "info", "update", "tryPromise", "check", "version", "currentVersion", "downloaded", "contentLength", "handleDownload", "Match", "pipe", "when", "event", "data", "chunkLength", "exhaustive", "downloadAndInstall", "createIntent", "LayoutAction", "AddToast", "part", "subject", "id", "NATIVE_PLUGIN", "title", "ns", "description", "duration", "Infinity", "actionLabel", "actionAlt", "onAction", "relaunch", "fiber", "repeat", "Schedule", "fixed", "Duration", "hours", "runFork", "runSync", "Fiber", "interrupt"]
7
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"NativePlugin.d.ts","sourceRoot":"","sources":["../../../src/NativePlugin.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,YAAY,4CAWrB,CAAC"}
1
+ {"version":3,"file":"NativePlugin.d.ts","sourceRoot":"","sources":["../../../src/NativePlugin.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,YAAY,4CAiBrB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const Updater: (props?: import("@dxos/app-framework").PluginContext | undefined) => Promise<() => Promise<import("@dxos/app-framework").Capability<null> | import("@dxos/app-framework").AnyCapability[]>>;
2
+ export declare const Ollama: (props?: import("@dxos/app-framework").PluginContext | undefined) => Promise<() => Promise<import("@dxos/app-framework").Capability<import("effect/Layer").Layer<import("node_modules/@dxos/ai/dist/types/src/AiServiceRouter").AiModelResolver, never, never>> | import("@dxos/app-framework").AnyCapability[]>>;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,OAAO,6LAAkC,CAAC;AACvD,eAAO,MAAM,MAAM,mTAAiC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { Layer } from 'effect';
2
+ import { AiServiceRouter } from '@dxos/ai';
3
+ import { type PluginContext } from '@dxos/app-framework';
4
+ declare const _default: (_context: PluginContext) => import("@dxos/app-framework").Capability<Layer.Layer<AiServiceRouter.AiModelResolver, never, never>>;
5
+ export default _default;
6
+ //# sourceMappingURL=ollama.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ollama.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/ollama.ts"],"names":[],"mappings":"AAMA,OAAO,EAAmB,KAAK,EAAkB,MAAM,QAAQ,CAAC;AAEhE,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,KAAK,aAAa,EAAe,MAAM,qBAAqB,CAAC;yBAOtD,UAAU,aAAa;AAAvC,wBAeE"}
@@ -0,0 +1,4 @@
1
+ import { type PluginContext } from '@dxos/app-framework';
2
+ declare const _default: (context: PluginContext) => import("@dxos/app-framework").Capability<null>;
3
+ export default _default;
4
+ //# sourceMappingURL=updater.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updater.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/updater.ts"],"names":[],"mappings":"AASA,OAAO,EAA8B,KAAK,aAAa,EAA6B,MAAM,qBAAqB,CAAC;yBAOhG,SAAS,aAAa;AAAtC,wBA8DE"}
@@ -0,0 +1,12 @@
1
+ import { meta } from './meta';
2
+ export declare const translations: [{
3
+ readonly 'en-US': {
4
+ readonly [meta.id]: {
5
+ readonly 'update ready label': "Ready to update";
6
+ readonly 'update ready description': "A new version of Composer is available.";
7
+ readonly 'update label': "Update";
8
+ readonly 'update alt': "Relaunch the app to update";
9
+ };
10
+ };
11
+ }];
12
+ //# sourceMappingURL=translations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,eAAO,MAAM,YAAY;;QAGnB,SAAA,CAAC,IAAI,CAAC,EAAE,CAAC;;;;;UAKR;;EAGwB,CAAC"}