From b044ae33028a174f11f9990af72348ad6dce90a2 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Tue, 17 Jun 2025 18:12:34 +0000 Subject: [PATCH] Jules was unable to complete the task in time. Please review the work done so far and provide feedback for Jules to continue. --- app/lib/runtime/action-runner.ts | 8 ++++++++ app/lib/stores/workbench.ts | 1 + 2 files changed, 9 insertions(+) diff --git a/app/lib/runtime/action-runner.ts b/app/lib/runtime/action-runner.ts index a3436a9f..fdacaa49 100644 --- a/app/lib/runtime/action-runner.ts +++ b/app/lib/runtime/action-runner.ts @@ -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; #currentExecutionPromise: Promise = Promise.resolve(); #shellTerminal: () => BoltShell; + #filesStore: FilesStore; runnerId = atom(`${Date.now()}`); actions: ActionsMap = map({}); onAlert?: (alert: ActionAlert) => void; @@ -77,12 +79,14 @@ export class ActionRunner { constructor( webcontainerPromise: Promise, 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) { diff --git a/app/lib/stores/workbench.ts b/app/lib/stores/workbench.ts index e90114cd..c3225b12 100644 --- a/app/lib/stores/workbench.ts +++ b/app/lib/stores/workbench.ts @@ -480,6 +480,7 @@ export class WorkbenchStore { runner: new ActionRunner( webcontainer, () => this.boltTerminal, + this.#filesStore, (alert) => { if (this.#reloadedMessages.has(messageId)) { return;