@cursor/july 0.1.89 → 0.1.91

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 (346) hide show
  1. package/AGENTS.md +8 -0
  2. package/README.md +98 -96
  3. package/dist/ab.d.ts +1 -1
  4. package/dist/ab.js +1 -1
  5. package/dist/artifacts.d.ts +1 -1
  6. package/dist/artifacts.js +1 -1
  7. package/dist/bin/agent-serve.js +20 -7
  8. package/dist/channels/slack/channel-watch.d.ts +1 -1
  9. package/dist/channels/slack/channel-watch.js +1 -1
  10. package/dist/channels/slack/slack-channel.js +1 -1
  11. package/dist/channels/slack/types.d.ts +2 -4
  12. package/dist/channels/slack/types.d.ts.map +1 -1
  13. package/dist/channels.d.ts +1 -1
  14. package/dist/channels.js +1 -1
  15. package/dist/connections.d.ts +1 -1
  16. package/dist/connections.js +1 -1
  17. package/dist/docs/404.html +3 -3
  18. package/dist/docs/ab.html +7 -7
  19. package/dist/docs/assets/{ab.md.DYjwREAP.js → ab.md.CVzWxLoB.js} +1 -1
  20. package/dist/docs/assets/{ab.md.DYjwREAP.lean.js → ab.md.CVzWxLoB.lean.js} +1 -1
  21. package/dist/docs/assets/{app.DUOPbN18.js → app.Bci6CM9E.js} +1 -1
  22. package/dist/docs/assets/{building-with-agents.md.PeZaZA1P.js → building-with-agents.md.DH8A_cHA.js} +1 -1
  23. package/dist/docs/assets/{building-with-agents.md.PeZaZA1P.lean.js → building-with-agents.md.DH8A_cHA.lean.js} +1 -1
  24. package/dist/docs/assets/chunks/@localSearchIndexroot.Dv-Q0XtU.js +1 -0
  25. package/dist/docs/assets/chunks/{VPLocalSearchBox.CmWbGcGk.js → VPLocalSearchBox.BCPT6xA-.js} +1 -1
  26. package/dist/docs/assets/chunks/{framework.CAZyNGu9.js → framework.BCISBCiQ.js} +1 -1
  27. package/dist/docs/assets/chunks/theme.BEA8BF3c.js +2 -0
  28. package/dist/docs/assets/{concepts.md.BXAm6G-C.js → concepts.md.CRfU3bVg.js} +1 -1
  29. package/dist/docs/assets/{concepts.md.BXAm6G-C.lean.js → concepts.md.CRfU3bVg.lean.js} +1 -1
  30. package/dist/docs/assets/{deployment.md.B8kW-h7P.js → deployment.md.DX_hc3ze.js} +6 -5
  31. package/dist/docs/assets/{deployment.md.B8kW-h7P.lean.js → deployment.md.DX_hc3ze.lean.js} +1 -1
  32. package/dist/docs/assets/{evals.md.CVe_O75-.js → evals.md.a0SMN6r9.js} +3 -3
  33. package/dist/docs/assets/{evals.md.CVe_O75-.lean.js → evals.md.a0SMN6r9.lean.js} +1 -1
  34. package/dist/docs/assets/{example-agents_approval-buddy.md.CIiZ9coo.js → example-agents_approval-buddy.md.DNL83puR.js} +1 -1
  35. package/dist/docs/assets/{example-agents_approval-buddy.md.CIiZ9coo.lean.js → example-agents_approval-buddy.md.DNL83puR.lean.js} +1 -1
  36. package/dist/docs/assets/{example-agents_benny.md.B-LIDGja.js → example-agents_benny.md.C40vHRLc.js} +1 -1
  37. package/dist/docs/assets/{example-agents_benny.md.B-LIDGja.lean.js → example-agents_benny.md.C40vHRLc.lean.js} +1 -1
  38. package/dist/docs/assets/{example-agents_bugbot.md.Dp5JqHSQ.js → example-agents_bugbot.md.BRGMi9O2.js} +1 -1
  39. package/dist/docs/assets/{example-agents_bugbot.md.Dp5JqHSQ.lean.js → example-agents_bugbot.md.BRGMi9O2.lean.js} +1 -1
  40. package/dist/docs/assets/{example-agents_codebase-wiki.md.D-lteFf0.js → example-agents_codebase-wiki.md.Dftj_tPp.js} +1 -1
  41. package/dist/docs/assets/{example-agents_codebase-wiki.md.D-lteFf0.lean.js → example-agents_codebase-wiki.md.Dftj_tPp.lean.js} +1 -1
  42. package/dist/docs/assets/{example-agents_codeowners-review.md.BU2ZXLf-.js → example-agents_codeowners-review.md.Bfta-lBU.js} +1 -1
  43. package/dist/docs/assets/{example-agents_codeowners-review.md.BU2ZXLf-.lean.js → example-agents_codeowners-review.md.Bfta-lBU.lean.js} +1 -1
  44. package/dist/docs/assets/{example-agents_concierge.md.DA2al_NK.js → example-agents_concierge.md.MrKpQndp.js} +1 -1
  45. package/dist/docs/assets/{example-agents_concierge.md.DA2al_NK.lean.js → example-agents_concierge.md.MrKpQndp.lean.js} +1 -1
  46. package/dist/docs/assets/{example-agents_fsd.md.ZeGEpAw_.js → example-agents_fsd.md.ZWHWWZPE.js} +1 -1
  47. package/dist/docs/assets/{example-agents_fsd.md.ZeGEpAw_.lean.js → example-agents_fsd.md.ZWHWWZPE.lean.js} +1 -1
  48. package/dist/docs/assets/example-agents_index.md.QZ8mhr6n.js +2 -0
  49. package/dist/docs/assets/{example-agents_index.md.xmJ87d_3.lean.js → example-agents_index.md.QZ8mhr6n.lean.js} +1 -1
  50. package/dist/docs/assets/{example-agents_knowledge-base.md.IneynQSR.js → example-agents_knowledge-base.md.DqKqHQ9u.js} +1 -1
  51. package/dist/docs/assets/{example-agents_knowledge-base.md.IneynQSR.lean.js → example-agents_knowledge-base.md.DqKqHQ9u.lean.js} +1 -1
  52. package/dist/docs/assets/{example-agents_oncall.md.CBmyuAKc.js → example-agents_oncall.md.DK4XkYTd.js} +1 -1
  53. package/dist/docs/assets/{example-agents_oncall.md.CBmyuAKc.lean.js → example-agents_oncall.md.DK4XkYTd.lean.js} +1 -1
  54. package/dist/docs/assets/{example-agents_security-reviewer.md.DBL1TwtP.js → example-agents_security-reviewer.md.Bai6D0Ee.js} +4 -4
  55. package/dist/docs/assets/{example-agents_security-reviewer.md.DBL1TwtP.lean.js → example-agents_security-reviewer.md.Bai6D0Ee.lean.js} +1 -1
  56. package/dist/docs/assets/{example-agents_slack-agent.md.06jQXTAI.js → example-agents_slack-agent.md.D7Kdj5BV.js} +1 -1
  57. package/dist/docs/assets/{example-agents_slack-agent.md.06jQXTAI.lean.js → example-agents_slack-agent.md.D7Kdj5BV.lean.js} +1 -1
  58. package/dist/docs/assets/{example-agents_weather-agent.md.DC3lINjo.js → example-agents_weather-agent.md.lVEAbWFf.js} +5 -5
  59. package/dist/docs/assets/example-agents_weather-agent.md.lVEAbWFf.lean.js +1 -0
  60. package/dist/docs/assets/{guides_agent-to-agent.md.Bmbxy-FA.js → guides_agent-to-agent.md.BCeVdJRJ.js} +1 -1
  61. package/dist/docs/assets/{guides_agent-to-agent.md.Bmbxy-FA.lean.js → guides_agent-to-agent.md.BCeVdJRJ.lean.js} +1 -1
  62. package/dist/docs/assets/{guides_cloud-runtime.md.CbklWfzh.js → guides_cloud-runtime.md.BSMLIBHr.js} +1 -1
  63. package/dist/docs/assets/{guides_cloud-runtime.md.CbklWfzh.lean.js → guides_cloud-runtime.md.BSMLIBHr.lean.js} +1 -1
  64. package/dist/docs/assets/{guides_convert-automation.md.BhMzTkE5.js → guides_convert-automation.md.D06eIzea.js} +1 -1
  65. package/dist/docs/assets/{guides_convert-automation.md.BhMzTkE5.lean.js → guides_convert-automation.md.D06eIzea.lean.js} +1 -1
  66. package/dist/docs/assets/{guides_github.md.CLLQJKRB.js → guides_github.md.Cdt1s2QC.js} +4 -4
  67. package/dist/docs/assets/{guides_github.md.CLLQJKRB.lean.js → guides_github.md.Cdt1s2QC.lean.js} +1 -1
  68. package/dist/docs/assets/{guides_human-in-the-loop.md.Cf8kIIqC.js → guides_human-in-the-loop.md.By1G2T3_.js} +1 -1
  69. package/dist/docs/assets/{guides_human-in-the-loop.md.Cf8kIIqC.lean.js → guides_human-in-the-loop.md.By1G2T3_.lean.js} +1 -1
  70. package/dist/docs/assets/{guides_mcp-oauth.md.CzEB6RaG.js → guides_mcp-oauth.md.Du0f7pGU.js} +1 -1
  71. package/dist/docs/assets/{guides_mcp-oauth.md.CzEB6RaG.lean.js → guides_mcp-oauth.md.Du0f7pGU.lean.js} +1 -1
  72. package/dist/docs/assets/{guides_opentelemetry.md.Csn7ZI25.js → guides_opentelemetry.md.bmPmkvJu.js} +1 -1
  73. package/dist/docs/assets/{guides_opentelemetry.md.Csn7ZI25.lean.js → guides_opentelemetry.md.bmPmkvJu.lean.js} +1 -1
  74. package/dist/docs/assets/{guides_slack.md.DP4H75WP.js → guides_slack.md.DiUmk_Oi.js} +5 -5
  75. package/dist/docs/assets/{guides_slack.md.DP4H75WP.lean.js → guides_slack.md.DiUmk_Oi.lean.js} +1 -1
  76. package/dist/docs/assets/{guides_webhooks.md.DB-r_er9.js → guides_webhooks.md.BpnIdO0i.js} +5 -6
  77. package/dist/docs/assets/{guides_webhooks.md.DB-r_er9.lean.js → guides_webhooks.md.BpnIdO0i.lean.js} +1 -1
  78. package/dist/docs/assets/{hillclimbing.md.yXqdlv2R.js → hillclimbing.md.ywF3yDAd.js} +1 -1
  79. package/dist/docs/assets/{hillclimbing.md.yXqdlv2R.lean.js → hillclimbing.md.ywF3yDAd.lean.js} +1 -1
  80. package/dist/docs/assets/index.md.BAaMXLFd.js +5 -0
  81. package/dist/docs/assets/{index.md.DhRHS_-L.lean.js → index.md.BAaMXLFd.lean.js} +1 -1
  82. package/dist/docs/assets/{quickstart.md.DZxBu44y.js → quickstart.md.DsrarzEg.js} +1 -1
  83. package/dist/docs/assets/{quickstart.md.DZxBu44y.lean.js → quickstart.md.DsrarzEg.lean.js} +1 -1
  84. package/dist/docs/assets/{reference_agent-config.md.CTWp4DnU.js → reference_agent-config.md.Bqylgw50.js} +1 -1
  85. package/dist/docs/assets/{reference_agent-config.md.CTWp4DnU.lean.js → reference_agent-config.md.Bqylgw50.lean.js} +1 -1
  86. package/dist/docs/assets/{reference_artifacts.md.BGG4bZo-.js → reference_artifacts.md.Dior32Qw.js} +1 -1
  87. package/dist/docs/assets/{reference_artifacts.md.BGG4bZo-.lean.js → reference_artifacts.md.Dior32Qw.lean.js} +1 -1
  88. package/dist/docs/assets/{reference_channels.md.CboFd5IH.js → reference_channels.md.DQZjCnyh.js} +2 -2
  89. package/dist/docs/assets/{reference_channels.md.CboFd5IH.lean.js → reference_channels.md.DQZjCnyh.lean.js} +1 -1
  90. package/dist/docs/assets/{reference_cli.md.TAaYU8br.js → reference_cli.md.B7GkAJRC.js} +8 -7
  91. package/dist/docs/assets/{reference_cli.md.TAaYU8br.lean.js → reference_cli.md.B7GkAJRC.lean.js} +1 -1
  92. package/dist/docs/assets/{reference_connections.md.Cu3N-S3Q.js → reference_connections.md.DYidrb-j.js} +5 -5
  93. package/dist/docs/assets/{reference_connections.md.Cu3N-S3Q.lean.js → reference_connections.md.DYidrb-j.lean.js} +1 -1
  94. package/dist/docs/assets/{reference_hooks.md.DJE5DXcT.js → reference_hooks.md.B9FSgdDe.js} +1 -1
  95. package/dist/docs/assets/{reference_hooks.md.DJE5DXcT.lean.js → reference_hooks.md.B9FSgdDe.lean.js} +1 -1
  96. package/dist/docs/assets/{reference_http-api.md.DMbdFGVQ.js → reference_http-api.md.CSHVobzG.js} +4 -4
  97. package/dist/docs/assets/{reference_http-api.md.DMbdFGVQ.lean.js → reference_http-api.md.CSHVobzG.lean.js} +1 -1
  98. package/dist/docs/assets/{reference_instructions.md.CgoV-YEb.js → reference_instructions.md.DhNCOl7r.js} +1 -1
  99. package/dist/docs/assets/{reference_instructions.md.CgoV-YEb.lean.js → reference_instructions.md.DhNCOl7r.lean.js} +1 -1
  100. package/dist/docs/assets/{reference_playground.md.CPZhfYaO.js → reference_playground.md.Dfb92yQf.js} +1 -1
  101. package/dist/docs/assets/{reference_playground.md.CPZhfYaO.lean.js → reference_playground.md.Dfb92yQf.lean.js} +1 -1
  102. package/dist/docs/assets/{reference_project-layout.md.D3MdHM2z.js → reference_project-layout.md.CwkSbEWT.js} +5 -20
  103. package/dist/docs/assets/reference_project-layout.md.CwkSbEWT.lean.js +1 -0
  104. package/dist/docs/assets/{reference_prompt.md.BaiweQxE.js → reference_prompt.md.DZUMtLPD.js} +1 -1
  105. package/dist/docs/assets/{reference_prompt.md.BaiweQxE.lean.js → reference_prompt.md.DZUMtLPD.lean.js} +1 -1
  106. package/dist/docs/assets/{reference_schedules.md.gmfYzf_I.js → reference_schedules.md.DNipebiG.js} +1 -1
  107. package/dist/docs/assets/{reference_schedules.md.gmfYzf_I.lean.js → reference_schedules.md.DNipebiG.lean.js} +1 -1
  108. package/dist/docs/assets/{reference_sessions.md.B0DdlM-K.js → reference_sessions.md.tUFzz98S.js} +1 -1
  109. package/dist/docs/assets/{reference_sessions.md.B0DdlM-K.lean.js → reference_sessions.md.tUFzz98S.lean.js} +1 -1
  110. package/dist/docs/assets/{reference_skills.md.BRF2nDv9.js → reference_skills.md.B5ZEuHfG.js} +1 -1
  111. package/dist/docs/assets/{reference_skills.md.BRF2nDv9.lean.js → reference_skills.md.B5ZEuHfG.lean.js} +1 -1
  112. package/dist/docs/assets/{reference_subagents.md.DSrGLIuB.js → reference_subagents.md.Xoav0AII.js} +1 -1
  113. package/dist/docs/assets/{reference_subagents.md.DSrGLIuB.lean.js → reference_subagents.md.Xoav0AII.lean.js} +1 -1
  114. package/dist/docs/assets/{reference_tools.md.DTg_kEsx.js → reference_tools.md.wpaJtHn6.js} +23 -3
  115. package/dist/docs/assets/{reference_tools.md.DTg_kEsx.lean.js → reference_tools.md.wpaJtHn6.lean.js} +1 -1
  116. package/dist/docs/assets/{scaffolding-agents.md.CiGsJ1aw.js → scaffolding-agents.md.CRDDUtYJ.js} +1 -1
  117. package/dist/docs/assets/{scaffolding-agents.md.CiGsJ1aw.lean.js → scaffolding-agents.md.CRDDUtYJ.lean.js} +1 -1
  118. package/dist/docs/assets/{storage.md.ks1u64_R.js → storage.md.JbjlHWZ6.js} +1 -1
  119. package/dist/docs/assets/{storage.md.ks1u64_R.lean.js → storage.md.JbjlHWZ6.lean.js} +1 -1
  120. package/dist/docs/assets/{style.kTsvp4pE.css → style.BRuM8477.css} +1 -1
  121. package/dist/docs/assets/{templates_agentic-owners.md.BkTLORaU.js → templates_agentic-owners.md.DSJSIpWU.js} +1 -1
  122. package/dist/docs/assets/{templates_agentic-owners.md.BkTLORaU.lean.js → templates_agentic-owners.md.DSJSIpWU.lean.js} +1 -1
  123. package/dist/docs/assets/{templates_demo.md.Bgd6MBaZ.js → templates_demo.md.DhFcWN6j.js} +1 -1
  124. package/dist/docs/assets/{templates_demo.md.Bgd6MBaZ.lean.js → templates_demo.md.DhFcWN6j.lean.js} +1 -1
  125. package/dist/docs/assets/{templates_pr-autofixer.md.DcmoeUNZ.js → templates_pr-autofixer.md.1HAR3RXE.js} +1 -1
  126. package/dist/docs/assets/{templates_pr-autofixer.md.DcmoeUNZ.lean.js → templates_pr-autofixer.md.1HAR3RXE.lean.js} +1 -1
  127. package/dist/docs/assets/{templates_security-reviewer.md.C0yIUaYs.js → templates_security-reviewer.md.ByFyRta2.js} +1 -1
  128. package/dist/docs/assets/{templates_security-reviewer.md.C0yIUaYs.lean.js → templates_security-reviewer.md.ByFyRta2.lean.js} +1 -1
  129. package/dist/docs/assets/{templates_triage.md.DWuQ1bZz.js → templates_triage.md.CVlpctKS.js} +2 -2
  130. package/dist/docs/assets/{templates_triage.md.DWuQ1bZz.lean.js → templates_triage.md.CVlpctKS.lean.js} +1 -1
  131. package/dist/docs/assets/troubleshooting.md.DYECCZiJ.js +1 -0
  132. package/dist/docs/assets/{troubleshooting.md.KgmmaCgw.lean.js → troubleshooting.md.DYECCZiJ.lean.js} +1 -1
  133. package/dist/docs/building-with-agents.html +7 -7
  134. package/dist/docs/concepts.html +7 -7
  135. package/dist/docs/deployment.html +11 -10
  136. package/dist/docs/evals.html +8 -8
  137. package/dist/docs/example-agents/approval-buddy.html +7 -7
  138. package/dist/docs/example-agents/benny.html +7 -7
  139. package/dist/docs/example-agents/bugbot.html +7 -7
  140. package/dist/docs/example-agents/codebase-wiki.html +7 -7
  141. package/dist/docs/example-agents/codeowners-review.html +7 -7
  142. package/dist/docs/example-agents/concierge.html +7 -7
  143. package/dist/docs/example-agents/fsd.html +7 -7
  144. package/dist/docs/example-agents/index.html +7 -7
  145. package/dist/docs/example-agents/knowledge-base.html +7 -7
  146. package/dist/docs/example-agents/oncall.html +7 -7
  147. package/dist/docs/example-agents/security-reviewer.html +10 -10
  148. package/dist/docs/example-agents/slack-agent.html +7 -7
  149. package/dist/docs/example-agents/weather-agent.html +12 -12
  150. package/dist/docs/guides/agent-to-agent.html +7 -7
  151. package/dist/docs/guides/cloud-runtime.html +7 -7
  152. package/dist/docs/guides/convert-automation.html +7 -7
  153. package/dist/docs/guides/github.html +9 -9
  154. package/dist/docs/guides/human-in-the-loop.html +7 -7
  155. package/dist/docs/guides/mcp-oauth.html +7 -7
  156. package/dist/docs/guides/opentelemetry.html +7 -7
  157. package/dist/docs/guides/slack.html +10 -10
  158. package/dist/docs/guides/webhooks.html +10 -11
  159. package/dist/docs/hashmap.json +1 -1
  160. package/dist/docs/hillclimbing.html +7 -7
  161. package/dist/docs/index.html +8 -8
  162. package/dist/docs/quickstart.html +7 -7
  163. package/dist/docs/reference/agent-config.html +7 -7
  164. package/dist/docs/reference/artifacts.html +7 -7
  165. package/dist/docs/reference/channels.html +8 -8
  166. package/dist/docs/reference/cli.html +13 -12
  167. package/dist/docs/reference/connections.html +10 -10
  168. package/dist/docs/reference/hooks.html +7 -7
  169. package/dist/docs/reference/http-api.html +10 -10
  170. package/dist/docs/reference/instructions.html +7 -7
  171. package/dist/docs/reference/playground.html +7 -7
  172. package/dist/docs/reference/project-layout.html +10 -25
  173. package/dist/docs/reference/prompt.html +7 -7
  174. package/dist/docs/reference/schedules.html +7 -7
  175. package/dist/docs/reference/sessions.html +7 -7
  176. package/dist/docs/reference/skills.html +7 -7
  177. package/dist/docs/reference/subagents.html +7 -7
  178. package/dist/docs/reference/tools.html +29 -9
  179. package/dist/docs/scaffolding-agents.html +7 -7
  180. package/dist/docs/storage.html +7 -7
  181. package/dist/docs/templates/agentic-owners.html +7 -7
  182. package/dist/docs/templates/demo.html +7 -7
  183. package/dist/docs/templates/pr-autofixer.html +7 -7
  184. package/dist/docs/templates/security-reviewer.html +7 -7
  185. package/dist/docs/templates/triage.html +8 -8
  186. package/dist/docs/troubleshooting.html +7 -7
  187. package/dist/evals.d.ts +1 -1
  188. package/dist/evals.js +1 -1
  189. package/dist/hooks.d.ts +1 -1
  190. package/dist/hooks.js +1 -1
  191. package/dist/index.d.ts +2 -2
  192. package/dist/index.js +2 -2
  193. package/dist/internal/cli-convert-automation.d.ts +1 -1
  194. package/dist/internal/cli-convert-automation.js +1 -1
  195. package/dist/internal/cli-cursor.d.ts +12 -4
  196. package/dist/internal/cli-cursor.d.ts.map +1 -1
  197. package/dist/internal/cli-cursor.js +11 -4
  198. package/dist/internal/cli-deploy.d.ts.map +1 -1
  199. package/dist/internal/cli-deploy.js +21 -3
  200. package/dist/internal/convert-automation/convert-workflow.d.ts +1 -1
  201. package/dist/internal/convert-automation/convert-workflow.js +9 -9
  202. package/dist/internal/convert-automation/types.d.ts +1 -1
  203. package/dist/internal/convert-automation/types.js +1 -1
  204. package/dist/internal/cursor/backend-client.d.ts +9 -1
  205. package/dist/internal/cursor/backend-client.d.ts.map +1 -1
  206. package/dist/internal/cursor/backend-client.js +19 -6
  207. package/dist/internal/cursor/credentials.d.ts +35 -9
  208. package/dist/internal/cursor/credentials.d.ts.map +1 -1
  209. package/dist/internal/cursor/credentials.js +92 -39
  210. package/dist/internal/cursor-agent-template.d.ts +1 -1
  211. package/dist/internal/cursor-agent-template.d.ts.map +1 -1
  212. package/dist/internal/cursor-agent-template.js +1 -0
  213. package/dist/internal/deploy-client.d.ts +18 -0
  214. package/dist/internal/deploy-client.d.ts.map +1 -1
  215. package/dist/internal/deploy-client.js +25 -1
  216. package/dist/internal/deploy-manifest.d.ts.map +1 -1
  217. package/dist/internal/deploy-manifest.js +5 -1
  218. package/dist/internal/discovery.d.ts +5 -1
  219. package/dist/internal/discovery.d.ts.map +1 -1
  220. package/dist/internal/discovery.js +17 -1
  221. package/dist/internal/distribution.d.ts +18 -0
  222. package/dist/internal/distribution.d.ts.map +1 -1
  223. package/dist/internal/distribution.js +19 -0
  224. package/dist/internal/eval-runner.js +1 -1
  225. package/dist/internal/grokbot/runner.d.ts +5 -2
  226. package/dist/internal/grokbot/runner.d.ts.map +1 -1
  227. package/dist/internal/grokbot/runner.js +10 -6
  228. package/dist/internal/http-channel.d.ts +2 -2
  229. package/dist/internal/http-channel.d.ts.map +1 -1
  230. package/dist/internal/http-channel.js +11 -31
  231. package/dist/internal/init-project.d.ts.map +1 -1
  232. package/dist/internal/init-project.js +10 -1
  233. package/dist/internal/sdk-runner.d.ts +5 -0
  234. package/dist/internal/sdk-runner.d.ts.map +1 -1
  235. package/dist/internal/sdk-runner.js +10 -5
  236. package/dist/internal/server.d.ts.map +1 -1
  237. package/dist/internal/server.js +80 -36
  238. package/dist/internal/session-engine.d.ts +8 -0
  239. package/dist/internal/session-engine.d.ts.map +1 -1
  240. package/dist/internal/session-engine.js +47 -5
  241. package/dist/playground/assets/index-D9N7-q97.css +1 -0
  242. package/dist/playground/assets/{index-BmiIjFlM.js → index-DDvyC2z6.js} +49 -49
  243. package/dist/playground/index.html +2 -2
  244. package/dist/reminders.d.ts +1 -1
  245. package/dist/reminders.js +1 -1
  246. package/dist/schedules.d.ts +1 -1
  247. package/dist/schedules.js +1 -1
  248. package/dist/skills.d.ts +1 -1
  249. package/dist/skills.js +1 -1
  250. package/dist/storage.d.ts +1 -1
  251. package/dist/storage.js +1 -1
  252. package/dist/tools.d.ts +1 -1
  253. package/dist/tools.js +1 -1
  254. package/dist/types.d.ts +10 -7
  255. package/dist/types.d.ts.map +1 -1
  256. package/dist/types.js +1 -1
  257. package/docs/README.md +3 -1
  258. package/docs/concepts.md +2 -1
  259. package/docs/deployment.md +9 -6
  260. package/docs/evals.md +1 -5
  261. package/docs/example-agents/codebase-wiki.md +2 -3
  262. package/docs/example-agents/fsd.md +1 -1
  263. package/docs/example-agents/index.md +2 -2
  264. package/docs/example-agents/knowledge-base.md +3 -3
  265. package/docs/example-agents/security-reviewer.md +17 -48
  266. package/docs/example-agents/weather-agent.md +14 -45
  267. package/docs/guides/github.md +7 -4
  268. package/docs/guides/slack.md +7 -2
  269. package/docs/guides/webhooks.md +12 -15
  270. package/docs/reference/channels.md +4 -0
  271. package/docs/reference/cli.md +21 -7
  272. package/docs/reference/connections.md +13 -32
  273. package/docs/reference/http-api.md +14 -9
  274. package/docs/reference/project-layout.md +5 -20
  275. package/docs/reference/tools.md +51 -3
  276. package/docs/scaffolding-agents.md +2 -0
  277. package/docs/templates/triage.md +3 -5
  278. package/docs/troubleshooting.md +1 -1
  279. package/package.json +2 -1
  280. package/skills/create-agent/SKILL.md +6 -7
  281. package/skills/framework-map/SKILL.md +6 -6
  282. package/skills/setup-slack/SKILL.md +1 -1
  283. package/src/ab.ts +1 -1
  284. package/src/artifacts.ts +1 -1
  285. package/src/bin/agent-serve.ts +20 -6
  286. package/src/channels/slack/channel-watch.ts +1 -1
  287. package/src/channels/slack/slack-channel.ts +1 -1
  288. package/src/channels/slack/types.ts +2 -4
  289. package/src/channels.ts +1 -1
  290. package/src/connections.ts +1 -1
  291. package/src/evals.ts +1 -1
  292. package/src/hooks.ts +1 -1
  293. package/src/index.ts +2 -2
  294. package/src/internal/cli-convert-automation.ts +1 -1
  295. package/src/internal/cli-cursor.ts +18 -5
  296. package/src/internal/cli-deploy.ts +27 -7
  297. package/src/internal/convert-automation/convert-workflow.ts +9 -9
  298. package/src/internal/convert-automation/types.ts +1 -1
  299. package/src/internal/cursor/backend-client.ts +29 -4
  300. package/src/internal/cursor/credentials.ts +87 -24
  301. package/src/internal/cursor-agent-template.ts +1 -0
  302. package/src/internal/deploy-client.ts +40 -1
  303. package/src/internal/deploy-manifest.ts +10 -1
  304. package/src/internal/discovery.ts +21 -1
  305. package/src/internal/distribution.ts +31 -0
  306. package/src/internal/eval-runner.ts +1 -1
  307. package/src/internal/grokbot/runner.ts +15 -6
  308. package/src/internal/http-channel.ts +14 -41
  309. package/src/internal/init-project.ts +13 -1
  310. package/src/internal/sdk-runner.ts +10 -4
  311. package/src/internal/server.ts +95 -33
  312. package/src/internal/session-engine.ts +58 -8
  313. package/src/reminders.ts +1 -1
  314. package/src/schedules.ts +1 -1
  315. package/src/skills.ts +1 -1
  316. package/src/storage.ts +1 -1
  317. package/src/tools.ts +1 -1
  318. package/src/types.ts +10 -7
  319. package/templates/security-help/README.md +37 -0
  320. package/templates/security-help/agent/agent.ts +18 -0
  321. package/templates/security-help/agent/channels/github.ts +13 -0
  322. package/templates/security-help/agent/channels/slack.ts +89 -0
  323. package/templates/security-help/agent/instructions.md +20 -0
  324. package/templates/security-help/agent/knowledge/faq/approvals.md +5 -0
  325. package/templates/security-help/agent/knowledge/faq/channels.md +6 -0
  326. package/templates/security-help/agent/knowledge/faq/phishing.md +10 -0
  327. package/templates/security-help/agent/lib/pr-first-pass.ts +42 -0
  328. package/templates/security-help/agent/lib/repos.ts +5 -0
  329. package/templates/security-help/agent/skills/access-request.md +10 -0
  330. package/templates/security-help/agent/skills/security-first-pass.md +15 -0
  331. package/templates/security-help/agent/skills/security-playbooks.md +12 -0
  332. package/templates/security-help/agent/skills/security-pr-first-pass.md +12 -0
  333. package/templates/security-help/evals/evals.config.ts +5 -0
  334. package/templates/security-help/evals/security-help.eval.ts +53 -0
  335. package/templates/security-help/init.json +31 -0
  336. package/templates/security-help/package.json +18 -0
  337. package/templates/security-help/tsconfig.json +12 -0
  338. package/templates/triage/agent/channels/webhook.ts +2 -2
  339. package/dist/docs/assets/chunks/@localSearchIndexroot.CxCtxfDE.js +0 -1
  340. package/dist/docs/assets/chunks/theme.S57OeOLA.js +0 -2
  341. package/dist/docs/assets/example-agents_index.md.xmJ87d_3.js +0 -2
  342. package/dist/docs/assets/example-agents_weather-agent.md.DC3lINjo.lean.js +0 -1
  343. package/dist/docs/assets/index.md.DhRHS_-L.js +0 -5
  344. package/dist/docs/assets/reference_project-layout.md.D3MdHM2z.lean.js +0 -1
  345. package/dist/docs/assets/troubleshooting.md.KgmmaCgw.js +0 -1
  346. package/dist/playground/assets/index-DQGZnAI0.css +0 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Pure Workflow → agentkit project converter.
