Skip to content
Merged
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
6 changes: 3 additions & 3 deletions AGENTS-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ Stable Contracts and Security Control Plane 的边界以
| 1 | 接口与入口层 | `src/apps/*`, `src/web-ui`, `src/mobile-web`, `BitFun-Installer`, `tests/e2e`, `src/crates/interfaces` | 产品宿主、命令、UI 入口、协议接口和跨形态测试 | desktop、CLI、server、relay、Web UI、mobile web、installer、E2E、`acp`、`sdk-host` | 最近的本地 `AGENTS.md`;[interfaces](src/crates/interfaces/AGENTS.md) |
| 2 | 产品组装层 | `src/crates/assembly` | 兼容导出、产品能力选择、product-full 接线、不可变内置 Agent 内容、adapter/service 注册和生态无关的来源协调 | `agent-content`, `core`, `external-sources`, `product-capabilities` | [AGENTS.md](src/crates/assembly/AGENTS.md) |
| 3 | 适配层 | `src/crates/adapters` | AI/transport/WebDriver 协议 adapter、外部 AI work source adapter(OpenCode/Claude Code/Codex)和外部 provider 转换 | `agent-runtime-ipc`、`ai-adapters`, `opencode-adapter`, `claude-code-adapter`, `codex-adapter`, `static-hook-support`, `transport`, `webdriver` | [AGENTS.md](src/crates/adapters/AGENTS.md) |
| 4 | 服务实现层 | `src/crates/services` | 可复用 OS、filesystem、terminal、MCP、remote、git、watch、process、LSP plugin registry、session persistence primitives、network 和 MiniApp runtime IO 实现 | `services-core`, `services-integrations`, `relay-service`, `page-function-runtime`, `terminal` | [AGENTS.md](src/crates/services/AGENTS.md) |
| 4 | 服务实现层 | `src/crates/services` | 可复用 OS、filesystem、terminal、MCP、remote、git、watch、process、session persistence primitives、network 和 MiniApp runtime IO 实现 | `services-core`, `services-integrations`, `relay-service`, `page-function-runtime`, `terminal` | [AGENTS.md](src/crates/services/AGENTS.md) |
| 5 | 执行原语层 | `src/crates/execution` | 可移植 agent、harness、stream、DeepReview policy/report、插件运行时客户端、typed-service、tool-contract、tool-group 和 tool-execution 构件 | `agent-runtime`, `agent-stream`, `tool-contracts`, `harness`, `plugin-runtime-client`, `runtime-services`, `tool-provider-groups`, `tool-execution`, `tool-call-jsonrepair` | [AGENTS.md](src/crates/execution/AGENTS.md) |
| 6 | 稳定契约与产品领域层 | `src/crates/contracts` | 跨层共享 DTO、事件形状、runtime port、LSP protocol/plugin DTO、产品领域契约和策略 | `core-types`, `events`, `runtime-ports`, `product-domains` | [AGENTS.md](src/crates/contracts/AGENTS.md) |
| 6 | 稳定契约与产品领域层 | `src/crates/contracts` | 跨层共享 DTO、事件形状、runtime port、产品领域契约和策略 | `core-types`, `events`, `runtime-ports`, `product-domains` | [AGENTS.md](src/crates/contracts/AGENTS.md) |

边界规则:

