@tina_summer/codepocket 2.6.10 → 2.6.11

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.
Files changed (2) hide show
  1. package/bin/codepocket.js +19 -12
  2. package/package.json +5 -5
package/bin/codepocket.js CHANGED
@@ -270,21 +270,28 @@ if (args[0] === 'stop') {
270
270
  console.log(`[codepocket] Stopped (PID ${pid})${extra}`)
271
271
  process.exit(0)
272
272
  }, 300)
273
+ // CRITICAL: do not fall through. The exit is scheduled 300ms out; without
274
+ // this return, execution continues to run(), whose foreground path sees
275
+ // "no daemon running", auto-starts a NEW daemon (stop never sticks), and
276
+ // spawns a claude session with the CLI args as prompt (trust banner +
277
+ // "--print needs input" error noise).
278
+ return
273
279
  }
274
280
 
275
- // Kill orphaned hub/runner processes by binary name (cross-platform).
276
- // The hub binary (cpkt-hub) also runs the runner/sync modes, so matching the
277
- // binary name catches every mode it was spawned in.
281
+ // Kill orphaned hub processes (cross-platform). Only `hub start` mode is
282
+ // targeted — the same binary also runs claude session wrappers and the
283
+ // runner, so never match the bare binary name. Covers the shipped path
284
+ // (`.../bin/codepocket hub start`) and dev/legacy `cpkt-hub` builds.
278
285
  function killOrphans() {
279
- try {
280
- if (process.platform === 'win32') {
281
- execSync('taskkill /F /IM cpkt-hub.exe /T', { stdio: 'ignore' })
282
- } else {
283
- execSync('pkill -f cpkt-hub', { stdio: 'ignore' })
284
- }
285
- return 'hub'
286
- } catch {}
287
- return ''
286
+ const killed = []
287
+ const run = (cmd) => { try { execSync(cmd, { stdio: 'ignore' }); return true } catch { return false } }
288
+ if (process.platform === 'win32') {
289
+ if (run('powershell -NoProfile -Command "Get-CimInstance Win32_Process -Filter \\"Name=\'codepocket.exe\' or Name=\'cpkt-hub.exe\'\\" | Where-Object { $_.CommandLine -match \'hub start\' } | ForEach-Object { Stop-Process -Id $_.ProcessId -Force }"')) killed.push('hub')
290
+ } else {
291
+ if (run('pkill -f "bin/codepocket hub start"')) killed.push('hub')
292
+ if (run('pkill -f "cpkt-hub hub start"')) killed.push('hub')
293
+ }
294
+ return [...new Set(killed)].join('+')
288
295
  }
289
296
 
290
297
  // 'logs' subcommand
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tina_summer/codepocket",
3
- "version": "2.6.10",
3
+ "version": "2.6.11",
4
4
  "description": "CodePocket — 基于ClaudeCode的微信小程序工作台",
5
5
  "bin": {
6
6
  "codepocket": "bin/codepocket.js",
@@ -20,10 +20,10 @@
20
20
  "ws": "^8.18.0"
21
21
  },
22
22
  "optionalDependencies": {
23
- "@tina_summer/codepocket-darwin-arm64": "2.6.10",
24
- "@tina_summer/codepocket-darwin-x64": "2.6.10",
25
- "@tina_summer/codepocket-linux-x64": "2.6.10",
26
- "@tina_summer/codepocket-win32-x64": "2.6.10"
23
+ "@tina_summer/codepocket-darwin-arm64": "2.6.11",
24
+ "@tina_summer/codepocket-darwin-x64": "2.6.11",
25
+ "@tina_summer/codepocket-linux-x64": "2.6.11",
26
+ "@tina_summer/codepocket-win32-x64": "2.6.11"
27
27
  },
28
28
  "engines": {
29
29
  "node": ">=18"