@noetic-tools/sub-harness-opencode
v1.0.0
Published
opencode sub-harness for Noetic — run the opencode agent as a Noetic step via step.opencode(...) or an opencode JSON workflow node.
Downloads
188
Maintainers
Readme
@noetic-tools/sub-harness-opencode
Run the opencode agent as a Noetic step.
import { opencode } from '@noetic-tools/sub-harness-opencode';
const flow = step.opencode({
id: 'fix-bug',
harness: opencode({ model: 'anthropic/claude-opus-4-8' }),
prompt: 'Fix the failing test in src/foo.ts',
});Install
bun add @noetic-tools/sub-harness-opencode @opencode-ai/sdk@opencode-ai/sdk is an optional peer dependency. The default runner loads it
lazily, so the package installs and type-checks without it; a missing SDK
surfaces as a SubHarnessStartError when a turn runs. Pass a custom runner
to drive opencode some other way (e.g. its CLI) or in tests.
API
opencode(options?)— build the opencodeSubHarness.optionsextends the sharedSubHarnessSettings(model,permissionMode,maxTurns,allowedTools,extra) plus an optionalrunneroverride.defaultOpencodeRunner— the SDK-backed turn runner.mapOpencodeMessage(message)— map one opencode message/event into normalizedSubHarnessStreamParts.