- 接口与入口层暴露选定产品行为;可复用行为应下移。
- 组装层只接线下层并选择产品能力事实,不实现具体 adapter、OS 或 service 细节。
- 产品特性只在内核能力之上组装用户侧命令、UI contribution、设置和默认策略;长程任务、scheduler、permission、session/workspace、memory、DFX、hook 和 event 事实属于 Agent Kernel owner。
- 适配层翻译协议和外部 provider 形状,不拥有产品能力选择或可复用 OS service 行为。
- 服务实现层负责可复用的 OS、process、terminal、MCP、remote、git、filesystem、LSP plugin registry、session persistence primitives 和 MiniApp runtime IO 能力。
- 服务实现层负责可复用的 OS、process、terminal、MCP、remote、git、filesystem、session persistence primitives 和 MiniApp runtime IO 能力。
- 外部系统是边界外资源,不是仓库内层级。只有已注册的 adapter、service 或 app-local provider 应调用它们;其他层消费 port 和稳定契约。
- 执行原语层只放可移植运行时构件,不拥有宿主或交付形态。
- 契约层保持轻行为,不得向上依赖。
Expand Down
6 changes: 3 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ Keep crate dependencies inside each layer to the smallest set needed.
| 1 | Interfaces and entrypoints | `src/apps/*`, `src/web-ui`, `src/mobile-web`, `BitFun-Installer`, `tests/e2e`, `src/crates/interfaces` | Product hosts, commands, UI entrypoints, protocol interfaces, and cross-surface tests | desktop, CLI, server, relay, Web UI, mobile web, installer, E2E, `acp`, `app-server`, `sdk-host` | nearest local `AGENTS.md`; [interfaces](src/crates/interfaces/AGENTS.md) |
| 2 | Product assembly | `src/crates/assembly` | Compatibility exports, product capability selection, product-full wiring, immutable built-in Agent content, adapter/service registration, and ecosystem-neutral source coordination | `agent-content`, `core`, `external-sources`, `product-capabilities` | [AGENTS.md](src/crates/assembly/AGENTS.md) |
| 3 | Adapters | `src/crates/adapters` | AI/transport/WebDriver protocol adapters, external AI work source adapters (OpenCode/Claude Code/Codex), and external-provider translation | `agent-runtime-ipc`, `ai-adapters`, `opencode-adapter`, `claude-code-adapter`, `codex-adapter`, `static-hook-support`, `transport`, `webdriver` | [AGENTS.md](src/crates/adapters/AGENTS.md) |
| 4 | Services | `src/crates/services` | Reusable OS, filesystem, terminal, MCP, remote, git, watch, process, LSP plugin registry, session persistence primitives, MiniApp runtime IO, and network implementations | `services-core`, `services-integrations`, `miniapp-market-service`, `relay-service`, `page-function-runtime`, `terminal` | [AGENTS.md](src/crates/services/AGENTS.md) |
| 4 | Services | `src/crates/services` | Reusable OS, filesystem, terminal, MCP, remote, git, watch, process, session persistence primitives, MiniApp runtime IO, and network implementations | `services-core`, `services-integrations`, `miniapp-market-service`, `relay-service`, `page-function-runtime`, `terminal` | [AGENTS.md](src/crates/services/AGENTS.md) |
| 5 | Execution primitives | `src/crates/execution` | Portable agent, harness, stream, DeepReview policy/report, plugin runtime client, typed-service, tool-contract, tool-group, and tool-execution building blocks | `agent-runtime`, `agent-stream`, `tool-contracts`, `harness`, `plugin-runtime-client`, `runtime-services`, `tool-provider-groups`, `tool-execution`, `tool-call-jsonrepair` | [AGENTS.md](src/crates/execution/AGENTS.md) |
| 6 | Stable contracts and product domains | `src/crates/contracts` | Shared DTOs, event shapes, runtime ports, LSP protocol/plugin DTOs, and product domain contracts/policies | `core-types`, `events`, `runtime-ports`, `product-domains` | [AGENTS.md](src/crates/contracts/AGENTS.md) |
| 6 | Stable contracts and product domains | `src/crates/contracts` | Shared DTOs, event shapes, runtime ports, and product domain contracts/policies | `core-types`, `events`, `runtime-ports`, `product-domains` | [AGENTS.md](src/crates/contracts/AGENTS.md) |

Boundary rules:

