MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / create_pty

Function create_pty

crates/opencode-server/src/routes.rs:3406–3413  ·  view source on GitHub ↗
(Json(req): Json<CreatePtyRequest>)

Source from the content-addressed store, hash-verified

3404}
3405
3406async fn create_pty(Json(req): Json<CreatePtyRequest>) -> Result<Json<PtyInfo>> {
3407 let manager = get_pty_manager();
3408 let session = manager
3409 .create_session(&req.command, req.cwd.as_deref(), req.env)
3410 .await
3411 .map_err(|e| ApiError::BadRequest(e.to_string()))?;
3412 Ok(Json(PtyInfo::from(session)))
3413}
3414
3415async fn get_pty(Path(id): Path<String>) -> Result<Json<PtyInfo>> {
3416 let manager = get_pty_manager();

Callers

nothing calls this directly

Calls 2

get_pty_managerFunction · 0.85
create_sessionMethod · 0.45

Tested by

no test coverage detected