Skip to content

RIA-Spec/one-agent

Repository files navigation

One Agent

An AI agent with Reason-able Action Space (RAS) support for Python, TypeScript, and Bash.

This project is under active development and may introduce breaking changes.

Re in Act

This monorepo is a reference implementation of the Re in Act working draft.

Core reference:

In this repository, that means:

  • reason() is the required core interface and is used for schema-bounded local judgment inside the Reason-able Action Space (RAS).
  • act() is an optional interface for external actions and tool execution inside the RAS.
  • reusable workflows are modeled as riffs, or Reusable RAS Definitions.
  • the agent can operate through Bash RAS and Code RAS runtime forms, with Python and TypeScript as the main code runtimes in this implementation.

The implementation here focuses on making those ideas executable in a real agent/runtime/web stack, rather than only documenting the spec terms.

Packages

This monorepo is split into a small set of focused packages:

Reason-able Action Space (RAS)

The RAS is the bounded action context and interfaces for reasoning in action. In the spec, it is the space where local feedback, deterministic control flow, and bounded reason() / optional act() steps stay local instead of bouncing every disturbance back to the outer loop. This repository currently ships three runtime surfaces.

1. Python RAS (Code RAS) - Default

The Programmatic Approach: Manage control flows using code execution (conditions, loops, branches).

Configuration: Uses one-runner-python.md

import asyncio
import os

async def main():
    log_content = open("build.log").read() if os.path.exists("build.log") else "No log"
    analysis = await reason(
        log_content + "\nDid the build succeed?",
        {"success": False, "reason": ""}
    )

    if analysis["data"]["success"]:
        await act("bash", {"command": "echo deploy to production"})
    else:
        print(f"Build failed: {analysis['data']['reason']}")

asyncio.run(main())

2. TypeScript RAS (Code RAS)

The Programmatic Approach: Manage control flows using TypeScript/JavaScript execution with await reason(...) and await act(...).

Configuration: Uses one-runner-python.md for the shared code-runner surface.

const status = await act("bash", { command: "cat build.log" });
if (status?.isError) {
  console.log(status);
  process.exit(1);
}

const analysis = await reason(
  "Goal: decide if the build succeeded. Observation: " +
    String(status.content?.[0]?.text ?? "").slice(0, 4000) +
    ". Constraints: return success plus a short grounded reason.",
  { success: false, reason: "" }
);

if (analysis?.error) {
  console.log(analysis.error);
  process.exit(1);
}

if (analysis.data.success) {
  await act("bash", { command: "echo deploy to production" });
} else {
  console.log(`Build failed: ${analysis.data.reason}`);
}

3. Bash RAS (Unix Philosophy)

The Unix Philosophy: Control flow using pipes (|) and redirection (>).

Configuration: Uses one-runner-bash.md

cat api_docs.md | \
  reason - '{"summary":"","test_command":""}' | \
  tee /tmp/plan.json | \
  jq -r '.summary' && \
  jq -c '{command: .test_command}' /tmp/plan.json | \
  act bash -

Notes:

  • direct shell execution runs inside a just-bash sandbox.
  • use act bash ... when you explicitly need the real host bash tool.
  • reason in Bash expects: reason [prompt|-] [structure]
  • act <tool> - expects JSON from stdin (not plain text)

Environment Variables

RAS Mode Selection

Control which RAS runtime surface to enable (only one at a time):

# Enable Python RAS (default)
export RAS_MODE=python

# Enable TypeScript RAS
export RAS_MODE=typescript

# Aliases also supported
export RAS_MODE=ts

# Enable Bash RAS
export RAS_MODE=bash

File System Configuration

# Root directory for file operations
export NODE_FS_ROOT=/path/to/root

# Mount point path visible in Python/TypeScript runtimes
export NODE_FS_MOUNT_POINT=/path/to/mount

Usage

import { agent } from "./src/agent";

await agent("Calculate fibonacci sequence up to 100");

CLI Model Configuration

The one CLI and the built-in reason() function use different config scopes.

  • one auth configures the main one agent model used by one repl and other top-level one CLI flows.
  • one reason auth configures the model used by reason() inside the Reason-able Action Space.

By default these write separate config files under ~/.config/one/:

  • one auth writes one.json
  • one reason auth writes reason.json

Example:

# Configure the main one agent model
one auth

# Configure the model used by reason()
one reason auth

This separation is intentional: you can use one model/provider for the main agent loop and a different model/provider for bounded reason() calls.

Contributing

Development setup, local scripts, and contributor workflow now live in CONTRIBUTING.md.

Credits

Parts of the tool implementation in this repository were informed by public ideas and patterns from these agent projects:

License

This repository is licensed under Apache-2.0. See LICENSE and NOTICE at the repository root.

About

The `one tool to rule them all` agent that implements Re in Act pattern

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors