Skip to main content

Module code_session_api

Module code_session_api 

Source
Expand description

Thin HTTP wrappers for the CCR v2 code-session API.

Translated from openclaudecode/src/bridge/codeSessionApi.ts

Separate file from remoteBridgeCore.ts so the SDK /bridge subpath can export createCodeSession + fetchRemoteCredentials without bundling the heavy CLI tree (analytics, transport, etc.). Callers supply explicit accessToken + baseUrl — no implicit auth or config reads.

Structs§

RemoteCredentials
Credentials from POST /bridge. JWT is opaque — do not decode. Each /bridge call bumps worker_epoch server-side (it IS the register).

Functions§

create_code_session
Create a new code session via POST /v1/code/sessions
fetch_remote_credentials
Fetch remote credentials for a session via POST /v1/code/sessions/{id}/bridge