@grok/agent-sdk 0.2.28 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (528) hide show
  1. package/AGENTS.md +29 -29
  2. package/dist/bin/agent-serve.d.ts +2 -2
  3. package/dist/bin/agent-serve.js +3 -3
  4. package/dist/channels/pagerduty/api.js +1 -1
  5. package/dist/channels/pagerduty/pagerduty-channel.d.ts +1 -1
  6. package/dist/channels/pagerduty/pagerduty-channel.d.ts.map +1 -1
  7. package/dist/channels/pagerduty/pagerduty-channel.js +1 -1
  8. package/dist/channels/pagerduty/replay.d.ts +1 -1
  9. package/dist/channels/pagerduty/replay.js +4 -4
  10. package/dist/channels/slack/cli-project.js +1 -1
  11. package/dist/docs/404.html +2 -2
  12. package/dist/docs/assets/{app.DF9vlcdn.js → app.BzTUBOAD.js} +4 -4
  13. package/dist/docs/assets/building-with-agents.md.BqJ7AAjG.js +6 -0
  14. package/dist/docs/assets/{building-with-agents.md.Bf1yH2tG.lean.js → building-with-agents.md.BqJ7AAjG.lean.js} +1 -1
  15. package/dist/docs/assets/changelog.md.BWhC6DET.js +1 -0
  16. package/dist/docs/assets/changelog.md.BWhC6DET.lean.js +1 -0
  17. package/dist/docs/assets/chunks/@localSearchIndexroot.CWxwVoCG.js +1 -0
  18. package/dist/docs/assets/chunks/{VPLocalSearchBox.D8OuwKO0.js → VPLocalSearchBox.DsnRlUT5.js} +1 -1
  19. package/dist/docs/assets/chunks/{arc.DCq_TCYV.js → arc.DH8GOhiv.js} +1 -1
  20. package/dist/docs/assets/chunks/{architectureDiagram-Q4EWVU46.PWRNTPbk.js → architectureDiagram-Q4EWVU46.9m9ObyuE.js} +1 -1
  21. package/dist/docs/assets/chunks/{baseUniq.BeRPvRUL.js → baseUniq.BXHpx1lE.js} +1 -1
  22. package/dist/docs/assets/chunks/{blockDiagram-DXYQGD6D.BuRmZVSo.js → blockDiagram-DXYQGD6D.xY3EX59q.js} +1 -1
  23. package/dist/docs/assets/chunks/{c4Diagram-AHTNJAMY.7DKSMwuv.js → c4Diagram-AHTNJAMY.DnqgMVgc.js} +1 -1
  24. package/dist/docs/assets/chunks/channel.Cctv0f7X.js +1 -0
  25. package/dist/docs/assets/chunks/{chunk-4BX2VUAB.7VrO9-9i.js → chunk-4BX2VUAB.BjFxK2A3.js} +1 -1
  26. package/dist/docs/assets/chunks/{chunk-4TB4RGXK.CHystNE2.js → chunk-4TB4RGXK.BujS_Spt.js} +1 -1
  27. package/dist/docs/assets/chunks/{chunk-55IACEB6.Nuh9TbTq.js → chunk-55IACEB6.YbTjhdaM.js} +1 -1
  28. package/dist/docs/assets/chunks/{chunk-EDXVE4YY.CA0EKugm.js → chunk-EDXVE4YY.DnQ8t4GC.js} +1 -1
  29. package/dist/docs/assets/chunks/{chunk-FMBD7UC4.F9_mp7U8.js → chunk-FMBD7UC4.B67AwAmj.js} +1 -1
  30. package/dist/docs/assets/chunks/{chunk-OYMX7WX6.CEU4QfE1.js → chunk-OYMX7WX6.DrZIAFOm.js} +1 -1
  31. package/dist/docs/assets/chunks/{chunk-QZHKN3VN.B8h_x9_i.js → chunk-QZHKN3VN.BLmmydkn.js} +1 -1
  32. package/dist/docs/assets/chunks/{chunk-YZCP3GAM.Btfb-rKg.js → chunk-YZCP3GAM.DaoOfw0O.js} +1 -1
  33. package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.DU5sqchW.js +1 -0
  34. package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.DU5sqchW.js +1 -0
  35. package/dist/docs/assets/chunks/clone.B9rdNt6j.js +1 -0
  36. package/dist/docs/assets/chunks/{cose-bilkent-S5V4N54A.DKvc96Wa.js → cose-bilkent-S5V4N54A.DMQuNhM5.js} +1 -1
  37. package/dist/docs/assets/chunks/{dagre-KV5264BT.CMo0cy1b.js → dagre-KV5264BT.CZoGVuUf.js} +1 -1
  38. package/dist/docs/assets/chunks/{diagram-5BDNPKRD.DDgMOQhB.js → diagram-5BDNPKRD.CLt9uOyL.js} +1 -1
  39. package/dist/docs/assets/chunks/{diagram-G4DWMVQ6.BdJnoIsU.js → diagram-G4DWMVQ6.DpczEm1G.js} +1 -1
  40. package/dist/docs/assets/chunks/{diagram-MMDJMWI5.oSvhAZaL.js → diagram-MMDJMWI5.D4r13DvJ.js} +1 -1
  41. package/dist/docs/assets/chunks/{diagram-TYMM5635.C9zZLIE-.js → diagram-TYMM5635.CYU9eGFu.js} +1 -1
  42. package/dist/docs/assets/chunks/{erDiagram-SMLLAGMA.BNhVyccy.js → erDiagram-SMLLAGMA.QA9naWEw.js} +1 -1
  43. package/dist/docs/assets/chunks/{flowDiagram-DWJPFMVM.BEFLLBiU.js → flowDiagram-DWJPFMVM.BbNoVZYd.js} +1 -1
  44. package/dist/docs/assets/chunks/{ganttDiagram-T4ZO3ILL.BdUzXBgY.js → ganttDiagram-T4ZO3ILL.IHjDoG7r.js} +1 -1
  45. package/dist/docs/assets/chunks/{gitGraphDiagram-UUTBAWPF.Rd3LlOIJ.js → gitGraphDiagram-UUTBAWPF.B21VMdf5.js} +1 -1
  46. package/dist/docs/assets/chunks/{graph.DnJC1GpG.js → graph.DgJ4L-8V.js} +1 -1
  47. package/dist/docs/assets/chunks/{infoDiagram-42DDH7IO.xv0xntDJ.js → infoDiagram-42DDH7IO.CQjrcthc.js} +1 -1
  48. package/dist/docs/assets/chunks/{ishikawaDiagram-UXIWVN3A.BaGIlviU.js → ishikawaDiagram-UXIWVN3A.D4tPGtVo.js} +1 -1
  49. package/dist/docs/assets/chunks/{journeyDiagram-VCZTEJTY.Cof_h0fp.js → journeyDiagram-VCZTEJTY.BD3WaNbQ.js} +1 -1
  50. package/dist/docs/assets/chunks/{kanban-definition-6JOO6SKY.C5GozFuU.js → kanban-definition-6JOO6SKY.Ca0o4Tqz.js} +1 -1
  51. package/dist/docs/assets/chunks/{layout.zc9UShLc.js → layout.DXXqX4MQ.js} +1 -1
  52. package/dist/docs/assets/chunks/{linear.BoqrFVcJ.js → linear.5c61gNw4.js} +1 -1
  53. package/dist/docs/assets/chunks/{min.DwIfr8hG.js → min.B1-NAjHX.js} +1 -1
  54. package/dist/docs/assets/chunks/{mindmap-definition-QFDTVHPH.Dkq2yTtp.js → mindmap-definition-QFDTVHPH.BELznv3-.js} +1 -1
  55. package/dist/docs/assets/chunks/{pieDiagram-DEJITSTG.B4CpTmHK.js → pieDiagram-DEJITSTG.qPzO1mq5.js} +1 -1
  56. package/dist/docs/assets/chunks/{quadrantDiagram-34T5L4WZ.BqXnFC9C.js → quadrantDiagram-34T5L4WZ.CxIvzbjX.js} +1 -1
  57. package/dist/docs/assets/chunks/{requirementDiagram-MS252O5E.DhIN2z-E.js → requirementDiagram-MS252O5E.CqA0iJx8.js} +1 -1
  58. package/dist/docs/assets/chunks/{sankeyDiagram-XADWPNL6.BhxUAmg2.js → sankeyDiagram-XADWPNL6.XRTutBnb.js} +1 -1
  59. package/dist/docs/assets/chunks/{sequenceDiagram-FGHM5R23.BqgU7HU-.js → sequenceDiagram-FGHM5R23.E--7bRLQ.js} +1 -1
  60. package/dist/docs/assets/chunks/{stateDiagram-FHFEXIEX.B1BCO18N.js → stateDiagram-FHFEXIEX.C4vGu8zq.js} +1 -1
  61. package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.ECMu2BdJ.js +1 -0
  62. package/dist/docs/assets/chunks/{theme.oV7rddEz.js → theme.DMj_7q3B.js} +2 -2
  63. package/dist/docs/assets/chunks/{timeline-definition-GMOUNBTQ.oRI8UwMC.js → timeline-definition-GMOUNBTQ.C7LgNVAL.js} +1 -1
  64. package/dist/docs/assets/chunks/{vennDiagram-DHZGUBPP.DmuWrIxN.js → vennDiagram-DHZGUBPP.HUwoZcy_.js} +1 -1
  65. package/dist/docs/assets/chunks/{wardley-RL74JXVD.CEBjM5ov.js → wardley-RL74JXVD.BxFEFYZS.js} +1 -1
  66. package/dist/docs/assets/chunks/{wardleyDiagram-NUSXRM2D.m5zsCOF9.js → wardleyDiagram-NUSXRM2D.B2pSo5rB.js} +1 -1
  67. package/dist/docs/assets/chunks/{xychartDiagram-5P7HB3ND.cPN-587n.js → xychartDiagram-5P7HB3ND.NQhMiOOL.js} +1 -1
  68. package/dist/docs/assets/deployment.md.BtqJrHhp.js +31 -0
  69. package/dist/docs/assets/{deployment.md.DDmjAVbg.lean.js → deployment.md.BtqJrHhp.lean.js} +1 -1
  70. package/dist/docs/assets/evals.md.Dne6VRmZ.js +49 -0
  71. package/dist/docs/assets/evals.md.Dne6VRmZ.lean.js +1 -0
  72. package/dist/docs/assets/{guides_agent-to-agent.md.D1D5f6Jc.js → guides_agent-to-agent.md.BcmSqL2z.js} +8 -8
  73. package/dist/docs/assets/guides_agent-to-agent.md.BcmSqL2z.lean.js +1 -0
  74. package/dist/docs/assets/{guides_bitbucket.md.DkjkBRU8.js → guides_bitbucket.md.BiA6ZMFW.js} +27 -27
  75. package/dist/docs/assets/{guides_bitbucket.md.DkjkBRU8.lean.js → guides_bitbucket.md.BiA6ZMFW.lean.js} +1 -1
  76. package/dist/docs/assets/guides_cloud-agents.md.CiXAW6on.js +9 -0
  77. package/dist/docs/assets/{guides_cloud-agents.md.Ceyjv0ul.lean.js → guides_cloud-agents.md.CiXAW6on.lean.js} +1 -1
  78. package/dist/docs/assets/guides_convert-automation.md.BvTxsJ8J.js +26 -0
  79. package/dist/docs/assets/{guides_convert-automation.md.BjraCvok.lean.js → guides_convert-automation.md.BvTxsJ8J.lean.js} +1 -1
  80. package/dist/docs/assets/{guides_github.md.CgN5sNbW.js → guides_github.md.6jiEH7dg.js} +11 -19
  81. package/dist/docs/assets/{guides_github.md.CgN5sNbW.lean.js → guides_github.md.6jiEH7dg.lean.js} +1 -1
  82. package/dist/docs/assets/{guides_gitlab.md.DCE0p7_w.js → guides_gitlab.md.DcKusOcU.js} +63 -73
  83. package/dist/docs/assets/{guides_gitlab.md.DCE0p7_w.lean.js → guides_gitlab.md.DcKusOcU.lean.js} +1 -1
  84. package/dist/docs/assets/guides_improve.md.o3WOGR7n.js +16 -0
  85. package/dist/docs/assets/{guides_improve.md.BFYtrtLE.lean.js → guides_improve.md.o3WOGR7n.lean.js} +1 -1
  86. package/dist/docs/assets/{guides_jev.md.Ccw4pedT.js → guides_jev.md.DGCzkMUN.js} +20 -60
  87. package/dist/docs/assets/{guides_jev.md.Ccw4pedT.lean.js → guides_jev.md.DGCzkMUN.lean.js} +1 -1
  88. package/dist/docs/assets/{guides_mcp-oauth.md.ekpWOZCC.js → guides_mcp-oauth.md.C-Sx_IPa.js} +3 -5
  89. package/dist/docs/assets/{guides_mcp-oauth.md.ekpWOZCC.lean.js → guides_mcp-oauth.md.C-Sx_IPa.lean.js} +1 -1
  90. package/dist/docs/assets/guides_migrate.md.BbhHYeCr.js +3 -0
  91. package/dist/docs/assets/{guides_migrate.md.RS9Eu-Xh.lean.js → guides_migrate.md.BbhHYeCr.lean.js} +1 -1
  92. package/dist/docs/assets/guides_opentelemetry.md.BRSktBHt.js +26 -0
  93. package/dist/docs/assets/guides_opentelemetry.md.BRSktBHt.lean.js +1 -0
  94. package/dist/docs/assets/guides_pagerduty.md.pMXUkZZc.js +61 -0
  95. package/dist/docs/assets/guides_pagerduty.md.pMXUkZZc.lean.js +1 -0
  96. package/dist/docs/assets/guides_slack.md.BgIGG9ur.js +82 -0
  97. package/dist/docs/assets/{guides_slack.md.BqiGSYGX.lean.js → guides_slack.md.BgIGG9ur.lean.js} +1 -1
  98. package/dist/docs/assets/{guides_webhooks.md.BJk63ZTs.js → guides_webhooks.md.B5DXt2v1.js} +7 -7
  99. package/dist/docs/assets/{guides_webhooks.md.BJk63ZTs.lean.js → guides_webhooks.md.B5DXt2v1.lean.js} +1 -1
  100. package/dist/docs/assets/hillclimbing.md.3TkdF79A.js +5 -0
  101. package/dist/docs/assets/hillclimbing.md.3TkdF79A.lean.js +1 -0
  102. package/dist/docs/assets/index.md.DRfaoRCZ.js +20 -0
  103. package/dist/docs/assets/index.md.DRfaoRCZ.lean.js +1 -0
  104. package/dist/docs/assets/quickstart.md.r-oE8nkX.js +113 -0
  105. package/dist/docs/assets/{quickstart.md.DaLk4ZIF.lean.js → quickstart.md.r-oE8nkX.lean.js} +1 -1
  106. package/dist/docs/assets/reference_access.md.C5lblfUC.js +1 -0
  107. package/dist/docs/assets/{reference_access.md.CExlH_mR.lean.js → reference_access.md.C5lblfUC.lean.js} +1 -1
  108. package/dist/docs/assets/reference_agent-config.md.C0Tp_Fk9.js +27 -0
  109. package/dist/docs/assets/{reference_agent-config.md.11E_xe--.lean.js → reference_agent-config.md.C0Tp_Fk9.lean.js} +1 -1
  110. package/dist/docs/assets/reference_artifacts.md.BJpAI7h9.js +17 -0
  111. package/dist/docs/assets/{reference_artifacts.md.C-hKR2hp.lean.js → reference_artifacts.md.BJpAI7h9.lean.js} +1 -1
  112. package/dist/docs/assets/reference_channels.md.CPWOpdsC.js +21 -0
  113. package/dist/docs/assets/{reference_channels.md.DsJfGSBJ.lean.js → reference_channels.md.CPWOpdsC.lean.js} +1 -1
  114. package/dist/docs/assets/reference_cli.md.B8GdpaRj.js +83 -0
  115. package/dist/docs/assets/reference_cli.md.B8GdpaRj.lean.js +1 -0
  116. package/dist/docs/assets/reference_connections.md.DoY4vrDH.js +54 -0
  117. package/dist/docs/assets/{reference_connections.md.BoAotr7_.lean.js → reference_connections.md.DoY4vrDH.lean.js} +1 -1
  118. package/dist/docs/assets/reference_evals.md.DgfUtfIc.js +69 -0
  119. package/dist/docs/assets/{reference_evals.md.DYKjGFi-.lean.js → reference_evals.md.DgfUtfIc.lean.js} +1 -1
  120. package/dist/docs/assets/{reference_extensions.md.pEVj72Xo.js → reference_extensions.md.DHbW6eOf.js} +6 -8
  121. package/dist/docs/assets/{reference_extensions.md.pEVj72Xo.lean.js → reference_extensions.md.DHbW6eOf.lean.js} +1 -1
  122. package/dist/docs/assets/reference_hooks.md.CSWmOwMM.js +39 -0
  123. package/dist/docs/assets/reference_hooks.md.CSWmOwMM.lean.js +1 -0
  124. package/dist/docs/assets/reference_http-api.md.C7Cb0r2J.js +7 -0
  125. package/dist/docs/assets/{reference_http-api.md._RWELr3d.lean.js → reference_http-api.md.C7Cb0r2J.lean.js} +1 -1
  126. package/dist/docs/assets/reference_instructions.md.CV6Qq0UX.js +14 -0
  127. package/dist/docs/assets/reference_instructions.md.CV6Qq0UX.lean.js +1 -0
  128. package/dist/docs/assets/reference_limits.md.CbdtFr4T.js +8 -0
  129. package/dist/docs/assets/reference_limits.md.CbdtFr4T.lean.js +1 -0
  130. package/dist/docs/assets/reference_memory.md.CdoJISM-.js +3 -0
  131. package/dist/docs/assets/{reference_memory.md.Dd7cyV9V.lean.js → reference_memory.md.CdoJISM-.lean.js} +1 -1
  132. package/dist/docs/assets/reference_playground.md.DIUsRAcy.js +1 -0
  133. package/dist/docs/assets/{reference_playground.md.CQiJk9CM.lean.js → reference_playground.md.DIUsRAcy.lean.js} +1 -1
  134. package/dist/docs/assets/reference_project-layout.md.9DiKoE16.js +26 -0
  135. package/dist/docs/assets/reference_project-layout.md.9DiKoE16.lean.js +1 -0
  136. package/dist/docs/assets/reference_schedules.md.RhQ9ZLo1.js +45 -0
  137. package/dist/docs/assets/{reference_schedules.md.RC47aFm4.lean.js → reference_schedules.md.RhQ9ZLo1.lean.js} +1 -1
  138. package/dist/docs/assets/reference_sessions.md.NXVQt9mP.js +22 -0
  139. package/dist/docs/assets/{reference_sessions.md.C7KFhWXV.lean.js → reference_sessions.md.NXVQt9mP.lean.js} +1 -1
  140. package/dist/docs/assets/{reference_skills.md.Dej2zQxi.js → reference_skills.md.DzCPNPkG.js} +4 -4
  141. package/dist/docs/assets/{reference_skills.md.Dej2zQxi.lean.js → reference_skills.md.DzCPNPkG.lean.js} +1 -1
  142. package/dist/docs/assets/reference_subagents.md.Dvpq2sUu.js +10 -0
  143. package/dist/docs/assets/{reference_subagents.md.CAhvW4yS.lean.js → reference_subagents.md.Dvpq2sUu.lean.js} +1 -1
  144. package/dist/docs/assets/reference_tools.md.B2OaR1Nb.js +62 -0
  145. package/dist/docs/assets/{reference_tools.md.DQr7Fnhu.lean.js → reference_tools.md.B2OaR1Nb.lean.js} +1 -1
  146. package/dist/docs/assets/templates_agentic-owners.md.B6ZmKAzT.js +13 -0
  147. package/dist/docs/assets/{templates_agentic-owners.md.Dh2nDSqg.lean.js → templates_agentic-owners.md.B6ZmKAzT.lean.js} +1 -1
  148. package/dist/docs/assets/templates_reviews.md.dr9Xv_KM.js +10 -0
  149. package/dist/docs/assets/templates_reviews.md.dr9Xv_KM.lean.js +1 -0
  150. package/dist/docs/assets/troubleshooting.md.DfKKvW1R.js +3 -0
  151. package/dist/docs/assets/{troubleshooting.md.AGJ3jDzj.lean.js → troubleshooting.md.DfKKvW1R.lean.js} +1 -1
  152. package/dist/docs/building-with-agents.html +41 -44
  153. package/dist/docs/building-with-agents.md +11 -104
  154. package/dist/docs/changelog.html +37 -37
  155. package/dist/docs/changelog.md +5 -145
  156. package/dist/docs/deployment.html +54 -54
  157. package/dist/docs/deployment.md +86 -265
  158. package/dist/docs/evals.html +52 -71
  159. package/dist/docs/evals.md +33 -127
  160. package/dist/docs/guides/agent-to-agent.html +43 -43
  161. package/dist/docs/guides/agent-to-agent.md +27 -64
  162. package/dist/docs/guides/bitbucket.html +62 -62
  163. package/dist/docs/guides/bitbucket.md +73 -134
  164. package/dist/docs/guides/cloud-agents.html +37 -37
  165. package/dist/docs/guides/cloud-agents.md +23 -53
  166. package/dist/docs/guides/convert-automation.html +39 -56
  167. package/dist/docs/guides/convert-automation.md +31 -115
  168. package/dist/docs/guides/github.html +46 -54
  169. package/dist/docs/guides/github.md +49 -131
  170. package/dist/docs/guides/gitlab.html +98 -108
  171. package/dist/docs/guides/gitlab.md +104 -184
  172. package/dist/docs/guides/improve.html +38 -43
  173. package/dist/docs/guides/improve.md +24 -90
  174. package/dist/docs/guides/jev.html +55 -95
  175. package/dist/docs/guides/jev.md +57 -159
  176. package/dist/docs/guides/mcp-oauth.html +38 -40
  177. package/dist/docs/guides/mcp-oauth.md +34 -69
  178. package/dist/docs/guides/migrate.html +38 -43
  179. package/dist/docs/guides/migrate.md +56 -130
  180. package/dist/docs/guides/opentelemetry.html +41 -43
  181. package/dist/docs/guides/opentelemetry.md +32 -27
  182. package/dist/docs/guides/pagerduty.html +50 -49
  183. package/dist/docs/guides/pagerduty.md +65 -199
  184. package/dist/docs/guides/slack.html +51 -57
  185. package/dist/docs/guides/slack.md +76 -205
  186. package/dist/docs/guides/webhooks.html +42 -42
  187. package/dist/docs/guides/webhooks.md +64 -146
  188. package/dist/docs/hashmap.json +1 -1
  189. package/dist/docs/hillclimbing.html +40 -42
  190. package/dist/docs/hillclimbing.md +40 -102
  191. package/dist/docs/index.html +55 -62
  192. package/dist/docs/index.md +49 -82
  193. package/dist/docs/llms-full.txt +2292 -5830
  194. package/dist/docs/llms.txt +9 -15
  195. package/dist/docs/quickstart.html +96 -153
  196. package/dist/docs/quickstart.md +93 -178
  197. package/dist/docs/reference/access.html +36 -36
  198. package/dist/docs/reference/access.md +7 -12
  199. package/dist/docs/reference/agent-config.html +43 -56
  200. package/dist/docs/reference/agent-config.md +93 -176
  201. package/dist/docs/reference/artifacts.html +38 -39
  202. package/dist/docs/reference/artifacts.md +38 -62
  203. package/dist/docs/reference/channels.html +38 -39
  204. package/dist/docs/reference/channels.md +102 -151
  205. package/dist/docs/reference/cli.html +68 -84
  206. package/dist/docs/reference/cli.md +233 -698
  207. package/dist/docs/reference/connections.html +45 -57
  208. package/dist/docs/reference/connections.md +83 -164
  209. package/dist/docs/reference/evals.html +66 -53
  210. package/dist/docs/reference/evals.md +97 -128
  211. package/dist/docs/reference/extensions.html +41 -43
  212. package/dist/docs/reference/extensions.md +37 -70
  213. package/dist/docs/reference/hooks.html +40 -52
  214. package/dist/docs/reference/hooks.md +62 -133
  215. package/dist/docs/reference/http-api.html +38 -42
  216. package/dist/docs/reference/http-api.md +66 -118
  217. package/dist/docs/reference/instructions.html +39 -39
  218. package/dist/docs/reference/instructions.md +19 -29
  219. package/dist/docs/reference/limits.html +38 -38
  220. package/dist/docs/reference/limits.md +9 -21
  221. package/dist/docs/reference/memory.html +37 -38
  222. package/dist/docs/reference/memory.md +38 -75
  223. package/dist/docs/reference/playground.html +36 -36
  224. package/dist/docs/reference/playground.md +14 -22
  225. package/dist/docs/reference/project-layout.html +49 -48
  226. package/dist/docs/reference/project-layout.md +38 -84
  227. package/dist/docs/reference/schedules.html +46 -48
  228. package/dist/docs/reference/schedules.md +59 -90
  229. package/dist/docs/reference/sessions.html +37 -37
  230. package/dist/docs/reference/sessions.md +66 -113
  231. package/dist/docs/reference/skills.html +39 -39
  232. package/dist/docs/reference/skills.md +11 -31
  233. package/dist/docs/reference/subagents.html +37 -37
  234. package/dist/docs/reference/subagents.md +17 -31
  235. package/dist/docs/reference/tools.html +47 -64
  236. package/dist/docs/reference/tools.md +48 -130
  237. package/dist/docs/templates/agentic-owners.html +38 -38
  238. package/dist/docs/templates/agentic-owners.md +50 -74
  239. package/dist/docs/templates/reviews.html +69 -0
  240. package/dist/docs/templates/reviews.md +71 -0
  241. package/dist/docs/troubleshooting.html +38 -36
  242. package/dist/docs/troubleshooting.md +48 -101
  243. package/dist/evals.d.ts +2 -2
  244. package/dist/extensions/jev/extension.d.ts +12 -2
  245. package/dist/extensions/jev/extension.d.ts.map +1 -1
  246. package/dist/extensions/jev/extension.js +4 -0
  247. package/dist/extensions/jev/lib/evaluate.d.ts +31 -4
  248. package/dist/extensions/jev/lib/evaluate.d.ts.map +1 -1
  249. package/dist/extensions/jev/lib/evaluate.js +18 -4
  250. package/dist/internal/cli/command.d.ts +1 -1
  251. package/dist/internal/cli/command.js +1 -1
  252. package/dist/internal/cli/commands/channels.js +6 -6
  253. package/dist/internal/cli/commands/develop.d.ts.map +1 -1
  254. package/dist/internal/cli/commands/develop.js +23 -14
  255. package/dist/internal/cli/commands/hosted.js +4 -4
  256. package/dist/internal/cli/commands/index.d.ts +1 -1
  257. package/dist/internal/cli/commands/index.d.ts.map +1 -1
  258. package/dist/internal/cli/commands/index.js +1 -1
  259. package/dist/internal/cli/commands/mcp.js +1 -1
  260. package/dist/internal/cli/commands/project.js +4 -4
  261. package/dist/internal/cli/commands/scaffold.d.ts.map +1 -1
  262. package/dist/internal/cli/commands/scaffold.js +9 -6
  263. package/dist/internal/cli/commands/serve.d.ts +1 -1
  264. package/dist/internal/cli/commands/serve.js +5 -5
  265. package/dist/internal/cli/commands/session.d.ts.map +1 -1
  266. package/dist/internal/cli/commands/session.js +12 -7
  267. package/dist/internal/cli/dispatch.d.ts +3 -3
  268. package/dist/internal/cli/dispatch.js +3 -3
  269. package/dist/internal/cli/errors.d.ts +1 -1
  270. package/dist/internal/cli/errors.d.ts.map +1 -1
  271. package/dist/internal/cli/errors.js +1 -1
  272. package/dist/internal/cli/flags.d.ts +2 -2
  273. package/dist/internal/cli/flags.d.ts.map +1 -1
  274. package/dist/internal/cli/flags.js +2 -2
  275. package/dist/internal/cli/help-command.d.ts +1 -1
  276. package/dist/internal/cli/help-command.js +2 -2
  277. package/dist/internal/cli/help.d.ts +7 -7
  278. package/dist/internal/cli/help.d.ts.map +1 -1
  279. package/dist/internal/cli/help.js +8 -8
  280. package/dist/internal/cli-ax.d.ts.map +1 -1
  281. package/dist/internal/cli-ax.js +3 -0
  282. package/dist/internal/cli-convert-automation.d.ts +1 -1
  283. package/dist/internal/cli-convert-automation.js +1 -1
  284. package/dist/internal/cli-deploy.js +1 -1
  285. package/dist/internal/cli-docs.js +1 -1
  286. package/dist/internal/cli-images.js +1 -1
  287. package/dist/internal/cli-migrate.d.ts +1 -1
  288. package/dist/internal/cli-migrate.js +1 -1
  289. package/dist/internal/cli-pagerduty.d.ts +1 -1
  290. package/dist/internal/cli-pagerduty.js +1 -1
  291. package/dist/internal/cli-skills.js +1 -1
  292. package/dist/internal/convert-automation/types.d.ts +1 -1
  293. package/dist/internal/convert-automation/types.js +1 -1
  294. package/dist/internal/cursor/credentials.js +1 -1
  295. package/dist/internal/deploy-client.d.ts +2 -2
  296. package/dist/internal/deploy-client.d.ts.map +1 -1
  297. package/dist/internal/deploy-manifest.d.ts +1 -0
  298. package/dist/internal/deploy-manifest.d.ts.map +1 -1
  299. package/dist/internal/deploy-manifest.js +0 -1
  300. package/dist/internal/discovery/agent-config.d.ts +2 -6
  301. package/dist/internal/discovery/agent-config.d.ts.map +1 -1
  302. package/dist/internal/discovery/agent-config.js +8 -25
  303. package/dist/internal/discovery/agent.d.ts.map +1 -1
  304. package/dist/internal/discovery/agent.js +2 -3
  305. package/dist/internal/discovery/project.d.ts.map +1 -1
  306. package/dist/internal/discovery/project.js +15 -0
  307. package/dist/internal/init-project.d.ts +7 -3
  308. package/dist/internal/init-project.d.ts.map +1 -1
  309. package/dist/internal/init-project.js +60 -12
  310. package/dist/internal/init-scaffold.d.ts +2 -1
  311. package/dist/internal/init-scaffold.d.ts.map +1 -1
  312. package/dist/internal/init-scaffold.js +20 -7
  313. package/dist/internal/peer-connections.js +1 -1
  314. package/dist/internal/reminder-runner.js +1 -1
  315. package/dist/internal/server.d.ts +1 -1
  316. package/dist/internal/session-cost.d.ts +4 -4
  317. package/dist/internal/session-cost.d.ts.map +1 -1
  318. package/dist/internal/session-cost.js +4 -4
  319. package/dist/internal/session-engine.d.ts +1 -1
  320. package/dist/internal/session-engine.js +2 -2
  321. package/dist/internal/shallow-clone.js +1 -1
  322. package/dist/playground/assets/index-D6mVn9og.js +62 -0
  323. package/dist/playground/assets/index-DlALM6gr.css +1 -0
  324. package/dist/playground/index.html +2 -2
  325. package/dist/types.d.ts +9 -22
  326. package/dist/types.d.ts.map +1 -1
  327. package/docs/README.md +49 -82
  328. package/docs/building-with-agents.md +11 -104
  329. package/docs/changelog.md +6 -146
  330. package/docs/deployment.md +86 -265
  331. package/docs/evals.md +34 -128
  332. package/docs/guides/agent-to-agent.md +27 -64
  333. package/docs/guides/bitbucket.md +73 -134
  334. package/docs/guides/cloud-agents.md +23 -53
  335. package/docs/guides/convert-automation.md +31 -115
  336. package/docs/guides/github.md +49 -131
  337. package/docs/guides/gitlab.md +104 -184
  338. package/docs/guides/improve.md +24 -90
  339. package/docs/guides/jev.md +57 -159
  340. package/docs/guides/mcp-oauth.md +34 -69
  341. package/docs/guides/migrate.md +56 -130
  342. package/docs/guides/opentelemetry.md +37 -27
  343. package/docs/guides/pagerduty.md +68 -200
  344. package/docs/guides/slack.md +76 -205
  345. package/docs/guides/webhooks.md +64 -146
  346. package/docs/hillclimbing.md +41 -103
  347. package/docs/quickstart.md +93 -178
  348. package/docs/reference/access.md +7 -12
  349. package/docs/reference/agent-config.md +93 -176
  350. package/docs/reference/artifacts.md +38 -62
  351. package/docs/reference/channels.md +102 -151
  352. package/docs/reference/cli.md +233 -698
  353. package/docs/reference/connections.md +83 -164
  354. package/docs/reference/evals.md +97 -128
  355. package/docs/reference/extensions.md +37 -70
  356. package/docs/reference/hooks.md +61 -132
  357. package/docs/reference/http-api.md +66 -118
  358. package/docs/reference/instructions.md +20 -30
  359. package/docs/reference/limits.md +10 -22
  360. package/docs/reference/memory.md +38 -75
  361. package/docs/reference/playground.md +14 -22
  362. package/docs/reference/project-layout.md +38 -84
  363. package/docs/reference/schedules.md +59 -90
  364. package/docs/reference/sessions.md +66 -113
  365. package/docs/reference/skills.md +12 -32
  366. package/docs/reference/subagents.md +17 -31
  367. package/docs/reference/tools.md +48 -130
  368. package/docs/templates/agentic-owners.md +50 -74
  369. package/docs/templates/reviews.md +76 -0
  370. package/docs/troubleshooting.md +48 -101
  371. package/package.json +3 -9
  372. package/skills/cli/SKILL.md +15 -15
  373. package/skills/create-agent/SKILL.md +20 -19
  374. package/skills/debug/SKILL.md +4 -4
  375. package/skills/deploy/SKILL.md +2 -2
  376. package/skills/evals/SKILL.md +8 -8
  377. package/skills/framework-map/SKILL.md +3 -3
  378. package/skills/github/SKILL.md +7 -7
  379. package/skills/hillclimb/SKILL.md +4 -4
  380. package/skills/mcp-auth/SKILL.md +3 -3
  381. package/skills/migrate-v2/SKILL.md +40 -41
  382. package/skills/otel/SKILL.md +2 -2
  383. package/skills/setup-slack/SKILL.md +8 -8
  384. package/templates/agentic-owners/README.md +5 -5
  385. package/templates/agentic-owners/bot/tools/record_review.ts +1 -1
  386. package/templates/agentic-owners/package.json +1 -1
  387. package/templates/agents-md/README.md +4 -4
  388. package/templates/agents-md/package.json +1 -1
  389. package/templates/code-wiki/README.md +3 -3
  390. package/templates/code-wiki/package.json +1 -1
  391. package/templates/demo/README.md +3 -3
  392. package/templates/demo/package.json +1 -1
  393. package/templates/pr-autofixer/package.json +1 -1
  394. package/templates/security-help/README.md +5 -5
  395. package/templates/security-help/package.json +1 -1
  396. package/templates/security-reviewer/README.md +3 -3
  397. package/templates/security-reviewer/package.json +1 -1
  398. package/templates/thermo-quality-review/README.md +4 -4
  399. package/templates/thermo-quality-review/package.json +1 -1
  400. package/templates/thermo-review/README.md +4 -4
  401. package/templates/thermo-review/package.json +1 -1
  402. package/templates/triage/README.md +3 -3
  403. package/templates/triage/overlays/jira/README.md +3 -3
  404. package/templates/triage/overlays/linear/README.md +3 -3
  405. package/templates/triage/package.json +1 -1
  406. package/dist/docs/assets/building-with-agents.md.Bf1yH2tG.js +0 -9
  407. package/dist/docs/assets/changelog.md.fZ-NNFeJ.js +0 -1
  408. package/dist/docs/assets/changelog.md.fZ-NNFeJ.lean.js +0 -1
  409. package/dist/docs/assets/chunks/@localSearchIndexroot.mfzjiOsL.js +0 -1
  410. package/dist/docs/assets/chunks/channel.goFR5lbe.js +0 -1
  411. package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.B2yLtFja.js +0 -1
  412. package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.B2yLtFja.js +0 -1
  413. package/dist/docs/assets/chunks/clone.CztV97Wu.js +0 -1
  414. package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.CZlVHdDZ.js +0 -1
  415. package/dist/docs/assets/deployment.md.DDmjAVbg.js +0 -31
  416. package/dist/docs/assets/evals.md.OjKb7tNA.js +0 -68
  417. package/dist/docs/assets/evals.md.OjKb7tNA.lean.js +0 -1
  418. package/dist/docs/assets/guides_agent-to-agent.md.D1D5f6Jc.lean.js +0 -1
  419. package/dist/docs/assets/guides_cloud-agents.md.Ceyjv0ul.js +0 -9
  420. package/dist/docs/assets/guides_convert-automation.md.BjraCvok.js +0 -43
  421. package/dist/docs/assets/guides_grokbot-agents.md.D0PpM_Gf.js +0 -15
  422. package/dist/docs/assets/guides_grokbot-agents.md.D0PpM_Gf.lean.js +0 -1
  423. package/dist/docs/assets/guides_hooks.md.BjeEiM7s.js +0 -54
  424. package/dist/docs/assets/guides_hooks.md.BjeEiM7s.lean.js +0 -1
  425. package/dist/docs/assets/guides_improve.md.BFYtrtLE.js +0 -21
  426. package/dist/docs/assets/guides_migrate.md.RS9Eu-Xh.js +0 -8
  427. package/dist/docs/assets/guides_opentelemetry.md.CoZ1kNyd.js +0 -28
  428. package/dist/docs/assets/guides_opentelemetry.md.CoZ1kNyd.lean.js +0 -1
  429. package/dist/docs/assets/guides_pagerduty.md.mnKXe9U0.js +0 -60
  430. package/dist/docs/assets/guides_pagerduty.md.mnKXe9U0.lean.js +0 -1
  431. package/dist/docs/assets/guides_slack.md.BqiGSYGX.js +0 -88
  432. package/dist/docs/assets/hillclimbing.md.By61f3uq.js +0 -7
  433. package/dist/docs/assets/hillclimbing.md.By61f3uq.lean.js +0 -1
  434. package/dist/docs/assets/index.md.CVRjO09Y.js +0 -27
  435. package/dist/docs/assets/index.md.CVRjO09Y.lean.js +0 -1
  436. package/dist/docs/assets/quickstart.md.DaLk4ZIF.js +0 -170
  437. package/dist/docs/assets/reference_access.md.CExlH_mR.js +0 -1
  438. package/dist/docs/assets/reference_agent-config.md.11E_xe--.js +0 -40
  439. package/dist/docs/assets/reference_artifacts.md.C-hKR2hp.js +0 -18
  440. package/dist/docs/assets/reference_channels.md.DsJfGSBJ.js +0 -22
  441. package/dist/docs/assets/reference_cli.md.DQ3dCgmk.js +0 -99
  442. package/dist/docs/assets/reference_cli.md.DQ3dCgmk.lean.js +0 -1
  443. package/dist/docs/assets/reference_connections.md.BoAotr7_.js +0 -66
  444. package/dist/docs/assets/reference_evals.md.DYKjGFi-.js +0 -56
  445. package/dist/docs/assets/reference_hooks.md.B-bwJuiG.js +0 -51
  446. package/dist/docs/assets/reference_hooks.md.B-bwJuiG.lean.js +0 -1
  447. package/dist/docs/assets/reference_http-api.md._RWELr3d.js +0 -11
  448. package/dist/docs/assets/reference_instructions.md.yL2hXLnl.js +0 -14
  449. package/dist/docs/assets/reference_instructions.md.yL2hXLnl.lean.js +0 -1
  450. package/dist/docs/assets/reference_limits.md.Da1HegjB.js +0 -8
  451. package/dist/docs/assets/reference_limits.md.Da1HegjB.lean.js +0 -1
  452. package/dist/docs/assets/reference_memory.md.Dd7cyV9V.js +0 -4
  453. package/dist/docs/assets/reference_playground.md.CQiJk9CM.js +0 -1
  454. package/dist/docs/assets/reference_project-layout.md.BamcPDUn.js +0 -25
  455. package/dist/docs/assets/reference_project-layout.md.BamcPDUn.lean.js +0 -1
  456. package/dist/docs/assets/reference_prompt.md.BMjm1Jp3.js +0 -9
  457. package/dist/docs/assets/reference_prompt.md.BMjm1Jp3.lean.js +0 -1
  458. package/dist/docs/assets/reference_schedules.md.RC47aFm4.js +0 -47
  459. package/dist/docs/assets/reference_sessions.md.C7KFhWXV.js +0 -22
  460. package/dist/docs/assets/reference_subagents.md.CAhvW4yS.js +0 -10
  461. package/dist/docs/assets/reference_tools.md.DQr7Fnhu.js +0 -79
  462. package/dist/docs/assets/templates_agentic-owners.md.Dh2nDSqg.js +0 -13
  463. package/dist/docs/assets/templates_security-reviewer.md.DnwXdnB5.js +0 -3
  464. package/dist/docs/assets/templates_security-reviewer.md.DnwXdnB5.lean.js +0 -1
  465. package/dist/docs/assets/templates_thermo-quality-review.md.MJIdHkzE.js +0 -3
  466. package/dist/docs/assets/templates_thermo-quality-review.md.MJIdHkzE.lean.js +0 -1
  467. package/dist/docs/assets/templates_thermo-review.md.DfN1OFOl.js +0 -3
  468. package/dist/docs/assets/templates_thermo-review.md.DfN1OFOl.lean.js +0 -1
  469. package/dist/docs/assets/templates_triage.md.BYWMloV4.js +0 -9
  470. package/dist/docs/assets/templates_triage.md.BYWMloV4.lean.js +0 -1
  471. package/dist/docs/assets/troubleshooting.md.AGJ3jDzj.js +0 -1
  472. package/dist/docs/guides/grokbot-agents.html +0 -74
  473. package/dist/docs/guides/grokbot-agents.md +0 -129
  474. package/dist/docs/guides/hooks.html +0 -113
  475. package/dist/docs/guides/hooks.md +0 -116
  476. package/dist/docs/reference/prompt.html +0 -68
  477. package/dist/docs/reference/prompt.md +0 -47
  478. package/dist/docs/templates/security-reviewer.html +0 -62
  479. package/dist/docs/templates/security-reviewer.md +0 -81
  480. package/dist/docs/templates/thermo-quality-review.html +0 -62
  481. package/dist/docs/templates/thermo-quality-review.md +0 -75
  482. package/dist/docs/templates/thermo-review.html +0 -62
  483. package/dist/docs/templates/thermo-review.md +0 -75
  484. package/dist/docs/templates/triage.html +0 -68
  485. package/dist/docs/templates/triage.md +0 -101
  486. package/dist/extensions/cursor-grokbot-agents/extension.d.ts +0 -71
  487. package/dist/extensions/cursor-grokbot-agents/extension.d.ts.map +0 -1
  488. package/dist/extensions/cursor-grokbot-agents/extension.js +0 -64
  489. package/dist/extensions/cursor-grokbot-agents/lib/agents.d.ts +0 -11
  490. package/dist/extensions/cursor-grokbot-agents/lib/agents.d.ts.map +0 -1
  491. package/dist/extensions/cursor-grokbot-agents/lib/agents.js +0 -31
  492. package/dist/extensions/cursor-grokbot-agents/lib/backend.d.ts +0 -56
  493. package/dist/extensions/cursor-grokbot-agents/lib/backend.d.ts.map +0 -1
  494. package/dist/extensions/cursor-grokbot-agents/lib/backend.js +0 -139
  495. package/dist/extensions/cursor-grokbot-agents/lib/contacts.d.ts +0 -28
  496. package/dist/extensions/cursor-grokbot-agents/lib/contacts.d.ts.map +0 -1
  497. package/dist/extensions/cursor-grokbot-agents/lib/contacts.js +0 -46
  498. package/dist/extensions/cursor-grokbot-agents/lib/conversation.d.ts +0 -53
  499. package/dist/extensions/cursor-grokbot-agents/lib/conversation.d.ts.map +0 -1
  500. package/dist/extensions/cursor-grokbot-agents/lib/conversation.js +0 -186
  501. package/dist/extensions/cursor-grokbot-agents/lib/inputs.d.ts +0 -4
  502. package/dist/extensions/cursor-grokbot-agents/lib/inputs.d.ts.map +0 -1
  503. package/dist/extensions/cursor-grokbot-agents/lib/inputs.js +0 -15
  504. package/dist/extensions/cursor-grokbot-agents/lib/lock.d.ts +0 -12
  505. package/dist/extensions/cursor-grokbot-agents/lib/lock.d.ts.map +0 -1
  506. package/dist/extensions/cursor-grokbot-agents/lib/lock.js +0 -24
  507. package/dist/extensions/cursor-grokbot-agents/skills/consult.md +0 -40
  508. package/dist/extensions/cursor-grokbot-agents/tools/ask.d.ts +0 -4
  509. package/dist/extensions/cursor-grokbot-agents/tools/ask.d.ts.map +0 -1
  510. package/dist/extensions/cursor-grokbot-agents/tools/ask.js +0 -26
  511. package/dist/extensions/cursor-grokbot-agents/tools/check.d.ts +0 -4
  512. package/dist/extensions/cursor-grokbot-agents/tools/check.d.ts.map +0 -1
  513. package/dist/extensions/cursor-grokbot-agents/tools/check.js +0 -21
  514. package/dist/extensions/cursor-grokbot-agents/tools/interrupt.d.ts +0 -4
  515. package/dist/extensions/cursor-grokbot-agents/tools/interrupt.d.ts.map +0 -1
  516. package/dist/extensions/cursor-grokbot-agents/tools/interrupt.js +0 -13
  517. package/dist/extensions/cursor-grokbot-agents/tools/list.d.ts +0 -4
  518. package/dist/extensions/cursor-grokbot-agents/tools/list.d.ts.map +0 -1
  519. package/dist/extensions/cursor-grokbot-agents/tools/list.js +0 -22
  520. package/dist/playground/assets/index-BMpVzZzC.css +0 -1
  521. package/dist/playground/assets/index-_3zz3yh8.js +0 -62
  522. package/docs/guides/grokbot-agents.md +0 -134
  523. package/docs/guides/hooks.md +0 -121
  524. package/docs/reference/prompt.md +0 -52
  525. package/docs/templates/security-reviewer.md +0 -86
  526. package/docs/templates/thermo-quality-review.md +0 -80
  527. package/docs/templates/thermo-review.md +0 -80
  528. package/docs/templates/triage.md +0 -106
