diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 4c6fe24..55bd1e8 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -1,14 +1,24 @@ { "name": "beardrive", - "owner": { "name": "runbear", "email": "snow@runbear.io" }, - "description": "BearDrive (beardrive) — a synced file system for AI agents", + "owner": { + "name": "runbear", + "email": "snow@runbear.io" + }, + "description": "BearDrive — the open-source Google Drive for AI agents: one folder your team and their agents share, with per-change attribution and read analytics.", "plugins": [ { "name": "beardrive", "source": "./plugin", - "description": "BearDrive: folders that stay in sync across your team and agents through a BearDrive server (or S3/GCS directly). Installs the beardrive skill, /beardrive:install, /beardrive:init and /beardrive:status commands, and turn-boundary sync hooks in one step.", + "description": "BearDrive: folders that stay in sync across your team and agents through a self-hostable BearDrive hub, with per-file history and public share links. Installs the beardrive skill, /beardrive:install, /beardrive:init and /beardrive:status commands, and turn-boundary sync hooks in one step.", "category": "workflow", - "tags": ["sync", "files", "workspace", "s3", "gcs", "agents"] + "tags": [ + "sync", + "files", + "workspace", + "agents", + "memory", + "claude-code" + ] } ] } diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..6a85838 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,47 @@ +name: Bug report +description: Something misbehaved — a sync, the CLI, the hub, or the web UI +labels: [bug] +body: + - type: input + id: version + attributes: + label: bdrive version + description: Output of `bdrive version` + placeholder: beardrive v0.7.0 + validations: + required: true + - type: input + id: os + attributes: + label: OS / platform + placeholder: macOS 15.2 (arm64) / Ubuntu 24.04 + validations: + required: true + - type: dropdown + id: mode + attributes: + label: Where does it happen? + options: + - Syncing client (bdrive CLI / daemon) + - Self-hosted hub (bdrive web) + - Web UI in the browser + - Claude Code plugin / agent hooks + - Not sure + validations: + required: true + - type: textarea + id: repro + attributes: + label: What happened, and how do we reproduce it? + description: | + Steps, expected vs actual. For sync issues, `bdrive status` and + `bdrive log -n 20` output help a lot. Never paste tokens or the + contents of settings.json. + validations: + required: true + - type: textarea + id: logs + attributes: + label: Logs (optional) + description: Daemon log lives at `~/.bdrive/volumes//daemon.log`. + render: text diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..a533d06 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,27 @@ +name: Feature request +description: An idea for BearDrive — check ROADMAP.md first, it might already be planned +labels: [enhancement] +body: + - type: textarea + id: problem + attributes: + label: What are you trying to do? + description: The workflow or problem, not just the feature — context makes better designs. + validations: + required: true + - type: textarea + id: proposal + attributes: + label: What would you like BearDrive to do? + validations: + required: true + - type: dropdown + id: area + attributes: + label: Area + options: + - Sync engine / CLI + - Hub / web UI + - Agent integration (hooks, plugin, skills) + - Sharing / permissions + - Other diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..de45369 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,10 @@ +## What & why + + + +## Checklist + +- [ ] `go build ./... && go vet ./... && go test ./...` green +- [ ] Sync behavior changes have a multi-device test in `internal/syncer` +- [ ] Frontend changes: `npm run build` re-committed `internal/webapp/static` and `npm run e2e` is green +- [ ] CLI behavior changes updated both `README.md` and `plugin/skills/beardrive/SKILL.md` diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..10525af --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,69 @@ +# Changelog + +Notable changes per release. Format loosely follows +[Keep a Changelog](https://keepachangelog.com/); BearDrive is pre-1.0, so +minor versions may ship breaking changes (see [SemVer §4](https://semver.org/#spec-item-4)). + +## v0.7.0 — 2026-07-14 + +- **`bdrive url `** — internal, permission-walled links (sign-in + + project membership required) that agents share when they create files; + the plugin now teaches agents to include the link in their reply. +- Mobile layout overhaul: responsive chrome now covers tablet and phone + landscape, 44px touch targets throughout, five designer-review rounds. +- Read-heat hooks re-registered on upgrade pick up broader matchers. + +## v0.6.0 — 2026-07-13 + +- **Web UI rewritten in React + TypeScript** (same URLs, same design): + committed build output keeps `go build`/`go install` Node-free. +- **Read-heat coverage fix**: agent reads via shell commands (`cat`, + `grep`, `tail`) and Grep matches now count, not just native file reads; + `bdrive hooks install` upgrades existing hook matchers in place. +- Content-hashed assets served immutable; committed e2e harness + + 42-spec Playwright suite. + +## v0.5.0 — 2026-07-12 + +- **Project home page**: connect-an-agent guide (Claude Code & Cowork + plugin flow, Hermes/Codex CLI) with real hub URL + project id filled + in; Insights embedded for admins/org owners. +- Two-file AGENTS.md orientation for shared folders in the plugin flows. +- Expandable history notes; RESTful `/insights` and `/history` routes. + +## v0.4.0 — 2026-07-12 + +- **Read heat / Insights**: per-file read telemetry (human vs agent vs + share), heat dots in listings, and the Insights dashboard — treemap, + reads×staleness scatter with the hot-but-stale danger quadrant, hot + path, per-agent coverage matrix. +- **Agent read reporting**: `bdrive read-log` + hooks spool agent file + reads locally and report on next sync. + +## v0.3.1 — 2026-07-10 + +- Parallel blob upload + progress bar for large initial imports. + +## v0.3.0 — 2026-07-10 + +- **Hub-only architecture**: clients sync exclusively through a + `bdrive web` hub over HTTPS (the `remote` command and direct + client-to-bucket sync were removed); `bdrive logout` added. +- **SQL metadata backends**: hub accounts/projects/orgs/shares can live + in SQLite or Postgres (incl. Supabase) instead of JSON files. +- Dockerfile + Cloud Run deployment recipe. + +## v0.2.2 — 2026-07-08 + +- **BearDrive**: the project (formerly `sfs`) got its name; CLI became + `bdrive`. +- Multi-project sync hub with accounts and orgs; interactive + `bdrive init` / browser `bdrive login` onboarding; public share links; + web viewer folded into the CLI as `bdrive web`; per-file history in + the web UI; `/beardrive:install` team onboarding for Claude Code. + +## v0.1.0 — 2026-06-12 + +- First release: per-device append-only journals, last-writer-wins + replay, content-addressed blobs, offline-first sync through S3/GCS/ + file remotes, conflict copies, daemon with turn-boundary agent hooks. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..fa55ae9 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,65 @@ +# Contributing to BearDrive + +Thanks for wanting to help. BearDrive is early (pre-1.0) and moving fast — +small, focused PRs land quickest, and an issue or discussion before a big +change saves everyone time. + +## Build & test + +```sh +go build ./... # everything, no CGO, no Node needed +go vet ./... +go test ./... # full suite +go test ./internal/syncer -run TestConflict -v # one test +``` + +Set `BDRIVE_HOME=/some/tmp/dir` when testing the CLI by hand so you never +touch your real `~/.bdrive`. + +## Run a local hub + +```sh +go build -o bdrive ./cmd/bdrive +mkdir -p /tmp/hub-storage +./bdrive web /tmp/hub-storage --addr :8080 --upload # plain-folder viewer +``` + +For hub mode with accounts, see the self-hosting guide +([docs/self-hosting.md](docs/self-hosting.md)). The e2e test harness +(`BDRIVE_E2E_SERVE=1 go test -run TestE2EServe ./internal/webapp`) starts a +seeded hub on :8993 with test accounts — handy for frontend work. + +## The rules that matter here + +- **Sync changes need multi-device tests.** The real coverage lives in + `internal/syncer/syncer_test.go`: simulated devices syncing through a + shared remote, driven cycle by cycle. A new sync behavior without a + multi-device test is untested where it matters. +- **Never break sync.** Errors degrade to offline and retry next cycle; + a cycle must not fail because a side feature (telemetry, hooks) did. + Read the invariants section in [CLAUDE.md](CLAUDE.md) before touching + `internal/syncer`, `internal/journal`, or `internal/store` — replay + determinism and journal ownership are the whole concurrency story. +- **Frontend changes rebuild the committed assets.** The web UI lives in + `internal/webapp/frontend` (React + TS, Vite); its build output is + committed at `internal/webapp/static` so `go build` needs no Node. + After changing `frontend/src`: `npm run build`, commit the new + `static/`, and keep `npm run e2e` green. `frontend/check-dist.sh` + verifies freshness. +- **Docs travel with behavior.** Changing CLI commands, flags, or output + means updating both `README.md` and `plugin/skills/beardrive/SKILL.md` + — the skill is what makes agents beardrive-aware and must match the + binary. + +## Where to start + +[ROADMAP.md](ROADMAP.md) marks items we'd love help with, and issues +labeled `good first issue` / `help wanted` are curated to be approachable. +Bug reports with a reproduction (the issue form asks for `bdrive version`, +OS, and hub vs plain-folder mode) are gold. + +## Conduct + +Be kind, be direct, assume good intent. Maintainers reserve the right to +moderate. Security issues: email snow@runbear.io rather than opening a +public issue. diff --git a/README.md b/README.md index 5b4b57b..e9e5010 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,18 @@ Two things it's for: **sharing files with people** — any synced file becomes a public URL that renders as a page — and **sharing context across AI agents**: give every agent on the team the same folder as memory, and your agent knows what their agent knows. Notes, plans, findings, and -artifacts follow the team everywhere, with a full audit trail of which -agent or human changed what. +artifacts follow the team everywhere — and unlike a memory API, they stay +**real files with provenance**: every change is attributed to the human, +agent, and device that made it, and the hub's Insights show what your +agents actually read (and which hot-but-stale docs nobody maintains). + +

+ Knowledge Insights — every file plotted by agent/human reads vs staleness; hot-but-stale docs are the danger zone +

+ +| Browse with read heat | Public share pages | +|---|---| +| ![Folder listing with per-file agent read counts and change feed](docs/assets/browse.png) | ![A shared markdown file rendered as a public page](docs/assets/share.png) | ```console $ bdrive login # once per device (browser sign-in) @@ -507,14 +517,19 @@ deletes for it), and anything excluded by `.bdriveignore` or omitted from an ## Roadmap -- `beardrive restore @