@assertrx/dino 1.0.6 → 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/README.md +10 -10
- package/package.json +2 -2
- package/scripts/api-server.mjs +1 -1
- package/scripts/setup-dino-api.bat +39 -2
- package/scripts/setup-dino-api.sh +24 -2
- package/scripts/start-dino-server.bat +13 -1
- package/scripts/start-dino-server.sh +11 -1
package/README.md
CHANGED
|
@@ -310,7 +310,7 @@ This single script:
|
|
|
310
310
|
1. Checks that Node.js is installed
|
|
311
311
|
2. Installs `pi` globally if missing
|
|
312
312
|
3. Installs `@assertrx/dino` via `pi install` if missing
|
|
313
|
-
4. Starts the API server on port
|
|
313
|
+
4. Starts the API server on port 4003
|
|
314
314
|
|
|
315
315
|
### Manual setup
|
|
316
316
|
|
|
@@ -378,28 +378,28 @@ All POST bodies accept auth/model options, `cwd` (workspace directory, defaults
|
|
|
378
378
|
|
|
379
379
|
```bash
|
|
380
380
|
# List all prompts
|
|
381
|
-
curl http://localhost:
|
|
381
|
+
curl http://localhost:4003/api/prompts
|
|
382
382
|
|
|
383
383
|
# Discover providers and their auth status
|
|
384
|
-
curl http://localhost:
|
|
384
|
+
curl http://localhost:4003/api/providers
|
|
385
385
|
|
|
386
386
|
# List models available to the server (optionally per provider)
|
|
387
|
-
curl http://localhost:
|
|
388
|
-
curl "http://localhost:
|
|
387
|
+
curl http://localhost:4003/api/models
|
|
388
|
+
curl "http://localhost:4003/api/models?provider=anthropic"
|
|
389
389
|
|
|
390
390
|
# Execute a prompt (SSE streaming, auth from env vars)
|
|
391
|
-
curl -X POST http://localhost:
|
|
391
|
+
curl -X POST http://localhost:4003/api/prompts/setup-playwright \
|
|
392
392
|
-H "Content-Type: application/json" \
|
|
393
393
|
-d '{"cwd": "/path/to/workspace"}'
|
|
394
394
|
|
|
395
395
|
# Execute with a single provider key + model selection
|
|
396
396
|
# (env: export OPENAI_API_KEY=sk-... then:)
|
|
397
|
-
curl -X POST http://localhost:
|
|
397
|
+
curl -X POST http://localhost:4003/api/prompts/setup-playwright \
|
|
398
398
|
-H "Content-Type: application/json" \
|
|
399
399
|
-d '{"cwd": "/path/to/workspace", "model": "openai/gpt-5.2"}'
|
|
400
400
|
|
|
401
401
|
# Execute with multiple per-request API keys and an explicit model
|
|
402
|
-
curl -X POST http://localhost:
|
|
402
|
+
curl -X POST http://localhost:4003/api/prompts/setup-playwright \
|
|
403
403
|
-H "Content-Type: application/json" \
|
|
404
404
|
-d '{
|
|
405
405
|
"cwd": "/path/to/workspace",
|
|
@@ -408,7 +408,7 @@ curl -X POST http://localhost:3000/api/prompts/setup-playwright \
|
|
|
408
408
|
}'
|
|
409
409
|
|
|
410
410
|
# Execute with URL parameter (non-streaming JSON response)
|
|
411
|
-
curl -X POST http://localhost:
|
|
411
|
+
curl -X POST http://localhost:4003/api/prompts/generate-pom-from-url-cli \
|
|
412
412
|
-H "Content-Type: application/json" \
|
|
413
413
|
-d '{"url": "https://example.com", "outputDir": "tests/pom", "stream": false}'
|
|
414
414
|
```
|
|
@@ -439,7 +439,7 @@ event: error → {"message": "..."} # error
|
|
|
439
439
|
|
|
440
440
|
| Variable | Default | Description |
|
|
441
441
|
|----------|---------|-------------|
|
|
442
|
-
| `PORT` | `
|
|
442
|
+
| `PORT` | `4003` | Server port |
|
|
443
443
|
| `HOST` | `0.0.0.0` | Server host |
|
|
444
444
|
| Provider env vars | — | Any provider's standard env var (e.g. `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY`); per-request `apiKeys`/`apiKey` override these |
|
|
445
445
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@assertrx/dino",
|
|
3
|
-
"version": "1.0.
|
|
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",
|
package/scripts/api-server.mjs
CHANGED
|
@@ -545,7 +545,7 @@ app.post("/api/prompts/:name", async (request, reply) => {
|
|
|
545
545
|
});
|
|
546
546
|
|
|
547
547
|
// ── Start server ───────────────────────────────────────────────────────────
|
|
548
|
-
const PORT = parseInt(process.env.PORT || "
|
|
548
|
+
const PORT = parseInt(process.env.PORT || "4003", 10);
|
|
549
549
|
const HOST = process.env.HOST || "0.0.0.0";
|
|
550
550
|
|
|
551
551
|
try {
|
|
@@ -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,12 +56,49 @@ 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.
|
|
62
99
|
|
|
63
100
|
:: Defaults — override via env vars
|
|
64
|
-
if "%PORT%"=="" set PORT=
|
|
101
|
+
if "%PORT%"=="" set PORT=4003
|
|
65
102
|
if "%HOST%"=="" set HOST=0.0.0.0
|
|
66
103
|
|
|
67
104
|
echo Port: %PORT%
|
|
@@ -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,11 +36,33 @@ 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 ""
|
|
42
64
|
|
|
43
|
-
PORT="${PORT:-
|
|
65
|
+
PORT="${PORT:-4003}"
|
|
44
66
|
HOST="${HOST:-0.0.0.0}"
|
|
45
67
|
|
|
46
68
|
echo " Port: ${PORT}"
|
|
@@ -10,7 +10,19 @@ if not exist "%DINO_DIR%" (
|
|
|
10
10
|
exit /b 1
|
|
11
11
|
)
|
|
12
12
|
|
|
13
|
-
|
|
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
|
+
|
|
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
|
|
16
28
|
:: to the local source copy when this script is run from the Dino repo.
|
|
@@ -12,5 +12,15 @@ if [ ! -d "${DINO_DIR}" ]; then
|
|
|
12
12
|
exit 1
|
|
13
13
|
fi
|
|
14
14
|
|
|
15
|
-
|
|
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
|
+
|
|
25
|
+
echo "Starting Dino API server on port ${PORT:-4003}..."
|
|
16
26
|
exec node "${DINO_DIR}/scripts/api-server.mjs"
|