Commit Graph

749 Commits

Author SHA1 Message Date
boos adb349eecc feat: Stats routes — model-by-site + site-distribution
- GET /api/stats/model-by-site — model usage aggregated by model name
- GET /api/stats/site-distribution — per-site usage summary
- Both query existing model_day_usage table with day-range filter
- 18/18 tests pass
2026-05-17 17:10:35 +08:00
boos 15f73a2793 fix: ComfyUI wildcard route syntax for axum 0.8+
- Changed  to  in comfyui proxy route
- Added config.toml for local dev
- Verified: Rust backend starts and serves /healthz, /api/sites,
  /api/events, /api/tasks, /api/settings, /api/organizations/plans
- 18/18 tests pass
2026-05-17 17:08:36 +08:00
boos fe1a7c2115 feat: User profile routes migrated to Rust
- PATCH /api/users/me — update own username
- POST /api/users/me/password — change password (verify old first)
- GET /api/users/{id} — get user profile (self or admin)
- JWT auth for all endpoints
- 18/18 tests pass
2026-05-17 17:04:54 +08:00
boos 07f427877b feat: Background task SSE streaming endpoint
- Added /api/update-center/tasks/{id}/stream SSE endpoint
- Polls DB for task status updates every 1s (up to 2 min)
- Streams status + log events, ends on completion/timeout
- Added async-stream dependency
- 18/18 tests pass
2026-05-17 17:03:12 +08:00
boos e94c6cf853 feat: Proxy extensions — audio, video, completions, embeddings
- Generic execute_proxy_request executor for arbitrary paths
- POST /v1/completions, /v1/embeddings
- POST /v1/audio/speech, /v1/audio/transcriptions, /v1/audio/translations
- POST /v1/videos
- All reuse existing auth + route resolution infra
- 18/18 tests pass
2026-05-17 17:01:15 +08:00
boos 84b4b16ebd feat: Proxy extensions — /v1/completions + /v1/embeddings
- Added generic execute_proxy_request executor for any path suffix
- POST /v1/completions — forwards to upstream /completions
- POST /v1/embeddings — forwards to upstream /embeddings
- Both use existing auth + route resolution infra
- 18/18 tests pass
2026-05-17 16:59:43 +08:00
boos 4ac9c2385f feat: Organizations + Invitations routes migrated to Rust
- New migration: organizations, organization_members, invitations tables
- New model: Organization, OrganizationMember, Invitation
- Full CRUD: list/create/get/update orgs, members, invitations
- Public invitation lookup + accept flow
- JWT auth for all protected endpoints
- Admin role verification for org management
- 18/18 tests pass
2026-05-17 16:58:27 +08:00
boos fac1aa4a88 feat: Background tasks table + tasks route migrated to Rust
- New migration: background_tasks table
- New model: BackgroundTask (background_task.rs)
- GET /api/tasks with limit param
- GET /api/tasks/{id} with 404 handling
- 18/18 tests pass
2026-05-17 16:56:15 +08:00
boos d7d3670f02 feat: User API Keys routes migrated to Rust
- New user_api_keys.rs route module
- JWT-authenticated CRUD on downstream_api_keys scoped to user_id
- GET/POST/PATCH/DELETE /api/user-api-keys with ownership verification
- Uses existing downstream_api_keys table with user_id FK
- Supports all fields: name, tags, enabled, expires_at, max_cost, etc.
- 18/18 tests pass
2026-05-17 13:37:17 +08:00
boos 9329248e59 feat: Site Announcements routes migrated to Rust
- New SiteAnnouncement model (site_announcement.rs)
- Route handlers: list (with siteId/platform/read/status filters),
  mark read, mark all read, delete all
- In-memory status filtering for active/expired/dismissed (same as Node.js)
- Uses existing site_announcements table from migration
- 18/18 tests pass
2026-05-17 13:34:53 +08:00
boos 2793a7990d feat: Checkin + Events routes migrated to Rust
- /api/checkin — list logs, stats, accounts, toggle, run
- /api/events — list, count, mark read, clear
- CheckinLog + Event models
- cargo check ✅ | cargo test 18/18 ✅
2026-05-17 13:29:17 +08:00
boos af05b40799 feat: Events API routes migrated to Rust
- GET /api/events — list with filters (type, read, pagination)
- GET /api/events/count — unread count
- POST /api/events/{id}/read — mark one as read
- POST /api/events/read-all — mark all as read
- DELETE /api/events — clear all events
- Event model with sqlx FromRow
2026-05-17 13:28:16 +08:00
boos 8568859da6 feat: User management + JWT auth routes
- Admin users CRUD: /api/admin/users + /api/admin/users/{id}
- Public auth: /api/auth/register, /api/auth/login, /api/auth/me
- User model + password hashing via existing auth module
- JWT token generation and validation
- cargo check ✅ | cargo test 18/18 ✅
2026-05-17 13:24:37 +08:00
boos 7987833ba9 feat: Rust refactor — full backend rewrite (Phases 1-6)
Phase 1-3: Scaffold + types + auth (JWT, Argon2, API keys)
Phase 4a: Admin API (sites/accounts/tokens/downstream-keys/settings)
Phase 5: Proxy core (/v1/chat, /v1/images, /v1/models)
Phase 6: ComfyUI proxy routes migrated

