@vibe-forge/client 0.7.4 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.cjs +16 -17
- package/dist/assets/{arc-DXs6SvQX.js → arc-BjI8Mzf5.js} +1 -1
- package/dist/assets/{blockDiagram-c4efeb88-h-xVkbzT.js → blockDiagram-c4efeb88-By4JL1RU.js} +1 -1
- package/dist/assets/{c4Diagram-c83219d4-DEumwLCr.js → c4Diagram-c83219d4-frpxdNO6.js} +1 -1
- package/dist/assets/channel-Da5T54-_.js +1 -0
- package/dist/assets/{classDiagram-beda092f-Dh_6VL8e.js → classDiagram-beda092f-sGBIwOiO.js} +1 -1
- package/dist/assets/{classDiagram-v2-2358418a-D9hG_V5y.js → classDiagram-v2-2358418a-JfASkQqT.js} +1 -1
- package/dist/assets/clone-BfjbcwWs.js +1 -0
- package/dist/assets/{createText-1719965b-DGO5tdKk.js → createText-1719965b-C6SwHZ-r.js} +1 -1
- package/dist/assets/{edges-96097737-63FzeZDk.js → edges-96097737-z-Dp4FKF.js} +1 -1
- package/dist/assets/{erDiagram-0228fc6a-jN2RzBTN.js → erDiagram-0228fc6a-5fIyCTtw.js} +1 -1
- package/dist/assets/{flowDb-c6c81e3f-CvND0Kz-.js → flowDb-c6c81e3f-DuDOLffh.js} +1 -1
- package/dist/assets/{flowDiagram-50d868cf-jtMtLi5z.js → flowDiagram-50d868cf-CqfJoZYm.js} +1 -1
- package/dist/assets/flowDiagram-v2-4f6560a1-B25RT9lb.js +1 -0
- package/dist/assets/{flowchart-elk-definition-6af322e1-Dic1wweO.js → flowchart-elk-definition-6af322e1-wpZusdN_.js} +1 -1
- package/dist/assets/{ganttDiagram-a2739b55-BLbYj7ru.js → ganttDiagram-a2739b55-aw70jAEI.js} +1 -1
- package/dist/assets/{gitGraphDiagram-82fe8481-Dm4ee53U.js → gitGraphDiagram-82fe8481-DhJVtfJF.js} +1 -1
- package/dist/assets/{graph-BnzAin3i.js → graph-Dp5XlF1F.js} +1 -1
- package/dist/assets/{index-5325376f-gU7GGRnq.js → index-5325376f-C7cRw1io.js} +1 -1
- package/dist/assets/{index-BRIfON-w.css → index-DHL1Qu5o.css} +1 -1
- package/dist/assets/index-DqioMim6.js +557 -0
- package/dist/assets/{infoDiagram-8eee0895-BI_1UH70.js → infoDiagram-8eee0895-B9VmKQm_.js} +1 -1
- package/dist/assets/{journeyDiagram-c64418c1-Xc6td0Nk.js → journeyDiagram-c64418c1-BTKwOAU-.js} +1 -1
- package/dist/assets/{layout-PHWoi3a3.js → layout-XtAsDaFY.js} +1 -1
- package/dist/assets/{line-BJPgSD92.js → line-1nd8Xc89.js} +1 -1
- package/dist/assets/{linear-DYKGy-mG.js → linear-BBztVBp6.js} +1 -1
- package/dist/assets/{mermaid.core-H3QJi-7A.js → mermaid.core-DaqQ11eY.js} +4 -4
- package/dist/assets/{mindmap-definition-8da855dc-UC--JAZa.js → mindmap-definition-8da855dc-DYdtyQbX.js} +1 -1
- package/dist/assets/{pieDiagram-a8764435-BTI_-cYX.js → pieDiagram-a8764435-CO9FnqSm.js} +1 -1
- package/dist/assets/{quadrantDiagram-1e28029f-C4Gf_SaX.js → quadrantDiagram-1e28029f-Cs-iTCZ-.js} +1 -1
- package/dist/assets/{requirementDiagram-08caed73-BKwfGAsO.js → requirementDiagram-08caed73-Diwrdq_y.js} +1 -1
- package/dist/assets/{sankeyDiagram-a04cb91d-DTp2p2pD.js → sankeyDiagram-a04cb91d-DjxNZwMs.js} +1 -1
- package/dist/assets/{sequenceDiagram-c5b8d532-CLuNEegU.js → sequenceDiagram-c5b8d532-CWawhoyM.js} +1 -1
- package/dist/assets/{stateDiagram-1ecb1508-BUofUUM6.js → stateDiagram-1ecb1508-Bow7IRrW.js} +1 -1
- package/dist/assets/{stateDiagram-v2-c2b004d7-BATuZH_y.js → stateDiagram-v2-c2b004d7-BJqu9_Fj.js} +1 -1
- package/dist/assets/{styles-b4e223ce-CVO41uVV.js → styles-b4e223ce-F2FDTYdm.js} +1 -1
- package/dist/assets/{styles-ca3715f6-fFE_-gsH.js → styles-ca3715f6-DJITgKSs.js} +1 -1
- package/dist/assets/{styles-d45a18b0-BeG4Dd2L.js → styles-d45a18b0-DMSpafXP.js} +1 -1
- package/dist/assets/{svgDrawCommon-b86b1483-D6PZVIuy.js → svgDrawCommon-b86b1483-3_yd3bB_.js} +1 -1
- package/dist/assets/{timeline-definition-faaaa080-CTFMc2GO.js → timeline-definition-faaaa080-CV5umgp5.js} +1 -1
- package/dist/assets/{xychartDiagram-f5964ef8-wWcw3yKn.js → xychartDiagram-f5964ef8-DhVTgtev.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +10 -8
- package/src/App.tsx +1 -1
- package/src/api/base.ts +7 -7
- package/src/api/benchmark.ts +7 -3
- package/src/api/config.ts +2 -1
- package/src/api.ts +1 -1
- package/src/components/ArchiveView.tsx +1 -1
- package/src/components/ConfigView.tsx +18 -6
- package/src/components/MarkdownContent.tsx +1 -1
- package/src/components/Sidebar.tsx +2 -2
- package/src/components/automation-view/RuleFormPanel.tsx +7 -5
- package/src/components/automation-view/TaskList.tsx +8 -5
- package/src/components/automation-view/TriggerList.tsx +25 -15
- package/src/components/automation-view/types.ts +1 -1
- package/src/components/benchmark-view/BenchmarkCasePanel.tsx +94 -94
- package/src/components/benchmark-view/BenchmarkSidebar.scss +8 -6
- package/src/components/benchmark-view/BenchmarkSidebar.tsx +43 -30
- package/src/components/benchmark-view/index.tsx +4 -2
- package/src/components/benchmark-view/types.ts +3 -2
- package/src/components/benchmark-view/utils.ts +1 -2
- package/src/components/chat/ChatHeader.tsx +1 -1
- package/src/components/chat/ChatHistoryView.tsx +3 -2
- package/src/components/chat/CurrentTodoList.tsx +2 -3
- package/src/components/chat/messages/MessageItem.tsx +15 -14
- package/src/components/chat/messages/message-utils.ts +1 -1
- package/src/components/chat/sender/Sender.scss +8 -3
- package/src/components/chat/sender/Sender.tsx +71 -22
- package/src/components/chat/session-timeline-panel/git-graph.ts +8 -1
- package/src/components/chat/session-timeline-panel/index.scss +2 -2
- package/src/components/chat/tools/DefaultTool.tsx +3 -3
- package/src/components/chat/tools/adapter-claude/BashTool.tsx +2 -2
- package/src/components/chat/tools/adapter-claude/GlobTool.tsx +2 -2
- package/src/components/chat/tools/adapter-claude/GrepTool.tsx +2 -2
- package/src/components/chat/tools/adapter-claude/LSTool.tsx +4 -4
- package/src/components/chat/tools/adapter-claude/ReadTool.scss +1 -2
- package/src/components/chat/tools/adapter-claude/ReadTool.tsx +3 -3
- package/src/components/chat/tools/adapter-claude/TodoTool.tsx +1 -1
- package/src/components/chat/tools/adapter-claude/WriteTool.tsx +2 -2
- package/src/components/chat/tools/adapter-claude/components/FileList.scss +4 -2
- package/src/components/chat/tools/core/ToolCallBox.scss +34 -35
- package/src/components/chat/tools/core/ToolGroup.tsx +5 -5
- package/src/components/chat/tools/plugin-chrome-devtools/ChromeDevtoolsTool.tsx +1 -1
- package/src/components/chat/tools/task/GetTaskInfoTool.tsx +1 -1
- package/src/components/chat/tools/task/StartTasksTool.tsx +2 -2
- package/src/components/chat/tools/task/components/TaskRow.tsx +4 -4
- package/src/components/chat/tools/task/components/TaskToolCard.tsx +4 -4
- package/src/components/config/ConfigAboutSection.tsx +1 -1
- package/src/components/config/ConfigSectionForm.tsx +2 -1
- package/src/components/config/ConfigSectionPanel.tsx +1 -1
- package/src/components/config/ConfigShortcutInput.scss +1 -1
- package/src/components/config/ConfigSourceSwitch.tsx +1 -1
- package/src/components/config/configSchema.ts +16 -1
- package/src/components/config/index.tsx +1 -1
- package/src/components/config/record-editors/McpServersRecordEditor.tsx +125 -123
- package/src/components/config/record-editors/ModelServicesRecordEditor.tsx +138 -136
- package/src/components/config/record-editors/RecordJsonEditor.tsx +31 -29
- package/src/components/config/record-editors/index.tsx +1 -1
- package/src/components/knowledge-base/components/EmptyState.tsx +1 -1
- package/src/components/knowledge-base/components/EntitiesTab.tsx +2 -2
- package/src/components/knowledge-base/components/EntityItem.tsx +1 -1
- package/src/components/knowledge-base/components/EntityList.tsx +1 -1
- package/src/components/knowledge-base/components/FilterBar.tsx +2 -2
- package/src/components/knowledge-base/components/FlowsTab.tsx +1 -1
- package/src/components/knowledge-base/components/KnowledgeList.tsx +1 -1
- package/src/components/knowledge-base/components/MetaList.tsx +1 -1
- package/src/components/knowledge-base/components/RuleItem.tsx +1 -1
- package/src/components/knowledge-base/components/RuleList.tsx +1 -1
- package/src/components/knowledge-base/components/RulesTab.tsx +3 -3
- package/src/components/knowledge-base/components/SectionHeader.tsx +1 -1
- package/src/components/knowledge-base/components/SkillsTab.tsx +3 -3
- package/src/components/knowledge-base/components/SpecItem.tsx +1 -1
- package/src/components/knowledge-base/components/SpecList.tsx +1 -1
- package/src/components/knowledge-base/components/TabContent.tsx +1 -1
- package/src/components/knowledge-base/components/TabLabel.tsx +1 -1
- package/src/components/sidebar/SessionItem.scss +0 -1
- package/src/components/sidebar/SessionItem.tsx +1 -1
- package/src/hooks/chat/model-selector.ts +115 -121
- package/src/hooks/chat/use-chat-adapter.ts +3 -3
- package/src/hooks/chat/use-chat-interaction.ts +1 -1
- package/src/hooks/chat/use-chat-model-adapter-selection.tsx +549 -0
- package/src/hooks/chat/use-chat-models.tsx +7 -2
- package/src/hooks/chat/use-chat-permission-mode.ts +5 -1
- package/src/hooks/chat/use-chat-session-messages.ts +2 -2
- package/src/hooks/chat/use-chat-session.ts +14 -12
- package/src/hooks/chat/use-chat-view.ts +1 -1
- package/src/hooks/use-app-preferences.ts +14 -4
- package/src/hooks/use-session-subscription.ts +17 -6
- package/src/hooks/useQueryParams.ts +8 -6
- package/src/resources/adapters.ts +8 -2
- package/src/resources/locales/en.json +14 -1
- package/src/resources/locales/zh.json +14 -1
- package/src/routes/ChatRoute.scss +5 -1
- package/src/runtime-config.ts +17 -13
- package/src/utils/shortcutUtils.ts +1 -1
- package/vite.config.ts +5 -0
- package/dist/assets/channel-Hxo8SEEx.js +0 -1
- package/dist/assets/clone-Dd_kUYh5.js +0 -1
- package/dist/assets/flowDiagram-v2-4f6560a1-CmztIxNZ.js +0 -1
- package/dist/assets/index-Cw-fkktx.js +0 -557
|
@@ -3,11 +3,11 @@ import './McpServersRecordEditor.scss'
|
|
|
3
3
|
import { Button, Input, Select, Switch, Tooltip } from 'antd'
|
|
4
4
|
import { useEffect, useMemo, useState } from 'react'
|
|
5
5
|
|
|
6
|
+
import { StringArrayEditor } from '../ConfigEditors'
|
|
6
7
|
import { FieldRow } from '../ConfigFieldRow'
|
|
7
8
|
import { getTypeIcon } from '../configUtils'
|
|
8
9
|
import type { TranslationFn } from '../configUtils'
|
|
9
10
|
import { KeyValueEditor } from './KeyValueEditor'
|
|
10
|
-
import { StringArrayEditor } from '../ConfigEditors'
|
|
11
11
|
|
|
12
12
|
export const McpServersRecordEditor = ({
|
|
13
13
|
value,
|
|
@@ -71,7 +71,9 @@ export const McpServersRecordEditor = ({
|
|
|
71
71
|
type='text'
|
|
72
72
|
className='config-view__icon-button config-view__icon-button--compact'
|
|
73
73
|
aria-label={isCollapsed ? t('config.editor.expand') : t('config.editor.collapse')}
|
|
74
|
-
icon={
|
|
74
|
+
icon={
|
|
75
|
+
<span className='material-symbols-rounded'>{isCollapsed ? 'chevron_right' : 'expand_more'}</span>
|
|
76
|
+
}
|
|
75
77
|
onClick={() => {
|
|
76
78
|
setCollapsedKeys(prev => ({ ...prev, [key]: !isCollapsed }))
|
|
77
79
|
}}
|
|
@@ -97,127 +99,127 @@ export const McpServersRecordEditor = ({
|
|
|
97
99
|
</div>
|
|
98
100
|
<div className='config-view__record-body'>
|
|
99
101
|
<div className='config-view__record-fields'>
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
102
|
+
<FieldRow
|
|
103
|
+
title={t('config.fields.mcpServer.enabled.label')}
|
|
104
|
+
description={t('config.fields.mcpServer.enabled.desc')}
|
|
105
|
+
icon={getTypeIcon('boolean')}
|
|
106
|
+
>
|
|
107
|
+
<Switch
|
|
108
|
+
checked={Boolean(recordValue.enabled)}
|
|
109
|
+
onChange={(next) => {
|
|
110
|
+
updateRecord({ ...recordValue, enabled: next })
|
|
111
|
+
}}
|
|
112
|
+
/>
|
|
113
|
+
</FieldRow>
|
|
114
|
+
<FieldRow
|
|
115
|
+
title={t('config.fields.mcpServer.type.label')}
|
|
116
|
+
description={t('config.fields.mcpServer.type.desc')}
|
|
117
|
+
icon={getTypeIcon('string')}
|
|
118
|
+
>
|
|
119
|
+
<Select
|
|
120
|
+
value={typeValue}
|
|
121
|
+
options={[
|
|
122
|
+
{ value: 'command', label: t('config.options.mcp.command') },
|
|
123
|
+
{ value: 'sse', label: t('config.options.mcp.sse') },
|
|
124
|
+
{ value: 'http', label: t('config.options.mcp.http') }
|
|
125
|
+
]}
|
|
126
|
+
onChange={(next) => {
|
|
127
|
+
const nextRecord = { ...recordValue }
|
|
128
|
+
if (next === 'command') {
|
|
129
|
+
delete nextRecord.type
|
|
130
|
+
if (nextRecord.command == null) nextRecord.command = ''
|
|
131
|
+
if (nextRecord.args == null) nextRecord.args = []
|
|
132
|
+
delete nextRecord.url
|
|
133
|
+
delete nextRecord.headers
|
|
134
|
+
} else {
|
|
135
|
+
nextRecord.type = next
|
|
136
|
+
if (nextRecord.url == null) nextRecord.url = ''
|
|
137
|
+
if (nextRecord.headers == null) nextRecord.headers = {}
|
|
138
|
+
delete nextRecord.command
|
|
139
|
+
delete nextRecord.args
|
|
140
|
+
}
|
|
141
|
+
updateRecord(nextRecord)
|
|
142
|
+
}}
|
|
143
|
+
/>
|
|
144
|
+
</FieldRow>
|
|
145
|
+
{typeValue === 'command' && (
|
|
146
|
+
<>
|
|
147
|
+
<FieldRow
|
|
148
|
+
title={t('config.fields.mcpServer.command.label')}
|
|
149
|
+
description={t('config.fields.mcpServer.command.desc')}
|
|
150
|
+
icon={getTypeIcon('string')}
|
|
151
|
+
>
|
|
152
|
+
<Input
|
|
153
|
+
value={typeof recordValue.command === 'string' ? recordValue.command : ''}
|
|
154
|
+
onChange={(event) => {
|
|
155
|
+
updateRecord({ ...recordValue, command: event.target.value })
|
|
156
|
+
}}
|
|
157
|
+
placeholder={t('config.editor.commandPlaceholder')}
|
|
158
|
+
/>
|
|
159
|
+
</FieldRow>
|
|
160
|
+
<FieldRow
|
|
161
|
+
title={t('config.fields.mcpServer.args.label')}
|
|
162
|
+
description={t('config.fields.mcpServer.args.desc')}
|
|
163
|
+
icon={getTypeIcon('array')}
|
|
164
|
+
layout='stacked'
|
|
165
|
+
>
|
|
166
|
+
<StringArrayEditor
|
|
167
|
+
value={argsValue}
|
|
168
|
+
onChange={(next) => {
|
|
169
|
+
updateRecord({ ...recordValue, args: next })
|
|
170
|
+
}}
|
|
171
|
+
t={t}
|
|
172
|
+
/>
|
|
173
|
+
</FieldRow>
|
|
174
|
+
</>
|
|
175
|
+
)}
|
|
176
|
+
{typeValue !== 'command' && (
|
|
177
|
+
<>
|
|
178
|
+
<FieldRow
|
|
179
|
+
title={t('config.fields.mcpServer.url.label')}
|
|
180
|
+
description={t('config.fields.mcpServer.url.desc')}
|
|
181
|
+
icon={getTypeIcon('string')}
|
|
182
|
+
>
|
|
183
|
+
<Input
|
|
184
|
+
value={typeof recordValue.url === 'string' ? recordValue.url : ''}
|
|
185
|
+
onChange={(event) => {
|
|
186
|
+
updateRecord({ ...recordValue, url: event.target.value })
|
|
187
|
+
}}
|
|
188
|
+
placeholder={t('config.editor.urlPlaceholder')}
|
|
189
|
+
/>
|
|
190
|
+
</FieldRow>
|
|
191
|
+
<FieldRow
|
|
192
|
+
title={t('config.fields.mcpServer.headers.label')}
|
|
193
|
+
description={t('config.fields.mcpServer.headers.desc')}
|
|
194
|
+
icon={getTypeIcon('object')}
|
|
195
|
+
layout='stacked'
|
|
196
|
+
>
|
|
197
|
+
<KeyValueEditor
|
|
198
|
+
value={headersValue}
|
|
199
|
+
onChange={(next) => {
|
|
200
|
+
updateRecord({ ...recordValue, headers: next })
|
|
201
|
+
}}
|
|
202
|
+
t={t}
|
|
203
|
+
keyPlaceholder={t('config.editor.newHeaderName')}
|
|
204
|
+
/>
|
|
205
|
+
</FieldRow>
|
|
206
|
+
</>
|
|
207
|
+
)}
|
|
208
|
+
<FieldRow
|
|
209
|
+
title={t('config.fields.mcpServer.env.label')}
|
|
210
|
+
description={t('config.fields.mcpServer.env.desc')}
|
|
211
|
+
icon={getTypeIcon('object')}
|
|
212
|
+
layout='stacked'
|
|
213
|
+
>
|
|
214
|
+
<KeyValueEditor
|
|
215
|
+
value={envValue}
|
|
216
|
+
onChange={(next) => {
|
|
217
|
+
updateRecord({ ...recordValue, env: next })
|
|
218
|
+
}}
|
|
219
|
+
t={t}
|
|
220
|
+
keyPlaceholder={t('config.editor.newEnvVarName')}
|
|
221
|
+
/>
|
|
222
|
+
</FieldRow>
|
|
221
223
|
</div>
|
|
222
224
|
</div>
|
|
223
225
|
</div>
|
|
@@ -62,7 +62,9 @@ export const ModelServicesRecordEditor = ({
|
|
|
62
62
|
type='text'
|
|
63
63
|
className='config-view__icon-button config-view__icon-button--compact'
|
|
64
64
|
aria-label={isCollapsed ? t('config.editor.expand') : t('config.editor.collapse')}
|
|
65
|
-
icon={
|
|
65
|
+
icon={
|
|
66
|
+
<span className='material-symbols-rounded'>{isCollapsed ? 'chevron_right' : 'expand_more'}</span>
|
|
67
|
+
}
|
|
66
68
|
onClick={() => {
|
|
67
69
|
setCollapsedKeys(prev => ({ ...prev, [key]: !isCollapsed }))
|
|
68
70
|
}}
|
|
@@ -96,141 +98,141 @@ export const ModelServicesRecordEditor = ({
|
|
|
96
98
|
</div>
|
|
97
99
|
<div className='config-view__record-body'>
|
|
98
100
|
<div className='config-view__record-fields'>
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
101
|
+
<FieldRow
|
|
102
|
+
title={t('config.fields.modelServices.item.title.label')}
|
|
103
|
+
description={t('config.fields.modelServices.item.title.desc')}
|
|
104
|
+
icon={getTypeIcon('string')}
|
|
105
|
+
>
|
|
106
|
+
<Input
|
|
107
|
+
value={titleValue}
|
|
108
|
+
onChange={(event) => {
|
|
109
|
+
onChange({ ...value, [key]: { ...recordValue, title: event.target.value } })
|
|
110
|
+
}}
|
|
111
|
+
placeholder={t('config.editor.titlePlaceholder')}
|
|
112
|
+
/>
|
|
113
|
+
</FieldRow>
|
|
114
|
+
<FieldRow
|
|
115
|
+
title={t('config.fields.modelServices.item.description.label')}
|
|
116
|
+
description={t('config.fields.modelServices.item.description.desc')}
|
|
117
|
+
icon={getTypeIcon('string')}
|
|
118
|
+
layout='stacked'
|
|
119
|
+
>
|
|
120
|
+
<Input.TextArea
|
|
121
|
+
value={descriptionValue}
|
|
122
|
+
onChange={(event) => {
|
|
123
|
+
onChange({ ...value, [key]: { ...recordValue, description: event.target.value } })
|
|
124
|
+
}}
|
|
125
|
+
autoSize={{ minRows: 2 }}
|
|
126
|
+
placeholder={t('config.editor.descriptionPlaceholder')}
|
|
127
|
+
/>
|
|
128
|
+
</FieldRow>
|
|
129
|
+
<FieldRow
|
|
130
|
+
title={t('config.fields.modelServices.item.apiBaseUrl.label')}
|
|
131
|
+
description={t('config.fields.modelServices.item.apiBaseUrl.desc')}
|
|
132
|
+
icon={getTypeIcon('string')}
|
|
133
|
+
>
|
|
134
|
+
<Input
|
|
135
|
+
value={typeof recordValue.apiBaseUrl === 'string' ? recordValue.apiBaseUrl : ''}
|
|
136
|
+
onChange={(event) => {
|
|
137
|
+
onChange({ ...value, [key]: { ...recordValue, apiBaseUrl: event.target.value } })
|
|
138
|
+
}}
|
|
139
|
+
/>
|
|
140
|
+
</FieldRow>
|
|
141
|
+
<FieldRow
|
|
142
|
+
title={t('config.fields.modelServices.item.apiKey.label')}
|
|
143
|
+
description={t('config.fields.modelServices.item.apiKey.desc')}
|
|
144
|
+
icon={getTypeIcon('string')}
|
|
145
|
+
>
|
|
146
|
+
<Input.Password
|
|
147
|
+
value={typeof recordValue.apiKey === 'string' ? recordValue.apiKey : ''}
|
|
148
|
+
onChange={(event) => {
|
|
149
|
+
onChange({ ...value, [key]: { ...recordValue, apiKey: event.target.value } })
|
|
150
|
+
}}
|
|
151
|
+
placeholder={t('config.editor.secretPlaceholder')}
|
|
152
|
+
/>
|
|
153
|
+
</FieldRow>
|
|
154
|
+
<FieldRow
|
|
155
|
+
title={t('config.fields.modelServices.item.models.label')}
|
|
156
|
+
description={t('config.fields.modelServices.item.models.desc')}
|
|
157
|
+
icon={getTypeIcon('array')}
|
|
158
|
+
layout='stacked'
|
|
159
|
+
>
|
|
160
|
+
<StringArrayEditor
|
|
161
|
+
value={models}
|
|
162
|
+
onChange={(next) => {
|
|
163
|
+
onChange({ ...value, [key]: { ...recordValue, models: next } })
|
|
164
|
+
}}
|
|
165
|
+
t={t}
|
|
166
|
+
/>
|
|
167
|
+
</FieldRow>
|
|
168
|
+
<FieldRow
|
|
169
|
+
title={t('config.fields.modelServices.item.modelsAlias.label')}
|
|
170
|
+
description={t('config.fields.modelServices.item.modelsAlias.desc')}
|
|
171
|
+
icon={getTypeIcon('object')}
|
|
172
|
+
layout='stacked'
|
|
173
|
+
>
|
|
174
|
+
<ComplexTextEditor
|
|
175
|
+
value={recordValue.modelsAlias ?? {}}
|
|
176
|
+
onChange={(next) => {
|
|
177
|
+
onChange({ ...value, [key]: { ...recordValue, modelsAlias: next } })
|
|
178
|
+
}}
|
|
179
|
+
/>
|
|
180
|
+
</FieldRow>
|
|
181
|
+
<FieldRow
|
|
182
|
+
title={t('config.fields.modelServices.item.timeoutMs.label')}
|
|
183
|
+
description={t('config.fields.modelServices.item.timeoutMs.desc')}
|
|
184
|
+
icon={getTypeIcon('number')}
|
|
185
|
+
>
|
|
186
|
+
<InputNumber
|
|
187
|
+
min={1}
|
|
188
|
+
step={1000}
|
|
189
|
+
value={typeof recordValue.timeoutMs === 'number' ? recordValue.timeoutMs : undefined}
|
|
190
|
+
onChange={(nextValue) => {
|
|
191
|
+
onChange({
|
|
192
|
+
...value,
|
|
193
|
+
[key]: {
|
|
194
|
+
...recordValue,
|
|
195
|
+
...(typeof nextValue === 'number' ? { timeoutMs: nextValue } : { timeoutMs: undefined })
|
|
196
|
+
}
|
|
197
|
+
})
|
|
198
|
+
}}
|
|
199
|
+
/>
|
|
200
|
+
</FieldRow>
|
|
201
|
+
<FieldRow
|
|
202
|
+
title={t('config.fields.modelServices.item.maxOutputTokens.label')}
|
|
203
|
+
description={t('config.fields.modelServices.item.maxOutputTokens.desc')}
|
|
204
|
+
icon={getTypeIcon('number')}
|
|
205
|
+
>
|
|
206
|
+
<InputNumber
|
|
207
|
+
min={1}
|
|
208
|
+
step={256}
|
|
209
|
+
value={typeof recordValue.maxOutputTokens === 'number' ? recordValue.maxOutputTokens : undefined}
|
|
210
|
+
onChange={(nextValue) => {
|
|
211
|
+
onChange({
|
|
212
|
+
...value,
|
|
213
|
+
[key]: {
|
|
214
|
+
...recordValue,
|
|
215
|
+
...(typeof nextValue === 'number'
|
|
216
|
+
? { maxOutputTokens: nextValue }
|
|
217
|
+
: { maxOutputTokens: undefined })
|
|
218
|
+
}
|
|
219
|
+
})
|
|
220
|
+
}}
|
|
221
|
+
/>
|
|
222
|
+
</FieldRow>
|
|
223
|
+
<FieldRow
|
|
224
|
+
title={t('config.fields.modelServices.item.extra.label')}
|
|
225
|
+
description={t('config.fields.modelServices.item.extra.desc')}
|
|
226
|
+
icon={getTypeIcon('object')}
|
|
227
|
+
layout='stacked'
|
|
228
|
+
>
|
|
229
|
+
<ComplexTextEditor
|
|
230
|
+
value={recordValue.extra ?? {}}
|
|
231
|
+
onChange={(next) => {
|
|
232
|
+
onChange({ ...value, [key]: { ...recordValue, extra: next } })
|
|
233
|
+
}}
|
|
234
|
+
/>
|
|
235
|
+
</FieldRow>
|
|
234
236
|
</div>
|
|
235
237
|
</div>
|
|
236
238
|
</div>
|