@clawdstrike/opencode
v0.1.1
Published
In-process tool boundary hooks for OpenCode-style coding assistants
Downloads
157
Maintainers
Readme
@clawdstrike/opencode
In-process tool-boundary hooks for OpenCode-style coding assistants.
Install
npm install @clawdstrike/opencode @clawdstrike/adapter-core @clawdstrike/engine-localUsage
import { createHushCliEngine } from '@clawdstrike/engine-local';
import { OpenCodeToolBoundary, wrapOpenCodeToolDispatcher } from '@clawdstrike/opencode';
const engine = createHushCliEngine({ policyRef: 'default' });
const boundary = new OpenCodeToolBoundary({ engine });
const dispatchTool = wrapOpenCodeToolDispatcher(boundary, async (toolName, input, runId) => {
// ...execute the tool...
return { toolName, input, runId };
});
await dispatchTool('write_file', { path: './out.txt', content: 'hi' }, 'run-1');