Skip to content
المشاريع

حول

Self-hosted AI engineering team on Bun + SQLite: Super Assistant + specialist coding agents across 4 ACP harnesses (oma, Claude Code, pi, omp), Git Wiki & Web/Lark sync.

أدوات التطوير

كيف تُقاس هذه الأرقام

النمو المقاس للنجوم

خلال 24 ساعة
؜-١
خلال 7 أيام
جارٍ جمع السجل
خلال 15 يومًا
جارٍ جمع السجل
خلال شهر
جارٍ جمع السجل

تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.

README.md

الأصل

OmaHQ

Run a self-hosted AI engineering team without drowning in terminal noise.

One front-desk Personal Assistant guards your attention while specialist workers execute in isolated git workshops — across oma, Claude Code, pi, and omp on a single Bun + SQLite stack.

English · 简体中文 · Website · User Guide

Website Bun TypeScript Next.js SQLite npm version (rc) npm downloads License: MIT CI

Product Model · PA + Worker · Skills + MCP · Screenshots · Quick Start · Architecture · Security · Docs


OmaHQ walkthrough: Today, Chat with Live HTML Preview & Ask Q&A, Requirements, Multi-Harness Team, Workflow DAG, Observability & Evals, and Git Wiki

End-to-end walkthrough: Today → Chat (Ask Q&A & Live HTML Preview) → Requirements → 4-Harness Team → Workflow DAG → Observability & Evals → Git Wiki · Download full HD MP4


Scaling from one coding agent to an engineering team breaks human attention long before it hits token limits. OmaHQ turns isolated terminal agents into a coordinated, self-improving team on a single Bun + SQLite stack:

🧭 Two Pillars: Attention Management × AI-Native Loop

Pillar What It Solves Built-In Capabilities
Attention Management Keeps noisy tool logs, worker back-and-forth, and raw telemetry out of your way so you spend attention only on irreducible decisions. PA Attention Firewall & /today triage · Persistent Ask Q&A cards & fail-closed approvals · Two-Agent Delivery Gate · Propose ≠ Save + Proposal Eval Regression Gate · Zero-log AI Health Brief (Top 1–3 anomalies instead of raw dashboards).
AI-Native Engineering Loop Turns every chat turn, failure, and delivery into an addressable, replayable, self-improving engineering flywheel. 4 Coding Harnesses (oma · Claude Code · pi · omp) over one ACP rail · 7 @ Cite Domain URIs + live sandboxed HTML/SVG previews & pasted images · Rewind & Replay knob-tuning workbench → solidify into *.eval.json · Functional Evals with tool sandboxing & mockAnswers + eval_auto_tune · Git Wiki knowledge flywheel.

👥 The PA + Worker Team Model

Most coding agents put chat, planning, shell execution, and git writes inside one omnipotent loop — one misunderstanding silently mutates your repository or buries your chat in tool noise.

OmaHQ enforces a hard organizational boundary in code (not just system prompts): one Personal Assistant (PA) manages your attention at the front desk, while Specialist Workers execute in isolated workshops.

flowchart LR
    H["You (Web / Lark)"] <-->|Requirements · Decisions · Delivery| PA["Personal Assistant (Front Desk)\nNo bash · No repo writes"]

    PA -->|scoped child session| W1["Backend Coder (Claude Code / oma)\nIsolated git copy -> agent/<runId>"]
    PA -->|independent audit| W2["Security Reviewer (pi / oma)\nClears Delivery Gate"]
    PA -->|deep research| W3["Infra Researcher (omp / oma)\nCodebase & profiling"]

    W1 -.->|escalates blocker| PA
    PA -->|compiles durable lessons| WIKI["Git-Backed Wiki"]
    PA -.->|irreversible / policy gate| H

Who Does What (Enforced by Runtime & Tool Boundaries)

