sintbot 1.3.0 → 1.4.1

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.
Files changed (81) hide show
  1. package/CHANGELOG.en.json +50 -0
  2. package/CHANGELOG.json +50 -0
  3. package/README.md +138 -20
  4. package/README.zh-CN.md +144 -20
  5. package/assets/design-styles/acid-pop.md +155 -0
  6. package/assets/design-styles/archive-index.md +161 -0
  7. package/assets/design-styles/art-deco.md +164 -0
  8. package/assets/design-styles/cinematic-noir.md +178 -0
  9. package/assets/design-styles/editorial.md +121 -0
  10. package/assets/design-styles/geometric-pop.md +122 -0
  11. package/assets/design-styles/hand-drawn.md +117 -0
  12. package/assets/design-styles/islamic-geometry.md +155 -0
  13. package/assets/design-styles/liquid-glass.md +183 -0
  14. package/assets/design-styles/neo-chinese.md +136 -0
  15. package/assets/design-styles/precision-mono.md +156 -0
  16. package/assets/design-styles/quiet-luxury.md +163 -0
  17. package/assets/design-styles/riso-print.md +116 -0
  18. package/assets/design-styles/soft-friendly.md +174 -0
  19. package/assets/design-styles/swiss-grid.md +156 -0
  20. package/assets/design-styles/tech-dark.md +182 -0
  21. package/bin/sintbot-v2.js +291 -263
  22. package/docs/AI-ASSISTED-INSTALL.md +8 -8
  23. package/docs/install.md +80 -48
  24. package/docs/zh-CN/AI-ASSISTED-INSTALL.md +8 -8
  25. package/docs/zh-CN/install.md +80 -48
  26. package/install.sh +34 -81
  27. package/package.json +60 -5
  28. package/src/agent/claudecode.js +32 -3
  29. package/src/agent/claudemodels.js +60 -0
  30. package/src/agent/claudestatus.js +74 -0
  31. package/src/agent/claudeusage.js +200 -0
  32. package/src/agent/codexapp.js +21 -4
  33. package/src/agent/codexcode.js +8 -3
  34. package/src/agent/codexstatus.js +181 -0
  35. package/src/agent/privatecore.js +1 -1
  36. package/src/agent/privatecore.wasm +0 -0
  37. package/src/c2configcontrol.js +214 -0
  38. package/src/c2console.js +149 -0
  39. package/src/c2incident.js +125 -0
  40. package/src/c2install.js +247 -37
  41. package/src/c2migration.js +100 -0
  42. package/src/c2multigroupcapacity.js +103 -0
  43. package/src/c2multigroupservice.js +418 -0
  44. package/src/cdp.js +254 -0
  45. package/src/config.js +13 -2
  46. package/src/core/c2durablejournal.js +26 -9
  47. package/src/core/c2durableruntime.js +104 -1
  48. package/src/core/c2inputrejection.js +45 -0
  49. package/src/core/c2localeffectexecutor.js +12 -1
  50. package/src/core/c2payloadhandles.js +11 -0
  51. package/src/core/c2persistrelation.js +20 -0
  52. package/src/core/c2persiststate.js +28 -2
  53. package/src/core/c2platformrecoverysender.js +1 -1
  54. package/src/core/c2sourcequarantine.js +56 -1
  55. package/src/core/c2terminalprune.js +2 -1
  56. package/src/core/engineslotsadapter.js +108 -0
  57. package/src/core/issues.js +185 -0
  58. package/src/core/ledger.js +30 -0
  59. package/src/core/proxy.js +424 -0
  60. package/src/core/store.js +12 -0
  61. package/src/core/v2engine.js +427 -31
  62. package/src/design.js +5161 -0
  63. package/src/gitrepo.js +150 -0
  64. package/src/leftover.js +174 -0
  65. package/src/platform/slack.js +1294 -0
  66. package/src/platform/wecom.js +961 -0
  67. package/src/platform/wecomcli.js +128 -0
  68. package/src/platform/wecomname.js +43 -0
  69. package/src/platform/wecompoll.js +241 -0
  70. package/src/preview.js +581 -0
  71. package/src/projectmemory.js +175 -0
  72. package/src/ui/auth.js +31 -0
  73. package/src/ui/browser.html +392 -0
  74. package/src/ui/browserroutes.js +234 -0
  75. package/src/ui/console.html +5719 -0
  76. package/src/ui/dashboard.js +168 -0
  77. package/src/ui/feishulogin.js +136 -0
  78. package/src/ui/serverbase.js +2371 -0
  79. package/src/ui/sessions.js +78 -0
  80. package/src/ui/takeover.js +108 -0
  81. package/src/usage.js +144 -0
@@ -1,19 +1,19 @@
1
- # Install SintBot 1.3.0 with an AI assistant
1
+ # Install SintBot 1.4.1 with an AI assistant
2
2
 
3
3
  English · [简体中文](./zh-CN/AI-ASSISTED-INSTALL.md)
4
4
 
5
- Use the terminal on the Mac that will run SintBot. A cloud shell cannot install it on the user's Mac. Follow the [installation guide](./install.md); its supported route is one Feishu group, Codex and a foreground process.
5
+ Use the terminal on the Mac that will run SintBot. A cloud shell cannot install it on the user's Mac. Follow the [installation guide](./install.md); its supported route is 1–32 Feishu groups, Codex or Claude Code per group, and a foreground process.
6
6
 
