@cosmicstack/mercury-agent 1.2.4 → 1.2.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicstack/mercury-agent",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "description": "Soul-driven AI agent with Second Brain memory, permission-hardened tools, token budgets, and multi-channel access. Runs 24/7 from CLI or Telegram.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -159,3 +159,34 @@ index 55acec7..035907a 100644
159
159
  });
160
160
  //# sourceMappingURL=reconciler.js.map
161
161
 
162
+ diff --git a/node_modules/ink/build/log-update.js b/node_modules/ink/build/log-update.js
163
+ --- a/node_modules/ink/build/log-update.js
164
+ +++ b/node_modules/ink/build/log-update.js
165
+ @@ -13,9 +13,26 @@
166
+ if (output === previousOutput) {
167
+ return;
168
+ }
169
+ + // Diff-render (Cosmic Stack patch): erase and rewrite only the rows
170
+ + // from the first changed line onward; identical rows above stay on
171
+ + // screen untouched. Ink 5's log-update erased and rewrote the ENTIRE
172
+ + // frame on every render — a prompt-selection change or spinner tick
173
+ + // repainted the whole live region, which read as a full-UI flash.
174
+ + // The row bytes are compared verbatim (layout is deterministic), and
175
+ + // the erase count accounts for the trailing blank line exactly like
176
+ + // `previousLineCount` does, so `clear()` and cursor arithmetic stay
177
+ + // in sync with the original accounting.
178
+ + const previousRows = previousOutput === '' ? [] : previousOutput.slice(0, -1).split('\n');
179
+ + const nextRows = output.slice(0, -1).split('\n');
180
+ + const common = Math.min(previousRows.length, nextRows.length);
181
+ + let firstChange = 0;
182
+ + while (firstChange < common && previousRows[firstChange] === nextRows[firstChange]) {
183
+ + firstChange++;
184
+ + }
185
+ + const eraseCount = previousLineCount - firstChange;
186
+ previousOutput = output;
187
+ - stream.write(ansiEscapes.eraseLines(previousLineCount) + output);
188
+ previousLineCount = output.split('\n').length;
189
+ + stream.write(ansiEscapes.eraseLines(eraseCount) + nextRows.slice(firstChange).join('\n') + '\n');
190
+ };
191
+ render.clear = () => {
192
+ stream.write(ansiEscapes.eraseLines(previousLineCount));