mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-24 21:30:17 +08:00
feat: overhaul OpenClaw config panels with JSON5 round-trip write engine
- Add json-five crate for JSON5 serialization preserving comments and formatting - Rewrite openclaw_config.rs with comment-preserving JSON5 read/write engine - Add Tauri commands: get_openclaw_live_provider, write_openclaw_config_section - Redesign EnvPanel as full JSON editor with structured error handling - Add tools.profile selection (minimal/coding/messaging/full) to ToolsPanel - Add legacy timeout migration support to AgentsDefaultsPanel - Add OpenClawHealthBanner component for config validation warnings - Add supporting hooks, mutations, utility functions, and unit tests
This commit is contained in:
+20
-1
@@ -483,6 +483,23 @@ export interface OpenClawModelCatalogEntry {
|
||||
alias?: string;
|
||||
}
|
||||
|
||||
export interface OpenClawHealthWarning {
|
||||
code: string;
|
||||
message: string;
|
||||
path?: string;
|
||||
}
|
||||
|
||||
export interface OpenClawWriteOutcome {
|
||||
backupPath?: string;
|
||||
warnings: OpenClawHealthWarning[];
|
||||
}
|
||||
|
||||
export type OpenClawToolsProfile =
|
||||
| "minimal"
|
||||
| "coding"
|
||||
| "messaging"
|
||||
| "full";
|
||||
|
||||
// OpenClaw 供应商配置(settings_config 结构)
|
||||
// 对应 OpenClaw 的 models.providers.<provider-id> 配置
|
||||
export interface OpenClawProviderConfig {
|
||||
@@ -496,6 +513,8 @@ export interface OpenClawProviderConfig {
|
||||
export interface OpenClawAgentsDefaults {
|
||||
model?: OpenClawDefaultModel;
|
||||
models?: Record<string, OpenClawModelCatalogEntry>;
|
||||
timeoutSeconds?: number;
|
||||
timeout?: number;
|
||||
[key: string]: unknown; // preserve unknown fields
|
||||
}
|
||||
|
||||
@@ -506,7 +525,7 @@ export interface OpenClawEnvConfig {
|
||||
|
||||
// OpenClaw tools 配置(openclaw.json 的 tools 节点)
|
||||
export interface OpenClawToolsConfig {
|
||||
profile?: string;
|
||||
profile?: OpenClawToolsProfile | string;
|
||||
allow?: string[];
|
||||
deny?: string[];
|
||||
[key: string]: unknown; // preserve unknown fields
|
||||
|
||||
Reference in New Issue
Block a user