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
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
11 changes: 11 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
* text=auto eol=lf

*.gif binary
*.ico binary
*.jpeg binary
*.jpg binary
*.pdf binary
*.png binary
*.pptx binary
*.woff binary
*.woff2 binary
4 changes: 4 additions & 0 deletions .githooks/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
set -eu

pnpm exec commitlint --edit "$1"
7 changes: 7 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh
set -eu

pnpm branch:check
pnpm format:check
pnpm lint
pnpm architecture-check
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: 缺陷反馈
description: 报告 Mango 中的错误流程、崩溃或异常行为。
title: '[缺陷]: '
labels:
- bug
body:
- type: textarea
id: summary
attributes:
label: 发生了什么?
description: 请描述实际发生的问题,以及你原本预期会发生什么。
validations:
required: true
- type: input
id: version
attributes:
label: Mango 版本
placeholder: 0.1.0-beta.1
- type: dropdown
id: platform
attributes:
label: 平台
options:
- Windows
- macOS
- Linux
- type: textarea
id: repro
attributes:
label: 复现步骤
- type: textarea
id: logs
attributes:
label: 相关日志或截图
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: 功能建议
description: 为 Mango 提出新能力或工作流改进建议。
title: '[功能建议]: '
labels:
- enhancement
body:
- type: textarea
id: problem
attributes:
label: 当前卡住了什么工作流?
description: 请描述你正在做的事情,以及当前最明显的阻碍。
validations:
required: true
- type: textarea
id: proposal
attributes:
label: 你希望 Mango 做什么?
- type: textarea
id: success
attributes:
label: 你认为什么结果算成功?
35 changes: 35 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
## 背景

<!-- 这次改动为什么要做?对应哪份产品/工程/质量文档? -->

## 本次改动

<!-- 用 3-7 条列出这次 PR 真正做了什么。 -->

## 不包含

<!-- 明确写出这次没有做什么,避免评审时误解范围。 -->

## 契约 / 数据 / 权限影响

<!-- 是否影响 @mango/contracts、OpenAPI、IPC DTO、SQLite migration、系统权限、环境变量?没有请写“无”。 -->

## 验证

<!-- 贴出你实际跑过的命令与结果摘要。 -->

## 风险与回滚

<!-- 如果发布后有问题,如何回退?如果无法自动回滚,请写清原因。 -->

## 文档同步

<!-- 说明本次同步更新了哪些文档;如果没有,请说明为什么不需要。 -->

## 自检清单

- [ ] 标题符合 Conventional Commits
- [ ] 已更新必要文档
- [ ] 已说明契约 / 数据 / 权限影响
- [ ] 已补齐验证方式
- [ ] 已说明风险与回滚方式
61 changes: 61 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: CI

on:
push:
branches:
- main
- 'codex/**'
pull_request:

jobs:
verify:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.6.5

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm

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

- name: Run format check
run: pnpm format:check

- name: Run lint
run: pnpm lint

- name: Run architecture check
run: pnpm architecture-check

- name: Run tests
run: pnpm test

- name: Run contract checks
run: pnpm check:contracts

- name: Run typecheck
run: pnpm typecheck

- name: Run build
run: pnpm build

- name: Run desktop smoke
run: pnpm smoke:desktop
25 changes: 25 additions & 0 deletions .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: PR Title

on:
pull_request:
types:
- opened
- edited
- reopened
- synchronize

jobs:
validate-title:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22

- name: Validate PR title
run: node tooling/scripts/check-pr-title.mjs "${{ github.event.pull_request.title }}"
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,37 @@

# dependencies
/node_modules
**/node_modules
/.pnp
.pnp.js
.pnpm-store

# testing
/coverage
/test-results
/playwright-report

# next.js
/.next/
/out/

# production
/build
/apps/desktop/dist
/apps/desktop/out
/apps/*/dist
/apps/*/out
/packages/*/dist
/packages/*/src/**/*.js
/packages/*/src/**/*.d.ts

