@openhoo/hoopilot 1.1.0 → 1.3.0
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 +9 -1
- package/dist/cli.js +970 -27
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +989 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +30 -1
- package/dist/index.d.ts +30 -1
- package/dist/index.js +988 -26
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,6 +14,7 @@ This project uses GitHub Copilot service endpoints and is not an official GitHub
|
|
|
14
14
|
- Anthropic Messages compatibility for Claude Code and other Anthropic-style clients.
|
|
15
15
|
- Bundled `codexx` launcher that runs Codex against a local Hoopilot server with the right Responses API provider settings.
|
|
16
16
|
- Local API-key gate, loopback-safe defaults, structured logs, Prometheus metrics, and Copilot quota reporting.
|
|
17
|
+
- Self-contained live dashboard at `/dashboard` showing usage and status metrics in real time.
|
|
17
18
|
- npm package, standalone binaries, Docker image, and self-update support for release binaries.
|
|
18
19
|
|
|
19
20
|
## Quick start
|
|
@@ -273,12 +274,18 @@ Hoopilot tracks token usage, request counts, and latency in memory while the ser
|
|
|
273
274
|
- `GET /v1/usage` returns JSON combining the proxy metrics snapshot with live Copilot quota fetched from GitHub and cached for 60 seconds. If quota cannot be read, `copilot` is `null` and `copilot_error` explains why. The snapshot's `proxy.githubRateLimit` field reports the most recent GitHub REST rate-limit budget per resource (`limit`, `remaining`, `used`, `resetAt`, `retryAfterSeconds`, `observedAt`).
|
|
274
275
|
- `hoopilot usage` prints your Copilot plan and quota — and, when GitHub returns them, your GitHub API rate-limit budget — from the command line.
|
|
275
276
|
|
|
276
|
-
Token usage is read from the upstream `usage` object. For streaming chat completions, usage is only available when the client sends `stream_options: {"include_usage": true}`; Hoopilot does not inject that flag. Responses API streaming always reports usage, so streamed Responses requests are fully accounted.
|
|
277
|
+
Token usage is read from the upstream `usage` object. For streaming chat completions, usage is only available when the client sends `stream_options: {"include_usage": true}`; Hoopilot does not inject that flag. Responses API streaming always reports usage, so streamed Responses requests are fully accounted. The `hoopilot_token_extraction_total{outcome="extracted"|"missing"}` counter (mirrored in `/v1/usage` as `proxy.tokens.extraction`) tracks how often a completion reported usage versus not, so a rising `missing` count flags clients whose token usage is going unaccounted.
|
|
277
278
|
|
|
278
279
|
GitHub API usage is read from the `x-ratelimit-*` response headers that `api.github.com` returns on the `copilot_internal/user` quota call Hoopilot already makes, so it costs no extra request. (The Copilot completion host `api.githubcopilot.com` does not currently emit these headers, so per-completion rate-limit data is not yet available there.)
|
|
279
280
|
|
|
280
281
|
`/metrics` and `/v1/usage` are subject to the same `HOOPILOT_API_KEY` gate as the other routes.
|
|
281
282
|
|
|
283
|
+
## Dashboard
|
|
284
|
+
|
|
285
|
+
`GET /dashboard` serves a self-contained live dashboard — open `http://127.0.0.1:4141/dashboard` in a browser. It renders the proxy's status and usage in real time: request rate, tokens/sec, in-flight requests, uptime, a per-route request table, status-code and latency breakdowns, token usage by model, your Copilot quota, upstream-call health, and a throughput chart. It polls `/v1/usage` every few seconds (interval and pause are adjustable in the header) and computes rates client-side, with dark and light themes.
|
|
286
|
+
|
|
287
|
+
The page is a single HTML document with no external resources — no CDN, fonts, or images — so it works offline, in the Docker image, and in the standalone binary. The HTML shell is served without the API-key gate (it contains no secrets) so a browser navigation can load it; the data it polls from `/v1/usage` stays behind the gate, and when `HOOPILOT_API_KEY` is set the page prompts for the key (stored in the browser and sent as `x-api-key`). Cross-origin browser access is blocked as for every route, so open the dashboard by navigating to it directly rather than linking from another site.
|
|
288
|
+
|
|
282
289
|
## Troubleshooting
|
|
283
290
|
|
|
284
291
|
### Codex auth errors
|
|
@@ -391,6 +398,7 @@ Options:
|
|
|
391
398
|
## Endpoints
|
|
392
399
|
|
|
393
400
|
- `GET /` and `GET /healthz`
|
|
401
|
+
- `GET /dashboard`
|
|
394
402
|
- `GET /metrics`
|
|
395
403
|
- `GET /v1/models`
|
|
396
404
|
- `GET /v1/usage`
|