meris-agent 0.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- meris_agent-0.0.1/.env.example +16 -0
- meris_agent-0.0.1/.github/workflows/test.yml +45 -0
- meris_agent-0.0.1/.gitignore +54 -0
- meris_agent-0.0.1/.meris/rules/paths.md +6 -0
- meris_agent-0.0.1/.meris/rules/workspace.md +8 -0
- meris_agent-0.0.1/.meris/settings.json +38 -0
- meris_agent-0.0.1/.meris/skills/plan-format.md +22 -0
- meris_agent-0.0.1/AGENTS.md +60 -0
- meris_agent-0.0.1/BRAND.md +38 -0
- meris_agent-0.0.1/LICENSE +21 -0
- meris_agent-0.0.1/PKG-INFO +297 -0
- meris_agent-0.0.1/PROGRESS.md +58 -0
- meris_agent-0.0.1/README.md +262 -0
- meris_agent-0.0.1/ROADMAP.md +65 -0
- meris_agent-0.0.1/docs/DOGFOOD_7DAY.md +115 -0
- meris_agent-0.0.1/docs/LOCAL_SETUP.md +157 -0
- meris_agent-0.0.1/docs/RUST_ROADMAP.md +102 -0
- meris_agent-0.0.1/docs/examples/ainote-vault/.meris/settings.json +53 -0
- meris_agent-0.0.1/docs/examples/ainote-vault/.meris/skills/obsidian-vault.md +25 -0
- meris_agent-0.0.1/docs/examples/ainote-vault/AGENTS.md +19 -0
- meris_agent-0.0.1/docs/examples/ainote-vault/PROGRESS.md +18 -0
- meris_agent-0.0.1/docs/examples/ainote-vault/README.md +32 -0
- meris_agent-0.0.1/extensions/vscode-meris/README.md +48 -0
- meris_agent-0.0.1/extensions/vscode-meris/extension.js +55 -0
- meris_agent-0.0.1/extensions/vscode-meris/package.json +51 -0
- meris_agent-0.0.1/meris/__init__.py +3 -0
- meris_agent-0.0.1/meris/benchmark.py +121 -0
- meris_agent-0.0.1/meris/cli.py +570 -0
- meris_agent-0.0.1/meris/config.py +15 -0
- meris_agent-0.0.1/meris/env.py +16 -0
- meris_agent-0.0.1/meris/harness/__init__.py +3 -0
- meris_agent-0.0.1/meris/harness/context.py +165 -0
- meris_agent-0.0.1/meris/harness/doctor.py +128 -0
- meris_agent-0.0.1/meris/harness/event_hooks.py +65 -0
- meris_agent-0.0.1/meris/harness/guardrails.py +38 -0
- meris_agent-0.0.1/meris/harness/guides.py +55 -0
- meris_agent-0.0.1/meris/harness/hooks.py +42 -0
- meris_agent-0.0.1/meris/harness/hooks_loader.py +103 -0
- meris_agent-0.0.1/meris/harness/memory.py +30 -0
- meris_agent-0.0.1/meris/harness/paths.py +12 -0
- meris_agent-0.0.1/meris/harness/permissions.py +75 -0
- meris_agent-0.0.1/meris/harness/plan.py +44 -0
- meris_agent-0.0.1/meris/harness/sensors.py +63 -0
- meris_agent-0.0.1/meris/harness/sessions.py +110 -0
- meris_agent-0.0.1/meris/harness/settings.py +59 -0
- meris_agent-0.0.1/meris/harness/skills.py +28 -0
- meris_agent-0.0.1/meris/harness/spec.py +164 -0
- meris_agent-0.0.1/meris/loop.py +318 -0
- meris_agent-0.0.1/meris/native.py +149 -0
- meris_agent-0.0.1/meris/parallel.py +105 -0
- meris_agent-0.0.1/meris/provider/__init__.py +12 -0
- meris_agent-0.0.1/meris/provider/anthropic.py +140 -0
- meris_agent-0.0.1/meris/provider/base.py +20 -0
- meris_agent-0.0.1/meris/provider/factory.py +30 -0
- meris_agent-0.0.1/meris/provider/openai_compat.py +72 -0
- meris_agent-0.0.1/meris/state.py +35 -0
- meris_agent-0.0.1/meris/tools/__init__.py +24 -0
- meris_agent-0.0.1/meris/tools/builtin.py +410 -0
- meris_agent-0.0.1/meris/tools/mcp.py +287 -0
- meris_agent-0.0.1/meris/tools/registry.py +50 -0
- meris_agent-0.0.1/meris/tools/worktree.py +54 -0
- meris_agent-0.0.1/meris/tui/__init__.py +3 -0
- meris_agent-0.0.1/meris/tui/app.py +236 -0
- meris_agent-0.0.1/meris-rs/Cargo.lock +611 -0
- meris_agent-0.0.1/meris-rs/Cargo.toml +23 -0
- meris_agent-0.0.1/meris-rs/README.md +44 -0
- meris_agent-0.0.1/meris-rs/src/context.rs +261 -0
- meris_agent-0.0.1/meris-rs/src/lib.rs +9 -0
- meris_agent-0.0.1/meris-rs/src/main.rs +171 -0
- meris_agent-0.0.1/meris-rs/src/permissions.rs +117 -0
- meris_agent-0.0.1/meris-rs/src/settings.rs +15 -0
- meris_agent-0.0.1/pyproject.toml +47 -0
- meris_agent-0.0.1/scripts/benchmark/tasks.json +25 -0
- meris_agent-0.0.1/scripts/dogfood-tasks.txt +11 -0
- meris_agent-0.0.1/scripts/setup-local.ps1 +58 -0
- meris_agent-0.0.1/templates/AGENTS.md +35 -0
- meris_agent-0.0.1/templates/PROGRESS.md +13 -0
- meris_agent-0.0.1/templates/settings.json +40 -0
- meris_agent-0.0.1/templates/skills/harness.md +14 -0
- meris_agent-0.0.1/templates/spec/design.md +17 -0
- meris_agent-0.0.1/templates/spec/requirements.md +14 -0
- meris_agent-0.0.1/templates/spec/tasks.md +12 -0
- meris_agent-0.0.1/tests/conftest.py +56 -0
- meris_agent-0.0.1/tests/test_cli.py +42 -0
- meris_agent-0.0.1/tests/test_meris.py +331 -0
- meris_agent-0.0.1/tests/test_phase_a.py +86 -0
- meris_agent-0.0.1/tests/test_phase_b.py +111 -0
- meris_agent-0.0.1/tests/test_phase_c.py +83 -0
- meris_agent-0.0.1/tests/test_phase_d.py +63 -0
- meris_agent-0.0.1/tests/test_session_resume.py +91 -0
- meris_agent-0.0.1/tests/test_tui_submit.py +26 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# DeepSeek(OpenAI 兼容)
|
|
2
|
+
# 复制为 .env 并填入真实 key:https://platform.deepseek.com/
|
|
3
|
+
DEEPSEEK_API_KEY=
|
|
4
|
+
MERIS_BASE_URL=https://api.deepseek.com/v1
|
|
5
|
+
MERIS_MODEL=deepseek-chat
|
|
6
|
+
|
|
7
|
+
# 或使用通用变量名
|
|
8
|
+
# LLM_API_KEY=
|
|
9
|
+
# OPENAI_API_KEY=
|
|
10
|
+
|
|
11
|
+
# 可选:Anthropic 原生
|
|
12
|
+
# MERIS_PROVIDER=anthropic
|
|
13
|
+
# ANTHROPIC_API_KEY=
|
|
14
|
+
|
|
15
|
+
# 可选:使用 meris-rs 做 context 压缩(需 meris native build)
|
|
16
|
+
# MERIS_NATIVE=1
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
name: test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, master]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
test:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
strategy:
|
|
12
|
+
matrix:
|
|
13
|
+
python-version: ["3.11", "3.12"]
|
|
14
|
+
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
|
|
18
|
+
- name: Set up Python
|
|
19
|
+
uses: actions/setup-python@v5
|
|
20
|
+
with:
|
|
21
|
+
python-version: ${{ matrix.python-version }}
|
|
22
|
+
|
|
23
|
+
- name: Install
|
|
24
|
+
run: pip install -e ".[dev]"
|
|
25
|
+
|
|
26
|
+
- name: Unit tests
|
|
27
|
+
run: pytest tests/ -v -m "not integration"
|
|
28
|
+
|
|
29
|
+
- name: Ruff check
|
|
30
|
+
run: ruff check meris tests
|
|
31
|
+
|
|
32
|
+
rust:
|
|
33
|
+
runs-on: ubuntu-latest
|
|
34
|
+
steps:
|
|
35
|
+
- uses: actions/checkout@v4
|
|
36
|
+
|
|
37
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
38
|
+
|
|
39
|
+
- name: Cargo test
|
|
40
|
+
working-directory: meris-rs
|
|
41
|
+
run: cargo test
|
|
42
|
+
|
|
43
|
+
- name: Cargo build release
|
|
44
|
+
working-directory: meris-rs
|
|
45
|
+
run: cargo build --release
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# --- Secrets & local env ---
|
|
2
|
+
.env
|
|
3
|
+
.env.*
|
|
4
|
+
!.env.example
|
|
5
|
+
|
|
6
|
+
# --- Python ---
|
|
7
|
+
__pycache__/
|
|
8
|
+
*.py[cod]
|
|
9
|
+
*$py.class
|
|
10
|
+
*.so
|
|
11
|
+
.Python
|
|
12
|
+
.venv/
|
|
13
|
+
venv/
|
|
14
|
+
ENV/
|
|
15
|
+
dist/
|
|
16
|
+
build/
|
|
17
|
+
*.egg-info/
|
|
18
|
+
.eggs/
|
|
19
|
+
pip-wheel-metadata/
|
|
20
|
+
|
|
21
|
+
# --- Test / lint caches ---
|
|
22
|
+
.pytest_cache/
|
|
23
|
+
.ruff_cache/
|
|
24
|
+
.mypy_cache/
|
|
25
|
+
htmlcov/
|
|
26
|
+
.coverage
|
|
27
|
+
.coverage.*
|
|
28
|
+
coverage.xml
|
|
29
|
+
|
|
30
|
+
# --- Rust ---
|
|
31
|
+
meris-rs/target/
|
|
32
|
+
|
|
33
|
+
# --- IDE / editor (local) ---
|
|
34
|
+
.idea/
|
|
35
|
+
.vscode/
|
|
36
|
+
*.swp
|
|
37
|
+
*.swo
|
|
38
|
+
*~
|
|
39
|
+
|
|
40
|
+
# --- OS ---
|
|
41
|
+
.DS_Store
|
|
42
|
+
Thumbs.db
|
|
43
|
+
Desktop.ini
|
|
44
|
+
|
|
45
|
+
# --- Meris harness runtime (do not commit) ---
|
|
46
|
+
.meris/sessions/
|
|
47
|
+
.meris/plan/
|
|
48
|
+
.meris/worktrees/
|
|
49
|
+
.meris/spec/
|
|
50
|
+
|
|
51
|
+
# Commit harness *templates* for this repo: .meris/settings.json, rules/, skills/
|
|
52
|
+
|
|
53
|
+
# --- Cursor local (not the vscode-meris extension source) ---
|
|
54
|
+
.cursor/
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# 路径规范(Meris 仓库 cwd)
|
|
2
|
+
|
|
3
|
+
- Python **包**在 `meris/` 目录:`meris/cli.py`、`meris/harness/`、`meris/tools/`
|
|
4
|
+
- 本仓库 **根目录**文档:`README.md`、`PROGRESS.md`、`AGENTS.md`(不要写成 `meris/README.md`)
|
|
5
|
+
- import 一律 `from meris.xxx import ...`
|
|
6
|
+
- 仅在 **vault 根** cwd、且 Meris 是子目录时,才用 `meris/README.md` 这类带前缀路径
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# 工作区 cwd
|
|
2
|
+
|
|
3
|
+
| 任务 | cwd |
|
|
4
|
+
|------|-----|
|
|
5
|
+
| 改 Meris 代码、README、跑 pytest | Meris **git 仓库根**(clone 后的目录,含 `pyproject.toml`) |
|
|
6
|
+
| 改 Obsidian 笔记 `Articles/` | **vault 根**(Meris 的父目录或独立笔记库) |
|
|
7
|
+
|
|
8
|
+
Meris 仓库作为 vault 子目录时:在 vault 根跑 `meris run` 改 README 会变成 `meris/README.md` 且可能被 block。**改 Meris 请先 `cd` 到 Meris 仓库根。**
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Read",
|
|
5
|
+
"Edit",
|
|
6
|
+
"Write",
|
|
7
|
+
"Glob",
|
|
8
|
+
"Grep",
|
|
9
|
+
"Git",
|
|
10
|
+
"Bash(pytest*)",
|
|
11
|
+
"Bash(python*)",
|
|
12
|
+
"Bash(git status*)",
|
|
13
|
+
"Bash(git diff*)",
|
|
14
|
+
"Bash(git add*)",
|
|
15
|
+
"MCP"
|
|
16
|
+
],
|
|
17
|
+
"deny": [
|
|
18
|
+
"Bash(rm -rf*)",
|
|
19
|
+
"Bash(git push*)",
|
|
20
|
+
"Bash(curl*)"
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
"sensors": {
|
|
24
|
+
"postEdit": ["pytest tests/ -m \"not integration\" -q --tb=no"],
|
|
25
|
+
"onComplete": true
|
|
26
|
+
},
|
|
27
|
+
"context": {
|
|
28
|
+
"maxMessages": 48,
|
|
29
|
+
"maxTokens": 32000,
|
|
30
|
+
"maxToolTokens": 2000
|
|
31
|
+
},
|
|
32
|
+
"blockedPaths": ["**/generated/**", "**/node_modules/**"],
|
|
33
|
+
"hooks": {
|
|
34
|
+
"preToolUse": [],
|
|
35
|
+
"postToolUse": []
|
|
36
|
+
},
|
|
37
|
+
"mcpServers": {}
|
|
38
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Skill: Plan 输出格式
|
|
2
|
+
|
|
3
|
+
## 何时使用
|
|
4
|
+
|
|
5
|
+
`meris plan`、benchmark plan 任务、用户要求「列计划 / checkbox 任务」时。
|
|
6
|
+
|
|
7
|
+
## 必须格式
|
|
8
|
+
|
|
9
|
+
```markdown
|
|
10
|
+
- [ ] 第一条任务
|
|
11
|
+
- [ ] 第二条任务
|
|
12
|
+
- [ ] 第三条任务
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
- 中括号内**必须有空格**:`- [ ]`(不是 `- []`)
|
|
16
|
+
- 至少 3 条(除非用户指定 N 条)
|
|
17
|
+
- 禁止只用 `1.` `2.` 数字列表
|
|
18
|
+
|
|
19
|
+
## 路径
|
|
20
|
+
|
|
21
|
+
- 源码:`meris/cli.py`、`meris/harness/...`
|
|
22
|
+
- 本仓库 README:`README.md`(不是 `meris/README.md`)
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# AGENTS.md — Meris Harness (Instructions subsystem)
|
|
2
|
+
# Inspired by: OpenAI Codex AGENTS.md + Claude Code CLAUDE.md
|
|
3
|
+
|
|
4
|
+
## 项目说明
|
|
5
|
+
|
|
6
|
+
- 包管理器:pip(`pyproject.toml` + hatchling)
|
|
7
|
+
- 测试命令:`pytest tests/ -m "not integration"`
|
|
8
|
+
|
|
9
|
+
## 仓库布局
|
|
10
|
+
|
|
11
|
+
| 路径 | 说明 |
|
|
12
|
+
|------|------|
|
|
13
|
+
| `README.md` | 仓库根目录说明(**cwd 在本仓库时路径为 `README.md`,不是 `meris/README.md`**) |
|
|
14
|
+
| `meris/cli.py` | CLI 入口 |
|
|
15
|
+
| `meris/loop.py` | Agent 主循环 |
|
|
16
|
+
| `meris/harness/` | Harness 子系统 |
|
|
17
|
+
| `meris/tools/` | 工具注册 |
|
|
18
|
+
| `meris/provider/` | LLM Provider |
|
|
19
|
+
|
|
20
|
+
计划与代码中的路径、import 一律使用 `meris/` 包前缀(如 `from meris.harness.sessions import ...`)。
|
|
21
|
+
|
|
22
|
+
## Plan 模式(`meris plan`)
|
|
23
|
+
|
|
24
|
+
输出 **Markdown 任务清单**,格式必须严格遵守:
|
|
25
|
+
|
|
26
|
+
- 每条任务一行,使用 **未完成 checkbox**:`- [ ] 描述`(中括号内必须有空格)
|
|
27
|
+
- 至少 3 条 `- [ ]` 任务(用户要求 N 条时按 N 条)
|
|
28
|
+
- 不要用纯数字列表 `1.` 代替 checkbox
|
|
29
|
+
- 文件路径用 `meris/...`(如 `meris/cli.py`),README 在本仓库 cwd 下为 `README.md`
|
|
30
|
+
- 只输出计划,不改代码
|
|
31
|
+
|
|
32
|
+
示例:
|
|
33
|
+
|
|
34
|
+
```markdown
|
|
35
|
+
- [ ] 在 meris/harness/sessions.py 添加 prune 函数
|
|
36
|
+
- [ ] 在 meris/cli.py 添加 session prune 子命令
|
|
37
|
+
- [ ] 更新 PROGRESS.md 并跑 pytest
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## 代码风格
|
|
41
|
+
- Python 3.11+,ruff line-length 100
|
|
42
|
+
- 最小 diff,匹配现有命名与结构
|
|
43
|
+
|
|
44
|
+
## 禁止操作
|
|
45
|
+
- 不要修改 `**/generated/**` 下的文件
|
|
46
|
+
- 不要自动 `git push`
|
|
47
|
+
- 不要删除 `migrations/` 下已有 migration
|
|
48
|
+
|
|
49
|
+
## 会话约定
|
|
50
|
+
- 新会话第一件事:读 `PROGRESS.md`
|
|
51
|
+
- 任务完成或断点变化:更新 `PROGRESS.md`
|
|
52
|
+
- Plan 任务可 `load_skill plan-format`;路径/ cwd 见 `.meris/rules/`
|
|
53
|
+
|
|
54
|
+
## 完成定义 (Definition of Done)
|
|
55
|
+
|
|
56
|
+
任务完成 = 以下命令全部退出码为 0:
|
|
57
|
+
|
|
58
|
+
- `pytest tests/ -m "not integration" -q`
|
|
59
|
+
|
|
60
|
+
任何一项失败,任务不算完成。
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Meris Agent — 品牌说明
|
|
2
|
+
|
|
3
|
+
> 正式品牌名:**Meris** · 公开版本 **0.0.1**(首个开源 tag)
|
|
4
|
+
|
|
5
|
+
## 标识
|
|
6
|
+
|
|
7
|
+
| 项 | 值 |
|
|
8
|
+
|---|---|
|
|
9
|
+
| **品牌** | **Meris** |
|
|
10
|
+
| **CLI** | `meris` |
|
|
11
|
+
| **Python 包** | `meris-agent` |
|
|
12
|
+
| **Rust 核心** | `meris-rs` |
|
|
13
|
+
| **Harness 目录** | `.meris/` |
|
|
14
|
+
| **环境变量** | `MERIS_*` |
|
|
15
|
+
|
|
16
|
+
## 定位语
|
|
17
|
+
|
|
18
|
+
> Harness-first · Model-agnostic · Yours to shape
|
|
19
|
+
|
|
20
|
+
## 历史
|
|
21
|
+
|
|
22
|
+
| 日期 | 变更 |
|
|
23
|
+
|------|------|
|
|
24
|
+
| 2026-05 | 正式品牌 **Meris** · 开源发布 **v0.0.1** |
|
|
25
|
+
| 2026-05 | Haltr / forCode 等候选未采用 |
|
|
26
|
+
|
|
27
|
+
## 新仓库
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
meris init-harness /path/to/repo
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Hook 环境变量:`MERIS_TOOL_NAME`、`MERIS_HOOK_PHASE` 等。
|
|
34
|
+
|
|
35
|
+
## 相关文档
|
|
36
|
+
|
|
37
|
+
- [docs/LOCAL_SETUP.md](docs/LOCAL_SETUP.md) — 本机扩展与 Rust 配置
|
|
38
|
+
- [docs/RUST_ROADMAP.md](docs/RUST_ROADMAP.md) — Rust 移植路线
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Meris contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: meris-agent
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Model-agnostic coding agent with first-class Harness engineering
|
|
5
|
+
Project-URL: Homepage, https://github.com/meris-agent/meris
|
|
6
|
+
Project-URL: Repository, https://github.com/meris-agent/meris
|
|
7
|
+
Project-URL: Issues, https://github.com/meris-agent/meris/issues
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Python: >=3.11
|
|
11
|
+
Requires-Dist: httpx>=0.27.0
|
|
12
|
+
Requires-Dist: openai>=1.40.0
|
|
13
|
+
Requires-Dist: pydantic>=2.7.0
|
|
14
|
+
Requires-Dist: python-dotenv>=1.0.0
|
|
15
|
+
Requires-Dist: rich>=13.7.0
|
|
16
|
+
Requires-Dist: typer>=0.12.0
|
|
17
|
+
Provides-Extra: anthropic
|
|
18
|
+
Requires-Dist: anthropic>=0.40.0; extra == 'anthropic'
|
|
19
|
+
Provides-Extra: dev
|
|
20
|
+
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
|
|
21
|
+
Requires-Dist: pytest>=8.0.0; extra == 'dev'
|
|
22
|
+
Requires-Dist: ruff>=0.4.0; extra == 'dev'
|
|
23
|
+
Provides-Extra: full
|
|
24
|
+
Requires-Dist: anthropic>=0.40.0; extra == 'full'
|
|
25
|
+
Requires-Dist: mcp>=1.0.0; extra == 'full'
|
|
26
|
+
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'full'
|
|
27
|
+
Requires-Dist: pytest>=8.0.0; extra == 'full'
|
|
28
|
+
Requires-Dist: ruff>=0.4.0; extra == 'full'
|
|
29
|
+
Requires-Dist: textual>=1.0.0; extra == 'full'
|
|
30
|
+
Provides-Extra: mcp
|
|
31
|
+
Requires-Dist: mcp>=1.0.0; extra == 'mcp'
|
|
32
|
+
Provides-Extra: tui
|
|
33
|
+
Requires-Dist: textual>=1.0.0; extra == 'tui'
|
|
34
|
+
Description-Content-Type: text/markdown
|
|
35
|
+
|
|
36
|
+
# Meris Agent
|
|
37
|
+
|
|
38
|
+
Model-agnostic terminal coding agent — **Harness-first**, inspired by AtomCode, Claude Code, Codex, Cursor, and Kiro.
|
|
39
|
+
|
|
40
|
+
## Philosophy
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
Agent = Model + Harness
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
- **Built lean** — minimal deps, fast startup (Python MVP → optional Rust later)
|
|
47
|
+
- **Model-agnostic** — OpenAI-compatible API or native Anthropic (`MERIS_PROVIDER=anthropic`)
|
|
48
|
+
- **Yours to shape** — approve mode, PROGRESS checkpoints, interrupt-safe
|
|
49
|
+
- **Harness-first** — AGENTS.md, permissions, hooks, DoD sensors
|
|
50
|
+
|
|
51
|
+
## Quick start
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
cd meris
|
|
55
|
+
pip install -e .
|
|
56
|
+
|
|
57
|
+
# Verify installation
|
|
58
|
+
meris version
|
|
59
|
+
|
|
60
|
+
# Set your model (OpenAI-compatible)
|
|
61
|
+
set OPENAI_API_KEY=sk-...
|
|
62
|
+
set MERIS_BASE_URL=https://api.deepseek.com/v1
|
|
63
|
+
set MERIS_MODEL=deepseek-chat
|
|
64
|
+
|
|
65
|
+
# Init harness in your project
|
|
66
|
+
meris init-harness /path/to/your/repo
|
|
67
|
+
|
|
68
|
+
# Ask (read-only)
|
|
69
|
+
meris ask "where is auth handled?"
|
|
70
|
+
|
|
71
|
+
# Plan (writes tasks, no code)
|
|
72
|
+
meris plan "add rate limiting to /api/users"
|
|
73
|
+
|
|
74
|
+
# Run agent
|
|
75
|
+
meris run "fix the failing test in tests/test_auth.py"
|
|
76
|
+
|
|
77
|
+
# Approve mode — confirm each write/edit/bash
|
|
78
|
+
meris run --approve "refactor loop.py"
|
|
79
|
+
|
|
80
|
+
# Skip DoD sensors
|
|
81
|
+
meris run --no-sensor "explore codebase structure"
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Project layout
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
meris/
|
|
88
|
+
├── meris/ # Python agent package
|
|
89
|
+
├── meris-rs/ # Rust harness core (P5 MVP)
|
|
90
|
+
├── extensions/
|
|
91
|
+
│ └── vscode-meris/ # VS Code / Cursor plugin
|
|
92
|
+
├── templates/
|
|
93
|
+
└── tests/
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Harness files (in target repo)
|
|
97
|
+
|
|
98
|
+
| File | Subsystem | From |
|
|
99
|
+
|------|-----------|------|
|
|
100
|
+
| `AGENTS.md` | Instructions | Codex / 新智元 |
|
|
101
|
+
| `.meris/settings.json` | Tools (permissions) | Claude Code |
|
|
102
|
+
| `PROGRESS.md` | State | Anthropic / 新智元 |
|
|
103
|
+
| `.meris/spec/*.md` | Spec workflow | Kiro (optional) |
|
|
104
|
+
|
|
105
|
+
## Design doc
|
|
106
|
+
|
|
107
|
+
See `Articles/MyCodingAgent-架构设计.md` in the Obsidian vault.
|
|
108
|
+
|
|
109
|
+
**Dogfood(7 天)**:见 [docs/DOGFOOD_7DAY.md](docs/DOGFOOD_7DAY.md)
|
|
110
|
+
|
|
111
|
+
## Roadmap
|
|
112
|
+
|
|
113
|
+
- [x] P1: Loop + tools + provider + harness loaders
|
|
114
|
+
- [x] P2: Context compression, post-edit sensors, guardrails, git tools, approve mode
|
|
115
|
+
- [x] P3: MCP client, Textual TUI, config-driven hooks
|
|
116
|
+
- [x] P4: Session persistence, parallel sessions, skills, subagent, MCP SSE
|
|
117
|
+
- [x] P5: Rust core MVP (`meris-rs` — context, permissions; full loop still Python)
|
|
118
|
+
|
|
119
|
+
## Phase D (v0.6.0)
|
|
120
|
+
|
|
121
|
+
**本机配置(扩展 + Rust)**:见 [docs/LOCAL_SETUP.md](docs/LOCAL_SETUP.md) · Rust 路线见 [docs/RUST_ROADMAP.md](docs/RUST_ROADMAP.md)
|
|
122
|
+
|
|
123
|
+
一键脚本(Windows):
|
|
124
|
+
|
|
125
|
+
```powershell
|
|
126
|
+
powershell -ExecutionPolicy Bypass -File scripts\setup-local.ps1
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
**Native Rust core** (`meris-rs/`):
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
meris native build # requires Rust: https://rustup.rs
|
|
133
|
+
meris native status
|
|
134
|
+
set MERIS_NATIVE=1 # optional native context compression
|
|
135
|
+
meris-rs run doctor # delegates to Python meris
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
**Brand**: see [BRAND.md](BRAND.md) — **Meris** (PyPI: `meris-agent`).
|
|
139
|
+
|
|
140
|
+
**IDE extension** (VS Code / Cursor): `extensions/vscode-meris/` — 安装见 [docs/LOCAL_SETUP.md](docs/LOCAL_SETUP.md)。
|
|
141
|
+
|
|
142
|
+
## Phase C (v0.5.0)
|
|
143
|
+
|
|
144
|
+
**Token budget** — `.meris/settings.json`:
|
|
145
|
+
|
|
146
|
+
```json
|
|
147
|
+
"context": { "maxMessages": 48, "maxTokens": 32000, "maxToolTokens": 2000 }
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
**Anthropic native**:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
pip install meris-agent[anthropic]
|
|
154
|
+
set MERIS_PROVIDER=anthropic
|
|
155
|
+
set ANTHROPIC_API_KEY=sk-ant-...
|
|
156
|
+
meris doctor
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
**Extra tools**: `fetch_url` (HTTP GET), `lint_file` (ruff check).
|
|
160
|
+
|
|
161
|
+
**MCP resources/prompts**: auto-registered as `mcp_{server}_read_resource` / `mcp_{server}_get_prompt`.
|
|
162
|
+
|
|
163
|
+
**TUI session panel**: `meris tui` — left sidebar lists sessions; Enter to resume, Ctrl+S refresh.
|
|
164
|
+
|
|
165
|
+
## Phase A
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
meris doctor # env + harness + API probe
|
|
169
|
+
meris plan "add feature" # saves .meris/plan/tasks.md
|
|
170
|
+
meris run --from-plan "go" # implement saved plan
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
See [ROADMAP.md](ROADMAP.md) for full plan.
|
|
174
|
+
|
|
175
|
+
## Spec workflow (Phase B)
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
meris spec init "rate limiting"
|
|
179
|
+
meris spec status
|
|
180
|
+
meris spec next --note "REST API only"
|
|
181
|
+
meris run --from-spec "implement checklist"
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
## Event hooks
|
|
185
|
+
|
|
186
|
+
```json
|
|
187
|
+
{
|
|
188
|
+
"hooks": {
|
|
189
|
+
"onSave": [
|
|
190
|
+
{ "matcher": "*.py", "command": "python -m ruff check $MERIS_SAVED_PATH" }
|
|
191
|
+
],
|
|
192
|
+
"onCommit": [
|
|
193
|
+
{ "command": "pytest tests/ -q" }
|
|
194
|
+
]
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
## Benchmark
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
meris benchmark list
|
|
203
|
+
meris benchmark run
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## MCP (external tools)
|
|
207
|
+
|
|
208
|
+
Configure servers in `.meris/settings.json`:
|
|
209
|
+
|
|
210
|
+
```json
|
|
211
|
+
{
|
|
212
|
+
"mcpServers": {
|
|
213
|
+
"filesystem": {
|
|
214
|
+
"command": "npx",
|
|
215
|
+
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/dir"]
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
pip install meris-agent[mcp]
|
|
223
|
+
meris mcp list
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
Tools appear as `mcp_{server}_{tool}` in the agent registry. Resources and prompts are exposed as `mcp_{server}_read_resource` and `mcp_{server}_get_prompt`.
|
|
227
|
+
|
|
228
|
+
## TUI
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
pip install meris-agent[tui]
|
|
232
|
+
meris tui --cwd . --mode run --approve
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
Interactive log + task input. Left **Sessions** panel — Enter to resume, Ctrl+R latest, Ctrl+S refresh. Ctrl+L clears log.
|
|
236
|
+
|
|
237
|
+
## Hooks (settings.json)
|
|
238
|
+
|
|
239
|
+
Shell hooks run before/after tools (Claude Code–style):
|
|
240
|
+
|
|
241
|
+
```json
|
|
242
|
+
{
|
|
243
|
+
"hooks": {
|
|
244
|
+
"preToolUse": [
|
|
245
|
+
{ "matcher": "bash", "command": "echo pre $MERIS_TOOL_NAME" }
|
|
246
|
+
],
|
|
247
|
+
"postToolUse": [
|
|
248
|
+
{ "matcher": "write_file|edit_file", "command": "echo post" }
|
|
249
|
+
]
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
Env vars: `MERIS_TOOL_NAME`, `MERIS_TOOL_ARGS`, `MERIS_TOOL_RESULT`, `MERIS_HOOK_PHASE`.
|
|
255
|
+
|
|
256
|
+
## Sessions (persist & resume)
|
|
257
|
+
|
|
258
|
+
Every run auto-saves to `.meris/sessions/{id}.json`. Resume after interrupt:
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
meris session list
|
|
262
|
+
meris session show abc123
|
|
263
|
+
meris session resume abc123
|
|
264
|
+
meris run "task" --session-id my-id # optional fixed id
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
## Parallel sessions
|
|
268
|
+
|
|
269
|
+
```bash
|
|
270
|
+
meris parallel "explain auth" "explain db layer" --mode ask -j 2
|
|
271
|
+
meris parallel "fix test A" "fix test B" --mode run --isolate # git worktree each
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
## Skills
|
|
275
|
+
|
|
276
|
+
Place markdown in `.meris/skills/{name}.md`. Agent sees index in prompt; call `load_skill` to fetch full doc.
|
|
277
|
+
|
|
278
|
+
## Subagent
|
|
279
|
+
|
|
280
|
+
In `run` mode, agent can call `subagent_run` to delegate read-only exploration with isolated context.
|
|
281
|
+
|
|
282
|
+
## MCP SSE transport
|
|
283
|
+
|
|
284
|
+
```json
|
|
285
|
+
{
|
|
286
|
+
"mcpServers": {
|
|
287
|
+
"remote": {
|
|
288
|
+
"transport": "sse",
|
|
289
|
+
"url": "http://localhost:8080/sse"
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
## License
|
|
296
|
+
|
|
297
|
+
MIT — see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# 项目进度
|
|
2
|
+
|
|
3
|
+
## 已完成
|
|
4
|
+
- [x] P1–P4 + 阶段 A(doctor、permissions、plan、interrupt、git_commit、CI)
|
|
5
|
+
- [x] **阶段 B(v0.4.0)** — spec、session、hooks、benchmark
|
|
6
|
+
- [x] **阶段 C(v0.5.0)** — token 压缩、Anthropic、MCP extras、TUI 面板
|
|
7
|
+
- [x] **阶段 D(v0.6.0)**
|
|
8
|
+
- [x] D1 `meris-rs` + `meris native`
|
|
9
|
+
- [x] D2 `BRAND.md`
|
|
10
|
+
- [x] D3 VS Code/Cursor 扩展
|
|
11
|
+
- [x] **本机配置**:Cursor 扩展联接 + Rust/MSVC + `meris-rs` release(见 [docs/LOCAL_SETUP.md](docs/LOCAL_SETUP.md))
|
|
12
|
+
- [x] **品牌 Meris(v0.7.0+)** — CLI / 包 / Harness 统一为 Meris
|
|
13
|
+
- [x] **TUI 提交修复(v0.8.1)** — `_task_busy`;7 天 dogfood 文档
|
|
14
|
+
- [x] **7 天 dogfood Ratchet + 开源整理** — 见下方「Dogfood 复盘」
|
|
15
|
+
- [x] **首个公开版本 v0.0.1** — 对外 tag 从 0.0.1 起计
|
|
16
|
+
|
|
17
|
+
## 进行中
|
|
18
|
+
- [ ] Benchmark 持续跟踪(`meris benchmark run`)
|
|
19
|
+
- [ ] meris-rs 全量 Agent loop 移植(P5 后续)
|
|
20
|
+
|
|
21
|
+
## Dogfood 复盘(7 天 · Ratchet)
|
|
22
|
+
|
|
23
|
+
| # | 错误类型 | 典型表现 | Harness 改动 |
|
|
24
|
+
|---|----------|----------|----------------|
|
|
25
|
+
| 1 | **不知道路径规范** | plan 写 `forge/`;README 写成 `meris/README.md` | `AGENTS.md` 仓库布局 + `.meris/rules/paths.md` |
|
|
26
|
+
| 2 | **输出格式不对** | plan 无 `- [ ]`,benchmark `plan_smoke` fail | `AGENTS.md` Plan 节 + `.meris/skills/plan-format.md` + `benchmark.py` 判题 |
|
|
27
|
+
| 3 | **工作区 cwd 搞错** | 在 vault 根跑 run,README 被 block | `.meris/rules/workspace.md` + vault `AGENTS.md` 双 cwd 表 |
|
|
28
|
+
|
|
29
|
+
**代码层修复(非 Harness)**:TUI `_task_busy`;context `sanitize_messages_for_api`(tool 消息 400)。
|
|
30
|
+
|
|
31
|
+
**Meris 比裸 Chat 多什么**:permissions/block、DoD sensor、session 持久化、Plan 落盘、Ratchet 可沉淀规则。
|
|
32
|
+
|
|
33
|
+
## 阶段 D 命令
|
|
34
|
+
```bash
|
|
35
|
+
# Rust 核心
|
|
36
|
+
meris native status
|
|
37
|
+
meris native build
|
|
38
|
+
set MERIS_NATIVE=1
|
|
39
|
+
meris-rs context compress --max-tokens 3000 < msgs.json
|
|
40
|
+
|
|
41
|
+
# IDE(见 extensions/vscode-meris/README.md)
|
|
42
|
+
# Command Palette → Meris: Run Agent
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## 阶段 C 命令
|
|
46
|
+
```bash
|
|
47
|
+
set MERIS_PROVIDER=anthropic
|
|
48
|
+
pip install meris-agent[anthropic]
|
|
49
|
+
meris tui
|
|
50
|
+
meris mcp list
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## 阶段 B 命令
|
|
54
|
+
```bash
|
|
55
|
+
meris spec init "my feature"
|
|
56
|
+
meris benchmark run
|
|
57
|
+
meris session prune --keep 10
|
|
58
|
+
```
|