cliclaw 1.0.12 → 1.0.14

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cliclaw",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "description": "Telegram bot bridging AI CLIs (Claude Code, Codex) to Forum Topics",
5
5
  "main": "index.ts",
6
6
  "scripts": {
@@ -38,8 +38,13 @@ function spawnClaude(args: string[]): Promise<ClaudeResult> {
38
38
  return new Promise((resolve, reject) => {
39
39
  let stdout = ''
40
40
  let stderr = ''
41
- // On Windows, npm binaries are .cmd files — shell:true is required to find them
42
- const proc = spawn('claude', args, { env: buildEnv(), shell: process.platform === 'win32' })
41
+ const isWin = process.platform === 'win32'
42
+ const proc = spawn('claude', args, {
43
+ env: buildEnv(),
44
+ shell: isWin,
45
+ windowsHide: true,
46
+ stdio: ['ignore', 'pipe', 'pipe'], // explicit: ignore stdin so headless PM2 doesn't hang
47
+ })
43
48
  proc.stdout.on('data', (d: Buffer) => { stdout += d.toString() })
44
49
  proc.stderr.on('data', (d: Buffer) => { stderr += d.toString() })
45
50
  proc.on('close', (code) => {
@@ -18,11 +18,13 @@ const BASE_ENV = {
18
18
  function spawnCodex(args: string[]): Promise<{ text: string; threadId: string | null; usage?: TokenUsage }> {
19
19
  return new Promise((resolve, reject) => {
20
20
  let stdout = ''
21
- // On Windows, npm binaries are .cmd files — shell:true is required to find them
21
+ const isWin = process.platform === 'win32'
22
22
  const proc = spawn('codex', args, {
23
23
  env: { ...process.env, ...BASE_ENV },
24
24
  cwd: process.cwd(),
25
- shell: process.platform === 'win32',
25
+ shell: isWin,
26
+ windowsHide: true,
27
+ stdio: ['ignore', 'pipe', 'pipe'], // explicit: ignore stdin so headless PM2 doesn't hang
26
28
  })
27
29
  proc.stdout.on('data', (d: Buffer) => { stdout += d.toString() })
28
30
  proc.stderr.on('data', (d: Buffer) => {
@@ -83,7 +83,7 @@ export function registerMessageHandler(bot: Bot<Context>, storage: Storage, conf
83
83
 
84
84
  activeLocks.add(session.id)
85
85
  const replyOpts: any = threadId > 0 ? { message_thread_id: threadId } : {}
86
- const emoji = session.model === 'claude' ? '\U0001f7e3' : '\U0001f7e2'
86
+ const emoji = session.model === 'claude' ? '🟣' : '🟢'
87
87
 
88
88
  const workingMsg = await ctx.reply(
89
89
  `${emoji} <i>${t(lang, 'processing')}</i>`,