dsh-agy-link 0.4.82 → 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 +28 -0
- package/dist/index.js +21 -8
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
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
|
+
|
|
17
|
+
## 0.4.83 (2026-10-29)
|
|
18
|
+
|
|
19
|
+
### English
|
|
20
|
+
|
|
21
|
+
- **Fix(media): a malformed `file://` percent-escape no longer throws out of the media route.**
|
|
22
|
+
- `resolveLocalMediaPath()` called `decodeURIComponent()` unguarded on the `file://` path. A double-encoded query (`?path=file%3A%2F%2F%2F%25E0...`) decodes to the literal `file:///%E0%A4%A`, whose inner decode throws `URIError: URI malformed` straight out of `handleMediaRequest()` (unhandled). Malformed escapes are now decoded via a safe helper that returns `null`, so the route answers `404` instead of throwing. Adds a regression test.
|
|
23
|
+
|
|
24
|
+
### 中文
|
|
25
|
+
|
|
26
|
+
- **修复(media):畸形的 `file://` 百分号转义不再把异常抛出媒体路由。**
|
|
27
|
+
- `resolveLocalMediaPath()` 对 `file://` 路径直接 `decodeURIComponent()`,未做保护。经双重编码的查询(`?path=file%3A%2F%2F%2F%25E0...`)解析出字面量 `file:///%E0%A4%A`,其内部解码抛出 `URIError: URI malformed` 并从 `handleMediaRequest()` 直接逃逸。现在改用安全解码助手,畸形转义返回 `null`,路由回 `404` 而非抛异常。补充回归测试。
|
|
28
|
+
|
|
29
|
+
**Full Changelog**: https://github.com/amlyczz/dsh-agy-link/compare/v0.4.82...v0.4.83
|
|
30
|
+
|
|
3
31
|
## 0.4.82 (2026-10-29)
|
|
4
32
|
|
|
5
33
|
### 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
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
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;
|
|
@@ -35029,6 +35030,14 @@ const MIME_MAP = {
|
|
|
35029
35030
|
".json": "application/json; charset=utf-8"
|
|
35030
35031
|
};
|
|
35031
35032
|
const IS_WIN = process.platform === "win32";
|
|
35033
|
+
/** decodeURIComponent that returns null instead of throwing on malformed input. */
|
|
35034
|
+
function safeDecodeUri(s) {
|
|
35035
|
+
try {
|
|
35036
|
+
return decodeURIComponent(s);
|
|
35037
|
+
} catch {
|
|
35038
|
+
return null;
|
|
35039
|
+
}
|
|
35040
|
+
}
|
|
35032
35041
|
/**
|
|
35033
35042
|
* Normalize and resolve a raw path or file:// URL into a system file path.
|
|
35034
35043
|
* Converts WSL /mnt/X/ and /home/ paths on Windows where possible.
|
|
@@ -35037,10 +35046,14 @@ function resolveLocalMediaPath(rawPath, workspaceRoot) {
|
|
|
35037
35046
|
if (!rawPath || typeof rawPath !== "string") return null;
|
|
35038
35047
|
let p = rawPath.trim();
|
|
35039
35048
|
if (p.startsWith("file:///")) {
|
|
35040
|
-
|
|
35049
|
+
const decoded = safeDecodeUri(p.slice(8));
|
|
35050
|
+
if (decoded === null) return null;
|
|
35051
|
+
p = decoded;
|
|
35041
35052
|
if (IS_WIN && !/^[A-Za-z]:/.test(p) && /^\/[A-Za-z]:/.test(p)) p = p.slice(1);
|
|
35042
35053
|
} else if (p.startsWith("file://")) {
|
|
35043
|
-
|
|
35054
|
+
const decoded = safeDecodeUri(p.slice(7));
|
|
35055
|
+
if (decoded === null) return null;
|
|
35056
|
+
p = decoded;
|
|
35044
35057
|
if (IS_WIN && p.startsWith("wsl.localhost/")) p = "\\\\" + p.replace(/\//g, "\\");
|
|
35045
35058
|
}
|
|
35046
35059
|
if (IS_WIN) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-agy-link",
|
|
3
|
-
"version": "0.4.
|
|
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",
|