dsh-agy-link 0.4.83 → 0.4.84

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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.84 (2026-10-29)
4
+
5
+ ### English
6
+
7
+ - **Perf(parser): parse a multi-line chunk in O(n) instead of O(n²).**
8
+ - `StreamJsonParser.feed()` walked the buffer with a `while` loop that re-sliced `this.buffer` on every newline — each slice copies the whole remainder, so a large chunk carrying many lines was quadratic in copied bytes. It now splits once (`split('\n')`, keep the torn tail), which is linear; behaviour (incl. `\r\n` stripping and torn-chunk buffering) is unchanged. Adds a large-single-chunk regression test.
9
+
10
+ ### 中文
11
+
12
+ - **性能(parser):多行 chunk 由 O(n²) 改为 O(n) 解析。**
13
+ - `StreamJsonParser.feed()` 原来用 `while` 循环逐行 `this.buffer = this.buffer.slice(...)`,每次 slice 都会复制整个剩余缓冲,含大量行的大 chunk 呈平方级复制。现改为一次性 `split('\n')` 并保留未完成的尾部(线性);`\r\n` 去除与断块缓冲等行为不变。补充「单个大 chunk」回归测试。
14
+
15
+ **Full Changelog**: https://github.com/amlyczz/dsh-agy-link/compare/v0.4.83...v0.4.84
16
+
3
17
  ## 0.4.83 (2026-10-29)
4
18
 
5
19
  ### English
package/dist/index.js CHANGED
@@ -2721,12 +2721,13 @@ var StreamJsonParser = class {
2721
2721
  feed(chunk) {
2722
2722
  this.buffer += chunk;
2723
2723
  const out = [];
2724
- let nl;
2725
- while ((nl = this.buffer.indexOf("\n")) >= 0) {
2726
- const line = this.buffer.slice(0, nl).replace(/\r$/, "");
2727
- this.buffer = this.buffer.slice(nl + 1);
2728
- const ev = this.takeLine(line);
2729
- if (ev) out.push(ev);
2724
+ if (this.buffer.indexOf("\n") >= 0) {
2725
+ const parts = this.buffer.split("\n");
2726
+ this.buffer = parts.pop() ?? "";
2727
+ for (const part of parts) {
2728
+ const ev = this.takeLine(part.replace(/\r$/, ""));
2729
+ if (ev) out.push(ev);
2730
+ }
2730
2731
  }
2731
2732
  if (this.buffer.length > 8388608) {
2732
2733
  const dropped = this.buffer.length;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-agy-link",
3
- "version": "0.4.83",
3
+ "version": "0.4.84",
4
4
  "description": "Google Antigravity (agy CLI) models for DeepSeek Harness — stream Gemini/Claude/GPT-OSS subscriptions into DSH with thinking, tool activity, token usage and in-GUI Google OAuth login.",
5
5
  "type": "module",
6
6
  "license": "MIT",