- Interfaces and app entrypoints expose selected product behavior; reusable behavior moves down.
- Assembly wires lower layers and selects product capability facts; it must not implement concrete adapter, OS, or service details.
- Product features assemble user-facing commands, UI contributions, settings, and default policy on top of kernel capabilities; long-running task, scheduler, permission, session/workspace, memory, DFX, hook, and event facts stay in Agent Kernel owners.
- Adapters translate protocols and external-provider shapes; they should not own product capability selection or reusable OS service behavior.
- Services implement reusable concrete OS, process, terminal, MCP, remote, git, filesystem, LSP plugin registry, and MiniApp runtime IO capabilities.
- Services implement reusable concrete OS, process, terminal, MCP, remote, git, filesystem, and MiniApp runtime IO capabilities.
- External systems are boundary resources, not repository layers. Only registered adapters/services/app-local providers should call them; other layers consume ports and stable contracts.
- Execution crates are portable runtime building blocks, not host-specific or delivery-profile owners.
- Contracts stay behavior-light and must not depend upward.
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ terms:
> Product managers and UI designers are welcome to submit ideas quickly via PI. We will help refine them for development.
2. Improve the Agent system and overall quality
3. Improve system stability and strengthen foundational capabilities
4. Expand the ecosystem (Skills, MCP, LSP plugins, or better support for domain-specific development scenarios)
4. Expand the ecosystem (Skills, MCP, or better support for domain-specific development scenarios)

