wip: agui integration

This commit is contained in:
2026-02-25 19:51:58 +01:00
parent 5efbcfe03a
commit fcdf869a7c
59 changed files with 3467 additions and 267 deletions

View File

@@ -0,0 +1,35 @@
import { describe, expect, it } from 'vitest';
import { planAssistantRequest } from '../../../src/renderer/navigation/assistantConversation';
describe('assistantConversation', () => {
it('creates enriched first message when no conversation exists yet', () => {
const result = planAssistantRequest({
conversationId: null,
userPrompt: 'Find weak tags',
context: {
tabType: 'post',
id: 'post-1',
title: 'Launch Notes',
},
});
expect(result.shouldCreateConversation).toBe(true);
expect(result.outboundMessage).toContain('User request: Find weak tags');
expect(result.outboundMessage).toContain('Current editor context type: post');
});
it('sends plain follow-up message when conversation already exists', () => {
const result = planAssistantRequest({
conversationId: 'conv-1',
userPrompt: 'What next?',
context: {
tabType: 'post',
id: 'post-1',
title: 'Launch Notes',
},
});
expect(result.shouldCreateConversation).toBe(false);
expect(result.outboundMessage).toBe('What next?');
});
});