codex-to-im 1.0.11 → 1.0.13

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
@@ -10,6 +10,8 @@ The product is no longer centered around a Codex skill. The main path is:
10
10
  4. Start the bridge in the background
11
11
  5. Bind real desktop Codex threads to Feishu or Weixin chats
12
12
 
13
+ Optional: if you want Codex to know it can send local files or images back to IM without relying on bridge-injected prompt text, install the bundled `codex-to-im` skill from the workbench.
14
+
13
15
  ## Project Origin
14
16
 
15
17
  The current codebase is a consolidated continuation of two earlier repositories:
package/README_CN.md CHANGED
@@ -10,6 +10,8 @@
10
10
  4. 在后台启动 bridge
11
11
  5. 把真实的桌面 Codex thread 绑定到飞书或微信聊天
12
12
 
13
+ 可选:如果你希望 Codex 在不依赖 bridge 注入提示词的前提下,知道“可以把本地图片/文件回发到 IM”,可以在工作台里安装附带的 `codex-to-im` skill。
14
+
13
15
  ## 项目来源
14
16
 
15
17
  当前这套代码是在两个早期仓库的基础上整理和改造出来的:
package/SKILL.md ADDED
@@ -0,0 +1,67 @@
1
+ ---
2
+ name: codex-to-im
3
+ description: Use this skill when working through Codex-to-IM and you need Codex to send a local image or file back to the current IM chat. It teaches the attachment-send protocol and when to use it.
4
+ ---
5
+
6
+ # Codex-to-IM attachment sending
7
+
8
+ Use this skill only when the user is chatting through Codex-to-IM and wants you to send a generated or existing local artifact back to the IM chat.
9
+
10
+ ## What this skill does
11
+
12
+ Codex-to-IM can send local files back to the chat after your reply. You trigger that by including one or more `<cti-send>...</cti-send>` blocks in your final answer.
13
+
14
+ Supported artifact kinds:
15
+
16
+ - `image`
17
+ - `file`
18
+
19
+ ## Required format
20
+
21
+ Output valid JSON inside the block, with no markdown fence.
22
+
23
+ Single artifact:
24
+
25
+ ```text
26
+ <cti-send>
27
+ {"type":"image","path":"D:\\path\\to\\result.png","caption":"optional caption"}
28
+ </cti-send>
29
+ ```
30
+
31
+ or
32
+
33
+ ```text
34
+ <cti-send>
35
+ {"type":"file","path":"D:\\path\\to\\report.pdf","caption":"optional caption"}
36
+ </cti-send>
37
+ ```
38
+
39
+ Multiple artifacts:
40
+
41
+ ```text
42
+ <cti-send>
43
+ {"items":[
44
+ {"type":"image","path":"D:\\path\\to\\result.png"},
45
+ {"type":"file","path":"D:\\path\\to\\report.pdf"}
46
+ ]}
47
+ </cti-send>
48
+ ```
49
+
50
+ ## Rules
51
+
52
+ - The `path` must be an absolute local path.
53
+ - The file must already exist before you emit the block.
54
+ - Keep normal user-facing explanation outside the `<cti-send>` block.
55
+ - Do not invent artifacts that were not actually created or found.
56
+ - If you are unsure whether the file exists, verify first.
57
+ - If the channel probably does not support the artifact well, explain that plainly instead of inventing a successful send.
58
+
59
+ ## When to use
60
+
61
+ Use this protocol when the user asks you to:
62
+
63
+ - send a generated chart, diagram, screenshot, or edited image
64
+ - send a report, archive, patch, PDF, spreadsheet, or other output file
65
+ - send the final result as an attachment instead of only pasting text
66
+
67
+ Do not use it for ordinary text replies.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Codex to IM"
3
+ short_description: "Help Codex send local files back to IM chats"
4
+ default_prompt: "Use $codex-to-im when you need to send a generated image or file back to the current Codex-to-IM chat."
package/dist/cli.mjs CHANGED
@@ -3,6 +3,7 @@ import { createRequire } from 'module'; const require = createRequire(import.met
3
3
 
4
4
  // src/service-manager.ts
5
5
  import fs2 from "node:fs";
6
+ import os2 from "node:os";
6
7
  import path2 from "node:path";
7
8
  import { spawn } from "node:child_process";
8
9
  import { fileURLToPath } from "node:url";