@saltpub/agent-autoloop 0.0.0-stage → 0.1.2
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.
- package/CHANGELOG.md +19 -0
- package/INSTALL.md +118 -0
- package/LICENSE +21 -0
- package/README.en.md +264 -0
- package/README.md +260 -2
- package/SECURITY.md +48 -0
- package/dist/bin/agent-autoloop.js +2 -0
- package/dist/cli/backup.js +144 -0
- package/dist/cli/explain.js +84 -0
- package/dist/cli/main.js +1016 -0
- package/dist/cli/mcp.js +151 -0
- package/dist/cli/runs.js +40 -0
- package/dist/cli/spend.js +21 -0
- package/dist/cli/status.js +304 -0
- package/dist/cli/try.js +6 -0
- package/dist/cli/uninstall.js +84 -0
- package/dist/cli/update.js +65 -0
- package/dist/cli/why.js +115 -0
- package/dist/host/background-launcher.js +12 -0
- package/dist/host/background.js +24 -0
- package/dist/host/channels.js +4 -0
- package/dist/host/command.js +98 -0
- package/dist/host/config.js +37 -0
- package/dist/host/files.js +22 -0
- package/dist/host/home.js +5 -0
- package/dist/host/http.js +43 -0
- package/dist/host/launcher.js +188 -0
- package/dist/host/lines.js +15 -0
- package/dist/host/node-path.js +33 -0
- package/dist/host/npm.js +28 -0
- package/dist/host/plugins.js +26 -0
- package/dist/host/program.js +14 -0
- package/dist/host/runtime.js +179 -0
- package/dist/host/server.js +159 -0
- package/dist/host/service.js +325 -0
- package/dist/host/state.js +203 -0
- package/dist/host/up.js +162 -0
- package/dist/host/update.js +286 -0
- package/dist/host/version.js +81 -0
- package/dist/kernel/card-page.js +54 -0
- package/dist/kernel/credentials.js +16 -0
- package/dist/kernel/cron.js +135 -0
- package/dist/kernel/decide.js +826 -0
- package/dist/kernel/due.js +73 -0
- package/dist/kernel/errors.js +9 -0
- package/dist/kernel/evolve.js +264 -0
- package/dist/kernel/http.js +357 -0
- package/dist/kernel/query.js +202 -0
- package/dist/kernel/rules.js +20 -0
- package/dist/kernel/store.js +52 -0
- package/dist/plugins/acp/agent.js +32 -0
- package/dist/plugins/acp/bridge.js +204 -0
- package/dist/plugins/claude/agent.js +113 -0
- package/dist/plugins/codex/agent.js +105 -0
- package/dist/plugins/command/agent.js +25 -0
- package/dist/plugins/delivery/action.js +25 -0
- package/dist/plugins/delivery/agent.js +13 -0
- package/dist/plugins/delivery/delivery.js +388 -0
- package/dist/plugins/delivery/github.js +201 -0
- package/dist/plugins/delivery/handoff.js +50 -0
- package/dist/plugins/delivery/input.js +47 -0
- package/dist/plugins/delivery/poll.js +72 -0
- package/dist/plugins/delivery/project.js +144 -0
- package/dist/plugins/delivery/review-ledger.js +82 -0
- package/dist/plugins/delivery/review-policy.js +99 -0
- package/dist/plugins/delivery/review.js +280 -0
- package/dist/plugins/delivery/run.js +204 -0
- package/dist/plugins/desktop/channel.js +94 -0
- package/dist/plugins/dsh/agent.js +116 -0
- package/dist/plugins/feishu/channel.js +245 -0
- package/dist/plugins/github/source.js +30 -0
- package/dist/plugins/gitlab/source.js +30 -0
- package/dist/plugins/omp/agent.js +3 -0
- package/dist/plugins/opencode/agent.js +88 -0
- package/dist/plugins/pi/agent.js +92 -0
- package/dist/plugins/webhook/channel.js +70 -0
- package/dist/plugins/webhook/templates.js +34 -0
- package/dist/plugins/xiaojiu/channel.js +410 -0
- package/dist/plugins/zcode/agent.js +102 -0
- package/dist/protocol/client.js +56 -0
- package/dist/protocol/conformance.js +184 -0
- package/dist/protocol/job.js +1 -0
- package/dist/protocol/rules.js +230 -0
- package/dist/protocol/schema.js +70 -0
- package/dist/protocol/schema.json +985 -0
- package/dist/protocol/validate.js +150 -0
- package/dist/worker/agents.js +47 -0
- package/dist/worker/contract.js +178 -0
- package/dist/worker/run.js +52 -0
- package/dist/worker/usage.js +45 -0
- package/dist/worker/windows.ps1 +48 -0
- package/dist/worker/worker.js +595 -0
- package/docs/architecture.en.svg +178 -0
- package/docs/architecture.svg +178 -0
- package/docs/auto-update.md +53 -0
- package/docs/plugins.md +139 -0
- package/docs/protocol.md +582 -0
- package/docs/state-machines.md +77 -0
- package/examples/channel.sh +15 -0
- package/examples/plugins/hello-agent/agent.ts +40 -0
- package/examples/plugins/hello-channel/channel.ts +54 -0
- package/examples/plugins/hello-source/source.ts +19 -0
- package/examples/recipes/browser-handoff/README.md +44 -0
- package/examples/recipes/browser-handoff/SKILL.md +22 -0
- package/examples/recipes/browser-handoff/browser.json +10 -0
- package/examples/recipes/browser-handoff/handoff.ts +44 -0
- package/examples/recipes/browser-handoff/rules.json +19 -0
- package/examples/recipes/feedback/README.md +34 -0
- package/examples/recipes/feedback/SKILL.md +22 -0
- package/examples/recipes/feedback/event.json +8 -0
- package/examples/recipes/feedback/rules.json +37 -0
- package/examples/recipes/feishu-brief/README.md +28 -0
- package/examples/recipes/feishu-brief/SKILL.md +16 -0
- package/examples/recipes/feishu-brief/collect.ts +164 -0
- package/examples/recipes/feishu-brief/rules.json +57 -0
- package/examples/recipes/feishu-brief/sources.json +13 -0
- package/examples/recipes/github-issues/README.md +17 -0
- package/examples/recipes/github-issues/SKILL.md +18 -0
- package/examples/recipes/github-issues/rules.json +30 -0
- package/examples/recipes/inbox-triage/README.md +36 -0
- package/examples/recipes/inbox-triage/SKILL.md +19 -0
- package/examples/recipes/inbox-triage/collect.ts +191 -0
- package/examples/recipes/inbox-triage/rules.json +57 -0
- package/examples/recipes/inbox-triage/sources.json +8 -0
- package/examples/recipes/morning-brief/README.md +17 -0
- package/examples/recipes/morning-brief/SKILL.md +17 -0
- package/examples/recipes/morning-brief/rules.json +16 -0
- package/examples/recipes/ops-alerts/README.md +18 -0
- package/examples/recipes/ops-alerts/SKILL.md +34 -0
- package/examples/recipes/ops-alerts/restart.sh +5 -0
- package/examples/recipes/ops-alerts/rules.json +29 -0
- package/examples/recipes/website-watch/README.md +26 -0
- package/examples/recipes/website-watch/SKILL.md +19 -0
- package/examples/recipes/website-watch/check.ts +86 -0
- package/examples/recipes/website-watch/rules.json +56 -0
- package/examples/recipes/website-watch/site.json +6 -0
- package/examples/skills/weekly-sweep/SKILL.md +17 -0
- package/examples/watch-github-issues.sh +23 -0
- package/examples/worker.sh +18 -0
- package/package.json +55 -4
- package/plugins/acp/agent.ts +31 -0
- package/plugins/acp/bridge.ts +190 -0
- package/plugins/claude/agent.ts +121 -0
- package/plugins/codex/agent.ts +103 -0
- package/plugins/command/agent.ts +25 -0
- package/plugins/delivery/action.ts +29 -0
- package/plugins/delivery/action.yml +28 -0
- package/plugins/delivery/agent.ts +15 -0
- package/plugins/delivery/delivery.ts +408 -0
- package/plugins/delivery/github.ts +207 -0
- package/plugins/delivery/handoff.ts +72 -0
- package/plugins/delivery/input.ts +55 -0
- package/plugins/delivery/poll.ts +65 -0
- package/plugins/delivery/project.ts +161 -0
- package/plugins/delivery/review-ledger.ts +90 -0
- package/plugins/delivery/review-policy.ts +126 -0
- package/plugins/delivery/review.ts +324 -0
- package/plugins/delivery/run.ts +219 -0
- package/plugins/desktop/channel.ts +100 -0
- package/plugins/dsh/agent.ts +100 -0
- package/plugins/feishu/channel.ts +243 -0
- package/plugins/github/source.ts +33 -0
- package/plugins/gitlab/source.ts +32 -0
- package/plugins/omp/agent.ts +4 -0
- package/plugins/opencode/agent.ts +78 -0
- package/plugins/pi/agent.ts +80 -0
- package/plugins/webhook/channel.ts +74 -0
- package/plugins/webhook/templates.ts +32 -0
- package/plugins/xiaojiu/channel.ts +426 -0
- package/plugins/zcode/agent.ts +96 -0
- package/skills/agent-autoloop/SKILL.md +260 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# @saltpub/agent-autoloop
|
|
2
|
+
|
|
3
|
+
## 0.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- e59941d: 发布包名改为 `@saltpub/agent-autoloop`(挂在 saltpub 组织下),安装与更新命令相应改为 `npm install -g @saltpub/agent-autoloop`。
|
|
8
|
+
|
|
9
|
+
## 0.1.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 39bda1d: 接单程序拿到的资料里,回答和到期复查带上当初那一轮处理过的事件编号(`answers`、`timers`、`waiting` 里的 `events`),业务能把结果对回自己发出的编号。交付在转正式后 10 分钟仍没有检查记录或必需任务时重新触发一次草稿转正式,必需任务已经在排队时继续等,不再提前退回。飞书的事件监听被“另一个连接占用”拒绝时用中文说明原因,改为一分钟重试一次,停止中台不再等这段间隔。默认 Codex 审查模型改为 `gpt-6.2-sol`。
|
|
14
|
+
- 007b45e: npm 包和源码检出同构:包里带 `plugins/` 源码、`docs/` 和 `examples/`,`init` 把共享 Skill 链到当前版本目录,装上后手册里指向 `README.md`、`docs/`、`examples/` 和 `plugins/` 的相对路径都能打开,`update` 换版本时链接跟着换。构建不再压缩。
|
|
15
|
+
- 7470412: 装好的副本会自己换版本:中台每 6 小时看一眼 npm,把新版放在 `~/.agent-autoloop/versions/` 下试跑,没有在跑的活时由启动器换过去,连着两次起不来就退回上一版。原来按全局 npm 安装的位置也能用,`update` 改为先放进版本目录再重启。
|
|
16
|
+
|
|
17
|
+
## 0.1.0
|
|
18
|
+
|
|
19
|
+
首个 npm 发布:`npm install -g @saltpub/agent-autoloop`,`agent-autoloop init` 完成本机配置。程序以编译后的形式发布,Node 24 即可运行;`agent-autoloop update` 从 npm 取最新版。
|
package/INSTALL.md
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# 安装说明(写给 Agent)
|
|
2
|
+
|
|
3
|
+
用户请你装好 Agent 自动化中台。先安装,再走一遍提问和继续处理;能自己做的直接做。
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
支持原生 Windows、macOS 和 Linux。需要 Node.js 24 或更新(自带 npm),以及一个已经登录的命令行 Agent;Git 只在安装插件和接 GitHub 交付时用到。Windows 使用系统自带的 PowerShell 5.1、任务计划程序和 Windows Script Host(wscript)。
|
|
8
|
+
|
|
9
|
+
Windows PowerShell:
|
|
10
|
+
|
|
11
|
+
```powershell
|
|
12
|
+
npm install -g @saltpub/agent-autoloop
|
|
13
|
+
agent-autoloop init
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
npm 把 `agent-autoloop` 命令和包一起装进全局目录,确认命令在 PATH 上。Windows 10 和 11 都能装,不需要管理员:后台服务是当前账号自己的登录任务。例外是 Windows 自带的 Administrator 账号(开着 UAC 时):不提权建不了登录任务,提权建出来的任务又会让中台和它派的 Agent 带着完整的管理员权限,所以 `service install` 会拒绝并打印一行 PowerShell,改用「启动」文件夹在登录时以普通权限拉起中台。Windows 服务在本人登录后于后台常驻、不开窗口,退出 10 秒后自动重启,注销后停止;通过 SSH 管理时也可用 `service install`,任务会在 Windows 已登录的会话中运行;Codex 0.167 的原生沙箱在 OpenSSH 会话中会出现 runner pipe-in 超时,本机登录会话正常,见 [Codex 已知问题](https://github.com/openai/codex/issues/37722)。中台起不来、日志里是 `listen EACCES` 时,多半是 Hyper-V、WSL 把端口划进了系统保留范围:`netsh int ipv4 show excludedportrange protocol=tcp` 查看,在 `config.json` 里换一个范围外的端口。CI 或普通命令测试用 `--no-service`,再运行安装器打印的完整命令启动 `up`。桌面通知只在同一登录会话显示。
|
|
17
|
+
|
|
18
|
+
给 Windows 写带中文的 PowerShell 脚本(比如轮询脚本,或包一层 Agent 的脚本)要存成带 BOM 的 UTF-8:PowerShell 5.1 按本地代码页读不带 BOM 的文件,中文会乱,接着报语法错误。
|
|
19
|
+
|
|
20
|
+
WSL2 仍按 Linux 安装;常驻服务需要发行版开启 systemd,没开则加 `--no-service`。WSL2 的桌面通知不会发送到 Windows 桌面。
|
|
21
|
+
|
|
22
|
+
先检查 `node --version` 和 `npm --version`。Homebrew 的 `node@24` 默认不进 PATH,装好后还要运行 `export PATH="$(brew --prefix node@24)/bin:$PATH"`;需要长期生效时再写入用户的 shell 配置。不要替用户登录,也不要读取或复制登录凭据。
|
|
23
|
+
|
|
24
|
+
本仓库已公开,安装包和代码都可匿名下载,不需要 GitHub 账号、登录或 GitHub CLI(`gh`)。macOS/Linux:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm install -g @saltpub/agent-autoloop
|
|
28
|
+
agent-autoloop init
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
npm 的全局目录不可写时(比如系统自带的 node),不要用 sudo 装这个程序:改用 nvm,或者给 npm 设一个自己的目录:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npm config set prefix "$HOME/.local"
|
|
35
|
+
npm install -g @saltpub/agent-autoloop
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
再把 `$HOME/.local/bin` 加进 PATH。
|
|
39
|
+
|
|
40
|
+
GitHub Issue 轮询和 PR 交付等功能另需已登录的 `gh`,按对应场景说明配置;运行 Agent 也仍需该 Agent 自己的登录或授权。中台在后台启动 Agent,桌面应用里能用的浏览器和电脑操作它不一定用得上(比如 Codex 应用里的 Chrome,后台的 `codex exec` 用不到);要它操作网页,照[浏览器接入](docs/plugins.md#浏览器接入)配好,再用后台的启动方式实际跑一次。
|
|
41
|
+
|
|
42
|
+
安装和 `agent-autoloop update` 都装 npm 上的最新版本,那是通过了全部检查的版本,`main` 上还没发布的改动要等下一次发布。装好以后自动检查更新,过程、回退和关闭方法见[自动更新](docs/auto-update.md)。
|
|
43
|
+
|
|
44
|
+
`--agent claude` 选择 Claude Code;只有其他 CLI 时给 `init` 加 `--command 'hermes chat -Q -q {prompt}'`,带空格的路径用引号括起来;找不到这个程序时不装。不指定时会检测本机安装的 Agent,第一种作为试跑对象。
|
|
45
|
+
|
|
46
|
+
程序由 npm 装进它的全局目录(`npm prefix -g`),配置和记录留在 `~/.agent-autoloop`。默认打开桌面通知;没有图形会话时安静跳过,问题仍能用 `agent-autoloop status` 查看。
|
|
47
|
+
|
|
48
|
+
在源码目录里开发时用 `npm install -g .` 安装当前目录。这样装出来的 `update` 同样从 npm 取新版本,不会拉取未提交的改动;要换回发布版,先 `agent-autoloop uninstall` 再装一次。
|
|
49
|
+
|
|
50
|
+
中台启动时在 macOS/Linux 把数据目录设为 `0700`,Windows 则用 ACL 只允许本人和 SYSTEM 访问,包括已有目录,阻止其他系统用户读取数据库、事件和运行输出。Codex 的 Windows 沙箱会给用户目录下的文件夹加上它的账号的读权限,数据目录也在内;中台启动时收回,在那之前沙箱里的命令能读到主密钥和配置里的密钥。插件另外给每轮的 `context.json` 加这个读权限。升级后同步重启中台与接单程序;新版 `status` 使用中台提供的费用汇总。
|
|
51
|
+
|
|
52
|
+
升级时若投影格式有变化,会自动从旧日志逐条重建,历史多时首次启动需要等待;之后正常启动直接复用投影。原日志和已有卡片链接保留,不需要手动迁移。
|
|
53
|
+
|
|
54
|
+
## 临时 HOME、CI 或没有服务管理器
|
|
55
|
+
|
|
56
|
+
使用临时 HOME 时不要装系统服务,不改真实用户的 shell 配置和 Agent 配置。保留调用者给定的 `AGENT_AUTOLOOP_HOME`;用真实 `CODEX_HOME` 只为了沿用已经完成的 Codex 登录。
|
|
57
|
+
|
|
58
|
+
在临时环境中选一个空闲端口,用 npm 把当前目录装进临时前缀,随后启动中台:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
port=$(node -e 'const s=require("node:net").createServer().listen(0,"127.0.0.1",()=>{console.log(s.address().port);s.close()})')
|
|
62
|
+
npm install -g --prefix "$work/prefix" /path/to/agent-autoloop --no-audit
|
|
63
|
+
export PATH="$work/prefix/bin:$PATH"
|
|
64
|
+
agent-autoloop init --agent codex --no-service --port "$port"
|
|
65
|
+
agent-autoloop up
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
`up` 会一直运行。在 Agent 的命令工具里保留它返回的运行中会话,再用另一条命令完成验证;不要用 `nohup … &` 代替,命令工具可能在退出时清理后台进程。看到监听地址后再运行验证命令;启动失败就先处理该会话里的错误。
|
|
69
|
+
|
|
70
|
+
PATH 没有命令时,把 `agent-autoloop` 换成 `init` 打印的完整路径。临时测试使用假的通知程序或通道,Windows 也不要弹真实通知;不要给已在线的飞书应用再开监听。
|
|
71
|
+
|
|
72
|
+
## 验证
|
|
73
|
+
|
|
74
|
+
先查看安装和连接情况,再用真实 Agent 跑完整问答:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
agent-autoloop --version
|
|
78
|
+
agent-autoloop doctor
|
|
79
|
+
agent-autoloop try
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
`try` 会使用用户的模型额度。在非交互终端,它打印问题和 `agent-autoloop answer` 命令后退出;这是正常等待,不是失败。把问题转给用户,按他的选择回答,再运行 `agent-autoloop status`,看到“试跑通过”才算接通。仅为安装验证时,可以选择第二项绿色完成试跑。
|
|
83
|
+
|
|
84
|
+
Claude 要委托 Codex 处理网页时,可用[浏览器交接模板](examples/recipes/browser-handoff/README.md),先配置现成入口,再验收首次调用与原会话续办。模板不安装浏览器驱动、不自动放宽 Claude 命令权限。
|
|
85
|
+
|
|
86
|
+
任务还需要网页操作时,另按[浏览器接入](docs/plugins.md#浏览器接入)用同一后台启动方式核实实际页面和会话接续。`try` 只证明问答流程;中台不自动提供浏览器连接或修改 Agent 的工具配置。需要本人恢复连接、登录或验证时,保留待验收项并交 `ask`,不要反复重跑已完成的业务。
|
|
87
|
+
|
|
88
|
+
没有安装系统服务时,`doctor` 会显示服务未运行;检查中台、Agent 和桌面通道是否在线即可,不要为了消除这条提示安装真实服务。
|
|
89
|
+
|
|
90
|
+
## 写第一条规则
|
|
91
|
+
|
|
92
|
+
安装验证完成后,按用户希望自动处理的事从 [README 的场景模板](README.md#拿来即用的场景模板)选一个,再照[配置手册](skills/agent-autoloop/SKILL.md)写规则;用户还没指定用途时再问。用 `agent-autoloop check` 检查;改动几秒内生效。
|
|
93
|
+
|
|
94
|
+
国内业务可从反馈处理、网站巡检、飞书周报与业务摘要三套模板开始。它们默认飞书本人私聊;替换占位符后,配置和业务资料留在私有目录,不提交到仓库。模板不替用户新建凭据或扩大飞书权限。
|
|
95
|
+
|
|
96
|
+
桌面通知只在这台电脑上显示。需要别的通道时,先确认接收位置,再按配置手册接入。不要直接测试发信或发群消息。`access` 的含义见[插件说明](docs/plugins.md#access-实际能做什么),不要替用户扩大权限。
|
|
97
|
+
|
|
98
|
+
## 卸载
|
|
99
|
+
|
|
100
|
+
卸载程序,默认保留规则、密钥和记录:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
agent-autoloop uninstall
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
终端里确认后才执行;非交互运行时加 `--yes` 跳过确认,数据同样保留。它只停自己的服务和进程、删除指向自身的命令及 Skill 链接,以及 npm 安装的包。其他同名文件不动;数据目录不删除。
|
|
107
|
+
|
|
108
|
+
临时安装验证完,用 `agent-autoloop uninstall --yes` 停掉本次进程,再清掉自己创建的临时目录。不要卸载用户已经在用的中台。
|
|
109
|
+
|
|
110
|
+
## 文档
|
|
111
|
+
|
|
112
|
+
- [配置手册](skills/agent-autoloop/SKILL.md):接事件插件、通道和多台电脑。
|
|
113
|
+
- [交付流水线](skills/agent-autoloop/SKILL.md#交付流水线)随安装提供,按仓库配置交付规则后开始接单。
|
|
114
|
+
- [协议](docs/protocol.md):HTTP、回执、事实日志和故障恢复。
|
|
115
|
+
- [插件](docs/plugins.md):三个可运行的最小例子。
|
|
116
|
+
- [安全边界](SECURITY.md):密钥、执行权限和交付审查。
|
|
117
|
+
|
|
118
|
+
开发检查各平台都用 `npm run test:quick`,Windows 上它跳过只在 Unix 跑的用例并说出跳了哪些;Windows 另加 `npm run test:windows` 与 `node scripts/install-smoke-windows.ts`。Linux/macOS 用 `npm run test:quick`(改了 `kernel/`、`protocol/`、`sim/` 时用 `npm test`)、`npm run typecheck`、`npm run format:check`,完整故障检查和性能实测用 `npm run test:nightly`。备份和恢复见[配置手册](skills/agent-autoloop/SKILL.md#日志与恢复)。`master.key` 坏了中台会拒绝启动:从备份恢复;没有备份就删掉它,重启会生成新的,已发出的卡片链接和正在跑的轮次会失效。
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 数字生命卡兹克
|
|
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.
|
package/README.en.md
ADDED
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
# Agent Autoloop
|
|
2
|
+
|
|
3
|
+
**Let your command-line agents pick up work and follow it through in the background — staying quiet when they can handle it, and sending you a card only when a decision is yours to make.**
|
|
4
|
+
|
|
5
|
+
[中文](README.md) | **English**
|
|
6
|
+
|
|
7
|
+
[Get started](#get-started) · [Recipes](#ready-to-use-recipes) · [Plugins](#plugin-ecosystem-swap-any-of-the-four-sides) · [Kernel](#four-kernel-mechanisms) · [Docs](#documentation)
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
## What problem does it solve?
|
|
12
|
+
|
|
13
|
+
Most of us use command-line agents like Claude Code or Codex by babysitting a terminal: you type a prompt, watch it run, and answer its questions. Close the window or walk away, and the work stops.
|
|
14
|
+
|
|
15
|
+
**Agent Autoloop** turns your command-line agents into a background loop. At the center is a deterministic **kernel** with zero runtime dependencies. Around it, event sources, agents, notification channels, and even CI/CD delivery pipelines are all swappable **plugins**.
|
|
16
|
+
|
|
17
|
+
- **One machine, one install command.** Runs on Windows, macOS, or Linux. No cloud server or inbound ports required.
|
|
18
|
+
- **Connect a new agent in one line.** No SDK, no agent source code to fork. Any CLI tool that takes a prompt and prints a final reply can plug in.
|
|
19
|
+
- **No web dashboard.** Cards reach you on Feishu, DingTalk, WeCom, Slack, Discord, or desktop notifications when you are needed. Everything else is one command away.
|
|
20
|
+
|
|
21
|
+
## Get started
|
|
22
|
+
|
|
23
|
+
Works on Windows, macOS, and Linux. You need Node 24 or newer (with npm) and a command-line agent already signed in. No GitHub account required. You can hand the [installation guide](INSTALL.md) to your agent.
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install -g @saltpub/agent-autoloop
|
|
27
|
+
agent-autoloop init
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Both installing and `agent-autoloop update` take the newest version on npm, which has passed every check. After that it checks for updates by itself: a new version is unpacked beside the old one and smoke-run, switched in at the next start once no run is in flight, and rolled back if it does not come up. See [auto-update](docs/auto-update.md).
|
|
31
|
+
|
|
32
|
+
Then run a real loop with your own agent — ask, exit while it waits, make the call, resume:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
agent-autoloop try
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
> CLI output and default notification strings are still Chinese until they are translated. Sample CLI output in this README is that same text written in English.
|
|
39
|
+
|
|
40
|
+
Here is the output from Codex in a non-interactive terminal, written in English:
|
|
41
|
+
|
|
42
|
+
```text
|
|
43
|
+
Event sent. The agent is getting to work...
|
|
44
|
+
|
|
45
|
+
The agent finished this round and asked you a question. No process is running for it now, and it is not spending tokens.
|
|
46
|
+
|
|
47
|
+
[Your call] #1 Try run: pick a color
|
|
48
|
+
This is a try run. Either choice is fine.
|
|
49
|
+
1. Blue
|
|
50
|
+
2. Green
|
|
51
|
+
Answer: agent-autoloop answer 1 <number>
|
|
52
|
+
After you answer, run agent-autoloop status to see it pick the work back up and finish.
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
In an interactive terminal, just type the option number. In a non-interactive terminal, run `agent-autoloop answer 1 2` to pick green. Then `agent-autoloop status` shows that the agent resumed its conversation and finished, along with rounds, tokens, and cost for today and the past seven days ([how they are counted](skills/agent-autoloop/SKILL.md#看情况回答)).
|
|
56
|
+
|
|
57
|
+
## How a piece of work flows
|
|
58
|
+
|
|
59
|
+
The numbers match the diagram above:
|
|
60
|
+
|
|
61
|
+
1. **An event comes in.** A 9:00 AM schedule, a new GitHub issue, or a production alert becomes a standard event sent to the kernel.
|
|
62
|
+
2. **Dispatched by your rules.** Your rules decide which agent handles it and in which folder. New events for the same subject while it is queued merge into one round.
|
|
63
|
+
3. **Work one round and exit.** The agent puts its result in its final message, and the process exits.
|
|
64
|
+
4. **Asks only when needed.** For sensitive actions like deleting data, taking a service down, spending money, or messaging people, the kernel sends you a card through Feishu or a desktop notification. While you take your time, no agent process runs and no tokens are spent.
|
|
65
|
+
5. **One tap resumes it.** Your answer picks up the original conversation and finishes the job.
|
|
66
|
+
|
|
67
|
+
Anything the agent can handle alone takes the auto-loop at the top of the diagram: finish outright, or schedule a follow-up check (say, in 30 minutes) without bothering you.
|
|
68
|
+
|
|
69
|
+
## Day-to-day usage
|
|
70
|
+
|
|
71
|
+
### Write your rules (`rules.json`)
|
|
72
|
+
|
|
73
|
+
No glue code needed. Open `~/.agent-autoloop/rules.json` and, under `rules`, declare **what happened, who handles it, and where they work**. Set `to` to a name already under `agents`. For example, write a brief every morning at 9:
|
|
74
|
+
|
|
75
|
+
```json
|
|
76
|
+
{
|
|
77
|
+
"name": "Morning brief",
|
|
78
|
+
"when": { "cron": "0 9 * * *" },
|
|
79
|
+
"to": "codex",
|
|
80
|
+
"cwd": "~/notes",
|
|
81
|
+
"prompt": "Summarize yesterday's notes and commits into today's brief."
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
External events work the same way once the source is connected. To hand new GitHub issues to Codex, first register `github` under `sources` ([guide](skills/agent-autoloop/SKILL.md#接一个事件插件)):
|
|
86
|
+
|
|
87
|
+
```json
|
|
88
|
+
{
|
|
89
|
+
"name": "Handle issues",
|
|
90
|
+
"when": { "source": "github", "types": ["issues.opened"] },
|
|
91
|
+
"to": "codex",
|
|
92
|
+
"cwd": "~/code/app",
|
|
93
|
+
"skill": "handle-issue",
|
|
94
|
+
"parallel": 3
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
`agent-autoloop pause <rule>` and `resume <rule>` pause and resume one rule: while paused it skips its scheduled times and doesn't take or queue events, and a resume doesn't catch up on its own. A resume lists the events the pause skipped and prints `agent-autoloop replay <rule> --since <time>`, which hands them all to the rule at once, each only once. `agent-autoloop run <rule>` runs it once now. These are kept in the hub's log; `rules.json` is not changed. `agent-autoloop runs [rule]` lists finished rounds, `--before <round>` pages back, and `agent-autoloop why <round>` tells the full story of one.
|
|
99
|
+
|
|
100
|
+
Changes take effect within seconds of saving. Run `agent-autoloop check` to validate, `agent-autoloop check <file>` to validate a draft without touching the running hub, `agent-autoloop rules explain [file]` to see the rules in effect and their next runs (a draft file too), and `agent-autoloop emit <type> --dry-run` to preview who an event would go to (it doesn't contact the hub or write to the log). If you make a mistake, or the file is deleted or can't be read, the hub keeps running the previous valid rules and sends you a card about it.
|
|
101
|
+
|
|
102
|
+
### How agents talk back to the hub
|
|
103
|
+
|
|
104
|
+
The hub asks only one thing of an agent: **put your result in your final message**. When the job is done, a one-line conclusion is enough. To ask you something, the agent appends an `agent-autoloop` block:
|
|
105
|
+
|
|
106
|
+
````text
|
|
107
|
+
Order checked. We have enough stock in the warehouse.
|
|
108
|
+
|
|
109
|
+
```agent-autoloop
|
|
110
|
+
{
|
|
111
|
+
"ask": [{
|
|
112
|
+
"title": "How should we ship it?",
|
|
113
|
+
"text": "Both options can go out today.",
|
|
114
|
+
"options": ["Courier", "Pickup"],
|
|
115
|
+
"key": "shipping"
|
|
116
|
+
}]
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
````
|
|
120
|
+
|
|
121
|
+
Besides `ask`, receipts can send notifications (`notice`), resolve open cards (`resolve`), schedule follow-up checks (`later`), and emit new events (`events`). A notice asks for nothing, but you can add a line of your own when you settle one, and it stays on the card; one marked `fyi` is only there to tell you, and has no button. If the JSON is invalid, the hub has the agent rewrite just that final message in the same session, without repeating completed work. If rewriting also fails, it keeps the original conclusion and tells you the receipt was not applied (a plain command has no session, so it goes straight to this). Going on in an old session works the same way: a new session starts only when the old one can't be continued. If it was continued and then broke partway, the run counts as failed and is retried in that session a few minutes later, not redone in a new one. A new event on the same thread starts a new session by default; with `"resume": true` in the rule it goes on in the last round's session.
|
|
122
|
+
|
|
123
|
+
## Ready-to-use recipes
|
|
124
|
+
|
|
125
|
+
Each recipe includes sample rules and setup instructions (written in Chinese).
|
|
126
|
+
|
|
127
|
+
| Task | Included workflow |
|
|
128
|
+
| --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
129
|
+
| [Morning brief](examples/recipes/morning-brief/README.md) | Summarize local notes and Git commits at 8 AM by default; write `briefs/YYYY-MM-DD.md` |
|
|
130
|
+
| [GitHub issues](examples/recipes/github-issues/README.md) | Poll every five minutes, edit code locally, and notify you to review; no commits, pushes, or issue replies |
|
|
131
|
+
| [Production alerts](examples/recipes/ops-alerts/README.md) | Receive an error, investigate local code, ask before restarting, and continue after your answer |
|
|
132
|
+
| [User feedback](examples/recipes/feedback/README.md) | Re-read current feedback, fix, deliver and verify, then prepare a reply; ask you in Feishu and resume after your answer |
|
|
133
|
+
| [Website watch](examples/recipes/website-watch/README.md) | Check status and expected content every five minutes; wake the agent on a new incident, keep ongoing failures quiet, and update the card on recovery |
|
|
134
|
+
| [Feishu weekly and business brief](examples/recipes/feishu-brief/README.md) | Read selected reports and tables with your permissions at 6 PM Sunday; summarize locally and send only a short summary to Feishu |
|
|
135
|
+
| [Inbox triage](examples/recipes/inbox-triage/README.md) | Read unread mail from the last 24 hours at 8 AM by default; write a local checklist with reply drafts, without sending or changing the mailbox |
|
|
136
|
+
| [PR delivery](skills/agent-autoloop/SKILL.md#交付流水线) | Add `deliver` to a PR to review it, wait for CI, merge, wait for deployment, and verify the live version |
|
|
137
|
+
|
|
138
|
+
**To enable one:** open its instructions. If the recipe includes a task Skill, put it in your agent's skills directory. Merge the sample rules into `~/.agent-autoloop/rules.json`, replace worker names and paths, then run `agent-autoloop check`.
|
|
139
|
+
|
|
140
|
+
Feedback, website watch, Feishu briefs, and inbox triage default to Asia/Shanghai and send only to the owner's private Feishu chat. Sample data is fictional; scripts and receipts have been verified only with local HTTP and a fake Feishu CLI, not run end to end on a live account.
|
|
141
|
+
|
|
142
|
+
More: [Claude-to-Codex browser handoff](examples/recipes/browser-handoff/README.md) and [weekly code cleanup](examples/skills/weekly-sweep/SKILL.md).
|
|
143
|
+
|
|
144
|
+
## Plugin ecosystem: swap any of the four sides
|
|
145
|
+
|
|
146
|
+
Built-in plugins ship with the program and are enabled through configuration. Use `agent-autoloop add <git URL>` for third-party plugins.
|
|
147
|
+
|
|
148
|
+
| Side | Built in | Setup |
|
|
149
|
+
| --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
|
|
150
|
+
| **Events**: how work is found | [GitHub Webhook](plugins/github/source.ts), [GitLab Webhook](plugins/gitlab/source.ts), [HTTP API](docs/protocol.md#来源把世界变成事件), [cron rules](skills/agent-autoloop/SKILL.md#改规则), [issue polling script](examples/watch-github-issues.sh) | [Guide](skills/agent-autoloop/SKILL.md#接一个事件插件) |
|
|
151
|
+
| **Agents**: who does the work | [Claude Code](plugins/claude/agent.ts), [Codex](plugins/codex/agent.ts), [OpenCode](plugins/opencode/agent.ts), [pi](plugins/pi/agent.ts), [OMP](plugins/omp/agent.ts), [ACP](plugins/acp/agent.ts), [DeepSeek Harness](plugins/dsh/agent.ts), [ZCode](plugins/zcode/agent.ts), [generic command](plugins/command/agent.ts) | [Guide](skills/agent-autoloop/SKILL.md#接一个-agent) |
|
|
152
|
+
| **Channels**: how cards reach you | [Desktop notifications](plugins/desktop/channel.ts) (on by default), [Feishu](plugins/feishu/channel.ts), [DingTalk / WeCom / Slack / Discord](plugins/webhook/templates.ts) | [Guide](skills/agent-autoloop/SKILL.md#接一个通道) |
|
|
153
|
+
| **Delivery**: CI/CD as a plugin | [`delivery`](plugins/delivery/delivery.ts) | [Guide](skills/agent-autoloop/SKILL.md#交付流水线) |
|
|
154
|
+
|
|
155
|
+
**What has been tested:** Claude Code, Codex, and ACP (with the official Codex ACP adapter) have run multi-turn Q&A and session resumption across processes. OpenCode (2.2.7), pi, and OMP have run multi-turn Q&A, session resumption, and usage reporting. ZCode has run a question, an answer, and the resumed session. Feishu has run real delivery, button callbacks, and card updates. The four webhook templates have only been checked against local mock servers, and the GitLab webhook against the payloads in its docs, not a real GitLab. These text channels answer through a link, so `hub.publicUrl` must be reachable from your phone or computer.
|
|
156
|
+
|
|
157
|
+
**Built-in agents through another service.** To send Claude Code or Codex to a third-party model service, or to set environment variables before it starts, write a small script that sets them and starts the program, then put `"program": "/path/to/script"` on the agent. Session resumption and usage reporting still work. See the [guide](skills/agent-autoloop/SKILL.md#接一个-agent).
|
|
158
|
+
|
|
159
|
+
**Other CLI agents connect in one line.** Set `use: "command"` and pass a command array; `{prompt}` is a single argument, never evaluated as shell code. These commands come from each tool's official docs, and we have not run each of them yet:
|
|
160
|
+
|
|
161
|
+
| Agent | Command |
|
|
162
|
+
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- |
|
|
163
|
+
| [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/cli-help.md#dsh-headless) older versions (the built-in plugin needs 0.2.2 or newer) | `dsh --profile headless {prompt}` |
|
|
164
|
+
| [pi](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/cli.md) | `pi --print {prompt}` |
|
|
165
|
+
| [OpenClaw](https://docs.openclaw.ai/cli/agent) | `openclaw agent exec {prompt}` |
|
|
166
|
+
| [Hermes](https://hermes-agent.nousresearch.com/docs/user-guide/cli) | `hermes chat -Q -q {prompt}` |
|
|
167
|
+
| [Cursor](https://cursor.com/docs/cli/reference/parameters) | `agent -p --trust {prompt}` |
|
|
168
|
+
| [WorkBuddy / CodeBuddy](https://www.codebuddy.ai/docs/cli/headless) | `codebuddy -p {prompt}` |
|
|
169
|
+
|
|
170
|
+
OpenClaw's `agent exec` stops each run after 600 seconds by default, and that counts as a failure; for longer work add `--timeout <seconds>` to the command (`0` means no limit).
|
|
171
|
+
|
|
172
|
+
Agents that speak ACP connect with `use: "acp"` and can go on in the same session: [Gemini CLI](https://geminicli.com/docs/cli/acp-mode/) is `"command": ["gemini", "--acp"]`, [OpenCode](https://opencode.ai/docs/acp) is `"command": ["opencode", "acp"]`, and Antigravity is `"command": ["agy", "acp"]`. Gemini CLI 0.67.0 and OpenCode 1.1.2 answered the ACP handshake; multi-turn Q&A and session resumption have not been run yet. Antigravity (agy 1.5.5) has run both on Windows. OpenCode also has a built-in plugin (`use: "opencode"`, `run --format json`) with session resumption and usage reporting.
|
|
173
|
+
|
|
174
|
+
**Delivery pipeline.** Once delivery rules are configured, the `deliver` label takes a GitHub PR through review, CI, merge, deployment, and live-version verification. Projects can choose reviewers per authoring agent or share a policy. Delivery reads trusted settings from main and reviews a read-only snapshot on the worker.
|
|
175
|
+
|
|
176
|
+
**Write your own.** Start from the runnable [agent](examples/plugins/hello-agent/agent.ts), [channel](examples/plugins/hello-channel/channel.ts), and [event](examples/plugins/hello-source/source.ts) templates and the [plugin guide](docs/plugins.md). For web tasks, read [browser access](docs/plugins.md#浏览器接入) first. The CLI and [MCP](skills/agent-autoloop/SKILL.md#mcp-与密钥撤销) can also inspect and answer cards.
|
|
177
|
+
|
|
178
|
+
## Four kernel mechanisms
|
|
179
|
+
|
|
180
|
+
The kernel has zero runtime dependencies. It reads no clock, uses no randomness, and makes no outbound requests; plugins connect in, and credentials stay with the plugins that use them. Identical inputs always give identical results. It brings four proven systems patterns to command-line agents:
|
|
181
|
+
|
|
182
|
+
- **Zero-cost wait**: The process exits while waiting for your call, and the waiting state lives in SQLite, so the agent does not stay alive. If you reply three days later, no agent process runs and no tokens are spent in the meantime — only the lightweight hub waits in the background; your answer resumes the original conversation.
|
|
183
|
+
- **Event sourcing**: All state is derived from an append-only fact log, committed in the same SQLite transaction as its indexes before the hub replies. Confirmed facts survive `SIGKILL` (whole-machine power loss is not separately tested), every run can be traced with a single command, and format changes rebuild from the log without migration scripts.
|
|
184
|
+
- **Code / data split**: Like parameterized SQL. Issue titles, bodies, and other external text are written only to a local data file, never into the prompt, which carries only character-checked types, IDs, and links; `rules.json` alone decides which agent runs, in which folder, and with what access. Events carrying `cwd`, `agent`, or `access` fields are rejected outright.
|
|
185
|
+
- **Hop circuit breaker**: Like packet TTL in networking. Events returned by an agent can dispatch more agents, and the hop count keeps growing — across human questions and scheduled follow-ups too — and an agent cannot reset it. Past 8 hops, the kernel records the event, stops dispatching, and sends you a notice card.
|
|
186
|
+
|
|
187
|
+
### Check it yourself
|
|
188
|
+
|
|
189
|
+
On Windows use `npm run test:windows` and `node scripts/install-smoke-windows.ts`. These run the common behavior tests and native process/install checks; Unix shell fixtures remain on Linux/macOS.
|
|
190
|
+
|
|
191
|
+
Run these from `~/.agent-autoloop/app`:
|
|
192
|
+
|
|
193
|
+
| What it checks | Command |
|
|
194
|
+
| --------------------------------------------------------------------------------------------------------------------- | --------------------------------- |
|
|
195
|
+
| The full story of any round | `agent-autoloop why 1` |
|
|
196
|
+
| 200,000 simulated steps of network loss, dropped packets, crashes, and duplicate requests, reproducible from one seed | `node sim/random.ts 24301 200000` |
|
|
197
|
+
| 1,000 process kills with no acknowledged record lost | `node sim/crash.ts 1000 12648430` |
|
|
198
|
+
| The benchmarks below | `npm run benchmark` |
|
|
199
|
+
|
|
200
|
+
```text
|
|
201
|
+
Round 1 · Demo
|
|
202
|
+
11-03 20:47:25 Rules version #1
|
|
203
|
+
11-03 20:47:25 Triggering event: source local · type demo.start · subject example
|
|
204
|
+
11-03 20:47:25 local picked it up (demo program)
|
|
205
|
+
11-03 20:47:25 Finished: demo complete
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Benchmarks
|
|
209
|
+
|
|
210
|
+
Apple M5 Pro, 24 GB, Node 24.21.0. Each write is a separate request, acknowledged only after its transaction is durable.
|
|
211
|
+
|
|
212
|
+
| Metric | Measured |
|
|
213
|
+
| ----------------------------------------- | -------------: |
|
|
214
|
+
| Cold start | 88.78 ms |
|
|
215
|
+
| Idle memory | 59.94 MB RSS |
|
|
216
|
+
| 1,000 concurrent waiting polls | 170.49 MB RSS |
|
|
217
|
+
| Durable writes | 2,394 events/s |
|
|
218
|
+
| Dispatch p99 | 1.82 ms |
|
|
219
|
+
| Held-back heartbeat p99 with 5,000 queued | 1.66 ms |
|
|
220
|
+
| Startup at 1.1 million facts | 99.8 ms |
|
|
221
|
+
| Runtime dependencies | 0 |
|
|
222
|
+
|
|
223
|
+
As history grows, the status summary slows down and the log and indexes keep using disk. The first start after a format change rebuilds from the log, which took 43.1 seconds for 1.1 million facts. [Full numbers and method](docs/protocol.md#历史增长实测) (in Chinese).
|
|
224
|
+
|
|
225
|
+
## Usage and provider terms
|
|
226
|
+
|
|
227
|
+
The hub invokes command-line tools you have already installed and signed into on your machine; it never reads or exports their credentials. Model usage is billed to your own account under each provider's terms.
|
|
228
|
+
|
|
229
|
+
For automated workloads, providers generally recommend using API keys rather than personal subscription quotas (which are designed around interactive personal use — see [Anthropic](https://code.claude.com/docs/en/legal-and-compliance) and [OpenAI](https://learn.chatgpt.com/docs/auth)). Use API keys if you are running services for others. This project is independent and is not affiliated with or endorsed by those providers.
|
|
230
|
+
|
|
231
|
+
## Documentation
|
|
232
|
+
|
|
233
|
+
- [Installation guide](INSTALL.md)
|
|
234
|
+
- [Configuration & delivery pipeline manual](skills/agent-autoloop/SKILL.md)
|
|
235
|
+
- [Writing plugins](docs/plugins.md)
|
|
236
|
+
- [Full HTTP protocol specification](docs/protocol.md)
|
|
237
|
+
- [Security boundaries](SECURITY.md)
|
|
238
|
+
- [Contributing and community](CONTRIBUTING.md)
|
|
239
|
+
- [Development guidelines](AGENTS.md)
|
|
240
|
+
|
|
241
|
+
<details>
|
|
242
|
+
<summary><strong>Repository layout</strong></summary>
|
|
243
|
+
|
|
244
|
+
| Location | Contents |
|
|
245
|
+
| -------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
|
|
246
|
+
| `kernel/` | Decisions, fact log, projections, deadlines, rule matching, endpoint behavior, and card forms |
|
|
247
|
+
| `host/` | Node HTTP, files and SQLite connections, clock, configuration, status summary, background services, and plugin loading |
|
|
248
|
+
| `protocol/` | Wire formats, JSON Schema, input validation, HTTP client, and conformance checks |
|
|
249
|
+
| `worker/` | Claim work, run agents, handle heartbeats and cancellation, read and submit receipts |
|
|
250
|
+
| `cli/`, `bin/` | User commands and entry point: status, answers, `why`, MCP, updates, and uninstall |
|
|
251
|
+
| `plugins/` | Built-in agent, event, channel, and delivery plugins |
|
|
252
|
+
| `examples/recipes/` | Complete recipes with rules, a task Skill, and setup instructions |
|
|
253
|
+
| `examples/plugins/`, `examples/skills/`, `examples/*.sh` | Minimal plugin templates, standalone task guides, and Shell examples |
|
|
254
|
+
| `skills/agent-autoloop/` | The hub's configuration and operation manual, also made available to agents during installation |
|
|
255
|
+
| `docs/` | Protocol, plugin guide, and Chinese / English architecture diagrams |
|
|
256
|
+
| `tests/`, `sim/` | Everyday behavior tests, simulation, enumeration, crash tests, and mutation checks |
|
|
257
|
+
| `scripts/`, `.github/workflows/` | Performance and real-agent checks, installation smoke scripts, and Windows / Linux / macOS CI |
|
|
258
|
+
| Root documents and `package.json` | Chinese / English READMEs, installation, security, development guidelines, license, and npm publish metadata |
|
|
259
|
+
|
|
260
|
+
Start reading at `bin/agent-autoloop.ts` → `cli/main.ts`, then follow the feature into `host/`, `worker/`, or `plugins/`. Read the [protocol](docs/protocol.md) for kernel design. Similarly named files serve different layers: `host/http.ts` adapts Node requests while `kernel/http.ts` defines endpoint behavior; `protocol/rules.ts` validates input while `kernel/rules.ts` defines rule types and matching.
|
|
261
|
+
|
|
262
|
+
</details>
|
|
263
|
+
|
|
264
|
+
[MIT License](LICENSE)
|