Role What it owns Hard boundary (enforced in code)
You (Human) Team roster, permissions, irreversible approvals, merge & acceptance decisions. Agents can propose new projects, workflows, or member settings — nothing is saved or merged without your explicit confirmation.
Personal Assistant (PA / Front Desk) Your attention & main conversation: clarifies intent, turns real goals into tracked Requirements, selects workers by capability, monitors progress, answers worker questions from context/Wiki, and compiles knowledge into the Git Wiki. Physically has no execution tools (bash, write, edit, read, eval, browser). It cannot silently inspect or hack your codebase — any work outside the conversation must be dispatched to a worker.
Specialist Workers (Coder, Reviewer, Researcher, ...) Deep execution inside isolated child conversations and isolated git project copies using any harness (oma, Claude Code, pi, omp) with per-worker SOUL.md, skills, and MCP servers. Cannot talk to you uninvited (unless you explicitly step in via direct line or worktree terminal); project_push only pushes agent/<runId> branches (pushing main/master is rejected); deny_write_paths & deny_commands block workspace escape.

How One Request Flows End-to-End

  1. You talk to the PA in Web or Lark/Feishu (e.g., "Harden /webhooks/stripe with atomic idempotency keys and have Security Reviewer verify it").
  2. Track & Dispatch — The PA creates a tracked Requirement (goal, constraints, acceptance criteria) and dispatches a Coder into an isolated child session and isolated git worktree.
  3. Escalation & Fail-Closed Approvals — If a worker hits a missing detail, the PA answers from the brief/Wiki or escalates to you as a persistent decision card; high-risk shell/file actions pause on fail-closed approval cards (timeout = deny).
  4. Two-Agent Delivery Gate — The Coder pushes only to agent/<runId> and emits typed artifacts://. Until a second worker (e.g., Reviewer) independently verifies the diff and tests, the backend automatically stamps the delivery Unverified. You decide whether to merge.
  5. Knowledge Compounds in Git — Decisions, root causes, and architectural lessons are committed to the shared Git Wiki with source citations — instead of evaporating inside chat logs.

🎛 Operate the Console via Chat (Skills + Product MCP)

In OmaHQ, conversation isn't only for coding tasks — you operate the control plane itself through chat.

Resource editors (Members, Projects, Workflows, Evals) embed a live PA side-panel next to the form. Type / to invoke 11 progressive Skills from skills/, backed by per-Run Product MCP servers (product-tools, agent-config, workflow) authenticated with single-Run bearer tokens revoked on settle.

Propose ≠ Save + Eval Regression Gate: agents never silently overwrite live team config, project bindings, workflow DAGs, or Auto-Tune patches. Every mutation returns a field-by-field Proposal Card (backed by an Eval Regression Gate for member changes) before explicit Save.

Slash Skill Role Product MCP Tools What you can do in chat
/member_manage PA team_list, agent_read, agent_write, agent_create, model_list Inspect the team roster and propose adding or updating a member's harness, model, role, or write-path policy.
/project_manage PA project_list, project_detail, project_propose, project_attach Register/edit Git projects and bind repos to workers (with human approval).
/requirement_memory PA requirement_track, requirement_query Create, update, and recall durable Requirements (goals, constraints, acceptance criteria) across conversations.
/team_dispatch PA dispatch, steer_worker, cancel_worker, answer_worker_request, ask_question, resource_read, artifact_*, history_* Decompose multi-step plans, dispatch or steer/cancel live workers, answer worker blockers from Wiki, and read all 7 domain URIs.
/wiki_manage PA wiki_query, wiki_read, wiki_create, wiki_patch, wiki_lint, wiki_source_add Search, ingest source citations, safely CAS-patch pages, and run health checks across the shared Git Wiki.
/reminder_manage PA remind_me, reminder_list, reminder_cancel Schedule, inspect, or cancel one-shot and recurring UTC cron reminders in the current conversation.
/workflow_design PA & Worker workflow_read, workflow_save, workflow_run Generate and schema-validate *.workflow.json DAGs (parseWorkflow), surfaced in the editor as an unsaved proposal.
/skills_about PA & Worker skill_load, ${SKILL_DIR} index Inspect how two-stage progressive skill discovery works and how bundled scripts resolve.
/worker_delivery Worker report, handback, project_push, artifact_upload, todo_write Report progress/blockers with verification status, hand back out-of-scope tasks, and deliver agent/<runId> branches + typed artifacts.
/agent_doctor Worker Workspace memory + conversation ledger inspection Diagnose another teammate's context drift against canonical ledger facts and propose targeted fixes without mutating its memory.
/agent_fanout Worker task (batch fan-out up to 64 items / 8 concurrent), workflow_run Run parallel subagent audits, migrations, multi-source research, and fix-until-pass orchestration scripts inside a sandboxed VM.

