Skip to content

Commit ecad849

Browse files
committed
Rewrite docs homepage with feature-grouped toctrees
Replace the single Manual + API Reference toctree pair with six themed toctrees (Get started / File and storage / Servers and surfaces / Run-time controls / Composition / API reference) so every chapter is reachable from a clearly captioned sidebar group. Add an inline 'What it gives you' section that links each feature group to its chapter via :doc: references, and pull install / first action snippets above the toctrees so the homepage stands on its own. Mirror the structure across English, 繁體中文, and 简体中文.
1 parent 5014eb8 commit ecad849

3 files changed

Lines changed: 598 additions & 143 deletions

File tree

docs/source.zh-CN/index.rst

Lines changed: 195 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,215 @@
1+
###############
12
automation_file
2-
===============
3+
###############
4+
5+
**以 JSON 动作列表为核心的模块化文件自动化框架。**
6+
7+
``automation_file`` 把本地文件 / 目录 / ZIP / tar 操作、经 SSRF 校验且
8+
可续传的 HTTP 下载、十一种远端存储后端(Google Drive、S3、Azure Blob、
9+
Dropbox、OneDrive、Box、SFTP、FTP / FTPS、WebDAV、SMB、fsspec)、
10+
通过内建 TCP / HTTP / MCP 服务器执行的 JSON 动作列表、cron 调度器、
11+
文件监控触发器、通知扇出、审计日志、AES-256-GCM 文件加密、Prometheus
12+
指标,以及 PySide6 桌面图形界面,全部统合为单一框架——一切通过共享的
13+
``ActionRegistry`` 调度,并由单一 ``automation_file`` 门面对外呈现。
14+
15+
* **PyPI**:https://pypi.org/project/automation_file/
16+
* **GitHub**:https://github.com/Integration-Automation/FileAutomation
17+
* **Issue / 未来规划**:https://github.com/Integration-Automation/FileAutomation/issues
18+
* **许可**:MIT
319

420
语言:`English <../html/index.html>`_ | `繁體中文 <../html-zh-TW/index.html>`_ | **简体中文**
521

6-
以 JSON 动作列表为核心的模块化文件自动化框架。
22+
.. contents:: 本页目录
23+
:local:
24+
:depth: 1
25+
26+
----
27+
28+
安装
29+
====
30+
31+
.. code-block:: bash
32+
33+
pip install automation_file
34+
35+
每个后端(Google Drive、S3、Azure Blob、Dropbox、OneDrive、Box、SFTP、
36+
FTP、WebDAV、SMB、fsspec)以及 PySide6 图形界面均为一级运行时依赖
37+
包——无需记住任何可选 extra。
38+
39+
第一份动作
40+
==========
41+
42+
一个动作是三种 JSON 形态之一——``[name]``、``[name, {kwargs}]`` 或
43+
``[name, [args]]``。动作列表是动作的数组。共享的执行器会按序运行,
44+
并返回每条动作的结果映射。
45+
46+
.. code-block:: python
47+
48+
from automation_file import execute_action
49+
50+
results = execute_action([
51+
["FA_create_dir", {"dir_path": "build"}],
52+
["FA_create_file", {"file_path": "build/hello.txt", "content": "hi"}],
53+
["FA_zip_dir", {"dir_we_want_to_zip": "build", "zip_name": "build_snapshot"}],
54+
])
55+
56+
同一份列表可从 CLI(``python -m automation_file run actions.json``)、
57+
Loopback TCP / HTTP 服务器、MCP 主机,以及图形界面的 **JSON 动作** 分页
58+
直接执行——无需改写。可参考 :doc:`usage/quickstart` 了解校验、Dry-run
59+
与并行执行;:doc:`usage/cli` 介绍 argparse 派发器;:doc:`architecture`
60+
说明注册器与执行器如何协作。
61+
62+
----
63+
64+
提供哪些功能
65+
============
66+
67+
**本地操作**\ :doc:`usage/local`)
68+
文件 / 目录 / ZIP / tar / 压缩档操作、``safe_join`` 路径穿越防护、
69+
感知 OS 索引的 ``fast_find``、流式 ``file_checksum`` 与
70+
``find_duplicates``、``sync_dir`` rsync 风格镜像、目录差异比对、
71+
文本 patch、JSON / YAML / CSV / JSONL / Parquet 编辑、MIME 检测、
72+
模板渲染、回收站发送 / 还原、文件版本控制、条件式执行
73+
(``FA_if_exists`` / ``FA_if_newer`` / ``FA_if_size_gt``)、变量替换
74+
(``${env:…}`` / ``${date:%Y-%m-%d}`` / ``${uuid}``)、带超时的 shell
75+
子进程,以及 AES-256-GCM 文件加密。
76+
77+
**HTTP 传输**\ :doc:`usage/transfer`)
78+
``download_file`` 通过 ``validate_http_url`` 校验每个 URL(拒绝
79+
``file://`` / ``ftp://`` / 私有 / loopback / link-local / 保留地址),
80+
设下大小与超时上限,支持通过 ``Range:`` 续传到 ``<target>.part``,
81+
传输后比对 ``expected_sha256``,并可整合进度注册器,提供实时传输
82+
快照与协作式取消。
83+
84+
**云端与远端存储**\ :doc:`usage/cloud`)
85+
Google Drive(OAuth2)、S3(boto3)、Azure Blob、Dropbox、OneDrive、
86+
Box、SFTP(paramiko + ``RejectPolicy``)、FTP / FTPS、WebDAV、SMB /
87+
CIFS 与 fsspec 桥接——皆由 ``build_default_registry()`` 自动注册,
88+
并通过各自的共享单例访问。``copy_between`` 可按 URI 前缀在任意两个
89+
后端间搬运数据。
90+
91+
**动作服务器**\ :doc:`usage/servers`)
92+
默认仅绑定 loopback 的 TCP 与 HTTP 服务器,接受 JSON 动作列表,可
93+
选择启用共享密钥认证、服务端 ``ActionACL`` 白名单、
94+
``GET /healthz`` / ``GET /readyz`` 健康检查、``GET /openapi.json``、
95+
``GET /progress`` WebSocket,以及带类型的 ``HTTPActionClient`` SDK。
96+
97+
**MCP 服务器**\ :doc:`usage/mcp`)
98+
``MCPServer`` 通过 stdio 上的换行分隔 JSON-RPC 2.0,把注册器桥接到
99+
任意 Model Context Protocol 主机(Claude Desktop、Claude Code、MCP
100+
CLI)。每个 ``FA_*`` 动作会变成带自动生成输入 schema 的 MCP 工具。
101+
102+
**桌面图形界面**\ :doc:`usage/gui`)
103+
PySide6 分页控制界面——Home、Local、Transfer、Progress、JSON 动作、
104+
Triggers、Scheduler、Servers,加上每个云端后端各一个分页——共享
105+
相同的单例,并通过 ``ActionWorker`` 在全局线程池上派工。
7106

