mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-04-25 00:16:29 +02:00
Merge branch 'dev' of github.com:rowboatlabs/rowboat into dev
This commit is contained in:
commit
906ffccb7b
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) {
|
||||
|
|
|
|||
|
|
@ -195,9 +195,11 @@ knowledge/People/Sarah Chen.md
|
|||
~/Desktop/report.pdf
|
||||
\`\`\`
|
||||
|
||||
This renders as an interactive card in the UI. Use this format for:
|
||||
This renders as an interactive card in the UI that the user can click to open the file. Use this format for:
|
||||
- Knowledge base file paths (knowledge/...)
|
||||
- Files on the user's machine (~/Desktop/..., /Users/..., etc.)
|
||||
- Audio files, images, documents, or any file reference
|
||||
|
||||
Never output raw file paths in plain text when they could be wrapped in a filepath block.`;
|
||||
**IMPORTANT:** Only use filepath blocks for files that already exist. The card is clickable and opens the file, so it must point to a real file. If you are proposing a path for a file that hasn't been created yet (e.g., "Shall I save it at ~/Documents/report.pdf?"), use inline code (\`~/Documents/report.pdf\`) instead of a filepath block. Use the filepath block only after the file has been written/created successfully.
|
||||
|
||||
Never output raw file paths in plain text when they could be wrapped in a filepath block — unless the file does not exist yet.`;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue