feat(cli-endpoints): add create, update, and delete functionality for CLI endpoints

- Implemented `useCreateCliEndpoint`, `useUpdateCliEndpoint`, and `useDeleteCliEndpoint` hooks for managing CLI endpoints.
- Added `CliEndpointFormDialog` component for creating and editing CLI endpoints with validation.
- Updated translations for CLI hooks and manager to include new fields and messages.
- Refactored `CcwToolsMcpCard` to simplify enabling and disabling tools.
- Adjusted `SkillCreateDialog` to display paths based on CLI type.
This commit is contained in:
catlog22
2026-02-07 21:56:08 +08:00
parent 678be8d41f
commit 6073627ff2
12 changed files with 1252 additions and 422 deletions

View File

@@ -104,7 +104,10 @@
"hookType": "Hook Type",
"trigger": "Trigger Event",
"platform": "Platform",
"commandPreview": "Command Preview"
"commandPreview": "Command Preview",
"installTo": "Install To",
"scopeProject": "Project",
"scopeGlobal": "Global"
}
},
"navigation": {
@@ -117,36 +120,49 @@
"title": "Memory Update Wizard",
"description": "Configure hook to update CLAUDE.md on session end",
"shortDescription": "Update CLAUDE.md automatically",
"claudePath": "CLAUDE.md Path",
"updateFrequency": "Update Frequency",
"frequency": {
"sessionEnd": "Session End",
"hourly": "Hourly",
"daily": "Daily"
}
"cliTool": "CLI Tool",
"cliToolHelp": "CLI tool for CLAUDE.md generation",
"threshold": "Threshold (paths)",
"thresholdHelp": "Number of paths to trigger batch update (1-20)",
"timeout": "Timeout (seconds)",
"timeoutHelp": "Auto-flush queue after this time (60-1800)"
},
"dangerProtection": {
"title": "Danger Protection Wizard",
"description": "Configure confirmation hook for dangerous operations",
"shortDescription": "Confirm dangerous operations",
"keywords": "Dangerous Keywords",
"keywordsHelp": "Enter one keyword per line",
"confirmationMessage": "Confirmation Message",
"allowBypass": "Allow bypass with --force flag"
"selectProtections": "Select the protections you want to enable",
"selectedProtections": "Selected Protections",
"options": {
"bashConfirm": "Dangerous Commands",
"bashConfirmDesc": "Confirm before rm -rf, shutdown, kill, format, etc.",
"fileProtection": "Sensitive Files",
"fileProtectionDesc": "Block modifications to .env, .git/, secrets, keys",
"gitDestructive": "Git Operations",
"gitDestructiveDesc": "Confirm force push, hard reset, branch delete",
"networkConfirm": "Network Access",
"networkConfirmDesc": "Confirm curl, wget, ssh, WebFetch requests",
"systemPaths": "System Paths",
"systemPathsDesc": "Block/confirm operations on /etc, /usr, C:\\Windows",
"permissionChange": "Permission Changes",
"permissionChangeDesc": "Confirm chmod, chown, icacls operations"
}
},
"skillContext": {
"title": "SKILL Context Wizard",
"description": "Configure hook to load SKILL based on prompt keywords",
"shortDescription": "Auto-load SKILL based on keywords",
"loadingSkills": "Loading available skills...",
"keywordPlaceholder": "Enter keyword",
"selectSkill": "Select skill",
"addPair": "Add Keyword-Skill Pair",
"priority": "Priority",
"priorityHigh": "High",
"priorityMedium": "Medium",
"priorityLow": "Low",
"keywordMappings": "Keyword Mappings"
"addPair": "Add Skill Configuration",
"keywordMappings": "Keyword Mappings",
"keywordsPlaceholder": "react,workflow,api",
"mode": "Detection Mode",
"modeKeyword": "Keyword Matching",
"modeKeywordDesc": "Load specific SKILLs when keywords are detected",
"modeAuto": "Auto Detection",
"modeAutoDesc": "Automatically detect and load SKILLs by name",
"autoDescription": "Auto detection mode will scan user prompts for SKILL names and automatically load matching context. All available skills are shown below."
}
}
}

View File

