mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-04-28 09:56:23 +02:00
fix: resolve file card paths for ~/.rowboat/ files and restrict filepath blocks to existing files
- Resolve workspace-relative and /tmp paths in shell:openPath and shell:readFileBase64 IPC handlers - Update assistant instructions to only use filepath blocks for files that already exist Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
1aaa413828
commit
a05e9468f3
2 changed files with 10 additions and 2 deletions
|
|
@ -462,6 +462,9 @@ export function setupIpcHandlers() {
|
|||
let filePath = args.path;
|
||||
if (filePath.startsWith('~')) {
|
||||
filePath = path.join(os.homedir(), filePath.slice(1));
|
||||
} else if (!path.isAbsolute(filePath)) {
|
||||
// Workspace-relative path — resolve against ~/.rowboat/
|
||||
filePath = path.join(os.homedir(), '.rowboat', filePath);
|
||||
}
|
||||
const error = await shell.openPath(filePath);
|
||||
return { error: error || undefined };
|
||||
|
|
@ -470,6 +473,9 @@ export function setupIpcHandlers() {
|
|||
let filePath = args.path;
|
||||
if (filePath.startsWith('~')) {
|
||||
filePath = path.join(os.homedir(), filePath.slice(1));
|
||||
} else if (!path.isAbsolute(filePath)) {
|
||||
// Workspace-relative path — resolve against ~/.rowboat/
|
||||
filePath = path.join(os.homedir(), '.rowboat', filePath);
|
||||
}
|
||||
const stat = await fs.stat(filePath);
|
||||
if (stat.size > 10 * 1024 * 1024) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue