Merge branch 'feat/design_agent_simple' of ssh://genarrative-station:2222/GenarrativeAI/Genarrative into feat/design_agent_simple
This commit is contained in:
@@ -1754,8 +1754,6 @@ for (const snippet of [
|
|||||||
"'write_game_creator_app_config'",
|
"'write_game_creator_app_config'",
|
||||||
'aria-label="运行时配置"',
|
'aria-label="运行时配置"',
|
||||||
'LLM API Key',
|
'LLM API Key',
|
||||||
'External Editor Base URL',
|
|
||||||
'External Editor API Key',
|
|
||||||
'runtime_config.save',
|
'runtime_config.save',
|
||||||
"'/run:运行自检,启动本地 HTTP 预览并载入客户端运行视图'",
|
"'/run:运行自检,启动本地 HTTP 预览并载入客户端运行视图'",
|
||||||
"'activate_local_game_preview'",
|
"'activate_local_game_preview'",
|
||||||
@@ -1791,6 +1789,19 @@ for (const snippet of [
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (const snippet of [
|
||||||
|
"label: '连接与工具'",
|
||||||
|
"id: 'connections'",
|
||||||
|
"activeSection === 'connections'",
|
||||||
|
'aria-label="外部连接"',
|
||||||
|
]) {
|
||||||
|
if (appSource.includes(snippet)) {
|
||||||
|
throw new Error(
|
||||||
|
`AI game creator shell removed settings page was reintroduced: ${snippet}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (const script of [
|
for (const script of [
|
||||||
'ai-game-creator-shell:dev',
|
'ai-game-creator-shell:dev',
|
||||||
'ai-game-creator-shell:dev-server',
|
'ai-game-creator-shell:dev-server',
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import {
|
import {
|
||||||
Bot,
|
Bot,
|
||||||
Cable,
|
|
||||||
CheckCircle2,
|
CheckCircle2,
|
||||||
CircleAlert,
|
CircleAlert,
|
||||||
Info,
|
Info,
|
||||||
@@ -91,7 +90,6 @@ const defaultRuntimeConfigDraft: GameCreatorAppConfig = {
|
|||||||
type RuntimeSettingsSection =
|
type RuntimeSettingsSection =
|
||||||
| 'general'
|
| 'general'
|
||||||
| 'agents'
|
| 'agents'
|
||||||
| 'connections'
|
|
||||||
| 'extensions'
|
| 'extensions'
|
||||||
| 'advanced'
|
| 'advanced'
|
||||||
| 'about';
|
| 'about';
|
||||||
@@ -116,12 +114,6 @@ const runtimeSettingsSections = [
|
|||||||
description: '按角色覆盖默认模型',
|
description: '按角色覆盖默认模型',
|
||||||
icon: Bot,
|
icon: Bot,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
id: 'connections',
|
|
||||||
label: '连接与工具',
|
|
||||||
description: '外部服务',
|
|
||||||
icon: Cable,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
id: 'extensions',
|
id: 'extensions',
|
||||||
label: '扩展',
|
label: '扩展',
|
||||||
@@ -1452,57 +1444,6 @@ export function RuntimeConfigDialog({
|
|||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
{activeSection === 'connections' ? (
|
|
||||||
<section
|
|
||||||
className="runtime-settings-section"
|
|
||||||
aria-label="外部连接"
|
|
||||||
>
|
|
||||||
<header className="runtime-settings-section-header">
|
|
||||||
<div>
|
|
||||||
<h3>外部连接</h3>
|
|
||||||
<p>配置图片编辑器使用的外部服务</p>
|
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
{allowAdvancedExternalEditorConfig ? (
|
|
||||||
<div className="runtime-settings-fields">
|
|
||||||
<label>
|
|
||||||
External Editor Base URL
|
|
||||||
<input
|
|
||||||
aria-label="External Editor Base URL"
|
|
||||||
value={runtimeConfigDraft.editorApi.baseUrl}
|
|
||||||
onChange={(event) =>
|
|
||||||
setRuntimeConfigDraft((current) => ({
|
|
||||||
...current,
|
|
||||||
editorApi: {
|
|
||||||
...current.editorApi,
|
|
||||||
baseUrl: event.currentTarget.value,
|
|
||||||
},
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</label>
|
|
||||||
<label>
|
|
||||||
External Editor API Key
|
|
||||||
<input
|
|
||||||
aria-label="External Editor API Key"
|
|
||||||
autoComplete="off"
|
|
||||||
type="password"
|
|
||||||
value={runtimeConfigDraft.editorApi.apiKey}
|
|
||||||
onChange={(event) =>
|
|
||||||
setRuntimeConfigDraft((current) => ({
|
|
||||||
...current,
|
|
||||||
editorApi: {
|
|
||||||
...current.editorApi,
|
|
||||||
apiKey: event.currentTarget.value,
|
|
||||||
},
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
) : null}
|
|
||||||
</section>
|
|
||||||
) : null}
|
|
||||||
{activeSection === 'extensions' ? (
|
{activeSection === 'extensions' ? (
|
||||||
<section
|
<section
|
||||||
className="runtime-settings-section runtime-settings-extensions"
|
className="runtime-settings-section runtime-settings-extensions"
|
||||||
|
|||||||
@@ -832,7 +832,7 @@ export function registerPublishedRuntimeSettingsTests() {
|
|||||||
expect(
|
expect(
|
||||||
screen.getByLabelText('LLM API Key').getAttribute('autocomplete'),
|
screen.getByLabelText('LLM API Key').getAttribute('autocomplete'),
|
||||||
).toBe('off');
|
).toBe('off');
|
||||||
fireEvent.click(screen.getByRole('button', { name: /连接与工具/ }));
|
expect(screen.queryByRole('button', { name: /连接与工具/ })).toBeNull();
|
||||||
expect(screen.queryByLabelText('External Editor Base URL')).toBeNull();
|
expect(screen.queryByLabelText('External Editor Base URL')).toBeNull();
|
||||||
expect(screen.queryByLabelText('External Editor API Key')).toBeNull();
|
expect(screen.queryByLabelText('External Editor API Key')).toBeNull();
|
||||||
fireEvent.click(screen.getByRole('button', { name: /Agent 模型/ }));
|
fireEvent.click(screen.getByRole('button', { name: /Agent 模型/ }));
|
||||||
@@ -1007,7 +1007,7 @@ export function registerPublishedRuntimeSettingsTests() {
|
|||||||
target: { value: 'ark' },
|
target: { value: 'ark' },
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
fireEvent.click(screen.getByRole('button', { name: /连接与工具/ }));
|
expect(screen.queryByRole('button', { name: /连接与工具/ })).toBeNull();
|
||||||
expect(screen.queryByLabelText('External Editor Base URL')).toBeNull();
|
expect(screen.queryByLabelText('External Editor Base URL')).toBeNull();
|
||||||
expect(screen.queryByLabelText('External Editor API Key')).toBeNull();
|
expect(screen.queryByLabelText('External Editor API Key')).toBeNull();
|
||||||
fireEvent.click(
|
fireEvent.click(
|
||||||
@@ -1166,7 +1166,7 @@ export function registerPublishedRuntimeSettingsTests() {
|
|||||||
'value',
|
'value',
|
||||||
'12000',
|
'12000',
|
||||||
);
|
);
|
||||||
fireEvent.click(screen.getByRole('button', { name: /连接与工具/ }));
|
expect(screen.queryByRole('button', { name: /连接与工具/ })).toBeNull();
|
||||||
expect(screen.queryByLabelText('External Editor Base URL')).toBeNull();
|
expect(screen.queryByLabelText('External Editor Base URL')).toBeNull();
|
||||||
expect(screen.queryByLabelText('External Editor API Key')).toBeNull();
|
expect(screen.queryByLabelText('External Editor API Key')).toBeNull();
|
||||||
fireEvent.click(
|
fireEvent.click(
|
||||||
|
|||||||
Reference in New Issue
Block a user