# misc
.DS_Store
*.pem
.worktrees/
/.turbo
**/.turbo
.eslintcache

# debug
npm-debug.log*
Expand Down
7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules
.turbo
coverage
dist
out
playwright-report
test-results
11 changes: 11 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"arrowParens": "always",
"bracketSpacing": true,
"endOfLine": "lf",
"printWidth": 100,
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"useTabs": false,
"trailingComma": "none"
}
49 changes: 49 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# 更新日志

本项目的所有重要变更都会记录在此文件中。

格式遵循 [Keep a Changelog 1.1.0](https://keepachangelog.com/zh-CN/1.1.0/),并尽量遵循 [语义化版本](https://semver.org/lang/zh-CN/)。

## [Unreleased]

### Added

- 预留后续迭代的未发布变更记录区。

### Fixed

- 新增 `.gitattributes` 统一文本文件为 `LF`,修复 Windows CI 中 `Prettier --check` 因 `CRLF` 检出导致的格式校验失败。

## [0.1.0] - 2026-03-25

### Added

- 建立 `pnpm + Turborepo` 的 Mango Monorepo 工程底座,拆分 `apps/*`、`packages/*`、`tooling/*`、`tests/*`、`infra/*` 与 `docs/*`。
- 建立 Mango v1 中文文档体系,覆盖产品定义、信息架构、技术架构、工程规范、测试策略、发布流程与协作流程。
- 建立桌面端 `Electron + React + TypeScript` 应用骨架,落地 `Plan -> Approve -> Go -> Review` 主工作台界面。
- 建立 `@mango/core`、`@mango/contracts`、`@mango/adapters`、`@mango/ui` 与 `@mango/config-*` 共享包。
- 建立 `TaskSession`、`ExecutionEvent`、`WorkspaceContext`、`PermissionPolicy` 等领域模型与基础测试。
- 建立 OpenAPI 单一事实源文件,作为未来 REST 契约与类型生成的基线。
- 建立 SQLite migration 基线、迁移目录与桌面端持久化测试。
- 新增 `Claude Code CLI` 适配器入口,支持 CLI 可用性检测、结构化计划生成与批准后执行摘要收口。
- 新增桌面端适配器选择控件,允许用户看到当前执行适配器及其可用性说明。
- 新增针对真实 CLI 适配器、桌面主进程编排、SQLite 存储与渲染工作台的测试覆盖。

### Changed

- 桌面端本地持久化从早期 JSON 主存储升级为 `SQLite 主存储 + JSON 首次导入兜底`。
- 桌面端 SQLite 运行时从实验性的 `node:sqlite` 切换为 `better-sqlite3`,消除实验性警告并稳定 native 依赖构建。
- 桌面端主进程从写死的单一 mock adapter 改为可扩展的多 adapter 注册与选择机制。
- Workspace 现在会持久化 `primaryAdapterId` 和 `configuredAdapters`,为后续任务恢复和多 provider 扩展打基础。
- Renderer 不再盲选第一个 adapter,而是优先选择工作区上次使用且当前可用的 adapter。

### Fixed

- 修复适配器执行失败时任务状态可能错误落为成功的问题,失败场景现在会被收口为 `failed` 并保留错误事件。
- 修复桌面端类型检查未稳定指向 workspace 源码路径的问题,统一通过根级 `tsconfig.base.json` 路径别名约束桌面包类型检查。
- 修复 SQLite 持久化层对 native SQLite 运行时的依赖不稳定问题,补齐 `pnpm onlyBuiltDependencies` 和类型声明。
- 修复工作台对适配器状态可见性不足的问题,补充执行 adapter 选择与状态展示。

### Security

- 保持高风险能力按 `PermissionPolicy` 显式评估与展示,为后续权限批准、失败恢复和审计记录预留统一边界。
Loading
Loading