tako-cli 0.3.9 → 0.3.10

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 (3) hide show
  1. package/dist/index.js +207 -206
  2. package/install.ps1 +15 -1
  3. package/package.json +1 -1
package/install.ps1 CHANGED
@@ -246,9 +246,16 @@ function Create-Command {
246
246
  New-Item -ItemType Directory -Force -Path $TAKO_BIN_DIR | Out-Null
247
247
 
248
248
  # Create tako.cmd batch file
249
+ # 注意:这份 cmd/ps1 wrapper 逻辑与 src/windows-wrapper.ts 等价(更新时由那里重写)。
250
+ # 改这里必须同步改 windows-wrapper.ts,否则安装期与更新期写的 wrapper 会漂移。
249
251
  $cmdContent = @"
250
252
  @echo off
253
+ set "TAKO_WINDOWS_HANDOFF_FILE=%TEMP%\tako-handoff-%RANDOM%-%RANDOM%.ps1"
254
+ if exist "%TAKO_WINDOWS_HANDOFF_FILE%" del "%TAKO_WINDOWS_HANDOFF_FILE%" >nul 2>nul
251
255
  "$bun" "$TakoEntry" %*
256
+ set "TAKO_EXIT_CODE=%ERRORLEVEL%"
257
+ if not exist "%TAKO_WINDOWS_HANDOFF_FILE%" exit /b %TAKO_EXIT_CODE%
258
+ powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%TAKO_WINDOWS_HANDOFF_FILE%"
252
259
  exit /b %ERRORLEVEL%
253
260
  "@
254
261
 
@@ -257,8 +264,15 @@ exit /b %ERRORLEVEL%
257
264
 
258
265
  # Create tako.ps1 PowerShell script (optional)
259
266
  $ps1Content = @"
267
+ `$env:TAKO_WINDOWS_HANDOFF_FILE = Join-Path ([System.IO.Path]::GetTempPath()) ("tako-handoff-{0}-{1}.ps1" -f `$PID, [System.Guid]::NewGuid().ToString("N"))
268
+ Remove-Item -LiteralPath `$env:TAKO_WINDOWS_HANDOFF_FILE -Force -ErrorAction SilentlyContinue
260
269
  & "$bun" "$TakoEntry" @args
261
- exit `$LASTEXITCODE
270
+ `$code = `$LASTEXITCODE
271
+ if (Test-Path -LiteralPath `$env:TAKO_WINDOWS_HANDOFF_FILE) {
272
+ powershell.exe -NoProfile -ExecutionPolicy Bypass -File `$env:TAKO_WINDOWS_HANDOFF_FILE
273
+ exit `$LASTEXITCODE
274
+ }
275
+ exit `$code
262
276
  "@
263
277
  $ps1Bytes = [System.Text.Encoding]::UTF8.GetBytes($ps1Content)
264
278
  [System.IO.File]::WriteAllBytes("$TAKO_BIN_DIR\tako.ps1", $ps1Bytes)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tako-cli",
3
- "version": "0.3.9",
3
+ "version": "0.3.10",
4
4
  "description": "Tako CLI — unified launcher for AI coding tools (Claude Code, Codex, Gemini) with multi-agent session management",
5
5
  "type": "module",
6
6
  "homepage": "https://github.com/tako-dev/cli#readme",