sintbot 1.0.16 → 1.3.0

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 (137) hide show
  1. package/CHANGELOG.en.json +99 -0
  2. package/CHANGELOG.json +99 -0
  3. package/README.md +20 -158
  4. package/README.zh-CN.md +20 -166
  5. package/THIRD-PARTY-NOTICES.md +394 -0
  6. package/bin/sintbot-v2.js +363 -0
  7. package/docs/AI-ASSISTED-INSTALL.md +11 -35
  8. package/docs/install.md +61 -167
  9. package/docs/zh-CN/AI-ASSISTED-INSTALL.md +11 -35
  10. package/docs/zh-CN/install.md +61 -165
  11. package/install.sh +84 -0
  12. package/package.json +73 -37
  13. package/src/agent/claudecode.js +149 -108
  14. package/src/agent/codexapp.js +458 -0
  15. package/src/agent/codexcode.js +210 -107
  16. package/src/agent/errtag.js +34 -0
  17. package/src/agent/privatecore.js +790 -0
  18. package/src/agent/privatecore.wasm +0 -0
  19. package/src/agent/runner.js +10 -8
  20. package/src/agent/winexec.js +35 -5
  21. package/src/c2install.js +117 -0
  22. package/src/config.js +2 -1
  23. package/src/core/c2cardeffectbridge.js +51 -0
  24. package/src/core/c2cardterminalpath.js +216 -0
  25. package/src/core/c2durableingress.js +148 -0
  26. package/src/core/c2durablejournal.js +1560 -0
  27. package/src/core/c2durableruntime.js +2361 -0
  28. package/src/core/c2eventidentity.js +90 -0
  29. package/src/core/c2globalfault.js +401 -0
  30. package/src/core/c2localeffectexecutor.js +193 -0
  31. package/src/core/c2payloadhandles.js +333 -0
  32. package/src/core/c2persistrelation.js +179 -0
  33. package/src/core/c2persiststate.js +342 -0
  34. package/src/core/c2platformrecoverysender.js +76 -0
  35. package/src/core/c2recoverygate.js +385 -0
  36. package/src/core/c2runnerinput.js +63 -0
  37. package/src/core/c2servicestartgate.js +103 -0
  38. package/src/core/c2sessionbridge.js +72 -0
  39. package/src/core/c2sourcequarantine.js +30 -0
  40. package/src/core/c2startuprecovery.js +105 -0
  41. package/src/core/c2successorbridge.js +151 -0
  42. package/src/core/c2terminaleffectbridge.js +154 -0
  43. package/src/core/c2terminalprune.js +108 -0
  44. package/src/core/c2turnprojection.js +177 -0
  45. package/src/core/enginecheckpoint.js +211 -0
  46. package/src/core/engineeffectcursor.js +394 -0
  47. package/src/core/enginestepcoordinator.js +183 -0
  48. package/src/core/store.js +52 -8
  49. package/src/core/v2engine.js +1469 -0
  50. package/src/platform/feishu.js +324 -67
  51. package/src/plugins.js +1 -9
  52. package/assets/design-styles/acid-pop.md +0 -155
  53. package/assets/design-styles/archive-index.md +0 -161
  54. package/assets/design-styles/art-deco.md +0 -164
  55. package/assets/design-styles/cinematic-noir.md +0 -178
  56. package/assets/design-styles/editorial.md +0 -121
  57. package/assets/design-styles/extra/README.md +0 -23
  58. package/assets/design-styles/extra/constructivism.md +0 -146
  59. package/assets/design-styles/extra/neo-brutalism.md +0 -175
  60. package/assets/design-styles/extra/new-wave.md +0 -166
  61. package/assets/design-styles/extra/nordic-material.md +0 -162
  62. package/assets/design-styles/extra/paris-couture.md +0 -162
  63. package/assets/design-styles/extra/tropical-modern.md +0 -168
  64. package/assets/design-styles/extra/ulm-functional.md +0 -182
  65. package/assets/design-styles/extra/wa-shikimen.md +0 -160
  66. package/assets/design-styles/extra/y2k-chrome.md +0 -172
  67. package/assets/design-styles/geometric-pop.md +0 -122
  68. package/assets/design-styles/hand-drawn.md +0 -117
  69. package/assets/design-styles/islamic-geometry.md +0 -155
  70. package/assets/design-styles/liquid-glass.md +0 -183
  71. package/assets/design-styles/neo-chinese.md +0 -136
  72. package/assets/design-styles/precision-mono.md +0 -156
  73. package/assets/design-styles/quiet-luxury.md +0 -163
  74. package/assets/design-styles/riso-print.md +0 -116
  75. package/assets/design-styles/soft-friendly.md +0 -174
  76. package/assets/design-styles/swiss-grid.md +0 -156
  77. package/assets/design-styles/tech-dark.md +0 -182
  78. package/assets/favicon.svg +0 -6
  79. package/assets/logo.svg +0 -24
  80. package/bin/sbot.js +0 -4716
  81. package/docs/slack-app-manifest.yaml +0 -104
  82. package/sbot.config.example.json +0 -235
  83. package/src/agent/askonce.js +0 -76
  84. package/src/agent/claudemodels.js +0 -60
  85. package/src/agent/claudestatus.js +0 -74
  86. package/src/agent/claudeusage.js +0 -200
  87. package/src/agent/codexstatus.js +0 -181
  88. package/src/agent/imagen.js +0 -458
  89. package/src/agent/quotaerr.js +0 -44
  90. package/src/agent/transienterr.js +0 -32
  91. package/src/cdp.js +0 -254
  92. package/src/cli-secret.js +0 -36
  93. package/src/clilang.js +0 -31
  94. package/src/core/cron.js +0 -182
  95. package/src/core/cronfire.js +0 -120
  96. package/src/core/cronrun.js +0 -116
  97. package/src/core/engine.js +0 -2758
  98. package/src/core/interfaces.js +0 -114
  99. package/src/core/issues.js +0 -185
  100. package/src/core/ledger.js +0 -30
  101. package/src/core/opsalert.js +0 -214
  102. package/src/core/pending.js +0 -123
  103. package/src/core/proxy.js +0 -424
  104. package/src/core/quotaalert.js +0 -79
  105. package/src/core/quotaerr.js +0 -55
  106. package/src/core/scheduler.js +0 -59
  107. package/src/design.js +0 -5161
  108. package/src/gitrepo.js +0 -150
  109. package/src/health.js +0 -353
  110. package/src/installdeps.js +0 -72
  111. package/src/leftover.js +0 -174
  112. package/src/platform/boardnotice.js +0 -77
  113. package/src/platform/boardops.js +0 -36
  114. package/src/platform/boardwatch.js +0 -447
  115. package/src/platform/cli.js +0 -45
  116. package/src/platform/slack.js +0 -1289
  117. package/src/platform/takeovercard.js +0 -37
  118. package/src/platform/wecom.js +0 -938
  119. package/src/platform/wecomcli.js +0 -128
  120. package/src/platform/wecomgate.js +0 -108
  121. package/src/platform/wecomname.js +0 -43
  122. package/src/platform/wecompoll.js +0 -241
  123. package/src/preview.js +0 -581
  124. package/src/projectmemory.js +0 -175
  125. package/src/service.js +0 -317
  126. package/src/ui/auth.js +0 -31
  127. package/src/ui/browser.html +0 -392
  128. package/src/ui/browserroutes.js +0 -234
  129. package/src/ui/console.html +0 -5526
  130. package/src/ui/dashboard.js +0 -168
  131. package/src/ui/feishulogin.js +0 -136
  132. package/src/ui/server.js +0 -2314
  133. package/src/ui/sessions.js +0 -78
  134. package/src/ui/takeover.js +0 -108
  135. package/src/updater.js +0 -243
  136. package/src/upgrade.js +0 -35
  137. package/src/usage.js +0 -144