## Contribution Workflow and PR Expectations

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ DevTools;`Cmd/Ctrl + Shift + I` 切换 BitFun 元素检查器,`Cmd/Ctrl + Sh
> 欢迎产品经理、UI 设计师通过 PI 快速提交创意,我们会帮助完善开发
2. 优化 Agent 系统和效果
3. 对提升系统稳定性和完善基础能力
4. 扩展生态(Skills、MCP、LSP 插件,或者对某些垂域开发场景的更好支持)
4. 扩展生态(Skills、MCP,或者对某些垂域开发场景的更好支持)

## 贡献流程与 PR 约定

Expand Down
2 changes: 0 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ dark-light = "1.1"
dunce = "1"
filetime = "0.2"
fs2 = "0.4"
zip = { version = "4.6", default-features = false, features = ["deflate"] } # plugin load
zip = { version = "4.6", default-features = false, features = ["deflate"] } # archive extraction
flate2 = "1.0"
tar = "0.4"
bzip2 = "0.5"
Expand Down
2 changes: 1 addition & 1 deletion MiniApp/Skills/miniapp-dev/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ MiniApp 框架**只暴露下列能力**,没有任何"通用 BitFun 后端通
- GitService(结构化 status / diff / blame,区别于裸 `git` 命令)
- TerminalService(创建/读写交互式终端)
- Session / AgenticSystem 的**通用**会话管理(任意会话的创建、接管、读写)——小应用只能通过 `app.agent.*` 启动**自己的**隐藏会话并消费其事件,再通过 `app.chat.*` 借用悬浮会话气泡做输入与过程展示;不能访问其他会话
- LSP / Snapshot / Mermaid / Skills / Browser API / Computer Use / Config 等
- Snapshot / Mermaid / Skills / Browser API / Computer Use / Config 等

需要这类能力时的合规姿势:

Expand Down
2 changes: 1 addition & 1 deletion MiniApp/Skills/miniapp-dev/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ MiniApp **能且只能**用以下 API,没有任何"通用 BitFun 后端通道"
- `app.call('xxx', ...)` + `worker.js` —— 自定义 Node 后端(仅 `node.enabled = true` 时)
- `app.appearanceMode / locale / on*` —— 主题与 i18n

**框架不暴露**的 BitFun 后端能力(截至当前版本):WorkspaceService(结构化搜索 / 索引)、GitService(结构化 status/diff/blame)、TerminalService、Session/AgenticSystem、LSP / Snapshot / Mermaid / Skills / Browser / Computer Use / Config 等。需要这些能力时:
**框架不暴露**的 BitFun 后端能力(截至当前版本):WorkspaceService(结构化搜索 / 索引)、GitService(结构化 status/diff/blame)、TerminalService、Session/AgenticSystem、Snapshot / Mermaid / Skills / Browser / Computer Use / Config 等。需要这些能力时:

1. 能用裸命令行解决就用 `app.shell.exec`(如 git → 在 `permissions.shell.allow` 加 `"git"`,参考 `builtin-coding-selfie`);
2. 只是要读 BitFun 工作区里的文件就用 `app.fs.*`(把 `{workspace}` 加到 `permissions.fs.read`);
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ Stars, Issues, and PRs are welcome. We especially care about:

1. Code Agent, Deep Review, debugging, and long-task execution capabilities
2. Cowork, research, document, and desktop workflows
3. MCP, Skills, Mini App, LSP plugins, and new domain Agents
3. MCP, Skills, Mini App, and new domain Agents
4. Runtime stability, performance, context efficiency, and verifiability

Please submit PRs directly to the `main` branch. For more details, see [CONTRIBUTING.md](./CONTRIBUTING.md).
Expand Down
2 changes: 1 addition & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ BitFun 的扩展路径从轻到重连续展开:

1. Code Agent、Deep Review、调试和长任务执行能力
2. Cowork、调研、文档和桌面工作流
3. MCP、Skills、Mini App、LSP 插件和新领域 Agent
3. MCP、Skills、Mini App 和新领域 Agent
4. Runtime 稳定性、性能、上下文效率和可验证性

请将 PR 直接提交至 `main` 分支。更多说明见 [CONTRIBUTING_CN.md](./CONTRIBUTING_CN.md)。
Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[中文版](./SECURITY_CN.md)

BitFun is a desktop-grade Agent runtime (Rust core + Tauri shell) that runs on your own machine with broad capabilities—filesystem, terminal, Git, MCP/LSP, and remote control. Because of this reach, we take security reports seriously and appreciate the community's help in keeping users safe.
BitFun is a desktop-grade Agent runtime (Rust core + Tauri shell) that runs on your own machine with broad capabilities—filesystem, terminal, Git, MCP, and remote control. Because of this reach, we take security reports seriously and appreciate the community's help in keeping users safe.

## Supported Versions

Expand Down
2 changes: 1 addition & 1 deletion SECURITY_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[English](./SECURITY.md)

BitFun 是一个运行在你本机的桌面级 Agent 运行时(Rust 内核 + Tauri 外壳),具备文件系统、终端、Git、MCP/LSP 以及远程控制等广泛能力。正因为权限范围较大,我们非常重视安全问题,并感谢社区帮助我们保护用户安全。
BitFun 是一个运行在你本机的桌面级 Agent 运行时(Rust 内核 + Tauri 外壳),具备文件系统、终端、Git、MCP 以及远程控制等广泛能力。正因为权限范围较大,我们非常重视安全问题,并感谢社区帮助我们保护用户安全。

## 受支持的版本

Expand Down
15 changes: 11 additions & 4 deletions docs/architecture/extensions/external-ai-work-sources-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,15 @@ provider 失败事实,避免在空目录界面中伪装成“成功但没有

| 等级 | 示例 | 默认行为 |
|---|---|---|
| L0 仅清单 | 尚未支持的字段、静态插件/工具名称、来源元数据 | 自动发现和展示,绝不宣称已经应用或可执行。 |
| L0 仅清单 | 尚未支持的字段、静态插件/工具名称、来源元数据、外部生态的 LSP 声明 | 自动发现和展示,绝不宣称已经应用或可执行。 |
| L1 被动声明 | 本地 Rules、Instructions、纯声明配置、Skill 的说明和索引 | 校验后默认自动应用;显示一次可撤销摘要。不得启动进程、读取凭据或主动联网。 |
| L2 受归属模块保护的外部能力 | 可执行 Skill/Command、远程 Reference、MCP、LSP、Formatter、Provider 连接 | 发现后进入“需确认”;由真实归属模块展示命令、网络、凭据和使用范围后启用。 |
| L2 受归属模块保护的外部能力 | 可执行 Skill/Command、远程 Reference、MCP、Formatter、Provider 连接 | 发现后进入“需确认”;由真实归属模块展示命令、网络、凭据和使用范围后启用。 |
| L3 任意第三方代码 | JS/TS Tool、服务插件、动态 Hook/TUI 入口、动态 import | 默认发现但不 import;只有能在执行前完整枚举命令与依赖、并由既有归属模块承担执行的窄切片可经独立设计和精确审阅启用。不能承诺动态 import 前已知全部贡献。 |

LSP 是明确的退役边界,不参与 L2 升级:Claude Code、OpenCode 或其他来源中的 LSP 字段只能作为 L0 来源事实或
`unsupported` 诊断保留。BitFun LSP Runtime 已退役,adapter 不得导入、应用或执行这些声明,不得为其创建产品 DTO、
启动进程,也不得在 Remote 不支持时回退到控制端本机。

OpenCode Subagent 属于 L2:adapter 只读取声明,不执行外部代码;激活仍需确认实际模型、工具、执行域和来源关系。
仅 description 等 catalog 文案变化不会扩大运行权限,因此不重复询问;prompt 行为、来源、模型或工具变化必须重新确认。
当前实现中,生态 adapter 只提交类型明确的 `Default`、`Inherit` 或不透明 `Reference`,不能把 `provider/model`
Expand Down Expand Up @@ -307,7 +311,8 @@ Desktop、交互式 TUI 以及未来通过 Host 能力访问该状态的界面

本切片明确不实现:内置厂商/型号别名表、按名称推断能力、模型质量评分、成本优化、自动跨 provider fallback、在线模型目录、
模型下载或安装、请求级配置覆盖、通用 options map、temperature/top_p/thinking budget/reasoning summary/verbosity、
Plugin Host Runtime、LSP,以及通用动态模型路由器。现有 capability 标签只用于验证模型是否具备调用所需的已声明功能,
Plugin Host Runtime、已退役的 LSP Runtime,以及通用动态模型路由器。外部 LSP 声明只形成 L0/`unsupported`
事实,永不导入、应用或执行。现有 capability 标签只用于验证模型是否具备调用所需的已声明功能,
不能据此宣称两个模型在质量、成本、隐私或上下文行为上等价。

完成判定使用表驱动契约覆盖 Claude、GPT、GLM、DeepSeek 风格以及未知未来名称,证明生产解析不依赖任何厂商列表;同时
Expand Down Expand Up @@ -392,11 +397,13 @@ Plugin Host Runtime、LSP,以及通用动态模型路由器。现有 capabilit
- 同一 provider 先完成原生覆盖,再把一个 effective candidate 交给产品管理模块;跨 provider 或 BitFun-native 同名才生成
用户冲突。选择绑定参与者与行为版本,仅展示变化不重问,候选删除或不可用不静默回退。

该矩阵不是“除 Runtime 外全部兼容”的声明。Rules/Instructions、References、模型/Provider 配置、LSP、Formatter、
该矩阵不是“除 Runtime 外全部兼容”的声明。Rules/Instructions、References、模型/Provider 配置、Formatter、
Theme、Keybind、完整插件清单,以及各生态新增的 managed/session/plugin 配置层仍需按具名消费场景逐项评估;其中能够
安全静态解析的部分也尚未全部实现。后续不得为了填满矩阵建立通用配置 DTO 或第二套归属模块,应继续以端到端收益和
真实消费方为前提扩展现有能力契约。

LSP 不属于上述待评估能力:上游声明可以被发现并解释为不支持,但不得进入应用层、运行层或未来阶段计划。

声明式 adapter 共同遵守以下边界:

- 仅扫描已知 root;配置文件、角色文件和符号链接在读取前 canonicalize,越出声明来源 root、循环或非普通文件即拒绝。
Expand Down
Loading
Loading