pi-cursor-sdk 0.5.3 → 0.5.5

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 (141) hide show
  1. package/CHANGELOG.md +61 -1
  2. package/README.md +62 -816
  3. package/dist/context.js +11 -5
  4. package/dist/cursor-agents-context.js +6 -6
  5. package/dist/cursor-api-key.js +1 -1
  6. package/dist/cursor-bridge-contract.js +1 -13
  7. package/dist/cursor-cloud-local-state.js +0 -1
  8. package/dist/cursor-config.js +1 -17
  9. package/dist/cursor-fallback-models.generated.js +424 -1
  10. package/dist/cursor-live-run-coordinator.js +1 -0
  11. package/dist/cursor-local-run-terminal-error.js +57 -0
  12. package/dist/cursor-mcp-timeout-override.js +6 -17
  13. package/dist/cursor-native-tool-display-replay.js +5 -5
  14. package/dist/cursor-native-tools.js +11 -0
  15. package/dist/cursor-pi-tool-bridge-env.js +25 -2
  16. package/dist/cursor-pi-tool-bridge-server.js +98 -48
  17. package/dist/cursor-pi-tool-bridge-snapshot.js +1 -1
  18. package/dist/cursor-pi-tool-bridge.js +4 -12
  19. package/dist/cursor-provider-errors.js +0 -6
  20. package/dist/cursor-provider-live-run-drain.js +8 -3
  21. package/dist/cursor-provider-overflow.js +7 -21
  22. package/dist/cursor-provider-turn-finalize.js +2 -0
  23. package/dist/cursor-provider-turn-prepare.js +8 -1
  24. package/dist/cursor-provider-turn-runner.js +17 -6
  25. package/dist/cursor-provider-turn-send.js +3 -0
  26. package/dist/cursor-provider.js +1 -4
  27. package/dist/cursor-runtime-state.js +3 -3
  28. package/dist/cursor-sdk-event-debug.js +2 -2
  29. package/dist/cursor-sdk-output-filter.js +1 -1
  30. package/dist/cursor-sdk-process-error-guard.js +1 -2
  31. package/dist/cursor-session-agent.js +6 -8
  32. package/dist/cursor-session-scope.js +1 -7
  33. package/dist/cursor-session-store.js +3 -2
  34. package/dist/cursor-state.js +9 -23
  35. package/dist/cursor-tool-lifecycle.js +0 -3
  36. package/dist/cursor-tool-manifest.js +3 -1
  37. package/dist/cursor-tool-presentation-registry.js +2 -4
  38. package/dist/cursor-tool-visibility.js +0 -3
  39. package/dist/cursor-transcript-tool-specs.js +1 -2
  40. package/dist/index.js +21 -0
  41. package/dist/model-discovery.js +0 -1
  42. package/dist/model-list-cache.js +4 -9
  43. package/docs/cursor-live-smoke-checklist.md +4 -4
  44. package/docs/cursor-model-ux-spec.md +18 -8
  45. package/docs/cursor-native-tool-replay.md +2 -2
  46. package/docs/cursor-native-tool-visual-audit.md +1 -1
  47. package/docs/cursor-testing-lessons.md +22 -4
  48. package/docs/cursor-tool-surfaces.md +32 -3
  49. package/docs/development.md +101 -0
  50. package/docs/platform-smoke-implementation.md +3 -2
  51. package/docs/reference.md +810 -0
  52. package/node_modules/@modelcontextprotocol/core/node_modules/zod/package.json +1 -1
  53. package/node_modules/@modelcontextprotocol/core/node_modules/zod/src/v4/classic/tests/array.test.ts +27 -0
  54. package/node_modules/@modelcontextprotocol/core/node_modules/zod/src/v4/classic/tests/map.test.ts +7 -0
  55. package/node_modules/@modelcontextprotocol/core/node_modules/zod/src/v4/classic/tests/set.test.ts +6 -0
  56. package/node_modules/@modelcontextprotocol/core/node_modules/zod/src/v4/core/compile.ts +9 -0
  57. package/node_modules/@modelcontextprotocol/core/node_modules/zod/src/v4/core/schemas.ts +35 -1
  58. package/node_modules/@modelcontextprotocol/core/node_modules/zod/src/v4/core/util.ts +13 -0
  59. package/node_modules/@modelcontextprotocol/core/node_modules/zod/src/v4/core/versions.ts +1 -1
  60. package/node_modules/@modelcontextprotocol/core/node_modules/zod/v4/core/compile.cjs +8 -0
  61. package/node_modules/@modelcontextprotocol/core/node_modules/zod/v4/core/compile.js +8 -0
  62. package/node_modules/@modelcontextprotocol/core/node_modules/zod/v4/core/schemas.cjs +30 -0
  63. package/node_modules/@modelcontextprotocol/core/node_modules/zod/v4/core/schemas.d.cts +3 -1
  64. package/node_modules/@modelcontextprotocol/core/node_modules/zod/v4/core/schemas.d.ts +3 -1
  65. package/node_modules/@modelcontextprotocol/core/node_modules/zod/v4/core/schemas.js +30 -0
  66. package/node_modules/@modelcontextprotocol/core/node_modules/zod/v4/core/util.cjs +15 -0
  67. package/node_modules/@modelcontextprotocol/core/node_modules/zod/v4/core/util.d.cts +2 -0
  68. package/node_modules/@modelcontextprotocol/core/node_modules/zod/v4/core/util.d.ts +2 -0
  69. package/node_modules/@modelcontextprotocol/core/node_modules/zod/v4/core/util.js +14 -0
  70. package/node_modules/@modelcontextprotocol/core/node_modules/zod/v4/core/versions.cjs +1 -1
  71. package/node_modules/@modelcontextprotocol/core/node_modules/zod/v4/core/versions.js +1 -1
  72. package/node_modules/@modelcontextprotocol/server/node_modules/zod/package.json +1 -1
  73. package/node_modules/@modelcontextprotocol/server/node_modules/zod/src/v4/classic/tests/array.test.ts +27 -0
  74. package/node_modules/@modelcontextprotocol/server/node_modules/zod/src/v4/classic/tests/map.test.ts +7 -0
  75. package/node_modules/@modelcontextprotocol/server/node_modules/zod/src/v4/classic/tests/set.test.ts +6 -0
  76. package/node_modules/@modelcontextprotocol/server/node_modules/zod/src/v4/core/compile.ts +9 -0
  77. package/node_modules/@modelcontextprotocol/server/node_modules/zod/src/v4/core/schemas.ts +35 -1
  78. package/node_modules/@modelcontextprotocol/server/node_modules/zod/src/v4/core/util.ts +13 -0
  79. package/node_modules/@modelcontextprotocol/server/node_modules/zod/src/v4/core/versions.ts +1 -1
  80. package/node_modules/@modelcontextprotocol/server/node_modules/zod/v4/core/compile.cjs +8 -0
  81. package/node_modules/@modelcontextprotocol/server/node_modules/zod/v4/core/compile.js +8 -0
  82. package/node_modules/@modelcontextprotocol/server/node_modules/zod/v4/core/schemas.cjs +30 -0
  83. package/node_modules/@modelcontextprotocol/server/node_modules/zod/v4/core/schemas.d.cts +3 -1
  84. package/node_modules/@modelcontextprotocol/server/node_modules/zod/v4/core/schemas.d.ts +3 -1
  85. package/node_modules/@modelcontextprotocol/server/node_modules/zod/v4/core/schemas.js +30 -0
  86. package/node_modules/@modelcontextprotocol/server/node_modules/zod/v4/core/util.cjs +15 -0
  87. package/node_modules/@modelcontextprotocol/server/node_modules/zod/v4/core/util.d.cts +2 -0
  88. package/node_modules/@modelcontextprotocol/server/node_modules/zod/v4/core/util.d.ts +2 -0
  89. package/node_modules/@modelcontextprotocol/server/node_modules/zod/v4/core/util.js +14 -0
  90. package/node_modules/@modelcontextprotocol/server/node_modules/zod/v4/core/versions.cjs +1 -1
  91. package/node_modules/@modelcontextprotocol/server/node_modules/zod/v4/core/versions.js +1 -1
  92. package/package.json +14 -6
  93. package/scripts/platform-smoke/artifact-secrets.mjs +13 -4
  94. package/scripts/platform-smoke/local-resume-runner.mjs +0 -1
  95. package/scripts/platform-smoke/target-runtime.mjs +4 -2
  96. package/scripts/platform-smoke/targets.mjs +0 -1
  97. package/scripts/steering-rpc-smoke.mjs +1 -1
  98. package/shared/cursor-sdk-output-filter.d.mts +2 -0
  99. package/shared/cursor-sdk-output-filter.mjs +92 -28
  100. package/shared/cursor-sensitive-text.d.mts +1 -0
  101. package/shared/cursor-sensitive-text.mjs +7 -0
  102. package/src/context.ts +16 -9
  103. package/src/cursor-agents-context.ts +6 -6
  104. package/src/cursor-api-key.ts +1 -1
  105. package/src/cursor-bridge-contract.ts +1 -15
  106. package/src/cursor-cloud-local-state.ts +0 -2
  107. package/src/cursor-config.ts +1 -24
  108. package/src/cursor-fallback-models.generated.ts +424 -1
  109. package/src/cursor-live-run-coordinator.ts +5 -0
  110. package/src/cursor-local-run-terminal-error.ts +58 -0
  111. package/src/cursor-mcp-timeout-override.ts +6 -30
  112. package/src/cursor-native-tool-display-replay.ts +4 -6
  113. package/src/cursor-native-tools.ts +14 -0
  114. package/src/cursor-pi-tool-bridge-env.ts +31 -2
  115. package/src/cursor-pi-tool-bridge-server.ts +89 -45
  116. package/src/cursor-pi-tool-bridge-snapshot.ts +0 -1
  117. package/src/cursor-pi-tool-bridge.ts +2 -18
  118. package/src/cursor-provider-errors.ts +0 -8
  119. package/src/cursor-provider-live-run-drain.ts +8 -2
  120. package/src/cursor-provider-overflow.ts +6 -24
  121. package/src/cursor-provider-turn-finalize.ts +2 -0
  122. package/src/cursor-provider-turn-prepare.ts +10 -1
  123. package/src/cursor-provider-turn-runner.ts +17 -6
  124. package/src/cursor-provider-turn-send.ts +2 -0
  125. package/src/cursor-provider.ts +0 -5
  126. package/src/cursor-runtime-state.ts +3 -3
  127. package/src/cursor-sdk-event-debug.ts +2 -2
  128. package/src/cursor-sdk-output-filter.ts +2 -1
  129. package/src/cursor-sdk-process-error-guard.ts +1 -3
  130. package/src/cursor-session-agent.ts +8 -8
  131. package/src/cursor-session-scope.ts +1 -9
  132. package/src/cursor-session-store.ts +3 -2
  133. package/src/cursor-state.ts +9 -36
  134. package/src/cursor-tool-lifecycle.ts +0 -4
  135. package/src/cursor-tool-manifest.ts +4 -1
  136. package/src/cursor-tool-presentation-registry.ts +3 -5
  137. package/src/cursor-tool-visibility.ts +0 -4
  138. package/src/cursor-transcript-tool-specs.ts +0 -3
  139. package/src/index.ts +18 -0
  140. package/src/model-discovery.ts +0 -1
  141. package/src/model-list-cache.ts +4 -10
