Centralize all path management via src/config/paths.ts
- Add getPaths() with workspace, scripts, ppt skin/template paths - Export getWorkspacePath(args?) helper — removes duplicate local functions and stale process.cwd()/workspace fallbacks from sqlite, pdf, excel, image, pubmed, email, audio-transcribe (7 files) - weather.ts: replace __dirname-relative scripts path with getPaths().scripts - Move ppt/ to .smallclaw/skills/presenter/ppt/; update server-v2.ts, pptx.ts, pptx_gen.py (argparse --skin-dir/--template-dir) - Fix PPT skin thumbnail serving: res.sendFile → fs.createReadStream (bypasses send module dotfiles restriction for .smallclaw/ paths) - Fix workspace default: .smallclaw/workspace (was project root workspace/) - Fix subagent paths to use SMALLCLAW_DATA_DIR env var - Fix Monaco marked module load failure: restore define.amd on DOMContentLoaded after deferred UMD libs (tone, magenta) have loaded - Add AudioContext resume on first user click (Chrome autoplay policy) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+2
-1
@@ -2,6 +2,7 @@ import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { ToolResult } from '../types.js';
|
||||
import { getConfig } from '../config/config.js';
|
||||
import { getWorkspacePath } from '../config/paths.js';
|
||||
|
||||
// ── Config ────────────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -333,7 +334,7 @@ export const emailReadTool = {
|
||||
resolvedWorkspacePath = path.resolve(String(injectedWorkspace));
|
||||
} else {
|
||||
const cfg = getConfig().getConfig();
|
||||
resolvedWorkspacePath = path.resolve(cfg?.workspace?.path || path.join(process.cwd(), 'workspace'));
|
||||
resolvedWorkspacePath = path.resolve(getWorkspacePath(args));
|
||||
}
|
||||
const relDir = path.join('attachments', `uid-${uid}`);
|
||||
const saveDir = path.join(resolvedWorkspacePath, relDir);
|
||||
|
||||
Reference in New Issue
Block a user