Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: saber
Type: Package
Title: Context Engineering for R
Version: 0.7.0
Version: 0.7.1
Authors@R: c(
person("Troy", "Hernandez", role = c("aut", "cre"),
email = "troy@cornball.ai",
Expand Down
2 changes: 1 addition & 1 deletion R/agent_context.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
#' @return Character string of assembled context, or empty string if no
#' context applies.
#' @examples
#' \dontrun{
#' \donttest{
#' # Codex agent in current project
#' saber::agent_context(agent = "codex")
#'
Expand Down
6 changes: 3 additions & 3 deletions R/briefing.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
#' directory basename.
#' @param scan_dir Directory to scan for project directories.
#' @param briefs_dir Directory to write briefing markdown files.
#' @return The briefing text (character string), returned invisibly. Printed
#' to stdout and written to \code{briefs_dir/{project}.md}.
#' @return The briefing text (character string), returned invisibly. Emitted
#' via \code{message()} and written to \code{briefs_dir/{project}.md}.
#' @examples
#' d <- file.path(tempdir(), "briefpkg")
#' dir.create(file.path(d, "R"), recursive = TRUE, showWarnings = FALSE)
Expand Down Expand Up @@ -57,7 +57,7 @@ briefing <- function(project = NULL, scan_dir = path.expand("~"),
outfile <- file.path(briefs_dir, paste0(project, ".md"))
writeLines(lines, outfile)

cat(text, "\n", sep = "")
message(text)
invisible(text)
}

Expand Down
9 changes: 5 additions & 4 deletions inst/tinytest/test_briefing.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ system2("git", c("-C", pkg_dir, "add", "-A"), stdout = FALSE, stderr = FALSE)
system2("git", c("-C", pkg_dir, "commit", "-q", "-m", "init"),
stdout = FALSE, stderr = FALSE)

# --- briefing() returns invisible character, prints to stdout ---
printed <- capture.output(
result <- briefing("demopkg", scan_dir = scan_dir, briefs_dir = briefs_dir)
# --- briefing() returns invisible character, emits via message() ---
msgs <- capture.output(
result <- briefing("demopkg", scan_dir = scan_dir, briefs_dir = briefs_dir),
type = "message"
)
expect_true(is.character(result))
expect_true(grepl("Briefing: demopkg", result))
expect_true(any(grepl("Briefing: demopkg", printed)))
expect_true(any(grepl("Briefing: demopkg", msgs)))

# --- briefing includes DESCRIPTION metadata ---
expect_true(grepl("Demo Package", result))
Expand Down
2 changes: 1 addition & 1 deletion man/agent_context.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ conventions and picking the file relevant to the consumer:
Override the defaults with the \code{include_*} parameters.
}
\examples{
\dontrun{
\donttest{
# Codex agent in current project
saber::agent_context(agent = "codex")

Expand Down
4 changes: 2 additions & 2 deletions man/briefing.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ directory basename.}
\item{briefs_dir}{Directory to write briefing markdown files.}
}
\value{
The briefing text (character string), returned invisibly. Printed
to stdout and written to \code{briefs_dir/{project}.md}.
The briefing text (character string), returned invisibly. Emitted
via \code{message()} and written to \code{briefs_dir/{project}.md}.
}
\description{
Generate project context for AI coding agents.
Expand Down
Loading