arbiter-ai 1.4.0 → 1.4.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.
@@ -60,24 +60,32 @@ export function createQuestLog(deps) {
60
60
  return text.slice(0, maxLen - 1) + '…';
61
61
  }
62
62
  /**
63
- * Wrap text to multiple lines
63
+ * Wrap text to multiple lines, respecting existing newlines
64
64
  */
65
65
  function wrapText(text, width) {
66
- const words = text.split(' ');
67
66
  const lines = [];
68
- let currentLine = '';
69
- for (const word of words) {
70
- if (currentLine.length + word.length + 1 <= width) {
71
- currentLine += (currentLine ? ' ' : '') + word;
67
+ // Split on newlines first, then wrap each paragraph
68
+ const paragraphs = text.split(/\r?\n/);
69
+ for (const paragraph of paragraphs) {
70
+ if (paragraph.trim() === '') {
71
+ lines.push('');
72
+ continue;
72
73
  }
73
- else {
74
- if (currentLine)
75
- lines.push(currentLine);
76
- currentLine = word;
74
+ const words = paragraph.split(' ');
75
+ let currentLine = '';
76
+ for (const word of words) {
77
+ if (currentLine.length + word.length + 1 <= width) {
78
+ currentLine += (currentLine ? ' ' : '') + word;
79
+ }
80
+ else {
81
+ if (currentLine)
82
+ lines.push(currentLine);
83
+ currentLine = word;
84
+ }
77
85
  }
86
+ if (currentLine)
87
+ lines.push(currentLine);
78
88
  }
79
- if (currentLine)
80
- lines.push(currentLine);
81
89
  return lines;
82
90
  }
83
91
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arbiter-ai",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "Hierarchical AI orchestration system for extending Claude's effective context window while staying on task",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",