@dxos/plugin-native 0.8.4-main.1da679c → 0.8.4-main.1f223c7

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.
@@ -9,9 +9,9 @@ import { AssistantEvents } from "@dxos/plugin-assistant";
9
9
 
10
10
  // src/capabilities/index.ts
11
11
  import { lazy } from "@dxos/app-framework";
12
- var Ollama = lazy(() => import("./ollama-FEWAW35N.mjs"));
13
- var Updater = lazy(() => import("./updater-NS5MWZOK.mjs"));
14
- var Window = lazy(() => import("./window-6G542FZL.mjs"));
12
+ var Ollama = lazy(() => import("./ollama-7VZCJLY5.mjs"));
13
+ var Updater = lazy(() => import("./updater-MNSUJ5ER.mjs"));
14
+ var Window = lazy(() => import("./window-5EBHZJJ4.mjs"));
15
15
 
16
16
  // src/translations.ts
17
17
  var translations = [
@@ -1 +1 @@
1
- {"inputs":{"src/meta.ts":{"bytes":914,"imports":[],"format":"esm"},"src/capabilities/ollama.ts":{"bytes":9874,"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}],"format":"esm"},"src/capabilities/updater.ts":{"bytes":11877,"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/window.ts":{"bytes":5689,"imports":[{"path":"@tauri-apps/api/window","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/index.ts":{"bytes":1148,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/ollama.ts","kind":"dynamic-import","original":"./ollama"},{"path":"src/capabilities/updater.ts","kind":"dynamic-import","original":"./updater"},{"path":"src/capabilities/window.ts","kind":"dynamic-import","original":"./window"}],"format":"esm"},"src/translations.ts":{"bytes":1625,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"src/NativePlugin.tsx":{"bytes":4037,"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":3147},"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/ollama-FEWAW35N.mjs","kind":"dynamic-import"},{"path":"dist/lib/browser/updater-NS5MWZOK.mjs","kind":"dynamic-import"},{"path":"dist/lib/browser/window-6G542FZL.mjs","kind":"dynamic-import"}],"exports":["NATIVE_PLUGIN","NativePlugin","meta"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0},"src/NativePlugin.tsx":{"bytesInOutput":771},"src/capabilities/index.ts":{"bytesInOutput":220},"src/translations.ts":{"bytesInOutput":293}},"bytes":1539},"dist/lib/browser/ollama-FEWAW35N.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5004},"dist/lib/browser/ollama-FEWAW35N.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}],"exports":["default"],"entryPoint":"src/capabilities/ollama.ts","inputs":{"src/capabilities/ollama.ts":{"bytesInOutput":2612}},"bytes":2727},"dist/lib/browser/updater-NS5MWZOK.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5539},"dist/lib/browser/updater-NS5MWZOK.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":3451}},"bytes":3626},"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/window-6G542FZL.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2974},"dist/lib/browser/window-6G542FZL.mjs":{"imports":[{"path":"@tauri-apps/api/window","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/window.ts","inputs":{"src/capabilities/window.ts":{"bytesInOutput":1214}},"bytes":1329}}}
1
+ {"inputs":{"src/meta.ts":{"bytes":914,"imports":[],"format":"esm"},"src/capabilities/ollama.ts":{"bytes":10053,"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/updater.ts":{"bytes":11877,"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/window.ts":{"bytes":5689,"imports":[{"path":"@tauri-apps/api/window","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/index.ts":{"bytes":1148,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/ollama.ts","kind":"dynamic-import","original":"./ollama"},{"path":"src/capabilities/updater.ts","kind":"dynamic-import","original":"./updater"},{"path":"src/capabilities/window.ts","kind":"dynamic-import","original":"./window"}],"format":"esm"},"src/translations.ts":{"bytes":1625,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"src/NativePlugin.tsx":{"bytes":4037,"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":3147},"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/ollama-7VZCJLY5.mjs","kind":"dynamic-import"},{"path":"dist/lib/browser/updater-MNSUJ5ER.mjs","kind":"dynamic-import"},{"path":"dist/lib/browser/window-5EBHZJJ4.mjs","kind":"dynamic-import"}],"exports":["NATIVE_PLUGIN","NativePlugin","meta"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0},"src/NativePlugin.tsx":{"bytesInOutput":771},"src/capabilities/index.ts":{"bytesInOutput":220},"src/translations.ts":{"bytesInOutput":293}},"bytes":1539},"dist/lib/browser/ollama-7VZCJLY5.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5088},"dist/lib/browser/ollama-7VZCJLY5.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":2669}},"bytes":2784},"dist/lib/browser/updater-MNSUJ5ER.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5539},"dist/lib/browser/updater-MNSUJ5ER.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":3449}},"bytes":3624},"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/window-5EBHZJJ4.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2974},"dist/lib/browser/window-5EBHZJJ4.mjs":{"imports":[{"path":"@tauri-apps/api/window","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/window.ts","inputs":{"src/capabilities/window.ts":{"bytesInOutput":1212}},"bytes":1327}}}
@@ -3,8 +3,9 @@ import { FetchHttpClient, HttpClient } from "@effect/platform";
3
3
  import { Command } from "@tauri-apps/plugin-shell";
4
4
  import { Context, Effect, Layer, ManagedRuntime } from "effect";
5
5
  import { AiServiceRouter } from "@dxos/ai";
6
- import { Capabilities, contributes } from "@dxos/app-framework";
6
+ import { contributes } from "@dxos/app-framework";
7
7
  import { log } from "@dxos/log";
8
+ import { AssistantCapabilities } from "@dxos/plugin-assistant";
8
9
  function _define_property(obj, key, value) {
9
10
  if (key in obj) {
10
11
  Object.defineProperty(obj, key, {
@@ -20,13 +21,13 @@ function _define_property(obj, key, value) {
20
21
  }
21
22
  var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-native/src/capabilities/ollama.ts";
22
23
  var OLLAMA_HOST = "http://localhost:21434";
23
- var ollama_default = ((_context) => {
24
+ var ollama_default = (_context) => {
24
25
  const runtime = ManagedRuntime.make(OllamaSidecar.layerLive);
25
26
  const sidecarLayer = Layer.effectContext(runtime.runtimeEffect.pipe(Effect.map((rt) => rt.context.pipe(Context.pick(OllamaSidecar)))));
26
- return contributes(Capabilities.AiModelResolver, OllamaSidecarModelResolver.pipe(Layer.provide(sidecarLayer)), async () => {
27
+ return contributes(AssistantCapabilities.AiModelResolver, OllamaSidecarModelResolver.pipe(Layer.provide(sidecarLayer)), async () => {
27
28
  await runtime.dispose();
28
29
  });
29
- });
30
+ };
30
31
  var _Context_Tag;
31
32
  var OllamaSidecar = class extends (_Context_Tag = Context.Tag("@dxos/plugin-native/OllamaSidecar")()) {
32
33
  };
@@ -45,7 +46,7 @@ _define_property(OllamaSidecar, "layerLive", Layer.scoped(OllamaSidecar, Effect.
45
46
  code
46
47
  }, {
47
48
  F: __dxlog_file,
48
- L: 52,
49
+ L: 53,
49
50
  S: this,
50
51
  C: (f, a) => f(...a)
51
52
  }));
@@ -53,7 +54,7 @@ _define_property(OllamaSidecar, "layerLive", Layer.scoped(OllamaSidecar, Effect.
53
54
  error
54
55
  }, {
55
56
  F: __dxlog_file,
56
- L: 53,
57
+ L: 54,
57
58
  S: this,
58
59
  C: (f, a) => f(...a)
59
60
  }));
@@ -65,7 +66,7 @@ _define_property(OllamaSidecar, "layerLive", Layer.scoped(OllamaSidecar, Effect.
65
66
  pid: child.pid
66
67
  }, {
67
68
  F: __dxlog_file,
68
- L: 60,
69
+ L: 61,
69
70
  S: this,
70
71
  C: (f, a) => f(...a)
71
72
  });
@@ -83,4 +84,4 @@ var OllamaSidecarModelResolver = Layer.unwrapEffect(Effect.gen(function* () {
83
84
  export {
84
85
  ollama_default as default
85
86
  };
86
- //# sourceMappingURL=ollama-FEWAW35N.mjs.map
87
+ //# sourceMappingURL=ollama-7VZCJLY5.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 Capability, 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): Capability<any> => {\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 transformClient: HttpClient.withTracerPropagation(false),\n });\n }),\n ).pipe(Layer.provide(FetchHttpClient.layer));\n"],
5
+ "mappings": ";AAIA,SAASA,iBAAiBC,kBAAkB;AAC5C,SAASC,eAAe;AACxB,SAASC,SAASC,QAAQC,OAAOC,sBAAsB;AAEvD,SAASC,uBAAuB;AAChC,SAA8CC,mBAAmB;AACjE,SAASC,WAAW;AACpB,SAASC,6BAA6B;;;;;;;;;;;;;;;AAGtC,IAAMC,cAAc;AAEpB,IAAA,iBAAe,CAACC,aAAAA;AACd,QAAMC,UAAUP,eAAeQ,KAAKC,cAAcC,SAAS;AAG3D,QAAMC,eAAeZ,MAAMa,cACzBL,QAAQM,cAAcC,KAAKhB,OAAOiB,IAAI,CAACC,OAAOA,GAAGC,QAAQH,KAAKjB,QAAQqB,KAAKT,aAAAA,CAAAA,CAAAA,CAAAA,CAAAA;AAG7E,SAAOP,YACLE,sBAAsBe,iBACtBC,2BAA2BN,KAAKf,MAAMsB,QAAQV,YAAAA,CAAAA,GAC9C,YAAA;AACE,UAAMJ,QAAQe,QAAO;EACvB,CAAA;AAEJ;IAE4BzB;AAA5B,IAAMY,gBAAN,eAA4BZ,eAAAA,QAAQ0B,IAAI,mCAAA,EAAA,GAKtC;AA6BF;AA5BE,iBANId,eAMGC,aAAYX,MAAMyB,OACvBf,eACAX,OAAO2B,IAAI,aAAA;AACT,QAAMC,UAAU9B,QAAQ+B,QAAQ,kBAAkB;IAAC;KAAU;IAC3DC,KAAK;MACHvB;MACAwB,gBAAgB;IAClB;EACF,CAAA;AAGAH,UAAQI,OAAOC,GAAG,QAAQ,CAACC,SAASC,QAAQ9B,IAAI,YAAY6B,KAAKE,SAAQ,CAAA,CAAA;AACzER,UAAQS,OAAOJ,GAAG,QAAQ,CAACC,SAASC,QAAQG,MAAM,YAAYJ,KAAKE,SAAQ,CAAA,CAAA;AAC3ER,UAAQK,GAAG,SAAS,CAACM,SAASlC,IAAImC,KAAK,yBAAyB;IAAED;EAAK,GAAA;;;;;;AACvEX,UAAQK,GAAG,SAAS,CAACK,UAAUjC,IAAIiC,MAAM,gBAAgB;IAAEA;EAAM,GAAA;;;;;;AACjE,QAAMG,QAAQ,OAAOzC,OAAO0C,QAAQ,MAAMd,QAAQe,MAAK,CAAA;AACvD,SAAO3C,OAAO4C,aACZ5C,OAAO6C,GAAG,aAAA;AACR,WAAO7C,OAAO0C,QAAQ,MAAMD,MAAMK,KAAI,CAAA;EACxC,CAAA,CAAA;AAEFzC,MAAImC,KAAK,kBAAkB;IAAEO,KAAKN,MAAMM;EAAI,GAAA;;;;;;AAE5C,SAAO;IACLC,UAAUzC;EACZ;AACF,CAAA,CAAA,CAAA;AAIJ,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
+ }
@@ -15,7 +15,7 @@ var SUPPORTS_OTA = [
15
15
  "macos",
16
16
  "windows"
17
17
  ];
18
- var updater_default = ((context) => {
18
+ var updater_default = (context) => {
19
19
  const platform = type();
20
20
  if (!SUPPORTS_OTA.includes(platform) || window.location.hostname === "localhost") {
21
21
  return contributes(Capabilities.Null, null);
@@ -126,8 +126,8 @@ var updater_default = ((context) => {
126
126
  return contributes(Capabilities.Null, null, () => {
127
127
  Effect.runSync(Fiber.interrupt(fiber));
128
128
  });
129
- });
129
+ };
130
130
  export {
131
131
  updater_default as default
132
132
  };
133
- //# sourceMappingURL=updater-NS5MWZOK.mjs.map
133
+ //# sourceMappingURL=updater-MNSUJ5ER.mjs.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/capabilities/updater.ts"],
4
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 // Skip updates if not supported or in dev mode.\n const platform = type();\n if (!SUPPORTS_OTA.includes(platform) || window.location.hostname === 'localhost') {\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.verbose('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/D,SAASC,cAAcC,cAAkCC,aAAaC,oBAAoB;AAC1F,SAASC,WAAW;;AAIpB,IAAMC,eAAe;EAAC;EAAS;EAAS;;AAExC,IAAA,mBAAe,CAACC,YAAAA;AAEd,QAAMC,WAAWC,KAAAA;AACjB,MAAI,CAACH,aAAaI,SAASF,QAAAA,KAAaG,OAAOC,SAASC,aAAa,aAAa;AAChF,WAAOC,YAAYC,aAAaC,MAAM,IAAA;EACxC;AAEA,QAAM,EAAEC,SAAQ,IAAKV,QAAQW,cA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BAAgBK,MAAMC,KAAKN,iBAAiB;AAC5CR,YAAIC,KAAK,oBAAoB;UAAEO;QAAc,GAAA;;;;;;MAC/C,CAAA,GACAE,MAAME,KAAK;QAAEC,OAAO;MAAW,GAAG,CAACA,UAAAA;AACjCN,sBAAcM,MAAMC,KAAKC;AACzBf,YAAIgB,QAAQ,qBAAqB;UAAET;UAAYC;QAAc,GAAA;;;;;;MAC/D,CAAA,GACAE,MAAME,KAAK;QAAEC,OAAO;MAAW,GAAG,MAAA;AAChCb,YAAIC,KAAK,sBAAA,QAAA;;;;;;MACX,CAAA,GACAS,MAAMO,UAAU;AAGlB,aAAOnB,OAAOK,WAAW,MAAMD,OAAOgB,mBAAmBT,cAAAA,CAAAA;AAEzD,aAAOf,SACLyB,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,QAAQxB;;IAEZd;IACAC,OAAOsC,OAAOC,SAASC,MAAMC,SAASC,MAAM,CAAA,CAAA,CAAA;IAC5C1C,OAAO2C;EAAO;AAGhB,SAAOlD,YAAYC,aAAaC,MAAM,MAAM,MAAA;AAC1CK,WAAO4C,QAAQC,MAAMC,UAAUT,KAAAA,CAAAA;EACjC,CAAA;AACF;",
6
6
  "names": ["type", "relaunch", "check", "Duration", "Effect", "Fiber", "Match", "Schedule", "pipe", "Capabilities", "LayoutAction", "contributes", "createIntent", "log", "SUPPORTS_OTA", "context", "platform", "type", "includes", "window", "location", "hostname", "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", "verbose", "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
7
  }
@@ -1,7 +1,7 @@
1
1
  // src/capabilities/window.ts
2
2
  import { LogicalPosition, LogicalSize, getCurrentWindow } from "@tauri-apps/api/window";
3
3
  import { Capabilities, contributes } from "@dxos/app-framework";
4
- var window_default = ((_context) => {
4
+ var window_default = (_context) => {
5
5
  return contributes(Capabilities.Null, null, () => {
6
6
  const appWindow = getCurrentWindow();
7
7
  async function saveWindowState() {
@@ -27,8 +27,8 @@ var window_default = ((_context) => {
27
27
  document.addEventListener("DOMContentLoaded", restoreWindowState);
28
28
  window.addEventListener("beforeunload", saveWindowState);
29
29
  });
30
- });
30
+ };
31
31
  export {
32
32
  window_default as default
33
33
  };
34
- //# sourceMappingURL=window-6G542FZL.mjs.map
34
+ //# sourceMappingURL=window-5EBHZJJ4.mjs.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/capabilities/window.ts"],
4
4
  "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { LogicalPosition, LogicalSize, getCurrentWindow } from '@tauri-apps/api/window';\n\nimport { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';\n\nexport default (_context: PluginContext) => {\n return contributes(Capabilities.Null, null, () => {\n const appWindow = getCurrentWindow();\n\n // Save window state to localStorage.\n async function saveWindowState() {\n const size = await appWindow.innerSize();\n const position = await appWindow.innerPosition();\n localStorage.setItem(\n 'windowState',\n JSON.stringify({\n width: size.width,\n height: size.height,\n x: position.x,\n y: position.y,\n }),\n );\n }\n\n // Restore window state from localStorage.\n async function restoreWindowState() {\n const savedState = localStorage.getItem('windowState');\n if (savedState) {\n const state = JSON.parse(savedState);\n\n await appWindow.setSize(new LogicalSize(state.width, state.height));\n await appWindow.setPosition(new LogicalPosition(state.x, state.y));\n }\n }\n\n // Listen for window events and save state.\n void appWindow.listen('tauri://resize', saveWindowState);\n void appWindow.listen('tauri://move', saveWindowState);\n\n // Restore state when app loads.\n document.addEventListener('DOMContentLoaded', restoreWindowState);\n\n // Save state before closing.\n window.addEventListener('beforeunload', saveWindowState);\n });\n};\n"],
5
- "mappings": ";AAIA,SAASA,iBAAiBC,aAAaC,wBAAwB;AAE/D,SAASC,cAAkCC,mBAAmB;AAE9D,IAAA,kBAAe,CAACC,aAAAA;AACd,SAAOC,YAAYC,aAAaC,MAAM,MAAM,MAAA;AAC1C,UAAMC,YAAYC,iBAAAA;AAGlB,mBAAeC,kBAAAA;AACb,YAAMC,OAAO,MAAMH,UAAUI,UAAS;AACtC,YAAMC,WAAW,MAAML,UAAUM,cAAa;AAC9CC,mBAAaC,QACX,eACAC,KAAKC,UAAU;QACbC,OAAOR,KAAKQ;QACZC,QAAQT,KAAKS;QACbC,GAAGR,SAASQ;QACZC,GAAGT,SAASS;MACd,CAAA,CAAA;IAEJ;AAGA,mBAAeC,qBAAAA;AACb,YAAMC,aAAaT,aAAaU,QAAQ,aAAA;AACxC,UAAID,YAAY;AACd,cAAME,QAAQT,KAAKU,MAAMH,UAAAA;AAEzB,cAAMhB,UAAUoB,QAAQ,IAAIC,YAAYH,MAAMP,OAAOO,MAAMN,MAAM,CAAA;AACjE,cAAMZ,UAAUsB,YAAY,IAAIC,gBAAgBL,MAAML,GAAGK,MAAMJ,CAAC,CAAA;MAClE;IACF;AAGA,SAAKd,UAAUwB,OAAO,kBAAkBtB,eAAAA;AACxC,SAAKF,UAAUwB,OAAO,gBAAgBtB,eAAAA;AAGtCuB,aAASC,iBAAiB,oBAAoBX,kBAAAA;AAG9CY,WAAOD,iBAAiB,gBAAgBxB,eAAAA;EAC1C,CAAA;AACF;",
5
+ "mappings": ";AAIA,SAASA,iBAAiBC,aAAaC,wBAAwB;AAE/D,SAASC,cAAkCC,mBAAmB;AAE9D,IAAA,iBAAe,CAACC,aAAAA;AACd,SAAOC,YAAYC,aAAaC,MAAM,MAAM,MAAA;AAC1C,UAAMC,YAAYC,iBAAAA;AAGlB,mBAAeC,kBAAAA;AACb,YAAMC,OAAO,MAAMH,UAAUI,UAAS;AACtC,YAAMC,WAAW,MAAML,UAAUM,cAAa;AAC9CC,mBAAaC,QACX,eACAC,KAAKC,UAAU;QACbC,OAAOR,KAAKQ;QACZC,QAAQT,KAAKS;QACbC,GAAGR,SAASQ;QACZC,GAAGT,SAASS;MACd,CAAA,CAAA;IAEJ;AAGA,mBAAeC,qBAAAA;AACb,YAAMC,aAAaT,aAAaU,QAAQ,aAAA;AACxC,UAAID,YAAY;AACd,cAAME,QAAQT,KAAKU,MAAMH,UAAAA;AAEzB,cAAMhB,UAAUoB,QAAQ,IAAIC,YAAYH,MAAMP,OAAOO,MAAMN,MAAM,CAAA;AACjE,cAAMZ,UAAUsB,YAAY,IAAIC,gBAAgBL,MAAML,GAAGK,MAAMJ,CAAC,CAAA;MAClE;IACF;AAGA,SAAKd,UAAUwB,OAAO,kBAAkBtB,eAAAA;AACxC,SAAKF,UAAUwB,OAAO,gBAAgBtB,eAAAA;AAGtCuB,aAASC,iBAAiB,oBAAoBX,kBAAAA;AAG9CY,WAAOD,iBAAiB,gBAAgBxB,eAAAA;EAC1C,CAAA;AACF;",
6
6
  "names": ["LogicalPosition", "LogicalSize", "getCurrentWindow", "Capabilities", "contributes", "_context", "contributes", "Capabilities", "Null", "appWindow", "getCurrentWindow", "saveWindowState", "size", "innerSize", "position", "innerPosition", "localStorage", "setItem", "JSON", "stringify", "width", "height", "x", "y", "restoreWindowState", "savedState", "getItem", "state", "parse", "setSize", "LogicalSize", "setPosition", "LogicalPosition", "listen", "document", "addEventListener", "window"]
7
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ollama.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/ollama.ts"],"names":[],"mappings":"AASA,OAAO,EAAgB,KAAK,UAAU,EAAE,KAAK,aAAa,EAAe,MAAM,qBAAqB,CAAC;yBAMrF,UAAU,aAAa,KAAG,UAAU,CAAC,GAAG,CAAC;AAAzD,wBAeE"}
1
+ {"version":3,"file":"ollama.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/ollama.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,aAAa,EAAe,MAAM,qBAAqB,CAAC;yBAOvE,UAAU,aAAa,KAAG,UAAU,CAAC,GAAG,CAAC;AAAzD,wBAeE"}