Skip to main content

Module repl

Module repl 

Source
Expand description

REPL language (.ragsh) — capability-bound interactive orchestration; the RLM/CodeAct surface of the runtime.

.ragsh is TinyAgents’ answer to the Recursive Language Model execution model: instead of stuffing everything into one context window, an orchestrator (a human, or a model acting as one) drives a session by issuing small typed commands — set/get session values, load and compile a .rag blueprint, run a graph, or call a registered capability — inspecting each ReplOutcome and iterating. Because every capability-bearing command is checked against a CapabilityPolicy allowlist before it can touch the runtime, the same surface is safe to expose to a model that is recursively orchestrating sub-models, sub-agents, and sub-graphs from inside a run.

The REPL language is the interactive, session-oriented counterpart to the declarative .rag expressive language. An operator (human or parent orchestrator) drives a harness/graph session by issuing typed commands that are policy-checked before they reach the runtime.

This module is currently at milestone R1 (Documentation and Types). It establishes the command grammar, a line-oriented parser, a session/capability boundary, and structured outcomes. Commands that need live harness/graph integration are policy-checked and returned as ReplOutcome::Planned rather than executed; wiring to the live harness/graph runtime is deferred to milestones R2–R6.

§Grammar

line      = verb ( ws+ arg )* ws*
verb      = [a-zA-Z][a-zA-Z0-9_-]*
arg       = quoted | bare
quoted    = '"' ( <any> | '\\' <any> )* '"'
bare      = ( <non-whitespace> )+

The first token is the command verb (matched case-insensitively). Subsequent tokens are positional arguments. For the call verb the remainder of the line after the capability name is parsed as a single JSON value, so multi-token JSON objects and arrays are accepted verbatim.

§Verb table

VerbSignatureNotes
helphelpAlso: ?
quitquitAlso: exit, q
loadload <path>Requires "load" capability
compilecompile <name>Requires "compile" capability
runrun <graph> <input>Requires "run" capability
setset <key> <value><value> may be quoted
getget <key>
showshow vars|graphs|status
callcall <capability> <json>JSON may span multiple tokens

Re-exports§

pub use types::*;

Modules§

types
REPL command and session types for the .ragsh interactive language.

Functions§

parse_command
Parse a single .ragsh REPL command line into a ReplCommand.