@dxos/plugin-native 0.9.1-main.c7dcc2e112 → 0.9.1-staging.ee54ba693a

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.
Files changed (44) hide show
  1. package/dist/lib/neutral/{NativeSettings-EYX4X3D3.mjs → NativeSettings-33K63AVG.mjs} +15 -8
  2. package/dist/lib/neutral/NativeSettings-33K63AVG.mjs.map +7 -0
  3. package/dist/lib/neutral/capabilities/index.mjs +2 -2
  4. package/dist/lib/neutral/{components → containers}/index.mjs +2 -2
  5. package/dist/lib/neutral/{components → containers}/index.mjs.map +1 -1
  6. package/dist/lib/neutral/meta.json +1 -1
  7. package/dist/lib/neutral/ollama-HZEXAT2P.mjs +312 -0
  8. package/dist/lib/neutral/ollama-HZEXAT2P.mjs.map +7 -0
  9. package/dist/lib/neutral/{react-surface-BVH3ZPG5.mjs → react-surface-YST5DQA3.mjs} +2 -2
  10. package/dist/lib/neutral/{react-surface-BVH3ZPG5.mjs.map → react-surface-YST5DQA3.mjs.map} +1 -1
  11. package/dist/lib/neutral/translations.mjs +0 -1
  12. package/dist/lib/neutral/translations.mjs.map +2 -2
  13. package/dist/types/src/capabilities/index.d.ts +1 -1
  14. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  15. package/dist/types/src/capabilities/ollama.d.ts +3 -2
  16. package/dist/types/src/capabilities/ollama.d.ts.map +1 -1
  17. package/dist/types/src/capabilities/react-surface.d.ts +1 -1
  18. package/dist/types/src/capabilities/settings.d.ts +1 -3
  19. package/dist/types/src/capabilities/settings.d.ts.map +1 -1
  20. package/dist/types/src/capabilities/spotlight-listener.d.ts +1 -1
  21. package/dist/types/src/capabilities/updater.d.ts +1 -2
  22. package/dist/types/src/capabilities/updater.d.ts.map +1 -1
  23. package/dist/types/src/{components → containers}/NativeSettings/NativeSettings.d.ts +1 -1
  24. package/dist/types/src/containers/NativeSettings/NativeSettings.d.ts.map +1 -0
  25. package/dist/types/src/{components → containers}/NativeSettings/index.d.ts.map +1 -1
  26. package/dist/types/src/{components → containers}/index.d.ts.map +1 -1
  27. package/dist/types/src/meta.d.ts +4 -0
  28. package/dist/types/src/meta.d.ts.map +1 -1
  29. package/dist/types/src/translations.d.ts +0 -1
  30. package/dist/types/src/translations.d.ts.map +1 -1
  31. package/dist/types/tsconfig.tsbuildinfo +1 -1
  32. package/package.json +24 -24
  33. package/src/capabilities/ollama.ts +281 -16
  34. package/src/capabilities/react-surface.tsx +1 -1
  35. package/src/{components → containers}/NativeSettings/NativeSettings.tsx +14 -9
  36. package/src/translations.ts +0 -1
  37. package/dist/lib/neutral/NativeSettings-EYX4X3D3.mjs.map +0 -7
  38. package/dist/lib/neutral/ollama-BHWFTROM.mjs +0 -62
  39. package/dist/lib/neutral/ollama-BHWFTROM.mjs.map +0 -7
  40. package/dist/types/src/components/NativeSettings/NativeSettings.d.ts.map +0 -1
  41. /package/dist/types/src/{components → containers}/NativeSettings/index.d.ts +0 -0
  42. /package/dist/types/src/{components → containers}/index.d.ts +0 -0
  43. /package/src/{components → containers}/NativeSettings/index.ts +0 -0
  44. /package/src/{components → containers}/index.ts +0 -0
@@ -1,13 +1,14 @@
1
1
  import "./chunk-J5LGTIGS.mjs";
2
2
 
3
- // src/components/NativeSettings/NativeSettings.tsx
3
+ // src/containers/NativeSettings/NativeSettings.tsx
4
4
  import { useAtomValue } from "@effect-atom/atom-react";
5
5
  import { formatDistanceToNow } from "date-fns/formatDistanceToNow";
6
6
  import * as Match from "effect/Match";
7
+ import * as Schema from "effect/Schema";
7
8
  import React, { useState } from "react";
8
9
  import { useCapability } from "@dxos/app-framework/ui";
9
10
  import { Button, useTranslation } from "@dxos/react-ui";
10
- import { Settings as SettingsForm } from "@dxos/react-ui-form";
11
+ import { Form } from "@dxos/react-ui-form";
11
12
  import { meta } from "#meta";
12
13
  import { NativeCapabilities } from "#types";
13
14
  var NativeSettings = (_props) => {
@@ -28,12 +29,18 @@ var NativeSettings = (_props) => {
28
29
  onInstall: runAction("install", manager.install),
29
30
  onRelaunch: runAction("relaunch", manager.relaunch)
30
31
  });
31
- return /* @__PURE__ */ React.createElement(SettingsForm.Viewport, null, /* @__PURE__ */ React.createElement(SettingsForm.Section, {
32
- title: t("settings.title")
33
- }, /* @__PURE__ */ React.createElement(SettingsForm.Item, {
34
- title: t("settings.updates.label"),
32
+ return /* @__PURE__ */ React.createElement(Form.Root, {
33
+ schema: Schema.Struct({}),
34
+ values: {},
35
+ variant: "settings"
36
+ }, /* @__PURE__ */ React.createElement(Form.Viewport, {
37
+ scroll: true
38
+ }, /* @__PURE__ */ React.createElement(Form.Content, null, /* @__PURE__ */ React.createElement(Form.Section, {
39
+ title: meta.profile.name ?? meta.profile.key
40
+ }, /* @__PURE__ */ React.createElement(Form.Row, {
41
+ label: t("settings.updates.label"),
35
42
  description
36
- }, button)));
43
+ }, button)))));
37
44
  };
