feat(agents): add ZCode client integration

This commit is contained in:
lzt404 committed 2026-08-15 14:05:21 +08:00
1 parent 11b1ea23a5
commit d093a0122e
16 files changed
+472 -4

No files matched your search

+2
View File
@@ -466,6 +466,7 @@ export const jaOverrides = {
'agents.description.openclaw': 'CPA モデルプロバイダーと既定モデルを使用',
'agents.description.hermes': 'CPA カスタムプロバイダーを使用',
'agents.description.deepseekHarness': 'Harness のネイティブ DeepSeek 設定と分離された OpenAI 互換ルートで CPA を使用',
'agents.description.zcode': 'CPA の Anthropic Messages API と動的モデルカタログを使用',
'agents.description.pi': 'CLIProxyAPI プロバイダーを使用して Pi CLI のモデルを動的に読み込みます',
'agents.list.detecting': '検出中',
'agents.list.unsupported': '現在のプラットフォームでは非対応',
@@ -617,6 +618,7 @@ export const jaOverrides = {
'agents.modify.default': 'デフォルト設定',
'agents.modify.clear': '設定を消去',
'agents.modify.invalid': '現在の設定を解析できません。「設定変更を適用」は最小の有効な設定を再構築し、「デフォルト設定」はファイル全体をリセットします。',
'agents.modify.zcodeRestart': '設定の適用または終了後、モデルプロバイダーを再読み込みするため ZCode を完全終了して再起動してください。',
'agents.pi.installTitle': 'Pi CLIProxyAPI プロバイダー',
'agents.pi.installDescription': 'プラグインをインストールまたは更新し、CPA 認証情報、既定のプロバイダー、既定のモデルを修復します',
'agents.pi.install': 'Pi プラグインをインストール',
+2
View File
@@ -466,6 +466,7 @@ export const en: Record<MessageKey, string> = {
'agents.description.openclaw': 'Uses the CPA model provider and default model',
'agents.description.hermes': 'Uses the CPA custom provider',
'agents.description.deepseekHarness': 'Uses CPA through an isolated, OpenAI-compatible Harness route',
'agents.description.zcode': 'Uses the CPA Anthropic Messages API and dynamic model catalog',
'agents.description.pi': 'Loads models dynamically in Pi through the CLIProxyAPI provider',
'agents.list.detecting': 'Detecting',
'agents.list.unsupported': 'Unsupported on this platform',
@@ -617,6 +618,7 @@ export const en: Record<MessageKey, string> = {
'agents.modify.default': 'Default Configuration',
'agents.modify.clear': 'Clear Configuration',
'agents.modify.invalid': 'The current configuration cannot be parsed. Apply Configuration Changes rebuilds a minimal valid configuration; Default Configuration resets the whole file.',
'agents.modify.zcodeRestart': 'Fully quit and restart ZCode after applying or closing the configuration so it reloads model providers.',
'agents.pi.installTitle': 'Pi CLIProxyAPI provider',
'agents.pi.installDescription': 'Install or update the plugin and repair CPA credentials, the default provider, and the default model.',
'agents.pi.install': 'Install Pi Plugin',
+2
View File
@@ -464,6 +464,7 @@ export const zhCN = {
'agents.description.openclaw': '使用 CPA 模型供应商和默认模型',
'agents.description.hermes': '使用 CPA custom provider',
'agents.description.deepseekHarness': '通过通用 OpenAI 兼容路由使用 CPA,并与 Harness 原生 DeepSeek 配置隔离',
'agents.description.zcode': '使用 CPA 的 Anthropic Messages 接口和动态模型目录',
'agents.description.pi': '使用 Pi CLI 和 CLIProxyAPI provider 动态加载模型',
'agents.list.detecting': '正在检测',
'agents.list.unsupported': '当前平台不支持',
@@ -615,6 +616,7 @@ export const zhCN = {
'agents.modify.default': '默认配置',
'agents.modify.clear': '清空配置',
'agents.modify.invalid': '当前配置无法解析。点击“应用配置修改”会重建最小合法配置;“默认配置”会重置整个文件。',
'agents.modify.zcodeRestart': '应用或关闭配置后,请完全退出并重新启动 ZCode 以加载模型供应商。',
'agents.pi.installTitle': 'Pi CLIProxyAPI provider',
'agents.pi.installDescription': '安装或更新插件,并修复 CPA 凭据、默认 provider 与默认模型',
'agents.pi.install': '安装 Pi 插件',
+11 -2
View File
@@ -56,6 +56,7 @@ type AgentClientId =
| 'openclaw'
| 'hermes'
| 'deepseek-harness'
| 'zcode'
| 'pi';
type ClaudeModelMappingClientId = 'claude-code' | 'claude-desktop';
@@ -170,7 +171,7 @@ type AgentDefinition = {
name: string;
icon?: string;
Icon?: ComponentType<{ size?: number; 'aria-hidden'?: boolean }>;
descriptionKey: 'agents.description.claudeCode' | 'agents.description.claudeDesktop' | 'agents.description.codex' | 'agents.description.opencode' | 'agents.description.openclaw' | 'agents.description.hermes' | 'agents.description.deepseekHarness' | 'agents.description.pi';
descriptionKey: 'agents.description.claudeCode' | 'agents.description.claudeDesktop' | 'agents.description.codex' | 'agents.description.opencode' | 'agents.description.openclaw' | 'agents.description.hermes' | 'agents.description.deepseekHarness' | 'agents.description.zcode' | 'agents.description.pi';
};
type AgentSubpageId = 'core' | 'sessions';
@@ -224,6 +225,12 @@ const agentDefinitions: AgentDefinition[] = [
icon: deepseekIcon,
descriptionKey: 'agents.description.deepseekHarness',
},
{
id: 'zcode',
name: 'ZCode',
Icon: Bot,
descriptionKey: 'agents.description.zcode',
},
{
id: 'pi',
name: 'Pi',
@@ -888,7 +895,9 @@ export function AgentsPage() {
: t('agents.model.firstSelection', { count: models.length }));
const modificationDescription = activeStatus?.modificationState === 'invalid'
? t('agents.modify.invalid')
: '';
: selected === 'zcode'
? t('agents.modify.zcodeRestart')
: '';
const refreshModels = () => {
void loadModels(selected);
};
+1
View File
@@ -6,6 +6,7 @@ export type AgentConfigurationClientId =
| 'openclaw'
| 'hermes'
| 'deepseek-harness'
| 'zcode'
| 'pi';
export type AgentConfigurationModificationState = 'unconfigured' | 'applied' | 'invalid';