@beevibe/daemon 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +91 -301
- package/dist/main.js +1076 -70
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,354 +1,144 @@
|
|
|
1
|
-
# beevibe
|
|
1
|
+
# @beevibe/daemon
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The local worker. Runs on a user's machine, registers with the api as a `(daemon, runtime)` pair, then claims sessions whose agent's `preferred_runtime_id` matches and spawns the local CLI (`claude`, etc.) to fulfill them. Streams steps back via `/runtime/events` and finalizes with `/runtime/done`.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The daemon never proxies MCP tool calls — the spawned CLI calls the api's `/mcp` endpoint directly using the `bv_a_` agent token written into its workspace's `mcp-config.json`. The daemon only writes that file and supervises the subprocess.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
For full setup, see the [root README](../../README.md).
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## Run it
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Three subcommands. `setup` once; `start` to claim sessions; `update` for the brew/curl install path.
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
- **Docker / docker-compose** — `git clone && docker compose up` against a tagged release (see [Self-hosting](#self-hosting) below).
|
|
20
|
-
- **Manual** — `pnpm install && pnpm build && pnpm start` per service against your own Postgres.
|
|
21
|
-
|
|
22
|
-
The repo and its tagged releases are the source of truth. The Railway button is a convenience layer; you can deploy the same code to Fly, Render, Coolify, k8s, or any container host.
|
|
13
|
+
```bash
|
|
14
|
+
# 1. one-time registration with an api server
|
|
15
|
+
beevibe-daemon setup --api https://api.beevibe.io --user-token bv_u_…
|
|
16
|
+
# detects CLIs on PATH (claude, …), POSTs /runtime/register,
|
|
17
|
+
# writes ~/.beevibe/config.json (mode 0600) with the bv_d_ token
|
|
23
18
|
|
|
24
|
-
|
|
19
|
+
# 2. start claiming
|
|
20
|
+
beevibe-daemon start
|
|
21
|
+
# loads config, syncs ~/.beevibe/skills, opens WS to /runtime/ws,
|
|
22
|
+
# polls /runtime/claim every 30s, heartbeats every 15s
|
|
25
23
|
|
|
26
|
-
|
|
27
|
-
beevibe
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
│ ├── api/ MCP tool surface for agents + REST for humans + mesh broker
|
|
31
|
-
│ ├── scheduler/ fallback claimant for null-runtime sessions + orphan reaper
|
|
32
|
-
│ ├── daemon/ runs on each user's machine; claims sessions and spawns CLIs locally
|
|
33
|
-
│ └── web/ Next.js dashboard with live updates over SSE
|
|
34
|
-
│
|
|
35
|
-
├── skills/ Anthropic Agent Skills (markdown behavioral protocols)
|
|
36
|
-
├── migrations/ node-pg-migrate SQL files
|
|
37
|
-
├── scripts/ dev orchestrator + e2e smokes + provisioning helpers
|
|
38
|
-
└── docker-compose.yml Postgres 16 + pgvector
|
|
24
|
+
# 3. update self (Bun-compiled binaries only)
|
|
25
|
+
beevibe-daemon update
|
|
26
|
+
# downloads latest GitHub release, SHA-256 verifies, atomic rename.
|
|
27
|
+
# For npm / source installs, prints the right install command and bails.
|
|
39
28
|
```
|
|
40
29
|
|
|
41
|
-
|
|
30
|
+
`setup` flags:
|
|
42
31
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
32
|
+
| Flag | Default | Purpose |
|
|
33
|
+
|---|---|---|
|
|
34
|
+
| `--api` / `-a` | (required) | Api base URL (http or https). |
|
|
35
|
+
| `--user-token` / `-t` | (required) | Your `bv_u_` user key — used once to mint the `bv_d_` daemon key. |
|
|
36
|
+
| `--device-name` | `<user>@<hostname>` | Human label shown in the Runtimes panel. |
|
|
37
|
+
| `--external-id` | `<hostname>` | Stable per-machine id; lets `setup` re-run idempotently. |
|
|
48
38
|
|
|
49
|
-
|
|
39
|
+
`start` takes no flags — everything comes from `~/.beevibe/config.json` + env. `update` takes `--yes` / `-y` to skip the confirmation prompt.
|
|
50
40
|
|
|
51
|
-
|
|
52
|
-
- **Person / user**. A human owner. Authenticates with a `bv_u_…` API key. Can act as their top-level agent through MCP, or use the dashboard for review.
|
|
53
|
-
- **Task**. A unit of work assigned to an agent. Moves through `pending → running → review → done` (or `failed` / `blocked` / `cancelled`). Tasks can spawn child tasks; parents auto-complete when their children settle.
|
|
54
|
-
- **Session**. One run of the `claude` CLI for one task. Has a transcript, a `cli_session_id` (for `--resume`), and usage telemetry (including cache-hit ratios).
|
|
55
|
-
- **Mesh**. Agents can `ask` peers one-shot questions or `negotiate` with team/org peers across multiple rounds. If they can't agree, either side can `escalate_to_humans` and a person resolves it from the dashboard.
|
|
56
|
-
- **Memory**. `save_memory(...)` archives a fact (`belief`/`pattern`/`gotcha`/`preference`/`decision`); after the session ends, the FactPromoter LLM may elevate it from `ic` scope to `team` or `org` based on whether it generalizes. `update_core_memory(...)` writes the durable per-agent blocks.
|
|
57
|
-
- **Skills**. Markdown procedural protocols ([Anthropic Agent Skills standard](https://agentskills.io/specification)) auto-discovered by `claude` from `<workspace>/.claude/skills/`. We ship two: `beevibe-pre-task-setup` and `beevibe-team-mesh-negotiation`.
|
|
41
|
+
## Setup flow
|
|
58
42
|
|
|
59
|
-
|
|
43
|
+
1. **`setup`** probes `PATH` for known CLIs (`KNOWN_CLIS` from `@beevibe/core`), running `<cli> --version` for each one it finds.
|
|
44
|
+
2. POSTs `/runtime/register` with `{ external_id, device_name, runtimes }` and `Authorization: Bearer <bv_u_…>`.
|
|
45
|
+
3. Server returns `{ daemon_id, daemon_token, runtimes: [{id, cli}] }`. The daemon token is shown ONCE — saved straight to `~/.beevibe/config.json` (server stores only the SHA-256).
|
|
46
|
+
4. **`start`** loads config, fetches `/runtime/skills` (version-cached), syncs into `~/.beevibe/skills/`, opens the WS, and starts the claim/heartbeat loops.
|
|
60
47
|
|
|
61
|
-
|
|
48
|
+
`~/.beevibe/config.json` (dir `0700`, file `0600`):
|
|
62
49
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
pnpm install
|
|
72
|
-
|
|
73
|
-
cp .env.example .env
|
|
74
|
-
# fill in ANTHROPIC_API_KEY and OPENAI_API_KEY
|
|
75
|
-
|
|
76
|
-
docker compose up -d # postgres + pgvector
|
|
77
|
-
pnpm migrate up # apply migrations to dev DB
|
|
78
|
-
pnpm dev # postgres + api + scheduler (+ tunnel if cloudflared is on PATH)
|
|
50
|
+
```json
|
|
51
|
+
{
|
|
52
|
+
"api_url": "https://api.beevibe.io",
|
|
53
|
+
"external_id": "macbook-pro.local",
|
|
54
|
+
"daemon_id": "dmn_…",
|
|
55
|
+
"daemon_token": "bv_d_…",
|
|
56
|
+
"runtimes": [{ "id": "rt_…", "cli": "claude" }]
|
|
57
|
+
}
|
|
79
58
|
```
|
|
80
59
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
- starts Postgres if it isn't already running
|
|
84
|
-
- applies migrations
|
|
85
|
-
- spawns `@beevibe/api` (port 3000) and `@beevibe/scheduler` (health on 3001) in watch mode with `[api]` / `[exec]` log prefixes
|
|
86
|
-
- if `cloudflared` is on PATH, exposes the api at a `*.trycloudflare.com` URL and prints a paste-ready `mcp.json` snippet for remote `claude` CLI access (pass `--no-tunnel` to disable)
|
|
87
|
-
|
|
88
|
-
`Ctrl+C` tears the whole tree down.
|
|
60
|
+
## Concurrency cap
|
|
89
61
|
|
|
90
|
-
|
|
62
|
+
A single global hardware cap across all sessions on this machine. Default: **10**. Override:
|
|
91
63
|
|
|
92
64
|
```bash
|
|
93
|
-
|
|
94
|
-
# then visit http://localhost:3030
|
|
65
|
+
BEEVIBE_DAEMON_MAX_CONCURRENT=4 beevibe-daemon start
|
|
95
66
|
```
|
|
96
67
|
|
|
97
|
-
The
|
|
68
|
+
The `Supervisor` tracks each session under its own `AbortController`; cancel frames received over the WS abort the named session. `SIGINT` / `SIGTERM` calls `cancelAll()` and exits.
|
|
98
69
|
|
|
99
|
-
|
|
70
|
+
Per-agent caps (`max_task_sessions=1`, mesh=3) are enforced server-side at claim time, so you don't have to set those here.
|
|
100
71
|
|
|
101
|
-
|
|
72
|
+
## Polling, heartbeat, reconnect
|
|
102
73
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
pnpm tsx scripts/provision-demo.ts
|
|
110
|
-
```
|
|
74
|
+
| Signal | Cadence | Source |
|
|
75
|
+
|---|---|---|
|
|
76
|
+
| WS push (`task_available`, `cancel`) | event-driven | api `DaemonHub.notify` |
|
|
77
|
+
| HTTP `/runtime/claim` poll | 30s | `claimer.ts` `DEFAULT_POLL_MS` |
|
|
78
|
+
| `/runtime/heartbeat` | 15s | `RUNTIME_HEARTBEAT_INTERVAL_MS` from `@beevibe/core` |
|
|
79
|
+
| WS reconnect | exponential 1s → 30s cap | `DEFAULT_WS_RECONNECT_MAX_MS` |
|
|
111
80
|
|
|
112
|
-
|
|
81
|
+
The WS push is the low-latency wakeup; the HTTP poll is the catch-up + safety net. Server stales a runtime after 60s of silence (`packages/core/src/services/orphan-reaper.ts`) — well over 2× the heartbeat interval.
|
|
113
82
|
|
|
114
|
-
|
|
115
|
-
person: demo-user (bv_u_<token>)
|
|
116
|
-
└── captain (team-tier, owned by demo-user)
|
|
117
|
-
├── ic-alice (ic-tier)
|
|
118
|
-
└── ic-bob (ic-tier)
|
|
119
|
-
```
|
|
83
|
+
When the WS opens, the daemon drains `/runtime/claim` until it returns 204 or the supervisor is full, then idles waiting for the next push.
|
|
120
84
|
|
|
121
|
-
|
|
85
|
+
## Workspaces + env
|
|
122
86
|
|
|
123
|
-
|
|
124
|
-
claude
|
|
125
|
-
# In the chat, try:
|
|
126
|
-
# "who are my subordinates?" → find_subordinates → [ic-alice, ic-bob]
|
|
127
|
-
# "create a task for ic-alice: write a hello-world bash script"
|
|
128
|
-
# wait ~30-60s, watching [exec] logs in Terminal 1
|
|
129
|
-
# "what's the status of that task?" → check_work_status → done
|
|
130
|
-
# "ask ic-alice: where is hello.sh?" → mesh-ask round-trip
|
|
131
|
-
```
|
|
87
|
+
Per-agent workspace dirs are created lazily on first claim:
|
|
132
88
|
|
|
133
|
-
|
|
89
|
+
- Default: `~/.beevibe/workspaces/<agent_id>/`
|
|
90
|
+
- Override: `WORKSPACE_ROOT=/path/to/dir`
|
|
134
91
|
|
|
135
|
-
|
|
136
|
-
pnpm tsx scripts/provision-demo.ts --print # re-print existing keys/snippet
|
|
137
|
-
pnpm tsx scripts/provision-demo.ts --clean # wipe demo rows (no reseed)
|
|
138
|
-
```
|
|
92
|
+
Each workspace contains `mcp-config.json` (mode `0600`) with `Bearer <bv_a_…>` for that agent and the api's `/mcp` URL. The CLI reads this file directly; the daemon never sees the `bv_a_` token in a request path.
|
|
139
93
|
|
|
140
|
-
|
|
94
|
+
Skills cache: `~/.beevibe/skills/`, version-gated via `.version`. Refreshed on every `start`.
|
|
141
95
|
|
|
142
|
-
##
|
|
96
|
+
## What it doesn't do
|
|
143
97
|
|
|
144
|
-
|
|
98
|
+
- **No MCP proxy.** The CLI calls `/mcp` directly using the `bv_a_` token in `mcp-config.json`. The daemon's job stops at writing the file and supervising the subprocess.
|
|
99
|
+
- **No agent semantics.** `/runtime/claim` payloads are self-contained — agent_id, intent, prior_session_id (for `--resume`), workspace dir. The daemon never queries agents or tasks.
|
|
100
|
+
- **No persistence beyond config.** No DB connection, no cache of agent state. The token is plaintext locally; the server stores only the SHA-256.
|
|
145
101
|
|
|
146
|
-
|
|
102
|
+
## Source layout
|
|
147
103
|
|
|
148
|
-
```bash
|
|
149
|
-
pnpm install-skills
|
|
150
104
|
```
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
```bash
|
|
165
|
-
git clone https://github.com/beevibe-ai/beevibe.git
|
|
166
|
-
cd beevibe
|
|
167
|
-
# Optional: pin to a tagged release for reproducible builds
|
|
168
|
-
# git checkout v0.1.0
|
|
169
|
-
|
|
170
|
-
# 1. Build the three service images
|
|
171
|
-
docker build -f infra/railway/Dockerfile.api -t beevibe-api .
|
|
172
|
-
docker build -f infra/railway/Dockerfile.scheduler -t beevibe-scheduler .
|
|
173
|
-
docker build -f infra/railway/Dockerfile.web \
|
|
174
|
-
--build-arg NEXT_PUBLIC_BV_API_URL=http://localhost:3000 \
|
|
175
|
-
-t beevibe-web .
|
|
176
|
-
|
|
177
|
-
# 2. Start Postgres
|
|
178
|
-
docker compose up -d postgres
|
|
179
|
-
|
|
180
|
-
# 3. Run migrations once
|
|
181
|
-
docker run --rm --network host \
|
|
182
|
-
-e DATABASE_URL=postgresql://beevibe:beevibe@localhost:5433/beevibe \
|
|
183
|
-
beevibe-api pnpm migrate:deploy up
|
|
184
|
-
|
|
185
|
-
# 4. Run the services (each in its own terminal or via your orchestrator)
|
|
186
|
-
docker run -p 3000:3000 --network host --env-file .env beevibe-api
|
|
187
|
-
docker run --network host --env-file .env beevibe-scheduler
|
|
188
|
-
docker run -p 8080:3000 --env-file .env beevibe-web
|
|
105
|
+
src/
|
|
106
|
+
├── main.ts CLI arg parser + subcommand dispatch
|
|
107
|
+
├── setup.ts runSetup: detect CLIs, POST /runtime/register, write config
|
|
108
|
+
├── start.ts runStart: load config, sync skills, build Supervisor + Claimer
|
|
109
|
+
├── update.ts runUpdate: GitHub-release self-update for compiled binaries
|
|
110
|
+
├── config.ts load/save ~/.beevibe/config.json (DaemonConfig shape)
|
|
111
|
+
├── api-client.ts thin GET/POST/claim over /runtime/* with bv_d_ auth + WS open
|
|
112
|
+
├── claimer.ts WS push + 30s HTTP poll + 15s heartbeat + WS reconnect
|
|
113
|
+
├── supervisor.ts bounded concurrency cap with per-session AbortControllers
|
|
114
|
+
├── spawner.ts runDispatch: workspace + ClaudeCodeRuntime + batched events
|
|
115
|
+
├── skills-cache.ts syncSkillsCache: pull /runtime/skills into ~/.beevibe/skills/
|
|
116
|
+
└── supervisor.test.ts vitest unit tests
|
|
189
117
|
```
|
|
190
118
|
|
|
191
|
-
|
|
119
|
+
## Build distribution
|
|
192
120
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
If you'd rather not use Docker:
|
|
121
|
+
For local dev:
|
|
196
122
|
|
|
197
123
|
```bash
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
# Optional: pin to a tagged release
|
|
201
|
-
# git checkout v0.1.0
|
|
202
|
-
|
|
203
|
-
pnpm install --frozen-lockfile
|
|
204
|
-
pnpm build
|
|
205
|
-
pnpm migrate:deploy up
|
|
206
|
-
|
|
207
|
-
# Start each service in its own process (use systemd, pm2, or your service manager)
|
|
208
|
-
node packages/api/dist/main.js # api on $PORT (default 3000)
|
|
209
|
-
node packages/scheduler/dist/main.js # scheduler (background worker)
|
|
210
|
-
pnpm --filter @beevibe/web start # web (next start, port from $PORT)
|
|
124
|
+
pnpm --filter @beevibe/daemon build # tsc → dist/
|
|
125
|
+
pnpm --filter @beevibe/daemon dev # tsx watch
|
|
211
126
|
```
|
|
212
127
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
### Notes for production self-hosting
|
|
216
|
-
|
|
217
|
-
- **Single api replica** for v1 (see [v1 single-instance API constraint](#v1-single-instance-api-constraint) below).
|
|
218
|
-
- **Postgres 16+** with `pgvector` extension. The included `docker-compose.yml` uses `pgvector/pgvector:pg16`.
|
|
219
|
-
- **Reverse proxy** in front of the api (nginx / Caddy / Cloudflare) must support WebSockets (`/runtime/ws`) and long-held HTTP responses (mesh negotiate held connections, up to 5 minutes idle).
|
|
220
|
-
- **CORS**: set `BEEVIBE_CORS_ORIGINS` to the public URL of the web service. Localhost variants are always allowed in addition.
|
|
221
|
-
- **Daemon distribution**: end users still install the [`beevibe-daemon`](./packages/daemon) on their own machines to run agent CLIs locally. The hosted api never spawns user CLIs.
|
|
222
|
-
|
|
223
|
-
## Architecture
|
|
224
|
-
|
|
225
|
-
The dependency direction across packages is one-way and ESLint-enforced:
|
|
226
|
-
|
|
227
|
-
```
|
|
228
|
-
core/domain → nothing
|
|
229
|
-
core/ports → domain
|
|
230
|
-
core/services → domain + ports (NEVER adapters)
|
|
231
|
-
core/adapters → ports it implements + domain
|
|
232
|
-
api/ → core (composition root)
|
|
233
|
-
scheduler/ → core (composition root)
|
|
234
|
-
daemon/ → core (workspace + runtime adapters, direct imports)
|
|
235
|
-
web/ → core (types only) + api (HTTP)
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
The api, scheduler, and per-user daemons are independent processes. The api never talks to the scheduler or daemons over HTTP for task dispatch — Postgres is the integration point:
|
|
239
|
-
|
|
240
|
-
- The api writes task lifecycle changes (created, approved, revised, cancelled) and inserts `session` rows with `status='pending'`.
|
|
241
|
-
- A daemon claims sessions whose `preferred_runtime_id` matches its registered runtime and spawns the CLI locally on the user's machine.
|
|
242
|
-
- The scheduler claims null-runtime sessions (server-fallback for offline-target mesh asks) and runs the daemon-orphan reaper.
|
|
243
|
-
- Cancellation: api `UPDATE`s the row + `pg_notify('cancel_task', task_id)`; the active claimant (daemon or scheduler) aborts the in-flight session in <200ms.
|
|
244
|
-
- Live updates: every state-changing INSERT/UPDATE fires a `pg_notify`; api's `/api/stream` SSE endpoint relays them to the dashboard.
|
|
245
|
-
|
|
246
|
-
That decoupling means each component scales independently — many daemons (one per user machine), one or a few schedulers, a single api replica per region (see [v1 single-instance API constraint](#v1-single-instance-api-constraint) below).
|
|
247
|
-
|
|
248
|
-
### v1 single-instance API constraint
|
|
249
|
-
|
|
250
|
-
The mesh resolver (`packages/api/src/mesh/server.ts:90`) and the
|
|
251
|
-
forthcoming chat / room resolvers are in-process `Map`s — when an agent's
|
|
252
|
-
`ask` fires, the API holds the HTTP request open and resolves it from
|
|
253
|
-
that map when the target's `respond_ask` lands. **Both halves of the
|
|
254
|
-
round-trip must hit the same API process** for v1; a multi-instance API
|
|
255
|
-
fronted by a load balancer can drop responses on the floor when the two
|
|
256
|
-
HTTP requests land on different replicas. Documented in code; tracked
|
|
257
|
-
for cross-instance federation via `pg_notify` as a follow-up. **Self-hosters
|
|
258
|
-
should run a single API replica until that ships.** The scheduler and
|
|
259
|
-
per-user daemons scale horizontally either way.
|
|
260
|
-
|
|
261
|
-
## Common commands
|
|
128
|
+
For releases (Bun-compiled standalone binaries — no Node required):
|
|
262
129
|
|
|
263
130
|
```bash
|
|
264
|
-
pnpm
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
pnpm test # vitest (unit + integration)
|
|
268
|
-
pnpm dev # full local stack (postgres + api + scheduler + tunnel)
|
|
269
|
-
pnpm migrate up # apply migrations to DATABASE_URL
|
|
270
|
-
pnpm migrate:test up # apply migrations to DATABASE_URL_TEST
|
|
271
|
-
pnpm install-skills # install beevibe skills into ~/.claude/skills/
|
|
131
|
+
pnpm --filter @beevibe/daemon build:binaries
|
|
132
|
+
# bun build --compile for darwin-{arm64,x64} + linux-{x64,arm64}
|
|
133
|
+
# outputs dist-bin/ with size + SHA-256, ready for GitHub release upload
|
|
272
134
|
```
|
|
273
135
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
- TypeScript strict (ES2022, NodeNext)
|
|
277
|
-
- pnpm workspaces + Turborepo
|
|
278
|
-
- Postgres 16 + pgvector, raw `pg` driver (no ORM)
|
|
279
|
-
- node-pg-migrate
|
|
280
|
-
- Claude Code CLI runtime (spawned per-session)
|
|
281
|
-
- `@modelcontextprotocol/sdk`
|
|
282
|
-
- Next.js 14 + TanStack Query + Tailwind (dashboard)
|
|
136
|
+
Used by `.github/workflows/release.yml`. The companion `scripts/prepare-publish.sh` bundles the workspace dep `@beevibe/core` into one ESM file via `bun build` for `npm publish`.
|
|
283
137
|
|
|
284
|
-
##
|
|
285
|
-
|
|
286
|
-
Live integration tests against real Postgres + LLM APIs. Each is gated by an env flag.
|
|
138
|
+
## Build / test
|
|
287
139
|
|
|
288
140
|
```bash
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
OPENAI_API_KEY=... ANTHROPIC_API_KEY=... \
|
|
293
|
-
pnpm tsx scripts/m6-e2e.ts
|
|
294
|
-
|
|
295
|
-
# Multi-process smoke — api + scheduler as actual `node dist/main.js`
|
|
296
|
-
# subprocesses; verifies cross-process IPC, signal propagation, no orphans
|
|
297
|
-
RUN_M7_E2E=1 \
|
|
298
|
-
DATABASE_URL_TEST=postgresql://beevibe:beevibe@localhost:5433/beevibe_test \
|
|
299
|
-
OPENAI_API_KEY=... ANTHROPIC_API_KEY=... \
|
|
300
|
-
pnpm tsx scripts/m7-e2e.ts
|
|
301
|
-
|
|
302
|
-
# Skills + memory + cache-hit ratio smoke (M9 features)
|
|
303
|
-
RUN_M9_E2E=1 \
|
|
304
|
-
DATABASE_URL_TEST=postgresql://beevibe:beevibe@localhost:5433/beevibe_test \
|
|
305
|
-
OPENAI_API_KEY=... ANTHROPIC_API_KEY=... \
|
|
306
|
-
pnpm tsx scripts/m9-e2e.ts
|
|
141
|
+
pnpm --filter @beevibe/daemon build
|
|
142
|
+
pnpm --filter @beevibe/daemon typecheck
|
|
143
|
+
pnpm --filter @beevibe/daemon test
|
|
307
144
|
```
|
|
308
|
-
|
|
309
|
-
Apply test-DB migrations first with `pnpm migrate:test up`. All scripts truncate the test DB at the start, so back-to-back runs work.
|
|
310
|
-
|
|
311
|
-
## Project status
|
|
312
|
-
|
|
313
|
-
The platform was built in milestones (M0 → M9), each with its own integration test:
|
|
314
|
-
|
|
315
|
-
| Milestone | What landed |
|
|
316
|
-
|---|---|
|
|
317
|
-
| M0 | Repo scaffold |
|
|
318
|
-
| M1 | Domain + ports + Postgres adapter + schema + migrations |
|
|
319
|
-
| M2 | Claude Code runtime adapter + workspace adapter |
|
|
320
|
-
| M3 | Memory subsystem + pgvector + LLM providers |
|
|
321
|
-
| M4 | API-key auth + agent provisioning |
|
|
322
|
-
| M5 | Executor binary (polling + dispatch) |
|
|
323
|
-
| M6 | API binary (MCP tools + REST + mesh + escalation + cancellation) |
|
|
324
|
-
| M7 | Multi-process integration test + dev orchestrator |
|
|
325
|
-
| M8 | Web dashboard (Next.js + SSE) |
|
|
326
|
-
| M9 | Skill system (auto-discovered behavioral protocols) + memory tooling refresh |
|
|
327
|
-
|
|
328
|
-
The full design discussions and PR references live in the [closed issues](https://github.com/beevibe-ai/beevibe/issues?q=is%3Aissue+is%3Aclosed) — each milestone has one tracking issue.
|
|
329
|
-
|
|
330
|
-
## Contributing
|
|
331
|
-
|
|
332
|
-
Issues and PRs welcome. For non-trivial changes, open an issue first so we can align on direction.
|
|
333
|
-
|
|
334
|
-
A few conventions worth knowing:
|
|
335
|
-
|
|
336
|
-
- **Plan first, build second.** Each milestone is scoped end-to-end (schema → types → unit tests → integration test) before any code is written. See `tasks/` (gitignored) for the workflow.
|
|
337
|
-
- **TDD where it pays.** Domain types and pure services are test-first. Adapters get integration tests against real services (Postgres, real LLM keys).
|
|
338
|
-
- **No parallel systems.** When a feature replaces an older one, the old code is deleted in the same PR — no `if (new) ... else if (old) ...` branches.
|
|
339
|
-
|
|
340
|
-
## License
|
|
341
|
-
|
|
342
|
-
The Beevibe source code is licensed under the [Apache License 2.0](./LICENSE).
|
|
343
|
-
|
|
344
|
-
The **Beevibe** name and logo are trademarks of the project — see
|
|
345
|
-
[TRADEMARK.md](./TRADEMARK.md). Apache 2.0 grants rights to the source
|
|
346
|
-
code; it does not grant rights to use the project's name or marks. Forks
|
|
347
|
-
and derivative works are welcome under any name that is not "Beevibe."
|
|
348
|
-
|
|
349
|
-
Contributing? See [CONTRIBUTING.md](./CONTRIBUTING.md). All commits must
|
|
350
|
-
include a `Signed-off-by:` trailer (the [Developer Certificate of Origin
|
|
351
|
-
v1.1](./CONTRIBUTING.md#developer-certificate-of-origin-v11)) — `git commit -s`.
|
|
352
|
-
|
|
353
|
-
Copyright (c) 2026 Zhe Pang. Rights to be assigned to Beevibe Inc. upon
|
|
354
|
-
its formation.
|