feat: implement browser open functionality and related tests
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { randomUUID } from 'crypto';
|
||||
import { randomUUID } from 'node:crypto';
|
||||
import { createProvider } from '@electron/providers';
|
||||
import type { BaseProvider } from '@electron/providers/BaseProvider';
|
||||
import { providerApiService } from '@electron/service/provider-api-service';
|
||||
@@ -8,6 +8,7 @@ import type { RawMessage } from '@runtime/shared/chat-model';
|
||||
import { sessionStore } from '../session-store';
|
||||
import type { GatewayEvent, GatewayRpcParams, GatewayRpcReturns } from '../types';
|
||||
import { appendTranscriptLine } from '@electron/utils/token-usage-writer';
|
||||
import { maybeHandleBrowserOpenMessage } from '../browser-shortcut';
|
||||
|
||||
export interface GatewayChatMessage {
|
||||
role: 'system' | 'user' | 'assistant' | 'tool';
|
||||
@@ -131,6 +132,10 @@ export function handleChatSend(
|
||||
},
|
||||
});
|
||||
|
||||
if (maybeHandleBrowserOpenMessage(sessionKey, runId, userMessage, broadcast)) {
|
||||
return { runId };
|
||||
}
|
||||
|
||||
// 2. Resolve provider account
|
||||
const accountId = options?.providerAccountId || providerApiService.getDefault().accountId;
|
||||
if (!accountId) {
|
||||
|
||||
Reference in New Issue
Block a user