@x-tech-laboratories/x-app 0.104.0 → 0.106.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/app/daemon.js +19 -0
- package/dist/app/define.d.ts +8 -0
- package/dist/app/define.js +3 -0
- package/dist/app/desktop.js +3 -0
- package/dist/app/preload.js +2 -0
- package/dist/app/protocol.d.ts +2 -0
- package/dist/app/web/app_page.js +10 -3
- package/dist/app/web/hosts.d.ts +1 -1
- package/dist/app/web/hosts.js +1 -0
- package/dist/app/web/settings_page.d.ts +13 -0
- package/dist/app/web/settings_page.js +4 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,8 +13,8 @@ an app moves over by changing the package name in its imports and its `x-libs-*`
|
|
|
13
13
|
| `app/server`, `app/daemon` | `run_server(app, { web_folder })`: the web server from `<PREFIX>_CONFIG` with accounts in `accounts.db` (moved there once from the data's own file, tokens starting with the app's `token_prefix`), the calls, OpenAPI, MCP, the server's backups and its sync peer, a token or MCP client refused the app's `page_only` calls and the `user_only_backup_calls` (restore, remove, schedule) and its calls run as the `program` caller; `run_daemon(app)`: the desktop daemon from `<PREFIX>_DB` with sync, letting devices connect, backups, certificates and the desktop settings; Both take the app's `services` (see `app/services`), `run_daemon(app, env, { services })`. `build_server`, `start_daemon`, `open_app_database` (with `on_restore` hooks) and `register_app_calls` for tests and apps that add their own. |
|
|
14
14
|
| `app/services` | An app's own work beside its calls, run by both hosts: `StartServices` gets a `HostContext` (`kind`, `database()`, `profile`, `device_name`, the server's raw `config`, `plugins_folder`, `declared_file` from `<PREFIX>_DECLARED_FILE` or `/etc/<id>/declared.json`, `announce`, `emit(event, data)` for the page's `on_event`, `side_database(name)` for a never-backed-up file such as `<base>-index.db`, `back_up`) and returns `HostServices` (`before_restore`, `after_restore`, `stop`), stopped before sync and the database. |
|
|
15
15
|
| `app/links` | `app_link(scheme, route)` and `route_of_link(scheme, link)`: an app's links such as `x-notes://note/<id>` and the page route they open. |
|
|
16
|
-
| `app/desktop`, `app/preload` | `run_desktop(app, electron, { main_dir })`: Electron's main process as a portal onto this computer's daemon or a server, with the window (`default_size` fixed or from the screen's free area, the daemon told while one is in front for its services' `window_in_front`), the tray (`show_tray_icon`, the app's own `tray` rows above Show, Quit and Quit completely, closing the last window leaving the app in it, `--hidden` starting there), the app's `link_scheme` links opening the window on their page (`route_of_link` to map them its own way; the page follows the `open` event), the login entry, a second launch and `--daemon`; the app's own `desktop_settings` switches sit in Settings → Desktop app beside the base's; `run_preload(app, electron)` puts every bridge on the page. Electron is handed in, so neither imports it. |
|
|
17
|
-
| `app/web/app_page`, `app/web/page` | `render_app({ app, pages, general_settings })`: the page on the web, the desktop or Android in the `Shell`, with sign-in in a browser, Your account, Settings (the app's general sections, each page's own, Connections, Desktop app, Sync and Backups) and `SyncButton`; `page_hooks<Methods>()` gives the app's typed `calls`, `use_data` and `use_settings`. The phone's host (`app/web/android`) loads only on Android. The page API's `on_event(name, listener)` hears the named events the app's services `emit`, on the web and the desktop. |
|
|
16
|
+
| `app/desktop`, `app/preload` | `run_desktop(app, electron, { main_dir })`: Electron's main process as a portal onto this computer's daemon or a server, with the window (`default_size` fixed or from the screen's free area, the daemon told while one is in front for its services' `window_in_front`), the tray (`show_tray_icon`, the app's own `tray` rows above Show, Quit and Quit completely, closing the last window leaving the app in it, `--hidden` starting there), the app's `link_scheme` links opening the window on their page (`route_of_link` to map them its own way; the page follows the `open` event), the login entry, a second launch and `--daemon`; the app's own `desktop_settings` switches sit in Settings → Desktop app beside the base's; `run_preload(app, electron)` puts every bridge on the page. Electron is handed in, so neither imports it. An app with `local_mcp: { default_port }` serves its calls as MCP on 127.0.0.1 from the desktop daemon (`electron/mcp`, page-only calls left out, calls run as `program`), turned on under Settings → MCP server. |
|
|
17
|
+
| `app/web/app_page`, `app/web/page` | `render_app({ app, pages, general_settings })`: the page on the web, the desktop or Android in the `Shell`, with sign-in in a browser, Your account, Settings (the app's general sections, each page's own, Connections, Desktop app, Sync and Backups) and `SyncButton`; `page_hooks<Methods>()` gives the app's typed `calls`, `use_data` and `use_settings`. The phone's host (`app/web/android`) loads only on Android. The page API's `on_event(name, listener)` hears the named events the app's services `emit`, on the web and the desktop. A page may have an `icon` (the sidebar then shows icon rows), a `use_badge` hook ("Inbox · 3"), `in_sidebar: false` with `active_as` for a page reached only by its route; `default_page` names the page an empty route opens, and the `use_chrome(parts)` hook gives the `sidebar` content under the rows, header `tools` and a `side_pane`. |
|
|
18
18
|
| `config/vite`, `config/electron_vite`, `config/vitest`, `config/tsconfig/*.json` | An X-app's configs as presets: `web_vite_config({ port })` and `android_vite_config()` for the page, `desktop_vite_config()` for electron-vite's window, daemon, preload and page, `vitest_config()` for tests in `tests/` in UTC with coverage of `src/` to the terminal, merged with the app's own floor so `autoUpdate` still raises it, and `base`, `node`, `web` and `tests` tsconfigs to extend. |
|
|
19
19
|
| `app_new` | The `x-app-new <X-Name>` command: a new X-app's files written once, laid out as the Application Standard asks, on the base app, the presets, X-App's Nix lib and its CI actions, with an example notes feature; `--port`, `--folder`, `--no-desktop` and `--no-android`. |
|
|
20
20
|
| `durations` | `parse_duration` for settings such as `"2h30m"`, `format_duration` in months down to seconds and "less than a second" below one, `format_age`, and `format_clock` for a playing time such as `"3:07"`, with `{ hours: "always" }` writing `"0:03:07"` so a column of times lines up and `empty` for no time. |
|
package/dist/app/daemon.js
CHANGED
|
@@ -7,6 +7,7 @@ import { hostname } from "node:os";
|
|
|
7
7
|
import { dirname, join } from "node:path";
|
|
8
8
|
import fastify from "fastify";
|
|
9
9
|
import { create_certificate_trust } from "../certificates.js";
|
|
10
|
+
import { create_local_mcp } from "../electron/mcp.js";
|
|
10
11
|
import { DaemonRunningError, daemon_socket_path, listen_on_socket } from "../local_daemon.js";
|
|
11
12
|
import { register_call_table } from "../server/call_table.js";
|
|
12
13
|
import { EventStream } from "../server/events.js";
|
|
@@ -57,6 +58,20 @@ export async function start_daemon(app, options) {
|
|
|
57
58
|
stop_daemon: () => void setTimeout(() => void shut_down(), 0),
|
|
58
59
|
set_window_in_front: (in_front) => void (window_in_front = in_front === true),
|
|
59
60
|
};
|
|
61
|
+
// Off until turned on in Settings; a change made through it reaches the open windows and syncs like any other.
|
|
62
|
+
const local_mcp = app.local_mcp
|
|
63
|
+
? create_local_mcp({
|
|
64
|
+
name: app.id,
|
|
65
|
+
version: app.version,
|
|
66
|
+
instructions: app.instructions,
|
|
67
|
+
api: app.api_spec,
|
|
68
|
+
is_read_only: app.is_read_only,
|
|
69
|
+
page_only: app.page_only,
|
|
70
|
+
settings_file: join(profile, "mcp.json"),
|
|
71
|
+
default_port: app.local_mcp.default_port,
|
|
72
|
+
call: (method, args) => app.bridges.calls.dispatch(app.bind_methods(opened.database, () => changes.announce_change(), "program"), method, args),
|
|
73
|
+
})
|
|
74
|
+
: null;
|
|
60
75
|
// ── Calls ──────────────────────────────────────────────────────────
|
|
61
76
|
const daemon = fastify({ bodyLimit: call_body_limit, forceCloseConnections: true });
|
|
62
77
|
register_lenient_json_body(daemon);
|
|
@@ -71,6 +86,8 @@ export async function start_daemon(app, options) {
|
|
|
71
86
|
register_call_table(api, "/device", sync_device_methods(sync), { is_read_only, on_change: tell_others });
|
|
72
87
|
register_call_table(api, "/peer_listening", listening.methods, { is_read_only });
|
|
73
88
|
register_call_table(api, "/certificates", certificates.methods, { is_read_only });
|
|
89
|
+
if (local_mcp)
|
|
90
|
+
register_call_table(api, "/local_mcp", local_mcp.methods, { is_read_only });
|
|
74
91
|
register_call_table(api, "/daemon", daemon_methods, { is_read_only, on_change: tell_others });
|
|
75
92
|
}, { prefix: "/api" });
|
|
76
93
|
// ── Lifecycle ──────────────────────────────────────────────────────
|
|
@@ -83,6 +100,7 @@ export async function start_daemon(app, options) {
|
|
|
83
100
|
clearInterval(unused_timer);
|
|
84
101
|
await services.stop();
|
|
85
102
|
sync.stop();
|
|
103
|
+
await local_mcp?.stop();
|
|
86
104
|
await daemon.close();
|
|
87
105
|
await listening.stop();
|
|
88
106
|
sides.close_all();
|
|
@@ -104,6 +122,7 @@ export async function start_daemon(app, options) {
|
|
|
104
122
|
}
|
|
105
123
|
await listening.start();
|
|
106
124
|
sync.start();
|
|
125
|
+
await local_mcp?.start();
|
|
107
126
|
if (options.services) {
|
|
108
127
|
services = await options.services({
|
|
109
128
|
kind: "desktop",
|
package/dist/app/define.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { type ConnectionMethods } from "../connection_protocol.ts";
|
|
|
7
7
|
import { type Bridge } from "../electron/bridge.ts";
|
|
8
8
|
import { type EventsBridge } from "../electron/events.ts";
|
|
9
9
|
import type { History } from "../history.ts";
|
|
10
|
+
import { type LocalMcpMethods } from "../local_mcp_protocol.ts";
|
|
10
11
|
import { type SettingSpec, type SettingsMethods, type SettingsStore, type SettingsStoreOptions } from "../settings.ts";
|
|
11
12
|
import { type MigrationStep, type SqlDatabase } from "../sql.ts";
|
|
12
13
|
import { type SyncedTable } from "../sync_engine.ts";
|
|
@@ -56,6 +57,9 @@ export interface AppOptions<Features extends readonly Feature[]> {
|
|
|
56
57
|
token_prefix?: string;
|
|
57
58
|
desktop_settings?: Readonly<Record<string, DesktopSettingSpec>>;
|
|
58
59
|
link_scheme?: string;
|
|
60
|
+
local_mcp?: {
|
|
61
|
+
default_port: number;
|
|
62
|
+
};
|
|
59
63
|
}
|
|
60
64
|
export declare const base_setting_defaults: {
|
|
61
65
|
history_days: number;
|
|
@@ -81,6 +85,7 @@ export interface AppBridges<Methods extends Record<keyof Methods, (...args: neve
|
|
|
81
85
|
certificates: Bridge<CertificateMethods>;
|
|
82
86
|
desktop: Bridge<DesktopMethods>;
|
|
83
87
|
connections: Bridge<ConnectionMethods>;
|
|
88
|
+
local_mcp: Bridge<LocalMcpMethods>;
|
|
84
89
|
events: EventsBridge<AppEvents>;
|
|
85
90
|
}
|
|
86
91
|
export declare function define_app<const Features extends readonly Feature[]>(options: AppOptions<Features>): {
|
|
@@ -105,6 +110,9 @@ export declare function define_app<const Features extends readonly Feature[]>(op
|
|
|
105
110
|
token_prefix?: string;
|
|
106
111
|
desktop_settings?: Readonly<Record<string, DesktopSettingSpec>>;
|
|
107
112
|
link_scheme?: string;
|
|
113
|
+
local_mcp?: {
|
|
114
|
+
default_port: number;
|
|
115
|
+
};
|
|
108
116
|
features: readonly Feature<Record<string, StoreMethod>>[];
|
|
109
117
|
settings_store: SettingsStore;
|
|
110
118
|
setting_defaults: Readonly<import("../settings.ts").Settings>;
|
package/dist/app/define.js
CHANGED
|
@@ -10,6 +10,7 @@ import { certificate_method_names } from "../certificate_protocol.js";
|
|
|
10
10
|
import { connection_method_names } from "../connection_protocol.js";
|
|
11
11
|
import { define_bridge } from "../electron/bridge.js";
|
|
12
12
|
import { define_events } from "../electron/events.js";
|
|
13
|
+
import { local_mcp_method_names } from "../local_mcp_protocol.js";
|
|
13
14
|
import { create_settings_store, read_setting, settings_of, write_setting } from "../settings.js";
|
|
14
15
|
import { migrate } from "../sql.js";
|
|
15
16
|
import { create_sync_engine } from "../sync_engine.js";
|
|
@@ -158,6 +159,8 @@ export function define_app(options) {
|
|
|
158
159
|
desktop: define_bridge(`${prefix}_desktop`, desktop_method_names),
|
|
159
160
|
// The daemons the desktop app can work on: this computer's, or a server signed in to as this device.
|
|
160
161
|
connections: define_bridge(`${prefix}_connections`, connection_method_names),
|
|
162
|
+
// The desktop app's own MCP endpoint, for AI clients on the same computer.
|
|
163
|
+
local_mcp: define_bridge(`${prefix}_local_mcp`, local_mcp_method_names),
|
|
161
164
|
events: define_events(`${prefix}_events`),
|
|
162
165
|
};
|
|
163
166
|
return {
|
package/dist/app/desktop.js
CHANGED
|
@@ -8,6 +8,7 @@ import { join } from "node:path";
|
|
|
8
8
|
import { launch_command, set_autostart } from "../autostart.js";
|
|
9
9
|
import { backup_method_names } from "../backups.js";
|
|
10
10
|
import { certificate_method_names } from "../certificate_protocol.js";
|
|
11
|
+
import { local_mcp_method_names } from "../local_mcp_protocol.js";
|
|
11
12
|
import { create_certificate_trust } from "../certificates.js";
|
|
12
13
|
import { connection_file_storage } from "../connection_file_storage.js";
|
|
13
14
|
import { create_connections } from "../connections.js";
|
|
@@ -186,6 +187,8 @@ export function run_desktop(app, electron, options) {
|
|
|
186
187
|
bridges.peer_listening.handle(ipcMain, forwarded(peer_listening_method_names, "peer_listening"), handle_options);
|
|
187
188
|
bridges.certificates.handle(ipcMain, forwarded(certificate_method_names, "certificates"), handle_options);
|
|
188
189
|
bridges.connections.handle(ipcMain, connections.methods, handle_options);
|
|
190
|
+
if (app.local_mcp)
|
|
191
|
+
bridges.local_mcp.handle(ipcMain, forwarded(local_mcp_method_names, "local_mcp"), handle_options);
|
|
189
192
|
const desktop = {
|
|
190
193
|
get_desktop_settings,
|
|
191
194
|
set_desktop_setting: async (key, value) => {
|
package/dist/app/preload.js
CHANGED
|
@@ -6,5 +6,7 @@ export function run_preload(app, { contextBridge, ipcRenderer }) {
|
|
|
6
6
|
for (const bridge of [bridges.calls, bridges.device, bridges.backups, bridges.certificates, bridges.peer_listening, bridges.desktop, bridges.connections]) {
|
|
7
7
|
bridge.expose(contextBridge, ipcRenderer, { envelopes: true });
|
|
8
8
|
}
|
|
9
|
+
if (app.local_mcp)
|
|
10
|
+
bridges.local_mcp.expose(contextBridge, ipcRenderer, { envelopes: true });
|
|
9
11
|
bridges.events.expose(contextBridge, ipcRenderer);
|
|
10
12
|
}
|
package/dist/app/protocol.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { BackupClient } from "../backups.ts";
|
|
2
2
|
import type { CertificateClient } from "../certificate_protocol.ts";
|
|
3
3
|
import type { ConnectionClient } from "../connection_protocol.ts";
|
|
4
|
+
import type { LocalMcpClient } from "../local_mcp_protocol.ts";
|
|
4
5
|
import type { Client } from "../electron/bridge.ts";
|
|
5
6
|
import type { PeerListeningClient, SyncDeviceClient } from "../sync_protocol.ts";
|
|
6
7
|
export interface DesktopSettings {
|
|
@@ -43,6 +44,7 @@ export interface PageApi<Methods extends Record<keyof Methods, (...args: never[]
|
|
|
43
44
|
connections?: ConnectionClient;
|
|
44
45
|
peer_listening?: PeerListeningClient;
|
|
45
46
|
desktop?: Client<DesktopMethods>;
|
|
47
|
+
local_mcp?: LocalMcpClient;
|
|
46
48
|
on_change: (listener: () => void) => () => void;
|
|
47
49
|
on_event?: (event: string, listener: (data: unknown) => void) => () => void;
|
|
48
50
|
}
|
package/dist/app/web/app_page.js
CHANGED
|
@@ -35,17 +35,24 @@ function SidebarFoot() {
|
|
|
35
35
|
function Pages({ pages, account }) {
|
|
36
36
|
const { app } = pages;
|
|
37
37
|
const route = use_route();
|
|
38
|
-
const [section = pages.pages[0]?.id ?? "settings", ...rest] = route.parts;
|
|
38
|
+
const [section = pages.default_page ?? pages.pages[0]?.id ?? "settings", ...rest] = route.parts;
|
|
39
39
|
const shown = pages.pages.find((candidate) => candidate.id === section);
|
|
40
40
|
const is_account = account !== null && section === "account";
|
|
41
41
|
const label = shown?.label ?? (is_account ? "Your account" : "Settings");
|
|
42
42
|
const view_key = route.parts.join("/");
|
|
43
|
+
const chrome = pages.use_chrome?.(route.parts) ?? {};
|
|
43
44
|
useEffect(() => {
|
|
44
45
|
document.title = `${label} · ${app.name}`;
|
|
45
46
|
}, [label, app.name]);
|
|
46
|
-
|
|
47
|
+
// Each listed page's badge, such as how many things wait, from its hook, called in the same order every time.
|
|
48
|
+
const listed = pages.pages.filter((each) => each.in_sidebar !== false);
|
|
49
|
+
const badges = listed.map((each) => each.use_badge?.() ?? null);
|
|
50
|
+
const row_label = (index) => (badges[index] ? `${listed[index].label} · ${badges[index]}` : listed[index].label);
|
|
51
|
+
const with_icons = listed.some((each) => each.icon);
|
|
52
|
+
const sections = listed.map((each, index) => ({ id: each.id, label: row_label(index), href: `#/${each.id}` }));
|
|
53
|
+
const views = listed.map((each, index) => ({ id: each.id, label: row_label(index), href: `#/${each.id}`, ...(each.icon ? { icon: each.icon } : {}) }));
|
|
47
54
|
const view = shown ? shown.view(rest) : is_account ? _jsx(AccountPage, { account: account }) : _jsx(SettingsView, { pages: pages, is_admin: account === null || is_admin(account.me) });
|
|
48
|
-
return (_jsx(Shell, { brand: app.name, brand_icon: pages.brand_icon ?? "icon.svg",
|
|
55
|
+
return (_jsx(Shell, { brand: app.name, brand_icon: pages.brand_icon ?? "icon.svg", ...(with_icons ? { views } : { sections }), active: shown?.active_as ?? section, ...(chrome.sidebar ? { sidebar: chrome.sidebar } : {}), ...(chrome.tools ? { tools: chrome.tools } : {}), ...(chrome.side_pane ? { side_pane: chrome.side_pane } : {}), theme: theme_choice(`${app.id}-theme`), view_key: view_key, user: account ? account.me.name : undefined, user_href: account ? "#/account" : undefined, on_logout: account ? () => void account.sign_out() : undefined, sidebar_foot: _jsx(SidebarFoot, {}), settings: { href: "#/settings" }, children: _jsx(Fragment, { children: view }, view_key) }));
|
|
49
56
|
}
|
|
50
57
|
// ── App ──────────────────────────────────────────────────────────────────────
|
|
51
58
|
// A browser reaches the server's data, so it signs in; the desktop and phone apps keep their own and sign in only to sync.
|
package/dist/app/web/hosts.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ import type { App } from "../define.ts";
|
|
|
2
2
|
import type { PageApi } from "../protocol.ts";
|
|
3
3
|
export declare function web_api(app: Pick<App, "bridges">): PageApi;
|
|
4
4
|
export declare function is_desktop(app: Pick<App, "bridges">): boolean;
|
|
5
|
-
export declare function desktop_api(app: Pick<App, "bridges">): Promise<PageApi>;
|
|
5
|
+
export declare function desktop_api(app: Pick<App, "bridges"> & Partial<Pick<App, "local_mcp">>): Promise<PageApi>;
|
|
6
6
|
export declare function is_android(): boolean;
|
package/dist/app/web/hosts.js
CHANGED
|
@@ -109,6 +109,7 @@ export async function desktop_api(app) {
|
|
|
109
109
|
// Sync belongs to this computer's own daemon, so it shows only while that daemon is in use.
|
|
110
110
|
device: is_here ? exposed[bridges.device.api_name] : null,
|
|
111
111
|
...(is_here ? { peer_listening: exposed[bridges.peer_listening.api_name] } : {}),
|
|
112
|
+
...(is_here && app.local_mcp ? { local_mcp: exposed[bridges.local_mcp.api_name] } : {}),
|
|
112
113
|
backups: exposed[bridges.backups.api_name],
|
|
113
114
|
certificates: exposed[bridges.certificates.api_name],
|
|
114
115
|
connections,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import type { IconGlyph } from "../../web/react/icons.tsx";
|
|
1
2
|
import { type SettingsSection } from "../../web/react/layout.tsx";
|
|
3
|
+
import type { ShellSidePane } from "../../web/react/shell.tsx";
|
|
2
4
|
import type { App } from "../define.ts";
|
|
3
5
|
export interface PageSettingsProps {
|
|
4
6
|
settings: Record<string, unknown>;
|
|
@@ -9,12 +11,23 @@ export interface AppPage {
|
|
|
9
11
|
label: string;
|
|
10
12
|
view: (parts: string[]) => React.ReactNode;
|
|
11
13
|
settings?: (props: PageSettingsProps) => SettingsSection[];
|
|
14
|
+
icon?: IconGlyph;
|
|
15
|
+
use_badge?: () => number | string | null;
|
|
16
|
+
in_sidebar?: boolean;
|
|
17
|
+
active_as?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface AppChrome {
|
|
20
|
+
sidebar?: React.ReactNode;
|
|
21
|
+
tools?: React.ReactNode;
|
|
22
|
+
side_pane?: ShellSidePane;
|
|
12
23
|
}
|
|
13
24
|
export interface AppPages {
|
|
14
25
|
app: Pick<App, "id" | "name" | "data_name" | "server_example" | "bridges"> & Partial<Pick<App, "desktop_settings">>;
|
|
15
26
|
pages: readonly AppPage[];
|
|
16
27
|
general_settings?: (props: PageSettingsProps) => SettingsSection[];
|
|
17
28
|
brand_icon?: string;
|
|
29
|
+
default_page?: string;
|
|
30
|
+
use_chrome?: (parts: readonly string[]) => AppChrome;
|
|
18
31
|
}
|
|
19
32
|
export declare function SettingsView({ pages, is_admin }: {
|
|
20
33
|
pages: AppPages;
|
|
@@ -6,6 +6,7 @@ import { useEffect, useState } from "react";
|
|
|
6
6
|
import { BackupSettings } from "../../web/react/backup_settings.js";
|
|
7
7
|
import { TrustedCertificates } from "../../web/react/certificates.js";
|
|
8
8
|
import { ConnectionSettings } from "../../web/react/connections.js";
|
|
9
|
+
import { LocalMcpSettings } from "../../web/react/local_mcp_settings.js";
|
|
9
10
|
import { Switch } from "../../web/react/controls.js";
|
|
10
11
|
import { PageHeading, SettingRow, SettingsPage } from "../../web/react/layout.js";
|
|
11
12
|
import { Loaded } from "../../web/react/states.js";
|
|
@@ -36,7 +37,7 @@ function Desktop({ app_name, own }) {
|
|
|
36
37
|
}
|
|
37
38
|
// A desktop window on a server's daemon works on the server's data, as a browser does.
|
|
38
39
|
function storage_category(app, is_admin) {
|
|
39
|
-
const { backups, backup_folder, certificates, connections, desktop, device, host, peer_listening } = page();
|
|
40
|
+
const { backups, backup_folder, certificates, connections, desktop, device, host, local_mcp, peer_listening } = page();
|
|
40
41
|
const { data_name, name } = app;
|
|
41
42
|
const on_server = host === "web" || (host === "desktop" && !device);
|
|
42
43
|
const sections = [];
|
|
@@ -45,6 +46,8 @@ function storage_category(app, is_admin) {
|
|
|
45
46
|
}
|
|
46
47
|
if (desktop)
|
|
47
48
|
sections.push({ id: "desktop", heading: "Desktop app", content: _jsx(Desktop, { app_name: name, own: app.desktop_settings ?? {} }) });
|
|
49
|
+
if (local_mcp)
|
|
50
|
+
sections.push({ id: "mcp", heading: "MCP server", hint: `Let AI assistants such as Claude Code reach this computer's ${data_name} without the server.`, content: _jsx(LocalMcpSettings, { device: local_mcp, name: name }) });
|
|
48
51
|
if (device && (!on_server || is_admin)) {
|
|
49
52
|
const hint = on_server ? `Keep the server's ${data_name} alike with the devices paired with it.` : `Keep this device's ${data_name} alike with your other devices and your ${name} server.`;
|
|
50
53
|
sections.push({ id: "sync", heading: "Sync", hint, content: _jsx(SyncSettings, { device: device, subscribe: (listener) => data_watch.subscribe(listener), data_name: data_name, extra: peer_listening && _jsx(PeerListeningSettings, { listening: peer_listening }) }) });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@x-tech-laboratories/x-app",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.106.0",
|
|
4
4
|
"description": "Code the X-apps share: agents and their long runs, passwords and sign-in, the Fastify server pieces, durations, and the web page's helpers and widgets",
|
|
5
5
|
"license": "GPL-3.0-or-later",
|
|
6
6
|
"repository": {
|