feat(tui): show workspace roots in cwd command

This commit is contained in:
Felipe Coury
2026-06-12 00:33:59 -07:00
parent 7cc15e96a2
commit f7eb951ee2
12 changed files with 155 additions and 4 deletions
@@ -552,6 +552,12 @@ client_request_definitions! {
serialization: thread_id(params.thread_id),
response: v2::ThreadWorkspaceUpdateResponse,
},
#[experimental("thread/workspace/read")]
ThreadWorkspaceRead => "thread/workspace/read" {
params: v2::ThreadWorkspaceReadParams,
serialization: thread_id(params.thread_id),
response: v2::ThreadWorkspaceReadResponse,
},
#[experimental("thread/memoryMode/set")]
ThreadMemoryModeSet => "thread/memoryMode/set" {
params: v2::ThreadMemoryModeSetParams,
@@ -3736,6 +3736,21 @@ fn thread_workspace_update_params_round_trip() {
);
}
#[test]
fn thread_workspace_read_params_round_trip() {
let params = ThreadWorkspaceReadParams {
thread_id: "thread_123".to_string(),
};
let serialized = serde_json::to_value(&params).expect("params should serialize");
assert_eq!(serialized, json!({ "threadId": "thread_123" }));
assert_eq!(
serde_json::from_value::<ThreadWorkspaceReadParams>(serialized)
.expect("params should deserialize"),
params
);
}
#[test]
fn thread_settings_update_params_preserve_field_level_experimental_gates() {
let permissions = ThreadSettingsUpdateParams {
@@ -300,6 +300,21 @@ pub struct ThreadWorkspaceUpdateResponse {
pub runtime_workspace_roots: Vec<AbsolutePathBuf>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
pub struct ThreadWorkspaceReadParams {
pub thread_id: String,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
pub struct ThreadWorkspaceReadResponse {
pub cwd: AbsolutePathBuf,
pub runtime_workspace_roots: Vec<AbsolutePathBuf>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS, ExperimentalApi)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]