38
45
  var renderUpdateRow = (status, pending, t, { onCheck, onInstall, onRelaunch }) => {
39
46
  const isChecking = pending === "check" || status.kind === "checking";
@@ -110,4 +117,4 @@ var renderUpdateRow = (status, pending, t, { onCheck, onInstall, onRelaunch }) =
110
117
  export {
111
118
  NativeSettings as default
112
119
  };
113
- //# sourceMappingURL=NativeSettings-EYX4X3D3.mjs.map
120
+ //# sourceMappingURL=NativeSettings-33K63AVG.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/containers/NativeSettings/NativeSettings.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { useAtomValue } from '@effect-atom/atom-react';\nimport { formatDistanceToNow } from 'date-fns/formatDistanceToNow';\nimport * as Match from 'effect/Match';\nimport * as Schema from 'effect/Schema';\nimport React, { type ReactNode, useState } from 'react';\n\nimport { useCapability } from '@dxos/app-framework/ui';\nimport { type AppSurface } from '@dxos/app-toolkit/ui';\nimport { Button, useTranslation } from '@dxos/react-ui';\nimport { Form } from '@dxos/react-ui-form';\n\nimport { meta } from '#meta';\nimport { NativeCapabilities, type Settings, type Update } from '#types';\n\nexport type NativeSettingsProps = AppSurface.SettingsProps<Settings.Settings>;\n\ntype Pending = null | 'check' | 'install' | 'relaunch';\n\ntype UpdateActions = {\n onCheck: () => Promise<void>;\n onInstall: () => Promise<void>;\n onRelaunch: () => Promise<void>;\n};\n\ntype UpdateRow = { description: string; button: ReactNode };\n\nexport const NativeSettings = (_props: NativeSettingsProps) => {\n const { t } = useTranslation(meta.profile.key);\n const manager = useCapability(NativeCapabilities.UpdateManager);\n const status = useAtomValue(manager.status);\n\n // UI-level pending flag. The status atom can flip between `checking` and `up-to-date` faster\n // than the user can perceive, so we also gate the button on the click handler's lifetime to\n // guarantee no duplicate triggers and a visible busy state.\n const [pending, setPending] = useState<Pending>(null);\n\n const runAction = (kind: Exclude<Pending, null>, action: () => Promise<void>) => async () => {\n setPending(kind);\n try {\n await action();\n } finally {\n setPending(null);\n }\n };\n\n const { description, button } = renderUpdateRow(status, pending, t, {\n onCheck: runAction('check', manager.check),\n onInstall: runAction('install', manager.install),\n onRelaunch: runAction('relaunch', manager.relaunch),\n });\n\n return (\n <Form.Root schema={Schema.Struct({})} values={{}} variant='settings'>\n <Form.Viewport scroll>\n <Form.Content>\n <Form.Section title={meta.profile.name ?? meta.profile.key}>\n <Form.Row label={t('settings.updates.label')} description={description}>\n {button}\n </Form.Row>\n </Form.Section>\n </Form.Content>\n </Form.Viewport>\n </Form.Root>\n );\n};\n\nconst renderUpdateRow = (\n status: Update.Status,\n pending: Pending,\n t: (key: string, options?: Record<string, unknown>) => string,\n { onCheck, onInstall, onRelaunch }: UpdateActions,\n): UpdateRow => {\n const isChecking = pending === 'check' || status.kind === 'checking';\n const isInstalling = pending === 'install' || status.kind === 'downloading';\n\n const checkButton = (disabled = false) => (\n <Button disabled={disabled || isChecking || isInstalling || pending === 'relaunch'} onClick={() => void onCheck()}>\n {isChecking ? t('settings.updates.checking.label') : t('settings.updates.check.label')}\n </Button>\n );\n\n return Match.value(status).pipe(\n Match.withReturnType<UpdateRow>(),\n Match.when({ kind: 'unsupported' }, () => ({\n description: t('settings.updates.unsupported.message'),\n button: checkButton(true),\n })),\n Match.when({ kind: 'idle' }, () => ({\n description: isChecking ? t('settings.updates.checking.message') : t('settings.updates.idle.message'),\n button: checkButton(),\n })),\n Match.when({ kind: 'checking' }, () => ({\n description: t('settings.updates.checking.message'),\n button: checkButton(),\n })),\n Match.when({ kind: 'up-to-date' }, (s) => ({\n description: isChecking\n ? t('settings.updates.checking.message')\n : t('settings.updates.up-to-date.message', {\n checkedAt: formatDistanceToNow(new Date(s.checkedAt), { addSuffix: true }),\n }),\n button: checkButton(),\n })),\n Match.when({ kind: 'available' }, (s) => ({\n description: t('settings.updates.available.message', { version: s.version }),\n button: (\n <Button variant='primary' disabled={isInstalling} onClick={() => void onInstall()}>\n {isInstalling ? t('settings.updates.downloading.label') : t('settings.updates.update-now.label')}\n </Button>\n ),\n })),\n Match.when({ kind: 'downloading' }, (s) => {\n const percent = s.contentLength > 0 ? Math.round((s.downloaded / s.contentLength) * 100) : 0;\n return {\n description: t('settings.updates.downloading.message', { percent }),\n button: <Button disabled>{t('settings.updates.downloading.label')}</Button>,\n };\n }),\n Match.when({ kind: 'ready' }, () => ({\n description: t('settings.updates.ready.message'),\n button: (\n <Button variant='primary' disabled={pending === 'relaunch'} onClick={() => void onRelaunch()}>\n {t('settings.updates.relaunch.label')}\n </Button>\n ),\n })),\n Match.when({ kind: 'failed' }, (s) => ({\n description: t('settings.updates.failed.message', { error: s.error }),\n button: checkButton(),\n })),\n Match.exhaustive,\n );\n};\n"],
5
+ "mappings": "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",
6
+ "names": ["useAtomValue", "formatDistanceToNow", "Match", "Schema", "React", "useState", "useCapability", "Button", "useTranslation", "Form", "meta", "NativeCapabilities", "NativeSettings", "_props", "t", "profile", "key", "manager", "UpdateManager", "status", "pending", "setPending", "runAction", "kind", "action", "description", "button", "renderUpdateRow", "onCheck", "check", "onInstall", "install", "onRelaunch", "relaunch", "Root", "schema", "Struct", "values", "variant", "Viewport", "scroll", "Content", "Section", "title", "name", "Row", "label", "isChecking", "isInstalling", "checkButton", "disabled", "onClick", "value", "pipe", "withReturnType", "when", "s", "checkedAt", "Date", "addSuffix", "version", "percent", "contentLength", "Math", "round", "downloaded", "error", "exhaustive"]
7
+ }
@@ -3,8 +3,8 @@ import "../chunk-J5LGTIGS.mjs";
3
3
  // src/capabilities/index.ts
