opencode-readseek 0.12.4 → 0.12.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.
Files changed (2) hide show
  1. package/dist/index.js +5 -9
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -2134,9 +2134,10 @@ function getBunSpawn() {
2134
2134
  return spawn;
2135
2135
  }
2136
2136
  async function readBoundedText(stream, streamName, maxOutputBytes, onOverflow) {
2137
- const reader = stream.getReader();
2137
+ const decoder = new TextDecoder;
2138
2138
  const chunks = [];
2139
2139
  let totalBytes = 0;
2140
+ const reader = stream.getReader();
2140
2141
  try {
2141
2142
  while (true) {
2142
2143
  const { done, value } = await reader.read();
@@ -2150,18 +2151,13 @@ async function readBoundedText(stream, streamName, maxOutputBytes, onOverflow) {
2150
2151
  });
2151
2152
  throw failureFromProcessResult({ stdout: "", stderr: "", exitCode: null, signal: null }, { overflow: streamName, maxOutputBytes });
2152
2153
  }
2153
- chunks.push(value);
2154
+ chunks.push(decoder.decode(value, { stream: true }));
2154
2155
  }
2155
2156
  } finally {
2156
2157
  reader.releaseLock();
2157
2158
  }
2158
- const bytes = new Uint8Array(totalBytes);
2159
- let offset = 0;
2160
- for (const chunk of chunks) {
2161
- bytes.set(chunk, offset);
2162
- offset += chunk.byteLength;
2163
- }
2164
- return new TextDecoder().decode(bytes);
2159
+ chunks.push(decoder.decode());
2160
+ return chunks.join("");
2165
2161
  }
2166
2162
  async function runReadSeekBun(binaryPath, args, options = {}) {
2167
2163
  const limits = resolveProcessLimits(options);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-readseek",
3
- "version": "0.12.4",
3
+ "version": "0.12.5",
4
4
  "description": "OpenCode plugin for anchored file operations and structural code navigation",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -33,8 +33,8 @@
33
33
  "node": ">=20.0.0"
34
34
  },
35
35
  "dependencies": {
36
- "@jarkkojs/readseek": "^0.12.4",
37
- "@jarkkojs/readseek-api": "^0.12.4",
36
+ "@jarkkojs/readseek": "^0.12.5",
37
+ "@jarkkojs/readseek-api": "^0.12.5",
38
38
  "@opencode-ai/plugin": "^1.18.18"
39
39
  },
40
40
  "devDependencies": {