feat: add official game audio generation client

This commit is contained in:
2026-09-21 12:17:32 +08:00
parent d222d17500
commit 09e0ce5cf3
28 changed files with 1835 additions and 31 deletions

View File

@@ -12,15 +12,19 @@ vi.mock('@/lib/coding-attachments', () => ({
describe('CodingConversationTimeline', () => {
afterEach(() => vi.unstubAllGlobals());
it('shows one Game Resource progress card from generation through automatic project save', async () => {
it.each([
['makelore.game-resource', '游戏资源'],
['makelore.game-audio', '游戏音频'],
])('shows one %s progress card through automatic project save', async (pluginId, label) => {
const { codingConversationStore } = await import('@/stores/coding-conversations');
const { CodingConversationTimeline } = await import(
'@/pages/Chat/CodingConversationTimeline'
);
const base = createProductSnapshot('conversation-game-resource-progress', 1);
const conversationId = 'conversation-progress-' + pluginId;
const base = createProductSnapshot(conversationId, 1);
const details = (phase: 'saving' | 'saved') => ({
schema: 'makelore-capability.v1' as const,
plugin_id: 'makelore.game-resource',
plugin_id: pluginId,
plugin_version: '1.0.0',
capability_id: 'game-resource.generate',
operation: 'generate',
@@ -82,28 +86,28 @@ describe('CodingConversationTimeline', () => {
};
codingConversationStore.getState().applySnapshotEvent({
type: 'snapshot',
conversationId: 'conversation-game-resource-progress',
conversationId,
workerGeneration: 1,
seq: base.cursor.seq,
snapshot: snapshot(base.cursor.seq, 'saving'),
});
render(<CodingConversationTimeline conversationId="conversation-game-resource-progress" />);
render(<CodingConversationTimeline conversationId={conversationId} />);
expect(screen.getByTestId('tool-progress-preview')).toHaveTextContent(
'游戏资源 · 正在保存到项目',
label + ' · 正在保存到项目',
);
const nextSeq = base.cursor.seq + 1;
act(() => codingConversationStore.getState().applySnapshotEvent({
type: 'snapshot',
conversationId: 'conversation-game-resource-progress',
conversationId,
workerGeneration: 1,
seq: nextSeq,
snapshot: snapshot(nextSeq, 'saved'),
}));
await waitFor(() => expect(screen.getByTestId('tool-progress-preview'))
.toHaveTextContent('游戏资源 · 已保存 2 个文件'));
.toHaveTextContent(label + ' · 已保存 2 个文件'));
});
it('resolves attachment refs into temporary object URLs without base64 state', async () => {