chatccc 0.2.277 → 0.2.279

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.
@@ -5,7 +5,7 @@ description: Create, clone, or configure a Feishu enterprise self-built bot appl
5
5
 
6
6
  # Create a ChatCCC Feishu App
7
7
 
8
- Use the logged-in Feishu developer console to create and completely configure a ChatCCC bot app. Treat this repository's README as the minimum requirement and the existing app named exactly lowercase `chatccc` as the configuration template.
8
+ Use the logged-in Feishu developer console to create and completely configure a ChatCCC bot app. Treat this repository's README as the authoritative source for permissions and required capabilities. When imitation is requested, use the existing app named exactly lowercase `chatccc` only as a template for presentation, subscriptions, and release settings.
9
9
 
10
10
  ## 1. Establish the target and authorization
11
11
 
@@ -21,13 +21,12 @@ Use the logged-in Feishu developer console to create and completely configure a
21
21
  3. Record its non-secret configuration:
22
22
  - app description and icon;
23
23
  - application capabilities, especially `机器人`;
24
- - every granted permission and its identity type;
25
24
  - event and callback subscription modes;
26
25
  - every event and callback identifier;
27
26
  - version availability, external sharing choices, and release state.
28
27
  4. Never reveal, log, export to chat, or persist the template App Secret.
29
28
 
30
- Prefer current console data over a stale hard-coded list. At the time this workflow was verified, lowercase `chatccc` had 62 application-identity permissions, one user-identity permission, 12 application events, and one callback. Use those counts as a sanity check, not as a replacement for inspecting the template.
29
+ Do not use the template's permission set or permission counts as the source of truth. Permissions must always follow the current README rule below. Prefer current console data over a stale hard-coded list for the remaining template settings.
31
30
 
32
31
  ## 3. Create the target app
33
32
 
@@ -36,16 +35,17 @@ Prefer current console data over a stale hard-coded list. At the time this workf
36
35
  3. Click the final `创建` action only after confirmation.
37
36
  4. Click once and wait for SPA navigation. Verify the exact app name, App ID, URL, and status before retrying; the console can temporarily show stale text after a successful mutation.
38
37
 
39
- ## 4. Clone the complete ChatCCC configuration
38
+ ## 4. Configure the complete README-defined ChatCCC setup
40
39
 
41
40
  Perform the configuration in this order:
42
41
 
43
42
  1. Add the `机器人` application capability and verify that the page offers `删除能力`, which means the capability is enabled.
44
- 2. Clone permissions with `权限管理` > `批量处理` > `批量导入/导出权限`:
45
- - export from lowercase `chatccc`;
46
- - import into the target app;
47
- - confirm all additions and verify both application-identity and user-identity totals;
48
- - do not save the export JSON in the repository or chat.
43
+ 2. Configure permissions from the README, not from the lowercase template:
44
+ - under `权限管理`, search for the `im:` prefix and enable every permission whose name starts with `im:`;
45
+ - search for the `cardkit:` prefix and enable every permission whose name starts with `cardkit:`;
46
+ - separately search for the exact scope `im:message.p2p_msg:readonly` and verify that it is enabled. This private-message read permission is easy to miss and must not be inferred from other message permissions;
47
+ - confirm all permission changes and complete any required administrator approval;
48
+ - do not use template permission export/import as an authoritative shortcut, because the template may be incomplete or stale.
49
49
  3. Under `事件与回调` > `事件配置`, set the subscription mode to `使用长连接接收事件`, then add every event present in the template. The verified baseline is:
50
50
  - `im.chat.disbanded_v1`
51
51
  - `im.chat.member.bot.added_v1`
@@ -62,7 +62,7 @@ Perform the configuration in this order:
62
62
  4. Under `回调配置`, independently set `使用长连接接收回调` and add `card.action.trigger`. Configuring the event mode does not configure the callback mode.
63
63
  5. Verify that every listed event shows a sufficient permission as `已开通`.
64
64
 
