@cursor/bdk 0.2.10 → 0.2.12

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 (436) hide show
  1. package/dist/bin/agent-serve.js +28 -26
  2. package/dist/channels/bitbucket/api.js +8 -8
  3. package/dist/channels/bitbucket/binding.js +4 -4
  4. package/dist/channels/bitbucket/bitbucket-channel.js +1 -1
  5. package/dist/channels/bitbucket/bitbucket-webhook.js +1 -1
  6. package/dist/channels/bitbucket/checks.js +1 -1
  7. package/dist/channels/bitbucket/cursor-account.js +1 -1
  8. package/dist/channels/bitbucket/events.js +1 -1
  9. package/dist/channels/change-monitors/change-monitors-channel.js +1 -1
  10. package/dist/channels/checks.js +2 -2
  11. package/dist/channels/deployments/deployments-channel.js +1 -1
  12. package/dist/channels/github/cursor-account.js +3 -3
  13. package/dist/channels/github/defaults.js +3 -3
  14. package/dist/channels/github/events.js +1 -1
  15. package/dist/channels/github/forward.js +8 -8
  16. package/dist/channels/github/github-channel.js +2 -2
  17. package/dist/channels/gitlab/binding.js +4 -4
  18. package/dist/channels/gitlab/checks.js +1 -1
  19. package/dist/channels/gitlab/cursor-account.js +1 -1
  20. package/dist/channels/gitlab/events.js +1 -1
  21. package/dist/channels/gitlab/gitlab-channel.js +1 -1
  22. package/dist/channels/gitlab/gitlab-webhook.js +1 -1
  23. package/dist/channels/gitlab/replay.js +2 -2
  24. package/dist/channels/origin/binding.js +3 -3
  25. package/dist/channels/origin/checks.js +1 -1
  26. package/dist/channels/origin/cursor-account.js +1 -1
  27. package/dist/channels/origin/events.js +1 -1
  28. package/dist/channels/origin/origin-channel.js +1 -1
  29. package/dist/channels/origin/origin-webhook.js +2 -2
  30. package/dist/channels/slack/agentic-delivery.js +3 -3
  31. package/dist/channels/slack/agentic-signals.js +1 -1
  32. package/dist/channels/slack/api.js +5 -5
  33. package/dist/channels/slack/approvals.js +1 -1
  34. package/dist/channels/slack/attachments.js +3 -3
  35. package/dist/channels/slack/blocks.js +3 -3
  36. package/dist/channels/slack/bot-mentions.js +4 -4
  37. package/dist/channels/slack/channel-watch.js +4 -4
  38. package/dist/channels/slack/cli-project.js +3 -3
  39. package/dist/channels/slack/dispatch.js +1 -1
  40. package/dist/channels/slack/doctor.js +1 -1
  41. package/dist/channels/slack/eval-directive.js +1 -1
  42. package/dist/channels/slack/footer.js +1 -1
  43. package/dist/channels/slack/interactive.js +2 -2
  44. package/dist/channels/slack/log.d.ts.map +1 -1
  45. package/dist/channels/slack/log.js +1 -1
  46. package/dist/channels/slack/manifest.js +1 -1
  47. package/dist/channels/slack/nudge-carrier.js +1 -1
  48. package/dist/channels/slack/nudge-store.js +2 -2
  49. package/dist/channels/slack/recording-sink.js +6 -6
  50. package/dist/channels/slack/reply-options.js +6 -6
  51. package/dist/channels/slack/self-identity.d.ts +7 -4
  52. package/dist/channels/slack/self-identity.d.ts.map +1 -1
  53. package/dist/channels/slack/self-identity.js +17 -8
  54. package/dist/channels/slack/sender-name.d.ts.map +1 -1
  55. package/dist/channels/slack/sender-name.js +2 -6
  56. package/dist/channels/slack/setup.d.ts.map +1 -1
  57. package/dist/channels/slack/setup.js +1 -1
  58. package/dist/channels/slack/slack-channel.js +2 -2
  59. package/dist/channels/slack/socket-mode.js +2 -2
  60. package/dist/channels/slack/thread-context.js +8 -8
  61. package/dist/channels/slack/tool-cards.js +1 -1
  62. package/dist/channels/slack/user-info.d.ts +2 -1
  63. package/dist/channels/slack/user-info.d.ts.map +1 -1
  64. package/dist/channels/slack/user-info.js +16 -1
  65. package/dist/channels.js +1 -1
  66. package/dist/docs/404.html +3 -3
  67. package/dist/docs/assets/{app.DXI7bwox.js → app.CKta5zX1.js} +4 -4
  68. package/dist/docs/assets/chunks/@localSearchIndexroot.DtlCe4t6.js +1 -0
  69. package/dist/docs/assets/chunks/{VPLocalSearchBox.BrbO5mEe.js → VPLocalSearchBox.4vRM3EDG.js} +2 -2
  70. package/dist/docs/assets/chunks/{arc.BOG1yms8.js → arc.CofbA8tA.js} +1 -1
  71. package/dist/docs/assets/chunks/{architectureDiagram-Q4EWVU46.C0hsMZnZ.js → architectureDiagram-Q4EWVU46.Mt2UV5M-.js} +1 -1
  72. package/dist/docs/assets/chunks/{baseUniq.H044KjKs.js → baseUniq.C_W0Aqp4.js} +1 -1
  73. package/dist/docs/assets/chunks/{blockDiagram-DXYQGD6D.BsRW6GoB.js → blockDiagram-DXYQGD6D.dAc4goE-.js} +1 -1
  74. package/dist/docs/assets/chunks/{c4Diagram-AHTNJAMY.B9HV5PFR.js → c4Diagram-AHTNJAMY.dnbRC3Dm.js} +1 -1
  75. package/dist/docs/assets/chunks/channel.DpljPUVU.js +1 -0
  76. package/dist/docs/assets/chunks/{chunk-4BX2VUAB.CPoT_ajl.js → chunk-4BX2VUAB.B42ltSTd.js} +1 -1
  77. package/dist/docs/assets/chunks/{chunk-4TB4RGXK.DZBwWuCL.js → chunk-4TB4RGXK.2GbAul_E.js} +1 -1
  78. package/dist/docs/assets/chunks/{chunk-55IACEB6.CZ3yTiyq.js → chunk-55IACEB6.pjzY-v-B.js} +1 -1
  79. package/dist/docs/assets/chunks/{chunk-EDXVE4YY.6DfvHSd8.js → chunk-EDXVE4YY.BB1GXLj2.js} +1 -1
  80. package/dist/docs/assets/chunks/{chunk-FMBD7UC4.CpBj8HfK.js → chunk-FMBD7UC4.B2WxZkoA.js} +1 -1
  81. package/dist/docs/assets/chunks/{chunk-OYMX7WX6.BdKo8YqS.js → chunk-OYMX7WX6.BMvb2w73.js} +1 -1
  82. package/dist/docs/assets/chunks/{chunk-QZHKN3VN.BnXNyxJx.js → chunk-QZHKN3VN.Bmu_2lNr.js} +1 -1
  83. package/dist/docs/assets/chunks/{chunk-YZCP3GAM.Cg1OcF8G.js → chunk-YZCP3GAM.Cth65EaC.js} +1 -1
  84. package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.DFNHq2OM.js +1 -0
  85. package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.DFNHq2OM.js +1 -0
  86. package/dist/docs/assets/chunks/clone.DssygCzX.js +1 -0
  87. package/dist/docs/assets/chunks/{cose-bilkent-S5V4N54A.1SP8al9c.js → cose-bilkent-S5V4N54A.CrfA7Iw_.js} +1 -1
  88. package/dist/docs/assets/chunks/{dagre-KV5264BT.DS1L6hJt.js → dagre-KV5264BT.PCD6KQDb.js} +1 -1
  89. package/dist/docs/assets/chunks/{diagram-5BDNPKRD.ChsausbG.js → diagram-5BDNPKRD.CGNlYlP1.js} +1 -1
  90. package/dist/docs/assets/chunks/{diagram-G4DWMVQ6.3XsptNWj.js → diagram-G4DWMVQ6.C0cvryPD.js} +1 -1
  91. package/dist/docs/assets/chunks/{diagram-MMDJMWI5.DPA9Dk_P.js → diagram-MMDJMWI5.DHlkZHNV.js} +1 -1
  92. package/dist/docs/assets/chunks/{diagram-TYMM5635.BVswXWrB.js → diagram-TYMM5635.DDGqH_4B.js} +1 -1
  93. package/dist/docs/assets/chunks/{erDiagram-SMLLAGMA.BSak5OSP.js → erDiagram-SMLLAGMA.4gOY_C3v.js} +1 -1
  94. package/dist/docs/assets/chunks/{flowDiagram-DWJPFMVM.CQgN4TTz.js → flowDiagram-DWJPFMVM.8i7zsxuh.js} +1 -1
  95. package/dist/docs/assets/chunks/{ganttDiagram-T4ZO3ILL.GrT0kA4a.js → ganttDiagram-T4ZO3ILL.BEKHYdM-.js} +1 -1
  96. package/dist/docs/assets/chunks/{gitGraphDiagram-UUTBAWPF.CdS7Ucll.js → gitGraphDiagram-UUTBAWPF.ACzeLGiB.js} +1 -1
  97. package/dist/docs/assets/chunks/{graph.BVqKRmRo.js → graph.08C3hS6m.js} +1 -1
  98. package/dist/docs/assets/chunks/{infoDiagram-42DDH7IO.C3C9FRto.js → infoDiagram-42DDH7IO.D8R9obOH.js} +1 -1
  99. package/dist/docs/assets/chunks/{ishikawaDiagram-UXIWVN3A.2FuAh_Zj.js → ishikawaDiagram-UXIWVN3A.CmgYpCWL.js} +1 -1
  100. package/dist/docs/assets/chunks/{journeyDiagram-VCZTEJTY.CaHMfK4b.js → journeyDiagram-VCZTEJTY.DUzjGfoZ.js} +1 -1
  101. package/dist/docs/assets/chunks/{kanban-definition-6JOO6SKY.CjhIUwcA.js → kanban-definition-6JOO6SKY.DbcW2iZ0.js} +1 -1
  102. package/dist/docs/assets/chunks/{layout.CGU3gfSf.js → layout.BaDEpJzu.js} +1 -1
  103. package/dist/docs/assets/chunks/{linear.DaihpW_n.js → linear.B_zRQgCU.js} +1 -1
  104. package/dist/docs/assets/chunks/{min.BS-j8kHQ.js → min.BYscCdSu.js} +1 -1
  105. package/dist/docs/assets/chunks/{mindmap-definition-QFDTVHPH.BVJ1Bbnk.js → mindmap-definition-QFDTVHPH.Ggu0jg86.js} +1 -1
  106. package/dist/docs/assets/chunks/{pieDiagram-DEJITSTG.Cz1WIv9r.js → pieDiagram-DEJITSTG.D_q4SVDT.js} +1 -1
  107. package/dist/docs/assets/chunks/{quadrantDiagram-34T5L4WZ.DKLFxcjy.js → quadrantDiagram-34T5L4WZ.D3zGj5ok.js} +1 -1
  108. package/dist/docs/assets/chunks/{requirementDiagram-MS252O5E.BHegiK7x.js → requirementDiagram-MS252O5E.DVTg7zr2.js} +1 -1
  109. package/dist/docs/assets/chunks/{sankeyDiagram-XADWPNL6.DYkY6yPc.js → sankeyDiagram-XADWPNL6.D3X8jm57.js} +1 -1
  110. package/dist/docs/assets/chunks/{sequenceDiagram-FGHM5R23.DYQ1QUrI.js → sequenceDiagram-FGHM5R23.Dpjai9YP.js} +1 -1
  111. package/dist/docs/assets/chunks/{stateDiagram-FHFEXIEX.Iru8BsFo.js → stateDiagram-FHFEXIEX.D_AbQBuP.js} +1 -1
  112. package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.CWKWRxRx.js +1 -0
  113. package/dist/docs/assets/chunks/{theme.DaplWQhQ.js → theme.BcgOnbZ6.js} +2 -2
  114. package/dist/docs/assets/chunks/{timeline-definition-GMOUNBTQ.BwFA8hiX.js → timeline-definition-GMOUNBTQ.Cp3DKBe2.js} +1 -1
  115. package/dist/docs/assets/chunks/{vennDiagram-DHZGUBPP.CZ60W1C_.js → vennDiagram-DHZGUBPP.Bcvg-Aqu.js} +1 -1
  116. package/dist/docs/assets/chunks/wardley-RL74JXVD.CCpdcUSq.js +162 -0
  117. package/dist/docs/assets/chunks/{wardleyDiagram-NUSXRM2D.B69D2r8-.js → wardleyDiagram-NUSXRM2D.L0yehCc5.js} +1 -1
  118. package/dist/docs/assets/chunks/{xychartDiagram-5P7HB3ND.CLPZEIU9.js → xychartDiagram-5P7HB3ND.Cw8-tJmw.js} +1 -1
  119. package/dist/docs/assets/{reference_connections.md.Bljpve-y.js → reference_connections.md.DLrgAd5f.js} +1 -1
  120. package/dist/docs/assets/{reference_hooks.md.C5LCJ1R3.js → reference_hooks.md.B-eGa2km.js} +3 -3
  121. package/dist/docs/assets/{reference_hooks.md.C5LCJ1R3.lean.js → reference_hooks.md.B-eGa2km.lean.js} +1 -1
  122. package/dist/docs/assets/{reference_sessions.md.CM5zo3w4.js → reference_sessions.md.CyM7ARz1.js} +1 -1
  123. package/dist/docs/assets/{reference_skills.md.C0guGcH0.js → reference_skills.md.ClkMoQsV.js} +3 -3
  124. package/dist/docs/assets/{reference_tools.md.v3SXVSs_.js → reference_tools.md.DzIY9JzY.js} +3 -3
  125. package/dist/docs/assets/{reference_tools.md.v3SXVSs_.lean.js → reference_tools.md.DzIY9JzY.lean.js} +1 -1
  126. package/dist/docs/assets/{style.C130MVnH.css → style.Dwls12uf.css} +1 -1
  127. package/dist/docs/building-with-agents.html +37 -37
  128. package/dist/docs/deployment.html +37 -37
  129. package/dist/docs/evals.html +37 -37
  130. package/dist/docs/guides/agent-to-agent.html +37 -37
  131. package/dist/docs/guides/bitbucket.html +37 -37
  132. package/dist/docs/guides/cloud-agents.html +37 -37
  133. package/dist/docs/guides/convert-automation.html +37 -37
  134. package/dist/docs/guides/github.html +37 -37
  135. package/dist/docs/guides/gitlab.html +37 -37
  136. package/dist/docs/guides/grokbot-agents.html +37 -37
  137. package/dist/docs/guides/hooks.html +37 -37
  138. package/dist/docs/guides/improve.html +37 -37
  139. package/dist/docs/guides/jev.html +37 -37
  140. package/dist/docs/guides/mcp-oauth.html +37 -37
  141. package/dist/docs/guides/migrate.html +37 -37
  142. package/dist/docs/guides/opentelemetry.html +37 -37
  143. package/dist/docs/guides/slack.html +37 -37
  144. package/dist/docs/guides/webhooks.html +37 -37
  145. package/dist/docs/hashmap.json +1 -1
  146. package/dist/docs/hillclimbing.html +37 -37
  147. package/dist/docs/index.html +37 -37
  148. package/dist/docs/llms-full.txt +15 -2
  149. package/dist/docs/quickstart.html +37 -37
  150. package/dist/docs/reference/agent-config.html +37 -37
  151. package/dist/docs/reference/artifacts.html +37 -37
  152. package/dist/docs/reference/channels.html +37 -37
  153. package/dist/docs/reference/cli.html +37 -37
  154. package/dist/docs/reference/connections.html +39 -39
  155. package/dist/docs/reference/connections.md +2 -1
  156. package/dist/docs/reference/evals.html +37 -37
  157. package/dist/docs/reference/extensions.html +37 -37
  158. package/dist/docs/reference/hooks.html +39 -39
  159. package/dist/docs/reference/hooks.md +1 -0
  160. package/dist/docs/reference/http-api.html +37 -37
  161. package/dist/docs/reference/instructions.html +37 -37
  162. package/dist/docs/reference/playground.html +36 -36
  163. package/dist/docs/reference/project-layout.html +37 -37
  164. package/dist/docs/reference/prompt.html +37 -37
  165. package/dist/docs/reference/schedules.html +37 -37
  166. package/dist/docs/reference/sessions.html +37 -37
  167. package/dist/docs/reference/sessions.md +1 -1
  168. package/dist/docs/reference/skills.html +40 -40
  169. package/dist/docs/reference/subagents.html +37 -37
  170. package/dist/docs/reference/tools.html +39 -39
  171. package/dist/docs/reference/tools.md +11 -0
  172. package/dist/docs/templates/agentic-owners.html +37 -37
  173. package/dist/docs/templates/grokbot-agents.html +37 -37
  174. package/dist/docs/templates/security-reviewer.html +37 -37
  175. package/dist/docs/templates/thermo-quality-review.html +37 -37
  176. package/dist/docs/templates/thermo-review.html +37 -37
  177. package/dist/docs/templates/triage.html +37 -37
  178. package/dist/docs/troubleshooting.html +36 -36
  179. package/dist/evals/assertions.d.ts.map +1 -1
  180. package/dist/evals/assertions.js +21 -19
  181. package/dist/evals/expect.js +1 -1
  182. package/dist/evals/judge.js +1 -1
  183. package/dist/evals/reporters.js +8 -8
  184. package/dist/evals/run-facts.js +2 -2
  185. package/dist/evals.js +6 -6
  186. package/dist/extensions/cursor-cloud-agents/extension.d.ts +2 -0
  187. package/dist/extensions/cursor-cloud-agents/extension.d.ts.map +1 -1
  188. package/dist/extensions/cursor-cloud-agents/extension.js +2 -1
  189. package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts +16 -0
  190. package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts.map +1 -1
  191. package/dist/extensions/cursor-cloud-agents/lib/backend.js +44 -3
  192. package/dist/extensions/cursor-cloud-agents/lib/fleet.js +1 -1
  193. package/dist/extensions/cursor-cloud-agents/lib/launch-agent.d.ts +23 -0
  194. package/dist/extensions/cursor-cloud-agents/lib/launch-agent.d.ts.map +1 -0
  195. package/dist/extensions/cursor-cloud-agents/lib/launch-agent.js +32 -0
  196. package/dist/extensions/cursor-cloud-agents/lib/repos.js +2 -2
  197. package/dist/extensions/cursor-cloud-agents/lib/transcript.js +2 -2
  198. package/dist/extensions/cursor-cloud-agents/lib/watch.d.ts.map +1 -1
  199. package/dist/extensions/cursor-cloud-agents/lib/watch.js +1 -1
  200. package/dist/extensions/cursor-cloud-agents/tools/launch.d.ts.map +1 -1
  201. package/dist/extensions/cursor-cloud-agents/tools/launch.js +3 -8
  202. package/dist/extensions/cursor-cloud-agents/tools/list.js +1 -1
  203. package/dist/extensions/cursor-grokbot-agents/extension.js +3 -3
  204. package/dist/extensions/cursor-grokbot-agents/lib/agents.js +3 -3
  205. package/dist/extensions/cursor-grokbot-agents/lib/contacts.js +3 -3
  206. package/dist/extensions/cursor-grokbot-agents/lib/conversation.js +4 -4
  207. package/dist/extensions/cursor-grokbot-agents/tools/list.js +1 -1
  208. package/dist/extensions/improve/skills/yourself.js +1 -1
  209. package/dist/extensions/jev/extension.js +2 -2
  210. package/dist/extensions/jev/tools/evaluate.js +1 -1
  211. package/dist/extensions/slack-communication/tools/react.js +1 -1
  212. package/dist/files-backends/cursor-hosted.js +8 -8
  213. package/dist/files-backends/local-fs.js +1 -1
  214. package/dist/filesystem.d.ts.map +1 -1
  215. package/dist/filesystem.js +15 -15
  216. package/dist/internal/advertise-tools.d.ts +3 -2
  217. package/dist/internal/advertise-tools.d.ts.map +1 -1
  218. package/dist/internal/advertise-tools.js +11 -9
  219. package/dist/internal/approval-gate.js +1 -1
  220. package/dist/internal/artifacts-store.js +13 -13
  221. package/dist/internal/as-of.js +2 -2
  222. package/dist/internal/authored-alias-hooks.js +1 -1
  223. package/dist/internal/builtin-tools/reminders.js +2 -2
  224. package/dist/internal/chat-client.js +5 -5
  225. package/dist/internal/cli-ax.js +14 -14
  226. package/dist/internal/cli-bitbucket.js +10 -10
  227. package/dist/internal/cli-convert-automation.js +2 -2
  228. package/dist/internal/cli-cursor.js +2 -2
  229. package/dist/internal/cli-deploy.d.ts.map +1 -1
  230. package/dist/internal/cli-deploy.js +40 -40
  231. package/dist/internal/cli-docs.js +5 -5
  232. package/dist/internal/cli-github.js +15 -15
  233. package/dist/internal/cli-gitlab.js +10 -10
  234. package/dist/internal/cli-images.js +16 -16
  235. package/dist/internal/cli-manifest.js +1 -1
  236. package/dist/internal/cli-mcp-oauth.js +5 -5
  237. package/dist/internal/cli-mcp.js +3 -3
  238. package/dist/internal/cli-migrate.js +1 -1
  239. package/dist/internal/cli-skills.js +2 -2
  240. package/dist/internal/cli-slack.js +5 -5
  241. package/dist/internal/cloud-turn-cost.js +1 -1
  242. package/dist/internal/continuation-identity.js +6 -6
  243. package/dist/internal/conversation-mirror.js +5 -5
  244. package/dist/internal/convert-automation/convert-workflow.js +24 -24
  245. package/dist/internal/cursor/account-mcp.d.ts.map +1 -1
  246. package/dist/internal/cursor/account-mcp.js +20 -20
  247. package/dist/internal/cursor/backend-client.js +6 -6
  248. package/dist/internal/cursor/credentials.js +1 -1
  249. package/dist/internal/cursor/store-api-client.js +1 -1
  250. package/dist/internal/cursor-account-mcp-auth.js +9 -9
  251. package/dist/internal/cursor-deployment-relay.d.ts.map +1 -1
  252. package/dist/internal/cursor-deployment-relay.js +9 -9
  253. package/dist/internal/cursor-event-relay.js +10 -10
  254. package/dist/internal/cursor-relay-core.js +2 -2
  255. package/dist/internal/deploy-client.d.ts.map +1 -1
  256. package/dist/internal/deploy-client.js +3 -0
  257. package/dist/internal/deploy-manifest.js +10 -10
  258. package/dist/internal/discovery/agent-config.js +2 -2
  259. package/dist/internal/discovery/agent.js +6 -6
  260. package/dist/internal/discovery/connections.js +5 -5
  261. package/dist/internal/discovery/cursor-plugin.js +12 -12
  262. package/dist/internal/discovery/extension-overlay.js +3 -3
  263. package/dist/internal/discovery/extensions.js +6 -6
  264. package/dist/internal/discovery/info.js +9 -9
  265. package/dist/internal/discovery/instructions.js +1 -1
  266. package/dist/internal/discovery/project.js +3 -3
  267. package/dist/internal/discovery/services.js +1 -1
  268. package/dist/internal/discovery/tools.js +1 -1
  269. package/dist/internal/docs-site.js +2 -2
  270. package/dist/internal/env-file.js +1 -1
  271. package/dist/internal/eval-run-store.js +7 -7
  272. package/dist/internal/eval-runner.d.ts.map +1 -1
  273. package/dist/internal/eval-runner.js +14 -14
  274. package/dist/internal/eval-transport.js +1 -1
  275. package/dist/internal/evals-client.js +4 -4
  276. package/dist/internal/event-log.js +8 -8
  277. package/dist/internal/event-mapper.js +13 -13
  278. package/dist/internal/expected-delivery-failure.js +2 -2
  279. package/dist/internal/filesystem/format.js +2 -2
  280. package/dist/internal/filesystem/nearest.js +3 -3
  281. package/dist/internal/filesystem/scratch.js +3 -3
  282. package/dist/internal/filesystem/tools.js +6 -6
  283. package/dist/internal/filesystem/walk.d.ts.map +1 -1
  284. package/dist/internal/filesystem/walk.js +2 -2
  285. package/dist/internal/framework-file-storage.d.ts.map +1 -1
  286. package/dist/internal/framework-file-storage.js +6 -5
  287. package/dist/internal/framework-storage-selection.d.ts.map +1 -1
  288. package/dist/internal/framework-storage-selection.js +4 -2
  289. package/dist/internal/github-fanout.d.ts.map +1 -1
  290. package/dist/internal/github-fanout.js +3 -3
  291. package/dist/internal/guest-network.js +4 -4
  292. package/dist/internal/host-files.js +1 -1
  293. package/dist/internal/host-kv.js +2 -2
  294. package/dist/internal/hosted-catch-protocol.js +1 -1
  295. package/dist/internal/hosted-catch.js +1 -1
  296. package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
  297. package/dist/internal/hosted-delivery-protocol.js +14 -14
  298. package/dist/internal/hosted-delivery.d.ts.map +1 -1
  299. package/dist/internal/hosted-delivery.js +23 -9
  300. package/dist/internal/hosted-eval-cases.js +4 -4
  301. package/dist/internal/hosted-execution-diag.js +3 -3
  302. package/dist/internal/hosting.js +1 -1
  303. package/dist/internal/http-channel.js +1 -1
  304. package/dist/internal/http-control-plane-session.js +2 -2
  305. package/dist/internal/init-interview.js +7 -7
  306. package/dist/internal/init-project.d.ts.map +1 -1
  307. package/dist/internal/init-project.js +12 -12
  308. package/dist/internal/inline-stdio-mcp.js +2 -2
  309. package/dist/internal/install-cursor-skills.js +11 -11
  310. package/dist/internal/json-schema.js +1 -1
  311. package/dist/internal/local-control-plane.js +3 -3
  312. package/dist/internal/local-env.js +3 -3
  313. package/dist/internal/log-ring.js +1 -1
  314. package/dist/internal/logs-client.js +1 -1
  315. package/dist/internal/mcp-endpoint.js +8 -8
  316. package/dist/internal/mcp-host.d.ts.map +1 -1
  317. package/dist/internal/mcp-host.js +5 -5
  318. package/dist/internal/mcp-oauth-on-demand.js +3 -3
  319. package/dist/internal/mcp-oauth.js +5 -5
  320. package/dist/internal/net.js +2 -2
  321. package/dist/internal/otel/config.js +3 -3
  322. package/dist/internal/otel/runtime.js +13 -13
  323. package/dist/internal/peer-connections.js +2 -2
  324. package/dist/internal/persistent-stage-log-mirror.d.ts +57 -0
  325. package/dist/internal/persistent-stage-log-mirror.d.ts.map +1 -0
  326. package/dist/internal/persistent-stage-log-mirror.js +231 -0
  327. package/dist/internal/platform-schedule-sync.js +1 -1
  328. package/dist/internal/platform-timers.js +1 -1
  329. package/dist/internal/playground/static.js +2 -2
  330. package/dist/internal/playground/toolchain.js +2 -2
  331. package/dist/internal/playground-proxy.js +3 -3
  332. package/dist/internal/process-memory-telemetry.js +1 -1
  333. package/dist/internal/reminder-runner.d.ts +1 -1
  334. package/dist/internal/reminder-runner.d.ts.map +1 -1
  335. package/dist/internal/reminder-runner.js +14 -16
  336. package/dist/internal/reminder-store.js +1 -1
  337. package/dist/internal/resolved-connections.js +8 -8
  338. package/dist/internal/router.js +4 -4
  339. package/dist/internal/run-client.js +2 -2
  340. package/dist/internal/schedule-runner.js +6 -6
  341. package/dist/internal/sdk-runner.d.ts.map +1 -1
  342. package/dist/internal/sdk-runner.js +6 -6
  343. package/dist/internal/serve-restart.js +1 -1
  344. package/dist/internal/server.d.ts.map +1 -1
  345. package/dist/internal/server.js +93 -72
  346. package/dist/internal/session-cost.js +3 -3
  347. package/dist/internal/session-engine.d.ts +8 -0
  348. package/dist/internal/session-engine.d.ts.map +1 -1
  349. package/dist/internal/session-engine.js +183 -118
  350. package/dist/internal/session-live-publisher.d.ts +46 -0
  351. package/dist/internal/session-live-publisher.d.ts.map +1 -0
  352. package/dist/internal/session-live-publisher.js +352 -0
  353. package/dist/internal/session-run-log.js +6 -6
  354. package/dist/internal/sessions-client.js +3 -3
  355. package/dist/internal/skill-catalog.js +2 -2
  356. package/dist/internal/sleep.js +1 -1
  357. package/dist/internal/start-log-store.d.ts +5 -1
  358. package/dist/internal/start-log-store.d.ts.map +1 -1
  359. package/dist/internal/start-log-store.js +5 -3
  360. package/dist/internal/storage-coordinator.js +12 -12
  361. package/dist/internal/store-api-protocol.d.ts +51 -0
  362. package/dist/internal/store-api-protocol.d.ts.map +1 -1
  363. package/dist/internal/store-api-protocol.js +39 -2
  364. package/dist/internal/store-mirror.js +4 -4
  365. package/dist/internal/stream-progress.d.ts.map +1 -1
  366. package/dist/internal/stream-progress.js +4 -0
  367. package/dist/internal/terminal-style.js +2 -2
  368. package/dist/internal/tool-call-retry.d.ts +87 -0
  369. package/dist/internal/tool-call-retry.d.ts.map +1 -0
  370. package/dist/internal/tool-call-retry.js +387 -0
  371. package/dist/internal/tool-result.js +3 -3
  372. package/dist/internal/trajectory.js +7 -7
  373. package/dist/internal/turn-governor.js +2 -2
  374. package/dist/internal/turn-outbox.js +1 -1
  375. package/dist/internal/update-check.d.ts.map +1 -1
  376. package/dist/internal/update-check.js +4 -2
  377. package/dist/internal/v2-hosting.d.ts +6 -0
  378. package/dist/internal/v2-hosting.d.ts.map +1 -1
  379. package/dist/internal/v2-hosting.js +7 -1
  380. package/dist/internal/workspace.js +4 -4
  381. package/dist/kv/memory-kv.js +3 -3
  382. package/dist/playground/assets/{index-JekUQERK.js → index-HN5lOuAX.js} +42 -42
  383. package/dist/playground/assets/index-JY1wKCMg.css +1 -0
  384. package/dist/playground/index.html +2 -2
  385. package/dist/prompt.js +1 -1
  386. package/dist/storage-backends/cursor-hosted-v2.js +2 -2
  387. package/dist/storage-backends/file-kv.js +7 -7
  388. package/dist/storage-protocol.d.ts +7 -0
  389. package/dist/storage-protocol.d.ts.map +1 -1
  390. package/dist/storage-protocol.js +7 -0
  391. package/dist/storage.js +3 -3
  392. package/dist/types.d.ts +15 -0
  393. package/dist/types.d.ts.map +1 -1
  394. package/dist/types.js +4 -4
  395. package/docs/reference/connections.md +2 -1
  396. package/docs/reference/hooks.md +1 -0
  397. package/docs/reference/sessions.md +1 -1
  398. package/docs/reference/tools.md +11 -0
  399. package/package.json +6 -6
  400. package/templates/agentic-owners/bot/channels/github.ts +2 -2
  401. package/templates/agentic-owners/bot/lib/github.ts +7 -5
  402. package/templates/agentic-owners/bot/lib/owners/decision.ts +9 -9
  403. package/templates/agentic-owners/bot/lib/owners/handles.ts +2 -2
  404. package/templates/agentic-owners/bot/lib/owners/match.ts +5 -3
  405. package/templates/agentic-owners/bot/lib/owners/matching.ts +1 -1
  406. package/templates/agentic-owners/bot/lib/owners/parse.ts +4 -4
  407. package/templates/agentic-owners/bot/lib/owners/prompt.ts +1 -1
  408. package/templates/agentic-owners/bot/lib/review.ts +18 -17
  409. package/templates/agentic-owners/evals/owners.eval.ts +2 -2
  410. package/templates/agents-md/bot/lib/collect.ts +6 -6
  411. package/templates/agents-md/bot/lib/config.ts +1 -1
  412. package/templates/agents-md/bot/tools/apply_agents.ts +4 -4
  413. package/templates/code-wiki/bot/channels/github.ts +3 -3
  414. package/templates/code-wiki/bot/lib/repos.ts +1 -1
  415. package/templates/code-wiki/bot/tools/apply_wiki.ts +2 -2
  416. package/templates/demo/bot/lib/collect.ts +1 -1
  417. package/templates/demo/bot/lib/repos.ts +1 -1
  418. package/templates/demo/bot/tools/record_demo.ts +1 -1
  419. package/templates/pr-autofixer/bot/channels/github.ts +2 -2
  420. package/templates/pr-autofixer/bot/lib/merge-watch.ts +2 -2
  421. package/templates/pr-autofixer/bot/lib/repos.ts +2 -2
  422. package/templates/pr-autofixer/bot/lib/webhook-routing.ts +1 -1
  423. package/templates/security-help/bot/lib/repos.ts +1 -1
  424. package/templates/security-reviewer/bot/lib/repos.ts +1 -1
  425. package/templates/triage/bot/lib/actuate.ts +15 -15
  426. package/dist/docs/assets/chunks/@localSearchIndexroot.CtLtpWcx.js +0 -1
  427. package/dist/docs/assets/chunks/channel.CBwrU9rP.js +0 -1
  428. package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.CbC_mrvB.js +0 -1
  429. package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.CbC_mrvB.js +0 -1
  430. package/dist/docs/assets/chunks/clone.BTvFyY1a.js +0 -1
  431. package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.BYXl4LW6.js +0 -1
  432. package/dist/docs/assets/chunks/wardley-RL74JXVD.iXazD3Z7.js +0 -162
  433. package/dist/playground/assets/index-DXm_VXAQ.css +0 -1
  434. /package/dist/docs/assets/{reference_connections.md.Bljpve-y.lean.js → reference_connections.md.DLrgAd5f.lean.js} +0 -0
  435. /package/dist/docs/assets/{reference_sessions.md.CM5zo3w4.lean.js → reference_sessions.md.CyM7ARz1.lean.js} +0 -0
  436. /package/dist/docs/assets/{reference_skills.md.C0guGcH0.lean.js → reference_skills.md.ClkMoQsV.lean.js} +0 -0
