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.
- package/CHANGELOG.en.json +50 -0
- package/CHANGELOG.json +50 -0
- package/README.md +138 -20
- package/README.zh-CN.md +144 -20
- package/assets/design-styles/acid-pop.md +155 -0
- package/assets/design-styles/archive-index.md +161 -0
- package/assets/design-styles/art-deco.md +164 -0
- package/assets/design-styles/cinematic-noir.md +178 -0
- package/assets/design-styles/editorial.md +121 -0
- package/assets/design-styles/geometric-pop.md +122 -0
- package/assets/design-styles/hand-drawn.md +117 -0
- package/assets/design-styles/islamic-geometry.md +155 -0
- package/assets/design-styles/liquid-glass.md +183 -0
- package/assets/design-styles/neo-chinese.md +136 -0
- package/assets/design-styles/precision-mono.md +156 -0
- package/assets/design-styles/quiet-luxury.md +163 -0
- package/assets/design-styles/riso-print.md +116 -0
- package/assets/design-styles/soft-friendly.md +174 -0
- package/assets/design-styles/swiss-grid.md +156 -0
- package/assets/design-styles/tech-dark.md +182 -0
- package/bin/sintbot-v2.js +291 -263
- package/docs/AI-ASSISTED-INSTALL.md +8 -8
- package/docs/install.md +80 -48
- package/docs/zh-CN/AI-ASSISTED-INSTALL.md +8 -8
- package/docs/zh-CN/install.md +80 -48
- package/install.sh +34 -81
- package/package.json +60 -5
- package/src/agent/claudecode.js +32 -3
- package/src/agent/claudemodels.js +60 -0
- package/src/agent/claudestatus.js +74 -0
- package/src/agent/claudeusage.js +200 -0
- package/src/agent/codexapp.js +21 -4
- package/src/agent/codexcode.js +8 -3
- package/src/agent/codexstatus.js +181 -0
- package/src/agent/privatecore.js +1 -1
- package/src/agent/privatecore.wasm +0 -0
- package/src/c2configcontrol.js +214 -0
- package/src/c2console.js +149 -0
- package/src/c2incident.js +125 -0
- package/src/c2install.js +247 -37
- package/src/c2migration.js +100 -0
- package/src/c2multigroupcapacity.js +103 -0
- package/src/c2multigroupservice.js +418 -0
- package/src/cdp.js +254 -0
- package/src/config.js +13 -2
- package/src/core/c2durablejournal.js +26 -9
- package/src/core/c2durableruntime.js +104 -1
- package/src/core/c2inputrejection.js +45 -0
- package/src/core/c2localeffectexecutor.js +12 -1
- package/src/core/c2payloadhandles.js +11 -0
- package/src/core/c2persistrelation.js +20 -0
- package/src/core/c2persiststate.js +28 -2
- package/src/core/c2platformrecoverysender.js +1 -1
- package/src/core/c2sourcequarantine.js +56 -1
- package/src/core/c2terminalprune.js +2 -1
- package/src/core/engineslotsadapter.js +108 -0
- package/src/core/issues.js +185 -0
- package/src/core/ledger.js +30 -0
- package/src/core/proxy.js +424 -0
- package/src/core/store.js +12 -0
- package/src/core/v2engine.js +427 -31
- package/src/design.js +5161 -0
- package/src/gitrepo.js +150 -0
- package/src/leftover.js +174 -0
- package/src/platform/slack.js +1294 -0
- package/src/platform/wecom.js +961 -0
- package/src/platform/wecomcli.js +128 -0
- package/src/platform/wecomname.js +43 -0
- package/src/platform/wecompoll.js +241 -0
- package/src/preview.js +581 -0
- package/src/projectmemory.js +175 -0
- package/src/ui/auth.js +31 -0
- package/src/ui/browser.html +392 -0
- package/src/ui/browserroutes.js +234 -0
- package/src/ui/console.html +5719 -0
- package/src/ui/dashboard.js +168 -0
- package/src/ui/feishulogin.js +136 -0
- package/src/ui/serverbase.js +2371 -0
- package/src/ui/sessions.js +78 -0
- package/src/ui/takeover.js +108 -0
- package/src/usage.js +144 -0
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
# Install SintBot 1.
|
|
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
|
|
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
|
|
8
|
-
2.
|
|
9
|
-
3.
|
|
10
|
-
4. Prepare the
|
|
11
|
-
5. For fresh state only, run `init`, then `start --preflight`. Refusal due to
|
|
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.
|
|
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.
|
|
1
|
+
# Install SintBot 1.4.1
|
|
2
2
|
|
|
3
3
|
English · [简体中文](./zh-CN/install.md)
|
|
4
4
|
|
|
5
|
-
|
|
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.
|
|
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
|
-
|
|
13
|
-
codex --version
|
|
10
|
+
curl -fsSL https://sintbot.com/install.sh | bash
|
|
14
11
|
```
|
|
15
12
|
|
|
16
|
-
|
|
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
|
-
|
|
15
|
+
To preview, append `-s -- --dry-run`. To choose another location, set `SINTBOT_INSTALL_DIR` and adjust the executable paths below.
|
|
21
16
|
|
|
22
|
-
|
|
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
|
-
|
|
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
|
-
|
|
21
|
+
Enter the app credentials in the default macOS terminal (the secret is not echoed):
|
|
31
22
|
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
|
|
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
|
-
|
|
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
|
-
|
|
32
|
+
## 3. Bind projects
|
|
45
33
|
|
|
46
|
-
Create
|
|
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": {
|
|
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
|
-
"
|
|
49
|
+
"oc_REPLACE_WITH_FIRST_CHAT_ID": {
|
|
59
50
|
"platform": "feishu",
|
|
60
51
|
"provider": "codex",
|
|
61
|
-
"workdir": "/absolute/path/to/
|
|
52
|
+
"workdir": "/absolute/path/to/first/project",
|
|
62
53
|
"permissionMode": "dontAsk",
|
|
63
|
-
"codexSteer":
|
|
64
|
-
|
|
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
|
-
|
|
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.
|
|
72
|
+
## 4. First start
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
Copy and run in the same terminal:
|
|
75
75
|
|
|
76
76
|
```bash
|
|
77
|
-
|
|
78
|
-
"$SINTBOT"
|
|
79
|
-
"$SINTBOT" start --config "$HOME/.sbot/config
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
125
|
+
[Illustrated website guide](https://sintbot.com/guide/install/) · [AI-assisted installation](./AI-ASSISTED-INSTALL.md)
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
# 用 AI 助手安装 SintBot 1.
|
|
1
|
+
# 用 AI 助手安装 SintBot 1.4.1
|
|
2
2
|
|
|
3
3
|
[English](../AI-ASSISTED-INSTALL.md) · 简体中文
|
|
4
4
|
|
|
5
|
-
使用实际运行 SintBot 的 Mac 本地终端;云端终端不能替用户的 Mac 安装。按[安装指南](./install.md)
|
|
5
|
+
使用实际运行 SintBot 的 Mac 本地终端;云端终端不能替用户的 Mac 安装。按[安装指南](./install.md)操作,本版支持 1–32 个飞书群、每群选用 Codex 或 Claude Code,以前台方式运行。
|
|
6
6
|
|
|
7
|
-
1. 核对 macOS、Node 22 及以上、Codex
|
|
8
|
-
2.
|
|
9
|
-
3.
|
|
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
|
-
|
|
18
|
+
按一行安装指南,在这台 Mac 安装 SintBot 1.4.1。保留已有服务、配置、状态和 Codex 或 Claude Code 账号数据,不输出凭据。验证实际入口与二进制核心,配置飞书群及各群的执行器,只对全新状态初始化。运行前台预检和已授权的只读群测试,对照结果,再验证正常停止与重启。完成后停止临时进程,并区分程序包安装与群验收结果。
|
|
19
19
|
```
|
package/docs/zh-CN/install.md
CHANGED
|
@@ -1,93 +1,125 @@
|
|
|
1
|
-
# 安装 SintBot 1.
|
|
1
|
+
# 安装 SintBot 1.4.1
|
|
2
2
|
|
|
3
3
|
[English](../install.md) · 简体中文
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
准备一台 Mac、Node.js 22 及以上,以及保存在本机的项目。执行器至少装好并登录一个:Codex,或 Claude Code。本版连接中国区飞书的 1–32 个群,每个群绑定一个本地项目,以前台方式运行。
|
|
6
6
|
|
|
7
|
-
## 1.
|
|
8
|
-
|
|
9
|
-
在项目所在 Mac 的本地终端操作,确认 Node.js 22 及以上、Codex 可以实际运行且已完成登录。保留已有 Codex 安装和账号数据。SintBot 安装器不安装或登录 Codex,也不安装 Node。
|
|
7
|
+
## 1. 一行安装
|
|
10
8
|
|
|
11
9
|
```bash
|
|
12
|
-
|
|
13
|
-
codex --version
|
|
10
|
+
curl -fsSL https://sintbot.com/install.sh | bash
|
|
14
11
|
```
|
|
15
12
|
|
|
16
|
-
|
|
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
|
-
|
|
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
|
-
|
|
19
|
+
在 [飞书开放平台](https://open.feishu.cn/) 创建企业自建应用,启用机器人、接收和回复消息的权限,事件订阅选择长连接并订阅消息接收。发布应用后,把机器人加入要使用的群,取得每个群的 `oc_…` 群 ID。
|
|
29
20
|
|
|
30
|
-
|
|
21
|
+
在 macOS 默认终端中输入应用凭据(密钥输入时不显示):
|
|
31
22
|
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
## 3. 配置一个飞书群
|
|
41
|
-
|
|
42
|
-
在 `open.feishu.cn` 创建企业自建应用,启用机器人,授予接收与回复消息的权限,事件订阅选择长连接,订阅消息接收事件,发布应用并把机器人加入测试群。从飞书取得该群的 `oc_…` 群 ID。本版使用中国区飞书,不支持国际版 Lark。
|
|
30
|
+
不要把密钥发进群或提交到仓库。后续步骤都在这个终端里做;新开终端时需要重新设置这两个变量。
|
|
43
31
|
|
|
44
|
-
|
|
32
|
+
## 3. 绑定项目
|
|
45
33
|
|
|
46
|
-
|
|
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": {
|
|
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
|
-
"
|
|
49
|
+
"oc_REPLACE_WITH_FIRST_CHAT_ID": {
|
|
59
50
|
"platform": "feishu",
|
|
60
51
|
"provider": "codex",
|
|
61
|
-
"workdir": "/absolute/path/to/
|
|
52
|
+
"workdir": "/absolute/path/to/first/project",
|
|
62
53
|
"permissionMode": "dontAsk",
|
|
63
|
-
"codexSteer":
|
|
64
|
-
|
|
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
|
-
|
|
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
|
-
|
|
78
|
-
"$SINTBOT"
|
|
79
|
-
"$SINTBOT" start --config "$HOME/.sbot/config
|
|
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
|
|
83
|
+
这组命令依次初始化消息日志、预检配置和执行器、连接飞书并打开本机控制台,任一步失败就停止。**初始化只运行一次**;以后重启不要再执行 `init`。保持终端开启。
|
|
84
|
+
|
|
85
|
+
在群里发“读取项目 README 的第一行,只回复这一行”,并和本地文件对照。预检通过不代表飞书认证或消息送达已经验证。
|
|
86
|
+
|
|
87
|
+
## 5. 在群里使用
|
|
88
|
+
|
|
89
|
+
直接发文字就是给它派任务。回复以卡片呈现,模型开始输出后就会出现并随进度刷新。
|
|
83
90
|
|
|
84
|
-
|
|
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
|
-
|
|
89
|
-
- 任务失败或启动提示未结收据时,保留日志与状态,核对实际结果后再处置。不要清空未知效果、覆盖日志或盲目重发相同任务。
|
|
90
|
-
- 安装器保留旧程序包,但切版本仍须排空旧进程、备份配置与状态、确认收据兼容。只有旧可执行文件不等于可以安全回退状态。
|
|
91
|
-
- 已有多群安装继续用原版本,替换为单群路径前必须有经过核对的迁移方案。
|
|
123
|
+
封存会把原日志原样留在数据目录的 `incidents/` 下,并给这个群换一份新日志;封存前没处理完的消息不会再处理。再次启动服务,这个群就重新开放。有群会保持暂停时,预检会失败。不要通过删除日志或重复发送来绕过暂停。一个飞书应用同一时间只运行一个连接进程。本版不自动注册后台服务。
|
|
92
124
|
|
|
93
|
-
|
|
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
|
-
#
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
command -v
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
[ "$
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
if
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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 "$@"
|