OpenCode.Generated.Sync (opencode_sdk v0.1.65)

Copy Markdown View Source

Provides API endpoints related to sync

Summary

Functions

Replay sync events

Start workspace sync

Steal session into workspace

Types

sync_history_list_200_json_resp()

@type sync_history_list_200_json_resp() :: %{
  aggregate_id: String.t(),
  data: map(),
  id: String.t(),
  seq: integer(),
  type: String.t()
}

sync_replay_200_json_resp()

@type sync_replay_200_json_resp() :: %{session_id: String.t()}

sync_steal_200_json_resp()

@type sync_steal_200_json_resp() :: %{session_id: String.t()}

Functions

sync_history_list(body, opts \\ [])

@spec sync_history_list(body :: map(), opts :: keyword()) ::
  {:ok, [sync_history_list_200_json_resp()]}
  | {:error, OpenCode.Generated.BadRequestError.t()}

List sync events

List sync events for all aggregates. Keys are aggregate IDs the client already knows about, values are the last known sequence ID. Events with seq > value are returned for those aggregates. Aggregates not listed in the input get their full history.

Options

  • directory
  • workspace

Request Body

Content Types: application/json

sync_replay(body, opts \\ [])

@spec sync_replay(body :: map(), opts :: keyword()) ::
  {:ok, sync_replay_200_json_resp()}
  | {:error, OpenCode.Generated.BadRequestError.t()}

Replay sync events

Validate and replay a complete sync event history.

Options

  • directory
  • workspace

Request Body

Content Types: application/json

sync_start(opts \\ [])

@spec sync_start(opts :: keyword()) :: {:ok, boolean()} | :error

Start workspace sync

Start sync loops for workspaces in the current project that have active sessions.

Options

  • directory
  • workspace

sync_steal(body, opts \\ [])

@spec sync_steal(body :: map(), opts :: keyword()) ::
  {:ok, sync_steal_200_json_resp()}
  | {:error, OpenCode.Generated.BadRequestError.t()}

Steal session into workspace

Update a session to belong to the current workspace through the sync event system.

Options

  • directory
  • workspace

Request Body

Content Types: application/json