4
4
  import { Capability } from "@dxos/app-framework";
5
5
  var NativeSettings = Capability.lazy("NativeSettings", () => import("../settings-S5MFUI42.mjs"));
6
- var Ollama = Capability.lazy("Ollama", () => import("../ollama-BHWFTROM.mjs"));
7
- var ReactSurface = Capability.lazy("ReactSurface", () => import("../react-surface-BVH3ZPG5.mjs"));
6
+ var Ollama = Capability.lazy("Ollama", () => import("../ollama-HZEXAT2P.mjs"));
7
+ var ReactSurface = Capability.lazy("ReactSurface", () => import("../react-surface-YST5DQA3.mjs"));
8
8
  var SpotlightListener = Capability.lazy("SpotlightListener", () => import("../spotlight-listener-K7S6LGL3.mjs"));
9
9
  var Updater = Capability.lazy("Updater", () => import("../updater-5ETKR4S3.mjs"));
10
10
  export {
@@ -1,8 +1,8 @@
1
1
  import "../chunk-J5LGTIGS.mjs";
2
2
 
3
- // src/components/index.ts
3
+ // src/containers/index.ts
4
4
  import { lazy } from "react";
5
- var NativeSettings = lazy(() => import("../NativeSettings-EYX4X3D3.mjs"));
5
+ var NativeSettings = lazy(() => import("../NativeSettings-33K63AVG.mjs"));
6
6
  export {
7
7
  NativeSettings
8
8
  };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../src/components/index.ts"],
3
+ "sources": ["../../../../src/containers/index.ts"],
4
4
  "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type ComponentType, lazy } from 'react';\n\nexport const NativeSettings: ComponentType<any> = lazy(() => import('./NativeSettings'));\n"],
5
5
  "mappings": ";;;AAIA,SAA6BA,YAAY;AAElC,IAAMC,iBAAqCD,KAAK,MAAM,OAAO,gCAAA,CAAA;",
6
6
  "names": ["lazy", "NativeSettings"]
