Documentation
¶
Overview ¶
Package opencode is the OpenCode V2 provider (ADR-0019). It is built from a reading of OpenCode's source at commit 1e4ad075. No real session checked it, so it is unverified: smif shows these sessions and never types into them, forks them or installs hooks for them. OpenCode V1 has no session_v2 table and stays at the herdr and Listed levels.
One server serves every TUI, and no file or route links a TUI's pid to a session, so smif matches like the Codex provider: an opencode process on a terminal owns the session in its folder that was updated since the process started. A TUI with no such session stays at the Listed level.
The database is opened with mode=ro, never immutable=1: immutable would skip a live -wal file. service.json holds the server's password, so smif never opens that file and uses no HTTP route. `ps` tells that the server lives. A pending approval lives only in the server's memory, so an open tool call gives no state.
Index ¶
- Constants
- type Provider
- func (p *Provider) Check() (state, detail string)
- func (p *Provider) Discover() []harness.Session
- func (p *Provider) Info() harness.Info
- func (p *Provider) Read(sessionID string, limit int) harness.Reading
- func (p *Provider) Stamp(sessionID string) string
- func (p *Provider) State(s harness.Session) (string, time.Time)
Constants ¶
const Name = "opencode"
Name is the harness name of OpenCode sessions.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider reads one OpenCode database.
func NewWithProcs ¶
NewWithProcs takes the process list from procs: tests use it.
func (*Provider) Check ¶
Check compares the database on this machine with the source reading. The detail names counts and table names only, never a value from a row.
func (*Provider) Discover ¶
Discover returns the sessions a live TUI owns. With no database it runs no ps, so a machine without OpenCode pays only a stat.
func (*Provider) Info ¶
Info names the provider. Verified stays false until a real session checks it and docs/compat.md has a row with that version.