codex-to-im 1.0.23 → 1.0.27

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 CHANGED
@@ -102,6 +102,20 @@ codex-to-im status
102
102
  codex-to-im stop
103
103
  ```
104
104
 
105
+ ### 卸载
106
+
107
+ ```bash
108
+ codex-to-im uninstall
109
+ ```
110
+
111
+ 说明:
112
+
113
+ - 该命令会停止本地 UI、停止 bridge,并尝试移除已安装的 bridge 开机自启动任务。
114
+ - 当前命令退出后,后台会尝试执行 `npm uninstall -g codex-to-im`;这一步不是立即完成。
115
+ - 可根据输出中的日志路径确认后台卸载结果;如果几秒后 `codex-to-im` 仍可执行,请手动运行 `npm uninstall -g codex-to-im`。
116
+ - 该命令不会删除 `~/.codex-to-im` 下的配置、日志和会话数据。
117
+ - 该命令也不会删除 `~/.codex/skills/codex-to-im`;如需彻底清理,请手动删除相关目录。
118
+
105
119
  ## 典型使用方式
106
120
 
107
121
  ### 1. 接管桌面线程
package/README_EN.md CHANGED
@@ -102,6 +102,20 @@ If you want to stop the local UI and bridge:
102
102
  codex-to-im stop
103
103
  ```
104
104
 
105
+ ### Uninstall
106
+
107
+ ```bash
108
+ codex-to-im uninstall
109
+ ```
110
+
111
+ Notes:
112
+
113
+ - This command stops the local UI, stops the bridge, and attempts to remove the installed bridge boot task if present.
114
+ - After the command exits, a background helper attempts to run `npm uninstall -g codex-to-im`; this step is not immediate.
115
+ - Check the log path printed by the command to confirm the uninstall result. If `codex-to-im` is still available a few seconds later, run `npm uninstall -g codex-to-im` manually.
116
+ - This command does not delete local config, logs, or session data under `~/.codex-to-im`.
117
+ - This command also does not delete `~/.codex/skills/codex-to-im`; remove those directories manually if you want a full local cleanup.
118
+
105
119
  ## Typical Workflows
106
120
 
107
121
  ### 1. Take over a desktop thread
package/dist/cli.mjs CHANGED
@@ -657,9 +657,12 @@ async function main() {
657
657
  [
658
658
  `Stopped services. UI running=${result.ui.running ? "yes" : "no"}, Bridge running=${result.bridge.running ? "yes" : "no"}`,
659
659
  result.autostart.installed ? `Bridge autostart still installed: ${result.autostart.taskName}` : "Bridge autostart removed.",
660
- `Global npm uninstall scheduled via ${result.npmCommand}.`,
660
+ `Background npm uninstall scheduled via ${result.npmCommand}.`,
661
661
  `Log: ${result.logPath}`,
662
- "\u5F53\u524D\u547D\u4EE4\u9000\u51FA\u540E\uFF0C\u540E\u53F0\u4F1A\u7EE7\u7EED\u6267\u884C\u5168\u5C40\u5378\u8F7D\u3002"
662
+ "\u5F53\u524D\u547D\u4EE4\u9000\u51FA\u540E\uFF0C\u540E\u53F0\u4F1A\u5C1D\u8BD5\u6267\u884C npm uninstall -g codex-to-im\u3002",
663
+ "\u8FD9\u4E00\u6B65\u4E0D\u662F\u7ACB\u5373\u5B8C\u6210\uFF1B\u5982\u9700\u786E\u8BA4\u7ED3\u679C\uFF0C\u8BF7\u67E5\u770B\u4E0A\u9762\u7684\u65E5\u5FD7\u6587\u4EF6\u3002",
664
+ "\u5982\u679C\u51E0\u79D2\u540E codex-to-im \u4ECD\u53EF\u6267\u884C\uFF0C\u8BF7\u624B\u52A8\u8FD0\u884C\uFF1Anpm uninstall -g codex-to-im",
665
+ "\u672C\u547D\u4EE4\u4E0D\u4F1A\u5220\u9664 ~/.codex-to-im \u6216 ~/.codex/skills/codex-to-im\uFF0C\u8BF7\u6309\u9700\u624B\u52A8\u5220\u9664\u3002"
663
666
  ].join("\n") + "\n"
664
667
  );
665
668
  return;
