Skip to content
This repository was archived by the owner on Sep 23, 2025. It is now read-only.

Commit 005d235

Browse files
committed
Simplify Action function and add resolved walkthrough types
- Remove description field from Action - can be embedded in markdown lists - Keep only button and tell_agent fields for cleaner API - Add ResolvedWalkthrough and ResolvedWalkthroughElement types - Define final IPC payload structure for VSCode extension - Support introduction, highlights, changes, and actions sections - Use serde(untagged) for flexible element types (Text, Comment, GitDiff, Action) Ready for walkthrough execution implementation.
1 parent 66b74dd commit 005d235

File tree

2 files changed

+25
-9
lines changed

2 files changed

+25
-9
lines changed

server/src/ide.rs

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -376,13 +376,10 @@ fn process_file(
376376
/// Create an interactive action button for walkthroughs.
377377
///
378378
/// Examples:
379-
/// - `{"action": {"description": "Click to run tests", "button": "Run Tests"}}`
380-
/// - `{"action": {"description": "Generate boilerplate", "button": "Generate", "tell_agent": "Generate user authentication boilerplate"}}`
379+
/// - `{"action": {"button": "Run Tests"}}`
380+
/// - `{"action": {"button": "Generate", "tell_agent": "Generate user authentication boilerplate"}}`
381381
#[derive(Deserialize)]
382382
pub struct Action {
383-
/// Description shown to user
384-
pub description: String,
385-
386383
/// Button text
387384
pub button: String,
388385

@@ -392,7 +389,6 @@ pub struct Action {
392389

393390
#[derive(Serialize)]
394391
pub struct ResolvedAction {
395-
pub description: String,
396392
pub button: String,
397393
pub tell_agent: Option<String>,
398394
}
@@ -408,9 +404,31 @@ impl<U: IpcClient> DialectFunction<U> for Action {
408404
) -> anyhow::Result<Self::Output> {
409405
// Action is already resolved, just pass through
410406
Ok(ResolvedAction {
411-
description: self.description,
412407
button: self.button,
413408
tell_agent: self.tell_agent,
414409
})
415410
}
416411
}
412+
413+
/// Resolved walkthrough types for IPC communication with VSCode extension
414+
415+
#[derive(Serialize)]
416+
pub struct ResolvedWalkthrough {
417+
pub introduction: Option<Vec<String>>,
418+
pub highlights: Option<Vec<ResolvedWalkthroughElement>>,
419+
pub changes: Option<Vec<ResolvedWalkthroughElement>>,
420+
pub actions: Option<Vec<ResolvedWalkthroughElement>>,
421+
}
422+
423+
#[derive(Serialize)]
424+
#[serde(untagged)]
425+
pub enum ResolvedWalkthroughElement {
426+
/// Plain markdown text
427+
Text(String),
428+
/// Comment placed at specific locations
429+
Comment(ResolvedComment),
430+
/// Git diff display
431+
GitDiff(Vec<crate::synthetic_pr::FileChange>),
432+
/// Action button
433+
Action(ResolvedAction),
434+
}

server/src/ide/test.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,6 @@ async fn test_action_function() {
746746
// Test action with tell_agent
747747
let program = serde_json::json!({
748748
"action": {
749-
"description": "Generate authentication boilerplate code",
750749
"button": "Generate Auth",
751750
"tell_agent": "Create a complete authentication system with login, logout, and middleware"
752751
}
@@ -758,7 +757,6 @@ async fn test_action_function() {
758757
Ok(
759758
Object {
760759
"button": String("Generate Auth"),
761-
"description": String("Generate authentication boilerplate code"),
762760
"tell_agent": String("Create a complete authentication system with login, logout, and middleware"),
763761
},
764762
)

0 commit comments

Comments
 (0)