mirror of
https://github.com/hansjone/dsh-im-ops.git
synced 2026-10-11 02:53:20 +08:00
feat: add message source context enhancement
This commit is contained in:
parent
5928b33057
commit
0cb79f74e9
69 changed files with 6217 additions and 597 deletions
|
|
@ -4,6 +4,7 @@ import { CredentialActionIcon, CredentialBindingPanel } from '../../credential-b
|
|||
import { h } from '../../i18n.js';
|
||||
import { installDingtalkStyles } from '../dingtalk/styles.js';
|
||||
import { WorkspaceEditor } from '../../workspace-editor.js';
|
||||
import { ContextEnhancementEditor } from '../../context-enhancement.js';
|
||||
import {
|
||||
AgentPresetCatalogContext,
|
||||
AgentPresetEditor,
|
||||
|
|
@ -73,7 +74,7 @@ export function createTokenChannelSettings(definition) {
|
|||
accountSettingsEndpoint = null,
|
||||
} = definition;
|
||||
|
||||
function AccountCard({ account, busy, testNotice, removing, onReconnect, onWorkspaceSave, onAgentPresetSave, onAccountSettingsSave, onRequestRemove, onConfirmRemove, onCancelRemove }) {
|
||||
function AccountCard({ account, busy, testNotice, removing, onReconnect, onWorkspaceSave, onAgentPresetSave, onContextEnhancementSave, onAccountSettingsSave, onRequestRemove, onConfirmRemove, onCancelRemove }) {
|
||||
const state = busy === 'reconnect' ? 'connecting' : account.state;
|
||||
const tone = account.connected ? 'success' : state === 'error' ? 'error' : 'warning';
|
||||
const stateLabel = account.connected ? '运行正常' : state === 'connecting' ? '正在连接' : '连接未就绪';
|
||||
|
|
@ -105,6 +106,11 @@ export function createTokenChannelSettings(definition) {
|
|||
disabled: Boolean(busy),
|
||||
onSave: onAgentPresetSave,
|
||||
}),
|
||||
h(ContextEnhancementEditor, {
|
||||
config: account.contextEnhancement,
|
||||
disabled: Boolean(busy),
|
||||
onSave: onContextEnhancementSave,
|
||||
}),
|
||||
AccountSettings ? h(AccountSettings, {
|
||||
account,
|
||||
busy: Boolean(busy),
|
||||
|
|
@ -309,6 +315,12 @@ export function createTokenChannelSettings(definition) {
|
|||
endpoints.setAgentPreset,
|
||||
{ botId: account.botId, agentPreset },
|
||||
),
|
||||
onContextEnhancementSave: (config) => botAction(
|
||||
account,
|
||||
'context-enhancement',
|
||||
endpoints.setContextEnhancement,
|
||||
{ botId: account.botId, config },
|
||||
),
|
||||
onAccountSettingsSave: AccountSettings && accountSettingsEndpoint
|
||||
? (payload) => botAction(
|
||||
account,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue