@rama_nigg/open-cursor 2.3.10 → 2.3.11
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/dist/index.js +9 -1
- package/dist/plugin-entry.js +9 -1
- package/package.json +1 -1
- package/src/streaming/delta-tracker.ts +15 -1
package/dist/index.js
CHANGED
|
@@ -13331,7 +13331,15 @@ class DeltaTracker {
|
|
|
13331
13331
|
if (current.startsWith(previous)) {
|
|
13332
13332
|
return current.slice(previous.length);
|
|
13333
13333
|
}
|
|
13334
|
-
|
|
13334
|
+
if (previous.startsWith(current)) {
|
|
13335
|
+
return "";
|
|
13336
|
+
}
|
|
13337
|
+
let i = 0;
|
|
13338
|
+
const minLen = Math.min(previous.length, current.length);
|
|
13339
|
+
while (i < minLen && previous[i] === current[i]) {
|
|
13340
|
+
i++;
|
|
13341
|
+
}
|
|
13342
|
+
return current.slice(i);
|
|
13335
13343
|
}
|
|
13336
13344
|
}
|
|
13337
13345
|
|
package/dist/plugin-entry.js
CHANGED
|
@@ -13331,7 +13331,15 @@ class DeltaTracker {
|
|
|
13331
13331
|
if (current.startsWith(previous)) {
|
|
13332
13332
|
return current.slice(previous.length);
|
|
13333
13333
|
}
|
|
13334
|
-
|
|
13334
|
+
if (previous.startsWith(current)) {
|
|
13335
|
+
return "";
|
|
13336
|
+
}
|
|
13337
|
+
let i = 0;
|
|
13338
|
+
const minLen = Math.min(previous.length, current.length);
|
|
13339
|
+
while (i < minLen && previous[i] === current[i]) {
|
|
13340
|
+
i++;
|
|
13341
|
+
}
|
|
13342
|
+
return current.slice(i);
|
|
13335
13343
|
}
|
|
13336
13344
|
}
|
|
13337
13345
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rama_nigg/open-cursor",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.11",
|
|
4
4
|
"description": "No prompt limits. No broken streams. Full thinking + tool support. Your Cursor subscription, properly integrated.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/plugin-entry.js",
|
|
@@ -24,10 +24,24 @@ export class DeltaTracker {
|
|
|
24
24
|
return current;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
// Happy path: accumulated text grows with exact prefix match
|
|
27
28
|
if (current.startsWith(previous)) {
|
|
28
29
|
return current.slice(previous.length);
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
|
|
32
|
+
// Accumulated text was already fully emitted (e.g. duplicate or trimmed event)
|
|
33
|
+
if (previous.startsWith(current)) {
|
|
34
|
+
return "";
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Prefix mismatch (formatting drift, unicode normalization, whitespace changes):
|
|
38
|
+
// find longest common prefix and emit only the new suffix.
|
|
39
|
+
// This prevents re-emitting the entire accumulated text as a "delta".
|
|
40
|
+
let i = 0;
|
|
41
|
+
const minLen = Math.min(previous.length, current.length);
|
|
42
|
+
while (i < minLen && previous[i] === current[i]) {
|
|
43
|
+
i++;
|
|
44
|
+
}
|
|
45
|
+
return current.slice(i);
|
|
32
46
|
}
|
|
33
47
|
}
|