pi-cost 0.1.0 → 0.1.1
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 +3 -0
- package/package.json +1 -1
- package/server.js +3 -2
package/README.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# pi-cost
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/pi-cost)
|
|
4
|
+
[](https://www.npmjs.com/package/pi-cost)
|
|
5
|
+
|
|
3
6
|
Cost dashboard for the [pi coding agent](https://pi.dev) — overview → project → session → message, with actual and estimated spend.
|
|
4
7
|
|
|
5
8
|
[](https://github.com/user-attachments/assets/f9383f3f-4379-4ca6-b920-badb35f5eea8)
|
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
+
const http = require('node:http');
|
|
4
5
|
const express = require('express');
|
|
5
6
|
const path = require('node:path');
|
|
6
7
|
const fsp = require('node:fs/promises');
|
|
@@ -644,7 +645,7 @@ loadAllThemes().then(() => {
|
|
|
644
645
|
console.log(`themes loaded: ${themes.size} (user dir: ${USER_THEME_DIR})`);
|
|
645
646
|
}).catch((e) => console.warn('themes: load failed:', e.message));
|
|
646
647
|
|
|
647
|
-
const server = app.listen(PORT, () => {
|
|
648
|
+
const server = http.createServer({ maxHeaderSize: 32768 }, app).listen(PORT, () => {
|
|
648
649
|
const actualPort = server.address().port;
|
|
649
650
|
console.log(`pi-cost dashboard running at http://localhost:${actualPort}`);
|
|
650
651
|
console.log(`Sessions dir: ${parsers.getSessionsDir()}`);
|
|
@@ -656,7 +657,7 @@ const server = app.listen(PORT, () => {
|
|
|
656
657
|
server.on('error', (err) => {
|
|
657
658
|
if (err.code === 'EADDRINUSE') {
|
|
658
659
|
console.log(`Port ${PORT} in use, trying random port...`);
|
|
659
|
-
const fallback = app.listen(0, () => {
|
|
660
|
+
const fallback = http.createServer({ maxHeaderSize: 32768 }, app).listen(0, () => {
|
|
660
661
|
const p = fallback.address().port;
|
|
661
662
|
console.log(`pi-cost dashboard running at http://localhost:${p}`);
|
|
662
663
|
if (process.argv.includes('--open')) {
|