Skip to content

fix(plugin): export Promise ToolEditor - #46950

Merged
kitlangton merged 1 commit into
v2from
export-tool-editor
Sep 3, 2026
Merged

fix(plugin): export Promise ToolEditor#46950
kitlangton merged 1 commit into
v2from
export-tool-editor

Conversation

@kitlangton

Copy link
Copy Markdown
Contributor

Why

Promise plugin authors cannot import ToolEditor to type reusable transform helpers: TypeScript reports that the module declares it locally but does not export it. The Effect API and the other public editor interfaces already export their editor types.

What Changes

Export the existing Promise interface without changing its members:

import type { ToolEditor } from "@opencode-ai/plugin/promise/tool"

function removeLegacyTool(editor: ToolEditor) {
  editor.remove("legacy")
}

Before: this named type import fails with TS2459. After: a separate source-linked consumer can import it and use the editor's methods.

Scope

One export keyword. No runtime changes, method renames, or changes to the Effect API.

Verification

# packages/plugin
bun typecheck
TMPDIR="$(realpath "${TMPDIR:-/tmp}")" bun run test

# separate source-linked consumer package
bun typecheck

# repository root
bunx prettier --check packages/plugin/src/promise/tool.ts
git diff --check

The consumer check failed with TS2459 before the change and passed afterward. Package typechecking, all 9 plugin tests, formatting, and the normal pre-push workspace typecheck pass. TMPDIR is canonicalized so the existing host-resolution tests compare the same filesystem path spelling on macOS.

@kitlangton
kitlangton enabled auto-merge (squash) September 3, 2026 01:31
@kitlangton
kitlangton merged commit 5f1d74f into v2 Sep 3, 2026
10 checks passed
@kitlangton
kitlangton deleted the export-tool-editor branch September 3, 2026 01:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant