@grok/agent-sdk 0.3.0 → 0.5.0

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 (289) hide show
  1. package/dist/channels/match-ready/index.d.ts +4 -0
  2. package/dist/channels/match-ready/index.d.ts.map +1 -0
  3. package/dist/channels/match-ready/index.js +2 -0
  4. package/dist/channels/match-ready/match-ready-channel.d.ts +5 -0
  5. package/dist/channels/match-ready/match-ready-channel.d.ts.map +1 -0
  6. package/dist/channels/match-ready/match-ready-channel.js +42 -0
  7. package/dist/channels/match-ready/types.d.ts +25 -0
  8. package/dist/channels/match-ready/types.d.ts.map +1 -0
  9. package/dist/channels/match-ready/types.js +1 -0
  10. package/dist/channels/slack/slack-channel.d.ts.map +1 -1
  11. package/dist/channels/slack/slack-channel.js +27 -14
  12. package/dist/docs/404.html +2 -2
  13. package/dist/docs/assets/{app.BzTUBOAD.js → app.CYdjweqP.js} +4 -4
  14. package/dist/docs/assets/{building-with-agents.md.BqJ7AAjG.js → building-with-agents.md.Bo3ct-rf.js} +1 -1
  15. package/dist/docs/assets/changelog.md.BMrJ5WxW.js +1 -0
  16. package/dist/docs/assets/changelog.md.BMrJ5WxW.lean.js +1 -0
  17. package/dist/docs/assets/chunks/@localSearchIndexroot.dUaE1f8e.js +1 -0
  18. package/dist/docs/assets/chunks/{VPLocalSearchBox.DsnRlUT5.js → VPLocalSearchBox.CRATKS9J.js} +1 -1
  19. package/dist/docs/assets/chunks/{arc.DH8GOhiv.js → arc.BxM78ISR.js} +1 -1
  20. package/dist/docs/assets/chunks/{architectureDiagram-Q4EWVU46.9m9ObyuE.js → architectureDiagram-Q4EWVU46.Bi6MuKaU.js} +1 -1
  21. package/dist/docs/assets/chunks/{baseUniq.BXHpx1lE.js → baseUniq.L47qqpDG.js} +1 -1
  22. package/dist/docs/assets/chunks/{blockDiagram-DXYQGD6D.xY3EX59q.js → blockDiagram-DXYQGD6D.kHFF2FK5.js} +1 -1
  23. package/dist/docs/assets/chunks/{c4Diagram-AHTNJAMY.DnqgMVgc.js → c4Diagram-AHTNJAMY.BTW85ll3.js} +1 -1
  24. package/dist/docs/assets/chunks/channel.ljJtQtBi.js +1 -0
  25. package/dist/docs/assets/chunks/{chunk-4BX2VUAB.BjFxK2A3.js → chunk-4BX2VUAB.Bbh3_48g.js} +1 -1
  26. package/dist/docs/assets/chunks/{chunk-4TB4RGXK.BujS_Spt.js → chunk-4TB4RGXK.WeAmK3fK.js} +1 -1
  27. package/dist/docs/assets/chunks/{chunk-55IACEB6.YbTjhdaM.js → chunk-55IACEB6.DTdUiVHf.js} +1 -1
  28. package/dist/docs/assets/chunks/{chunk-EDXVE4YY.DnQ8t4GC.js → chunk-EDXVE4YY.n5XzANDz.js} +1 -1
  29. package/dist/docs/assets/chunks/{chunk-FMBD7UC4.B67AwAmj.js → chunk-FMBD7UC4.D51eewCb.js} +1 -1
  30. package/dist/docs/assets/chunks/{chunk-OYMX7WX6.DrZIAFOm.js → chunk-OYMX7WX6.BrY0U7ZV.js} +1 -1
  31. package/dist/docs/assets/chunks/{chunk-QZHKN3VN.BLmmydkn.js → chunk-QZHKN3VN.B0OA4aFV.js} +1 -1
  32. package/dist/docs/assets/chunks/{chunk-YZCP3GAM.DaoOfw0O.js → chunk-YZCP3GAM.Djt3Mjft.js} +1 -1
  33. package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.BZ3Uc-XU.js +1 -0
  34. package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.BZ3Uc-XU.js +1 -0
  35. package/dist/docs/assets/chunks/clone.BDtbEo69.js +1 -0
  36. package/dist/docs/assets/chunks/{cose-bilkent-S5V4N54A.DMQuNhM5.js → cose-bilkent-S5V4N54A.DiMcA6Q8.js} +1 -1
  37. package/dist/docs/assets/chunks/{dagre-KV5264BT.CZoGVuUf.js → dagre-KV5264BT.BGqI4vrS.js} +1 -1
  38. package/dist/docs/assets/chunks/{diagram-5BDNPKRD.CLt9uOyL.js → diagram-5BDNPKRD.bDqFuMoH.js} +1 -1
  39. package/dist/docs/assets/chunks/{diagram-G4DWMVQ6.DpczEm1G.js → diagram-G4DWMVQ6.Y0sxaXRU.js} +1 -1
  40. package/dist/docs/assets/chunks/{diagram-MMDJMWI5.D4r13DvJ.js → diagram-MMDJMWI5.Bg43b0yi.js} +1 -1
  41. package/dist/docs/assets/chunks/{diagram-TYMM5635.CYU9eGFu.js → diagram-TYMM5635.DCfVasEC.js} +1 -1
  42. package/dist/docs/assets/chunks/{erDiagram-SMLLAGMA.QA9naWEw.js → erDiagram-SMLLAGMA.C72GaD16.js} +1 -1
  43. package/dist/docs/assets/chunks/{flowDiagram-DWJPFMVM.BbNoVZYd.js → flowDiagram-DWJPFMVM.DxRQj7pP.js} +1 -1
  44. package/dist/docs/assets/chunks/{ganttDiagram-T4ZO3ILL.IHjDoG7r.js → ganttDiagram-T4ZO3ILL.DiLZy5Q4.js} +1 -1
  45. package/dist/docs/assets/chunks/{gitGraphDiagram-UUTBAWPF.B21VMdf5.js → gitGraphDiagram-UUTBAWPF.DL8XkRvh.js} +1 -1
  46. package/dist/docs/assets/chunks/{graph.DgJ4L-8V.js → graph.3Xub80xJ.js} +1 -1
  47. package/dist/docs/assets/chunks/{infoDiagram-42DDH7IO.CQjrcthc.js → infoDiagram-42DDH7IO.O3lGaspu.js} +1 -1
  48. package/dist/docs/assets/chunks/{ishikawaDiagram-UXIWVN3A.D4tPGtVo.js → ishikawaDiagram-UXIWVN3A.w-pCiQzn.js} +1 -1
  49. package/dist/docs/assets/chunks/{journeyDiagram-VCZTEJTY.BD3WaNbQ.js → journeyDiagram-VCZTEJTY.Cg_oBs9j.js} +1 -1
  50. package/dist/docs/assets/chunks/{kanban-definition-6JOO6SKY.Ca0o4Tqz.js → kanban-definition-6JOO6SKY.BpfMGPwn.js} +1 -1
  51. package/dist/docs/assets/chunks/{layout.DXXqX4MQ.js → layout.CtwXs__p.js} +1 -1
  52. package/dist/docs/assets/chunks/{linear.5c61gNw4.js → linear.NmCskOrP.js} +1 -1
  53. package/dist/docs/assets/chunks/{min.B1-NAjHX.js → min.DpQtsLKs.js} +1 -1
  54. package/dist/docs/assets/chunks/{mindmap-definition-QFDTVHPH.BELznv3-.js → mindmap-definition-QFDTVHPH.B-P-aKVp.js} +1 -1
  55. package/dist/docs/assets/chunks/{pieDiagram-DEJITSTG.qPzO1mq5.js → pieDiagram-DEJITSTG.BfjjqK7j.js} +1 -1
  56. package/dist/docs/assets/chunks/{quadrantDiagram-34T5L4WZ.CxIvzbjX.js → quadrantDiagram-34T5L4WZ.BTzHo53F.js} +1 -1
  57. package/dist/docs/assets/chunks/{requirementDiagram-MS252O5E.CqA0iJx8.js → requirementDiagram-MS252O5E.DIT2FIKr.js} +1 -1
  58. package/dist/docs/assets/chunks/{sankeyDiagram-XADWPNL6.XRTutBnb.js → sankeyDiagram-XADWPNL6.NK1wCsgt.js} +1 -1
  59. package/dist/docs/assets/chunks/{sequenceDiagram-FGHM5R23.E--7bRLQ.js → sequenceDiagram-FGHM5R23.D9oElkvo.js} +1 -1
  60. package/dist/docs/assets/chunks/{stateDiagram-FHFEXIEX.C4vGu8zq.js → stateDiagram-FHFEXIEX.IPksnixH.js} +1 -1
  61. package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.CbhzVsQE.js +1 -0
  62. package/dist/docs/assets/chunks/{theme.DMj_7q3B.js → theme.CgKu7tr3.js} +2 -2
  63. package/dist/docs/assets/chunks/{timeline-definition-GMOUNBTQ.C7LgNVAL.js → timeline-definition-GMOUNBTQ.CuAtJapY.js} +1 -1
  64. package/dist/docs/assets/chunks/{vennDiagram-DHZGUBPP.HUwoZcy_.js → vennDiagram-DHZGUBPP.B87nNW9E.js} +1 -1
  65. package/dist/docs/assets/chunks/wardley-RL74JXVD.BFIVMaoi.js +162 -0
  66. package/dist/docs/assets/chunks/{wardleyDiagram-NUSXRM2D.B2pSo5rB.js → wardleyDiagram-NUSXRM2D.BELjSq8w.js} +1 -1
  67. package/dist/docs/assets/chunks/{xychartDiagram-5P7HB3ND.NQhMiOOL.js → xychartDiagram-5P7HB3ND.5zN5ZGsz.js} +1 -1
  68. package/dist/docs/assets/{deployment.md.BtqJrHhp.js → deployment.md.DJtuDVLh.js} +3 -3
  69. package/dist/docs/assets/{deployment.md.BtqJrHhp.lean.js → deployment.md.DJtuDVLh.lean.js} +1 -1
  70. package/dist/docs/assets/{guides_agent-to-agent.md.BcmSqL2z.js → guides_agent-to-agent.md.DcB3nhOz.js} +1 -1
  71. package/dist/docs/assets/{guides_github.md.6jiEH7dg.js → guides_github.md.CcuZ7keS.js} +1 -1
  72. package/dist/docs/assets/{guides_mcp-oauth.md.C-Sx_IPa.js → guides_mcp-oauth.md.GVPMKcYl.js} +1 -1
  73. package/dist/docs/assets/{guides_migrate.md.BbhHYeCr.js → guides_migrate.md.B8CZxnnX.js} +1 -1
  74. package/dist/docs/assets/{guides_slack.md.BgIGG9ur.js → guides_slack.md.D7Rwyva4.js} +1 -1
  75. package/dist/docs/assets/{hillclimbing.md.3TkdF79A.js → hillclimbing.md.M51bF-oT.js} +1 -1
  76. package/dist/docs/assets/index.md.DnJPj_B6.js +14 -0
  77. package/dist/docs/assets/index.md.DnJPj_B6.lean.js +1 -0
  78. package/dist/docs/assets/{reference_agent-config.md.C0Tp_Fk9.js → reference_agent-config.md.Bbqf0lgS.js} +13 -5
  79. package/dist/docs/assets/{reference_agent-config.md.C0Tp_Fk9.lean.js → reference_agent-config.md.Bbqf0lgS.lean.js} +1 -1
  80. package/dist/docs/assets/{reference_cli.md.B8GdpaRj.js → reference_cli.md.DHm6DmYk.js} +2 -2
  81. package/dist/docs/assets/{reference_hooks.md.CSWmOwMM.js → reference_hooks.md.vbIM394-.js} +2 -2
  82. package/dist/docs/assets/{reference_hooks.md.CSWmOwMM.lean.js → reference_hooks.md.vbIM394-.lean.js} +1 -1
  83. package/dist/docs/assets/{reference_tools.md.B2OaR1Nb.js → reference_tools.md.BhqW6neF.js} +4 -2
  84. package/dist/docs/assets/{reference_tools.md.B2OaR1Nb.lean.js → reference_tools.md.BhqW6neF.lean.js} +1 -1
  85. package/dist/docs/building-with-agents.html +36 -36
  86. package/dist/docs/building-with-agents.md +3 -3
  87. package/dist/docs/changelog.html +36 -36
  88. package/dist/docs/changelog.md +44 -1
  89. package/dist/docs/deployment.html +37 -37
  90. package/dist/docs/deployment.md +22 -16
  91. package/dist/docs/evals.html +35 -35
  92. package/dist/docs/guides/agent-to-agent.html +37 -37
  93. package/dist/docs/guides/agent-to-agent.md +4 -2
  94. package/dist/docs/guides/bitbucket.html +35 -35
  95. package/dist/docs/guides/cloud-agents.html +35 -35
  96. package/dist/docs/guides/convert-automation.html +35 -35
  97. package/dist/docs/guides/github.html +37 -37
  98. package/dist/docs/guides/github.md +1 -1
  99. package/dist/docs/guides/gitlab.html +35 -35
  100. package/dist/docs/guides/improve.html +35 -35
  101. package/dist/docs/guides/jev.html +35 -35
  102. package/dist/docs/guides/mcp-oauth.html +37 -37
  103. package/dist/docs/guides/mcp-oauth.md +1 -1
  104. package/dist/docs/guides/migrate.html +37 -37
  105. package/dist/docs/guides/migrate.md +1 -1
  106. package/dist/docs/guides/opentelemetry.html +35 -35
  107. package/dist/docs/guides/pagerduty.html +35 -35
  108. package/dist/docs/guides/slack.html +37 -37
  109. package/dist/docs/guides/slack.md +1 -1
  110. package/dist/docs/guides/webhooks.html +35 -35
  111. package/dist/docs/hashmap.json +1 -1
  112. package/dist/docs/hillclimbing.html +36 -36
  113. package/dist/docs/hillclimbing.md +1 -1
  114. package/dist/docs/index.html +42 -48
  115. package/dist/docs/index.md +8 -14
  116. package/dist/docs/llms-full.txt +176 -54
  117. package/dist/docs/quickstart.html +35 -35
  118. package/dist/docs/reference/access.html +35 -35
  119. package/dist/docs/reference/agent-config.html +47 -39
  120. package/dist/docs/reference/agent-config.md +75 -10
  121. package/dist/docs/reference/artifacts.html +35 -35
  122. package/dist/docs/reference/channels.html +35 -35
  123. package/dist/docs/reference/cli.html +38 -38
  124. package/dist/docs/reference/cli.md +2 -2
  125. package/dist/docs/reference/connections.html +35 -35
  126. package/dist/docs/reference/evals.html +35 -35
  127. package/dist/docs/reference/extensions.html +35 -35
  128. package/dist/docs/reference/hooks.html +37 -37
  129. package/dist/docs/reference/hooks.md +1 -1
  130. package/dist/docs/reference/http-api.html +35 -35
  131. package/dist/docs/reference/instructions.html +35 -35
  132. package/dist/docs/reference/limits.html +35 -35
  133. package/dist/docs/reference/memory.html +35 -35
  134. package/dist/docs/reference/playground.html +35 -35
  135. package/dist/docs/reference/project-layout.html +35 -35
  136. package/dist/docs/reference/schedules.html +35 -35
  137. package/dist/docs/reference/sessions.html +35 -35
  138. package/dist/docs/reference/skills.html +35 -35
  139. package/dist/docs/reference/subagents.html +35 -35
  140. package/dist/docs/reference/tools.html +39 -37
  141. package/dist/docs/reference/tools.md +12 -0
  142. package/dist/docs/templates/agentic-owners.html +35 -35
  143. package/dist/docs/templates/reviews.html +35 -35
  144. package/dist/docs/troubleshooting.html +35 -35
  145. package/dist/filesystem.d.ts +12 -412
  146. package/dist/filesystem.d.ts.map +1 -1
  147. package/dist/filesystem.js +37 -980
  148. package/dist/index.d.ts +1 -3
  149. package/dist/index.d.ts.map +1 -1
  150. package/dist/index.js +1 -3
  151. package/dist/internal/authored-alias-hooks.d.ts +6 -0
  152. package/dist/internal/authored-alias-hooks.d.ts.map +1 -1
  153. package/dist/internal/authored-alias-hooks.js +12 -0
  154. package/dist/internal/authored-loaders.js +10 -1
  155. package/dist/internal/cli/commands/scaffold.js +1 -1
  156. package/dist/internal/continuation-channel.d.ts +3 -3
  157. package/dist/internal/continuation-channel.js +3 -3
  158. package/dist/internal/continuation-identity.d.ts +6 -5
  159. package/dist/internal/continuation-identity.d.ts.map +1 -1
  160. package/dist/internal/continuation-identity.js +17 -2
  161. package/dist/internal/continuation-session-ids.d.ts +15 -0
  162. package/dist/internal/continuation-session-ids.d.ts.map +1 -0
  163. package/dist/internal/continuation-session-ids.js +43 -0
  164. package/dist/internal/direct-file-tools.d.ts +21 -0
  165. package/dist/internal/direct-file-tools.d.ts.map +1 -0
  166. package/dist/internal/direct-file-tools.js +60 -0
  167. package/dist/internal/discovery/agent.d.ts.map +1 -1
  168. package/dist/internal/discovery/agent.js +71 -66
  169. package/dist/internal/filesystem/walk.d.ts +4 -56
  170. package/dist/internal/filesystem/walk.d.ts.map +1 -1
  171. package/dist/internal/filesystem/walk.js +4 -198
  172. package/dist/internal/hosted-catch-protocol.d.ts +3 -3
  173. package/dist/internal/hosted-catch-protocol.js +3 -3
  174. package/dist/internal/hosted-fetch.d.ts +7 -0
  175. package/dist/internal/hosted-fetch.d.ts.map +1 -0
  176. package/dist/internal/hosted-fetch.js +26 -0
  177. package/dist/internal/hosted-managed-automation.js +1 -1
  178. package/dist/internal/install-cursor-skills.d.ts +5 -6
  179. package/dist/internal/install-cursor-skills.d.ts.map +1 -1
  180. package/dist/internal/install-cursor-skills.js +19 -4
  181. package/dist/internal/mcp-endpoint.js +4 -4
  182. package/dist/internal/model-config.d.ts.map +1 -1
  183. package/dist/internal/model-config.js +11 -4
  184. package/dist/internal/otel/http.d.ts +2 -1
  185. package/dist/internal/otel/http.d.ts.map +1 -1
  186. package/dist/internal/otel/http.js +2 -3
  187. package/dist/internal/platform-timers.d.ts +3 -7
  188. package/dist/internal/platform-timers.d.ts.map +1 -1
  189. package/dist/internal/platform-timers.js +10 -51
  190. package/dist/internal/sdk-runner.d.ts.map +1 -1
  191. package/dist/internal/sdk-runner.js +22 -40
  192. package/dist/internal/server.d.ts.map +1 -1
  193. package/dist/internal/server.js +6 -1
  194. package/dist/internal/session-engine.d.ts +36 -19
  195. package/dist/internal/session-engine.d.ts.map +1 -1
  196. package/dist/internal/session-engine.js +182 -254
  197. package/dist/internal/tool-paths.d.ts +8 -0
  198. package/dist/internal/tool-paths.d.ts.map +1 -0
  199. package/dist/internal/tool-paths.js +12 -0
  200. package/dist/internal/workspace-tree.d.ts +27 -0
  201. package/dist/internal/workspace-tree.d.ts.map +1 -0
  202. package/dist/internal/workspace-tree.js +106 -0
  203. package/dist/playground/assets/index-D0-FHg1x.css +1 -0
  204. package/dist/playground/assets/index-D5SLKUy6.js +62 -0
  205. package/dist/playground/index.html +2 -2
  206. package/dist/types.d.ts +43 -23
  207. package/dist/types.d.ts.map +1 -1
  208. package/dist/types.js +2 -2
  209. package/docs/README.md +8 -14
  210. package/docs/building-with-agents.md +3 -3
  211. package/docs/changelog.md +44 -1
  212. package/docs/deployment.md +22 -16
  213. package/docs/guides/agent-to-agent.md +4 -2
  214. package/docs/guides/github.md +1 -1
  215. package/docs/guides/mcp-oauth.md +1 -1
  216. package/docs/guides/migrate.md +1 -1
  217. package/docs/guides/slack.md +1 -1
  218. package/docs/hillclimbing.md +1 -1
  219. package/docs/reference/agent-config.md +75 -10
  220. package/docs/reference/cli.md +2 -2
  221. package/docs/reference/hooks.md +1 -1
  222. package/docs/reference/tools.md +12 -0
  223. package/package.json +10 -15
  224. package/skills/cli/SKILL.md +1 -1
  225. package/skills/create-agent/SKILL.md +61 -7
  226. package/skills/debug/SKILL.md +1 -1
  227. package/skills/deploy/SKILL.md +3 -3
  228. package/skills/evals/SKILL.md +1 -1
  229. package/skills/framework-map/SKILL.md +2 -2
  230. package/skills/github/SKILL.md +1 -1
  231. package/skills/hillclimb/SKILL.md +1 -1
  232. package/skills/mcp-auth/SKILL.md +1 -1
  233. package/skills/migrate-v2/SKILL.md +2 -2
  234. package/skills/otel/SKILL.md +1 -1
  235. package/skills/setup-slack/SKILL.md +2 -2
  236. package/dist/docs/assets/changelog.md.BWhC6DET.js +0 -1
  237. package/dist/docs/assets/changelog.md.BWhC6DET.lean.js +0 -1
  238. package/dist/docs/assets/chunks/@localSearchIndexroot.CWxwVoCG.js +0 -1
  239. package/dist/docs/assets/chunks/channel.Cctv0f7X.js +0 -1
  240. package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.DU5sqchW.js +0 -1
  241. package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.DU5sqchW.js +0 -1
  242. package/dist/docs/assets/chunks/clone.B9rdNt6j.js +0 -1
  243. package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.ECMu2BdJ.js +0 -1
  244. package/dist/docs/assets/chunks/wardley-RL74JXVD.BxFEFYZS.js +0 -162
  245. package/dist/docs/assets/index.md.DRfaoRCZ.js +0 -20
  246. package/dist/docs/assets/index.md.DRfaoRCZ.lean.js +0 -1
  247. package/dist/executors.d.ts +0 -11
  248. package/dist/executors.d.ts.map +0 -1
  249. package/dist/executors.js +0 -21
  250. package/dist/internal/filesystem/errors.d.ts +0 -64
  251. package/dist/internal/filesystem/errors.d.ts.map +0 -1
  252. package/dist/internal/filesystem/errors.js +0 -180
  253. package/dist/internal/filesystem/format.d.ts +0 -28
  254. package/dist/internal/filesystem/format.d.ts.map +0 -1
  255. package/dist/internal/filesystem/format.js +0 -209
  256. package/dist/internal/filesystem/merge.d.ts +0 -34
  257. package/dist/internal/filesystem/merge.d.ts.map +0 -1
  258. package/dist/internal/filesystem/merge.js +0 -154
  259. package/dist/internal/filesystem/nearest.d.ts +0 -15
  260. package/dist/internal/filesystem/nearest.d.ts.map +0 -1
  261. package/dist/internal/filesystem/nearest.js +0 -90
  262. package/dist/internal/filesystem/scratch.d.ts +0 -60
  263. package/dist/internal/filesystem/scratch.d.ts.map +0 -1
  264. package/dist/internal/filesystem/scratch.js +0 -187
  265. package/dist/internal/filesystem/sdk-schemas.d.ts +0 -29
  266. package/dist/internal/filesystem/sdk-schemas.d.ts.map +0 -1
  267. package/dist/internal/filesystem/sdk-schemas.js +0 -148
  268. package/dist/internal/filesystem/subagent-inherit.d.ts +0 -39
  269. package/dist/internal/filesystem/subagent-inherit.d.ts.map +0 -1
  270. package/dist/internal/filesystem/subagent-inherit.js +0 -96
  271. package/dist/internal/filesystem/tools.d.ts +0 -59
  272. package/dist/internal/filesystem/tools.d.ts.map +0 -1
  273. package/dist/internal/filesystem/tools.js +0 -634
  274. package/dist/internal/otel/propagation.d.ts +0 -7
  275. package/dist/internal/otel/propagation.d.ts.map +0 -1
  276. package/dist/internal/otel/propagation.js +0 -15
  277. package/dist/internal/sdk-subagent-inherit-support.d.ts +0 -9
  278. package/dist/internal/sdk-subagent-inherit-support.d.ts.map +0 -1
  279. package/dist/internal/sdk-subagent-inherit-support.js +0 -90
  280. package/dist/playground/assets/index-D6mVn9og.js +0 -62
  281. package/dist/playground/assets/index-DlALM6gr.css +0 -1
  282. /package/dist/docs/assets/{building-with-agents.md.BqJ7AAjG.lean.js → building-with-agents.md.Bo3ct-rf.lean.js} +0 -0
  283. /package/dist/docs/assets/{guides_agent-to-agent.md.BcmSqL2z.lean.js → guides_agent-to-agent.md.DcB3nhOz.lean.js} +0 -0
  284. /package/dist/docs/assets/{guides_github.md.6jiEH7dg.lean.js → guides_github.md.CcuZ7keS.lean.js} +0 -0
  285. /package/dist/docs/assets/{guides_mcp-oauth.md.C-Sx_IPa.lean.js → guides_mcp-oauth.md.GVPMKcYl.lean.js} +0 -0
  286. /package/dist/docs/assets/{guides_migrate.md.BbhHYeCr.lean.js → guides_migrate.md.B8CZxnnX.lean.js} +0 -0
  287. /package/dist/docs/assets/{guides_slack.md.BgIGG9ur.lean.js → guides_slack.md.D7Rwyva4.lean.js} +0 -0
  288. /package/dist/docs/assets/{hillclimbing.md.3TkdF79A.lean.js → hillclimbing.md.M51bF-oT.lean.js} +0 -0
  289. /package/dist/docs/assets/{reference_cli.md.B8GdpaRj.lean.js → reference_cli.md.DHm6DmYk.lean.js} +0 -0
