Metadata-Version: 2.4
Name: ChatTodo
Version: 0.1.0
Summary: Validated persistent task trees and atomic operations for collaborative planning.
Author-email: ChatArch <1073853456@qq.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/ChatArch/ChatTodo
Project-URL: Repository, https://github.com/ChatArch/ChatTodo
Project-URL: Documentation, https://arch.gh.wzhecnu.cn/ChatTodo/
Keywords: chattodo,chatarch,cli
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click>=8.0
Requires-Dist: chatstyle<0.3.0,>=0.2.0
Requires-Dist: chatenv<0.3.0,>=0.2.11
Provides-Extra: dev
Requires-Dist: build; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: twine; extra == "dev"
Provides-Extra: docs
Requires-Dist: mkdocs<2.0,>=1.6; extra == "docs"
Requires-Dist: mkdocs-material<9.7,>=9.5; extra == "docs"
Requires-Dist: mkdocs-static-i18n<2.0,>=1.2; extra == "docs"
Requires-Dist: mike<3.0,>=2.0; extra == "docs"
Dynamic: license-file

# ChatTodo

ChatTodo 提供有序任务树、原子变更、SQLite 持久化、版本冲突检测和撤销能力，供 ChatSite 任务树工作台及其他 Python 程序调用。

安装：`pip install "ChatTodo>=0.1.0,<0.2.0"`。

文档：https://arch.gh.wzhecnu.cn/ChatTodo/

完整网页请安装 `ChatSite[todo]`；ChatTodo 本身是领域库，不启动 Web 服务。

## Python API

```python
from chatenv import get_paths
from chattodo.board import BoardStore

store = BoardStore(get_paths().home_dir / "chattodo" / "boards.sqlite3")
board = store.create("example-user", title="项目计划")
root = board["nodes"][0]["id"]
result = store.mutate(
    board["id"], "example-user", board["revision"], "create-first-task",
    [{"op": "create", "node": {
        "id": "first-task", "parent_id": root,
        "title": "明确需求", "body": "## 目标\n明确交付范围。",
    }}],
)
print(result["change"]["counts"])
```

- `validate_nodes` / `apply_operations`：纯函数校验与变更，不修改调用者输入。
- `BoardStore.create/list/get/mutate/undo/save_view/history/delete`：持久化接口。
- 稳定节点 ID、四种任务状态、Markdown 正文、父子关系和兄弟排序。
- 修改批次原子应用；旧 revision 冲突；同一 request_id 幂等且绑定原始内容。
- 视图坐标／缩放／折叠状态与语义 revision 分离。
- SQLite 专用目录与文件私有，拒绝危险链接／特殊文件；owner 间隔离。

浏览器页面、登录、同源 API、模型调用与站点部署属于 **ChatSite**，不在 ChatTodo 中重复实现 Web 服务。模型配置不属于此领域包。

## 开发验证

```bash
python -m pytest -q
chattodo --version
chattodo --tree
chattodo --tree-brief
python -m build
```

当前 CLI 保留标准根选项；领域能力以 Python API 提供，不伪造尚不存在的业务命令。