7
- 1. Check macOS, Node 22+, the actual Codex executable/login and any existing SintBot process. Do not print credentials. Preserve existing installations, configuration and state.
8
- 2. Download and inspect the installer, run its `--dry-run`, then install the exact package into a new prefix. Continue within the user's authorization; ask only for missing decisions. The installer does not change Node, Codex, shell profiles or services.
9
- 3. Use the executable under that prefix and verify it reports `1.3.0`. Do not substitute a globally installed command. A successful package install is not a successful group test.
10
- 4. Prepare the single-group configuration in the install guide. Let the user enter secrets locally or use already authorized credential references without revealing them. Use an existing authorized Feishu app only when another process is not connected to it. If app setup or login requires the user, finish other independent preparation first.
11
- 5. For fresh state only, run `init`, then `start --preflight`. Refusal due to old state or unresolved receipts is a stop condition: never delete files, fabricate a new authority or alter receipts to bypass it.
7
+ 1. Check macOS, Node 22+, the actual Codex or Claude Code executable and login, and any existing SintBot process. Do not print credentials. Preserve existing installations, configuration and state.
8
+ 2. Run the one-line installation command in the guide; `--dry-run` is optional. Continue within the user's authorization; ask only for missing decisions. The installer does not change Node, Codex, Claude Code, shell profiles or services.
9
+ 3. The installer verifies the version and core at `~/.local/share/sintbot/bin/sintbot`. A successful package install is not a successful group test.
10
+ 4. Prepare the group configuration in the install guide. Let the user enter secrets locally or use already authorized credential references without revealing them. Use an existing authorized Feishu app only when another process is not connected to it. If app setup or login requires the user, finish other independent preparation first.
11
+ 5. For fresh state only, run `init`, then `start --preflight`. Refusal due to an existing journal or unresolved receipts is a stop condition: never delete files, fabricate a new authority or alter receipts to bypass it.
12
12
  6. Run the foreground service, send an authorized read-only group request and compare its response with the file. Stop cleanly and verify a restart. If no person is available, use an authorized test account to send the request; document the sender and do not call it independent human acceptance. A bot's own API message may be ignored and is not a substitute for an incoming user message.
13
13
  7. Stop temporary processes before ending the task. Report what was installed, what actually ran and any remaining setup. Do not register an automatic background service for this release.
14
14
 
15
15
  ## Copyable request
16
16
 
17
17
  ```text
18
- Install SintBot 1.3.0 on this Mac using the versioned, isolated installation guide. Preserve existing services, configuration, state and Codex account data. Do not expose credentials. Verify the actual installed executable and binary core, configure one Feishu group for Codex, and initialize only clean new state. Run the foreground preflight and an authorized read-only group test, check the result, then verify clean stop/restart. Do not use the old setup, console or service-install flow. Stop temporary processes when finished, and distinguish package installation from successful group acceptance.
18
+ Install SintBot 1.4.1 on this Mac using the one-line installation guide. Preserve existing services, configuration, state and Codex or Claude Code account data. Do not expose credentials. Verify the actual installed executable and binary core, configure the Feishu groups with their runners, and initialize only clean new state. Run the foreground preflight and an authorized read-only group test, check the result, then verify clean stop/restart. Stop temporary processes when finished, and distinguish package installation from successful group acceptance.
19
19
  ```
package/docs/install.md CHANGED
@@ -1,93 +1,125 @@
1
- # Install SintBot 1.3.0
1
+ # Install SintBot 1.4.1
2
2
 
3
3
  English · [简体中文](./zh-CN/install.md)
4
4
 
5
- This release supports macOS, Node.js 22+, one Feishu group and Codex message turns. It runs in the foreground. Multiple groups, other chat platforms or model routes, the console, automatic service setup, scheduled tasks, terminal chat and whiteboards are not supported in 1.3.0.
5
+ You need a Mac, Node.js 22 or newer, and projects stored on that Mac. Install and sign in to at least one runner: Codex or Claude Code. This release connects 1–32 Feishu China groups, binds each group to one local project, and runs in the foreground.
6
6
 
7
- ## 1. Prepare the Mac
8
-
9
- Use a terminal on the Mac where the project lives. Confirm Node.js 22+ and a working, authenticated Codex installation. Keep the existing Codex installation and account data. The SintBot installer does not install or log in to Codex and does not install Node.
7
+ ## 1. Install with one command
10
8
 
11
9
  ```bash
12
- node --version
13
- codex --version
10
+ curl -fsSL https://sintbot.com/install.sh | bash
14
11
  ```
15
12
 
16
- If this Mac already runs SintBot, leave it running its current package and configuration. A separate package prefix is safe to install, but **1.3.0 does not automatically migrate existing state**. Its initialization refuses existing state, old receipts or an existing journal. Do not delete these files to bypass that check. Do not connect two processes to the same Feishu application.
17
-
18
- ## 2. Install into a separate directory
13
+ The installer checks the environment, installs `sintbot@1.4.1` into `~/.local/share/sintbot`, and verifies the entry, built-in core and Feishu module. Continue when you see `Installed and verified SintBot 1.4.1`. No sudo is needed.
19
14
 
20
- Download and inspect the installer, then run the same file:
15
+ To preview, append `-s -- --dry-run`. To choose another location, set `SINTBOT_INSTALL_DIR` and adjust the executable paths below.
21
16
 
22
- ```bash
23
- curl -fsSL https://sintbot.com/install.sh -o /tmp/sintbot-install.sh
24
- bash /tmp/sintbot-install.sh --dry-run
25
- bash /tmp/sintbot-install.sh
26
- ```
17
+ ## 2. Connect Feishu
27
18
 
