Merge steps into one
cellucid_history_squash.RdReplace consecutive steps of one branch (from first to last, whole turns; a group's are its steps) with one squashed step from the first one's state to the last one's; elsewhere it replays as values only. Refused when another branch starts inside; the steps go to Recently deleted. An agent squashes only its own turn's steps.
Arguments
- viewer
A viewer
cellucid_view()orcellucid_serve()returned.- from
The first step to merge. Text. Required.
- to
The last step to merge. Text. Required.
Value
A cellucid_action_request, at once and invisibly: the action is sent now, or when the viewer's channel opens.
cellucid_action_result(request) returns its outcome: a list of groups_removed (Groups that held only these steps, removed with them), head (The step shown now), journal (Its Recently deleted entry), squashed (Steps it replaced), step (The squashed step).
Details
The viewer's action history.squash (History). It moves the viewer's history, as the person's Undo, Redo or a click on a step does: it makes no step of the history.
When an agent (Claude, ChatGPT) runs it, the viewer asks the person first (deletes-saved); from R it is not asked.
See also
cellucid_act() sends any action by its type, and cellucid_action_result()
collects its answer.
Examples
if (interactive() && requireNamespace("SeuratObject", quietly = TRUE)) {
data("pbmc_small", package = "SeuratObject")
viewer <- cellucid_view(SeuratObject::UpdateSeuratObject(pbmc_small))
request <- cellucid_history_squash(viewer, from = "s4",
to = "s9")
print(request)
# cellucid_action_result(request) waits for its outcome.
cellucid_stop(viewer)
}