OpenCode.Generated.V2 (opencode_sdk v0.1.80)

Copy Markdown View Source

Provides API endpoints related to v2

Summary

Types

Functions

v2_session_compact(sessionID, opts \\ [])

Compact v2 session

Compact a v2 session conversation.

v2_session_context(sessionID, opts \\ [])

Get v2 session context

Retrieve the active context messages for a v2 session (all messages after the last compaction).

v2_session_list(opts \\ [])

List v2 sessions

Retrieve sessions in the requested order. Items keep that order across pages; use cursor.next or cursor.previous to move through the ordered list.

Options

  • workspace
  • limit
  • order
  • search
  • directory
  • project
  • subpath
  • cursor

v2_session_prompt(sessionID, body, opts \\ [])

Send v2 message

Durably admit one v2 session input and schedule agent-loop execution unless resume is false.

Request Body

Content Types: application/json

v2_session_wait(sessionID, opts \\ [])

Wait for v2 session

Wait for a v2 session agent loop to become idle.