Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Bug report
description: Report a reproducible bug or regression.
title: "[Bug]: "
body:
- type: textarea
id: summary
attributes:
label: Summary
description: What went wrong, and what did you expect instead?
placeholder: Briefly describe the bug and the expected behavior.
validations:
required: true
- type: dropdown
id: area
attributes:
label: Area
options:
- Desktop app
- Web UI
- Mobile web
- Agent runtime / core
- AI provider / model adapter
- Remote workspace / relay
- Installer / packaging
- Documentation
- Not sure
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: Reproduction or evidence
description: Steps, screenshots, logs, or a short recording. Remove tokens, keys, user IDs, and private data.
placeholder: |
1. Open ...
2. Click ...
3. Observe ...
validations:
required: true
- type: textarea
id: environment
attributes:
label: Environment, if relevant
description: Include the version, commit, OS, browser, desktop/mobile device, model/provider, or deployment mode if relevant.
placeholder: |
BitFun version/commit:
OS:
Browser/device:
Model/provider:
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: Security vulnerability
url: https://github.com/GCWing/BitFun/security/advisories/new
about: Please report security issues privately instead of opening a public issue.
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Documentation issue
description: Report missing, outdated, confusing, or incorrect documentation.
title: "[Docs]: "
body:
- type: textarea
id: location
attributes:
label: Documentation location
description: Link the page or file path if known.
placeholder: README.md, CONTRIBUTING.md, docs/..., website page, etc.
validations:
required: true
- type: textarea
id: problem
attributes:
label: Problem or suggested update
description: What is missing, outdated, confusing, or incorrect? Include suggested wording if you have it.
validations:
required: true
46 changes: 46 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Feature or product proposal
description: Suggest a user-facing feature, workflow improvement, or product direction.
title: "[Feature]: "
body:
- type: textarea
id: problem
attributes:
label: Problem / opportunity
description: What user problem, workflow gap, or product opportunity should this address?
placeholder: Describe the current pain point and who experiences it.
validations:
required: true
- type: textarea
id: proposal
attributes:
label: Proposed behavior
description: What should BitFun do differently?
placeholder: Describe the desired behavior or workflow.
validations:
required: true
- type: dropdown
id: surface
attributes:
label: Product surface
options:
- Desktop app
- Web UI
- Mobile web
- Agent runtime / core
- AI provider / model adapter
- Remote workspace / relay
- Installer / packaging
- Documentation
- Cross-cutting
- Not sure
validations:
required: true
- type: textarea
id: details
attributes:
label: Details, examples, or constraints
description: Optional. Include acceptance criteria, screenshots, alternatives, risks, or compatibility concerns.
placeholder: |
- Users can ...
- The UI shows ...
- It works when ...
33 changes: 33 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
## Summary

<!-- Briefly describe what changed. -->

Fixes #

## Type and Areas

Type:

<!-- Feature / bug fix / regression fix / refactor / UI/UX / docs / test / CI / dependency / other. -->

Areas:

<!-- Rust core, desktop/Tauri, web UI, mobile web, server/relay, AI adapters, installer, docs, etc. -->

## Motivation / Impact

<!-- What problem does this solve, and what changes for users or developers? Write "No direct user-facing change" if applicable. -->

## Verification

<!-- List exact commands, manual checks, and outcomes. For docs-only or template-only changes, use the lightest relevant checks or explain why runtime checks were skipped. -->

## Reviewer Notes

<!-- Optional: screenshots, architecture notes, compatibility risks, migration notes, or rollback guidance. -->

## Checklist

- [ ] This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
- [ ] Relevant verification is recorded above, or skipped checks are explained.
- [ ] User-facing strings, docs, and locales are updated where applicable.
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ jobs:
NODE_OPTIONS: --max-old-space-size=6144
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Setup pnpm
uses: pnpm/action-setup@v4
Expand All @@ -112,15 +114,30 @@ jobs:
node-version: 20
cache: pnpm

- name: Check repository hygiene
run: pnpm run check:repo-hygiene

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Validate GitHub config
run: pnpm run check:github-config

- name: Lint web UI
run: pnpm run lint:web

- name: Run web UI tests
run: pnpm --dir src/web-ui run test:run

- name: Build web UI
run: pnpm run build:web

- name: Type-check mobile web
run: pnpm --dir src/mobile-web run type-check

- name: Build mobile web
run: pnpm run build:mobile-web

- name: Upload frontend build artifacts
uses: actions/upload-artifact@v4
with:
Expand Down
16 changes: 13 additions & 3 deletions AGENTS-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# AGENTS-CN.md

BitFun 是一个由 Rust workspace 与共享 React 前端组成的项目。
BitFun 是一个由 Rust workspace React 前端组成的项目。

