qq-codex-bridge 0.1.2 → 0.1.3

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.
@@ -11,9 +11,10 @@ export class ThreadCommandHandler {
11
11
  return false;
12
12
  }
13
13
  const text = message.text.trim();
14
- if (!this.isSupportedCommand(text)) {
14
+ if (!text.startsWith("/")) {
15
15
  return false;
16
16
  }
17
+ const supportedCommand = this.isSupportedCommand(text);
17
18
  const alreadySeen = await this.deps.transcriptStore.hasInbound(message.messageId);
18
19
  if (alreadySeen) {
19
20
  return true;
@@ -25,6 +26,10 @@ export class ThreadCommandHandler {
25
26
  }
26
27
  await this.ensureSessionExists(message);
27
28
  await this.deps.transcriptStore.recordInbound(message);
29
+ if (!supportedCommand) {
30
+ await this.deliverControlReply(message, this.buildUnknownCommandText(text));
31
+ return;
32
+ }
28
33
  if (text === "/threads" || text === "/t") {
29
34
  const threads = await this.deps.desktopDriver.listRecentThreads(20);
30
35
  await this.deliverControlReply(message, this.formatThreads(threads));
@@ -209,10 +214,19 @@ export class ThreadCommandHandler {
209
214
  "| 查看当前运行状态 | `/status` | `/st` |",
210
215
  "| 查看帮助 | `/help` | `/h` |",
211
216
  "",
217
+ "所有 `/` 开头的桥接快捷指令都会先由桥接层处理,不会直接发给 Codex。",
212
218
  "建议先发 `/t` 看列表,再用 `/tu 2` 这种方式切换。",
213
219
  "模型和额度信息来自当前 Codex Desktop 界面,可见性取决于 UI 是否暴露对应信息。"
214
220
  ].join("\n");
215
221
  }
222
+ buildUnknownCommandText(text) {
223
+ return [
224
+ `未识别的桥接快捷指令:\`${text}\``,
225
+ "这条 `/` 指令不会转发给 Codex。",
226
+ "",
227
+ this.buildHelpText()
228
+ ].join("\n");
229
+ }
216
230
  formatModelReply(state) {
217
231
  return [
218
232
  `当前模型:${state.model ?? "未识别"}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qq-codex-bridge",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "A bridge between QQ Official Bot and Codex Desktop, with media relay, STT, thread management, and incremental reply delivery.",
5
5
  "type": "module",
6
6
  "homepage": "https://github.com/983033995/qq-codex-bridge",