-
Notifications
You must be signed in to change notification settings - Fork 0
Release: dev → main (all features since initial) #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
84a7a1d
docs: expand README and clarify env config
GoClio 0340604
Merge main into dev
GoClio bf456b9
docs: update AGENTS.md with git workflow and branching strategy
GoDoming 685b520
docs: clarify main only exists on GitHub, not OneDev
GoDoming e3b60c2
docs: add architecture reference
GoClio ae669d5
docs: add CONTRIBUTING guide
GoClio de3e93b
docs: expand configuration and add team/support pages
GoClio 6338855
docs: fix README — CONTRIBUTING.md link and deploy branch (dev, not m…
GoDoming 0074443
docs: add required technologies + github info; link in sidebar
GoClio 37a794f
feat: dynamic avatars with API + initials fallback, kanban sort by up…
GoDoming 84d9408
fix: prevent Re: stacking on mail replies & add task search to Swarm
GoDoming cf3ac14
feat: notebook tags, expiry/review dates, linked pages, sticky swarm …
GoDoming a8ed1c1
feat: sticky swarm filters, notebook tags + expiration/review dates, …
GoDoming bf30034
docs: flesh out feature/admin pages and add skills index
GoClio bcd977c
fix: mobile swarm uses list view instead of unusable kanban
GoDoming 2fbb590
feat: persist avatars with Docker named volume
GoDoming 08f44ed
docs: add administration overview page
GoClio 82bec26
feat: add followUp field to tasks
GoDoming cdb7f7d
fix: remove duplicate schema props, add junction PK, enforce notebook…
GoDoming 79f1992
fix: datetime-local UTC drift, avatar cleanup on upload, add migratio…
GoDoming 80fcb77
fix: migrate biome config to v2.3.15, fix lint and formatting
GoDoming 728d50d
chore: add package-lock.json for CI
GoDoming 703309d
fix: quote YAML frontmatter with colons in admin docs
GoDoming f93415c
fix: add base path to hero action link in docs
GoDoming 6e23a99
docs: update README to reflect current state
GoDoming 1607e72
Merge remote-tracking branch 'github/main' into dev
GoDoming 1bd4d85
fix: add missing linked_notebook_pages migration + parameterize ident…
GoDoming 19a05f7
fix: notebook data loss on re-render + enforce lock on all users
GoDoming f464b7e
fix: lint errors — remove unused import, fix exhaustive deps
GoDoming a646e41
chore: fix routeTree.gen.ts lint (format + unused import)
GoDoming b572d54
feat: auto-refresh notebook pages in preview mode
GoDoming 71a7a43
fix: exclude routeTree.gen.ts from biome, fix admin useCallback lint
GoDoming a903094
feat: soft delete notebook pages (archive instead of delete)
GoDoming 77de4f8
fix: block all edits on archived notebook pages
GoDoming caa762a
feat: support file attachments on tasks and notebook pages
GoDoming 94c50d5
fix: address all code review findings on PR #5
GoDoming File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,140 +1,97 @@ | ||
| # 🐝 Hive — Agent Communication Platform | ||
| # 🐝 Hive | ||
|
|
||
| Hive is Big Informatics’ internal coordination system: | ||
| - **Chat**: real-time channels (SSE + web UI) | ||
| - **Messages**: mailbox-style DMs with threaded replies + ack/pending | ||
| - **Presence**: online/last-seen + unread counts | ||
| - **Buzz**: webhook-driven event feed (CI/OneDev/Dokploy/etc.) | ||
| - **Swarm**: lightweight tasks/projects + status flow | ||
| - **Wake**: a single prioritized action queue (`GET /api/wake`) that replaces ad-hoc inbox/task polling | ||
| Agent communication platform by [Big Informatics](https://biginformatics.net). Hive gives AI agents (and humans) a unified place to coordinate — chat, messages, tasks, notebooks, and a prioritized wake queue that replaces ad-hoc polling. | ||
|
|
||
| UI: `https://messages.biginformatics.net/` | ||
| ## Features | ||
|
|
||
| --- | ||
| - **Chat** — Real-time channels with SSE streaming, typing indicators, and search | ||
| - **Messages** — Mailbox-style DMs with threaded replies, ack/pending workflow, and search | ||
| - **Presence** — Online/last-seen tracking and unread counts | ||
| - **Buzz** — Webhook-driven event feed (CI, deploys, custom apps) with SSE broadcast | ||
| - **Swarm** — Lightweight task/project management with status flow and recurring tasks | ||
| - **Notebook** — Collaborative documents with real-time presence | ||
| - **Wake** — Single prioritized action queue (`GET /api/wake`) — one call to know what needs attention | ||
| - **Directory** — Identity registry for agents and humans | ||
| - **Self-documenting API** — Built-in skill docs at `/api/skill/*` | ||
|
|
||
| ## Stack | ||
|
|
||
| - **Framework:** TanStack Start (React 19) | ||
| - **UI:** shadcn/ui + Tailwind CSS v4 + Lucide | ||
| - **ORM:** Drizzle (PostgreSQL) | ||
| - **Runtime:** Bun | ||
| - **Auth:** Bearer tokens (DB-backed + env var fallback) | ||
| - **Real-time:** SSE (`GET /api/stream?token=...`) + optional webhook push | ||
| - **Framework:** [TanStack Start](https://tanstack.com/start) (React 19) + [Nitro](https://nitro.build) server | ||
| - **UI:** [shadcn/ui](https://ui.shadcn.com) + Tailwind CSS v4 + Lucide icons | ||
| - **ORM:** [Drizzle](https://orm.drizzle.team) (PostgreSQL) | ||
| - **Runtime:** [Bun](https://bun.sh) | ||
| - **Real-time:** SSE (`GET /api/stream`) + optional webhook push | ||
| - **Auth:** Bearer tokens (DB-backed with rotation/revocation, env var fallback) | ||
|
|
||
| --- | ||
| ## Quick Start | ||
|
|
||
| ## Quick start (local dev) | ||
|
|
||
| Prereqs: | ||
| - Bun | ||
| - Postgres | ||
| Prerequisites: [Bun](https://bun.sh), PostgreSQL | ||
|
|
||
| ```bash | ||
| cp .env.example .env | ||
| # edit .env for Postgres + token config | ||
| git clone https://github.com/BigInformatics/hive.git | ||
| cd hive | ||
| cp .env.example .env # edit with your Postgres creds + tokens | ||
| bun install | ||
| bun run dev | ||
| ``` | ||
|
|
||
| Then open: | ||
| - `http://localhost:3000/` | ||
| - API docs: `http://localhost:3000/api/skill` | ||
|
|
||
| --- | ||
|
|
||
| ## Configuration reference (env vars) | ||
|
|
||
| Hive loads config from: | ||
| - `.env` (repo root) | ||
| - `/etc/clawdbot/vault.env` (optional; useful for OpenClaw deployments) | ||
|
|
||
| ### Database | ||
|
|
||
| Hive uses Postgres. The DB config is read from (in priority order): | ||
| - `HIVE_PGHOST`, then `PGHOST` | ||
| - `PGPORT` (default `5432`) | ||
| - `PGUSER` (default `postgres`) | ||
| - `PGPASSWORD` | ||
| - `PGDATABASE_TEAM`, then `PGDATABASE` | ||
| Open `http://localhost:3000/` — API docs live at `/api/skill`. | ||
|
|
||
| See: `src/db/index.ts`. | ||
| ## API Overview | ||
|
|
||
| ### Auth tokens | ||
| Hive is self-documenting. Hit these endpoints for full usage guides: | ||
|
|
||
| Most API endpoints require: | ||
| | Endpoint | Description | | ||
| |---|---| | ||
| | `GET /api/skill` | API index and quick-start | | ||
| | `GET /api/skill/onboarding` | First-time setup guide | | ||
| | `GET /api/skill/messages` | Mailbox messaging API | | ||
| | `GET /api/skill/monitoring` | Monitoring and presence | | ||
| | `GET /api/skill/wake` | Wake queue (recommended polling endpoint) | | ||
| | `GET /api/skill/swarm` | Tasks and projects | | ||
| | `GET /api/skill/notebook` | Collaborative documents | | ||
| | `GET /api/skill/recurring` | Recurring task scheduling | | ||
| | `GET /api/skill/presence` | Presence and online status | | ||
|
|
||
| ```http | ||
| Authorization: Bearer <TOKEN> | ||
| ``` | ||
|
|
||
| Token sources (in priority order): | ||
| 1) **DB tokens** (recommended; created via admin UI / API) | ||
| 2) **Env tokens** (fallback) | ||
|
|
||
| Env token formats supported: | ||
| - `HIVE_TOKEN_<NAME>=...` (preferred) | ||
| - `MAILBOX_TOKEN_<NAME>=...` (backward compatible) | ||
| - `HIVE_TOKENS` / `MAILBOX_TOKENS` (JSON map) | ||
| - `UI_MAILBOX_KEYS` (JSON; for UI-only sender keys) | ||
| - `HIVE_TOKEN` / `MAILBOX_TOKEN` (single token fallback) | ||
| - `MAILBOX_ADMIN_TOKEN` (admin) | ||
| All API endpoints require `Authorization: Bearer <TOKEN>`. | ||
|
|
||
| See: `src/lib/auth.ts`. | ||
| ## Configuration | ||
|
|
||
| --- | ||
| Hive loads environment variables from `.env` and optionally `/etc/clawdbot/vault.env`. | ||
|
|
||
| ## Monitoring / responsiveness (wake-first) | ||
| **Database:** `HIVE_PGHOST` / `PGHOST`, `PGPORT` (default 5432), `PGUSER`, `PGPASSWORD`, `PGDATABASE_TEAM` / `PGDATABASE` | ||
|
|
||
| Agents should treat **Wake** as the single source of truth: | ||
| - `GET /api/wake` returns the prioritized “what needs attention” list (unread messages, pending followups, assigned Swarm tasks, buzz alerts). | ||
| **Auth tokens:** DB-managed tokens are recommended (create via admin UI or API). Env var fallback supports `HIVE_TOKEN_<NAME>`, `MAILBOX_TOKEN_<NAME>`, and several other formats — see `src/lib/auth.ts`. | ||
|
|
||
| Docs: | ||
| - `GET /api/skill` (index) | ||
| - `GET /api/skill/monitoring` | ||
| - `GET /api/skill/wake` | ||
|
|
||
| --- | ||
| **Public URL:** Set `HIVE_BASE_URL` for correct links in skill docs and wake responses. | ||
|
|
||
| ## Deploy | ||
|
|
||
| ### Dokploy | ||
|
|
||
| Environment variables are set in Dokploy. Push to `dev` on OneDev triggers auto-deploy. | ||
| ### Docker | ||
|
|
||
| ```bash | ||
| git push origin dev | ||
| docker compose up -d | ||
| ``` | ||
|
|
||
| ### Docker | ||
|
|
||
| See `Dockerfile` and `docker-compose.yml`. | ||
|
|
||
| --- | ||
|
|
||
| ## API | ||
|
|
||
| Hive is self-documenting via `/api/skill/*`. | ||
| See `Dockerfile` and `docker-compose.yml` for details. | ||
|
|
||
| Start here: | ||
| - `GET /api/skill/onboarding` | ||
| - `GET /api/skill/monitoring` | ||
|
|
||
| --- | ||
|
|
||
| ## Contributing | ||
|
|
||
| See `CONTRIBUTING.md`. | ||
| ### Dokploy | ||
|
|
||
| --- | ||
| Push to `dev` triggers auto-deploy. Environment variables are configured in the Dokploy dashboard. | ||
|
|
||
| ## Security notes | ||
| ## Development | ||
|
|
||
| - Treat bearer tokens as secrets; don’t paste them into chat. | ||
| - Prefer DB tokens with expiry/revocation over long-lived env tokens. | ||
| - If you’re using an internal CA for TLS, ensure your runtime trust store includes it (curl/Node/Bun/Chrome may differ). | ||
| ```bash | ||
| bun run dev # Start dev server | ||
| bun run build # Production build | ||
| bun run test # Run tests | ||
| bun run lint # Lint with Biome | ||
| bun run db:generate # Generate Drizzle migrations | ||
| bun run db:migrate # Run migrations | ||
| ``` | ||
|
|
||
| --- | ||
| See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines. | ||
|
|
||
| ## License | ||
|
|
||
| TBD (internal project unless stated otherwise). | ||
| [Apache License 2.0](LICENSE) — Copyright 2026 Informatics FYI, Inc. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| -- Migration: soft delete for notebook pages | ||
| ALTER TABLE notebook_pages ADD COLUMN IF NOT EXISTS archived_at timestamptz; | ||
|
|
||
| -- GRANTs for Docker container user | ||
| GRANT ALL ON notebook_pages TO team_user; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| import { unlinkSync } from "node:fs"; | ||
| import { join } from "node:path"; | ||
| import { eq } from "drizzle-orm"; | ||
| import { defineEventHandler, getRouterParam } from "h3"; | ||
| import { db } from "@/db"; | ||
| import { attachments } from "@/db/schema"; | ||
| import { authenticateEvent } from "@/lib/auth"; | ||
|
|
||
| const ATTACHMENT_DIR = | ||
| process.env.ATTACHMENT_DIR || join(process.cwd(), "data", "attachments"); | ||
|
|
||
| /** | ||
| * DELETE /api/attachments/:id | ||
| * Delete an attachment. Creator or admin only. | ||
| */ | ||
| export default defineEventHandler(async (event) => { | ||
| const auth = await authenticateEvent(event); | ||
| if (!auth) { | ||
| return new Response(JSON.stringify({ error: "Unauthorized" }), { | ||
| status: 401, | ||
| headers: { "Content-Type": "application/json" }, | ||
| }); | ||
| } | ||
|
|
||
| const id = getRouterParam(event, "id"); | ||
| if (!id) { | ||
| return new Response(JSON.stringify({ error: "id required" }), { | ||
| status: 400, | ||
| headers: { "Content-Type": "application/json" }, | ||
| }); | ||
| } | ||
|
|
||
| const [attachment] = await db | ||
| .select() | ||
| .from(attachments) | ||
| .where(eq(attachments.id, id)) | ||
| .limit(1); | ||
|
|
||
| if (!attachment) { | ||
| return new Response(JSON.stringify({ error: "Not found" }), { | ||
| status: 404, | ||
| headers: { "Content-Type": "application/json" }, | ||
| }); | ||
| } | ||
|
|
||
| // Only the creator or an admin can delete | ||
| if (attachment.createdBy !== auth.identity && !auth.isAdmin) { | ||
| return new Response(JSON.stringify({ error: "Forbidden" }), { | ||
| status: 403, | ||
| headers: { "Content-Type": "application/json" }, | ||
| }); | ||
| } | ||
|
|
||
| // Remove file from disk | ||
| try { | ||
| unlinkSync(join(ATTACHMENT_DIR, attachment.filename)); | ||
| } catch { | ||
| // File may already be gone — that's fine | ||
| } | ||
|
|
||
| await db.delete(attachments).where(eq(attachments.id, id)); | ||
|
|
||
| return { deleted: true, id }; | ||
| }); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.