package/docs/install.md CHANGED
@@ -1,199 +1,93 @@
1
- # Install
1
+ # Install SintBot 1.3.0
2
2
 
3
3
  English · [简体中文](./zh-CN/install.md)
4
4
 
5
- The [one-line install](#one-line-install) is the easiest path for new users. A manual install takes three steps: install the package, run `sintbot setup`, then run `sintbot service install`. If an AI assistant will install and configure it, follow the [AI-assisted install and first-use guide](./AI-ASSISTED-INSTALL.md) to keep the flow on the target machine and credentials out of chat. The sections below add platform-specific details.
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.
6
6
 
7
- The package installs two equivalent commands, `sintbot` and `sbot`.
7
+ ## 1. Prepare the Mac
8
8
 
9
- ## One-line install
10
-
11
- On macOS and Linux (Linux support is experimental):
12
-
13
- ```bash
14
- curl -fsSL https://sintbot.com/install.sh | bash
15
- ```
16
-
17
- The script runs four numbered steps and skips work that is already done. It prompts before a Homebrew Node install or upgrade and before installing the background service (Enter accepts the default); installing or upgrading SintBot is part of the requested install. During model setup, a missing required Claude Code CLI is installed automatically. The terminal only installs SintBot and sets up a model: it does not ask where you are or for a proxy, a projects folder or chat platform credentials. You set those in the console afterwards.
18
-
19
- 1. **Environment: Node.js 22+.** In an interactive install, the script asks first. It can install or upgrade Node with Homebrew on a Mac that has Homebrew; otherwise (no Homebrew, or Linux), it prints the [nodejs.org](https://nodejs.org) download link and stops. Without an interactive terminal, a real install stops instead of installing or upgrading Node automatically.
20
- **npm registry.** If you have configured a registry, the script uses it. If you are on the official registry, it first tests the connection. If the official registry is unreachable (common in mainland China), it uses the `registry.npmmirror.com` mirror for this run.
21
- 2. **Install sintbot.** It runs `npm i -g sintbot`. If the latest version is already installed, it says so and moves on; an older version is upgraded. If the global npm directory is not writable, it does not fall back to `sudo`; it prints the commands that move the global directory into your home folder.
22
- 3. **Model**, `sintbot setup`. The wizard installs Claude Code if it is missing (see the next section), then sets up a model with a live trial turn. See [section 2](#2-configure-sintbot-setup).
23
- 4. **Background service.** It asks whether to run `sintbot service install`, which starts SintBot at login and restarts it on crash. The console then stays up at `http://127.0.0.1:4600`, even before a chat platform is connected, and the script opens it in your browser (not over SSH). If the service is already running and nothing was upgraded, the step is skipped; after an upgrade it asks whether to restart the service, which announces the upgrade in connected groups.
24
-
25
- The script ends with the console address and what to do next: connect Slack, Feishu or WeCom under Settings, bind a group under Groups, then @mention the bot in that group. `sintbot chat` lets you try it in the terminal first.
26
-
27
- - To preview the script without installing or changing the system or answering prompts, run `curl -fsSL https://sintbot.com/install.sh | bash -s -- --dry-run`. When npm is available, it checks registry reachability and the latest version; it also reads service status and warns that setup may install the required CLI and send a billable trial request. The script source is [install.sh](../install.sh) at the root of the repository.
28
- - Without an interactive terminal (for example in CI), a real install stops if Node 22+ is missing. If Node is already available, it may install only the package; the wizard and service steps are skipped and setup is reported as incomplete. A non-interactive `--dry-run` can still preview the plan.
29
- - The script and the wizard print Chinese if your locale is Chinese (`LANG` starting with `zh`) or, on macOS, the system language is Chinese; otherwise English. Set `SINTBOT_LANG=en` or `SINTBOT_LANG=zh` to choose, for example `curl -fsSL https://sintbot.com/install.sh | SINTBOT_LANG=en bash`.
30
- - The one-line install does not support Windows; follow the manual steps below.
31
-
32
- ## Claude Code: install and sign in
33
-
34
- SintBot runs every turn through the `claude` CLI on this machine (Codex groups use `codex`), so Claude Code must be installed. This is true even if you only use DeepSeek or another API-key model: Claude Code is the agent framework, and in that case it needs no login.
35
-
36
- **Install it** in any of these ways:
37
-
38
- - **Let the wizard do it.** If `sintbot setup` finds no Claude Code, it installs it when run in a terminal. It runs the npm command below and switches to the mirror when the official registry is unreachable.
39
- - **npm:** `npm i -g @anthropic-ai/claude-code`. If the official registry is unreachable, add `--registry https://registry.npmmirror.com`.
40
- - **The official installer:** see the [Claude Code setup guide](https://code.claude.com/docs/en/setup).
41
-
42
- When `claude --version` prints a version, you are done. Upgrade with `claude update` (or `npm i -g @anthropic-ai/claude-code@latest` for an npm install).
43
-
44
- **Authenticate** according to the model you plan to use:
45
-
46
- | Model | What to do |
47
- |---|---|
48
- | DeepSeek, Zhipu GLM, MiniMax, Volcano Ark and other API-key models | **No login.** Paste the key in the wizard; see [models.md](./models.md#use-deepseek-or-another-api-key-model-in-three-steps) |
49
- | Claude, on a subscription (Pro / Max) | Run `claude auth login` and sign in in the browser that opens. `claude auth status` shows whether you are signed in |
50
- | Claude, on an Anthropic API key (pay as you go) | Run `claude auth login --console`, or put `ANTHROPIC_API_KEY` in the daemon's environment |
51
-
52
- - **Headless machines** (such as a Mac mini used as a server): use Screen Sharing (`vnc://<machine-ip>`) to reach the desktop and run `claude auth login` once. The login is saved to disk, so the daemon keeps working unattended.
53
- - For the terms-of-service question around serving a group from a personal subscription, see [Security in the README](../README.md#security).
54
- - **To verify:** run `claude --version`, then `claude auth status` (subscription only), then `sintbot agent run "introduce yourself in one sentence"`, a read-only trial turn in the terminal.
55
-
56
- ## Requirements
57
-
58
- | Requirement | Check | Notes |
59
- |---|---|---|
60
- | Node.js ≥ 22 | `node -v` | The current LTS is fine. The browser takeover page needs Node's built-in WebSocket |
61
- | Claude Code | `claude --version` | `sintbot setup` can install it for you; see the previous section. With API-key models only, it can stay signed out |
62
- | Codex CLI (optional) | `codex --version` | Needed only with a ChatGPT account, for GPT groups and image generation. Run `npm i -g @openai/codex`, then `codex login` (browser OAuth, needs a desktop) |
63
- | Design icon libraries (optional) | `sintbot doctor` (the `design.icons` row) | Lucide, Tabler, Phosphor and Pixelarticons, about 170 MB in all. The agent takes icons from them by name when it draws a design; without them it draws its own, which may not match the design |
64
-
65
- The first step of `sintbot setup` checks all of these. If Claude Code is missing, it installs it. Codex and the design icon libraries are optional; if they are missing, the wizard prints the install command and moves on. The login status of Claude and Codex is shown in the model step.
66
-
67
- ## 1. Install the package
68
-
69
- ```bash
70
- npm i -g sintbot
71
- sintbot version
72
- ```
73
-
74
- The package is **`sintbot`**. The `sbot` package on npm belongs to someone else, so do not install that one by mistake.
75
-
76
- > ⚠ If the machine has both a Homebrew node and an nvm node, `npm i -g` installs into **the one your current shell uses**. The service uses whichever node was active when you ran `sintbot service install`, because that path is written into the service. When the two differ, you get "I upgraded but the old version is still running". Run `sintbot service install --dry-run` to see which node the service uses.
77
-
78
- To run from source:
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.
79
10
 
80
11
  ```bash
81
- git clone https://github.com/sintlab/sintbot.git && cd sintbot
82
- npm install
83
- npm link # optional: link the sintbot / sbot commands globally
12
+ node --version
13
+ codex --version
84
14
  ```
85
15
 
86
- ## 2. Configure: `sintbot setup`
87
-
88
- This is an interactive wizard; Enter accepts the default (the value in brackets, or the capital letter in `(Y/n)`). It only covers what SintBot needs to run on this machine:
89
-
90
- 1. **Environment.** Claude Code (installed if missing), Codex and the design icon libraries (optional; the install command is printed). See [Requirements](#requirements).
91
- 2. **Model.** The wizard first shows the login status of Claude and ChatGPT (Codex), plus any models whose keys are already set, then recommends in this order:
92
- - If Claude is signed in, the default is Claude; otherwise, if Codex is signed in, the default is Codex. Nothing more is asked; add other models in the console under Models.
93
- - If neither is signed in, it **recommends DeepSeek**: it tells you to get a key at platform.deepseek.com and **runs a trial turn** as soon as you paste it. You can also pick another provider (Zhipu GLM, MiniMax, Volcano Ark), sign in to Claude or Codex in another terminal and come back to re-check, or skip for now.
94
- - Zhipu GLM and MiniMax have international sites (Z.ai and minimax.io), and a key only works on the site that issued it. The wizard tries one site and, if the key is rejected, tries the other one automatically. Without Claude Code it cannot run a trial, so it asks which site issued the key.
95
- - If the trial turn fails, the wizard tells you why: a wrong key, an empty balance or missing identity verification, a network problem (is a global proxy on?), or a wrong model name. You can paste the key again and retry.
96
- - The wizard picks the default model itself (a signed-in subscription first, then a model whose trial passed, then one with a key) and runs a trial turn if it has not had one yet. Groups can switch any time with `/model`.
97
- - If Codex is not installed or not signed in, the Codex preset and the automatic fallback to Codex are left out of the config. Kimi is not a preset; add it in the console under Models → Add model → Custom. See [models.md](./models.md).
98
-
99
- The config is written to `~/.sbot/config.json` with permissions 600. If the current directory already has a `sbot.config.json`, that file is updated instead. Running `sintbot setup` again only fills in what is missing and leaves existing values alone.
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.
100
17
 
101
- The wizard ends with a short health check that lists only failures; `sintbot doctor` shows the full list.
18
+ ## 2. Install into a separate directory
102
19
 
103
- **Everything else is in the console** (`sintbot ui`, or `http://127.0.0.1:4600` once the service runs):
104
-
105
- | What | Where in the console |
106
- |---|---|
107
- | Chat platform credentials (Slack, Feishu, WeCom), precheck, Feishu admins | Settings; each platform has a step-by-step guide. See [platforms/](./platforms/) |
108
- | Binding groups to project folders | Groups |
109
- | Bot name, network proxy | Settings → Bot & network |
110
- | Projects folder | Read-only in the console (it is the fence for what the console may bind). The default is `~/Projects`; to change it, edit `projectsRoots` in the config or run `sintbot setup --full` |
111
-
112
- **`sintbot setup --full`** asks the old full set of questions in the terminal, for servers without a browser: proxy routing, bot name, chat platform credentials with precheck, projects folder and a first group. This part of the wizard is in Chinese only.
113
-
114
- ## 3. Run as a service: `sintbot service install`
20
+ Download and inspect the installer, then run the same file:
115
21
 
116
22
  ```bash
117
- sintbot service install # write and start the service
118
- sintbot service install --ui-host 0.0.0.0 # open the console to the LAN (run sintbot ui --set-password first)
119
- sintbot service status | restart | logs | uninstall
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
120
26
  ```
121
27
 
122
- - **macOS:** writes `~/Library/LaunchAgents/com.sbot.daemon.plist`, a LaunchAgent that starts at login and restarts 15 seconds after a crash.
123
- - **Linux** (experimental: in 1.0 the generated unit is covered by unit tests but has not been installed on a real machine): writes `~/.config/systemd/user/sbot.service`. To start at boot without logging in, also run `loginctl enable-linger $USER`.
124
- - **Logs:** `~/.sbot/logs/err.log`; `sintbot service logs` shows the tail.
125
- - **What the service pins:** the node path, the sintbot entry point, the absolute config path, and the PATH of your current shell (with the directories of `claude` and `codex` first). **After changing node, moving the config or newly installing claude, run `sintbot service install` again.**
126
- - **Node path:** a Homebrew node really lives in a versioned directory that disappears on upgrade, so install switches to an unversioned path to the same program (such as `/opt/homebrew/bin/node`). For nvm, volta and other managers without a stable path, it keeps the original path and reminds you to reinstall the service after changing node versions.
127
- - **Environment variables:** the service does **not** inherit your shell's variables, so install writes the values it needs into the service definition (the file is set to 600, and `--dry-run` masks them): every `"env:NAME"` in the config, and your shell's `https_proxy` and similar variables when the config has no proxy. After changing a key or the proxy, run install again; or put the values directly in the config, which is itself 600 (for the proxy: the console's Settings → Bot & network).
128
- - **Console exposure:** if the console is opened beyond this machine (`--ui-host` set to a non-loopback address) without a password, install refuses; otherwise the service would exit on every start.
129
- - **No chat platform yet:** the service still installs and runs the console only. Connect a platform under Settings and save; the service restarts itself within seconds and connects. (Versions 1.0.10 and 1.0.11 refused to install in this case.)
130
- - **`sintbot ui` while the service runs** opens the service's console instead of failing on the busy port.
131
- - ⚠ **Do not start a second daemon.** Once the service is installed, do not also run `sintbot start` by hand: only one daemon is allowed per OS user (lock file `~/.sbot/daemon.lock`), and a second one reports the running one's pid and exits. If another machine or OS user starts a daemon with **the same bot app**, Feishu and Slack hand each message **to one of the connections at random**, so the other never sees it. WeCom lets the new connection replace the old one, and a connection replaced twice within 10 minutes stops reconnecting.
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.
132
29
 
133
- ### Upgrade
134
-
135
- The console's **Settings → Software updates** checks for stable releases at startup and once daily; you can also check manually. Automatic checks are always on. An administrator must confirm before installation. SintBot waits for every group task and queue to clear, then installs only the exact version just checked. It never escalates privileges: if the global install is not writable or this process is not running from that install, use the terminal instead.
136
-
137
- After verifying the installed version, a managed background service restarts automatically. A foreground process must be restarted manually. You can ignore the detected version and choose whether to announce an upgrade in groups. A failed network check leaves the last successful result intact.
30
+ Keep using the exact executable, so an older global command cannot be selected accidentally:
138
31
 
139
32
  ```bash
140
- npm i -g sintbot@latest && sintbot service restart
33
+ SINTBOT="$HOME/.local/share/sintbot/releases/1.3.0/bin/sintbot"
34
+ "$SINTBOT" --version
35
+ "$SINTBOT" help
141
36
  ```
142
37
 
143
- A restart aborts turns in progress. An aborted turn is redone automatically after the restart, and the group is told. The safest time to restart is when every group is idle on the console's Overview page.
144
-
145
- ## macOS: a Mac mini as a server
146
-
147
- Unattended use needs three things: no sleep, automatic restart after a power cut, and automatic login to the desktop after a reboot.
148
-
149
- ```bash
150
- sudo pmset -a sleep 0 disablesleep 1 autorestart 1 powernap 0
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.
43
+
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.
45
+
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.
47
+
48
+ ```json
49
+ {
50
+ "defaultProvider": "codex",
51
+ "providers": { "codex": { "runner": "codex" } },
52
+ "feishu": {
53
+ "appId": "env:FEISHU_APP_ID",
54
+ "appSecret": "env:FEISHU_APP_SECRET",
55
+ "onlyWhenMentioned": false
56
+ },
57
+ "groups": {
58
+ "oc_REPLACE_WITH_YOUR_CHAT_ID": {
59
+ "platform": "feishu",
60
+ "provider": "codex",
61
+ "workdir": "/absolute/path/to/your/project",
62
+ "permissionMode": "dontAsk",
63
+ "codexSteer": false,
64
+ "codexApp": false
65
+ }
66
+ }
67
+ }
151
68
  ```
152
69
 
153
- Then turn on **automatic login** in System Settings → Users & Groups. A LaunchAgent only starts inside a user session, because it reads the logins in `~/.claude` and `~/.codex` and the keychain; without automatic login, the service does not come back after a reboot.
154
-
155
- `codex login` needs a browser. Do it once over Screen Sharing (`vnc://<machine-ip>`); the credentials are saved to disk and work unattended afterwards.
156
-
157
- ## Windows
158
-
159
- > 1.0 has not been verified on a real Windows machine (CI runs Linux only). The notes below follow the code's behavior; please open an issue if something does not work.
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.
160
71
 
161
- - If `claude` was installed with npm, it is really a `claude.cmd` shim. This is handled automatically; just write `claude` in the config.
162
- - **Service:** on Windows, `sintbot service install` does not install anything. Instead it prints ready-made commands for [NSSM](https://nssm.cc/) and pm2; run them. With NSSM, pass API keys and proxy variables into the service environment with `nssm set SintBot AppEnvironmentExtra …`.
163
- - The default projects folder is `D:\Projects` (or `%USERPROFILE%\Projects` if there is no D: drive).
72
+ ## 4. Initialize and start
164
73
 
165
- ## Proxies (mainland China)
166
-
167
- In mainland China, official Claude, ChatGPT / Codex and Slack need a proxy, while domestic model endpoints, Feishu and WeCom connect directly. Set the proxy in the console under Settings → Bot & network (or with `sintbot setup --full`); the config's `proxy` block is then applied in two places:
168
-
169
- - It is injected into every spawned `claude` / `codex` process, without overriding values already set in your shell.
170
- - The daemon also uses it for its own Slack connection. Node's `fetch` and WebSocket ignore `HTTP_PROXY`, so this is handled separately.
171
-
172
- **Domestic model endpoints should connect directly.** Routing DeepSeek, Zhipu, MiniMax or Volcano Ark through a server abroad and back is slow and can trip the provider's risk controls. When the proxy is set in the console or by setup, `noProxy` is generated from the providers you enabled. If you set the proxy in your shell yourself, add these hosts to `NO_PROXY`:
74
+ For a **new installation only**:
173
75
 
174
76
  ```bash
175
- export NO_PROXY=api.deepseek.com,open.bigmodel.cn,api.minimaxi.com,ark.cn-beijing.volces.com,localhost,127.0.0.1
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"
176
80
  ```
177
81
 
178
- To check that the proxy works, run `curl -I https://chatgpt.com/`. A 403 means it works (Cloudflare blocks bare curl); a timeout or a refused connection means it does not.
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.
179
83
 
180
- ## Troubleshooting
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.
181
85
 
182
- | Symptom | Cause and fix |
183
- |---|---|
184
- | The health check or the group says "not logged in" / `Not logged in` | The default model is still `claude`, but this machine is not signed in to Claude. If you only use DeepSeek or another API-key model, run `sintbot setup` again and pick the model, send `/model deepseek` in the group, or change the group's model in the console. To use Claude, run `claude auth login` |
185
- | The trial turn says the key is wrong (401) | The key was not copied in full. For Zhipu and MiniMax the wizard already tried both the mainland and the international site, so the key itself is wrong. Run `sintbot setup` again and paste it |
186
- | Insufficient balance / identity not verified | Top up or complete identity verification in the provider's console, then retry |
187
- | Domestic models are slow or unreachable | With a global proxy on, requests go abroad and back. Set the model hosts to connect directly; see [Proxies](#proxies-mainland-china) above |
188
- | npm installs are slow or fail | Add `--registry https://registry.npmmirror.com`; the one-line install and the wizard switch automatically |
189
- | A permission error (EACCES) on global install | Do not use `sudo`. Move the global npm directory into your home folder; see step 3 of [One-line install](#one-line-install) |
190
- | GitHub is unreachable | The Chinese introduction and install steps are on [the website](https://sintbot.com/zh/); the README is also on the [npmmirror package page](https://npmmirror.com/package/sintbot) |
191
- | No reply after @-mentioning the bot | Check the platform rows of `sintbot doctor`, and the latest errors in `sintbot service logs` |
86
+ ## Stop, failure and upgrades
192
87
 
193
- ## Uninstall
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.
194
92
 
195
- ```bash
196
- sintbot service uninstall
197
- npm rm -g sintbot
198
- rm -rf ~/.sbot # config, session ledger and logs live here; project directories are untouched
199
- ```
93
+ See the [AI-assisted guide](./AI-ASSISTED-INSTALL.md) if an assistant is performing the local steps.
@@ -1,43 +1,19 @@
1
- # 让 AI 助手帮你安装并开始使用 SintBot
1
+ # 用 AI 助手安装 SintBot 1.3.0
2
2
 
3
3
  [English](../AI-ASSISTED-INSTALL.md) · 简体中文
4
4
 
5
- AI 助手只有能操作 **SintBot 实际运行那台电脑的本机终端**,才能直接安装。纯聊天或云端 Shell 不能把软件装到你的 Mac。若助手连不上本机终端,就在目标电脑的「终端」里运行安装命令,再让助手继续核对。
5
+ 使用实际运行 SintBot 的 Mac 本地终端;云端终端不能替用户的 Mac 安装。按[安装指南](./install.md)操作,本版支持一个飞书群、Codex 与前台运行。
6
6
 
7
- 一键安装支持 macOS 和 Linux(Linux 为实验性支持);Windows 请按[手动步骤](./install.md#windows)。
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`。若已有旧状态或未结收据而拒绝启动,不得删文件、新造日志权威或篡改收据来绕过。
12
+ 6. 前台运行,用已经授权的账号在群内发只读请求,把回复和文件对照,再正常停止并验证重启。没有真人协助时可用授权测试账号发送,并记录实际发送方式,不称为独立真人验收;机器人自己发的接口消息可能被忽略,不能当作用户入站消息。
13
+ 7. 本轮临时进程用完停止。说明安装了什么、实际验证了什么、还缺什么。本版不注册自动后台服务。
8
14
 
9
- ## 最短流程
10
-
11
- 1. **先检查。** 核对目标系统、Node 版本、SintBot 版本和服务状态;不要读取或打印配置、凭据。
12
- 2. **选对路径。** 新装先把官方安装脚本下载到临时文件、检查并做无修改预览;获准后执行同一份文件。升级只更新程序包,不重跑模型配置或试跑。重启正在运行的服务可能会向已接入的群播报升级。
13
- 3. **一次确认。** 改动前用一条简短摘要列清:是否要用 Homebrew 安装 / 升级 Node、缺少时安装必需的 Claude Code CLI、模型选择及试跑可能产生的费用、是否安装 / 重启后台服务。只问还没确定的选项。获得批准后,助手按已选方案处理安装器重复出现的相同选项,不再重复打断;若出现未说明的新改动,先停下询问。
14
- 4. **在本机执行。** 使用目标电脑的交互终端。账号登录由用户本人完成;API key 只由用户在 SintBot 本机遮罩提示中输入。不要把凭据复制进聊天或助手记录,也不要用 `sudo`。
15
- 5. **完成首次使用。** 核对版本、体检和服务状态。在控制台按「开始使用」完成:确认模型可用、按需接聊天平台、把一个群绑定到一个项目目录,再发一条只读测试消息。暂时不接平台,也能先在「试跑」里验证模型。
16
-
17
- 如果还要创建或审批聊天平台应用,助手按对应的[平台接入说明](./platforms/)逐步引导;凭据由用户直接填在本机控制台。每次只问下一步必需的信息,不重复索要已经提供的内容。
18
-
19
- ## 助手没有本机终端时
20
-
21
- 不要在另一台电脑或云端 Shell 上真实安装。可以做不改动系统的 `--dry-run` 预览;没有交互终端时,真实安装若缺少 Node 22+ 会停止,若已有 Node 也可能只安装程序包并提示配置未完成。让用户在目标电脑运行[一键安装](./install.md#一键安装),再由助手继续核对。
22
-
23
- ## 可直接发给 AI 助手
15
+ ## 可复制的请求
24
16
 
25
17
  ```text
26
- 请帮我在这台电脑安装或升级 SintBot,并完成首次使用。只能操作它实际运行这台电脑的本机终端。先核对系统、Node 版本、SintBot 版本和服务状态;不要读取配置或凭据。
27
-
28
- 新装先把官方安装脚本下载到临时文件、检查并运行无修改预览;获准后执行同一份文件。升级只更新程序包,不重跑模型配置或试跑。改动前用一条简短摘要说明 Node / Claude Code 安装、模型选择与试跑可能产生的费用、后台服务安装或重启(含群播报),一次问清需要我决定的选项。获得我的批准后,按已选内容处理重复的安装器确认,不要再问一遍;若出现新的改动要求就先停下。
29
-
30
- 只用目标电脑的交互终端。我会自行登录,并在本机遮罩提示中输入 API key;不要把凭据放进聊天。不要用 sudo 或重置现有数据。安装后核对版本、体检和服务状态,再带我完成控制台「开始使用」:可以先在「试跑」验证模型;需要群聊时再接平台、绑一个群到一个项目目录,并发一条只读测试。每次只问下一项必需选择;遇错先停下说明原因。
31
- ```
32
-
33
- ## 给 AI agent 派清楚任务
34
-
35
- 写代码时,说明目标、验收结果和限制。例如:
36
-
37
- ```text
38
- 目标:……
39
- 完成标准:……
40
- 限制:……
41
-
42
- 先看项目说明和当前状态。信息足够就直接执行;只有缺少的信息会阻塞工作时才问我。完成后简要列出改动、检查结果和未完成项。
18
+ 按独立目录安装指南,在这台 Mac 安装 SintBot 1.3.0。保留已有服务、配置、状态和 Codex 账号数据,不输出凭据。验证实际入口与二进制核心,配置一个飞书群使用 Codex,只对全新状态初始化。运行前台预检和已授权的只读群测试,对照结果,再验证正常停止与重启。不要用旧版向导、控制台或安装服务流程。完成后停止临时进程,并区分程序包安装与群验收结果。
43
19
  ```
@@ -1,197 +1,93 @@
1
- # 安装
1
+ # 安装 SintBot 1.3.0
2
2
 
3
3
  [English](../install.md) · 简体中文
4
4
 
5
- 新用户用[一键安装](#一键安装)最省事;手动装就是三步:装包 → `sintbot setup` → `sintbot service install`。如果请 AI 助手安装并带你完成首次使用,先看[AI 安装与首次使用说明](./AI-ASSISTED-INSTALL.md),让流程留在目标电脑上,凭据不进聊天。下面按平台补充细节。
5
+ 本版支持 macOS、Node.js 22 及以上、一个飞书群和 Codex 消息轮次,以前台方式运行。多群、其他聊天平台或模型通道、控制台、自动后台服务、定时任务、终端聊天和画布不在 1.3.0 支持范围。
6
6
 
7
- ## 一键安装
7
+ ## 1. 准备 Mac
8
8
 
9
- macOS / Linux(Linux 为实验性支持):
9
+ 在项目所在 Mac 的本地终端操作,确认 Node.js 22 及以上、Codex 可以实际运行且已完成登录。保留已有 Codex 安装和账号数据。SintBot 安装器不安装或登录 Codex,也不安装 Node。
10
10
 
11
11
  ```bash
12
- curl -fsSL https://sintbot.com/install.sh | bash
12
+ node --version
13
+ codex --version
13
14
  ```
14
15
 
15
- 脚本分四步,每一步先检查、已经有的跳过。通过 Homebrew 安装 / 升级 Node、安装后台服务前会先询问(回车 = 接受默认值);安装或升级 SintBot 本身属于这次安装流程。模型配置时若缺少必需的 Claude Code CLI,向导会自动安装。终端里只装好、配好模型:不问你在哪,也不要求填代理、项目目录、聊天平台凭据 —— 这些装完在控制台里配。
16
+ 如果这台 Mac 已经运行 SintBot,保留原来的程序包与配置。可以把新包装到独立目录,但 **1.3.0 不自动迁移已有状态**。初始化会拒绝已有状态、旧收据或日志;不要删除它们来绕过检查。不要让两个进程连接同一个飞书应用。
16
17
 
17
- 1. **环境:Node 22+**:没有或版本太旧时,交互安装会先询问;Mac 上有 Homebrew 可用它装 / 升级,否则会给出 [nodejs.org](https://nodejs.org) 的下载地址后停下。没有交互终端时不会自动装 / 升级 Node,真实安装会直接停止。
18
- **npm 源**:你配过 npm 源就照用;还是官方源时先试连一下,连不上(国内常见)本次改用国内镜像 `registry.npmmirror.com`。
19
- 2. **装 sintbot**:`npm i -g sintbot`。已经是最新版就直接跳过,旧版本直接升级。npm 全局目录没有写权限时不会用 sudo,而是给出改装到用户目录的命令。
20
- 3. **配模型** `sintbot setup`:检查 Claude Code,没装就装上(见下一节);然后配模型,当场试跑一轮。见下文[第 2 节](#2-配置sintbot-setup)。
21
- 4. **后台服务**:问要不要 `sintbot service install`(登录后自启、崩溃自动拉起)。装好后控制台常开在 `http://127.0.0.1:4600` —— 还没接聊天平台也开着,脚本会在浏览器里打开它(SSH 连进来装的只打印地址)。服务已经在跑、这次也没升级就跳过这一步;升级了会问要不要重启服务(重启会在已接的群里播报升级)。
18
+ ## 2. 安装到独立目录
22
19
 
23
- 结尾给出控制台地址和接下来做什么:在「设置」里接飞书 / Slack / 企业微信,在「群 · 项目」里绑群,然后在群里 @ 机器人。不接平台也能先用 `sintbot chat` 在终端里试。
24
-
25
- - 想先看看它会做什么:`curl -fsSL https://sintbot.com/install.sh | bash -s -- --dry-run`(不安装、不修改、也不提问;npm 可用时检查源和最新版,并读取服务状态,还会提示模型向导可能安装必需组件和发送计费试跑);脚本源码就是仓库根目录的 [install.sh](../../install.sh)。
26
- - 没有可交互的终端时(如 CI),若已有 Node 22+ 仍可能只装包,向导和常驻服务会跳过并提示未完成;若没有合格 Node,真实安装会停止。无交互 `--dry-run` 仍可预览计划。
27
- - 脚本和向导的输出语言跟着系统:`LANG` 以 `zh` 开头,或者 macOS 的系统语言是中文,就是中文,否则英文;想指定就设 `SINTBOT_LANG=zh` 或 `en`,例如 `curl -fsSL https://sintbot.com/install.sh | SINTBOT_LANG=zh bash`。
28
- - Windows 不支持一键安装,按下面手动来。
29
-
30
- ## Claude Code:安装与登录
31
-
32
- SintBot 每一轮都调用本机的 `claude` 命令行干活(Codex 群调用 `codex`),所以这台机器上要有 Claude Code —— 用 DeepSeek 等模型时也一样,它是执行框架,只是不用登录。
33
-
34
- **安装**,任选一种:
35
-
36
- - 让向导装:`sintbot setup` 在终端里运行时发现没装就直接装(就是下一条的 npm 命令,源连不上会自动换镜像)。
37
- - npm:`npm i -g @anthropic-ai/claude-code`(国内连不上官方源时加 `--registry https://registry.npmmirror.com`)。
38
- - 官方安装程序:见 [Claude Code 安装说明](https://code.claude.com/docs/zh-CN/setup)。
39
-
40
- 装好后 `claude --version` 能打出版本号即可。升级用 `claude update`(npm 装的也可以 `npm i -g @anthropic-ai/claude-code@latest`)。
41
-
42
- **认证**,按要用的模型选一种:
43
-
44
- | 要用的模型 | 怎么做 |
45
- |---|---|
46
- | DeepSeek / 智谱 GLM / MiniMax / 火山方舟等(用 API key) | **不用登录**,装好即可;key 在向导里粘贴,见 [models.md](./models.md#三步接上-deepseek-等模型) |
47
- | Claude,用订阅(Pro / Max) | 终端跑 `claude auth login`,在打开的浏览器里登录;`claude auth status` 查看是否已登录 |
48
- | Claude,用 Anthropic API key(按量计费) | `claude auth login --console`;或把 `ANTHROPIC_API_KEY` 放进守护进程的环境 |
49
-
50
- - 没有屏幕的机器(如当服务器用的 Mac mini):用屏幕共享(`vnc://机器IP`)进桌面跑一次 `claude auth login`,登录态落盘后无人值守也能用。
51
- - 用个人订阅服务多人群聊的条款问题,见 [中文 README](../../README.zh-CN.md#安全须知)的「安全须知」。
52
- - 验证:`claude --version` → `claude auth status`(用订阅时)→ `sintbot agent run "用一句话自我介绍"`(先在终端试一轮,只读)。
53
-
54
- ## 前置
55
-
56
- | 要求 | 检查 | 说明 |
57
- |---|---|---|
58
- | Node ≥ 22 | `node -v` | 当前 LTS 即可(浏览器接管页要用 Node 自带的 WebSocket) |
59
- | Claude Code | `claude --version` | 可以让 `sintbot setup` 替你装;安装与登录见上一节。只用 DeepSeek 等 API key 模型的话装了不登录也行 |
60
- | Codex CLI(可选) | `codex --version` | 有 ChatGPT 账号才用得上:GPT 群与生图。`npm i -g @openai/codex` 后 `codex login`(浏览器 OAuth,要图形界面) |
61
- | 设计图标库(可选) | `sintbot doctor` 的 `design.icons` 行 | Lucide、Tabler、Phosphor、Pixelarticons 四套,合计约 170 MB。agent 出设计图时按名字从这里取图标;没装就只能自己画,和设计图对不上 |
62
-
63
- `sintbot setup` 第一步会检查这几样:缺 Claude Code 就直接装;Codex 和设计图标库是可选的,缺了只打印装法、不问;Claude 与 Codex 的登录状态在模型那一步一起显示。
64
-
65
- ## 1. 装包
20
+ 下载并检查安装脚本,再执行同一份文件:
66
21
 
67
22
  ```bash
68
- npm i -g sintbot
69
- sintbot version
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
70
26
  ```
71
27
 
72
- 包名是 **`sintbot`**(npm 上叫 `sbot` 的是别人的包,别装错)。装出两个同义命令:`sbot` 和 `sintbot`。
73
-
74
- > ⚠ 同一台机器同时有 Homebrew 的 node 和 nvm 的 node 时,`npm i -g` 装进的是**当前 shell 那份**。常驻服务用的是装服务那一刻的 node(`sintbot service install` 会把路径写进服务),两者对不上就会出现「升级了但跑的还是旧版」。用 `sintbot service install --dry-run` 看服务里写的是哪个 node。
28
+ 脚本把精确的 **sintbot@1.3.0** 安装到 `~/.local/share/sintbot/releases/1.3.0`,验证实际入口、二进制核心和飞书模块,保留全局安装、终端配置、应用配置和服务。目标目录已存在时拒绝覆盖;可用 `--prefix /全新/绝对/目录` 指定其他位置。`--dry-run` 不修改文件,也不下载程序包。
75
29
 
76
- 从源码跑:
30
+ 始终使用这一个实际入口,避免误用全局旧版本:
77
31
 
78
32
  ```bash
79
- git clone https://github.com/sintlab/sintbot.git && cd sintbot
80
- npm install
81
- npm link # 可选:把 sbot 命令链到全局
33
+ SINTBOT="$HOME/.local/share/sintbot/releases/1.3.0/bin/sintbot"
34
+ "$SINTBOT" --version
35
+ "$SINTBOT" help
82
36
  ```
83
37
 
84
- ## 2. 配置:`sintbot setup`
85
-
86
- 交互式向导,回车即默认(方括号里的值,`(Y/n)` 大写的那个)。只问这台机器跑起来需要的两样:
87
-
88
- 1. **环境**:Claude Code(缺了就装)、Codex 和设计图标库(可选,缺了打印装法),见上文「前置」
89
- 2. **模型**:先显示 Claude 订阅、ChatGPT(Codex)的登录状态和已有 key 的模型,按这个顺序推荐:
90
- - Claude 已登录 → 默认 Claude;否则 Codex 已登录 → 默认 Codex。不再多问;别的模型在控制台「模型 · 库」里加
91
- - 都没有 → **推荐 DeepSeek**:告诉你去 platform.deepseek.com 拿 key,粘贴后**当场试跑一轮**。也可以选别家(智谱 GLM / MiniMax / 火山方舟)、另开终端登录 Claude 或 Codex 后回来重新检测,或先跳过
92
- - 智谱 GLM、MiniMax 有国际站(Z.ai / minimax.io),key 只在开它的那个站能用:向导先试一个站,认证失败自动换另一个站再试;没装 Claude Code 试跑不了时,才问 key 是哪个站开的
93
- - 试跑失败会说原因:key 不对、余额不足或没实名、连不上(是不是开着全局代理)、模型名不对;可以重新粘贴再试
94
- - 默认模型由向导自动选(已登录的订阅优先,其次试跑通过的,再次有 key 的),还没试跑过就直接试一轮;群里 `/model` 随时切
95
- - 没装或没登录 codex 时,codex 预设和「额度用完自动切到 codex」不写进配置。Kimi 不在预设里,要在控制台「模型 · 库 → 添加模型 → 自定义」添加。见 [models.md](./models.md)
96
-
97
- 配置写到 `~/.sbot/config.json`(权限 600);当前目录已有 `sbot.config.json` 时更新那份。再跑一次 `sintbot setup` 只补缺项,不动已填的。
98
-
99
- 向导最后做一次简短体检,只列失败项;完整的看 `sintbot doctor`。
100
-
101
- **其余的都在控制台里配**(`sintbot ui`,装了服务就是 `http://127.0.0.1:4600`):
102
-
103
- | 配什么 | 控制台里的位置 |
104
- |---|---|
105
- | 聊天平台凭据(飞书 / Slack / 企业微信)、预检、飞书管理员 | 「设置」,每个平台都有分步指南;另见 [platforms/](./platforms/) |
106
- | 把群绑到项目目录 | 「群 · 项目」 |
107
- | 机器人名字、网络代理 | 「设置 → 机器人与网络」 |
108
- | 项目根目录 | 控制台里只读(它是控制台能绑哪些目录的围栏)。默认 `~/Projects`;要改就编辑配置里的 `projectsRoots`,或运行 `sintbot setup --full` |
109
-
110
- **`sintbot setup --full`**:在终端里问旧的完整一套,给没有浏览器的服务器用 —— 代理分流、机器人名、聊天平台凭据与预检、项目根目录、绑第一个群。
111
-
112
- ## 3. 常驻:`sintbot service install`
113
-
114
- ```bash
115
- sintbot service install # 写入并启动服务
116
- sintbot service install --ui-host 0.0.0.0 # 控制台对局域网开放(先 sintbot ui --set-password)
117
- sintbot service status | restart | logs | uninstall
118
- ```
119
-
120
- - **macOS**:写 `~/Library/LaunchAgents/com.sbot.daemon.plist`(LaunchAgent,随用户登录启动,崩溃 15 秒后拉起)
121
- - **Linux**(实验性:1.0 只用单元测试核对过生成的单元文件,没在真机上装过):写 `~/.config/systemd/user/sbot.service`;要开机就起(不必先登录)再跑一次 `loginctl enable-linger $USER`
122
- - 日志:`~/.sbot/logs/err.log`(`sintbot service logs` 看末尾)
123
- - 服务里固定的是:node 的路径、sbot 入口、配置文件绝对路径,以及当前 shell 的 PATH(`claude` / `codex` 所在目录排最前)。**换了 node、挪了配置、新装了 claude 之后,重跑一次 `sintbot service install`**
124
- - node 路径:Homebrew 装的 node 实际在带版本号的目录里,升级后旧路径就没了 —— install 会换成指向同一个程序、不带版本号的路径(如 `/opt/homebrew/bin/node`)。nvm / volta 这类找不到稳定路径的照用原路径,并提醒你换 node 版本后重装服务
125
- - 环境变量:服务里**没有**你 shell 里的变量,install 会把需要的值直接写进服务定义(文件权限 600,`--dry-run` 打印时值是遮住的):配置里所有 `"env:变量名"` 引用,以及配置没写代理时 shell 里的 `https_proxy` 这类变量。换了 key 或代理要重跑 install;或者干脆在配置里填明文(配置文件本身就是 600;代理在控制台「设置 → 机器人与网络」填)
126
- - 控制台对外(`--ui-host` 非本机地址)而没设密码时,install 直接拒绝 —— 否则服务每次一启动就退出
127
- - 还没接聊天平台也照装:服务先只开控制台,在「设置」里接好平台、保存后,几秒内自己重启并连上(1.0.10、1.0.11 这种情况会拒绝安装)
128
- - 服务在跑时运行 `sintbot ui`,会直接打开服务里的控制台,不报端口被占用
129
- - ⚠ 装了服务就别再手动 `sintbot start`:同一个系统用户只允许一个守护进程(锁文件 `~/.sbot/daemon.lock`),第二个会报出已在运行的那个的 pid 后退出。另一台机器或另一个系统用户用**同一个机器人应用**再起一个的话:飞书和 Slack 会把每条消息**随机交给其中一个连接**(另一个就收不到),企业微信则是新连接顶掉旧连接,10 分钟内被顶两次就不再重连
130
-
131
- ### 升级
132
-
133
- 控制台「设置 → 软件更新」启动时及之后每天自动检查稳定版,也可手动检查。自动检查始终开启。发现新版后由管理员明确确认才安装;所有群任务和队列空闲后,只升级到刚检测到的精确版本。全局安装目录不可写或当前不是全局安装时不会提权,页面会提示改用终端。
134
-
135
- 受托管的后台服务会在安装并核对版本后自动重启;前台运行则需手动重启。可忽略当前版本,并选择升级后是否向群播报。网络检查失败不会清掉上次成功结果。
136
-
137
- ```bash
138
- npm i -g sintbot@latest && sintbot service restart
139
- ```
140
-
141
- 重启会中止正在跑的轮次;被中止的那一轮在重启后自动重做,群里会说一声。最稳妥的做法是挑控制台「概览」里各群都空闲的时候重启。
142
-
143
- ## macOS:当服务器用的 Mac mini
144
-
145
- 无人值守要满足:不休眠、断电自恢复、重启后自动进桌面。
146
-
147
- ```bash
148
- sudo pmset -a sleep 0 disablesleep 1 autorestart 1 powernap 0
38
+ 版本输出应为 `1.3.0`。装好程序包不会自动启动机器人。
39
+
40
+ ## 3. 配置一个飞书群
41
+
42
+ 在 `open.feishu.cn` 创建企业自建应用,启用机器人,授予接收与回复消息的权限,事件订阅选择长连接,订阅消息接收事件,发布应用并把机器人加入测试群。从飞书取得该群的 `oc_…` 群 ID。本版使用中国区飞书,不支持国际版 Lark。
43
+
44
+ 在启动 SintBot 的本地终端中,把应用 ID 和应用密钥分别设为 `FEISHU_APP_ID`、`FEISHU_APP_SECRET` 环境变量。不要把密钥发进聊天或提交到仓库。配置中的环境变量引用在启动时解析;每次新开终端都需要保证这两个变量存在。
45
+
46
+ 先用 `mkdir -p ~/.sbot && chmod 700 ~/.sbot` 创建私有配置目录,再创建 `~/.sbot/config-1.3.0.json`,内容如下。把群 ID 和项目路径换成真实值;项目目录必须已存在。只留一个群,两个显式 `false` 不要省略。
47
+
48
+ ```json
49
+ {
50
+ "defaultProvider": "codex",
51
+ "providers": { "codex": { "runner": "codex" } },
52
+ "feishu": {
53
+ "appId": "env:FEISHU_APP_ID",
54
+ "appSecret": "env:FEISHU_APP_SECRET",
55
+ "onlyWhenMentioned": false
56
+ },
57
+ "groups": {
58
+ "oc_REPLACE_WITH_YOUR_CHAT_ID": {
59
+ "platform": "feishu",
60
+ "provider": "codex",
61
+ "workdir": "/absolute/path/to/your/project",
62
+ "permissionMode": "dontAsk",
63
+ "codexSteer": false,
64
+ "codexApp": false
65
+ }
66
+ }
67
+ }
149
68
  ```
150
69
 
151
- 再到「系统设置 → 用户与群组」打开**自动登录**。LaunchAgent 要有用户会话才会启动(它要读 `~/.claude` / `~/.codex` 的登录态和钥匙串),不开自动登录,重启后服务不会起来。
152
-
153
- `codex login` 要浏览器:用屏幕共享(`vnc://机器IP`)进桌面做一次,凭据落盘后无人值守也能用。
154
-
155
- ## Windows
156
-
157
- > 1.0 没有在 Windows 真机上验证过(持续集成只跑 Linux)。下面几条按代码行为写成,遇到问题请提 issue。
70
+ 限制配置文件权限(`chmod 600 ~/.sbot/config-1.3.0.json`)。示例采用只读权限,接收这一个群里的普通消息,请使用专用测试群。若只接收 @ 机器人的消息,须设 `onlyWhenMentioned: true` 并填入该应用实际的 `botOpenId`;缺少机器人 ID 会在启动前被拒绝。不要从旧示例复制控制台、其他平台、定时任务或画布配置;历史完整配置不代表 1.3.0 支持范围。
158
71
 
159
- - `claude` 若是 npm 装的,实际是 `claude.cmd` 垫片 —— 已自动处理,配置里写 `claude` 即可
160
- - 服务化:`sintbot service install` 在 Windows 上不自动装,而是打印 [NSSM](https://nssm.cc/) 与 pm2 的现成命令,照着执行即可。用 NSSM 时,API key 和代理变量要用 `nssm set SintBot AppEnvironmentExtra …` 带进服务环境
161
- - 项目根目录默认 `D:\Projects`(没有 D 盘则 `%USERPROFILE%\Projects`)
72
+ ## 4. 初始化并启动
162
73
 
163
- ## 代理
164
-
165
- 在中国大陆:官方 Claude、ChatGPT / Codex、Slack 要走代理,国内模型端点、飞书、企业微信直连。在控制台「设置 → 机器人与网络」填代理(或用 `sintbot setup --full`)后,配置里的 `proxy` 块会:
166
-
167
- - 注入到每次 spawn 的 `claude` / `codex` 子进程(不覆盖 shell 里已有的值);
168
- - 也用于守护进程自己连 Slack(Node 的 `fetch` / WebSocket 不读 `HTTP_PROXY` 环境变量,所以单独处理)。
169
-
170
- **国内模型端点要直连**:DeepSeek、智谱、MiniMax、火山方舟绕到境外再连回来,既慢,也可能触发对方的风控。在控制台或向导里填代理时,`noProxy` 会按你启用的 provider 自动生成;如果是自己在 shell 里配的代理,把这些域名加进 `NO_PROXY`:
74
+ **仅全新安装**执行:
171
75
 
172
76
  ```bash
173
- export NO_PROXY=api.deepseek.com,open.bigmodel.cn,api.minimaxi.com,ark.cn-beijing.volces.com,localhost,127.0.0.1
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"
174
80
  ```
175
81
 
176
- 验证代理通没通:`curl -I https://chatgpt.com/` 返回 403 就是通了(Cloudflare 拦裸 curl);超时或连接被拒才是不通。
82
+ `init` 在 `~/.sbot/c2-v2.log` 创建持久收据日志,只运行一次;不会重置已有日志或迁移旧状态。`--preflight` 检查本地配置与装配,不建立飞书连接,也不能代替认证或消息送达验证。`start` 持有单写锁并连接所配群,需要保持终端开启。
177
83
 
178
- ## 常见问题
84
+ 在群里直接发消息,要求读取项目 README 的第一行。把返回结果与文件对照。按 Ctrl-C 并等待退出,再用相同的 `start` 命令启动一次。正常重启不要重新执行 `init`。
179
85
 
180
- | 现象 | 原因与做法 |
181
- |---|---|
182
- | 体检或群里报「未登录」/ `Not logged in` | 默认模型还是 `claude`,但这台机器没登录 Claude。只用 DeepSeek 等:重跑 `sintbot setup` 选模型,或群里 `/model deepseek`、控制台给群换模型;要用 Claude 就跑 `claude auth login` |
183
- | 试跑报「key 不对」(401) | key 没复制完整。智谱 / MiniMax 向导已经把中国站和国际站都试过了,说明 key 本身不对。重跑 `sintbot setup` 重新粘贴 |
184
- | 报余额不足 / 未实名 | 到厂商后台充值、完成实名后再试 |
185
- | 很慢或连不上国内模型 | 开着全局代理(梯子)时请求会绕到境外:把模型域名设成直连,见上文「代理」 |
186
- | npm 安装很慢或失败 | 加 `--registry https://registry.npmmirror.com`;一键安装和向导会自动换 |
187
- | 全局安装报权限错误(EACCES) | 别用 sudo,把 npm 全局目录改到用户目录,做法见上文「一键安装」第 3 条 |
188
- | GitHub 打不开 | 中文介绍和安装步骤在[官网](https://sintbot.com/zh/)上都有;英文 README 在 [npmmirror 的包页](https://npmmirror.com/package/sintbot)上也能看到 |
189
- | 群里 @ 了没反应 | `sintbot doctor` 看平台那几行;`sintbot service logs` 看最近的错误 |
86
+ ## 停止、故障和升级
190
87
 
191
- ## 卸载
88
+ - 按 Ctrl-C 并等待退出;本版不提供登录自启或安装后台服务命令。
89
+ - 任务失败或启动提示未结收据时,保留日志与状态,核对实际结果后再处置。不要清空未知效果、覆盖日志或盲目重发相同任务。
90
+ - 安装器保留旧程序包,但切版本仍须排空旧进程、备份配置与状态、确认收据兼容。只有旧可执行文件不等于可以安全回退状态。
91
+ - 已有多群安装继续用原版本,替换为单群路径前必须有经过核对的迁移方案。
192
92
 
193
- ```bash
194
- sintbot service uninstall
195
- npm rm -g sintbot
196
- rm -rf ~/.sbot # 配置、会话账本、日志都在这里;项目目录不受影响
197
- ```
93
+ 由助手操作时可用 [AI 辅助安装指南](./AI-ASSISTED-INSTALL.md)。