summaryrefslogtreecommitdiffhomepage
path: root/packages/plugin/src
diff options
context:
space:
mode:
authoradamelmore <[email protected]>2026-01-27 06:12:47 -0600
committeradamelmore <[email protected]>2026-01-27 06:29:19 -0600
commit1f9313847f61978faf3b8459e68386c1d3834b90 (patch)
tree118e94f5e3acf790f42aae60e4a96e896b995c83 /packages/plugin/src
parent2180be2f3f6f414e0b40f983a0727e8d610f05ea (diff)
downloadopencode-1f9313847f61978faf3b8459e68386c1d3834b90.tar.gz
opencode-1f9313847f61978faf3b8459e68386c1d3834b90.zip
feat(core): add worktree to plugin tool context
Diffstat (limited to 'packages/plugin/src')
-rw-r--r--packages/plugin/src/tool.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/packages/plugin/src/tool.ts b/packages/plugin/src/tool.ts
index 6b4f7f1d1..23aa512d9 100644
--- a/packages/plugin/src/tool.ts
+++ b/packages/plugin/src/tool.ts
@@ -9,6 +9,11 @@ export type ToolContext = {
* Prefer this over process.cwd() when resolving relative paths.
*/
directory: string
+ /**
+ * Project worktree root for this session.
+ * Useful for generating stable relative paths (e.g. path.relative(worktree, absPath)).
+ */
+ worktree: string
abort: AbortSignal
metadata(input: { title?: string; metadata?: { [key: string]: any } }): void
ask(input: AskInput): Promise<void>