@@ -1 +1 @@
1
- {"inputs":{"dx.config.ts":{"bytes":3550,"imports":[{"path":"@dxos/app-framework/config","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/meta.ts":{"bytes":1063,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dx.config.ts","kind":"import-statement","original":"../dx.config"}],"format":"esm"},"src/index.ts":{"bytes":368,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"raw-loader:/__w/dxos/dxos/packages/plugins/plugin-native/PLUGIN.mdl":{"bytes":9088,"imports":[]},"src/NativePlugin.tsx":{"bytes":5043,"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},{"path":"raw-loader:/__w/dxos/dxos/packages/plugins/plugin-native/PLUGIN.mdl","kind":"import-statement","original":"../PLUGIN.mdl?raw"}],"format":"esm"},"src/capabilities/settings.ts":{"bytes":3132,"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/effect","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","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/react-surface.tsx":{"bytes":3619,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit/ui","kind":"import-statement","external":true},{"path":"#components","kind":"import-statement","external":true},{"path":"#meta","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":25131,"imports":[{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"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":"#types","kind":"import-statement","external":true},{"path":"src/constants.ts","kind":"import-statement","original":"../constants"}],"format":"esm"},"src/capabilities/index.ts":{"bytes":2057,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/settings.ts","kind":"dynamic-import","original":"./settings"},{"path":"src/capabilities/ollama.ts","kind":"dynamic-import","original":"./ollama"},{"path":"src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"},{"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/components/NativeSettings/NativeSettings.tsx":{"bytes":16337,"imports":[{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"date-fns/formatDistanceToNow","kind":"import-statement","external":true},{"path":"effect/Match","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"format":"esm"},"src/components/NativeSettings/index.ts":{"bytes":518,"imports":[{"path":"src/components/NativeSettings/NativeSettings.tsx","kind":"import-statement","original":"./NativeSettings"}],"format":"esm"},"src/components/index.ts":{"bytes":714,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/components/NativeSettings/index.ts","kind":"dynamic-import","original":"./NativeSettings"}],"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":4520,"imports":[{"path":"#meta","kind":"import-statement","external":true}],"format":"esm"},"src/types/NativeCapabilities.ts":{"bytes":1933,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"format":"esm"},"src/types/Settings.ts":{"bytes":880,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true}],"format":"esm"},"src/types/Update.ts":{"bytes":1080,"imports":[],"format":"esm"},"src/types/index.ts":{"bytes":796,"imports":[{"path":"src/types/NativeCapabilities.ts","kind":"import-statement","original":"./NativeCapabilities"},{"path":"src/types/Settings.ts","kind":"import-statement","original":"./Settings"},{"path":"src/types/Update.ts","kind":"import-statement","original":"./Update"}],"format":"esm"}},"outputs":{"dist/lib/neutral/settings-S5MFUI42.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1598},"dist/lib/neutral/settings-S5MFUI42.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"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/effect","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/settings.ts","inputs":{"src/capabilities/settings.ts":{"bytesInOutput":724}},"bytes":877},"dist/lib/neutral/ollama-BHWFTROM.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5093},"dist/lib/neutral/ollama-BHWFTROM.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"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":2730},"dist/lib/neutral/react-surface-BVH3ZPG5.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1887},"dist/lib/neutral/react-surface-BVH3ZPG5.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit/ui","kind":"import-statement","external":true},{"path":"#components","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/react-surface.tsx","inputs":{"src/capabilities/react-surface.tsx":{"bytesInOutput":838}},"bytes":1007},"dist/lib/neutral/spotlight-listener-K7S6LGL3.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3118},"dist/lib/neutral/spotlight-listener-K7S6LGL3.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"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":1933},"dist/lib/neutral/updater-5ETKR4S3.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":11859},"dist/lib/neutral/updater-5ETKR4S3.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"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":"#types","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/updater.ts","inputs":{"src/capabilities/updater.ts":{"bytesInOutput":6475},"src/constants.ts":{"bytesInOutput":36}},"bytes":6714},"dist/lib/neutral/NativeSettings-EYX4X3D3.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":8557},"dist/lib/neutral/NativeSettings-EYX4X3D3.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"date-fns/formatDistanceToNow","kind":"import-statement","external":true},{"path":"effect/Match","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/components/NativeSettings/index.ts","inputs":{"src/components/NativeSettings/NativeSettings.tsx":{"bytesInOutput":4060},"src/components/NativeSettings/index.ts":{"bytesInOutput":0}},"bytes":4237},"dist/lib/neutral/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-WU6IZ56J.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"}],"exports":["meta"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0}},"bytes":132},"dist/lib/neutral/NativePlugin.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":12637},"dist/lib/neutral/NativePlugin.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"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":1146},"raw-loader:/__w/dxos/dxos/packages/plugins/plugin-native/PLUGIN.mdl":{"bytesInOutput":9802}},"bytes":11205},"dist/lib/neutral/capabilities/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1081},"dist/lib/neutral/capabilities/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/neutral/settings-S5MFUI42.mjs","kind":"dynamic-import"},{"path":"dist/lib/neutral/ollama-BHWFTROM.mjs","kind":"dynamic-import"},{"path":"dist/lib/neutral/react-surface-BVH3ZPG5.mjs","kind":"dynamic-import"},{"path":"dist/lib/neutral/spotlight-listener-K7S6LGL3.mjs","kind":"dynamic-import"},{"path":"dist/lib/neutral/updater-5ETKR4S3.mjs","kind":"dynamic-import"}],"exports":["NativeSettings","Ollama","ReactSurface","SpotlightListener","Updater"],"entryPoint":"src/capabilities/index.ts","inputs":{"src/capabilities/index.ts":{"bytesInOutput":524}},"bytes":708},"dist/lib/neutral/components/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":404},"dist/lib/neutral/components/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"dist/lib/neutral/NativeSettings-EYX4X3D3.mjs","kind":"dynamic-import"}],"exports":["NativeSettings"],"entryPoint":"src/components/index.ts","inputs":{"src/components/index.ts":{"bytesInOutput":105}},"bytes":229},"dist/lib/neutral/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/meta.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-WU6IZ56J.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"}],"exports":["meta"],"entryPoint":"src/meta.ts","inputs":{},"bytes":131},"dist/lib/neutral/plugin.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":440},"dist/lib/neutral/plugin.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-WU6IZ56J.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.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":268},"dist/lib/neutral/chunk-WU6IZ56J.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2076},"dist/lib/neutral/chunk-WU6IZ56J.mjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/config","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["meta"],"inputs":{"src/meta.ts":{"bytesInOutput":102},"dx.config.ts":{"bytesInOutput":1183}},"bytes":1397},"dist/lib/neutral/translations.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2083},"dist/lib/neutral/translations.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"#meta","kind":"import-statement","external":true}],"exports":["translations"],"entryPoint":"src/translations.ts","inputs":{"src/translations.ts":{"bytesInOutput":1423}},"bytes":1547},"dist/lib/neutral/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2053},"dist/lib/neutral/types/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true}],"exports":["NativeCapabilities","Settings","Update"],"entryPoint":"src/types/index.ts","inputs":{"src/types/NativeCapabilities.ts":{"bytesInOutput":386},"src/types/index.ts":{"bytesInOutput":0},"src/types/Settings.ts":{"bytesInOutput":180},"src/types/Update.ts":{"bytesInOutput":25}},"bytes":887},"dist/lib/neutral/chunk-J5LGTIGS.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/chunk-J5LGTIGS.mjs":{"imports":[],"exports":["__export"],"inputs":{},"bytes":235}}}
1
+ {"inputs":{"dx.config.ts":{"bytes":3550,"imports":[{"path":"@dxos/app-framework/config","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/meta.ts":{"bytes":1063,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dx.config.ts","kind":"import-statement","original":"../dx.config"}],"format":"esm"},"src/index.ts":{"bytes":368,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"raw-loader:/__w/dxos/dxos/packages/plugins/plugin-native/PLUGIN.mdl":{"bytes":9088,"imports":[]},"src/NativePlugin.tsx":{"bytes":5043,"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},{"path":"raw-loader:/__w/dxos/dxos/packages/plugins/plugin-native/PLUGIN.mdl","kind":"import-statement","original":"../PLUGIN.mdl?raw"}],"format":"esm"},"src/capabilities/settings.ts":{"bytes":3132,"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/effect","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/ollama.ts":{"bytes":50796,"imports":[{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"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/Cause","kind":"import-statement","external":true},{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Duration","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Either","kind":"import-statement","external":true},{"path":"effect/Exit","kind":"import-statement","external":true},{"path":"effect/Fiber","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/ManagedRuntime","kind":"import-statement","external":true},{"path":"effect/Schedule","kind":"import-statement","external":true},{"path":"effect/Stream","kind":"import-statement","external":true},{"path":"@dxos/ai","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},{"path":"@dxos/plugin-assistant","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/react-surface.tsx":{"bytes":3619,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit/ui","kind":"import-statement","external":true},{"path":"#containers","kind":"import-statement","external":true},{"path":"#meta","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":25131,"imports":[{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"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":"#types","kind":"import-statement","external":true},{"path":"src/constants.ts","kind":"import-statement","original":"../constants"}],"format":"esm"},"src/capabilities/index.ts":{"bytes":2057,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/settings.ts","kind":"dynamic-import","original":"./settings"},{"path":"src/capabilities/ollama.ts","kind":"dynamic-import","original":"./ollama"},{"path":"src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"},{"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/containers/NativeSettings/NativeSettings.tsx":{"bytes":17124,"imports":[{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"date-fns/formatDistanceToNow","kind":"import-statement","external":true},{"path":"effect/Match","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"format":"esm"},"src/containers/NativeSettings/index.ts":{"bytes":518,"imports":[{"path":"src/containers/NativeSettings/NativeSettings.tsx","kind":"import-statement","original":"./NativeSettings"}],"format":"esm"},"src/containers/index.ts":{"bytes":714,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/containers/NativeSettings/index.ts","kind":"dynamic-import","original":"./NativeSettings"}],"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":4415,"imports":[{"path":"#meta","kind":"import-statement","external":true}],"format":"esm"},"src/types/NativeCapabilities.ts":{"bytes":1933,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"format":"esm"},"src/types/Settings.ts":{"bytes":880,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true}],"format":"esm"},"src/types/Update.ts":{"bytes":1080,"imports":[],"format":"esm"},"src/types/index.ts":{"bytes":796,"imports":[{"path":"src/types/NativeCapabilities.ts","kind":"import-statement","original":"./NativeCapabilities"},{"path":"src/types/Settings.ts","kind":"import-statement","original":"./Settings"},{"path":"src/types/Update.ts","kind":"import-statement","original":"./Update"}],"format":"esm"}},"outputs":{"dist/lib/neutral/settings-S5MFUI42.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1598},"dist/lib/neutral/settings-S5MFUI42.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"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/effect","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/settings.ts","inputs":{"src/capabilities/settings.ts":{"bytesInOutput":724}},"bytes":877},"dist/lib/neutral/ollama-HZEXAT2P.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":23591},"dist/lib/neutral/ollama-HZEXAT2P.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"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/Cause","kind":"import-statement","external":true},{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Duration","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Either","kind":"import-statement","external":true},{"path":"effect/Exit","kind":"import-statement","external":true},{"path":"effect/Fiber","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/ManagedRuntime","kind":"import-statement","external":true},{"path":"effect/Schedule","kind":"import-statement","external":true},{"path":"effect/Stream","kind":"import-statement","external":true},{"path":"@dxos/ai","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},{"path":"@dxos/plugin-assistant","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/ollama.ts","inputs":{"src/capabilities/ollama.ts":{"bytesInOutput":11181}},"bytes":11328},"dist/lib/neutral/react-surface-YST5DQA3.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1887},"dist/lib/neutral/react-surface-YST5DQA3.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit/ui","kind":"import-statement","external":true},{"path":"#containers","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/react-surface.tsx","inputs":{"src/capabilities/react-surface.tsx":{"bytesInOutput":838}},"bytes":1007},"dist/lib/neutral/spotlight-listener-K7S6LGL3.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3118},"dist/lib/neutral/spotlight-listener-K7S6LGL3.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"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":1933},"dist/lib/neutral/updater-5ETKR4S3.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":11859},"dist/lib/neutral/updater-5ETKR4S3.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"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":"#types","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/updater.ts","inputs":{"src/capabilities/updater.ts":{"bytesInOutput":6475},"src/constants.ts":{"bytesInOutput":36}},"bytes":6714},"dist/lib/neutral/NativeSettings-33K63AVG.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":8958},"dist/lib/neutral/NativeSettings-33K63AVG.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"date-fns/formatDistanceToNow","kind":"import-statement","external":true},{"path":"effect/Match","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/containers/NativeSettings/index.ts","inputs":{"src/containers/NativeSettings/NativeSettings.tsx":{"bytesInOutput":4275},"src/containers/NativeSettings/index.ts":{"bytesInOutput":0}},"bytes":4452},"dist/lib/neutral/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-WU6IZ56J.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"}],"exports":["meta"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0}},"bytes":132},"dist/lib/neutral/NativePlugin.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":12637},"dist/lib/neutral/NativePlugin.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"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":1146},"raw-loader:/__w/dxos/dxos/packages/plugins/plugin-native/PLUGIN.mdl":{"bytesInOutput":9802}},"bytes":11205},"dist/lib/neutral/capabilities/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1081},"dist/lib/neutral/capabilities/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/neutral/settings-S5MFUI42.mjs","kind":"dynamic-import"},{"path":"dist/lib/neutral/ollama-HZEXAT2P.mjs","kind":"dynamic-import"},{"path":"dist/lib/neutral/react-surface-YST5DQA3.mjs","kind":"dynamic-import"},{"path":"dist/lib/neutral/spotlight-listener-K7S6LGL3.mjs","kind":"dynamic-import"},{"path":"dist/lib/neutral/updater-5ETKR4S3.mjs","kind":"dynamic-import"}],"exports":["NativeSettings","Ollama","ReactSurface","SpotlightListener","Updater"],"entryPoint":"src/capabilities/index.ts","inputs":{"src/capabilities/index.ts":{"bytesInOutput":524}},"bytes":708},"dist/lib/neutral/containers/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":404},"dist/lib/neutral/containers/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"dist/lib/neutral/NativeSettings-33K63AVG.mjs","kind":"dynamic-import"}],"exports":["NativeSettings"],"entryPoint":"src/containers/index.ts","inputs":{"src/containers/index.ts":{"bytesInOutput":105}},"bytes":229},"dist/lib/neutral/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/meta.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-WU6IZ56J.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"}],"exports":["meta"],"entryPoint":"src/meta.ts","inputs":{},"bytes":131},"dist/lib/neutral/plugin.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":440},"dist/lib/neutral/plugin.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-WU6IZ56J.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.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":268},"dist/lib/neutral/chunk-WU6IZ56J.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2076},"dist/lib/neutral/chunk-WU6IZ56J.mjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/config","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["meta"],"inputs":{"src/meta.ts":{"bytesInOutput":102},"dx.config.ts":{"bytesInOutput":1183}},"bytes":1397},"dist/lib/neutral/translations.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2036},"dist/lib/neutral/translations.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"#meta","kind":"import-statement","external":true}],"exports":["translations"],"entryPoint":"src/translations.ts","inputs":{"src/translations.ts":{"bytesInOutput":1390}},"bytes":1514},"dist/lib/neutral/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2053},"dist/lib/neutral/types/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true}],"exports":["NativeCapabilities","Settings","Update"],"entryPoint":"src/types/index.ts","inputs":{"src/types/NativeCapabilities.ts":{"bytesInOutput":386},"src/types/index.ts":{"bytesInOutput":0},"src/types/Settings.ts":{"bytesInOutput":180},"src/types/Update.ts":{"bytesInOutput":25}},"bytes":887},"dist/lib/neutral/chunk-J5LGTIGS.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/chunk-J5LGTIGS.mjs":{"imports":[],"exports":["__export"],"inputs":{},"bytes":235}}}
@@ -0,0 +1,312 @@
1
+ import "./chunk-J5LGTIGS.mjs";
2
+
3
+ // src/capabilities/ollama.ts
4
+ import { Atom } from "@effect-atom/atom-react";
5
+ import * as FetchHttpClient from "@effect/platform/FetchHttpClient";
6
+ import * as HttpClient from "@effect/platform/HttpClient";
7
+ import { Command } from "@tauri-apps/plugin-shell";
8
+ import * as Cause from "effect/Cause";
9
+ import * as Context from "effect/Context";
10
+ import * as Duration from "effect/Duration";
11
+ import * as Effect from "effect/Effect";
12
+ import * as Either from "effect/Either";
13
+ import * as Exit from "effect/Exit";
14
+ import * as Fiber from "effect/Fiber";
15
+ import * as Layer from "effect/Layer";
16
+ import * as ManagedRuntime from "effect/ManagedRuntime";
17
+ import * as Schedule from "effect/Schedule";
18
+ import * as Stream from "effect/Stream";
19
+ import { Provider } from "@dxos/ai";
20
+ import { OllamaAdmin, OllamaResolver } from "@dxos/ai/resolvers";
21
+ import { Capabilities, Capability } from "@dxos/app-framework";
22
+ import { AppCapabilities } from "@dxos/app-toolkit";
23
+ import { log } from "@dxos/log";
24
+ import { AssistantCapabilities } from "@dxos/plugin-assistant";
25
+ var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-native/src/capabilities/ollama.ts";
26
+ var OLLAMA_HOST = "http://localhost:21434";
27
+ var ollama_default = Capability.makeModule(Effect.fnUntraced(function* () {
28
+ const registry = yield* Capability.get(Capabilities.AtomRegistry);
29
+ const runtime = ManagedRuntime.make(OllamaSidecar.layerLive);
30
+ const sidecarLayer = Layer.effectContext(runtime.runtimeEffect.pipe(Effect.map((rt) => rt.context.pipe(Context.pick(OllamaSidecar)))));
31
+ const admin = OllamaAdmin.make({
32
+ endpoint: OLLAMA_HOST
33
+ });
34
+ const stateAtom = Atom.make({
35
+ kind: "idle",
36
+ models: [],
37
+ loaded: [],
38
+ pulls: {},
39
+ errors: {}
40
+ }).pipe(Atom.keepAlive);
41
+ const getState = Effect.sync(() => registry.get(stateAtom));
42
+ const updateState = (f) => Effect.sync(() => registry.set(stateAtom, f(registry.get(stateAtom))));
43
+ const fail = (error) => updateState((state) => ({
44
+ ...state,
45
+ kind: "failed",
46
+ error
47
+ }));
48
+ const setError = (name, error) => updateState((state) => {
49
+ const errors = {
50
+ ...state.errors
51
+ };
52
+ if (error) {
53
+ errors[name] = error;
54
+ } else {
55
+ delete errors[name];
56
+ }
57
+ return {
58
+ ...state,
59
+ errors
60
+ };
61
+ });
62
+ const setProgress = (name, progress) => updateState((state) => {
63
+ const pulls = {
64
+ ...state.pulls
65
+ };
66
+ if (progress) {
67
+ pulls[name] = progress;
68
+ } else {
69
+ delete pulls[name];
70
+ }
71
+ return {
72
+ ...state,
73
+ pulls
74
+ };
75
+ });
76
+ const ensureRunning = Effect.asVoid(OllamaSidecar).pipe(Effect.provide(sidecarLayer));
77
+ const runAdmin = (effect) => effect.pipe(Effect.provide(clientLayer), Effect.either, Effect.map(Either.mapLeft((error) => error.message)));
78
+ const pullFibers = /* @__PURE__ */ new Map();
79
+ const refreshLoaded = Effect.gen(function* () {
80
+ const result = yield* runAdmin(admin.ps);
81
+ if (Either.isLeft(result)) {
82
+ return;
83
+ }
84
+ const before = (yield* getState).loaded.map((model) => model.name);
85
+ const after = result.right.map((model) => model.name);
86
+ if (before.join() !== after.join()) {
87
+ yield* Effect.sync(() => log.info("ollama loaded models changed", {
88
+ loaded: after
89
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 102, S: this }));
90
+ }
91
+ yield* updateState((state) => ({
92
+ ...state,
93
+ loaded: result.right
94
+ }));
95
+ });
96
+ const refresh = Effect.gen(function* () {
97
+ yield* updateState((state) => ({
98
+ ...state,
99
+ kind: "loading",
100
+ error: void 0
101
+ }));
102
+ const started = yield* Effect.exit(ensureRunning);
103
+ if (Exit.isFailure(started)) {
104
+ return yield* fail(formatError(Cause.squash(started.cause)));
105
+ }
106
+ const result = yield* runAdmin(admin.list.pipe(Effect.retry({
107
+ schedule: Schedule.spaced(Duration.millis(300)),
108
+ times: 29
109
+ })));
110
+ if (Either.isLeft(result)) {
111
+ return yield* fail(result.left);
112
+ }
113
+ yield* updateState((state) => ({
114
+ ...state,
115
+ kind: "ready",
116
+ models: result.right,
117
+ error: void 0
118
+ }));
119
+ yield* Effect.sync(() => log.info("ollama models", {
120
+ installed: result.right.map((model) => model.name)
121
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 136, S: this }));
122
+ yield* refreshLoaded;
123
+ });
124
+ const pull = (name) => Effect.gen(function* () {
125
+ const started = yield* Effect.exit(ensureRunning);
126
+ if (Exit.isFailure(started)) {
127
+ return yield* fail(formatError(Cause.squash(started.cause)));
128
+ }
129
+ yield* setError(name, void 0);
130
+ yield* Effect.sync(() => log.info("ollama pull started", {
131
+ name
132
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 147, S: this }));
133
+ yield* setProgress(name, {
134
+ status: "starting"
135
+ });
136
+ const downloaded = /* @__PURE__ */ new Map();
137
+ const onProgress = (progress) => Effect.suspend(() => {
138
+ if (progress.digest && progress.total) {
139
+ downloaded.set(progress.digest, {
140
+ completed: progress.completed ?? 0,
141
+ total: progress.total
142
+ });
143
+ let completed = 0;
144
+ let total = 0;
145
+ for (const layer2 of downloaded.values()) {
146
+ completed += layer2.completed;
147
+ total += layer2.total;
148
+ }
149
+ return setProgress(name, {
150
+ status: progress.status,
151
+ completed,
152
+ total
153
+ });
154
+ }
155
+ return setProgress(name, {
156
+ status: progress.status
157
+ });
158
+ });
159
+ const work = admin.pull(name).pipe(Stream.runForEach(onProgress), Effect.provide(clientLayer), Effect.matchCauseEffect({
160
+ onFailure: (cause) => Cause.isInterruptedOnly(cause) ? Effect.sync(() => log.info("ollama pull finished", {
161
+ name,
162
+ cancelled: true
163
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 182, S: this })) : Effect.gen(function* () {
164
+ const message = formatError(Cause.squash(cause));
165
+ yield* Effect.sync(() => log.warn("ollama pull failed", {
166
+ name,
167
+ error: message
168
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 187, S: this }));
169
+ yield* setError(name, message);
170
+ }),
171
+ onSuccess: () => Effect.gen(function* () {
172
+ yield* Effect.sync(() => log.info("ollama pull finished", {
173
+ name,
174
+ cancelled: false
175
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 194, S: this }));
176
+ yield* refresh;
177
+ })
178
+ }), Effect.ensuring(setProgress(name, void 0)), Effect.ensuring(Effect.sync(() => pullFibers.delete(name))));
179
+ const fiber = yield* Effect.forkDaemon(work);
180
+ yield* Effect.sync(() => pullFibers.set(name, fiber));
181
+ });
182
+ const cancel = (name) => Effect.gen(function* () {
183
+ yield* Effect.sync(() => log.info("ollama pull cancelled", {
184
+ name
185
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 205, S: this }));
186
+ const fiber = pullFibers.get(name);
187
+ if (fiber) {
188
+ yield* Fiber.interrupt(fiber);
189
+ }
190
+ });
191
+ const load = (name) => Effect.gen(function* () {
192
+ yield* setError(name, void 0);
193
+ const started = yield* Effect.exit(ensureRunning);
194
+ if (Exit.isFailure(started)) {
195
+ return yield* setError(name, formatError(Cause.squash(started.cause)));
196
+ }
197
+ yield* Effect.sync(() => log.info("ollama load", {
198
+ name
199
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 220, S: this }));
200
+ const result = yield* runAdmin(admin.load(name));
201
+ if (Either.isLeft(result)) {
202
+ yield* Effect.sync(() => log.warn("ollama load failed", {
203
+ name,
204
+ error: result.left
205
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 225, S: this }));
206
+ return yield* setError(name, result.left);
207
+ }
208
+ yield* refreshLoaded;
209
+ });
210
+ const unload = (name) => Effect.gen(function* () {
211
+ yield* setError(name, void 0);
212
+ const started = yield* Effect.exit(ensureRunning);
213
+ if (Exit.isFailure(started)) {
214
+ return yield* setError(name, formatError(Cause.squash(started.cause)));
215
+ }
216
+ yield* Effect.sync(() => log.info("ollama unload", {
217
+ name
218
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 239, S: this }));
219
+ const result = yield* runAdmin(admin.unload(name));
220
+ if (Either.isLeft(result)) {
221
+ return yield* setError(name, result.left);
222
+ }
223
+ yield* refreshLoaded;
224
+ });
225
+ const remove = (name) => Effect.gen(function* () {
226
+ yield* setError(name, void 0);
227
+ const started = yield* Effect.exit(ensureRunning);
228
+ if (Exit.isFailure(started)) {
229
+ return yield* setError(name, formatError(Cause.squash(started.cause)));
230
+ }
231
+ const result = yield* runAdmin(admin.remove(name));
232
+ if (Either.isLeft(result)) {
233
+ return yield* setError(name, result.left);
234
+ }
235
+ yield* refresh;
236
+ });
237
+ const manager = {
238
+ endpoint: OLLAMA_HOST,
239
+ state: stateAtom,
240
+ refresh,
241
+ refreshLoaded,
242
+ pull,
243
+ cancel,
244
+ load,
245
+ unload,
246
+ remove
247
+ };
248
+ return [
249
+ // The runtime-dispose finalizer lives on the resolver contribution only; the manager closes
250
+ // over the same runtime, so there is a single disposal path.
251
+ Capability.contributes(AppCapabilities.AiModelResolver, OllamaSidecarModelResolver.pipe(Layer.provide(sidecarLayer)), () => Effect.tryPromise(() => runtime.dispose())),
252
+ Capability.contributes(AssistantCapabilities.OllamaManager, manager)
253
+ ];
254
+ }));
255
+ var OllamaSidecar = class _OllamaSidecar extends Context.Tag("@dxos/plugin-native/OllamaSidecar")() {
256
+ static layerLive = Layer.scoped(_OllamaSidecar, Effect.gen(function* () {
257
+ const command = Command.sidecar("sidecar/ollama", [
258
+ "serve"
259
+ ], {
260
+ env: {
261
+ OLLAMA_HOST,
262
+ OLLAMA_ORIGINS: "*"
263
+ }
264
+ });
265
+ command.stdout.on("data", (data) => logSidecar(data.toString()));
266
+ command.stderr.on("data", (data) => logSidecar(data.toString()));
267
+ command.on("close", (code) => log.info("Ollama process exited", {
268
+ code
269
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 296, S: this }));
270
+ command.on("error", (error) => log.error("Ollama error", {
271
+ error
272
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 299, S: this }));
273
+ const child = yield* Effect.promise(() => command.spawn());
274
+ yield* Effect.addFinalizer(Effect.fn(function* () {
275
+ yield* Effect.promise(() => child.kill());
276
+ }));
277
+ log.info("Running ollama", {
278
+ pid: child.pid
279
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 306, S: this });
280
+ return {
281
+ endpoint: OLLAMA_HOST
282
+ };
283
+ }));
284
+ };
285
+ var OllamaSidecarModelResolver = Layer.unwrapEffect(Effect.gen(function* () {
286
+ const { endpoint } = yield* OllamaSidecar;
287
+ return OllamaResolver.make({
288
+ endpoint,
289
+ provider: Provider.builtIn.id,
290
+ transformClient: HttpClient.withTracerPropagation(false)
291
+ });
292
+ })).pipe(Layer.provide(FetchHttpClient.layer));
293
+ var formatError = (error) => typeof error === "string" ? error : error instanceof Error ? error.message : String(error);
294
+ var clientLayer = FetchHttpClient.layer;
295
+ var logSidecar = (chunk) => {
296
+ for (const line of chunk.split("\n")) {
297
+ if (line.trim().length === 0) {
298
+ continue;
299
+ }
300
+ if (line.includes("level=ERROR")) {
301
+ console.error("[ollama]", line);
302
+ } else if (line.includes("level=WARN")) {
303
+ console.warn("[ollama]", line);
304
+ } else {
305
+ console.log("[ollama]", line);
306
+ }
307
+ }
308
+ };
309
+ export {
310
+ ollama_default as default
311
+ };
312
+ //# sourceMappingURL=ollama-HZEXAT2P.mjs.map