65
- The README minimum is the bot capability, relevant `im:` and `cardkit:` permissions, `im.message.receive_v1`, and `card.action.trigger`; a clone request requires the complete current template configuration, not only that minimum.
65
+ The README requires the bot capability, every permission whose name starts with `im:` or `cardkit:`, explicit verification of `im:message.p2p_msg:readonly`, `im.message.receive_v1`, and `card.action.trigger`. A clone request may copy the current template's presentation, subscriptions, availability, and release settings, but it must not weaken the README permission rule.
66
66
 
67
67
  ## 5. Create and publish a version
68
68
 
@@ -78,8 +78,8 @@ The README minimum is the bot capability, relevant `im:` and `cardkit:` permissi
78
78
 
79
79
  ## 6. Verify and hand off safely
80
80
 
81
- - Re-open the bot, permission, event/callback, and version pages after publication. Verify the bot is enabled, permission identity counts match, both subscription modes are long connection, event/callback identifiers match, and the version is published.
81
+ - Re-open the bot, permission, event/callback, and version pages after publication. Verify the bot is enabled, all current `im:` and `cardkit:` permissions are enabled, `im:message.p2p_msg:readonly` is explicitly present, both subscription modes are long connection, event/callback identifiers match, and the version is published.
82
82
  - Treat network responses and a refreshed page as stronger evidence than an immediately stale SPA view. Never repeat a create, add, or publish action only because the first page read is stale.
83
- - Report the app name, App ID, capability, permission counts, event/callback counts, version, release state, and any remaining action.
83
+ - Report the app name, App ID, capability, whether the README permission checks passed, event/callback counts, version, release state, and any remaining action.
84
84
  - Never print the App Secret. If the user explicitly asks to configure ChatCCC, transfer the App ID and App Secret directly into the local private configuration without echoing the secret in commands, logs, screenshots, files tracked by Git, or chat.
85
85
  - Do not modify local ChatCCC configuration or transmit credentials elsewhere unless explicitly authorized.
@@ -5,7 +5,7 @@ description: Create, clone, or configure a Feishu enterprise self-built bot appl
5
5
 
6
6
  # Create a ChatCCC Feishu App
7
7
 
8
- Use the logged-in Feishu developer console to create and completely configure a ChatCCC bot app. Treat this repository's README as the minimum requirement and the existing app named exactly lowercase `chatccc` as the configuration template.
8
+ Use the logged-in Feishu developer console to create and completely configure a ChatCCC bot app. Treat this repository's README as the authoritative source for permissions and required capabilities. When imitation is requested, use the existing app named exactly lowercase `chatccc` only as a template for presentation, subscriptions, and release settings.
9
9
 
10
10
  ## 1. Establish the target and authorization
11
11
 
@@ -21,13 +21,12 @@ Use the logged-in Feishu developer console to create and completely configure a
21
21
  3. Record its non-secret configuration:
22
22
  - app description and icon;
23
23
  - application capabilities, especially `机器人`;
24
- - every granted permission and its identity type;
25
24
  - event and callback subscription modes;
26
25
  - every event and callback identifier;
27
26
  - version availability, external sharing choices, and release state.
28
27
  4. Never reveal, log, export to chat, or persist the template App Secret.
29
28
 
30
- Prefer current console data over a stale hard-coded list. At the time this workflow was verified, lowercase `chatccc` had 62 application-identity permissions, one user-identity permission, 12 application events, and one callback. Use those counts as a sanity check, not as a replacement for inspecting the template.
29
+ Do not use the template's permission set or permission counts as the source of truth. Permissions must always follow the current README rule below. Prefer current console data over a stale hard-coded list for the remaining template settings.
31
30
 
32
31
  ## 3. Create the target app
33
32
 
@@ -36,16 +35,17 @@ Prefer current console data over a stale hard-coded list. At the time this workf
36
35
  3. Click the final `创建` action only after confirmation.
37
36
  4. Click once and wait for SPA navigation. Verify the exact app name, App ID, URL, and status before retrying; the console can temporarily show stale text after a successful mutation.
38
37
 
39
- ## 4. Clone the complete ChatCCC configuration
38
+ ## 4. Configure the complete README-defined ChatCCC setup
40
39
 
