@cursor/july 0.1.109 → 0.1.111

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 (1076) hide show
  1. package/AGENTS.md +1 -1
  2. package/README.md +0 -15
  3. package/dist/bin/agent-serve.js +81 -66
  4. package/dist/channels/bitbucket/api.js +8 -8
  5. package/dist/channels/bitbucket/binding.js +4 -4
  6. package/dist/channels/bitbucket/bitbucket-channel.js +1 -1
  7. package/dist/channels/bitbucket/bitbucket-webhook.js +1 -1
  8. package/dist/channels/bitbucket/checks.d.ts.map +1 -1
  9. package/dist/channels/bitbucket/checks.js +1 -1
  10. package/dist/channels/bitbucket/cursor-account.js +1 -1
  11. package/dist/channels/bitbucket/events.js +1 -1
  12. package/dist/channels/change-monitors/change-monitors-channel.js +1 -1
  13. package/dist/channels/checks.d.ts.map +1 -1
  14. package/dist/channels/checks.js +2 -2
  15. package/dist/channels/deployments/deployments-channel.js +1 -1
  16. package/dist/channels/github/cursor-account.js +3 -3
  17. package/dist/channels/github/defaults.d.ts.map +1 -1
  18. package/dist/channels/github/defaults.js +5 -3
  19. package/dist/channels/github/events.js +1 -1
  20. package/dist/channels/github/forward.js +8 -8
  21. package/dist/channels/github/github-channel.d.ts.map +1 -1
  22. package/dist/channels/github/github-channel.js +17 -13
  23. package/dist/channels/github/progress.d.ts.map +1 -1
  24. package/dist/channels/github/progress.js +7 -2
  25. package/dist/channels/github/state.d.ts +6 -0
  26. package/dist/channels/github/state.d.ts.map +1 -1
  27. package/dist/channels/github/types.d.ts +6 -0
  28. package/dist/channels/github/types.d.ts.map +1 -1
  29. package/dist/channels/gitlab/binding.js +4 -4
  30. package/dist/channels/gitlab/checks.d.ts.map +1 -1
  31. package/dist/channels/gitlab/checks.js +1 -1
  32. package/dist/channels/gitlab/cursor-account.js +1 -1
  33. package/dist/channels/gitlab/events.js +1 -1
  34. package/dist/channels/gitlab/gitlab-channel.js +1 -1
  35. package/dist/channels/gitlab/gitlab-webhook.js +1 -1
  36. package/dist/channels/gitlab/replay.js +2 -2
  37. package/dist/channels/origin/binding.d.ts +2 -0
  38. package/dist/channels/origin/binding.d.ts.map +1 -1
  39. package/dist/channels/origin/binding.js +3 -3
  40. package/dist/channels/origin/checks.d.ts +19 -7
  41. package/dist/channels/origin/checks.d.ts.map +1 -1
  42. package/dist/channels/origin/checks.js +13 -9
  43. package/dist/channels/origin/cursor-account.js +1 -1
  44. package/dist/channels/origin/defaults.d.ts.map +1 -1
  45. package/dist/channels/origin/defaults.js +3 -1
  46. package/dist/channels/origin/events.js +1 -1
  47. package/dist/channels/origin/origin-channel.d.ts.map +1 -1
  48. package/dist/channels/origin/origin-channel.js +2 -1
  49. package/dist/channels/origin/origin-webhook.js +2 -2
  50. package/dist/channels/slack/agentic-delivery.d.ts +23 -0
  51. package/dist/channels/slack/agentic-delivery.d.ts.map +1 -0
  52. package/dist/channels/slack/agentic-delivery.js +558 -0
  53. package/dist/channels/slack/agentic-posted.d.ts +30 -0
  54. package/dist/channels/slack/agentic-posted.d.ts.map +1 -0
  55. package/dist/channels/slack/agentic-posted.js +102 -0
  56. package/dist/channels/slack/agentic-signals.d.ts +48 -0
  57. package/dist/channels/slack/agentic-signals.d.ts.map +1 -0
  58. package/dist/channels/slack/agentic-signals.js +204 -0
  59. package/dist/channels/slack/api.d.ts +20 -1
  60. package/dist/channels/slack/api.d.ts.map +1 -1
  61. package/dist/channels/slack/api.js +43 -11
  62. package/dist/channels/slack/approvals.js +1 -1
  63. package/dist/channels/slack/auth.d.ts.map +1 -1
  64. package/dist/channels/slack/auth.js +3 -1
  65. package/dist/channels/slack/blocks.js +3 -3
  66. package/dist/channels/slack/bot-mentions.d.ts.map +1 -1
  67. package/dist/channels/slack/bot-mentions.js +5 -5
  68. package/dist/channels/slack/channel-watch.js +1 -1
  69. package/dist/channels/slack/cli-project.js +3 -3
  70. package/dist/channels/slack/defaults.d.ts +3 -0
  71. package/dist/channels/slack/defaults.d.ts.map +1 -1
  72. package/dist/channels/slack/defaults.js +90 -29
  73. package/dist/channels/slack/dispatch.d.ts +34 -1
  74. package/dist/channels/slack/dispatch.d.ts.map +1 -1
  75. package/dist/channels/slack/dispatch.js +219 -106
  76. package/dist/channels/slack/doctor.js +1 -1
  77. package/dist/channels/slack/eval-directive.js +1 -1
  78. package/dist/channels/slack/external-policy.d.ts +2 -1
  79. package/dist/channels/slack/external-policy.d.ts.map +1 -1
  80. package/dist/channels/slack/external-policy.js +13 -2
  81. package/dist/channels/slack/footer.d.ts +30 -0
  82. package/dist/channels/slack/footer.d.ts.map +1 -0
  83. package/dist/channels/slack/footer.js +88 -0
  84. package/dist/channels/slack/index.d.ts +2 -0
  85. package/dist/channels/slack/index.d.ts.map +1 -1
  86. package/dist/channels/slack/index.js +2 -0
  87. package/dist/channels/slack/interactive.d.ts.map +1 -1
  88. package/dist/channels/slack/interactive.js +5 -3
  89. package/dist/channels/slack/live-delivery.d.ts +1 -1
  90. package/dist/channels/slack/live-delivery.d.ts.map +1 -1
  91. package/dist/channels/slack/live-delivery.js +20 -6
  92. package/dist/channels/slack/log.d.ts.map +1 -1
  93. package/dist/channels/slack/log.js +1 -1
  94. package/dist/channels/slack/manifest.js +1 -1
  95. package/dist/channels/slack/nudge-carrier.js +1 -1
  96. package/dist/channels/slack/nudge-store.js +2 -2
  97. package/dist/channels/slack/paint-start.d.ts +22 -0
  98. package/dist/channels/slack/paint-start.d.ts.map +1 -0
  99. package/dist/channels/slack/paint-start.js +91 -0
  100. package/dist/channels/slack/placeholder.d.ts +36 -0
  101. package/dist/channels/slack/placeholder.d.ts.map +1 -0
  102. package/dist/channels/slack/placeholder.js +240 -0
  103. package/dist/channels/slack/progress-delivery.d.ts.map +1 -1
  104. package/dist/channels/slack/progress-delivery.js +13 -4
  105. package/dist/channels/slack/reasoning-chip.d.ts +8 -0
  106. package/dist/channels/slack/reasoning-chip.d.ts.map +1 -0
  107. package/dist/channels/slack/reasoning-chip.js +30 -0
  108. package/dist/channels/slack/recording-sink.d.ts +29 -0
  109. package/dist/channels/slack/recording-sink.d.ts.map +1 -0
  110. package/dist/channels/slack/recording-sink.js +142 -0
  111. package/dist/channels/slack/reply-options.d.ts +8 -1
  112. package/dist/channels/slack/reply-options.d.ts.map +1 -1
  113. package/dist/channels/slack/reply-options.js +59 -14
  114. package/dist/channels/slack/setup.js +1 -1
  115. package/dist/channels/slack/slack-channel.d.ts +2 -2
  116. package/dist/channels/slack/slack-channel.d.ts.map +1 -1
  117. package/dist/channels/slack/slack-channel.js +55 -20
  118. package/dist/channels/slack/socket-mode.js +2 -2
  119. package/dist/channels/slack/thread-context.js +5 -5
  120. package/dist/channels/slack/tool-approval-events.d.ts +5 -0
  121. package/dist/channels/slack/tool-approval-events.d.ts.map +1 -1
  122. package/dist/channels/slack/tool-approval-events.js +50 -38
  123. package/dist/channels/slack/tool-cards.js +1 -1
  124. package/dist/channels/slack/tool-chip.d.ts +9 -0
  125. package/dist/channels/slack/tool-chip.d.ts.map +1 -0
  126. package/dist/channels/slack/tool-chip.js +25 -0
  127. package/dist/channels/slack/types.d.ts +49 -7
  128. package/dist/channels/slack/types.d.ts.map +1 -1
  129. package/dist/channels/slack/upload.d.ts +13 -0
  130. package/dist/channels/slack/upload.d.ts.map +1 -0
  131. package/dist/channels/slack/upload.js +135 -0
  132. package/dist/channels.d.ts +10 -14
  133. package/dist/channels.d.ts.map +1 -1
  134. package/dist/channels.js +9 -21
  135. package/dist/dashboard-session-url.d.ts +15 -0
  136. package/dist/dashboard-session-url.d.ts.map +1 -0
  137. package/dist/dashboard-session-url.js +25 -0
  138. package/dist/docs/404.html +3 -3
  139. package/dist/docs/architecture.svg +59 -0
  140. package/dist/docs/assets/app.Drol6mi6.js +309 -0
  141. package/dist/docs/assets/{building-with-agents.md.D0KbSkJn.js → building-with-agents.md.CEGVXkmO.js} +2 -2
  142. package/dist/docs/assets/{building-with-agents.md.D0KbSkJn.lean.js → building-with-agents.md.CEGVXkmO.lean.js} +1 -1
  143. package/dist/docs/assets/chunks/@localSearchIndexroot.DtXk1hy-.js +1 -0
  144. package/dist/docs/assets/chunks/{VPLocalSearchBox.CVQERt56.js → VPLocalSearchBox.CdqoBZJX.js} +2 -2
  145. package/dist/docs/assets/chunks/arc.BVX3ycTn.js +1 -0
  146. package/dist/docs/assets/chunks/architectureDiagram-Q4EWVU46.CcChnMxX.js +36 -0
  147. package/dist/docs/assets/chunks/baseUniq.xwtXO-yt.js +1 -0
  148. package/dist/docs/assets/chunks/blockDiagram-DXYQGD6D.CijZ_taK.js +132 -0
  149. package/dist/docs/assets/chunks/c4Diagram-AHTNJAMY.0FBvwBvK.js +10 -0
  150. package/dist/docs/assets/chunks/channel.Bkv1N-gK.js +1 -0
  151. package/dist/docs/assets/chunks/chunk-4BX2VUAB.CELMmMDA.js +1 -0
  152. package/dist/docs/assets/chunks/chunk-4TB4RGXK.C4bhFtSm.js +206 -0
  153. package/dist/docs/assets/chunks/chunk-55IACEB6.ZnQ9gRRQ.js +1 -0
  154. package/dist/docs/assets/chunks/chunk-EDXVE4YY.DPlmglG-.js +1 -0
  155. package/dist/docs/assets/chunks/chunk-FMBD7UC4.BrUk8pff.js +15 -0
  156. package/dist/docs/assets/chunks/chunk-OYMX7WX6.CcmWIncu.js +231 -0
  157. package/dist/docs/assets/chunks/chunk-QZHKN3VN.D65-cs8I.js +1 -0
  158. package/dist/docs/assets/chunks/chunk-YZCP3GAM.qoXZpG9F.js +1 -0
  159. package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.CZDco1o8.js +1 -0
  160. package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.CZDco1o8.js +1 -0
  161. package/dist/docs/assets/chunks/clone.YSt_40_s.js +1 -0
  162. package/dist/docs/assets/chunks/cose-bilkent-S5V4N54A.8rYtqudO.js +1 -0
  163. package/dist/docs/assets/chunks/cytoscape.esm.BQk4lpUV.js +331 -0
  164. package/dist/docs/assets/chunks/dagre-KV5264BT.DrRP1fOh.js +4 -0
  165. package/dist/docs/assets/chunks/defaultLocale.C4B-KCzX.js +1 -0
  166. package/dist/docs/assets/chunks/diagram-5BDNPKRD.DHj_xA2_.js +10 -0
  167. package/dist/docs/assets/chunks/diagram-G4DWMVQ6.Bz_6nAKj.js +24 -0
  168. package/dist/docs/assets/chunks/diagram-MMDJMWI5.BWA0xSW9.js +43 -0
  169. package/dist/docs/assets/chunks/diagram-TYMM5635.CpTJLNJI.js +24 -0
  170. package/dist/docs/assets/chunks/erDiagram-SMLLAGMA.-7AWWSrP.js +85 -0
  171. package/dist/docs/assets/chunks/flowDiagram-DWJPFMVM.BTnQ742_.js +162 -0
  172. package/dist/docs/assets/chunks/framework.dypDpWZ3.js +19 -0
  173. package/dist/docs/assets/chunks/ganttDiagram-T4ZO3ILL.B5_HiiQ5.js +292 -0
  174. package/dist/docs/assets/chunks/gitGraphDiagram-UUTBAWPF.CZcNTFZd.js +106 -0
  175. package/dist/docs/assets/chunks/graph.V2GLaab4.js +1 -0
  176. package/dist/docs/assets/chunks/infoDiagram-42DDH7IO.7pZOkCCU.js +2 -0
  177. package/dist/docs/assets/chunks/init.Gi6I4Gst.js +1 -0
  178. package/dist/docs/assets/chunks/ishikawaDiagram-UXIWVN3A.DSMo3Qa3.js +70 -0
  179. package/dist/docs/assets/chunks/journeyDiagram-VCZTEJTY.BNEgWN1S.js +139 -0
  180. package/dist/docs/assets/chunks/kanban-definition-6JOO6SKY.B-4d4tC7.js +89 -0
  181. package/dist/docs/assets/chunks/katex.DkKDou_j.js +257 -0
  182. package/dist/docs/assets/chunks/layout.Dvbn9nSb.js +1 -0
  183. package/dist/docs/assets/chunks/linear.D2GM4p4b.js +1 -0
  184. package/dist/docs/assets/chunks/min.DVBtLK-B.js +1 -0
  185. package/dist/docs/assets/chunks/mindmap-definition-QFDTVHPH.CnJRI55x.js +96 -0
  186. package/dist/docs/assets/chunks/ordinal.DBvzRdQf.js +1 -0
  187. package/dist/docs/assets/chunks/pieDiagram-DEJITSTG.CtoaTFlA.js +30 -0
  188. package/dist/docs/assets/chunks/quadrantDiagram-34T5L4WZ.DtT24_vN.js +7 -0
  189. package/dist/docs/assets/chunks/requirementDiagram-MS252O5E.CjSO4o8f.js +84 -0
  190. package/dist/docs/assets/chunks/sankeyDiagram-XADWPNL6.-wWiIVWa.js +10 -0
  191. package/dist/docs/assets/chunks/sequenceDiagram-FGHM5R23.DSk8s4gX.js +157 -0
  192. package/dist/docs/assets/chunks/stateDiagram-FHFEXIEX.BFKAsdkN.js +1 -0
  193. package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.C4CLm481.js +1 -0
  194. package/dist/docs/assets/chunks/{theme.Dnsd3XOn.js → theme.C0MctGaz.js} +2 -2
  195. package/dist/docs/assets/chunks/timeline-definition-GMOUNBTQ.TUNJbAFe.js +120 -0
  196. package/dist/docs/assets/chunks/vennDiagram-DHZGUBPP.C-RGNnk4.js +34 -0
  197. package/dist/docs/assets/chunks/virtual_mermaid-config.DDnGl6nM.js +1 -0
  198. package/dist/docs/assets/chunks/wardley-RL74JXVD.g5efOWmT.js +162 -0
  199. package/dist/docs/assets/chunks/wardleyDiagram-NUSXRM2D.DH4zt73Y.js +20 -0
  200. package/dist/docs/assets/chunks/xychartDiagram-5P7HB3ND.B-3k6bF6.js +7 -0
  201. package/dist/docs/assets/{deployment.md.JenwuCCB.js → deployment.md.Dm4Qo3hp.js} +5 -5
  202. package/dist/docs/assets/{deployment.md.JenwuCCB.lean.js → deployment.md.Dm4Qo3hp.lean.js} +1 -1
  203. package/dist/docs/assets/{evals.md.C7JLjoEP.js → evals.md.BLDRt5LH.js} +4 -4
  204. package/dist/docs/assets/{evals.md.C7JLjoEP.lean.js → evals.md.BLDRt5LH.lean.js} +1 -1
  205. package/dist/docs/assets/guides_agent-to-agent.md.BI0xclmy.js +14 -0
  206. package/dist/docs/assets/guides_agent-to-agent.md.BI0xclmy.lean.js +1 -0
  207. package/dist/docs/assets/{guides_bitbucket.md.DZPzmUjU.js → guides_bitbucket.md.CTpCl__f.js} +1 -1
  208. package/dist/docs/assets/{guides_bitbucket.md.DZPzmUjU.lean.js → guides_bitbucket.md.CTpCl__f.lean.js} +1 -1
  209. package/dist/docs/assets/{guides_cloud-agents.md.BsloyHdY.js → guides_cloud-agents.md.lSE_l7lH.js} +2 -2
  210. package/dist/docs/assets/{guides_cloud-agents.md.BsloyHdY.lean.js → guides_cloud-agents.md.lSE_l7lH.lean.js} +1 -1
  211. package/dist/docs/assets/{guides_convert-automation.md.B4sjlodG.js → guides_convert-automation.md.Ck6Cr68A.js} +1 -1
  212. package/dist/docs/assets/{guides_convert-automation.md.B4sjlodG.lean.js → guides_convert-automation.md.Ck6Cr68A.lean.js} +1 -1
  213. package/dist/docs/assets/{guides_github.md.TZaTZlfz.js → guides_github.md.D6ER29dG.js} +1 -1
  214. package/dist/docs/assets/{guides_github.md.TZaTZlfz.lean.js → guides_github.md.D6ER29dG.lean.js} +1 -1
  215. package/dist/docs/assets/{guides_gitlab.md.BmqwQfdG.js → guides_gitlab.md.P-TjBnS5.js} +1 -1
  216. package/dist/docs/assets/{guides_gitlab.md.BmqwQfdG.lean.js → guides_gitlab.md.P-TjBnS5.lean.js} +1 -1
  217. package/dist/docs/assets/guides_grokbot-agents.md.WBZIOvkz.js +9 -0
  218. package/dist/docs/assets/{guides_grokbot-agents.md.DyV-WArv.lean.js → guides_grokbot-agents.md.WBZIOvkz.lean.js} +1 -1
  219. package/dist/docs/assets/{guides_improve.md.BGVk32bK.js → guides_improve.md.BKaDuKKK.js} +1 -1
  220. package/dist/docs/assets/{guides_improve.md.BGVk32bK.lean.js → guides_improve.md.BKaDuKKK.lean.js} +1 -1
  221. package/dist/docs/assets/{guides_mcp-oauth.md.Dp6cDP7f.js → guides_mcp-oauth.md.DMNMpXtO.js} +1 -1
  222. package/dist/docs/assets/{guides_mcp-oauth.md.Dp6cDP7f.lean.js → guides_mcp-oauth.md.DMNMpXtO.lean.js} +1 -1
  223. package/dist/docs/assets/{guides_opentelemetry.md.SCRMskno.js → guides_opentelemetry.md._CRfDyzH.js} +14 -14
  224. package/dist/docs/assets/{guides_opentelemetry.md.SCRMskno.lean.js → guides_opentelemetry.md._CRfDyzH.lean.js} +1 -1
  225. package/dist/docs/assets/{guides_slack.md.D4RVMM4G.js → guides_slack.md.DdT8rmsj.js} +12 -4
  226. package/dist/docs/assets/{guides_slack.md.D4RVMM4G.lean.js → guides_slack.md.DdT8rmsj.lean.js} +1 -1
  227. package/dist/docs/assets/{guides_webhooks.md.CJK484ex.js → guides_webhooks.md.aQW10HRe.js} +2 -2
  228. package/dist/docs/assets/{guides_webhooks.md.CJK484ex.lean.js → guides_webhooks.md.aQW10HRe.lean.js} +1 -1
  229. package/dist/docs/assets/hillclimbing.md.Dq4kkVIL.js +1 -0
  230. package/dist/docs/assets/hillclimbing.md.Dq4kkVIL.lean.js +1 -0
  231. package/dist/docs/assets/index.md.BFVyY2KT.js +17 -0
  232. package/dist/docs/assets/index.md.BFVyY2KT.lean.js +1 -0
  233. package/dist/docs/assets/{quickstart.md.DdQOF7Y8.js → quickstart.md.D3MjSZN-.js} +30 -38
  234. package/dist/docs/assets/quickstart.md.D3MjSZN-.lean.js +1 -0
  235. package/dist/docs/assets/{reference_agent-config.md.CvoL6pof.js → reference_agent-config.md.CfVA-LZJ.js} +1 -1
  236. package/dist/docs/assets/{reference_agent-config.md.CvoL6pof.lean.js → reference_agent-config.md.CfVA-LZJ.lean.js} +1 -1
  237. package/dist/docs/assets/{reference_artifacts.md.Dior32Qw.js → reference_artifacts.md.Vf7qyIZ-.js} +1 -1
  238. package/dist/docs/assets/{reference_artifacts.md.Dior32Qw.lean.js → reference_artifacts.md.Vf7qyIZ-.lean.js} +1 -1
  239. package/dist/docs/assets/{reference_channels.md.CAo-iK4j.js → reference_channels.md.icqLKcTc.js} +2 -12
  240. package/dist/docs/assets/{reference_channels.md.CAo-iK4j.lean.js → reference_channels.md.icqLKcTc.lean.js} +1 -1
  241. package/dist/docs/assets/{reference_cli.md.Deg7849l.js → reference_cli.md.B2dBL6L8.js} +3 -3
  242. package/dist/docs/assets/{reference_cli.md.Deg7849l.lean.js → reference_cli.md.B2dBL6L8.lean.js} +1 -1
  243. package/dist/docs/assets/{reference_connections.md.BojkC6c5.js → reference_connections.md.Cb3U_c8n.js} +4 -4
  244. package/dist/docs/assets/{reference_connections.md.BojkC6c5.lean.js → reference_connections.md.Cb3U_c8n.lean.js} +1 -1
  245. package/dist/docs/assets/{reference_extensions.md.ZAVUyuEX.js → reference_extensions.md.wlFD3cUR.js} +2 -2
  246. package/dist/docs/assets/{reference_extensions.md.ZAVUyuEX.lean.js → reference_extensions.md.wlFD3cUR.lean.js} +1 -1
  247. package/dist/docs/assets/{reference_hooks.md.BlM_bOg6.js → reference_hooks.md.CZuynAxj.js} +3 -3
  248. package/dist/docs/assets/{reference_hooks.md.BlM_bOg6.lean.js → reference_hooks.md.CZuynAxj.lean.js} +1 -1
  249. package/dist/docs/assets/{reference_http-api.md.BwaCo-VO.js → reference_http-api.md.DTKcYE6L.js} +3 -3
  250. package/dist/docs/assets/{reference_http-api.md.BwaCo-VO.lean.js → reference_http-api.md.DTKcYE6L.lean.js} +1 -1
  251. package/dist/docs/assets/{reference_instructions.md.CR7XSsGk.js → reference_instructions.md.D7gkckK-.js} +1 -1
  252. package/dist/docs/assets/{reference_instructions.md.CR7XSsGk.lean.js → reference_instructions.md.D7gkckK-.lean.js} +1 -1
  253. package/dist/docs/assets/{reference_playground.md.DLnoaczX.js → reference_playground.md.D2YExv5K.js} +1 -1
  254. package/dist/docs/assets/{reference_playground.md.DLnoaczX.lean.js → reference_playground.md.D2YExv5K.lean.js} +1 -1
  255. package/dist/docs/assets/{reference_project-layout.md.BEU8MtQV.js → reference_project-layout.md.DPxbUJyt.js} +3 -3
  256. package/dist/docs/assets/{reference_project-layout.md.BEU8MtQV.lean.js → reference_project-layout.md.DPxbUJyt.lean.js} +1 -1
  257. package/dist/docs/assets/{reference_prompt.md.DnaD5dNK.js → reference_prompt.md.BQ5uAv1F.js} +1 -1
  258. package/dist/docs/assets/{reference_prompt.md.DnaD5dNK.lean.js → reference_prompt.md.BQ5uAv1F.lean.js} +1 -1
  259. package/dist/docs/assets/{reference_schedules.md.DI_JrHgq.js → reference_schedules.md.BasfZWO-.js} +1 -1
  260. package/dist/docs/assets/{reference_schedules.md.DI_JrHgq.lean.js → reference_schedules.md.BasfZWO-.lean.js} +1 -1
  261. package/dist/docs/assets/{reference_sessions.md.CyXV1MUw.js → reference_sessions.md.YKvIsWAx.js} +1 -1
  262. package/dist/docs/assets/{reference_sessions.md.CyXV1MUw.lean.js → reference_sessions.md.YKvIsWAx.lean.js} +1 -1
  263. package/dist/docs/assets/{reference_skills.md.l2ezAcaN.js → reference_skills.md.rNgpsGd0.js} +1 -1
  264. package/dist/docs/assets/{reference_skills.md.l2ezAcaN.lean.js → reference_skills.md.rNgpsGd0.lean.js} +1 -1
  265. package/dist/docs/assets/{reference_subagents.md.CfsIloPm.js → reference_subagents.md.e5qitjJt.js} +2 -2
  266. package/dist/docs/assets/{reference_subagents.md.CfsIloPm.lean.js → reference_subagents.md.e5qitjJt.lean.js} +1 -1
  267. package/dist/docs/assets/{reference_tools.md.aGrn99hP.js → reference_tools.md.BdCO2aHZ.js} +4 -4
  268. package/dist/docs/assets/{reference_tools.md.aGrn99hP.lean.js → reference_tools.md.BdCO2aHZ.lean.js} +1 -1
  269. package/dist/docs/assets/{style.DCD_zyg3.css → style.Cfo2vbik.css} +1 -1
  270. package/dist/docs/assets/{templates_agentic-owners.md.BZSH4N9z.js → templates_agentic-owners.md.Da_AGDlH.js} +1 -1
  271. package/dist/docs/assets/{templates_agentic-owners.md.BZSH4N9z.lean.js → templates_agentic-owners.md.Da_AGDlH.lean.js} +1 -1
  272. package/dist/docs/assets/{templates_pr-autofixer.md.Bds_XWcV.js → templates_pr-autofixer.md.DqxocIGh.js} +1 -1
  273. package/dist/docs/assets/{templates_pr-autofixer.md.Bds_XWcV.lean.js → templates_pr-autofixer.md.DqxocIGh.lean.js} +1 -1
  274. package/dist/docs/assets/{templates_security-reviewer.md.lshxbCLK.js → templates_security-reviewer.md.Bhnvd8VE.js} +1 -1
  275. package/dist/docs/assets/{templates_security-reviewer.md.lshxbCLK.lean.js → templates_security-reviewer.md.Bhnvd8VE.lean.js} +1 -1
  276. package/dist/docs/assets/{templates_triage.md.Co4UNzkZ.js → templates_triage.md.BdBWO9Ic.js} +1 -1
  277. package/dist/docs/assets/{templates_triage.md.Co4UNzkZ.lean.js → templates_triage.md.BdBWO9Ic.lean.js} +1 -1
  278. package/dist/docs/assets/{troubleshooting.md.CYEAO9bM.js → troubleshooting.md.BcgNoYtJ.js} +1 -1
  279. package/dist/docs/assets/{troubleshooting.md.CYEAO9bM.lean.js → troubleshooting.md.BcgNoYtJ.lean.js} +1 -1
  280. package/dist/docs/building-with-agents.html +41 -8
  281. package/dist/docs/building-with-agents.md +13 -15
  282. package/dist/docs/deployment.html +44 -11
  283. package/dist/docs/deployment.md +6 -7
  284. package/dist/docs/evals.html +44 -11
  285. package/dist/docs/evals.md +5 -5
  286. package/dist/docs/guides/agent-to-agent.html +48 -11
  287. package/dist/docs/guides/agent-to-agent.md +40 -83
  288. package/dist/docs/guides/bitbucket.html +41 -8
  289. package/dist/docs/guides/cloud-agents.html +41 -8
  290. package/dist/docs/guides/cloud-agents.md +24 -20
  291. package/dist/docs/guides/convert-automation.html +41 -8
  292. package/dist/docs/guides/github.html +41 -8
  293. package/dist/docs/guides/github.md +1 -1
  294. package/dist/docs/guides/gitlab.html +41 -8
  295. package/dist/docs/guides/grokbot-agents.html +41 -8
  296. package/dist/docs/guides/grokbot-agents.md +26 -19
  297. package/dist/docs/guides/improve.html +41 -8
  298. package/dist/docs/guides/mcp-oauth.html +41 -8
  299. package/dist/docs/guides/mcp-oauth.md +1 -1
  300. package/dist/docs/guides/opentelemetry.html +53 -20
  301. package/dist/docs/guides/opentelemetry.md +28 -41
  302. package/dist/docs/guides/slack.html +51 -10
  303. package/dist/docs/guides/slack.md +53 -4
  304. package/dist/docs/guides/webhooks.html +42 -9
  305. package/dist/docs/guides/webhooks.md +3 -4
  306. package/dist/docs/hashmap.json +1 -1
  307. package/dist/docs/hillclimbing.html +40 -10
  308. package/dist/docs/hillclimbing.md +5 -5
  309. package/dist/docs/index.html +57 -12
  310. package/dist/docs/index.md +81 -150
  311. package/dist/docs/llms-full.txt +5779 -10297
  312. package/dist/docs/llms.txt +3 -29
  313. package/dist/docs/quickstart.html +70 -45
  314. package/dist/docs/quickstart.md +44 -105
  315. package/dist/docs/reference/agent-config.html +41 -8
  316. package/dist/docs/reference/artifacts.html +41 -8
  317. package/dist/docs/reference/channels.html +41 -18
  318. package/dist/docs/reference/channels.md +0 -16
  319. package/dist/docs/reference/cli.html +42 -9
  320. package/dist/docs/reference/cli.md +0 -16
  321. package/dist/docs/reference/connections.html +43 -10
  322. package/dist/docs/reference/connections.md +3 -5
  323. package/dist/docs/reference/extensions.html +42 -9
  324. package/dist/docs/reference/extensions.md +2 -2
  325. package/dist/docs/reference/hooks.html +42 -9
  326. package/dist/docs/reference/hooks.md +2 -4
  327. package/dist/docs/reference/http-api.html +42 -9
  328. package/dist/docs/reference/http-api.md +5 -5
  329. package/dist/docs/reference/instructions.html +41 -8
  330. package/dist/docs/reference/playground.html +40 -7
  331. package/dist/docs/reference/playground.md +2 -2
  332. package/dist/docs/reference/project-layout.html +42 -9
  333. package/dist/docs/reference/project-layout.md +3 -4
  334. package/dist/docs/reference/prompt.html +41 -8
  335. package/dist/docs/reference/schedules.html +41 -8
  336. package/dist/docs/reference/sessions.html +40 -7
  337. package/dist/docs/reference/sessions.md +5 -4
  338. package/dist/docs/reference/skills.html +41 -8
  339. package/dist/docs/reference/subagents.html +41 -8
  340. package/dist/docs/reference/subagents.md +2 -4
  341. package/dist/docs/reference/tools.html +43 -10
  342. package/dist/docs/reference/tools.md +2 -5
  343. package/dist/docs/templates/agentic-owners.html +41 -8
  344. package/dist/docs/templates/pr-autofixer.html +41 -8
  345. package/dist/docs/templates/security-reviewer.html +41 -8
  346. package/dist/docs/templates/triage.html +41 -8
  347. package/dist/docs/troubleshooting.html +40 -7
  348. package/dist/docs/troubleshooting.md +1 -2
  349. package/dist/evals/assertions.js +19 -19
  350. package/dist/evals/expect.js +1 -1
  351. package/dist/evals/judge.js +1 -1
  352. package/dist/evals/reporters.d.ts.map +1 -1
  353. package/dist/evals/reporters.js +8 -8
  354. package/dist/evals/run-facts.js +2 -2
  355. package/dist/evals.d.ts +1 -1
  356. package/dist/evals.d.ts.map +1 -1
  357. package/dist/evals.js +7 -7
  358. package/dist/extensions/cursor-cloud-agents/extension.js +1 -1
  359. package/dist/extensions/cursor-cloud-agents/lib/backend.js +3 -3
  360. package/dist/extensions/cursor-cloud-agents/lib/fleet.js +1 -1
  361. package/dist/extensions/cursor-cloud-agents/lib/repos.js +6 -6
  362. package/dist/extensions/cursor-cloud-agents/lib/transcript.d.ts.map +1 -1
  363. package/dist/extensions/cursor-cloud-agents/lib/transcript.js +2 -2
  364. package/dist/extensions/cursor-cloud-agents/tools/list.js +1 -1
  365. package/dist/extensions/improve/skills/yourself.js +1 -1
  366. package/dist/extensions/slack-communication/extension.d.ts +28 -0
  367. package/dist/extensions/slack-communication/extension.d.ts.map +1 -0
  368. package/dist/extensions/slack-communication/extension.js +32 -0
  369. package/dist/extensions/slack-communication/skills/slack-voice.d.ts +5 -0
  370. package/dist/extensions/slack-communication/skills/slack-voice.d.ts.map +1 -0
  371. package/dist/extensions/slack-communication/skills/slack-voice.js +54 -0
  372. package/dist/extensions/slack-communication/tools/delete-message.d.ts +4 -0
  373. package/dist/extensions/slack-communication/tools/delete-message.d.ts.map +1 -0
  374. package/dist/extensions/slack-communication/tools/delete-message.js +29 -0
  375. package/dist/extensions/slack-communication/tools/edit-message.d.ts +4 -0
  376. package/dist/extensions/slack-communication/tools/edit-message.d.ts.map +1 -0
  377. package/dist/extensions/slack-communication/tools/edit-message.js +37 -0
  378. package/dist/extensions/slack-communication/tools/post-card.d.ts +4 -0
  379. package/dist/extensions/slack-communication/tools/post-card.d.ts.map +1 -0
  380. package/dist/extensions/slack-communication/tools/post-card.js +25 -0
  381. package/dist/extensions/slack-communication/tools/post-file.d.ts +4 -0
  382. package/dist/extensions/slack-communication/tools/post-file.d.ts.map +1 -0
  383. package/dist/extensions/slack-communication/tools/post-file.js +76 -0
  384. package/dist/extensions/slack-communication/tools/post-update.d.ts +4 -0
  385. package/dist/extensions/slack-communication/tools/post-update.d.ts.map +1 -0
  386. package/dist/extensions/slack-communication/tools/post-update.js +36 -0
  387. package/dist/extensions/slack-communication/tools/react.d.ts +4 -0
  388. package/dist/extensions/slack-communication/tools/react.d.ts.map +1 -0
  389. package/dist/extensions/slack-communication/tools/react.js +27 -0
  390. package/dist/extensions/slack-communication/tools/set-status.d.ts +4 -0
  391. package/dist/extensions/slack-communication/tools/set-status.d.ts.map +1 -0
  392. package/dist/extensions/slack-communication/tools/set-status.js +18 -0
  393. package/dist/files-backends/cursor-hosted.d.ts +18 -6
  394. package/dist/files-backends/cursor-hosted.d.ts.map +1 -1
  395. package/dist/files-backends/cursor-hosted.js +357 -74
  396. package/dist/files-backends/local-fs.js +1 -1
  397. package/dist/files.d.ts +15 -0
  398. package/dist/files.d.ts.map +1 -1
  399. package/dist/filesystem.d.ts.map +1 -1
  400. package/dist/filesystem.js +15 -15
  401. package/dist/index.d.ts +5 -8
  402. package/dist/index.d.ts.map +1 -1
  403. package/dist/index.js +4 -6
  404. package/dist/internal/advertise-tools.js +6 -6
  405. package/dist/internal/approval-gate.js +1 -1
  406. package/dist/internal/artifacts-store.js +3 -3
  407. package/dist/internal/as-of.js +2 -2
  408. package/dist/internal/authored-alias-hooks.js +1 -1
  409. package/dist/internal/builtin-tools/reminders.js +2 -2
  410. package/dist/internal/chat-client.js +5 -5
  411. package/dist/internal/cli-ax.d.ts +1 -0
  412. package/dist/internal/cli-ax.d.ts.map +1 -1
  413. package/dist/internal/cli-ax.js +68 -13
  414. package/dist/internal/cli-bitbucket.js +10 -10
  415. package/dist/internal/cli-convert-automation.js +2 -2
  416. package/dist/internal/cli-cursor.d.ts +3 -11
  417. package/dist/internal/cli-cursor.d.ts.map +1 -1
  418. package/dist/internal/cli-cursor.js +5 -10
  419. package/dist/internal/cli-deploy.d.ts +12 -2
  420. package/dist/internal/cli-deploy.d.ts.map +1 -1
  421. package/dist/internal/cli-deploy.js +328 -96
  422. package/dist/internal/cli-docs.js +5 -5
  423. package/dist/internal/cli-github.js +15 -16
  424. package/dist/internal/cli-gitlab.js +10 -10
  425. package/dist/internal/cli-manifest.js +1 -1
  426. package/dist/internal/cli-mcp-oauth.d.ts.map +1 -1
  427. package/dist/internal/cli-mcp-oauth.js +5 -5
  428. package/dist/internal/cli-mcp.js +3 -3
  429. package/dist/internal/cli-skills.js +2 -2
  430. package/dist/internal/cli-slack.js +5 -5
  431. package/dist/internal/cloud-turn-cost.js +1 -1
  432. package/dist/internal/continuation-identity.d.ts.map +1 -1
  433. package/dist/internal/continuation-identity.js +14 -9
  434. package/dist/internal/conversation-mirror.d.ts.map +1 -1
  435. package/dist/internal/conversation-mirror.js +33 -2
  436. package/dist/internal/convert-automation/convert-workflow.js +25 -24
  437. package/dist/internal/convert-automation/types.d.ts +8 -0
  438. package/dist/internal/convert-automation/types.d.ts.map +1 -1
  439. package/dist/internal/cursor/account-mcp.d.ts +2 -2
  440. package/dist/internal/cursor/account-mcp.d.ts.map +1 -1
  441. package/dist/internal/cursor/account-mcp.js +32 -27
  442. package/dist/internal/cursor/backend-client.d.ts +15 -10
  443. package/dist/internal/cursor/backend-client.d.ts.map +1 -1
  444. package/dist/internal/cursor/backend-client.js +17 -11
  445. package/dist/internal/cursor/credentials.js +1 -1
  446. package/dist/internal/cursor/hosted-store-secrets.d.ts +16 -0
  447. package/dist/internal/cursor/hosted-store-secrets.d.ts.map +1 -1
  448. package/dist/internal/cursor/hosted-store-secrets.js +25 -0
  449. package/dist/internal/cursor-account-mcp-auth.js +9 -9
  450. package/dist/internal/cursor-deployment-relay.js +9 -9
  451. package/dist/internal/cursor-event-relay.js +10 -10
  452. package/dist/internal/cursor-relay-core.js +2 -2
  453. package/dist/internal/deploy-client.d.ts +106 -9
  454. package/dist/internal/deploy-client.d.ts.map +1 -1
  455. package/dist/internal/deploy-client.js +171 -23
  456. package/dist/internal/deploy-manifest.d.ts +13 -0
  457. package/dist/internal/deploy-manifest.d.ts.map +1 -1
  458. package/dist/internal/deploy-manifest.js +32 -16
  459. package/dist/internal/discovery/agent-config.d.ts +5 -0
  460. package/dist/internal/discovery/agent-config.d.ts.map +1 -1
  461. package/dist/internal/discovery/agent-config.js +27 -0
  462. package/dist/internal/discovery/agent.d.ts.map +1 -1
  463. package/dist/internal/discovery/agent.js +10 -8
  464. package/dist/internal/discovery/channels.js +4 -4
  465. package/dist/internal/discovery/connections.js +4 -4
  466. package/dist/internal/discovery/cursor-plugin.js +12 -12
  467. package/dist/internal/discovery/extension-overlay.js +3 -3
  468. package/dist/internal/discovery/extensions.js +6 -6
  469. package/dist/internal/discovery/info.js +9 -9
  470. package/dist/internal/discovery/instructions.js +1 -1
  471. package/dist/internal/discovery/project.d.ts.map +1 -1
  472. package/dist/internal/discovery/project.js +4 -4
  473. package/dist/internal/discovery/services.js +1 -1
  474. package/dist/internal/discovery/tools.js +1 -1
  475. package/dist/internal/docs-site.js +2 -2
  476. package/dist/internal/env-file.js +1 -1
  477. package/dist/internal/eval-run-store.d.ts.map +1 -1
  478. package/dist/internal/eval-run-store.js +7 -7
  479. package/dist/internal/eval-runner.js +14 -14
  480. package/dist/internal/evals-client.js +4 -4
  481. package/dist/internal/event-log.js +8 -8
  482. package/dist/internal/event-mapper.d.ts +18 -0
  483. package/dist/internal/event-mapper.d.ts.map +1 -1
  484. package/dist/internal/event-mapper.js +34 -2
  485. package/dist/internal/filesystem/format.d.ts.map +1 -1
  486. package/dist/internal/filesystem/format.js +6 -3
  487. package/dist/internal/filesystem/scratch.js +3 -3
  488. package/dist/internal/filesystem/tools.d.ts.map +1 -1
  489. package/dist/internal/filesystem/tools.js +6 -6
  490. package/dist/internal/filesystem/walk.js +1 -1
  491. package/dist/internal/framework-file-storage.d.ts +6 -2
  492. package/dist/internal/framework-file-storage.d.ts.map +1 -1
  493. package/dist/internal/framework-file-storage.js +91 -2
  494. package/dist/internal/framework-storage-selection.d.ts +0 -6
  495. package/dist/internal/framework-storage-selection.d.ts.map +1 -1
  496. package/dist/internal/framework-storage-selection.js +2 -11
  497. package/dist/internal/github-fanout.js +3 -3
  498. package/dist/internal/guest-network.js +4 -4
  499. package/dist/internal/host-files.js +1 -1
  500. package/dist/internal/host-kv.js +2 -2
  501. package/dist/internal/hosted-admission-adapter.d.ts +2 -0
  502. package/dist/internal/hosted-admission-adapter.d.ts.map +1 -1
  503. package/dist/internal/hosted-catch-protocol.d.ts.map +1 -1
  504. package/dist/internal/hosted-catch-protocol.js +2 -4
  505. package/dist/internal/hosted-catch.js +1 -1
  506. package/dist/internal/hosted-delivery-protocol.d.ts +29 -0
  507. package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
  508. package/dist/internal/hosted-delivery-protocol.js +76 -8
  509. package/dist/internal/hosted-delivery.d.ts.map +1 -1
  510. package/dist/internal/hosted-delivery.js +201 -64
  511. package/dist/internal/hosted-execution-diag.js +3 -3
  512. package/dist/internal/hosted-execution-latency.d.ts +80 -0
  513. package/dist/internal/hosted-execution-latency.d.ts.map +1 -0
  514. package/dist/internal/hosted-execution-latency.js +220 -0
  515. package/dist/internal/hosting.d.ts +5 -5
  516. package/dist/internal/hosting.d.ts.map +1 -1
  517. package/dist/internal/hosting.js +5 -6
  518. package/dist/internal/http-channel-define.d.ts +11 -0
  519. package/dist/internal/http-channel-define.d.ts.map +1 -0
  520. package/dist/internal/http-channel-define.js +18 -0
  521. package/dist/internal/http-channel.d.ts +2 -3
  522. package/dist/internal/http-channel.d.ts.map +1 -1
  523. package/dist/internal/http-channel.js +3 -4
  524. package/dist/internal/http-control-plane-session.d.ts +7 -3
  525. package/dist/internal/http-control-plane-session.d.ts.map +1 -1
  526. package/dist/internal/http-control-plane-session.js +22 -10
  527. package/dist/internal/incoming-headers-to-fetch.d.ts +10 -0
  528. package/dist/internal/incoming-headers-to-fetch.d.ts.map +1 -0
  529. package/dist/internal/incoming-headers-to-fetch.js +41 -0
  530. package/dist/internal/init-interview.js +7 -7
  531. package/dist/internal/init-project.d.ts.map +1 -1
  532. package/dist/internal/init-project.js +14 -14
  533. package/dist/internal/init-scaffold.js +1 -1
  534. package/dist/internal/inline-stdio-mcp.js +2 -2
  535. package/dist/internal/install-cursor-skills.js +10 -10
  536. package/dist/internal/json-schema.js +1 -1
  537. package/dist/internal/local-control-plane.d.ts.map +1 -1
  538. package/dist/internal/local-control-plane.js +3 -3
  539. package/dist/internal/local-env.js +3 -3
  540. package/dist/internal/log-ring.js +1 -1
  541. package/dist/internal/logs-client.js +1 -1
  542. package/dist/internal/mcp-endpoint.js +8 -8
  543. package/dist/internal/mcp-host.js +4 -4
  544. package/dist/internal/mcp-oauth-on-demand.js +3 -3
  545. package/dist/internal/mcp-oauth.js +5 -5
  546. package/dist/internal/net.js +2 -2
  547. package/dist/internal/otel/config.js +3 -3
  548. package/dist/internal/otel/runtime.js +13 -13
  549. package/dist/internal/peer-connections.js +2 -2
  550. package/dist/internal/platform-schedule-sync.js +1 -1
  551. package/dist/internal/platform-timers.js +1 -1
  552. package/dist/internal/playground/static.js +2 -2
  553. package/dist/internal/playground/toolchain.js +2 -2
  554. package/dist/internal/playground-proxy.js +3 -3
  555. package/dist/internal/process-memory-telemetry.js +1 -1
  556. package/dist/internal/reminder-runner.d.ts.map +1 -1
  557. package/dist/internal/reminder-runner.js +7 -7
  558. package/dist/internal/reminder-store.js +1 -1
  559. package/dist/internal/request-error-status.d.ts.map +1 -1
  560. package/dist/internal/request-error-status.js +9 -0
  561. package/dist/internal/resolved-connections.js +8 -8
  562. package/dist/internal/result-output.d.ts +14 -2
  563. package/dist/internal/result-output.d.ts.map +1 -1
  564. package/dist/internal/result-output.js +45 -2
  565. package/dist/internal/router.js +4 -4
  566. package/dist/internal/run-client.js +2 -2
  567. package/dist/internal/schedule-runner.js +6 -6
  568. package/dist/internal/scm/pr-url.d.ts +3 -1
  569. package/dist/internal/scm/pr-url.d.ts.map +1 -1
  570. package/dist/internal/scm/pr-url.js +10 -2
  571. package/dist/internal/sdk-runner.d.ts.map +1 -1
  572. package/dist/internal/sdk-runner.js +14 -15
  573. package/dist/internal/serve-restart.js +1 -1
  574. package/dist/internal/server.d.ts.map +1 -1
  575. package/dist/internal/server.js +81 -87
  576. package/dist/internal/session-cost.js +3 -3
  577. package/dist/internal/session-engine.d.ts +34 -0
  578. package/dist/internal/session-engine.d.ts.map +1 -1
  579. package/dist/internal/session-engine.js +380 -184
  580. package/dist/internal/session-run-log.d.ts.map +1 -1
  581. package/dist/internal/session-run-log.js +4 -4
  582. package/dist/internal/session-store.d.ts +47 -3
  583. package/dist/internal/session-store.d.ts.map +1 -1
  584. package/dist/internal/session-store.js +198 -33
  585. package/dist/internal/sessions-client.js +3 -3
  586. package/dist/internal/slack-thread-key.d.ts +7 -0
  587. package/dist/internal/slack-thread-key.d.ts.map +1 -0
  588. package/dist/internal/slack-thread-key.js +10 -0
  589. package/dist/internal/sleep.js +1 -1
  590. package/dist/internal/storage-coordinator.d.ts +17 -0
  591. package/dist/internal/storage-coordinator.d.ts.map +1 -1
  592. package/dist/internal/storage-coordinator.js +111 -11
  593. package/dist/internal/storage.d.ts +2 -0
  594. package/dist/internal/storage.d.ts.map +1 -0
  595. package/dist/internal/storage.js +1 -0
  596. package/dist/internal/store-mirror.js +4 -4
  597. package/dist/internal/terminal-style.js +2 -2
  598. package/dist/internal/tool-result.js +3 -3
  599. package/dist/internal/trajectory.js +7 -7
  600. package/dist/internal/turn-governor.js +2 -2
  601. package/dist/internal/turn-outbox.js +1 -1
  602. package/dist/internal/update-check.js +2 -2
  603. package/dist/internal/v2-hosting.d.ts +9 -0
  604. package/dist/internal/v2-hosting.d.ts.map +1 -1
  605. package/dist/internal/v2-hosting.js +10 -0
  606. package/dist/internal/workspace.d.ts +13 -10
  607. package/dist/internal/workspace.d.ts.map +1 -1
  608. package/dist/internal/workspace.js +17 -16
  609. package/dist/kv/memory-kv.d.ts +6 -4
  610. package/dist/kv/memory-kv.d.ts.map +1 -1
  611. package/dist/kv/memory-kv.js +9 -7
  612. package/dist/kv.d.ts +4 -7
  613. package/dist/kv.d.ts.map +1 -1
  614. package/dist/kv.js +4 -7
  615. package/dist/otel-public.d.ts +7 -0
  616. package/dist/otel-public.d.ts.map +1 -0
  617. package/dist/otel-public.js +5 -0
  618. package/dist/otel.d.ts +7 -2
  619. package/dist/otel.d.ts.map +1 -1
  620. package/dist/otel.js +7 -2
  621. package/dist/playground/assets/index-BLlKgZtI.css +1 -0
  622. package/dist/playground/assets/index-CDS5p9sR.js +67 -0
  623. package/dist/playground/index.html +2 -2
  624. package/dist/prompt.js +1 -1
  625. package/dist/result.d.ts +10 -4
  626. package/dist/result.d.ts.map +1 -1
  627. package/dist/result.js +9 -3
  628. package/dist/storage-backends/cursor-hosted-v2.js +2 -2
  629. package/dist/storage-backends/cursor-hosted.d.ts +5 -17
  630. package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
  631. package/dist/storage-backends/cursor-hosted.js +6 -20
  632. package/dist/storage-backends/file-kv.js +7 -7
  633. package/dist/storage.d.ts +20 -2
  634. package/dist/storage.d.ts.map +1 -1
  635. package/dist/storage.js +7 -6
  636. package/dist/types.d.ts +67 -11
  637. package/dist/types.d.ts.map +1 -1
  638. package/dist/types.js +12 -4
  639. package/docs/README.md +83 -152
  640. package/docs/building-with-agents.md +13 -15
  641. package/docs/deployment.md +6 -7
  642. package/docs/evals.md +5 -5
  643. package/docs/guides/agent-to-agent.md +41 -84
  644. package/docs/guides/cloud-agents.md +25 -20
  645. package/docs/guides/github.md +1 -1
  646. package/docs/guides/grokbot-agents.md +27 -19
  647. package/docs/guides/mcp-oauth.md +1 -1
  648. package/docs/guides/opentelemetry.md +28 -41
  649. package/docs/guides/slack.md +53 -4
  650. package/docs/guides/webhooks.md +3 -4
  651. package/docs/hillclimbing.md +5 -5
  652. package/docs/quickstart.md +45 -106
  653. package/docs/reference/channels.md +0 -16
  654. package/docs/reference/cli.md +0 -16
  655. package/docs/reference/connections.md +3 -5
  656. package/docs/reference/extensions.md +2 -2
  657. package/docs/reference/hooks.md +2 -4
  658. package/docs/reference/http-api.md +5 -5
  659. package/docs/reference/playground.md +2 -2
  660. package/docs/reference/project-layout.md +3 -4
  661. package/docs/reference/sessions.md +5 -4
  662. package/docs/reference/subagents.md +2 -4
  663. package/docs/reference/tools.md +2 -5
  664. package/docs/troubleshooting.md +1 -2
  665. package/package.json +55 -37
  666. package/skills/framework-map/SKILL.md +2 -2
  667. package/skills/otel/SKILL.md +8 -18
  668. package/src/bin/agent-serve.ts +93 -72
  669. package/src/channels/bitbucket/api.ts +8 -8
  670. package/src/channels/bitbucket/binding.ts +4 -4
  671. package/src/channels/bitbucket/bitbucket-channel.ts +1 -1
  672. package/src/channels/bitbucket/bitbucket-webhook.ts +1 -1
  673. package/src/channels/bitbucket/checks.ts +3 -4
  674. package/src/channels/bitbucket/cursor-account.ts +1 -1
  675. package/src/channels/bitbucket/events.ts +1 -1
  676. package/src/channels/change-monitors/change-monitors-channel.ts +2 -2
  677. package/src/channels/checks.ts +5 -4
  678. package/src/channels/deployments/deployments-channel.ts +1 -1
  679. package/src/channels/github/api.ts +1 -1
  680. package/src/channels/github/checks.ts +1 -1
  681. package/src/channels/github/cursor-account.ts +3 -3
  682. package/src/channels/github/defaults.ts +8 -4
  683. package/src/channels/github/events.ts +1 -1
  684. package/src/channels/github/forward.ts +8 -8
  685. package/src/channels/github/github-channel.ts +19 -2
  686. package/src/channels/github/progress.ts +7 -2
  687. package/src/channels/github/state.ts +6 -0
  688. package/src/channels/github/types.ts +6 -0
  689. package/src/channels/gitlab/binding.ts +4 -4
  690. package/src/channels/gitlab/checks.ts +3 -4
  691. package/src/channels/gitlab/cursor-account.ts +1 -1
  692. package/src/channels/gitlab/events.ts +1 -1
  693. package/src/channels/gitlab/gitlab-channel.ts +1 -1
  694. package/src/channels/gitlab/gitlab-webhook.ts +1 -1
  695. package/src/channels/gitlab/replay.ts +2 -2
  696. package/src/channels/origin/binding.ts +6 -3
  697. package/src/channels/origin/checks.ts +27 -17
  698. package/src/channels/origin/cursor-account.ts +1 -1
  699. package/src/channels/origin/defaults.ts +5 -1
  700. package/src/channels/origin/events.ts +1 -1
  701. package/src/channels/origin/origin-channel.ts +2 -1
  702. package/src/channels/origin/origin-webhook.ts +2 -2
  703. package/src/channels/slack/agentic-delivery.ts +659 -0
  704. package/src/channels/slack/agentic-posted.ts +148 -0
  705. package/src/channels/slack/agentic-signals.ts +248 -0
  706. package/src/channels/slack/api.ts +51 -11
  707. package/src/channels/slack/approvals.ts +1 -1
  708. package/src/channels/slack/attachments.ts +1 -1
  709. package/src/channels/slack/auth.ts +3 -1
  710. package/src/channels/slack/blocks.ts +3 -3
  711. package/src/channels/slack/bot-mentions.ts +5 -7
  712. package/src/channels/slack/channel-watch.ts +1 -1
  713. package/src/channels/slack/cli-project.ts +3 -3
  714. package/src/channels/slack/defaults.ts +109 -37
  715. package/src/channels/slack/dispatch.ts +299 -170
  716. package/src/channels/slack/doctor.ts +1 -1
  717. package/src/channels/slack/eval-directive.ts +1 -1
  718. package/src/channels/slack/external-policy.ts +15 -2
  719. package/src/channels/slack/footer.ts +108 -0
  720. package/src/channels/slack/index.ts +2 -0
  721. package/src/channels/slack/interactive.ts +4 -2
  722. package/src/channels/slack/live-delivery.ts +23 -7
  723. package/src/channels/slack/log.ts +1 -1
  724. package/src/channels/slack/manifest.ts +1 -1
  725. package/src/channels/slack/nudge-carrier.ts +1 -1
  726. package/src/channels/slack/nudge-store.ts +2 -2
  727. package/src/channels/slack/paint-start.ts +93 -0
  728. package/src/channels/slack/placeholder.ts +315 -0
  729. package/src/channels/slack/progress-delivery.ts +14 -1
  730. package/src/channels/slack/reasoning-chip.ts +48 -0
  731. package/src/channels/slack/recording-sink.ts +176 -0
  732. package/src/channels/slack/reply-options.ts +71 -15
  733. package/src/channels/slack/setup.ts +1 -1
  734. package/src/channels/slack/slack-channel.ts +73 -13
  735. package/src/channels/slack/socket-mode.ts +2 -2
  736. package/src/channels/slack/thread-context.ts +5 -5
  737. package/src/channels/slack/tool-approval-events.ts +54 -38
  738. package/src/channels/slack/tool-cards.ts +1 -1
  739. package/src/channels/slack/tool-chip.ts +36 -0
  740. package/src/channels/slack/types.ts +47 -7
  741. package/src/channels/slack/upload.ts +142 -0
  742. package/src/channels.ts +12 -30
  743. package/src/dashboard-session-url.ts +32 -0
  744. package/src/evals/assertions.ts +19 -19
  745. package/src/evals/expect.ts +1 -1
  746. package/src/evals/judge.ts +1 -1
  747. package/src/evals/reporters.ts +8 -9
  748. package/src/evals/run-facts.ts +2 -2
  749. package/src/evals.ts +7 -10
  750. package/src/extensions/cursor-cloud-agents/extension.ts +1 -1
  751. package/src/extensions/cursor-cloud-agents/lib/backend.ts +3 -3
  752. package/src/extensions/cursor-cloud-agents/lib/fleet.ts +1 -1
  753. package/src/extensions/cursor-cloud-agents/lib/repos.ts +3 -3
  754. package/src/extensions/cursor-cloud-agents/lib/transcript.ts +3 -4
  755. package/src/extensions/cursor-cloud-agents/tools/list.ts +1 -1
  756. package/src/extensions/improve/skills/yourself.ts +1 -1
  757. package/src/extensions/slack-communication/evals/harness.ts +728 -0
  758. package/src/extensions/slack-communication/evals/slack-communication.eval.ts +953 -0
  759. package/src/extensions/slack-communication/evals/slack-placeholder.eval.ts +194 -0
  760. package/src/extensions/slack-communication/extension.ts +45 -0
  761. package/src/extensions/slack-communication/skills/slack-voice.ts +59 -0
  762. package/src/extensions/slack-communication/tools/delete-message.ts +34 -0
  763. package/src/extensions/slack-communication/tools/edit-message.ts +42 -0
  764. package/src/extensions/slack-communication/tools/post-card.ts +28 -0
  765. package/src/extensions/slack-communication/tools/post-file.ts +85 -0
  766. package/src/extensions/slack-communication/tools/post-update.ts +41 -0
  767. package/src/extensions/slack-communication/tools/react.ts +33 -0
  768. package/src/extensions/slack-communication/tools/set-status.ts +21 -0
  769. package/src/files-backends/cursor-hosted.ts +502 -98
  770. package/src/files-backends/local-fs.ts +1 -1
  771. package/src/files.ts +15 -0
  772. package/src/filesystem.ts +16 -18
  773. package/src/index.ts +4 -36
  774. package/src/internal/advertise-tools.ts +6 -6
  775. package/src/internal/approval-gate.ts +1 -1
  776. package/src/internal/artifacts-store.ts +3 -3
  777. package/src/internal/as-of.ts +2 -2
  778. package/src/internal/authored-alias-hooks.ts +1 -1
  779. package/src/internal/authored-loaders.ts +2 -3
  780. package/src/internal/builtin-tools/reminders.ts +2 -2
  781. package/src/internal/chat-client.ts +5 -5
  782. package/src/internal/cli-ax.ts +84 -14
  783. package/src/internal/cli-bitbucket.ts +11 -11
  784. package/src/internal/cli-convert-automation.ts +2 -2
  785. package/src/internal/cli-cursor.ts +5 -16
  786. package/src/internal/cli-deploy.ts +389 -104
  787. package/src/internal/cli-docs.ts +5 -5
  788. package/src/internal/cli-github.ts +16 -19
  789. package/src/internal/cli-gitlab.ts +11 -11
  790. package/src/internal/cli-manifest.ts +1 -1
  791. package/src/internal/cli-mcp-oauth.ts +5 -7
  792. package/src/internal/cli-mcp.ts +3 -3
  793. package/src/internal/cli-skills.ts +2 -2
  794. package/src/internal/cli-slack.ts +5 -5
  795. package/src/internal/cloud-turn-cost.ts +1 -1
  796. package/src/internal/continuation-identity.ts +13 -9
  797. package/src/internal/conversation-mirror.ts +36 -3
  798. package/src/internal/convert-automation/convert-workflow.ts +27 -27
  799. package/src/internal/convert-automation/types.ts +9 -0
  800. package/src/internal/cursor/account-mcp.ts +48 -31
  801. package/src/internal/cursor/backend-client.ts +28 -17
  802. package/src/internal/cursor/credentials.ts +1 -1
  803. package/src/internal/cursor/hosted-store-secrets.ts +34 -0
  804. package/src/internal/cursor-account-mcp-auth.ts +9 -9
  805. package/src/internal/cursor-deployment-relay.ts +10 -10
  806. package/src/internal/cursor-event-relay.ts +10 -10
  807. package/src/internal/cursor-relay-core.ts +2 -2
  808. package/src/internal/deploy-client.ts +266 -24
  809. package/src/internal/deploy-manifest.ts +46 -8
  810. package/src/internal/discovery/agent-config.ts +34 -0
  811. package/src/internal/discovery/agent.ts +14 -6
  812. package/src/internal/discovery/channels.ts +4 -4
  813. package/src/internal/discovery/connections.ts +4 -4
  814. package/src/internal/discovery/cursor-plugin.ts +12 -12
  815. package/src/internal/discovery/extension-overlay.ts +3 -3
  816. package/src/internal/discovery/extensions.ts +6 -6
  817. package/src/internal/discovery/info.ts +9 -9
  818. package/src/internal/discovery/instructions.ts +1 -1
  819. package/src/internal/discovery/project.ts +4 -4
  820. package/src/internal/discovery/services.ts +1 -1
  821. package/src/internal/discovery/tools.ts +1 -1
  822. package/src/internal/docs-site.ts +2 -2
  823. package/src/internal/env-file.ts +2 -2
  824. package/src/internal/eval-run-store.ts +7 -9
  825. package/src/internal/eval-runner.ts +20 -20
  826. package/src/internal/evals-client.ts +6 -6
  827. package/src/internal/event-log.ts +10 -10
  828. package/src/internal/event-mapper.ts +37 -2
  829. package/src/internal/filesystem/format.ts +11 -12
  830. package/src/internal/filesystem/scratch.ts +3 -3
  831. package/src/internal/filesystem/tools.ts +6 -8
  832. package/src/internal/filesystem/walk.ts +1 -1
  833. package/src/internal/framework-file-storage.ts +104 -4
  834. package/src/internal/framework-storage-selection.ts +2 -12
  835. package/src/internal/github-fanout.ts +4 -4
  836. package/src/internal/guest-network.ts +4 -4
  837. package/src/internal/host-files.ts +1 -1
  838. package/src/internal/host-kv.ts +2 -2
  839. package/src/internal/hosted-admission-adapter.ts +2 -0
  840. package/src/internal/hosted-catch-protocol.ts +3 -5
  841. package/src/internal/hosted-catch.ts +1 -1
  842. package/src/internal/hosted-delivery-protocol.ts +111 -13
  843. package/src/internal/hosted-delivery.ts +286 -81
  844. package/src/internal/hosted-execution-diag.ts +3 -3
  845. package/src/internal/hosted-execution-latency.ts +334 -0
  846. package/src/internal/hosting.ts +5 -6
  847. package/src/internal/http-channel-define.ts +27 -0
  848. package/src/internal/http-channel.ts +3 -4
  849. package/src/internal/http-control-plane-session.ts +24 -11
  850. package/src/internal/incoming-headers-to-fetch.ts +54 -0
  851. package/src/internal/init-interview.ts +7 -7
  852. package/src/internal/init-project.ts +14 -16
  853. package/src/internal/init-scaffold.ts +1 -1
  854. package/src/internal/inline-stdio-mcp.ts +2 -2
  855. package/src/internal/install-cursor-skills.ts +11 -11
  856. package/src/internal/json-schema.ts +1 -1
  857. package/src/internal/local-control-plane.ts +4 -5
  858. package/src/internal/local-env.ts +3 -3
  859. package/src/internal/log-ring.ts +1 -1
  860. package/src/internal/logs-client.ts +1 -1
  861. package/src/internal/mcp-endpoint.ts +10 -10
  862. package/src/internal/mcp-host.ts +9 -9
  863. package/src/internal/mcp-oauth-on-demand.ts +3 -3
  864. package/src/internal/mcp-oauth.ts +5 -5
  865. package/src/internal/net.ts +2 -2
  866. package/src/internal/otel/config.ts +3 -3
  867. package/src/internal/otel/runtime.ts +14 -14
  868. package/src/internal/peer-connections.ts +2 -2
  869. package/src/internal/platform-schedule-sync.ts +1 -1
  870. package/src/internal/platform-timers.ts +1 -1
  871. package/src/internal/playground/static.ts +2 -2
  872. package/src/internal/playground/toolchain.ts +2 -2
  873. package/src/internal/playground-proxy.ts +3 -3
  874. package/src/internal/process-memory-telemetry.ts +1 -1
  875. package/src/internal/reminder-runner.ts +8 -10
  876. package/src/internal/reminder-store.ts +1 -1
  877. package/src/internal/request-error-status.ts +9 -0
  878. package/src/internal/resolved-connections.ts +8 -8
  879. package/src/internal/result-output.ts +62 -5
  880. package/src/internal/router.ts +4 -4
  881. package/src/internal/run-client.ts +2 -2
  882. package/src/internal/schedule-runner.ts +6 -6
  883. package/src/internal/scm/pr-url.ts +11 -2
  884. package/src/internal/sdk-runner.ts +14 -28
  885. package/src/internal/serve-restart.ts +1 -1
  886. package/src/internal/server.ts +97 -99
  887. package/src/internal/session-cost.ts +3 -3
  888. package/src/internal/session-engine.ts +504 -244
  889. package/src/internal/session-run-log.ts +4 -6
  890. package/src/internal/session-store.ts +213 -39
  891. package/src/internal/sessions-client.ts +3 -3
  892. package/src/internal/slack-thread-key.ts +11 -0
  893. package/src/internal/sleep.ts +1 -1
  894. package/src/internal/storage-coordinator.ts +118 -21
  895. package/src/internal/storage.ts +1 -0
  896. package/src/internal/store-mirror.ts +4 -4
  897. package/src/internal/terminal-style.ts +2 -2
  898. package/src/internal/tool-result.ts +3 -3
  899. package/src/internal/trajectory.ts +7 -7
  900. package/src/internal/turn-governor.ts +2 -2
  901. package/src/internal/turn-outbox.ts +1 -1
  902. package/src/internal/update-check.ts +2 -2
  903. package/src/internal/v2-hosting.ts +14 -0
  904. package/src/internal/workspace.ts +17 -17
  905. package/src/kv/memory-kv.ts +9 -7
  906. package/src/kv.ts +4 -7
  907. package/src/otel-public.ts +24 -0
  908. package/src/otel.ts +7 -2
  909. package/src/prompt.ts +1 -1
  910. package/src/result.ts +10 -8
  911. package/src/storage-backends/cursor-hosted-v2.ts +2 -2
  912. package/src/storage-backends/cursor-hosted.ts +6 -23
  913. package/src/storage-backends/file-kv.ts +7 -7
  914. package/src/storage.ts +22 -7
  915. package/src/types.ts +82 -17
  916. package/templates/agentic-owners/agent/channels/github.ts +3 -6
  917. package/templates/agentic-owners/agent/lib/github.ts +5 -5
  918. package/templates/agentic-owners/agent/lib/owners/decision.ts +13 -10
  919. package/templates/agentic-owners/agent/lib/owners/handles.ts +2 -2
  920. package/templates/agentic-owners/agent/lib/owners/match.ts +3 -3
  921. package/templates/agentic-owners/agent/lib/owners/matching.ts +1 -1
  922. package/templates/agentic-owners/agent/lib/owners/parse.ts +4 -9
  923. package/templates/agentic-owners/agent/lib/owners/prompt.ts +1 -1
  924. package/templates/agentic-owners/agent/lib/review.ts +37 -30
  925. package/templates/agentic-owners/evals/owners.eval.ts +2 -2
  926. package/templates/agentic-owners/package.json +1 -1
  927. package/templates/agents-md/agent/lib/collect.ts +16 -10
  928. package/templates/agents-md/agent/lib/config.ts +1 -1
  929. package/templates/agents-md/agent/tools/apply_agents.ts +10 -8
  930. package/templates/agents-md/package.json +1 -1
  931. package/templates/code-wiki/agent/channels/github.ts +4 -7
  932. package/templates/code-wiki/agent/lib/repos.ts +1 -1
  933. package/templates/code-wiki/agent/tools/apply_wiki.ts +3 -4
  934. package/templates/code-wiki/package.json +1 -1
  935. package/templates/demo/agent/lib/collect.ts +6 -2
  936. package/templates/demo/agent/lib/repos.ts +1 -1
  937. package/templates/demo/agent/tools/record_demo.ts +1 -1
  938. package/templates/demo/evals/demo.eval.ts +1 -5
  939. package/templates/demo/package.json +1 -1
  940. package/templates/grokbot-agents/package.json +1 -1
  941. package/templates/pr-autofixer/agent/channels/github.ts +16 -13
  942. package/templates/pr-autofixer/agent/lib/merge-watch.ts +2 -4
  943. package/templates/pr-autofixer/agent/lib/repos.ts +2 -2
  944. package/templates/pr-autofixer/agent/lib/webhook-routing.ts +1 -1
  945. package/templates/pr-autofixer/package.json +1 -1
  946. package/templates/security-help/agent/lib/repos.ts +1 -1
  947. package/templates/security-help/package.json +1 -1
  948. package/templates/security-reviewer/agent/lib/repos.ts +1 -1
  949. package/templates/security-reviewer/agent/tools/post_findings.ts +1 -3
  950. package/templates/security-reviewer/package.json +1 -1
  951. package/templates/triage/agent/lib/actuate.ts +26 -41
  952. package/templates/triage/agent/lib/parse-queue-event.ts +2 -1
  953. package/templates/triage/agent/lib/verify-webhook.ts +10 -5
  954. package/templates/triage/agent/tools/record_triage.ts +1 -4
  955. package/templates/triage/package.json +1 -1
  956. package/dist/client.d.ts +0 -14
  957. package/dist/client.d.ts.map +0 -1
  958. package/dist/client.js +0 -12
  959. package/dist/docs/assets/app.Cr-wVbnB.js +0 -1
  960. package/dist/docs/assets/chunks/@localSearchIndexroot.CFVQ4S17.js +0 -1
  961. package/dist/docs/assets/chunks/framework.BCISBCiQ.js +0 -19
  962. package/dist/docs/assets/concepts.md.B4o63Gul.js +0 -1
  963. package/dist/docs/assets/concepts.md.B4o63Gul.lean.js +0 -1
  964. package/dist/docs/assets/guides_agent-to-agent.md.BDb0t1QV.js +0 -10
  965. package/dist/docs/assets/guides_agent-to-agent.md.BDb0t1QV.lean.js +0 -1
  966. package/dist/docs/assets/guides_grokbot-agents.md.DyV-WArv.js +0 -9
  967. package/dist/docs/assets/guides_human-in-the-loop.md.By1G2T3_.js +0 -28
  968. package/dist/docs/assets/guides_human-in-the-loop.md.By1G2T3_.lean.js +0 -1
  969. package/dist/docs/assets/hillclimbing.md.BOiVo1tf.js +0 -4
  970. package/dist/docs/assets/hillclimbing.md.BOiVo1tf.lean.js +0 -1
  971. package/dist/docs/assets/index.md.DD9Q2XuJ.js +0 -5
  972. package/dist/docs/assets/index.md.DD9Q2XuJ.lean.js +0 -1
  973. package/dist/docs/assets/quickstart.md.DdQOF7Y8.lean.js +0 -1
  974. package/dist/docs/assets/reference_result.md.BK5SxDrf.js +0 -19
  975. package/dist/docs/assets/reference_result.md.BK5SxDrf.lean.js +0 -1
  976. package/dist/docs/assets/scaffolding-agents.md.Kctn3OVb.js +0 -1
  977. package/dist/docs/assets/scaffolding-agents.md.Kctn3OVb.lean.js +0 -1
  978. package/dist/docs/assets/skills_create-agent.md.Q3h6Je-e.js +0 -8
  979. package/dist/docs/assets/skills_create-agent.md.Q3h6Je-e.lean.js +0 -1
  980. package/dist/docs/assets/skills_debug.md.CVjCXMFF.js +0 -1
  981. package/dist/docs/assets/skills_debug.md.CVjCXMFF.lean.js +0 -1
  982. package/dist/docs/assets/skills_deploy.md.CWqi_ZxW.js +0 -35
  983. package/dist/docs/assets/skills_deploy.md.CWqi_ZxW.lean.js +0 -1
  984. package/dist/docs/assets/skills_evals.md.DFxYPErF.js +0 -25
  985. package/dist/docs/assets/skills_evals.md.DFxYPErF.lean.js +0 -1
  986. package/dist/docs/assets/skills_framework-map.md.BxLSOhSY.js +0 -1
  987. package/dist/docs/assets/skills_framework-map.md.BxLSOhSY.lean.js +0 -1
  988. package/dist/docs/assets/skills_github.md.hgFX_oKY.js +0 -16
  989. package/dist/docs/assets/skills_github.md.hgFX_oKY.lean.js +0 -1
  990. package/dist/docs/assets/skills_hillclimb.md.B_zJerxA.js +0 -7
  991. package/dist/docs/assets/skills_hillclimb.md.B_zJerxA.lean.js +0 -1
  992. package/dist/docs/assets/skills_index.md.DL7EHaQ-.js +0 -1
  993. package/dist/docs/assets/skills_index.md.DL7EHaQ-.lean.js +0 -1
  994. package/dist/docs/assets/skills_mcp-auth.md.DGvFP3HE.js +0 -18
  995. package/dist/docs/assets/skills_mcp-auth.md.DGvFP3HE.lean.js +0 -1
  996. package/dist/docs/assets/skills_otel.md.B5Ddv1xH.js +0 -8
  997. package/dist/docs/assets/skills_otel.md.B5Ddv1xH.lean.js +0 -1
  998. package/dist/docs/assets/skills_setup-slack.md.BBgx8lUz.js +0 -20
  999. package/dist/docs/assets/skills_setup-slack.md.BBgx8lUz.lean.js +0 -1
  1000. package/dist/docs/assets/storage.md.BUrhJ-Zz.js +0 -30
  1001. package/dist/docs/assets/storage.md.BUrhJ-Zz.lean.js +0 -1
  1002. package/dist/docs/assets/templates_agents-md.md.CXSMZljE.js +0 -2
  1003. package/dist/docs/assets/templates_agents-md.md.CXSMZljE.lean.js +0 -1
  1004. package/dist/docs/assets/templates_code-wiki.md.CDYZIBFN.js +0 -2
  1005. package/dist/docs/assets/templates_code-wiki.md.CDYZIBFN.lean.js +0 -1
  1006. package/dist/docs/assets/templates_demo.md.BeQX9V3H.js +0 -4
  1007. package/dist/docs/assets/templates_demo.md.BeQX9V3H.lean.js +0 -1
  1008. package/dist/docs/assets/templates_grokbot-agents.md.c1s6Flp9.js +0 -3
  1009. package/dist/docs/assets/templates_grokbot-agents.md.c1s6Flp9.lean.js +0 -1
  1010. package/dist/docs/assets/templates_security-help.md.C3Ny_Qr2.js +0 -4
  1011. package/dist/docs/assets/templates_security-help.md.C3Ny_Qr2.lean.js +0 -1
  1012. package/dist/docs/concepts.html +0 -27
  1013. package/dist/docs/concepts.md +0 -166
  1014. package/dist/docs/design/filesystem.md +0 -376
  1015. package/dist/docs/design/runtime-abstraction.md +0 -1756
  1016. package/dist/docs/guides/human-in-the-loop.html +0 -54
  1017. package/dist/docs/guides/human-in-the-loop.md +0 -126
  1018. package/dist/docs/reference/result.html +0 -45
  1019. package/dist/docs/reference/result.md +0 -89
  1020. package/dist/docs/scaffolding-agents.html +0 -27
  1021. package/dist/docs/scaffolding-agents.md +0 -130
  1022. package/dist/docs/skills/create-agent.html +0 -34
  1023. package/dist/docs/skills/create-agent.md +0 -160
  1024. package/dist/docs/skills/debug.html +0 -27
  1025. package/dist/docs/skills/debug.md +0 -36
  1026. package/dist/docs/skills/deploy.html +0 -61
  1027. package/dist/docs/skills/deploy.md +0 -161
  1028. package/dist/docs/skills/evals.html +0 -51
  1029. package/dist/docs/skills/evals.md +0 -137
  1030. package/dist/docs/skills/framework-map.html +0 -27
  1031. package/dist/docs/skills/framework-map.md +0 -99
  1032. package/dist/docs/skills/github.html +0 -42
  1033. package/dist/docs/skills/github.md +0 -93
  1034. package/dist/docs/skills/hillclimb.html +0 -33
  1035. package/dist/docs/skills/hillclimb.md +0 -55
  1036. package/dist/docs/skills/index.html +0 -27
  1037. package/dist/docs/skills/index.md +0 -21
  1038. package/dist/docs/skills/mcp-auth.html +0 -44
  1039. package/dist/docs/skills/mcp-auth.md +0 -76
  1040. package/dist/docs/skills/otel.html +0 -34
  1041. package/dist/docs/skills/otel.md +0 -53
  1042. package/dist/docs/skills/setup-slack.html +0 -46
  1043. package/dist/docs/skills/setup-slack.md +0 -141
  1044. package/dist/docs/storage.html +0 -56
  1045. package/dist/docs/storage.md +0 -167
  1046. package/dist/docs/templates/agents-md.html +0 -28
  1047. package/dist/docs/templates/agents-md.md +0 -105
  1048. package/dist/docs/templates/code-wiki.html +0 -28
  1049. package/dist/docs/templates/code-wiki.md +0 -91
  1050. package/dist/docs/templates/demo.html +0 -30
  1051. package/dist/docs/templates/demo.md +0 -80
  1052. package/dist/docs/templates/grokbot-agents.html +0 -29
  1053. package/dist/docs/templates/grokbot-agents.md +0 -48
  1054. package/dist/docs/templates/security-help.html +0 -30
  1055. package/dist/docs/templates/security-help.md +0 -65
  1056. package/dist/internal/tenant-slack/relay.d.ts +0 -75
  1057. package/dist/internal/tenant-slack/relay.d.ts.map +0 -1
  1058. package/dist/internal/tenant-slack/relay.js +0 -148
  1059. package/dist/playground/assets/index-Bhxzrcf6.css +0 -1
  1060. package/dist/playground/assets/index-CqLX5uF3.js +0 -67
  1061. package/docs/concepts.md +0 -171
  1062. package/docs/design/filesystem.md +0 -376
  1063. package/docs/design/runtime-abstraction.md +0 -1756
  1064. package/docs/guides/human-in-the-loop.md +0 -131
  1065. package/docs/reference/result.md +0 -94
  1066. package/docs/scaffolding-agents.md +0 -135
  1067. package/docs/skills/index.md +0 -26
  1068. package/docs/storage.md +0 -172
  1069. package/docs/templates/agents-md.md +0 -110
  1070. package/docs/templates/code-wiki.md +0 -96
  1071. package/docs/templates/demo.md +0 -85
  1072. package/docs/templates/grokbot-agents.md +0 -53
  1073. package/docs/templates/security-help.md +0 -70
  1074. package/src/client.ts +0 -23
  1075. package/src/internal/tenant-slack/relay.ts +0 -203
  1076. package/templates/pr-autofixer/agent/storage.ts +0 -7