AI-Native Diagnostics & Eval Tools: The PA can also directly call run_diagnose, eval_list, eval_inspect, eval_run, eval_diff, eval_case_add, and eval_auto_tune to diagnose anomalies, turn failures into regression cases, and propose Auto-Tune patches. Builtin skills are role-scoped (roles: front vs roles: worker) across all four harnesses (oma, Claude Code, pi, omp) and load progressively in two stages (skill_load + ${SKILL_DIR}).

✨ Why OmaHQ

Capability What you get
Attention Management First The PA absorbs multi-worker noise, answers routine escalations from Brief/Wiki, and surfaces only irreducible decisions in /today plus zero-log AI Health Brief anomaly digests in /system.
Unified @ Cite URIs & Live Previews Address artifacts://, requirements://, workflows://, wiki://, projects://, chats://, and agents:// via @ Cite — rendered as compact inline chips, artifact-backed pasted images (with vision-model guard), and capped sandboxed HTML/SVG previews right inside chat.
Rewind / Replay → Functional Evals → Auto-Tune Fork & replay any turn with model/prompt/effort/tool overrides, solidify winning or failing runs straight into Git-versioned *.eval.json suites (with tool sandboxing & mockAnswers), track Experiment Pass-Rate Trends, and gate eval_auto_tune proposals with an Eval Regression Gate.
One ACP Rail, Four Coding Harnesses Assign oma (built-in CLI/TUI runtime), Claude Code, pi, or omp per agent behind one unified ACP child-process boundary — swap engines without changing your console, Lark bot, or approval flow.
Workspace-as-Config & Git Wiki Every agent's identity (SOUL.md, USER.md), skills, MCP servers, and memory are plain files. Durable lessons live in a git-backed Wiki (raw/ citations + compiled pages) instead of decaying inside chat history.
One Ledger, Every Surface in Sync Web Console, Lark/Feishu IM bot, Oma TUI, and in-browser Coding worktree terminals all project one SQLite ledger — zero Docker Compose, Postgres, or Redis.

📸 Screenshots

Today Inbox
Today Inbox — attention triage: pending human gates, active goals, work sessions & team roster
Chat Run Console
Chat Console — inline artifacts:// chips, live sandboxed HTML Delivery Gate preview & settled Ask Q&A
Observability and AI Health Brief
Observability & AI Health Brief — zero-log anomaly digest, active latency, prompt cache hit & 24h token telemetry
Functional Evals and Experiment Trend
Functional Evals & Auto-Tune — regression suites, Experiment Pass-Rate Trend (63% → 100%) & P95 latency
Workflow DAG Orchestrator
Agentic Workflow DAG — agent, bubblewrap-sandboxed script, and human sign-off gate nodes
Tracked Requirements
Tracked Requirements — goals, constraints, acceptance criteria & Two-Agent Delivery Gate runs
More screenshots (Multi-Harness Team, Git-Backed Wiki, Oma TUI)
Multi-Harness Team (oma · claude · pi · omp) Git-Backed LLM Wiki
Team agents across harnesses Git-backed LLM Wiki
Oma TUI — Interactive Session Oma TUI — Tool Calls & Mermaid
Oma TUI real session Oma TUI mermaid

🚀 Quick Start

Option 1: Prebuilt CLI + Gateway (Fastest)

Install oma together with the prebuilt backend + web gateway bundle (requires tar and zstd; Bun is installed automatically if missing):

curl -fsSL https://raw.githubusercontent.com/Chengchcc/oma-hq/master/scripts/install.sh | OMA_VERSION=rc sh
oma gateway up        # foreground; use `oma gateway up -d` for background

OMA_VERSION=rc pulls the npm rc channel while oma gateway is in release candidate. The installer downloads the bundle to ~/.oma/gateway/ and never auto-starts services.

Open http://127.0.0.1:3001/login and sign in with the password printed by oma gateway up (stored with 0600 permissions in ~/.oma/gateway-secrets.json). You can change it in Settings → Login password or via oma gateway passwd.

Common commands:

