cliclaw 1.0.36 → 1.0.38

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.36",
3
+ "version": "1.0.38",
4
4
  "description": "Telegram bot bridging AI CLIs (Claude Code, Codex) to Forum Topics",
5
5
  "main": "index.ts",
6
6
  "scripts": {
@@ -86,7 +86,9 @@ function startProto(appSessionId: string): ProtoSession {
86
86
  try {
87
87
  const obj = JSON.parse(line)
88
88
  handleProtoEvent(ps, obj)
89
- } catch {}
89
+ } catch (e: any) {
90
+ console.error('[Codex proto] parse error:', e?.message, '| line:', line.slice(0, 120))
91
+ }
90
92
  }
91
93
  })
92
94
 
@@ -132,18 +134,13 @@ function handleProtoEvent(ps: ProtoSession, obj: any) {
132
134
  const commandStr = formatApprovalCommand(msg.command ?? msg.cmd)
133
135
  console.log(`[Codex approval] request recebido sub_id=${subId} cmd="${commandStr.slice(0, 80)}"`)
134
136
 
135
- // Respond using the original message id so Codex can correlate the reply
136
137
  const respond = (decision: string) => {
137
- // Handle app-level session approval Codex only understands 'approved'/'denied'/'abort'
138
- if (decision === 'approved_for_session') {
139
- ps.sessionApproved = true
140
- decision = 'approved'
141
- }
138
+ if (decision === 'approved_for_session') ps.sessionApproved = true
142
139
  console.log(`[Codex approval] enviando exec_approval sub_id=${subId} decision=${decision}`)
143
140
  try {
144
141
  ps.proc.stdin!.write(JSON.stringify({
145
- id: msgId, // use original event id, not a new UUID
146
- op: { type: 'exec_approval', sub_id: subId, decision },
142
+ id: randomUUID(),
143
+ op: { type: 'exec_approval', id: subId, decision },
147
144
  }) + '\n')
148
145
  console.log(`[Codex approval] enviado ok`)
149
146
  } catch (e: any) {