8-
``automation_file`` 把本地文件 / 目录 / ZIP 操作、经 SSRF 校验的 HTTP 下载、
9-
远端存储后端(Google Drive、S3、Azure Blob、Dropbox、OneDrive、Box、SFTP
10-
FTP、WebDAV、SMB、fsspec)以及通过内建 TCP / HTTP / MCP 服务器执行的 JSON
11-
动作列表统合为单一框架——全部通过共享的 ``ActionRegistry`` 调度,并由
12-
PySide6 桌面图形界面对外呈现
107+
**可靠性**\ :doc:`usage/reliability`)
108+
``retry_on_transient`` 带上限的指数退避、``Quota`` 大小与时间预算
109+
``CircuitBreaker``、``RateLimiter``、``FileLock`` / ``SQLiteLock``、
110+
持久化的 ``ActionQueue``、SQLite ``AuditLog``、用于周期清单比对的
111+
``IntegrityMonitor``,以及带类型的 ``FileAutomationException`` 层级
13112

14-
文档按语言与内容类型拆分。每个语言手册以章节组织:入门、CLI、架构、
15-
本地操作、HTTP 传输、云端与 SFTP 后端、动作服务器、MCP 服务器、图形界面、
16-
可靠性、触发器与调度、通知、配置、DAG、插件。API 参考则是自动生成的
17-
Python 参考资料
113+
**触发器与调度**\ :doc:`usage/events`)
114+
文件监控触发器(``FA_watch_*``)会在文件系统事件发生时运行动作列表;
115+
cron 风格调度器(``FA_schedule_*``)按调度周期性运行动作列表,并具
116+
重叠保护——两者均会在失败时回退到通知
18117

19-
未来规划
20-
--------
118+
**通知**\ :doc:`usage/notifications`)
119+
Slack、Email(SMTP)、Discord、Telegram、Microsoft Teams、PagerDuty
120+
与通用 Webhook 接收端,由 ``NotificationManager`` 组合,具备每接收端
121+
错误隔离与滑动窗口去重。
21122