@@ -1 +1 @@
1
- import{_ as t,c as e,o as a,ag as i}from"./chunks/framework.BCISBCiQ.js";const k=JSON.parse('{"title":"Extensions","description":"Mount a package of agent contributions or a Cursor plugin under a namespace with one file, adjust what it contributes, and author your own as a directory laid out like agent/.","frontmatter":{"title":"Extensions","description":"Mount a package of agent contributions or a Cursor plugin under a namespace with one file, adjust what it contributes, and author your own as a directory laid out like agent/."},"headers":[],"relativePath":"reference/extensions.md","filePath":"reference/extensions.md"}'),n={name:"reference/extensions.md"};function o(l,s,d,h,p,r){return a(),e("div",null,[...s[0]||(s[0]=[i("",46)])])}const g=t(n,[["render",o]]);export{k as __pageData,g as default};
1
+ import{_ as t,c as e,o as a,a3 as i}from"./chunks/framework.dypDpWZ3.js";const k=JSON.parse('{"title":"Extensions","description":"Mount a package of agent contributions or a Cursor plugin under a namespace with one file, adjust what it contributes, and author your own as a directory laid out like agent/.","frontmatter":{"title":"Extensions","description":"Mount a package of agent contributions or a Cursor plugin under a namespace with one file, adjust what it contributes, and author your own as a directory laid out like agent/."},"headers":[],"relativePath":"reference/extensions.md","filePath":"reference/extensions.md"}'),n={name:"reference/extensions.md"};function o(l,s,d,h,p,r){return a(),e("div",null,[...s[0]||(s[0]=[i("",46)])])}const g=t(n,[["render",o]]);export{k as __pageData,g as default};
@@ -1,4 +1,4 @@
1
- import{_ as e,c as a,o as t,ag as i}from"./chunks/framework.BCISBCiQ.js";const c=JSON.parse('{"title":"Hooks","description":"Observe-only subscribers to the session event stream: audit logs, metrics, transcript mirrors, derived state.","frontmatter":{"title":"Hooks","description":"Observe-only subscribers to the session event stream: audit logs, metrics, transcript mirrors, derived state."},"headers":[],"relativePath":"reference/hooks.md","filePath":"reference/hooks.md"}'),n={name:"reference/hooks.md"};function h(o,s,l,d,r,p){return t(),a("div",null,[...s[0]||(s[0]=[i(`<h1 id="hooks" tabindex="-1">Hooks <a class="header-anchor" href="#hooks" aria-label="Permalink to &quot;Hooks&quot;">​</a></h1><p>A hook subscribes to the session event stream and runs a side effect after each event is recorded: an audit line, a metric, a copy of the transcript in your own store, or derived state for later turns. Hooks run in the serving process for every session of the agent, on local and cloud runtime turns alike.</p><p>Hooks observe. They can&#39;t change the turn, the prompt, or the reply, and a handler that throws is logged and skipped. Treat the event as read-only; later subscribers see the same object. That makes hooks safe to add to a production agent, and the wrong tool for anything that must happen before the model runs or must fail a turn; see <a href="#when-not-to-use-a-hook">When not to use a hook</a>.</p><p><code>defineHook</code> is unrelated to <a href="https://cursor.com/docs/agent/hooks" target="_blank" rel="noreferrer">Cursor Agent hooks</a>, the <code>.cursor/hooks.json</code> scripts that can observe, block, or modify the agent loop. Those still run inside a local session workspace.</p><h2 id="author-a-hook" tabindex="-1">Author a hook <a class="header-anchor" href="#author-a-hook" aria-label="Permalink to &quot;Author a hook&quot;">​</a></h2><p>Author <code>agent/hooks/&lt;name&gt;.ts</code> with <code>defineHook</code> from <code>@cursor/july/hooks</code>. This one meters tokens:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// agent/hooks/usage.ts</span></span>
1
+ import{_ as e,c as a,o as i,a3 as t}from"./chunks/framework.dypDpWZ3.js";const c=JSON.parse('{"title":"Hooks","description":"Observe-only subscribers to the session event stream: audit logs, metrics, transcript mirrors, derived state.","frontmatter":{"title":"Hooks","description":"Observe-only subscribers to the session event stream: audit logs, metrics, transcript mirrors, derived state."},"headers":[],"relativePath":"reference/hooks.md","filePath":"reference/hooks.md"}'),n={name:"reference/hooks.md"};function h(o,s,l,d,r,p){return i(),a("div",null,[...s[0]||(s[0]=[t(`<h1 id="hooks" tabindex="-1">Hooks <a class="header-anchor" href="#hooks" aria-label="Permalink to &quot;Hooks&quot;">​</a></h1><p>A hook subscribes to the session event stream and runs a side effect after each event is recorded: an audit line, a metric, a copy of the transcript in your own store, or derived state for later turns. Hooks run in the serving process for every session of the agent, on local and cloud runtime turns alike.</p><p>Hooks observe. They can&#39;t change the turn, the prompt, or the reply, and a handler that throws is logged and skipped. Treat the event as read-only; later subscribers see the same object. That makes hooks safe to add to a production agent, and the wrong tool for anything that must happen before the model runs or must fail a turn; see <a href="#when-not-to-use-a-hook">When not to use a hook</a>.</p><p><code>defineHook</code> is unrelated to <a href="https://cursor.com/docs/agent/hooks" target="_blank" rel="noreferrer">Cursor Agent hooks</a>, the <code>.cursor/hooks.json</code> scripts that can observe, block, or modify the agent loop. Those still run inside a local session workspace.</p><h2 id="author-a-hook" tabindex="-1">Author a hook <a class="header-anchor" href="#author-a-hook" aria-label="Permalink to &quot;Author a hook&quot;">​</a></h2><p>Author <code>agent/hooks/&lt;name&gt;.ts</code> with <code>defineHook</code> from <code>@cursor/july/hooks</code>. This one meters tokens:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// agent/hooks/usage.ts</span></span>
2
2
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { defineHook } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;@cursor/july/hooks&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
3
3
  <span class="line"></span>
4
4
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> defineHook</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
@@ -15,7 +15,7 @@ import{_ as e,c as a,o as t,ag as i}from"./chunks/framework.BCISBCiQ.js";const c
15
15
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ctx.host.otel.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">increment</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;acme.turn.failed&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, { channel: ctx.channel.id });</span></span>
16
16
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
17
17
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
18
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p>Any module under <code>agent/hooks/</code>, subfolders included, is a hook named by its path without the extension: <code>agent/hooks/audit/usage.ts</code> is <code>audit/usage</code>. <code>*.test.ts</code> and <code>*.spec.ts</code> files are skipped. The default export must be <code>defineHook(...)</code>, names can&#39;t contain <code>__</code>, and an empty <code>events</code> map skips the hook with a warning; <code>agent-sdk validate</code> reports all three. An extension mounts its hooks as <code>&lt;ns&gt;__&lt;name&gt;</code>, and <code>disableHook()</code> removes one (<a href="./extensions.html#adjust-a-mounted-extension">Adjust a mounted extension</a>).</p><p><code>agent-sdk init</code> scaffolds <code>agent/hooks/memory.ts</code>, which exports <code>memoryHook()</code> from <code>@cursor/july/memory</code> and journals every turn for later sessions to read. Delete the file to opt out.</p><h2 id="events-and-payloads" tabindex="-1">Events and payloads <a class="header-anchor" href="#events-and-payloads" aria-label="Permalink to &quot;Events and payloads&quot;">​</a></h2><p>Keys are event types from the <a href="./sessions.html#which-events-can-i-stream">event vocabulary</a>, or <code>&quot;*&quot;</code> for every event. A typed key narrows <code>event.data</code>; a <code>&quot;*&quot;</code> handler receives the union, so switch on <code>event.type</code>. Every event carries the stream envelope <code>{ type, index, sessionId, turnId?, at, data }</code>, with <code>turnId</code> set on turn-scoped events.</p><p>The payloads hooks read most often:</p><table tabindex="0"><thead><tr><th>Event</th><th><code>event.data</code></th></tr></thead><tbody><tr><td><code>message.received</code></td><td><code>{ text }</code></td></tr><tr><td><code>turn.completed</code></td><td><code>{ result?, usage?, cost? }</code>. <code>usage</code> has <code>inputTokens</code>, <code>outputTokens</code>, <code>cacheReadTokens</code>, <code>cacheWriteTokens</code>, and optional <code>reasoningTokens</code>. <code>cost</code> has <code>totalUsd</code> and the <code>model</code> it was priced against</td></tr><tr><td><code>turn.failed</code></td><td><code>{ message }</code></td></tr><tr><td><code>actions.requested</code></td><td><code>{ calls: [{ callId, toolName, args? }] }</code>. A call with <code>parentCallId</code> belongs to a subagent</td></tr><tr><td><code>action.result</code></td><td><code>{ callId, toolName, output?, isError, stubbed? }</code>. <code>stubbed</code> means a dry-run session answered a write without running it</td></tr></tbody></table><p>The types are <code>SessionEvent</code>, <code>SessionEventType</code>, and <code>HookContext</code>, exported from <code>@cursor/july</code>.</p><h2 id="handler-context" tabindex="-1">Handler context <a class="header-anchor" href="#handler-context" aria-label="Permalink to &quot;Handler context&quot;">​</a></h2><table tabindex="0"><thead><tr><th>Member</th><th>What it is</th></tr></thead><tbody><tr><td><code>ctx.session</code></td><td>Read-only session info: <code>id</code>, <code>channelId</code>, <code>mode</code> (<code>chat</code> or <code>task</code>), <code>purpose</code> (<code>live</code> or <code>eval</code>), <code>auth</code>, plus <code>title</code> and <code>sdkAgentId</code> when set</td></tr><tr><td><code>ctx.agent</code></td><td><code>{ name }</code> of the agent the event belongs to</td></tr><tr><td><code>ctx.channel</code></td><td><code>{ id, continuationToken }</code>. The token is <code>null</code> when the session can&#39;t take follow-ups</td></tr><tr><td><code>ctx.host.kv</code></td><td>Durable JSON, shared by every session of the agent; the <a href="./../storage.html#author-kv-ctx-host-kv">storage backend</a> decides whether it survives a hosted replace. Prefix keys with <code>ctx.session.id</code> for per-session state</td></tr><tr><td><code>ctx.host.files</code></td><td>Durable files, bound to this session. Pass <code>{ scope: &quot;deployment&quot; }</code> for agent-wide files</td></tr><tr><td><code>ctx.host.otel</code></td><td>Counters, histograms, and tags, attributed to this session</td></tr><tr><td><code>ctx.host.mcp</code>, <code>ctx.host.github</code>, <code>ctx.host.slack</code></td><td>The same shared clients tools get</td></tr><tr><td><code>ctx.host.reminders</code></td><td>Per-session <a href="./schedules.html">reminders</a>, the same API tools get</td></tr><tr><td><code>ctx.artifacts</code></td><td>Session-bound <a href="./artifacts.html">artifacts</a> facade: <code>tag</code> fills in <code>sessionId</code> and <code>turnId</code></td></tr><tr><td><code>ctx.stateRoot</code></td><td>Absolute path of the local state root. It resets when a hosted deployment is replaced; keep derived state in <code>kv</code> or <code>files</code></td></tr></tbody></table><h2 id="when-hooks-run" tabindex="-1">When hooks run <a class="header-anchor" href="#when-hooks-run" aria-label="Permalink to &quot;When hooks run&quot;">​</a></h2><p>A hook runs after the event is durably recorded. It never delays the model turn and never sees an event that wasn&#39;t recorded.</p><p>Within one session, events dispatch in order, one at a time: the channel&#39;s <code>events</code> handlers first, then each hook in discovery order. Sessions don&#39;t wait on each other.</p><p>Two consequences:</p><ul><li>A slow handler holds up the next event&#39;s handlers for that session, not the model. Keep handlers short and queue anything slow.</li><li>Hooks fire for eval sessions too. Check <code>ctx.session.purpose === &quot;eval&quot;</code> before metering or paging.</li></ul><p>Each event reaches a hook at most once. A restart doesn&#39;t replay the log into hooks, so a mirror needs no dedupe, and the event log rather than the hook&#39;s copy is the source of truth.</p><h2 id="hooks-channel-events-or-evals" tabindex="-1">Hooks, channel events, or evals? <a class="header-anchor" href="#hooks-channel-events-or-evals" aria-label="Permalink to &quot;Hooks, channel events, or evals?&quot;">​</a></h2><p>All of them consume the same stream, for different jobs:</p><table tabindex="0"><thead><tr><th></th><th>Hooks</th><th>Channel <code>events</code></th><th>Evals</th></tr></thead><tbody><tr><td>Scope</td><td>every session of the agent</td><td>sessions the channel owns</td><td>one test turn</td></tr><tr><td>Job</td><td>observe: audit, metrics, mirrors, derived state</td><td>deliver: replies back to the channel&#39;s surface</td><td>assert: gates over the trajectory</td></tr><tr><td>Context</td><td><code>ctx.host</code>, <code>ctx.artifacts</code>, session info</td><td><code>channel.state</code>, <code>setContinuationToken</code>, <code>ctx.host</code>, session info</td><td>the <code>t</code> assertion helpers</td></tr><tr><td>Can affect the run</td><td>no</td><td>yes, it owns the surface</td><td>n/a</td></tr><tr><td>Authored at</td><td><code>agent/hooks/*.ts</code></td><td>channel config</td><td><code>evals/**/*.eval.ts</code></td></tr></tbody></table><h2 id="when-not-to-use-a-hook" tabindex="-1">When not to use a hook <a class="header-anchor" href="#when-not-to-use-a-hook" aria-label="Permalink to &quot;When not to use a hook&quot;">​</a></h2><table tabindex="0"><thead><tr><th>You want to</th><th>Use instead</th></tr></thead><tbody><tr><td>Add context before the model runs</td><td>The channel&#39;s <code>send</code> message and <code>workspaceFiles</code>, <code>instructions.md</code>, skills, or <code>sandbox/workspace/</code> seed files</td></tr><tr><td>Reply on Slack, comment on a PR, or post any other delivery</td><td>The channel&#39;s <code>events</code> map, or the Slack and GitHub packs</td></tr><tr><td>Show PR progress (merge-box check, sticky banner)</td><td><code>githubChannel({ progress: { commitStatus, banner } })</code>; see <a href="./../guides/github.html#show-pr-progress">Show PR progress</a></td></tr><tr><td>Block, approve, or rewrite a tool call</td><td><a href="./tools.html#gate-a-tool-on-human-approval"><code>needsApproval</code></a> on the tool</td></tr><tr><td>Act on the final assistant text, or fail a bad turn</td><td><a href="./result.html"><code>defineResult</code></a></td></tr><tr><td>Gate a change on behavior</td><td><a href="./../evals.html">Evals</a></td></tr></tbody></table><h2 id="patterns" tabindex="-1">Patterns <a class="header-anchor" href="#patterns" aria-label="Permalink to &quot;Patterns&quot;">​</a></h2><p>Usage metering is the <a href="#author-a-hook">authoring example</a>. Three more:</p><h3 id="alert-on-failure" tabindex="-1">Alert on failure <a class="header-anchor" href="#alert-on-failure" aria-label="Permalink to &quot;Alert on failure&quot;">​</a></h3><p><code>turn.failed</code> carries the message, and <code>ctx.session.id</code> points at the trace. Skip interrupted turns; those are preemptions, not failures. Read secrets inside the handler: hosted deployments bind them after the process starts, so a module-scope read stays empty. Give the call a timeout, since a stalled request holds up later handlers on that session.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// agent/hooks/page-on-failure.ts</span></span>
18
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p>Any module under <code>agent/hooks/</code>, subfolders included, is a hook named by its path without the extension: <code>agent/hooks/audit/usage.ts</code> is <code>audit/usage</code>. <code>*.test.ts</code> and <code>*.spec.ts</code> files are skipped. The default export must be <code>defineHook(...)</code>, names can&#39;t contain <code>__</code>, and an empty <code>events</code> map skips the hook with a warning; <code>agent-sdk validate</code> reports all three. An extension mounts its hooks as <code>&lt;ns&gt;__&lt;name&gt;</code>, and <code>disableHook()</code> removes one (<a href="./extensions.html#adjust-a-mounted-extension">Adjust a mounted extension</a>).</p><p><code>agent-sdk init</code> scaffolds <code>agent/hooks/memory.ts</code>, which exports <code>memoryHook()</code> from <code>@cursor/july/memory</code> and journals every turn for later sessions to read. Delete the file to opt out.</p><h2 id="events-and-payloads" tabindex="-1">Events and payloads <a class="header-anchor" href="#events-and-payloads" aria-label="Permalink to &quot;Events and payloads&quot;">​</a></h2><p>Keys are event types from the <a href="./sessions.html#which-events-can-i-stream">event vocabulary</a>, or <code>&quot;*&quot;</code> for every event. A typed key narrows <code>event.data</code>; a <code>&quot;*&quot;</code> handler receives the union, so switch on <code>event.type</code>. Every event carries the stream envelope <code>{ type, index, sessionId, turnId?, at, data }</code>, with <code>turnId</code> set on turn-scoped events.</p><p>The payloads hooks read most often:</p><table tabindex="0"><thead><tr><th>Event</th><th><code>event.data</code></th></tr></thead><tbody><tr><td><code>message.received</code></td><td><code>{ text }</code></td></tr><tr><td><code>turn.completed</code></td><td><code>{ result?, usage?, cost? }</code>. <code>usage</code> has <code>inputTokens</code>, <code>outputTokens</code>, <code>cacheReadTokens</code>, <code>cacheWriteTokens</code>, and optional <code>reasoningTokens</code>. <code>cost</code> has <code>totalUsd</code> and the <code>model</code> it was priced against</td></tr><tr><td><code>turn.failed</code></td><td><code>{ message }</code></td></tr><tr><td><code>actions.requested</code></td><td><code>{ calls: [{ callId, toolName, args? }] }</code>. A call with <code>parentCallId</code> belongs to a subagent</td></tr><tr><td><code>action.result</code></td><td><code>{ callId, toolName, output?, isError, stubbed? }</code>. <code>stubbed</code> means a dry-run session answered a write without running it</td></tr></tbody></table><p>The types are <code>SessionEvent</code>, <code>SessionEventType</code>, and <code>HookContext</code>, exported from <code>@cursor/july</code>.</p><h2 id="handler-context" tabindex="-1">Handler context <a class="header-anchor" href="#handler-context" aria-label="Permalink to &quot;Handler context&quot;">​</a></h2><table tabindex="0"><thead><tr><th>Member</th><th>What it is</th></tr></thead><tbody><tr><td><code>ctx.session</code></td><td>Read-only session info: <code>id</code>, <code>channelId</code>, <code>mode</code> (<code>chat</code> or <code>task</code>), <code>purpose</code> (<code>live</code> or <code>eval</code>), <code>auth</code>, plus <code>title</code> and <code>sdkAgentId</code> when set</td></tr><tr><td><code>ctx.agent</code></td><td><code>{ name }</code> of the agent the event belongs to</td></tr><tr><td><code>ctx.channel</code></td><td><code>{ id, continuationToken }</code>. The token is <code>null</code> when the session can&#39;t take follow-ups</td></tr><tr><td><code>ctx.host.kv</code></td><td>Durable JSON, shared by every session of the agent; the storage backend decides whether it survives a hosted replace. Prefix keys with <code>ctx.session.id</code> for per-session state</td></tr><tr><td><code>ctx.host.files</code></td><td>Durable files, bound to this session. Pass <code>{ scope: &quot;deployment&quot; }</code> for agent-wide files</td></tr><tr><td><code>ctx.host.otel</code></td><td>Counters, histograms, and tags, attributed to this session</td></tr><tr><td><code>ctx.host.mcp</code>, <code>ctx.host.github</code>, <code>ctx.host.slack</code></td><td>The same shared clients tools get</td></tr><tr><td><code>ctx.host.reminders</code></td><td>Per-session <a href="./schedules.html">reminders</a>, the same API tools get</td></tr><tr><td><code>ctx.artifacts</code></td><td>Session-bound <a href="./artifacts.html">artifacts</a> facade: <code>tag</code> fills in <code>sessionId</code> and <code>turnId</code></td></tr><tr><td><code>ctx.stateRoot</code></td><td>Absolute path of the local state root. It resets when a hosted deployment is replaced; keep derived state in <code>kv</code> or <code>files</code></td></tr></tbody></table><h2 id="when-hooks-run" tabindex="-1">When hooks run <a class="header-anchor" href="#when-hooks-run" aria-label="Permalink to &quot;When hooks run&quot;">​</a></h2><p>A hook runs after the event is durably recorded. It never delays the model turn and never sees an event that wasn&#39;t recorded.</p><p>Within one session, events dispatch in order, one at a time: the channel&#39;s <code>events</code> handlers first, then each hook in discovery order. Sessions don&#39;t wait on each other.</p><p>Two consequences:</p><ul><li>A slow handler holds up the next event&#39;s handlers for that session, not the model. Keep handlers short and queue anything slow.</li><li>Hooks fire for eval sessions too. Check <code>ctx.session.purpose === &quot;eval&quot;</code> before metering or paging.</li></ul><p>Each event reaches a hook at most once. A restart doesn&#39;t replay the log into hooks, so a mirror needs no dedupe, and the event log rather than the hook&#39;s copy is the source of truth.</p><h2 id="hooks-channel-events-or-evals" tabindex="-1">Hooks, channel events, or evals? <a class="header-anchor" href="#hooks-channel-events-or-evals" aria-label="Permalink to &quot;Hooks, channel events, or evals?&quot;">​</a></h2><p>All of them consume the same stream, for different jobs:</p><table tabindex="0"><thead><tr><th></th><th>Hooks</th><th>Channel <code>events</code></th><th>Evals</th></tr></thead><tbody><tr><td>Scope</td><td>every session of the agent</td><td>sessions the channel owns</td><td>one test turn</td></tr><tr><td>Job</td><td>observe: audit, metrics, mirrors, derived state</td><td>deliver: replies back to the channel&#39;s surface</td><td>assert: gates over the trajectory</td></tr><tr><td>Context</td><td><code>ctx.host</code>, <code>ctx.artifacts</code>, session info</td><td><code>channel.state</code>, <code>setContinuationToken</code>, <code>ctx.host</code>, session info</td><td>the <code>t</code> assertion helpers</td></tr><tr><td>Can affect the run</td><td>no</td><td>yes, it owns the surface</td><td>n/a</td></tr><tr><td>Authored at</td><td><code>agent/hooks/*.ts</code></td><td>channel config</td><td><code>evals/**/*.eval.ts</code></td></tr></tbody></table><h2 id="when-not-to-use-a-hook" tabindex="-1">When not to use a hook <a class="header-anchor" href="#when-not-to-use-a-hook" aria-label="Permalink to &quot;When not to use a hook&quot;">​</a></h2><table tabindex="0"><thead><tr><th>You want to</th><th>Use instead</th></tr></thead><tbody><tr><td>Add context before the model runs</td><td>The channel&#39;s <code>send</code> message and <code>workspaceFiles</code>, <code>instructions.md</code>, skills, or <code>sandbox/workspace/</code> seed files</td></tr><tr><td>Reply on Slack, comment on a PR, or post any other delivery</td><td>The channel&#39;s <code>events</code> map, or the Slack and GitHub packs</td></tr><tr><td>Show PR progress (merge-box check, sticky banner)</td><td><code>githubChannel({ progress: { commitStatus, banner } })</code>; see <a href="./../guides/github.html#show-pr-progress">Show PR progress</a></td></tr><tr><td>Block, approve, or rewrite a tool call</td><td><a href="./tools.html#gate-a-tool-on-human-approval"><code>needsApproval</code></a> on the tool</td></tr><tr><td>Act on the final assistant text, reject it for a same-turn repair, or fail a bad turn</td><td><code>defineResult</code></td></tr><tr><td>Gate a change on behavior</td><td><a href="./../evals.html">Evals</a></td></tr></tbody></table><h2 id="patterns" tabindex="-1">Patterns <a class="header-anchor" href="#patterns" aria-label="Permalink to &quot;Patterns&quot;">​</a></h2><p>Usage metering is the <a href="#author-a-hook">authoring example</a>. Three more:</p><h3 id="alert-on-failure" tabindex="-1">Alert on failure <a class="header-anchor" href="#alert-on-failure" aria-label="Permalink to &quot;Alert on failure&quot;">​</a></h3><p><code>turn.failed</code> carries the message, and <code>ctx.session.id</code> points at the trace. Skip interrupted turns; those are preemptions, not failures. Read secrets inside the handler: hosted deployments bind them after the process starts, so a module-scope read stays empty. Give the call a timeout, since a stalled request holds up later handlers on that session.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// agent/hooks/page-on-failure.ts</span></span>
19
19
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { defineHook } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;@cursor/july/hooks&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
20
20
  <span class="line"></span>
21
21
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> defineHook</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
@@ -70,4 +70,4 @@ import{_ as e,c as a,o as t,ag as i}from"./chunks/framework.BCISBCiQ.js";const c
70
70
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> });</span></span>
71
71
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
72
72
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
73
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><h2 id="test-and-debug-a-hook" tabindex="-1">Test and debug a hook <a class="header-anchor" href="#test-and-debug-a-hook" aria-label="Permalink to &quot;Test and debug a hook&quot;">​</a></h2><p>A hook definition is a plain object, so a unit test calls <code>hook.events[&quot;turn.completed&quot;]</code> directly with an event and a stub <code>HookContext</code>. Discovery skips <code>*.test.ts</code>, so the test can live next to the hook.</p><p>At runtime:</p><ul><li><code>agent-sdk validate --dir .</code> reports discovery errors and the empty-handlers warning.</li><li><code>agent-sdk info --dir . --json</code> lists the loaded hooks under <code>agents[].hooks</code>.</li><li>Send a turn with <code>agent-sdk dev</code> or <code>agent-sdk run --dir . --message &quot;…&quot;</code> and watch the serve log for <code>hook &quot;&lt;name&gt;&quot; handler for &lt;event&gt; threw: …</code>. <code>run</code> prints that log on stderr. On hosting, read it with <a href="./cli.html#logs"><code>agent-sdk logs</code></a>.</li></ul><h2 id="what-s-next" tabindex="-1">What&#39;s next <a class="header-anchor" href="#what-s-next" aria-label="Permalink to &quot;What&#39;s next&quot;">​</a></h2><p>Continue with these pages:</p><ul><li><a href="./result.html">Turn result</a>: fail a turn from <code>commit</code>, not from a hook</li><li><a href="./sessions.html">Sessions and streaming</a>: the event vocabulary hooks observe</li><li><a href="./../storage.html">Storage</a>: where <code>ctx.host.kv</code> and <code>ctx.host.files</code> live</li><li><a href="./../guides/opentelemetry.html">OpenTelemetry</a>: OTLP traces and metrics from the same event stream</li><li><a href="./../deployment.html#observability">Deployment</a>: runtime logs and export paths</li><li><a href="./channels.html#events">Channels</a>: the delivery-side counterpart</li></ul>`,45)])])}const E=e(n,[["render",h]]);export{c as __pageData,E as default};
73
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><h2 id="test-and-debug-a-hook" tabindex="-1">Test and debug a hook <a class="header-anchor" href="#test-and-debug-a-hook" aria-label="Permalink to &quot;Test and debug a hook&quot;">​</a></h2><p>A hook definition is a plain object, so a unit test calls <code>hook.events[&quot;turn.completed&quot;]</code> directly with an event and a stub <code>HookContext</code>. Discovery skips <code>*.test.ts</code>, so the test can live next to the hook.</p><p>At runtime:</p><ul><li><code>agent-sdk validate --dir .</code> reports discovery errors and the empty-handlers warning.</li><li><code>agent-sdk info --dir . --json</code> lists the loaded hooks under <code>agents[].hooks</code>.</li><li>Send a turn with <code>agent-sdk dev</code> or <code>agent-sdk run --dir . --message &quot;…&quot;</code> and watch the serve log for <code>hook &quot;&lt;name&gt;&quot; handler for &lt;event&gt; threw: …</code>. <code>run</code> prints that log on stderr. On hosting, read it with <a href="./cli.html#logs"><code>agent-sdk logs</code></a>.</li></ul><h2 id="what-s-next" tabindex="-1">What&#39;s next <a class="header-anchor" href="#what-s-next" aria-label="Permalink to &quot;What&#39;s next&quot;">​</a></h2><p>Continue with these pages:</p><ul><li><a href="./sessions.html">Sessions and streaming</a>: the event vocabulary hooks observe</li><li><a href="./../guides/opentelemetry.html">OpenTelemetry</a>: OTLP traces and metrics from the same event stream</li><li><a href="./../deployment.html#observability">Deployment</a>: runtime logs and export paths</li><li><a href="./channels.html#events">Channels</a>: the delivery-side counterpart</li></ul>`,45)])])}const E=e(n,[["render",h]]);export{c as __pageData,E as default};
@@ -1 +1 @@
1
- import{_ as e,c as a,o as t,ag as i}from"./chunks/framework.BCISBCiQ.js";const c=JSON.parse('{"title":"Hooks","description":"Observe-only subscribers to the session event stream: audit logs, metrics, transcript mirrors, derived state.","frontmatter":{"title":"Hooks","description":"Observe-only subscribers to the session event stream: audit logs, metrics, transcript mirrors, derived state."},"headers":[],"relativePath":"reference/hooks.md","filePath":"reference/hooks.md"}'),n={name:"reference/hooks.md"};function h(o,s,l,d,r,p){return t(),a("div",null,[...s[0]||(s[0]=[i("",45)])])}const E=e(n,[["render",h]]);export{c as __pageData,E as default};
1
+ import{_ as e,c as a,o as i,a3 as t}from"./chunks/framework.dypDpWZ3.js";const c=JSON.parse('{"title":"Hooks","description":"Observe-only subscribers to the session event stream: audit logs, metrics, transcript mirrors, derived state.","frontmatter":{"title":"Hooks","description":"Observe-only subscribers to the session event stream: audit logs, metrics, transcript mirrors, derived state."},"headers":[],"relativePath":"reference/hooks.md","filePath":"reference/hooks.md"}'),n={name:"reference/hooks.md"};function h(o,s,l,d,r,p){return i(),a("div",null,[...s[0]||(s[0]=[t("",45)])])}const E=e(n,[["render",h]]);export{c as __pageData,E as default};
@@ -1,11 +1,11 @@
1
- import{_ as t,c as s,o,ag as a}from"./chunks/framework.BCISBCiQ.js";const p=JSON.parse('{"title":"HTTP API","description":"Public session, discovery, and channel routes callers use.","frontmatter":{"title":"HTTP API","description":"Public session, discovery, and channel routes callers use."},"headers":[],"relativePath":"reference/http-api.md","filePath":"reference/http-api.md"}'),n={name:"reference/http-api.md"};function d(i,e,r,l,h,c){return o(),s("div",null,[...e[0]||(e[0]=[a(`<h1 id="http-api-reference" tabindex="-1">HTTP API reference <a class="header-anchor" href="#http-api-reference" aria-label="Permalink to &quot;HTTP API reference&quot;">​</a></h1><p>Agent SDK hosts expose the same public HTTP surface. In the default multi-agent layout each agent is namespaced under its slug (<code>/&lt;slug&gt;/v1/session</code>, <code>/&lt;slug&gt;/playground</code>), with host-level routes at the root. With <code>--mode single</code>, one agent serves the same surface unslugged (<code>/v1/*</code>).</p><p>Unless noted otherwise, routes run the agent&#39;s HTTP auth chain: the default is <code>localDevStrict()</code> (loopback only), replaced by <code>bearerAuth</code> under <code>--bearer-token</code> or <code>allowAll()</code> under <code>--allow-anonymous</code>. Session routes also require the caller to be the session&#39;s owner (<code>403</code> otherwise). Errors return JSON <code>{ ok: false, error: &quot;&lt;code&gt;&quot;, message? }</code> with a matching HTTP status.</p><h2 id="host-level-routes-multi-agent-mode" tabindex="-1">Host-level routes (multi-agent mode) <a class="header-anchor" href="#host-level-routes-multi-agent-mode" aria-label="Permalink to &quot;Host-level routes (multi-agent mode)&quot;">​</a></h2><p>These routes live at the host root, above any agent. The two index routes exist only while the playground is enabled (<code>--no-playground</code> removes them) and run no auth. The documentation site is mounted in both layouts and removed by <code>--no-docs</code>.</p><table tabindex="0"><thead><tr><th>Route</th><th>What it does</th></tr></thead><tbody><tr><td><code>GET /</code></td><td>A web index of every mounted agent, linking to playgrounds (playground only)</td></tr><tr><td><code>GET /v1/agents</code></td><td>The JSON index of mounted agents (playground only, no auth)</td></tr><tr><td><code>GET /docs</code>, <code>GET /docs/*</code></td><td>This documentation, served as a static site (both layouts, no auth)</td></tr><tr><td><code>GET /v1/health</code></td><td>Host-level liveness, no auth</td></tr></tbody></table><h2 id="start-a-session" tabindex="-1">Start a session <a class="header-anchor" href="#start-a-session" aria-label="Permalink to &quot;Start a session&quot;">​</a></h2><p><code>POST /v1/session</code> opens a durable conversation.</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">curl</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -X</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> POST</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> http://127.0.0.1:3000/</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&lt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">slu</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">g</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&gt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">/v1/session</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
1
+ import{_ as t,c as s,o,a3 as a}from"./chunks/framework.dypDpWZ3.js";const p=JSON.parse('{"title":"HTTP API","description":"Public session, discovery, and channel routes callers use.","frontmatter":{"title":"HTTP API","description":"Public session, discovery, and channel routes callers use."},"headers":[],"relativePath":"reference/http-api.md","filePath":"reference/http-api.md"}'),n={name:"reference/http-api.md"};function d(i,e,r,l,c,h){return o(),s("div",null,[...e[0]||(e[0]=[a(`<h1 id="http-api-reference" tabindex="-1">HTTP API reference <a class="header-anchor" href="#http-api-reference" aria-label="Permalink to &quot;HTTP API reference&quot;">​</a></h1><p>Agent SDK hosts expose the same public HTTP surface. In the default multi-agent layout each agent is namespaced under its slug (<code>/&lt;slug&gt;/v1/session</code>, <code>/&lt;slug&gt;/playground</code>), with host-level routes at the root. With <code>--mode single</code>, one agent serves the same surface unslugged (<code>/v1/*</code>).</p><p>Unless noted otherwise, routes run the agent&#39;s HTTP auth chain: the default is <code>localDevStrict()</code> (loopback only), replaced by <code>bearerAuth</code> under <code>--bearer-token</code> or <code>allowAll()</code> under <code>--allow-anonymous</code>. Session routes also require the caller to be the session&#39;s owner (<code>403</code> otherwise). Errors return JSON <code>{ ok: false, error: &quot;&lt;code&gt;&quot;, message? }</code> with a matching HTTP status.</p><h2 id="host-level-routes-multi-agent-mode" tabindex="-1">Host-level routes (multi-agent mode) <a class="header-anchor" href="#host-level-routes-multi-agent-mode" aria-label="Permalink to &quot;Host-level routes (multi-agent mode)&quot;">​</a></h2><p>These routes live at the host root, above any agent. The two index routes exist only while the playground is enabled (<code>--no-playground</code> removes them) and run no auth. The documentation site is mounted in both layouts and removed by <code>--no-docs</code>.</p><table tabindex="0"><thead><tr><th>Route</th><th>What it does</th></tr></thead><tbody><tr><td><code>GET /</code></td><td>A web index of every mounted agent, linking to playgrounds (playground only)</td></tr><tr><td><code>GET /v1/agents</code></td><td>The JSON index of mounted agents (playground only, no auth)</td></tr><tr><td><code>GET /docs</code>, <code>GET /docs/*</code></td><td>This documentation, served as a static site (both layouts, no auth)</td></tr><tr><td><code>GET /v1/health</code></td><td>Host-level liveness, no auth</td></tr></tbody></table><h2 id="start-a-session" tabindex="-1">Start a session <a class="header-anchor" href="#start-a-session" aria-label="Permalink to &quot;Start a session&quot;">​</a></h2><p><code>POST /v1/session</code> opens a durable conversation.</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">curl</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -X</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> POST</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> http://127.0.0.1:3000/</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&lt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">slu</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">g</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&gt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">/v1/session</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
2
2
  <span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -H</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &#39;content-type: application/json&#39;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
3
3
  <span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -d</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &#39;{&quot;message&quot;:&quot;What can you do?&quot;}&#39;</span></span>
4
4
  <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># {&quot;ok&quot;:true,&quot;sessionId&quot;:&quot;ses_…&quot;,&quot;continuationToken&quot;:&quot;http:…&quot;,</span></span>
5
5
  <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># &quot;playgroundUrl&quot;:&quot;…?sessionId=ses_…&quot;,&quot;traceUrl&quot;:&quot;…/v1/session/ses_…/events&quot;}</span></span></code></pre></div><p>The response returns as soon as the message is accepted; follow the stream for progress. The continuation token is the follow-up credential, and <code>playgroundUrl</code> deep-links the session in the playground.</p><table tabindex="0"><thead><tr><th>Body field</th><th>Meaning</th></tr></thead><tbody><tr><td><code>message</code></td><td>Required user message</td></tr><tr><td><code>title</code></td><td>Session title</td></tr><tr><td><code>dryRun</code></td><td>Run read tools and stub write tools</td></tr><tr><td><code>asOf</code></td><td>ISO-8601 instant with a timezone, frozen at create; the prompt states it, <code>ctx.now()</code> returns it, and tool calls with relative, later-than-<code>asOf</code>, or omitted schema-declared time bounds are refused. <code>400</code> when unusable</td></tr><tr><td><code>workspaceFiles</code></td><td>UTF-8 files written into the session workspace</td></tr><tr><td><code>cloud</code></td><td>Per-session cloud options merged over the agent defaults</td></tr></tbody></table><h2 id="send-a-follow-up" tabindex="-1">Send a follow-up <a class="header-anchor" href="#send-a-follow-up" aria-label="Permalink to &quot;Send a follow-up&quot;">​</a></h2><p><code>POST /v1/session/:sessionId</code> continues an existing conversation.</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">curl</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -X</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> POST</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> http://127.0.0.1:3000/</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&lt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">slu</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">g</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&gt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">/v1/session/ses_…</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
6
6
  <span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -H</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &#39;content-type: application/json&#39;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
7
- <span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -d</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &#39;{&quot;continuationToken&quot;:&quot;http:…&quot;,&quot;message&quot;:&quot;Make it shorter.&quot;}&#39;</span></span></code></pre></div><p>Works for any chat session, including ones created by custom channels. Each accepted follow-up rotates the token, and the response carries the new one. Sending to a busy session interrupts the in-flight turn, waits for it to settle, then sends.</p><p>Expect <code>409</code> on a stale token or a task session. Task sessions do not accept follow-ups. Expect <code>403</code> when the caller is not the session owner.</p><h2 id="stream-a-session" tabindex="-1">Stream a session <a class="header-anchor" href="#stream-a-session" aria-label="Permalink to &quot;Stream a session&quot;">​</a></h2><p><code>GET /v1/session/:sessionId/stream</code> is the live NDJSON feed.</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">curl</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -N</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &#39;http://127.0.0.1:3000/&lt;slug&gt;/v1/session/ses_…/stream?startIndex=0&#39;</span></span></code></pre></div><p>One NDJSON event per line, from <code>startIndex</code>, then following live. The default is <code>0</code>: omitting the parameter replays the entire recorded stream before following. Pass the last index you&#39;ve seen plus one to resume without duplicates. The stream is durable and reconnectable. For the vocabulary, see <a href="./sessions.html#which-events-can-i-stream">Sessions</a>.</p><p><code>GET /v1/session/:sessionId/events</code> returns a one-shot NDJSON dump. Pass <code>?format=json</code> for <code>{ sessionId, events, playgroundUrl }</code>.</p><h2 id="stop-and-list" tabindex="-1">Stop and list <a class="header-anchor" href="#stop-and-list" aria-label="Permalink to &quot;Stop and list&quot;">​</a></h2><p><code>POST /v1/session/:sessionId/stop</code> interrupts the in-flight turn without sending a new message. <code>GET /v1/sessions</code> lists sessions owned by the calling principal. Under <code>serve --dev</code> on loopback it includes all sessions, which is how webhook and schedule sessions show up in the playground.</p><h2 id="session-cost" tabindex="-1">Session cost <a class="header-anchor" href="#session-cost" aria-label="Permalink to &quot;Session cost&quot;">​</a></h2><p><code>GET /v1/session/:sessionId/cost</code> returns the session&#39;s cost report: per-turn token usage and the engine&#39;s estimated cost, folded from <code>turn.completed</code> events. It runs the same owner check as the other session routes and returns <code>404</code> for an unknown session. The <a href="./cli.html#cost"><code>agent-sdk cost</code></a> command reports the same data.</p><h2 id="approvals" tabindex="-1">Approvals <a class="header-anchor" href="#approvals" aria-label="Permalink to &quot;Approvals&quot;">​</a></h2><p>Two routes list and resolve parked tool calls.</p><table tabindex="0"><thead><tr><th>Route</th><th>What it does</th></tr></thead><tbody><tr><td><code>GET /v1/session/:sessionId/approvals</code></td><td>Pending human-in-the-loop tool approvals</td></tr><tr><td><code>POST /v1/session/:sessionId/approvals/:callId</code></td><td>Resolve one: <code>{&quot;decision&quot;:&quot;approve&quot;}</code> or <code>{&quot;decision&quot;:&quot;deny&quot;}</code></td></tr></tbody></table><p>For the lifecycle, see <a href="./../guides/human-in-the-loop.html">Human-in-the-loop</a>.</p><h2 id="call-a-tool-directly" tabindex="-1">Call a tool directly <a class="header-anchor" href="#call-a-tool-directly" aria-label="Permalink to &quot;Call a tool directly&quot;">​</a></h2><p><code>POST /v1/tools/:toolName</code> runs a server tool with no model turn.</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">curl</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -X</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> POST</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> http://127.0.0.1:3000/</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&lt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">slu</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">g</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&gt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">/v1/tools/inspect_pr</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
7
+ <span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -d</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &#39;{&quot;continuationToken&quot;:&quot;http:…&quot;,&quot;message&quot;:&quot;Make it shorter.&quot;}&#39;</span></span></code></pre></div><p>Works for any chat session, including ones created by custom channels. Each accepted follow-up rotates the token, and the response carries the new one. Sending to a busy session interrupts the in-flight turn, waits for it to settle, then sends.</p><p>Expect <code>409</code> on a stale token or a task session. Task sessions do not accept follow-ups. Expect <code>403</code> when the caller is not the session owner.</p><h2 id="stream-a-session" tabindex="-1">Stream a session <a class="header-anchor" href="#stream-a-session" aria-label="Permalink to &quot;Stream a session&quot;">​</a></h2><p><code>GET /v1/session/:sessionId/stream</code> is the live NDJSON feed.</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">curl</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -N</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &#39;http://127.0.0.1:3000/&lt;slug&gt;/v1/session/ses_…/stream?startIndex=0&#39;</span></span></code></pre></div><p>One NDJSON event per line, from <code>startIndex</code>, then following live. The default is <code>0</code>: omitting the parameter replays the entire recorded stream before following. Pass the last index you&#39;ve seen plus one to resume without duplicates. The stream is durable and reconnectable. For the vocabulary, see <a href="./sessions.html#which-events-can-i-stream">Sessions</a>.</p><p><code>GET /v1/session/:sessionId/events</code> returns a one-shot NDJSON dump. Pass <code>?format=json</code> for <code>{ sessionId, events, playgroundUrl }</code>.</p><h2 id="stop-and-list" tabindex="-1">Stop and list <a class="header-anchor" href="#stop-and-list" aria-label="Permalink to &quot;Stop and list&quot;">​</a></h2><p><code>POST /v1/session/:sessionId/stop</code> interrupts the in-flight turn without sending a new message. <code>GET /v1/sessions</code> lists sessions owned by the calling principal. Under <code>serve --dev</code> on loopback it includes all sessions, which is how webhook and schedule sessions show up in the playground.</p><h2 id="session-cost" tabindex="-1">Session cost <a class="header-anchor" href="#session-cost" aria-label="Permalink to &quot;Session cost&quot;">​</a></h2><p><code>GET /v1/session/:sessionId/cost</code> returns the session&#39;s cost report: per-turn token usage and the engine&#39;s estimated cost, folded from <code>turn.completed</code> events. It runs the same owner check as the other session routes and returns <code>404</code> for an unknown session. The <a href="./cli.html#cost"><code>agent-sdk cost</code></a> command reports the same data.</p><h2 id="approvals" tabindex="-1">Approvals <a class="header-anchor" href="#approvals" aria-label="Permalink to &quot;Approvals&quot;">​</a></h2><p>Two routes list and resolve parked tool calls.</p><table tabindex="0"><thead><tr><th>Route</th><th>What it does</th></tr></thead><tbody><tr><td><code>GET /v1/session/:sessionId/approvals</code></td><td>Pending human-in-the-loop tool approvals</td></tr><tr><td><code>POST /v1/session/:sessionId/approvals/:callId</code></td><td>Resolve one: <code>{&quot;decision&quot;:&quot;approve&quot;}</code> or <code>{&quot;decision&quot;:&quot;deny&quot;}</code></td></tr></tbody></table><p>For the lifecycle, see <a href="./tools.html#gate-a-tool-on-human-approval">Gate a tool on human approval</a>.</p><h2 id="call-a-tool-directly" tabindex="-1">Call a tool directly <a class="header-anchor" href="#call-a-tool-directly" aria-label="Permalink to &quot;Call a tool directly&quot;">​</a></h2><p><code>POST /v1/tools/:toolName</code> runs a server tool with no model turn.</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">curl</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -X</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> POST</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> http://127.0.0.1:3000/</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&lt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">slu</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">g</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&gt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">/v1/tools/inspect_pr</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
8
8
  <span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -H</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &#39;content-type: application/json&#39;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
9
9
  <span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -d</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &#39;{&quot;input&quot;:{&quot;prUrl&quot;:&quot;https://github.com/acme/checkout/pull/42&quot;}}&#39;</span></span>
10
10
  <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># {&quot;ok&quot;:true,&quot;toolName&quot;:&quot;inspect_pr&quot;,&quot;callId&quot;:&quot;tool_inspect_pr_…&quot;,</span></span>
11
- <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># &quot;isError&quot;:false,&quot;result&quot;:{…},&quot;durationMs&quot;:12}</span></span></code></pre></div><p>It runs an authored server tool in-process: schema-validated, no model turn. An optional <code>&quot;sessionId&quot;</code> in the body runs it inside an existing session and records it on that session&#39;s stream (<code>409 session_busy</code> for a write-effect call while a turn runs; reads run alongside the turn). Agent-execution tools are rejected with <code>400</code>, and unknown tools with <code>404</code> and the list of available names. For the semantics, see <a href="./tools.html#call-a-tool-without-a-model-turn">Tools</a>.</p><p>An optional <code>&quot;continuationToken&quot;</code> (<code>&lt;channelId&gt;:&lt;key&gt;</code>, as <code>/v1/sessions</code> lists it; mutually exclusive with <code>sessionId</code>) addresses the session by continuation token instead; malformed tokens are rejected with <code>400 invalid_continuation_token</code>. For the semantics, see <a href="./tools.html#call-a-tool-without-a-model-turn">Tools</a>.</p><h2 id="discovery" tabindex="-1">Discovery <a class="header-anchor" href="#discovery" aria-label="Permalink to &quot;Discovery&quot;">​</a></h2><p>These read-only routes describe the running agent.</p><table tabindex="0"><thead><tr><th>Route</th><th>What it does</th></tr></thead><tbody><tr><td><code>GET /v1/info</code></td><td>The discovered surface: model, tools, skills, MCP connections, subagents, channels and routes (with schemas), schedules, hooks, diagnostics</td></tr><tr><td><code>GET /v1/tools</code></td><td>The live tool catalog: authored server tools plus advertised MCP passthroughs under model-facing names, as light <code>{ name, title?, source? }</code> entries. <code>session</code> / <code>continuationToken</code> query parameters bind the listing to a session identity (advertised inventories can be tenant-scoped); a connection whose listing fails is skipped and reported in <code>connectionErrors</code></td></tr><tr><td><code>GET /v1/tools/:name</code></td><td>One catalog tool&#39;s full description: description, execution, <code>needsApproval</code>, <code>effect</code>, input and output schemas, source connection. Same session binding as the listing; unknown names get <code>404</code> with the available names</td></tr><tr><td><code>GET /v1/health</code></td><td>Per-agent liveness, no auth</td></tr><tr><td><code>GET /v1/logs?after=N</code></td><td>Recent server log lines, with a polling cursor</td></tr></tbody></table><h2 id="artifacts" tabindex="-1">Artifacts <a class="header-anchor" href="#artifacts" aria-label="Permalink to &quot;Artifacts&quot;">​</a></h2><p>Two routes read durable artifacts tagged by <code>ctx.artifacts</code> or <code>tag_artifact</code>. See <a href="./artifacts.html">Artifacts</a>.</p><table tabindex="0"><thead><tr><th>Route</th><th>What it does</th></tr></thead><tbody><tr><td><code>GET /v1/artifacts</code></td><td>List artifacts as <code>{ artifacts }</code>, newest-updated first. Filter with <code>?kind=</code>, <code>?sessionId=</code>, and <code>?limit=</code> (a positive integer)</td></tr><tr><td><code>GET /v1/artifacts/:id/content</code></td><td>Download one artifact&#39;s file or blob payload. Served as an attachment, never rendered inline; <code>404</code> when the artifact is unknown or carries no content</td></tr></tbody></table><p>Session ownership applies the same way as <code>GET /v1/sessions</code>: under <code>serve --dev</code> on loopback (or <code>--allow-anonymous</code>) the list spans all principals, while bearer or custom channel auth keeps strict per-principal isolation.</p><h2 id="custom-channel-routes" tabindex="-1">Custom channel routes <a class="header-anchor" href="#custom-channel-routes" aria-label="Permalink to &quot;Custom channel routes&quot;">​</a></h2><p>Authored routes mount under <code>/v1/channels/&lt;id&gt;</code> with the methods, paths, and Zod schemas the channel declared (a <code>POST /&lt;slug&gt;/v1/channels/drive</code> route, say). Bodies are validated before handlers run (<code>400</code> on schema violations), and each channel&#39;s auth chain applies. The GitHub channel verifies <code>X-Hub-Signature-256</code> when a secret is configured. See <a href="./channels.html">Channels</a>.</p><h2 id="mcp-endpoint" tabindex="-1">MCP endpoint <a class="header-anchor" href="#mcp-endpoint" aria-label="Permalink to &quot;MCP endpoint&quot;">​</a></h2><p><code>/v1/mcp</code> serves the Model Context Protocol over streamable HTTP (stateless; POST carries the protocol, and GET/DELETE return spec-compliant 405s). The tools are <code>ask</code> (delegate a message, bounded waits), <code>check</code> (poll a running session), and <code>call_tool</code> (deterministic server-tool passthrough, present when the agent has server tools). The route runs the same auth chain as the session API. See <a href="./../guides/agent-to-agent.html">Agent-to-agent</a>.</p><p><code>/v1/mcp/tools</code> is a second stateless MCP endpoint exposing only the agent&#39;s deterministic server tools. Hosted cloud turns call back into it through the URL configured by <code>serve --cloud-tools-url</code>. Unlike <code>/v1/mcp</code>, it runs the CLI-level auth chain (loopback, bearer, or anonymous), not any authored channel auth.</p><h2 id="playground-eval-routes" tabindex="-1">Playground eval routes <a class="header-anchor" href="#playground-eval-routes" aria-label="Permalink to &quot;Playground eval routes&quot;">​</a></h2><p>The playground Evals tab and <code>agent-sdk eval --prod</code> / <code>--url</code> use these:</p><table tabindex="0"><thead><tr><th>Route</th><th>What it does</th></tr></thead><tbody><tr><td><code>GET /v1/dev/evals</code></td><td>List discovered eval datapoints and project config</td></tr><tr><td><code>GET /v1/dev/evals/runs</code></td><td>List recent run snapshots, newest first</td></tr><tr><td><code>POST /v1/dev/evals/runs</code></td><td>Start an eval run (<code>{filterIds?, tags?}</code>); <code>202</code> with a snapshot (<code>runId</code> is the Eval ID), <code>404</code> when nothing matches, <code>409</code> when one is running</td></tr><tr><td><code>GET /v1/dev/evals/runs/:runId</code></td><td>Poll a run&#39;s progress</td></tr><tr><td><code>POST /v1/dev/evals/runs/:runId/cancel</code></td><td>Cancel a running batch; <code>200</code> with snapshot, <code>404</code> unknown, <code>409</code> when not running</td></tr></tbody></table><p>Eval runs are asynchronous. Poll the run route for case progress and the final <code>completed</code> or <code>failed</code> status. Batch errors appear on the snapshot returned by the poll. Entries within <code>filterIds</code> and <code>tags</code> use OR semantics. When both fields are present, a case must match one entry from each field. Listed runs persist across restarts when storage is configured; see <a href="./../storage.html#eval-table">Storage</a>. Otherwise they are process-memory only.</p><h2 id="dev-mode-routes" tabindex="-1">Dev-mode routes <a class="header-anchor" href="#dev-mode-routes" aria-label="Permalink to &quot;Dev-mode routes&quot;">​</a></h2><p>These routes exist only under <code>serve --dev</code>.</p><table tabindex="0"><thead><tr><th>Route</th><th>What it does</th></tr></thead><tbody><tr><td><code>POST /v1/dev/schedules/:scheduleId</code></td><td>Dispatch a schedule by hand, exactly once. Returns <code>{scheduleId, sessionIds}</code></td></tr><tr><td><code>GET /v1/dev/reminders</code></td><td>List reminders</td></tr><tr><td><code>POST /v1/dev/reminders/:reminderId</code></td><td>Fire a reminder by hand</td></tr></tbody></table><p>Schedules and reminders never fire automatically in dev mode. These routes are the only way they run, which keeps iteration deterministic.</p><h2 id="playground-assets" tabindex="-1">Playground assets <a class="header-anchor" href="#playground-assets" aria-label="Permalink to &quot;Playground assets&quot;">​</a></h2><p><code>GET /playground</code> and <code>GET /playground/assets/:file</code> serve the playground (omitted with <code>--no-playground</code>). It calls the JSON API above and has no privileged surface.</p><h2 id="status-codes" tabindex="-1">Status codes <a class="header-anchor" href="#status-codes" aria-label="Permalink to &quot;Status codes&quot;">​</a></h2><p>Error responses use a small, consistent set of status codes.</p><table tabindex="0"><thead><tr><th>Code</th><th>Meaning here</th></tr></thead><tbody><tr><td><code>400</code></td><td>Schema-invalid body or query, agent-execution tool called on the host, malformed request</td></tr><tr><td><code>401</code></td><td>No auth policy admitted the request</td></tr><tr><td><code>403</code></td><td>Authenticated, but not the session owner</td></tr><tr><td><code>404</code></td><td>Unknown session, tool, schedule, reminder, or eval run; no eval datapoints match a run request</td></tr><tr><td><code>405</code></td><td>Wrong method (GET on the MCP endpoint, say)</td></tr><tr><td><code>409</code></td><td>Stale continuation token, a busy session-bound tool call, a non-followable task session, or an eval run already in progress</td></tr><tr><td><code>202</code></td><td>Accepted for background work (GitHub <code>{ task }</code> hooks, eval runs)</td></tr></tbody></table><h2 id="what-s-next" tabindex="-1">What&#39;s next <a class="header-anchor" href="#what-s-next" aria-label="Permalink to &quot;What&#39;s next&quot;">​</a></h2><p>Continue with these pages:</p><ul><li><a href="./sessions.html">Sessions and streaming</a>: the handles and events these routes traffic in</li><li><a href="./channels.html">Channels</a>: authoring your own routes</li><li><a href="./../deployment.html">Deployment</a>: auth on real hosts</li></ul>`,62)])])}const k=t(n,[["render",d]]);export{p as __pageData,k as default};
11
+ <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># &quot;isError&quot;:false,&quot;result&quot;:{…},&quot;durationMs&quot;:12}</span></span></code></pre></div><p>It runs an authored server tool in-process: schema-validated, no model turn. An optional <code>&quot;sessionId&quot;</code> in the body runs it inside an existing session and records it on that session&#39;s stream (<code>409 session_busy</code> for a write-effect call while a turn runs; reads run alongside the turn). Agent-execution tools are rejected with <code>400</code>, and unknown tools with <code>404</code> and the list of available names. For the semantics, see <a href="./tools.html#call-a-tool-without-a-model-turn">Tools</a>.</p><p>An optional <code>&quot;continuationToken&quot;</code> (<code>&lt;channelId&gt;:&lt;key&gt;</code>, as <code>/v1/sessions</code> lists it; mutually exclusive with <code>sessionId</code>) addresses the session by continuation token instead; malformed tokens are rejected with <code>400 invalid_continuation_token</code>. For the semantics, see <a href="./tools.html#call-a-tool-without-a-model-turn">Tools</a>.</p><h2 id="discovery" tabindex="-1">Discovery <a class="header-anchor" href="#discovery" aria-label="Permalink to &quot;Discovery&quot;">​</a></h2><p>These read-only routes describe the running agent.</p><table tabindex="0"><thead><tr><th>Route</th><th>What it does</th></tr></thead><tbody><tr><td><code>GET /v1/info</code></td><td>The discovered surface: model, tools, skills, MCP connections, subagents, channels and routes (with schemas), schedules, hooks, diagnostics</td></tr><tr><td><code>GET /v1/tools</code></td><td>The live tool catalog: authored server tools plus advertised MCP passthroughs under model-facing names, as light <code>{ name, title?, source? }</code> entries. <code>session</code> / <code>continuationToken</code> query parameters bind the listing to a session identity (advertised inventories can be tenant-scoped); a connection whose listing fails is skipped and reported in <code>connectionErrors</code></td></tr><tr><td><code>GET /v1/tools/:name</code></td><td>One catalog tool&#39;s full description: description, execution, <code>needsApproval</code>, <code>effect</code>, input and output schemas, source connection. Same session binding as the listing; unknown names get <code>404</code> with the available names</td></tr><tr><td><code>GET /v1/health</code></td><td>Per-agent liveness, no auth</td></tr><tr><td><code>GET /v1/logs?after=N</code></td><td>Recent server log lines, with a polling cursor</td></tr></tbody></table><h2 id="artifacts" tabindex="-1">Artifacts <a class="header-anchor" href="#artifacts" aria-label="Permalink to &quot;Artifacts&quot;">​</a></h2><p>Two routes read durable artifacts tagged by <code>ctx.artifacts</code> or <code>tag_artifact</code>. See <a href="./artifacts.html">Artifacts</a>.</p><table tabindex="0"><thead><tr><th>Route</th><th>What it does</th></tr></thead><tbody><tr><td><code>GET /v1/artifacts</code></td><td>List artifacts as <code>{ artifacts }</code>, newest-updated first. Filter with <code>?kind=</code>, <code>?sessionId=</code>, and <code>?limit=</code> (a positive integer)</td></tr><tr><td><code>GET /v1/artifacts/:id/content</code></td><td>Download one artifact&#39;s file or blob payload. Served as an attachment, never rendered inline; <code>404</code> when the artifact is unknown or carries no content</td></tr></tbody></table><p>Session ownership applies the same way as <code>GET /v1/sessions</code>: under <code>serve --dev</code> on loopback (or <code>--allow-anonymous</code>) the list spans all principals, while bearer or custom channel auth keeps strict per-principal isolation.</p><h2 id="custom-channel-routes" tabindex="-1">Custom channel routes <a class="header-anchor" href="#custom-channel-routes" aria-label="Permalink to &quot;Custom channel routes&quot;">​</a></h2><p>Authored routes mount under <code>/v1/channels/&lt;id&gt;</code> with the methods, paths, and Zod schemas the channel declared (a <code>POST /&lt;slug&gt;/v1/channels/drive</code> route, say). Bodies are validated before handlers run (<code>400</code> on schema violations), and each channel&#39;s auth chain applies. The GitHub channel verifies <code>X-Hub-Signature-256</code> when a secret is configured. See <a href="./channels.html">Channels</a>.</p><h2 id="mcp-endpoint" tabindex="-1">MCP endpoint <a class="header-anchor" href="#mcp-endpoint" aria-label="Permalink to &quot;MCP endpoint&quot;">​</a></h2><p><code>/v1/mcp</code> serves the Model Context Protocol over streamable HTTP (stateless; POST carries the protocol, and GET/DELETE return spec-compliant 405s). The tools are <code>ask</code> (delegate a message, bounded waits), <code>check</code> (poll a running session), and <code>call_tool</code> (deterministic server-tool passthrough, present when the agent has server tools). The route runs the same auth chain as the session API. Peer wiring: <a href="./connections.html#peer-mcp-connection">MCP connections</a>.</p><p><code>/v1/mcp/tools</code> is a second stateless MCP endpoint exposing only the agent&#39;s deterministic server tools. Hosted cloud turns call back into it through the URL configured by <code>serve --cloud-tools-url</code>. Unlike <code>/v1/mcp</code>, it runs the CLI-level auth chain (loopback, bearer, or anonymous), not any authored channel auth.</p><h2 id="playground-eval-routes" tabindex="-1">Playground eval routes <a class="header-anchor" href="#playground-eval-routes" aria-label="Permalink to &quot;Playground eval routes&quot;">​</a></h2><p>The playground Evals tab and <code>agent-sdk eval --prod</code> / <code>--url</code> use these:</p><table tabindex="0"><thead><tr><th>Route</th><th>What it does</th></tr></thead><tbody><tr><td><code>GET /v1/dev/evals</code></td><td>List discovered eval datapoints and project config</td></tr><tr><td><code>GET /v1/dev/evals/runs</code></td><td>List recent run snapshots, newest first</td></tr><tr><td><code>POST /v1/dev/evals/runs</code></td><td>Start an eval run (<code>{filterIds?, tags?}</code>); <code>202</code> with a snapshot (<code>runId</code> is the Eval ID), <code>404</code> when nothing matches, <code>409</code> when one is running</td></tr><tr><td><code>GET /v1/dev/evals/runs/:runId</code></td><td>Poll a run&#39;s progress</td></tr><tr><td><code>POST /v1/dev/evals/runs/:runId/cancel</code></td><td>Cancel a running batch; <code>200</code> with snapshot, <code>404</code> unknown, <code>409</code> when not running</td></tr></tbody></table><p>Eval runs are asynchronous. Poll the run route for case progress and the final <code>completed</code> or <code>failed</code> status. Batch errors appear on the snapshot returned by the poll. Entries within <code>filterIds</code> and <code>tags</code> use OR semantics. When both fields are present, a case must match one entry from each field. Listed runs persist across restarts when durable storage is configured. Otherwise they are process-memory only.</p><h2 id="dev-mode-routes" tabindex="-1">Dev-mode routes <a class="header-anchor" href="#dev-mode-routes" aria-label="Permalink to &quot;Dev-mode routes&quot;">​</a></h2><p>These routes exist only under <code>serve --dev</code>.</p><table tabindex="0"><thead><tr><th>Route</th><th>What it does</th></tr></thead><tbody><tr><td><code>POST /v1/dev/schedules/:scheduleId</code></td><td>Dispatch a schedule by hand, exactly once. Returns <code>{scheduleId, sessionIds}</code></td></tr><tr><td><code>GET /v1/dev/reminders</code></td><td>List reminders</td></tr><tr><td><code>POST /v1/dev/reminders/:reminderId</code></td><td>Fire a reminder by hand</td></tr></tbody></table><p>Schedules and reminders never fire automatically in dev mode. These routes are the only way they run, which keeps iteration deterministic.</p><h2 id="playground-assets" tabindex="-1">Playground assets <a class="header-anchor" href="#playground-assets" aria-label="Permalink to &quot;Playground assets&quot;">​</a></h2><p><code>GET /playground</code> and <code>GET /playground/assets/:file</code> serve the playground (omitted with <code>--no-playground</code>). It calls the JSON API above and has no privileged surface.</p><h2 id="status-codes" tabindex="-1">Status codes <a class="header-anchor" href="#status-codes" aria-label="Permalink to &quot;Status codes&quot;">​</a></h2><p>Error responses use a small, consistent set of status codes.</p><table tabindex="0"><thead><tr><th>Code</th><th>Meaning here</th></tr></thead><tbody><tr><td><code>400</code></td><td>Schema-invalid body or query, agent-execution tool called on the host, malformed request</td></tr><tr><td><code>401</code></td><td>No auth policy admitted the request</td></tr><tr><td><code>403</code></td><td>Authenticated, but not the session owner</td></tr><tr><td><code>404</code></td><td>Unknown session, tool, schedule, reminder, or eval run; no eval datapoints match a run request</td></tr><tr><td><code>405</code></td><td>Wrong method (GET on the MCP endpoint, say)</td></tr><tr><td><code>409</code></td><td>Stale continuation token, a busy session-bound tool call, a non-followable task session, or an eval run already in progress</td></tr><tr><td><code>202</code></td><td>Accepted for background work (GitHub <code>{ task }</code> hooks, eval runs)</td></tr></tbody></table><h2 id="what-s-next" tabindex="-1">What&#39;s next <a class="header-anchor" href="#what-s-next" aria-label="Permalink to &quot;What&#39;s next&quot;">​</a></h2><p>Continue with these pages:</p><ul><li><a href="./sessions.html">Sessions and streaming</a>: the handles and events these routes traffic in</li><li><a href="./channels.html">Channels</a>: authoring your own routes</li><li><a href="./../deployment.html">Deployment</a>: auth on real hosts</li></ul>`,62)])])}const k=t(n,[["render",d]]);export{p as __pageData,k as default};
@@ -1 +1 @@
1
- import{_ as t,c as s,o,ag as a}from"./chunks/framework.BCISBCiQ.js";const p=JSON.parse('{"title":"HTTP API","description":"Public session, discovery, and channel routes callers use.","frontmatter":{"title":"HTTP API","description":"Public session, discovery, and channel routes callers use."},"headers":[],"relativePath":"reference/http-api.md","filePath":"reference/http-api.md"}'),n={name:"reference/http-api.md"};function d(i,e,r,l,h,c){return o(),s("div",null,[...e[0]||(e[0]=[a("",62)])])}const k=t(n,[["render",d]]);export{p as __pageData,k as default};
1
+ import{_ as t,c as s,o,a3 as a}from"./chunks/framework.dypDpWZ3.js";const p=JSON.parse('{"title":"HTTP API","description":"Public session, discovery, and channel routes callers use.","frontmatter":{"title":"HTTP API","description":"Public session, discovery, and channel routes callers use."},"headers":[],"relativePath":"reference/http-api.md","filePath":"reference/http-api.md"}'),n={name:"reference/http-api.md"};function d(i,e,r,l,c,h){return o(),s("div",null,[...e[0]||(e[0]=[a("",62)])])}const k=t(n,[["render",d]]);export{p as __pageData,k as default};
@@ -1,4 +1,4 @@
1
- import{_ as t,c as e,o as i,ag as a}from"./chunks/framework.BCISBCiQ.js";const k=JSON.parse('{"title":"Instructions","description":"The always-on system prompt: authoring forms, how it reaches the model on each runtime, and what makes instructions hold up.","frontmatter":{"title":"Instructions","description":"The always-on system prompt: authoring forms, how it reaches the model on each runtime, and what makes instructions hold up."},"headers":[],"relativePath":"reference/instructions.md","filePath":"reference/instructions.md"}'),n={name:"reference/instructions.md"};function o(r,s,h,l,p,d){return i(),e("div",null,[...s[0]||(s[0]=[a(`<h1 id="instructions" tabindex="-1">Instructions <a class="header-anchor" href="#instructions" aria-label="Permalink to &quot;Instructions&quot;">​</a></h1><p><code>agent/instructions.md</code> is the always-on system prompt. It&#39;s the one piece of prose the model sees on every turn. It&#39;s required on the root agent; subagents may inline <code>instructions</code> in their <code>agent.ts</code> instead.</p><h2 id="authoring-forms" tabindex="-1">Authoring forms <a class="header-anchor" href="#authoring-forms" aria-label="Permalink to &quot;Authoring forms&quot;">​</a></h2><p>Three forms cover every case.</p><table tabindex="0"><thead><tr><th>Form</th><th>Reach for it when</th></tr></thead><tbody><tr><td><code>agent/instructions.md</code></td><td>Plain Markdown for most agents.</td></tr><tr><td><code>agent/instructions.ts</code></td><td>Generated prompts. Default-export <code>defineInstructions({ markdown })</code> or a plain string.</td></tr><tr><td><code>agent/instructions/</code> directory</td><td>A long prompt split across files, composed in filename order.</td></tr></tbody></table><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// agent/instructions.ts</span></span>
1
+ import{_ as t,c as e,o as i,a3 as a}from"./chunks/framework.dypDpWZ3.js";const k=JSON.parse('{"title":"Instructions","description":"The always-on system prompt: authoring forms, how it reaches the model on each runtime, and what makes instructions hold up.","frontmatter":{"title":"Instructions","description":"The always-on system prompt: authoring forms, how it reaches the model on each runtime, and what makes instructions hold up."},"headers":[],"relativePath":"reference/instructions.md","filePath":"reference/instructions.md"}'),n={name:"reference/instructions.md"};function o(r,s,h,l,p,d){return i(),e("div",null,[...s[0]||(s[0]=[a(`<h1 id="instructions" tabindex="-1">Instructions <a class="header-anchor" href="#instructions" aria-label="Permalink to &quot;Instructions&quot;">​</a></h1><p><code>agent/instructions.md</code> is the always-on system prompt. It&#39;s the one piece of prose the model sees on every turn. It&#39;s required on the root agent; subagents may inline <code>instructions</code> in their <code>agent.ts</code> instead.</p><h2 id="authoring-forms" tabindex="-1">Authoring forms <a class="header-anchor" href="#authoring-forms" aria-label="Permalink to &quot;Authoring forms&quot;">​</a></h2><p>Three forms cover every case.</p><table tabindex="0"><thead><tr><th>Form</th><th>Reach for it when</th></tr></thead><tbody><tr><td><code>agent/instructions.md</code></td><td>Plain Markdown for most agents.</td></tr><tr><td><code>agent/instructions.ts</code></td><td>Generated prompts. Default-export <code>defineInstructions({ markdown })</code> or a plain string.</td></tr><tr><td><code>agent/instructions/</code> directory</td><td>A long prompt split across files, composed in filename order.</td></tr></tbody></table><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// agent/instructions.ts</span></span>
2
2
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { defineInstructions } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;@cursor/july&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
3
3
  <span class="line"></span>
4
4
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> defineInstructions</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
@@ -1 +1 @@
1
- import{_ as t,c as e,o as i,ag as a}from"./chunks/framework.BCISBCiQ.js";const k=JSON.parse('{"title":"Instructions","description":"The always-on system prompt: authoring forms, how it reaches the model on each runtime, and what makes instructions hold up.","frontmatter":{"title":"Instructions","description":"The always-on system prompt: authoring forms, how it reaches the model on each runtime, and what makes instructions hold up."},"headers":[],"relativePath":"reference/instructions.md","filePath":"reference/instructions.md"}'),n={name:"reference/instructions.md"};function o(r,s,h,l,p,d){return i(),e("div",null,[...s[0]||(s[0]=[a("",17)])])}const u=t(n,[["render",o]]);export{k as __pageData,u as default};
1
+ import{_ as t,c as e,o as i,a3 as a}from"./chunks/framework.dypDpWZ3.js";const k=JSON.parse('{"title":"Instructions","description":"The always-on system prompt: authoring forms, how it reaches the model on each runtime, and what makes instructions hold up.","frontmatter":{"title":"Instructions","description":"The always-on system prompt: authoring forms, how it reaches the model on each runtime, and what makes instructions hold up."},"headers":[],"relativePath":"reference/instructions.md","filePath":"reference/instructions.md"}'),n={name:"reference/instructions.md"};function o(r,s,h,l,p,d){return i(),e("div",null,[...s[0]||(s[0]=[a("",17)])])}const u=t(n,[["render",o]]);export{k as __pageData,u as default};
@@ -1 +1 @@
1
- import{_ as t,c as o,o as a,ag as n}from"./chunks/framework.BCISBCiQ.js";const u=JSON.parse('{"title":"Playground","description":"The built-in web UI: chat with streaming, Try buttons and slash commands, session replay, approvals, and dev-mode dispatch.","frontmatter":{"title":"Playground","description":"The built-in web UI: chat with streaming, Try buttons and slash commands, session replay, approvals, and dev-mode dispatch."},"headers":[],"relativePath":"reference/playground.md","filePath":"reference/playground.md"}'),s={name:"reference/playground.md"};function r(l,e,d,i,c,h){return a(),o("div",null,[...e[0]||(e[0]=[n('<h1 id="playground" tabindex="-1">Playground <a class="header-anchor" href="#playground" aria-label="Permalink to &quot;Playground&quot;">​</a></h1><p>Every served agent ships with a web playground at <code>http://127.0.0.1:3000/&lt;slug&gt;/playground</code> (or <code>/playground</code> in single mode). Anything you can do there you can also do with curl.</p><h2 id="what-it-does" tabindex="-1">What it does <a class="header-anchor" href="#what-it-does" aria-label="Permalink to &quot;What it does&quot;">​</a></h2><p>Use the playground to chat, try channel routes, and inspect sessions.</p><ul><li><strong>Chat</strong> with the agent. Text and reasoning stream live, and tool calls appear inline with their arguments, output, and error state.</li><li><strong>Slash commands</strong>: custom channel routes become composer commands (a <code>drive</code> route becomes <code>/drive &lt;pr-url&gt;</code>), with <code>/help</code> and autocomplete.</li><li><strong>Try</strong> any channel route from the Agent surface. The modal remembers your last body per endpoint and has Copy curl, and a successful Try opens the created session.</li><li><strong>Sessions</strong>: browse the sessions you own (chat, custom-channel, schedule tasks) and replay their event streams. In <code>--dev</code> on loopback, or with <code>--allow-anonymous</code>, the list includes every principal. Search by session ID to filter the list, or press Enter to open an ID directly. &quot;Open trace&quot; renders a saved event stream.</li><li><strong>Approvals</strong>: parked <code>needsApproval</code> tool calls render Approve / Deny buttons.</li><li><strong>Evals</strong>: list and run filesystem evals from the browser (backed by <code>/v1/dev/evals</code>). Schedule hand-dispatch still requires <code>--dev</code>.</li><li><strong>The surface</strong>: inspect the discovered tools, skills, subagents, MCP connections, channels, and hooks.</li><li><strong>Custom tool chips</strong>: drop <code>agent/playground/tools/&lt;toolName&gt;.tsx</code> to change how that tool renders. Chips compile from the agent tree; an <a href="./extensions.html">extension</a> cannot contribute them.</li><li><strong>Raw events pane</strong>: flip it on to inspect the event stream.</li><li><strong>Logs tab</strong>: recent server log lines, polled from <code>GET /v1/logs</code>.</li></ul><p>In multi-agent mode each agent has its own playground at <code>/&lt;slug&gt;/playground</code>, and <code>/</code> is an index of them all.</p><h2 id="share-it-beyond-localhost" tabindex="-1">Share it beyond localhost <a class="header-anchor" href="#share-it-beyond-localhost" aria-label="Permalink to &quot;Share it beyond localhost&quot;">​</a></h2><p>The default <code>localDevStrict()</code> auth admits direct loopback calls only and rejects proxy-forwarding headers, so a tunnel or LAN address won&#39;t work until you pass <code>--bearer-token &lt;secret&gt;</code> (or <code>serve(dir, { authToken })</code>). Open the playground on the remote device and paste the token into the token field in the navbar. <code>--allow-anonymous</code> is the demo-only alternative for trusted networks.</p><h2 id="what-s-next" tabindex="-1">What&#39;s next <a class="header-anchor" href="#what-s-next" aria-label="Permalink to &quot;What&#39;s next&quot;">​</a></h2><p>Continue with these pages:</p><ul><li><a href="./http-api.html">HTTP API</a>: the HTTP surface the playground uses</li><li><a href="./sessions.html">Sessions and streaming</a>: the streams it renders</li><li><a href="./../guides/human-in-the-loop.html">Human-in-the-loop</a>: the approval buttons in context</li></ul>',11)])])}const g=t(s,[["render",r]]);export{u as __pageData,g as default};
1
+ import{_ as t,c as o,o as a,a3 as n}from"./chunks/framework.dypDpWZ3.js";const u=JSON.parse('{"title":"Playground","description":"The built-in web UI: chat with streaming, Try buttons and slash commands, session replay, approvals, and dev-mode dispatch.","frontmatter":{"title":"Playground","description":"The built-in web UI: chat with streaming, Try buttons and slash commands, session replay, approvals, and dev-mode dispatch."},"headers":[],"relativePath":"reference/playground.md","filePath":"reference/playground.md"}'),s={name:"reference/playground.md"};function r(l,e,d,i,c,h){return a(),o("div",null,[...e[0]||(e[0]=[n('<h1 id="playground" tabindex="-1">Playground <a class="header-anchor" href="#playground" aria-label="Permalink to &quot;Playground&quot;">​</a></h1><p>Every served agent ships with a web playground at <code>http://127.0.0.1:3000/&lt;slug&gt;/playground</code> (or <code>/playground</code> in single mode). Anything you can do there you can also do with curl.</p><h2 id="what-it-does" tabindex="-1">What it does <a class="header-anchor" href="#what-it-does" aria-label="Permalink to &quot;What it does&quot;">​</a></h2><p>Use the playground to chat, try channel routes, and inspect sessions.</p><ul><li><strong>Chat</strong> with the agent. Text and reasoning stream live, and tool calls appear inline with their arguments, output, and error state.</li><li><strong>Slash commands</strong>: custom channel routes become composer commands (a <code>drive</code> route becomes <code>/drive &lt;pr-url&gt;</code>), with <code>/help</code> and autocomplete.</li><li><strong>Try</strong> any channel route from the Agent surface. The modal remembers your last body per endpoint and has Copy curl, and a successful Try opens the created session.</li><li><strong>Sessions</strong>: browse the sessions you own (chat, custom-channel, schedule tasks) and replay their event streams. In <code>--dev</code> on loopback, or with <code>--allow-anonymous</code>, the list includes every principal. Search by session ID to filter the list, or press Enter to open an ID directly. &quot;Open trace&quot; renders a saved event stream.</li><li><strong>Approvals</strong>: parked <code>needsApproval</code> tool calls render Approve / Deny buttons.</li><li><strong>Evals</strong>: list and run filesystem evals from the browser (backed by <code>/v1/dev/evals</code>). Schedule hand-dispatch still requires <code>--dev</code>.</li><li><strong>The surface</strong>: inspect the discovered tools, skills, subagents, MCP connections, channels, and hooks.</li><li><strong>Custom tool chips</strong>: drop <code>agent/playground/tools/&lt;toolName&gt;.tsx</code> to change how that tool renders. Chips compile from the agent tree; an <a href="./extensions.html">extension</a> cannot contribute them.</li><li><strong>Raw events pane</strong>: flip it on to inspect the event stream.</li><li><strong>Logs tab</strong>: recent server log lines, polled from <code>GET /v1/logs</code>.</li></ul><p>In multi-agent mode each agent has its own playground at <code>/&lt;slug&gt;/playground</code>, and <code>/</code> is an index of them all.</p><h2 id="share-it-beyond-localhost" tabindex="-1">Share it beyond localhost <a class="header-anchor" href="#share-it-beyond-localhost" aria-label="Permalink to &quot;Share it beyond localhost&quot;">​</a></h2><p>The default <code>localDevStrict()</code> auth admits direct loopback calls only and rejects proxy-forwarding headers, so a tunnel or LAN address won&#39;t work until you pass <code>--bearer-token &lt;secret&gt;</code> (or <code>serve(dir, { authToken })</code>). Open the playground on the remote device and paste the token into the token field in the navbar. <code>--allow-anonymous</code> is the demo-only alternative for trusted networks.</p><h2 id="what-s-next" tabindex="-1">What&#39;s next <a class="header-anchor" href="#what-s-next" aria-label="Permalink to &quot;What&#39;s next&quot;">​</a></h2><p>Continue with these pages:</p><ul><li><a href="./http-api.html">HTTP API</a>: the HTTP surface the playground uses</li><li><a href="./sessions.html">Sessions and streaming</a>: the streams it renders</li><li><a href="./tools.html#gate-a-tool-on-human-approval">Gate a tool on human approval</a>: the approval buttons in context</li></ul>',11)])])}const g=t(s,[["render",r]]);export{u as __pageData,g as default};
@@ -1 +1 @@
1
- import{_ as t,c as o,o as a,ag as n}from"./chunks/framework.BCISBCiQ.js";const u=JSON.parse('{"title":"Playground","description":"The built-in web UI: chat with streaming, Try buttons and slash commands, session replay, approvals, and dev-mode dispatch.","frontmatter":{"title":"Playground","description":"The built-in web UI: chat with streaming, Try buttons and slash commands, session replay, approvals, and dev-mode dispatch."},"headers":[],"relativePath":"reference/playground.md","filePath":"reference/playground.md"}'),s={name:"reference/playground.md"};function r(l,e,d,i,c,h){return a(),o("div",null,[...e[0]||(e[0]=[n("",11)])])}const g=t(s,[["render",r]]);export{u as __pageData,g as default};
1
+ import{_ as t,c as o,o as a,a3 as n}from"./chunks/framework.dypDpWZ3.js";const u=JSON.parse('{"title":"Playground","description":"The built-in web UI: chat with streaming, Try buttons and slash commands, session replay, approvals, and dev-mode dispatch.","frontmatter":{"title":"Playground","description":"The built-in web UI: chat with streaming, Try buttons and slash commands, session replay, approvals, and dev-mode dispatch."},"headers":[],"relativePath":"reference/playground.md","filePath":"reference/playground.md"}'),s={name:"reference/playground.md"};function r(l,e,d,i,c,h){return a(),o("div",null,[...e[0]||(e[0]=[n("",11)])])}const g=t(s,[["render",r]]);export{u as __pageData,g as default};
@@ -1,4 +1,4 @@
1
- import{_ as t,c as s,o as a,ag as o}from"./chunks/framework.BCISBCiQ.js";const g=JSON.parse('{"title":"Project layout","description":"The folder structure under agent/ and the path-derived naming rule.","frontmatter":{"title":"Project layout","description":"The folder structure under agent/ and the path-derived naming rule."},"headers":[],"relativePath":"reference/project-layout.md","filePath":"reference/project-layout.md"}'),d={name:"reference/project-layout.md"};function n(r,e,i,c,l,h){return a(),s("div",null,[...e[0]||(e[0]=[o(`<h1 id="project-layout" tabindex="-1">Project layout <a class="header-anchor" href="#project-layout" aria-label="Permalink to &quot;Project layout&quot;">​</a></h1><p>The Agent SDK builds an agent by walking the filesystem under <code>agent/</code>. Each folder has a defined purpose. The path a file lands in determines how the Agent SDK loads it.</p><h2 id="folder-structure" tabindex="-1">Folder structure <a class="header-anchor" href="#folder-structure" aria-label="Permalink to &quot;Folder structure&quot;">​</a></h2><p>For the capabilities below, identity comes from the path.</p><table tabindex="0"><thead><tr><th>Path</th><th>Resolves to</th></tr></thead><tbody><tr><td><code>agent/tools/approve_pr.ts</code></td><td>tool <code>approve_pr</code></td></tr><tr><td><code>agent/mcp-connections/linear.ts</code></td><td>MCP connection <code>linear</code> (model + host)</td></tr><tr><td><code>agent/host-connections/anytool.ts</code></td><td>Host MCP connection <code>anytool</code> (host + <code>mcp oauth</code> only)</td></tr><tr><td><code>agent/skills/pr-review.md</code></td><td>skill <code>pr-review</code></td></tr><tr><td><code>agent/subagents/reviewer/</code></td><td>subagent <code>reviewer</code></td></tr><tr><td><code>agent/extensions/ci.ts</code></td><td>extension mount <code>ci</code>; its contributions become <code>ci__&lt;name&gt;</code></td></tr><tr><td><code>agent/extensions/notion.ts</code></td><td>Cursor plugin mount <code>notion</code> (<code>cursorPlugin</code>); its skills, agents, and MCP servers become <code>notion__&lt;name&gt;</code></td></tr><tr><td><code>agent/channels/drive.ts</code></td><td>channel <code>drive</code>, routes under <code>/v1/channels/drive</code></td></tr></tbody></table><p>The root agent takes its name from <code>package.json</code> <code>name</code>, falling back to the directory name. When serving multiple agents, the slug is the directory name and must match <code>[A-Za-z0-9][A-Za-z0-9_-]*</code> (and not the reserved <code>v1</code>, <code>playground</code>, or <code>docs</code> segments).</p><h2 id="project-overview" tabindex="-1">Project overview <a class="header-anchor" href="#project-overview" aria-label="Permalink to &quot;Project overview&quot;">​</a></h2><p>Most projects start with this shape.</p><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>my-agent/</span></span>
1
+ import{_ as t,c as s,o as a,a3 as o}from"./chunks/framework.dypDpWZ3.js";const g=JSON.parse('{"title":"Project layout","description":"The folder structure under agent/ and the path-derived naming rule.","frontmatter":{"title":"Project layout","description":"The folder structure under agent/ and the path-derived naming rule."},"headers":[],"relativePath":"reference/project-layout.md","filePath":"reference/project-layout.md"}'),d={name:"reference/project-layout.md"};function n(r,e,i,c,l,h){return a(),s("div",null,[...e[0]||(e[0]=[o(`<h1 id="project-layout" tabindex="-1">Project layout <a class="header-anchor" href="#project-layout" aria-label="Permalink to &quot;Project layout&quot;">​</a></h1><p>The Agent SDK builds an agent by walking the filesystem under <code>agent/</code>. Each folder has a defined purpose. The path a file lands in determines how the Agent SDK loads it.</p><h2 id="folder-structure" tabindex="-1">Folder structure <a class="header-anchor" href="#folder-structure" aria-label="Permalink to &quot;Folder structure&quot;">​</a></h2><p>For the capabilities below, identity comes from the path.</p><table tabindex="0"><thead><tr><th>Path</th><th>Resolves to</th></tr></thead><tbody><tr><td><code>agent/tools/approve_pr.ts</code></td><td>tool <code>approve_pr</code></td></tr><tr><td><code>agent/mcp-connections/linear.ts</code></td><td>MCP connection <code>linear</code> (model + host)</td></tr><tr><td><code>agent/host-connections/anytool.ts</code></td><td>Host MCP connection <code>anytool</code> (host + <code>mcp oauth</code> only)</td></tr><tr><td><code>agent/skills/pr-review.md</code></td><td>skill <code>pr-review</code></td></tr><tr><td><code>agent/subagents/reviewer/</code></td><td>subagent <code>reviewer</code></td></tr><tr><td><code>agent/extensions/ci.ts</code></td><td>extension mount <code>ci</code>; its contributions become <code>ci__&lt;name&gt;</code></td></tr><tr><td><code>agent/extensions/notion.ts</code></td><td>Cursor plugin mount <code>notion</code> (<code>cursorPlugin</code>); its skills, agents, and MCP servers become <code>notion__&lt;name&gt;</code></td></tr><tr><td><code>agent/channels/drive.ts</code></td><td>channel <code>drive</code>, routes under <code>/v1/channels/drive</code></td></tr></tbody></table><p>The root agent takes its name from <code>package.json</code> <code>name</code>, falling back to the directory name. When serving multiple agents, the slug is the directory name and must match <code>[A-Za-z0-9][A-Za-z0-9_-]*</code> (and not the reserved <code>v1</code>, <code>playground</code>, or <code>docs</code> segments).</p><h2 id="project-overview" tabindex="-1">Project overview <a class="header-anchor" href="#project-overview" aria-label="Permalink to &quot;Project overview&quot;">​</a></h2><p>Most projects start with this shape.</p><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>my-agent/</span></span>
2
2
  <span class="line"><span>├── package.json</span></span>
3
3
  <span class="line"><span>├── agent/</span></span>
4
4
  <span class="line"><span>│ ├── agent.ts # runtime config (model, runtime, cloud/local)</span></span>
@@ -14,6 +14,6 @@ import{_ as t,c as s,o as a,ag as o}from"./chunks/framework.BCISBCiQ.js";const g
14
14
  <span class="line"><span>│ └── channels/</span></span>
15
15
  <span class="line"><span>│ └── github.ts # messages and external events</span></span>
16
16
  <span class="line"><span>└── evals/</span></span>
17
- <span class="line"><span> └── readiness.eval.ts # regression cases</span></span></code></pre></div><p>Evals live in <code>evals/</code> at the project root, a sibling of <code>agent/</code>, never inside it. <code>agent/evals/</code> is silently ignored. See <a href="./../evals.html">Evals</a>.</p><h2 id="folder-reference" tabindex="-1">Folder reference <a class="header-anchor" href="#folder-reference" aria-label="Permalink to &quot;Folder reference&quot;">​</a></h2><p>Each path maps to a capability and a reference page.</p><table tabindex="0"><thead><tr><th>Path</th><th>What it is</th><th>Reference</th></tr></thead><tbody><tr><td><code>agent/agent.ts</code></td><td><code>defineAgent({ model?, runtime?, cloud?, local? })</code>; the model defaults to <code>grok-4.5</code> with <code>effort=high</code>, <code>fast=true</code></td><td><a href="./agent-config.html">Agent config</a></td></tr><tr><td><code>agent/instructions.md</code></td><td>Always-on system prompt, required on the root agent (<code>.ts</code> and directory forms exist)</td><td><a href="./instructions.html">Instructions</a></td></tr><tr><td><code>agent/tools/&lt;name&gt;.ts</code></td><td>One typed tool; filename = tool name. <code>execution: &quot;server&quot;</code> (in-process, default) or <code>&quot;agent&quot;</code> (a script that runs where the agent runs)</td><td><a href="./tools.html">Tools</a></td></tr><tr><td><code>agent/skills/*</code></td><td>SKILL.md-convention procedures, loaded on demand</td><td><a href="./skills.html">Skills</a></td></tr><tr><td><code>agent/mcp-connections/&lt;name&gt;.ts</code></td><td>MCP servers, available to the model, to server tools (<code>ctx.host.mcp</code>), and to channel/schedule handlers (<code>args.host.mcp</code>)</td><td><a href="./connections.html">MCP connections</a></td></tr><tr><td><code>agent/host-connections/&lt;name&gt;.ts</code></td><td>Privileged MCP servers for <code>ctx.host.mcp</code> and <code>mcp oauth</code>. The model never sees them.</td><td><a href="./connections.html">MCP connections</a></td></tr><tr><td><code>agent/subagents/&lt;id&gt;/</code></td><td>Child agent directory; <code>description</code> required</td><td><a href="./subagents.html">Subagents</a></td></tr><tr><td><code>agent/extensions/&lt;ns&gt;.ts</code> or <code>agent/extensions/&lt;ns&gt;/</code></td><td>A mounted extension or Cursor plugin; its contributions become <code>&lt;ns&gt;__&lt;name&gt;</code></td><td><a href="./extensions.html">Extensions</a></td></tr><tr><td><code>agent/channels/*.ts</code></td><td>HTTP surfaces beyond the built-in session API; <code>slack.ts</code> and <code>github.ts</code> use the platform packs</td><td><a href="./channels.html">Channels</a></td></tr><tr><td><code>agent/hooks/*.ts</code></td><td>Observe-only event subscribers, never fatal</td><td><a href="./hooks.html">Hooks</a></td></tr><tr><td><code>agent/otel.ts</code></td><td><code>defineOtel</code> OTLP export (traces, metrics, optional logs)</td><td><a href="./../guides/opentelemetry.html">OpenTelemetry</a></td></tr><tr><td><code>agent/storage.ts</code></td><td><code>defineStorage</code> backend for the durable <code>host.kv</code> / <code>host.files</code> APIs</td><td><a href="./../storage.html">Storage</a></td></tr><tr><td><code>agent/artifacts.ts</code></td><td><code>defineArtifacts</code> kinds, the <code>tag_artifact</code> opt-in, and retention</td><td><a href="./artifacts.html">Artifacts</a></td></tr><tr><td><code>agent/result.ts</code></td><td><code>defineResult</code> host <code>commit</code> on the final assistant text</td><td><a href="./result.html">Turn result</a></td></tr><tr><td><code>agent/schedules/*</code></td><td>Cron-driven runs (UTC, 5-field; never auto-fire under <code>--dev</code>)</td><td><a href="./schedules.html">Schedules</a></td></tr><tr><td><code>agent/sandbox/workspace/**</code></td><td>Seed files copied into each local session workspace</td><td><a href="./sessions.html#what-goes-into-a-local-session-workspace">Sessions</a></td></tr><tr><td><code>agent/playground/</code></td><td>Custom playground tool chips</td><td><a href="./playground.html">Playground</a></td></tr><tr><td><code>agent/lib/</code></td><td>Import-only shared code, never discovered</td><td>None</td></tr><tr><td><code>evals/evals.config.ts</code></td><td>Shared eval settings (e.g. <code>maxConcurrency</code>); required when evals exist</td><td><a href="./../evals.html">Evals</a></td></tr><tr><td><code>evals/**/*.eval.ts</code></td><td>Filesystem evals; case id = path under <code>evals/</code></td><td><a href="./../evals.html">Evals</a></td></tr></tbody></table><p><code>agent/lib/</code> is the only place for shared code. Everything else under <code>agent/</code> is discovery surface. A stray <code>.ts</code> file in one of these folders is treated as a definition.</p><h2 id="why-didn-t-the-agent-sdk-discover-my-file" tabindex="-1">Why didn&#39;t the Agent SDK discover my file? <a class="header-anchor" href="#why-didn-t-the-agent-sdk-discover-my-file" aria-label="Permalink to &quot;Why didn&#39;t the Agent SDK discover my file?&quot;">​</a></h2><p>Run <code>agent-sdk validate --dir .</code> and <code>agent-sdk info --dir .</code>. <code>validate</code> prints diagnostics, and <code>serve</code> refuses to start on error-severity ones. Warnings, such as cloud runtime combined with local-only capabilities, print but don&#39;t block. <code>info</code> lists the discovered surface, so a missing tool or channel shows up immediately. From there, check the folder reference: the file is usually in the wrong directory or has the wrong extension.</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agent-sdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> validate</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --dir</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # diagnostics; non-zero exit on errors</span></span>
17
+ <span class="line"><span> └── readiness.eval.ts # regression cases</span></span></code></pre></div><p>Evals live in <code>evals/</code> at the project root, a sibling of <code>agent/</code>, never inside it. <code>agent/evals/</code> is silently ignored. See <a href="./../evals.html">Evals</a>.</p><h2 id="folder-reference" tabindex="-1">Folder reference <a class="header-anchor" href="#folder-reference" aria-label="Permalink to &quot;Folder reference&quot;">​</a></h2><p>Each path maps to a capability and a reference page.</p><table tabindex="0"><thead><tr><th>Path</th><th>What it is</th><th>Reference</th></tr></thead><tbody><tr><td><code>agent/agent.ts</code></td><td><code>defineAgent({ model?, runtime?, cloud?, local? })</code>; the model defaults to <code>grok-4.5</code> with <code>effort=high</code>, <code>fast=true</code></td><td><a href="./agent-config.html">Agent config</a></td></tr><tr><td><code>agent/instructions.md</code></td><td>Always-on system prompt, required on the root agent (<code>.ts</code> and directory forms exist)</td><td><a href="./instructions.html">Instructions</a></td></tr><tr><td><code>agent/tools/&lt;name&gt;.ts</code></td><td>One typed tool; filename = tool name. <code>execution: &quot;server&quot;</code> (in-process, default) or <code>&quot;agent&quot;</code> (a script that runs where the agent runs)</td><td><a href="./tools.html">Tools</a></td></tr><tr><td><code>agent/skills/*</code></td><td>SKILL.md-convention procedures, loaded on demand</td><td><a href="./skills.html">Skills</a></td></tr><tr><td><code>agent/mcp-connections/&lt;name&gt;.ts</code></td><td>MCP servers, available to the model, to server tools (<code>ctx.host.mcp</code>), and to channel/schedule handlers (<code>args.host.mcp</code>)</td><td><a href="./connections.html">MCP connections</a></td></tr><tr><td><code>agent/host-connections/&lt;name&gt;.ts</code></td><td>Privileged MCP servers for <code>ctx.host.mcp</code> and <code>mcp oauth</code>. The model never sees them.</td><td><a href="./connections.html">MCP connections</a></td></tr><tr><td><code>agent/subagents/&lt;id&gt;/</code></td><td>Child agent directory; <code>description</code> required</td><td><a href="./subagents.html">Subagents</a></td></tr><tr><td><code>agent/extensions/&lt;ns&gt;.ts</code> or <code>agent/extensions/&lt;ns&gt;/</code></td><td>A mounted extension or Cursor plugin; its contributions become <code>&lt;ns&gt;__&lt;name&gt;</code></td><td><a href="./extensions.html">Extensions</a></td></tr><tr><td><code>agent/channels/*.ts</code></td><td>HTTP surfaces beyond the built-in session API; <code>slack.ts</code> and <code>github.ts</code> use the platform packs</td><td><a href="./channels.html">Channels</a></td></tr><tr><td><code>agent/hooks/*.ts</code></td><td>Observe-only event subscribers, never fatal</td><td><a href="./hooks.html">Hooks</a></td></tr><tr><td><code>agent/otel.ts</code></td><td>Factory-only OTLP authoring (<code>defineOtel</code>). Public path is env / <code>serve({ otel })</code>.</td><td><a href="./../guides/opentelemetry.html">OpenTelemetry</a></td></tr><tr><td><code>agent/storage.ts</code></td><td><code>defineStorage</code> backend for the durable <code>host.kv</code> / <code>host.files</code> APIs</td><td>None</td></tr><tr><td><code>agent/artifacts.ts</code></td><td><code>defineArtifacts</code> kinds, the <code>tag_artifact</code> opt-in, and retention</td><td><a href="./artifacts.html">Artifacts</a></td></tr><tr><td><code>agent/result.ts</code></td><td><code>defineResult</code> host <code>commit</code> on the final assistant text (<code>throw</code> or <code>ctx.reject</code>)</td><td>None</td></tr><tr><td><code>agent/schedules/*</code></td><td>Cron-driven runs (UTC, 5-field; never auto-fire under <code>--dev</code>)</td><td><a href="./schedules.html">Schedules</a></td></tr><tr><td><code>agent/sandbox/workspace/**</code></td><td>Seed files copied into each local session workspace</td><td><a href="./sessions.html#what-goes-into-a-local-session-workspace">Sessions</a></td></tr><tr><td><code>agent/playground/</code></td><td>Custom playground tool chips</td><td><a href="./playground.html">Playground</a></td></tr><tr><td><code>agent/lib/</code></td><td>Import-only shared code, never discovered</td><td>None</td></tr><tr><td><code>evals/evals.config.ts</code></td><td>Shared eval settings (e.g. <code>maxConcurrency</code>); required when evals exist</td><td><a href="./../evals.html">Evals</a></td></tr><tr><td><code>evals/**/*.eval.ts</code></td><td>Filesystem evals; case id = path under <code>evals/</code></td><td><a href="./../evals.html">Evals</a></td></tr></tbody></table><p><code>agent/lib/</code> is the only place for shared code. Everything else under <code>agent/</code> is discovery surface. A stray <code>.ts</code> file in one of these folders is treated as a definition.</p><h2 id="why-didn-t-the-agent-sdk-discover-my-file" tabindex="-1">Why didn&#39;t the Agent SDK discover my file? <a class="header-anchor" href="#why-didn-t-the-agent-sdk-discover-my-file" aria-label="Permalink to &quot;Why didn&#39;t the Agent SDK discover my file?&quot;">​</a></h2><p>Run <code>agent-sdk validate --dir .</code> and <code>agent-sdk info --dir .</code>. <code>validate</code> prints diagnostics, and <code>serve</code> refuses to start on error-severity ones. Warnings, such as cloud runtime combined with local-only capabilities, print but don&#39;t block. <code>info</code> lists the discovered surface, so a missing tool or channel shows up immediately. From there, check the folder reference: the file is usually in the wrong directory or has the wrong extension.</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agent-sdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> validate</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --dir</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # diagnostics; non-zero exit on errors</span></span>
18
18
  <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agent-sdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> info</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --dir</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # human-readable surface</span></span>
19
- <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agent-sdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> info</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --dir</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --json</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # machine-readable project info (same shape as GET /v1/info)</span></span></code></pre></div><h2 id="what-s-next" tabindex="-1">What&#39;s next <a class="header-anchor" href="#what-s-next" aria-label="Permalink to &quot;What&#39;s next&quot;">​</a></h2><p>Continue with these pages:</p><ul><li><a href="./agent-config.html">Agent config</a>: the runtime config at the root</li><li><a href="./tools.html">Tools</a>: add typed actions under <code>agent/tools/</code></li><li><a href="./../concepts.html">Concepts</a>: why the filesystem is the interface</li></ul>`,20)])])}const u=t(d,[["render",n]]);export{g as __pageData,u as default};
19
+ <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agent-sdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> info</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --dir</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --json</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # machine-readable project info (same shape as GET /v1/info)</span></span></code></pre></div><h2 id="what-s-next" tabindex="-1">What&#39;s next <a class="header-anchor" href="#what-s-next" aria-label="Permalink to &quot;What&#39;s next&quot;">​</a></h2><p>Continue with these pages:</p><ul><li><a href="./agent-config.html">Agent config</a>: the runtime config at the root</li><li><a href="./tools.html">Tools</a>: add typed actions under <code>agent/tools/</code></li></ul>`,20)])])}const u=t(d,[["render",n]]);export{g as __pageData,u as default};
@@ -1 +1 @@
1
- import{_ as t,c as s,o as a,ag as o}from"./chunks/framework.BCISBCiQ.js";const g=JSON.parse('{"title":"Project layout","description":"The folder structure under agent/ and the path-derived naming rule.","frontmatter":{"title":"Project layout","description":"The folder structure under agent/ and the path-derived naming rule."},"headers":[],"relativePath":"reference/project-layout.md","filePath":"reference/project-layout.md"}'),d={name:"reference/project-layout.md"};function n(r,e,i,c,l,h){return a(),s("div",null,[...e[0]||(e[0]=[o("",20)])])}const u=t(d,[["render",n]]);export{g as __pageData,u as default};
1
+ import{_ as t,c as s,o as a,a3 as o}from"./chunks/framework.dypDpWZ3.js";const g=JSON.parse('{"title":"Project layout","description":"The folder structure under agent/ and the path-derived naming rule.","frontmatter":{"title":"Project layout","description":"The folder structure under agent/ and the path-derived naming rule."},"headers":[],"relativePath":"reference/project-layout.md","filePath":"reference/project-layout.md"}'),d={name:"reference/project-layout.md"};function n(r,e,i,c,l,h){return a(),s("div",null,[...e[0]||(e[0]=[o("",20)])])}const u=t(d,[["render",n]]);export{g as __pageData,u as default};
@@ -1 +1 @@
1
- import{_ as e,c as i,o as t,ag as a}from"./chunks/framework.BCISBCiQ.js";const c=JSON.parse('{"title":"prompt","description":"Dedented multi-line strings for tool descriptions, reminder prompts, channel context, and errors.","frontmatter":{"title":"prompt","description":"Dedented multi-line strings for tool descriptions, reminder prompts, channel context, and errors."},"headers":[],"relativePath":"reference/prompt.md","filePath":"reference/prompt.md"}'),n={name:"reference/prompt.md"};function p(r,s,l,o,h,d){return t(),i("div",null,[...s[0]||(s[0]=[a('<h1 id="prompt" tabindex="-1"><code>prompt</code> <a class="header-anchor" href="#prompt" aria-label="Permalink to &quot;`prompt`&quot;">​</a></h1><p>Authoring helper for long strings that live next to indented TypeScript: tool descriptions, reminder <code>prompt</code> fields, GitHub channel <code>context</code>, and error messages.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { prompt } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;@cursor/july&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>\n<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// or: import { prompt } from &quot;@cursor/july/prompt&quot;;</span></span></code></pre></div><h2 id="prompt-1" tabindex="-1"><code>prompt\\</code>…`` <a class="header-anchor" href="#prompt-1" aria-label="Permalink to &quot;`prompt\\`…\\``&quot;">​</a></h2><p>Returns a single dedented string. Common leading whitespace is stripped; a leading newline after the opening backtick is dropped so the usual multiline form stays readable in source.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">throw</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> new</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Error</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">prompt</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">`</span></span>\n<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> It is outside business hours (Mon–Fri 9am–5pm ET).</span></span>\n<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> Use request_author_approval, or pass approval=human_request.</span></span>\n<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">`</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">);</span></span></code></pre></div><p>Blank lines inside the body are preserved. Relative indentation after the common prefix is kept (handy for nested bullet lists).</p><p>When interpolating multi-line values (for example a list of services), give those lines the same indent as the <code>prompt</code> body so dedent stays consistent.</p><h2 id="prompt-lines" tabindex="-1"><code>prompt.lines\\</code>…`` <a class="header-anchor" href="#prompt-lines" aria-label="Permalink to &quot;`prompt.lines\\`…\\``&quot;">​</a></h2><p>Same dedent rules, but returns <code>string[]</code>, one entry per line. Use this where an API wants separate lines (for example GitHub channel <code>context</code>):</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">context</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: prompt.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">lines</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">`</span></span>\n<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> Merged PR detected: ${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">pr</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">.</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">url</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">} by ${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">author</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">}.</span></span>\n<span class="line"></span>\n<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> Call plan_deploy, then follow its nextStep.</span></span>\n<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">`</span></span></code></pre></div>',11)])])}const m=e(n,[["render",p]]);export{c as __pageData,m as default};
1
+ import{_ as e,c as i,o as t,a3 as a}from"./chunks/framework.dypDpWZ3.js";const c=JSON.parse('{"title":"prompt","description":"Dedented multi-line strings for tool descriptions, reminder prompts, channel context, and errors.","frontmatter":{"title":"prompt","description":"Dedented multi-line strings for tool descriptions, reminder prompts, channel context, and errors."},"headers":[],"relativePath":"reference/prompt.md","filePath":"reference/prompt.md"}'),n={name:"reference/prompt.md"};function p(r,s,l,o,h,d){return t(),i("div",null,[...s[0]||(s[0]=[a('<h1 id="prompt" tabindex="-1"><code>prompt</code> <a class="header-anchor" href="#prompt" aria-label="Permalink to &quot;`prompt`&quot;">​</a></h1><p>Authoring helper for long strings that live next to indented TypeScript: tool descriptions, reminder <code>prompt</code> fields, GitHub channel <code>context</code>, and error messages.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { prompt } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;@cursor/july&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>\n<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// or: import { prompt } from &quot;@cursor/july/prompt&quot;;</span></span></code></pre></div><h2 id="prompt-1" tabindex="-1"><code>prompt\\</code>…`` <a class="header-anchor" href="#prompt-1" aria-label="Permalink to &quot;`prompt\\`…\\``&quot;">​</a></h2><p>Returns a single dedented string. Common leading whitespace is stripped; a leading newline after the opening backtick is dropped so the usual multiline form stays readable in source.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">throw</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> new</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Error</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">prompt</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">`</span></span>\n<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> It is outside business hours (Mon–Fri 9am–5pm ET).</span></span>\n<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> Use request_author_approval, or pass approval=human_request.</span></span>\n<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">`</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">);</span></span></code></pre></div><p>Blank lines inside the body are preserved. Relative indentation after the common prefix is kept (handy for nested bullet lists).</p><p>When interpolating multi-line values (for example a list of services), give those lines the same indent as the <code>prompt</code> body so dedent stays consistent.</p><h2 id="prompt-lines" tabindex="-1"><code>prompt.lines\\</code>…`` <a class="header-anchor" href="#prompt-lines" aria-label="Permalink to &quot;`prompt.lines\\`…\\``&quot;">​</a></h2><p>Same dedent rules, but returns <code>string[]</code>, one entry per line. Use this where an API wants separate lines (for example GitHub channel <code>context</code>):</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">context</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: prompt.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">lines</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">`</span></span>\n<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> Merged PR detected: ${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">pr</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">.</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">url</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">} by ${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">author</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">}.</span></span>\n<span class="line"></span>\n<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> Call plan_deploy, then follow its nextStep.</span></span>\n<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">`</span></span></code></pre></div>',11)])])}const m=e(n,[["render",p]]);export{c as __pageData,m as default};
@@ -1 +1 @@
1
- import{_ as e,c as i,o as t,ag as a}from"./chunks/framework.BCISBCiQ.js";const c=JSON.parse('{"title":"prompt","description":"Dedented multi-line strings for tool descriptions, reminder prompts, channel context, and errors.","frontmatter":{"title":"prompt","description":"Dedented multi-line strings for tool descriptions, reminder prompts, channel context, and errors."},"headers":[],"relativePath":"reference/prompt.md","filePath":"reference/prompt.md"}'),n={name:"reference/prompt.md"};function p(r,s,l,o,h,d){return t(),i("div",null,[...s[0]||(s[0]=[a("",11)])])}const m=e(n,[["render",p]]);export{c as __pageData,m as default};
1
+ import{_ as e,c as i,o as t,a3 as a}from"./chunks/framework.dypDpWZ3.js";const c=JSON.parse('{"title":"prompt","description":"Dedented multi-line strings for tool descriptions, reminder prompts, channel context, and errors.","frontmatter":{"title":"prompt","description":"Dedented multi-line strings for tool descriptions, reminder prompts, channel context, and errors."},"headers":[],"relativePath":"reference/prompt.md","filePath":"reference/prompt.md"}'),n={name:"reference/prompt.md"};function p(r,s,l,o,h,d){return t(),i("div",null,[...s[0]||(s[0]=[a("",11)])])}const m=e(n,[["render",p]]);export{c as __pageData,m as default};
@@ -1,4 +1,4 @@
1
- import{_ as i,c as a,o as n,ag as e}from"./chunks/framework.BCISBCiQ.js";const E=JSON.parse('{"title":"Schedules & reminders","description":"Cron-driven runs defined at deploy time, and per-session durable wakes created at runtime.","frontmatter":{"title":"Schedules & reminders","description":"Cron-driven runs defined at deploy time, and per-session durable wakes created at runtime."},"headers":[],"relativePath":"reference/schedules.md","filePath":"reference/schedules.md"}'),t={name:"reference/schedules.md"};function h(l,s,p,k,d,r){return n(),a("div",null,[...s[0]||(s[0]=[e(`<h1 id="schedules-and-reminders" tabindex="-1">Schedules and reminders <a class="header-anchor" href="#schedules-and-reminders" aria-label="Permalink to &quot;Schedules and reminders&quot;">​</a></h1><p>Two ways an agent acts without an inbound message. A schedule is deploy-time cron: &quot;every weekday at 09:00, summarize open incidents.&quot; A reminder is a runtime wake bound to one conversation: &quot;re-check this PR&#39;s CI in two hours.&quot; Schedules live in the filesystem; reminders are created by running code.</p><h2 id="schedules" tabindex="-1">Schedules <a class="header-anchor" href="#schedules" aria-label="Permalink to &quot;Schedules&quot;">​</a></h2><p>Cron expressions are standard 5-field, evaluated in UTC with minute granularity.</p><h3 id="schedules-in-markdown" tabindex="-1">Schedules in Markdown <a class="header-anchor" href="#schedules-in-markdown" aria-label="Permalink to &quot;Schedules in Markdown&quot;">​</a></h3><p>A plain markdown file with <code>cron:</code> frontmatter is a fire-and-forget task:</p><div class="language-md vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">md</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold;">---</span></span>
1
+ import{_ as i,c as a,o as n,a3 as e}from"./chunks/framework.dypDpWZ3.js";const E=JSON.parse('{"title":"Schedules & reminders","description":"Cron-driven runs defined at deploy time, and per-session durable wakes created at runtime.","frontmatter":{"title":"Schedules & reminders","description":"Cron-driven runs defined at deploy time, and per-session durable wakes created at runtime."},"headers":[],"relativePath":"reference/schedules.md","filePath":"reference/schedules.md"}'),t={name:"reference/schedules.md"};function h(l,s,p,k,d,r){return n(),a("div",null,[...s[0]||(s[0]=[e(`<h1 id="schedules-and-reminders" tabindex="-1">Schedules and reminders <a class="header-anchor" href="#schedules-and-reminders" aria-label="Permalink to &quot;Schedules and reminders&quot;">​</a></h1><p>Two ways an agent acts without an inbound message. A schedule is deploy-time cron: &quot;every weekday at 09:00, summarize open incidents.&quot; A reminder is a runtime wake bound to one conversation: &quot;re-check this PR&#39;s CI in two hours.&quot; Schedules live in the filesystem; reminders are created by running code.</p><h2 id="schedules" tabindex="-1">Schedules <a class="header-anchor" href="#schedules" aria-label="Permalink to &quot;Schedules&quot;">​</a></h2><p>Cron expressions are standard 5-field, evaluated in UTC with minute granularity.</p><h3 id="schedules-in-markdown" tabindex="-1">Schedules in Markdown <a class="header-anchor" href="#schedules-in-markdown" aria-label="Permalink to &quot;Schedules in Markdown&quot;">​</a></h3><p>A plain markdown file with <code>cron:</code> frontmatter is a fire-and-forget task:</p><div class="language-md vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">md</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold;">---</span></span>
2
2
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">cron: &quot;0 9 * * 1-5&quot;</span></span>
3
3
  <span class="line"><span style="--shiki-light:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold;">---</span></span>
4
4
  <span class="line"></span>
@@ -1 +1 @@
1
- import{_ as i,c as a,o as n,ag as e}from"./chunks/framework.BCISBCiQ.js";const E=JSON.parse('{"title":"Schedules & reminders","description":"Cron-driven runs defined at deploy time, and per-session durable wakes created at runtime.","frontmatter":{"title":"Schedules & reminders","description":"Cron-driven runs defined at deploy time, and per-session durable wakes created at runtime."},"headers":[],"relativePath":"reference/schedules.md","filePath":"reference/schedules.md"}'),t={name:"reference/schedules.md"};function h(l,s,p,k,d,r){return n(),a("div",null,[...s[0]||(s[0]=[e("",38)])])}const c=i(t,[["render",h]]);export{E as __pageData,c as default};
1
+ import{_ as i,c as a,o as n,a3 as e}from"./chunks/framework.dypDpWZ3.js";const E=JSON.parse('{"title":"Schedules & reminders","description":"Cron-driven runs defined at deploy time, and per-session durable wakes created at runtime.","frontmatter":{"title":"Schedules & reminders","description":"Cron-driven runs defined at deploy time, and per-session durable wakes created at runtime."},"headers":[],"relativePath":"reference/schedules.md","filePath":"reference/schedules.md"}'),t={name:"reference/schedules.md"};function h(l,s,p,k,d,r){return n(),a("div",null,[...s[0]||(s[0]=[e("",38)])])}const c=i(t,[["render",h]]);export{E as __pageData,c as default};