仓库核心原则:**先保持产品逻辑平台无关,再通过平台适配层对外暴露能力**。

Expand All @@ -19,7 +19,10 @@ BitFun 是一个由 Rust workspace 与共享 React 前端组成的项目。
|---|---|---|
| Core(产品逻辑) | `src/crates/core` | [AGENTS.md](src/crates/core/AGENTS.md) |
| 已拆出的 core 支撑 crate | `src/crates/{core-types,agent-stream,runtime-ports,terminal,tool-runtime}` | (使用 core 指南) |
| Core owner crate | `src/crates/{services-core,services-integrations,agent-tools,tool-packs}` | (使用 core 指南 + 拆解护栏) |
| Service core owner crate | `src/crates/services-core` | [AGENTS.md](src/crates/services-core/AGENTS.md) |
| Service integrations owner crate | `src/crates/services-integrations` | [AGENTS.md](src/crates/services-integrations/AGENTS.md) |
| Agent tool contracts | `src/crates/agent-tools` | [AGENTS.md](src/crates/agent-tools/AGENTS.md) |
| Tool pack provider plan | `src/crates/tool-packs` | [AGENTS.md](src/crates/tool-packs/AGENTS.md) |
| 产品领域 crate | `src/crates/product-domains` | [AGENTS.md](src/crates/product-domains/AGENTS.md) |
| Transport 适配层 | `src/crates/transport` | (使用 core 指南) |
| API layer | `src/crates/api-layer` | (使用 core 指南) |
Expand All @@ -30,6 +33,7 @@ BitFun 是一个由 Rust workspace 与共享 React 前端组成的项目。
| CLI | `src/apps/cli` | (使用 core 指南) |
| 中继服务器 | `src/apps/relay-server` | (使用 core 指南) |
| 共享前端 | `src/web-ui` | [AGENTS.md](src/web-ui/AGENTS.md) |
| Mobile web | `src/mobile-web` | [AGENTS.md](src/mobile-web/AGENTS.md) |
| 安装器 | `BitFun-Installer` | [AGENTS.md](BitFun-Installer/AGENTS.md) |
| E2E 测试 | `tests/e2e` | [AGENTS.md](tests/e2e/AGENTS.md) |

Expand All @@ -49,6 +53,9 @@ pnpm run cli:dev # CLI 运行时
pnpm run fmt:rs # 只格式化已改动 / 已暂存的 Rust 文件
pnpm run lint:web
pnpm run type-check:web
pnpm --dir src/mobile-web run type-check
pnpm run check:repo-hygiene
pnpm run check:github-config
cargo check --workspace

# 测试
Expand All @@ -58,6 +65,7 @@ cargo test --workspace
# 构建
cargo build -p bitfun-desktop
pnpm run build:web
pnpm run build:mobile-web

# 快速构建(开发 / CI 提速)
pnpm run desktop:build:fast # debug 构建,不打包
Expand Down Expand Up @@ -164,6 +172,7 @@ SessionManager → Session → DialogTurn → ModelRound
| 改动类型 | 最低验证要求 |
|---|---|
| 前端 UI、状态、适配层或多语言文案 | `pnpm run lint:web && pnpm run type-check:web && pnpm --dir src/web-ui run test:run` |
| Mobile web UI、状态、配对、断开或重连行为 | `pnpm --dir src/mobile-web run type-check && pnpm run build:mobile-web`;行为变化还需要在 PR 中说明手动配对 / 重连验证 |
| Deep Review / 代码审核团队行为 | 运行上面的前端验证,再运行 `cargo test -p bitfun-core deep_review -- --nocapture`;如果触及后端或 Tauri API,还需要运行下方 Rust / 桌面端验证 |
| `core`、`transport`、`api-layer` 或共享服务中的 Rust 逻辑 | `cargo check --workspace && cargo test --workspace` |
| 桌面端集成、Tauri API、browser/computer-use 或桌面专属行为 | `cargo check -p bitfun-desktop && cargo test -p bitfun-desktop` |
Expand All @@ -176,7 +185,8 @@ SessionManager → Session → DialogTurn → ModelRound
| 功能 | 关键路径 |
|---|---|
| Agent mode | `src/crates/core/src/agentic/agents/`、`src/crates/core/src/agentic/agents/prompts/`、`src/web-ui/src/locales/*/scenes/agents.json` |
| Deep Review / 代码审核团队 | `src/crates/core/src/agentic/deep_review_policy.rs`、`src/crates/core/src/agentic/agents/deep_review_agent.rs`、`src/crates/core/src/agentic/tools/implementations/{task_tool.rs,code_review_tool.rs}`、`src/web-ui/src/shared/services/reviewTeamService.ts`、`src/web-ui/src/flow_chat/services/DeepReviewService.ts`、`src/web-ui/src/app/scenes/agents/components/ReviewTeamPage.tsx` |
| Deep Review / 代码审核团队 | `src/crates/core/src/agentic/deep_review/`、`src/crates/core/src/agentic/deep_review_policy.rs`、`src/crates/core/src/agentic/agents/definitions/hidden/deep_review.rs`、`src/crates/core/src/agentic/tools/implementations/{task_tool.rs,code_review_tool.rs}`、`src/web-ui/src/shared/services/review-team/`、`src/web-ui/src/flow_chat/deep-review/`、`src/web-ui/src/app/scenes/agents/components/ReviewTeamPage.tsx` |
| Mobile web 配对 / 远程控制 | `src/mobile-web/src/pages/PairingPage.tsx`、`src/mobile-web/src/pages/SessionListPage.tsx`、`src/mobile-web/src/pages/ChatPage.tsx`、`src/mobile-web/src/services/RemoteSessionManager.ts`、`src/mobile-web/src/services/RelayHttpClient.ts`、`src/mobile-web/src/services/store.ts` |
| 会话用量报告(`/usage`) | `src/crates/core/src/service/session_usage/`、`src/web-ui/src/flow_chat/components/usage/`、`src/web-ui/src/locales/*/flow-chat.json` |
| Tool | `src/crates/core/src/agentic/tools/implementations/`、`src/crates/core/src/agentic/tools/registry.rs` |
| MCP / LSP / remote | `src/crates/core/src/service/mcp/`、`src/crates/core/src/service/lsp/`、`src/crates/core/src/service/remote_connect/`、`src/crates/core/src/service/remote_ssh/` |
Expand Down
11 changes: 9 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# AGENTS.md

