Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
190 changes: 190 additions & 0 deletions AGENTS.md

Large diffs are not rendered by default.

172 changes: 2 additions & 170 deletions CLAUDE.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ bazilion completion bash|zsh|fish # print a shell completion script
- **Pi agent engine** — Bazilion is based on [pi-coding-agent](https://www.npmjs.com/package/@earendil-works/pi-coding-agent). Pi runs each turn, stores the canonical JSONL transcript under the agent's `sessions/` directory, handles replay and compaction, executes the provider/tool loop, and supplies the coding tools. Bazilion contributes the multi-agent shell around that engine: profiles, groups, USER.md, memory, mailbox, scheduler, browser/MCP integrations, and clients.
- **Group** — a collaboration context: one filesystem root, one USER.md, one roster, one shared memory. Every agent belongs to exactly one group, chosen at spawn time. The agent's coding tools (`read`/`bash`/`edit`/`write`/`grep`/`find`/`ls`, supplied by [pi-coding-agent](https://www.npmjs.com/package/@earendil-works/pi-coding-agent)) are rooted at the group directory. USER.md is read-only to agents — edit it via `bazilion group user-md set` or the web UI. First-run setup seeds a `default` group at `~/.bazilion/groups/default/`. Groups always live under `~/.bazilion/groups/<slug>/`; pass `--link <existing-path>` to `bazilion group add` to materialize the slot as a symlink to your existing project tree instead of as a fresh directory.
- **Agent** — an instance spawned from a profile into a group. Has a private home (`~/.bazilion/agents/<id>/` — its copy of the templates, plus pi's append-only session JSONL under `sessions/`) reachable via the `home_*` tools, and one group membership reachable via the coding tools. UUIDs as ids.
- **Skill** — a directory under `~/.bazilion/skills/<name>/` with a `SKILL.md` (standard OpenClaw / Anthropic agent-skill format). Imported via `bazilion skill import --from openclaw` (or any path). The body is injected into the system prompt of every agent the skill is attached to; helper scripts shipped alongside the markdown are invoked by the agent via its generic `bash` tool (no framework-level entrypoint and no trust gate — see CLAUDE.md for why we removed both).
- **Skill** — a directory under `~/.bazilion/skills/<name>/` with a `SKILL.md` (standard OpenClaw / Anthropic agent-skill format). Imported via `bazilion skill import --from openclaw` (or any path). The body is injected into the system prompt of every agent the skill is attached to; helper scripts shipped alongside the markdown are invoked by the agent via its generic `bash` tool (no framework-level entrypoint and no trust gate — see AGENTS.md for why we removed both).
- **Memory** — **group-shared** BM25 index rooted at `<groupPath>/memory/`. Every agent in the group reads + writes the same store. The current backend is `qmdBackend` (BM25 over markdown via [@tobilu/qmd](https://github.com/tobi/qmd)). Use it for project knowledge — codebase notes, decisions, things the user told you about the work; for personal notes about an agent (preferences, persona quirks), use `home_write` on `IDENTITY.md` instead.
- **Mailbox** — `messages` table. Agents talk to each other via `send_message` / `read_inbox` / `wait_for_reply` tools, via `bazilion send` from the CLI, or from outside the loop: `bazilion inbox list <agent> [--unread]`, `bazilion inbox show <id>`, `bazilion inbox read <id>`, or the web UI at `/agents/<id>/inbox`. The worker delegates these tool calls to the daemon over Node IPC — workers don't hold their own SQLite handle.
- **Trigger** — a heartbeat (interval in seconds) or cron expression that periodically wakes an agent with a stored message. An in-process scheduler ticks every 5 s (overridable via `BAZILION_SCHEDULER_TICK_MS`; disable with `BAZILION_SCHEDULER=off`) and fires due triggers through the same code path as user chat. Example: `bazilion trigger add <agent> --every 300 --message "check your inbox"`.
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/lib/wire-constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// (`apps/daemon/src/core`) and re-exported through `@bazilion/api-types`. We
// re-declare them here rather than reaching into daemon source so the web
// app stays decoupled from Node-only deps (the architecture mandate is
// "apps/web never reaches into daemon source" — see CLAUDE.md). Daemon-side
// "apps/web never reaches into daemon source" — see AGENTS.md). Daemon-side
// validation re-checks every wire string against the source of truth, so
// a drift here surfaces as a 4xx, never as silent corruption.

Expand Down
4 changes: 2 additions & 2 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ Uses Node 22's built-in `node:sqlite` (`DatabaseSync`). No `better-sqlite3`, no
| `agent_skills` | `(agent_id, skill_name)` — per-agent skill attachments. Cascade on agent delete. |
| `agent_triggers` | Per-agent wake-ups (`kind='interval' \| 'cron'`, `interval_sec`, `cron_expr`, `message`, `last_fired_at`, `enabled`). |
| `messages` | Inter-agent mailbox (`id`, `from_agent_id`, `to_agent_id`, `payload`, `reply_to`, `read_at`). FKs do **not** cascade; `agent/delete.ts` nulls inbound `reply_to` and purges rows manually before removing the agent. |
| `skill_meta` | Import provenance — `(name PK, source, imported_at)`. No trust column — see "Skill model" in CLAUDE.md. |
| `skill_meta` | Import provenance — `(name PK, source, imported_at)`. No trust column — see "Skill model" in AGENTS.md. |
| `web_tokens` | Per-token access records (hashed). The `bootstrap` row's plaintext lives in `auth.json`; revoking it returns 409 (would lock the operator out). |
| `provider_models` | Curated model list per provider (what shows up in dropdowns). |
| `provider_state` | Per-provider enabled flag. |
Expand Down Expand Up @@ -389,7 +389,7 @@ Cancellation: `POST /api/agents/:id/cancel` → `cancelAgent(id)` → the stored

## 4b. `apps/web` — the browser UI (TanStack Start)

React 19 + Vite 7 + Tailwind v4 + shadcn/ui. File-based routes via `@tanstack/react-router`; `src/router.tsx` exports `getRouter`. Server fns use `.inputValidator()`. Bound to `127.0.0.1:4322` by default (`WEB_HOST` / `WEB_PORT`).
React 19 + Vite 8 + Tailwind v4 + shadcn/ui. File-based routes via `@tanstack/react-router`; `src/router.tsx` exports `getRouter`. Server fns use `.inputValidator()`. Bound to `127.0.0.1:4322` by default (`WEB_HOST` / `WEB_PORT`).

**Daemon-only client** — `apps/web` never reaches into daemon source; the only daemon-facing types it imports are wire shapes from `@bazilion/api-types`. Every loader is a `createServerFn` handler that calls `apps/web/src/lib/daemon-client.ts`, which reads the request's `bz_token` cookie via `getCookie` from `@tanstack/react-start/server` and forwards it as `Authorization: Bearer …` to the daemon (`http://127.0.0.1:4321`, overridable via `BAZILION_DAEMON`).

Expand Down
6 changes: 3 additions & 3 deletions docs/openclaw-reference.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OpenClaw — reference for Bazilion contributors

Bazilion's README and `CLAUDE.md` call the project "OpenClaw-inspired", and the daemon literally reads `~/.openclaw/skills/` when you run `bazilion skill import --from openclaw`. This doc captures what upstream OpenClaw actually is, so contributors know what we borrowed, what we deliberately didn't, and where the format we accept comes from.
Bazilion's README and `AGENTS.md` call the project "OpenClaw-inspired", and the daemon literally reads `~/.openclaw/skills/` when you run `bazilion skill import --from openclaw`. This doc captures what upstream OpenClaw actually is, so contributors know what we borrowed, what we deliberately didn't, and where the format we accept comes from.

Snapshot date: 2026-05-17. Source: `docs.openclaw.ai` + `github.com/openclaw/openclaw` `main`. Re-fetch before relying on exact counts.

Expand Down Expand Up @@ -179,7 +179,7 @@ Official registry: `github.com/openclaw/clawhub`. ~13,729 third-party skills as

**Borrowed:**

- The **prompt-only skill model.** `apps/daemon/src/core/skills/` reads `SKILL.md` and injects the body into the system prompt of every attached agent. Helper scripts run via the agent's generic `bash` tool. See `CLAUDE.md` → "OpenClaw skill model: prompt-only".
- The **prompt-only skill model.** `apps/daemon/src/core/skills/` reads `SKILL.md` and injects the body into the system prompt of every attached agent. Helper scripts run via the agent's generic `bash` tool. See `AGENTS.md` → "OpenClaw skill model: prompt-only".
- The **`SKILL.md` + YAML frontmatter format.** Upstream skills "drop in unchanged" per the README — `bazilion skill import --from openclaw` resolves to `~/.openclaw/skills/` (see `apps/daemon/src/routes/skills.ts`).
- The general idea of a per-user state root with a workspace concept. Bazilion's `~/.bazilion/groups/<slug>/` is roughly the analogue of OpenClaw's `<workspace>/`.

Expand All @@ -192,7 +192,7 @@ Official registry: `github.com/openclaw/clawhub`. ~13,729 third-party skills as
- The **plugin model** (28 hooks, TypeScript in-process modules, `openclaw.plugin.json`). Bazilion has no plugin SDK — all extensibility goes through skills + native daemon code.
- **Channels.** Upstream's first-class WhatsApp/Telegram/iMessage/Signal transports have no Bazilion equivalent; we expose HTTP only.
- **ClawHub.** No registry integration.
- **JSON5 `openclaw.json`** config surface. Bazilion stores config in the daemon's SQLite (`config` table) + secrets in the encrypted `secrets` table (see `CLAUDE.md` → "Secrets and config").
- **JSON5 `openclaw.json`** config surface. Bazilion stores config in the daemon's SQLite (`config` table) + secrets in the encrypted `secrets` table (see `AGENTS.md` → "Secrets and config").
- The richer skill frontmatter (`user-invocable`, `command-dispatch`, `disable-model-invocation`, install recipes). Bazilion's skill loader only consumes `name` + `description` + body today.

## 7. Authoritative sources
Expand Down
Loading