From d17ea0f9585225cb93d6582f8e7341727c630891 Mon Sep 17 00:00:00 2001 From: Kit Langton Date: Sat, 6 Jun 2026 20:50:59 -0400 Subject: [PATCH 1/2] fix(core): use static tool type imports --- packages/core/src/public/opencode.ts | 3 ++- packages/core/src/public/tool.ts | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/core/src/public/opencode.ts b/packages/core/src/public/opencode.ts index 0f7deb6a80e1..0543e47a7485 100644 --- a/packages/core/src/public/opencode.ts +++ b/packages/core/src/public/opencode.ts @@ -13,10 +13,11 @@ import { SessionProjector } from "../session/projector" import { SessionStore } from "../session/store" import { ApplicationTools } from "../tool/application-tools" import { Session } from "./session" +import type { ToolService } from "./tool" export interface Interface { readonly sessions: Session.Interface - readonly tools: import("./tool").Service + readonly tools: ToolService } /** Intentional public native API for Effect applications embedding OpenCode. */ diff --git a/packages/core/src/public/tool.ts b/packages/core/src/public/tool.ts index 2c41b3937794..6078c3e36caf 100644 --- a/packages/core/src/public/tool.ts +++ b/packages/core/src/public/tool.ts @@ -1,9 +1,10 @@ import { Effect, Scope } from "effect" +import type { Tool } from "../tool/tool" export { Failure, RegistrationError, make } from "../tool/tool" export type { AnyTool, Content, Context, Tool } from "../tool/tool" -export interface Service { +export interface ToolService { /** * Register same-process tools on this OpenCode instance for the current Scope. * Location tools with the same name take precedence where they are installed. @@ -11,6 +12,6 @@ export interface Service { * started settling may fail because the tool is no longer available. */ readonly register: ( - tools: Readonly>, - ) => Effect.Effect + tools: Readonly>, + ) => Effect.Effect } From b51f546355b9cc3a17137f8ebe028b22d46f78ff Mon Sep 17 00:00:00 2001 From: Kit Langton Date: Sat, 6 Jun 2026 20:52:16 -0400 Subject: [PATCH 2/2] refactor(core): align public tool interface naming --- packages/core/src/public/opencode.ts | 4 ++-- packages/core/src/public/tool.ts | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/core/src/public/opencode.ts b/packages/core/src/public/opencode.ts index 0543e47a7485..80c69bdb0656 100644 --- a/packages/core/src/public/opencode.ts +++ b/packages/core/src/public/opencode.ts @@ -13,11 +13,11 @@ import { SessionProjector } from "../session/projector" import { SessionStore } from "../session/store" import { ApplicationTools } from "../tool/application-tools" import { Session } from "./session" -import type { ToolService } from "./tool" +import { Tool } from "./tool" export interface Interface { readonly sessions: Session.Interface - readonly tools: ToolService + readonly tools: Tool.Interface } /** Intentional public native API for Effect applications embedding OpenCode. */ diff --git a/packages/core/src/public/tool.ts b/packages/core/src/public/tool.ts index 6078c3e36caf..d40303d93d1a 100644 --- a/packages/core/src/public/tool.ts +++ b/packages/core/src/public/tool.ts @@ -1,17 +1,17 @@ +export * as Tool from "./tool" + import { Effect, Scope } from "effect" -import type { Tool } from "../tool/tool" +import type { AnyTool, RegistrationError } from "../tool/tool" export { Failure, RegistrationError, make } from "../tool/tool" -export type { AnyTool, Content, Context, Tool } from "../tool/tool" +export type { AnyTool, Content, Context } from "../tool/tool" -export interface ToolService { +export interface Interface { /** * Register same-process tools on this OpenCode instance for the current Scope. * Location tools with the same name take precedence where they are installed. * Closing the Scope removes the tools immediately, so calls that have not * started settling may fail because the tool is no longer available. */ - readonly register: ( - tools: Readonly>, - ) => Effect.Effect + readonly register: (tools: Readonly>) => Effect.Effect }