Skip to content

desktop/src-tauri/crates/core/src/adapters/opencode/mod.rs

Comment 1, line 1

desktop/src-tauri/crates/core/src/adapters/opencode/mod.rs:1

//! OpenCode adapter; see architecture.md#adapter-layout.

Comment 2, line 2

desktop/src-tauri/crates/core/src/adapters/opencode/mod.rs:2

//! - Stable entry point implements the shared interface and re-exports modules.

Comment 3, line 3

desktop/src-tauri/crates/core/src/adapters/opencode/mod.rs:3

//! - detect checks product-specific opencode.db schema and the session.version registry.

Comment 4, line 4

desktop/src-tauri/crates/core/src/adapters/opencode/mod.rs:4

//! - versions selects a verified implementation or latest_fallback per record.

Comment 5, line 5

desktop/src-tauri/crates/core/src/adapters/opencode/mod.rs:5

//! - common checks product-specific schema and read-only/staged source access.

Comment 6, line 6

desktop/src-tauri/crates/core/src/adapters/opencode/mod.rs:6

//! - Wire parsing lives in the shared crate::adapters::opencode_family module.

Comment 7, line 7

desktop/src-tauri/crates/core/src/adapters/opencode/mod.rs:7

//!

Comment 8, line 8

desktop/src-tauri/crates/core/src/adapters/opencode/mod.rs:8

//! Reference A17: commit 0027387dc5c59793c12dfc531abc78f825ed6868.

Comment 9, line 9

desktop/src-tauri/crates/core/src/adapters/opencode/mod.rs:9

//! Official CLI/local-model 1.18.34 (aec0b9a6) samples verified main-loop usage and cache reads.

Comment 10, line 10

desktop/src-tauri/crates/core/src/adapters/opencode/mod.rs:10

//! These checks do not verify other versions in the same database or every call path.

Comment 11, line 11

desktop/src-tauri/crates/core/src/adapters/opencode/mod.rs:11

//! - xdg-basedir data lives at $XDG_DATA_HOME/opencode, defaulting to

Comment 12, line 12

desktop/src-tauri/crates/core/src/adapters/opencode/mod.rs:12

//! ~/.local/share/opencode; Windows layout has no real-sample verification.

Comment 13, line 13

desktop/src-tauri/crates/core/src/adapters/opencode/mod.rs:13

//! WAL databases use opencode.db or the channel variant opencode-<channel>.db.

Comment 14, line 14

desktop/src-tauri/crates/core/src/adapters/opencode/mod.rs:14

//! - Per-step usage comes from part rows of type step-finish; see family module references.

Comment 15, line 15

desktop/src-tauri/crates/core/src/adapters/opencode/mod.rs:15

//! - The earlier research note that exact per-request mapping was unimplemented was

Comment 16, line 16

desktop/src-tauri/crates/core/src/adapters/opencode/mod.rs:16

//! corrected after source inspection: step-finish carries usage per step and drives upstream projector counts.

Comment 17, line 17

desktop/src-tauri/crates/core/src/adapters/opencode/mod.rs:17

//! Map each part row; exact call timestamps and model-switch order require further event-level data.

Comment 18, line 18

desktop/src-tauri/crates/core/src/adapters/opencode/mod.rs:18

//! Timestamp basis remains observed_at.

Comment 19, line 28

desktop/src-tauri/crates/core/src/adapters/opencode/mod.rs:28

/// Stateless OpenCode adapter.

Comment 20, line 58

desktop/src-tauri/crates/core/src/adapters/opencode/mod.rs:58

// xdg-basedir path from the referenced global.ts: data = xdgData/opencode.

Comment 21, line 76

desktop/src-tauri/crates/core/src/adapters/opencode/mod.rs:76

// Inspect opencode*.db directly under each candidate data directory without recursive disk searches.

Comment 22, line 77

desktop/src-tauri/crates/core/src/adapters/opencode/mod.rs:77

// Manual roots may themselves contain databases, or provide <root>/opencode

Comment 23, line 78

desktop/src-tauri/crates/core/src/adapters/opencode/mod.rs:78

// or <root>/.local/share/opencode. Names alone cannot distinguish related products

Comment 24, line 79

desktop/src-tauri/crates/core/src/adapters/opencode/mod.rs:79

// such as Kilo with opencode-rc.db; detection must check the product-specific schema.

Comment 25, line 148

desktop/src-tauri/crates/core/src/adapters/opencode/mod.rs:148

// All currently attempted versions use step_finish_parts_v1; extend dispatch with the registry.