Skip to main content

Module opencode

Module opencode 

Source
Expand description

opencode 1.x and 2.x: the TS plugin adapters/opencode/borg.ts, compiled in and copied to ~/.config/opencode/plugins/borg.ts ($OPENCODE_CONFIG_DIR, $XDG_CONFIG_HOME/opencode). The plugin translates both ways, sends opencode’s pid, emulates the stop’s second round and sets its budget.

Structs§

Opencode

Constants§

ADAPTER
CHILDREN
A guard, not a tuning knob: at most this many children of one session are exported, the rest read from the parent’s copy of their final text.

Functions§

session_runs
One run per main session that started subagents, oldest first: session (a ses_… id) only, else every parent of a subagent session since since (1.x’s query). A subagent is a child session; the parent’s task tool call (1.x task, 2.x subagent) names it (metadata.sessionId/sessionID) with its description, agent and prompt, and holds its final text. Its export gives its cwd and work. opencode has no structured output: output stays None.

Type Aliases§

Export
Exports a session by id, in the directory given (else wherever it runs).
Query
Runs a read-only query of opencode 1.x’s database (None: no such query).