@@ -26,7 +26,23 @@ export const CURSOR_SKILLS_NAMESPACE = "agent-sdk";
26
26
  * Earlier install folders. Deleted on install so stale skill ids stop
27
27
  * being discovered next to the current copies.
28
28
  */
29
- const LEGACY_CURSOR_SKILLS_NAMESPACES = ["bdk", "agentsdk", "agentkit"];
29
+ const LEGACY_CURSOR_SKILLS_NAMESPACES = [
30
+ "bdk",
31
+ "agentsdk",
32
+ "agentkit",
33
+ "bdk-create-agent",
34
+ "bdk-debug",
35
+ "bdk-deploy",
36
+ "bdk-evals",
37
+ "bdk-framework-map",
38
+ "bdk-github",
39
+ "bdk-hillclimb",
40
+ "bdk-mcp-auth",
41
+ "bdk-migrate-v2",
42
+ "bdk-otel",
43
+ "bdk-setup-slack",
44
+ "bdk-cli",
45
+ ];
30
46
  /** How long the `init` offer waits for an answer before skipping the install. */
31
47
  export const SKILL_PROMPT_TIMEOUT_MS = 45_000;
32
48
  /**
@@ -68,7 +84,7 @@ export function skillInstallPath(skill, skillsHome = cursorSkillsHome()) {
68
84
  }
69
85
  /**
70
86
  * Skills shipped next to the running package. Uses the frontmatter `name`
71
- * when present, otherwise `bdk-<dir>`.
87
+ * when present, otherwise `agent-sdk-<dir>`.
72
88
  */
