mirror of
https://github.com/runbear-io/beardrive.git
synced 2026-08-25 08:08:08 +02:00
Two front doors for the same setup, and one of them was a second copy of everything. The plugin shipped the skill the CLI already installs (to four platforms, not one), hooks that ran the identical commands `bdrive hooks install` writes machine-level, and an install flow duplicating INSTALL_FOR_AGENTS.md. Nothing deduped, so a machine with both pulled twice per turn — two blocking syncs — and showed two identical `beardrive` skills in the picker. What remains is `internal/agenthooks` plus the runbook: init registers a blocking pull (which also injects the gated-link convention as additionalContext), an async push on Write/Edit, and read-log for the heatmap, in each platform's user config, once per machine. That is the whole integration, and it is the part that was never optional. Removed: plugin/, .claude-plugin/marketplace.json, internal/agentskills, `bdrive skill`, `bdrive hook-approve` (its PreToolUse auto-approve only ever helped when a plugin pre-installed it; the substitute is a `Bash(bdrive:*)` permission entry, which is user-owned config and needs no code). The e2e now asserts the absence: no SKILL.md in any platform's skills dir after init, and no `skill` subcommand. login_test keeps the "no revoke surface" wording check on logoutNote alone. Claude-Session: https://claude.ai/code/session_016aYntCWwdUhpzUfEk3ddyJ Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2.3 KiB
2.3 KiB
BearDrive — system overview
The whole repo on one page: every package and surface, and which detail diagram drills into it. Reflects the code as of this commit; update this file in any PR that adds/removes a package or changes how the pieces connect. Detail diagrams: cli-sync.md, webapp-server.md, webapp-frontend.md.
flowchart LR
subgraph device["User device"]
wf["working folder<br/>(real files + .bdrive/config.json)"]
cli["cmd/bdrive<br/>CLI commands"]
dmn["internal/daemon<br/>background loop"]
eng["internal/syncer Session.Cycle<br/>internal/journal ops + replay"]
vs["volume store ~/.bdrive/volumes/id<br/>internal/store: blobs, journals,<br/>state, paused marker"]
cfg["internal/config<br/>device.json, settings.json, mounts.json"]
end
subgraph agents["Agent platforms (claude / codex / gemini / hermes)"]
hooks["internal/agenthooks<br/>turn-boundary sync hooks"]
end
subgraph hub["bdrive web hub"]
srv["internal/webapp Server<br/>auth, orgs, projects, shares,<br/>history, read heat, store proxy"]
fe["webapp/frontend React SPA<br/>committed dist go:embed'ed at webapp/static"]
meta["MetaStore: file JSON (default)<br/>or sqlite / postgres (db_sql)"]
end
store["object store (hub-owned)<br/>internal/remote: file:// s3:// gs://<br/>blobs + per-device journals"]
docs["web/docs — docs.beardrive.ai<br/>Astro/Starlight, deploys separately"]
cloud["cloud/ (PRIVATE nested repo, gitignored)<br/>managed beardrive.ai: swaps AuthProvider,<br/>QuotaProvider, MetaStore seams"]
wf <-->|scan / materialize| eng
cli --> eng
dmn --> eng
cli --> cfg
eng --> vs
eng <-->|"https:// backend (internal/remote/http.go)<br/>device token, /api/p/id/store/*"| srv
hooks -->|"bdrive sync --hook / --note, read-log<br/>gated: enrolled + not paused"| cli
srv --> store
srv --> meta
fe -->|/api/config, /api/projects, viewer APIs| srv
cloud -.->|imports OSS packages,<br/>replaces providers| srv
docs -.->|documents| cli
Not drawn in any detail diagram (deliberately): web/docs (content site, no
Go/TS application code) and cloud/ (private repo — its architecture lives
there; here it only consumes the provider seams drawn in webapp-server.md).