41
40
  Perform the configuration in this order:
42
41
 
43
42
  1. Add the `机器人` application capability and verify that the page offers `删除能力`, which means the capability is enabled.
44
- 2. Clone permissions with `权限管理` > `批量处理` > `批量导入/导出权限`:
45
- - export from lowercase `chatccc`;
46
- - import into the target app;
47
- - confirm all additions and verify both application-identity and user-identity totals;
48
- - do not save the export JSON in the repository or chat.
43
+ 2. Configure permissions from the README, not from the lowercase template:
44
+ - under `权限管理`, search for the `im:` prefix and enable every permission whose name starts with `im:`;
45
+ - search for the `cardkit:` prefix and enable every permission whose name starts with `cardkit:`;
46
+ - separately search for the exact scope `im:message.p2p_msg:readonly` and verify that it is enabled. This private-message read permission is easy to miss and must not be inferred from other message permissions;
47
+ - confirm all permission changes and complete any required administrator approval;
48
+ - do not use template permission export/import as an authoritative shortcut, because the template may be incomplete or stale.
49
49
  3. Under `事件与回调` > `事件配置`, set the subscription mode to `使用长连接接收事件`, then add every event present in the template. The verified baseline is:
50
50
  - `im.chat.disbanded_v1`
51
51
  - `im.chat.member.bot.added_v1`
@@ -62,7 +62,7 @@ Perform the configuration in this order:
62
62
  4. Under `回调配置`, independently set `使用长连接接收回调` and add `card.action.trigger`. Configuring the event mode does not configure the callback mode.
63
63
  5. Verify that every listed event shows a sufficient permission as `已开通`.
64
64
 
65
- The README minimum is the bot capability, relevant `im:` and `cardkit:` permissions, `im.message.receive_v1`, and `card.action.trigger`; a clone request requires the complete current template configuration, not only that minimum.
65
+ The README requires the bot capability, every permission whose name starts with `im:` or `cardkit:`, explicit verification of `im:message.p2p_msg:readonly`, `im.message.receive_v1`, and `card.action.trigger`. A clone request may copy the current template's presentation, subscriptions, availability, and release settings, but it must not weaken the README permission rule.
66
66
 
67
67
  ## 5. Create and publish a version
68
68
 
@@ -78,8 +78,8 @@ The README minimum is the bot capability, relevant `im:` and `cardkit:` permissi
78
78
 
79
79
  ## 6. Verify and hand off safely
80
80
 
81
- - Re-open the bot, permission, event/callback, and version pages after publication. Verify the bot is enabled, permission identity counts match, both subscription modes are long connection, event/callback identifiers match, and the version is published.
81
+ - Re-open the bot, permission, event/callback, and version pages after publication. Verify the bot is enabled, all current `im:` and `cardkit:` permissions are enabled, `im:message.p2p_msg:readonly` is explicitly present, both subscription modes are long connection, event/callback identifiers match, and the version is published.
82
82
  - Treat network responses and a refreshed page as stronger evidence than an immediately stale SPA view. Never repeat a create, add, or publish action only because the first page read is stale.
83
- - Report the app name, App ID, capability, permission counts, event/callback counts, version, release state, and any remaining action.
83
+ - Report the app name, App ID, capability, whether the README permission checks passed, event/callback counts, version, release state, and any remaining action.
84
84
  - Never print the App Secret. If the user explicitly asks to configure ChatCCC, transfer the App ID and App Secret directly into the local private configuration without echoing the secret in commands, logs, screenshots, files tracked by Git, or chat.
85
85
  - Do not modify local ChatCCC configuration or transmit credentials elsewhere unless explicitly authorized.
@@ -5,7 +5,7 @@ description: Create, clone, or configure a Feishu enterprise self-built bot appl
5
5
 
6
6
  # Create a ChatCCC Feishu App
7
7
 
