API Reference

Interface reference

CLI flags, the cycle() options bag, the three adapter interfaces, and the MCP server — everything you need to drive, test, or extend Auriga.

CLI flags

Pass flags to auriga-router.mjs (or via npm run ... scripts in src/router/):

FlagTypeDescription
--once boolean Run exactly one cycle then exit. No sleep, no loop. Equivalent to npm run once.
--dry-run boolean Compute and log all dispatch decisions without executing any assignments. No board mutations. Equivalent to npm run dry.
--max-assign N number Override CAPS.perCycleTotal for this run. Maximum N total dispatches this cycle.
--no-zombie boolean Skip the zombie recovery pass this cycle. Useful for debugging dispatch logic without the zombie pass interfering.
# Convenience scripts in src/router/package.json
npm run once          # node auriga-router.mjs --once
npm run dry           # node auriga-router.mjs --once --dry-run
npm test              # node --test test/*.test.mjs

CLI subcommands

The auriga CLI (at src/router/bin/auriga.mjs) provides subcommands for memory and agent integration:

auriga memory

auriga memory recall  --scope <scope> --query <text>
auriga memory remember --scope <scope> --content <text>

Recall or remember context via the configured MemoryAdapter. The --scope is a namespace string (e.g. a project ID or agent name). Use AURIGA_MEMORY_ADAPTER=stub to use the in-memory stub without a live Mnemosyne instance.

auriga agent

auriga agent init    # detect and wire up Claude Code / Codex MCP server
auriga agent status  # show which agents are registered

Registers Auriga's read-only MCP server with the agent CLI(s) found on the machine. Idempotent — safe to re-run. See MCP server below.


cycle() options bag

cycle(opts) is exported from auriga-router.mjs and is the primary integration point for tests. All dependencies default to their live production singletons, so passing no options is equivalent to running a real production cycle.

OptionTypeDefaultDescription
backlog BacklogAdapter createMulticaBacklogAdapter() Board read/write adapter. Pass a stub for tests.
spawn SpawnAdapter createMulticaSpawnAdapter() Agent dispatch adapter. Pass a stub for tests.
cfg object imported config Full config object (CAPS, AGENTS, lane maps, etc.).
core object imported core Decision logic module. Rarely overridden — only for testing core module itself.
log function console.log Logging function. Captures log output in tests.
sleep function(ms) real sleep Async sleep. Pass async () => {} in tests to skip waits.
dryRun boolean false If true, compute decisions but execute no mutations.
noZombie boolean false If true, skip the zombie recovery pass.
maxAssign number CAPS.perCycleTotal Max total dispatches this cycle.
now number (ms) Date.now() Current timestamp. Override in tests for deterministic zombie detection.
// Example: drive cycle() in a test
import { cycle } from '../auriga-router.mjs';
import { createStubBacklogAdapter } from '../lib/adapters/stub/backlog.mjs';
import { createStubSpawnAdapter } from '../lib/adapters/stub/spawn.mjs';

const backlog = createStubBacklogAdapter({ issues: [...] });
const spawn   = createStubSpawnAdapter();
await cycle({ backlog, spawn, sleep: async () => {}, now: Date.now() });
assert.deepEqual(spawn.calls, [{ op: 'assign', issueId: 'X', agentId: 'Y' }]);

BacklogAdapter

JSDoc typedef in lib/adapters/backlog-adapter.mjs. All methods are synchronous — they return plain values, never Promises.

MethodReturnsDescription
listIssues(projectIds, statuses) Issue[] List issues across the given projects with the given status values.
getIssueRuns(issueId) Run[] Get all runs for an issue, ordered most-recent first.
getIssuePullRequests(issueId) PR[] Get all pull requests linked to an issue.
setIssueStatus(issueId, status) void Set an issue's status. status is one of: todo, in_progress, in_review, done, blocked.
assignIssue(issueId, agentId) void Assign an issue to an agent.
commentOnIssue(issueId, body) void Post a comment on an issue.
getIssue(issueId) Issue Fetch a single issue by ID.

SpawnAdapter

JSDoc typedef in lib/adapters/spawn-adapter.mjs. All methods are synchronous.

MethodReturnsDescription
assignAndRun(issueId, agentId, lane) RunResult Assign an issue to an agent and trigger a run in the given lane. Returns enough information to verify a run started.
rerun(issueId, agentId, lane) RunResult Re-trigger a run for an already-assigned issue (used in zombie recovery).
unassign(issueId) void Remove an agent assignment from an issue.

No provisioning hooks

SpawnAdapter deliberately has no provisioning method, hook, or middleware slot. Auriga must never pre-build concepts for tools it doesn't have a real story for. If a future story needs provisioning, add the method then.


MemoryAdapter

JSDoc typedef in lib/adapters/memory-adapter.mjs. Unlike the other two adapters, MemoryAdapter is async — Mnemosyne's transport is genuinely asynchronous over HTTP.

MethodReturnsDescription
recall(scope, query) Promise<string[]> Recall context entries matching query within scope. Semantic search via Mnemosyne.
remember(scope, content) Promise<void> Store a context entry under scope in Mnemosyne.

The stub implementation (stub/memory.mjs) uses simple substring matching rather than semantic search — sufficient for testing the recall/remember round-trip in isolation.


MCP server

Auriga ships a read-only MCP (Model Context Protocol) server at src/router/lib/mcp/server.mjs. Once registered with an AI agent CLI, the agent can query Auriga's board state directly without the operator dashboard.

Setup

# One-command install + MCP registration
curl -fsSL https://mdostal.github.io/auriga/install.sh | bash

# Or manually after cloning:
auriga agent init     # detects Claude Code / Codex, registers MCP server
auriga agent status   # verify registration

Available MCP tools

ToolDescription
auriga_list_epics List all epics and their story counts.
auriga_list_stories List stories in an epic with status and metadata.
auriga_get_story Get full detail for a single story including acceptance criteria and risks.
auriga_list_activity List recent audit records and commits from .pHive/ state.

Read-only

The MCP server exposes only read operations — it is a window onto Auriga's planning state, not a control channel. No board mutations can be triggered through MCP.