package/dist/daemon.mjs CHANGED
@@ -17230,8 +17230,10 @@ function buildIndexedCommandList(title, items, footer = [], markdown = false) {
17230
17230
  return lines.join("\n").trim();
17231
17231
  }
17232
17232
  function buildDesktopThreadsCommandResponse(desktopSessions, markdown, showAll, limit = 10) {
17233
+ const actualCount = desktopSessions.length;
17234
+ const title = showAll ? `\u684C\u9762\u4F1A\u8BDD\uFF08\u5F53\u524D\u663E\u793A ${actualCount} \u6761\uFF0C\u6700\u591A ${MAX_DESKTOP_THREAD_LIST_LIMIT} \u6761\uFF09` : `\u6700\u8FD1 ${actualCount} \u6761\u684C\u9762\u4F1A\u8BDD`;
17233
17235
  return buildIndexedCommandList(
17234
- showAll ? `\u684C\u9762\u4F1A\u8BDD\uFF08\u6700\u591A ${MAX_DESKTOP_THREAD_LIST_LIMIT} \u6761\uFF09` : `\u6700\u8FD1 ${limit} \u6761\u684C\u9762\u4F1A\u8BDD`,
17236
+ title,
17235
17237
  desktopSessions.map((session) => ({
17236
17238
  heading: session.title || "\u672A\u547D\u540D\u7EBF\u7A0B",
17237
17239
  details: [
@@ -18094,7 +18096,7 @@ function getMirrorAssistantRuntimeLabel() {
18094
18096
  }
18095
18097
  function buildMirrorTitle(threadTitle, markdown = false) {
18096
18098
  const title = threadTitle?.trim() || "\u684C\u9762\u7EBF\u7A0B";
18097
- const rendered = markdown ? `&lt;${title}&gt;` : `<${title}>`;
18099
+ const rendered = markdown ? `\`<${title}>\`` : `<${title}>`;
18098
18100
  return markdown ? `**${rendered}**` : rendered;
18099
18101
  }
18100
18102
  function buildMirrorSpeakerLabel(label, markdown = false) {
@@ -19397,7 +19399,7 @@ async function handleCommand(adapter, msg, text2) {
19397
19399
  );
19398
19400
  break;
19399
19401
  }
19400
- const displayedThreads = getDisplayedDesktopThreads(DEFAULT_DESKTOP_THREAD_LIST_LIMIT);
19402
+ const displayedThreads = getDisplayedDesktopThreads(MAX_DESKTOP_THREAD_LIST_LIMIT);
19401
19403
  const threadPick = resolveByIndexOrPrefix(args, displayedThreads, (session) => session.threadId);
19402
19404
  if (threadPick.ambiguous) {
19403
19405
  response = "\u5339\u914D\u5230\u591A\u4E2A\u684C\u9762\u4F1A\u8BDD\uFF0C\u8BF7\u5148\u53D1\u9001 `/t` \u67E5\u770B\u5217\u8868\uFF0C\u518D\u7528 `/t 1` \u8FD9\u79CD\u5E8F\u53F7\u5207\u6362\u3002";
@@ -19428,6 +19430,10 @@ async function handleCommand(adapter, msg, text2) {
19428
19430
  );
19429
19431
  break;
19430
19432
  }
19433
+ if (threadPick.index !== void 0) {
19434
+ response = displayedThreads.length > 0 ? `\u5F53\u524D\u53EA\u627E\u5230 ${displayedThreads.length} \u6761\u684C\u9762\u4F1A\u8BDD\uFF0C\u6CA1\u6709\u7B2C ${threadPick.index} \u6761\u3002\u5148\u53D1\u9001 \`/t\` \u67E5\u770B\u6700\u8FD1\u4F1A\u8BDD\uFF0C\u6216\u53D1\u9001 \`/t all\` \u67E5\u770B\u66F4\u591A\u540E\u518D\u9009\u62E9\u3002` : "\u6CA1\u6709\u627E\u5230\u684C\u9762\u4F1A\u8BDD\u3002\u5148\u5728 Codex Desktop App \u4E2D\u6253\u5F00\u4E00\u4E2A\u4F1A\u8BDD\uFF0C\u518D\u56DE\u6765\u8BD5\u4E00\u6B21\u3002";
19435
+ break;
19436
+ }
19431
19437
  response = "\u6CA1\u6709\u627E\u5230\u5BF9\u5E94\u7684\u684C\u9762\u4F1A\u8BDD\u3002\u5148\u53D1\u9001 `/t` \u67E5\u770B\u6700\u8FD1\u4F1A\u8BDD\uFF0C\u518D\u7528 `/t 1` \u63A5\u7BA1\u3002";
19432
19438
  break;
19433
19439
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codex-to-im",
3
- "version": "1.0.23",
3
+ "version": "1.0.27",
4
4
  "description": "Installable Codex-to-IM bridge with local setup UI and background service",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/zhangle1987/codex-to-im#readme",
@@ -1,138 +0,0 @@
1
- # Codex-to-IM legacy env snapshot / migration reference
2
- # The primary runtime config is now ~/.codex-to-im/config.v2.json and is
3
- # normally managed from the Web workbench.
4
- # This file is kept only for:
5
- # 1. migrating old single-instance setups to v2
6
- # 2. compatibility snapshots / old tooling fallback
7
- # It no longer fully represents multi-instance channel configuration.
8
-
9
- # Runtime backend: claude | codex | auto
10
- # claude — uses Claude Code CLI + @anthropic-ai/claude-agent-sdk
11
- # codex (default) — uses @openai/codex-sdk (auth: codex auth login, or OPENAI_API_KEY)
12
- # auto — tries Claude first, falls back to Codex if CLI not found
13
- CTI_RUNTIME=codex
14
-
15
- # Legacy provider enable list (still used by non-v2 providers such as
16
- # telegram / discord / qq; Feishu and Weixin are now configured as channel
17
- # instances in config.v2.json).
18
- CTI_ENABLED_CHANNELS=feishu
19
-
20
- # Default workspace root for `/new proj1` style project creation.
21
- # When unset, codex-to-im falls back to `~/cx2im`
22
- # and expands it per OS (Windows/macOS/Linux).
23
- # CTI_DEFAULT_WORKSPACE_ROOT=/path/to/your/workspace
24
-
25
- # Default model (optional — inherits from runtime's own default if not set)
26
- # CTI_DEFAULT_MODEL=
27
-
28
- # Default mode (code, plan, ask)
29
- CTI_DEFAULT_MODE=code
30
-
31
- # Number of recent messages returned by /history
32
- # CTI_HISTORY_MESSAGE_LIMIT=8
33
-
34
- # ── Claude CLI path (optional) ──
35
- # Override if you have multiple `claude` versions in PATH, or the daemon
36
- # picks the wrong one (e.g. an npm-installed 1.x instead of the native 2.x).
37
- # CTI_CLAUDE_CODE_EXECUTABLE=/path/to/claude
38
-
39
- # ── Third-party API provider (optional) ──
40
- # If you use Claude through a third-party API provider (not the default
41
- # Anthropic API), set these so the daemon forwards them to the CLI subprocess.
42
- # They are automatically passed through in both inherit and strict env modes.
43
- # All ANTHROPIC_* vars in this file are forwarded to the launchd/setsid daemon.
44
- # ANTHROPIC_API_KEY=your-third-party-api-key
45
- # ANTHROPIC_BASE_URL=https://your-api-provider.com/v1
46
- # ANTHROPIC_AUTH_TOKEN=your-auth-token
47
-
48
- # ── Codex auth (optional — only if not using `codex auth login`) ──
49
- # Priority: CTI_CODEX_API_KEY > CODEX_API_KEY > OPENAI_API_KEY
50
- # CTI_CODEX_API_KEY=
51
- # CTI_CODEX_BASE_URL=
52
- # Allow Codex to run when the selected project directory is not inside a trusted Git repo.
53
- # This project defaults it to true so first-time setup works more smoothly.
54
- CTI_CODEX_SKIP_GIT_REPO_CHECK=true
55
- # Default filesystem permission mode for Codex threads created by codex-to-im.
56
- # Options: read-only | workspace-write | danger-full-access
57
- CTI_CODEX_SANDBOX_MODE=workspace-write
58
- # Default reasoning effort for Codex.
59
- # Official SDK/runtime levels: minimal | low | medium | high | xhigh
60
- # IM aliases also support: 1=minimal, 2=low, 3=medium, 4=high, 5=xhigh
61
- CTI_CODEX_REASONING_EFFORT=medium
62
-
63
- # ── Web 控制台访问 ──
64
- # 默认仅允许本机访问本地工作台。开启后,局域网设备访问时需要先输入 token。
65
- # 可以在 Web 工作台里直接勾选并自动生成 token。
66
- # CTI_UI_ALLOW_LAN=false
67
- # CTI_UI_ACCESS_TOKEN=your-random-access-token
68
-
69
- # ── Telegram ──
70
- CTI_TG_BOT_TOKEN=your-telegram-bot-token
71
- # Chat ID for authorization (at least one of CHAT_ID or ALLOWED_USERS is required)
72
- # Get it: send a message to the bot, then visit https://api.telegram.org/botYOUR_TOKEN/getUpdates
73
- CTI_TG_CHAT_ID=your-chat-id
74
- # CTI_TG_ALLOWED_USERS=user_id_1,user_id_2
75
-
76
- # ── Discord ──
77
- # CTI_DISCORD_BOT_TOKEN=your-discord-bot-token
78
- # CTI_DISCORD_ALLOWED_USERS=user_id_1,user_id_2
79
- # CTI_DISCORD_ALLOWED_CHANNELS=channel_id_1
80
- # CTI_DISCORD_ALLOWED_GUILDS=guild_id_1
81
-
82
- # ── Feishu / Lark (legacy single-instance migration fields) ──
83
- # For new setups, add Feishu/Lark channel instances in the Web workbench and
84
- # choose the site there. These env vars are only used when migrating an old
85
- # single-instance setup into config.v2.json.
86
- # CTI_FEISHU_APP_ID=your-app-id
87
- # CTI_FEISHU_APP_SECRET=your-app-secret
88
- # CTI_FEISHU_SITE=feishu
89
- # CTI_FEISHU_ALLOWED_USERS=user_id_1,user_id_2
90
- # Enable streaming response cards in Feishu (default true).
91
- # Requires published Feishu permissions such as:
92
- # - cardkit:card:write
93
- # - cardkit:card:read
94
- # - im:message:update
95
- # Current Codex runtime note: thinking/progress can update live, but
96
- # assistant body text may still arrive only at completion.
97
- # CTI_FEISHU_STREAMING_ENABLED=true
98
- # Use Markdown for text sent through the bridge, including normal replies,
99
- # shared-thread mirror messages, and system feedback such as /h or /status.
100
- # CTI_FEISHU_COMMAND_MARKDOWN_ENABLED=true
101
-
102
- # ── QQ ──
103
- # Required: obtain from https://q.qq.com/qqbot/openclaw
104
- # CTI_QQ_APP_ID=your-qq-app-id
105
- # CTI_QQ_APP_SECRET=your-qq-app-secret
106
- # Allowed users — comma-separated user_openid values (NOT QQ numbers)
107
- # CTI_QQ_ALLOWED_USERS=openid_1,openid_2
108
- # Image input — set to false if the underlying provider doesn't support image input
109
- # CTI_QQ_IMAGE_ENABLED=true
110
- # Max image size in MB (default 20)
111
- # CTI_QQ_MAX_IMAGE_SIZE=20
112
-
113
- # ── WeChat / 微信 (legacy single-instance migration fields) ──
114
- # For new setups, add Weixin channel instances in the Web workbench. These env
115
- # vars are only used when migrating an old single-instance setup into
116
- # config.v2.json.
117
- # No static token is required here. Use the QR login helper to add accounts:
118
- # npm run weixin:login
119
- # Optional protocol overrides (normally leave unset)
120
- # CTI_WEIXIN_BASE_URL=https://ilinkai.weixin.qq.com
121
- # CTI_WEIXIN_CDN_BASE_URL=https://novac2c.cdn.weixin.qq.com/c2c
122
- # Enable inbound media download/processing for image/file/video messages.
123
- # Voice messages do not use raw audio download/transcription here: the bridge
124
- # only accepts WeChat-provided speech-to-text text and otherwise returns an error.
125
- # (default false for safety in CLI setups)
126
- # CTI_WEIXIN_MEDIA_ENABLED=false
127
- # Use Markdown for text sent through the bridge, including normal replies,
128
- # shared-thread mirror messages, and system feedback such as /h or /status.
129
- # Default is false for WeChat.
130
- # CTI_WEIXIN_COMMAND_MARKDOWN_ENABLED=false
131
-
132
- # ── Permission ──
133
- # Auto-approve all tool permission requests without user confirmation.
134
- # Useful for channels that lack interactive permission UI (e.g. Feishu
135
- # WebSocket long-connection mode, where there is no HTTP webhook to
136
- # render clickable approve/deny buttons).
137
- # ⚠️ Only enable this in trusted, access-controlled environments.
138
- # CTI_AUTO_APPROVE=true