mirror of
https://github.com/stackblitz-labs/bolt.diy
synced 2025-06-26 10:16:01 +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 { atom, map, type MapStore } from 'nanostores';
|
||||||
import type { ActionAlert, BoltAction, DeployAlert, FileHistory, SupabaseAction, SupabaseAlert } from '~/types/actions';
|
import type { ActionAlert, BoltAction, DeployAlert, FileHistory, SupabaseAction, SupabaseAlert } from '~/types/actions';
|
||||||
import { createScopedLogger } from '~/utils/logger';
|
import { createScopedLogger } from '~/utils/logger';
|
||||||
|
import type { FilesStore } from '~/lib/stores/files';
|
||||||
import { unreachable } from '~/utils/unreachable';
|
import { unreachable } from '~/utils/unreachable';
|
||||||
import type { ActionCallbackData } from './message-parser';
|
import type { ActionCallbackData } from './message-parser';
|
||||||
import type { BoltShell } from '~/utils/shell';
|
import type { BoltShell } from '~/utils/shell';
|
||||||
@ -67,6 +68,7 @@ export class ActionRunner {
|
|||||||
#webcontainer: Promise<WebContainer>;
|
#webcontainer: Promise<WebContainer>;
|
||||||
#currentExecutionPromise: Promise<void> = Promise.resolve();
|
#currentExecutionPromise: Promise<void> = Promise.resolve();
|
||||||
#shellTerminal: () => BoltShell;
|
#shellTerminal: () => BoltShell;
|
||||||
|
#filesStore: FilesStore;
|
||||||
runnerId = atom<string>(`${Date.now()}`);
|
runnerId = atom<string>(`${Date.now()}`);
|
||||||
actions: ActionsMap = map({});
|
actions: ActionsMap = map({});
|
||||||
onAlert?: (alert: ActionAlert) => void;
|
onAlert?: (alert: ActionAlert) => void;
|
||||||
@ -77,12 +79,14 @@ export class ActionRunner {
|
|||||||
constructor(
|
constructor(
|
||||||
webcontainerPromise: Promise<WebContainer>,
|
webcontainerPromise: Promise<WebContainer>,
|
||||||
getShellTerminal: () => BoltShell,
|
getShellTerminal: () => BoltShell,
|
||||||
|
filesStore: FilesStore,
|
||||||
onAlert?: (alert: ActionAlert) => void,
|
onAlert?: (alert: ActionAlert) => void,
|
||||||
onSupabaseAlert?: (alert: SupabaseAlert) => void,
|
onSupabaseAlert?: (alert: SupabaseAlert) => void,
|
||||||
onDeployAlert?: (alert: DeployAlert) => void,
|
onDeployAlert?: (alert: DeployAlert) => void,
|
||||||
) {
|
) {
|
||||||
this.#webcontainer = webcontainerPromise;
|
this.#webcontainer = webcontainerPromise;
|
||||||
this.#shellTerminal = getShellTerminal;
|
this.#shellTerminal = getShellTerminal;
|
||||||
|
this.#filesStore = filesStore;
|
||||||
this.onAlert = onAlert;
|
this.onAlert = onAlert;
|
||||||
this.onSupabaseAlert = onSupabaseAlert;
|
this.onSupabaseAlert = onSupabaseAlert;
|
||||||
this.onDeployAlert = onDeployAlert;
|
this.onDeployAlert = onDeployAlert;
|
||||||
@ -322,6 +326,10 @@ export class ActionRunner {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
if (this.#filesStore.isFileLocked(action.filePath)) {
|
||||||
|
logger.info(`Skipped writing to locked file: ${action.filePath}`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
await webcontainer.fs.writeFile(relativePath, action.content);
|
await webcontainer.fs.writeFile(relativePath, action.content);
|
||||||
logger.debug(`File written ${relativePath}`);
|
logger.debug(`File written ${relativePath}`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@ -480,6 +480,7 @@ export class WorkbenchStore {
|
|||||||
runner: new ActionRunner(
|
runner: new ActionRunner(
|
||||||
webcontainer,
|
webcontainer,
|
||||||
() => this.boltTerminal,
|
() => this.boltTerminal,
|
||||||
|
this.#filesStore,
|
||||||
(alert) => {
|
(alert) => {
|
||||||
if (this.#reloadedMessages.has(messageId)) {
|
if (this.#reloadedMessages.has(messageId)) {
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user