pi-usage-hub 1.0.1 → 1.0.2

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.
Files changed (2) hide show
  1. package/README.md +7 -6
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -101,7 +101,7 @@ Built-in providers are the ones already used and smoke-tested by the author. The
101
101
 
102
102
  ## Pull API
103
103
 
104
- The hub caches results for 60 seconds and deduplicates concurrent requests. It never pushes footer text: consumers refresh data, read the cached summary, and re-render when notified.
104
+ The hub caches results for 60 seconds and deduplicates concurrent requests. It never pushes footer text: consumers start refreshes without blocking lifecycle events, read the cached summary, and re-render when notified.
105
105
 
106
106
  | API | Role |
107
107
  |-----|------|
@@ -135,14 +135,15 @@ const offUpdated = pi.events.on("pi-usage-hub:updated", () => {
135
135
  requestRender?.();
136
136
  });
137
137
 
138
- pi.on("session_start", async (_event, ctx) => {
138
+ // Pi awaits lifecycle handlers; refresh in the background and re-render on pi-usage-hub:updated.
139
+ pi.on("session_start", (_event, ctx) => {
139
140
  void usageHub?.refresh({ model: ctx.model, force: true });
140
141
  });
141
- pi.on("model_select", async (event) => {
142
- await usageHub?.refresh({ model: event.model, force: true });
142
+ pi.on("model_select", (event) => {
143
+ void usageHub?.refresh({ model: event.model, force: true });
143
144
  });
144
- pi.on("agent_end", async (_event, ctx) => {
145
- await usageHub?.refresh({ model: ctx.model, force: true });
145
+ pi.on("agent_end", (_event, ctx) => {
146
+ void usageHub?.refresh({ model: ctx.model, force: true });
146
147
  });
147
148
 
148
149
  // Inside footer render():
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-usage-hub",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Usage hub for pi — provider quota/balance registry with cache, /usage-hub panel, and pull API",
5
5
  "keywords": [
6
6
  "pi",