% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/session-context.R
\name{session_context_report}
\alias{session_context_report}
\title{Capture a human-readable report of the current R session state}
\usage{
session_context_report(max_objs = 20L, max_hist = 30L, quiet = FALSE)
}
\arguments{
\item{max_objs}{Maximum number of global objects to list per class group
(default 20).}

\item{max_hist}{Maximum number of console history lines to include
(default 30).}

\item{quiet}{If \code{TRUE}, suppress the \code{message()} emitted when
RStudio API is unavailable (default \code{FALSE}).}
}
\value{
Character string. A multi-section report ready to embed in a
system prompt.
}
\description{
\code{session_context_report()} collects and formats the following information
from the current R session:
\itemize{
\item R version and operating system.
\item Loaded add-on packages (non-base).
\item Global environment objects grouped by class.
\item Contents of the active source editor (via \pkg{rstudioapi}).
\item Console command history (via \pkg{rstudioapi}; falls back to
\verb{~/.Rhistory}).
}

This report is primarily used internally to populate the system prompt
sent to the LLM in the \code{\link[=addin_chat_panel]{addin_chat_panel()}} gadget, so the model has
full awareness of the analyst's working environment.
}
\examples{
\dontrun{
report <- session_context_report()
cat(report)
}

}