2
+ * Pure Workflow → agentsdk project converter.
3
3
  *
4
4
  * Maps an exported Cursor automation (proto3 workflow JSON + enriched MCP
5
5
  * server list) to project files, warnings, and setup steps. No I/O, no
@@ -119,7 +119,7 @@ function renderInstructions(automation, workflow, exportedAt, warnings) {
119
119
  return `${header}\n\n${heading}${sanitizePromptText((_b = prompt.prompt) !== null && _b !== void 0 ? _b : "", warnings)}\n`;
120
120
  }
121
121
  /**
122
- * Strip Cursor-backend prompt markup that means nothing in agentkit:
122
+ * Strip Cursor-backend prompt markup that means nothing in agentsdk:
123
123
  * `@[label](action:...)` action tokens become their label text, and
124
124
  * unresolvable `%%INLINECODE<n>%%` storage placeholders are flagged (their
125
125
  * content is not in the export).
@@ -662,7 +662,7 @@ function emitSlackChannel(automation, triggers, slugs, out) {
662
662
  const kind = trigger.slackChannelCreated !== undefined
663
663
  ? "channel-created"
664
664
  : "reaction-added";
665
- out.warnings.push(`Slack ${kind} trigger has no agentkit equivalent — its config is inlined as a comment in ${path}; handle the Slack event yourself on a dedicated Socket Mode app.`);
665
+ out.warnings.push(`Slack ${kind} trigger has no agentsdk equivalent — its config is inlined as a comment in ${path}; handle the Slack event yourself on a dedicated Socket Mode app.`);
666
666
  }
667
667
  let reactionDropped = false;
668
668
  for (const watch of watches) {
@@ -679,7 +679,7 @@ function emitSlackChannel(automation, triggers, slugs, out) {
679
679
  }
680
680
  }
681
681
  if (reactionDropped) {
682
- out.warnings.push("The Slack trigger marked triggering messages with a completion reaction; agentkit has no completion-reaction option, so that signal is lost unless agent/instructions.md tells the agent to add the reaction itself via Slack tools.");
682
+ out.warnings.push("The Slack trigger marked triggering messages with a completion reaction; agentsdk has no completion-reaction option, so that signal is lost unless agent/instructions.md tells the agent to add the reaction itself via Slack tools.");
683
683
  }
684
684
  if (socketMode) {
685
685
  out.setupSteps.push(`Slack channel-watch / reaction / channel-created triggers need a dedicated Socket Mode Slack app (not the Cursor connection): run \`${CLI_COMMAND_NAME} slack create --channel-posts\`, then finish in the dashboard wizard.`);
@@ -708,8 +708,8 @@ function emitSlackChannel(automation, triggers, slugs, out) {
708
708
  .blockUnauthenticatedSlackUsers !== true);
709
709
  if (blocksUnauthenticated) {
710
710
  out.warnings.push(includeBotPosts
711
- ? "Some Slack watches only fired for authenticated Cursor users while others allowed anyone; agentkit has one bot-post setting per channel, so the export keeps bot posts ENABLED (the open watches depend on them) and the authenticated-only watches lose both their sender gate and their bot exclusion. Split the channels or add an onChannelPost gate."
712
- : "The Slack trigger only fired for authenticated Cursor users (linked accounts on the owning team); agentkit has no equivalent sender gate, so the exported watch dispatches for ANY channel member (bot posts stay excluded). Add an onChannelPost gate in the channel if that matters.");
711
+ ? "Some Slack watches only fired for authenticated Cursor users while others allowed anyone; agentsdk has one bot-post setting per channel, so the export keeps bot posts ENABLED (the open watches depend on them) and the authenticated-only watches lose both their sender gate and their bot exclusion. Split the channels or add an onChannelPost gate."
712
+ : "The Slack trigger only fired for authenticated Cursor users (linked accounts on the owning team); agentsdk has no equivalent sender gate, so the exported watch dispatches for ANY channel member (bot posts stay excluded). Add an onChannelPost gate in the channel if that matters.");
713
713
  }
714
714
  const engagement = [];
715
715
  if (allow.length > 0) {
@@ -912,8 +912,8 @@ const ACTION_STEPS = {
912
912
  requestReviewers: "Verify: request_reviewers — no built-in equivalent; request reviewers via ctx.github in a github channel hook.",
913
913
  approvePr: 'Verify: approve_pr — PR approval needs githubChannel "pr-write" plus explicit approval guidance in agent/instructions.md.',
914
914
  resolveReviewThreads: "Verify: resolve_review_threads — no built-in equivalent; resolve threads via the GitHub GraphQL API in a hook or tool.",
915
- microsoftTeams: "Verify: microsoft_teams post — agentkit has no Teams channel; wire the Microsoft Teams API yourself.",
916
- readMicrosoftTeams: "Verify: read_microsoft_teams — agentkit has no Teams tools; wire the Microsoft Teams API yourself.",
915
+ microsoftTeams: "Verify: microsoft_teams post — agentsdk has no Teams channel; wire the Microsoft Teams API yourself.",
916
+ readMicrosoftTeams: "Verify: read_microsoft_teams — agentsdk has no Teams tools; wire the Microsoft Teams API yourself.",
917
917
  };
918
918
  function slackActionStep(action, { hasSlackChannel, hasSlackConnection }) {
919
919
  const channels = dedupe(slackChannelList(action));
@@ -957,7 +957,7 @@ function behaviorSteps(workflow, warnings, slack) {
957
957
  }
958
958
  const disabled = (_c = workflow.disabledDefaultTools) !== null && _c !== void 0 ? _c : [];
959
959
  if (disabled.length > 0) {
960
- steps.push(`Verify: disabled_default_tools (${disabled.join(", ")}) — agentkit has no default automation tools; enforce the equivalent restriction in agent/instructions.md.`);
960
+ steps.push(`Verify: disabled_default_tools (${disabled.join(", ")}) — agentsdk has no default automation tools; enforce the equivalent restriction in agent/instructions.md.`);
961
961
  }
962
962
  return steps;
963
963
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Types for `convertWorkflow` — the pure automation → agentkit project
2
+ * Types for `convertWorkflow` — the pure automation → agentsdk project
3
3
  * converter behind `agent-serve convert-automation`.
4
4
  *
5
5
  * The workflow arrives as generic proto3 JSON (lowerCamelCase field names,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Types for `convertWorkflow` — the pure automation → agentkit project
2
+ * Types for `convertWorkflow` — the pure automation → agentsdk project
3
3
  * converter behind `agent-serve convert-automation`.
4
4
  *
5
5
  * The workflow arrives as generic proto3 JSON (lowerCamelCase field names,
@@ -87,18 +87,26 @@ export interface AccountMcpCallResult {
87
87
  export interface CursorBackendClientOptions {
88
88
  backendUrl: string;
89
89
  apiKey: string;
90
+ /**
91
+ * Re-read the key on each authenticated call. Hosted freeze listens
92
+ * unsigned and the binder drops the key after restore; a constructor-frozen
93
+ * key would miss that bind.
94
+ */
95
+ getApiKey?: () => string;
90
96
  logger?: (line: string) => void;
