mirror of
https://github.com/stackblitz-labs/bolt.diy
synced 2025-06-26 18:26:38 +00:00
Include mouse data when analyzing execution data
This commit is contained in:
parent
7d02bb58fc
commit
45c7365f01
@ -26,7 +26,6 @@ import { getSimulationRecording, getSimulationEnhancedPrompt } from '~/lib/repla
|
||||
import { getIFrameSimulationData, type SimulationData } from '~/lib/replay/Recording';
|
||||
import { getCurrentIFrame } from '../workbench/Preview';
|
||||
import { getCurrentMouseData } from '../workbench/PointSelector';
|
||||
import { assert } from '~/lib/replay/ReplayProtocolClient';
|
||||
import { anthropicNumFreeUsesCookieName, anthropicApiKeyCookieName, MaxFreeUses } from '~/utils/freeUses';
|
||||
import type { FileMap } from '~/lib/stores/files';
|
||||
import { shouldIncludeFile } from '~/utils/fileUtils';
|
||||
@ -284,7 +283,8 @@ export const ChatImpl = memo(
|
||||
const getEnhancedPrompt = async (recordingId: string, repositoryContents: string) => {
|
||||
let enhancedPrompt, message;
|
||||
try {
|
||||
enhancedPrompt = await getSimulationEnhancedPrompt(recordingId, repositoryContents);
|
||||
const mouseData = getCurrentMouseData();
|
||||
enhancedPrompt = await getSimulationEnhancedPrompt(recordingId, repositoryContents, mouseData);
|
||||
message = `Explanation of the bug:\n\n${enhancedPrompt}`;
|
||||
} catch (e) {
|
||||
console.error("Error enhancing prompt", e);
|
||||
|
@ -230,7 +230,11 @@ async function enhancePromptFromFailureData(
|
||||
return prompt;
|
||||
}
|
||||
|
||||
export async function getSimulationEnhancedPrompt(recordingId: string, repositoryContents: string): Promise<string> {
|
||||
export async function getSimulationEnhancedPrompt(
|
||||
recordingId: string,
|
||||
repositoryContents: string,
|
||||
mouseData: MouseData | undefined
|
||||
): Promise<string> {
|
||||
const client = new ProtocolClient();
|
||||
await client.initialize();
|
||||
try {
|
||||
@ -241,10 +245,10 @@ export async function getSimulationEnhancedPrompt(recordingId: string, repositor
|
||||
method: "Session.experimentalCommand",
|
||||
params: {
|
||||
name: "analyzeExecutionPoint",
|
||||
params: {},
|
||||
params: { mouseData },
|
||||
},
|
||||
sessionId,
|
||||
}) as { rval: ExecutionDataAnalysisResult };;
|
||||
}) as { rval: ExecutionDataAnalysisResult };
|
||||
|
||||
const { points, failureData } = rval;
|
||||
assert(failureData, "No failure data");
|
||||
|
Loading…
Reference in New Issue
Block a user