28
- It installs **sintbot@1.3.0** into `~/.local/share/sintbot/releases/1.3.0`, checks the actual executable, binary core and Feishu module, and leaves global packages, shell profiles, configuration and services untouched. It refuses an existing target directory. Use `--prefix /new/absolute/directory` for a different location. `--dry-run` makes no changes and does not fetch a package.
19
+ In the [Feishu Open Platform](https://open.feishu.cn/), create a custom app, enable the bot and the permissions to receive and reply to messages, choose long connection for event subscription and subscribe to message receipt. Publish the app, add the bot to the groups you will use, and copy each group's `oc_…` chat ID.
29
20
 
30
- Keep using the exact executable, so an older global command cannot be selected accidentally:
21
+ Enter the app credentials in the default macOS terminal (the secret is not echoed):
31
22
 
32
- ```bash
33
- SINTBOT="$HOME/.local/share/sintbot/releases/1.3.0/bin/sintbot"
34
- "$SINTBOT" --version
35
- "$SINTBOT" help
23
+ ```zsh
24
+ read -r "FEISHU_APP_ID?Feishu App ID: "
25
+ read -rs "FEISHU_APP_SECRET?Feishu App Secret: "
26
+ printf '\n'
27
+ export FEISHU_APP_ID FEISHU_APP_SECRET
36
28
  ```
37
29
 
38
- The expected version is `1.3.0`. Installing the package does not start a bot.
39
-
40
- ## 3. Configure one Feishu group
41
-
42
- Create a Feishu enterprise custom application on `open.feishu.cn`, enable its bot, grant message reception and reply permissions, choose long-connection event delivery, subscribe to message reception, publish the application and add its bot to your test group. Obtain that group's `oc_…` chat ID from Feishu. Use the China Feishu platform; international Lark is not supported.
30
+ Never post the secret in a group or commit it. Keep using this terminal; set both variables again in a new one.
43
31
 
44
- Enter the app ID and app secret locally as `FEISHU_APP_ID` and `FEISHU_APP_SECRET` environment variables in the terminal that will start SintBot. Do not paste the secret into chat or commit it to your repository. Environment references are resolved at startup; both values must be present in each new terminal session.
32
+ ## 3. Bind projects
45
33
 
46
- Create the private configuration directory with `mkdir -p ~/.sbot && chmod 700 ~/.sbot`, then create `~/.sbot/config-1.3.0.json` with the following content. Replace the group ID and project path with actual values. The project must already exist. Keep exactly one group and the two explicit `false` flags.
34
+ Create a private directory with `mkdir -p ~/.sbot && chmod 700 ~/.sbot`, then create `~/.sbot/config.json`. Replace the chat IDs and absolute project paths; each project directory must already exist. The example binds two groups, one with Codex and one with Claude Code. With one group, delete the other entry.
47
35
 
48
36
  ```json
49
37
  {
50
38
  "defaultProvider": "codex",
51
- "providers": { "codex": { "runner": "codex" } },
39
+ "providers": {
40
+ "codex": { "runner": "codex" },
41
+ "claude": { "runner": "claude" }
42
+ },
52
43
  "feishu": {
53
44
  "appId": "env:FEISHU_APP_ID",
54
45
  "appSecret": "env:FEISHU_APP_SECRET",
55
46
  "onlyWhenMentioned": false
56
47
  },
57
48
  "groups": {
58
- "oc_REPLACE_WITH_YOUR_CHAT_ID": {
49
+ "oc_REPLACE_WITH_FIRST_CHAT_ID": {
59
50
  "platform": "feishu",
60
51
  "provider": "codex",
61
- "workdir": "/absolute/path/to/your/project",
52
+ "workdir": "/absolute/path/to/first/project",
62
53
  "permissionMode": "dontAsk",
63
- "codexSteer": false,
64
- "codexApp": false
54
+ "codexSteer": true
55
+ },
56
+ "oc_REPLACE_WITH_SECOND_CHAT_ID": {
57
+ "platform": "feishu",
58
+ "provider": "claude",
59
+ "workdir": "/absolute/path/to/second/project",
60
+ "permissionMode": "dontAsk"
65
61
  }
66
62
  }
67
63
  }
68
64
  ```
69
65
 
70
- Keep the configuration private (`chmod 600 ~/.sbot/config-1.3.0.json`). This example begins read-only and receives ordinary messages in this one group; use a dedicated test group. To require mentions instead, set `onlyWhenMentioned: true` and supply the actual app-specific `botOpenId`; startup rejects a missing bot ID. Do not add console, other-platform, scheduled-task or whiteboard settings from an older example. The full historical configuration schema is not the supported 1.3.0 setup.
66
+ Then run `chmod 600 ~/.sbot/config.json`.
67
+
68
+ - `permissionMode: "dontAsk"` is restricted and suits a first test group. Use `"bypassPermissions"` (full access) once it should edit files and run commands.
69
+ - To pin a Claude model, add `"model"` to `providers.claude`; otherwise Claude Code's default model on this Mac is used.
70
+ - At most 2 tasks run at once by default; add `"agent": { "maxConcurrent": 4 }` at the top level to change it (1–32).
71
71
 
72
- ## 4. Initialize and start
72
+ ## 4. First start
73
73
 
74
- For a **new installation only**:
74
+ Copy and run in the same terminal:
75
75
 
76
76
  ```bash
77
- "$SINTBOT" init --config "$HOME/.sbot/config-1.3.0.json"
78
- "$SINTBOT" start --config "$HOME/.sbot/config-1.3.0.json" --preflight
79
- "$SINTBOT" start --config "$HOME/.sbot/config-1.3.0.json"
77
+ SINTBOT="$HOME/.local/share/sintbot/bin/sintbot"
78
+ "$SINTBOT" init --config "$HOME/.sbot/config.json" &&
79
+ "$SINTBOT" start --config "$HOME/.sbot/config.json" --preflight &&
80
+ "$SINTBOT" start --config "$HOME/.sbot/config.json" --ui
80
81
  ```
81
82
 
82
- `init` creates a new persistent receipt journal at `~/.sbot/c2-v2.log`; it never resets an existing journal or migrates old state. Run it once. `--preflight` checks local configuration and assembly without starting the Feishu connection; it does not prove authentication or message delivery. `start` holds the single-writer lock and connects the configured group. Keep that terminal open.
83
+ This initializes the message journals, checks the configuration and runners, connects Feishu and opens the local console, stopping at the first failure. **Run `init` only once**; never run it again for a restart. Keep the terminal open.
84
+
85
+ In a group, send "Read the first line of the project README and reply with only that line", then compare it with the file. A passing preflight does not prove Feishu authentication or delivery.
86
+
87
+ ## 5. Use it in a group
88
+
89
+ Any text message is a task. Replies arrive in a card that appears once the model starts answering and refreshes as it works.
83
90
 
84
- Send a message in the group and request the first line of the project's README. Check the returned line against the file. Press Ctrl-C and wait for the process to exit, then run the same `start` command again. Do not rerun `init` for normal restarts.
91
+ | Command | Effect |
92
+ | --- | --- |
93
+ | `/help` | List commands |
94
+ | `/status` | Group status: model, project, busy or idle, queue |
95
+ | `/model` | List models; `/model name` switches (only while the group is idle; starts a new conversation) |
96
+ | `/new` | Start a new conversation (only while the group is idle) |
97
+ | `/stop` | Stop the current task and cancel queued ones |
98
+ | `/hud` | Quota of the current model and usage of this conversation |
99
+ | `/issue text` | Log feedback; review and close it in the console overview |
85
100
 
86
- ## Stop, failure and upgrades
101
+ Messages sent while a task runs are added to that task in Codex groups (`codexSteer: true`) and queued in Claude Code groups. If a turn returns a model error or no result, only that group is asked to resend; there is no automatic retry. If a group's last result cannot be confirmed, such as a reply whose delivery is unknown, only that group is paused and answers new messages with a short notice; other groups keep working. Nothing is replayed or retried.
102
+
103
+ ## 6. Console
104
+
105
+ With `--ui`, open `http://127.0.0.1:4600` on this Mac. The console shows each group (a paused group shows Needs attention), stops tasks, binds new groups, and switches the model or project folder of an idle group. For LAN access, set a console password in its settings first, then enable LAN access.
106
+
107
+ You can also add a group without the console: add it to the configuration, stop the service and run `start` again; the new group is registered automatically. Bound groups cannot be removed or renamed by editing the configuration.
108
+
109
+ ## Stop and restart
110
+
111
+ Press Ctrl-C and wait for exit. With the Feishu variables set, run:
112
+
113
+ ```bash
114
+ "$HOME/.local/share/sintbot/bin/sintbot" start --config "$HOME/.sbot/config.json" --ui
115
+ ```
116
+
117
+ If a group stays paused, first restart: a group whose records can recover reopens on its own and is told once to resend. If it is still paused, check what actually happened in that group, then stop the service and seal the group's incident:
118
+
119
+ ```bash
120
+ "$HOME/.local/share/sintbot/bin/sintbot" incident seal --config "$HOME/.sbot/config.json" --group oc_PAUSED_GROUP_ID
121
+ ```
87
122
 
88
- - Stop with Ctrl-C and wait for shutdown. This version does not provide automatic login startup or a service-install command.
89
- - If a request fails or startup reports unresolved receipts, preserve the journal and state. Verify what happened before retrying. Do not clear unknown effects, overwrite the journal or run the same task again blindly.
90
- - The installer never replaces an earlier package. A version change still requires draining the old process, preserving configuration/state and checking receipt compatibility. A spare executable alone is not a safe rollback of state.
91
- - Existing multi-group installations remain on their previous release. A reviewed migration is required before replacing them with this single-group route.
123
+ Sealing keeps the old journal unchanged under `incidents/` in the data directory and gives the group a new journal; messages left unfinished before the seal are never processed again. Start the service again to reopen the group. A preflight fails while any group would stay paused. Never delete journals or resend to get around a paused group. Run only one connected process per Feishu app. This release does not register a background service.
92
124
 
93
- See the [AI-assisted guide](./AI-ASSISTED-INSTALL.md) if an assistant is performing the local steps.
125
+ [Illustrated website guide](https://sintbot.com/guide/install/) · [AI-assisted installation](./AI-ASSISTED-INSTALL.md)
@@ -1,19 +1,19 @@
1
- # 用 AI 助手安装 SintBot 1.3.0
1
+ # 用 AI 助手安装 SintBot 1.4.1
2
2
 
3
3
  [English](../AI-ASSISTED-INSTALL.md) · 简体中文
4
4
 
5
- 使用实际运行 SintBot 的 Mac 本地终端;云端终端不能替用户的 Mac 安装。按[安装指南](./install.md)操作,本版支持一个飞书群、Codex 与前台运行。
5
+ 使用实际运行 SintBot 的 Mac 本地终端;云端终端不能替用户的 Mac 安装。按[安装指南](./install.md)操作,本版支持 1–32 个飞书群、每群选用 Codex 或 Claude Code,以前台方式运行。
6
6
 
7
- 1. 核对 macOS、Node 22 及以上、Codex 实际程序与登录、是否已有 SintBot 进程。不输出凭据,保留已有安装、配置和状态。
8
- 2. 下载并检查安装器,运行 `--dry-run`,再装到全新目录。用户已经授权的步骤继续执行,只问缺失的决定。安装器不修改 Node、Codex、终端配置或服务。
9
- 3. 使用独立目录中的实际入口,确认输出 `1.3.0`,不要误用全局旧命令。安装程序包成功不等于群测试成功。
10
- 4. 按安装指南准备单群配置。让用户在本地输入密钥,或使用已经授权的凭据引用,不显示秘密。复用授权飞书应用时,确认没有另一个进程连接该应用。应用或登录需要本人操作时,先完成其他独立准备。
11
- 5. 只有全新状态才能执行 `init`,然后执行 `start --preflight`。若已有旧状态或未结收据而拒绝启动,不得删文件、新造日志权威或篡改收据来绕过。
7
+ 1. 核对 macOS、Node 22 及以上、Codex 或 Claude Code 的实际程序与登录、是否已有 SintBot 进程。不输出凭据,保留已有安装、配置和状态。
8
+ 2. 运行指南中的一行安装命令;`--dry-run` 为可选预览。用户已经授权的步骤继续执行,只问缺失的决定。安装器不修改 Node、Codex、Claude Code、终端配置或服务。
9
+ 3. 安装器会验证 `~/.local/share/sintbot/bin/sintbot` 的版本和核心加载。安装程序包成功不等于群测试成功。
10
+ 4. 按安装指南准备群配置。让用户在本地输入密钥,或使用已经授权的凭据引用,不显示秘密。复用授权飞书应用时,确认没有另一个进程连接该应用。应用或登录需要本人操作时,先完成其他独立准备。
11
+ 5. 只有全新状态才能执行 `init`,然后执行 `start --preflight`。若已有日志或未结收据而拒绝启动,不得删文件、新造日志权威或篡改收据来绕过。
12
12
  6. 前台运行,用已经授权的账号在群内发只读请求,把回复和文件对照,再正常停止并验证重启。没有真人协助时可用授权测试账号发送,并记录实际发送方式,不称为独立真人验收;机器人自己发的接口消息可能被忽略,不能当作用户入站消息。
13
13
  7. 本轮临时进程用完停止。说明安装了什么、实际验证了什么、还缺什么。本版不注册自动后台服务。
14
14
 
15
15
  ## 可复制的请求
16
16
 
17
17
  ```text
18
- 按独立目录安装指南,在这台 Mac 安装 SintBot 1.3.0。保留已有服务、配置、状态和 Codex 账号数据,不输出凭据。验证实际入口与二进制核心,配置一个飞书群使用 Codex,只对全新状态初始化。运行前台预检和已授权的只读群测试,对照结果,再验证正常停止与重启。不要用旧版向导、控制台或安装服务流程。完成后停止临时进程,并区分程序包安装与群验收结果。
18
+ 按一行安装指南,在这台 Mac 安装 SintBot 1.4.1。保留已有服务、配置、状态和 Codex 或 Claude Code 账号数据,不输出凭据。验证实际入口与二进制核心,配置飞书群及各群的执行器,只对全新状态初始化。运行前台预检和已授权的只读群测试,对照结果,再验证正常停止与重启。完成后停止临时进程,并区分程序包安装与群验收结果。
19
19
  ```
@@ -1,93 +1,125 @@
1
- # 安装 SintBot 1.3.0
1
+ # 安装 SintBot 1.4.1
2
2
 
3
3
  [English](../install.md) · 简体中文
4
4
 
5
- 本版支持 macOS、Node.js 22 及以上、一个飞书群和 Codex 消息轮次,以前台方式运行。多群、其他聊天平台或模型通道、控制台、自动后台服务、定时任务、终端聊天和画布不在 1.3.0 支持范围。
5
+ 准备一台 Mac、Node.js 22 及以上,以及保存在本机的项目。执行器至少装好并登录一个:Codex,或 Claude Code。本版连接中国区飞书的 1–32 个群,每个群绑定一个本地项目,以前台方式运行。
6
6
 
7
- ## 1. 准备 Mac
8
-
9
- 在项目所在 Mac 的本地终端操作,确认 Node.js 22 及以上、Codex 可以实际运行且已完成登录。保留已有 Codex 安装和账号数据。SintBot 安装器不安装或登录 Codex,也不安装 Node。
7
+ ## 1. 一行安装
10
8
 
11
9
  ```bash
12
- node --version
13
- codex --version
10
+ curl -fsSL https://sintbot.com/install.sh | bash
14
11
  ```
15
12
 
16
- 如果这台 Mac 已经运行 SintBot,保留原来的程序包与配置。可以把新包装到独立目录,但 **1.3.0 不自动迁移已有状态**。初始化会拒绝已有状态、旧收据或日志;不要删除它们来绕过检查。不要让两个进程连接同一个飞书应用。
17
-
18
- ## 2. 安装到独立目录
13
+ 安装器会自动检查环境,把 `sintbot@1.4.1` 装到 `~/.local/share/sintbot`,并验证程序入口、内置核心和飞书模块。看到 `Installed and verified SintBot 1.4.1` 就可以继续。不需要 sudo。
19
14
 
20
- 下载并检查安装脚本,再执行同一份文件:
15
+ 可选预览:在命令末尾加 `-s -- --dry-run`。要自定义安装位置,设置 `SINTBOT_INSTALL_DIR` 环境变量,并同步修改后面的可执行文件路径。
21
16
 
22
- ```bash
23
- curl -fsSL https://sintbot.com/install.sh -o /tmp/sintbot-install.sh
24
- bash /tmp/sintbot-install.sh --dry-run
25
- bash /tmp/sintbot-install.sh
26
- ```
17
+ ## 2. 连接飞书
27
18
 
28
- 脚本把精确的 **sintbot@1.3.0** 安装到 `~/.local/share/sintbot/releases/1.3.0`,验证实际入口、二进制核心和飞书模块,保留全局安装、终端配置、应用配置和服务。目标目录已存在时拒绝覆盖;可用 `--prefix /全新/绝对/目录` 指定其他位置。`--dry-run` 不修改文件,也不下载程序包。
19
+ 在 [飞书开放平台](https://open.feishu.cn/) 创建企业自建应用,启用机器人、接收和回复消息的权限,事件订阅选择长连接并订阅消息接收。发布应用后,把机器人加入要使用的群,取得每个群的 `oc_…` 群 ID。
29
20
 
30
- 始终使用这一个实际入口,避免误用全局旧版本:
21
+ 在 macOS 默认终端中输入应用凭据(密钥输入时不显示):
31
22
 
32
- ```bash
33
- SINTBOT="$HOME/.local/share/sintbot/releases/1.3.0/bin/sintbot"
34
- "$SINTBOT" --version
35
- "$SINTBOT" help
23
+ ```zsh
24
+ read -r "FEISHU_APP_ID?Feishu App ID: "
25
+ read -rs "FEISHU_APP_SECRET?Feishu App Secret: "
26
+ printf '\n'
27
+ export FEISHU_APP_ID FEISHU_APP_SECRET
36
28
  ```
37
29
 
38
- 版本输出应为 `1.3.0`。装好程序包不会自动启动机器人。
39
-
40
- ## 3. 配置一个飞书群
41
-
42
- 在 `open.feishu.cn` 创建企业自建应用,启用机器人,授予接收与回复消息的权限,事件订阅选择长连接,订阅消息接收事件,发布应用并把机器人加入测试群。从飞书取得该群的 `oc_…` 群 ID。本版使用中国区飞书,不支持国际版 Lark。
30
+ 不要把密钥发进群或提交到仓库。后续步骤都在这个终端里做;新开终端时需要重新设置这两个变量。
43
31
 
44
- 在启动 SintBot 的本地终端中,把应用 ID 和应用密钥分别设为 `FEISHU_APP_ID`、`FEISHU_APP_SECRET` 环境变量。不要把密钥发进聊天或提交到仓库。配置中的环境变量引用在启动时解析;每次新开终端都需要保证这两个变量存在。
32
+ ## 3. 绑定项目
45
33
 
46
- 先用 `mkdir -p ~/.sbot && chmod 700 ~/.sbot` 创建私有配置目录,再创建 `~/.sbot/config-1.3.0.json`,内容如下。把群 ID 和项目路径换成真实值;项目目录必须已存在。只留一个群,两个显式 `false` 不要省略。
34
+ 用 `mkdir -p ~/.sbot && chmod 700 ~/.sbot` 创建私有配置目录,再创建 `~/.sbot/config.json`。把群 ID 和项目绝对路径换成你自己的,项目目录必须已经存在。下面的示例绑定两个群:一个用 Codex,一个用 Claude Code。只有一个群时删掉另一项即可。
47
35
 
48
36
  ```json
49
37
  {
50
38
  "defaultProvider": "codex",
51
- "providers": { "codex": { "runner": "codex" } },
39
+ "providers": {
40
+ "codex": { "runner": "codex" },
41
+ "claude": { "runner": "claude" }
42
+ },
52
43
  "feishu": {
53
44
  "appId": "env:FEISHU_APP_ID",
54
45
  "appSecret": "env:FEISHU_APP_SECRET",
55
46
  "onlyWhenMentioned": false
56
47
  },
57
48
  "groups": {
58
- "oc_REPLACE_WITH_YOUR_CHAT_ID": {
49
+ "oc_REPLACE_WITH_FIRST_CHAT_ID": {
59
50
  "platform": "feishu",
60
51
  "provider": "codex",
61
- "workdir": "/absolute/path/to/your/project",
52
+ "workdir": "/absolute/path/to/first/project",
62
53
  "permissionMode": "dontAsk",
63
- "codexSteer": false,
64
- "codexApp": false
54
+ "codexSteer": true
55
+ },
56
+ "oc_REPLACE_WITH_SECOND_CHAT_ID": {
57
+ "platform": "feishu",
58
+ "provider": "claude",
59
+ "workdir": "/absolute/path/to/second/project",
60
+ "permissionMode": "dontAsk"
65
61
  }
66
62
  }
67
63
  }
68
64
  ```
69
65
 
70
- 限制配置文件权限(`chmod 600 ~/.sbot/config-1.3.0.json`)。示例采用只读权限,接收这一个群里的普通消息,请使用专用测试群。若只接收 @ 机器人的消息,须设 `onlyWhenMentioned: true` 并填入该应用实际的 `botOpenId`;缺少机器人 ID 会在启动前被拒绝。不要从旧示例复制控制台、其他平台、定时任务或画布配置;历史完整配置不代表 1.3.0 支持范围。
66
+ 保存后执行 `chmod 600 ~/.sbot/config.json`。
67
+
68
+ - `permissionMode: "dontAsk"` 是受限权限,适合先在测试群试用。确认需要让它修改文件、执行命令时,改为 `"bypassPermissions"`(完全访问)。
69
+ - 要固定 Claude 型号,可在 `providers.claude` 里加 `"model"`;不写就用这台机器上 Claude Code 的默认模型。
70
+ - 同时运行的任务默认最多 2 个,可在顶层加 `"agent": { "maxConcurrent": 4 }` 调整(1–32)。
71
71
 
72
- ## 4. 初始化并启动
72
+ ## 4. 首次启动
73
73
 
74
- **仅全新安装**执行:
74
+ 在刚才的终端里一次复制执行:
75
75
 
76
76
  ```bash
77
- "$SINTBOT" init --config "$HOME/.sbot/config-1.3.0.json"
78
- "$SINTBOT" start --config "$HOME/.sbot/config-1.3.0.json" --preflight
79
- "$SINTBOT" start --config "$HOME/.sbot/config-1.3.0.json"
77
+ SINTBOT="$HOME/.local/share/sintbot/bin/sintbot"
78
+ "$SINTBOT" init --config "$HOME/.sbot/config.json" &&
79
+ "$SINTBOT" start --config "$HOME/.sbot/config.json" --preflight &&
80
+ "$SINTBOT" start --config "$HOME/.sbot/config.json" --ui
80
81
  ```
81
82
 
82
- `init` 在 `~/.sbot/c2-v2.log` 创建持久收据日志,只运行一次;不会重置已有日志或迁移旧状态。`--preflight` 检查本地配置与装配,不建立飞书连接,也不能代替认证或消息送达验证。`start` 持有单写锁并连接所配群,需要保持终端开启。
83
+ 这组命令依次初始化消息日志、预检配置和执行器、连接飞书并打开本机控制台,任一步失败就停止。**初始化只运行一次**;以后重启不要再执行 `init`。保持终端开启。
84
+
85
+ 在群里发“读取项目 README 的第一行,只回复这一行”,并和本地文件对照。预检通过不代表飞书认证或消息送达已经验证。
86
+
87
+ ## 5. 在群里使用
88
+
89
+ 直接发文字就是给它派任务。回复以卡片呈现,模型开始输出后就会出现并随进度刷新。
83
90
 
84
- 在群里直接发消息,要求读取项目 README 的第一行。把返回结果与文件对照。按 Ctrl-C 并等待退出,再用相同的 `start` 命令启动一次。正常重启不要重新执行 `init`。
91
+ | 命令 | 作用 |
92
+ | --- | --- |
93
+ | `/help` | 查看可用命令 |
94
+ | `/status` | 本群状态:模型、项目、是否在忙、排队数 |
95
+ | `/model` | 查看可选模型;`/model 名字` 切换(只在本群空闲时生效,切换后开始新的一段对话) |
96
+ | `/new` | 开始新的一段对话(只在本群空闲时生效) |
97
+ | `/stop` | 停止当前任务,连同排队的一起取消 |
98
+ | `/hud` | 当前模型的额度与本段对话的用量 |
99
+ | `/issue 一句话` | 记下问题反馈,在控制台概览里查看和标记处理 |
85
100
 
86
- ## 停止、故障和升级
101
+ 任务进行中再发的消息:Codex 群(`codexSteer: true`)会补充进当前任务,Claude Code 群会排队,等这一轮结束再处理。某一轮模型报错或没有结果时,只在本群提示重新发送,不会自动重试。某个群上一轮的结果无法确认时(例如回复是否送达不明),只暂停这个群,它收到新消息会回一句说明,其他群照常;不重放、不重试。
102
+
103
+ ## 6. 控制台
104
+
105
+ 带 `--ui` 启动后,在本机浏览器打开 `http://127.0.0.1:4600`。控制台可以查看各群状态(暂停的群显示「需要处理」)、停止任务、绑定新群、给空闲的群切换模型或项目目录。要从局域网访问,先在控制台的设置里设访问密码,再开启局域网访问。
106
+
107
+ 不用控制台也能加群:在配置里加上新群,停止后重新 `start` 即可,新群会自动登记。已绑定的群不能通过改配置删除或改名。
108
+
109
+ ## 停止与重启
110
+
111
+ 按 Ctrl-C 并等待退出。确认飞书环境变量已设置,再执行:
112
+
113
+ ```bash
114
+ "$HOME/.local/share/sintbot/bin/sintbot" start --config "$HOME/.sbot/config.json" --ui
115
+ ```
116
+
117
+ 某个群一直暂停时,先重启:记录能恢复的群会自己重新开放,并提示一次重新发送。重启后仍暂停,先核对这个群实际发生了什么,再停止服务,封存这个群的事故记录:
118
+
119
+ ```bash
120
+ "$HOME/.local/share/sintbot/bin/sintbot" incident seal --config "$HOME/.sbot/config.json" --group oc_暂停的群ID
121
+ ```
87
122
 
88
- - 按 Ctrl-C 并等待退出;本版不提供登录自启或安装后台服务命令。
89
- - 任务失败或启动提示未结收据时,保留日志与状态,核对实际结果后再处置。不要清空未知效果、覆盖日志或盲目重发相同任务。
90
- - 安装器保留旧程序包,但切版本仍须排空旧进程、备份配置与状态、确认收据兼容。只有旧可执行文件不等于可以安全回退状态。
91
- - 已有多群安装继续用原版本,替换为单群路径前必须有经过核对的迁移方案。
123
+ 封存会把原日志原样留在数据目录的 `incidents/` 下,并给这个群换一份新日志;封存前没处理完的消息不会再处理。再次启动服务,这个群就重新开放。有群会保持暂停时,预检会失败。不要通过删除日志或重复发送来绕过暂停。一个飞书应用同一时间只运行一个连接进程。本版不自动注册后台服务。
92
124
 
93
- 由助手操作时可用 [AI 辅助安装指南](./AI-ASSISTED-INSTALL.md)。
125
+ [带图示的官网指南](https://sintbot.com/zh/guide/install/) · [AI 辅助安装](./AI-ASSISTED-INSTALL.md)
package/install.sh CHANGED
@@ -1,84 +1,37 @@
1
1
  #!/usr/bin/env bash
2
- # SintBot 1.3.0: isolated macOS package install. Does not change services/config.
3
- set -u
4
- VERSION=1.3.0
5
- PREFIX="${HOME}/.local/share/sintbot/releases/${VERSION}"
6
- PACKAGE="sintbot@${VERSION}"
7
- DRY=0
8
- STAGE=''
9
- LOCK=''
10
- fail() { printf '%s\n' "SintBot: $*" >&2; exit 1; }
11
- cleanup() {
12
- if [ -n "$STAGE" ] && [ -d "$STAGE" ]; then rm -rf -- "$STAGE"; fi
13
- if [ -n "$LOCK" ] && [ -d "$LOCK" ]; then rmdir -- "$LOCK" 2>/dev/null || true; fi
14
- }
15
- trap cleanup EXIT
16
- trap 'exit 130' INT
17
- trap 'exit 143' TERM
18
- while [ "$#" -gt 0 ]; do
19
- case "$1" in
20
- --dry-run) DRY=1; shift ;;
21
- --prefix|--package)
22
- [ "$#" -ge 2 ] || fail "$1 needs a value"
23
- if [ "$1" = --prefix ]; then PREFIX="$2"; else PACKAGE="$2"; fi
24
- shift 2 ;;
25
- --help|-h)
26
- printf '%s\n' 'SintBot 1.3.0 — macOS / one Feishu group / Codex' \
27
- 'Usage: bash install.sh [--dry-run] [--prefix /new/absolute/directory]' \
28
- ' [--package /absolute/sintbot-1.3.0.tgz]' \
29
- 'Installs to a new private prefix. Does not replace an existing global install,' \
30
- 'change configuration, authenticate Codex, start a bot or install a service.'
31
- exit 0 ;;
32
- *) fail "Unknown argument: $1" ;;
2
+ # The function is parsed in full before installation starts, including when piped.
3
+ sintbot_install() (
4
+ set -eu
5
+ version=1.4.1
6
+ prefix="${SINTBOT_INSTALL_DIR:-$HOME/.local/share/sintbot}"
7
+ fail() { printf 'SintBot: %s\n' "$*" >&2; exit 1; }
8
+ case "${1:-}" in
9
+ '') [ "$#" -eq 0 ] || fail 'Unexpected arguments.' ;;
10
+ --dry-run) [ "$#" -eq 1 ] || fail 'Unexpected arguments.' ;;
11
+ *) fail 'Usage: bash install.sh [--dry-run]' ;;
33
12
  esac
