@qpfai/pf-gate-cli 2.0.2-linux-x64 → 2.0.2-win32-x64

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # @qpfai/pf-gate-cli (linux-x64)
1
+ # @qpfai/pf-gate-cli (win32-x64)
2
2
 
3
3
  Platform runtime payload for PF Gate CLI.
4
4
 
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@qpfai/pf-gate-cli",
3
- "version": "2.0.2-linux-x64",
4
- "description": "PF Gate runtime payload for linux x64.",
3
+ "version": "2.0.2-win32-x64",
4
+ "description": "PF Gate runtime payload for win32 x64.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "os": [
8
- "linux"
8
+ "win32"
9
9
  ],
10
10
  "cpu": [
11
11
  "x64"
@@ -0,0 +1,68 @@
1
+ @echo off
2
+ setlocal
3
+
4
+ set "SCRIPT_DIR=%~dp0"
5
+ set "BUNDLED_WHEEL=%SCRIPT_DIR%..\python\persons_field-1.0.0-py3-none-any.whl"
6
+
7
+ set "PYTHON_BIN=%PF_GATE_PYTHON%"
8
+ if "%PYTHON_BIN%"=="" (
9
+ set "SYSTEM_PYTHON="
10
+ where python >nul 2>nul
11
+ if not errorlevel 1 (
12
+ set "SYSTEM_PYTHON=python"
13
+ ) else (
14
+ where py >nul 2>nul
15
+ if not errorlevel 1 (
16
+ set "SYSTEM_PYTHON=py -3"
17
+ )
18
+ )
19
+
20
+ if "%SYSTEM_PYTHON%"=="" (
21
+ echo PF Gate runtime error: Python 3.13+ not found. Install Python or set PF_GATE_PYTHON. 1>&2
22
+ exit /b 1
23
+ )
24
+
25
+ set "RUNTIME_HOME=%PF_GATE_RUNTIME_HOME%"
26
+ if "%RUNTIME_HOME%"=="" set "RUNTIME_HOME=%USERPROFILE%\.pf-gate\runtime"
27
+ set "VENV_DIR=%RUNTIME_HOME%\.venv"
28
+ set "PYTHON_BIN=%VENV_DIR%\Scripts\python.exe"
29
+
30
+ if not exist "%PYTHON_BIN%" (
31
+ echo PF Gate runtime: creating runtime environment at %VENV_DIR% 1>&2
32
+ if not exist "%RUNTIME_HOME%" mkdir "%RUNTIME_HOME%"
33
+ call %SYSTEM_PYTHON% -m venv "%VENV_DIR%"
34
+ if errorlevel 1 (
35
+ echo PF Gate runtime error: failed to create runtime environment at %VENV_DIR% 1>&2
36
+ exit /b 1
37
+ )
38
+ )
39
+ )
40
+
41
+ set "PIP_TARGET=%PF_GATE_PIP_SPEC%"
42
+ if "%PIP_TARGET%"=="" set "PIP_TARGET=%BUNDLED_WHEEL%"
43
+ if "%PF_GATE_PIP_SPEC%"=="" (
44
+ if not exist "%BUNDLED_WHEEL%" (
45
+ echo PF Gate runtime error: missing bundled wheel at %BUNDLED_WHEEL% 1>&2
46
+ exit /b 1
47
+ )
48
+ )
49
+
50
+ call %PYTHON_BIN% -c "import persons_field.terminal.launcher" >nul 2>nul
51
+ if errorlevel 1 (
52
+ echo PF Gate runtime: persons_field is missing; installing %PIP_TARGET%... 1>&2
53
+ call %PYTHON_BIN% -m pip --version >nul 2>nul
54
+ if errorlevel 1 (
55
+ call %PYTHON_BIN% -m ensurepip --upgrade >nul 2>nul
56
+ )
57
+ call %PYTHON_BIN% -m pip install --upgrade --disable-pip-version-check "%PIP_TARGET%"
58
+ if errorlevel 1 (
59
+ call %PYTHON_BIN% -m pip install --user --upgrade --disable-pip-version-check "%PIP_TARGET%"
60
+ if errorlevel 1 (
61
+ echo PF Gate runtime error: failed to install %PIP_TARGET%. Set PF_GATE_PYTHON and PF_GATE_PIP_SPEC, then retry. 1>&2
62
+ exit /b 1
63
+ )
64
+ )
65
+ )
66
+
67
+ call %PYTHON_BIN% -m persons_field.terminal.launcher %*
68
+ exit /b %ERRORLEVEL%
@@ -1,66 +0,0 @@
1
- #!/usr/bin/env sh
2
- set -eu
3
-
4
- SCRIPT_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
5
- BUNDLED_WHEEL="$SCRIPT_DIR/../python/persons_field-1.0.0-py3-none-any.whl"
6
-
7
- resolve_system_python() {
8
- if command -v python3 >/dev/null 2>&1; then
9
- printf '%s' "python3"
10
- return 0
11
- fi
12
- if command -v python >/dev/null 2>&1; then
13
- printf '%s' "python"
14
- return 0
15
- fi
16
- return 1
17
- }
18
-
19
- PYTHON_BIN="${PF_GATE_PYTHON:-}"
20
- if [ -z "$PYTHON_BIN" ]; then
21
- SYSTEM_PYTHON="$(resolve_system_python || true)"
22
- if [ -z "$SYSTEM_PYTHON" ]; then
23
- echo "PF Gate runtime error: Python 3.13+ not found. Install Python or set PF_GATE_PYTHON." >&2
24
- exit 1
25
- fi
26
-
27
- USER_HOME="${HOME:-}"
28
- if [ -z "$USER_HOME" ] && [ -z "${PF_GATE_RUNTIME_HOME:-}" ]; then
29
- echo "PF Gate runtime error: HOME is not set. Set PF_GATE_RUNTIME_HOME or PF_GATE_PYTHON." >&2
30
- exit 1
31
- fi
32
-
33
- RUNTIME_HOME="${PF_GATE_RUNTIME_HOME:-$USER_HOME/.pf-gate/runtime}"
34
- VENV_DIR="$RUNTIME_HOME/.venv"
35
- PYTHON_BIN="$VENV_DIR/bin/python"
36
-
37
- if [ ! -x "$PYTHON_BIN" ]; then
38
- echo "PF Gate runtime: creating runtime environment at $VENV_DIR" >&2
39
- mkdir -p "$RUNTIME_HOME"
40
- if ! "$SYSTEM_PYTHON" -m venv "$VENV_DIR"; then
41
- echo "PF Gate runtime error: failed to create runtime environment at $VENV_DIR" >&2
42
- exit 1
43
- fi
44
- fi
45
- fi
46
-
47
- PIP_TARGET="${PF_GATE_PIP_SPEC:-$BUNDLED_WHEEL}"
48
- if [ -z "${PF_GATE_PIP_SPEC:-}" ] && [ ! -f "$BUNDLED_WHEEL" ]; then
49
- echo "PF Gate runtime error: missing bundled wheel at $BUNDLED_WHEEL" >&2
50
- exit 1
51
- fi
52
-
53
- if ! "$PYTHON_BIN" -c "import persons_field.terminal.launcher" >/dev/null 2>&1; then
54
- echo "PF Gate runtime: persons_field is missing; installing ${PIP_TARGET}..." >&2
55
- if ! "$PYTHON_BIN" -m pip --version >/dev/null 2>&1; then
56
- "$PYTHON_BIN" -m ensurepip --upgrade >/dev/null 2>&1 || true
57
- fi
58
- if ! "$PYTHON_BIN" -m pip install --upgrade --disable-pip-version-check "$PIP_TARGET"; then
59
- if ! "$PYTHON_BIN" -m pip install --user --upgrade --disable-pip-version-check "$PIP_TARGET"; then
60
- echo "PF Gate runtime error: failed to install ${PIP_TARGET}. Set PF_GATE_PYTHON and PF_GATE_PIP_SPEC, then retry." >&2
61
- exit 1
62
- fi
63
- fi
64
- fi
65
-
66
- exec "$PYTHON_BIN" -m persons_field.terminal.launcher "$@"