91
97
  /** Test seam; defaults to global fetch. */
92
98
  fetchImpl?: typeof fetch;
93
99
  }
94
100
  export declare class CursorBackendClient {
95
101
  private readonly backendUrl;
96
- private readonly apiKey;
102
+ private readonly resolveApiKey;
97
103
  private readonly logger;
98
104
  private readonly fetchImpl;
99
105
  private token;
100
106
  private tokenExchange;
107
+ private lastExchangedApiKey;
101
108
  constructor(options: CursorBackendClientOptions);
109
+ private currentApiKey;
102
110
  /** Who this API key acts as. */
103
111
  getMe(): Promise<CursorIdentity>;
104
112
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"backend-client.d.ts","sourceRoot":"","sources":["../../../src/internal/cursor/backend-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAczD,qBAAa,kBAAmB,SAAQ,KAAK;IAGzC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM;IACxB,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM;IAHhC,YACE,OAAO,EAAE,MAAM,EACN,MAAM,CAAC,EAAE,MAAM,YAAA,EACf,YAAY,CAAC,EAAE,MAAM,YAAA,EAI/B;CACF;AAMD,QAAA,MAAM,mBAAmB,EAAE,CAAC,CAAC,SAAS,CACpC;IACE,MAAM,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IACnC,KAAK,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAClC,SAAS,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IACtC,QAAQ,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IACrC,MAAM,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IACnC,QAAQ,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;CACtC,EACD,OAAO,CAQP,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAMjE,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB;AAiCD,kEA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;GAMG;AACH,wBAAsB,sBAAsB,CAAC,IAAI,EAAE;IACjD,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,sEAAsE;IACtE,MAAM,EAAE,MAAM,CAAC;IACf,uEAAuE;IACvE,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;CAC1B,GAAG,OAAO,CAAC,IAAI,CAAC,CAmChB"}
@@ -181,13 +181,16 @@ function parseRpcResponse(method, response) {
181
181
  }
182
182
  export class CursorBackendClient {
183
183
  constructor(options) {
184
- var _a, _b;
184
+ var _a, _b, _c;
185
185
  this.backendUrl = options.backendUrl.endsWith("/")
186
186
  ? options.backendUrl.slice(0, -1)
187
187
  : options.backendUrl;
188
- this.apiKey = options.apiKey;
189
- this.logger = (_a = options.logger) !== null && _a !== void 0 ? _a : (() => { });
190
- this.fetchImpl = (_b = options.fetchImpl) !== null && _b !== void 0 ? _b : fetch;
188
+ this.resolveApiKey = (_a = options.getApiKey) !== null && _a !== void 0 ? _a : (() => options.apiKey);
189
+ this.logger = (_b = options.logger) !== null && _b !== void 0 ? _b : (() => { });
190
+ this.fetchImpl = (_c = options.fetchImpl) !== null && _c !== void 0 ? _c : fetch;
191
+ }
192
+ currentApiKey() {
193
+ return this.resolveApiKey().trim();
191
194
  }
192
195
  /** Who this API key acts as. */
193
196
  getMe() {
@@ -291,7 +294,7 @@ export class CursorBackendClient {
291
294
  method: "POST",
292
295
  headers: {
293
296
  "content-type": "application/json",
294
- authorization: `Bearer ${this.apiKey}`,
297
+ authorization: `Bearer ${this.currentApiKey()}`,
295
298
  },
296
299
  body: JSON.stringify({ repos: [...repos], permissions }),
297
300
  signal: AbortSignal.timeout(30000),
@@ -362,6 +365,14 @@ export class CursorBackendClient {
362
365
  * when none is cached or it is near expiry.
363
366
  */
364
367
  getAccessToken() {
368
+ const apiKey = this.currentApiKey();
369
+ if (apiKey === "") {
370
+ return Promise.reject(new CursorBackendError("The Cursor backend client has no API key yet. Bind CURSOR_API_KEY or CURSOR_API_KEY_FILE before authenticated calls."));
371
+ }
372
+ if (this.lastExchangedApiKey !== apiKey) {
373
+ this.token = undefined;
374
+ this.tokenExchange = undefined;
375
+ }
365
376
  if (this.token !== undefined &&
366
377
  Date.now() < this.token.expiresAtMs - TOKEN_EXPIRY_LEEWAY_MS) {
367
378
  return Promise.resolve(this.token.value);
@@ -376,13 +387,14 @@ export class CursorBackendClient {
376
387
  }
377
388
  exchangeApiKey() {
378
389
  return __awaiter(this, void 0, void 0, function* () {
390
+ const apiKey = this.currentApiKey();
379
391
  let response;
380
392
  try {
381
393
  response = yield this.fetchImpl(`${this.backendUrl}${EXCHANGE_PATH}`, {
382
394
  method: "POST",
383
395
  headers: {
384
396
  "content-type": "application/json",
385
- authorization: `Bearer ${this.apiKey}`,
397
+ authorization: `Bearer ${apiKey}`,
386
398
  },
387
399
  body: "{}",
388
400
  signal: AbortSignal.timeout(30000),
@@ -405,6 +417,7 @@ export class CursorBackendClient {
405
417
  value: body.data.accessToken,
406
418
  expiresAtMs: jwtExpiryMs(body.data.accessToken),
407
419
  };
420
+ this.lastExchangedApiKey = apiKey;
408
421
  this.logger("[agent-sdk] cursor account: minted a fresh access token");
409
422
  return body.data.accessToken;
410
423
  });
@@ -9,6 +9,10 @@
9
9
  * dashboard-revocable user API key — only the key is stored.
10
10
  * - `CURSOR_API_KEY` (or `serve({ apiKey })`) wins over the stored key, so
11
11
  * CI and hosted deployments stay env-driven.
12
+ * - `CURSOR_API_KEY_FILE` (or the hosted default path) is next: freeze bind
13
+ * drops the key at task time without restarting July.
14
+ * - Stored `july login` is last. Same order for hosted and self-hosted:
15
+ * option → env → file → login.
12
16
  *
13
17
  * There is deliberately no session-token storage, refresh-token rotation, or
14
18
  * cross-tool credential sharing here: short-lived access tokens are minted
@@ -27,10 +31,11 @@ export declare const DEFAULT_CURSOR_EXTERNAL_API_URL = "https://api.cursor.com";
27
31
  export declare function cursorBackendUrl(): string;
28
32
  /**
29
33
  * External API base URL for routes served only by the external-api
30
- * microlith (`/internal/agent-serve/*`, engine aliases). In production
31
- * these are mounted on api.cursor.com and 404 on api2.cursor.sh, so the
32
- * deploy surface needs its own default. `CURSOR_API_BASE_URL` still
33
- * overrides everything for local dev, where one server mounts all routes.
34
+ * microlith (`/internal/agent-serve/*`, `/v0/grokbot/*`, engine aliases).
35
+ * In production these are mounted on api.cursor.com and 404 on
36
+ * api2.cursor.sh, so the deploy surface needs its own default.
37
+ * `CURSOR_API_BASE_URL` still overrides everything for local dev, where
38
+ * one server mounts all routes.
34
39
  */
35
40
  export declare function cursorExternalApiUrl(): string;
36
41
  /** Website base URL for the login deep link (`CURSOR_WEBSITE_URL` override). */
@@ -48,20 +53,41 @@ export type StoredCredentials = z.infer<typeof storedCredentialsSchema>;
48
53
  export declare function configDirPath(): string;
49
54
  /** `<configDir>/credentials.json` (0600). */
50
55
  export declare function credentialsFilePath(): string;
56
+ export declare function readStoredCredentialsSync(): StoredCredentials | undefined;
51
57
  export declare function readStoredCredentials(): Promise<StoredCredentials | undefined>;
52
58
  export declare function writeStoredCredentials(credentials: StoredCredentials): Promise<void>;
53
59
  export declare function clearStoredCredentials(): Promise<boolean>;
54
- export type ApiKeySource = "option" | "env" | "login";
60
+ export type ApiKeySource = "option" | "env" | "file" | "login";
55
61
  export interface ResolvedApiKey {
56
62
  apiKey: string;
57
63
  source: ApiKeySource;
58
64
  backendUrl: string;
59
65
  }
60
66
  /**
61
- * Resolve the account API key for `backendUrl` (defaults to the active
62
- * backend): explicit option `CURSOR_API_KEY` stored login. A stored key
63
- * minted against a different backend is ignored rather than sent to the
64
- * wrong host.
67
+ * Hosted task-bind path. Not a secret: the snapshot may name this path.
68
+ * The binder writes the key here after restore; July re-reads on each use.
69
+ * Override with `CURSOR_API_KEY_FILE`. A missing file is unsigned self-hosted
70
+ * then uses `CURSOR_API_KEY` or stored login.
71
+ */
72
+ export declare const DEFAULT_CURSOR_API_KEY_FILE: string;
73
+ /**
74
+ * Read `CURSOR_API_KEY_FILE` (or {@link DEFAULT_CURSOR_API_KEY_FILE} when
75
+ * unset). Missing/empty files are unsigned, not an error — freeze bake
76
+ * listens before the binder drops the key; self-hosted falls through to
77
+ * env or login.
78
+ */
79
+ export declare function readApiKeyFromFile(filePath?: string): string | undefined;
80
+ /**
81
+ * First present source wins. We define the order; operators do not.
82
+ * `--api-key` / `serve({ apiKey })` → `CURSOR_API_KEY` → `CURSOR_API_KEY_FILE`
83
+ * (hosted default path if unset) → stored `july login`.
84
+ */
85
+ export declare function resolveApiKeySync(options?: {
86
+ apiKey?: string;
87
+ backendUrl?: string;
88
+ }): ResolvedApiKey | undefined;
89
+ /**
90
+ * {@link resolveApiKeySync} as a Promise for call sites that already await.
65
91
  */
66
92
  export declare function resolveApiKey(options?: {
67
93
  apiKey?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../../src/internal/cursor/credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAMH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,0BAA0B,2BAA2B,CAAC;AACnE,eAAO,MAAM,+BAA+B,2BAA2B,CAAC;AAGxE;;;;;;GAMG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAMzC;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAI7C;AAED,gFAAgF;AAChF,wBAAgB,gBAAgB,IAAI,MAAM,CAIzC;AAUD,QAAA,MAAM,uBAAuB,EAAE,CAAC,CAAC,SAAS,CACxC;IAAE,UAAU,EAAE,CAAC,CAAC,SAAS,CAAC;IAAC,MAAM,EAAE,CAAC,CAAC,SAAS,CAAA;CAAE,EAChD,OAAO,CAKP,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE;;;;GAIG;AACH,wBAAgB,aA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AM,MAAM,eAAe,GACvB;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GAC5C;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE,GACvB;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE,GACvB;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1C;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,4DAA4D;IAC5D,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,2CAA2C;IAC3C,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;IACzB,uEAAuE;IACvE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,OAAO,CAAC,eAAe,CAAC,CAmG3B"}
@@ -9,6 +9,10 @@
9
9
  * dashboard-revocable user API key — only the key is stored.
10
10
  * - `CURSOR_API_KEY` (or `serve({ apiKey })`) wins over the stored key, so
11
11
  * CI and hosted deployments stay env-driven.
12
+ * - `CURSOR_API_KEY_FILE` (or the hosted default path) is next: freeze bind
13
+ * drops the key at task time without restarting July.
14
+ * - Stored `july login` is last. Same order for hosted and self-hosted:
15
+ * option → env → file → login.
12
16
  *
13
17
  * There is deliberately no session-token storage, refresh-token rotation, or
14
18
  * cross-tool credential sharing here: short-lived access tokens are minted
@@ -24,6 +28,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
24
28
  });
25
29
  };
26
30
  import { createHash, randomBytes, randomUUID } from "node:crypto";
31
+ import { readFileSync } from "node:fs";
27
32
  import { chmod, mkdir, readFile, rm, writeFile } from "node:fs/promises";
28
33
  import { homedir } from "node:os";
29
34
  import { dirname, join } from "node:path";
@@ -45,10 +50,11 @@ export function cursorBackendUrl() {
45
50
  }
46
51
  /**
47
52
  * External API base URL for routes served only by the external-api
48
- * microlith (`/internal/agent-serve/*`, engine aliases). In production
49
- * these are mounted on api.cursor.com and 404 on api2.cursor.sh, so the
50
- * deploy surface needs its own default. `CURSOR_API_BASE_URL` still
51
- * overrides everything for local dev, where one server mounts all routes.
53
+ * microlith (`/internal/agent-serve/*`, `/v0/grokbot/*`, engine aliases).
54
+ * In production these are mounted on api.cursor.com and 404 on
55
+ * api2.cursor.sh, so the deploy surface needs its own default.
56
+ * `CURSOR_API_BASE_URL` still overrides everything for local dev, where
57
+ * one server mounts all routes.
52
58
  */
53
59
  export function cursorExternalApiUrl() {
54
60
  var _a;
@@ -83,6 +89,33 @@ export function configDirPath() {
83
89
  export function credentialsFilePath() {
84
90
  return join(configDirPath(), "credentials.json");
85
91
  }
92
+ function parseStoredCredentialsJson(raw) {
93
+ let parsed;
94
+ try {
95
+ parsed = JSON.parse(raw);
96
+ }
97
+ catch (_a) {
98
+ return undefined;
99
+ }
100
+ const credentials = storedCredentialsSchema.safeParse(parsed);
101
+ if (!credentials.success) {
102
+ return undefined;
103
+ }
104
+ return {
105
+ backendUrl: trimTrailingSlash(credentials.data.backendUrl),
106
+ apiKey: credentials.data.apiKey,
107
+ };
108
+ }
109
+ export function readStoredCredentialsSync() {
110
+ let raw;
111
+ try {
112
+ raw = readFileSync(credentialsFilePath(), "utf8");
113
+ }
114
+ catch (_a) {
115
+ return undefined;
116
+ }
117
+ return parseStoredCredentialsJson(raw);
118
+ }
86
119
  export function readStoredCredentials() {
87
120
  return __awaiter(this, void 0, void 0, function* () {
88
121
  let raw;
@@ -92,22 +125,7 @@ export function readStoredCredentials() {
92
125
  catch (_a) {
93
126
  return undefined;
94
127
  }
95
- let parsed;
96
- try {
97
- parsed = JSON.parse(raw);
98
- }
99
- catch (_b) {
100
- // Corrupt file — treat as signed out; login rewrites it.
101
- return undefined;
102
- }
103
- const credentials = storedCredentialsSchema.safeParse(parsed);
104
- if (!credentials.success) {
105
- return undefined;
106
- }
107
- return {
108
- backendUrl: trimTrailingSlash(credentials.data.backendUrl),
109
- apiKey: credentials.data.apiKey,
110
- };
128
+ return parseStoredCredentialsJson(raw);
111
129
  });
112
130
  }
113
131
  export function writeStoredCredentials(credentials) {
@@ -133,31 +151,66 @@ export function clearStoredCredentials() {
133
151
  });
134
152
  }
135
153
  /**
136
- * Resolve the account API key for `backendUrl` (defaults to the active
137
- * backend): explicit option `CURSOR_API_KEY` stored login. A stored key
138
- * minted against a different backend is ignored rather than sent to the
139
- * wrong host.
154
+ * Hosted task-bind path. Not a secret: the snapshot may name this path.
155
+ * The binder writes the key here after restore; July re-reads on each use.
156
+ * Override with `CURSOR_API_KEY_FILE`. A missing file is unsigned self-hosted
157
+ * then uses `CURSOR_API_KEY` or stored login.
158
+ */
159
+ export const DEFAULT_CURSOR_API_KEY_FILE = "/run/cursor/secrets/CURSOR_API_KEY";
160
+ /**
161
+ * Read `CURSOR_API_KEY_FILE` (or {@link DEFAULT_CURSOR_API_KEY_FILE} when
162
+ * unset). Missing/empty files are unsigned, not an error — freeze bake
163
+ * listens before the binder drops the key; self-hosted falls through to
164
+ * env or login.
165
+ */
166
+ export function readApiKeyFromFile(filePath) {
167
+ const configured = filePath !== null && filePath !== void 0 ? filePath : process.env.CURSOR_API_KEY_FILE;
168
+ const path = configured !== undefined && configured.trim() !== ""
169
+ ? configured.trim()
170
+ : DEFAULT_CURSOR_API_KEY_FILE;
171
+ try {
172
+ const raw = readFileSync(path, "utf8").trim();
173
+ return raw === "" ? undefined : raw;
174
+ }
175
+ catch (_a) {
176
+ return undefined;
177
+ }
178
+ }
179
+ /**
180
+ * First present source wins. We define the order; operators do not.
181
+ * `--api-key` / `serve({ apiKey })` → `CURSOR_API_KEY` → `CURSOR_API_KEY_FILE`
182
+ * (hosted default path if unset) → stored `july login`.
183
+ */
184
+ export function resolveApiKeySync(options) {
185
+ var _a;
186
+ const backendUrl = (_a = options === null || options === void 0 ? void 0 : options.backendUrl) !== null && _a !== void 0 ? _a : cursorBackendUrl();
187
+ if ((options === null || options === void 0 ? void 0 : options.apiKey) !== undefined && options.apiKey.trim() !== "") {
188
+ return { apiKey: options.apiKey.trim(), source: "option", backendUrl };
189
+ }
190
+ const envKey = process.env.CURSOR_API_KEY;
191
+ if (envKey !== undefined && envKey.trim() !== "") {
192
+ return { apiKey: envKey.trim(), source: "env", backendUrl };
193
+ }
194
+ const fileKey = readApiKeyFromFile();
195
+ if (fileKey !== undefined) {
196
+ return { apiKey: fileKey, source: "file", backendUrl };
197
+ }
198
+ const stored = readStoredCredentialsSync();
199
+ if (stored !== undefined && stored.backendUrl === backendUrl) {
200
+ return { apiKey: stored.apiKey, source: "login", backendUrl };
201
+ }
202
+ return undefined;
203
+ }
204
+ /**
205
+ * {@link resolveApiKeySync} as a Promise for call sites that already await.
140
206
  */
141
207
  export function resolveApiKey(options) {
142
208
  return __awaiter(this, void 0, void 0, function* () {
143
- var _a;
144
- const backendUrl = (_a = options === null || options === void 0 ? void 0 : options.backendUrl) !== null && _a !== void 0 ? _a : cursorBackendUrl();
145
- if ((options === null || options === void 0 ? void 0 : options.apiKey) !== undefined && options.apiKey.trim() !== "") {
146
- return { apiKey: options.apiKey.trim(), source: "option", backendUrl };
147
- }
148
- const envKey = process.env.CURSOR_API_KEY;
149
- if (envKey !== undefined && envKey.trim() !== "") {
150
- return { apiKey: envKey.trim(), source: "env", backendUrl };
151
- }
152
- const stored = yield readStoredCredentials();
153
- if (stored !== undefined && stored.backendUrl === backendUrl) {
154
- return { apiKey: stored.apiKey, source: "login", backendUrl };
155
- }
156
- return undefined;
209
+ return resolveApiKeySync(options);
157
210
  });
158
211
  }
159
212
  /** One-line hint for "no credentials" errors, shared across surfaces. */
160
- export const SIGN_IN_HINT = `Run \`${CLI_COMMAND_NAME} login\` (or set CURSOR_API_KEY / pass serve({ apiKey })).`;
213
+ export const SIGN_IN_HINT = `Run \`${CLI_COMMAND_NAME} login\` (or set CURSOR_API_KEY / CURSOR_API_KEY_FILE / pass serve({ apiKey })).`;
161
214
  // ============================================================================
162
215
  // PKCE browser login (mirrors cursor-agent / Sand)
163
216
  // ============================================================================
@@ -1,4 +1,4 @@
1
- declare const TEMPLATE_NAMES: readonly ["agentic-owners", "demo", "pr-autofixer", "security-reviewer", "triage-linear", "triage-jira"];
1
+ declare const TEMPLATE_NAMES: readonly ["agentic-owners", "demo", "pr-autofixer", "security-help", "security-reviewer", "triage-linear", "triage-jira"];
2
2
  export type TemplateName = (typeof TEMPLATE_NAMES)[number];
3
3
  export declare function canonicalTemplateName(name: string): string;
4
4
  export declare function isTemplateName(name: string): name is TemplateName;
@@ -1 +1 @@
1
- {"version":3,"file":"cursor-agent-template.d.ts","sourceRoot":"","sources":["../../src/internal/cursor-agent-template.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,cAAc,YAClB,gBAAgB,EAChB,MAAM,EACN,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,aAAa,CACL,CAAC;AACX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAG3D,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,YAAY,CAEjE;AAED,yEAAyE;AACzE,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAY3E;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAOtE"}
1
+ {"version":3,"file":"cursor-agent-template.d.ts","sourceRoot":"","sources":["../../src/internal/cursor-agent-template.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,cAAc,YAClB,gBAAgB,EAChB,MAAM,EACN,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,eAAe,EACf,aAAa,CACL,CAAC;AACX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAG3D,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,YAAY,CAEjE;AAED,yEAAyE;AACzE,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAY3E;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAOtE"}
@@ -5,6 +5,7 @@ const TEMPLATE_NAMES = [
5
5
  "agentic-owners",
6
6
  "demo",
7
7
  "pr-autofixer",
8
+ "security-help",
8
9
  "security-reviewer",
9
10
  "triage-linear",
10
11
  "triage-jira",
@@ -155,6 +155,16 @@ export interface AgentkitDeployStatus {
155
155
  statusMessage: string | null;
156
156
  }
157
157
  export declare const TERMINAL_AGENTKIT_DEPLOY_STATUSES: ReadonlySet<AgentkitCustomerStatus>;
158
+ /**
159
+ * `POST /internal/agentkit/deployments/:slug/stop` 202 body. Like v1
160
+ * {@link StopAccepted} but keyed by catalog ids instead of the numeric
161
+ * deployment row id.
162
+ */
163
+ export interface AgentkitStopAccepted {
164
+ applicationId: string;
165
+ releaseId: string;
166
+ status: string;
167
+ }
158
168
  /** One secret's metadata from the list endpoint — names only, never values. */
159
169
  export interface SecretInfo {
160
170
  name: string;
@@ -217,6 +227,14 @@ export declare class AgentServeDeployClient {
217
227
  teamId: number;
218
228
  slug: string;
219
229
  }): Promise<AgentkitDeployStatus>;
230
+ /**
231
+ * Stop a v2 deployment (`POST /internal/agentkit/deployments/:slug/stop`).
232
+ * 202 means accepted; poll {@link getAgentkitDeploy} until `stopped`.
233
+ */
234
+ stopAgentkit(args: {
235
+ teamId: number;
236
+ slug: string;
237
+ }): Promise<AgentkitStopAccepted>;
220
238
  listDeployments(args: {
221
239
  teamId: number;
222
240
  }): Promise<Deployment[]>;
@@ -1 +1 @@
1
- {"version":3,"file":"deploy-client.d.ts","sourceRoot":"","sources":["../../src/internal/deploy-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAUH,MAAM,MAAM,gBAAgB,GACxB,SAAS,GACT,WAAW,GACX,SAAS,GACT,UAAU,GACV,QAAQ,GACR,UAAU,GACV,SAAS,GACT,UAAU,CAAC;AAEf,sEAAsE;AACtE,MAAM,MAAM,kBAAkB,GAC1B,QAAQ,GACR,WAAW,GACX,UAAU,GACV,UAAU,GACV,UAAU,GACV,YAAY,GACZ,SAAS,GACT,QAAQ,GACR,UAAU,GACV,SAAS,GACT,UAAU,GACV,UAAU,CAAC;AAEf,eAAO,MAAM,wBAAwB,EAAE,WAAW,CAAC,gBAAgB,CAKjE,CAAC;AAEH;;;;;;;GAOG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,SAAS,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uEAAuE;IACvE,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B;;OAEG;IACH,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B,CAAC;AAIF,0EAA0E;AAC1E,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAKvE;AAED,6EAA6E;AAC7E,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAOtE;AAED,qBAAa,cAAe,SAAQ,KAAK;IAGrC,QAAQ,CAAC,MAAM,EAAE,MAAM;IACvB,oEAAoE;IACpE,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM;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AG,OAAO,CAAC,MAAM,CAAC,CAOlB;IAED;;;;;OAKG;IACG,gBAAgB,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAsBxE;IAED,4DAA4D;IAC5D,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEpC;IAED;;;;;OAKG;IACH,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAElD;YAEa,OAAO;CAyCtB"}
@@ -112,6 +112,13 @@ const agentkitDeployStatusSchema = z
112
112
  statusMessage: z.string().nullable(),
113
113
  })
114
114
  .passthrough();
115
+ const agentkitStopAcceptedSchema = z
116
+ .object({
117
+ applicationId: z.string().min(1),
118
+ releaseId: z.string().min(1),
119
+ status: z.string(),
120
+ })
121
+ .passthrough();
115
122
  const deploymentSchema = z.object({
116
123
  id: z.number(),
117
124
  slug: z.string(),
@@ -331,6 +338,20 @@ export class AgentServeDeployClient {
331
338
  return agentkitDeployStatusSchema.parse(raw);
332
339
  });
333
340
  }
341
+ /**
342
+ * Stop a v2 deployment (`POST /internal/agentkit/deployments/:slug/stop`).
343
+ * 202 means accepted; poll {@link getAgentkitDeploy} until `stopped`.
344
+ */
345
+ stopAgentkit(args) {
346
+ return __awaiter(this, void 0, void 0, function* () {
347
+ const raw = yield this.request({
348
+ method: "POST",
349
+ path: `/internal/agentkit/deployments/${encodeURIComponent(args.slug)}/stop?teamId=${args.teamId}`,
350
+ context: { verb: "stop", slug: args.slug },
351
+ });
352
+ return agentkitStopAcceptedSchema.parse(raw);
353
+ });
354
+ }
334
355
  listDeployments(args) {
335
356
  return __awaiter(this, void 0, void 0, function* () {
336
357
  const raw = yield this.request({
@@ -551,7 +572,10 @@ function mapErrorResponse(response, bodyText, context) {
551
572
  : `Deployment${slugPart} was not found — check the slug and --team, or the agent_serve_mvp feature gate may not be enabled for your team.`, 404);
552
573
  }
553
574
  case 409:
554
- return new DeployApiError(`A concurrent deploy or stop is changing deployment${slugPart}; retry in a moment.`, 409);
575
+ // The server's 409 body distinguishes real conflicts (CAS races,
576
+ // "still deploying", architecture-v2 slugs on the v1 surface); keep
577
+ // its message when present.
578
+ return new DeployApiError(serverError !== null && serverError !== void 0 ? serverError : `A concurrent deploy or stop is changing deployment${slugPart}; retry in a moment.`, 409);
555
579
  case 429: {
556
580
  const retryAfterHeader = response.headers.get("retry-after");
557
581
  const retryAfterSeconds = retryAfterHeader !== null && /^\d+$/.test(retryAfterHeader)
@@ -1 +1 @@
1
- {"version":3,"file":"deploy-manifest.d.ts","sourceRoot":"","sources":["../../src/internal/deploy-manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAIH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAUlE,eAAO,MAAM,uBAAuB,EAAE,CAAK,CAAC;AAiC5C,MAAM,WAAW,+BAA+B;IAC9C,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,4EAA4E;IAC5E,gBAAgB,CAAC,EAAE,eAAe,GAAG,OAAO,GAAG,MAAM,CAAC;IACtD;;;;OAIG;IACH,YAAY,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAC3B;;;;;;;OAOG;IACH,QAAQ,EAAE,KAAK,CAAC;QACd,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;QACtB,YAAY,EAAE,oBAAoB,CAAC;KACpC,CAAC,CAAC;CACJ;AAED,MAAM,WAAW,qBAAqB;IACpC,eAAe,EAAE,CAAC,CAAC;IACnB,6BAA6B;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,yDAAyD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B,aAAa,EAAE,MAAM,CAAC;IACtB,yDAAyD;IACzD,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,+BAA+B,CAAC;IAC9C;;;OAGG;IACH,IAAI,EAAE,gBAAgB,CAAC;CACxB;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,YAAY,EACrB,OAAO,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GAChD,qBAAqB,CA0DvB;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,OAAO,GACX,qBAAqB,GAAG,SAAS,CAOnC"}
@@ -33,7 +33,7 @@ import { isPublicEndpointPolicy } from "../channels.js";
33
33
  import { isCursorHostedStorage } from "../storage-backends/cursor-hosted.js";
34
34
  import { applyAgentContinuationDefaults, channelContinuationIdentity, handshakeChannelContinuation, } from "./continuation-channel.js";
35
35
  import { CONTINUATION_SELECTORS } from "./continuation-identity.js";
36
- import { projectInfo } from "./discovery.js";
36
+ import { projectInfo, runtimeArchitectureCompatibilityError, } from "./discovery.js";
37
37
  import { packageVersion } from "./distribution.js";
38
38
  export const DEPLOY_MANIFEST_VERSION = 1;
39
39
  /**
@@ -70,6 +70,10 @@ const agentDeployManifestV1Schema = z.object({
70
70
  export function buildAgentDeployManifest(project, options) {
71
71
  var _a;
72
72
  var _b, _c, _d;
73
+ const runtimeArchitectureError = runtimeArchitectureCompatibilityError(project.agent);
74
+ if (runtimeArchitectureError !== undefined) {
75
+ throw new Error(runtimeArchitectureError);
76
+ }
73
77
  applyAgentContinuationDefaults(project);
74
78
  const channels = project.channels.map((channel) => {
75
79
  var _a, _b, _c;