mirror of
https://github.com/aiclientproxy/proxycast.git
synced 2026-09-24 23:10:56 +08:00
fix: update linter auto-fixed imports for v0.84.0
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
+158
-977
File diff suppressed because it is too large
Load Diff
@@ -1,19 +1,29 @@
|
||||
import { safeInvoke } from "@/lib/dev-bridge";
|
||||
import type {
|
||||
Config,
|
||||
EnvironmentPreview,
|
||||
} from "@/hooks/useTauri";
|
||||
import type { Config, EnvironmentPreview } from "./appConfigTypes";
|
||||
|
||||
export type {
|
||||
Config,
|
||||
CrashReportingConfig,
|
||||
ChatAppearanceConfig,
|
||||
ContentCreatorConfig,
|
||||
EnvironmentConfig,
|
||||
EnvironmentPreview,
|
||||
EnvironmentPreviewEntry,
|
||||
EnvironmentVariableOverride,
|
||||
ImageGenConfig,
|
||||
MultiSearchConfig,
|
||||
MultiSearchEngineEntryConfig,
|
||||
NavigationConfig,
|
||||
QuotaExceededConfig,
|
||||
RemoteManagementConfig,
|
||||
ResponseCacheConfig,
|
||||
ShellImportPreview,
|
||||
TlsConfig,
|
||||
ToolCallingConfig,
|
||||
} from "@/hooks/useTauri";
|
||||
UserProfile,
|
||||
VoiceConfig,
|
||||
AssistantConfig,
|
||||
} from "./appConfigTypes";
|
||||
|
||||
export async function getConfig(): Promise<Config> {
|
||||
return safeInvoke("get_config");
|
||||
|
||||
@@ -0,0 +1,257 @@
|
||||
import type { ChannelsConfig, GatewayConfig } from "./channelsRuntimeTypes";
|
||||
import type {
|
||||
ExperimentalFeatures,
|
||||
ToolCallingConfig,
|
||||
} from "./experimentalFeatureTypes";
|
||||
import type { MemoryConfig } from "./memoryRuntimeTypes";
|
||||
import type { AmpConfig, CredentialPoolConfig } from "./providerRuntimeTypes";
|
||||
|
||||
export type { ToolCallingConfig } from "./experimentalFeatureTypes";
|
||||
|
||||
export interface TlsConfig {
|
||||
enable: boolean;
|
||||
cert_path: string | null;
|
||||
key_path: string | null;
|
||||
}
|
||||
|
||||
export interface ResponseCacheConfig {
|
||||
enabled: boolean;
|
||||
ttl_secs: number;
|
||||
max_entries: number;
|
||||
max_body_bytes: number;
|
||||
cacheable_status_codes: number[];
|
||||
}
|
||||
|
||||
export interface RemoteManagementConfig {
|
||||
allow_remote: boolean;
|
||||
secret_key: string | null;
|
||||
disable_control_panel: boolean;
|
||||
}
|
||||
|
||||
export interface QuotaExceededConfig {
|
||||
switch_project: boolean;
|
||||
switch_preview_model: boolean;
|
||||
cooldown_seconds: number;
|
||||
}
|
||||
|
||||
export interface MultiSearchEngineEntryConfig {
|
||||
name: string;
|
||||
url_template: string;
|
||||
enabled: boolean;
|
||||
}
|
||||
|
||||
export interface MultiSearchConfig {
|
||||
priority?: string[];
|
||||
engines?: MultiSearchEngineEntryConfig[];
|
||||
max_results_per_engine?: number;
|
||||
max_total_results?: number;
|
||||
timeout_ms?: number;
|
||||
}
|
||||
|
||||
export interface MediaGenerationPreferenceConfig {
|
||||
preferredProviderId?: string;
|
||||
preferredModelId?: string;
|
||||
allowFallback?: boolean;
|
||||
}
|
||||
|
||||
export interface MediaGenerationDefaultsConfig {
|
||||
image?: MediaGenerationPreferenceConfig;
|
||||
video?: MediaGenerationPreferenceConfig;
|
||||
voice?: MediaGenerationPreferenceConfig;
|
||||
}
|
||||
|
||||
export interface ContentCreatorConfig {
|
||||
enabled_themes: string[];
|
||||
media_defaults?: MediaGenerationDefaultsConfig;
|
||||
}
|
||||
|
||||
export interface NavigationConfig {
|
||||
enabled_items: string[];
|
||||
}
|
||||
|
||||
export interface ChatAppearanceConfig {
|
||||
fontSize?: number;
|
||||
transitionMode?: "none" | "fadeIn" | "smooth";
|
||||
bubbleStyle?: "default" | "minimal" | "colorful";
|
||||
showAvatar?: boolean;
|
||||
showTimestamp?: boolean;
|
||||
append_selected_text_to_recommendation?: boolean;
|
||||
}
|
||||
|
||||
export interface VoiceConfig {
|
||||
tts_service?: "openai" | "azure" | "google" | "edge" | "macos";
|
||||
stt_service?: "openai" | "azure" | "google" | "whisper";
|
||||
tts_voice?: string;
|
||||
tts_rate?: number;
|
||||
tts_pitch?: number;
|
||||
tts_volume?: number;
|
||||
stt_language?: string;
|
||||
stt_auto_stop?: boolean;
|
||||
voice_input_enabled?: boolean;
|
||||
voice_output_enabled?: boolean;
|
||||
}
|
||||
|
||||
export interface ImageGenConfig {
|
||||
default_service?: "dall_e" | "midjourney" | "stable_diffusion" | "flux";
|
||||
default_count?: number;
|
||||
default_size?:
|
||||
| "256x256"
|
||||
| "512x512"
|
||||
| "1024x1024"
|
||||
| "1792x1024"
|
||||
| "1024x1792";
|
||||
default_quality?: "standard" | "hd";
|
||||
default_style?: "vivid" | "natural";
|
||||
enable_enhancement?: boolean;
|
||||
auto_download?: boolean;
|
||||
image_search_pexels_api_key?: string;
|
||||
image_search_pixabay_api_key?: string;
|
||||
}
|
||||
|
||||
export interface AssistantConfig {
|
||||
default_assistant_id?: string;
|
||||
custom_assistants?: Array<{
|
||||
id: string;
|
||||
name: string;
|
||||
description?: string;
|
||||
model?: string;
|
||||
system_prompt?: string;
|
||||
temperature?: number;
|
||||
max_tokens?: number;
|
||||
}>;
|
||||
auto_select?: boolean;
|
||||
show_suggestions?: boolean;
|
||||
}
|
||||
|
||||
export interface UserProfile {
|
||||
avatar_url?: string;
|
||||
nickname?: string;
|
||||
bio?: string;
|
||||
email?: string;
|
||||
tags?: string[];
|
||||
}
|
||||
|
||||
export interface CrashReportingConfig {
|
||||
enabled: boolean;
|
||||
dsn?: string | null;
|
||||
environment?: string;
|
||||
sample_rate?: number;
|
||||
send_pii?: boolean;
|
||||
}
|
||||
|
||||
export interface ShellEnvironmentImportConfig {
|
||||
enabled: boolean;
|
||||
timeout_ms: number;
|
||||
}
|
||||
|
||||
export interface EnvironmentVariableOverride {
|
||||
key: string;
|
||||
value: string;
|
||||
enabled: boolean;
|
||||
}
|
||||
|
||||
export interface EnvironmentConfig {
|
||||
shell_import: ShellEnvironmentImportConfig;
|
||||
variables: EnvironmentVariableOverride[];
|
||||
}
|
||||
|
||||
export interface EnvironmentPreviewEntry {
|
||||
key: string;
|
||||
value: string;
|
||||
maskedValue: string;
|
||||
source: string;
|
||||
sourceLabel: string;
|
||||
sensitive: boolean;
|
||||
overriddenSources: string[];
|
||||
}
|
||||
|
||||
export interface ShellImportPreview {
|
||||
enabled: boolean;
|
||||
status: string;
|
||||
message: string;
|
||||
importedCount: number;
|
||||
durationMs?: number | null;
|
||||
}
|
||||
|
||||
export interface EnvironmentPreview {
|
||||
shellImport: ShellImportPreview;
|
||||
entries: EnvironmentPreviewEntry[];
|
||||
}
|
||||
|
||||
export interface Config {
|
||||
server: {
|
||||
host: string;
|
||||
port: number;
|
||||
api_key: string;
|
||||
tls: TlsConfig;
|
||||
response_cache: ResponseCacheConfig;
|
||||
};
|
||||
providers: {
|
||||
kiro: {
|
||||
enabled: boolean;
|
||||
credentials_path: string | null;
|
||||
region: string | null;
|
||||
};
|
||||
gemini: {
|
||||
enabled: boolean;
|
||||
credentials_path: string | null;
|
||||
};
|
||||
qwen: {
|
||||
enabled: boolean;
|
||||
credentials_path: string | null;
|
||||
};
|
||||
openai: {
|
||||
enabled: boolean;
|
||||
api_key: string | null;
|
||||
base_url: string | null;
|
||||
};
|
||||
claude: {
|
||||
enabled: boolean;
|
||||
api_key: string | null;
|
||||
base_url: string | null;
|
||||
};
|
||||
};
|
||||
default_provider: string;
|
||||
remote_management: RemoteManagementConfig;
|
||||
quota_exceeded: QuotaExceededConfig;
|
||||
ampcode: AmpConfig;
|
||||
credential_pool: CredentialPoolConfig;
|
||||
proxy_url: string | null;
|
||||
minimize_to_tray: boolean;
|
||||
language: string;
|
||||
experimental?: ExperimentalFeatures;
|
||||
tool_calling?: ToolCallingConfig;
|
||||
content_creator?: ContentCreatorConfig;
|
||||
navigation?: NavigationConfig;
|
||||
chat_appearance?: ChatAppearanceConfig;
|
||||
environment?: EnvironmentConfig;
|
||||
web_search?: {
|
||||
engine: "google" | "xiaohongshu";
|
||||
provider?:
|
||||
| "tavily"
|
||||
| "multi_search_engine"
|
||||
| "duckduckgo_instant"
|
||||
| "bing_search_api"
|
||||
| "google_custom_search";
|
||||
provider_priority?: Array<
|
||||
| "tavily"
|
||||
| "multi_search_engine"
|
||||
| "duckduckgo_instant"
|
||||
| "bing_search_api"
|
||||
| "google_custom_search"
|
||||
>;
|
||||
tavily_api_key?: string | null;
|
||||
bing_search_api_key?: string | null;
|
||||
google_search_api_key?: string | null;
|
||||
google_search_engine_id?: string | null;
|
||||
multi_search?: MultiSearchConfig;
|
||||
};
|
||||
memory?: MemoryConfig;
|
||||
voice?: VoiceConfig;
|
||||
image_gen?: ImageGenConfig;
|
||||
assistant?: AssistantConfig;
|
||||
user_profile?: UserProfile;
|
||||
gateway?: GatewayConfig;
|
||||
channels?: ChannelsConfig;
|
||||
crash_reporting?: CrashReportingConfig;
|
||||
}
|
||||
@@ -10,25 +10,48 @@ import type {
|
||||
GatewayTunnelStatus,
|
||||
GatewayTunnelSyncWebhookResponse,
|
||||
TelegramProbeResult,
|
||||
} from "@/hooks/useTauri";
|
||||
} from "./channelsRuntimeTypes";
|
||||
|
||||
export type {
|
||||
ChannelsConfig,
|
||||
CloudflaredInstallResult,
|
||||
CloudflaredInstallStatus,
|
||||
DiscordAccountConfig,
|
||||
DiscordActionsConfig,
|
||||
DiscordAgentComponentsConfig,
|
||||
DiscordBotConfig,
|
||||
DiscordChannelConfig,
|
||||
DiscordExecApprovalsConfig,
|
||||
DiscordGatewayAccountStatus,
|
||||
DiscordGatewayStatus,
|
||||
DiscordGuildConfig,
|
||||
DiscordIntentsConfig,
|
||||
DiscordProbeResult,
|
||||
DiscordThreadBindingsConfig,
|
||||
DiscordUiComponentsConfig,
|
||||
DiscordUiConfig,
|
||||
DiscordVoiceAutoJoinConfig,
|
||||
DiscordVoiceConfig,
|
||||
DiscordAutoPresenceConfig,
|
||||
FeishuBotConfig,
|
||||
FeishuAccountConfig,
|
||||
FeishuGatewayAccountStatus,
|
||||
FeishuGatewayStatus,
|
||||
FeishuGroupConfig,
|
||||
FeishuProbeResult,
|
||||
CloudflareTunnelConfig,
|
||||
GatewayChannelStatusResponse,
|
||||
GatewayConfig,
|
||||
GatewayTunnelCreateResponse,
|
||||
GatewayTunnelConfig,
|
||||
GatewayTunnelProbeResult,
|
||||
GatewayTunnelStatus,
|
||||
GatewayTunnelSyncWebhookResponse,
|
||||
TelegramBotConfig,
|
||||
TelegramGatewayAccountStatus,
|
||||
TelegramGatewayStatus,
|
||||
TelegramProbeResult,
|
||||
} from "@/hooks/useTauri";
|
||||
} from "./channelsRuntimeTypes";
|
||||
|
||||
export async function gatewayChannelStart(params?: {
|
||||
channel?: "telegram" | "feishu" | "discord";
|
||||
|
||||
@@ -0,0 +1,374 @@
|
||||
export interface TelegramBotConfig {
|
||||
enabled: boolean;
|
||||
bot_token: string;
|
||||
allowed_user_ids: string[];
|
||||
default_model?: string;
|
||||
}
|
||||
|
||||
export interface DiscordBotConfig {
|
||||
enabled: boolean;
|
||||
bot_token: string;
|
||||
allowed_server_ids: string[];
|
||||
default_model?: string;
|
||||
default_account?: string;
|
||||
accounts?: Record<string, DiscordAccountConfig>;
|
||||
dm_policy?: string;
|
||||
allow_from?: string[];
|
||||
group_policy?: string;
|
||||
group_allow_from?: string[];
|
||||
groups?: Record<string, DiscordGuildConfig>;
|
||||
streaming?: string;
|
||||
reply_to_mode?: string;
|
||||
intents?: DiscordIntentsConfig;
|
||||
actions?: DiscordActionsConfig;
|
||||
thread_bindings?: DiscordThreadBindingsConfig;
|
||||
auto_presence?: DiscordAutoPresenceConfig;
|
||||
voice?: DiscordVoiceConfig;
|
||||
agent_components?: DiscordAgentComponentsConfig;
|
||||
ui?: DiscordUiConfig;
|
||||
exec_approvals?: DiscordExecApprovalsConfig;
|
||||
response_prefix?: string;
|
||||
ack_reaction?: string;
|
||||
}
|
||||
|
||||
export interface DiscordAccountConfig {
|
||||
enabled?: boolean;
|
||||
name?: string;
|
||||
bot_token?: string;
|
||||
allowed_server_ids?: string[];
|
||||
default_model?: string;
|
||||
dm_policy?: string;
|
||||
allow_from?: string[];
|
||||
group_policy?: string;
|
||||
group_allow_from?: string[];
|
||||
groups?: Record<string, DiscordGuildConfig>;
|
||||
streaming?: string;
|
||||
reply_to_mode?: string;
|
||||
intents?: DiscordIntentsConfig;
|
||||
actions?: DiscordActionsConfig;
|
||||
thread_bindings?: DiscordThreadBindingsConfig;
|
||||
auto_presence?: DiscordAutoPresenceConfig;
|
||||
voice?: DiscordVoiceConfig;
|
||||
agent_components?: DiscordAgentComponentsConfig;
|
||||
ui?: DiscordUiConfig;
|
||||
exec_approvals?: DiscordExecApprovalsConfig;
|
||||
response_prefix?: string;
|
||||
ack_reaction?: string;
|
||||
}
|
||||
|
||||
export interface DiscordGuildConfig {
|
||||
enabled?: boolean;
|
||||
require_mention?: boolean;
|
||||
group_policy?: string;
|
||||
allow_from?: string[];
|
||||
channels?: Record<string, DiscordChannelConfig>;
|
||||
}
|
||||
|
||||
export interface DiscordChannelConfig {
|
||||
enabled?: boolean;
|
||||
require_mention?: boolean;
|
||||
group_policy?: string;
|
||||
allow_from?: string[];
|
||||
}
|
||||
|
||||
export interface DiscordIntentsConfig {
|
||||
message_content?: boolean;
|
||||
guild_members?: boolean;
|
||||
presence?: boolean;
|
||||
}
|
||||
|
||||
export interface DiscordActionsConfig {
|
||||
reactions?: boolean;
|
||||
messages?: boolean;
|
||||
threads?: boolean;
|
||||
moderation?: boolean;
|
||||
presence?: boolean;
|
||||
}
|
||||
|
||||
export interface DiscordThreadBindingsConfig {
|
||||
enabled?: boolean;
|
||||
idle_hours?: number;
|
||||
max_age_hours?: number;
|
||||
spawn_subagent_sessions?: boolean;
|
||||
spawn_acp_sessions?: boolean;
|
||||
}
|
||||
|
||||
export interface DiscordAutoPresenceConfig {
|
||||
enabled?: boolean;
|
||||
interval_ms?: number;
|
||||
min_update_interval_ms?: number;
|
||||
healthy_text?: string;
|
||||
degraded_text?: string;
|
||||
exhausted_text?: string;
|
||||
}
|
||||
|
||||
export interface DiscordVoiceAutoJoinConfig {
|
||||
guild_id: string;
|
||||
channel_id: string;
|
||||
}
|
||||
|
||||
export interface DiscordVoiceConfig {
|
||||
enabled?: boolean;
|
||||
auto_join?: DiscordVoiceAutoJoinConfig[];
|
||||
dave_encryption?: boolean;
|
||||
decryption_failure_tolerance?: number;
|
||||
}
|
||||
|
||||
export interface DiscordAgentComponentsConfig {
|
||||
enabled?: boolean;
|
||||
}
|
||||
|
||||
export interface DiscordUiComponentsConfig {
|
||||
accent_color?: string;
|
||||
}
|
||||
|
||||
export interface DiscordUiConfig {
|
||||
components?: DiscordUiComponentsConfig;
|
||||
}
|
||||
|
||||
export interface DiscordExecApprovalsConfig {
|
||||
enabled?: boolean;
|
||||
approvers?: string[];
|
||||
agent_filter?: string[];
|
||||
session_filter?: string[];
|
||||
cleanup_after_resolve?: boolean;
|
||||
target?: string;
|
||||
}
|
||||
|
||||
export interface FeishuBotConfig {
|
||||
enabled: boolean;
|
||||
app_id: string;
|
||||
app_secret: string;
|
||||
verification_token?: string;
|
||||
encrypt_key?: string;
|
||||
default_model?: string;
|
||||
default_account?: string;
|
||||
accounts?: Record<string, FeishuAccountConfig>;
|
||||
domain?: string;
|
||||
connection_mode?: string;
|
||||
webhook_host?: string;
|
||||
webhook_port?: number;
|
||||
webhook_path?: string;
|
||||
dm_policy?: string;
|
||||
allow_from?: string[];
|
||||
group_policy?: string;
|
||||
group_allow_from?: string[];
|
||||
groups?: Record<string, FeishuGroupConfig>;
|
||||
streaming?: string;
|
||||
reply_to_mode?: string;
|
||||
}
|
||||
|
||||
export interface FeishuGroupConfig {
|
||||
enabled?: boolean;
|
||||
require_mention?: boolean;
|
||||
group_policy?: string;
|
||||
allow_from?: string[];
|
||||
}
|
||||
|
||||
export interface FeishuAccountConfig {
|
||||
enabled?: boolean;
|
||||
name?: string;
|
||||
app_id?: string;
|
||||
app_secret?: string;
|
||||
verification_token?: string;
|
||||
encrypt_key?: string;
|
||||
default_model?: string;
|
||||
domain?: string;
|
||||
connection_mode?: string;
|
||||
webhook_host?: string;
|
||||
webhook_port?: number;
|
||||
webhook_path?: string;
|
||||
dm_policy?: string;
|
||||
allow_from?: string[];
|
||||
group_policy?: string;
|
||||
group_allow_from?: string[];
|
||||
groups?: Record<string, FeishuGroupConfig>;
|
||||
streaming?: string;
|
||||
reply_to_mode?: string;
|
||||
}
|
||||
|
||||
export interface CloudflareTunnelConfig {
|
||||
account_id?: string;
|
||||
tunnel_name?: string;
|
||||
tunnel_id?: string;
|
||||
run_token?: string;
|
||||
credentials_file?: string;
|
||||
dns_name?: string;
|
||||
}
|
||||
|
||||
export interface GatewayTunnelConfig {
|
||||
enabled?: boolean;
|
||||
provider?: string;
|
||||
mode?: string;
|
||||
binary_path?: string;
|
||||
local_host?: string;
|
||||
local_port?: number;
|
||||
public_base_url?: string;
|
||||
cloudflare?: CloudflareTunnelConfig;
|
||||
}
|
||||
|
||||
export interface GatewayConfig {
|
||||
tunnel?: GatewayTunnelConfig;
|
||||
}
|
||||
|
||||
export interface ChannelsConfig {
|
||||
telegram: TelegramBotConfig;
|
||||
discord: DiscordBotConfig;
|
||||
feishu: FeishuBotConfig;
|
||||
}
|
||||
|
||||
export interface TelegramGatewayAccountStatus {
|
||||
account_id: string;
|
||||
running: boolean;
|
||||
bot_username?: string | null;
|
||||
started_at?: string | null;
|
||||
last_error?: string | null;
|
||||
last_update_id?: number | null;
|
||||
last_message_at?: string | null;
|
||||
}
|
||||
|
||||
export interface TelegramGatewayStatus {
|
||||
running_accounts: number;
|
||||
accounts: TelegramGatewayAccountStatus[];
|
||||
}
|
||||
|
||||
export interface FeishuGatewayAccountStatus {
|
||||
account_id: string;
|
||||
running: boolean;
|
||||
connection_mode: string;
|
||||
started_at?: string | null;
|
||||
last_error?: string | null;
|
||||
last_event_at?: string | null;
|
||||
last_message_at?: string | null;
|
||||
webhook_endpoint?: string | null;
|
||||
}
|
||||
|
||||
export interface FeishuGatewayStatus {
|
||||
running_accounts: number;
|
||||
accounts: FeishuGatewayAccountStatus[];
|
||||
}
|
||||
|
||||
export interface DiscordGatewayAccountStatus {
|
||||
account_id: string;
|
||||
running: boolean;
|
||||
connected: boolean;
|
||||
bot_id?: string | null;
|
||||
bot_username?: string | null;
|
||||
application_id?: string | null;
|
||||
message_content_intent?: string | null;
|
||||
started_at?: string | null;
|
||||
last_error?: string | null;
|
||||
last_event_at?: string | null;
|
||||
last_message_at?: string | null;
|
||||
last_disconnect?: string | null;
|
||||
reconnect_attempts?: number | null;
|
||||
}
|
||||
|
||||
export interface DiscordGatewayStatus {
|
||||
running_accounts: number;
|
||||
accounts: DiscordGatewayAccountStatus[];
|
||||
}
|
||||
|
||||
export interface GatewayChannelStatusResponse {
|
||||
channel: string;
|
||||
status: unknown;
|
||||
}
|
||||
|
||||
export interface TelegramProbeResult {
|
||||
account_id: string;
|
||||
ok: boolean;
|
||||
bot_id?: number | null;
|
||||
username?: string | null;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface FeishuProbeResult {
|
||||
account_id: string;
|
||||
ok: boolean;
|
||||
app_id?: string | null;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface DiscordProbeResult {
|
||||
account_id: string;
|
||||
ok: boolean;
|
||||
bot_id?: string | null;
|
||||
username?: string | null;
|
||||
application_id?: string | null;
|
||||
message_content_intent?: string | null;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface GatewayTunnelStatus {
|
||||
running: boolean;
|
||||
provider: string;
|
||||
mode: string;
|
||||
binary: string;
|
||||
local_url: string;
|
||||
public_base_url?: string | null;
|
||||
pid?: number | null;
|
||||
started_at?: string | null;
|
||||
last_error?: string | null;
|
||||
last_exit?: string | null;
|
||||
command_preview?: string | null;
|
||||
connector_active?: boolean | null;
|
||||
connector_message?: string | null;
|
||||
}
|
||||
|
||||
export interface GatewayTunnelProbeResult {
|
||||
ok: boolean;
|
||||
provider: string;
|
||||
mode: string;
|
||||
binary: string;
|
||||
version?: string | null;
|
||||
config_ready: boolean;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface CloudflaredInstallStatus {
|
||||
installed: boolean;
|
||||
binary: string;
|
||||
version?: string | null;
|
||||
platform: string;
|
||||
package_manager?: string | null;
|
||||
install_supported: boolean;
|
||||
install_command?: string | null;
|
||||
requires_privilege: boolean;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface CloudflaredInstallResult {
|
||||
ok: boolean;
|
||||
attempted: boolean;
|
||||
platform: string;
|
||||
package_manager?: string | null;
|
||||
command?: string | null;
|
||||
exit_code?: number | null;
|
||||
installed: boolean;
|
||||
version?: string | null;
|
||||
stdout: string;
|
||||
stderr: string;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface GatewayTunnelCreateResponse {
|
||||
result: {
|
||||
ok: boolean;
|
||||
tunnel_name: string;
|
||||
tunnel_id?: string | null;
|
||||
credentials_file?: string | null;
|
||||
dns_name?: string | null;
|
||||
public_base_url?: string | null;
|
||||
message: string;
|
||||
};
|
||||
status: GatewayTunnelStatus;
|
||||
}
|
||||
|
||||
export interface GatewayTunnelSyncWebhookResponse {
|
||||
channel: string;
|
||||
account_id?: string | null;
|
||||
webhook_path: string;
|
||||
public_base_url: string;
|
||||
webhook_url: string;
|
||||
persisted: boolean;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
export interface SmartInputConfig {
|
||||
enabled: boolean;
|
||||
shortcut: string;
|
||||
}
|
||||
|
||||
export interface ExperimentalFeatures {
|
||||
screenshot_chat: SmartInputConfig;
|
||||
}
|
||||
|
||||
export interface ToolCallingConfig {
|
||||
enabled: boolean;
|
||||
dynamic_filtering: boolean;
|
||||
native_input_examples: boolean;
|
||||
}
|
||||
@@ -1,7 +1,11 @@
|
||||
import { safeInvoke } from "@/lib/dev-bridge";
|
||||
import type { ExperimentalFeatures } from "@/hooks/useTauri";
|
||||
import type { ExperimentalFeatures } from "./experimentalFeatureTypes";
|
||||
|
||||
export type { ExperimentalFeatures, SmartInputConfig } from "@/hooks/useTauri";
|
||||
export type {
|
||||
ExperimentalFeatures,
|
||||
SmartInputConfig,
|
||||
ToolCallingConfig,
|
||||
} from "./experimentalFeatureTypes";
|
||||
|
||||
export async function getExperimentalConfig(): Promise<ExperimentalFeatures> {
|
||||
return safeInvoke("get_experimental_config");
|
||||
|
||||
@@ -4,19 +4,26 @@ import type {
|
||||
EffectiveMemorySourcesResponse,
|
||||
MemoryAutoToggleResponse,
|
||||
MemoryOverviewResponse,
|
||||
} from "@/hooks/useTauri";
|
||||
} from "./memoryRuntimeTypes";
|
||||
|
||||
export type {
|
||||
AutoMemoryIndexResponse,
|
||||
AutoMemoryIndexItem,
|
||||
CleanupMemoryResult,
|
||||
EffectiveMemorySourcesResponse,
|
||||
EffectiveMemorySource,
|
||||
MemoryAnalysisResult,
|
||||
MemoryAutoConfig,
|
||||
MemoryAutoToggleResponse,
|
||||
MemoryCategoryStat,
|
||||
MemoryConfig,
|
||||
MemoryEntryPreview,
|
||||
MemoryOverviewResponse,
|
||||
MemoryProfileConfig,
|
||||
MemoryResolveConfig,
|
||||
MemorySourcesConfig,
|
||||
} from "@/hooks/useTauri";
|
||||
MemoryStatsResponse,
|
||||
} from "./memoryRuntimeTypes";
|
||||
|
||||
export async function getMemoryOverview(
|
||||
limit?: number,
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
export interface MemoryProfileConfig {
|
||||
current_status?: string;
|
||||
strengths?: string[];
|
||||
explanation_style?: string[];
|
||||
challenge_preference?: string[];
|
||||
}
|
||||
|
||||
export interface MemorySourcesConfig {
|
||||
managed_policy_path?: string | null;
|
||||
project_memory_paths?: string[];
|
||||
project_rule_dirs?: string[];
|
||||
user_memory_path?: string | null;
|
||||
project_local_memory_path?: string | null;
|
||||
}
|
||||
|
||||
export interface MemoryAutoConfig {
|
||||
enabled?: boolean;
|
||||
entrypoint?: string;
|
||||
max_loaded_lines?: number;
|
||||
root_dir?: string | null;
|
||||
}
|
||||
|
||||
export interface MemoryResolveConfig {
|
||||
additional_dirs?: string[];
|
||||
follow_imports?: boolean;
|
||||
import_max_depth?: number;
|
||||
load_additional_dirs_memory?: boolean;
|
||||
}
|
||||
|
||||
export interface MemoryConfig {
|
||||
enabled: boolean;
|
||||
max_entries?: number;
|
||||
retention_days?: number;
|
||||
auto_cleanup?: boolean;
|
||||
profile?: MemoryProfileConfig;
|
||||
sources?: MemorySourcesConfig;
|
||||
auto?: MemoryAutoConfig;
|
||||
resolve?: MemoryResolveConfig;
|
||||
}
|
||||
|
||||
export interface MemoryStatsResponse {
|
||||
total_entries: number;
|
||||
storage_used: number;
|
||||
memory_count: number;
|
||||
}
|
||||
|
||||
export interface MemoryCategoryStat {
|
||||
category: "identity" | "context" | "preference" | "experience" | "activity";
|
||||
count: number;
|
||||
}
|
||||
|
||||
export interface MemoryEntryPreview {
|
||||
id: string;
|
||||
session_id: string;
|
||||
file_type: string;
|
||||
category: "identity" | "context" | "preference" | "experience" | "activity";
|
||||
title: string;
|
||||
summary: string;
|
||||
updated_at: number;
|
||||
tags: string[];
|
||||
}
|
||||
|
||||
export interface MemoryOverviewResponse {
|
||||
stats: MemoryStatsResponse;
|
||||
categories: MemoryCategoryStat[];
|
||||
entries: MemoryEntryPreview[];
|
||||
}
|
||||
|
||||
export interface CleanupMemoryResult {
|
||||
cleaned_entries: number;
|
||||
freed_space: number;
|
||||
}
|
||||
|
||||
export interface MemoryAnalysisResult {
|
||||
analyzed_sessions: number;
|
||||
analyzed_messages: number;
|
||||
generated_entries: number;
|
||||
deduplicated_entries: number;
|
||||
}
|
||||
|
||||
export interface EffectiveMemorySource {
|
||||
kind: string;
|
||||
path: string;
|
||||
exists: boolean;
|
||||
loaded: boolean;
|
||||
line_count: number;
|
||||
import_count: number;
|
||||
warnings: string[];
|
||||
preview?: string | null;
|
||||
}
|
||||
|
||||
export interface EffectiveMemorySourcesResponse {
|
||||
working_dir: string;
|
||||
total_sources: number;
|
||||
loaded_sources: number;
|
||||
follow_imports: boolean;
|
||||
import_max_depth: number;
|
||||
sources: EffectiveMemorySource[];
|
||||
}
|
||||
|
||||
export interface AutoMemoryIndexItem {
|
||||
title: string;
|
||||
relative_path: string;
|
||||
exists: boolean;
|
||||
summary?: string | null;
|
||||
}
|
||||
|
||||
export interface AutoMemoryIndexResponse {
|
||||
enabled: boolean;
|
||||
root_dir: string;
|
||||
entrypoint: string;
|
||||
max_loaded_lines: number;
|
||||
entry_exists: boolean;
|
||||
total_lines: number;
|
||||
preview_lines: string[];
|
||||
items: AutoMemoryIndexItem[];
|
||||
}
|
||||
|
||||
export interface MemoryAutoToggleResponse {
|
||||
enabled: boolean;
|
||||
}
|
||||
@@ -1,97 +1,32 @@
|
||||
import { safeInvoke } from "@/lib/dev-bridge";
|
||||
import type {
|
||||
CheckResult,
|
||||
ClaudeCustomStatus,
|
||||
EnvVariable,
|
||||
GeminiCredentialStatus,
|
||||
KiroCredentialStatus,
|
||||
OpenAICustomStatus,
|
||||
QwenCredentialStatus,
|
||||
} from "./providerRuntimeTypes";
|
||||
|
||||
export interface AmpModelMapping {
|
||||
from: string;
|
||||
to: string;
|
||||
}
|
||||
|
||||
export interface AmpConfig {
|
||||
upstream_url: string | null;
|
||||
model_mappings: AmpModelMapping[];
|
||||
restrict_management_to_localhost: boolean;
|
||||
}
|
||||
|
||||
export interface GeminiApiKeyEntry {
|
||||
id: string;
|
||||
api_key: string;
|
||||
base_url: string | null;
|
||||
proxy_url: string | null;
|
||||
excluded_models: string[];
|
||||
disabled: boolean;
|
||||
}
|
||||
|
||||
export interface VertexModelAlias {
|
||||
name: string;
|
||||
alias: string;
|
||||
}
|
||||
|
||||
export interface VertexApiKeyEntry {
|
||||
id: string;
|
||||
api_key: string;
|
||||
base_url: string | null;
|
||||
models: VertexModelAlias[];
|
||||
proxy_url: string | null;
|
||||
disabled: boolean;
|
||||
}
|
||||
|
||||
export interface CredentialEntry {
|
||||
id: string;
|
||||
token_file: string;
|
||||
disabled: boolean;
|
||||
proxy_url: string | null;
|
||||
}
|
||||
|
||||
export interface KiroCredentialStatus {
|
||||
loaded: boolean;
|
||||
has_access_token: boolean;
|
||||
has_refresh_token: boolean;
|
||||
region: string | null;
|
||||
auth_method: string | null;
|
||||
expires_at: string | null;
|
||||
creds_path: string;
|
||||
}
|
||||
|
||||
export interface EnvVariable {
|
||||
key: string;
|
||||
value: string;
|
||||
masked: string;
|
||||
}
|
||||
|
||||
export interface CheckResult {
|
||||
changed: boolean;
|
||||
new_hash: string;
|
||||
reloaded: boolean;
|
||||
}
|
||||
|
||||
export interface GeminiCredentialStatus {
|
||||
loaded: boolean;
|
||||
has_access_token: boolean;
|
||||
has_refresh_token: boolean;
|
||||
expiry_date: number | null;
|
||||
is_valid: boolean;
|
||||
creds_path: string;
|
||||
}
|
||||
|
||||
export interface QwenCredentialStatus {
|
||||
loaded: boolean;
|
||||
has_access_token: boolean;
|
||||
has_refresh_token: boolean;
|
||||
expiry_date: number | null;
|
||||
is_valid: boolean;
|
||||
creds_path: string;
|
||||
}
|
||||
|
||||
export interface OpenAICustomStatus {
|
||||
enabled: boolean;
|
||||
has_api_key: boolean;
|
||||
base_url: string;
|
||||
}
|
||||
|
||||
export interface ClaudeCustomStatus {
|
||||
enabled: boolean;
|
||||
has_api_key: boolean;
|
||||
base_url: string;
|
||||
}
|
||||
export type {
|
||||
AmpConfig,
|
||||
AmpModelMapping,
|
||||
ApiKeyEntry,
|
||||
CheckResult,
|
||||
ClaudeCustomStatus,
|
||||
CredentialEntry,
|
||||
CredentialPoolConfig,
|
||||
EnvVariable,
|
||||
GeminiApiKeyEntry,
|
||||
GeminiCredentialStatus,
|
||||
IFlowCredentialEntry,
|
||||
KiroCredentialStatus,
|
||||
OpenAICustomStatus,
|
||||
QwenCredentialStatus,
|
||||
VertexApiKeyEntry,
|
||||
VertexModelAlias,
|
||||
} from "./providerRuntimeTypes";
|
||||
|
||||
export async function refreshKiroToken(): Promise<string> {
|
||||
return safeInvoke("refresh_kiro_token");
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
export interface AmpModelMapping {
|
||||
from: string;
|
||||
to: string;
|
||||
}
|
||||
|
||||
export interface AmpConfig {
|
||||
upstream_url: string | null;
|
||||
model_mappings: AmpModelMapping[];
|
||||
restrict_management_to_localhost: boolean;
|
||||
}
|
||||
|
||||
export interface GeminiApiKeyEntry {
|
||||
id: string;
|
||||
api_key: string;
|
||||
base_url: string | null;
|
||||
proxy_url: string | null;
|
||||
excluded_models: string[];
|
||||
disabled: boolean;
|
||||
}
|
||||
|
||||
export interface VertexModelAlias {
|
||||
name: string;
|
||||
alias: string;
|
||||
}
|
||||
|
||||
export interface VertexApiKeyEntry {
|
||||
id: string;
|
||||
api_key: string;
|
||||
base_url: string | null;
|
||||
models: VertexModelAlias[];
|
||||
proxy_url: string | null;
|
||||
disabled: boolean;
|
||||
}
|
||||
|
||||
export interface IFlowCredentialEntry {
|
||||
id: string;
|
||||
token_file: string | null;
|
||||
auth_type: string;
|
||||
cookies: string | null;
|
||||
proxy_url: string | null;
|
||||
disabled: boolean;
|
||||
}
|
||||
|
||||
export interface CredentialEntry {
|
||||
id: string;
|
||||
token_file: string;
|
||||
disabled: boolean;
|
||||
proxy_url: string | null;
|
||||
}
|
||||
|
||||
export interface ApiKeyEntry {
|
||||
id: string;
|
||||
api_key: string;
|
||||
base_url: string | null;
|
||||
disabled: boolean;
|
||||
proxy_url: string | null;
|
||||
}
|
||||
|
||||
export interface CredentialPoolConfig {
|
||||
kiro: CredentialEntry[];
|
||||
gemini: CredentialEntry[];
|
||||
qwen: CredentialEntry[];
|
||||
openai: ApiKeyEntry[];
|
||||
claude: ApiKeyEntry[];
|
||||
gemini_api_keys: GeminiApiKeyEntry[];
|
||||
vertex_api_keys: VertexApiKeyEntry[];
|
||||
codex: CredentialEntry[];
|
||||
iflow: IFlowCredentialEntry[];
|
||||
}
|
||||
|
||||
export interface KiroCredentialStatus {
|
||||
loaded: boolean;
|
||||
has_access_token: boolean;
|
||||
has_refresh_token: boolean;
|
||||
region: string | null;
|
||||
auth_method: string | null;
|
||||
expires_at: string | null;
|
||||
creds_path: string;
|
||||
}
|
||||
|
||||
export interface EnvVariable {
|
||||
key: string;
|
||||
value: string;
|
||||
masked: string;
|
||||
}
|
||||
|
||||
export interface CheckResult {
|
||||
changed: boolean;
|
||||
new_hash: string;
|
||||
reloaded: boolean;
|
||||
}
|
||||
|
||||
export interface GeminiCredentialStatus {
|
||||
loaded: boolean;
|
||||
has_access_token: boolean;
|
||||
has_refresh_token: boolean;
|
||||
expiry_date: number | null;
|
||||
is_valid: boolean;
|
||||
creds_path: string;
|
||||
}
|
||||
|
||||
export interface QwenCredentialStatus {
|
||||
loaded: boolean;
|
||||
has_access_token: boolean;
|
||||
has_refresh_token: boolean;
|
||||
expiry_date: number | null;
|
||||
is_valid: boolean;
|
||||
creds_path: string;
|
||||
}
|
||||
|
||||
export interface OpenAICustomStatus {
|
||||
enabled: boolean;
|
||||
has_api_key: boolean;
|
||||
base_url: string;
|
||||
}
|
||||
|
||||
export interface ClaudeCustomStatus {
|
||||
enabled: boolean;
|
||||
has_api_key: boolean;
|
||||
base_url: string;
|
||||
}
|
||||
Reference in New Issue
Block a user