Command Action
oma gateway up / up -d Start backend + web (foreground / background, returns once healthy)
oma gateway status Show installed version, process health, and login password
oma gateway down Stop background gateway
oma update Upgrade CLI and gateway bundle together (--check to inspect only)
oma -p "Summarize docs/architecture/README.md in 3 bullets" Run a one-shot CLI prompt with oma

Manual install: bun add -g @chengchenccc/oh-my-agent@rc && oma gateway fetch && oma gateway up (fetch is required because Bun skips dependency postinstall scripts by default). Code (~/.oma/gateway/) and state (~/.oma/gateway-data/) are stored separately so upgrades preserve your data.

Option 2: Run from Source

1. Prerequisites

  • Bun >= 1.3.14 (package.json pins 1.3.14; CI & releases run 1.4.4)
  • System tools: ripgrep, bubblewrap, and openssl (used by scripts/predev.sh to generate local secrets)
  • Anthropic API key: ANTHROPIC_API_KEY or ANTHROPIC_AUTH_TOKEN (for other providers, see below)

2. Install dependencies

bun install

3. Start backend + web

export ANTHROPIC_API_KEY=sk-ant-...   # or ANTHROPIC_AUTH_TOKEN=...
bun run dev

bun run dev automatically runs scripts/predev.sh (generates .env files with random BACKEND_AUTH_TOKEN, SESSION_SECRET, and MOCK_PASSWORD, runs Drizzle migrations, and prepares Monaco assets) and then scripts/dev.sh (starts backend on :3000 and web on :3001).

4. Verify

  • Backend health: curl -s http://127.0.0.1:3000/health → {"status":"ok"}
  • Web console: open http://localhost:3001/login with MOCK_PASSWORD from the generated .env inside apps/web
Using OpenAI, DeepSeek, Groq, OpenRouter, or custom providers (and password / dev DB reset)

scripts/dev.sh checks for an Anthropic key, but the backend runtime supports any configured provider. To run without an Anthropic key, start backend and web in two terminals:

bun run predev       # generate .env & secrets once

# Terminal 1
export OPENAI_API_KEY=sk-...
bun run dev:backend  # http://127.0.0.1:3000

# Terminal 2
bun run dev:web      # http://localhost:3001

Supported built-in provider environment variables:

Provider Environment Variable
Anthropic ANTHROPIC_API_KEY
OpenAI OPENAI_API_KEY
DeepSeek DEEPSEEK_API_KEY
Groq GROQ_API_KEY
OpenRouter OPENROUTER_API_KEY

Custom providers and model overrides are configured in ~/.oma/models.yml (see Security Model for gateway path isolation).

  • Reset login password: MOCK_PASSWORD is only adopted on the first boot of a fresh data directory. Run bash scripts/reset-login-password.sh and restart the backend to reset it.
  • Dev database upgrades: migrations target fresh-boot paths. If a schema change breaks an old local dev DB, delete apps/backend/.backend-data/ and restart.

🏗 Architecture

flowchart TB
    subgraph Surfaces["Surfaces"]
        WEB["Web Console (Next.js 15)"]
        LARK["Lark / Feishu Bot"]
        TUI["Oma TUI & Coding Terminals"]
    end

    subgraph Backend["Product Backend (Elysia + SQLite)"]
        LEDGER["Conversation Ledger · Agent Context · Requirements · Wiki"]
        CTRL["Run Dispatcher · Workflow Engine · Artifacts · Approvals"]
    end

    subgraph ACP["ACP Child-Process Boundary (One Rail, Four Harnesses)"]
        OMA["oma (built-in runtime)"]
        CLAUDE["Claude Code"]
        PI["pi"]
        OMP["omp"]
    end

    PROTO["Shared Protocols: Message · ChatModel · Tool · ContentBlock · Workflow DSL"]

    WEB -->|HTTP / SSE / WS| LEDGER
    LARK -->|HTTP / SSE| LEDGER
    TUI -->|RPC / PTY| CTRL
    LEDGER <--> CTRL
    CTRL -->|spawn per Run via ACP| OMA
    CTRL -->|spawn per Run via ACP| CLAUDE
    CTRL -->|spawn per Run via ACP| PI
    CTRL -->|spawn per Run via ACP| OMP
    OMA --- PROTO
    CLAUDE --- PROTO
    PI --- PROTO
    OMP --- PROTO