- 80+ source files, all cargo check + 18 tests green
- Drop-in compatible with Node.js API surface
2026-05-17 13:20:52 +08:00
boos ad0bb86e31 feat: ComfyUI embedded dev setup + proxy auth with downstream keys
- COMFYUI_BASE configurable via env var (default 127.0.0.1:8188)
- All /api/comfyui/ routes protected by downstream API Key or admin token
- docker/Dockerfile.comfyui + docker-compose.comfyui.yml for dev
- npm scripts: comfyui:install, comfyui:start, comfyui:stop
- .gitignore / .env.example updated
2026-05-17 13:04:46 +08:00
boos 2fe8d8528a fix: ComfyUI Agent uses upstream API via env vars
- Read BOOSAPI_UPSTREAM_BASE/BOOSAPI_UPSTREAM_KEY from env
- Default to api.boos.lat/v1 with sk-boos4721
- Document: internal tool bypasses proxy /v1/ routing layer
- Update AGENTS.md with architecture decision
2026-05-17 04:23:20 +08:00
boos 5e3d4ee7d4 refactor: ComfyUI Agent - fix auth, upstream API, and SSE streaming
- Fix auth: use upstream API key (sk-boos4721) instead of local proxy
- Simplify SSE: remove nested SSE-in-SSE parsing, stream as plain text
- Fix frontend: add Authorization header from localStorage
- Fix ComfyUI nodes: default to api.boos.lat with correct API key
- All verified: frontend streaming works end-to-end with gpt-5.5
2026-05-17 04:17:12 +08:00
boos b78b622f0c docs: add subagent team collaboration strategy to Rust plan
Adds workstream map, parallel phase timing, shared contracts (AppState
extension, router composition, error type patterns), file ownership matrix,
subagent task template, git branch strategy, and coordinator workflow for
multi-agent parallel development.
2026-05-16 11:27:42 +08:00
boos 56b57f7ace docs: add Rust backend rewrite plan
Phase-by-phase migration plan for replacing the Node.js/Fastify backend
with Axum + SQLx + tokio in Rust. 13 phases covering scaffold through
integration testing.
2026-05-16 11:26:12 +08:00
boos f0188d3f68 docs: update plan with deployment doc improvements 2026-05-16 00:59:36 +08:00
boos 5bd847dd06 docs: complete Docker deployment documentation
- Fix all remaining metapi → boosapi references
- Full docker-compose.yml example with healthcheck
- .env file pattern with variable interpolation
- Complete environment variable reference table
- Docker Compose production checklist
- Redis/MySQL/PostgreSQL extension configs
- Resource limits example
- Nginx WebSocket support
- Admin panel IP restriction pattern
- Upgrade/rollback procedures with commands

Signed-off-by: Boos4721 <boos4721@icloud.com>
2026-05-16 00:54:54 +08:00
boos 0106dd3f5d Full internal rename: metapi → boosapi
Rename all remaining internal protocol identifiers:
- x-metapi-* headers → x-boosapi-*
- metapi: reasoning prefix → boosapi:
- __metapi* runtime markers → __boosapi*
- file-metapi-* → file-boosapi-*
- METAPI_* env vars → BOOSAPI_*
- metapi_turn_state/metapi_mcp_item__ etc. → boosapi_*
- package.json name → boosapi
- Docker/deploy/k3s/docs references

46 files changed, 168 insertions, 170 deletions.
typecheck:web passes (0 new errors).

Signed-off-by: Boos4721 <boos4721@icloud.com>
2026-05-16 00:46:28 +08:00
boos d2c16c3919 docs: add plan/ directory with 2026-05-15 dev report
- ComfyUI Agent conversational interface (SSE streaming)
- Metapi → BoosAPI full rebranding
- Gitea CI/CD runner on Alpine (OpenRC)
- Notification service architecture doc

