@assertrx/dino 1.0.7 → 1.0.8

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@assertrx/dino",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "A friendly purple dinosaur pi package with a custom TUI header, theme, and Playwright skills.",
5
5
  "keywords": [
6
6
  "pi-package"
@@ -25,7 +25,7 @@
25
25
  "postinstall": "npx playwright install chromium"
26
26
  },
27
27
  "dependencies": {
28
- "@earendil-works/pi-coding-agent": "*",
28
+ "@earendil-works/pi-coding-agent": "0.84.4",
29
29
  "@fastify/cors": "^11.3.0",
30
30
  "@mablhq/mabl-cli": "^2.127.20",
31
31
  "@modelcontextprotocol/sdk": "^1.30.0",
@@ -31,7 +31,7 @@ if !ERRORLEVEL! EQU 0 (
31
31
  for /f "tokens=*" %%v in ('pi --version 2^>^&1') do echo Found pi %%v
32
32
  ) else (
33
33
  echo Installing pi...
34
- call npm install -g @earendil-works/pi-coding-agent --silent --no-fund --no-audit
34
+ call npm install -g @earendil-works/pi-coding-agent@0.84.4 --silent --no-fund --no-audit
35
35
  if !ERRORLEVEL! NEQ 0 (
36
36
  echo ERROR: Failed to install pi.
37
37
  pause
@@ -56,6 +56,43 @@ if not exist "%DINO_DIR%" (
56
56
  echo Dino already installed at %DINO_DIR%
57
57
  )
58
58
 
59
+ :: ── 3b. Pin pi-coding-agent to last known-good version ───────────────
60
+ :: pi-coding-agent@0.85.0 imports @earendil-works/pi-server at runtime
61
+ :: without declaring it as a dependency (upstream packaging bug), which
62
+ :: breaks the API server with ERR_MODULE_NOT_FOUND. 0.84.4 is the last
63
+ :: version that works out of the box, so force it in pi's package dir
64
+ :: regardless of what dino's "*" dependency resolved to.
65
+ set "PI_NPM_DIR=%USERPROFILE%\.pi\agent\npm"
66
+ set "PINNED_PI=0.84.4"
67
+ node -e "const fs=require('fs');let v='';try{v=JSON.parse(fs.readFileSync(process.env.PI_NPM_DIR+'/node_modules/@earendil-works/pi-coding-agent/package.json','utf8')).version}catch(e){}process.exit(v===process.env.PINNED_PI?0:1)"
68
+ if errorlevel 1 (
69
+ echo Pinning @earendil-works/pi-coding-agent to %PINNED_PI% ...
70
+ pushd "%PI_NPM_DIR%"
71
+ call npm install "@earendil-works/pi-coding-agent@%PINNED_PI%" --save-exact --no-fund --no-audit --loglevel=error
72
+ if errorlevel 1 (
73
+ popd
74
+ echo ERROR: Failed to install @earendil-works/pi-coding-agent@%PINNED_PI%.
75
+ pause
76
+ exit /b 1
77
+ )
78
+ popd
79
+ echo Pinned to %PINNED_PI%.
80
+ ) else (
81
+ echo pi-coding-agent %PINNED_PI% ^(known-good^) installed.
82
+ )
83
+
84
+ :: Verify the package imports cleanly before starting the server.
85
+ pushd "%PI_NPM_DIR%"
86
+ node --input-type=module -e "await import('@earendil-works/pi-coding-agent')"
87
+ if errorlevel 1 (
88
+ popd
89
+ echo ERROR: pi-coding-agent failed to import - see message above.
90
+ pause
91
+ exit /b 1
92
+ )
93
+ popd
94
+ echo pi-coding-agent import check OK.
95
+
59
96
  :: ── 4. Start server ───────────────────────────────────────────────────
60
97
  echo [4/4] Starting Dino API server...
61
98
  echo.
@@ -21,7 +21,7 @@ if command -v pi &>/dev/null; then
21
21
  echo " Found pi $(pi --version 2>&1 || echo '(unknown version)')"
22
22
  else
23
23
  echo " Installing pi..."
24
- npm install -g @earendil-works/pi-coding-agent
24
+ npm install -g @earendil-works/pi-coding-agent@0.84.4
25
25
  echo " pi installed successfully."
26
26
  fi
27
27
 
@@ -36,6 +36,28 @@ else
36
36
  echo " Dino already installed at ${DINO_DIR}"
37
37
  fi
38
38
 
39
+ # pi-coding-agent@0.85.0 imports @earendil-works/pi-server at runtime
40
+ # without declaring it as a dependency (upstream packaging bug), which
41
+ # breaks the API server with ERR_MODULE_NOT_FOUND. 0.84.4 is the last
42
+ # version that works out of the box, so force it in pi's package dir
43
+ # regardless of what dino's "*" dependency resolved to.
44
+ PI_NPM_DIR="${HOME}/.pi/agent/npm"
45
+ PINNED_PI="0.84.4"
46
+ export PI_NPM_DIR PINNED_PI
47
+ if ! node -e "const fs=require('fs');let v='';try{v=JSON.parse(fs.readFileSync(process.env.PI_NPM_DIR+'/node_modules/@earendil-works/pi-coding-agent/package.json','utf8')).version}catch(e){}process.exit(v===process.env.PINNED_PI?0:1)"; then
48
+ echo " Pinning @earendil-works/pi-coding-agent to ${PINNED_PI}..."
49
+ (cd "${PI_NPM_DIR}" && npm install "@earendil-works/pi-coding-agent@${PINNED_PI}" --save-exact --no-fund --no-audit --loglevel=error)
50
+ echo " Pinned to ${PINNED_PI}."
51
+ else
52
+ echo " pi-coding-agent ${PINNED_PI} (known-good) installed."
53
+ fi
54
+
55
+ if ! (cd "${PI_NPM_DIR}" && node --input-type=module -e "await import('@earendil-works/pi-coding-agent')"); then
56
+ echo "ERROR: pi-coding-agent failed to import."
57
+ exit 1
58
+ fi
59
+ echo " pi-coding-agent import check OK."
60
+
39
61
  # ── 4. Start server ───────────────────────────────────────────────────
40
62
  echo "[4/4] Starting Dino API server..."
41
63
  echo ""
@@ -10,6 +10,18 @@ if not exist "%DINO_DIR%" (
10
10
  exit /b 1
11
11
  )
12
12
 
13
+ :: Self-heal: force known-good pi-coding-agent (0.85.0 has a missing
14
+ :: dependency that breaks the API server - see setup-dino-api.bat).
15
+ set "PI_NPM_DIR=%USERPROFILE%\.pi\agent\npm"
16
+ set "PINNED_PI=0.84.4"
17
+ node -e "const fs=require('fs');let v='';try{v=JSON.parse(fs.readFileSync(process.env.PI_NPM_DIR+'/node_modules/@earendil-works/pi-coding-agent/package.json','utf8')).version}catch(e){}process.exit(v===process.env.PINNED_PI?0:1)"
18
+ if errorlevel 1 (
19
+ echo Installing @earendil-works/pi-coding-agent@%PINNED_PI% ...
20
+ pushd "%PI_NPM_DIR%"
21
+ call npm install "@earendil-works/pi-coding-agent@%PINNED_PI%" --save-exact --no-fund --no-audit --loglevel=error
22
+ popd
23
+ )
24
+
13
25
  echo Starting Dino API server on port %PORT% (default: 4003)...
14
26
 
15
27
  :: The published npm package may not include api-server.mjs, so fall back
@@ -12,5 +12,15 @@ if [ ! -d "${DINO_DIR}" ]; then
12
12
  exit 1
13
13
  fi
14
14
 
15
+ # Self-heal: force known-good pi-coding-agent (0.85.0 has a missing
16
+ # dependency that breaks the API server - see setup-dino-api.sh).
17
+ PI_NPM_DIR="${HOME}/.pi/agent/npm"
18
+ PINNED_PI="0.84.4"
19
+ export PI_NPM_DIR PINNED_PI
20
+ if ! node -e "const fs=require('fs');let v='';try{v=JSON.parse(fs.readFileSync(process.env.PI_NPM_DIR+'/node_modules/@earendil-works/pi-coding-agent/package.json','utf8')).version}catch(e){}process.exit(v===process.env.PINNED_PI?0:1)"; then
21
+ echo "Installing @earendil-works/pi-coding-agent@${PINNED_PI}..."
22
+ (cd "${PI_NPM_DIR}" && npm install "@earendil-works/pi-coding-agent@${PINNED_PI}" --save-exact --no-fund --no-audit --loglevel=error)
23
+ fi
24
+
15
25
  echo "Starting Dino API server on port ${PORT:-4003}..."
16
26
  exec node "${DINO_DIR}/scripts/api-server.mjs"