Fix SDK tools to respect cwd option

Core tools now properly use the cwd passed to createAgentSession().
Added tool factory functions for SDK users who specify custom cwd with explicit tools.

Fixes #279
This commit is contained in:
Mario Zechner 2025-12-22 16:17:55 +01:00
parent 42bc368e70
commit face745f3d
16 changed files with 1243 additions and 1044 deletions

View file

@ -93,6 +93,16 @@ export {
configureOAuthStorage,
// Factory
createAgentSession,
createBashTool,
// Tool factories (for custom cwd)
createCodingTools,
createEditTool,
createFindTool,
createGrepTool,
createLsTool,
createReadOnlyTools,
createReadTool,
createWriteTool,
// Helpers
defaultGetApiKey,
discoverAvailableModels,
@ -106,7 +116,7 @@ export {
type FileSlashCommand,
findModel as findModelByProviderAndId,
loadSettings,
// Tools
// Pre-built tools (use process.cwd())
readOnlyTools,
} from "./core/sdk.js";
export {