8
- Use the logged-in Feishu developer console to create and completely configure a ChatCCC bot app. Treat this repository's README as the minimum requirement and the existing app named exactly lowercase `chatccc` as the configuration template.
8
+ Use the logged-in Feishu developer console to create and completely configure a ChatCCC bot app. Treat this repository's README as the authoritative source for permissions and required capabilities. When imitation is requested, use the existing app named exactly lowercase `chatccc` only as a template for presentation, subscriptions, and release settings.
9
9
 
10
10
  ## 1. Establish the target and authorization
11
11
 
@@ -21,13 +21,12 @@ Use the logged-in Feishu developer console to create and completely configure a
21
21
  3. Record its non-secret configuration:
22
22
  - app description and icon;
23
23
  - application capabilities, especially `机器人`;
24
- - every granted permission and its identity type;
25
24
  - event and callback subscription modes;
26
25
  - every event and callback identifier;
27
26
  - version availability, external sharing choices, and release state.
28
27
  4. Never reveal, log, export to chat, or persist the template App Secret.
29
28
 
30
- Prefer current console data over a stale hard-coded list. At the time this workflow was verified, lowercase `chatccc` had 62 application-identity permissions, one user-identity permission, 12 application events, and one callback. Use those counts as a sanity check, not as a replacement for inspecting the template.
29
+ Do not use the template's permission set or permission counts as the source of truth. Permissions must always follow the current README rule below. Prefer current console data over a stale hard-coded list for the remaining template settings.
31
30
 
32
31
  ## 3. Create the target app
33
32
 
@@ -36,16 +35,17 @@ Prefer current console data over a stale hard-coded list. At the time this workf
36
35
  3. Click the final `创建` action only after confirmation.
37
36
  4. Click once and wait for SPA navigation. Verify the exact app name, App ID, URL, and status before retrying; the console can temporarily show stale text after a successful mutation.
38
37
 
39
- ## 4. Clone the complete ChatCCC configuration
38
+ ## 4. Configure the complete README-defined ChatCCC setup
40
39
 
41
40
  Perform the configuration in this order:
42
41
 
43
42
  1. Add the `机器人` application capability and verify that the page offers `删除能力`, which means the capability is enabled.
44
- 2. Clone permissions with `权限管理` > `批量处理` > `批量导入/导出权限`:
45
- - export from lowercase `chatccc`;
46
- - import into the target app;
47
- - confirm all additions and verify both application-identity and user-identity totals;
48
- - do not save the export JSON in the repository or chat.
43
+ 2. Configure permissions from the README, not from the lowercase template:
44
+ - under `权限管理`, search for the `im:` prefix and enable every permission whose name starts with `im:`;
45
+ - search for the `cardkit:` prefix and enable every permission whose name starts with `cardkit:`;
46
+ - separately search for the exact scope `im:message.p2p_msg:readonly` and verify that it is enabled. This private-message read permission is easy to miss and must not be inferred from other message permissions;
47
+ - confirm all permission changes and complete any required administrator approval;
48
+ - do not use template permission export/import as an authoritative shortcut, because the template may be incomplete or stale.
49
49
  3. Under `事件与回调` > `事件配置`, set the subscription mode to `使用长连接接收事件`, then add every event present in the template. The verified baseline is:
50
50
  - `im.chat.disbanded_v1`
51
51
  - `im.chat.member.bot.added_v1`
@@ -62,7 +62,7 @@ Perform the configuration in this order:
62
62
  4. Under `回调配置`, independently set `使用长连接接收回调` and add `card.action.trigger`. Configuring the event mode does not configure the callback mode.
63
63
  5. Verify that every listed event shows a sufficient permission as `已开通`.
64
64
 
65
- The README minimum is the bot capability, relevant `im:` and `cardkit:` permissions, `im.message.receive_v1`, and `card.action.trigger`; a clone request requires the complete current template configuration, not only that minimum.
65
+ The README requires the bot capability, every permission whose name starts with `im:` or `cardkit:`, explicit verification of `im:message.p2p_msg:readonly`, `im.message.receive_v1`, and `card.action.trigger`. A clone request may copy the current template's presentation, subscriptions, availability, and release settings, but it must not weaken the README permission rule.
66
66
 
67
67
  ## 5. Create and publish a version
68
68
 
