@duckmind/dm-darwin-x64 0.35.2 → 0.35.4

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.
@@ -32,6 +32,7 @@ export type AnimationRuntimeState = {
32
32
  workingMessageApplied: boolean;
33
33
  workingWidgetApplied: boolean;
34
34
  workingIndicatorHidden: boolean;
35
+ lastWorkingMessage: string | undefined;
35
36
  lastWorkingLines: number;
36
37
  lastWorkingLineWidths: number[];
37
38
  currentAssistantMessage: any;
@@ -112,10 +113,11 @@ function createDefaultAnimationsRuntimeState(): AnimationRuntimeState {
112
113
  toolOwners: new Map(),
113
114
  ignoredAgentContexts: new WeakSet(),
114
115
  hiddenLabelApplied: false,
115
- workingMessageApplied: false,
116
- workingWidgetApplied: false,
117
- workingIndicatorHidden: false,
118
- lastWorkingLines: 0,
116
+ workingMessageApplied: false,
117
+ workingWidgetApplied: false,
118
+ workingIndicatorHidden: false,
119
+ lastWorkingMessage: undefined,
120
+ lastWorkingLines: 0,
119
121
  lastWorkingLineWidths: [],
120
122
  currentAssistantMessage: undefined,
121
123
  freezeGeneration: 0,
@@ -142,6 +144,7 @@ function migrateAnimationsRuntimeState(existing: Partial<AnimationRuntimeState>)
142
144
  if (typeof existing.workingMessageApplied !== "boolean") existing.workingMessageApplied = false;
143
145
  if (typeof existing.workingWidgetApplied !== "boolean") existing.workingWidgetApplied = false;
144
146
  if (typeof existing.workingIndicatorHidden !== "boolean") existing.workingIndicatorHidden = false;
147
+ if (typeof existing.lastWorkingMessage !== "string") existing.lastWorkingMessage = undefined;
145
148
  if (typeof existing.lastWorkingLines !== "number") existing.lastWorkingLines = 0;
146
149
  if (!Array.isArray(existing.lastWorkingLineWidths)) existing.lastWorkingLineWidths = [];
147
150
  if (!("currentAssistantMessage" in existing)) existing.currentAssistantMessage = undefined;
@@ -366,9 +369,12 @@ function renderWorkingAnimationFrame(state: AnimationRuntimeState, ui: any): boo
366
369
  const width = resolveAnimationWidth(state.settings.width, process.stdout.columns || 80);
367
370
  const lines = renderAnimationFrame(resolveAnimationNameForPhase(state, phase), state.frame, width, phase);
368
371
  if (isAnimationDebugEnabled()) state.lastWorkingLineWidths = summarizeWorkingLineWidths(lines);
369
- syncWorkingIndicatorForLines(state, ui, lines.length);
370
- const firstLine = lines[0] ?? "Working...";
371
- ui.setWorkingMessage(lines.length > 1 ? lines.join("\n") : firstLine);
372
+ restoreWorkingIndicator(state, ui);
373
+ const message = stableWorkingMessageForPhase(phase);
374
+ if (state.lastWorkingMessage !== message) {
375
+ ui.setWorkingMessage(message);
376
+ state.lastWorkingMessage = message;
377
+ }
372
378
  state.workingMessageApplied = true;
373
379
  writeAnimationDebugLog({ event: "working_render", state });
374
380
  if (state.workingWidgetApplied && typeof ui?.setWidget === "function") {
@@ -414,6 +420,7 @@ function clearWorkingAnimation(state: AnimationRuntimeState): void {
414
420
  state.workingMessageApplied = false;
415
421
  state.workingWidgetApplied = false;
416
422
  state.workingIndicatorHidden = false;
423
+ state.lastWorkingMessage = undefined;
417
424
  state.lastWorkingLines = 0;
418
425
  state.lastWorkingLineWidths = [];
419
426
  if (!shouldClearMessage && !shouldClearWidget && !shouldRestoreIndicator) return;
@@ -448,6 +455,10 @@ function resolveCurrentPhase(state: AnimationRuntimeState): AnimationPhase {
448
455
  return "working";
449
456
  }
450
457
 
458
+ function stableWorkingMessageForPhase(phase: AnimationPhase): string {
459
+ return phase === "tool" ? "Running..." : "Working...";
460
+ }
461
+
451
462
  function resolveAnimationNameForPhase(state: AnimationRuntimeState, phase: AnimationPhase): string {
452
463
  if (!state.settings.randomMode) {
453
464
  if (phase === "thinking") return state.settings.thinking;
@@ -108,6 +108,11 @@ export function stripSynchronizedOutputControls(data: string): string {
108
108
  return data.split(SYNCHRONIZED_OUTPUT_BEGIN).join("").split(SYNCHRONIZED_OUTPUT_END).join("");
109
109
  }
110
110
 
111
+ export function resetTextRenderingState(): string {
112
+ // Streamed tool output can leave SGR, OSC8, or DEC charset/SI-SO state active before the fixed input frame repaint.
113
+ return "\x1b[0m\x1b]8;;\x07\x0f\x1b%G\x1b(B\x1b)B\x1b*B\x1b+B";
114
+ }
115
+
111
116
  export function setScrollRegion(top: number, bottom: number): string {
112
117
  return `\x1b[${top};${bottom}r`;
113
118
  }
@@ -147,7 +152,7 @@ export function buildFixedEditorClusterPaint(
147
152
  const safeRows = Math.max(1, Math.floor(terminalRows));
148
153
  const safeWidth = Math.max(1, Math.floor(width));
149
154
  const startRow = Math.max(1, safeRows - cluster.lines.length + 1);
150
- let buffer = resetScrollRegion();
155
+ let buffer = resetScrollRegion() + resetTextRenderingState();
151
156
 
152
157
  for (let index = 0; index < cluster.lines.length; index++) {
153
158
  buffer += moveCursor(startRow + index, 1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duckmind/dm-darwin-x64",
3
- "version": "0.35.2",
3
+ "version": "0.35.4",
4
4
  "description": "DuckMind (dm) binary payload for darwin x64",
5
5
  "license": "MIT",
6
6
  "os": [