Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 78 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions apps/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"dependencies": {
"@monaco-editor/react": "^4.7.0",
"@tauri-apps/api": "^2.10.1",
"@tauri-apps/plugin-dialog": "^2",
"@tauri-apps/plugin-opener": "^2",
"@tauri-apps/plugin-process": "^2",
"@tauri-apps/plugin-updater": "^2",
Expand Down
1 change: 1 addition & 0 deletions apps/desktop/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ tauri-plugin-single-instance = { version = "2", features = ["deep-link"] }
tauri-plugin-deep-link = "2"
tauri-plugin-updater = "2"
tauri-plugin-autostart = "2"
tauri-plugin-dialog = "2"
image = { version = "0.25", default-features = false, features = ["png"] }
serde.workspace = true
serde_json.workspace = true
Expand Down
3 changes: 2 additions & 1 deletion apps/desktop/src-tauri/capabilities/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"core:window:allow-set-focus",
"opener:default",
"deep-link:default",
"updater:default"
"updater:default",
"dialog:default"
]
}
1 change: 1 addition & 0 deletions apps/desktop/src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ pub fn run() {

tauri::Builder::default()
.plugin(tauri_plugin_opener::init())
.plugin(tauri_plugin_dialog::init())
.plugin(tauri_plugin_deep_link::init())
.plugin(tauri_plugin_autostart::init(
tauri_plugin_autostart::MacosLauncher::LaunchAgent,
Expand Down
63 changes: 58 additions & 5 deletions apps/desktop/src/features/servers/ServersPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/

import { useEffect, useState, useCallback } from 'react';
import { open } from '@tauri-apps/plugin-dialog';
import {
ChevronDown,
ChevronRight,
Expand All @@ -17,6 +18,7 @@ import {
Loader2,
Clock,
FileJson,
FolderOpen,
} from 'lucide-react';
import { ServerActionMenu } from './ServerActionMenu';
import type { ServerViewModel, ServerDefinition, InstalledServerState, InputDefinition } from '../../types/registry';
Expand Down Expand Up @@ -1338,16 +1340,67 @@ export function ServersPage() {
className="input w-full"
/>
);
case 'password':
case 'select':
return (
<input
type="password"
<select
value={currentValue}
onChange={(e) => handleChange(e.target.value)}
placeholder={input.placeholder || `Enter ${input.label.toLowerCase()}...`}
className="input w-full"
data-testid={`config-input-${input.id}`}
/>
>
<option value="">{input.placeholder || `Select ${input.label.toLowerCase()}...`}</option>
{(input.options ?? []).map((opt) => (
<option key={opt.value} value={opt.value}>
{opt.label}
</option>
))}
</select>
);
case 'file_path':
return (
<div className="flex gap-2">
<input
type="text"
value={currentValue}
onChange={(e) => handleChange(e.target.value)}
placeholder={input.placeholder || 'Select a file...'}
className="input w-full"
data-testid={`config-input-${input.id}`}
/>
<button
type="button"
className="btn btn-secondary shrink-0 px-2"
onClick={async () => {
const selected = await open({ multiple: false });
if (selected) handleChange(selected);
}}
>
<FolderOpen className="w-4 h-4" />
</button>
</div>
);
case 'directory_path':
return (
<div className="flex gap-2">
<input
type="text"
value={currentValue}
onChange={(e) => handleChange(e.target.value)}
placeholder={input.placeholder || 'Select a directory...'}
className="input w-full"
data-testid={`config-input-${input.id}`}
/>
<button
type="button"
className="btn btn-secondary shrink-0 px-2"
onClick={async () => {
const selected = await open({ directory: true });
if (selected) handleChange(selected);
}}
>
<FolderOpen className="w-4 h-4" />
</button>
</div>
);
case 'text':
default:
Expand Down
4 changes: 3 additions & 1 deletion apps/desktop/src/types/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ export interface InputDefinition {
label: string;
description?: string;
/** Input type - determines how the field is rendered */
type?: 'text' | 'password' | 'boolean' | 'number' | 'url';
type?: 'text' | 'boolean' | 'number' | 'url' | 'select' | 'file_path' | 'directory_path';
required?: boolean;
/** Predefined options for select input type */
options?: { value: string; label: string; description?: string }[];
secret?: boolean;
placeholder?: string;
/** URL to obtain credentials/values */
Expand Down
1 change: 1 addition & 0 deletions crates/mcpmux-gateway/src/pool/transport/shell_env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

use std::ffi::OsString;
use std::sync::OnceLock;
#[cfg(unix)]
use tracing::{debug, info, warn};

/// Cached shell PATH, resolved once on first access.
Expand Down
10 changes: 10 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions tests/ts/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ vi.mock('@tauri-apps/plugin-updater', () => ({
Update: vi.fn(),
}));

// Mock Tauri dialog plugin
vi.mock('@tauri-apps/plugin-dialog', () => ({
open: vi.fn(),
}));

// Mock Tauri process plugin
vi.mock('@tauri-apps/plugin-process', () => ({
relaunch: vi.fn(),
Expand Down