@@ -28,6 +28,32 @@
"delete": "Delete Endpoint",
"toggle": "Toggle Endpoint"
},
"dialog": {
"createTitle": "Add Endpoint",
"editTitle": "Edit Endpoint ({id})"
},
"form": {
"name": "Name",
"namePlaceholder": "My endpoint",
"type": "Type",
"enabled": "Enabled",
"enabledHint": "Enable or disable this endpoint",
"configJson": "Configuration (JSON)",
"configJsonPlaceholder": "{\n \n}"
},
"validation": {
"nameRequired": "Name is required",
"typeRequired": "Type is required",
"invalidJson": "Invalid JSON",
"configMustBeObject": "Configuration must be a JSON object"
},
"messages": {
"created": "Endpoint created",
"updated": "Endpoint updated",
"deleted": "Endpoint deleted",
"saveFailed": "Failed to save endpoint",
"deleteFailed": "Failed to delete endpoint"
},
"deleteConfirm": "Are you sure you want to delete the endpoint \"{id}\"?",
"emptyState": {
"title": "No CLI Endpoints Found",

View File

@@ -104,7 +104,10 @@
"hookType": "钩子类型",
"trigger": "触发事件",
"platform": "平台",
"commandPreview": "命令预览"
"commandPreview": "命令预览",
"installTo": "安装到",
"scopeProject": "项目",
"scopeGlobal": "全局"
}
},
"navigation": {
@@ -117,36 +120,49 @@
"title": "记忆更新向导",
"description": "配置钩子以在会话结束时更新 CLAUDE.md",
"shortDescription": "自动更新 CLAUDE.md",
"claudePath": "CLAUDE.md 路径",
"updateFrequency": "更新频率",
"frequency": {
"sessionEnd": "会话结束时",
"hourly": "每小时",
"daily": "每天"
}
"cliTool": "CLI 工具",
"cliToolHelp": "用于生成 CLAUDE.md 的 CLI 工具",
"threshold": "阈值(路径数)",
"thresholdHelp": "触发批量更新的路径数量1-20",
"timeout": "超时时间(秒)",
"timeoutHelp": "超过此时间自动刷新队列60-1800"
},
"dangerProtection": {
"title": "危险操作保护向导",
"description": "配置危险操作的确认钩子",
"shortDescription": "确认危险操作",
"keywords": "危险关键词",
"keywordsHelp": "每行输入一个关键词",
"confirmationMessage": "确认消息",
"allowBypass": "允许使用 --force 标志绕过"
"selectProtections": "选择要启用的保护类型",
"selectedProtections": "已选保护",
"options": {
"bashConfirm": "危险命令",
"bashConfirmDesc": "执行 rm -rf、shutdown、kill、format 等命令前确认",
"fileProtection": "敏感文件",
"fileProtectionDesc": "阻止修改 .env、.git/、密钥等敏感文件",
"gitDestructive": "Git 操作",
"gitDestructiveDesc": "强制推送、硬重置、删除分支前确认",
"networkConfirm": "网络访问",
"networkConfirmDesc": "执行 curl、wget、ssh、WebFetch 请求前确认",
"systemPaths": "系统路径",
"systemPathsDesc": "阻止/确认对 /etc、/usr、C:\\Windows 的操作",
"permissionChange": "权限变更",
"permissionChangeDesc": "执行 chmod、chown、icacls 操作前确认"
}
},
"skillContext": {
"title": "SKILL 上下文向导",
"description": "配置钩子以根据提示关键词加载 SKILL",
"shortDescription": "根据关键词自动加载 SKILL",
"loadingSkills": "正在加载可用的技能...",
"keywordPlaceholder": "输入关键词",
"selectSkill": "选择技能",
"addPair": "添加关键词-技能对",
"priority": "优先级",
"priorityHigh": "高",
"priorityMedium": "",
"priorityLow": "",
"keywordMappings": "关键词映射"
"addPair": "添加技能配置",
"keywordMappings": "关键词映射",
"keywordsPlaceholder": "react,workflow,api",
"mode": "检测模式",
"modeKeyword": "关键词匹配",
"modeKeywordDesc": "检测到关键词时加载对应 SKILL",
"modeAuto": "自动检测",
"modeAutoDesc": "自动检测并按名称加载 SKILL",
"autoDescription": "自动检测模式将扫描用户提示中的 SKILL 名称,并自动加载匹配的上下文。所有可用技能如下所示。"
}
}
}

View File

@@ -28,6 +28,32 @@
"delete": "删除端点",
"toggle": "切换端点"
},
"dialog": {
"createTitle": "添加端点",
"editTitle": "编辑端点({id}"
},
"form": {
"name": "名称",
"namePlaceholder": "我的端点",
"type": "类型",
"enabled": "启用",
"enabledHint": "启用或禁用该端点",
"configJson": "配置JSON",
"configJsonPlaceholder": "{\n \n}"
},
"validation": {
"nameRequired": "名称不能为空",
"typeRequired": "类型不能为空",
"invalidJson": "JSON 格式不正确",
"configMustBeObject": "配置必须是 JSON 对象"
},
"messages": {
"created": "端点已创建",
"updated": "端点已更新",
"deleted": "端点已删除",
"saveFailed": "保存端点失败",
"deleteFailed": "删除端点失败"
},
"deleteConfirm": "确定要删除端点 \"{id}\" 吗?",
"emptyState": {
"title": "未找到 CLI 端点",