mirror of
https://github.com/stackblitz-labs/bolt.diy
synced 2025-06-23 02:16:08 +00:00
Jules was unable to complete the task in time. Please review the work done so far and provide feedback for Jules to continue.
This commit is contained in:
parent
f0ba6388b2
commit
b044ae3302
@ -3,6 +3,7 @@ import { path as nodePath } from '~/utils/path';
|
||||
import { atom, map, type MapStore } from 'nanostores';
|
||||
import type { ActionAlert, BoltAction, DeployAlert, FileHistory, SupabaseAction, SupabaseAlert } from '~/types/actions';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
import type { FilesStore } from '~/lib/stores/files';
|
||||
import { unreachable } from '~/utils/unreachable';
|
||||
import type { ActionCallbackData } from './message-parser';
|
||||
import type { BoltShell } from '~/utils/shell';
|
||||
@ -67,6 +68,7 @@ export class ActionRunner {
|
||||
#webcontainer: Promise<WebContainer>;
|
||||
#currentExecutionPromise: Promise<void> = Promise.resolve();
|
||||
#shellTerminal: () => BoltShell;
|
||||
#filesStore: FilesStore;
|
||||
runnerId = atom<string>(`${Date.now()}`);
|
||||
actions: ActionsMap = map({});
|
||||
onAlert?: (alert: ActionAlert) => void;
|
||||
@ -77,12 +79,14 @@ export class ActionRunner {
|
||||
constructor(
|
||||
webcontainerPromise: Promise<WebContainer>,
|
||||
getShellTerminal: () => BoltShell,
|
||||
filesStore: FilesStore,
|
||||
onAlert?: (alert: ActionAlert) => void,
|
||||
onSupabaseAlert?: (alert: SupabaseAlert) => void,
|
||||
onDeployAlert?: (alert: DeployAlert) => void,
|
||||
) {
|
||||
this.#webcontainer = webcontainerPromise;
|
||||
this.#shellTerminal = getShellTerminal;
|
||||
this.#filesStore = filesStore;
|
||||
this.onAlert = onAlert;
|
||||
this.onSupabaseAlert = onSupabaseAlert;
|
||||
this.onDeployAlert = onDeployAlert;
|
||||
@ -322,6 +326,10 @@ export class ActionRunner {
|
||||
}
|
||||
|
||||
try {
|
||||
if (this.#filesStore.isFileLocked(action.filePath)) {
|
||||
logger.info(`Skipped writing to locked file: ${action.filePath}`);
|
||||
return;
|
||||
}
|
||||
await webcontainer.fs.writeFile(relativePath, action.content);
|
||||
logger.debug(`File written ${relativePath}`);
|
||||
} catch (error) {
|
||||
|
@ -480,6 +480,7 @@ export class WorkbenchStore {
|
||||
runner: new ActionRunner(
|
||||
webcontainer,
|
||||
() => this.boltTerminal,
|
||||
this.#filesStore,
|
||||
(alert) => {
|
||||
if (this.#reloadedMessages.has(messageId)) {
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user