73
89
  export async function listShippedPackageSkills(packageRoot = packageRootDir()) {
74
90
  const skillsRoot = join(packageRoot, "skills");
@@ -143,8 +159,7 @@ export async function findMissingCursorSkills(options) {
143
159
  * Always overwrites so a package upgrade refreshes local Cursor skills.
144
160
  * Strips monorepo-only frontmatter, sets `alwaysApply: true` so Cursor
145
161
  * loads the body into context, and removes leaf dirs no longer shipped.
146
- * Also deletes leftover `skillsHome/bdk/`, `skillsHome/agentsdk/`, and
147
- * `skillsHome/agentkit/`.
162
+ * Also deletes leftover earlier-install folders under `skillsHome`.
148
163
  */
149
164
  export async function installCursorSkills(skills, skillsHome = cursorSkillsHome()) {
150
165
  const namespaceDir = bdkCursorSkillsDir(skillsHome);
@@ -296,7 +296,7 @@ function buildAgentMcpServer(engine, auth) {
296
296
  }
297
297
  });
298
298
  server.registerTool("check", {
299
- description: 'Wait for (or poll) a session started with ask. Returns the final reply once the turn completes, or status "running" to keep waiting. Use waitSeconds: 0 for a non-blocking poll.',
299
+ description: 'Wait for a session started with ask. Returns the final reply once the turn completes, or status "running". Do not end your turn while the status is "running". Call check again with the sessionId. Use waitSeconds: 0 for a non-blocking poll.',
300
300
  inputSchema: {
301
301
  sessionId: z.string().describe("Session id returned by ask."),
302
302
  waitSeconds: z
@@ -381,7 +381,7 @@ function buildInstructions(project) {
381
381
  const parts = [
382
382
  `This MCP server fronts the Cursor agent "${project.name}".`,
383
383
  ...(agent.description === undefined ? [] : [agent.description]),
384
- 'Delegate a task with the ask tool: each call without a sessionId starts a fresh session (fresh context); pass the returned sessionId to continue the same conversation. When ask returns status "running", call check with that sessionId to keep waiting for the reply.',
384
+ 'Delegate a task with the ask tool: each call without a sessionId starts a fresh session (fresh context); pass the returned sessionId to continue the same conversation. When ask returns status "running", do not end your turn. Call check with that sessionId until the reply arrives.',
385
385
  ];
386
386
  return parts.join(" ");
387
387
  }
@@ -390,7 +390,7 @@ function buildAskDescription(project) {
390
390
  const purpose = description === undefined || description.trim() === ""
391
391
  ? `the "${project.name}" agent`
392
392
  : `the "${project.name}" agent — ${description.trim()}`;
393
- return `Send a message to ${purpose}. Runs a full model turn in that agent's own context and returns its reply. Omit sessionId to start a fresh session; pass it to follow up. Long turns return status "running" — call check with the sessionId to keep waiting.`;
393
+ return `Send a message to ${purpose}. Runs a full model turn in that agent's own context and returns its reply. Omit sessionId to start a fresh session; pass it to follow up. Long turns return status "running". Do not end your turn. Call check with the sessionId.`;
394
394
  }
395
395
  // ============================================================================
396
396
  // Session helpers
@@ -433,7 +433,7 @@ async function waitForReply(engine, sessionId, waitSeconds) {
433
433
  return {
434
434
  status: "running",
435
435
  sessionId,
436
- note: `The turn is still running. Call check with { "sessionId": "${sessionId}" } to keep waiting.`,
436
+ note: `The turn is still running. Do not end your turn. Call check with { "sessionId": "${sessionId}" }.`,
437
437
  };
438
438
  }
439
439
  return toReplyPayload(engine, sessionId, outcome);
@@ -1 +1 @@
1
- {"version":3,"file":"model-config.d.ts","sourceRoot":"","sources":["../../src/internal/model-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAKtD,eAAO,MAAM,6BAA6B,kDAAkD,CAAC;AAE7F,qBAAa,uBAAwB,SAAQ,KAAK;IAChD,YAAY,OAAO,EAAE,MAAM,EAG1B;CACF;AAyCD,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,OAAO,EACpB,MAAM,EAAE,OAAO,GAAG,SAAS,GAC1B,kBAAkB,GAAG,SAAS,CAehC"}
1
+ {"version":3,"file":"model-config.d.ts","sourceRoot":"","sources":["../../src/internal/model-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAOtD,eAAO,MAAM,6BAA6B,kDAAkD,CAAC;AAE7F,qBAAa,uBAAwB,SAAQ,KAAK;IAChD,YAAY,OAAO,EAAE,MAAM,EAG1B;CACF;AA6CD,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,OAAO,EACpB,MAAM,EAAE,OAAO,GAAG,SAAS,GAC1B,kBAAkB,GAAG,SAAS,CAehC"}
@@ -1,6 +1,8 @@
1
1
  import { isRecord } from "./is-record.js";
2
2
  const MODEL_ID = /^[a-z0-9][a-z0-9.-]{0,127}$/;
3
3
  const LEVELS = new Set(["low", "medium", "high", "xhigh"]);
4
+ const GPT_EFFORT_IDS = ["reasoning"];
5
+ const OTHER_EFFORT_IDS = ["effort", "reasoning_effort"];
4
6
  export const MODEL_CONFIG_REQUIRES_DRY_RUN = "invalid argument: modelConfig requires dryRun";
5
7
  export class InvalidModelConfigError extends Error {
6
8
  constructor(message) {
@@ -21,17 +23,20 @@ function setting(value, where) {
21
23
  const rawParams = value.params;
22
24
  if (!Array.isArray(rawParams))
23
25
  invalid(`invalid argument: ${where} requires params`);
24
- const effortId = id.includes("gpt") ? "reasoning" : "effort";
26
+ const allowedEffort = id.includes("gpt") ? GPT_EFFORT_IDS : OTHER_EFFORT_IDS;
25
27
  const params = [];
26
28
  const seen = new Set();
29
+ let sawEffort = false;
27
30
  for (const param of rawParams) {
28
31
  if (!isRecord(param))
29
32
  invalid(`invalid argument: ${where} param "" is not allowed`);
30
33
  const paramId = typeof param.id === "string" ? param.id : "";
31
34
  const paramValue = typeof param.value === "string" ? param.value : "";
35
+ const isEffort = allowedEffort.includes(paramId);
32
36
  if (paramId === "" ||
33
37
  paramValue === "" ||
34
- (paramId !== effortId && paramId !== "fast") ||
38
+ (!isEffort && paramId !== "fast") ||
39
+ (isEffort && sawEffort) ||
35
40
  seen.has(paramId)) {
36
41
  invalid(`invalid argument: ${where} param ${JSON.stringify(paramId)} is not allowed`);
37
42
  }
@@ -39,10 +44,12 @@ function setting(value, where) {
39
44
  if (!valueOk)
40
45
  invalid(`invalid argument: ${where} param ${JSON.stringify(paramId)} bad value`);
41
46
  seen.add(paramId);
47
+ if (isEffort)
48
+ sawEffort = true;
42
49
  params.push({ id: paramId, value: paramValue });
43
50
  }
44
- if (!seen.has(effortId) || !seen.has("fast")) {
45
- invalid(`invalid argument: ${where} requires params ${effortId} and fast`);
51
+ if (!sawEffort || !seen.has("fast")) {
52
+ invalid(`invalid argument: ${where} requires params ${allowedEffort.join(" or ")} and fast`);
46
53
  }
47
54
  return { id, params };
48
55
  }
@@ -1,5 +1,6 @@
1
1
  /**
2
- * HTTP SERVER spans. Inbound requests extract W3C `traceparent` only.
2
+ * HTTP SERVER spans. Inbound requests extract with the global propagator
3
+ * that `installCustomerOtel` registers (W3C trace context and baggage).
3
4
  */
4
5
  import type { IncomingMessage, ServerResponse } from "node:http";
5
6
  import type { OtelRuntime } from "./runtime.js";
@@ -1 +1 @@
1
- {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../src/internal/otel/http.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAWjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAShD,iFAAiF;AACjF,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI,CAI3E;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAC9B,OAAO,EAAE,WAAW,EACpB,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACnB,OAAO,CAAC,CAAC,CAAC,CAcZ"}
1
+ {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../src/internal/otel/http.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAUjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAShD,iFAAiF;AACjF,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI,CAI3E;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAC9B,OAAO,EAAE,WAAW,EACpB,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACnB,OAAO,CAAC,CAAC,CAAC,CAcZ"}
@@ -1,9 +1,9 @@
1
1
  /**
2
- * HTTP SERVER spans. Inbound requests extract W3C `traceparent` only.
2
+ * HTTP SERVER spans. Inbound requests extract with the global propagator
3
+ * that `installCustomerOtel` registers (W3C trace context and baggage).
3
4
  */
4
5
  import { context, propagation, SpanKind, SpanStatusCode, trace, } from "@opentelemetry/api";
5
6
  import { describeError } from "../describe-error.js";
6
- import { ensureW3cPropagator } from "./propagation.js";
7
7
  const HTTP_SPAN_HANDLE_KEY = Symbol.for("anysphere.july.otel.httpSpanHandle");
8
8
  /** End the inbound SERVER span once the Fetch status is known (hosted flush). */
9
9
  export function endActiveHttpSpan(statusCode, error) {
@@ -34,7 +34,6 @@ function startHttpSpan(runtime, req) {
34
34
  if (runtime.config.traces === false) {
35
35
  return undefined;
36
36
  }
37
- ensureW3cPropagator();
38
37
  const headers = {};
39
38
  for (const [key, value] of Object.entries(req.headers)) {
40
39
  if (typeof value === "string") {
@@ -8,6 +8,7 @@
8
8
  * executes fires.
9
9
  */
10
10
  import { type ReminderControlPlane } from "./reminder-control-plane-protocol.js";
11
+ import { type HostedFetchOptions } from "./hosted-fetch.js";
11
12
  import { type ReminderRecord } from "./reminder-store.js";
12
13
  export interface PlatformTimers {
13
14
  upsertSchedule(input: {
@@ -27,16 +28,11 @@ export interface PlatformTimers {
27
28
  }): Promise<ReminderRecord[]>;
28
29
  deleteReminder(id: string): Promise<void>;
29
30
  }
30
- export interface CursorHostedPlatformTimersOptions {
31
- baseUrl?: string;
32
- apiKey?: string;
33
- fetch?: typeof fetch;
34
- }
35
- export declare function createCursorHostedPlatformTimers(options?: CursorHostedPlatformTimersOptions): PlatformTimers;
31
+ export declare function createCursorHostedPlatformTimers(options?: HostedFetchOptions): PlatformTimers;
36
32
  /**
37
33
  * Cursor-hosted HTTP ReminderControlPlane for architecture v2.
38
34
  * Speaks factory `/internal/agentsdk/reminders` (ELB → factory ECS).
39
35
  * CP owns ids and time. v1 PUT/DELETE reminders stay on timed-work.
40
36
  */
41
- export declare function createCursorHostedReminderControlPlane(options?: CursorHostedPlatformTimersOptions): ReminderControlPlane;
37
+ export declare function createCursorHostedReminderControlPlane(options?: HostedFetchOptions): ReminderControlPlane;
42
38
  //# sourceMappingURL=platform-timers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"platform-timers.d.ts","sourceRoot":"","sources":["../../src/internal/platform-timers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAEL,KAAK,oBAAoB,EAK1B,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAoB,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAI5E,MAAM,WAAW,cAAc;IAC7B,cAAc,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE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cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C,WAAW,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAAC;IAC7D;;;OAGG;IACH,aAAa,CAAC,MAAM,CAAC,EAAE;QACrB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC5B,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IAC9B,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3C;AA8BD,wBAAgB,gCAAgC,CAAC,OAAO,GAAE,kBAAuB,GAAG,cAAc,CAoEjG;AAmDD;;;;GAIG;AACH,wBAAgB,sCAAsC,CACpD,OAAO,GAAE,kBAAuB,GAC/B,oBAAoB,CA0HtB"}
@@ -8,38 +8,11 @@
8
8
  * executes fires.
9
9
  */
10
10
  import { REMINDER_CP_PROTOCOL_VERSION, } from "./reminder-control-plane-protocol.js";
11
+ import { hostedControlPlaneFetch } from "./hosted-fetch.js";
11
12
  import { isRecord } from "./is-record.js";
12
13
  import { isReminderRecord } from "./reminder-store.js";
13
- const DEFAULT_CURSOR_EXTERNAL_API_URL = "https://api.cursor.com";
14
- function resolveApiKey(options) {
15
- const key = (options.apiKey ?? process.env.CURSOR_API_KEY)?.trim();
16
- if (key === undefined || key === "") {
17
- throw new Error("platform timers require CURSOR_API_KEY (deployment pod credential on Cursor hosting)");
18
- }
19
- return key;
20
- }
21
- function resolveBaseUrl(options) {
22
- const raw = (options.baseUrl ??
23
- process.env.CURSOR_API_BASE_URL ??
24
- DEFAULT_CURSOR_EXTERNAL_API_URL).trim();
25
- return raw.endsWith("/") ? raw.slice(0, -1) : raw;
26
- }
27
- async function timedWorkFetch(options, method, path, body) {
28
- const fetchImpl = options.fetch ?? globalThis.fetch;
29
- if (typeof fetchImpl !== "function") {
30
- throw new Error("platform timers require fetch");
31
- }
32
- return fetchImpl(`${resolveBaseUrl(options)}${path}`, {
33
- method,
34
- headers: {
35
- Authorization: `Bearer ${resolveApiKey(options)}`,
36
- ...(body === undefined ? {} : { "Content-Type": "application/json" }),
37
- },
38
- ...(body === undefined ? {} : { body: JSON.stringify(body) }),
39
- });
40
- }
41
14
  async function timedWorkRpc(options, method, path, body) {
42
- const response = await timedWorkFetch(options, method, path, body);
15
+ const response = await hostedControlPlaneFetch(options, method, path, body);
43
16
  if (response.ok) {
44
17
  return;
45
18
  }
@@ -71,7 +44,7 @@ export function createCursorHostedPlatformTimers(options = {}) {
71
44
  await timedWorkRpc(options, "PUT", `/internal/agent-serve/timed-work/reminders/${encodeURIComponent(record.id)}`, record);
72
45
  },
73
46
  async getReminder(id) {
74
- const response = await timedWorkFetch(options, "GET", `/internal/agent-serve/timed-work/reminders/${encodeURIComponent(id)}`);
47
+ const response = await hostedControlPlaneFetch(options, "GET", `/internal/agent-serve/timed-work/reminders/${encodeURIComponent(id)}`);
75
48
  if (response.status === 404) {
76
49
  return undefined;
77
50
  }
@@ -82,7 +55,7 @@ export function createCursorHostedPlatformTimers(options = {}) {
82
55
  return isReminderRecord(parsed) ? parsed : undefined;
83
56
  },
84
57
  async listReminders() {
85
- const response = await timedWorkFetch(options, "GET", "/internal/agent-serve/timed-work/reminders");
58
+ const response = await hostedControlPlaneFetch(options, "GET", "/internal/agent-serve/timed-work/reminders");
86
59
  if (!response.ok) {
87
60
  throw new Error(`platform timers GET /reminders: HTTP ${response.status}`);
88
61
  }
@@ -129,20 +102,6 @@ async function withBoundedApplyRetries(run) {
129
102
  }
130
103
  throw lastError;
131
104
  }
132
- async function timedWorkJsonFetch(options, method, path, body) {
133
- const fetchImpl = options.fetch ?? globalThis.fetch;
134
- if (typeof fetchImpl !== "function") {
135
- throw new Error("reminder control plane requires fetch");
136
- }
137
- return fetchImpl(`${resolveBaseUrl(options)}${path}`, {
138
- method,
139
- headers: {
140
- Authorization: `Bearer ${resolveApiKey(options)}`,
141
- ...(body === undefined ? {} : { "Content-Type": "application/json" }),
142
- },
143
- ...(body === undefined ? {} : { body: JSON.stringify(body) }),
144
- });
145
- }
146
105
  const CP_ERROR_BODY_LIMIT = 512;
147
106
  /**
148
107
  * Read failures carry status and a bounded body: the guest logs them once
@@ -168,7 +127,7 @@ export function createCursorHostedReminderControlPlane(options = {}) {
168
127
  return {
169
128
  protocolVersion: REMINDER_CP_PROTOCOL_VERSION,
170
129
  async createReminder(intent) {
171
- const response = await timedWorkJsonFetch(options, "POST", `${AGENTSDK_REMINDERS_PREFIX}/reminders`, intent);
130
+ const response = await hostedControlPlaneFetch(options, "POST", `${AGENTSDK_REMINDERS_PREFIX}/reminders`, intent);
172
131
  if (!response.ok) {
173
132
  const text = await response.text();
174
133
  throw new Error(`reminder CP create failed: HTTP ${response.status} ${text}`);
@@ -180,7 +139,7 @@ export function createCursorHostedReminderControlPlane(options = {}) {
180
139
  return parsed;
181
140
  },
182
141
  async getReminder(id) {
183
- const response = await timedWorkJsonFetch(options, "GET", `${AGENTSDK_REMINDERS_PREFIX}/reminders/${encodeURIComponent(id)}`);
142
+ const response = await hostedControlPlaneFetch(options, "GET", `${AGENTSDK_REMINDERS_PREFIX}/reminders/${encodeURIComponent(id)}`);
184
143
  if (response.status === 404) {
185
144
  return undefined;
186
145
  }
@@ -199,7 +158,7 @@ export function createCursorHostedReminderControlPlane(options = {}) {
199
158
  params.set("purpose", filter.purpose);
200
159
  }
201
160
  const query = params.toString();
202
- const response = await timedWorkJsonFetch(options, "GET", `${AGENTSDK_REMINDERS_PREFIX}/reminders${query === "" ? "" : `?${query}`}`);
161
+ const response = await hostedControlPlaneFetch(options, "GET", `${AGENTSDK_REMINDERS_PREFIX}/reminders${query === "" ? "" : `?${query}`}`);
203
162
  if (!response.ok) {
204
163
  throw await reminderCpReadError("list", response);
205
164
  }
@@ -213,7 +172,7 @@ export function createCursorHostedReminderControlPlane(options = {}) {
213
172
  return parsed.reminders.filter(isReminderRecord);
214
173
  },
215
174
  async cancelReminder(id, reason) {
216
- const response = await timedWorkJsonFetch(options, "POST", `${AGENTSDK_REMINDERS_PREFIX}/reminders/${encodeURIComponent(id)}/cancel`, reason === undefined ? {} : { reason });
175
+ const response = await hostedControlPlaneFetch(options, "POST", `${AGENTSDK_REMINDERS_PREFIX}/reminders/${encodeURIComponent(id)}/cancel`, reason === undefined ? {} : { reason });
217
176
  if (response.status === 404) {
218
177
  return undefined;
219
178
  }
@@ -224,7 +183,7 @@ export function createCursorHostedReminderControlPlane(options = {}) {
224
183
  return isReminderRecord(parsed) ? parsed : undefined;
225
184
  },
226
185
  async rekeyReminders(channelId, oldToken, newToken) {
227
- const response = await timedWorkJsonFetch(options, "POST", `${AGENTSDK_REMINDERS_PREFIX}/reminders/rekey`, { channelId, oldToken, newToken });
186
+ const response = await hostedControlPlaneFetch(options, "POST", `${AGENTSDK_REMINDERS_PREFIX}/reminders/rekey`, { channelId, oldToken, newToken });
228
187
  if (!response.ok) {
229
188
  throw new Error(`reminder CP rekey failed: HTTP ${response.status}`);
230
189
  }
@@ -242,7 +201,7 @@ export function createCursorHostedReminderControlPlane(options = {}) {
242
201
  // CP write. Exhausted failures stay thrown so Temporal can re-admit
243
202
  // (at-least-once — not exactly-once).
244
203
  return await withBoundedApplyRetries(async () => {
245
- const response = await timedWorkJsonFetch(options, "POST", `${AGENTSDK_REMINDERS_PREFIX}/reminders/outcome`, { claim, outcome });
204
+ const response = await hostedControlPlaneFetch(options, "POST", `${AGENTSDK_REMINDERS_PREFIX}/reminders/outcome`, { claim, outcome });
246
205
  if (!response.ok) {
247
206
  throw new Error(`reminder CP outcome apply failed: HTTP ${response.status}`);
248
207
  }
@@ -1 +1 @@
1
- {"version":3,"file":"sdk-runner.d.ts","sourceRoot":"","sources":["../../src/internal/sdk-runner.ts"],"names":[],"mappings":"AAAA;;;;;;GA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, usageTokenSum } from "./cloud-turn-usage.js";
13
13
  import { resolveApiKeySync, SIGN_IN_HINT } from "./cursor/credentials.js";
14
14
  import { describeError, USER_FACING_TURN_FAILURE } from "./describe-error.js";
15
15
  import { isRecord } from "./is-record.js";
16
- import { installedSdkAppliesSubagentInherit } from "./sdk-subagent-inherit-support.js";
17
16
  import { sleep } from "./sleep.js";
18
17
  import { installSqliteExperimentalWarningFilter } from "./sqlite-experimental-warning.js";
19
- /** Attaches child inherit when this Cursor SDK applies it. */
20
- function withSubagentInherit(options) {
21
- const { local, inherit } = options;
22
- if (inherit === undefined || !installedSdkAppliesSubagentInherit()) {
23
- return local;
24
- }
25
- return Object.assign(local, { subagentInherit: inherit });
26
- }
27
- function toolsForLocalSdk(tools, inherit) {
28
- if (tools === undefined || inherit === undefined || installedSdkAppliesSubagentInherit()) {
29
- return tools;
30
- }
31
- const withoutTask = tools.filter((name) => name !== "task" && name !== "Task");
32
- return withoutTask.length === tools.length ? tools : withoutTask;
33
- }
34
18
  /**
35
19
  * How long a non-`--dev` serve holds workspace scans (rules, skills,
36
20
  * `AGENTS.md`, ignore files). The SDK default is 20s for an editor whose
@@ -375,20 +359,18 @@ export class CursorSdkRunner {
375
359
  ...mcpServersField(request.runtime === "local" && request.perSendMcpServers === true
376
360
  ? sendMcpServers
377
361
  : undefined),
378
- ...(request.runtime === "local"
362
+ local: request.runtime === "local"
379
363
  ? {
380
- local: withSubagentInherit({
381
- local: {
382
- customTools: request.customTools,
383
- // Follow-up turns expire any run still marked active on the
384
- // agent (a preempted or crash-wedged run) so this send is not
385
- // rejected with "already has active run".
386
- ...(request.forceExpireActiveRun === true ? { force: true } : {}),
387
- },
388
- inherit: request.subagentInherit,
389
- }),
364
+ customTools: request.customTools,
365
+ // The session's tree for this turn; a cached agent handle
366
+ // still carries the tree it was opened with.
367
+ fs: request.fs,
368
+ // Follow-up turns expire any run still marked active on the
369
+ // agent (a preempted or crash-wedged run) so this send is not
370
+ // rejected with "already has active run".
371
+ ...(request.forceExpireActiveRun === true ? { force: true } : {}),
390
372
  }
391
- : {}),
373
+ : undefined,
392
374
  });
393
375
  // A follow-up can preempt this turn: cancelling tears down execution and
394
376
  // marks the SDK run terminal so the next send is admitted cleanly. The
@@ -633,9 +615,7 @@ export class CursorSdkRunner {
633
615
  // deliberately absent from openCloudAgent's options: the SDK rejects
634
616
  // tool restrictions on cloud agents. Passed on create *and* resume
635
617
  // (both flow through here) — the SDK does not persist it across runs.
636
- ...(request.tools === undefined
637
- ? {}
638
- : { tools: toolsForLocalSdk(request.tools, request.subagentInherit) }),
618
+ tools: request.tools,
639
619
  ...(request.disallowedTools === undefined
640
620
  ? {}
641
621
  : { disallowedTools: request.disallowedTools }),
@@ -645,15 +625,17 @@ export class CursorSdkRunner {
645
625
  // Prewarm requests carry none, and the SDK's workspace cache key
646
626
  // ignores it, so a warmed executor is still the one turns land on.
647
627
  systemPrompt: request.instructions,
648
- local: withSubagentInherit({
649
- local: {
650
- cwd: request.workspaceDir,
651
- settingSources: ["project"],
652
- store,
653
- ...(request.sandbox === true ? { sandboxOptions: { enabled: true } } : {}),
654
- },
655
- inherit: request.subagentInherit,
656
- }),
628
+ local: {
629
+ cwd: request.workspaceDir,
630
+ settingSources: request.settingSources ?? ["project"],
631
+ store,
632
+ ...(request.sandbox === true ? { sandboxOptions: { enabled: true } } : {}),
633
+ // With `fs`, the SDK runs the native file tools on the tree and
634
+ // `reportedWorkspacePath` is the workspace inside it. Resume needs
635
+ // `fs` again, so it rides create and resume alike.
636
+ fs: request.fs,
637
+ reportedWorkspacePath: request.reportedWorkspacePath,
638
+ },
657
639
  };
658
640
  }
659
641
  async openAgent(request) {
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/internal/server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAsC,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AA6CpF,OAAO,KAAK,EACV,YAAY,EACZ,gBAAgB,EAU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otel/customer.
61
61
  import { instrumentHttp } from "./otel/http.js";
62
62
  import { collectPeerConnections } from "./peer-connections.js";
63
63
  import { PLATFORM_SCHEDULE_CATALOG_FILENAME, syncHostedPlatformSchedules, } from "./platform-schedule-sync.js";
64
+ import { sessionIdSourceForGuest } from "./continuation-session-ids.js";
64
65
  import { createCursorHostedPlatformTimers, createCursorHostedReminderControlPlane, } from "./platform-timers.js";
65
66
  import { renderAgentsIndexHtml, renderPlaygroundAsset, renderPlaygroundIndexHtml, } from "./playground/static.js";
66
67
  import { ensurePlaygroundBundle, playgroundDevBaseFromEnv, playgroundDevBasePath, startPlaygroundDevServer, } from "./playground/toolchain.js";
@@ -501,6 +502,7 @@ export async function startServer(mounts, options = {}) {
501
502
  const baseStateRoot = options.stateRoot ?? join(project.rootDir, ".agent-serve");
502
503
  const stateRoot = slug === "" ? baseStateRoot : join(baseStateRoot, slug);
503
504
  const otelCollector = createOtelCollector(otelRuntime, project.name, logger);
505
+ const hostedV2Guest = noControlPlane && project.agent.architecture === "v2";
504
506
  const engine = new SessionEngine({
505
507
  project,
506
508
  stateRoot,
@@ -509,6 +511,10 @@ export async function startServer(mounts, options = {}) {
509
511
  platforms: hostPlatforms,
510
512
  otel: otelCollector,
511
513
  otelMeter: () => otelRuntime.meter,
514
+ sessionIds: sessionIdSourceForGuest({
515
+ noControlPlane,
516
+ architecture: project.agent.architecture,
517
+ }),
512
518
  });
513
519
  engine.oauthCallbackHub.secrets = options.mcpOauthSecrets;
514
520
  engine.oauthCallbackHub.secretsBind = {
@@ -666,7 +672,6 @@ export async function startServer(mounts, options = {}) {
666
672
  }
667
673
  // A hosted v2 guest boots per delivery; its calendars come from the
668
674
  // release manifest at deploy time, so it must not sync them itself.
669
- const hostedV2Guest = noControlPlane && architecture === "v2";
670
675
  if (timerClient !== undefined && runSchedules && !hostedV2Guest) {
671
676
  await syncHostedPlatformSchedules({
672
677
  timers: timerClient,
@@ -6,7 +6,7 @@
6
6
  * are mapped onto the channel event vocabulary and dispatched to channel
7
7
  * event handlers and hooks.
8
8
  */
9
- import type { SDKCustomToolResult } from "@cursor/sdk";
9
+ import { type SDKCustomToolResult } from "@cursor/sdk";
10
10
  declare module "@cursor/sdk" {
11
11
  interface SDKCustomToolContext {
12
12
  sessionId?: string;
@@ -18,6 +18,7 @@ import { type AgentProject, type ApprovalDecision, type ArtifactListFilter, type
18
18
  import { type CloudAgentUsage } from "./cloud-turn-usage.js";
19
19
  import { type EventLogMemoryStats } from "./event-log.js";
20
20
  import { type HostPlatforms } from "./host-platforms.js";
21
+ import { type SessionIdSource } from "./continuation-session-ids.js";
21
22
  import { McpOauthOnDemandHub } from "./mcp-oauth-on-demand.js";
22
23
  import type { OtelCollector } from "./otel/collector.js";
23
24
  import type { AgentRunner } from "./sdk-runner.js";
@@ -108,6 +109,7 @@ export interface SessionEngineOptions {
108
109
  otel?: OtelCollector;
109
110
  /** Process-level meter for {@link HostContext.otel}. Absent → no-op counters. */
110
111
  otelMeter?: () => Meter | undefined;
112
+ sessionIds?: SessionIdSource;
111
113
  }
112
114
  /**
113
115
  * A connection the serve host resolved once it was listening — a **peer**
@@ -203,6 +205,7 @@ export declare class SessionEngine {
203
205
  /** In-flight authored-file syncs for cloud turns. */
204
206
  private readonly cloudSyncs;
205
207
  private readonly runner;
208
+ private readonly sessionIds;
206
209
  private readonly logger;
207
210
  private readonly logs;
208
211
  private readonly channelsById;
@@ -293,8 +296,6 @@ export declare class SessionEngine {
293
296
  private readonly sessionRootInflight;
294
297
  /** Discovered skills as a read-only tree, shared by every session. */
295
298
  private baseSkills;
296
- /** Per-turn union of the authored tree, `/agent/skills`, and `/tmp`. Dropped at end of turn. */
297
- private readonly turnRoots;
298
299
  /** In-flight `prewarmSharedWorkspace`; first turn waits so it lands hot. */
299
300
  private sharedWarm;
300
301
  constructor(options: SessionEngineOptions);
@@ -474,27 +475,43 @@ export declare class SessionEngine {
474
475
  getContinuationLastBotMessageTs(channelId: string, continuationToken: string): Promise<string | undefined>;
475
476
  interruptContinuation(channelId: string, continuationToken: string): Promise<boolean>;
476
477
  private hasRootOverride;
478
+ /**
479
+ * A sandboxed host-disk agent whose `tools` grant file tools and no shell
480
+ * runs on its session workspace as a tree, mounted at its `workspace`.
481
+ */
482
+ private confinesWorkspaceReads;
483
+ private treeWorkspace;
484
+ /**
485
+ * The session workspace at {@link treeWorkspace}, with the skills mount over
486
+ * it. Shared memory is a symlink out of the workspace, so it is mounted
487
+ * read-only in its place, as a sandboxed host agent can read it but not
488
+ * write through the link.
489
+ */
490
+ private workspaceTree;
477
491
  /** The field the author set, for messages. Discovery copies a lone `root` onto `fs`. */
478
492
  private authoredFsField;
479
493
  /**
480
- * FileSystem for this turn or `callTool`. Authored `fs` (static or
481
- * factory) is cached per session when `cache` is set; unscoped
482
- * `callTool` passes the invocation id and does not cache, so factories
483
- * cannot share one tree across callers. A static handle is used as
484
- * authored — every session sees that same object. Host-default agents
485
- * get `localFileSystem` against the harness cwd — same path verbs as
486
- * the Cursor SDK natives, always through the synthesized tools. With
487
- * `confineToWorkspace`, those verbs refuse a path outside the harness
488
- * cwd. The read verbs can still reach the Cursor SDK's scratch dir for
489
- * that cwd, where native WebFetch and WebSearch write large output.
490
- */
491
- private resolveFileSystem;
494
+ * The tree an `fs` agent runs on: the authored `fs` at `/` with the
495
+ * skills mount over it. A turn passes it to the SDK as `local.fs`, and
496
+ * the SDK mounts a fresh `/tmp` over it for each run. A direct call
497
+ * gets its own empty `/tmp` (`scratch`), so it sees what a run sees.
498
+ * Authored `fs` (static or factory) is cached per session when `cache`
499
+ * is set; unscoped `callTool` passes the invocation id and does not
500
+ * cache, so factories cannot share one tree across callers. A static
501
+ * handle is used as authored — every session sees that same object.
502
+ */
503
+ private resolveSessionTree;
492
504
  private resolveAuthoredFileSystem;
493
505
  private baseSkillsFileSystem;
494
- private dropTurnFileSystem;
495
- private prepareScratchToolInput;
496
- private withTurnScratchTools;
497
- private nativeFileSystemOutcome;
506
+ /**
507
+ * A native file tool run outside a turn, on the tree a turn of this
508
+ * session would use. Host-disk agents run it on the harness cwd,
509
+ * confined to that cwd, with the workspace set to the cwd as a turn's
510
+ * native tools report it. The read verbs can also reach the SDK's spill
511
+ * directory for that cwd, where native WebFetch and WebSearch write
512
+ * large output.
513
+ */
514
+ private directFileToolOutcome;
498
515
  /**
499
516
  * Local harness cwd for a session: per-send override, else the shared
500
517
  * `agent.local.workspaceDir`, else `<agent.local.cwd>/<sessionId>`, else