chatccc 0.2.82 → 0.2.84
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/package.json +63 -63
- package/src/adapters/codex-adapter.ts +16 -8
- package/src/adapters/cursor-adapter.ts +15 -7
- package/src/session.ts +4 -1
package/package.json
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "chatccc",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "Feishu bot bridge for Claude Code",
|
|
5
|
-
"license": "Apache-2.0",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"main": "./src/index.ts",
|
|
8
|
-
"bin": {
|
|
9
|
-
"chatccc": "bin/chatccc.mjs"
|
|
10
|
-
},
|
|
11
|
-
"files": [
|
|
12
|
-
"src/",
|
|
13
|
-
"bin/",
|
|
14
|
-
"scripts/postinstall-sharp-check.mjs",
|
|
15
|
-
"demo/ilink_echo_probe.ts",
|
|
16
|
-
"im-skills/",
|
|
17
|
-
"images/img_readme_*.jpg",
|
|
18
|
-
"images/img_readme_*.png",
|
|
19
|
-
"images/avatars/status_*.png",
|
|
20
|
-
"images/avatars/badges/",
|
|
21
|
-
"package.json",
|
|
22
|
-
"README.md",
|
|
23
|
-
"config.sample.json"
|
|
24
|
-
],
|
|
25
|
-
"scripts": {
|
|
26
|
-
"dev": "tsx src/index.ts",
|
|
27
|
-
"chatccc": "tsx src/index.ts",
|
|
28
|
-
"start": "tsx src/index.ts",
|
|
29
|
-
"demo:bot-test": "tsx demo/bot_test.ts",
|
|
30
|
-
"demo:bot-test:local": "tsx demo/bot_test.ts --local",
|
|
31
|
-
"demo:create-group": "tsx src/index.ts",
|
|
32
|
-
"demo:create-group:local": "tsx src/index.ts --local",
|
|
33
|
-
"demo:permission-check": "tsx demo/permission_check.ts",
|
|
34
|
-
"demo:claude-hi": "tsx demo/claude_say_hi.ts",
|
|
35
|
-
"demo:codex-hi": "tsx demo/codex_say_hi.ts",
|
|
36
|
-
"demo:ilink-echo": "tsx demo/ilink_echo_probe.ts",
|
|
37
|
-
"test": "vitest run",
|
|
38
|
-
"test:watch": "vitest",
|
|
39
|
-
"postinstall": "node scripts/postinstall-sharp-check.mjs"
|
|
40
|
-
},
|
|
41
|
-
"dependencies": {
|
|
42
|
-
"@ai-sdk/openai-compatible": "^2.0.47",
|
|
43
|
-
"@anthropic-ai/claude-agent-sdk": "0.2.133",
|
|
44
|
-
"@larksuiteoapi/node-sdk": "^1.59.0",
|
|
45
|
-
"@openilink/openilink-sdk-node": "^0.6.0",
|
|
46
|
-
"ai": "^6.0.184",
|
|
47
|
-
"nodemailer": "^8.0.7",
|
|
48
|
-
"qrcode-terminal": "^0.12.0",
|
|
49
|
-
"sharp": "^0.34.5",
|
|
50
|
-
"tsx": "^4.0.0",
|
|
51
|
-
"ws": "^8.18.0"
|
|
52
|
-
},
|
|
53
|
-
"devDependencies": {
|
|
54
|
-
"@types/node": "^20.0.0",
|
|
55
|
-
"@types/qrcode-terminal": "^0.12.2",
|
|
56
|
-
"@types/ws": "^8.18.1",
|
|
57
|
-
"typescript": "^5.0.0",
|
|
58
|
-
"vitest": "^3.2.4"
|
|
59
|
-
},
|
|
60
|
-
"engines": {
|
|
61
|
-
"node": ">=20"
|
|
62
|
-
}
|
|
63
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "chatccc",
|
|
3
|
+
"version": "0.2.84",
|
|
4
|
+
"description": "Feishu bot bridge for Claude Code",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./src/index.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"chatccc": "bin/chatccc.mjs"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"src/",
|
|
13
|
+
"bin/",
|
|
14
|
+
"scripts/postinstall-sharp-check.mjs",
|
|
15
|
+
"demo/ilink_echo_probe.ts",
|
|
16
|
+
"im-skills/",
|
|
17
|
+
"images/img_readme_*.jpg",
|
|
18
|
+
"images/img_readme_*.png",
|
|
19
|
+
"images/avatars/status_*.png",
|
|
20
|
+
"images/avatars/badges/",
|
|
21
|
+
"package.json",
|
|
22
|
+
"README.md",
|
|
23
|
+
"config.sample.json"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"dev": "tsx src/index.ts",
|
|
27
|
+
"chatccc": "tsx src/index.ts",
|
|
28
|
+
"start": "tsx src/index.ts",
|
|
29
|
+
"demo:bot-test": "tsx demo/bot_test.ts",
|
|
30
|
+
"demo:bot-test:local": "tsx demo/bot_test.ts --local",
|
|
31
|
+
"demo:create-group": "tsx src/index.ts",
|
|
32
|
+
"demo:create-group:local": "tsx src/index.ts --local",
|
|
33
|
+
"demo:permission-check": "tsx demo/permission_check.ts",
|
|
34
|
+
"demo:claude-hi": "tsx demo/claude_say_hi.ts",
|
|
35
|
+
"demo:codex-hi": "tsx demo/codex_say_hi.ts",
|
|
36
|
+
"demo:ilink-echo": "tsx demo/ilink_echo_probe.ts",
|
|
37
|
+
"test": "vitest run",
|
|
38
|
+
"test:watch": "vitest",
|
|
39
|
+
"postinstall": "node scripts/postinstall-sharp-check.mjs"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@ai-sdk/openai-compatible": "^2.0.47",
|
|
43
|
+
"@anthropic-ai/claude-agent-sdk": "0.2.133",
|
|
44
|
+
"@larksuiteoapi/node-sdk": "^1.59.0",
|
|
45
|
+
"@openilink/openilink-sdk-node": "^0.6.0",
|
|
46
|
+
"ai": "^6.0.184",
|
|
47
|
+
"nodemailer": "^8.0.7",
|
|
48
|
+
"qrcode-terminal": "^0.12.0",
|
|
49
|
+
"sharp": "^0.34.5",
|
|
50
|
+
"tsx": "^4.0.0",
|
|
51
|
+
"ws": "^8.18.0"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@types/node": "^20.0.0",
|
|
55
|
+
"@types/qrcode-terminal": "^0.12.2",
|
|
56
|
+
"@types/ws": "^8.18.1",
|
|
57
|
+
"typescript": "^5.0.0",
|
|
58
|
+
"vitest": "^3.2.4"
|
|
59
|
+
},
|
|
60
|
+
"engines": {
|
|
61
|
+
"node": ">=20"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -193,15 +193,23 @@ async function* readJsonLines(
|
|
|
193
193
|
signal?: AbortSignal,
|
|
194
194
|
): AsyncGenerator<CodexEvent> {
|
|
195
195
|
const rl = createInterface({ input: proc.stdout!, crlfDelay: Infinity });
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
196
|
+
// abort 时主动 close readline,避免等待 Windows 管道自然关闭(可能延迟数分钟)
|
|
197
|
+
const onAbort = () => { rl.close(); };
|
|
198
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
199
|
+
try {
|
|
200
|
+
for await (const line of rl) {
|
|
201
|
+
if (signal?.aborted) break;
|
|
202
|
+
const trimmed = line.trim();
|
|
203
|
+
if (!trimmed) continue;
|
|
204
|
+
try {
|
|
205
|
+
yield JSON.parse(trimmed) as CodexEvent;
|
|
206
|
+
} catch {
|
|
207
|
+
// 非 JSON 行静默跳过(如 "Reading prompt from stdin...")
|
|
208
|
+
}
|
|
204
209
|
}
|
|
210
|
+
} finally {
|
|
211
|
+
signal?.removeEventListener("abort", onAbort);
|
|
212
|
+
rl.close();
|
|
205
213
|
}
|
|
206
214
|
}
|
|
207
215
|
|
|
@@ -289,13 +289,21 @@ async function* readJsonLines(
|
|
|
289
289
|
signal?: AbortSignal,
|
|
290
290
|
): AsyncGenerator<CursorMessageLine> {
|
|
291
291
|
const rl = createInterface({ input: proc.stdout!, crlfDelay: Infinity });
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
292
|
+
// abort 时主动 close readline,避免等待 Windows 管道自然关闭(可能延迟数分钟)
|
|
293
|
+
const onAbort = () => { rl.close(); };
|
|
294
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
295
|
+
try {
|
|
296
|
+
for await (const line of rl) {
|
|
297
|
+
if (signal?.aborted) break;
|
|
298
|
+
const trimmed = line.trim();
|
|
299
|
+
if (!trimmed) continue;
|
|
300
|
+
try {
|
|
301
|
+
yield JSON.parse(trimmed) as CursorMessageLine;
|
|
302
|
+
} catch { /* 非 JSON 行静默跳过 */ }
|
|
303
|
+
}
|
|
304
|
+
} finally {
|
|
305
|
+
signal?.removeEventListener("abort", onAbort);
|
|
306
|
+
rl.close();
|
|
299
307
|
}
|
|
300
308
|
}
|
|
301
309
|
|
package/src/session.ts
CHANGED
|
@@ -1153,7 +1153,10 @@ export function ensureDisplayLoop(sessionId: string): void {
|
|
|
1153
1153
|
const oldDisplayContent = truncateContent(state.accumulatedContent + state.finalReply) || "处理中...";
|
|
1154
1154
|
const oldCard = buildProgressCard(oldDisplayContent, { showStop: false, headerTitle: "生成中...(上轮)" });
|
|
1155
1155
|
await p.cardUpdate(display.cardId, oldCard, oldSeqBase + 1).catch(() => {});
|
|
1156
|
-
const newCardId = await p.cardCreate(buildProgressCard(
|
|
1156
|
+
const newCardId = await p.cardCreate(buildProgressCard(
|
|
1157
|
+
truncateContent(state.accumulatedContent) || "处理中...",
|
|
1158
|
+
{ showStop: true, headerTitle: "生成中..." },
|
|
1159
|
+
));
|
|
1157
1160
|
if (newCardId) {
|
|
1158
1161
|
await p.cardSend(chatId, newCardId);
|
|
1159
1162
|
display.cardId = newCardId;
|