feat: refactor HomePage to integrate agents store and update related components

feat: add runtime event handling for providers in ProvidersSection

feat: update routing to include Channels and Agents pages

feat: extend route types and navigation items for Channels and Agents

feat: implement agents store for managing agent data and interactions

fix: update chat store to utilize agents store for agent-related functionality

chore: export agents store from index

fix: enhance runtime types for better event handling

fix: update Vite config to handle dev server URL correctly
This commit is contained in:
duanshuwen
2026-04-18 14:56:32 +08:00
parent dfa4388087
commit ee72cf7261
52 changed files with 6626 additions and 189 deletions

View File

@@ -43,12 +43,115 @@ export const messages: I18nMessages = {
sidebar: {
home: 'Home',
knowledge: 'Knowledge',
channels: 'Channels',
agents: 'Agents',
models: 'Models',
skills: 'Skills',
cron: 'Cron',
scripts: 'Scripts',
settings: 'Settings',
},
agents: {
title: 'Agents',
subtitle: 'Create new Agents to route specific channels into different personas or workspaces.',
refresh: 'Refresh',
addAgent: 'Add Agent',
addHint: 'Create a separate Agent for a new workspace, persona, or channel owner.',
warning: 'Changes from Providers, Channels, or runtime sync can take a moment to appear. Refresh if this view looks stale.',
emptyTitle: 'No Agents yet',
emptyDescription: 'Add your first Agent to split channels, accounts, or workspace context away from the Main Agent.',
errorPrefix: 'Failed to load agents: {error}',
defaultBadge: 'Default',
inherited: 'Inherited',
mainManagedHint: 'Main Agent',
none: 'None',
actions: {
rename: 'Rename',
model: 'Model',
settings: 'Settings',
delete: 'Delete',
},
prompts: {
createName: 'Agent name',
inheritWorkspace: 'Inherit the Main Agent workspace bootstrap files for this Agent?',
renameName: 'Rename Agent',
modelRef: 'Set a provider/model ref for this Agent. Leave blank to inherit from its provider or the workspace default.',
deleteConfirm: 'Delete Agent "{name}"? Existing chats stay on disk, but this Agent will disappear from the Agents page.',
},
createDialog: {
title: 'Add Agent',
description: 'Create a new Agent by name. You can optionally inherit the Main Agent workspace bootstrap files.',
nameLabel: 'Agent name',
namePlaceholder: 'Coding Helper',
inheritWorkspaceLabel: 'Inherit Main Agent workspace',
inheritWorkspaceDescription: 'Copy SOUL.md, AGENTS.md, and other bootstrap files from the Main Agent.',
saveLabel: 'Save',
savingLabel: 'Saving...',
},
fields: {
model: 'Model',
workspace: 'Workspace',
agentDir: 'Agent folder',
mainSessionKey: 'Main session key',
channels: 'Channels',
providerAccount: 'Provider',
},
card: {
modelLabel: 'Model',
channelCount: '{count} channels',
accountBindingCount: '{count} account bindings',
noChannels: 'No channels',
missingWorkspace: 'Workspace not configured',
missingModel: 'Model not configured',
missingAgentDir: 'Folder not created yet',
missingProviderAccount: 'No provider',
},
settings: {
title: 'Agent settings',
description: 'Review identity, model routing, and channel ownership for {name}.',
identityTitle: 'Identity',
modelTitle: 'Model',
bindingTitle: 'Channel ownership',
bindingHelp: 'Read-only summary of which channels and accounts currently resolve to this Agent.',
bindingEmpty: 'No channels or account ownership are associated with this Agent yet.',
nameLabel: 'Agent name',
agentIdLabel: 'Agent ID',
providerAccountLabel: 'Provider account',
useDefaultProvider: 'Use workspace default provider',
modelRefLabel: 'Model override',
modelRefPlaceholder: 'provider/model-id',
effectiveProviderLabel: 'Effective provider',
effectiveModelLabel: 'Effective model',
modelHelp: 'Leave this empty to follow the selected provider model, or the workspace default when no provider is pinned.',
inheritModel: 'Use inherited model',
saveIdentity: 'Save name',
saveModel: 'Save model',
save: 'Save',
saving: 'Saving...',
managedFromModels: 'The Main Agent follows the provider and default model configured in Models.',
openModels: 'Open Models',
workspaceTitle: 'Workspace',
workspaceDescription: 'Review the current workspace path and whether this Agent inherits the Main Agent workspace.',
inheritedWorkspaceLabel: 'Inherit Main Agent workspace',
inheritedWorkspaceYes: 'Yes',
inheritedWorkspaceNo: 'No',
channelSummaryLabel: 'Channel routing summary',
accountBindingsLabel: 'Account binding count',
providerLoadErrorPrefix: 'Provider accounts could not be loaded: ',
refreshCatalog: 'Refresh data',
manageBindings: 'Open Channels',
boundToLabel: 'Owner: {owner}',
channelFallbackLabel: 'Channel fallback',
channelFallbackHelp: 'Used when an account under this channel has no explicit owner.',
channelBindingLabel: 'From channel',
accountBindingLabel: 'Account override',
unassigned: 'Unassigned',
noChannelAccounts: 'No accounts discovered for this channel yet.',
bindingReadonly: 'Ownership is read-only here. Change channel/account bindings in Channels.',
providerLoadError: 'Provider accounts could not be loaded: {error}',
channelLoadError: 'Channel accounts could not be loaded: {error}',
},
},
settings: {
menu: {
systemSettings: 'System Settings',
@@ -143,12 +246,115 @@ export const messages: I18nMessages = {
sidebar: {
home: '首页',
knowledge: '知识库',
channels: '渠道',
agents: 'Agents',
models: '模型',
skills: '技能',
cron: '定时任务',
scripts: '脚本',
settings: '设置',
},
agents: {
title: 'Agents',
subtitle: '创建新的 Agent可以将特定频道路由到不同的人格配置或工作区。',
refresh: '刷新',
addAgent: '添加 Agent',
addHint: '为新的工作区、角色或频道归属创建独立 Agent。',
warning: 'Providers、Channels 或 runtime 刷新后,界面可能会有短暂延迟;如果看到旧数据,请手动刷新。',
emptyTitle: '还没有 Agent',
emptyDescription: '添加第一个 Agent把频道、账号或工作区上下文从 Main Agent 中拆分出来。',
errorPrefix: '加载 Agents 失败:{error}',
defaultBadge: '默认',
inherited: '继承',
mainManagedHint: 'Main Agent',
none: '无',
actions: {
rename: '重命名',
model: '设置模型',
settings: '设置',
delete: '删除',
},
prompts: {
createName: '请输入 Agent 名称',
inheritWorkspace: '是否让这个 Agent 继承 Main Agent 的工作区引导文件?',
renameName: '重命名 Agent',
modelRef: '为这个 Agent 设置 provider/model 标识。留空时会继承所选 Provider 或工作区默认模型。',
deleteConfirm: '确定删除 Agent “{name}”吗?现有聊天会保留在磁盘上,但这个 Agent 会从 Agents 页面中移除。',
},
createDialog: {
title: '添加 Agent',
description: '输入名称即可创建新 Agent可选择是否继承主 Agent 的工作区引导文件。',
nameLabel: 'Agent 名称',
namePlaceholder: 'Coding Helper',
inheritWorkspaceLabel: '继承 Main Agent 工作区',
inheritWorkspaceDescription: '从 Main Agent 复制 SOUL.md、AGENTS.md 等引导文件。',
saveLabel: '保存',
savingLabel: '保存中...',
},
fields: {
model: '模型',
workspace: '工作区',
agentDir: 'Agent 目录',
mainSessionKey: '主会话 Key',
channels: '频道',
providerAccount: 'Provider',
},
card: {
modelLabel: 'Model',
channelCount: '{count} 个频道',
accountBindingCount: '{count} 个账号绑定',
noChannels: '无频道',
missingWorkspace: '工作区未配置',
missingModel: '模型未配置',
missingAgentDir: '目录尚未创建',
missingProviderAccount: '未选择 Provider',
},
settings: {
title: 'Agent 设置',
description: '查看并调整 {name} 的基础信息、模型路由和频道归属摘要。',
identityTitle: '基础信息',
modelTitle: '模型',
bindingTitle: '频道归属',
bindingHelp: '这里只展示这个 Agent 当前命中的频道和账号归属摘要。',
bindingEmpty: '这个 Agent 还没有任何频道或账号归属。',
nameLabel: 'Agent 名称',
agentIdLabel: 'Agent ID',
providerAccountLabel: 'Provider 账号',
useDefaultProvider: '使用工作区默认 Provider',
modelRefLabel: '模型覆盖',
modelRefPlaceholder: 'provider/model-id',
effectiveProviderLabel: '生效中的 Provider',
effectiveModelLabel: '生效中的模型',
modelHelp: '留空后会跟随所选 Provider 的模型;如果没有固定 Provider则继续继承工作区默认模型。',
inheritModel: '改为继承模型',
saveIdentity: '保存名称',
saveModel: '保存模型',
save: '保存',
saving: '保存中...',
managedFromModels: 'Main Agent 使用 Models 页面里配置的 Provider 和默认模型。',
openModels: '前往 Models',
workspaceTitle: '工作区',
workspaceDescription: '查看当前 Agent 的工作区路径,以及是否继承主 Agent 工作区。',
inheritedWorkspaceLabel: '继承主 Agent 工作区',
inheritedWorkspaceYes: '是',
inheritedWorkspaceNo: '否',
channelSummaryLabel: '频道路由摘要',
accountBindingsLabel: '账号绑定数',
providerLoadErrorPrefix: '加载 Provider 账号失败:',
refreshCatalog: '刷新数据',
manageBindings: '前往 Channels',
boundToLabel: '归属:{owner}',
channelFallbackLabel: '频道级兜底归属',
channelFallbackHelp: '当该频道下的账号没有单独归属时,会使用这里的结果。',
channelBindingLabel: '继承频道',
accountBindingLabel: '账号覆盖',
unassigned: '未分配',
noChannelAccounts: '这个频道暂时还没有发现可展示的账号。',
bindingReadonly: '这里只读展示归属;修改 channel/account 绑定请前往 Channels。',
providerLoadError: '加载 Provider 账号失败:{error}',
channelLoadError: '加载频道账号失败:{error}',
},
},
settings: {
menu: {
systemSettings: '系统设置',
@@ -243,12 +449,115 @@ export const messages: I18nMessages = {
sidebar: {
home: 'ホーム',
knowledge: 'ナレッジ',
channels: 'チャンネル',
agents: 'Agents',
models: 'モデル',
skills: 'スキル',
cron: '定時タスク',
scripts: 'スクリプト',
settings: '設定',
},
agents: {
title: 'Agents',
subtitle: '新しい Agent を作成し、特定のチャンネルを別の人格設定やワークスペースへ振り分けます。',
refresh: '更新',
addAgent: 'Agent を追加',
addHint: '新しいワークスペース、役割、またはチャンネル担当のために別 Agent を作成します。',
warning: 'Providers、Channels、runtime の更新反映には少し時間がかかることがあります。表示が古い場合は更新してください。',
emptyTitle: 'まだ Agent はありません',
emptyDescription: '最初の Agent を追加して、チャンネル、アカウント、またはワークスペースの文脈を Main Agent から分けましょう。',
errorPrefix: 'Agents の読み込みに失敗しました: {error}',
defaultBadge: '既定',
inherited: '継承',
mainManagedHint: 'Main Agent',
none: 'なし',
actions: {
rename: '名前変更',
model: 'モデル設定',
settings: '設定',
delete: '削除',
},
prompts: {
createName: 'Agent 名を入力してください',
inheritWorkspace: 'この Agent に Main Agent のワークスペース初期ファイルを引き継ぎますか?',
renameName: 'Agent 名を変更',
modelRef: 'この Agent の provider/model を設定します。空欄のままなら選択した Provider またはワークスペース既定モデルを継承します。',
deleteConfirm: 'Agent「{name}」を削除しますか?既存のチャットはディスクに残りますが、この Agent は Agents ページから消えます。',
},
createDialog: {
title: 'Agent を追加',
description: '名前を指定して新しい Agent を作成します。必要なら Main Agent のワークスペース初期ファイルも引き継げます。',
nameLabel: 'Agent 名',
namePlaceholder: 'Coding Helper',
inheritWorkspaceLabel: 'Main Agent のワークスペースを引き継ぐ',
inheritWorkspaceDescription: 'Main Agent から SOUL.md、AGENTS.md などの初期ファイルをコピーします。',
saveLabel: '保存',
savingLabel: '保存中...',
},
fields: {
model: 'モデル',
workspace: 'ワークスペース',
agentDir: 'Agent フォルダ',
mainSessionKey: 'メインセッション Key',
channels: 'チャンネル',
providerAccount: 'Provider',
},
card: {
modelLabel: 'Model',
channelCount: '{count} チャンネル',
accountBindingCount: '{count} 件のアカウント紐付け',
noChannels: 'チャンネルなし',
missingWorkspace: 'ワークスペース未設定',
missingModel: 'モデル未設定',
missingAgentDir: 'フォルダ未作成',
missingProviderAccount: 'Provider 未選択',
},
settings: {
title: 'Agent 設定',
description: '{name} の基本情報、モデルルーティング、チャンネル担当の要約を確認します。',
identityTitle: '基本情報',
modelTitle: 'モデル',
bindingTitle: 'チャンネル担当',
bindingHelp: 'この Agent に現在解決されるチャンネル / アカウント担当を読み取り専用で表示します。',
bindingEmpty: 'この Agent にはまだチャンネルまたはアカウントの担当がありません。',
nameLabel: 'Agent 名',
agentIdLabel: 'Agent ID',
providerAccountLabel: 'Provider アカウント',
useDefaultProvider: 'ワークスペース既定の Provider を使う',
modelRefLabel: 'モデル上書き',
modelRefPlaceholder: 'provider/model-id',
effectiveProviderLabel: '現在の Provider',
effectiveModelLabel: '現在のモデル',
modelHelp: '空欄のままなら選択した Provider のモデルを使い、Provider が固定されていなければワークスペース既定モデルを継承します。',
inheritModel: '継承モデルに戻す',
saveIdentity: '名前を保存',
saveModel: 'モデルを保存',
save: '保存',
saving: '保存中...',
managedFromModels: 'Main Agent は Models ページで設定した Provider と既定モデルに従います。',
openModels: 'Models を開く',
workspaceTitle: 'ワークスペース',
workspaceDescription: '現在のワークスペースパスと、Main Agent のワークスペースを継承しているかを確認します。',
inheritedWorkspaceLabel: 'Main Agent のワークスペースを継承',
inheritedWorkspaceYes: 'はい',
inheritedWorkspaceNo: 'いいえ',
channelSummaryLabel: 'チャンネルルーティング要約',
accountBindingsLabel: 'アカウント紐付け数',
providerLoadErrorPrefix: 'Provider アカウントの読み込みに失敗しました: ',
refreshCatalog: 'データを更新',
manageBindings: 'Channels を開く',
boundToLabel: '担当: {owner}',
channelFallbackLabel: 'チャンネル既定担当',
channelFallbackHelp: 'このチャンネル配下のアカウントに個別担当がない場合に使われます。',
channelBindingLabel: 'チャンネル継承',
accountBindingLabel: 'アカウント個別設定',
unassigned: '未割り当て',
noChannelAccounts: 'このチャンネルではまだ表示できるアカウントが見つかっていません。',
bindingReadonly: 'ここでは担当を読み取り専用で表示します。channel/account の変更は Channels ページで行ってください。',
providerLoadError: 'Provider アカウントの読み込みに失敗しました: {error}',
channelLoadError: 'チャンネルアカウントの読み込みに失敗しました: {error}',
},
},
settings: {
menu: {
systemSettings: 'システム設定',