Euxis API Reference¶
Complete function reference for all 8 library modules in core/lib/.
common.sh — Logging, UI & Performance¶
Function |
Signature |
Description |
|---|---|---|
|
|
Log informational message to stderr |
|
|
Log error message to stderr |
|
|
Log debug message (only when |
|
|
Log warning message to stderr |
|
|
Returns current time in nanoseconds (falls back to seconds on macOS) |
|
|
Start a latency timer |
|
|
Returns elapsed milliseconds since timer start |
|
|
Returns 0 if within budget, 1 if exceeded; logs warning on exceed |
|
|
Append JSONL metric to |
|
|
Start background spinner for LLM wait |
|
|
Stop and clear spinner |
Environment Variables:
EUXIS_DEBUG— Set to1to enable debug loggingEUXIS_PERF_LOG— Path to JSONL performance metrics file (default:$EUXIS_HOME/data/runtime/perf/metrics.jsonl)
providers.sh — Provider Routing & Execution¶
Depends on: common.sh
Function |
Signature |
Description |
|---|---|---|
|
|
Returns optimal provider for agent based on intelligence tiering. P0 priority always returns |
|
|
Sets |
|
|
Resolves config and dispatches prompt to the named provider CLI |
|
|
Execute via Claude CLI with tools, streaming, and prompt caching |
|
|
Execute via Gemini CLI in plain-text mode |
|
|
Execute via OpenAI Codex CLI |
|
|
Execute via Ollama (local) |
|
|
Execute via Qwen CLI |
|
|
Execute via Charm Crush TUI |
|
|
Execute via Kiro CLI (kiro-cli) |
|
|
Execute via Block Goose |
Provider Routing:
Default provider is EUXIS_DEFAULT_PROVIDER (defaults to claude). Fallback chain is controlled by EUXIS_FALLBACK_CHAIN.
agents.sh — Agent Discovery, Lifecycle & Plugins¶
Function |
Signature |
Description |
|---|---|---|
|
|
Returns absolute path to agent prompt file (searches core/ then fleet/). Returns empty + exit 1 if not found. |
|
|
Lists all agent IDs (excludes |
|
|
Records state transition (idle/active/completed/failed/timeout). Writes atomic state file + JSONL log. |
|
|
Returns current state string (default: |
|
|
Lists agent IDs currently in |
|
|
Returns count of active agents (for coordination overhead measurement) |
|
|
Transitions agents stuck in |
|
|
Registers third-party agent from JSON manifest. Symlinks prompt into fleet/, stores manifest in config/plugins/. Requires |
|
|
Removes plugin agent prompt and manifest |
|
|
Lists registered plugin agent IDs |
|
|
Returns |
|
|
Returns |
|
|
Prints table of all agents with liveness/readiness status |
Lifecycle States: idle -> active -> completed | failed | timeout
Plugin Manifest Format:
{
"agent_id": "my-agent",
"role": "specialist",
"prompt_file": "/path/to/prompt.txt",
"tier": "standard",
"tags": ["custom"]
}
memory.sh — Tiered Memory, Pruning & Drift Detection¶
Function |
Signature |
Description |
|---|---|---|
|
|
Returns last 20 lines of memory file (Tier 1) |
|
|
Keyword-searches full memory file, returns up to 10 unique matches (Tier 2) |
|
|
Searches sibling agent memories for relevant context (Tier 3, read-only) |
|
|
Assembles all 3 tiers into formatted context block |
|
|
Pure-bash keyword extraction: words >= 5 chars, deduplicated, max 10, pipe-separated |
|
|
Reduces memory file size. Preserves REFLECTION/CONTRAINDICATION entries permanently. Keeps most recent N entries. |
|
|
Prunes all memory files in a project |
|
|
Detects contradictions between new fact and existing memories via negation and value-change heuristics |
|
|
Resolves detected drift. Modes: |
|
|
Extracts entities from recent memories and creates knowledge graph edges via |
Environment Variables:
EUXIS_MEMORY_MAX_LINES— Pruning threshold (default: 500)EUXIS_MEMORY_RECENT_KEEP— Lines to retain after pruning (default: 100)
Memory Entry Types:
Type |
Prefix |
Pruning Behavior |
|---|---|---|
Episodic |
|
Prunable (oldest first) |
Semantic |
|
Prunable (oldest first) |
Procedural |
|
Prunable unless contains CONTRAINDICATION |
Reflection |
|
Permanent — never pruned |
Contraindication |
|
Permanent — never pruned |
session.sh — Project & Session Management¶
Function |
Signature |
Description |
|---|---|---|
|
|
Returns |
|
|
Returns |
|
|
Creates project/agent directory structure with audit.md and memory.md |
|
|
Returns last N lines of memory file (default: 50) |
template.sh — Variable Substitution¶
Function |
Signature |
Description |
|---|---|---|
|
|
Pure-bash |
|
|
Returns approximate token count (1 token ~ 4 chars) |
Supported Variables:
{{AUDIT_FILE_PATH}}, {{MEMORY_FILE_PATH}}, {{SESSION_ID}}, {{MODEL_NAME}}, {{EUXIS_HOME}}, {{PROMPTS_DIR}}, {{PROJECTS_DIR}}
skill-detector.sh — Project Auto-Detection¶
Function |
Signature |
Description |
|---|---|---|
|
|
Scans directory for project indicators and returns space-separated recommended agent IDs |
|
|
Returns project type labels (e.g., |
Detection Rules:
Indicator |
Detected Agents |
|---|---|
|
designer, tactician |
|
tester |
|
tester, automaton |
|
automaton, optimizer |
|
sentinel, pentester |
|
automaton, gatekeeper |
|
optimizer, debugger, custodian |
|
maintainer |
prompt.sh — Prompt Assembly & Caching¶
Depends on: agents.sh, memory.sh, template.sh
Function |
Signature |
Description |
|---|---|---|
|
|
Loads mandatory protocols (_common.txt, _protocol.txt) plus conditional protocols based on task keywords. Token-budgeted and cached by keyword fingerprint. |
|
|
Full prompt assembly: protocols + agent prompt + template substitution + tiered memory + fleet roster + dispatch directive |
|
|
Generates deterministic cache key from task keyword categories |
|
|
Returns comma-separated agent IDs from data/agents/registry.json (memoized by file mtime) |
Environment Variables:
EUXIS_PROTOCOL_TOKEN_BUDGET— Max tokens for optional protocol loading (default: 12000)EUXIS_DISPATCH— Set totrueto inject structured JSON intermediate output directive
Conditional Protocol Loading:
Keywords |
Protocol File |
|---|---|
security, auth, cred, secret, pii |
|
version, release, bump, semver |
|
escalat, incident, sev, outage |
|
evidence, citation, source, fact |
|
handoff, artifact, schema, json |
|
brand, signature, logo |
|
synth, aggregate, merge |
|
bus, pubsub, message, topic |
|
graph, entity, edge, knowledge |
|
CLI Tools¶
Tool |
Description |
|---|---|
|
Main entry point — agent dispatch with latency budgets |
|
8-check static analysis (registry, protocol, versions, permissions, headers, patterns, compliance, deps) |
|
7-benchmark performance suite (health, lint, recall, provider, coordination, assembly, memory) |
|
System health check with |
|
Multi-agent pipeline orchestration (mesh/federated/sequential) |
|
Iterative agent execution with convergence |
|
Multi-agent deliberation and voting |
|
Knowledge graph operations (add-edge, query) |
|
Automated maintenance (memory pruning, stale cleanup) |
Euxis v0.0.20 · Build something that matters.