34
- done
35
- [ "$(uname -s)" = Darwin ] || fail 'This release supports macOS only.'
36
- command -v node >/dev/null 2>&1 || fail 'Install Node.js 22 or newer, then run this installer again.'
37
- command -v npm >/dev/null 2>&1 || fail 'npm is required.'
38
- node -e 'if (Number(process.versions.node.split(".")[0]) < 22) process.exit(1)' || fail 'Node.js 22 or newer is required.'
39
- case "$PREFIX" in /*) ;; *) fail '--prefix must be an absolute path.' ;; esac
40
- PREFIX="$(node -e 'process.stdout.write(require("node:path").resolve(process.argv[1]))' "$PREFIX")" || fail 'Invalid prefix.'
41
- [ "$PREFIX" != / ] || fail 'The filesystem root is not an installation prefix.'
42
- [ ! -e "$PREFIX" ] && [ ! -L "$PREFIX" ] || fail 'The target already exists; use a new prefix. Existing installations are never overwritten.'
43
- if [ "$PACKAGE" != "sintbot@${VERSION}" ]; then
44
- case "$PACKAGE" in /*.tgz) ;; *) fail '--package must name an absolute local .tgz file.' ;; esac
45
- [ -f "$PACKAGE" ] || fail 'The local package does not exist.'
46
- fi
47
- printf '%s\n' "SintBot ${VERSION}: isolated install into ${PREFIX}" 'Scope: macOS, one Feishu group, Codex messages; foreground operation.'
48
- if [ "$DRY" = 1 ]; then
49
- printf '%s\n' "Would install ${PACKAGE}, verify version/binary/platform loading, then show setup instructions." 'Preview complete. No changes were made.'
50
- exit 0
51
- fi
52
- PARENT="$(dirname "$PREFIX")"
53
- mkdir -p -- "$PARENT" || fail 'Cannot create the installation parent.'
54
- LOCK="${PREFIX}.install-lock"
55
- if ! mkdir -- "$LOCK" 2>/dev/null; then LOCK=''; fail 'Another install or a stale install lock exists; inspect it before retrying.'; fi
56
- [ ! -e "$PREFIX" ] && [ ! -L "$PREFIX" ] || fail 'The target appeared during installation; refusing to overwrite it.'
57
- STAGE="$(mktemp -d "${PARENT}/.sintbot-${VERSION}.XXXXXX")" || fail 'Cannot create staging directory.'
58
- if ! npm install --registry=https://registry.npmjs.org --global --prefix "$STAGE" --omit=dev --ignore-scripts --no-audit --no-fund "$PACKAGE"; then
59
- fail 'Package installation failed; the previous installation was not changed.'
60
- fi
61
- if ! node - "$STAGE/lib/node_modules/sintbot" "$VERSION" <<'NODE'
62
- const path = require('node:path')
63
- const root = process.argv[2]
64
- const pkg = require(path.join(root, 'package.json'))
65
- if (pkg.name !== 'sintbot' || pkg.version !== process.argv[3]) throw new Error('Package version mismatch')
66
- if (pkg.bin?.sintbot !== 'bin/sintbot-v2.js') throw new Error('Package does not use the supported 1.3.0 entry')
67
- require(path.join(root, 'src/agent/privatecore.js'))
68
- require(path.join(root, 'src/platform/feishu.js'))
13
+ [ "$(uname -s)" = Darwin ] || fail 'macOS is required.'
14
+ command -v node >/dev/null 2>&1 || fail 'Install Node.js 22 or newer first.'
15
+ command -v npm >/dev/null 2>&1 || fail 'npm is required.'
16
+ node -e 'if (+process.versions.node.split(".")[0] < 22) process.exit(1)' || fail 'Node.js 22 or newer is required.'
17
+ case "$prefix" in /*) ;; *) fail 'SINTBOT_INSTALL_DIR must be an absolute path.' ;; esac
18
+ [ "$prefix" != / ] || fail 'Choose an installation directory, not the filesystem root.'
19
+ printf 'Installing SintBot %s to %s\n' "$version" "$prefix"
20
+ [ "${1:-}" != --dry-run ] || { printf 'Preview only. No changes made.\n'; exit 0; }
21
+ npm install --registry=https://registry.npmjs.org --global --prefix "$prefix" \
22
+ --omit=dev --ignore-scripts --no-audit --no-fund "sintbot@$version"
23
+ node - "$prefix/lib/node_modules/sintbot" "$version" <<'NODE'
24
+ const path = require('node:path');
25
+ const root = process.argv[2];
26
+ const pkg = require(path.join(root, 'package.json'));
27
+ if (pkg.name !== 'sintbot' || pkg.version !== process.argv[3] || pkg.bin?.sintbot !== 'bin/sintbot-v2.js') {
28
+ throw new Error('Installed package verification failed');
29
+ }
30
+ require(path.join(root, 'src/agent/privatecore.js'));
31
+ require(path.join(root, 'src/platform/feishu.js'));
69
32
  NODE
70
- then fail 'Installed package failed version, entry or runtime verification.'; fi
71
- ACTUAL="$("$STAGE/bin/sintbot" --version)" || fail 'Installed executable did not start.'
72
- [ "$ACTUAL" = "$VERSION" ] || fail 'Installed executable reported an unexpected version.'
73
- [ ! -e "$PREFIX" ] && [ ! -L "$PREFIX" ] || fail 'The target appeared during installation; refusing to overwrite it.'
74
- if ! mv -- "$STAGE" "$PREFIX"; then fail 'Cannot finalize the isolated install.'; fi
75
- STAGE=''
76
- FINAL_VERSION="$("$PREFIX/bin/sintbot" --version)" || fail 'Final executable failed after relocation; inspect the new prefix before retrying.'
77
- [ "$FINAL_VERSION" = "$VERSION" ] || fail 'Final executable version mismatch.'
78
- printf '\n%s\n' "Installed and verified SintBot ${VERSION}. Existing services and configuration were not changed." \
79
- 'Finish the one-group configuration and first run using:' \
80
- 'https://github.com/sintlab/sintbot/blob/v1.3.0/docs/install.md' \
81
- 'Use this exact executable for the new installation:'
82
- printf ' %q\n' "$PREFIX/bin/sintbot"
83
- printf '%s\n' 'An existing multi-group installation must stay on its current version.' \
84
- 'Do not delete old state or receipts to make initialization succeed.'
33
+ [ "$("$prefix/bin/sintbot" --version)" = "$version" ] || fail 'Executable verification failed.'
34
+ printf '\nInstalled and verified SintBot %s.\n' "$version"
35
+ printf 'Connect your project: https://sintbot.com/guide/install/#feishu\n'
36
+ )
37
+ sintbot_install "$@"