Agent Command Protocol
Agent connectors own agent-specific behavior. Ruhroh owns the task loop and result mapping.
Most users should use the command-backed path documented in Connect an Agent and Run a Shell Agent. A command wrapper is easier to audit, works with existing agent CLIs, and already supports completion status, transcripts, model identity, usage, and evidence metadata through RUHROH_RESULT_PATH.
Use the TypeScript connector lifecycle only for advanced integrations where a process wrapper cannot preserve the agent behavior you need, for example a native session transport, embedded SDK client, or custom evidence collection.
Recommended Command Protocol
For shell-based public agents, use the generic command protocol. Ruhroh passes:
RUHROH_MESSAGERUHROH_ITERATIONRUHROH_WORKSPACERUHROH_GOAL_PATHRUHROH_WORKSPACE_PATHRUHROH_RESULT_PATHRUHROH_SESSION_HANDLERUHROH_SCENARIO_IDRUHROH_RUN_ROOTRUHROH_ADAPTER_IDRUHROH_SAMPLE_IDRUHROH_SAMPLE_SEEDRUHROH_RUN_INDEXRUHROH_RUN_COUNT
Wrappers should emit a final JSON line:
{"status":"goal_satisfied"}Wrappers may also write RUHROH_RESULT_PATH with version: "ruhroh_run_agent_result_v1". Ruhroh reads that file when present and maps goal_satisfied, continue, cannot_satisfy, policy_blocked, runtime_failure, and infra_failure into the generic completion contract.
The result file may include connector-specific metadata:
{
"version": "ruhroh_run_agent_result_v1",
"status": "goal_satisfied",
"runId": "agent-run-123",
"adapterVersion": "1.4.0",
"model": {
"provider": "example",
"model": "agent-model",
"version": "2026-07-07",
"promptVersion": "adapter-prompt-v3"
},
"usage": {
"costUsd": 0.42,
"inputTokens": 1200,
"outputTokens": 800,
"totalTokens": 2000
},
"artifacts": {
"transcript": "/path/to/transcript.log"
}
}Ruhroh copies adapterVersion, model, and usage from the latest command result into ruhroh-run-manifest.json. These values take precedence over env fallbacks for the same run.
For reproducible reports, wrappers or launch scripts may set:
RUHROH_RUN_AGENT_ADAPTER_VERSIONRUHROH_AGENT_PROVIDERRUHROH_AGENT_MODELRUHROH_AGENT_MODEL_VERSIONRUHROH_AGENT_PROMPT_VERSIONRUHROH_RUN_SEEDRUHROH_RETRY_POLICYRUHROH_COST_USDRUHROH_INPUT_TOKENSRUHROH_OUTPUT_TOKENSRUHROH_TOTAL_TOKENS
Ruhroh writes these into ruhroh-run-manifest.json when present. Secret values are not copied into the manifest.
Advanced TypeScript Lifecycle
The TypeScript adapter contract is exported from @kestrel-agents/ruhroh:
prepare()startSession()runTurn()detectCompletion()collectArtifacts()cleanup()
Connectors report their continuity level:
native_sessionworkspace_plus_transcriptworkspace_only

