izteamslots 1.5.3 → 1.5.4

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [1.5.4](https://github.com/izzzzzi/izTeamSlots/compare/v1.5.3...v1.5.4) (2026-03-06)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Windows compatibility — version check, wmic removal, CI matrix, venv resolution ([342b515](https://github.com/izzzzzi/izTeamSlots/commit/342b515e86ac7e674fed6c25c6dece20eb40b0ea))
7
+
1
8
  ## [1.5.3](https://github.com/izzzzzi/izTeamSlots/compare/v1.5.2...v1.5.3) (2026-03-06)
2
9
 
3
10
 
@@ -505,20 +505,25 @@ def _kill_chrome_for_profile(profile_dir: Path) -> None:
505
505
  killed = False
506
506
  try:
507
507
  if os.name == "nt":
508
- # Windows: use wmic to find chrome processes with this profile
508
+ # Windows: use PowerShell Get-CimInstance (wmic removed on newer Win11)
509
+ ps_cmd = (
510
+ "Get-CimInstance Win32_Process -Filter \"name like '%chrome%'\" | "
511
+ "ForEach-Object { \"$($_.ProcessId)|$($_.CommandLine)\" }"
512
+ )
509
513
  out = subprocess.check_output(
510
- ["wmic", "process", "where", "name like '%chrome%'", "get", "ProcessId,CommandLine"],
511
- text=True, timeout=10,
514
+ ["powershell", "-NoProfile", "-Command", ps_cmd],
515
+ text=True, timeout=15,
512
516
  )
517
+ resolved_win = resolved.replace("/", "\\")
513
518
  for line in out.splitlines():
514
- if resolved.replace("/", "\\") not in line and resolved not in line:
519
+ line = line.strip()
520
+ if "|" not in line:
515
521
  continue
516
- # PID is last token on the line
517
- parts = line.strip().split()
518
- if not parts:
522
+ pid_str, cmdline = line.split("|", 1)
523
+ if resolved_win not in cmdline and resolved not in cmdline:
519
524
  continue
520
525
  try:
521
- pid = int(parts[-1])
526
+ pid = int(pid_str.strip())
522
527
  if pid == os.getpid():
523
528
  continue
524
529
  subprocess.run(["taskkill", "/F", "/PID", str(pid)], timeout=5,
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { execFileSync, execSync } from "node:child_process";
2
+ import { execFileSync } from "node:child_process";
3
3
  import { existsSync } from "node:fs";
4
4
  import { resolve, dirname } from "node:path";
5
5
  import { fileURLToPath } from "node:url";
@@ -31,13 +31,7 @@ if (isWin) {
31
31
  const args = ["run", "--cwd", resolve(root, "ui"), "src/main.ts", ...process.argv.slice(2)];
32
32
 
33
33
  try {
34
- if (isWin) {
35
- // On Windows, execFileSync may fail to resolve commands — use shell
36
- const cmd = [bunCmd, ...args].map(a => `"${a}"`).join(" ");
37
- execSync(cmd, { stdio: "inherit", cwd: root, env: process.env });
38
- } else {
39
- execFileSync(bunCmd, args, { stdio: "inherit", cwd: root, env: process.env });
40
- }
34
+ execFileSync(bunCmd, args, { stdio: "inherit", cwd: root, env: process.env, shell: isWin });
41
35
  } catch (err) {
42
36
  process.exit(err.status ?? 1);
43
37
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "izteamslots",
3
- "version": "1.5.3",
3
+ "version": "1.5.4",
4
4
  "description": "ChatGPT Team slot management — automated invite, register, OAuth login & codex token pipeline",
5
5
  "bin": {
6
6
  "izteamslots": "bin/izteamslots.mjs"
package/scripts/setup.cmd CHANGED
@@ -27,6 +27,19 @@ if "%PYTHON%"=="" (
27
27
  echo [x] Python 3.11+ not found. Install: https://python.org
28
28
  exit /b 1
29
29
  )
30
+ :: Validate version >= 3.11
31
+ for /f "tokens=1,2 delims=." %%a in ("%PYVER%") do (
32
+ set "PYMAJOR=%%a"
33
+ set "PYMINOR=%%b"
34
+ )
35
+ if !PYMAJOR! LSS 3 (
36
+ echo [x] Python 3.11+ required, found %PYVER%. Install: https://python.org
37
+ exit /b 1
38
+ )
39
+ if !PYMAJOR! EQU 3 if !PYMINOR! LSS 11 (
40
+ echo [x] Python 3.11+ required, found %PYVER%. Install: https://python.org
41
+ exit /b 1
42
+ )
30
43
  echo [v] Python: %PYVER%
31
44
 
32
45
  :: ── uv ──────────────────────────────────────────────────
@@ -39,7 +52,7 @@ if errorlevel 1 (
39
52
  )
40
53
  where uv >nul 2>&1
41
54
  if errorlevel 1 (
42
- echo [x] uv install failed. Install manually: https://docs.astral.sh/uv
55
+ echo [x] uv install failed. Behind proxy/firewall? Install manually: https://docs.astral.sh/uv
43
56
  exit /b 1
44
57
  )
45
58
  for /f "tokens=*" %%v in ('uv --version') do echo [v] %%v
@@ -66,7 +79,7 @@ if errorlevel 1 (
66
79
  )
67
80
  where bun >nul 2>&1
68
81
  if errorlevel 1 (
69
- echo [x] Bun install failed. Install manually: https://bun.sh
82
+ echo [x] Bun install failed. Behind proxy/firewall? Install manually: https://bun.sh
70
83
  exit /b 1
71
84
  )
72
85
  for /f "tokens=*" %%v in ('bun --version') do echo [v] Bun: %%v
@@ -59,7 +59,8 @@ function copyToSystemClipboard(text: string): boolean {
59
59
  if (platform === "darwin") {
60
60
  execFileSync("pbcopy", [], { input: value })
61
61
  } else if (platform === "win32") {
62
- execFileSync("clip", [], { input: value })
62
+ execFileSync("powershell", ["-NoProfile", "-Command",
63
+ "Set-Clipboard ([Console]::In.ReadToEnd().TrimEnd())"], { input: value })
63
64
  } else {
64
65
  execFileSync("xclip", ["-selection", "clipboard"], { input: value })
65
66
  }
@@ -1,4 +1,5 @@
1
1
  import { spawn, type ChildProcessByStdio } from "node:child_process"
2
+ import { existsSync } from "node:fs"
2
3
  import type { Readable, Writable } from "node:stream"
3
4
  import { randomUUID } from "node:crypto"
4
5
  import { delimiter, dirname, resolve } from "node:path"
@@ -27,6 +28,19 @@ function projectRootFromCurrentFile() {
27
28
  return resolve(here, "../../..")
28
29
  }
29
30
 
31
+ function resolveDefaultPython(): string {
32
+ if (process.env.PYTHON_BIN) return process.env.PYTHON_BIN
33
+ if (process.env.PYTHON) return process.env.PYTHON
34
+ const root = process.env.IZTEAMSLOTS_ROOT ?? projectRootFromCurrentFile()
35
+ const venvPython = process.platform === "win32"
36
+ ? resolve(root, ".venv", "Scripts", "python.exe")
37
+ : resolve(root, ".venv", "bin", "python")
38
+ try {
39
+ if (existsSync(venvPython)) return venvPython
40
+ } catch { /* ignore */ }
41
+ return process.platform === "win32" ? "python" : "python3"
42
+ }
43
+
30
44
  export class StdioRpcClient {
31
45
  private proc: ChildProcessByStdio<Writable, Readable, Readable> | null = null
32
46
  private readonly pending = new Map<
@@ -40,8 +54,7 @@ export class StdioRpcClient {
40
54
  private readonly errorHandlers = new Set<ErrorOutputHandler>()
41
55
 
42
56
  constructor(
43
- private readonly pythonCmd: string =
44
- process.env.PYTHON_BIN ?? process.env.PYTHON ?? (process.platform === "win32" ? "python" : "python3"),
57
+ private readonly pythonCmd: string = resolveDefaultPython(),
45
58
  private readonly projectRoot: string = process.env.IZTEAMSLOTS_ROOT ?? projectRootFromCurrentFile(),
46
59
  ) {}
47
60