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 +1 -1
- package/src/agents/claude.ts +7 -2
- package/src/agents/codex.ts +4 -2
- package/src/handlers/messages.ts +1 -1
package/package.json
CHANGED
package/src/agents/claude.ts
CHANGED
|
@@ -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
|
-
|
|
42
|
-
const proc = spawn('claude', args, {
|
|
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) => {
|
package/src/agents/codex.ts
CHANGED
|
@@ -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
|
-
|
|
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:
|
|
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) => {
|
package/src/handlers/messages.ts
CHANGED
|
@@ -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' ? '
|
|
86
|
+
const emoji = session.model === 'claude' ? '🟣' : '🟢'
|
|
87
87
|
|
|
88
88
|
const workingMsg = await ctx.reply(
|
|
89
89
|
`${emoji} <i>${t(lang, 'processing')}</i>`,
|