cc-ding 0.1.0 → 0.2.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.
- package/README.md +249 -85
- package/dist/bin/cc-ding.js +1 -1
- package/dist/src/biz/cc-ding-cli.js +40 -40
- package/dist/src/biz/claude-process.js +27 -27
- package/dist/src/biz/commands.js +6 -6
- package/dist/src/biz/image.js +11 -10
- package/dist/src/biz/menu.js +3 -0
- package/dist/src/biz/messaging.js +5 -5
- package/dist/src/biz/quote.js +7 -3
- package/dist/src/biz/recorder.js +9 -9
- package/dist/src/biz/session.js +12 -11
- package/dist/src/biz/todo.js +8 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,29 +4,37 @@
|
|
|
4
4
|
[](https://www.npmjs.com/package/cc-ding)
|
|
5
5
|
[](LICENSE)
|
|
6
6
|
[](https://nodejs.org)
|
|
7
|
+
[](https://github.com/yihuineng/cc-ding/stargazers)
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
> 将 Claude Code 接入钉钉,构建企业级 AI 协作工作流。
|
|
10
|
+
>
|
|
11
|
+
> Connect Claude Code to DingTalk for enterprise-grade AI collaboration.
|
|
9
12
|
|
|
10
|
-
|
|
13
|
+
**[中文](#中文--简体中文)** | **[English](#english)**
|
|
11
14
|
|
|
12
|
-
|
|
13
|
-
- **群内多用户** — 白名单内所有成员均可参与同一会话
|
|
14
|
-
- **任务队列** — `/task` 提交任务,按队列顺序执行,完成后自动回复
|
|
15
|
-
- **定时任务** — 自然语言创建 cron,支持暂停 / 恢复 / 删除
|
|
16
|
-
- **图片消息** — 自动接收钉钉图片 / 富文本内嵌图片,可选本地 OCR 识别
|
|
17
|
-
- **API Key 池化** — 429 自动切换、跨天重置,提升服务稳定性
|
|
18
|
-
- **关联群** — 多个群共享同一个 Claude 会话上下文
|
|
15
|
+
---
|
|
19
16
|
|
|
20
|
-
##
|
|
17
|
+
## 中文 | 简体中文
|
|
21
18
|
|
|
22
|
-
|
|
19
|
+
将 Claude Code 接入钉钉,实现双向通信。支持多轮对话、任务队列、定时任务、图片识别,帮助团队以最低成本构建可私有化部署的 AI 助手。
|
|
20
|
+
|
|
21
|
+
### 目录
|
|
22
|
+
|
|
23
|
+
- [快速开始](#快速开始)
|
|
24
|
+
- [命令参考](#命令参考)
|
|
25
|
+
- [配置说明](#配置说明)
|
|
26
|
+
- [数据存储](#数据存储)
|
|
27
|
+
- [开发](#开发)
|
|
28
|
+
|
|
29
|
+
### 快速开始
|
|
30
|
+
|
|
31
|
+
#### 安装
|
|
23
32
|
|
|
24
33
|
```bash
|
|
25
34
|
pnpm i cc-ding -g
|
|
26
|
-
cc-ding --help
|
|
27
35
|
```
|
|
28
36
|
|
|
29
|
-
|
|
37
|
+
#### 初始化
|
|
30
38
|
|
|
31
39
|
```bash
|
|
32
40
|
cc-ding init -ci {clientId} -cs {clientSecret} -m {手机号}
|
|
@@ -34,107 +42,79 @@ cc-ding init -ci {clientId} -cs {clientSecret} -m {手机号}
|
|
|
34
42
|
|
|
35
43
|
| 参数 | 说明 |
|
|
36
44
|
|------|------|
|
|
37
|
-
| `-ci, --clientId` |
|
|
45
|
+
| `-ci, --clientId` | 钉钉应用 ClientId |
|
|
38
46
|
| `-cs, --clientSecret` | 钉钉 Stream 连接密钥 |
|
|
39
47
|
| `-m, --mobile` | 管理员手机号(自动加入白名单) |
|
|
40
48
|
| `-cn, --clientName` | 机器人名称(可选,默认 "cc助手") |
|
|
41
49
|
|
|
42
|
-
|
|
50
|
+
#### 编辑配置
|
|
43
51
|
|
|
44
|
-
配置文件位于 `~/.cc-ding/{clientId}/config.json
|
|
52
|
+
配置文件位于 `~/.cc-ding/{clientId}/config.json`,参考下方 [配置文件示例](#配置文件示例)。
|
|
45
53
|
|
|
46
|
-
|
|
54
|
+
#### 启动
|
|
47
55
|
|
|
48
56
|
```bash
|
|
49
57
|
# 直接启动
|
|
50
58
|
cc-ding run -ci {clientId}
|
|
51
59
|
|
|
52
|
-
# 推荐:PM2
|
|
60
|
+
# 推荐:PM2 守护进程
|
|
53
61
|
pm2 start --name "cc-ding-{clientId}" npx -- -p cc-ding cc-ding run -ci {clientId}
|
|
54
62
|
```
|
|
55
63
|
|
|
56
|
-
|
|
64
|
+
### 命令参考
|
|
57
65
|
|
|
58
|
-
|
|
66
|
+
#### 会话
|
|
59
67
|
|
|
60
68
|
| 命令 | 说明 |
|
|
61
69
|
|------|------|
|
|
62
|
-
| `/help` |
|
|
63
|
-
| `/log [行数]` |
|
|
64
|
-
| `/new [
|
|
65
|
-
| `/resume [
|
|
70
|
+
| `/help` | 查看所有命令 |
|
|
71
|
+
| `/log [行数]` | 查看会话日志 |
|
|
72
|
+
| `/new [消息]` | 开始新对话 |
|
|
73
|
+
| `/resume [ID]` | 恢复历史会话(不指定则恢复最近一个) |
|
|
66
74
|
| `/end` | 结束当前会话 |
|
|
67
75
|
|
|
68
|
-
|
|
69
|
-
- 群内所有白名单用户均可参与对话
|
|
76
|
+
> 会话自动持久化到 `active.json`,重启后无缝恢复。群内所有白名单用户均可参与。
|
|
70
77
|
|
|
71
|
-
|
|
78
|
+
#### 任务
|
|
72
79
|
|
|
73
80
|
```
|
|
74
|
-
/task
|
|
75
|
-
/task cancel
|
|
81
|
+
/task <描述> # 提交任务(自动排队顺序执行)
|
|
82
|
+
/task cancel # 取消任务
|
|
76
83
|
```
|
|
77
84
|
|
|
78
|
-
|
|
85
|
+
#### 定时任务
|
|
79
86
|
|
|
80
87
|
```
|
|
81
|
-
/cron
|
|
82
|
-
/cron 0 9 * * *
|
|
83
|
-
/cron list
|
|
84
|
-
/cron pause <id>
|
|
85
|
-
/cron delete <id>
|
|
88
|
+
/cron <自然语言> # Claude 自动生成 cron 表达式
|
|
89
|
+
/cron 0 9 * * * <描述> # 直接指定 cron
|
|
90
|
+
/cron list # 查看列表
|
|
91
|
+
/cron pause <id> | resume <id> # 暂停 / 恢复
|
|
92
|
+
/cron delete <id> # 删除
|
|
86
93
|
```
|
|
87
94
|
|
|
88
|
-
|
|
95
|
+
#### 文件操作
|
|
89
96
|
|
|
90
97
|
| 命令 | 说明 |
|
|
91
98
|
|------|------|
|
|
92
|
-
| `/pwd` |
|
|
99
|
+
| `/pwd` | 显示工作目录 |
|
|
93
100
|
| `/ls [目录] [层数]` | 查看目录结构 |
|
|
94
|
-
| `/mkdir
|
|
95
|
-
| `/touch <路径>` | 创建空文件 |
|
|
96
|
-
| `/rm <路径>` | 删除文件或目录 |
|
|
101
|
+
| `/mkdir` / `/touch` / `/rm` | 创建目录 / 创建空文件 / 删除 |
|
|
97
102
|
|
|
98
|
-
|
|
103
|
+
#### 管理命令(仅 owner)
|
|
99
104
|
|
|
100
105
|
| 命令 | 说明 |
|
|
101
106
|
|------|------|
|
|
102
|
-
| `/info [robot\|session\|task]` |
|
|
103
|
-
| `/version` |
|
|
104
|
-
| `/open [shell]` |
|
|
105
|
-
| `/clean [all]` |
|
|
107
|
+
| `/info [robot\|session\|task]` | 查看配置/会话/任务信息 |
|
|
108
|
+
| `/version` | 版本信息 |
|
|
109
|
+
| `/open [shell]` | 打开工作目录 |
|
|
110
|
+
| `/clean [all]` | 清除历史和缓存 |
|
|
106
111
|
| `/reset-apikeycfg` | 重置 API Key 配置 |
|
|
107
112
|
| `/cfg` | 注册当前群到配置 |
|
|
108
113
|
| `/auth [add\|del <用户>]` | 管理群级白名单 |
|
|
109
114
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
### 白名单
|
|
113
|
-
|
|
114
|
-
- **全局白名单**:`config.json` 中的 `whiteUserList`
|
|
115
|
-
- **群级白名单**:`conversations[].whiteUserList`(优先级高于全局)
|
|
116
|
-
- 支持手机号和 userId 两种格式,手机号自动解析为 userId
|
|
117
|
-
|
|
118
|
-
### API Key 池化
|
|
119
|
-
|
|
120
|
-
配置 `apiKeyCfg` 后启用:
|
|
121
|
-
|
|
122
|
-
- 429 错误自动切换到可用 Key
|
|
123
|
-
- 连续 TPM 不稳定时自动换 Key
|
|
124
|
-
- 每日 0 点自动重置 API Key 状态
|
|
125
|
-
|
|
126
|
-
### 图片消息
|
|
127
|
-
|
|
128
|
-
- 支持 `picture` 和 `richText`(含内嵌图片)消息类型
|
|
129
|
-
- 图片自动下载到 `.images/` 目录
|
|
130
|
-
- `useLocalOcr: true`(默认)使用本地 OCR 识别,同时传入原图路径供 Claude 自主查看
|
|
131
|
-
- 设置 `useLocalOcr: false` 关闭 OCR(适用于支持图片识别的模型)
|
|
132
|
-
|
|
133
|
-
### 关联群
|
|
115
|
+
### 配置说明
|
|
134
116
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
## 配置文件示例
|
|
117
|
+
#### 配置文件示例
|
|
138
118
|
|
|
139
119
|
```json
|
|
140
120
|
{
|
|
@@ -151,9 +131,7 @@ pm2 start --name "cc-ding-{clientId}" npx -- -p cc-ding cc-ding run -ci {clientI
|
|
|
151
131
|
"whiteUserList": ["工号1", "工号2"],
|
|
152
132
|
"agent": "指定agent(可选)",
|
|
153
133
|
"useLocalOcr": true,
|
|
154
|
-
"taskCfg": {
|
|
155
|
-
"skill": "指定技能(可选)"
|
|
156
|
-
}
|
|
134
|
+
"taskCfg": { "skill": "指定技能(可选)" }
|
|
157
135
|
}
|
|
158
136
|
],
|
|
159
137
|
"taskQueueSize": 50,
|
|
@@ -161,34 +139,220 @@ pm2 start --name "cc-ding-{clientId}" npx -- -p cc-ding cc-ding run -ci {clientI
|
|
|
161
139
|
"sessionMaxConcurrency": 20,
|
|
162
140
|
"includeThinking": false,
|
|
163
141
|
"resultOnly": true,
|
|
164
|
-
"debug": false
|
|
142
|
+
"debug": false,
|
|
143
|
+
"skipSandbox": false
|
|
165
144
|
}
|
|
166
145
|
```
|
|
167
146
|
|
|
168
|
-
|
|
147
|
+
#### 配置项速查
|
|
148
|
+
|
|
149
|
+
| 配置 | 说明 |
|
|
150
|
+
|------|------|
|
|
151
|
+
| `whiteUserList` | 全局白名单(手机号或 userId) |
|
|
152
|
+
| `conversations[].whiteUserList` | 群级白名单,优先级高于全局 |
|
|
153
|
+
| `apiKeyCfg` | API Key 池化:429 自动切换、每日 0 点重置 |
|
|
154
|
+
| `useLocalOcr` | 图片本地 OCR(默认 `true`),模型支持图片时可设 `false` |
|
|
155
|
+
| `linkConversationId` | 关联群 ID,多群共享同一 Claude 会话上下文 |
|
|
156
|
+
| `skipSandbox` | 跳过沙箱,允许完整文件系统访问(默认 `false`) |
|
|
157
|
+
|
|
158
|
+
### 数据存储
|
|
169
159
|
|
|
170
160
|
所有数据存储在 `~/.cc-ding/{clientId}/` 目录下:
|
|
171
161
|
|
|
172
162
|
| 类型 | 路径 |
|
|
173
163
|
|------|------|
|
|
174
|
-
|
|
|
175
|
-
|
|
|
164
|
+
| 会话 | `{MD5}/.sessions/{claudeSessionId}/session.{json,log}` |
|
|
165
|
+
| 任务 | `{MD5}/.tasks/{时间戳}/task.{json,log}` |
|
|
176
166
|
| 定时任务 | `cron.json` |
|
|
177
167
|
| 图片缓存 | `{MD5}/.images/` |
|
|
178
168
|
| 手机号映射 | `phone-map.json` |
|
|
179
169
|
|
|
180
|
-
|
|
170
|
+
### 开发
|
|
181
171
|
|
|
182
172
|
```bash
|
|
183
173
|
pnpm install
|
|
184
|
-
pnpm run lint
|
|
185
|
-
pnpm run test
|
|
186
|
-
pnpm run build
|
|
174
|
+
pnpm run lint
|
|
175
|
+
pnpm run test
|
|
176
|
+
pnpm run build
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
**系统要求:** Node.js >= 24
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## English
|
|
184
|
+
|
|
185
|
+
Connect Claude Code to DingTalk for bidirectional communication. Supports multi-turn conversations, task queues, scheduled jobs, and image recognition — helping teams build privately deployable AI assistants at minimal cost.
|
|
186
|
+
|
|
187
|
+
### Table of Contents
|
|
188
|
+
|
|
189
|
+
- [Quick Start](#quick-start)
|
|
190
|
+
- [Commands](#commands)
|
|
191
|
+
- [Configuration](#configuration)
|
|
192
|
+
- [Data Storage](#data-storage)
|
|
193
|
+
- [Development](#development)
|
|
194
|
+
|
|
195
|
+
### Quick Start
|
|
196
|
+
|
|
197
|
+
#### Install
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
pnpm i cc-ding -g
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
#### Initialize
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
cc-ding init -ci {clientId} -cs {clientSecret} -m {phone_number}
|
|
187
207
|
```
|
|
188
208
|
|
|
189
|
-
|
|
209
|
+
| Parameter | Description |
|
|
210
|
+
|-----------|-------------|
|
|
211
|
+
| `-ci, --clientId` | DingTalk app ClientId |
|
|
212
|
+
| `-cs, --clientSecret` | DingTalk Stream connection secret |
|
|
213
|
+
| `-m, --mobile` | Admin phone number (auto-added to whitelist) |
|
|
214
|
+
| `-cn, --clientName` | Bot name (optional, default "cc助手") |
|
|
215
|
+
|
|
216
|
+
#### Edit Config
|
|
217
|
+
|
|
218
|
+
Config file is at `~/.cc-ding/{clientId}/config.json`. See [config example](#configuration-example) below.
|
|
219
|
+
|
|
220
|
+
#### Start
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
# Direct start
|
|
224
|
+
cc-ding run -ci {clientId}
|
|
225
|
+
|
|
226
|
+
# Recommended: PM2 daemon
|
|
227
|
+
pm2 start --name "cc-ding-{clientId}" npx -- -p cc-ding cc-ding run -ci {clientId}
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### Commands
|
|
231
|
+
|
|
232
|
+
#### Session
|
|
233
|
+
|
|
234
|
+
| Command | Description |
|
|
235
|
+
|---------|-------------|
|
|
236
|
+
| `/help` | View all commands |
|
|
237
|
+
| `/log [lines]` | View session logs |
|
|
238
|
+
| `/new [msg]` | Start a new conversation |
|
|
239
|
+
| `/resume [ID]` | Resume a previous session (latest if omitted) |
|
|
240
|
+
| `/end` | End the current session |
|
|
241
|
+
|
|
242
|
+
> Sessions are auto-persisted to `active.json` and restored on restart. All whitelisted users in the group can participate.
|
|
243
|
+
|
|
244
|
+
#### Task
|
|
245
|
+
|
|
246
|
+
```
|
|
247
|
+
/task <description> # Submit task (auto-queued, sequential execution)
|
|
248
|
+
/task cancel # Cancel a task
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
#### Scheduled
|
|
252
|
+
|
|
253
|
+
```
|
|
254
|
+
/cron <natural language> # Claude auto-generates cron expression
|
|
255
|
+
/cron 0 9 * * * <description> # Specify cron directly
|
|
256
|
+
/cron list # View all
|
|
257
|
+
/cron pause <id> | resume <id> # Pause / resume
|
|
258
|
+
/cron delete <id> # Delete
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
#### File Operations
|
|
262
|
+
|
|
263
|
+
| Command | Description |
|
|
264
|
+
|---------|-------------|
|
|
265
|
+
| `/pwd` | Show working directory |
|
|
266
|
+
| `/ls [dir] [depth]` | View directory structure |
|
|
267
|
+
| `/mkdir` / `/touch` / `/rm` | Create dir / Create empty file / Delete |
|
|
268
|
+
|
|
269
|
+
#### Admin (owner only)
|
|
270
|
+
|
|
271
|
+
| Command | Description |
|
|
272
|
+
|---------|-------------|
|
|
273
|
+
| `/info [robot\|session\|task]` | View config/session/task info |
|
|
274
|
+
| `/version` | Version info |
|
|
275
|
+
| `/open [shell]` | Open working directory |
|
|
276
|
+
| `/clean [all]` | Clear history and cache |
|
|
277
|
+
| `/reset-apikeycfg` | Reset API Key configuration |
|
|
278
|
+
| `/cfg` | Register current group to config |
|
|
279
|
+
| `/auth [add\|del <user>]` | Manage group whitelist |
|
|
280
|
+
|
|
281
|
+
### Configuration
|
|
282
|
+
|
|
283
|
+
#### Configuration Example
|
|
284
|
+
|
|
285
|
+
```json
|
|
286
|
+
{
|
|
287
|
+
"clientName": "cc助手",
|
|
288
|
+
"owner": "your_phone_number",
|
|
289
|
+
"whiteUserList": ["your_phone_number"],
|
|
290
|
+
"clientSecret": "dingtalk_stream_secret",
|
|
291
|
+
"defaultDingToken": "fallback_dingtalk_bot_token",
|
|
292
|
+
"conversations": [
|
|
293
|
+
{
|
|
294
|
+
"conversationId": "group_id",
|
|
295
|
+
"conversationTitle": "group_name",
|
|
296
|
+
"dingToken": "group_bot_token",
|
|
297
|
+
"whiteUserList": ["emp_id_1", "emp_id_2"],
|
|
298
|
+
"agent": "specified_agent (optional)",
|
|
299
|
+
"useLocalOcr": true,
|
|
300
|
+
"taskCfg": { "skill": "specified_skill (optional)" }
|
|
301
|
+
}
|
|
302
|
+
],
|
|
303
|
+
"taskQueueSize": 50,
|
|
304
|
+
"taskHandlerCount": 1,
|
|
305
|
+
"sessionMaxConcurrency": 20,
|
|
306
|
+
"includeThinking": false,
|
|
307
|
+
"resultOnly": true,
|
|
308
|
+
"debug": false,
|
|
309
|
+
"skipSandbox": false
|
|
310
|
+
}
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
#### Config Quick Reference
|
|
314
|
+
|
|
315
|
+
| Config | Description |
|
|
316
|
+
|--------|-------------|
|
|
317
|
+
| `whiteUserList` | Global whitelist (phone or userId) |
|
|
318
|
+
| `conversations[].whiteUserList` | Group-level whitelist, higher priority than global |
|
|
319
|
+
| `apiKeyCfg` | API Key pooling: auto-switch on 429, daily reset at midnight |
|
|
320
|
+
| `useLocalOcr` | Local image OCR (default `true`); set `false` if model supports images natively |
|
|
321
|
+
| `linkConversationId` | Link groups to share one Claude session context |
|
|
322
|
+
| `skipSandbox` | Skip sandbox for full filesystem access (default `false`) |
|
|
323
|
+
|
|
324
|
+
### Data Storage
|
|
325
|
+
|
|
326
|
+
All data is stored under `~/.cc-ding/{clientId}/`:
|
|
327
|
+
|
|
328
|
+
| Type | Path |
|
|
329
|
+
|------|------|
|
|
330
|
+
| Sessions | `{MD5}/.sessions/{claudeSessionId}/session.{json,log}` |
|
|
331
|
+
| Tasks | `{MD5}/.tasks/{timestamp}/task.{json,log}` |
|
|
332
|
+
| Cron jobs | `cron.json` |
|
|
333
|
+
| Image cache | `{MD5}/.images/` |
|
|
334
|
+
| Phone mapping | `phone-map.json` |
|
|
335
|
+
|
|
336
|
+
### Development
|
|
337
|
+
|
|
338
|
+
```bash
|
|
339
|
+
pnpm install
|
|
340
|
+
pnpm run lint
|
|
341
|
+
pnpm run test
|
|
342
|
+
pnpm run build
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
**Requirements:** Node.js >= 24
|
|
346
|
+
|
|
347
|
+
---
|
|
348
|
+
|
|
349
|
+
## Star History
|
|
350
|
+
|
|
351
|
+
[](https://github.com/yihuineng/cc-ding/stargazers)
|
|
352
|
+
|
|
353
|
+
## Contributors
|
|
190
354
|
|
|
191
|
-
-
|
|
355
|
+
[](https://github.com/yihuineng/cc-ding/graphs/contributors)
|
|
192
356
|
|
|
193
357
|
## License
|
|
194
358
|
|
package/dist/bin/cc-ding.js
CHANGED
|
@@ -8,7 +8,7 @@ Examples:
|
|
|
8
8
|
`).version((0,common_1.projUtil)().getPkgVersion()),program.command("init").description("\u521D\u59CB\u5316cc-ding\u914D\u7F6E\u6587\u4EF6, \u751F\u6210\u6700\u7B80config.json").requiredOption("-ci, --clientId <value>","clientId").requiredOption("-cs, --clientSecret <value>","clientSecret (\u9489\u9489Stream\u8FDE\u63A5\u5BC6\u94A5)").requiredOption("-m, --mobile <value>","mobile (\u81EA\u5DF1\u7684\u624B\u673A\u53F7, \u81EA\u52A8\u52A0\u5165\u767D\u540D\u5355)").option("-cn, --clientName <value>","clientName (\u673A\u5668\u4EBA\u540D\u79F0, \u53EF\u9009)").action(async e=>{const n=process.version.slice(1);parseInt(n.split(".")[0],10)<24&&(console.log(`
|
|
9
9
|
\u274C Node \u7248\u672C\u8FC7\u4F4E\uFF0C\u65E0\u6CD5\u6267\u884C init \u547D\u4EE4`),console.log(` \u5F53\u524D\u7248\u672C\uFF1A${n}`),console.log(" \u8981\u6C42\uFF1ANode >= 24"),console.log(`
|
|
10
10
|
\u{1F4A1} \u8BF7\u5347\u7EA7 Node \u7248\u672C\u540E\u91CD\u65B0\u8FD0\u884C
|
|
11
|
-
`),process.exit(1));const i=`${`${(0,session_1.getHomeDir)()}/.cc-ding/${e.clientId}`}/config.json`;fs_1.default.existsSync(i)&&(console.log(`\u914D\u7F6E\u6587\u4EF6\u5DF2\u5B58\u5728: ${i}`),console.log("\u5982\u9700\u91CD\u65B0\u521D\u59CB\u5316, \u8BF7\u5148\u5220\u9664\u5DF2\u6709\u914D\u7F6E\u6587\u4EF6"),process.exit(1));const t={clientName:e.clientName||"cc\u52A9\u624B",owner:e.mobile,whiteUserList:[e.mobile],clientSecret:e.clientSecret,defaultDingToken:"<\u515C\u5E95\u9489\u9489\u673A\u5668\u4EBAToken-\u7528\u4E8E\u65E0dingToken\u7FA4\u7684\u6D88\u606F\u63A5\u6536>",conversations:[],includeThinking:!1,resultOnly:!0,debug:!1,taskQueueSize:10,taskHandlerCount:1,sessionMaxConcurrency:20};(0,session_1.initClientDir)(e.clientId,t),console.log("\u914D\u7F6E\u6587\u4EF6\u5DF2\u751F\u6210:",i),console.log(""),console.log("\u540E\u7EED\u6B65\u9AA4:"),console.log(" 1. \u7F16\u8F91 config.json \u6DFB\u52A0 conversations \u914D\u7F6E(\u7FA4\u804A\u9700\u914D\u7F6EdingToken)"),console.log(" 2. \u542F\u52A8\u673A\u5668\u4EBA: cc-ding run -ci",e.clientId),console.log(" 3. \u63A8\u8350PM2\u542F\u52A8:"),console.log(` pm2 start --name "cc-ding-${e.clientId}" npx -- -p cc-ding cc-ding run -ci ${e.clientId}`)}),program.command("run").description(`
|
|
11
|
+
`),process.exit(1));const i=`${`${(0,session_1.getHomeDir)()}/.cc-ding/${e.clientId}`}/config.json`;fs_1.default.existsSync(i)&&(console.log(`\u914D\u7F6E\u6587\u4EF6\u5DF2\u5B58\u5728: ${i}`),console.log("\u5982\u9700\u91CD\u65B0\u521D\u59CB\u5316, \u8BF7\u5148\u5220\u9664\u5DF2\u6709\u914D\u7F6E\u6587\u4EF6"),process.exit(1));const t={clientName:e.clientName||"cc\u52A9\u624B",owner:e.mobile,whiteUserList:[e.mobile],clientSecret:e.clientSecret,defaultDingToken:"<\u515C\u5E95\u9489\u9489\u673A\u5668\u4EBAToken-\u7528\u4E8E\u65E0dingToken\u7FA4\u7684\u6D88\u606F\u63A5\u6536>",conversations:[],includeThinking:!1,resultOnly:!0,debug:!1,taskQueueSize:10,taskHandlerCount:1,sessionMaxConcurrency:20,skipSandbox:!1};(0,session_1.initClientDir)(e.clientId,t),console.log("\u914D\u7F6E\u6587\u4EF6\u5DF2\u751F\u6210:",i),console.log(""),console.log("\u540E\u7EED\u6B65\u9AA4:"),console.log(" 1. \u7F16\u8F91 config.json \u6DFB\u52A0 conversations \u914D\u7F6E(\u7FA4\u804A\u9700\u914D\u7F6EdingToken)"),console.log(" 2. \u542F\u52A8\u673A\u5668\u4EBA: cc-ding run -ci",e.clientId),console.log(" 3. \u63A8\u8350PM2\u542F\u52A8:"),console.log(` pm2 start --name "cc-ding-${e.clientId}" npx -- -p cc-ding cc-ding run -ci ${e.clientId}`)}),program.command("run").description(`
|
|
12
12
|
- \u529F\u80FD: \u9489\u9489\u673A\u5668\u4EBA\u5BF9\u63A5\u672C\u5730Claude, \u652F\u6301\u4F1A\u8BDD\u6A21\u5F0F\u548C\u4EFB\u52A1\u961F\u5217\u6A21\u5F0F
|
|
13
13
|
- \u4F1A\u8BDD\u6570\u636E\u8DEF\u5F84: ~/.cc-ding/{clientId}/{MD5}/.sessions/{claudeSessionId}/session.{json|log}
|
|
14
14
|
- \u4EFB\u52A1\u6570\u636E\u8DEF\u5F84: ~/.cc-ding/{clientId}/{MD5}/.tasks/{\u65F6\u95F4\u6233}/task.{json|log}
|