feat(app): define trusted rewind branch flow
This commit is contained in:
@@ -720,6 +720,31 @@ pub struct TurnRequest {
|
||||
pub input: String,
|
||||
}
|
||||
|
||||
/// Requests a new playable branch rooted at an already committed story node.
|
||||
///
|
||||
/// The caller identifies the branch head it observed so the trusted runtime can
|
||||
/// reject a rewind racing with a newer turn. The new branch id is generated by
|
||||
/// the runtime from these trusted inputs and is never supplied by the UI or the
|
||||
/// model.
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(rename_all = "camelCase")]
|
||||
pub struct ForkBranchRequest {
|
||||
pub story_id: String,
|
||||
pub current_branch_id: String,
|
||||
pub expected_current_node_id: String,
|
||||
pub source_node_id: String,
|
||||
pub action_id: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(rename_all = "camelCase")]
|
||||
pub struct ForkBranchResult {
|
||||
pub branch_id: String,
|
||||
pub player_view: PlayerView,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(rename_all = "camelCase")]
|
||||
|
||||
Reference in New Issue
Block a user