BitFun is a Rust workspace plus a shared React frontend.
BitFun is a Rust workspace plus React frontends.

Repository rule: **keep product logic platform-agnostic, then expose it through platform adapters**.

Expand Down Expand Up @@ -33,6 +33,7 @@ Repository rule: **keep product logic platform-agnostic, then expose it through
| CLI | `src/apps/cli` | (use core guide) |
| Relay server | `src/apps/relay-server` | (use core guide) |
| Shared frontend | `src/web-ui` | [AGENTS.md](src/web-ui/AGENTS.md) |
| Mobile web | `src/mobile-web` | [AGENTS.md](src/mobile-web/AGENTS.md) |
| Installer | `BitFun-Installer` | [AGENTS.md](BitFun-Installer/AGENTS.md) |
| E2E tests | `tests/e2e` | [AGENTS.md](tests/e2e/AGENTS.md) |

Expand All @@ -52,6 +53,9 @@ pnpm run cli:dev # CLI runtime
pnpm run fmt:rs # format only changed / staged Rust files
pnpm run lint:web
pnpm run type-check:web
pnpm --dir src/mobile-web run type-check
pnpm run check:repo-hygiene
pnpm run check:github-config
cargo check --workspace

# Test
Expand All @@ -61,6 +65,7 @@ cargo test --workspace
# Build
cargo build -p bitfun-desktop
pnpm run build:web
pnpm run build:mobile-web

