pi-soly 2.4.1 → 2.4.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.
- package/index.ts +1 -1
- package/package.json +1 -1
- package/quota/poller.ts +5 -0
package/index.ts
CHANGED
|
@@ -551,7 +551,7 @@ export default function solyExtension(pi: ExtensionAPI) {
|
|
|
551
551
|
// ChromeData each tick, resolves the registered adapter, writes
|
|
552
552
|
// quotaPercent/quotaResetsLabel back for the footer to render).
|
|
553
553
|
if (quotaPoller) quotaPoller.stop();
|
|
554
|
-
quotaPoller = startQuotaPoller(chrome.data, () => getActiveConfig().chrome.enabled);
|
|
554
|
+
quotaPoller = startQuotaPoller(chrome.data, () => getActiveConfig().chrome.enabled, () => chrome.poke());
|
|
555
555
|
// Editors save in bursts (write to .tmp, rename, touch). Coalesce
|
|
556
556
|
// those rapid reload events into a single sub-line event under the
|
|
557
557
|
// Working indicator (└─ reloaded 47 rules). Errors here are real
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-soly",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.2",
|
|
4
4
|
"description": "Workflow + project management for pi-coding-agent. Plans, state, MANDATORY rules, self-review, multi-question picker. One npm install, zero config. LLM drives the workflow inline via the soly_workflow tool — no external subagent plugin.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.ts",
|
package/quota/poller.ts
CHANGED
|
@@ -39,10 +39,14 @@ export type QuotaPoller = {
|
|
|
39
39
|
*
|
|
40
40
|
* @param data - the shared ChromeData (mutated in place with quota fields)
|
|
41
41
|
* @param isEnabled - gate; return false to skip polling (e.g. chrome disabled)
|
|
42
|
+
* @param onUpdate - called after each successful write to ChromeData, so the
|
|
43
|
+
* caller can trigger a footer re-render (pi doesn't auto-render when a
|
|
44
|
+
* background timer mutates data — only on token ticks / user input).
|
|
42
45
|
* @param intervalMs - override poll interval (default 60_000); for tests */
|
|
43
46
|
export function startQuotaPoller(
|
|
44
47
|
data: ChromeData,
|
|
45
48
|
isEnabled: () => boolean,
|
|
49
|
+
onUpdate: () => void,
|
|
46
50
|
intervalMs: number = POLL_INTERVAL_MS,
|
|
47
51
|
): QuotaPoller {
|
|
48
52
|
let stopped = false;
|
|
@@ -79,6 +83,7 @@ export function startQuotaPoller(
|
|
|
79
83
|
if (snapshot) {
|
|
80
84
|
data.quotaPercent = snapshot.remainingPercent;
|
|
81
85
|
data.quotaResetsLabel = snapshot.resetsInMs !== null ? formatReset(snapshot.resetsInMs) : null;
|
|
86
|
+
onUpdate();
|
|
82
87
|
}
|
|
83
88
|
// On null (fetch failed), keep the previous snapshot — don't clear.
|
|
84
89
|
scheduleNext();
|