Engineering Invariants

  • Single source of truth: the backend owns conversation_ledger; Web, Lark, and TUI are pure projections of the same canonical facts.
  • Atomic terminal commits: every Run settles into one BackendRunOutcome and commits History + Context in a single SQLite transaction. Streaming output never pollutes canonical facts.
  • One-shot isolated processes: each Run spawns one child process over ACP; cross-run context continuity uses each harness's native session reference without long-lived daemon drift.
  • Fail-closed HITL: approvals and user questions persist in pending_action; timeouts default to deny.
  • Frozen workflow routing: conditional edges evaluate at node completion and freeze into CompletionRecord.routedTo (join semantics = any-of).
  • Config as files: agent definitions live in workspace files and freeze once per Run.

🔐 Security Model

OmaHQ is built for a single-operator, local/self-hosted threat model. Web login, the BFF, and the backend share one operator identity — there is no multi-tenant isolation. Do not expose this stack directly to the public internet as a multi-user service.

Concrete security boundaries enforced by the runtime:

  • Localhost by default: services bind to 127.0.0.1 only.
  • Worker repo isolation: workers operate in isolated project copies and project_push only pushes to agent/<runId> branches (pushing main/master is rejected); per-agent deny_write_paths, allow_write_paths, and deny_commands block path escape and cross-repo git writes.
  • Sandboxed workflow scripts: disabled by default (WORKFLOW_SCRIPTS_ENABLED=1 required); when enabled, scripts run inside bwrap / sandbox-exec with no network access, an isolated PID namespace, and no read access to dataDir or .env.
  • Lark sender allowlist: inbound Lark messages are restricted to agent.lark.allowed_senders open_ids; bot-authored messages are dropped.
  • Server-side secret masking: provider keys and MCP headers stay on the backend and are masked on every HTTP read.
  • Provider config isolation: spawned agent subprocesses read model config strictly from $OMA_HOME/models.yml rather than agent-writable workspaces, preventing a Run from hijacking the next Run's provider baseUrl or API key.

📦 Repository Structure

apps/
  backend/       Elysia backend — HTTP/SSE/WS, ledger, runs, workflows, wiki, artifacts, observability, evals, product MCP
  oh-my-agent/   Oma CLI & runtime — print / json / tui / acp modes, agent loop, plugins, compaction
  web/           Next.js 15 console — Today, Chat, Requirements, Team, Workflows, Coding, Wiki, Observability, Evals, Channels
  lark-bot/      Lark / Feishu IM bot adapter

packages/
  message/       Core protocol: Message, ChatModel, Tool, ContentBlock, stream utilities
  ai/            Multi-provider model registry & protocol adapters (Anthropic, OpenAI, DeepSeek, etc.)
  workflow/      Pure Agentic Workflow DSL: node graph, JSON-Logic routing, computeNext engine
  sandbox/       Process sandbox for workflow script nodes and oma eval tool
  adapter-mcp/   External MCP client mount
  ahp-client/    WebSocket transport & state mirror for Agent Host Protocol surfaces
  api-contract/  Cross-process type contracts (SSE events, Eden Treaty)
  embedding/     Local embedding support
  source-fetch/  Git / archive source materializer
  tui/           Terminal UI toolkit (editor, markdown, mermaid)
  config/        Configuration loader
  test-helpers/  Deterministic test doubles (echoModel)

Development commands:

bun run format          # Biome format
bun run lint            # Biome + ESLint
bun run typecheck       # tsc --noEmit across all workspaces
bun run test            # Full test suite (turbo)
bun run build           # Full build (turbo)
bun run audit           # Fast contract / workspace / docs / UI gates
bun run audit:coverage  # Coverage floors for oma runtime & backend semantics
bun run quality:mutate  # On-demand mutation testing probe

📚 Documentation

Document Contents
Website & User Guide Product overview and end-to-end usage guide (also in docs/guides/user-guide.md)
Project Wiki Current-state architecture, ADRs, guides, and roadmap
System Overview Execution pipeline, ownership boundaries, and invariants
Design Philosophy 8 architectural principles behind the codebase
Development Guide Local development workflow, testing, and pre-commit gates
Contributing Contribution & pre-commit checklist

📄 License

Licensed under the MIT License.

استكشف مشاريع مشابهة ومرتبطة

جارٍ التحميل…