pi-goosedump 0.5.5 → 0.5.6

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/index.ts +8 -9
  2. package/package.json +1 -1
package/index.ts CHANGED
@@ -115,10 +115,6 @@ function resolveGoosedumpBinary(): string {
115
115
  }
116
116
  }
117
117
 
118
- function binaryPath(): string {
119
- return resolveGoosedumpBinary();
120
- }
121
-
122
118
  function goosedumpVersion(): string | null {
123
119
  try {
124
120
  const pkg = require('@jarkkojs/goosedump/package.json') as { version: string };
@@ -218,9 +214,12 @@ function hitMessage(h: HitJson): GoosedumpMessage {
218
214
  return { id: h.entryId, role: h.role, content: h.text, score: h.score };
219
215
  }
220
216
 
217
+ const ANSI_SGR = new RegExp(String.fromCharCode(27) + '\\[[0-9;]*m', 'g');
218
+
221
219
  function compactLine(content: string): string {
222
- const collapsed = content.replace(/\s+/g, ' ').trim();
223
- return truncateToWidth(collapsed, 80).replaceAll(String.fromCharCode(27) + '[0m', '');
220
+ const plain = content.replace(ANSI_SGR, '');
221
+ const collapsed = plain.replace(/\s+/g, ' ').trim();
222
+ return collapsed.length > 80 ? `${collapsed.slice(0, 80)}...` : collapsed;
224
223
  }
225
224
 
226
225
  function formatMessagesCompact(messages: GoosedumpMessage[]): string {
@@ -240,7 +239,7 @@ function missingContextId(action: string): AgentToolResult<void> {
240
239
  }
241
240
 
242
241
  function runGoosedump(args: string[]): string {
243
- return execFileSync('node', [binaryPath(), ...args], {
242
+ return execFileSync('node', [resolveGoosedumpBinary(), ...args], {
244
243
  encoding: 'utf-8',
245
244
  });
246
245
  }
@@ -659,7 +658,7 @@ async function runSessionBrowser(
659
658
  const total = compactLines.length;
660
659
  const window = compactLines.slice(compactScroll, compactScroll + COMPACT_VIEWPORT);
661
660
  for (const row of window) {
662
- lines.push(makeRow(text(truncateToWidth(row, innerW)), innerW, border));
661
+ lines.push(makeRow(text(row), innerW, border));
663
662
  }
664
663
  for (let i = window.length; i < COMPACT_VIEWPORT; i++) {
665
664
  lines.push(makeRow('', innerW, border));
@@ -696,7 +695,7 @@ async function runSessionBrowser(
696
695
  const cursor = isSelected ? accent('▶') : ' ';
697
696
  const idText = isSelected ? accent(listing.id) : text(listing.id);
698
697
  const line = ` ${cursor} ${idText}`;
699
- lines.push(makeRow(truncateToWidth(line, innerW), innerW, border));
698
+ lines.push(makeRow(line, innerW, border));
700
699
  }
701
700
 
702
701
  if (total > LIST_VIEWPORT) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-goosedump",
3
- "version": "0.5.5",
3
+ "version": "0.5.6",
4
4
  "description": "Coding agent context data browser plugin for pi",
5
5
  "keywords": [
6
6
  "goosedump",