# Fast builds (for development / CI speed)
pnpm run desktop:build:fast # debug build, no bundling
Expand Down Expand Up @@ -171,6 +176,7 @@ Session data is stored under `.bitfun/sessions/{session_id}/`.
| Change type | Minimum verification |
|---|---|
| Frontend UI, state, adapters, or locales | `pnpm run lint:web && pnpm run type-check:web && pnpm --dir src/web-ui run test:run` |
| Mobile web UI, state, pairing, disconnect, or reconnect behavior | `pnpm --dir src/mobile-web run type-check && pnpm run build:mobile-web`; include manual pairing / reconnect verification when behavior changes |
| Deep Review / Code Review Team behavior | Web UI verification above, plus `cargo test -p bitfun-core deep_review -- --nocapture`; also run the Rust / desktop rows below when backend or Tauri APIs are touched |
| Shared Rust logic in `core`, `transport`, `api-layer`, or services | `cargo check --workspace && cargo test --workspace` |
| Desktop integration, Tauri APIs, browser/computer-use, or desktop-only behavior | `cargo check -p bitfun-desktop && cargo test -p bitfun-desktop` |
Expand All @@ -183,7 +189,8 @@ Session data is stored under `.bitfun/sessions/{session_id}/`.
| Feature | Key paths |
|---|---|
| Agent modes | `src/crates/core/src/agentic/agents/`, `src/crates/core/src/agentic/agents/prompts/`, `src/web-ui/src/locales/*/scenes/agents.json` |
| Deep Review / Code Review Team | `src/crates/core/src/agentic/deep_review/`, `src/crates/core/src/agentic/deep_review_policy.rs`, `src/crates/core/src/agentic/agents/deep_review_agent.rs`, `src/crates/core/src/agentic/tools/implementations/{task_tool.rs,code_review_tool.rs}`, `src/web-ui/src/shared/services/review-team/`, `src/web-ui/src/flow_chat/deep-review/`, `src/web-ui/src/app/scenes/agents/components/ReviewTeamPage.tsx` |
| Deep Review / Code Review Team | `src/crates/core/src/agentic/deep_review/`, `src/crates/core/src/agentic/deep_review_policy.rs`, `src/crates/core/src/agentic/agents/definitions/hidden/deep_review.rs`, `src/crates/core/src/agentic/tools/implementations/{task_tool.rs,code_review_tool.rs}`, `src/web-ui/src/shared/services/review-team/`, `src/web-ui/src/flow_chat/deep-review/`, `src/web-ui/src/app/scenes/agents/components/ReviewTeamPage.tsx` |
| Mobile web pairing / remote control | `src/mobile-web/src/pages/PairingPage.tsx`, `src/mobile-web/src/pages/SessionListPage.tsx`, `src/mobile-web/src/pages/ChatPage.tsx`, `src/mobile-web/src/services/RemoteSessionManager.ts`, `src/mobile-web/src/services/RelayHttpClient.ts`, `src/mobile-web/src/services/store.ts` |
| Session usage report (`/usage`) | `src/crates/core/src/service/session_usage/`, `src/web-ui/src/flow_chat/components/usage/`, `src/web-ui/src/locales/*/flow-chat.json` |
| Tools | `src/crates/core/src/agentic/tools/implementations/`, `src/crates/core/src/agentic/tools/registry.rs` |
| MCP / LSP / remote | `src/crates/core/src/service/mcp/`, `src/crates/core/src/service/lsp/`, `src/crates/core/src/service/remote_connect/`, `src/crates/core/src/service/remote_ssh/` |
Expand Down
20 changes: 13 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ We welcome contributions beyond standard feature or bug-fix PRs. Examples includ

- Open an issue to describe the problem or proposal, especially for larger changes, to avoid duplication and design conflicts
- For new features or UI changes, discuss the design direction early to ensure it fits the product experience
- Use the issue and PR templates as a guide. Keep the PR focused and explain any skipped verification when it matters.

### PR title and description

Expand All @@ -155,6 +156,8 @@ UI changes should include before/after screenshots or a short recording for fast

If your work is AI-assisted, please note it in the PR and indicate testing level (untested/lightly tested/fully tested) to help reviewers assess risk.

Do not commit transient AI prompts, local absolute paths, generated scratch files, pairing secrets, tokens, certificates, or unrelated artifacts. Keep the PR focused on the intended product or maintenance change.

### Branch management

**The `main` branch is the default collaboration branch and accepts feature PRs.** Since this repo encourages product managers and developers to use AI-generated code for rapid validation or idea submission, **please open all PRs targeting the `main` branch**.
Expand All @@ -165,17 +168,20 @@ Keep PRs small and focused. Avoid bundling unrelated changes.

## Testing and Verification

Run relevant tests for your change:
Run relevant tests for your change. You do not need to run every row below; choose the smallest set that matches the files and behavior you touched:

For `/usage` UI copy changes, keep `en-US`, `zh-CN`, and `zh-TW` locale strings in sync.

```bash
# Rust
cargo test --workspace
| Change type | Recommended verification |
| --- | --- |
| Repository metadata, PR/issue templates, or GitHub workflows | `pnpm run check:repo-hygiene && pnpm run check:github-config && git diff --check` |
| Web UI, state, adapters, or locale changes | `pnpm run lint:web && pnpm run type-check:web && pnpm --dir src/web-ui run test:run` |
| Mobile web UI, pairing, reconnect, disconnect, or chat-flow changes | `pnpm --dir src/mobile-web run type-check && pnpm run build:mobile-web` |
| Rust core, transport, API layer, services, or shared runtime logic | `cargo check --workspace && cargo test --workspace` |
| Desktop integration, Tauri APIs, or desktop-only behavior | `cargo check -p bitfun-desktop && cargo test -p bitfun-desktop` |
| E2E-covered behavior | Build the nearest app target, then run the closest E2E spec or `pnpm run e2e:test:l0` |

# E2E
pnpm run e2e:test
```
For mobile-web pairing, reconnect, disconnect, or chat-flow changes, include manual verification steps and screenshots or a short recording when the UI changes.

If you cannot run tests, explain why in the PR and provide manual verification steps.

Expand Down
Loading