pi-cursor-sdk 0.5.2 → 0.5.3

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.
Files changed (47) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +38 -17
  3. package/dist/context.js +2 -2
  4. package/dist/cursor-custom-subagent-definitions.js +1 -1
  5. package/dist/cursor-fallback-models.generated.js +402 -1
  6. package/dist/cursor-local-agent-ownership.js +17 -0
  7. package/dist/cursor-mcp-timeout-override.js +1 -1
  8. package/dist/cursor-pi-tool-bridge-diagnostics.js +4 -0
  9. package/dist/cursor-pi-tool-bridge-run.js +10 -3
  10. package/dist/cursor-provider-errors.js +2 -2
  11. package/dist/cursor-provider-turn-summary.js +1 -1
  12. package/dist/cursor-session-agent-cleanup.js +10 -1
  13. package/dist/cursor-session-agent-lifecycle.js +2 -2
  14. package/dist/cursor-session-agent-lineage.js +11 -7
  15. package/dist/cursor-session-agent-resume.js +15 -9
  16. package/dist/cursor-session-agent.js +22 -7
  17. package/dist/cursor-session-scope.js +27 -14
  18. package/dist/cursor-session-settings.js +3 -3
  19. package/dist/cursor-session-store.js +1 -1
  20. package/dist/cursor-state.js +17 -6
  21. package/dist/model-discovery.js +8 -9
  22. package/docs/cursor-live-smoke-checklist.md +2 -2
  23. package/docs/cursor-model-ux-spec.md +23 -14
  24. package/docs/cursor-native-tool-replay.md +6 -3
  25. package/docs/cursor-native-tool-visual-audit.md +1 -1
  26. package/docs/cursor-testing-lessons.md +24 -6
  27. package/docs/cursor-tool-surfaces.md +16 -1
  28. package/package.json +8 -8
  29. package/src/context.ts +2 -2
  30. package/src/cursor-custom-subagent-definitions.ts +1 -1
  31. package/src/cursor-fallback-models.generated.ts +402 -1
  32. package/src/cursor-local-agent-ownership.ts +18 -0
  33. package/src/cursor-mcp-timeout-override.ts +1 -1
  34. package/src/cursor-pi-tool-bridge-diagnostics.ts +17 -0
  35. package/src/cursor-pi-tool-bridge-run.ts +10 -3
  36. package/src/cursor-provider-errors.ts +2 -2
  37. package/src/cursor-provider-turn-summary.ts +1 -1
  38. package/src/cursor-session-agent-cleanup.ts +6 -1
  39. package/src/cursor-session-agent-lifecycle.ts +2 -2
  40. package/src/cursor-session-agent-lineage.ts +10 -5
  41. package/src/cursor-session-agent-resume.ts +14 -7
  42. package/src/cursor-session-agent.ts +23 -7
  43. package/src/cursor-session-scope.ts +33 -11
  44. package/src/cursor-session-settings.ts +3 -3
  45. package/src/cursor-session-store.ts +1 -1
  46. package/src/cursor-state.ts +25 -5
  47. package/src/model-discovery.ts +7 -8
@@ -115,9 +115,9 @@ function mapComparableLevel(
115
115
 
116
116
  function getThinkingLevelMap(item: ModelListItem): ThinkingLevelMap | undefined {
117
117
  const reasoningParameter = getParameter(item, "reasoning");
118
- const effortParameter = getParameter(item, "effort");
118
+ const effortParameter = getParameter(item, "effort") ?? getParameter(item, "reasoning_effort");
119
119
  const thinkingParameter = getParameter(item, "thinking");
120
- const valueParameter = effortParameter ?? reasoningParameter ?? thinkingParameter ?? getParameter(item, "reasoning_effort");
120
+ const valueParameter = effortParameter ?? reasoningParameter ?? thinkingParameter;
121
121
  if (!valueParameter) return undefined;
122
122
 
123
123
  if (valueParameter.id === "thinking" && hasBooleanValues(valueParameter)) {
@@ -306,11 +306,12 @@ function applyThinkingLevel(
306
306
  ): void {
307
307
  const mapped = metadata.thinkingLevelMap?.[level];
308
308
  if (mapped === undefined || mapped === null) return;
309
+ const effortId = metadata.parameterIds.effort ? "effort" : metadata.parameterIds.reasoning_effort ? "reasoning_effort" : undefined;
309
310
 
310
311
  if (level === "off") {
311
312
  if (metadata.parameterIds.thinking && mapped === "false") {
312
313
  setParam(params, "thinking", mapped);
313
- deleteParam(params, "effort");
314
+ if (effortId) deleteParam(params, effortId);
314
315
  return;
315
316
  }
316
317
  if (metadata.parameterIds.reasoning) {
@@ -319,9 +320,9 @@ function applyThinkingLevel(
319
320
  return;
320
321
  }
321
322
 
322
- if (metadata.parameterIds.effort) {
323
+ if (effortId) {
323
324
  if (metadata.parameterIds.thinking) setParam(params, "thinking", "true");
324
- setParam(params, "effort", mapped);
325
+ setParam(params, effortId, mapped);
325
326
  return;
326
327
  }
327
328
 
@@ -332,8 +333,6 @@ function applyThinkingLevel(
332
333
 
333
334
  if (metadata.parameterIds.thinking) {
334
335
  setParam(params, "thinking", mapped);
335
- } else if (metadata.parameterIds.reasoning_effort) {
336
- setParam(params, "reasoning_effort", mapped);
337
336
  }
338
337
  }
339
338
 
@@ -418,7 +417,7 @@ export async function discoverModels(options: DiscoverModelsOptions = {}): Promi
418
417
  try {
419
418
  const { Cursor } = await loadCursorSdk();
420
419
  options.signal?.throwIfAborted();
421
- // SDK 1.0.36 CursorRequestOptions has no caller signal. A late response
420
+ // SDK 1.0.37 CursorRequestOptions has no caller signal. A late response
422
421
  // still cannot publish outside the native generation that requested it.
423
422
  const models = await Cursor.models.list({ apiKey });
424
423
  options.signal?.throwIfAborted();