@@ -78,8 +78,8 @@ The README minimum is the bot capability, relevant `im:` and `cardkit:` permissi
78
78
 
79
79
  ## 6. Verify and hand off safely
80
80
 
81
- - Re-open the bot, permission, event/callback, and version pages after publication. Verify the bot is enabled, permission identity counts match, both subscription modes are long connection, event/callback identifiers match, and the version is published.
81
+ - Re-open the bot, permission, event/callback, and version pages after publication. Verify the bot is enabled, all current `im:` and `cardkit:` permissions are enabled, `im:message.p2p_msg:readonly` is explicitly present, both subscription modes are long connection, event/callback identifiers match, and the version is published.
82
82
  - Treat network responses and a refreshed page as stronger evidence than an immediately stale SPA view. Never repeat a create, add, or publish action only because the first page read is stale.
83
- - Report the app name, App ID, capability, permission counts, event/callback counts, version, release state, and any remaining action.
83
+ - Report the app name, App ID, capability, whether the README permission checks passed, event/callback counts, version, release state, and any remaining action.
84
84
  - Never print the App Secret. If the user explicitly asks to configure ChatCCC, transfer the App ID and App Secret directly into the local private configuration without echoing the secret in commands, logs, screenshots, files tracked by Git, or chat.
85
85
  - Do not modify local ChatCCC configuration or transmit credentials elsewhere unless explicitly authorized.
package/README.md CHANGED
@@ -182,12 +182,15 @@ npm run dev
182
182
 
183
183
  1. 打开 [飞书开放平台](https://open.feishu.cn),创建一个**企业自建应用**。
184
184
  2. 在「应用功能」里开启**机器人**能力。
185
- 3. 在「权限管理」里开通 `im:` `cardkit:` 前缀下的相关权限:
185
+ 3. 在「权限管理」里开通**所有权限名称以 `im:` `cardkit:` 开头的权限**。不要只依赖事件页面自动推荐的权限;开通后应分别搜索这两个前缀并逐项确认:
186
186
 
187
187
  | 前缀 | 用途 |
188
188
  | --- | --- |
189
- | `im:` | 收发消息、创建和管理群聊、机器人发言 |
190
- | `cardkit:` | 卡片展示、流式更新、按钮和交互回调 |
189
+ | `im:` | 全部开通,用于收发消息、创建和管理群聊、机器人发言等 |
190
+ | `cardkit:` | 全部开通,用于卡片展示、流式更新、按钮和交互回调等 |
191
+
192
+ > [!IMPORTANT]
193
+ > 请额外单独搜索并确认已开通 `im:message.p2p_msg:readonly`(获取用户发给机器人的单聊消息)。这个权限在飞书开发者后台配置时容易遗漏;缺少它可能导致 ChatCCC 无法正常识别或处理私聊消息。
191
194
 
192
195
  <p align="center">
193
196
  <img src="images/img_readme_permission.png" alt="飞书应用权限配置" width="280" />
@@ -71,6 +71,13 @@ function resolveCodexEffort() {
71
71
  // normalizeCodexMessage — Codex 事件 → UnifiedStreamMessage | null
72
72
  // ---------------------------------------------------------------------------
73
73
  export function normalizeCodexMessage(msg) {
74
+ if (msg.type === "error" && msg.message?.trim()) {
75
+ throw new Error(`Codex turn failed: ${msg.message.trim()}`);
76
+ }
77
+ if (msg.type === "turn.failed") {
78
+ const detail = typeof msg.error === "string" ? msg.error : msg.error?.message;
79
+ throw new Error(`Codex turn failed: ${detail?.trim() || "unknown Codex error"}`);
80
+ }
74
81
  // agent_message 只是 Codex 的一条阶段性文本 item。即使内容看起来像完整答复,
75
82
  // 后面仍可能继续发出工具调用,因此不能用它关闭 response-stall watchdog。
76
83
  if (msg.type === "item.completed" &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chatccc",
3
- "version": "0.2.277",
3
+ "version": "0.2.279",
4
4
  "description": "Feishu bot bridge for Claude Code",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",