Repository navigation
Description
Defer until #601 merges
The public /host and /status entry points are TypeScript source and their transitive
graph references Bun globals, so an external consumer cannot typecheck against them
without installing @types/bun and adding bun to compilerOptions.types. This
contradicts the documented Node support ("Node hosts do not need a Bun process bridge").
Do not start this before #601 lands: ./host exists only on that branch, so a pin written
against main today has nothing to check.
Measured
A consumer file consisting of
import { readMemoryCommand, type MemoryHost } from 'opencode-self-improvement/host';
export const h: Pick<MemoryHost, 'apiVersion'> = { apiVersion: '0.1.0' };
export const cmd = readMemoryCommand('repo-init');with target: ESNext, module/moduleResolution: NodeNext, strict, skipLibCheck,
allowImportingTsExtensions, types: ["node"]:
node_modules/opencode-self-improvement/src/host/services.ts(16,10): error TS2868: Cannot find name 'Bun' …
node_modules/opencode-self-improvement/src/runtime/setup.ts(97,14): error TS2868: Cannot find name 'Bun' …
node_modules/opencode-self-improvement/src/runtime/setup.ts(97,43): error TS2868: Cannot find name 'Bun' …
Adding @types/bun clears all three. skipLibCheck does not help because the published
surface is .ts, not declarations.
Independently confirmed by the first outside adapter
(WhollyMindless/dsh-self-improvement, #621): its tsconfig.json carries
"types": ["node", "bun"] and its README states the requirement as a known packaging
cost.
The two reference sites are readMemoryCommand using Bun.file and the setup-time
typeof Bun === "undefined" ? undefined : Bun.version probe.
Candidate fix, and the guard that should ship with it
readMemoryCommandreads the shipped command text throughnode:fs/promises.- The Bun-version probe reads
Bunoff a typedglobalThiscast rather than naming the
global.
The pin worth having is the one the package-boundary runner already writes: its generated
consumer tsconfig.json currently declares types: ["bun"]. Switching that generated
consumer to ["node"] turns the whole check into the regression guard — a future Bun
reference anywhere in the public graph fails bun run test:adapter-package instead of
being discovered by a downstream adapter. Unexecuted: neither the fix nor the
types: ["node"] variant has been run, so the fixer must confirm the consumer graph has no
other Bun dependency before proposing it.
Acceptance
tscof a public-entry consumer withtypes: ["node"]passes, from an installed
package rather than the checkout.- The boundary runner's consumer declares
types: ["node"], and reintroducing aBun
reference in the public graph makes that runner fail. - The external adapter's README sentence about needing Bun declarations becomes false, and
itstypesarray can dropbun.
Activity
WhollyMindless commentedon Nov 30, 2026
Note
🤖 gpt-6-astra responding on behalf of WhollyMindless
The fix is implemented in existing PR #601 at
b9021795, with the downstream dsh update pushed at972e611. It stays on the branch that provides the public entry points; no additional PR or engine release was created.readMemoryCommandusesnode:fs/promises, fixing its Node runtime failure as well as the declaration dependency.globalThis, preserving the existing warning behavior.NodeNextandtypes: ["node"]before installing native SDKs or Bun declarations. Before the production fix, this check failed on all three reported Bun references.tsximport and asserts that no Bun global exists. CI runs this package check on Node 22.19.0 on Linux and Windows.@types/bunand"bun"from its configuration, and updates its installation documentation. Removing the workaround against the old pin reproduced the three errors; the new pin passes both adapter and test typechecks.Local validation: the complete package check passes; the full engine rerun passes 2,150 tests, 35 skips. The first full run had a store-lock/teardown failure in
lock-narrowing.test.ts; it passed alone and on the full rerun. Dsh passes 9 native/package tests and 12 installed CLI scenarios on Node 24.15.0.The implementation is ready for review, with CI and #601's merge still pending. The npm release numbered 0.41.1 still lacks these entry points; this does not claim a registry release or resolve the separate compatibility-policy questions.
abogartz-opencode-self-improvement commentedon Dec 1, 2026
🎉 This issue has been resolved in version 0.42.0 🎉
The release is available on:
Your semantic-release bot 📦🚀