Signed-off-by: Boos4721 <boos4721@icloud.com>
2026-05-16 00:37:38 +08:00
boos 0f3ff82147 fix: restore ComfyUI as workflow frontend with BoosAPI backend integration
ComfyUI is kept as a visual workflow editor (node-based). All actual
generation goes through BoosAPI's own API via boosapi_comfy_nodes.py
custom nodes (now defaulting to localhost:4000/v1).

Architecture:
  BoosAPI (Node.js, port 4000)
    ├── /video-agent → iframe → ComfyUI (Python, port 8188, CPU)
    │                              └── custom_nodes/boosapi_comfy_nodes.py
    │                                   └── calls BoosAPI /v1/... API
    ├── /comfyui-agent → chat interface (direct API calls)
    └── /v1/... → API endpoints (LLM, image, TTS, video)

Signed-off-by: boos <boos@boos.lat>
2026-05-16 00:26:07 +08:00
boos bd06698c8e refactor: fully embed ComfyUI into BoosAPI, drop external dependency
- Remove comfyui.ts (external proxy to ComfyUI at :8188)
- Remove videoAgent.ts (redundant with comfyuiAgent)
- Remove ComfyUI Python process from Dockerfile (CPU-only, useless)
- Update boosapi_comfy_nodes.py default to localhost BoosAPI
- Clean up index.ts, App.tsx, desktop.ts registrations
- Sidebar: merge '视频工作台'/'视频助手' into single '视频助手' entry

Signed-off-by: boos <boos@boos.lat>
2026-05-16 00:21:18 +08:00
boos 9612bfcb3b chore: remove .github folder
Signed-off-by: Boos4721 <boos4721@icloud.com>
2026-05-16 00:17:00 +08:00
boos 48eb5bddf9 chore: remove CI entirely
Signed-off-by: Boos4721 <boos4721@icloud.com>
2026-05-16 00:15:23 +08:00
boos f92d0352a0 fix: lighter CI - single job, skip heavy builds, limit node memory
Signed-off-by: Boos4721 <boos4721@icloud.com>
2026-05-16 00:05:15 +08:00
boos 2f9f3614a2 fix: adapt CI for Gitea Actions, remove Docker/GitHub-specific workflows
- Rewrite ci.yml: replace GitHub Actions with run: steps, drop
  Docker publish, MySQL/Postgres schema, and artifact upload jobs
- Delete codeql.yml (GitHub CodeQL, not available on Gitea)
- Delete docs-pages.yml (GitHub Pages specific)
- Delete release.yml (Docker Hub + GitHub Releases)
- Delete claude-code.md, claude-opus-4.7.md (unused)

Signed-off-by: Boos4721 <boos4721@icloud.com>
2026-05-15 22:54:30 +08:00
boos cd42de2689 docs: add SaaS multi-tenant features and REST API overview
- Add SaaS multi-tenant section to both Chinese and English READMEs
- Add REST API endpoint reference table
- Add SaaS/plan highlights in subtitle and pain-point table
- Bilingual sync

