Skip to contents

Write a session file to share: the history (trackers and branches chosen; the tracker in use, its main and shown branches by default), the current state only, or the steps only; with or without notes, conversations, Recently deleted, times and where the dataset opens from.

Usage

cellucid_history_share(
  viewer,
  chats = FALSE,
  content = "history",
  file,
  include,
  journal = FALSE,
  notes = TRUE,
  results = "include",
  source = "full",
  times
)

Arguments

viewer

A viewer cellucid_view() or cellucid_serve() returned.

chats

Conversations kept with the trackers (never with a state). TRUE or FALSE. Default FALSE, the viewer's own.

content

history: the trackers and branches with their values; state: the current state only, without its history (one squashed step "Shared state"); steps: the steps only, no cells or values (a replay plan for any dataset). One of "history", "state", "steps". Default "history", the viewer's own.

file

The file's name; the dataset's name when left out. Text (at least 1 character). Left out unless given (the viewer then chooses as its own control does).

include

The trackers to include, each with its branches (its main and shown branches when left out); the tracker in use when left out. A vector or list of a named list (at least 1 item). Left out unless given (the viewer then chooses as its own control does).

journal

Recently deleted (never with a state). TRUE or FALSE. Default FALSE, the viewer's own.

notes

Notes and bookmarks (never with a state). TRUE or FALSE. Default TRUE, the viewer's own.

results

Analysis results: include them, or leave them out to compute again on open from their recorded inputs (smaller; always so for steps). Steps only always recompute, whatever is given. One of "include", "recompute". Default "include", the viewer's own.

source

full: the dataset's name and where it opens from; name: its name only. One of "full", "name". Default "full", the viewer's own.

times

exact; dates (each rounded down to its day); none. When left out: exact for a history or steps, none for a state. One of "exact", "dates", "none". Left out unless given (the viewer then chooses as its own control does).

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 bytes, content, file, steps (Steps written), trackers.

Details

The viewer's action history.share (History). It acts outside the viewer's state and history (a file the person receives in the browser, a publication, or what the browser keeps for later visits), which Undo does not take back: it makes no step of the history.

When an agent (Claude, ChatGPT) runs it, the viewer asks the person first (writes-file); 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_share(viewer)
  print(request)
  # cellucid_action_result(request) waits for its outcome.
  cellucid_stop(viewer)
}