@bahulam/code 0.1.3 → 0.1.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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bahulam/code",
3
- "version": "0.1.3",
4
- "description": "Bahulam Code \u2014 abundance, in your terminal. CLI-first, reliability-first, sub-agents, 65.6% SWE-bench Verified.",
3
+ "version": "0.1.4",
4
+ "description": "Bahulam Code abundance, in your terminal. CLI-first, reliability-first, sub-agents, 65.6% SWE-bench Verified.",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "bahulam": "src/terminal/main.mjs",
@@ -814,12 +814,23 @@ export function renderStagnation(data = {}) {
814
814
  const rawMessage = data?.message || '';
815
815
  const reason = data?.reason || rawMessage.replace(/^Stagnation:\s*/i, '').trim();
816
816
  const tool = data?.tool || data?.tool_name || '';
817
- const suggestion = data?.suggestion || data?.recovery_strategy || data?.strategy || '';
818
- const message = reason
819
- ? `Stagnation${tool ? ` (${tool})` : ''}: ${reason}`
820
- : `Stagnation${tool ? ` (${tool})` : ''} detected`;
821
- const key = `${message}\n${suggestion}`;
822
-
817
+ const count = data?.repeat_count || data?.count || null;
818
+ // Try to extract a target/path from the reason so we can show a
819
+ // compact one-liner. Reason shapes we know about from the framework:
820
+ // "Repeated overlapping <tool> inspections of '<target>' N times without mutation"
821
+ // "..." (fallback: use reason as-is, trimmed to ~80 chars)
822
+ const targetMatch = reason.match(/of\s+['"]([^'"]+)['"]/);
823
+ const target = targetMatch ? targetMatch[1] : '';
824
+
825
+ // Compose a compact single-line message:
826
+ // ! stagnation · read_file × 3 · v3_sse.py
827
+ // Falls back to a short slice of the reason when we can't parse it.
828
+ const parts = ['stagnation'];
829
+ if (tool) parts.push(`${tool}${count ? ` × ${count}` : ''}`);
830
+ if (target) parts.push(target);
831
+ const compact = parts.length > 1 ? parts.join(' · ') : reason.slice(0, 80);
832
+
833
+ const key = `${tool}:${target}:${count}`;
823
834
  if (session._lastStagnationWarning === key) return;
824
835
  session._lastStagnationWarning = key;
825
836
 
@@ -827,7 +838,9 @@ export function renderStagnation(data = {}) {
827
838
  flushContent();
828
839
  flushPendingHead();
829
840
  renderBlockBoundary('status', { compactSame: true });
830
- process.stderr.write(` ${c.yellow('!')} ${c.yellow(message)}\n`);
831
- if (suggestion) process.stderr.write(` ${c.dim(suggestion)}\n`);
841
+ // One line, dim yellow, no follow-up paragraph. The full guidance is
842
+ // still injected into the LLM context on the backend side — no need
843
+ // to also spam the operator's terminal with it.
844
+ process.stderr.write(` ${c.yellow('!')} ${c.dim(c.yellow(compact))}\n`);
832
845
  runtime.lastRenderedBlock = 'status';
833
846
  }