22-
项目跟踪:https://github.com/Integration-Automation/FileAutomation/issues
123+
**配置与机密信息**\ :doc:`usage/config`)
124+
在 ``automation_file.toml`` 中声明接收端与默认值;``${env:…}`` /
125+
``${file:…}`` 引用通过链式 ``EnvSecretProvider`` / ``FileSecretProvider``
126+
解析;``ConfigWatcher`` 会轮询并热重载文件,无需重启。
127+
128+
**DAG 动作执行器**\ :doc:`usage/dag`)
129+
以 DAG 形式运行动作列表,可声明依赖、进行拓扑式并行展开、按分支
130+
跳过失败节点。
131+
132+
**可观测性**
133+
``start_metrics_server()`` 把每个动作以 Prometheus 计数器与直方图
134+
对外暴露;``start_web_ui()`` 提供仅依赖标准库的 HTMX 仪表板,
135+
呈现健康状态、进度与注册器。
136+
137+
**插件**\ :doc:`usage/plugins`)
138+
第三方包可通过 ``[project.entry-points."automation_file.actions"]``
139+
注册自家 ``FA_*`` 动作;``PackageLoader`` 会导入一个 Python 包,
140+
并把其顶层成员以 ``<package>_<member>`` 名称注册进注册器。
141+
142+
----
143+
144+
阅读顺序
145+
========
146+
147+
文档按语言与内容类型拆分。手册按典型读者旅程组织——安装、操作本地、
148+
串接远端存储、对外开服务器、规模化自动化,最后深入可靠性、配置与
149+
组合执行。API 参考则是每个公开模块的自动生成 Python 参考。
150+
151+
.. toctree::
152+
:maxdepth: 1
153+
:caption: 入门
154+
155+
usage/quickstart
156+
usage/cli
157+
architecture
23158

24159
.. toctree::
25-
:maxdepth: 2
26-
:caption: 手册
27-
28-
第 1 章 — 入门 <usage/quickstart>
29-
第 2 章 — CLI <usage/cli>
30-
第 3 章 — 架构 <architecture>
31-
第 4 章 — 本地操作 <usage/local>
32-
第 5 章 — HTTP 传输 <usage/transfer>
33-
第 6 章 — 云端与 SFTP 后端 <usage/cloud>
34-
第 7 章 — 动作服务器 <usage/servers>
35-
第 8 章 — MCP 服务器 <usage/mcp>
36-
第 9 章 — 图形界面 <usage/gui>
37-
第 10 章 — 可靠性 <usage/reliability>
38-
第 11 章 — 触发器与调度 <usage/events>
39-
第 12 章 — 通知 <usage/notifications>
40-
第 13 章 — 配置与机密信息 <usage/config>
41-
第 14 章 — DAG 动作执行器 <usage/dag>
42-
第 15 章 — 插件 <usage/plugins>
160+
:maxdepth: 1
161+
:caption: 文件与存储操作
162+
163+
usage/local
164+
usage/transfer
165+
usage/cloud
43166

44167
.. toctree::
45-
:maxdepth: 2
168+
:maxdepth: 1
169+
:caption: 服务器与界面
170+
171+
usage/servers
172+
usage/mcp
173+
usage/gui
174+
175+
.. toctree::
176+
:maxdepth: 1
177+
:caption: 运行时控制
178+
179+
usage/reliability
180+
usage/events
181+
usage/notifications
182+
usage/config
183+
184+
.. toctree::
185+
:maxdepth: 1
186+
:caption: 组合与扩展
187+
188+
usage/dag
189+
usage/plugins
190+
191+
.. toctree::
192+
:maxdepth: 1
46193
:caption: API 参考
47194

48-
第 A 章 — 核心 <api/core>
49-
第 B 章 — 本地操作 <api/local>
50-
第 C 章 — 远端操作 <api/remote>
51-
第 D 章 — 服务器 <api/server>
52-
第 E 章 — 客户端 SDK <api/client>
53-
第 F 章 — 触发器 <api/trigger>
54-
第 G 章 — 调度器 <api/scheduler>
55-
第 H 章 — 通知 <api/notify>
56-
第 I 章 — 进度与取消 <api/progress>
57-
第 J 章 — 项目脚手架 <api/project>
58-
第 K 章 — 图形界面 <api/ui>
59-
第 L 章 — 工具 <api/utils>
195+
api/core
196+
api/local
197+
api/remote
198+
api/server
199+
api/client
200+
api/trigger
201+
api/scheduler
202+
api/notify
203+
api/progress
204+
api/project
205+
api/ui
206+
api/utils
60207

61-
索引
62208
----
63209

210+
索引
211+
====
212+
64213
* :ref:`genindex`
65214
* :ref:`modindex`
66215
* :ref:`search`

0 commit comments

Comments
 (0)