Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[Bug]: v2 still unloadable via npm spec on OpenCode 2.0.32 — ./v2 subpath not usable as a plugin spec; ship v2 as root default export

オープン
#85 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
1〜2日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
bun, typescript
領域
cli, devtools

調査の方向性

Start by reading package.json and the v2 entry point at dist/src/v2/index.js; compare their exports with the plugin loader error quoted in the issue. Check how the package root and v2 export are configured, then verify that the published root entry provides the v2 definition OpenCode expects while retaining the named v1 export if needed. Done means the issue's root plugin spec, "opencode-pty", loads on OpenCode 2 without a shim.

索引モデルが issue の本文から書いたものです。

説明

Summary

On OpenCode 2.0.32 (macOS arm64), [email protected] still fails to load as an npm plugin. This adds two things #67 and #83 don't cover yet:

  1. The ./v2 subpath can't be used as a plugin spec. The README's V2 example is "plugins": ["opencode-pty/v2"], and OpenCode 2 parses that string as a package name rather than a subpath export. The only way left is a local shim file. I couldn't get one stable here: with a partial dependency tree, the plugin activation step hung (Location plugins did not finish activating) and blocked every command. I can't say whether that's the shim's fault or the adapter's.
  2. What would fix it: publish with the v2 definition as the package's root default export, i.e. export default define({ id, setup }) from dist/index.js. You could keep the named PTYPlugin export for v1 hosts, or gate on the host version. With that, "plugins": ["opencode-pty"] loads on v2 with no shim.

Evidence

  • package.json main: dist/index.js exports only the named PTYPlugin. exports["./v2"] points to dist/src/v2/index.js, which does contain define({ id, setup }).
  • Load error (from ~/.local/share/opencode/log/opencode.log): Plugin must export a default definition with an id and an effect or setup function.
  • npm latest is still 0.4.0, published 2026-09-18.

Related

  • #67, #83: same load failure. This issue adds the subpath-spec detail and a concrete export fix.
  • #80: once v2 loads, the adapter should also wire the permission authorizer, so that permission.bash deny/ask covers the pty tools.
主要言語
TypeScript
スター
601
フォーク
66
平均マージ
4日 9時間
マージ済み PR(30日)
1

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

shekohex/opencode-pty のほかの issue

shekohex/opencode-pty の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。