Performs clean install smoke by importing the installed dist/index.js default export in a temp project.
verify-opencode-host-smoke.ts
Builds temporary OpenCode environment (bin from bun add opencode-ai), mounts the plugin tarball,
launches opencode serve, and probes http://127.0.0.1:<port>/global/health.
Captures logs and fails on failed to load plugin and cannot find module patterns.
All scripts are executable boundary files (#!/usr/bin/env bun / Node), with explicit temp-dir lifecycle management
and defensive cleanup via rmSync(..., { force: true, recursive: true }).
Flow
bun run build invokes scripts/generate-schema.ts through package.json#generate-schema after type declaration generation.
bun run verify:release runs verify-release-artifact.ts: sanitize dist -> pack artifact -> validate files -> install/import check.
bun run verify:host-smoke runs verify-opencode-host-smoke.ts: pack tarball -> boot isolated host -> wait for health -> verify no plugin-load errors.
Both verification scripts are non-interactive and designed for CI/CD pre-publish gates.
Integration
Bound to package.json scripts for local dev and release pipelines.
Release verification depends on build outputs from bun run build:plugin and bun run build:cli because it expects
dist/index.js, dist/cli/index.js, and generated schema.
Package integrity expectations are mirrored by tests and release scripts that assert packaged skill metadata and
runtime files are present.
Smoke checks instantiate the same plugin entrypoint (dist/index.js) that src/index.ts exports,
catching runtime breakage before publishing.