@@ -1,4 +1,4 @@
1
- // Generated with @cursor/sdk@1.0.37 from 46 Cursor models.
1
+ // Generated with @cursor/sdk@1.0.40 from 49 Cursor models.
2
2
  // Refresh with: npm run refresh:cursor-snapshots -- --write
3
3
  // Do not add secrets; this file stores public model metadata only.
4
4
  export const FALLBACK_MODEL_ITEMS = [
@@ -4794,6 +4794,10 @@ export const FALLBACK_MODEL_ITEMS = [
4794
4794
  variants: [
4795
4795
  {
4796
4796
  params: [
4797
+ {
4798
+ id: "cyber",
4799
+ value: "false"
4800
+ },
4797
4801
  {
4798
4802
  id: "context",
4799
4803
  value: "300k"
@@ -4811,6 +4815,10 @@ export const FALLBACK_MODEL_ITEMS = [
4811
4815
  },
4812
4816
  {
4813
4817
  params: [
4818
+ {
4819
+ id: "cyber",
4820
+ value: "false"
4821
+ },
4814
4822
  {
4815
4823
  id: "context",
4816
4824
  value: "300k"
@@ -4828,6 +4836,10 @@ export const FALLBACK_MODEL_ITEMS = [
4828
4836
  },
4829
4837
  {
4830
4838
  params: [
4839
+ {
4840
+ id: "cyber",
4841
+ value: "false"
4842
+ },
4831
4843
  {
4832
4844
  id: "context",
4833
4845
  value: "300k"
@@ -4845,6 +4857,10 @@ export const FALLBACK_MODEL_ITEMS = [
4845
4857
  },
4846
4858
  {
4847
4859
  params: [
4860
+ {
4861
+ id: "cyber",
4862
+ value: "false"
4863
+ },
4848
4864
  {
4849
4865
  id: "context",
4850
4866
  value: "300k"
@@ -4862,6 +4878,10 @@ export const FALLBACK_MODEL_ITEMS = [
4862
4878
  },
4863
4879
  {
4864
4880
  params: [
4881
+ {
4882
+ id: "cyber",
4883
+ value: "false"
4884
+ },
4865
4885
  {
4866
4886
  id: "context",
4867
4887
  value: "300k"
@@ -4879,6 +4899,10 @@ export const FALLBACK_MODEL_ITEMS = [
4879
4899
  },
4880
4900
  {
4881
4901
  params: [
4902
+ {
4903
+ id: "cyber",
4904
+ value: "false"
4905
+ },
4882
4906
  {
4883
4907
  id: "context",
4884
4908
  value: "300k"
@@ -4896,6 +4920,10 @@ export const FALLBACK_MODEL_ITEMS = [
4896
4920
  },
4897
4921
  {
4898
4922
  params: [
4923
+ {
4924
+ id: "cyber",
4925
+ value: "false"
4926
+ },
4899
4927
  {
4900
4928
  id: "context",
4901
4929
  value: "300k"
@@ -4913,6 +4941,10 @@ export const FALLBACK_MODEL_ITEMS = [
4913
4941
  },
4914
4942
  {
4915
4943
  params: [
4944
+ {
4945
+ id: "cyber",
4946
+ value: "false"
4947
+ },
4916
4948
  {
4917
4949
  id: "context",
4918
4950
  value: "300k"
@@ -4930,6 +4962,10 @@ export const FALLBACK_MODEL_ITEMS = [
4930
4962
  },
4931
4963
  {
4932
4964
  params: [
4965
+ {
4966
+ id: "cyber",
4967
+ value: "false"
4968
+ },
4933
4969
  {
4934
4970
  id: "context",
4935
4971
  value: "300k"
@@ -4947,6 +4983,10 @@ export const FALLBACK_MODEL_ITEMS = [
4947
4983
  },
4948
4984
  {
4949
4985
  params: [
4986
+ {
4987
+ id: "cyber",
4988
+ value: "false"
4989
+ },
4950
4990
  {
4951
4991
  id: "context",
4952
4992
  value: "300k"
@@ -4964,6 +5004,10 @@ export const FALLBACK_MODEL_ITEMS = [
4964
5004
  },
4965
5005
  {
4966
5006
  params: [
5007
+ {
5008
+ id: "cyber",
5009
+ value: "false"
5010
+ },
4967
5011
  {
4968
5012
  id: "context",
4969
5013
  value: "1m"
@@ -4981,6 +5025,10 @@ export const FALLBACK_MODEL_ITEMS = [
4981
5025
  },
4982
5026
  {
4983
5027
  params: [
5028
+ {
5029
+ id: "cyber",
5030
+ value: "false"
5031
+ },
4984
5032
  {
4985
5033
  id: "context",
4986
5034
  value: "1m"
@@ -4998,6 +5046,10 @@ export const FALLBACK_MODEL_ITEMS = [
4998
5046
  },
4999
5047
  {
5000
5048
  params: [
5049
+ {
5050
+ id: "cyber",
5051
+ value: "false"
5052
+ },
5001
5053
  {
5002
5054
  id: "context",
5003
5055
  value: "1m"
@@ -5016,6 +5068,10 @@ export const FALLBACK_MODEL_ITEMS = [
5016
5068
  },
5017
5069
  {
5018
5070
  params: [
5071
+ {
5072
+ id: "cyber",
5073
+ value: "false"
5074
+ },
5019
5075
  {
5020
5076
  id: "context",
5021
5077
  value: "1m"
@@ -5033,6 +5089,10 @@ export const FALLBACK_MODEL_ITEMS = [
5033
5089
  },
5034
5090
  {
5035
5091
  params: [
5092
+ {
5093
+ id: "cyber",
5094
+ value: "false"
5095
+ },
5036
5096
  {
5037
5097
  id: "context",
5038
5098
  value: "1m"
@@ -5050,6 +5110,10 @@ export const FALLBACK_MODEL_ITEMS = [
5050
5110
  },
5051
5111
  {
5052
5112
  params: [
5113
+ {
5114
+ id: "cyber",
5115
+ value: "false"
5116
+ },
5053
5117
  {
5054
5118
  id: "context",
5055
5119
  value: "1m"
@@ -5067,6 +5131,10 @@ export const FALLBACK_MODEL_ITEMS = [
5067
5131
  },
5068
5132
  {
5069
5133
  params: [
5134
+ {
5135
+ id: "cyber",
5136
+ value: "false"
5137
+ },
5070
5138
  {
5071
5139
  id: "context",
5072
5140
  value: "1m"
@@ -5084,6 +5152,10 @@ export const FALLBACK_MODEL_ITEMS = [
5084
5152
  },
5085
5153
  {
5086
5154
  params: [
5155
+ {
5156
+ id: "cyber",
5157
+ value: "false"
5158
+ },
5087
5159
  {
5088
5160
  id: "context",
5089
5161
  value: "1m"
@@ -5101,6 +5173,10 @@ export const FALLBACK_MODEL_ITEMS = [
5101
5173
  },
5102
5174
  {
5103
5175
  params: [
5176
+ {
5177
+ id: "cyber",
5178
+ value: "false"
5179
+ },
5104
5180
  {
5105
5181
  id: "context",
5106
5182
  value: "1m"
@@ -5118,6 +5194,10 @@ export const FALLBACK_MODEL_ITEMS = [
5118
5194
  },
5119
5195
  {
5120
5196
  params: [
5197
+ {
5198
+ id: "cyber",
5199
+ value: "false"
5200
+ },
5121
5201
  {
5122
5202
  id: "context",
5123
5203
  value: "1m"
@@ -6262,6 +6342,86 @@ export const FALLBACK_MODEL_ITEMS = [
6262
6342
  }
6263
6343
  ]
6264
6344
  },
6345
+ {
6346
+ id: "deepseek-v41-flash-1017",
6347
+ displayName: "DeepSeek V4.1 Flash 1017",
6348
+ parameters: [
6349
+ {
6350
+ id: "reasoning_effort",
6351
+ displayName: "Reasoning",
6352
+ values: [
6353
+ {
6354
+ value: "none",
6355
+ displayName: "None"
6356
+ },
6357
+ {
6358
+ value: "low",
6359
+ displayName: "Low"
6360
+ },
6361
+ {
6362
+ value: "medium",
6363
+ displayName: "Medium"
6364
+ },
6365
+ {
6366
+ value: "high",
6367
+ displayName: "High"
6368
+ },
6369
+ {
6370
+ value: "max",
6371
+ displayName: "Max"
6372
+ }
6373
+ ]
6374
+ }
6375
+ ],
6376
+ variants: [
6377
+ {
6378
+ params: [
6379
+ {
6380
+ id: "reasoning_effort",
6381
+ value: "none"
6382
+ }
6383
+ ],
6384
+ displayName: "DeepSeek V4.1 Flash 1017 None"
6385
+ },
6386
+ {
6387
+ params: [
6388
+ {
6389
+ id: "reasoning_effort",
6390
+ value: "low"
6391
+ }
6392
+ ],
6393
+ displayName: "DeepSeek V4.1 Flash 1017 Low"
6394
+ },
6395
+ {
6396
+ params: [
6397
+ {
6398
+ id: "reasoning_effort",
6399
+ value: "medium"
6400
+ }
6401
+ ],
6402
+ displayName: "DeepSeek V4.1 Flash 1017 Medium"
6403
+ },
6404
+ {
6405
+ params: [
6406
+ {
6407
+ id: "reasoning_effort",
6408
+ value: "high"
6409
+ }
6410
+ ],
6411
+ displayName: "DeepSeek V4.1 Flash 1017 High"
6412
+ },
6413
+ {
6414
+ params: [
6415
+ {
6416
+ id: "reasoning_effort",
6417
+ value: "max"
6418
+ }
6419
+ ],
6420
+ displayName: "DeepSeek V4.1 Flash 1017 Max",
6421
+ isDefault: true
6422
+ }
6423
+ ]
6424
+ },
6265
6425
  {
6266
6426
  id: "default",
6267
6427
  displayName: "Auto",
@@ -6516,6 +6676,60 @@ export const FALLBACK_MODEL_ITEMS = [
6516
6676
  }
6517
6677
  ]
6518
6678
  },
6679
+ {
6680
+ id: "gemini-4-argon",
6681
+ displayName: "Gemini 4 Argon",
6682
+ parameters: [
6683
+ {
6684
+ id: "reasoning_effort",
6685
+ displayName: "Effort",
6686
+ values: [
6687
+ {
6688
+ value: "low",
6689
+ displayName: "Low"
6690
+ },
6691
+ {
6692
+ value: "medium",
6693
+ displayName: "Medium"
6694
+ },
6695
+ {
6696
+ value: "high",
6697
+ displayName: "High"
6698
+ }
6699
+ ]
6700
+ }
6701
+ ],
6702
+ variants: [
6703
+ {
6704
+ params: [
6705
+ {
6706
+ id: "reasoning_effort",
6707
+ value: "low"
6708
+ }
6709
+ ],
6710
+ displayName: "Gemini 4 Argon Low"
6711
+ },
6712
+ {
6713
+ params: [
6714
+ {
6715
+ id: "reasoning_effort",
6716
+ value: "medium"
6717
+ }
6718
+ ],
6719
+ displayName: "Gemini 4 Argon Medium",
6720
+ isDefault: true
6721
+ },
6722
+ {
6723
+ params: [
6724
+ {
6725
+ id: "reasoning_effort",
6726
+ value: "high"
6727
+ }
6728
+ ],
6729
+ displayName: "Gemini 4 Argon High"
6730
+ }
6731
+ ]
6732
+ },
6519
6733
  {
6520
6734
  id: "glm-5.2",
6521
6735
  displayName: "GLM 5.2",
@@ -10155,5 +10369,214 @@ export const FALLBACK_MODEL_ITEMS = [
10155
10369
  displayName: "Muse Spark 1.3"
10156
10370
  }
10157
10371
  ]
10372
+ },
10373
+ {
10374
+ id: "muse-wonder-1.0",
10375
+ displayName: "Muse Wonder",
10376
+ parameters: [
10377
+ {
10378
+ id: "context",
10379
+ displayName: "Context",
10380
+ values: [
10381
+ {
10382
+ value: "300k",
10383
+ displayName: "300K"
10384
+ },
10385
+ {
10386
+ value: "1m",
10387
+ displayName: "1M"
10388
+ }
10389
+ ]
10390
+ },
10391
+ {
10392
+ id: "reasoning_effort",
10393
+ displayName: "Reasoning",
10394
+ values: [
10395
+ {
10396
+ value: "minimal",
10397
+ displayName: "Minimal"
10398
+ },
10399
+ {
10400
+ value: "low",
10401
+ displayName: "Low"
10402
+ },
10403
+ {
10404
+ value: "medium",
10405
+ displayName: "Medium"
10406
+ },
10407
+ {
10408
+ value: "high",
10409
+ displayName: "High"
10410
+ },
10411
+ {
10412
+ value: "xhigh",
10413
+ displayName: "Extra High"
10414
+ },
10415
+ {
10416
+ value: "max",
10417
+ displayName: "Max"
10418
+ }
10419
+ ]
10420
+ }
10421
+ ],
10422
+ variants: [
10423
+ {
10424
+ params: [
10425
+ {
10426
+ id: "context",
10427
+ value: "300k"
10428
+ },
10429
+ {
10430
+ id: "reasoning_effort",
10431
+ value: "minimal"
10432
+ }
10433
+ ],
10434
+ displayName: "Muse Wonder Minimal"
10435
+ },
10436
+ {
10437
+ params: [
10438
+ {
10439
+ id: "context",
10440
+ value: "300k"
10441
+ },
10442
+ {
10443
+ id: "reasoning_effort",
10444
+ value: "low"
10445
+ }
10446
+ ],
10447
+ displayName: "Muse Wonder Low"
10448
+ },
10449
+ {
10450
+ params: [
10451
+ {
10452
+ id: "context",
10453
+ value: "300k"
10454
+ },
10455
+ {
10456
+ id: "reasoning_effort",
10457
+ value: "medium"
10458
+ }
10459
+ ],
10460
+ displayName: "Muse Wonder Medium"
10461
+ },
10462
+ {
10463
+ params: [
10464
+ {
10465
+ id: "context",
10466
+ value: "300k"
10467
+ },
10468
+ {
10469
+ id: "reasoning_effort",
10470
+ value: "high"
10471
+ }
10472
+ ],
10473
+ displayName: "Muse Wonder High"
10474
+ },
10475
+ {
10476
+ params: [
10477
+ {
10478
+ id: "context",
10479
+ value: "300k"
10480
+ },
10481
+ {
10482
+ id: "reasoning_effort",
10483
+ value: "xhigh"
10484
+ }
10485
+ ],
10486
+ displayName: "Muse Wonder Extra High"
10487
+ },
10488
+ {
10489
+ params: [
10490
+ {
10491
+ id: "context",
10492
+ value: "300k"
10493
+ },
10494
+ {
10495
+ id: "reasoning_effort",
10496
+ value: "max"
10497
+ }
10498
+ ],
10499
+ displayName: "Muse Wonder Max"
10500
+ },
10501
+ {
10502
+ params: [
10503
+ {
10504
+ id: "context",
10505
+ value: "1m"
10506
+ },
10507
+ {
10508
+ id: "reasoning_effort",
10509
+ value: "minimal"
10510
+ }
10511
+ ],
10512
+ displayName: "Muse Wonder 1M Minimal"
10513
+ },
10514
+ {
10515
+ params: [
10516
+ {
10517
+ id: "context",
10518
+ value: "1m"
10519
+ },
10520
+ {
10521
+ id: "reasoning_effort",
10522
+ value: "low"
10523
+ }
10524
+ ],
10525
+ displayName: "Muse Wonder 1M Low"
10526
+ },
10527
+ {
10528
+ params: [
10529
+ {
10530
+ id: "context",
10531
+ value: "1m"
10532
+ },
10533
+ {
10534
+ id: "reasoning_effort",
10535
+ value: "medium"
10536
+ }
10537
+ ],
10538
+ displayName: "Muse Wonder 1M Medium"
10539
+ },
10540
+ {
10541
+ params: [
10542
+ {
10543
+ id: "context",
10544
+ value: "1m"
10545
+ },
10546
+ {
10547
+ id: "reasoning_effort",
10548
+ value: "high"
10549
+ }
10550
+ ],
10551
+ displayName: "Muse Wonder 1M High"
10552
+ },
10553
+ {
10554
+ params: [
10555
+ {
10556
+ id: "context",
10557
+ value: "1m"
10558
+ },
10559
+ {
10560
+ id: "reasoning_effort",
10561
+ value: "xhigh"
10562
+ }
10563
+ ],
10564
+ displayName: "Muse Wonder 1M Extra High",
10565
+ isDefault: true
10566
+ },
10567
+ {
10568
+ params: [
10569
+ {
10570
+ id: "context",
10571
+ value: "1m"
10572
+ },
10573
+ {
10574
+ id: "reasoning_effort",
10575
+ value: "max"
10576
+ }
10577
+ ],
10578
+ displayName: "Muse Wonder 1M Max"
10579
+ }
10580
+ ]
10158
10581
  }
10159
10582
  ];
@@ -150,6 +150,7 @@ export function createCursorLiveRunCoordinator(deps) {
150
150
  const run = {
151
151
  id: params.id,
152
152
  agent: params.agent,
153
+ nativeToolsEnabled: params.nativeToolsEnabled !== false,
153
154
  bridgeRun: params.bridgeRun,
154
155
  sessionBridgeRun: params.sessionBridgeRun,
155
156
  sessionAgentScopeKey,
@@ -0,0 +1,57 @@
1
+ const watchedRunsByStore = new WeakMap();
2
+ const terminalErrors = new WeakMap();
3
+ const TERMINAL_RUN_STATUSES = new Set(["finished", "error", "cancelled", "expired"]);
4
+ // A failed local SDK run leaves its native tool processes running, and Run.cancel() stops them only
5
+ // while run.status is "running". The SDK awaits the terminal run-row write before it changes
6
+ // run.status, so cancelling from that write is ordered before the change, not racing it.
7
+ function onRunRowWrite(watched, row) {
8
+ const run = watched.get(row.runId);
9
+ if (!run || !TERMINAL_RUN_STATUSES.has(row.status))
10
+ return;
11
+ watched.delete(row.runId);
12
+ if (row.status !== "error" || run.status !== "running")
13
+ return;
14
+ terminalErrors.set(run, { message: row.error?.trim() || "Cursor SDK run failed." });
15
+ run.cancel().catch(() => { });
16
+ }
17
+ /** Wraps a local store so watched runs are cancelled while still running when the SDK records a terminal error. */
18
+ export function observeCursorLocalRunTerminalErrors(store) {
19
+ const watched = new Map();
20
+ const { runs } = store;
21
+ const observed = {
22
+ agents: store.agents,
23
+ checkpoints: store.checkpoints,
24
+ runEvents: store.runEvents,
25
+ runs: {
26
+ get: (input) => runs.get(input),
27
+ create: (input) => runs.create(input),
28
+ delete: (input) => runs.delete(input),
29
+ list: (input) => runs.list(input),
30
+ update: async (input) => {
31
+ try {
32
+ return await runs.update(input);
33
+ }
34
+ finally {
35
+ onRunRowWrite(watched, input.run);
36
+ }
37
+ },
38
+ },
39
+ };
40
+ watchedRunsByStore.set(observed, watched);
41
+ return observed;
42
+ }
43
+ /**
44
+ * Call as soon as send() resolves. A run can only fail with native tools running after network
45
+ * input, which cannot be processed before this continuation.
46
+ */
47
+ export function watchCursorLocalRunTerminalError(store, run) {
48
+ if (run.status === "running")
49
+ watchedRunsByStore.get(store)?.set(run.id, run);
50
+ }
51
+ /** Restores the SDK failure that terminal-error cancellation turned into a "cancelled" wait result. */
52
+ export function resolveCursorLocalRunTerminalError(run, waitResult, callerAborted) {
53
+ const terminalError = terminalErrors.get(run);
54
+ if (!terminalError || callerAborted || waitResult.status !== "cancelled")
55
+ return waitResult;
56
+ return { ...waitResult, status: "error", error: terminalError };
57
+ }
@@ -36,7 +36,7 @@ function normalizeConnectTimeoutMs(timeoutMs) {
36
36
  return DEFAULT_CURSOR_MCP_CONNECT_TIMEOUT_MS;
37
37
  return Math.min(Math.max(Math.trunc(timeoutMs), MIN_CURSOR_MCP_CONNECT_TIMEOUT_MS), CURSOR_SDK_MCP_DEFAULT_TIMEOUT_MS);
38
38
  }
39
- export function resolveCursorMcpConnectTimeoutMs(env = process.env) {
39
+ function resolveCursorMcpConnectTimeoutMs(env = process.env) {
40
40
  const explicitMs = parsePositiveNumber(env[CURSOR_MCP_CONNECT_TIMEOUT_MS_ENV]);
41
41
  if (explicitMs !== undefined)
42
42
  return normalizeConnectTimeoutMs(explicitMs);
@@ -51,13 +51,13 @@ function isCursorSdkMcpProtocolTimeoutStack(stack) {
51
51
  return (/(?:node_modules[/\\]@cursor[/\\]sdk|node_modules\/\@cursor\/sdk|@cursor\/sdk\/dist)/.test(stack) &&
52
52
  /\b_setupTimeout\b|\bProtocol\._setupTimeout\b/.test(stack));
53
53
  }
54
- export function isCursorSdkMcpToolTimeoutStack(stack) {
54
+ function isCursorSdkMcpToolTimeoutStack(stack) {
55
55
  if (!stack)
56
56
  return false;
57
57
  return (isCursorSdkMcpProtocolTimeoutStack(stack) &&
58
58
  /\bcallTool\b|\bClient\.callTool\b|\bMcpSdkClient\.callTool\b/.test(stack));
59
59
  }
60
- export function isCursorSdkMcpConnectTimeoutStack(stack) {
60
+ function isCursorSdkMcpConnectTimeoutStack(stack) {
61
61
  if (!stack || !isCursorSdkMcpProtocolTimeoutStack(stack))
62
62
  return false;
63
63
  // The SDK minifies the Client class name; the protocol method and SDK
@@ -83,9 +83,9 @@ function patchedSetTimeout(handler, delay, ...args) {
83
83
  }
84
84
  return Reflect.apply(delegate, globalThis, [handler, nextDelay, ...args]);
85
85
  }
86
- export function installCursorMcpToolTimeoutOverride(options = {}) {
87
- installedToolTimeoutMs = normalizeOverrideTimeoutMs(options.timeoutMs ?? resolveCursorMcpToolTimeoutMs(options.env));
88
- installedConnectTimeoutMs = normalizeConnectTimeoutMs(options.connectTimeoutMs ?? resolveCursorMcpConnectTimeoutMs(options.env));
86
+ export function installCursorMcpToolTimeoutOverride() {
87
+ installedToolTimeoutMs = resolveCursorMcpToolTimeoutMs();
88
+ installedConnectTimeoutMs = resolveCursorMcpConnectTimeoutMs();
89
89
  if (!originalSetTimeout) {
90
90
  originalSetTimeout = globalThis.setTimeout;
91
91
  globalThis.setTimeout = patchedSetTimeout;
@@ -105,14 +105,3 @@ export function restoreCursorMcpToolTimeoutOverride() {
105
105
  installedToolTimeoutMs = DEFAULT_CURSOR_MCP_TOOL_TIMEOUT_MS;
106
106
  installedConnectTimeoutMs = DEFAULT_CURSOR_MCP_CONNECT_TIMEOUT_MS;
107
107
  }
108
- export const cursorMcpToolTimeoutOverrideDefaults = {
109
- cursorSdkDefaultTimeoutMs: CURSOR_SDK_MCP_DEFAULT_TIMEOUT_MS,
110
- defaultOverrideTimeoutMs: DEFAULT_CURSOR_MCP_TOOL_TIMEOUT_MS,
111
- defaultConnectTimeoutMs: DEFAULT_CURSOR_MCP_CONNECT_TIMEOUT_MS,
112
- minConnectTimeoutMs: MIN_CURSOR_MCP_CONNECT_TIMEOUT_MS,
113
- maxNodeTimerDelayMs: MAX_NODE_TIMER_DELAY_MS,
114
- timeoutMsEnv: CURSOR_MCP_TOOL_TIMEOUT_MS_ENV,
115
- timeoutSecondsEnv: CURSOR_MCP_TOOL_TIMEOUT_SECONDS_ENV,
116
- connectTimeoutMsEnv: CURSOR_MCP_CONNECT_TIMEOUT_MS_ENV,
117
- connectTimeoutSecondsEnv: CURSOR_MCP_CONNECT_TIMEOUT_SECONDS_ENV,
118
- };