feat: add file targeting feature

This commit is contained in:
vgcman16
2025-06-05 18:16:43 -05:00
parent 6721e94359
commit a01970fe1a
6 changed files with 305 additions and 0 deletions

View File

@@ -6,6 +6,8 @@ import { createScopedLogger } from '~/utils/logger';
import { unreachable } from '~/utils/unreachable';
import type { ActionCallbackData } from './message-parser';
import type { BoltShell } from '~/utils/shell';
import { isFileLocked } from '~/utils/fileLocks';
import { isFileTargeted, hasTargetedFiles } from '~/utils/targetFiles';
const logger = createScopedLogger('ActionRunner');
@@ -304,6 +306,16 @@ export class ActionRunner {
unreachable('Expected file action');
}
if (isFileLocked(action.filePath).locked) {
logger.warn(`Skipping locked file ${action.filePath}`);
return;
}
if (hasTargetedFiles() && !isFileTargeted(action.filePath)) {
logger.info(`Skipping non-targeted file ${action.filePath}`);
return;
}
const webcontainer = await this.#webcontainer;
const relativePath = nodePath.relative(webcontainer.workdir, action.filePath);