Signed-off-by: Boos4721 <boos4721@icloud.com>
2026-05-15 22:35:16 +08:00
boos 7886a0ab8b feat: add SaaS multi-tenant user management
- Add organizations, organization_members, invitations, data_plans tables
- Add organizationService (CRUD, member management, plan limit check)
- Add invitationService (create, accept, cancel invitations)
- Add planService (plan limits, seed defaults)
- Add /api/organizations/* routes (org CRUD, members, invitations)
- Add /api/invitations/* routes (public invite lookup, accept)
- Seed default plans (free/pro/enterprise) on startup

Signed-off-by: Boos4721 <boos4721@icloud.com>
2026-05-15 21:25:53 +08:00
boos 07013e2a39 docs: highlight built-in ComfyUI features
- Add ComfyUI chat assistant description in subtitle
- Add ComfyUI section in core features
- Update both Chinese and English versions

Signed-off-by: Boos4721 <boos4721@icloud.com>
2026-05-15 20:58:29 +08:00
boos 2c4aabe961 docs: rewrite README for BoosAPI rebranding
- Replace all Metapi references with BoosAPI
- Remove external service links (GitHub, Docker Hub, Render, Zeabur)
- Simplify structure for self-hosted deployment
- Update both Chinese and English versions

Signed-off-by: Boos4721 <boos4721@icloud.com>
2026-05-15 20:51:10 +08:00
boos 9cfe8427b5 feat: rebrand Metapi to BoosAPI, add ComfyUI agent and user management
- Rename project from Metapi to BoosAPI across all UI and server strings
- Add ComfyUI conversational agent page (/comfyui-agent)
- Add user management system (register, login, API keys, admin)
- Update Dockerfile and database schema
- Add ComfyUI workflow nodes support
- Update shared contracts and platform configurations

Signed-off-by: Boos4721 <boos4721@icloud.com>
2026-05-15 20:20:58 +08:00
Tursom K. Ulefits cdb12a9819 [codex] fix quota refresh probe model (#490) 2026-05-08 22:55:17 +08:00
Ju Zi f19ddac865 feat: 支持从站点页快捷添加 API Key (#505)
Co-authored-by: juzi <956428403@qq.com>
2026-05-08 22:54:40 +08:00
Cita 90e2f0c405 Merge PR #535: clear production dependency audit
Merge the narrow package-lock refresh that restores the main production audit gate.
2026-05-08 17:39:42 +08:00
cita-777 0f51dec36e Clear the main-branch production audit gate
Constraint: main push CI fails on npm audit --omit=dev --audit-level=high after recent merges.
Rejected: Broad npm audit fix output | it updated unrelated dev-only lockfile entries.
Confidence: high
Scope-risk: narrow
Directive: Keep PR audit informational until production dependencies are audited on dev/main consistently.
Tested: ELECTRON_SKIP_BINARY_DOWNLOAD=1 npm ci --prefer-offline --no-audit --no-fund; npm audit --omit=dev --audit-level=high; npm run typecheck:server; npm test -- --run src/server/config.test.ts src/server/settingsRoutePayloads.test.ts
Not-tested: Full GitHub Actions matrix before opening PR.
2026-05-08 17:35:24 +08:00
Cita f4148675e1 Merge PR #510: per-site model probe
Merged after updating the PR onto current main and fixing the remaining probe-setting review gaps.\n\nValidation:\n- GitHub checks all passing: Test Core, Typecheck, Build Web/Server/Desktop, Repo Drift Check, Schema SQLite/MySQL/Postgres, CodeQL, CodeRabbit.\n- Local: npm run typecheck\n- Local: npm run repo:drift-check\n- Local: npx vitest run --root . src/server/db/schemaContract.test.ts src/server/db/schemaArtifactGenerator.test.ts src/server/db/schemaIntrospection.test.ts src/server/db/schemaParity.test.ts src/web/api.test.ts src/web/pages/helpers/sitesEditor.test.ts src/web/pages/sites.disabled-models-save.test.tsx src/web/pages/sites.edit-scroll.test.tsx
2026-05-08 16:58:27 +08:00
cita-777 e5a8a0b3d7 Keep per-site probe settings reliable before merge
Refresh the PR onto current main and close the remaining probe-setting review gaps: the primary site save now persists the latency threshold, the site row type carries that field without an any-cast, active probe streams are aborted on unmount, and all-model one-shot probes get the longer timeout they need.

Constraint: PR #510 must preserve the per-site model probe feature while merging cleanly into current main.
Rejected: Leave threshold persistence behind the separate probe-settings button | the primary save path would still silently drop user changes.
Rejected: Keep the SiteRow any-cast | it hides API/schema drift for the new persisted field.
Confidence: high
Scope-risk: narrow
Directive: Keep probe setting fields represented in the typed site save payload and covered by focused web API/editor tests.
Tested: npm run typecheck; npm run repo:drift-check; npx vitest run --root . src/server/db/schemaContract.test.ts src/server/db/schemaArtifactGenerator.test.ts src/server/db/schemaIntrospection.test.ts src/server/db/schemaParity.test.ts src/web/api.test.ts src/web/pages/helpers/sitesEditor.test.ts src/web/pages/sites.disabled-models-save.test.tsx src/web/pages/sites.edit-scroll.test.tsx
Not-tested: Full npm test.
2026-05-08 16:51:05 +08:00
Cita 1d61a7ac84 Merge PR #495: auto-discover recent Docker Hub dev tags
Merged after resolving conflicts with current main.\n\nValidation:\n- GitHub checks all passing: Test Core, Typecheck, Build Web/Server/Desktop, Repo Drift Check, Schema checks, CodeQL, CodeRabbit.\n- Local: npx vitest run --root . src/web/pages/settings/UpdateCenterSection.test.tsx src/server/services/updateCenterVersionService.test.ts src/server/routes/api/updateCenter.test.ts src/server/services/updateCenterStatusService.test.ts\n- Local: npm run typecheck\n- Local: npm run repo:drift-check
2026-05-08 16:27:26 +08:00
cita-777 93bc42a69d Refresh the recent Docker tag PR onto current main
The release branch had fallen behind current main and only conflicted in the
Update Center recent-tag test. Keep the latest main-side deploy-state coverage
while preserving the PR's raw-tag filtering and digest visibility assertions.

Constraint: PR #495 must merge into the current main without widening the PR diff beyond the update-center candidate behavior.
Rejected: Drop the PR-specific digest/raw-tag assertions | would regress the review fixes that prompted the branch update.
Confidence: high
Scope-risk: narrow
Directive: Keep recent Docker tag cards deployable only from real tagName values and keep digest metadata visible before deployment.
Tested: npx vitest run --root . src/web/pages/settings/UpdateCenterSection.test.tsx src/server/services/updateCenterVersionService.test.ts src/server/routes/api/updateCenter.test.ts src/server/services/updateCenterStatusService.test.ts; npm run typecheck; npm run repo:drift-check; git diff --cached --check origin/main
Not-tested: Full npm test.
2026-05-08 16:23:05 +08:00
Cita 508fa71ec7 Merge pull request #518 from kevinye13/fix/settings-allowlist-json-array
fix(settings): persist model allowlist as JSON array
2026-05-08 16:05:15 +08:00
Cita 3ce705ab9d Update contributors section in README.md 2026-05-08 15:37:37 +08:00
Cita 4481cf7493 Clean up contributor section in README
Removed unnecessary contributor images from the README.
2026-05-08 15:29:19 +08:00
Cita 3720b3d0ed Merge pull request #533 from cita-777/release/fix-protocol-compatibility-20260508
[fix] Harden protocol compatibility from dev
2026-05-08 11:05:31 +08:00
cita-777 10dc1ba7bd Carry update center review test follow-up
This merge keeps PR #533 aligned with dev after addressing CodeRabbit follow-up test comments. The changes are limited to UpdateCenterSection test assertions.

Constraint: Release branch remains the publication branch for the open main-targeting PR.

Confidence: high

Scope-risk: narrow

Tested: npx vitest run --root . src/web/pages/settings/UpdateCenterSection.test.tsx

Tested: npm run typecheck:web

Co-authored-by: OmX <omx@oh-my-codex.dev>
2026-05-08 10:50:25 +08:00
cita-777 fee6a6388f Tighten update center review test coverage
CodeRabbit follow-up review pointed out that one renderer assertion could not fail usefully and that the new recent-candidate deploy test did not prove log streaming after dispatch. The test now asserts the visible candidate text directly and covers streamUpdateCenterTaskLogs for the new deploy path.

Constraint: Keep review follow-up scoped to test coverage only.

Confidence: high

Scope-risk: narrow

Tested: npx vitest run --root . src/web/pages/settings/UpdateCenterSection.test.tsx

Tested: npm run typecheck:web

Co-authored-by: OmX <omx@oh-my-codex.dev>
2026-05-08 10:50:10 +08:00
cita-777 00348e0528 Carry protocol review fixes into release
The release branch is main-based and tracks the reviewed dev slice for PR publication. This merge carries the post-review compatibility fixes without rewriting the already-open PR history.

Constraint: PR #533 publishes dev changes through a clean release branch targeting main.

Rejected: Recreate the PR branch from scratch | unnecessary churn after green checks and review context already exist.

Confidence: high

Scope-risk: narrow

Tested: npx vitest run --root . src/server/proxy-core/responsesPreflight.test.ts src/server/proxy-core/serviceTierPolicy.test.ts src/server/routes/proxy/chat.stream.test.ts src/web/pages/settings/UpdateCenterSection.test.tsx

Tested: npm run typecheck:server

Tested: npm run typecheck:web

Tested: npm run repo:drift-check

Co-authored-by: OmX <omx@oh-my-codex.dev>
2026-05-08 10:43:12 +08:00
cita-777 8309ac073a Close protocol compatibility review gaps
Review feedback found narrow compatibility regressions in the web-search shim, Responses tool detection, service tier accounting, and update-center Docker candidate actions. The fix keeps synthetic search routed through the dedicated search model, preserves Responses text compatibility, distinguishes absent service_tier from filtered service_tier, and evaluates recent Docker tags per candidate.

Constraint: Review fixes must stay on dev first, then flow into the main-based release PR branch.

Rejected: Leave Responses web_search simulation on the request model | it has the same search-route selection risk as Anthropic simulation.

Confidence: high

Scope-risk: narrow

Tested: npx vitest run --root . src/server/proxy-core/responsesPreflight.test.ts src/server/proxy-core/serviceTierPolicy.test.ts src/server/routes/proxy/chat.stream.test.ts src/web/pages/settings/UpdateCenterSection.test.tsx

Tested: npm run typecheck:server

Tested: npm run typecheck:web

Tested: npm run repo:drift-check

Co-authored-by: OmX <omx@oh-my-codex.dev>
2026-05-08 10:42:49 +08:00