@@ -1,8 +0,0 @@
1
- import{_ as t,c as s,o as i,a3 as a}from"./chunks/framework.BNw1pucY.js";const u=JSON.parse('{"title":"Limits","description":"Deploy limits for Agent SDK projects on Cursor-managed hosting, and the error a deploy returns when Cursor has turned those limits on.","frontmatter":{"title":"Limits","description":"Deploy limits for Agent SDK projects on Cursor-managed hosting, and the error a deploy returns when Cursor has turned those limits on."},"headers":[],"relativePath":"reference/limits.md","filePath":"reference/limits.md"}'),o={name:"reference/limits.md"};function n(l,e,d,r,h,p){return i(),s("div",null,[...e[0]||(e[0]=[a(`<h1 id="limits" tabindex="-1">Limits <a class="header-anchor" href="#limits" aria-label="Permalink to &quot;Limits&quot;">​</a></h1><p>Cursor can limit how many deployments a team keeps and how often that team deploys. The limits apply only to a team for which Cursor has turned them on. A team without that switch deploys with no cap.</p><p>When the switch is on, these are the default values. Cursor can set a different value for a team, or clear a cap.</p><table tabindex="0"><thead><tr><th>Limit</th><th><code>limit</code> id</th><th>Default when on</th><th>What counts</th></tr></thead><tbody><tr><td>Deployments</td><td><code>owner.deployments</code></td><td>20</td><td>Each deployment slug the team owns, running or stopped, and each new slug whose first build is still running or ready and not installed yet. A redeploy of an existing slug does not count. Installs of Cursor multi-tenant apps do not count. A ready build that has not been installed still holds its slot.</td></tr><tr><td>Deploys</td><td><code>owner.deploysPerDay</code></td><td>100 in the last 24 hours</td><td>Each accepted deploy, including redeploys and deploys that are still building. Deleting a deployment does not give its deploys back. A deploy that fails before it is accepted does not count.</td></tr><tr><td>Persistent deployments</td><td><code>owner.persistentSlots</code></td><td>1</td><td>Deployments with <code>persistent: true</code>.</td></tr></tbody></table><h2 id="when-a-deploy-reaches-a-limit" tabindex="-1">When a deploy reaches a limit <a class="header-anchor" href="#when-a-deploy-reaches-a-limit" aria-label="Permalink to &quot;When a deploy reaches a limit&quot;">​</a></h2><p><code>agent-sdk deploy</code> and the dashboard show the <code>error</code> sentence. The HTTP API returns this body:</p><div class="language-json vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span></span>
2
- <span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> &quot;error&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;Your team has 20 of 20 deployments. Delete one with \`agent-sdk deployment delete &lt;slug&gt;\`, or contact support to raise the limit. Redeploying an existing slug doesn&#39;t count.&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
3
- <span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> &quot;code&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;limit_exceeded&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
4
- <span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> &quot;limit&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;owner.deployments&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
5
- <span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> &quot;max&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">20</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
6
- <span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> &quot;current&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">20</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
7
- <span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> &quot;docsUrl&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;https://cursor.com/docs/bdk/reference/limits&quot;</span></span>
8
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><ul><li>The deployment and persistent deployment limits answer <code>403</code>. Delete a deployment with <code>agent-sdk deployment delete &lt;slug&gt;</code> to free a slot.</li><li>The deploy limit answers <code>429</code> with a <code>Retry-After</code> header, in seconds. Retry after the oldest counted deploy is more than 24 hours old.</li><li>If Cursor pauses deploys for your team, every deploy answers <code>403</code>, a redeploy too. Contact Cursor support to resume deploys.</li><li>A deploy that waits on another deploy for the same team can answer <code>503</code> with <code>Retry-After: 2</code>. Retry that request.</li></ul><p>The Deployed Agents dashboard shows <code>Deployments (N/max)</code> only when Cursor has turned the caps on for the team and the team has a deployment cap. Otherwise the heading is <code>Deployments</code>.</p><h2 id="raise-a-limit" tabindex="-1">Raise a limit <a class="header-anchor" href="#raise-a-limit" aria-label="Permalink to &quot;Raise a limit&quot;">​</a></h2><p>Contact Cursor support with your team and the limit you need.</p>`,11)])])}const y=t(o,[["render",n]]);export{u as __pageData,y as default};
@@ -1 +0,0 @@
1
- import{_ as t,c as s,o as i,a3 as a}from"./chunks/framework.BNw1pucY.js";const u=JSON.parse('{"title":"Limits","description":"Deploy limits for Agent SDK projects on Cursor-managed hosting, and the error a deploy returns when Cursor has turned those limits on.","frontmatter":{"title":"Limits","description":"Deploy limits for Agent SDK projects on Cursor-managed hosting, and the error a deploy returns when Cursor has turned those limits on."},"headers":[],"relativePath":"reference/limits.md","filePath":"reference/limits.md"}'),o={name:"reference/limits.md"};function n(l,e,d,r,h,p){return i(),s("div",null,[...e[0]||(e[0]=[a("",11)])])}const y=t(o,[["render",n]]);export{u as __pageData,y as default};
@@ -1,4 +0,0 @@
1
- import{_ as s,c as t,o as a,a3 as o}from"./chunks/framework.BNw1pucY.js";const k=JSON.parse('{"title":"Memory","description":"Journal every turn so later sessions can read what earlier ones did.","frontmatter":{"title":"Memory","description":"Journal every turn so later sessions can read what earlier ones did."},"headers":[],"relativePath":"reference/memory.md","filePath":"reference/memory.md"}'),i={name:"reference/memory.md"};function r(n,e,d,h,l,c){return a(),t("div",null,[...e[0]||(e[0]=[o(`<h1 id="memory" tabindex="-1">Memory <a class="header-anchor" href="#memory" aria-label="Permalink to &quot;Memory&quot;">​</a></h1><p>Memory lets an agent recall work from earlier sessions. A memory hook appends one record per turn to a shared journal, and the model reads that journal with its normal file tools when its instructions send it there. Every session and every user of the agent shares one journal.</p><h2 id="memory-is-on-by-default" tabindex="-1">Memory is on by default <a class="header-anchor" href="#memory-is-on-by-default" aria-label="Permalink to &quot;Memory is on by default&quot;">​</a></h2><p><code>agent-sdk init</code> scaffolds <code>bot/hooks/memory.ts</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:#6A737D;--shiki-dark:#6A737D;">// bot/hooks/memory.ts</span></span>
2
- <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { memoryHook } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;@grok/agent-sdk/memory&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
3
- <span class="line"></span>
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;"> memoryHook</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">();</span></span></code></pre></div><p>It also adds a <code>## Memory</code> section to <code>bot/instructions.md</code>. The model has no recall tool, so that section is what sends it to the journal: it says when to read <code>memory/</code>, and it tells the model to treat records as untrusted history. To add memory to an existing project, create the hook file and copy the <code>## Memory</code> section from a fresh <code>agent-sdk init</code> project into your instructions. To turn memory off, delete the hook file and the <code>## Memory</code> section.</p><h2 id="journal-records" tabindex="-1">Journal records <a class="header-anchor" href="#journal-records" aria-label="Permalink to &quot;Journal records&quot;">​</a></h2><p>The hook appends one JSON line to <code>memory/journal.jsonl</code> after each turn completes or fails:</p><div class="language-json vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">&quot;at&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;2026-10-01T16:42:09.118Z&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">&quot;sessionId&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;5f0c2a9e-7d1b-4c43-9a6e-2b8f1e0d7c35&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">&quot;channelId&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;slack&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">&quot;status&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;completed&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">&quot;title&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;Checkout flaky test&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">&quot;userMessage&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;Why does acme/checkout fail on main?&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">&quot;result&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;The cart test races the price service mock...&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">&quot;usage&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:{</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">&quot;inputTokens&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">18234</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">&quot;outputTokens&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">912</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">&quot;cacheReadTokens&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">15002</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">&quot;cacheWriteTokens&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}}</span></span></code></pre></div><table tabindex="0"><thead><tr><th>Field</th><th>Contract</th></tr></thead><tbody><tr><td><code>at</code></td><td>ISO-8601 time the turn finished</td></tr><tr><td><code>sessionId</code></td><td>Session that ran the turn</td></tr><tr><td><code>channelId</code></td><td>Channel that started the session, such as <code>http</code> for the session API</td></tr><tr><td><code>status</code></td><td><code>&quot;completed&quot;</code> or <code>&quot;failed&quot;</code></td></tr><tr><td><code>title</code></td><td>Session title, when the channel set one</td></tr><tr><td><code>userMessage</code></td><td>The message that started the turn, truncated to <code>maxTextLength</code></td></tr><tr><td><code>result</code></td><td>Final assistant text, or the failure message, truncated to <code>maxTextLength</code></td></tr><tr><td><code>usage</code></td><td>Token usage for completed turns; see <a href="./hooks.html#events-and-payloads">Events and payloads</a></td></tr></tbody></table><p>As the journal grows, older records move to <code>journal-*.jsonl</code> files beside it. Point the model at the whole <code>memory/</code> directory when it needs history beyond the latest segment.</p><h2 id="read-memory" tabindex="-1">Read memory <a class="header-anchor" href="#read-memory" aria-label="Permalink to &quot;Read memory&quot;">​</a></h2><p>Local turns find the journal at <code>memory/</code> in the session workspace. On a Cursor-hosted deployment, the first prompt of each session names the journal&#39;s path on that machine. A session on a server you run yourself can&#39;t reach the journal.</p><p><code>memory</code> is a reserved workspace path. Agent SDK rejects per-send <code>workspaceFiles</code> and <code>sandbox/workspace/</code> seed files under <code>memory/</code>, so callers can&#39;t write records through the workspace.</p><p>Local servers keep the journal in the project state directory. <code>agent-sdk run</code> and <code>agent-sdk eval</code> start an ephemeral server with a fresh state directory unless you pass <code>--state-root</code>, so each run starts with empty memory. Use <code>agent-sdk serve</code> or <code>agent-sdk dev</code>, or pass the same <code>--state-root</code>, to keep memory across runs. Hosted deployments keep the journal across redeploys.</p><h2 id="who-sees-memory" tabindex="-1">Who sees memory <a class="header-anchor" href="#who-sees-memory" aria-label="Permalink to &quot;Who sees memory&quot;">​</a></h2><p>Records from every session and every user land in the same journal, so one person&#39;s messages and the agent&#39;s replies to them can surface in another person&#39;s session. Turn memory off for an agent whose users shouldn&#39;t see each other&#39;s requests. Turning it off stops new records, but the journal keeps the records it already has. On a local server, delete the <code>memory/</code> directory in the project state directory to clear them. On Cursor-managed hosting, the journal is deployment data, so <a href="./../deployment.html#privacy-mode">Privacy Mode</a> applies to it.</p><p>Anyone who can message the agent can put text in the journal. The scaffolded instructions tell the model never to follow instructions found inside records; keep that rule if you write your own section.</p><h2 id="memory-and-host-state" tabindex="-1">Memory and host state <a class="header-anchor" href="#memory-and-host-state" aria-label="Permalink to &quot;Memory and host state&quot;">​</a></h2><p>Memory is advisory. A record can be dropped, and records written by concurrent sessions can show up only in a later session. Keep state your code depends on, such as dedupe records and cursors, in <code>ctx.host.kv</code> or <code>ctx.host.files</code>; see <a href="./hooks.html#handler-context">Handler context</a>.</p><h2 id="options" tabindex="-1">Options <a class="header-anchor" href="#options" aria-label="Permalink to &quot;Options&quot;">​</a></h2><p><code>memoryHook(options?)</code> accepts:</p><table tabindex="0"><thead><tr><th>Option</th><th>Contract</th></tr></thead><tbody><tr><td><code>maxTextLength</code></td><td>Truncation cap for <code>userMessage</code> and <code>result</code>. Default <code>2000</code> characters.</td></tr><tr><td><code>backend</code></td><td>A <code>MemoryBackend</code> that replaces the default journal</td></tr></tbody></table><p>A <code>MemoryBackend</code> has <code>appendTurn(record, { stateRoot, agentName })</code>, which receives each record, and an optional <code>prepareSession({ stateRoot, agentName })</code>, which runs when a session starts. Records go only where <code>appendTurn</code> sends them, but the <code>memory/</code> directory and the hosted first-prompt path still point at the default journal. Give the model a tool or file to read your records, and write instructions that send it there instead of <code>memory/</code>.</p><h2 id="related" tabindex="-1">Related <a class="header-anchor" href="#related" aria-label="Permalink to &quot;Related&quot;">​</a></h2><ul><li><a href="./hooks.html">Hooks</a></li><li><a href="./instructions.html">Instructions</a></li><li><a href="./sessions.html">Sessions</a></li><li><a href="./../deployment.html">Deployment</a></li></ul>`,26)])])}const u=s(i,[["render",r]]);export{k as __pageData,u as default};
@@ -1 +0,0 @@
1
- import{_ as t,c as a,o,a3 as r}from"./chunks/framework.BNw1pucY.js";const p=JSON.parse('{"title":"Playground","description":"The built-in web UI: chat with streaming, Try buttons and slash commands, session replay, and dev-mode dispatch.","frontmatter":{"title":"Playground","description":"The built-in web UI: chat with streaming, Try buttons and slash commands, session replay, and dev-mode dispatch."},"headers":[],"relativePath":"reference/playground.md","filePath":"reference/playground.md"}'),d={name:"reference/playground.md"};function s(n,e,l,c,i,h){return o(),a("div",null,[...e[0]||(e[0]=[r('<h1 id="playground" tabindex="-1">Playground <a class="header-anchor" href="#playground" aria-label="Permalink to &quot;Playground&quot;">​</a></h1><p><code>agent-sdk serve</code> enables a web playground at <code>http://127.0.0.1:3000/&lt;slug&gt;/playground</code> (or <code>/playground</code> in single mode). In multi-agent mode, each agent has its own playground, and <code>/</code> lists them all.</p><h2 id="playground-surfaces" tabindex="-1">Playground surfaces <a class="header-anchor" href="#playground-surfaces" aria-label="Permalink to &quot;Playground surfaces&quot;">​</a></h2><table tabindex="0"><thead><tr><th>Surface</th><th>What you can do</th></tr></thead><tbody><tr><td>Chat</td><td>Talk to the agent. Text and reasoning stream live, and tool calls appear inline with their arguments, output, and error state</td></tr><tr><td>Slash commands</td><td>Custom channel routes without path parameters become composer commands; GitHub and Slack ingress routes are excluded. A <code>drive</code> route becomes <code>/drive &lt;pr-url&gt;</code>, with <code>/help</code> and autocomplete</td></tr><tr><td>Try</td><td>Invoke a custom channel route from the Agent tab. The modal remembers your last body per endpoint and copies curl. Find the session the route starts under Runs</td></tr><tr><td>Runs</td><td>Browse the sessions you own and eval runs. Search by title or identifier; open sessions in Chat, Trace, or Raw and eval runs in Evals</td></tr><tr><td>Evals</td><td>List and run filesystem evals from the browser</td></tr><tr><td>Agent</td><td>Inspect the discovered tools, skills, subagents, MCP connections, channels, and hooks</td></tr><tr><td>Raw</td><td>Inspect the selected session&#39;s event stream</td></tr><tr><td>Logs</td><td>Recent server log lines, polled from <code>GET /v1/logs</code></td></tr></tbody></table><p>In <code>--dev</code> on loopback, or with <code>--allow-anonymous</code>, the session list includes every principal.</p><h2 id="remote-access" tabindex="-1">Remote access <a class="header-anchor" href="#remote-access" aria-label="Permalink to &quot;Remote access&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="related" tabindex="-1">Related <a class="header-anchor" href="#related" aria-label="Permalink to &quot;Related&quot;">​</a></h2><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></ul>',9)])])}const m=t(d,[["render",s]]);export{p as __pageData,m as default};
@@ -1,25 +0,0 @@
1
- import{_ as t,c as o,o as s,a3 as a}from"./chunks/framework.BNw1pucY.js";const u=JSON.parse('{"title":"Project layout","description":"The canonical bot/ folder layout and its path-derived naming rules.","frontmatter":{"title":"Project layout","description":"The canonical bot/ folder layout and its path-derived naming rules."},"headers":[],"relativePath":"reference/project-layout.md","filePath":"reference/project-layout.md"}'),n={name:"reference/project-layout.md"};function d(r,e,c,i,l,p){return s(),o("div",null,[...e[0]||(e[0]=[a(`<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>An Agent SDK project keeps agent files under <code>bot/</code>. Each file&#39;s path determines how Agent SDK loads it.</p><p>Existing projects rooted at <code>agent/</code> remain supported.</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 under <code>bot/</code></th><th>Resolves to</th></tr></thead><tbody><tr><td><code>tools/approve_pr.ts</code></td><td>tool <code>approve_pr</code></td></tr><tr><td><code>mcp-connections/linear.ts</code></td><td>MCP connection <code>linear</code> (model + host)</td></tr><tr><td><code>host-connections/inventory.ts</code></td><td>Host MCP connection <code>inventory</code> (host + <code>mcp oauth</code> only)</td></tr><tr><td><code>skills/pr-review.md</code></td><td>skill <code>pr-review</code></td></tr><tr><td><code>subagents/reviewer/</code></td><td>subagent <code>reviewer</code></td></tr><tr><td><code>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>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>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-tree" tabindex="-1">Project tree <a class="header-anchor" href="#project-tree" aria-label="Permalink to &quot;Project tree&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
- <span class="line"><span>├── package.json</span></span>
3
- <span class="line"><span>├── bot/</span></span>
4
- <span class="line"><span>│ ├── agent.ts # model and local harness config</span></span>
5
- <span class="line"><span>│ ├── instructions.md # always-on system prompt (required)</span></span>
6
- <span class="line"><span>│ ├── tools/</span></span>
7
- <span class="line"><span>│ │ └── approve_pr.ts # one typed tool per file</span></span>
8
- <span class="line"><span>│ ├── skills/</span></span>
9
- <span class="line"><span>│ │ └── pr-review.md # on-demand procedures (SKILL.md convention)</span></span>
10
- <span class="line"><span>│ ├── mcp-connections/</span></span>
11
- <span class="line"><span>│ │ └── linear.ts # tools from external MCP servers</span></span>
12
- <span class="line"><span>│ ├── host-connections/</span></span>
13
- <span class="line"><span>│ │ └── inventory.ts # host-only MCP tools</span></span>
14
- <span class="line"><span>│ ├── subagents/</span></span>
15
- <span class="line"><span>│ │ └── reviewer/</span></span>
16
- <span class="line"><span>│ │ ├── agent.ts</span></span>
17
- <span class="line"><span>│ │ └── instructions.md</span></span>
18
- <span class="line"><span>│ ├── channels/</span></span>
19
- <span class="line"><span>│ │ └── github.ts # messages and external events</span></span>
20
- <span class="line"><span>│ └── hooks/</span></span>
21
- <span class="line"><span>│ └── audit.ts # observe session events</span></span>
22
- <span class="line"><span>└── evals/</span></span>
23
- <span class="line"><span> └── readiness.eval.ts # regression cases</span></span></code></pre></div><p>Evals stay in <code>evals/</code> at the project root, as a sibling of <code>bot/</code>, never inside it. 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 under <code>bot/</code></th><th>What it is</th><th>Reference</th></tr></thead><tbody><tr><td><code>agent.ts</code></td><td><code>defineAgent({ model?, 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>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>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>skills/*</code></td><td>SKILL.md-convention procedures, loaded on demand</td><td><a href="./skills.html">Skills</a></td></tr><tr><td><code>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>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>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>extensions/&lt;ns&gt;.ts</code> or <code>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>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>hooks/*.ts</code></td><td>Observe-only event subscribers, never fatal</td><td><a href="./hooks.html">Hooks</a></td></tr><tr><td><code>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>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>reminders/*.ts</code></td><td>Named reminder handlers that stay armed across restarts</td><td><a href="./schedules.html#reminders">Schedules</a></td></tr><tr><td><code>sandbox/workspace/**</code></td><td>Seed files copied into each local session workspace</td><td><a href="./sessions.html#local-session-workspace">Sessions</a></td></tr><tr><td><code>lib/</code></td><td>Import-only shared code, never discovered</td><td>None</td></tr></tbody></table><p>Discovery rejects a <code>bot/result.ts</code> file. To act on a turn&#39;s decision, have the model record it with an authored <a href="./tools.html">tool</a>, then act on it from a <code>turn.completed</code> <a href="./hooks.html">hook</a>.</p><p>Evals use project-root paths:</p><table tabindex="0"><thead><tr><th>Project-root path</th><th>What it is</th><th>Reference</th></tr></thead><tbody><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>Use <code>bot/lib/</code> for shared imports. A <code>.ts</code> file in one of the listed discovery folders loads as a definition; unrecognized directories produce a validation warning.</p><h2 id="inspect-discovery" tabindex="-1">Inspect discovery <a class="header-anchor" href="#inspect-discovery" aria-label="Permalink to &quot;Inspect discovery&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 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-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>agent-sdk validate --dir . # diagnostics; non-zero exit on errors</span></span>
24
- <span class="line"><span>agent-sdk info --dir . # human-readable surface</span></span>
25
- <span class="line"><span>agent-sdk info --dir . --json # machine-readable project info (same shape as GET /v1/info)</span></span></code></pre></div><h2 id="related" tabindex="-1">Related <a class="header-anchor" href="#related" aria-label="Permalink to &quot;Related&quot;">​</a></h2><ul><li><a href="./agent-config.html">Agent config</a>: the config at the project root</li><li><a href="./tools.html">Tools</a>: add typed actions under <code>tools/</code></li><li><a href="./cli.html">CLI</a>: commands that discover this tree</li></ul>`,23)])])}const m=t(n,[["render",d]]);export{u as __pageData,m as default};
@@ -1 +0,0 @@
1
- import{_ as t,c as o,o as s,a3 as a}from"./chunks/framework.BNw1pucY.js";const u=JSON.parse('{"title":"Project layout","description":"The canonical bot/ folder layout and its path-derived naming rules.","frontmatter":{"title":"Project layout","description":"The canonical bot/ folder layout and its path-derived naming rules."},"headers":[],"relativePath":"reference/project-layout.md","filePath":"reference/project-layout.md"}'),n={name:"reference/project-layout.md"};function d(r,e,c,i,l,p){return s(),o("div",null,[...e[0]||(e[0]=[a("",23)])])}const m=t(n,[["render",d]]);export{u as __pageData,m as default};
@@ -1,9 +0,0 @@
1
- import{_ as e,c as i,o as t,a3 as a}from"./chunks/framework.BNw1pucY.js";const c=JSON.parse('{"title":"Prompt strings","description":"Write indented multi-line strings without carrying source indentation into their values.","frontmatter":{"title":"Prompt strings","description":"Write indented multi-line strings without carrying source indentation into their values."},"headers":[],"relativePath":"reference/prompt.md","filePath":"reference/prompt.md"}'),n={name:"reference/prompt.md"};function r(p,s,l,h,o,d){return t(),i("div",null,[...s[0]||(s[0]=[a(`<h1 id="prompt-strings" tabindex="-1">Prompt strings <a class="header-anchor" href="#prompt-strings" aria-label="Permalink to &quot;Prompt strings&quot;">​</a></h1><p>The <code>prompt</code> template tag keeps multi-line strings aligned with the surrounding TypeScript while returning dedented text. Use it for tool descriptions, reminder prompts, channel context, and errors. Import it from the package root or the dedicated entrypoint:</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;@grok/agent-sdk&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
2
- <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// or: import { prompt } from &quot;@grok/agent-sdk/prompt&quot;;</span></span></code></pre></div><h2 id="dedented-strings" tabindex="-1">Dedented strings <a class="header-anchor" href="#dedented-strings" aria-label="Permalink to &quot;Dedented strings&quot;">​</a></h2><p><code>prompt</code> returns one string. It removes the common leading whitespace and one newline immediately after the opening backtick.</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>
3
- <span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> It is outside business hours (Mon-Fri 9am-5pm ET).</span></span>
4
- <span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> Use request_author_approval, or pass approval=human_request.</span></span>
5
- <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 preserved, so nested lists keep their shape.</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="line-arrays" tabindex="-1">Line arrays <a class="header-anchor" href="#line-arrays" aria-label="Permalink to &quot;Line arrays&quot;">​</a></h2><p><code>prompt.lines</code> applies the same rules and returns <code>string[]</code>, with one entry per line. Use it when an API accepts separate context lines:</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>
6
- <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>
7
- <span class="line"></span>
8
- <span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> Call plan_deploy, then follow its nextStep.</span></span>
9
- <span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">\`</span></span></code></pre></div><h2 id="related" tabindex="-1">Related <a class="header-anchor" href="#related" aria-label="Permalink to &quot;Related&quot;">​</a></h2><ul><li><a href="./tools.html">Tools</a></li><li><a href="./channels.html">Channels</a></li></ul>`,13)])])}const g=e(n,[["render",r]]);export{c as __pageData,g as default};
@@ -1 +0,0 @@
1
- import{_ as e,c as i,o as t,a3 as a}from"./chunks/framework.BNw1pucY.js";const c=JSON.parse('{"title":"Prompt strings","description":"Write indented multi-line strings without carrying source indentation into their values.","frontmatter":{"title":"Prompt strings","description":"Write indented multi-line strings without carrying source indentation into their values."},"headers":[],"relativePath":"reference/prompt.md","filePath":"reference/prompt.md"}'),n={name:"reference/prompt.md"};function r(p,s,l,h,o,d){return t(),i("div",null,[...s[0]||(s[0]=[a("",13)])])}const g=e(n,[["render",r]]);export{c as __pageData,g as default};
@@ -1,47 +0,0 @@
1
- import{_ as i,c as e,o as a,a3 as t}from"./chunks/framework.BNw1pucY.js";const c=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"}'),n={name:"reference/schedules.md"};function h(l,s,d,r,p,o){return a(),e("div",null,[...s[0]||(s[0]=[t(`<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>An agent can act without an inbound message in two ways. 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="markdown-schedules" tabindex="-1">Markdown schedules <a class="header-anchor" href="#markdown-schedules" aria-label="Permalink to &quot;Markdown schedules&quot;">​</a></h3><p>A 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:#24292E;--shiki-dark:#E1E4E8;">---</span></span>
2
- <span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">cron</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;0 9 * * 1-5&quot;</span></span>
3
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">---</span></span>
4
- <span class="line"></span>
5
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">Pull open incidents and post a summary to the metrics endpoint.</span></span></code></pre></div><p>Each firing starts a task-mode session: the body is the prompt, the session runs to <code>session.completed</code> or <code>session.failed</code>, and it isn&#39;t followable.</p><h3 id="schedule-handlers" tabindex="-1">Schedule handlers <a class="header-anchor" href="#schedule-handlers" aria-label="Permalink to &quot;Schedule handlers&quot;">​</a></h3><p>Use <code>defineSchedule</code> with a <code>run</code> handler to call tools or hand work into a channel so its delivery events fire:</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;"> { defineSchedule } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;@grok/agent-sdk/schedules&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
6
- <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> webhook </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;../channels/webhook.js&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
7
- <span class="line"></span>
8
- <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;"> defineSchedule</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
9
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> cron: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;*/30 * * * *&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
10
- <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> async</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> run</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({ </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">receive</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">waitUntil</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">appAuth</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">host</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }) {</span></span>
11
- <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> waitUntil</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span></span>
12
- <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> receive</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(webhook, {</span></span>
13
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> message:</span></span>
14
- <span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;Check for new critical alerts. Report only when there are any.&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
15
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> auth: appAuth,</span></span>
16
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> })</span></span>
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>
19
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p><code>defineSchedule</code> requires exactly one of <code>markdown</code> or <code>run</code>. The <code>run</code> handler receives <code>receive</code> (hand off into a channel), <code>callTool</code> (deterministic server-tool calls), <code>waitUntil</code>, <code>appAuth</code> (a schedule-scoped principal for work the agent does on its own behalf), and <code>host</code> (shared services: <code>host.mcp</code>, <code>host.github</code>, <code>host.slack</code>, <code>host.reminders</code>).</p><h3 id="dispatch-a-schedule" tabindex="-1">Dispatch a schedule <a class="header-anchor" href="#dispatch-a-schedule" aria-label="Permalink to &quot;Dispatch a schedule&quot;">​</a></h3><table tabindex="0"><thead><tr><th>Mode</th><th>What fires</th></tr></thead><tbody><tr><td>Cursor-managed hosting</td><td>Cron cadence, from the schedules in the deployed release. See <a href="#schedules-on-cursor-hosting">Schedules on Cursor hosting</a></td></tr><tr><td>Production <code>agent-sdk serve</code></td><td>Cron cadence. <code>--no-schedules</code> disables them. Run them in exactly one process per project</td></tr><tr><td><code>serve --dev</code></td><td>Nothing automatic. Dispatch by hand through the same path production uses</td></tr></tbody></table><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/dev/schedules/heartbeat</span></span>
20
- <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># {&quot;scheduleId&quot;:&quot;heartbeat&quot;,&quot;sessionIds&quot;:[&quot;ses_…&quot;]}</span></span></code></pre></div><p>The playground can dispatch schedules in dev mode too, and <code>handle.dispatchSchedule(&quot;heartbeat&quot;)</code> does it programmatically.</p><h3 id="schedules-on-cursor-hosting" tabindex="-1">Schedules on Cursor hosting <a class="header-anchor" href="#schedules-on-cursor-hosting" aria-label="Permalink to &quot;Schedules on Cursor hosting&quot;">​</a></h3><p>Each deploy registers the schedules in its release and replaces the previous set, so a schedule you delete from <code>bot/schedules/</code> stops after the next deploy. Hosted schedules need <code>@grok/agent-sdk</code> 0.2.14 or newer in the project. A deployment built with an earlier version has no hosted schedules until you upgrade the package and deploy again.</p><p>Every fire starts a new runtime. A Markdown schedule starts a task session there, and a <code>run</code> handler must finish in 26 minutes, including the work it passes to <code>receive</code> and <code>waitUntil</code>. Nothing in module memory carries over to the next fire, so keep state in <code>ctx.host.kv</code> or <code>ctx.host.files</code>. Each scheduled time starts at most one run, and a stopped deployment skips its fires.</p><p>A schedule&#39;s name is its path under <code>bot/schedules/</code> without the file extension. On Cursor hosting, a name has 1 to 100 letters, digits, <code>.</code>, <code>_</code>, <code>-</code>, or <code>/</code>, and starts with a letter or digit. A release holds at most 64 schedules, and <code>deploy</code> rejects a release that breaks either rule.</p><h2 id="reminders" tabindex="-1">Reminders <a class="header-anchor" href="#reminders" aria-label="Permalink to &quot;Reminders&quot;">​</a></h2><p>A reminder is created at runtime and bound to a channel continuation. A prompt reminder wakes that conversation when it fires; a handler reminder runs host code, which can call <code>followup</code> to wake it. Recurring reminders behave like <code>setInterval</code>, and one-shots behave like <code>setTimeout</code>. Prompt and named-handler reminders stay armed across restarts.</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;">await</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> handle.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">createReminder</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
21
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> purpose: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;ci_recheck&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
22
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> channelId: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;drive&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
23
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> continuationToken: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;pr:acme/checkout#42&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
24
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> delay: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;2h&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
25
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> prompt: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;Re-check CI. Only act if still failing.&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
26
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> until: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;Cancel once CI is green or the PR is merged.&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
27
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p>When host code must decide what happens on each tick, author a named handler and pass its default export with serializable <code>args</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:#6A737D;--shiki-dark:#6A737D;">// bot/reminders/ci_recheck.ts</span></span>
28
- <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { defineReminder } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;@grok/agent-sdk/reminders&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
29
- <span class="line"></span>
30
- <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;"> defineReminder</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
31
- <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> async</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> run</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({ </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">args</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">followup</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }) {</span></span>
32
- <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> await</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> followup</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
33
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> message: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">\`Re-check CI for \${</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">String</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">(</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">args</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">.</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">prUrl</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">)</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">}. Report only if the status changed.\`</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
34
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> });</span></span>
35
- <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { action: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;delivered&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> };</span></span>
36
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
37
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><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;"> ciRecheck </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;./bot/reminders/ci_recheck.js&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
38
- <span class="line"></span>
39
- <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">await</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> handle.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">createReminder</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
40
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> purpose: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;ci_recheck&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
41
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> channelId: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;drive&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
42
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> continuationToken: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;pr:acme/checkout#42&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
43
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> every: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;30m&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
44
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> handler: ciRecheck,</span></span>
45
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> args: { prUrl: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;https://github.com/acme/checkout/pull/42&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
46
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p>Architecture v2, the default, rejects an anonymous <code>run</code> handler and a function <code>until</code>, locally and on Cursor hosting. Use a prompt or a named handler.</p><table tabindex="0"><thead><tr><th>Form</th><th>What it does</th><th>After a restart</th></tr></thead><tbody><tr><td>Prompt</td><td>Sends <code>prompt</code> into the session. <code>until</code> is the standing cancellation condition for the model</td><td>Stays armed</td></tr><tr><td>Named handler</td><td>Runs a discovered handler with serializable <code>args</code>; it starts a model turn only if the handler calls <code>followup</code></td><td>Stays armed</td></tr><tr><td>Anonymous <code>run</code></td><td>Architecture v1 only. Host handler returns <code>stop</code>, <code>skip</code>, or <code>delivered</code> per tick; it starts a model turn only if it calls <code>followup</code></td><td>Must be re-armed</td></tr></tbody></table><p>The same API is <code>host.reminders</code> on channel handlers, tools, and schedule runs. <code>builtinTools: { reminders: true }</code> adds <code>reminders_create</code>, <code>reminders_list</code>, and <code>reminders_cancel</code> on the current conversation; see <a href="./agent-config.html#built-in-tools">Agent config: built-in tools</a>.</p><p><code>--dev</code> does not auto-fire reminders. Dispatch one by hand:</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:#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/dev/reminders</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # list</span></span>
47
- <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/dev/reminders/</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&lt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">i</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">d</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&gt;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # fire one</span></span></code></pre></div><p><code>handle.dispatchReminder(id)</code> is the programmatic equivalent.</p><p>Cancel reminders when their subject dies, for example on <code>pull_request.closed</code>. Keep wake prompts generic so the agent re-reads live state instead of replaying a stale payload.</p><h2 id="schedules-vs-reminders" tabindex="-1">Schedules vs reminders <a class="header-anchor" href="#schedules-vs-reminders" aria-label="Permalink to &quot;Schedules vs reminders&quot;">​</a></h2><table tabindex="0"><thead><tr><th></th><th>Schedule</th><th>Reminder</th></tr></thead><tbody><tr><td>Defined</td><td>at deploy time, <code>bot/schedules/*</code></td><td>at runtime, <code>createReminder</code> / <code>host.reminders</code></td></tr><tr><td>Scope</td><td>global to the agent</td><td>one channel continuation (one conversation)</td></tr><tr><td>Session</td><td>starts a new task session (or hands off through <code>receive</code>)</td><td>wakes an existing conversation</td></tr><tr><td>Cadence</td><td>cron (UTC)</td><td><code>every</code>, <code>cron</code>, <code>delay</code>, or <code>at</code></td></tr><tr><td>Dev mode</td><td>manual dispatch only</td><td>manual dispatch only (timers off)</td></tr></tbody></table><h2 id="related" tabindex="-1">Related <a class="header-anchor" href="#related" aria-label="Permalink to &quot;Related&quot;">​</a></h2><ul><li><a href="./channels.html">Channels</a>: <code>receive</code> and the delivery events</li><li><a href="./../guides/github.html">GitHub guide</a>: reminders in a real webhook loop</li><li><a href="./http-api.html#dev-mode-routes">HTTP API</a>: the dev dispatch routes</li></ul>`,37)])])}const E=i(n,[["render",h]]);export{c as __pageData,E as default};
@@ -1,22 +0,0 @@
1
- import{_ as s,c as t,o as a,a3 as i}from"./chunks/framework.BNw1pucY.js";const k=JSON.parse('{"title":"Sessions, events, and streaming","description":"Understand how conversations continue, how events stream, and where session data lives.","frontmatter":{"title":"Sessions, events, and streaming","description":"Understand how conversations continue, how events stream, and where session data lives."},"headers":[],"relativePath":"reference/sessions.md","filePath":"reference/sessions.md"}'),n={name:"reference/sessions.md"};function o(d,e,r,l,h,c){return a(),t("div",null,[...e[0]||(e[0]=[i(`<h1 id="sessions-events-and-streaming" tabindex="-1">Sessions, events, and streaming <a class="header-anchor" href="#sessions-events-and-streaming" aria-label="Permalink to &quot;Sessions, events, and streaming&quot;">​</a></h1><p>A session keeps one conversation, its workspace, and an append-only record of every message and tool call. Continue it with a continuation token, inspect it with a session ID, and follow progress on the NDJSON stream. Chat sessions wait for follow-ups; task sessions run once and stop.</p><h2 id="session-contents" tabindex="-1">Session contents <a class="header-anchor" href="#session-contents" aria-label="Permalink to &quot;Session contents&quot;">​</a></h2><p>Each session combines:</p><ul><li>A channel and authenticated caller</li><li>A conversation the caller can continue</li><li>A workspace for local turns</li><li>An NDJSON event stream</li><li>State that lets the conversation resume after a restart</li></ul><p>Sessions belong to the principal that created them. Follow-up, stream, and list routes return <code>403</code> when another caller tries to access one.</p><h2 id="session-identifiers" tabindex="-1">Session identifiers <a class="header-anchor" href="#session-identifiers" aria-label="Permalink to &quot;Session identifiers&quot;">​</a></h2><p>Sessions have two identifiers because conversation routing and inspection are different jobs.</p><table tabindex="0"><thead><tr><th>Identifier</th><th>Use it for</th></tr></thead><tbody><tr><td><code>continuationToken</code></td><td>Continue a conversation through its channel</td></tr><tr><td><code>sessionId</code></td><td>Stream events, inspect state, or run a session-bound tool call</td></tr></tbody></table><p>Channels decide what a continuation token looks like. Slack uses its thread identity. A PR channel can use a key such as <code>pr:owner/repo#1</code>. The built-in HTTP API returns an opaque token and rotates it after each accepted follow-up. Reusing a stale HTTP token returns <code>409</code>.</p><p>Use the continuation token to keep talking. Use the session ID to observe or manage the stored session.</p><h2 id="session-modes" tabindex="-1">Session modes <a class="header-anchor" href="#session-modes" aria-label="Permalink to &quot;Session modes&quot;">​</a></h2><table tabindex="0"><thead><tr><th>Mode</th><th>Created by</th><th>What happens after a turn</th></tr></thead><tbody><tr><td><code>chat</code></td><td>HTTP sessions, channel <code>send</code>, Slack, or MCP <code>ask</code></td><td>Waits in <code>session.waiting</code> and accepts follow-ups</td></tr><tr><td><code>task</code></td><td>Markdown schedules and fire-and-forget dispatch</td><td>Ends in <code>session.completed</code> or <code>session.failed</code></td></tr></tbody></table><p>Task sessions don&#39;t accept follow-ups. Trying one returns <code>409</code>.</p><h2 id="follow-ups" tabindex="-1">Follow-ups <a class="header-anchor" href="#follow-ups" aria-label="Permalink to &quot;Follow-ups&quot;">​</a></h2><p>A follow-up to an idle chat session starts another turn. Admission when the session is already busy depends on the channel:</p><table tabindex="0"><thead><tr><th>Path</th><th>Busy-session policy</th></tr></thead><tbody><tr><td>HTTP playground / <code>POST /v1/session/:id</code> / MCP <code>ask</code></td><td><strong>Preempt</strong> (default): interrupt the in-flight turn, wait for it to settle, then run the new message</td></tr><tr><td>Slack mentions / DMs / alert-watch</td><td><strong>Coalesce</strong>: leave the active turn running and queue the follow-up. The running turn may receive it at a tool boundary; any asks that remain become one follow-up turn when it finishes</td></tr></tbody></table><p>Pass <code>admission: &quot;coalesce&quot;</code> on <code>send()</code> to opt into the Slack policy from other callers. Omit it (or pass <code>&quot;preempt&quot;</code>) to keep interrupt semantics.</p><h3 id="track-which-follow-up-reached-the-agent" tabindex="-1">Track which follow-up reached the agent <a class="header-anchor" href="#track-which-follow-up-reached-the-agent" aria-label="Permalink to &quot;Track which follow-up reached the agent&quot;">​</a></h3><p>Every <code>send()</code> returns a <code>deliveryId</code>. Pass your own as the <code>deliveryId</code> option, such as the webhook delivery ID you already hold, or omit it to get a fresh <code>dlv_…</code> ID. A coalesced follow-up reaches the agent in one of two ways, and the ID is on the event for that path:</p><table tabindex="0"><thead><tr><th>Path</th><th>Event</th><th>Field</th></tr></thead><tbody><tr><td>Steered into the running turn</td><td><code>nudge.delivered</code></td><td><code>data.deliveryId</code></td></tr><tr><td>Fell back to the next turn</td><td>That turn&#39;s <code>message.received</code></td><td><code>data.deliveryIds</code></td></tr></tbody></table><p><code>message.received</code> lists every send its prompt carries, in arrival order. Follow-ups queued behind a busy turn drain into one turn, so the list can hold several IDs. A direct send that starts a turn gets a one-item list.</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;">// In a route or channel hook: name the steer after the webhook delivery.</span></span>
2
- <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">await</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> send</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">\`Incident \${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">incident</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">.</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">id</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">} was acknowledged.\`</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, {</span></span>
3
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> continuationToken: incident.id,</span></span>
4
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> admission: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;coalesce&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
5
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> deliveryId: webhookId,</span></span>
6
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span>
7
- <span class="line"></span>
8
- <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// In the channel&#39;s \`events\` map:</span></span>
9
- <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> steered</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> new</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Set</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&lt;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;();</span></span>
10
- <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> prompted</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> new</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Set</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&lt;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;();</span></span>
11
- <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> events</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> ChannelEventHandlers</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
12
- <span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;nudge.delivered&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">async</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">event</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=&gt;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
13
- <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (event.data.deliveryId </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">!==</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> undefined</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) {</span></span>
14
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> steered.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">add</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(event.data.deliveryId);</span></span>
15
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
16
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
17
- <span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;message.received&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">async</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">event</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=&gt;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
18
- <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> for</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> id</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> of</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> event.data.deliveryIds </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">??</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> []) {</span></span>
19
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> prompted.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">add</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(id);</span></span>
20
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
21
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
22
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">};</span></span></code></pre></div><p>A local Slack session can also pick up follow-ups at a tool boundary from its own thread store. That <code>nudge.delivered</code> has no <code>deliveryId</code>, which tells it apart from a steered send.</p><p><code>POST /v1/session/:id/stop</code> interrupts a turn without sending a new message. The stream records <code>turn.failed</code> with <code>status: &quot;cancelled&quot;</code>; the session stays a chat session and can take another follow-up. A whole-message Slack <code>stop</code> / <code>@agent stop</code> does the same for that thread and clears pending coalesced follow-ups.</p><p>See <a href="./tools.html#call-a-tool-without-a-model-turn">Tools</a> for direct-call behavior while a session is busy.</p><h2 id="stream-events" tabindex="-1">Stream events <a class="header-anchor" href="#stream-events" aria-label="Permalink to &quot;Stream events&quot;">​</a></h2><p>Each NDJSON line uses this envelope: <code>{ type, index, sessionId, turnId?, at, data }</code>. The <code>index</code> increases within one session. The <code>at</code> field is an ISO-8601 timestamp.</p><table tabindex="0"><thead><tr><th>Phase</th><th>Events</th><th>What they tell you</th></tr></thead><tbody><tr><td>Session</td><td><code>session.started</code>, <code>session.waiting</code>, <code>session.completed</code>, <code>session.failed</code></td><td>Session creation, readiness, and task completion</td></tr><tr><td>Input</td><td><code>message.received</code>, <code>nudge.delivered</code></td><td>A user message was accepted as a turn&#39;s prompt, or reached a running turn mid-turn. Both name the <a href="#track-which-follow-up-reached-the-agent">sends they carry</a></td></tr><tr><td>Turn</td><td><code>turn.queued</code>, <code>turn.started</code>, <code>turn.completed</code>, <code>turn.failed</code></td><td>Queue position under a <a href="./agent-config.html#concurrency"><code>maxRunningTurns</code> cap</a>, then turn status, final result, and token usage</td></tr><tr><td>Steps</td><td><code>step.started</code>, <code>step.completed</code></td><td>Model step boundaries and duration</td></tr><tr><td>Reasoning</td><td><code>reasoning.appended</code>, <code>reasoning.completed</code></td><td>Streamed reasoning blocks</td></tr><tr><td>Reply</td><td><code>message.appended</code>, <code>message.completed</code></td><td>Text deltas and finalized assistant messages</td></tr><tr><td>Tools</td><td><code>actions.requested</code>, <code>actions.completed</code>, <code>action.result</code>, <code>action.tool_retry</code></td><td>Tool names, validated arguments, outputs, and errors. <code>action.tool_retry</code> means a read is running again after a transient failure</td></tr><tr><td>Subagents</td><td><code>subagent.called</code>, <code>subagent.completed</code></td><td>Delegated work</td></tr><tr><td>Artifacts</td><td><code>artifact.tagged</code></td><td>A durable <a href="./artifacts.html">artifact</a> was tagged for this session, by host code or <code>tag_artifact</code></td></tr></tbody></table><p>Pair <code>actions.requested</code> with <code>actions.completed</code> for each model-step batch. <code>action.result</code> is the live per-call envelope. Read <code>turn.completed.data.usage</code> for input, output, and cache token counts.</p><h2 id="stream-or-replay-events" tabindex="-1">Stream or replay events <a class="header-anchor" href="#stream-or-replay-events" aria-label="Permalink to &quot;Stream or replay events&quot;">​</a></h2><p>One endpoint handles both live streaming and replay:</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>Pass <code>startIndex</code> to continue after the last event you received, including after a server restart. Omit it or pass <code>0</code> to replay the full session before following new events. <code>GET /v1/session/:id/events</code> returns a one-time dump without staying connected.</p><h2 id="local-session-workspace" tabindex="-1">Local session workspace <a class="header-anchor" href="#local-session-workspace" aria-label="Permalink to &quot;Local session workspace&quot;">​</a></h2><p>Agent SDK creates a workspace before the first local turn:</p><table tabindex="0"><thead><tr><th>Source path</th><th>Lands as</th></tr></thead><tbody><tr><td><code>skills/*</code></td><td><code>.cursor/skills/&lt;name&gt;/SKILL.md</code></td></tr><tr><td>agent tools (<code>execution: &quot;agent&quot;</code>)</td><td>scripts in the session workspace, with a catalog in <code>AGENTS.md</code></td></tr><tr><td><code>sandbox/workspace/**</code></td><td>copied in as seed files</td></tr><tr><td>per-send <code>workspaceFiles</code></td><td>written before the turn</td></tr></tbody></table><p>Instructions reach the model as its system prompt; they aren&#39;t written into the workspace. See <a href="./instructions.html#delivery">Instructions</a>.</p><p>Local turns use this workspace as their working directory. Parent directories can contribute <code>AGENTS.md</code> and <code>.cursor</code> settings. Set <code>local.cwd</code> when you need a clean parent directory. A channel can also provide a different working directory for one session, such as a PR worktree.</p><p>See <a href="./agent-config.html#local-cwd">Agent config: local cwd</a> for the inheritance rules.</p><h2 id="session-storage" tabindex="-1">Session storage <a class="header-anchor" href="#session-storage" aria-label="Permalink to &quot;Session storage&quot;">​</a></h2><p>Local session state lives under <code>--state-root</code>. A slugged mount stores it in a subdirectory named for the slug.</p><p>Deleting a session directory removes the session from the server: it disappears from listings and can no longer be streamed or continued.</p><h2 id="inspect-a-saved-event-stream" tabindex="-1">Inspect a saved event stream <a class="header-anchor" href="#inspect-a-saved-event-stream" aria-label="Permalink to &quot;Inspect a saved event stream&quot;">​</a></h2><p>Use <code>session get --file</code> with a saved trace:</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>agent-sdk session get --file &lt;state-root&gt;/traces/&lt;sessionId&gt;.ndjson</span></span></code></pre></div><p>The command prints tool calls, the reply, and token usage in the same JSON shape as <code>run</code>. Open the session&#39;s <strong>Trace</strong> view in the playground for a visual timeline.</p><h2 id="related" tabindex="-1">Related <a class="header-anchor" href="#related" aria-label="Permalink to &quot;Related&quot;">​</a></h2><ul><li><a href="./http-api.html">HTTP API</a></li><li><a href="./hooks.html">Hooks</a></li><li><a href="./tools.html">Tools</a></li></ul>`,49)])])}const u=s(n,[["render",o]]);export{k as __pageData,u as default};
@@ -1,10 +0,0 @@
1
- import{_ as s,c as a,o as t,a3 as n}from"./chunks/framework.BNw1pucY.js";const u=JSON.parse('{"title":"Subagents","description":"Specialist child agents the model delegates to mid-turn, each its own directory under bot/subagents/.","frontmatter":{"title":"Subagents","description":"Specialist child agents the model delegates to mid-turn, each its own directory under bot/subagents/."},"headers":[],"relativePath":"reference/subagents.md","filePath":"reference/subagents.md"}'),i={name:"reference/subagents.md"};function o(d,e,l,r,c,h){return t(),a("div",null,[...e[0]||(e[0]=[n(`<h1 id="subagents" tabindex="-1">Subagents <a class="header-anchor" href="#subagents" aria-label="Permalink to &quot;Subagents&quot;">​</a></h1><p>A subagent is a specialist child agent the model can delegate to mid-turn. Each one lives under <code>bot/subagents/&lt;id&gt;/</code> with a required <code>agent.ts</code>. Add <code>instructions.md</code> or inline <code>instructions</code> in <code>agent.ts</code> for a custom prompt. The parent model delegates through the <code>task</code> tool, and the stream records <code>subagent.called</code> and <code>subagent.completed</code>. <code>subagent.completed</code> has <code>isError: true</code> when the subagent failed or was cancelled.</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>bot/subagents/researcher/</span></span>
2
- <span class="line"><span>├── agent.ts # description (required), model (optional)</span></span>
3
- <span class="line"><span>└── instructions.md # optional custom system prompt</span></span></code></pre></div><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;">// bot/subagents/researcher/agent.ts</span></span>
4
- <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { defineAgent } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;@grok/agent-sdk&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
5
- <span class="line"></span>
6
- <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;"> defineAgent</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
7
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> description:</span></span>
8
- <span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;Background research: climate history, records, comparisons across many cities.&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
9
- <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // model: omit to inherit the parent&#39;s model</span></span>
10
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><h2 id="subagent-rules" tabindex="-1">Subagent rules <a class="header-anchor" href="#subagent-rules" aria-label="Permalink to &quot;Subagent rules&quot;">​</a></h2><p><code>description</code> is required. The parent model uses it to decide whether to delegate, so write it as a routing rule (&quot;Background research: …&quot;), following the same discipline as a <a href="./skills.html">skill</a> description. <code>model</code> is optional; omit it to inherit the parent&#39;s model, or set it to run the specialist on a different model.</p><p>Subagents inherit the parent&#39;s execution surface. Every per-subagent capability directory is reported as a warning and ignored: <code>tools/</code>, <code>skills/</code>, <code>extensions/</code>, <code>mcp-connections/</code>, <code>host-connections/</code>, <code>channels/</code>, <code>schedules/</code>, <code>reminders/</code>, <code>hooks/</code>, <code>sandbox/</code>, and nested <code>subagents/</code>.</p><p>Delegation needs both halves: the description makes it possible, and the parent&#39;s <a href="./instructions.html">instructions</a> make it happen. &quot;When a request needs background research, delegate to the <code>researcher</code> subagent.&quot; The parent routes; the specialist executes.</p><h2 id="subagents-and-peers" tabindex="-1">Subagents and peers <a class="header-anchor" href="#subagents-and-peers" aria-label="Permalink to &quot;Subagents and peers&quot;">​</a></h2><p>Subagents split one job into roles inside a single agent. When the specialist is independently useful, with its own tools, sessions, and playground, make it a full agent. See <a href="./../guides/agent-to-agent.html#peer-or-subagent">Peer agents</a>.</p><h2 id="related" tabindex="-1">Related <a class="header-anchor" href="#related" aria-label="Permalink to &quot;Related&quot;">​</a></h2><ul><li><a href="./skills.html">Skills</a>: when a procedure is enough and a child agent is overkill</li><li><a href="./../guides/agent-to-agent.html">Peer agents</a>: independently useful specialists</li><li><a href="./agent-config.html#harness-tools">Agent config</a>: <code>&quot;task&quot;</code> on the parent&#39;s tool allowlist</li></ul>`,12)])])}const g=s(i,[["render",o]]);export{u as __pageData,g as default};