Add CLIAdapterModule with pretty JSONL formatting
New src/cli/format-event.ts handles formatting OpenCode JSONL events: - step_start: skip in normal mode, show in debug - text: display as-is - tool_use: show errors, skip in normal mode - step_finish: show message + tokens/cost in debug - error: display error message Exports cliAdapter.formatStdoutEvent for Paperclip UI to call. Also fixes ui-parser.ts to re-export from format-event.ts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,19 @@ export const label = "OpenCode (Kubernetes)";
|
||||
|
||||
export const models: undefined = undefined;
|
||||
|
||||
import type { CLIAdapterModule } from "@paperclipai/adapter-utils";
|
||||
import { formatEvent } from "./cli/format-event.js";
|
||||
|
||||
export const cliAdapter: CLIAdapterModule = {
|
||||
type,
|
||||
formatStdoutEvent: (line: string, debug: boolean) => {
|
||||
const formatted = formatEvent(line, debug);
|
||||
if (formatted) {
|
||||
console.log(formatted);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export const agentConfigurationDoc = `# opencode_k8s agent configuration
|
||||
|
||||
Adapter: opencode_k8s
|
||||
|
||||
Reference in New Issue
Block a user