pi-cursor-sdk 0.1.0 → 0.1.2

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,23 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.2 - 2026-05-07
4
+
5
+ ### Changed
6
+
7
+ - Migrated the local pi development baseline and peer metadata from deprecated `@mariozechner/*` packages to maintained `@earendil-works/*` `0.74.0`.
8
+ - Regenerated the npm lockfile against the current stable dependency graph and cleared moderate audit findings with current transitive overrides.
9
+
10
+ ## 0.1.1 - 2026-05-05
11
+
12
+ ### Fixed
13
+
14
+ - Use the bundled default context window for newly discovered Cursor models that do not expose a catalog `context` parameter.
15
+ - Redact more Cursor SDK error formats, including JSON-style `apiKey`, `token`, `session_id`, and multi-pair cookie values.
16
+
17
+ ### Changed
18
+
19
+ - Keep local demo-script notes out of the published npm tarball.
20
+
3
21
  ## 0.1.0 - 2026-05-04
4
22
 
5
23
  Initial public release.
package/package.json CHANGED
@@ -1,10 +1,18 @@
1
1
  {
2
2
  "name": "pi-cursor-sdk",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
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",
7
- "keywords": ["pi-package", "pi", "pi-extension", "cursor", "cursor-sdk", "ai", "extension"],
7
+ "keywords": [
8
+ "pi-package",
9
+ "pi",
10
+ "pi-extension",
11
+ "cursor",
12
+ "cursor-sdk",
13
+ "ai",
14
+ "extension"
15
+ ],
8
16
  "repository": {
9
17
  "type": "git",
10
18
  "url": "git+https://github.com/fitchmultz/pi-cursor-sdk.git"
@@ -13,7 +21,13 @@
13
21
  "url": "https://github.com/fitchmultz/pi-cursor-sdk/issues"
14
22
  },
15
23
  "homepage": "https://github.com/fitchmultz/pi-cursor-sdk#readme",
16
- "files": ["src", "README.md", "docs", "LICENSE", "CHANGELOG.md"],
24
+ "files": [
25
+ "src",
26
+ "README.md",
27
+ "docs/cursor-model-ux-spec.md",
28
+ "LICENSE",
29
+ "CHANGELOG.md"
30
+ ],
17
31
  "type": "module",
18
32
  "engines": {
19
33
  "node": ">=18"
@@ -27,16 +41,22 @@
27
41
  "@cursor/sdk": "^1.0.12"
28
42
  },
29
43
  "peerDependencies": {
30
- "@mariozechner/pi-ai": "*",
31
- "@mariozechner/pi-coding-agent": "*"
44
+ "@earendil-works/pi-ai": "*",
45
+ "@earendil-works/pi-coding-agent": "*"
32
46
  },
33
47
  "devDependencies": {
34
- "@mariozechner/pi-coding-agent": "^0.72.1",
35
- "@mariozechner/pi-ai": "^0.72.1",
48
+ "@earendil-works/pi-ai": "^0.74.0",
49
+ "@earendil-works/pi-coding-agent": "^0.74.0",
36
50
  "typescript": "^6.0.3",
37
51
  "vitest": "^4.1.5"
38
52
  },
39
53
  "pi": {
40
- "extensions": ["./src/index.ts"]
54
+ "extensions": [
55
+ "./src/index.ts"
56
+ ]
57
+ },
58
+ "overrides": {
59
+ "undici": "7.25.0",
60
+ "sqlite3": "6.0.1"
41
61
  }
42
62
  }
@@ -1,6 +1,6 @@
1
1
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
2
2
  import { dirname, join } from "node:path";
3
- import { getAgentDir } from "@mariozechner/pi-coding-agent";
3
+ import { getAgentDir } from "@earendil-works/pi-coding-agent";
4
4
  import { BUNDLED_CONTEXT_WINDOWS } from "./bundled-context-windows.js";
5
5
 
6
6
  const CONTEXT_WINDOW_CACHE_FILE = "cursor-sdk-context-windows.json";
@@ -41,7 +41,8 @@ export function loadContextWindowCache(): Map<string, number> {
41
41
  }
42
42
 
43
43
  export function getCachedContextWindow(modelId: string): number | undefined {
44
- return loadContextWindowCache().get(modelId);
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 = BUNDLED_CONTEXT_WINDOWS[modelId as keyof typeof BUNDLED_CONTEXT_WINDOWS];
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/context.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Context, Message, ToolCall } from "@mariozechner/pi-ai";
1
+ import type { Context, Message, ToolCall } from "@earendil-works/pi-ai";
2
2
  import type { SDKImage } from "@cursor/sdk";
3
3
 
4
4
  export interface CursorPrompt {
@@ -6,7 +6,7 @@ import {
6
6
  type Model,
7
7
  type SimpleStreamOptions,
8
8
  type AssistantMessage,
9
- } from "@mariozechner/pi-ai";
9
+ } from "@earendil-works/pi-ai";
10
10
  import { Agent, createAgentPlatform } from "@cursor/sdk";
11
11
  import type { InteractionUpdate, SDKAgent } from "@cursor/sdk";
12
12
  import { buildCursorPrompt } from "./context.js";
@@ -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(/(authorization\s*[:=]\s*)[^\s,;}]+/gi, "$1[redacted]")
65
- .replace(/(api[_-]?key\s*[:=]\s*)[^\s,;}]+/gi, "$1[redacted]")
66
- .replace(/(token\s*[:=]\s*)[^\s,;}]+/gi, "$1[redacted]")
67
- .replace(/(cookie\s*[:=]\s*)[^\n]+/gi, "$1[redacted]")
68
- .replace(/(session\s*[:=]\s*)[^\s,;}]+/gi, "$1[redacted]");
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 {
@@ -1,7 +1,7 @@
1
1
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
2
2
  import { dirname, join } from "node:path";
3
- import type { ExtensionAPI, ExtensionContext } from "@mariozechner/pi-coding-agent";
4
- import { getAgentDir } from "@mariozechner/pi-coding-agent";
3
+ import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
4
+ import { getAgentDir } from "@earendil-works/pi-coding-agent";
5
5
  import { getCursorModelMetadata } from "./model-discovery.js";
6
6
 
7
7
  const CURSOR_PROVIDER = "cursor";
package/src/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
1
+ import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
2
2
  import { discoverModels, type CursorModelFallbackIssue } from "./model-discovery.js";
3
3
  import { registerCursorFastControls } from "./cursor-state.js";
4
4
  import { streamCursor } from "./cursor-provider.js";
@@ -5,8 +5,8 @@ import type {
5
5
  ModelParameterValue,
6
6
  ModelSelection,
7
7
  } from "@cursor/sdk";
8
- import type { ProviderModelConfig } from "@mariozechner/pi-coding-agent";
9
- import type { ModelThinkingLevel, ThinkingLevelMap } from "@mariozechner/pi-ai";
8
+ import type { ProviderModelConfig } from "@earendil-works/pi-coding-agent";
9
+ import type { ModelThinkingLevel, ThinkingLevelMap } from "@earendil-works/pi-ai";
10
10
  import { getCachedContextWindow } from "./context-window-cache.js";
11
11
 
12
12
  const FALLBACK_CONTEXT_WINDOW = 128000;