pi-cursor-sdk 0.1.0 → 0.1.1
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 +11 -0
- package/package.json +2 -2
- package/src/context-window-cache.ts +4 -2
- package/src/cursor-provider.ts +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.1 - 2026-05-05
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- Use the bundled default context window for newly discovered Cursor models that do not expose a catalog `context` parameter.
|
|
8
|
+
- Redact more Cursor SDK error formats, including JSON-style `apiKey`, `token`, `session_id`, and multi-pair cookie values.
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- Keep local demo-script notes out of the published npm tarball.
|
|
13
|
+
|
|
3
14
|
## 0.1.0 - 2026-05-04
|
|
4
15
|
|
|
5
16
|
Initial public release.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-cursor-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "pi provider extension backed by @cursor/sdk local agents",
|
|
5
5
|
"author": "Mitch Fultz (https://github.com/fitchmultz)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"url": "https://github.com/fitchmultz/pi-cursor-sdk/issues"
|
|
14
14
|
},
|
|
15
15
|
"homepage": "https://github.com/fitchmultz/pi-cursor-sdk#readme",
|
|
16
|
-
"files": ["src", "README.md", "docs", "LICENSE", "CHANGELOG.md"],
|
|
16
|
+
"files": ["src", "README.md", "docs/cursor-model-ux-spec.md", "LICENSE", "CHANGELOG.md"],
|
|
17
17
|
"type": "module",
|
|
18
18
|
"engines": {
|
|
19
19
|
"node": ">=18"
|
|
@@ -41,7 +41,8 @@ export function loadContextWindowCache(): Map<string, number> {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
export function getCachedContextWindow(modelId: string): number | undefined {
|
|
44
|
-
|
|
44
|
+
const cache = loadContextWindowCache();
|
|
45
|
+
return cache.get(modelId) ?? cache.get("default");
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
export function getCheckpointContextWindow(checkpoint: unknown): number | undefined {
|
|
@@ -56,7 +57,8 @@ export function getCheckpointContextWindow(checkpoint: unknown): number | undefi
|
|
|
56
57
|
export function saveCachedContextWindow(modelId: string, contextWindow: number): void {
|
|
57
58
|
if (!isPositiveInteger(contextWindow)) return;
|
|
58
59
|
const overrides = loadUserContextWindowOverrides();
|
|
59
|
-
const bundledContextWindow =
|
|
60
|
+
const bundledContextWindow =
|
|
61
|
+
BUNDLED_CONTEXT_WINDOWS[modelId as keyof typeof BUNDLED_CONTEXT_WINDOWS] ?? BUNDLED_CONTEXT_WINDOWS.default;
|
|
60
62
|
if (bundledContextWindow === contextWindow) {
|
|
61
63
|
if (!overrides.has(modelId)) return;
|
|
62
64
|
overrides.delete(modelId);
|
package/src/cursor-provider.ts
CHANGED
|
@@ -61,11 +61,11 @@ function scrubSensitiveText(text: string, apiKey?: string): string {
|
|
|
61
61
|
}
|
|
62
62
|
return scrubbed
|
|
63
63
|
.replace(/Bearer\s+[A-Za-z0-9._~+/=-]+/gi, "Bearer [redacted]")
|
|
64
|
-
.replace(/(
|
|
65
|
-
.replace(
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
.replace(/((?:^|[\s,{])cookie["']?\s*[:=]\s*["']?)[^\n]+/gi, "$1[redacted]")
|
|
65
|
+
.replace(
|
|
66
|
+
/((?:authorization|api[_-]?key|apiKey|token|session(?:[_-]?id)?)["']?\s*[:=]\s*["']?)[^"'\s,;}]+/gi,
|
|
67
|
+
"$1[redacted]",
|
|
68
|
+
);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
function isGenericErrorMessage(message: string): boolean {
|