@@ -304,7 +304,7 @@ export function cursorHostedFiles(options = {}) {
304
304
  if (files.wire === "flush") {
305
305
  const response = await flushPost(options, "/flush", {
306
306
  store: files.store,
307
- ops: specs.map(spec => ({
307
+ ops: specs.map((spec) => ({
308
308
  op: "put",
309
309
  path: spec.key,
310
310
  sha: createHash("sha256").update(spec.body).digest("hex"),
@@ -317,7 +317,7 @@ export function cursorHostedFiles(options = {}) {
317
317
  // instruction matching below cannot hand its sibling's presign to it,
318
318
  // and the missing url surfaces as that key's own error.
319
319
  return {
320
- files: (response.ops ?? []).map(op => ({
320
+ files: (response.ops ?? []).map((op) => ({
321
321
  path: op.path,
322
322
  ...(typeof op.url === "string" && op.url !== "" ? { url: op.url } : {}),
323
323
  headers: op.headers,
@@ -325,7 +325,7 @@ export function cursorHostedFiles(options = {}) {
325
325
  };
326
326
  }
327
327
  return await storePost(options, files.path("/upload"), {
328
- files: specs.map(spec => ({
328
+ files: specs.map((spec) => ({
329
329
  path: spec.key,
330
330
  sha: createHash("sha256").update(spec.body).digest("hex"),
331
331
  size: spec.body.byteLength,
@@ -344,7 +344,7 @@ export function cursorHostedFiles(options = {}) {
344
344
  return await Promise.all(specs.map(async (spec, index) => {
345
345
  // Match by path, falling back to position for servers that answer
346
346
  // in request order without echoing the path.
347
- const instruction = presigned.files?.find(file => file.path === spec.key) ?? presigned.files?.[index];
347
+ const instruction = presigned.files?.find((file) => file.path === spec.key) ?? presigned.files?.[index];
348
348
  if (instruction?.url === undefined) {
349
349
  // Files past the single-part threshold come back with a multipart
350
350
  // plan instead of a url; this backend does not implement multipart.
@@ -486,7 +486,7 @@ export function cursorHostedFiles(options = {}) {
486
486
  return [];
487
487
  }
488
488
  return await withFiles(async (files) => {
489
- const resolved = entries.map(entry => ({
489
+ const resolved = entries.map((entry) => ({
490
490
  entry,
491
491
  ...preconditionFor(entry),
492
492
  }));
@@ -709,7 +709,7 @@ export function cursorHostedFiles(options = {}) {
709
709
  });
710
710
  // The API answers 200 with a per-file status, so a lost race would look
711
711
  // like success unless the outcome is read.
712
- const outcome = (raw.files ?? []).find(entry => entry.path === key);
712
+ const outcome = (raw.files ?? []).find((entry) => entry.path === key);
713
713
  if (outcome?.status === "conflict") {
714
714
  observedEtags.delete(key);
715
715
  throw new FileConflictError(key, {
@@ -771,8 +771,8 @@ function resolveStoreSourceId(options) {
771
771
  }
772
772
  const DEV_PRESIGN_HOSTS = new Set((process.env.CURSOR_HOSTED_FILES_DEV_PRESIGN_HOSTS ?? "")
773
773
  .split(",")
774
- .map(host => host.trim().toLowerCase())
775
- .filter(host => host.length > 0));
774
+ .map((host) => host.trim().toLowerCase())
775
+ .filter((host) => host.length > 0));
776
776
  /** Send a file request with the deployment pod credential. */
777
777
  async function storePost(options, path, body) {
778
778
  return await postJson(options, `${resolveCursorApiBaseUrl(options)}${AGENT_SERVE_FILES_PATH}${path}`, body);
@@ -47,7 +47,7 @@ export function localFiles(options) {
47
47
  };
48
48
  return {
49
49
  capabilities: { materialized: true },
50
- materializedPath: key => pathForKey(key),
50
+ materializedPath: (key) => pathForKey(key),
51
51
  async put(key, body) {
52
52
  const target = pathForKey(key);
53
53
  await mkdir(join(target, ".."), { recursive: true });
@@ -1 +1 @@
1
- {"version":3,"file":"filesystem.d.ts","sourceRoot":"","sources":["../src/filesystem.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAiB5C,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,iBAAiB,EACjB,uBAAuB,EACvB,mBA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;GAMG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,GAAG,UAAU,CAgJnE;AAeD;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,cAAc,GAAG,UAAU,CA0J7E"}
@@ -107,7 +107,7 @@ export class FileSystemConfigError extends Error {
107
107
  }
108
108
  }
109
109
  function allowlistHas(tools, ...names) {
110
- return tools.some(name => names.includes(name));
110
+ return tools.some((name) => names.includes(name));
111
111
  }
112
112
  export function resolveRootHarnessAllowlist(tools) {
113
113
  if (tools === undefined) {
@@ -130,7 +130,7 @@ export function resolveRootHarnessAllowlist(tools) {
130
130
  throw new FileSystemConfigError("`root` cannot list `readLints`: FileSystem has no diagnostics " +
131
131
  "verb, so the host language service would run against the real workspace.");
132
132
  }
133
- const extras = tools.filter(name => !isFileSystemToolAlias(name));
133
+ const extras = tools.filter((name) => !isFileSystemToolAlias(name));
134
134
  return withMcpGrant(extras);
135
135
  }
136
136
  export function resolveFileSystemTools(options) {
@@ -182,7 +182,7 @@ export function resolveHostHarnessToolOptions(tools) {
182
182
  return { tools: [] };
183
183
  }
184
184
  return {
185
- tools: withMcpGrant(tools.filter(name => !isReplacedHostFileAlias(name))),
185
+ tools: withMcpGrant(tools.filter((name) => !isReplacedHostFileAlias(name))),
186
186
  };
187
187
  }
188
188
  /** File aliases host-default synthesizes. Native `semSearch` stays. */
@@ -362,7 +362,7 @@ export async function collectGrepMatches(root, query, opts) {
362
362
  }
363
363
  export function shapeGrepUnion(matches, outputMode) {
364
364
  if (outputMode === "files_with_matches") {
365
- const files = [...new Set(matches.map(match => match.path))];
365
+ const files = [...new Set(matches.map((match) => match.path))];
366
366
  return { type: "files", output: { files, count: files.length } };
367
367
  }
368
368
  if (outputMode === "count") {
@@ -381,7 +381,7 @@ export function shapeGrepUnion(matches, outputMode) {
381
381
  return {
382
382
  type: "content",
383
383
  output: {
384
- matches: matches.map(match => ({
384
+ matches: matches.map((match) => ({
385
385
  file: match.path,
386
386
  lineNumber: match.lineNumber,
387
387
  line: match.line,
@@ -996,7 +996,7 @@ export function unionFs(mounts) {
996
996
  yield* limitResults(uncapped(), options?.limit);
997
997
  async function* uncapped() {
998
998
  if (isRootPath(prefix)) {
999
- yield* mergeSortedByPath(entries.map(mount => mapMountEntries(mount.fs.list(undefined, options), mount.prefix)), { unique: true });
999
+ yield* mergeSortedByPath(entries.map((mount) => mapMountEntries(mount.fs.list(undefined, options), mount.prefix)), { unique: true });
1000
1000
  return;
1001
1001
  }
1002
1002
  const path = normalizeFsPath(prefix ?? "/");
@@ -1013,7 +1013,7 @@ export function unionFs(mounts) {
1013
1013
  if (normalized === "/") {
1014
1014
  return { kind: "directory" };
1015
1015
  }
1016
- if (entries.some(entry => entry.prefix === normalized)) {
1016
+ if (entries.some((entry) => entry.prefix === normalized)) {
1017
1017
  return { kind: "directory" };
1018
1018
  }
1019
1019
  const mount = longestMount(normalized, entries);
@@ -1039,7 +1039,7 @@ export function unionFs(mounts) {
1039
1039
  async function* uncapped() {
1040
1040
  const scope = query.path === undefined || query.path === "" ? "/" : normalizeFsPath(query.path);
1041
1041
  if (scope === "/") {
1042
- yield* mergeSorted(entries.map(mount => mapMountGrep(mount.fs.grep({ ...query, path: undefined }), mount.prefix)), { compare: compareGrepResult });
1042
+ yield* mergeSorted(entries.map((mount) => mapMountGrep(mount.fs.grep({ ...query, path: undefined }), mount.prefix)), { compare: compareGrepResult });
1043
1043
  return;
1044
1044
  }
1045
1045
  const mount = longestMount(scope, entries);
@@ -1072,7 +1072,7 @@ export function unionFs(mounts) {
1072
1072
  async function* uncapped() {
1073
1073
  const scope = dir === undefined || dir === "" ? "/" : normalizeFsPath(dir);
1074
1074
  if (scope === "/") {
1075
- yield* mergeSortedByPath(entries.map(mount => mapMountEntries(mount.fs.glob(pattern, undefined, options), mount.prefix)), { unique: true });
1075
+ yield* mergeSortedByPath(entries.map((mount) => mapMountEntries(mount.fs.glob(pattern, undefined, options), mount.prefix)), { unique: true });
1076
1076
  return;
1077
1077
  }
1078
1078
  const mount = longestMount(scope, entries);
@@ -1162,7 +1162,7 @@ export function overlayFs(layers) {
1162
1162
  };
1163
1163
  return {
1164
1164
  async *list(prefix, options) {
1165
- const { streams, failure, served } = await walkLayers(layer => layer.list(prefix, options));
1165
+ const { streams, failure, served } = await walkLayers((layer) => layer.list(prefix, options));
1166
1166
  if (!served && failure !== undefined) {
1167
1167
  throw failure;
1168
1168
  }
@@ -1189,7 +1189,7 @@ export function overlayFs(layers) {
1189
1189
  return { kind: "missing" };
1190
1190
  },
1191
1191
  async *glob(pattern, dir, options) {
1192
- const { streams, failure, served } = await walkLayers(layer => layer.glob(pattern, dir, options));
1192
+ const { streams, failure, served } = await walkLayers((layer) => layer.glob(pattern, dir, options));
1193
1193
  if (!served && failure !== undefined) {
1194
1194
  throw failure;
1195
1195
  }
@@ -1215,7 +1215,7 @@ export function overlayFs(layers) {
1215
1215
  },
1216
1216
  async *grep(query) {
1217
1217
  const { maxResults, ...uncappedQuery } = query;
1218
- yield* limitResults(mergeSorted(await collectOverlayHits(layer => layer.grep(uncappedQuery), error => isInvalidGrepPatternError(error)), { compare: compareGrepResult }), maxResults);
1218
+ yield* limitResults(mergeSorted(await collectOverlayHits((layer) => layer.grep(uncappedQuery), (error) => isInvalidGrepPatternError(error)), { compare: compareGrepResult }), maxResults);
1219
1219
  },
1220
1220
  async write(path) {
1221
1221
  throw new ReadOnlyMountError(path);
@@ -1225,7 +1225,7 @@ export function overlayFs(layers) {
1225
1225
  },
1226
1226
  async *search(query) {
1227
1227
  const { maxResults, ...uncappedQuery } = query;
1228
- yield* limitResults(mergeSorted(await collectOverlayHits(layer => layer.search(uncappedQuery)), {
1228
+ yield* limitResults(mergeSorted(await collectOverlayHits((layer) => layer.search(uncappedQuery)), {
1229
1229
  compare: compareSearchResult,
1230
1230
  }), maxResults);
1231
1231
  },
@@ -1254,14 +1254,14 @@ export function hostFs(files, scope) {
1254
1254
  const listed = {
1255
1255
  async *list(prefix, options) {
1256
1256
  const entries = await files.list(undefined, callOptions);
1257
- yield* listFilesFromPaths(entries.map(entry => ({
1257
+ yield* listFilesFromPaths(entries.map((entry) => ({
1258
1258
  path: normalizeFsPath(entry.path),
1259
1259
  size: entry.size,
1260
1260
  })), prefix, options);
1261
1261
  },
1262
1262
  async stat(path) {
1263
1263
  const entries = await files.list(undefined, callOptions);
1264
- return statFromFilePaths(entries.map(entry => normalizeFsPath(entry.path)), path);
1264
+ return statFromFilePaths(entries.map((entry) => normalizeFsPath(entry.path)), path);
1265
1265
  },
1266
1266
  };
1267
1267
  const readText = async (inputPath) => {
@@ -88,8 +88,9 @@ export declare function resolveAdvertisedTools(args: {
88
88
  export declare function sourceForConnection(connection: DiscoveredConnection, session: SessionInfo, hostMcp: AdvertiseHostMcp): Promise<AdvertisedToolSource>;
89
89
  /**
90
90
  * Render an MCP call result for the model: text parts joined, non-text
91
- * parts noted by type, `isError` surfaced as a thrown error so the turn
92
- * records a tool error instead of error-shaped prose.
91
+ * parts noted by type, `isError` surfaced as a {@link McpToolError} so the
92
+ * turn records a tool error and read-only retry can tell a vendor-reported
93
+ * error from a transport failure.
93
94
  */
94
95
  export declare function formatMcpToolResult(connectionName: string, toolName: string, result: HostMcpCallResult): string;
95
96
  //# sourceMappingURL=advertise-tools.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"advertise-tools.d.ts","sourceRoot":"","sources":["../../src/internal/advertise-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EAGpB,KAAK,aAAa,EAClB,KAAK,WAAW,EAGjB,MAAM,aAAa,CAAC;AAGrB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAInD;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IA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EAAE,gBAAgB,CAAC;IAC1B;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACjE,0DAA0D;IAC1D,SAAS,CAAC,EAAE,CACV,UAAU,EAAE,oBAAoB,EAChC,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,gBAAgB,KACtB,OAAO,CAAC,oBAAoB,CAAC,CAAC;CACpC,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAmF5B;AAED;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,oBAAoB,EAChC,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,oBAAoB,CAAC,CAqB/B;AAkHD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,iBAAiB,GACxB,MAAM,CAgBR"}
@@ -37,6 +37,7 @@ import { connectionAllowsTool, } from "../types.js";
37
37
  import { brandDefinition } from "./brand.js";
38
38
  import { describeError } from "./describe-error.js";
39
39
  import { sanitizeMcpToolName, suffixMcpToolName } from "./sanitize-mcp-tool-name.js";
40
+ import { McpToolError } from "./tool-call-retry.js";
40
41
  import { classifyAnnotationsEffect } from "./tool-policy.js";
41
42
  /**
42
43
  * Model-facing advertised names after {@link sanitizeMcpToolName} — the
@@ -55,7 +56,7 @@ const ANY_OBJECT_SCHEMA = {
55
56
  * or a definition is invalid.
56
57
  */
57
58
  export async function resolveAdvertisedTools(args) {
58
- const advertising = args.agent.connections.filter(connection => connection.advertiseTools === true);
59
+ const advertising = args.agent.connections.filter((connection) => connection.advertiseTools === true);
59
60
  if (advertising.length === 0) {
60
61
  return [];
61
62
  }
@@ -68,14 +69,14 @@ export async function resolveAdvertisedTools(args) {
68
69
  connection,
69
70
  ok: true,
70
71
  source,
71
- listed: listed.filter(info => connectionAllowsTool(connection, info.name)),
72
+ listed: listed.filter((info) => connectionAllowsTool(connection, info.name)),
72
73
  };
73
74
  }
74
75
  catch (error) {
75
76
  return { connection, ok: false, error };
76
77
  }
77
78
  }));
78
- const claimed = new Set(args.agent.tools.map(tool => tool.name));
79
+ const claimed = new Set(args.agent.tools.map((tool) => tool.name));
79
80
  const resolved = [];
80
81
  for (const listing of listings) {
81
82
  const { connection } = listing;
@@ -102,7 +103,7 @@ export async function resolveAdvertisedTools(args) {
102
103
  }
103
104
  throw error;
104
105
  }
105
- const intended = listed.filter(info => !isDoNotCallTool(info.annotations) &&
106
+ const intended = listed.filter((info) => !isDoNotCallTool(info.annotations) &&
106
107
  matchesIntendedEffects(info.annotations, connection.effects));
107
108
  const exposed = exposeListedTools(intended, claimed);
108
109
  for (const { info, exposedName } of exposed) {
@@ -178,7 +179,7 @@ function exposeListedTools(listed, claimed) {
178
179
  exposedNameByInfo.set(info, exposedName);
179
180
  });
180
181
  }
181
- return listed.map(info => ({
182
+ return listed.map((info) => ({
182
183
  info,
183
184
  exposedName: exposedNameByInfo.get(info),
184
185
  }));
@@ -233,16 +234,17 @@ function toDiscoveredTool(connection, info, exposedName, source) {
233
234
  }
234
235
  /**
235
236
  * Render an MCP call result for the model: text parts joined, non-text
236
- * parts noted by type, `isError` surfaced as a thrown error so the turn
237
- * records a tool error instead of error-shaped prose.
237
+ * parts noted by type, `isError` surfaced as a {@link McpToolError} so the
238
+ * turn records a tool error and read-only retry can tell a vendor-reported
239
+ * error from a transport failure.
238
240
  */
239
241
  export function formatMcpToolResult(connectionName, toolName, result) {
240
- const parts = result.content.map(item => item.type === "text" && typeof item.text === "string"
242
+ const parts = result.content.map((item) => item.type === "text" && typeof item.text === "string"
241
243
  ? item.text
242
244
  : `[${item.type} content omitted]`);
243
245
  const text = parts.join("\n").trim();
244
246
  if (result.isError === true) {
245
- throw new Error(text === "" ? `${connectionName} tool ${toolName} failed` : text);
247
+ throw new McpToolError({ connection: connectionName, toolName, vendorMessage: text });
246
248
  }
247
249
  if (text !== "") {
248
250
  return text;
@@ -21,7 +21,7 @@ export class ApprovalGate {
21
21
  if (existing !== undefined) {
22
22
  throw new Error(`Approval already pending for session ${sessionId} call ${meta.callId}`);
23
23
  }
24
- return new Promise(resolveDecision => {
24
+ return new Promise((resolveDecision) => {
25
25
  this.waiters.set(key, {
26
26
  meta,
27
27
  resolve: resolveDecision,
@@ -159,7 +159,7 @@ export class ArtifactsStore {
159
159
  (options?.matches === undefined || options.matches(record));
160
160
  if (options?.matches === undefined) {
161
161
  const metas = await this.rows.listMeta();
162
- if (metas.some(meta => meta.mtimeMs !== undefined)) {
162
+ if (metas.some((meta) => meta.mtimeMs !== undefined)) {
163
163
  return this.pageFromMetadata(metas, limit, cursor, matches, options?.kind !== undefined || options?.sessionId !== undefined);
164
164
  }
165
165
  }
@@ -178,7 +178,7 @@ export class ArtifactsStore {
178
178
  // Resume after (boundary stamp, rows of that cohort already
179
179
  // examined). Same-stamp rows sit contiguously in the sort, so the
180
180
  // pair names an exact position without identifying any row.
181
- start = newestFirst.findIndex(meta => (meta.mtimeMs ?? 0) <= cursor.m);
181
+ start = newestFirst.findIndex((meta) => (meta.mtimeMs ?? 0) <= cursor.m);
182
182
  if (start === -1) {
183
183
  return { records: [] };
184
184
  }
@@ -213,8 +213,8 @@ export class ArtifactsStore {
213
213
  const sliceCap = filtered ? scanBatchSize : Math.min(scanBatchSize, limit - records.length);
214
214
  const batch = newestFirst.slice(from, from + Math.min(sliceCap, budget - examined));
215
215
  const bodies = this.rows.getMany !== undefined
216
- ? await this.rows.getMany(batch.map(meta => meta.id))
217
- : await mapBounded(batch, ROW_HYDRATION_CONCURRENCY, meta => this.rows.get(meta.id));
216
+ ? await this.rows.getMany(batch.map((meta) => meta.id))
217
+ : await mapBounded(batch, ROW_HYDRATION_CONCURRENCY, (meta) => this.rows.get(meta.id));
218
218
  for (let i = 0; i < batch.length; i += 1) {
219
219
  lastExamined = from + i;
220
220
  examined += 1;
@@ -263,7 +263,7 @@ export class ArtifactsStore {
263
263
  createdAt: cursor.c,
264
264
  id: cursor.id,
265
265
  };
266
- start = records.findIndex(record => byNewestUpdated(record, position) > 0);
266
+ start = records.findIndex((record) => byNewestUpdated(record, position) > 0);
267
267
  if (start === -1) {
268
268
  return { records: [] };
269
269
  }
@@ -336,14 +336,14 @@ export class ArtifactsStore {
336
336
  }
337
337
  /** The `excess` oldest row ids, cheapest available ordering first. */
338
338
  async oldestRowIds(metas, excess) {
339
- if (metas.some(meta => meta.mtimeMs !== undefined)) {
339
+ if (metas.some((meta) => meta.mtimeMs !== undefined)) {
340
340
  // A store that tracks mtimes must never regress to per-insert
341
341
  // hydration. An entry missing one sorts oldest via the comparator's
342
342
  // `?? 0` and is evicted first, avoiding a full hydration on each insert.
343
343
  return metas
344
344
  .sort(byOldestModified)
345
345
  .slice(0, excess)
346
- .map(meta => meta.id);
346
+ .map((meta) => meta.id);
347
347
  }
348
348
  // A store that tracks no modification times at all (the local
349
349
  // filesystem store, deliberately) leaves only the rows' own
@@ -354,7 +354,7 @@ export class ArtifactsStore {
354
354
  return records
355
355
  .sort((a, b) => byNewestUpdated(b, a))
356
356
  .slice(0, Math.min(excess, Math.max(0, records.length - this.max)))
357
- .map(record => record.id);
357
+ .map((record) => record.id);
358
358
  }
359
359
  }
360
360
  /** A syntactically invalid {@link ArtifactPageOptions.cursor}. */
@@ -479,17 +479,17 @@ function createSinkRowStore(sink, agentName) {
479
479
  await sink.delete(key(id));
480
480
  },
481
481
  async getMany(ids) {
482
- const keys = ids.map(id => key(id));
482
+ const keys = ids.map((id) => key(id));
483
483
  const bodies = sink.getMany !== undefined
484
484
  ? await sink.getMany(keys)
485
- : await mapBounded(keys, ROW_HYDRATION_CONCURRENCY, rowKey => sink.get(rowKey));
486
- return bodies.map(body => parseRecordBytes(sinkBody(body)));
485
+ : await mapBounded(keys, ROW_HYDRATION_CONCURRENCY, (rowKey) => sink.get(rowKey));
486
+ return bodies.map((body) => parseRecordBytes(sinkBody(body)));
487
487
  },
488
488
  async list() {
489
489
  const entries = await sink.list(agentStoreKeys.artifactRowPrefix(agentName));
490
490
  const bodies = sink.getMany !== undefined
491
- ? await sink.getMany(entries.map(entry => entry.key))
492
- : await mapBounded(entries, ROW_HYDRATION_CONCURRENCY, entry => sink.get(entry.key));
491
+ ? await sink.getMany(entries.map((entry) => entry.key))
492
+ : await mapBounded(entries, ROW_HYDRATION_CONCURRENCY, (entry) => sink.get(entry.key));
493
493
  const records = [];
494
494
  for (const body of bodies) {
495
495
  const record = parseRecordBytes(sinkBody(body));
@@ -50,7 +50,7 @@ export function assertTimeArgs(tools, asOf) {
50
50
  continue;
51
51
  }
52
52
  const properties = tool.inputSchema?.properties ?? {};
53
- const missing = declared.filter(name => !(name in properties));
53
+ const missing = declared.filter((name) => !(name in properties));
54
54
  if (missing.length > 0) {
55
55
  throw new VacuousTimeArgsError(tool.name, missing);
56
56
  }
@@ -194,7 +194,7 @@ export function missingTimeWindow(input, windowKeys, asOf) {
194
194
  return undefined;
195
195
  }
196
196
  const record = typeof input === "object" && input !== null ? input : {};
197
- const missing = windowKeys.filter(key => record[key] === undefined);
197
+ const missing = windowKeys.filter((key) => record[key] === undefined);
198
198
  if (missing.length === 0) {
199
199
  return undefined;
200
200
  }
@@ -26,7 +26,7 @@ function toNullProtoMap(source) {
26
26
  }
27
27
  export function initialize(data) {
28
28
  directAliases = toNullProtoMap(data.directAliases);
29
- sourceFallbackAliases = toNullProtoMap(Object.fromEntries((data.sourceFallbackAliases ?? []).map(specifier => [specifier, "1"])));
29
+ sourceFallbackAliases = toNullProtoMap(Object.fromEntries((data.sourceFallbackAliases ?? []).map((specifier) => [specifier, "1"])));
30
30
  const parent = data.sourceTreeFallbackParentURL;
31
31
  sourceTreeFallbackParentURL = typeof parent === "string" && parent !== "" ? parent : undefined;
32
32
  }
@@ -30,7 +30,7 @@ async function listMine(ctx, status) {
30
30
  status,
31
31
  continuationToken: conv.continuationToken,
32
32
  });
33
- return all.filter(r => r.channelId === conv.channelId);
33
+ return all.filter((r) => r.channelId === conv.channelId);
34
34
  }
35
35
  function toResult(r) {
36
36
  return {
@@ -100,7 +100,7 @@ const cancel = defineTool({
100
100
  id: z.string().min(1).describe("Reminder id from reminders_create or reminders_list."),
101
101
  }),
102
102
  async execute(input, ctx) {
103
- const mine = (await listMine(ctx)).find(r => r.id === input.id);
103
+ const mine = (await listMine(ctx)).find((r) => r.id === input.id);
104
104
  if (mine === undefined) {
105
105
  throw new Error(`No reminder "${input.id}" in this conversation.`);
106
106
  }
@@ -121,13 +121,13 @@ export async function runChat(options) {
121
121
  }
122
122
  write(c.dim("Type a message and press Enter. Ctrl-D or /quit to exit.\n\n"));
123
123
  const rl = createInterface({ input: process.stdin, output: process.stdout });
124
- await new Promise(resolve => {
124
+ await new Promise((resolve) => {
125
125
  const prompt = () => {
126
126
  rl.setPrompt(c.cyan("› "));
127
127
  rl.prompt();
128
128
  };
129
129
  prompt();
130
- rl.on("line", line => {
130
+ rl.on("line", (line) => {
131
131
  const text = line.trim();
132
132
  if (text === "") {
133
133
  prompt();
@@ -139,7 +139,7 @@ export async function runChat(options) {
139
139
  }
140
140
  rl.pause();
141
141
  runTurn(text, { echoUser: false })
142
- .catch(err => {
142
+ .catch((err) => {
143
143
  write(`${c.red("error")} ${describe(err)}\n\n`);
144
144
  })
145
145
  .finally(() => {
@@ -162,7 +162,7 @@ export async function lookupSessionContinuation(args) {
162
162
  baseUrl: args.baseUrl,
163
163
  auth: args.auth,
164
164
  });
165
- const match = sessions.find(s => s.sessionId === args.sessionId);
165
+ const match = sessions.find((s) => s.sessionId === args.sessionId);
166
166
  if (match === undefined) {
167
167
  throw new Error(`Session ${args.sessionId} not found in /v1/sessions (wrong id, or not owned by this caller). ` +
168
168
  `Pass --continuation-token if you have it.`);
@@ -199,7 +199,7 @@ async function attachSession(args) {
199
199
  }
200
200
  const lastIndex = events.length === 0
201
201
  ? -1
202
- : Math.max(...events.map(e => (typeof e.index === "number" ? e.index : -1)));
202
+ : Math.max(...events.map((e) => (typeof e.index === "number" ? e.index : -1)));
203
203
  return {
204
204
  sessionId: args.sessionId,
205
205
  continuationToken,
@@ -50,15 +50,15 @@ function pickAgentUrl(handle, slug) {
50
50
  die("No agents discovered.");
51
51
  }
52
52
  if (slug !== undefined && slug !== "") {
53
- const match = handle.agents.find(a => a.slug === slug);
53
+ const match = handle.agents.find((a) => a.slug === slug);
54
54
  if (match === undefined) {
55
55
  die(`Unknown agent slug "${slug}". Available: ${handle.agents
56
- .map(a => a.slug || "(root)")
56
+ .map((a) => a.slug || "(root)")
57
57
  .join(", ")}`);
58
58
  }
59
59
  return match.url;
60
60
  }
61
- const root = handle.agents.find(a => a.slug === "");
61
+ const root = handle.agents.find((a) => a.slug === "");
62
62
  return (root ?? handle.agents[0]).url;
63
63
  }
64
64
  async function startEphemeral(options, evals = false) {
@@ -84,7 +84,7 @@ async function startEphemeral(options, evals = false) {
84
84
  // engine.close() can hang on open SDK streams; don't block the CLI.
85
85
  await Promise.race([
86
86
  handle.close(),
87
- new Promise(resolve => setTimeout(resolve, 2_000)),
87
+ new Promise((resolve) => setTimeout(resolve, 2_000)),
88
88
  ]);
89
89
  },
90
90
  };
@@ -392,7 +392,7 @@ export async function cmdRun(options) {
392
392
  bearerToken: options.bearerToken,
393
393
  headers: target.headers,
394
394
  timeoutMs: options.timeoutMs,
395
- onEvent: progress === undefined ? undefined : e => progress.onEvent(e),
395
+ onEvent: progress === undefined ? undefined : (e) => progress.onEvent(e),
396
396
  });
397
397
  let eventsPath;
398
398
  const writeEvents = options.events !== false;
@@ -406,7 +406,7 @@ export async function cmdRun(options) {
406
406
  await mkdir(tracesDir, { recursive: true });
407
407
  eventsPath = join(tracesDir, `${result.sessionId}.ndjson`);
408
408
  }
409
- await writeFile(eventsPath, `${result.events.map(e => JSON.stringify(e)).join("\n")}\n`, "utf8");
409
+ await writeFile(eventsPath, `${result.events.map((e) => JSON.stringify(e)).join("\n")}\n`, "utf8");
410
410
  }
411
411
  const playgroundUrl = options.prod === true
412
412
  ? null
@@ -736,7 +736,7 @@ export async function cmdEval(options) {
736
736
  filterIds,
737
737
  tags,
738
738
  });
739
- return printListedEvals(listed.map(e => ({
739
+ return printListedEvals(listed.map((e) => ({
740
740
  id: e.id,
741
741
  fileId: e.fileId,
742
742
  description: e.description,
@@ -783,7 +783,7 @@ export async function cmdEval(options) {
783
783
  bearerToken: options.bearerToken,
784
784
  headers: target.headers,
785
785
  verbose: Boolean(options.verbose) || stream,
786
- onEvent: progress === undefined ? undefined : e => progress.onEvent(e),
786
+ onEvent: progress === undefined ? undefined : (e) => progress.onEvent(e),
787
787
  });
788
788
  if (results.length === 0) {
789
789
  process.stderr.write("No matching evals found.\n");
@@ -1076,7 +1076,7 @@ export async function cmdEvalStatus(runId, options) {
1076
1076
  }
1077
1077
  const failed = snap.status === "failed" ||
1078
1078
  snap.status === "cancelled" ||
1079
- snap.cases.some(c => c.ok !== true);
1079
+ snap.cases.some((c) => c.ok !== true);
1080
1080
  return failed ? 1 : 0;
1081
1081
  }
1082
1082
  catch (error) {
@@ -1097,7 +1097,7 @@ function formatEvalRunSummaryLine(run) {
1097
1097
  async function listLocalEvals(projectRoot, options, filterIds, tags) {
1098
1098
  const { evals } = await discoverEvals(projectRoot);
1099
1099
  const listed = filterDiscoveredEvals(evals, { filterIds, tags });
1100
- return printListedEvals(listed.map(e => ({
1100
+ return printListedEvals(listed.map((e) => ({
1101
1101
  id: e.id,
1102
1102
  fileId: e.fileId,
1103
1103
  path: e.path,
@@ -1346,7 +1346,7 @@ export async function cmdLogs(options) {
1346
1346
  if (architecture === "v2") {
1347
1347
  await followHostedLogs({
1348
1348
  slug,
1349
- read: signal => auth.client.getAgentkitDeploymentLogs({ teamId: auth.teamId, slug, sessionId, signal }),
1349
+ read: (signal) => auth.client.getAgentkitDeploymentLogs({ teamId: auth.teamId, slug, sessionId, signal }),
1350
1350
  scoped: sessionId !== undefined,
1351
1351
  once: options.once === true,
1352
1352
  json: options.json === true,
@@ -1476,7 +1476,7 @@ function formatHostedSessionRuns(sessionId, runs, events) {
1476
1476
  const lines = [`Session ${sessionId}`, `Hosted executions: ${runs.executions.length}`];
1477
1477
  for (const run of runs.executions) {
1478
1478
  const failure = run.error?.message ?? run.message ?? "";
1479
- lines.push("", `${run.executionId} ${run.turnStatus} ${run.durationMs}ms ${run.writtenAt} ${failure}`.trimEnd(), ...run.logs.map(log => ` ${log.line}`));
1479
+ lines.push("", `${run.executionId} ${run.turnStatus} ${run.durationMs}ms ${run.writtenAt} ${failure}`.trimEnd(), ...run.logs.map((log) => ` ${log.line}`));
1480
1480
  }
1481
1481
  const latestType = events?.events.at(-1)?.type;
1482
1482
  if (events !== undefined && events.events.length > 0) {
@@ -1590,7 +1590,7 @@ export async function cmdSession(sessionId, options) {
1590
1590
  if (outPath !== undefined) {
1591
1591
  const targetPath = resolve(outPath);
1592
1592
  await mkdir(dirname(targetPath), { recursive: true });
1593
- await writeFile(targetPath, `${events.map(e => JSON.stringify(e)).join("\n")}\n`, "utf8");
1593
+ await writeFile(targetPath, `${events.map((e) => JSON.stringify(e)).join("\n")}\n`, "utf8");
1594
1594
  process.stdout.write(`trace: ${targetPath} (${events.length} events)\n`);
1595
1595
  return 0;
1596
1596
  }
@@ -1784,7 +1784,7 @@ async function runPlaygroundProxySession(args) {
1784
1784
  }
1785
1785
  }
1786
1786
  try {
1787
- await new Promise(resolve => {
1787
+ await new Promise((resolve) => {
1788
1788
  if (controller.signal.aborted) {
1789
1789
  resolve();
1790
1790
  return;