pi-soly 2.6.0 → 2.6.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/visual/chrome.ts +18 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-soly",
3
- "version": "2.6.0",
3
+ "version": "2.6.1",
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/visual/chrome.ts CHANGED
@@ -103,10 +103,27 @@ export function createChrome(getConfig: () => ChromeConfig): Chrome {
103
103
  working = null;
104
104
  };
105
105
 
106
+ // TTL timer for the event sub-line. Each emit() schedules a clear after
107
+ // EVENT_TTL_MS; a new emit or startWorking cancels the previous timer.
108
+ let eventClearTimer: ReturnType<typeof setTimeout> | null = null;
109
+ const EVENT_TTL_MS = 5_000;
110
+
111
+ const clearEventSoon = (): void => {
112
+ if (eventClearTimer) clearTimeout(eventClearTimer);
113
+ eventClearTimer = setTimeout(() => {
114
+ data.recentEvent = null;
115
+ data.recentEventLevel = null;
116
+ eventClearTimer = null;
117
+ if (working) renderWorking();
118
+ try { tui?.requestRender(); } catch { /* not mounted yet */ }
119
+ }, EVENT_TTL_MS);
120
+ };
121
+
106
122
  return {
107
123
  emit(text: string, level: "info" | "warning" | "error" = "info"): void {
108
124
  data.recentEvent = text;
109
125
  data.recentEventLevel = level;
126
+ clearEventSoon();
110
127
  // Force the working message to re-render so the sub-line appears
111
128
  // immediately, even mid-turn.
112
129
  if (working) renderWorking();
@@ -152,6 +169,7 @@ export function createChrome(getConfig: () => ChromeConfig): Chrome {
152
169
  // from the previous turn, not relevant to the current one.
153
170
  data.recentEvent = null;
154
171
  data.recentEventLevel = null;
172
+ if (eventClearTimer) { clearTimeout(eventClearTimer); eventClearTimer = null; }
155
173
  working = { ui, startMs: Date.now(), inputTokens: data.ctxTokens ?? 0, outputTokens: 0, timer: null };
156
174
  renderWorking();
157
175
  working.timer = setInterval(renderWorking, 1000);