| Title: | Specification and Review Scaffolding for AI Agent Workflows |
|---|---|
| Description: | Specification, review, and scaffolding helpers for AI agent systems. The package standardizes workflow, memory, knowledge, interface, proposal, and review artifacts so humans and coding assistants can infer, inspect, revise, and hand off task designs. It intentionally excludes communication layers, provider-specific model client code, and full runtime execution engines so that design artifacts and implementation transport remain cleanly separated. |
| Authors: | Oliver Zhou [aut, cre] |
| Maintainer: | Oliver Zhou <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.2.8.4 |
| Built: | 2026-07-06 16:26:08 UTC |
| Source: | https://github.com/cran/agentr |
Add a child task to a task-family workflow
add_child_task_node(workflow, node, tags = character())add_child_task_node(workflow, node, tags = character())
workflow |
Existing task-family workflow. |
node |
One-row child-task node data frame. |
tags |
Optional tags for the child task. |
Updated task-family workflow.
AEConfig
AEConfig
Configuration for the action-execution subsystem.
$initialize(enabled = TRUE, execution_mode = "guided", tool_budget = "standard", metadata = list())Create an action-execution config.
$validate()Validate the config.
$as_list()Return a serializable representation.
enabledWhether the subsystem is enabled.
execution_modeExecution-mode label.
tool_budgetOptional tool budget label.
metadataFree-form metadata list.
new()
Create an action-execution config.
AEConfig$new( enabled = TRUE, execution_mode = "guided", tool_budget = "standard", metadata = list() )
enabledWhether the subsystem is enabled.
execution_modeExecution-mode label.
tool_budgetOptional tool budget label.
metadataFree-form metadata list.
validate()
Validate the config.
AEConfig$validate()
as_list()
Return a serializable representation.
AEConfig$as_list()
print()
Print a compact config summary.
AEConfig$print(...)
...Unused print arguments.
clone()
The objects of this class are cloneable with this method.
AEConfig$clone(deep = FALSE)
deepWhether to make a deep clone.
AffectiveConfig
AffectiveConfig
Lightweight configuration for the affective layer inside RWM.
$initialize(enabled = TRUE, style = "lightweight", persistence = "session", summary = NULL, metadata = list())Create an affective-layer config.
$validate()Validate the config.
$as_list()Return a serializable representation.
enabledWhether the affective layer is enabled.
styleAffective modeling style.
persistencePersistence mode for affective state.
summaryOptional one-line summary.
metadataFree-form metadata list.
new()
Create an affective-layer config.
AffectiveConfig$new( enabled = TRUE, style = "lightweight", persistence = "session", summary = NULL, metadata = list() )
enabledWhether the affective layer is enabled.
styleAffective modeling style.
persistencePersistence mode for affective state.
summaryOptional one-line summary.
metadataFree-form metadata list.
validate()
Validate the config.
AffectiveConfig$validate()
as_list()
Return a serializable representation.
AffectiveConfig$as_list()
print()
Print a compact config summary.
AffectiveConfig$print(...)
...Unused print arguments.
clone()
The objects of this class are cloneable with this method.
AffectiveConfig$clone(deep = FALSE)
deepWhether to make a deep clone.
AffectiveState
AffectiveState
Minimal structured affective layer with inertia-aware updates.
$initialize(state = default_emotion_state())Create an affective state container.
$decay(current_time = Sys.time())Apply time-based decay to the stored affective state.
$update_primary(updates)Blend named primary-emotion updates into the current state using inertia.
$describe(threshold = 0.2, include_blended = TRUE, method = "geometric")Return a natural-language description of the current affective state.
$as_list()Return the raw underlying affective-state list.
stateA named list returned by default_emotion_state().
new()
Create an AffectiveState with an initial emotion state.
AffectiveState$new(state = default_emotion_state())
stateAffective state used by $initialize().
decay()
Apply time-based decay to the current affective state.
AffectiveState$decay(current_time = Sys.time())
current_timeReference time used by $decay().
update_primary()
Blend named primary-emotion updates into the current affective state.
AffectiveState$update_primary(updates)
updatesNamed numeric updates used by $update_primary().
describe()
Return a natural-language description of the current affective state.
AffectiveState$describe( threshold = 0.2, include_blended = TRUE, method = "geometric" )
thresholdThreshold used by $describe().
include_blendedLogical flag used by $describe().
methodCombination method used by $describe().
as_list()
Return the underlying affective state as a plain list.
AffectiveState$as_list()
clone()
The objects of this class are cloneable with this method.
AffectiveState$clone(deep = FALSE)
deepWhether to make a deep clone.
AgentCore
AgentCore
Minimal agent container for the agentr cognitive core.
An AgentCore combines cognitive and affective state layers and can
optionally own a Scaffolder instance for human-in-the-loop workflow
elicitation.
$initialize(id = "agentr-core", name = "agentr", cognition = CognitiveState$new(), affect = AffectiveState$new(), metadata = list())Create a minimal agent container with cognition and affect.
$attach_scaffolder(scaffolder = NULL)Attach an existing scaffolder or create a new Scaffolder owned by the agent.
$snapshot()Return a serializable snapshot of the agent's core state.
idAgent identifier.
nameHuman-readable agent name.
cognitionA CognitiveState instance.
affectAn AffectiveState instance.
scaffolderOptional Scaffolder instance.
metadataFree-form metadata list.
new()
Create an AgentCore with cognition, affect, and free-form metadata.
AgentCore$new( id = "agentr-core", name = "agentr", cognition = CognitiveState$new(), affect = AffectiveState$new(), metadata = list() )
idAgent identifier used by $initialize().
nameHuman-readable agent name used by $initialize().
cognitionA CognitiveState instance used by $initialize().
affectAn AffectiveState instance used by $initialize().
metadataFree-form metadata list used by $initialize().
attach_scaffolder()
Attach an existing scaffolder or create a new one owned by this agent.
AgentCore$attach_scaffolder(scaffolder = NULL)
scaffolderOptional Scaffolder instance used by
$attach_scaffolder().
snapshot()
Return a serializable snapshot of the agent core state.
AgentCore$snapshot()
clone()
The objects of this class are cloneable with this method.
AgentCore$clone(deep = FALSE)
deepWhether to make a deep clone.
agentr workspace pathsReturn standard agentr workspace paths
agentr_workspace_paths(workspace)agentr_workspace_paths(workspace)
workspace |
Workspace root directory. |
Named list of workspace paths.
AgentScaffoldState
AgentScaffoldState
Top-level state container for approved agent designs and nested workflow state.
$initialize(approved_agent_spec = NULL, proposal_state = list(status = "draft", proposals = list()), workflow_state = WorkflowProposalState$new(), metadata = list())Create an agent scaffold state container.
$validate()Validate the state object.
$set_approved_agent_spec(spec)Store an approved AgentSpec.
$approved_workflow()Return the approved workflow, preferring the approved agent spec when present.
$as_list()Return a serializable representation.
approved_agent_specCurrent approved AgentSpec or NULL.
proposal_stateFree-form proposal lifecycle state list.
workflow_stateA WorkflowProposalState object.
metadataFree-form metadata list.
new()
Create an agent scaffold state container.
AgentScaffoldState$new( approved_agent_spec = NULL, proposal_state = list(status = "draft", proposals = list()), workflow_state = WorkflowProposalState$new(), metadata = list() )
approved_agent_specCurrent approved AgentSpec or NULL.
proposal_stateFree-form proposal lifecycle state list.
workflow_stateA WorkflowProposalState object.
metadataFree-form metadata list.
validate()
Validate the state object.
AgentScaffoldState$validate()
set_approved_agent_spec()
Store an approved AgentSpec.
AgentScaffoldState$set_approved_agent_spec(spec)
specAgent spec used by $set_approved_agent_spec().
approved_workflow()
Return the approved workflow.
AgentScaffoldState$approved_workflow()
as_list()
Return a serializable representation.
AgentScaffoldState$as_list()
print()
Print a compact state summary.
AgentScaffoldState$print(...)
...Unused print arguments.
clone()
The objects of this class are cloneable with this method.
AgentScaffoldState$clone(deep = FALSE)
deepWhether to make a deep clone.
AgentSpec
AgentSpec
Public agent-design artifact combining workflow, memory, knowledge, state, interface, and optional subsystem diagnostic labels.
$initialize(task, agent_name = "agentr-agent", summary = NULL, subsystems = SubsystemSpec$new(), workflow = NULL, knowledge_spec = NULL, memory_spec = NULL, state_requirements = list(), state_spec = NULL, interfaces = list(), interface_spec = NULL, autonomy_spec = NULL, autonomy_stage = NULL, implementation_targets = list(), metadata = list())Create an agent-design artifact.
$validate()Validate the agent design.
$selected_subsystems()Return the selected subsystem names.
$workflow_spec()Return the embedded workflow specification.
$design_summary()Return a one-row summary table.
$as_list()Return a serializable representation.
$save(file_path)Save the object with save_agent().
taskSource task description.
agent_nameHuman-readable agent name.
summaryOne-line agent summary.
subsystemsA SubsystemSpec object.
workflowEmbedded workflow specification or NULL.
knowledge_specEmbedded KnowledgeSpec or NULL.
memory_specEmbedded MemorySpec or NULL.
state_requirementsFree-form list of state requirements.
state_specOptional structured state-spec list.
interfacesFree-form list of interfaces.
interface_specOptional structured interface-spec list.
autonomy_specOptional structured autonomy-spec list.
autonomy_stageOptional autonomy-stage label.
implementation_targetsFree-form list of implementation targets.
metadataFree-form metadata list.
new()
Create an agent-design artifact.
AgentSpec$new( task, agent_name = "agentr-agent", summary = NULL, subsystems = SubsystemSpec$new(), workflow = NULL, knowledge_spec = NULL, memory_spec = NULL, state_requirements = list(), state_spec = NULL, interfaces = list(), interface_spec = NULL, autonomy_spec = NULL, autonomy_stage = NULL, implementation_targets = list(), metadata = list() )
taskSource task description.
agent_nameHuman-readable agent name.
summaryOne-line agent summary.
subsystemsA SubsystemSpec object or list payload.
workflowEmbedded workflow specification or NULL.
knowledge_specEmbedded KnowledgeSpec or NULL.
memory_specEmbedded MemorySpec or NULL.
state_requirementsFree-form list of state requirements.
state_specOptional structured state-spec list.
interfacesFree-form list of interfaces.
interface_specOptional structured interface-spec list.
autonomy_specOptional structured autonomy-spec list.
autonomy_stageOptional autonomy-stage label.
implementation_targetsFree-form list of implementation targets.
metadataFree-form metadata list.
validate()
Validate the agent design.
AgentSpec$validate()
selected_subsystems()
Return the selected subsystem names.
AgentSpec$selected_subsystems()
workflow_spec()
Return the embedded workflow specification.
AgentSpec$workflow_spec()
design_summary()
Return a one-row summary table.
AgentSpec$design_summary()
as_list()
Return a serializable representation.
AgentSpec$as_list()
save()
Save the object with save_agent().
AgentSpec$save(file_path)
file_pathOutput path used by $save().
print()
Print a compact agent-design summary.
AgentSpec$print(...)
...Unused print arguments.
clone()
The objects of this class are cloneable with this method.
AgentSpec$clone(deep = FALSE)
deepWhether to make a deep clone.
Append a decision trace
append_decision_trace(trace, path)append_decision_trace(trace, path)
trace |
Trace list. |
path |
JSONL or RDS path. |
Invisibly returns TRUE.
Append a reflection trace
append_reflection_trace(trace, path)append_reflection_trace(trace, path)
trace |
Trace list. |
path |
JSONL or RDS path. |
Invisibly returns TRUE.
Applies feedback through existing scaffolder review/discussion mechanisms when a scaffolder is supplied. Non-workflow feedback is preserved as structured design discussion metadata; it is not auto-executed.
apply_design_feedback(x, feedback, review_spec = NULL)apply_design_feedback(x, feedback, review_spec = NULL)
x |
A |
feedback |
Feedback item or list of items. |
review_spec |
Optional review spec used for target-id warnings. |
The mutated Scaffolder object.
Apply an initial LLM response into a workspace proposal state
apply_initial_spec_message( workspace, target = c("workflow", "agent", "memory", "knowledge"), message, comment = NULL )apply_initial_spec_message( workspace, target = c("workflow", "agent", "memory", "knowledge"), message, comment = NULL )
workspace |
Workspace root directory. |
target |
Target state: workflow, agent, memory, or knowledge. |
message |
JSON string, parsed list, or path to a JSON response file. |
comment |
Optional initial task context for workflow or agent targets. |
Mutated state object.
Apply a knowledge message
apply_knowledge_message(state, message)apply_knowledge_message(state, message)
state |
A |
message |
Parsed or raw knowledge message. |
Mutated state object.
Apply a memory message
apply_memory_message(state, message)apply_memory_message(state, message)
state |
A |
message |
Parsed or raw memory message. |
Mutated state object.
This is a convenience wrapper for apply_revision_message(target = "workflow", node_id = ...). It previews the proposed node schema or nested
workflow edits and stores them as a workflow proposal; approved workflow state
is not mutated until the proposal is explicitly approved.
apply_node_detail_message(workspace, node_id, message, agent_spec_path = NULL)apply_node_detail_message(workspace, node_id, message, agent_spec_path = NULL)
workspace |
Workspace root directory. |
node_id |
Workflow node id to revise. |
message |
JSON string, parsed list, or path to a JSON response file. |
agent_spec_path |
Optional path to approved |
Preview result.
Workflow revisions are previewed and stored as proposals; approved specs are not mutated by this function.
apply_revision_message( workspace, target = c("workflow", "agent", "memory", "knowledge"), message, agent_spec_path = NULL, node_id = NULL )apply_revision_message( workspace, target = c("workflow", "agent", "memory", "knowledge"), message, agent_spec_path = NULL, node_id = NULL )
workspace |
Workspace root directory. |
target |
Target state: workflow, agent, memory, or knowledge. |
message |
JSON string, parsed list, or path to a JSON response file. |
agent_spec_path |
Optional path to approved |
node_id |
Optional workflow node id. When supplied for workflow targets, only node-detail actions for this node are accepted. |
Mutated state object or preview result.
Parses and dispatches a machine-readable scaffolder message into concrete
calls on a Scaffolder instance.
apply_scaffolder_message( scaffolder, message, allowed_methods = scaffolder_action_methods(), stop_on_error = TRUE )apply_scaffolder_message( scaffolder, message, allowed_methods = scaffolder_action_methods(), stop_on_error = TRUE )
scaffolder |
A |
message |
Parsed message list, JSON string, or path to a downloaded
|
allowed_methods |
Character vector of allowed method names. |
stop_on_error |
Whether to stop on the first action error. When |
A standardized list with applied_actions, workflow_after,
human_prompts, and errors.
Approve a workspace proposal
approve_workspace_proposal( workspace, type = c("workflow", "agent", "memory", "knowledge"), proposal_id, note = NULL, agent_spec_path = NULL )approve_workspace_proposal( workspace, type = c("workflow", "agent", "memory", "knowledge"), proposal_id, note = NULL, agent_spec_path = NULL )
workspace |
Workspace root directory. |
type |
Proposal type: workflow, agent, memory, or knowledge. |
proposal_id |
Proposal identifier. |
note |
Optional approval note. |
agent_spec_path |
Optional path to approved |
Approved proposal or spec object.
Converts the article-level JSON object produced from
build_article_workflow_extraction_prompt() into one validated workflow
specification per element of workflows.
article_workflow_specs_from_json(x)article_workflow_specs_from_json(x)
x |
Parsed list, raw JSON string, or path to a |
A named list of validated workflow specifications.
agentr object with a timestamped filenameSaves a timestamped backup of an agentr core object to a specified
directory.
backup_agent(agent, dir)backup_agent(agent, dir)
agent |
An object created by |
dir |
Backup directory. Must be supplied explicitly. |
Invisibly returns the backup file path.
Creates a prompt that targets subsystem-first agent design while keeping the workflow as a nested component inside the proposed agent specification.
build_agent_design_prompt(scaffolder, format = "json")build_agent_design_prompt(scaffolder, format = "json")
scaffolder |
A |
format |
Prompt payload format. Use |
Character string prompt.
Creates a prompt for a reasoning model to infer one or more
agentr-compatible workflow specifications from an article describing
agentic AI application cases, demonstrations, or methods.
build_article_workflow_extraction_prompt( article_context, article_title = NULL, task = NULL, case_names = NULL, extraction_mode = "both", format = "json", target_agent = "reasoning_model", extraction_goal = "Infer agentr workflow specs from article-described application cases.", constraints = character(), extra_context = list() )build_article_workflow_extraction_prompt( article_context, article_title = NULL, task = NULL, case_names = NULL, extraction_mode = "both", format = "json", target_agent = "reasoning_model", extraction_goal = "Infer agentr workflow specs from article-described application cases.", constraints = character(), extra_context = list() )
article_context |
Character string or character vector containing the article text, excerpt, URL, abstract, notes, or section summaries. |
article_title |
Optional article title. |
task |
Optional task summary for the extraction. |
case_names |
Optional case names to prioritize when extracting workflows. |
extraction_mode |
Extraction mode: |
format |
Prompt payload format. Use |
target_agent |
Target reasoning agent label. |
extraction_goal |
Optional extraction goal note. |
constraints |
Optional character vector of extraction constraints. |
extra_context |
Optional named list of additional context. |
Character string prompt.
Packages an agent design and optional proposal states into a stable, JSON-ready review bundle. This prepares the data contract for a future JS/HTML review interface; it does not render a UI.
build_design_review_data( x = NULL, workflow = NULL, memory_spec = NULL, knowledge_spec = NULL, graph_spec = NULL, workflow_state = NULL, knowledge_state = NULL, memory_state = NULL, proposal_states = list(), review_id = .design_review_id(), metadata = list() )build_design_review_data( x = NULL, workflow = NULL, memory_spec = NULL, knowledge_spec = NULL, graph_spec = NULL, workflow_state = NULL, knowledge_state = NULL, memory_state = NULL, proposal_states = list(), review_id = .design_review_id(), metadata = list() )
x |
Optional |
workflow |
Optional workflow spec overriding the workflow inferred from
|
memory_spec |
Optional |
knowledge_spec |
Optional |
graph_spec |
Optional plain graph representation overriding graph
knowledge inferred from |
workflow_state |
Optional |
knowledge_state |
Optional |
memory_state |
Optional |
proposal_states |
Additional named proposal-state snapshots. |
review_id |
Optional review bundle id. |
metadata |
Additional metadata list. |
A DesignReviewSpec object.
Creates a second-stage prompt that turns workflow scaffolding output into an implementation-oriented handoff for a coding assistant.
build_implementation_prompt( x, language, format = "json", target_agent = "coding_assistant", runtime = NULL, style = NULL, constraints = character(), extra_context = list(), include_knowledge = TRUE, knowledge_scope = c("referenced", "approved", "all") )build_implementation_prompt( x, language, format = "json", target_agent = "coding_assistant", runtime = NULL, style = NULL, constraints = character(), extra_context = list(), include_knowledge = TRUE, knowledge_scope = c("referenced", "approved", "all") )
x |
A |
language |
Target implementation language, for example |
format |
Prompt payload format. Use |
target_agent |
Target coding assistant label. |
runtime |
Optional runtime or framework note. |
style |
Optional implementation style note. |
constraints |
Optional character vector of implementation constraints. |
extra_context |
Optional named list of additional context. |
include_knowledge |
Whether approved knowledge should be included in the implementation handoff when available. |
knowledge_scope |
Knowledge-selection scope when |
Character string prompt.
Build an initial design prompt into a workspace
build_initial_spec_prompt( workspace, target = c("workflow", "agent", "memory", "knowledge"), comment, out = NULL, format = c("markdown", "json") )build_initial_spec_prompt( workspace, target = c("workflow", "agent", "memory", "knowledge"), comment, out = NULL, format = c("markdown", "json") )
workspace |
Workspace root directory. |
target |
Prompt target: workflow, agent, memory, or knowledge. |
comment |
Natural-language task or design context. |
out |
Optional output file path. |
format |
Prompt payload format. |
Output prompt path.
Build a knowledge conflict-check prompt
build_knowledge_conflict_check_prompt( knowledge_spec = NULL, candidate, format = c("markdown", "json") )build_knowledge_conflict_check_prompt( knowledge_spec = NULL, candidate, format = c("markdown", "json") )
knowledge_spec |
Existing |
candidate |
Proposed knowledge item. |
format |
Output format, |
Prompt string.
Build a knowledge design prompt
build_knowledge_design_prompt(knowledge_state, format = c("markdown", "json"))build_knowledge_design_prompt(knowledge_state, format = c("markdown", "json"))
knowledge_state |
A |
format |
Output format, |
Prompt string.
Build a knowledge elicitation prompt
build_knowledge_elicitation_prompt( context = NULL, format = c("markdown", "json") )build_knowledge_elicitation_prompt( context = NULL, format = c("markdown", "json") )
context |
Optional context text. |
format |
Output format, |
Prompt string.
Build a knowledge normalization prompt
build_knowledge_normalization_prompt( raw_statement, format = c("markdown", "json") )build_knowledge_normalization_prompt( raw_statement, format = c("markdown", "json") )
raw_statement |
Raw human knowledge statement. |
format |
Output format, |
Prompt string.
Build a memory revision prompt
build_memory_revision_prompt( memory_state, feedback = NULL, format = c("markdown", "json") )build_memory_revision_prompt( memory_state, feedback = NULL, format = c("markdown", "json") )
memory_state |
A |
feedback |
Optional human feedback text or structured list. |
format |
Output format, |
Prompt string.
Build a memory schema prompt
build_memory_schema_prompt( context = NULL, current_memory = NULL, format = c("markdown", "json") )build_memory_schema_prompt( context = NULL, current_memory = NULL, format = c("markdown", "json") )
context |
Optional context text. |
current_memory |
Optional |
format |
Output format, |
Prompt string.
Creates a constrained prompt for revising only one workflow node's interface
schema or nested workflow detail. The expected response uses
set_node_schema() and/or set_node_nested_workflow() actions.
build_node_detail_prompt( workflow, node_id, include_nested_workflow = TRUE, feedback = NULL, format = c("json", "markdown") )build_node_detail_prompt( workflow, node_id, include_nested_workflow = TRUE, feedback = NULL, format = c("json", "markdown") )
workflow |
Workflow spec containing the target node. |
node_id |
Workflow node id to revise. |
include_nested_workflow |
Whether to include existing nested workflow payload in the prompt. |
feedback |
Optional human revision feedback. |
format |
Prompt payload format. Use |
Character string prompt.
Build a revision prompt into a workspace
build_revision_prompt( workspace, target = c("workflow", "agent", "memory", "knowledge"), comment, out = NULL, agent_spec_path = NULL, node_id = NULL, format = c("markdown", "json") )build_revision_prompt( workspace, target = c("workflow", "agent", "memory", "knowledge"), comment, out = NULL, agent_spec_path = NULL, node_id = NULL, format = c("markdown", "json") )
workspace |
Workspace root directory. |
target |
Revision target: workflow, agent, memory, or knowledge. |
comment |
Human revision feedback. |
out |
Optional output file path. |
agent_spec_path |
Optional path to approved |
node_id |
Optional workflow node id. When supplied for workflow targets, the prompt is constrained to node schema and nested-workflow revision. |
format |
Prompt payload format. |
Output prompt path.
Creates a prompt that describes the scaffolder's available methods, the task context, the current workflow state, and the required machine-readable JSON response format.
build_scaffolder_prompt(scaffolder, task = NULL, format = "json")build_scaffolder_prompt(scaffolder, task = NULL, format = "json")
scaffolder |
A |
task |
Optional task text. Defaults to the scaffolder's current task. |
format |
Prompt payload format. Use |
Character string prompt.
Creates a prompt for a reasoning model to infer an agentr-compatible
workflow specification from ad hoc code, scripts, or module summaries that
already exist.
build_workflow_extraction_prompt( code_context, task = NULL, language = NULL, format = "json", target_agent = "reasoning_model", extraction_goal = "Infer a workflow specification consistent with agentr.", constraints = character(), extra_context = list() )build_workflow_extraction_prompt( code_context, task = NULL, language = NULL, format = "json", target_agent = "reasoning_model", extraction_goal = "Infer a workflow specification consistent with agentr.", constraints = character(), extra_context = list() )
code_context |
Character string or character vector describing the existing code, snippets, file summaries, or execution flow to inspect. |
task |
Optional task summary associated with the code. |
language |
Optional source-code language, for example |
format |
Prompt payload format. Use |
target_agent |
Target reasoning agent label. |
extraction_goal |
Optional extraction goal note. |
constraints |
Optional character vector of extraction constraints. |
extra_context |
Optional named list of additional context. |
Character string prompt.
This creates a prompt for a coding assistant or implementation team. It does not execute the approved design.
build_workspace_implementation_prompt( workspace, agent_spec_path = NULL, out = NULL, language = "R", target_agent = "coding_assistant", runtime = NULL, style = NULL, constraints = character(), include_knowledge = TRUE, knowledge_scope = c("referenced", "approved", "all"), format = c("markdown", "json") )build_workspace_implementation_prompt( workspace, agent_spec_path = NULL, out = NULL, language = "R", target_agent = "coding_assistant", runtime = NULL, style = NULL, constraints = character(), include_knowledge = TRUE, knowledge_scope = c("referenced", "approved", "all"), format = c("markdown", "json") )
workspace |
Workspace root directory. |
agent_spec_path |
Optional path to approved |
out |
Optional output prompt path. |
language |
Target implementation language. |
target_agent |
Target implementation agent. |
runtime |
Optional runtime note. |
style |
Optional implementation style note. |
constraints |
Character vector of implementation constraints. |
include_knowledge |
Include approved knowledge in the prompt. |
knowledge_scope |
Knowledge inclusion scope. |
format |
Prompt format. |
Output prompt path.
Creates a workflow node that represents one child task inside a parent
task-family workflow. The child task can point to a saved workflow through
subworkflow_ref and/or embed a reviewable nested_workflow.
child_task_node( id, label, subworkflow_ref = NA_character_, nested_workflow = NULL, input_schema = list(), output_schema = list(), human_required = TRUE, owner = "human", automation_status = "human_in_loop", target_automation_status = NA_character_, implementation_hint = NA_character_, rule_spec = NA_character_, knowledge_refs = character(), trace_required = NA )child_task_node( id, label, subworkflow_ref = NA_character_, nested_workflow = NULL, input_schema = list(), output_schema = list(), human_required = TRUE, owner = "human", automation_status = "human_in_loop", target_automation_status = NA_character_, implementation_hint = NA_character_, rule_spec = NA_character_, knowledge_refs = character(), trace_required = NA )
id |
Child-task node id. |
label |
Child-task label. |
subworkflow_ref |
Optional reference to a saved child workflow. |
nested_workflow |
Optional embedded child workflow. |
input_schema |
Structured input schema for the child task. |
output_schema |
Structured output schema for the child task. |
human_required |
Whether the child task requires human review. |
owner |
Current child-task owner. |
automation_status |
Current child-task automation status. |
target_automation_status |
Target automation status. |
implementation_hint |
Optional implementation hint. |
rule_spec |
Optional child-task rule. |
knowledge_refs |
Character vector of related knowledge ids. |
trace_required |
Whether trace collection is required. |
One-row workflow node data frame.
CognitiveConfig
CognitiveConfig
Lightweight configuration for the cognitive layer inside RWM.
$initialize(enabled = TRUE, persistence = "session", memory_types = character(), summary = NULL, metadata = list())Create a cognitive-layer config.
$validate()Validate the config.
$as_list()Return a serializable representation.
enabledWhether the cognitive layer is enabled.
persistencePersistence mode for cognitive state.
memory_typesCharacter vector of memory categories to keep.
summaryOptional one-line summary.
metadataFree-form metadata list.
new()
Create a cognitive-layer config.
CognitiveConfig$new( enabled = TRUE, persistence = "session", memory_types = character(), summary = NULL, metadata = list() )
enabledWhether the cognitive layer is enabled.
persistencePersistence mode for cognitive state.
memory_typesCharacter vector of memory categories to keep.
summaryOptional one-line summary.
metadataFree-form metadata list.
validate()
Validate the config.
CognitiveConfig$validate()
as_list()
Return a serializable representation.
CognitiveConfig$as_list()
print()
Print a compact config summary.
CognitiveConfig$print(...)
...Unused print arguments.
clone()
The objects of this class are cloneable with this method.
CognitiveConfig$clone(deep = FALSE)
deepWhether to make a deep clone.
CognitiveState
CognitiveState
Minimal structured cognitive layer for agent state representation.
This class intentionally provides only a lightweight API for 0.1.3.
Its bayes_update() method is a placeholder interface rather than a full
inference engine.
$initialize(beliefs = list(), knowledge = list(), goals = list(), task_context = list(), confidence = numeric(), update_log = list())Create a lightweight cognitive state container.
$set_belief(name, value, confidence = NULL)Store or update a named belief and optional confidence value.
$add_knowledge(entry, label = NULL)Append a knowledge record with timestamped provenance.
$set_goal(id, description, status = "proposed")Store or update a goal record.
$set_context(...)Merge named task-context fields into the current cognitive state.
$bayes_update(target, evidence, prior = NULL, note = NULL)Record a placeholder Bayesian-style update artifact.
$as_list()Return the cognitive state as a plain list.
$record_update(type, key, value, confidence = NULL)Append a structured update record to the update log.
beliefsNamed list of beliefs.
knowledgeList of observations, notes, or external facts.
goalsList of goal records.
task_contextFree-form task context list.
confidenceNamed numeric vector of confidence scores.
update_logList of update events.
new()
Create a CognitiveState with beliefs, knowledge, goals, and context.
CognitiveState$new( beliefs = list(), knowledge = list(), goals = list(), task_context = list(), confidence = numeric(), update_log = list() )
beliefsNamed list used by $initialize().
knowledgeList used by $initialize() and $add_knowledge().
goalsGoal list used by $initialize().
task_contextTask context list used by $initialize().
confidenceConfidence vector used by $initialize() and
$set_belief().
update_logUpdate log used by $initialize().
set_belief()
Store or update a named belief and optional confidence value.
CognitiveState$set_belief(name, value, confidence = NULL)
nameBelief name used by $set_belief().
valueBelief or update value used by $set_belief() and
$record_update().
confidenceConfidence vector used by $initialize() and
$set_belief().
add_knowledge()
Append a timestamped knowledge record to the cognitive state.
CognitiveState$add_knowledge(entry, label = NULL)
entryKnowledge entry used by $add_knowledge().
labelOptional knowledge label used by $add_knowledge().
set_goal()
Store or update a structured goal record.
CognitiveState$set_goal(id, description, status = "proposed")
idGoal identifier used by $set_goal().
descriptionGoal description used by $set_goal().
statusGoal status used by $set_goal().
set_context()
Merge named task-context fields into the current state.
CognitiveState$set_context(...)
...Named task-context updates used by $set_context().
bayes_update()
Record a placeholder Bayesian-style update artifact.
CognitiveState$bayes_update(target, evidence, prior = NULL, note = NULL)
targetUpdate target used by $bayes_update().
evidenceEvidence payload used by $bayes_update().
priorOptional prior payload used by $bayes_update().
noteOptional note used by $bayes_update().
as_list()
Return the cognitive state as a plain list.
CognitiveState$as_list()
record_update()
Append a structured update event to the update log.
CognitiveState$record_update(type, key, value, confidence = NULL)
typeUpdate type used by $record_update().
keyUpdate key used by $record_update().
valueBelief or update value used by $set_belief() and
$record_update().
confidenceConfidence vector used by $initialize() and
$set_belief().
clone()
The objects of this class are cloneable with this method.
CognitiveState$clone(deep = FALSE)
deepWhether to make a deep clone.
Extracts pending human questions from a standardized dispatch result or, if no dispatch result is supplied, from the scaffolder interaction log.
collect_scaffolder_questions(scaffolder, dispatch_result = NULL)collect_scaffolder_questions(scaffolder, dispatch_result = NULL)
scaffolder |
A |
dispatch_result |
Optional result object returned by
|
Data frame of human-facing prompts.
Combine two emotion values
combine_emotions(a, b, method = "geometric", w1 = 0.5, w2 = 0.5)combine_emotions(a, b, method = "geometric", w1 = 0.5, w2 = 0.5)
a |
First value. |
b |
Second value. |
method |
Combination method. |
w1 |
Weight for |
w2 |
Weight for |
Numeric scalar.
Compute blended emotions from primary emotions
compute_blended_emotions(primary, method = "geometric")compute_blended_emotions(primary, method = "geometric")
primary |
Named numeric vector of primary emotions. |
method |
Combination method passed to |
Named list of blended emotions.
Create a decision trace
create_decision_trace( trace_id, agent_id, workflow_node_id, context = list(), human_decision, rationale, outcome = NULL, reflection = NULL, candidate_knowledge_refs = character(), reusable_rule_candidate = TRUE )create_decision_trace( trace_id, agent_id, workflow_node_id, context = list(), human_decision, rationale, outcome = NULL, reflection = NULL, candidate_knowledge_refs = character(), reusable_rule_candidate = TRUE )
trace_id |
Trace identifier. |
agent_id |
Agent identifier. |
workflow_node_id |
Workflow node identifier. |
context |
Optional context list. |
human_decision |
Human decision text. |
rationale |
Decision rationale. |
outcome |
Optional outcome text. |
reflection |
Optional reflection text. |
candidate_knowledge_refs |
Optional candidate knowledge ids. |
reusable_rule_candidate |
Whether this trace suggests a reusable rule. |
Trace list.
Create a reflection trace
create_reflection_trace( trace_id, agent_id, workflow_node_id, reflection, outcome = NULL )create_reflection_trace( trace_id, agent_id, workflow_node_id, reflection, outcome = NULL )
trace_id |
Trace identifier. |
agent_id |
Agent identifier. |
workflow_node_id |
Workflow node identifier. |
reflection |
Reflection text. |
outcome |
Optional outcome text. |
Trace list.
Apply time-based decay to an affective state
decay_emotion_state(emotion_state, current_time = Sys.time())decay_emotion_state(emotion_state, current_time = Sys.time())
emotion_state |
State list created by |
current_time |
Reference time. |
Updated affective state list.
Initializes a minimal affective state with Plutchik-style primary dimensions, an inertia factor, and a timestamp for time-based decay.
default_emotion_state(decay_rate = 0.98, inertia = 0.85)default_emotion_state(decay_rate = 0.98, inertia = 0.85)
decay_rate |
Hourly decay rate between 0 and 1. |
inertia |
Inertia factor between 0 and 1 for incremental updates. |
A named list.
Create a randomized affective state
define_random_emotion_state( total_intensity = 1, sparsity = 0, decay_rate = 0.98, inertia = 0.85 )define_random_emotion_state( total_intensity = 1, sparsity = 0, decay_rate = 0.98, inertia = 0.85 )
total_intensity |
Total sum of primary emotion values. |
sparsity |
Proportion of primary emotions to zero out. |
decay_rate |
Hourly decay rate between 0 and 1. |
inertia |
Inertia factor between 0 and 1 for incremental updates. |
A named list.
Describe an affective state in natural language
describe_emotional_state( emotion_state, threshold = 0.2, include_blended = TRUE, method = "geometric" )describe_emotional_state( emotion_state, threshold = 0.2, include_blended = TRUE, method = "geometric" )
emotion_state |
State list created by |
threshold |
Minimum intensity required for a dominant affect label. |
include_blended |
Whether to include blended affect. |
method |
Combination method passed to |
Character string.
Feedback items are the machine-readable output expected from a future JS/HTML review layer. They are intentionally structured rather than free text so they can be routed into workflow, memory, or knowledge revision prompts.
design_feedback_item( target, field, issue, suggestion, severity = "medium", issue_type = "unclear", id = NULL, target_id = NULL, item_id = NA_character_, location = list(), status = "open", source = "human", created_at = Sys.time(), metadata = list() )design_feedback_item( target, field, issue, suggestion, severity = "medium", issue_type = "unclear", id = NULL, target_id = NULL, item_id = NA_character_, location = list(), status = "open", source = "human", created_at = Sys.time(), metadata = list() )
target |
Review target, such as |
field |
Field path or semantic field name being reviewed. |
issue |
Concise issue description. |
suggestion |
Concise suggested change. |
severity |
Severity label: |
issue_type |
Issue type. |
id |
Optional feedback id. |
target_id |
Optional target identifier, such as a node id or memory-field id. |
item_id |
Optional target item id, such as a node id or memory-field id. |
location |
Optional structured location metadata. |
status |
Feedback status. |
source |
Feedback source. |
created_at |
Creation timestamp. |
metadata |
Additional metadata list. |
A validated design-feedback item list.
Creates a standalone, offline HTML/JavaScript review page from a design review bundle or supported design object. The page is review-only: it renders design artifacts and exports structured feedback JSON, but it does not run workflow nodes, call LLM providers, or mutate saved R objects.
design_review_html( x, include_workflow = TRUE, include_knowledge = TRUE, include_memory_schema = TRUE, include_feedback_panel = TRUE, self_contained = TRUE, title = NULL, graph_layout = c("grid", "layered", "swimlane", "process"), edge_style = c("curved", "straight", "orthogonal"), node_color_theme = c("default", "subsystems"), ... )design_review_html( x, include_workflow = TRUE, include_knowledge = TRUE, include_memory_schema = TRUE, include_feedback_panel = TRUE, self_contained = TRUE, title = NULL, graph_layout = c("grid", "layered", "swimlane", "process"), edge_style = c("curved", "straight", "orthogonal"), node_color_theme = c("default", "subsystems"), ... )
x |
A |
include_workflow |
Whether to render workflow graph information. |
include_knowledge |
Whether to render narrative and graph-shaped knowledge. |
include_memory_schema |
Whether to render memory/state/interface schema. |
include_feedback_panel |
Whether to include the structured feedback form and JSON export controls. |
self_contained |
Reserved for future asset handling. The current implementation is always self-contained and uses no remote resources. |
title |
Optional page title. |
graph_layout |
Workflow graph layout. |
edge_style |
Workflow edge routing style: |
node_color_theme |
Initial node-color theme: |
... |
Additional arguments passed to |
HTML string.
DesignReviewSpec
DesignReviewSpec
Data contract for a future JS/HTML human review layer. It packages the current design artifacts into stable sections that can be rendered, commented on, and converted back into structured feedback.
$initialize(...)Create a design-review data bundle.
$validate()Validate the bundle sections.
$to_list()Return a JSON-ready list.
$print(...)Print a compact summary.
review_idReview bundle identifier.
agent_nameAgent name.
taskSource task.
generated_atBundle creation timestamp.
workflow_graphWorkflow graph section.
memory_schemaMemory schema section.
narrative_knowledgeNarrative knowledge section.
graph_knowledgeGraph-shaped knowledge section.
proposal_statesProposal-state snapshots.
feedback_schemaStructured feedback schema.
metadataFree-form metadata.
new()
Create a design-review data bundle.
DesignReviewSpec$new( review_id = .design_review_id(), agent_name = NA_character_, task = NA_character_, generated_at = Sys.time(), workflow_graph = .workflow_review_section(NULL), memory_schema = .memory_review_section(NULL), narrative_knowledge = .narrative_knowledge_review_section(NULL), graph_knowledge = .graph_knowledge_review_section(NULL), proposal_states = list(), feedback_schema = .design_review_feedback_schema(), metadata = list() )
review_idReview bundle identifier.
agent_nameAgent name.
taskSource task.
generated_atBundle creation timestamp.
workflow_graphWorkflow graph section.
memory_schemaMemory schema section.
narrative_knowledgeNarrative knowledge section.
graph_knowledgeGraph-shaped knowledge section.
proposal_statesProposal-state snapshots.
feedback_schemaStructured feedback schema.
metadataFree-form metadata.
validate()
Validate the design-review bundle.
DesignReviewSpec$validate()
to_list()
Return a JSON-ready list.
DesignReviewSpec$to_list()
print()
Print a compact summary.
DesignReviewSpec$print(...)
...Unused print arguments.
clone()
The objects of this class are cloneable with this method.
DesignReviewSpec$clone(deep = FALSE)
deepWhether to make a deep clone.
Discover task-local spec files
discover_task_specs(task_dir, docs_dir = "docs")discover_task_specs(task_dir, docs_dir = "docs")
task_dir |
Task root directory. |
docs_dir |
Documentation/spec directory relative to |
Data frame with spec type, path, and existence flag.
Export standalone design-review HTML
export_design_review_html(x, path, ...)export_design_review_html(x, path, ...)
x |
A |
path |
Output HTML path. |
... |
Arguments passed to |
Invisibly returns the normalized output path.
Export workspace design-review HTML
export_workspace_design_review( workspace, agent_spec_path = NULL, out = NULL, title = "agentr design review", graph_layout = c("grid", "layered", "swimlane", "process"), edge_style = c("curved", "straight", "orthogonal") )export_workspace_design_review( workspace, agent_spec_path = NULL, out = NULL, title = "agentr design review", graph_layout = c("grid", "layered", "swimlane", "process"), edge_style = c("curved", "straight", "orthogonal") )
workspace |
Workspace root directory. |
agent_spec_path |
Optional path to approved |
out |
Optional output HTML path. |
title |
Review title. |
graph_layout |
Workflow graph layout passed to |
edge_style |
Workflow edge style passed to |
Output HTML path.
IACConfig
IACConfig
Configuration for Inter-Agent Communication.
$initialize(enabled = TRUE, channels = character(), structured_io = TRUE, metadata = list())Create an Inter-Agent Communication config.
$validate()Validate the config.
$as_list()Return a serializable representation.
enabledWhether the subsystem is enabled.
channelsCharacter vector of communication channels.
structured_ioWhether strongly structured I/O is required.
metadataFree-form metadata list.
new()
Create an Inter-Agent Communication config.
IACConfig$new( enabled = TRUE, channels = character(), structured_io = TRUE, metadata = list() )
enabledWhether the subsystem is enabled.
channelsCharacter vector of communication channels.
structured_ioWhether strongly structured I/O is required.
metadataFree-form metadata list.
validate()
Validate the config.
IACConfig$validate()
as_list()
Return a serializable representation.
IACConfig$as_list()
print()
Print a compact config summary.
IACConfig$print(...)
...Unused print arguments.
clone()
The objects of this class are cloneable with this method.
IACConfig$clone(deep = FALSE)
deepWhether to make a deep clone.
Imports workflow JSON from a reasoning model into a workflow specification and
optionally stores it as a workflow proposal on a Scaffolder.
import_extracted_workflow( x, scaffolder = NULL, source = "model", notes = NULL, store_proposal = !is.null(scaffolder), approve = FALSE )import_extracted_workflow( x, scaffolder = NULL, source = "model", notes = NULL, store_proposal = !is.null(scaffolder), approve = FALSE )
x |
Parsed list, raw JSON string, or path to a |
scaffolder |
Optional |
source |
Proposal source used when storing on a scaffolder. |
notes |
Optional proposal notes. |
store_proposal |
Whether to store a workflow proposal when a scaffolder is supplied. |
approve |
Whether to approve the stored proposal immediately. |
A workflow specification or a list containing workflow,
proposal_id, and proposal.
inferencer is availableCheck whether inferencer is available
inferencer_available()inferencer_available()
Logical scalar.
inferencer
Returns a lightweight descriptor rather than a duplicated provider client.
inferencer_integration(profile = NULL, prompt_template = NULL)inferencer_integration(profile = NULL, prompt_template = NULL)
profile |
Optional integration profile name. |
prompt_template |
Optional prompt template identifier. |
Named list.
agentr workspaceInitialize proposal-state artifacts for an agentr workspace
init_agentr_proposal_states(workspace, agent_spec_path = NULL)init_agentr_proposal_states(workspace, agent_spec_path = NULL)
workspace |
Workspace root directory. |
agent_spec_path |
Optional path to an approved |
Named list containing initialized state objects.
agentr lifecycle workspaceCreates workspace-scoped directories for specs, proposal states, prompts, reviews, traces, responses, and handoff prompts. It does not seed domain-specific content.
init_agentr_workspace(workspace, comment = NULL, create_readme = TRUE)init_agentr_workspace(workspace, comment = NULL, create_readme = TRUE)
workspace |
Workspace root directory. |
comment |
Optional workspace note. |
create_readme |
Whether to create a minimal workspace README. |
Named list of created workspace paths.
IntelligentAgent
IntelligentAgent
Runtime-oriented container for an approved agent design.
$initialize(id = "intelligent-agent", name = NULL, spec, workflow = NULL, subsystems = NULL, runtime_state = list(), metadata = list())Create a runtime-oriented agent container from an AgentSpec.
$validate()Validate the runtime container.
$selected_subsystems()Return the selected subsystem names.
$snapshot()Return a serializable runtime snapshot.
idRuntime identifier.
nameHuman-readable agent name.
specAn AgentSpec object.
workflowCurrent workflow specification.
subsystemsSelected SubsystemSpec object.
runtime_stateFree-form runtime state list.
metadataFree-form metadata list.
new()
Create a runtime-oriented agent container from an AgentSpec.
IntelligentAgent$new( id = "intelligent-agent", name = NULL, spec, workflow = NULL, subsystems = NULL, runtime_state = list(), metadata = list() )
idRuntime identifier.
nameHuman-readable agent name.
specAn AgentSpec object.
workflowCurrent workflow specification.
subsystemsSelected SubsystemSpec object.
runtime_stateFree-form runtime state list.
metadataFree-form metadata list.
validate()
Validate the runtime container.
IntelligentAgent$validate()
selected_subsystems()
Return the selected subsystem names.
IntelligentAgent$selected_subsystems()
snapshot()
Return a serializable runtime snapshot.
IntelligentAgent$snapshot()
print()
Print a compact runtime summary.
IntelligentAgent$print(...)
...Unused print arguments.
clone()
The objects of this class are cloneable with this method.
IntelligentAgent$clone(deep = FALSE)
deepWhether to make a deep clone.
List LLM-callable knowledge methods
knowledge_action_methods()knowledge_action_methods()
Character vector of allowed knowledge methods.
agentr treats graph structure as a representation shape rather than as a
separate first-class spec. This helper returns graph-ready node and edge data
from a KnowledgeSpec, MemorySpec, or plain list(nodes, edges, metadata) graph representation.
knowledge_graph_data(x)knowledge_graph_data(x)
x |
A |
A list with nodes, edges, and metadata.
This is a compatibility-oriented alias for knowledge_graph_data(). It no
longer returns a separate KnowledgeGraphSpec; graph is now a representation
shape embedded in knowledge or memory specs.
knowledge_graph_from_spec(x)knowledge_graph_from_spec(x)
x |
A |
A list with graph-ready nodes, edges, and metadata.
KnowledgeProposal
KnowledgeProposal
Proposal object for one candidate knowledge item.
idProposal identifier.
itemProposed knowledge item.
statusProposal status.
notesOptional notes.
conflict_reportOptional conflict report.
historyLifecycle history.
metadataFree-form metadata.
new()
Create a knowledge proposal.
KnowledgeProposal$new(
item,
id = if (is.list(item) && !is.null(item$id)) paste0("knowledge_proposal_",
as.character(item$id)[1]) else "knowledge_proposal_1",
status = "pending",
notes = NULL,
conflict_report = list(),
history = list(),
metadata = list(),
created_at = Sys.time(),
updated_at = created_at,
approved_at = as.POSIXct(NA),
rejected_at = as.POSIXct(NA),
superseded_by = NA_character_,
supersedes = NA_character_
)validate()
Validate the proposal.
KnowledgeProposal$validate()
discuss()
Append a discussion note.
KnowledgeProposal$discuss( note, source = "human", confidence = NA_character_, timestamp = Sys.time() )
transition()
Apply a status transition.
KnowledgeProposal$transition(status, note = NULL, timestamp = Sys.time())
approve()
Approve the proposal.
KnowledgeProposal$approve(note = NULL)
reject()
Reject the proposal.
KnowledgeProposal$reject(note = NULL)
to_list()
Return a serializable representation.
KnowledgeProposal$to_list()
print()
Print a compact summary.
KnowledgeProposal$print(...)
clone()
The objects of this class are cloneable with this method.
KnowledgeProposal$clone(deep = FALSE)
deepWhether to make a deep clone.
KnowledgeProposalState
KnowledgeProposalState
State container for approved knowledge plus active and historical proposals.
approved_knowledge_specApproved KnowledgeSpec.
proposalsNamed list of KnowledgeProposal objects.
historyProposal-state history.
new()
Create a knowledge proposal state container.
KnowledgeProposalState$new( approved_knowledge_spec = KnowledgeSpec$new(), proposals = list(), history = list() )
validate()
Validate the state object.
KnowledgeProposalState$validate()
add_proposal()
Add a proposal object.
KnowledgeProposalState$add_proposal(proposal)
get_proposal()
Return one stored proposal.
KnowledgeProposalState$get_proposal(proposal_id)
list_proposals()
List proposals with optional status filtering.
KnowledgeProposalState$list_proposals(status = NULL)
discuss_proposal()
Append a discussion note to one proposal.
KnowledgeProposalState$discuss_proposal(proposal_id, note, source = "human")
approve_proposal()
Approve one proposal and add its item to approved knowledge.
KnowledgeProposalState$approve_proposal(proposal_id, note = NULL)
reject_proposal()
Reject one proposal.
KnowledgeProposalState$reject_proposal(proposal_id, note = NULL)
approved_spec()
Return the approved knowledge specification.
KnowledgeProposalState$approved_spec()
as_list()
Return a serializable representation.
KnowledgeProposalState$as_list()
clone()
The objects of this class are cloneable with this method.
KnowledgeProposalState$clone(deep = FALSE)
deepWhether to make a deep clone.
KnowledgeSpec
KnowledgeSpec
Curated domain and epistemic knowledge used to guide agent behavior.
items stores narrative knowledge items, graph stores an optional
graph-shaped representation, and vector_refs reserves references to
external vector stores.
$initialize(items = list(), graph = NULL, vector_refs = list(), metadata = list())Create a knowledge specification.
$add_item(item)Add a narrative knowledge item.
$get_item(id)Return a narrative knowledge item by id.
$list_items(type = NULL, domain = NULL)List narrative knowledge items, optionally filtered.
$validate()Validate the knowledge specification.
$to_list()Return a serializable list.
$print(...)Print a compact summary.
itemsNamed list of narrative knowledge items.
graphOptional graph representation list with nodes and edges.
vector_refsList of external vector-knowledge references.
metadataFree-form metadata list.
new()
Create a knowledge specification.
KnowledgeSpec$new( items = list(), graph = NULL, vector_refs = list(), metadata = list() )
itemsList of narrative knowledge items.
graphOptional graph representation list with nodes and edges.
vector_refsList of external vector-knowledge references.
metadataFree-form metadata list.
add_item()
Add a knowledge item.
KnowledgeSpec$add_item(item)
itemKnowledge item used by $add_item().
get_item()
Return a knowledge item by id.
KnowledgeSpec$get_item(id)
idKnowledge item id used by $get_item().
list_items()
List knowledge items with optional filters.
KnowledgeSpec$list_items(type = NULL, domain = NULL)
typeOptional knowledge type filter used by $list_items().
domainOptional domain filter used by $list_items().
validate()
Validate the knowledge specification.
KnowledgeSpec$validate()
to_list()
Return a serializable representation.
KnowledgeSpec$to_list()
print()
Print a compact summary.
KnowledgeSpec$print(...)
...Unused print arguments.
clone()
The objects of this class are cloneable with this method.
KnowledgeSpec$clone(deep = FALSE)
deepWhether to make a deep clone.
LAConfig
LAConfig
Configuration for Learning & Adaptation.
$initialize(enabled = TRUE, learning_mode = "feedback_driven", feedback_sources = character(), persistence = "session", metadata = list())Create a learning and adaptation config.
$validate()Validate the config.
$as_list()Return a serializable representation.
enabledWhether the subsystem is enabled.
learning_modeLearning-mode label.
feedback_sourcesCharacter vector of feedback sources.
persistencePersistence mode for learned artifacts.
metadataFree-form metadata list.
new()
Create a learning and adaptation config.
LAConfig$new( enabled = TRUE, learning_mode = "feedback_driven", feedback_sources = character(), persistence = "session", metadata = list() )
enabledWhether the subsystem is enabled.
learning_modeLearning-mode label.
feedback_sourcesCharacter vector of feedback sources.
persistencePersistence mode for learned artifacts.
metadataFree-form metadata list.
validate()
Validate the config.
LAConfig$validate()
as_list()
Return a serializable representation.
LAConfig$as_list()
print()
Print a compact config summary.
LAConfig$print(...)
...Unused print arguments.
clone()
The objects of this class are cloneable with this method.
LAConfig$clone(deep = FALSE)
deepWhether to make a deep clone.
List workspace proposals
list_workspace_proposals( workspace, type = c("workflow", "agent", "memory", "knowledge"), status = NULL )list_workspace_proposals( workspace, type = c("workflow", "agent", "memory", "knowledge"), status = NULL )
workspace |
Workspace root directory. |
type |
Proposal type: workflow, agent, memory, or knowledge. |
status |
Optional status filter. |
Data frame summary.
agentr object from a fileLoads an agentr core object from a saved .rds file.
load_agent(file_path)load_agent(file_path)
file_path |
File path from which to load the object. |
An object created by agentr.
AgentSpec from a fileLoads a saved AgentSpec object from an .rds file.
load_agent_spec(file_path)load_agent_spec(file_path)
file_path |
File path from which to load the object. |
An AgentSpec object.
Load structured design feedback
load_design_feedback(path)load_design_feedback(path)
path |
Input |
A design-feedback item or list of items.
Load a design-review specification
load_design_review_spec(path)load_design_review_spec(path)
path |
Input |
A DesignReviewSpec object.
Load a JSON file
load_json_file(path, simplifyVector = TRUE)load_json_file(path, simplifyVector = TRUE)
path |
Path to a JSON file. |
simplifyVector |
Passed to |
Parsed JSON content.
Load a knowledge proposal
load_knowledge_proposal(path)load_knowledge_proposal(path)
path |
File path. |
A KnowledgeProposal object.
Load a knowledge specification
load_knowledge_spec(path, format = c("rds", "json", "yaml"))load_knowledge_spec(path, format = c("rds", "json", "yaml"))
path |
File path. |
format |
File format, either |
A KnowledgeSpec object.
Load a knowledge specification from JSON
load_knowledge_spec_json(path)load_knowledge_spec_json(path)
path |
File path. |
A KnowledgeSpec object.
Load a knowledge specification from YAML
load_knowledge_spec_yaml(path)load_knowledge_spec_yaml(path)
path |
File path. |
A KnowledgeSpec object.
MemorySpec from a fileLoads a saved MemorySpec object from an .rds, .json, or .yaml
file.
load_memory_spec(file_path, format = c("rds", "json", "yaml"))load_memory_spec(file_path, format = c("rds", "json", "yaml"))
file_path |
File path from which to load the object. |
format |
File format, either |
A MemorySpec object.
MemorySpec from JSONLoad a MemorySpec from JSON
load_memory_spec_json(file_path)load_memory_spec_json(file_path)
file_path |
File path from which to load the JSON. |
A MemorySpec object.
MemorySpec from YAMLLoad a MemorySpec from YAML
load_memory_spec_yaml(file_path)load_memory_spec_yaml(file_path)
file_path |
File path from which to load the YAML. |
A MemorySpec object.
SubsystemSpec from a fileLoads a saved SubsystemSpec object from an .rds file.
load_subsystem_spec(file_path)load_subsystem_spec(file_path)
file_path |
File path from which to load the object. |
A SubsystemSpec object.
Loads conventional task-local YAML specs when present. Missing specs are
returned as NULL unless missing = "error" is requested.
load_task_specs(task_dir, docs_dir = "docs", missing = c("null", "error"))load_task_specs(task_dir, docs_dir = "docs", missing = c("null", "error"))
task_dir |
Task root directory. |
docs_dir |
Documentation/spec directory relative to |
missing |
How to handle missing spec files. |
Named list containing loaded specs, path metadata, and discovery manifest.
Loads a previously saved workflow proposal from an .rds file.
load_workflow_proposal(file_path)load_workflow_proposal(file_path)
file_path |
File path from which to load the proposal. |
Workflow proposal object.
Load a workflow specification
load_workflow_spec(file_path, format = c("rds", "json", "yaml"))load_workflow_spec(file_path, format = c("rds", "json", "yaml"))
file_path |
File path from which to load the workflow. |
format |
File format, either |
Workflow specification.
Load a workflow specification from JSON
load_workflow_spec_json(file_path)load_workflow_spec_json(file_path)
file_path |
File path from which to load the workflow JSON. |
Workflow specification.
Load a workflow specification from YAML
load_workflow_spec_yaml(file_path)load_workflow_spec_yaml(file_path)
file_path |
File path from which to load the workflow YAML. |
Workflow specification.
Load a YAML file
load_yaml_file(path)load_yaml_file(path)
path |
Path to a YAML file. |
Parsed YAML content.
Mark a workflow node as agent-owned
mark_node_agent_owned(workflow, node_id)mark_node_agent_owned(workflow, node_id)
workflow |
Workflow specification. |
node_id |
Node identifier. |
Updated workflow specification.
Mark a workflow node as human-owned
mark_node_human_owned( workflow, node_id, reason, target_automation_status = NULL, trace_required = TRUE )mark_node_human_owned( workflow, node_id, reason, target_automation_status = NULL, trace_required = TRUE )
workflow |
Workflow specification. |
node_id |
Node identifier. |
reason |
Human-owned reason. |
target_automation_status |
Optional target automation status. |
trace_required |
Whether traces are required. |
Updated workflow specification.
List LLM-callable memory methods
memory_action_methods()memory_action_methods()
Character vector of allowed memory methods.
Create a memory field record
memory_field( id, label, memory_type = c("context", "semantic", "episodic", "procedural"), description = NA_character_, schema = list(), persistence = c("session", "cold_start_rds", "jsonl_trace", "external_store", "none"), update_policy = list(), source = NA_character_, review = list(status = "draft"), provenance = list(), metadata = list() )memory_field( id, label, memory_type = c("context", "semantic", "episodic", "procedural"), description = NA_character_, schema = list(), persistence = c("session", "cold_start_rds", "jsonl_trace", "external_store", "none"), update_policy = list(), source = NA_character_, review = list(status = "draft"), provenance = list(), metadata = list() )
id |
Memory field identifier. |
label |
Human-readable field label. |
memory_type |
Memory type: |
description |
Optional field description. |
schema |
Structured schema constraints for the field. |
persistence |
Persistence policy. |
update_policy |
Free-form update-policy description or list. |
source |
Optional source label. |
review |
Review metadata list. |
provenance |
Provenance metadata list. |
metadata |
Additional metadata list. |
A validated memory field list.
Memory persistence policies
memory_persistence_policies()memory_persistence_policies()
Character vector of supported memory persistence policies.
Converts memory fields and their optional schema shapes into graph-ready node and edge data. This is a design-review projection of memory structure, not a runtime memory store.
memory_schema_graph_data(x, include_field_schemas = TRUE)memory_schema_graph_data(x, include_field_schemas = TRUE)
x |
A |
include_field_schemas |
Whether to include nested schema-shape nodes for
each memory field's |
A list with vertices and edges data frames.
Memory types
memory_types()memory_types()
Character vector of supported memory type labels.
MemoryProposal
MemoryProposal
Proposal object for a candidate memory schema.
idProposal identifier.
memory_specProposed MemorySpec.
statusProposal status.
notesOptional notes.
historyLifecycle history.
metadataFree-form metadata.
created_atCreation timestamp.
updated_atLast update timestamp.
approved_atApproval timestamp, or NA.
rejected_atRejection timestamp, or NA.
superseded_byProposal identifier that superseded this proposal, or NA.
supersedesProposal identifier superseded by this proposal, or NA.
new()
Create a memory proposal.
MemoryProposal$new(
memory_spec,
id = paste0("memory_proposal_", format(Sys.time(), "%Y%m%d%H%M%S")),
status = "pending",
notes = NULL,
history = list(),
metadata = list(),
created_at = Sys.time(),
updated_at = created_at,
approved_at = as.POSIXct(NA),
rejected_at = as.POSIXct(NA),
superseded_by = NA_character_,
supersedes = NA_character_
)memory_specProposed MemorySpec or serializable memory-spec list.
idProposal identifier.
statusProposal status.
notesOptional proposal notes.
historyLifecycle history entries.
metadataFree-form metadata.
created_atCreation timestamp.
updated_atLast update timestamp.
approved_atApproval timestamp, or NA.
rejected_atRejection timestamp, or NA.
superseded_byProposal identifier that superseded this proposal, or NA.
supersedesProposal identifier superseded by this proposal, or NA.
validate()
Validate the proposal.
MemoryProposal$validate()
discuss()
Append a discussion note.
MemoryProposal$discuss( note, source = "human", confidence = NA_character_, timestamp = Sys.time() )
noteDiscussion or transition note.
sourceDiscussion source.
confidenceOptional confidence label.
timestampEvent timestamp.
transition()
Apply a lifecycle transition.
MemoryProposal$transition(status, note = NULL, timestamp = Sys.time())
statusProposal status.
noteDiscussion or transition note.
timestampEvent timestamp.
approve()
Approve the proposal.
MemoryProposal$approve(note = NULL)
noteDiscussion or transition note.
reject()
Reject the proposal.
MemoryProposal$reject(note = NULL)
noteDiscussion or transition note.
to_list()
Return a serializable representation.
MemoryProposal$to_list()
print()
Print a compact summary.
MemoryProposal$print(...)
...Unused.
clone()
The objects of this class are cloneable with this method.
MemoryProposal$clone(deep = FALSE)
deepWhether to make a deep clone.
MemoryProposalState
MemoryProposalState
State container for approved memory schema plus candidate proposals.
approved_memory_specApproved MemorySpec.
proposalsNamed list of MemoryProposal objects.
historyProposal-state history.
new()
Create a memory proposal state container.
MemoryProposalState$new( approved_memory_spec = MemorySpec$new(), proposals = list(), history = list() )
approved_memory_specApproved MemorySpec or serializable memory-spec list.
proposalsInitial proposals.
historyProposal-state history.
validate()
Validate the state object.
MemoryProposalState$validate()
add_proposal()
Add a proposal.
MemoryProposalState$add_proposal(proposal)
proposalMemoryProposal object or serializable proposal record.
get_proposal()
Return one proposal.
MemoryProposalState$get_proposal(proposal_id)
proposal_idProposal identifier.
list_proposals()
List proposals with optional status filtering.
MemoryProposalState$list_proposals(status = NULL)
statusOptional status filter.
discuss_proposal()
Discuss one proposal.
MemoryProposalState$discuss_proposal(proposal_id, note, source = "human")
proposal_idProposal identifier.
noteDiscussion or transition note.
sourceDiscussion source.
approve_proposal()
Approve one proposal and replace the approved memory spec.
MemoryProposalState$approve_proposal(proposal_id, note = NULL)
proposal_idProposal identifier.
noteDiscussion or transition note.
reject_proposal()
Reject one proposal.
MemoryProposalState$reject_proposal(proposal_id, note = NULL)
proposal_idProposal identifier.
noteDiscussion or transition note.
approved_spec()
Return the approved memory specification.
MemoryProposalState$approved_spec()
as_list()
Return a serializable representation.
MemoryProposalState$as_list()
clone()
The objects of this class are cloneable with this method.
MemoryProposalState$clone(deep = FALSE)
deepWhether to make a deep clone.
MemorySpec
MemorySpec
First-class memory schema for an agent design. MemorySpec records which
memory fields exist, what type of memory they represent, how they persist
across cold-start runs, and how they are expected to update. It can also
carry an optional graph-shaped representation of memory relationships.
$initialize(fields = list(), graph = NULL, metadata = list())Create a memory specification.
$add_field(field)Add one memory field.
$get_field(id)Return one memory field by id.
$list_fields(memory_type = NULL, persistence = NULL)Return memory fields, optionally filtered.
$validate()Validate the memory specification.
$to_list()Return a serializable list.
$print(...)Print a compact summary.
fieldsNamed list of memory field records.
graphOptional graph representation list with nodes and edges.
metadataFree-form metadata list.
new()
Create a memory specification.
MemorySpec$new(fields = list(), graph = NULL, metadata = list())
fieldsList of memory field records.
graphOptional graph representation list with nodes and edges.
metadataFree-form metadata list.
add_field()
Add one memory field.
MemorySpec$add_field(field)
fieldMemory field record used by $add_field().
get_field()
Return one memory field by id.
MemorySpec$get_field(id)
idMemory field id used by $get_field().
list_fields()
Return memory fields, optionally filtered by type or persistence policy.
MemorySpec$list_fields(memory_type = NULL, persistence = NULL)
memory_typeOptional memory type filter used by $list_fields().
persistenceOptional persistence-policy filter used by $list_fields().
validate()
Validate the memory specification.
MemorySpec$validate()
to_list()
Return a serializable list.
MemorySpec$to_list()
print()
Print a compact memory schema summary.
MemorySpec$print(...)
...Unused print arguments.
clone()
The objects of this class are cloneable with this method.
MemorySpec$clone(deep = FALSE)
deepWhether to make a deep clone.
Convenience constructor matching the public plan API.
new_design_review_spec(...)new_design_review_spec(...)
... |
Arguments passed to |
A DesignReviewSpec object.
Creates a root workflow whose nodes are child tasks. By default the root workflow has no edges because sibling child tasks are interpreted as independent unless explicit dependencies are supplied.
new_task_family_workflow( id, label, objective, nodes = .empty_workflow_nodes(), edges = .empty_workflow_edges(), shared_inputs = character(), shared_review_concerns = character(), task_tags = list(), metadata = list() )new_task_family_workflow( id, label, objective, nodes = .empty_workflow_nodes(), edges = .empty_workflow_edges(), shared_inputs = character(), shared_review_concerns = character(), task_tags = list(), metadata = list() )
id |
Task-family identifier. |
label |
Task-family label. |
objective |
Family-level objective. |
nodes |
Data frame of child-task nodes. |
edges |
Optional root-level dependency edges among child tasks. |
shared_inputs |
Character vector of shared input names. |
shared_review_concerns |
Character vector of shared review concerns. |
task_tags |
Optional named list mapping child-task ids to tags. |
metadata |
Additional root workflow metadata. |
agentr_workflow_spec.
Workflow specifications are outputs of reasoning and scaffolding rather than fixed package logic. The object captures DAG-like workflow structure and the minimal metadata needed for downstream implementation translation.
new_workflow_spec( nodes = workflow_node("task", "Task"), edges = data.frame(from = character(), to = character(), relation = character(), stringsAsFactors = FALSE), task = NULL, metadata = list() )new_workflow_spec( nodes = workflow_node("task", "Task"), edges = data.frame(from = character(), to = character(), relation = character(), stringsAsFactors = FALSE), task = NULL, metadata = list() )
nodes |
Data frame of workflow nodes. |
edges |
Data frame of workflow edges. |
task |
Optional source task text. |
metadata |
Additional metadata list. |
An object of class agentr_workflow_spec.
Accepts canonical subsystem keys and legacy mixed-case variants, then returns
the canonical keys used throughout agentr.
normalize_subsystem_key(x)normalize_subsystem_key(x)
x |
Character vector of subsystem keys. |
Character vector containing canonical subsystem keys.
Parse design feedback JSON
parse_design_feedback_json(x)parse_design_feedback_json(x)
x |
JSON string, parsed list, or |
A list of validated design-feedback items.
Parse a knowledge message
parse_knowledge_message(x)parse_knowledge_message(x)
x |
JSON string, parsed list, or |
Parsed knowledge message list.
Parse a memory message
parse_memory_message(x)parse_memory_message(x)
x |
JSON string, parsed list, or |
Parsed memory message list.
Parses a machine-readable scaffolder message from JSON text or a .json
file path into an R list.
parse_scaffolder_message(text)parse_scaffolder_message(text)
text |
Character string containing JSON or a path to a |
Parsed list.
PGConfig
PGConfig
Configuration for the Perception & Grounding subsystem.
$initialize(enabled = TRUE, planning_mode = "task_decomposition", decomposition_style = "dag", metadata = list())Create a Perception & Grounding config. Legacy field names are preserved for compatibility.
$validate()Validate the config.
$as_list()Return a serializable representation.
enabledWhether the subsystem is enabled.
planning_modeLegacy field name retained for compatibility; interpreted as a grounding/perception mode label.
decomposition_styleLegacy field name retained for compatibility; interpreted as a representation-structuring style.
metadataFree-form metadata list.
new()
Create a Perception & Grounding config.
PGConfig$new( enabled = TRUE, planning_mode = "task_decomposition", decomposition_style = "dag", metadata = list() )
enabledWhether the subsystem is enabled.
planning_modePlanning mode label.
decomposition_styleWorkflow decomposition style.
metadataFree-form metadata list.
validate()
Validate the config.
PGConfig$validate()
as_list()
Return a serializable representation.
PGConfig$as_list()
print()
Print a compact config summary.
PGConfig$print(...)
...Unused print arguments.
clone()
The objects of this class are cloneable with this method.
PGConfig$clone(deep = FALSE)
deepWhether to make a deep clone.
Plot a graph-shaped knowledge or memory representation
plot_knowledge_graph( x, rankdir = "TB", label_width = 28, show_edge_labels = TRUE, show_tooltips = FALSE )plot_knowledge_graph( x, rankdir = "TB", label_width = 28, show_edge_labels = TRUE, show_tooltips = FALSE )
x |
A |
rankdir |
Graphviz rank direction, for example |
label_width |
Approximate wrapping width for node labels. |
show_edge_labels |
Whether to show edge relation labels. |
show_tooltips |
Whether to include Graphviz tooltip attributes. |
A DiagrammeR graph object.
Creates a DiagrammeR graph from a workflow. This is preferred over base
igraph plotting for readable workflow DAG visualization.
plot_workflow_graph( x, rankdir = "TB", label_width = 28, show_edge_labels = FALSE, show_tooltips = FALSE, same_rank = NULL )plot_workflow_graph( x, rankdir = "TB", label_width = 28, show_edge_labels = FALSE, show_tooltips = FALSE, same_rank = NULL )
x |
A workflow specification or a |
rankdir |
Graphviz rank direction, for example |
label_width |
Approximate wrapping width for node labels. |
show_edge_labels |
Whether to show edge relation labels. |
show_tooltips |
Whether to include Graphviz tooltip attributes. Defaults
to |
same_rank |
Optional list of node-id character vectors to keep at the same Graphviz rank. |
A DiagrammeR graph object.
Preview design feedback application
preview_design_feedback(x, feedback, review_spec = NULL)preview_design_feedback(x, feedback, review_spec = NULL)
x |
A |
feedback |
Feedback item or list of items. |
review_spec |
Optional review spec used for target-id warnings. |
A non-mutating preview list.
Preview a knowledge message
preview_knowledge_message(state, message)preview_knowledge_message(state, message)
state |
A |
message |
Parsed or raw knowledge message. |
Preview list.
Preview a memory message
preview_memory_message(state, message)preview_memory_message(state, message)
state |
A |
message |
Parsed or raw memory message. |
Preview list.
Applies a message to a deep clone of the scaffolder, returns the preview result, and optionally stores the resulting workflow as a proposal on the original scaffolder for later approval or discussion.
preview_scaffolder_message( scaffolder, message, allowed_methods = scaffolder_action_methods(), stop_on_error = TRUE, store_proposal = TRUE, source = "model", proposal_notes = NULL )preview_scaffolder_message( scaffolder, message, allowed_methods = scaffolder_action_methods(), stop_on_error = TRUE, store_proposal = TRUE, source = "model", proposal_notes = NULL )
scaffolder |
A |
message |
Parsed message list, JSON string, or path to a downloaded
|
allowed_methods |
Character vector of allowed method names. |
stop_on_error |
Whether to stop on the first action error. When |
store_proposal |
Whether to store the previewed workflow as a proposal on the original scaffolder. |
source |
Proposal source label used when storing a proposal. |
proposal_notes |
Optional proposal notes. Defaults to top-level
|
A standardized list with proposal_id, proposal, preview_dispatch,
workflow_after, human_prompts, and errors.
Format a workflow proposal
## S3 method for class 'agentr_workflow_proposal' print(x, ...)## S3 method for class 'agentr_workflow_proposal' print(x, ...)
x |
Workflow proposal object. |
... |
Unused. |
Format a workflow specification
## S3 method for class 'agentr_workflow_spec' print(x, ...)## S3 method for class 'agentr_workflow_spec' print(x, ...)
x |
Workflow specification. |
... |
Unused. |
Read decision traces
read_decision_traces(path)read_decision_traces(path)
path |
JSONL or RDS path. |
List of traces.
Read reflection traces
read_reflection_traces(path)read_reflection_traces(path)
path |
JSONL or RDS path. |
List of traces.
Reject a workspace proposal
reject_workspace_proposal( workspace, type = c("workflow", "agent", "memory", "knowledge"), proposal_id, note = NULL )reject_workspace_proposal( workspace, type = c("workflow", "agent", "memory", "knowledge"), proposal_id, note = NULL )
workspace |
Workspace root directory. |
type |
Proposal type: workflow, agent, memory, or knowledge. |
proposal_id |
Proposal identifier. |
note |
Optional rejection note. |
Rejected proposal.
This helper renders graph-shaped knowledge or memory. It accepts a
KnowledgeSpec, MemorySpec, or plain list(nodes, edges, metadata)
graph representation. It does not require or create a separate graph spec.
render_knowledge_graphviz( x, rankdir = "TB", as = c("dot", "diagrammer", "svg"), label_width = 28, show_edge_labels = TRUE, show_tooltips = FALSE )render_knowledge_graphviz( x, rankdir = "TB", as = c("dot", "diagrammer", "svg"), label_width = 28, show_edge_labels = TRUE, show_tooltips = FALSE )
x |
A |
rankdir |
Graphviz rank direction, for example |
as |
Output format: raw |
label_width |
Approximate wrapping width for node labels. |
show_edge_labels |
Whether to show edge relation labels. |
show_tooltips |
Whether to include Graphviz tooltip attributes. |
A Graphviz DOT string, DiagrammeR graph object, or SVG string.
Render markdown-like text for terminal output
render_markdown_terminal(txt)render_markdown_terminal(txt)
txt |
Character string. |
Rendered character string with ANSI styling.
Renders memory fields and, optionally, the schema shape of each field. The output is for inspection and review of memory design, not runtime memory execution.
render_memory_schema_graphviz( x, include_field_schemas = TRUE, rankdir = "TB", as = c("dot", "diagrammer", "svg"), label_width = 28, show_edge_labels = TRUE, show_tooltips = FALSE )render_memory_schema_graphviz( x, include_field_schemas = TRUE, rankdir = "TB", as = c("dot", "diagrammer", "svg"), label_width = 28, show_edge_labels = TRUE, show_tooltips = FALSE )
x |
A |
include_field_schemas |
Whether to include nested schema-shape nodes for
each memory field's |
rankdir |
Graphviz rank direction, for example |
as |
Output format: raw |
label_width |
Approximate wrapping width for node labels. |
show_edge_labels |
Whether to show edge relation labels. |
show_tooltips |
Whether to include Graphviz tooltip attributes. |
A Graphviz DOT string, DiagrammeR graph object, or SVG string.
Renders a structural preview of a nested schema object, such as a workflow
node's input_schema or output_schema.
render_schema_shape_graphviz( x, root_id = "schema", root_label = "schema", rankdir = "TB", as = c("dot", "diagrammer", "svg"), label_width = 28, show_edge_labels = TRUE, show_tooltips = FALSE )render_schema_shape_graphviz( x, root_id = "schema", root_label = "schema", rankdir = "TB", as = c("dot", "diagrammer", "svg"), label_width = 28, show_edge_labels = TRUE, show_tooltips = FALSE )
x |
Schema object to inspect. |
root_id |
Root node identifier. |
root_label |
Human-readable root node label. |
rankdir |
Graphviz rank direction, for example |
as |
Output format: raw |
label_width |
Approximate wrapping width for node labels. |
show_edge_labels |
Whether to show edge relation labels. |
show_tooltips |
Whether to include Graphviz tooltip attributes. |
A Graphviz DOT string, DiagrammeR graph object, or SVG string.
Loads conventional task-local YAML specs and renders docs/review.html.
When present, memory and narrative knowledge specs are included alongside the
workflow graph. Graph-shaped knowledge is read from knowledge_spec.yaml
when present.
render_task_preview( task_dir, docs_dir = "docs", out = NULL, title = NULL, require_workflow = TRUE, graph_layout = c("grid", "layered", "swimlane", "process"), edge_style = c("curved", "straight", "orthogonal"), node_color_theme = c("default", "subsystems"), ... )render_task_preview( task_dir, docs_dir = "docs", out = NULL, title = NULL, require_workflow = TRUE, graph_layout = c("grid", "layered", "swimlane", "process"), edge_style = c("curved", "straight", "orthogonal"), node_color_theme = c("default", "subsystems"), ... )
task_dir |
Task root directory. |
docs_dir |
Documentation/spec directory relative to |
out |
Optional output HTML path. Defaults to |
title |
Optional review title. Defaults to the workflow task title, then the task directory name. |
require_workflow |
Whether |
graph_layout |
Workflow graph layout passed to
|
edge_style |
Workflow edge style passed to |
node_color_theme |
Initial node-color theme passed to
|
... |
Additional arguments passed to |
Invisibly returns the normalized output HTML path.
Scans a workspace for workflow_spec.yaml files under task-local docs/
directories and renders one review HTML file per discovered task. This helper
only loads specs and writes review artifacts; it does not execute task code.
render_task_previews( root, tasks_dir = "tasks", docs_dir = "docs", recursive = TRUE, require_workflow = TRUE, ... )render_task_previews( root, tasks_dir = "tasks", docs_dir = "docs", recursive = TRUE, require_workflow = TRUE, ... )
root |
Workspace root directory. |
tasks_dir |
Tasks directory relative to |
docs_dir |
Documentation/spec directory name relative to each task. |
recursive |
Whether to scan nested task folders. Defaults to |
require_workflow |
Whether discovered task previews require a workflow
spec. Discovered paths always have one; this is forwarded to
|
... |
Additional arguments passed to |
Data frame with rendered task directories and review paths.
Converts a workflow specification into a Graphviz-friendly representation. The DiagrammeR path is preferred for visual inspection of workflow DAGs.
render_workflow_graphviz( x, rankdir = "TB", as = c("dot", "diagrammer", "svg"), label_width = 28, show_edge_labels = FALSE, show_tooltips = FALSE, same_rank = NULL )render_workflow_graphviz( x, rankdir = "TB", as = c("dot", "diagrammer", "svg"), label_width = 28, show_edge_labels = FALSE, show_tooltips = FALSE, same_rank = NULL )
x |
A workflow specification or a |
rankdir |
Graphviz rank direction, for example |
as |
Output format: raw |
label_width |
Approximate wrapping width for node labels. |
show_edge_labels |
Whether to show edge relation labels. |
show_tooltips |
Whether to include Graphviz tooltip attributes. Defaults
to |
same_rank |
Optional list of node-id character vectors to keep at the same Graphviz rank. |
A Graphviz DOT string, DiagrammeR graph object, or SVG string.
RWMConfig
RWMConfig
Configuration for the Reasoning & World Model subsystem.
$initialize(cognitive = CognitiveConfig$new(), affective = NULL, persistence = "session", summary = NULL, metadata = list())Create a Reasoning & World Model config.
$validate()Validate the config.
$selected_layers()Return the active inner layers.
$as_list()Return a serializable representation.
cognitiveA CognitiveConfig object or NULL.
affectiveAn AffectiveConfig object or NULL.
persistencePersistence mode for the overall subsystem.
summaryOptional one-line summary.
metadataFree-form metadata list.
new()
Create an RWM config.
RWMConfig$new( cognitive = CognitiveConfig$new(), affective = NULL, persistence = "session", summary = NULL, metadata = list() )
cognitiveA CognitiveConfig object or list payload.
affectiveAn AffectiveConfig object or list payload.
persistencePersistence mode for the overall subsystem.
summaryOptional one-line summary.
metadataFree-form metadata list.
validate()
Validate the config.
RWMConfig$validate()
selected_layers()
Return the active inner layers.
RWMConfig$selected_layers()
as_list()
Return a serializable representation.
RWMConfig$as_list()
print()
Print a compact config summary.
RWMConfig$print(...)
...Unused print arguments.
clone()
The objects of this class are cloneable with this method.
RWMConfig$clone(deep = FALSE)
deepWhether to make a deep clone.
agentr object to a fileSaves an AgentCore, CognitiveState, AffectiveState, or
Scaffolder object to a specified .rds file. AgentSpec,
SubsystemSpec, MemorySpec, DesignReviewSpec, AgentScaffoldState,
and IntelligentAgent are also supported.
save_agent(agent, file_path)save_agent(agent, file_path)
agent |
An object created by |
file_path |
File path where the object should be saved. |
Invisibly returns TRUE.
AgentSpec to a fileSaves an AgentSpec object to a specified .rds file.
save_agent_spec(spec, file_path)save_agent_spec(spec, file_path)
spec |
An |
file_path |
File path where the object should be saved. |
Invisibly returns TRUE.
Save structured design feedback
save_design_feedback(x, path)save_design_feedback(x, path)
x |
A design-feedback item or list of items. |
path |
Output |
Invisibly returns TRUE.
Save a design-review specification
save_design_review_spec(x, path)save_design_review_spec(x, path)
x |
A |
path |
Output |
Invisibly returns TRUE.
Save a knowledge proposal
save_knowledge_proposal(x, path)save_knowledge_proposal(x, path)
x |
A |
path |
File path. |
Invisibly returns TRUE.
Save a knowledge specification
save_knowledge_spec(x, path, format = c("rds", "json", "yaml"))save_knowledge_spec(x, path, format = c("rds", "json", "yaml"))
x |
A |
path |
File path. |
format |
File format, either |
Invisibly returns TRUE.
Save a knowledge specification as JSON
save_knowledge_spec_json(x, path)save_knowledge_spec_json(x, path)
x |
A |
path |
File path. |
Invisibly returns TRUE.
Save a knowledge specification as YAML
save_knowledge_spec_yaml(x, path)save_knowledge_spec_yaml(x, path)
x |
A |
path |
File path. |
Invisibly returns TRUE.
MemorySpec to a fileSaves a MemorySpec object to a specified .rds, .json, or .yaml
file.
save_memory_spec(spec, file_path, format = c("rds", "json", "yaml"))save_memory_spec(spec, file_path, format = c("rds", "json", "yaml"))
spec |
A |
file_path |
File path where the object should be saved. |
format |
File format, either |
Invisibly returns TRUE.
MemorySpec as JSONSave a MemorySpec as JSON
save_memory_spec_json(spec, file_path)save_memory_spec_json(spec, file_path)
spec |
A |
file_path |
File path where the JSON should be saved. |
Invisibly returns TRUE.
MemorySpec as YAMLSave a MemorySpec as YAML
save_memory_spec_yaml(spec, file_path)save_memory_spec_yaml(spec, file_path)
spec |
A |
file_path |
File path where the YAML should be saved. |
Invisibly returns TRUE.
SubsystemSpec to a fileSaves a SubsystemSpec object to a specified .rds file.
save_subsystem_spec(spec, file_path)save_subsystem_spec(spec, file_path)
spec |
A |
file_path |
File path where the object should be saved. |
Invisibly returns TRUE.
Saves an agentr_workflow_proposal object so it can be reviewed, approved,
or visualized in a later session.
save_workflow_proposal(proposal, file_path)save_workflow_proposal(proposal, file_path)
proposal |
Workflow proposal object. |
file_path |
File path where the proposal should be saved. |
Invisibly returns TRUE.
Save a workflow specification
save_workflow_spec(workflow, file_path, format = c("rds", "json", "yaml"))save_workflow_spec(workflow, file_path, format = c("rds", "json", "yaml"))
workflow |
Workflow specification. |
file_path |
File path where the workflow should be saved. |
format |
File format, either |
Invisibly returns TRUE.
Save a workflow specification as JSON
save_workflow_spec_json(workflow, file_path)save_workflow_spec_json(workflow, file_path)
workflow |
Workflow specification. |
file_path |
File path where the JSON should be saved. |
Invisibly returns TRUE.
Save a workflow specification as YAML
save_workflow_spec_yaml(workflow, file_path)save_workflow_spec_yaml(workflow, file_path)
workflow |
Workflow specification. |
file_path |
File path where the YAML should be saved. |
Invisibly returns TRUE.
Scaffolder
Scaffolder
Human-in-the-loop scaffolding interface for iterative workflow elicitation.
A Scaffolder keeps a persistent task-evaluation artifact, supports
free-form discussion rounds before structured graph edits, separates
workflow-level and node-level review, treats node/edge edits as
first-class operations, and manages previewable workflow proposals with
explicit lifecycle state.
$initialize(agent = NULL, completion_threshold = 0.75)Create a scaffolder with empty workflow state and review metadata.
$evaluate_task(task, summary = NULL, workflow_complete = NA, blockers = NULL, next_focus = NULL)Create or refresh the persistent task-evaluation artifact.
$discuss_task(feedback, source = "human", node_id = NULL, confidence = NA_real_)Record a free-form human, model, or system discussion round.
$decompose_task(task = self$task, candidates = NULL, suggestions = NULL, nodes = NULL, edges = NULL, notes = NULL)Create or replace the workflow from linear candidates or non-linear graph suggestions.
$ask_human_complete(node_id)Create a prompt asking whether a workflow node is complete.
$ask_human_changes()Create a prompt asking what workflow or edge changes should happen next.
$ask_human_rule(node_id)Create a prompt requesting a node-specific rule.
$review_workflow(status = "pending", notes = NULL, confidence = NA_real_)Store workflow-level completeness or revision review state.
$review_node(node_id, status = "pending", notes = NULL, confidence = NA_real_, complete = NULL)Store node-level correctness or completion review state.
$edit_workflow(add = NULL, insert = NULL, remove = NULL, add_edges = NULL, remove_edges = NULL, rule_specs = list(), confidence = list())Apply first-class node and edge edits to the current workflow.
$set_node_schema(node_id, input_schema = NULL, output_schema = NULL)Set input/output schema metadata for one workflow node.
$set_node_nested_workflow(node_id, subworkflow_ref = NULL, nested_workflow = NULL)Attach a nested workflow reference or embedded nested workflow to one node.
$apply_human_feedback(completeness = NULL, add = NULL, remove = NULL, rule_specs = list(), confidence = list())Compatibility wrapper for structured human workflow edits.
$recommend_subsystems(task = self$task)Recommend optional subsystem/capability labels for the current task and workflow.
$subsystem_recommendations()Return the current subsystem recommendation records.
$subsystem_recommendation_rationale(subsystem = NULL)Return stored recommendation rationale for one subsystem or all subsystems.
$select_subsystems(subsystems)Store the selected subsystem configuration.
$selected_subsystems()Return the currently selected subsystem names.
$label_workflow_subsystems(labels)Assign subsystem owners to workflow nodes.
$edit_workflow_subsystems(set = NULL, add = NULL, remove = NULL, clear = NULL)Edit workflow-node subsystem ownership incrementally.
$propose_agent_spec(agent_name = "agentr-agent", summary = NULL, subsystems = NULL, workflow = NULL, workflow_proposal_id = NULL, state_requirements = list(), interfaces = list(), implementation_targets = list(), metadata = list(), source = "model", notes = NULL)Store a draft agent-spec proposal.
$list_agent_spec_proposals(status = NULL)Return stored agent-spec proposal summaries.
$get_agent_spec_proposal(proposal_id)Return a stored agent-spec proposal by id.
$discuss_agent_spec_proposal(proposal_id, feedback, source = "human", confidence = NA_real_)Attach discussion feedback to a draft agent-spec proposal.
$approve_agent_spec_proposal(proposal_id, approve_linked_workflow = TRUE)Approve a stored agent-spec proposal and optionally approve its linked workflow proposal.
$approve_agent_spec(agent_name = "agentr-agent", summary = NULL, state_requirements = list(), interfaces = list(), implementation_targets = list(), metadata = list())Approve an AgentSpec built from the current task, workflow, and optional subsystem labels.
$agent_spec()Return the approved agent spec or a draft spec built from current state.
$propose_workflow(workflow, source = "model", notes = NULL)Store a pending workflow proposal for preview and review.
$list_workflow_proposals(status = NULL)Return a summary table of stored workflow proposals.
$get_workflow_proposal(proposal_id)Return a stored WorkflowProposal object by identifier.
$approve_workflow_proposal(proposal_id)Promote a stored workflow proposal to the live workflow and supersede older active proposals when applicable.
$discuss_workflow_proposal(proposal_id, feedback, source = "human", confidence = NA_real_)Attach free-form discussion feedback to a non-approved workflow proposal and transition it into discussion state when needed.
$workflow_spec()Validate and return the current workflow specification.
$implementation_spec()Return an implementation-facing summary of workflow nodes and rules.
$low_confidence_nodes()Return workflow nodes below the completion threshold.
$get_node(node_id)Return a single workflow node by identifier.
$record_interaction(type, payload)Append an interaction event to the scaffolder log.
agentOptional AgentCore owner.
taskCurrent task text.
workflowCurrent workflow specification.
workflow_statePublic workflow proposal state container.
agent_statePublic agent scaffold state container.
proposal_logStored workflow proposals across pending, discussion, approved, superseded, and rejected lifecycle states.
interaction_logList of scaffolding interactions.
completion_thresholdThreshold used to flag low-confidence nodes.
new()
Create a Scaffolder with empty workflow, review, and discussion state.
Scaffolder$new(agent = NULL, completion_threshold = 0.75)
agentOptional AgentCore used by $initialize().
completion_thresholdConfidence threshold used by $initialize().
evaluate_task()
Create or refresh the persistent task-evaluation artifact.
Scaffolder$evaluate_task( task, summary = NULL, workflow_complete = NA, blockers = NULL, next_focus = NULL )
taskTask text used by $evaluate_task() and $decompose_task().
summaryOptional task summary used by $evaluate_task().
workflow_completeOptional task-level completeness flag used by
$evaluate_task().
blockersOptional blocker strings used by $evaluate_task().
next_focusOptional next-focus note used by $evaluate_task().
discuss_task()
Record a free-form human, model, or system discussion round.
Scaffolder$discuss_task( feedback, source = "human", node_id = NULL, confidence = NA_real_ )
feedbackFree-form discussion feedback used by $discuss_task().
sourceDiscussion source used by $discuss_task().
sourceProposal source used by proposal methods.
node_idWorkflow node identifier used by node-specific methods.
confidenceConfidence value used by review/edit helpers.
decompose_task()
Replace the workflow with nodes and edges derived from task suggestions.
Scaffolder$decompose_task( task = self$task, candidates = NULL, suggestions = NULL, nodes = NULL, edges = NULL, notes = NULL )
taskTask text used by $evaluate_task() and $decompose_task().
candidatesOptional candidate node labels used by $decompose_task().
suggestionsOptional free-form or structured graph suggestions used by
$decompose_task().
nodesOptional node list accepted directly by $decompose_task().
edgesOptional edge list accepted directly by $decompose_task().
notesOptional decomposition notes accepted directly by
$decompose_task().
notesOptional review notes.
notesOptional proposal notes.
ask_human_complete()
Build a prompt asking whether a node is complete.
Scaffolder$ask_human_complete(node_id)
node_idWorkflow node identifier used by node-specific methods.
ask_human_changes()
Build a prompt asking what workflow or edge changes should happen next.
Scaffolder$ask_human_changes()
ask_human_rule()
Build a prompt asking for a node-specific rule.
Scaffolder$ask_human_rule(node_id)
node_idWorkflow node identifier used by node-specific methods.
review_workflow()
Store workflow-level completeness or revision review state.
Scaffolder$review_workflow( status = "pending", notes = NULL, confidence = NA_real_ )
statusReview status used by $review_workflow() and
$review_node().
notesOptional decomposition notes accepted directly by
$decompose_task().
notesOptional review notes.
notesOptional proposal notes.
confidenceConfidence value used by review/edit helpers.
review_node()
Store node-level review status, notes, confidence, and completion state.
Scaffolder$review_node( node_id, status = "pending", notes = NULL, confidence = NA_real_, complete = NULL )
node_idWorkflow node identifier used by node-specific methods.
statusReview status used by $review_workflow() and
$review_node().
notesOptional decomposition notes accepted directly by
$decompose_task().
notesOptional review notes.
notesOptional proposal notes.
confidenceConfidence value used by review/edit helpers.
completeOptional node completion flag used by $review_node().
edit_workflow()
Apply first-class node and edge edits to the current workflow.
Scaffolder$edit_workflow( add = NULL, insert = NULL, remove = NULL, add_edges = NULL, remove_edges = NULL, rule_specs = list(), confidence = list() )
addList of node records to add in $edit_workflow().
insertList of insertion specs used by $edit_workflow().
removeCharacter vector of node ids to remove in $edit_workflow().
add_edgesList of edge records to add in $edit_workflow().
remove_edgesList of edge specs to remove in $edit_workflow().
rule_specsNamed list of rule specs used by $edit_workflow().
confidenceConfidence value used by review/edit helpers.
set_node_schema()
Set structured input and output schema metadata for one workflow node.
Scaffolder$set_node_schema(node_id, input_schema = NULL, output_schema = NULL)
node_idWorkflow node identifier used by node-specific methods.
input_schemaStructured input schema used by $set_node_schema().
output_schemaStructured output schema used by $set_node_schema().
set_node_nested_workflow()
Attach a nested workflow reference or embedded nested workflow to one node.
Scaffolder$set_node_nested_workflow( node_id, subworkflow_ref = NULL, nested_workflow = NULL )
node_idWorkflow node identifier used by node-specific methods.
subworkflow_refNested workflow reference used by
$set_node_nested_workflow().
nested_workflowEmbedded nested workflow used by
$set_node_nested_workflow().
apply_human_feedback()
Apply legacy structured human feedback to the workflow.
Scaffolder$apply_human_feedback( completeness = NULL, add = NULL, remove = NULL, rule_specs = list(), confidence = list() )
completenessNamed list of completion flags used by
$apply_human_feedback().
addList of node records to add in $edit_workflow().
removeCharacter vector of node ids to remove in $edit_workflow().
rule_specsNamed list of rule specs used by $edit_workflow().
confidenceConfidence value used by review/edit helpers.
recommend_subsystems()
Recommend optional subsystem/capability labels for the current task and workflow.
Scaffolder$recommend_subsystems(task = self$task)
taskTask text used by $evaluate_task() and $decompose_task().
subsystem_recommendations()
Return the current subsystem recommendation records.
Scaffolder$subsystem_recommendations()
subsystem_recommendation_rationale()
Return stored recommendation rationale.
Scaffolder$subsystem_recommendation_rationale(subsystem = NULL)
subsystemOptional subsystem name used by
$subsystem_recommendation_rationale().
select_subsystems()
Store the selected subsystem configuration.
Scaffolder$select_subsystems(subsystems)
subsystemsSelected subsystems used by $select_subsystems().
selected_subsystems()
Return the currently selected subsystem names.
Scaffolder$selected_subsystems()
label_workflow_subsystems()
Assign subsystem owners to workflow nodes.
Scaffolder$label_workflow_subsystems(labels)
labelsNamed node-to-subsystem assignments used by
$label_workflow_subsystems().
edit_workflow_subsystems()
Edit workflow-node subsystem ownership incrementally.
Scaffolder$edit_workflow_subsystems( set = NULL, add = NULL, remove = NULL, clear = NULL )
setNamed node-to-subsystem assignments used by
$edit_workflow_subsystems().
addList of node records to add in $edit_workflow().
removeCharacter vector of node ids to remove in $edit_workflow().
clearCharacter vector of node ids whose ownership labels should be
cleared by $edit_workflow_subsystems().
propose_agent_spec()
Store a draft agent-spec proposal.
Scaffolder$propose_agent_spec( agent_name = "agentr-agent", summary = NULL, subsystems = NULL, workflow = NULL, workflow_proposal_id = NULL, state_requirements = list(), interfaces = list(), implementation_targets = list(), metadata = list(), source = "model", notes = NULL )
agent_nameAgent name used by $approve_agent_spec().
summaryOptional task summary used by $evaluate_task().
subsystemsSelected subsystems used by $select_subsystems().
workflowProposed workflow used by proposal methods.
workflow_proposal_idWorkflow proposal id used to seed an agent-spec proposal.
state_requirementsState requirements used by $approve_agent_spec().
interfacesInterfaces used by $approve_agent_spec().
implementation_targetsImplementation targets used by
$approve_agent_spec().
metadataAgent-spec metadata used by $approve_agent_spec().
sourceDiscussion source used by $discuss_task().
sourceProposal source used by proposal methods.
notesOptional decomposition notes accepted directly by
$decompose_task().
notesOptional review notes.
notesOptional proposal notes.
list_agent_spec_proposals()
Return stored agent-spec proposal summaries.
Scaffolder$list_agent_spec_proposals(status = NULL)
statusReview status used by $review_workflow() and
$review_node().
get_agent_spec_proposal()
Return a stored agent-spec proposal by id.
Scaffolder$get_agent_spec_proposal(proposal_id)
proposal_idWorkflow proposal identifier.
discuss_agent_spec_proposal()
Attach discussion feedback to a draft agent-spec proposal.
Scaffolder$discuss_agent_spec_proposal( proposal_id, feedback, source = "human", confidence = NA_real_ )
proposal_idWorkflow proposal identifier.
feedbackFree-form discussion feedback used by $discuss_task().
sourceDiscussion source used by $discuss_task().
sourceProposal source used by proposal methods.
confidenceConfidence value used by review/edit helpers.
approve_agent_spec_proposal()
Approve a stored agent-spec proposal and optionally approve its linked workflow proposal.
Scaffolder$approve_agent_spec_proposal( proposal_id, approve_linked_workflow = TRUE )
proposal_idWorkflow proposal identifier.
approve_linked_workflowWhether linked workflow proposals should be approved when approving an agent-spec proposal.
approve_agent_spec()
Approve an agent spec built from the current scaffolding state.
Scaffolder$approve_agent_spec( agent_name = "agentr-agent", summary = NULL, state_requirements = list(), interfaces = list(), implementation_targets = list(), metadata = list() )
agent_nameAgent name used by $approve_agent_spec().
summaryOptional task summary used by $evaluate_task().
state_requirementsState requirements used by $approve_agent_spec().
interfacesInterfaces used by $approve_agent_spec().
implementation_targetsImplementation targets used by
$approve_agent_spec().
metadataAgent-spec metadata used by $approve_agent_spec().
agent_spec()
Return the approved agent spec or a draft spec built from current state.
Scaffolder$agent_spec()
propose_workflow()
Store a pending workflow proposal for preview and review.
Scaffolder$propose_workflow(workflow, source = "model", notes = NULL)
workflowProposed workflow used by proposal methods.
sourceDiscussion source used by $discuss_task().
sourceProposal source used by proposal methods.
notesOptional decomposition notes accepted directly by
$decompose_task().
notesOptional review notes.
notesOptional proposal notes.
list_workflow_proposals()
Return a summary table of stored workflow proposals.
Scaffolder$list_workflow_proposals(status = NULL)
statusReview status used by $review_workflow() and
$review_node().
get_workflow_proposal()
Return a stored WorkflowProposal object by identifier.
Scaffolder$get_workflow_proposal(proposal_id)
proposal_idWorkflow proposal identifier.
approve_workflow_proposal()
Promote a stored workflow proposal to the live workflow and supersede older active proposals when applicable.
Scaffolder$approve_workflow_proposal(proposal_id)
proposal_idWorkflow proposal identifier.
discuss_workflow_proposal()
Attach free-form discussion feedback to a non-approved workflow proposal and transition it into discussion state when needed.
Scaffolder$discuss_workflow_proposal( proposal_id, feedback, source = "human", confidence = NA_real_ )
proposal_idWorkflow proposal identifier.
feedbackFree-form discussion feedback used by $discuss_task().
sourceDiscussion source used by $discuss_task().
sourceProposal source used by proposal methods.
confidenceConfidence value used by review/edit helpers.
workflow_spec()
Validate and return the current workflow specification.
Scaffolder$workflow_spec()
implementation_spec()
Return an implementation-facing summary of workflow nodes and rules.
Scaffolder$implementation_spec()
low_confidence_nodes()
Return workflow nodes whose confidence falls below the completion threshold.
Scaffolder$low_confidence_nodes()
get_node()
Return a single workflow node by identifier.
Scaffolder$get_node(node_id)
node_idWorkflow node identifier used by node-specific methods.
record_interaction()
Append an interaction record to the scaffolder log.
Scaffolder$record_interaction(type, payload)
typeInteraction type used by $record_interaction().
payloadInteraction payload used by $record_interaction().
clone()
The objects of this class are cloneable with this method.
Scaffolder$clone(deep = FALSE)
deepWhether to make a deep clone.
Returns the method names that an external reasoning system is allowed to request through a machine-readable scaffolding message.
scaffolder_action_methods()scaffolder_action_methods()
Character vector of allowed method names.
Converts a nested R list, JSON-schema-like object, vector, or data frame into node and edge data frames. The output is a structural preview of the schema shape, not a validator.
schema_shape_graph_data(x, root_id = "schema", root_label = "schema")schema_shape_graph_data(x, root_id = "schema", root_label = "schema")
x |
Schema object to inspect. Common inputs are workflow-node
|
root_id |
Root node identifier. |
root_label |
Human-readable root node label. |
A list with vertices and edges data frames.
Set one workflow node automation status
set_workflow_node_automation_status( workflow, node_id, automation_status, target_automation_status = NULL )set_workflow_node_automation_status( workflow, node_id, automation_status, target_automation_status = NULL )
workflow |
Workflow specification. |
node_id |
Node identifier. |
automation_status |
Automation-status value. |
target_automation_status |
Optional target automation-status value. |
Updated workflow specification.
Set one workflow node owner
set_workflow_node_owner(workflow, node_id, owner)set_workflow_node_owner(workflow, node_id, owner)
workflow |
Workflow specification. |
node_id |
Node identifier. |
owner |
Owner value. |
Updated workflow specification.
SubsystemSpec
SubsystemSpec
Sparse diagnostic inventory of the selected agent subsystems.
$initialize(rwm = NULL, pg = NULL, ae = NULL, iac = NULL, la = NULL, metadata = list())Create an optional subsystem diagnostic inventory.
$validate()Validate the subsystem diagnostic labels.
$selected_subsystems()Return the selected subsystem names.
$persistence_requirements()Return persistence requirements for selected subsystems.
$communication_requirements()Return communication requirements for selected subsystems.
$summary()Return a one-row summary table.
$as_list()Return a serializable representation.
rwmAn RWMConfig object or NULL.
pgA PGConfig object or NULL.
aeAn AEConfig object or NULL.
iacAn IACConfig object or NULL.
laA LAConfig object or NULL.
metadataFree-form metadata list.
new()
Create an optional subsystem diagnostic inventory.
SubsystemSpec$new( rwm = NULL, pg = NULL, ae = NULL, iac = NULL, la = NULL, metadata = list() )
rwmAn RWMConfig object or list payload.
pgA PGConfig object or list payload.
aeAn AEConfig object or list payload.
iacAn IACConfig object or list payload.
laA LAConfig object or list payload.
metadataFree-form metadata list.
validate()
Validate the subsystem diagnostic labels.
SubsystemSpec$validate()
selected_subsystems()
Return the selected subsystem names.
SubsystemSpec$selected_subsystems()
persistence_requirements()
Return persistence requirements for selected subsystems.
SubsystemSpec$persistence_requirements()
communication_requirements()
Return communication requirements for selected subsystems.
SubsystemSpec$communication_requirements()
summary()
Return a one-row summary table.
SubsystemSpec$summary()
as_list()
Return a serializable representation.
SubsystemSpec$as_list()
print()
Print a compact subsystem summary.
SubsystemSpec$print(...)
...Unused print arguments.
clone()
The objects of this class are cloneable with this method.
SubsystemSpec$clone(deep = FALSE)
deepWhether to make a deep clone.
Task-family metadata describes a parent design space whose root workflow
contains child-task nodes. It is stored under workflow$metadata$task_family
so the workflow remains a normal agentr_workflow_spec.
task_family_metadata( id, label, objective, child_tasks = character(), dependency_policy = "independent_children_no_root_edges", shared_inputs = character(), shared_review_concerns = character(), task_tags = list(), metadata = list() )task_family_metadata( id, label, objective, child_tasks = character(), dependency_policy = "independent_children_no_root_edges", shared_inputs = character(), shared_review_concerns = character(), task_tags = list(), metadata = list() )
id |
Task-family identifier. |
label |
Human-readable task-family label. |
objective |
Family-level objective. |
child_tasks |
Character vector of child-task node ids. |
dependency_policy |
Description of how root-level child nodes should be interpreted. |
shared_inputs |
Character vector of shared input names. |
shared_review_concerns |
Character vector of shared review concerns. |
task_tags |
Optional named list mapping child-task ids to tags. |
metadata |
Additional metadata. |
List suitable for workflow$metadata$task_family.
Coding-assistant workflows commonly keep editable agentr specs under a
task-local docs/ directory. This helper returns the conventional paths
without creating or modifying files.
task_spec_paths(task_dir, docs_dir = "docs")task_spec_paths(task_dir, docs_dir = "docs")
task_dir |
Task root directory. |
docs_dir |
Documentation/spec directory relative to |
Named list of task-local paths.
Ask for workflow-node completeness in the terminal
terminal_ask_node_complete(scaffolder, node_id)terminal_ask_node_complete(scaffolder, node_id)
scaffolder |
A |
node_id |
Workflow node identifier. |
A list containing the prompt and response.
Ask for a node-specific rule in the terminal
terminal_ask_node_rule(scaffolder, node_id)terminal_ask_node_rule(scaffolder, node_id)
scaffolder |
A |
node_id |
Workflow node identifier. |
A list containing the prompt and response.
Ask for workflow changes in the terminal
terminal_ask_workflow_changes(scaffolder)terminal_ask_workflow_changes(scaffolder)
scaffolder |
A |
A list containing the prompt and response.
Capture free-form terminal feedback and record it in the scaffolder
terminal_discuss_task( scaffolder, prompt = "Share feedback for the current task or workflow.", source = "human", node_id = NULL )terminal_discuss_task( scaffolder, prompt = "Share feedback for the current task or workflow.", source = "human", node_id = NULL )
scaffolder |
A |
prompt |
Character string shown to the human. |
source |
Discussion source label. |
node_id |
Optional workflow node identifier. |
A list containing the prompt and recorded response.
Prompt for terminal input during scaffolding
terminal_scaffold_input(prompt)terminal_scaffold_input(prompt)
prompt |
Character string shown to the human. |
Character string entered by the user.
Validate structured design feedback
validate_design_feedback(x, review_spec = NULL)validate_design_feedback(x, review_spec = NULL)
x |
A feedback item, list of feedback items, or parsed feedback bundle
containing a |
review_spec |
Optional |
The validated feedback, invisibly.
Validate a design-review specification
validate_design_review_spec(x)validate_design_review_spec(x)
x |
A |
The validated object, invisibly.
Validate a knowledge specification item
validate_knowledge_item(item)validate_knowledge_item(item)
item |
Knowledge-item list. |
Validated item, invisibly.
Validate a knowledge proposal
validate_knowledge_proposal(x)validate_knowledge_proposal(x)
x |
Knowledge proposal record or object. |
Validated proposal, invisibly.
Validate a knowledge specification
validate_knowledge_spec(x)validate_knowledge_spec(x)
x |
A |
The validated object, invisibly.
Validate a memory field
validate_memory_field(x)validate_memory_field(x)
x |
Memory field list. |
The validated field, invisibly.
Validate a memory proposal
validate_memory_proposal(x)validate_memory_proposal(x)
x |
Memory proposal record or object. |
The validated proposal, invisibly.
Validate a MemorySpec
validate_memory_spec(x)validate_memory_spec(x)
x |
A |
The validated object, invisibly.
Validate a machine-readable scaffolder message
validate_scaffolder_message(x, allowed_methods = scaffolder_action_methods())validate_scaffolder_message(x, allowed_methods = scaffolder_action_methods())
x |
Parsed scaffolder message. |
allowed_methods |
Character vector of allowed method names. |
The validated message, invisibly.
Validates conventional task-local YAML specs when present and reports missing or invalid files without mutating the task directory.
validate_task_specs( task_dir, docs_dir = "docs", require = character(), stop_on_error = FALSE )validate_task_specs( task_dir, docs_dir = "docs", require = character(), stop_on_error = FALSE )
task_dir |
Task root directory. |
docs_dir |
Documentation/spec directory relative to |
require |
Character vector of spec types that must exist. Supported
values are |
stop_on_error |
Whether to stop when required or present specs are invalid. |
Data frame with one row per spec type.
Checks that a workflow proposal has the expected structure, valid lifecycle status, and a valid embedded workflow specification.
validate_workflow_proposal(x)validate_workflow_proposal(x)
x |
Workflow proposal object. |
The validated proposal, invisibly.
Validate a workflow specification
validate_workflow_spec(x, knowledge_spec = NULL, warn_missing_knowledge = TRUE)validate_workflow_spec(x, knowledge_spec = NULL, warn_missing_knowledge = TRUE)
x |
Workflow specification. |
knowledge_spec |
Optional |
warn_missing_knowledge |
Whether to emit warnings about unresolved
knowledge references when |
The validated object, invisibly.
Create a workflow edge record
workflow_edge( from, to, relation = "depends_on", confidence = NA_real_, notes = NA_character_, condition = NA_character_, branch_group = NA_character_, mutually_exclusive = NA )workflow_edge( from, to, relation = "depends_on", confidence = NA_real_, notes = NA_character_, condition = NA_character_, branch_group = NA_character_, mutually_exclusive = NA )
from |
Source node id. |
to |
Target node id. |
relation |
Edge relation label. Common relations include
|
confidence |
Optional edge confidence score between 0 and 1. |
notes |
Optional edge notes. |
condition |
Optional branch or transition condition. |
branch_group |
Optional identifier for related branch alternatives. |
mutually_exclusive |
Whether the edge is mutually exclusive with other edges in the same branch group. |
One-row data frame.
Returns node and edge data frames in a shape that is directly usable by graph
packages and renderers such as DiagrammeR.
workflow_graph_data( x, highlight_low_confidence = TRUE, confidence_threshold = 0.6 )workflow_graph_data( x, highlight_low_confidence = TRUE, confidence_threshold = 0.6 )
x |
A workflow specification or a |
highlight_low_confidence |
Whether to add a low-confidence flag based on
|
confidence_threshold |
Threshold for low-confidence highlighting. |
A list with vertices and edges data frames.
Create a workflow node record
workflow_node( id, label, confidence = NA_real_, human_required = TRUE, rule_spec = NA_character_, implementation_hint = NA_character_, complete = FALSE, review_status = "pending", review_notes = NA_character_, review_confidence = NA_real_, node_kind = "action", owner = NA_character_, automation_status = NA_character_, human_owned_reason = NA_character_, target_automation_status = NA_character_, trace_required = NA, knowledge_refs = character(), source_path = NA_character_, retrieval_mode = NA_character_, persistence = NA_character_, linked_spec_ids = character(), subworkflow_ref = NA_character_, input_schema = list(), output_schema = list(), nested_workflow = NULL )workflow_node( id, label, confidence = NA_real_, human_required = TRUE, rule_spec = NA_character_, implementation_hint = NA_character_, complete = FALSE, review_status = "pending", review_notes = NA_character_, review_confidence = NA_real_, node_kind = "action", owner = NA_character_, automation_status = NA_character_, human_owned_reason = NA_character_, target_automation_status = NA_character_, trace_required = NA, knowledge_refs = character(), source_path = NA_character_, retrieval_mode = NA_character_, persistence = NA_character_, linked_spec_ids = character(), subworkflow_ref = NA_character_, input_schema = list(), output_schema = list(), nested_workflow = NULL )
id |
Node identifier. |
label |
Human-readable node label. |
confidence |
Provisional confidence score between 0 and 1. |
human_required |
Whether human confirmation is required. |
rule_spec |
Optional node-specific rule specification. |
implementation_hint |
Optional implementation hint. |
complete |
Whether the node is considered complete. |
review_status |
Node-level review status. |
review_notes |
Optional node-level review notes. |
review_confidence |
Optional confidence attached to the latest review. |
node_kind |
Optional workflow node kind. Supported values are
|
owner |
Optional current owner for the node. |
automation_status |
Optional current automation status for the node. |
human_owned_reason |
Optional explanation for why the node remains human-owned. |
target_automation_status |
Optional target automation status for the node. |
trace_required |
Optional logical flag indicating whether decision traces should be collected. |
knowledge_refs |
Optional character vector of referenced knowledge-item ids. |
source_path |
Optional path, URI, or symbolic source for data/resource nodes. |
retrieval_mode |
Optional retrieval mode for data/resource nodes. |
persistence |
Optional persistence description for data/resource nodes. |
linked_spec_ids |
Optional character vector of linked knowledge, memory, schema, or interface spec ids. |
subworkflow_ref |
Optional identifier or path for a nested workflow. |
input_schema |
Optional structured input schema for the node. |
output_schema |
Optional structured output schema for the node. |
nested_workflow |
Optional nested workflow spec or list with |
One-row data frame.
Exports graph-ready vertex and edge tables for a stored workflow proposal.
This accepts either a workflow proposal object directly or a Scaffolder
plus a proposal id.
workflow_proposal_graph_data(x, proposal_id = NULL)workflow_proposal_graph_data(x, proposal_id = NULL)
x |
A workflow proposal object or a |
proposal_id |
Optional proposal id when |
A list with vertices and edges.
Converts reasoning-model output produced from
build_workflow_extraction_prompt() into a validated
agentr_workflow_spec object.
workflow_spec_from_json(x)workflow_spec_from_json(x)
x |
Parsed list, raw JSON string, or path to a |
A validated workflow specification.
Build a workflow specification from YAML
workflow_spec_from_yaml(file_path)workflow_spec_from_yaml(file_path)
file_path |
Path to a |
A validated workflow specification.
WorkflowProposal
WorkflowProposal
Public workflow proposal object with explicit lifecycle state and persistence helpers.
$initialize(...)Create a workflow proposal object.
$validate()Validate the proposal state and embedded workflow.
$as_list()Return the proposal as a serializable proposal record.
$summary()Return a one-row summary data frame.
$transition(to_status, timestamp = Sys.time(), superseded_by = NULL, supersedes = NULL)Apply a valid lifecycle transition.
$discuss(feedback, source = "human", confidence = NA_real_, timestamp = Sys.time())Append a discussion round and transition into discussion state when needed.
$graph_data()Export graph-ready data from the proposed workflow.
$save(file_path)Save the proposal to disk.
idWorkflow proposal identifier.
statusWorkflow proposal lifecycle status.
sourceProposal source label.
notesOptional proposal notes.
workflowProposed workflow specification.
discussion_roundsStored discussion rounds.
created_atProposal creation time.
updated_atLatest proposal update time.
approved_atApproval time.
superseded_byNewer proposal id that superseded this proposal.
supersedesOlder proposal id superseded by this proposal.
rejected_atRejection time.
new()
Create a WorkflowProposal.
WorkflowProposal$new( id, workflow, status = "pending", source = "model", notes = NULL, discussion_rounds = list(), created_at = Sys.time(), updated_at = created_at, approved_at = as.POSIXct(NA), superseded_by = NA_character_, supersedes = NA_character_, rejected_at = as.POSIXct(NA) )
idWorkflow proposal identifier.
workflowProposed workflow specification.
statusWorkflow proposal lifecycle status.
sourceProposal source label.
notesOptional proposal notes.
discussion_roundsStored discussion rounds.
created_atProposal creation time.
updated_atLatest proposal update time.
approved_atApproval time.
superseded_byNewer proposal id that superseded this proposal.
supersedesOlder proposal id superseded by this proposal.
rejected_atRejection time.
validate()
Validate the proposal.
WorkflowProposal$validate()
as_list()
Return a serializable proposal record.
WorkflowProposal$as_list()
summary()
Return a one-row proposal summary.
WorkflowProposal$summary()
transition()
Apply a valid lifecycle transition.
WorkflowProposal$transition( to_status, timestamp = Sys.time(), superseded_by = NULL, supersedes = NULL )
to_statusTarget lifecycle status used by $transition().
timestampTimestamp used by $transition() and $discuss().
superseded_byNewer proposal id that superseded this proposal.
supersedesOlder proposal id superseded by this proposal.
discuss()
Append a discussion round to the proposal.
WorkflowProposal$discuss( feedback, source = "human", confidence = NA_real_, timestamp = Sys.time() )
feedbackDiscussion feedback used by $discuss().
sourceProposal source label.
confidenceOptional discussion confidence used by $discuss().
timestampTimestamp used by $transition() and $discuss().
graph_data()
Export graph-ready proposal workflow data.
WorkflowProposal$graph_data()
save()
Save the proposal to disk.
WorkflowProposal$save(file_path)
file_pathFile path used by $save().
clone()
The objects of this class are cloneable with this method.
WorkflowProposal$clone(deep = FALSE)
deepWhether to make a deep clone.
WorkflowProposalState
WorkflowProposalState
Public state container for the approved workflow plus stored workflow proposals.
$initialize(approved_workflow = new_workflow_spec(...), proposals = list())Create a workflow proposal state container.
$set_approved_workflow(workflow)Replace the approved workflow.
$add_proposal(proposal)Store a proposal object.
$get_proposal(proposal_id)Return a stored proposal by id.
$list_proposals(status = NULL)Return a summary table of proposals.
$latest_proposal()Return the latest stored proposal or NULL.
$active_proposals()Return active proposal objects.
$proposal_history()Return proposal history in insertion order.
$approve_proposal(proposal_id, timestamp = Sys.time())Approve a proposal, update the approved workflow, and supersede older active proposals.
$as_list()Return a serializable state snapshot.
approved_workflowCurrent approved workflow specification.
proposalsNamed list of WorkflowProposal objects.
new()
Create a WorkflowProposalState.
WorkflowProposalState$new(
approved_workflow = new_workflow_spec(nodes = .empty_workflow_nodes(), edges =
.empty_workflow_edges(), task = NULL, metadata = list(evaluation = NULL,
workflow_review = NULL, discussion_rounds = list())),
proposals = list()
)approved_workflowCurrent approved workflow specification used by
$initialize().
proposalsInitial proposal objects used by $initialize().
set_approved_workflow()
Replace the approved workflow.
WorkflowProposalState$set_approved_workflow(workflow)
workflowApproved workflow specification used by
$set_approved_workflow().
add_proposal()
Store a proposal object.
WorkflowProposalState$add_proposal(proposal)
proposalProposal object used by $add_proposal().
get_proposal()
Return a stored proposal by id.
WorkflowProposalState$get_proposal(proposal_id)
proposal_idProposal identifier used by $get_proposal() and
$approve_proposal().
list_proposals()
Return proposal summary rows.
WorkflowProposalState$list_proposals(status = NULL)
statusOptional proposal status filter used by $list_proposals().
latest_proposal()
Return the latest proposal or NULL.
WorkflowProposalState$latest_proposal()
active_proposals()
Return active proposals.
WorkflowProposalState$active_proposals()
proposal_history()
Return proposal history.
WorkflowProposalState$proposal_history()
approve_proposal()
Approve a stored proposal and supersede older active proposals.
WorkflowProposalState$approve_proposal(proposal_id, timestamp = Sys.time())
proposal_idProposal identifier used by $get_proposal() and
$approve_proposal().
timestampTimestamp used by $approve_proposal().
as_list()
Return a serializable state snapshot.
WorkflowProposalState$as_list()
clone()
The objects of this class are cloneable with this method.
WorkflowProposalState$clone(deep = FALSE)
deepWhether to make a deep clone.