@grok/agent-sdk 0.2.27 → 0.2.28

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 (1291) hide show
  1. package/AGENTS.md +19 -14
  2. package/CHANGELOG.md +1 -1
  3. package/README.md +15 -17
  4. package/dist/agent-v2-hosting.d.ts +13 -0
  5. package/dist/agent-v2-hosting.d.ts.map +1 -0
  6. package/dist/agent-v2-hosting.js +8 -0
  7. package/dist/artifacts.d.ts +1 -1
  8. package/dist/artifacts.js +1 -1
  9. package/dist/bin/agent-serve.d.ts +3 -15
  10. package/dist/bin/agent-serve.d.ts.map +1 -1
  11. package/dist/bin/agent-serve.js +30 -1628
  12. package/dist/channels/bitbucket/api.d.ts.map +1 -1
  13. package/dist/channels/bitbucket/api.js +3 -3
  14. package/dist/channels/bitbucket/binding.d.ts.map +1 -1
  15. package/dist/channels/bitbucket/binding.js +5 -5
  16. package/dist/channels/bitbucket/bitbucket-channel.d.ts.map +1 -1
  17. package/dist/channels/bitbucket/bitbucket-channel.js +1 -0
  18. package/dist/channels/bitbucket/bitbucket-webhook.d.ts.map +1 -1
  19. package/dist/channels/bitbucket/bitbucket-webhook.js +9 -6
  20. package/dist/channels/bitbucket/checks.d.ts.map +1 -1
  21. package/dist/channels/bitbucket/checks.js +4 -0
  22. package/dist/channels/bitbucket/events.d.ts.map +1 -1
  23. package/dist/channels/bitbucket/index.d.ts +1 -1
  24. package/dist/channels/bitbucket/index.js +1 -1
  25. package/dist/channels/bitbucket/replay.d.ts.map +1 -1
  26. package/dist/channels/bitbucket/replay.js +4 -3
  27. package/dist/channels/change-monitors/change-monitors-channel.d.ts.map +1 -1
  28. package/dist/channels/change-monitors/change-monitors-channel.js +15 -2
  29. package/dist/channels/change-monitors/claim.d.ts +5 -0
  30. package/dist/channels/change-monitors/claim.d.ts.map +1 -0
  31. package/dist/channels/change-monitors/claim.js +6 -0
  32. package/dist/channels/change-monitors/index.d.ts +1 -0
  33. package/dist/channels/change-monitors/index.d.ts.map +1 -1
  34. package/dist/channels/change-monitors/index.js +1 -0
  35. package/dist/channels/change-monitors/types.d.ts.map +1 -1
  36. package/dist/channels/deployments/deployments-channel.d.ts +1 -1
  37. package/dist/channels/deployments/deployments-channel.js +1 -1
  38. package/dist/channels/deployments/index.d.ts +1 -1
  39. package/dist/channels/deployments/index.js +1 -1
  40. package/dist/channels/deployments/types.d.ts.map +1 -1
  41. package/dist/channels/github/api.d.ts +11 -0
  42. package/dist/channels/github/api.d.ts.map +1 -1
  43. package/dist/channels/github/api.js +29 -4
  44. package/dist/channels/github/binding.d.ts +5 -3
  45. package/dist/channels/github/binding.d.ts.map +1 -1
  46. package/dist/channels/github/binding.js +16 -9
  47. package/dist/channels/github/github-channel.d.ts +7 -2
  48. package/dist/channels/github/github-channel.d.ts.map +1 -1
  49. package/dist/channels/github/github-channel.js +20 -11
  50. package/dist/channels/github/index.d.ts +1 -1
  51. package/dist/channels/github/index.js +1 -1
  52. package/dist/channels/github/progress.d.ts.map +1 -1
  53. package/dist/channels/github/progress.js +4 -0
  54. package/dist/channels/github/state.d.ts +2 -2
  55. package/dist/channels/github/state.d.ts.map +1 -1
  56. package/dist/channels/github/types.d.ts +7 -7
  57. package/dist/channels/github/types.d.ts.map +1 -1
  58. package/dist/channels/gitlab/api.d.ts +2 -2
  59. package/dist/channels/gitlab/api.d.ts.map +1 -1
  60. package/dist/channels/gitlab/api.js +25 -14
  61. package/dist/channels/gitlab/binding.d.ts.map +1 -1
  62. package/dist/channels/gitlab/binding.js +2 -3
  63. package/dist/channels/gitlab/checks.d.ts.map +1 -1
  64. package/dist/channels/gitlab/checks.js +4 -0
  65. package/dist/channels/gitlab/events.d.ts.map +1 -1
  66. package/dist/channels/gitlab/gitlab-channel.d.ts.map +1 -1
  67. package/dist/channels/gitlab/gitlab-channel.js +4 -7
  68. package/dist/channels/gitlab/gitlab-webhook.d.ts.map +1 -1
  69. package/dist/channels/gitlab/gitlab-webhook.js +11 -8
  70. package/dist/channels/gitlab/index.d.ts +1 -1
  71. package/dist/channels/gitlab/index.js +1 -1
  72. package/dist/channels/gitlab/replay.d.ts.map +1 -1
  73. package/dist/channels/gitlab/replay.js +2 -0
  74. package/dist/channels/gitlab/types.d.ts.map +1 -1
  75. package/dist/channels/issues/claim.d.ts +5 -0
  76. package/dist/channels/issues/claim.d.ts.map +1 -0
  77. package/dist/channels/issues/claim.js +6 -0
  78. package/dist/channels/issues/index.d.ts +1 -0
  79. package/dist/channels/issues/index.d.ts.map +1 -1
  80. package/dist/channels/issues/index.js +1 -0
  81. package/dist/channels/issues/issues-channel.d.ts.map +1 -1
  82. package/dist/channels/issues/issues-channel.js +16 -3
  83. package/dist/channels/issues/types.d.ts +2 -2
  84. package/dist/channels/issues/types.d.ts.map +1 -1
  85. package/dist/channels/origin/api.d.ts.map +1 -1
  86. package/dist/channels/origin/api.js +3 -3
  87. package/dist/channels/origin/index.d.ts +1 -1
  88. package/dist/channels/origin/index.js +1 -1
  89. package/dist/channels/origin/origin-channel.d.ts.map +1 -1
  90. package/dist/channels/origin/origin-channel.js +6 -6
  91. package/dist/channels/origin/origin-webhook.d.ts.map +1 -1
  92. package/dist/channels/origin/origin-webhook.js +2 -5
  93. package/dist/channels/pagerduty/api.d.ts.map +1 -1
  94. package/dist/channels/pagerduty/api.js +2 -1
  95. package/dist/channels/pagerduty/index.d.ts +1 -1
  96. package/dist/channels/pagerduty/index.js +1 -1
  97. package/dist/channels/pagerduty/pagerduty-channel.d.ts.map +1 -1
  98. package/dist/channels/pagerduty/pagerduty-channel.js +1 -0
  99. package/dist/channels/pagerduty/pagerduty-webhook.d.ts.map +1 -1
  100. package/dist/channels/pagerduty/pagerduty-webhook.js +20 -11
  101. package/dist/channels/pagerduty/payload.d.ts.map +1 -1
  102. package/dist/channels/pagerduty/payload.js +2 -3
  103. package/dist/channels/pagerduty/replay.d.ts.map +1 -1
  104. package/dist/channels/pagerduty/replay.js +4 -1
  105. package/dist/channels/pagerduty/self-user.d.ts.map +1 -1
  106. package/dist/channels/pagerduty/self-user.js +8 -9
  107. package/dist/channels/runs/runs-channel.d.ts.map +1 -1
  108. package/dist/channels/runs/runs-channel.js +8 -2
  109. package/dist/channels/runs/types.d.ts +2 -2
  110. package/dist/channels/runs/types.d.ts.map +1 -1
  111. package/dist/channels/slack/agentic-delivery.d.ts +20 -1
  112. package/dist/channels/slack/agentic-delivery.d.ts.map +1 -1
  113. package/dist/channels/slack/agentic-delivery.js +77 -12
  114. package/dist/channels/slack/agentic-signals.d.ts +2 -0
  115. package/dist/channels/slack/agentic-signals.d.ts.map +1 -1
  116. package/dist/channels/slack/agentic-signals.js +24 -7
  117. package/dist/channels/slack/api.d.ts +1 -1
  118. package/dist/channels/slack/api.d.ts.map +1 -1
  119. package/dist/channels/slack/api.js +12 -13
  120. package/dist/channels/slack/approvals.d.ts.map +1 -1
  121. package/dist/channels/slack/approvals.js +5 -4
  122. package/dist/channels/slack/attachments.d.ts.map +1 -1
  123. package/dist/channels/slack/attachments.js +34 -9
  124. package/dist/channels/slack/auth.d.ts.map +1 -1
  125. package/dist/channels/slack/auth.js +3 -1
  126. package/dist/channels/slack/bot-mentions.d.ts.map +1 -1
  127. package/dist/channels/slack/bot-mentions.js +2 -4
  128. package/dist/channels/slack/cli-project.d.ts.map +1 -1
  129. package/dist/channels/slack/cli-project.js +7 -10
  130. package/dist/channels/slack/constants.d.ts +7 -0
  131. package/dist/channels/slack/constants.d.ts.map +1 -1
  132. package/dist/channels/slack/constants.js +7 -0
  133. package/dist/channels/slack/defaults.d.ts +12 -0
  134. package/dist/channels/slack/defaults.d.ts.map +1 -1
  135. package/dist/channels/slack/defaults.js +10 -2
  136. package/dist/channels/slack/dispatch.d.ts +7 -1
  137. package/dist/channels/slack/dispatch.d.ts.map +1 -1
  138. package/dist/channels/slack/dispatch.js +88 -13
  139. package/dist/channels/slack/doctor.d.ts.map +1 -1
  140. package/dist/channels/slack/doctor.js +11 -11
  141. package/dist/channels/slack/inbound.d.ts +7 -0
  142. package/dist/channels/slack/inbound.d.ts.map +1 -1
  143. package/dist/channels/slack/inbound.js +25 -4
  144. package/dist/channels/slack/index.d.ts +2 -2
  145. package/dist/channels/slack/index.d.ts.map +1 -1
  146. package/dist/channels/slack/index.js +2 -2
  147. package/dist/channels/slack/init.d.ts +2 -0
  148. package/dist/channels/slack/init.d.ts.map +1 -1
  149. package/dist/channels/slack/init.js +10 -2
  150. package/dist/channels/slack/interactive.d.ts +6 -1
  151. package/dist/channels/slack/interactive.d.ts.map +1 -1
  152. package/dist/channels/slack/interactive.js +15 -25
  153. package/dist/channels/slack/manifest.d.ts.map +1 -1
  154. package/dist/channels/slack/manifest.js +15 -12
  155. package/dist/channels/slack/message-body.d.ts.map +1 -1
  156. package/dist/channels/slack/message-body.js +2 -4
  157. package/dist/channels/slack/nudge-carrier.d.ts.map +1 -1
  158. package/dist/channels/slack/nudge-carrier.js +27 -1
  159. package/dist/channels/slack/nudge-store.d.ts.map +1 -1
  160. package/dist/channels/slack/nudge-store.js +8 -3
  161. package/dist/channels/slack/placeholder.d.ts +3 -0
  162. package/dist/channels/slack/placeholder.d.ts.map +1 -1
  163. package/dist/channels/slack/placeholder.js +6 -5
  164. package/dist/channels/slack/recording-sink.d.ts.map +1 -1
  165. package/dist/channels/slack/recording-sink.js +4 -3
  166. package/dist/channels/slack/sender-name.d.ts.map +1 -1
  167. package/dist/channels/slack/sender-name.js +2 -3
  168. package/dist/channels/slack/slack-channel.d.ts +1 -3
  169. package/dist/channels/slack/slack-channel.d.ts.map +1 -1
  170. package/dist/channels/slack/slack-channel.js +63 -86
  171. package/dist/channels/slack/thread-context.d.ts.map +1 -1
  172. package/dist/channels/slack/thread-context.js +4 -9
  173. package/dist/channels/slack/tool-cards.d.ts.map +1 -1
  174. package/dist/channels/slack/tool-cards.js +4 -0
  175. package/dist/channels/slack/types.d.ts +19 -4
  176. package/dist/channels/slack/types.d.ts.map +1 -1
  177. package/dist/channels/slack/upload.d.ts +2 -0
  178. package/dist/channels/slack/upload.d.ts.map +1 -1
  179. package/dist/channels/slack/upload.js +49 -12
  180. package/dist/channels/slack/user-info.d.ts.map +1 -1
  181. package/dist/channels/slack/user-info.js +3 -6
  182. package/dist/channels.d.ts +11 -11
  183. package/dist/channels.d.ts.map +1 -1
  184. package/dist/channels.js +57 -30
  185. package/dist/connections.d.ts +1 -1
  186. package/dist/connections.js +1 -1
  187. package/dist/docs/404.html +4 -4
  188. package/dist/docs/architecture.svg +1 -1
  189. package/dist/docs/assets/{app.wA5xBBcd.js → app.DF9vlcdn.js} +4 -4
  190. package/dist/docs/assets/building-with-agents.md.Bf1yH2tG.js +9 -0
  191. package/dist/docs/assets/building-with-agents.md.Bf1yH2tG.lean.js +1 -0
  192. package/dist/docs/assets/changelog.md.fZ-NNFeJ.js +1 -0
  193. package/dist/docs/assets/changelog.md.fZ-NNFeJ.lean.js +1 -0
  194. package/dist/docs/assets/chunks/@localSearchIndexroot.mfzjiOsL.js +1 -0
  195. package/dist/docs/assets/chunks/{VPLocalSearchBox.C29HLCVL.js → VPLocalSearchBox.D8OuwKO0.js} +1 -1
  196. package/dist/docs/assets/chunks/{arc.BOaoYWmh.js → arc.DCq_TCYV.js} +1 -1
  197. package/dist/docs/assets/chunks/{architectureDiagram-Q4EWVU46.MfG0itQh.js → architectureDiagram-Q4EWVU46.PWRNTPbk.js} +1 -1
  198. package/dist/docs/assets/chunks/{baseUniq.CUeJciCF.js → baseUniq.BeRPvRUL.js} +1 -1
  199. package/dist/docs/assets/chunks/{blockDiagram-DXYQGD6D.BrXMZRtK.js → blockDiagram-DXYQGD6D.BuRmZVSo.js} +1 -1
  200. package/dist/docs/assets/chunks/{c4Diagram-AHTNJAMY.DfkDHeB9.js → c4Diagram-AHTNJAMY.7DKSMwuv.js} +1 -1
  201. package/dist/docs/assets/chunks/channel.goFR5lbe.js +1 -0
  202. package/dist/docs/assets/chunks/{chunk-4BX2VUAB.xKz8CiXK.js → chunk-4BX2VUAB.7VrO9-9i.js} +1 -1
  203. package/dist/docs/assets/chunks/{chunk-4TB4RGXK.kkfBh4zk.js → chunk-4TB4RGXK.CHystNE2.js} +1 -1
  204. package/dist/docs/assets/chunks/{chunk-55IACEB6.BClJGb94.js → chunk-55IACEB6.Nuh9TbTq.js} +1 -1
  205. package/dist/docs/assets/chunks/{chunk-EDXVE4YY.P9BpQ9L3.js → chunk-EDXVE4YY.CA0EKugm.js} +1 -1
  206. package/dist/docs/assets/chunks/{chunk-FMBD7UC4.R4iYi58S.js → chunk-FMBD7UC4.F9_mp7U8.js} +1 -1
  207. package/dist/docs/assets/chunks/{chunk-OYMX7WX6.Cpn8L1dw.js → chunk-OYMX7WX6.CEU4QfE1.js} +1 -1
  208. package/dist/docs/assets/chunks/{chunk-QZHKN3VN.BLftECqU.js → chunk-QZHKN3VN.B8h_x9_i.js} +1 -1
  209. package/dist/docs/assets/chunks/{chunk-YZCP3GAM.BWDV1AYt.js → chunk-YZCP3GAM.Btfb-rKg.js} +1 -1
  210. package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.B2yLtFja.js +1 -0
  211. package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.B2yLtFja.js +1 -0
  212. package/dist/docs/assets/chunks/clone.CztV97Wu.js +1 -0
  213. package/dist/docs/assets/chunks/{cose-bilkent-S5V4N54A.DGpAcJ55.js → cose-bilkent-S5V4N54A.DKvc96Wa.js} +1 -1
  214. package/dist/docs/assets/chunks/{dagre-KV5264BT.BBXxGEaD.js → dagre-KV5264BT.CMo0cy1b.js} +1 -1
  215. package/dist/docs/assets/chunks/{diagram-5BDNPKRD.EKqOwmK2.js → diagram-5BDNPKRD.DDgMOQhB.js} +1 -1
  216. package/dist/docs/assets/chunks/{diagram-G4DWMVQ6.CB8pdkoZ.js → diagram-G4DWMVQ6.BdJnoIsU.js} +1 -1
  217. package/dist/docs/assets/chunks/{diagram-MMDJMWI5.aHh4WGg9.js → diagram-MMDJMWI5.oSvhAZaL.js} +1 -1
  218. package/dist/docs/assets/chunks/{diagram-TYMM5635.YIsbRH20.js → diagram-TYMM5635.C9zZLIE-.js} +1 -1
  219. package/dist/docs/assets/chunks/{erDiagram-SMLLAGMA.B3bTCW_e.js → erDiagram-SMLLAGMA.BNhVyccy.js} +1 -1
  220. package/dist/docs/assets/chunks/{flowDiagram-DWJPFMVM.M81hXIXZ.js → flowDiagram-DWJPFMVM.BEFLLBiU.js} +1 -1
  221. package/dist/docs/assets/chunks/{ganttDiagram-T4ZO3ILL.BKg7WY--.js → ganttDiagram-T4ZO3ILL.BdUzXBgY.js} +1 -1
  222. package/dist/docs/assets/chunks/{gitGraphDiagram-UUTBAWPF.CLEMZgO3.js → gitGraphDiagram-UUTBAWPF.Rd3LlOIJ.js} +1 -1
  223. package/dist/docs/assets/chunks/{graph.DS38W_Q-.js → graph.DnJC1GpG.js} +1 -1
  224. package/dist/docs/assets/chunks/{infoDiagram-42DDH7IO.BTiWTi82.js → infoDiagram-42DDH7IO.xv0xntDJ.js} +1 -1
  225. package/dist/docs/assets/chunks/{ishikawaDiagram-UXIWVN3A.DcqY_KQL.js → ishikawaDiagram-UXIWVN3A.BaGIlviU.js} +1 -1
  226. package/dist/docs/assets/chunks/{journeyDiagram-VCZTEJTY.0lQNZ40U.js → journeyDiagram-VCZTEJTY.Cof_h0fp.js} +1 -1
  227. package/dist/docs/assets/chunks/{kanban-definition-6JOO6SKY.L5sKlf7X.js → kanban-definition-6JOO6SKY.C5GozFuU.js} +1 -1
  228. package/dist/docs/assets/chunks/{layout.7u4gFhQa.js → layout.zc9UShLc.js} +1 -1
  229. package/dist/docs/assets/chunks/{linear.D5v33SOb.js → linear.BoqrFVcJ.js} +1 -1
  230. package/dist/docs/assets/chunks/{min.Dc9uCxf9.js → min.DwIfr8hG.js} +1 -1
  231. package/dist/docs/assets/chunks/{mindmap-definition-QFDTVHPH.B56nGoB_.js → mindmap-definition-QFDTVHPH.Dkq2yTtp.js} +1 -1
  232. package/dist/docs/assets/chunks/{pieDiagram-DEJITSTG.Cba8e8lS.js → pieDiagram-DEJITSTG.B4CpTmHK.js} +1 -1
  233. package/dist/docs/assets/chunks/{quadrantDiagram-34T5L4WZ.2YjBycHF.js → quadrantDiagram-34T5L4WZ.BqXnFC9C.js} +1 -1
  234. package/dist/docs/assets/chunks/{requirementDiagram-MS252O5E.D4P5RqVI.js → requirementDiagram-MS252O5E.DhIN2z-E.js} +1 -1
  235. package/dist/docs/assets/chunks/{sankeyDiagram-XADWPNL6.C0Hn8NUm.js → sankeyDiagram-XADWPNL6.BhxUAmg2.js} +1 -1
  236. package/dist/docs/assets/chunks/{sequenceDiagram-FGHM5R23.BZm7EaoT.js → sequenceDiagram-FGHM5R23.BqgU7HU-.js} +1 -1
  237. package/dist/docs/assets/chunks/{stateDiagram-FHFEXIEX.DcR4f3X2.js → stateDiagram-FHFEXIEX.B1BCO18N.js} +1 -1
  238. package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.CZlVHdDZ.js +1 -0
  239. package/dist/docs/assets/chunks/{theme.DvfKzyXq.js → theme.oV7rddEz.js} +2 -2
  240. package/dist/docs/assets/chunks/{timeline-definition-GMOUNBTQ.CgDh96vg.js → timeline-definition-GMOUNBTQ.oRI8UwMC.js} +1 -1
  241. package/dist/docs/assets/chunks/{vennDiagram-DHZGUBPP.B4fagbC8.js → vennDiagram-DHZGUBPP.DmuWrIxN.js} +1 -1
  242. package/dist/docs/assets/chunks/{wardley-RL74JXVD.Ck68omim.js → wardley-RL74JXVD.CEBjM5ov.js} +1 -1
  243. package/dist/docs/assets/chunks/{wardleyDiagram-NUSXRM2D.DBUg0bvz.js → wardleyDiagram-NUSXRM2D.m5zsCOF9.js} +1 -1
  244. package/dist/docs/assets/chunks/{xychartDiagram-5P7HB3ND.DnKSGQE1.js → xychartDiagram-5P7HB3ND.cPN-587n.js} +1 -1
  245. package/dist/docs/assets/deployment.md.DDmjAVbg.js +31 -0
  246. package/dist/docs/assets/deployment.md.DDmjAVbg.lean.js +1 -0
  247. package/dist/docs/assets/{evals.md.CHR34K1Y.js → evals.md.OjKb7tNA.js} +9 -9
  248. package/dist/docs/assets/{guides_agent-to-agent.md.CwL5cwuE.js → guides_agent-to-agent.md.D1D5f6Jc.js} +7 -7
  249. package/dist/docs/assets/guides_agent-to-agent.md.D1D5f6Jc.lean.js +1 -0
  250. package/dist/docs/assets/{guides_bitbucket.md.CKUayYtD.js → guides_bitbucket.md.DkjkBRU8.js} +3 -3
  251. package/dist/docs/assets/guides_cloud-agents.md.Ceyjv0ul.js +9 -0
  252. package/dist/docs/assets/guides_cloud-agents.md.Ceyjv0ul.lean.js +1 -0
  253. package/dist/docs/assets/{guides_convert-automation.md.DMEX9nF-.js → guides_convert-automation.md.BjraCvok.js} +11 -11
  254. package/dist/docs/assets/guides_convert-automation.md.BjraCvok.lean.js +1 -0
  255. package/dist/docs/assets/{guides_github.md.TuNiZAOQ.js → guides_github.md.CgN5sNbW.js} +14 -14
  256. package/dist/docs/assets/{guides_github.md.TuNiZAOQ.lean.js → guides_github.md.CgN5sNbW.lean.js} +1 -1
  257. package/dist/docs/assets/{guides_gitlab.md.CtNI4fSH.js → guides_gitlab.md.DCE0p7_w.js} +3 -3
  258. package/dist/docs/assets/guides_grokbot-agents.md.D0PpM_Gf.js +15 -0
  259. package/dist/docs/assets/{guides_grokbot-agents.md.BwAykJ7U.lean.js → guides_grokbot-agents.md.D0PpM_Gf.lean.js} +1 -1
  260. package/dist/docs/assets/{guides_hooks.md.B2XfGX50.js → guides_hooks.md.BjeEiM7s.js} +4 -4
  261. package/dist/docs/assets/{guides_hooks.md.B2XfGX50.lean.js → guides_hooks.md.BjeEiM7s.lean.js} +1 -1
  262. package/dist/docs/assets/{guides_improve.md.CZKVt1cT.js → guides_improve.md.BFYtrtLE.js} +4 -4
  263. package/dist/docs/assets/{guides_improve.md.CZKVt1cT.lean.js → guides_improve.md.BFYtrtLE.lean.js} +1 -1
  264. package/dist/docs/assets/{guides_jev.md.D7XH4JH3.js → guides_jev.md.Ccw4pedT.js} +10 -10
  265. package/dist/docs/assets/{guides_mcp-oauth.md.Cxq2TxBB.js → guides_mcp-oauth.md.ekpWOZCC.js} +8 -8
  266. package/dist/docs/assets/{guides_mcp-oauth.md.Cxq2TxBB.lean.js → guides_mcp-oauth.md.ekpWOZCC.lean.js} +1 -1
  267. package/dist/docs/assets/guides_migrate.md.RS9Eu-Xh.js +8 -0
  268. package/dist/docs/assets/guides_migrate.md.RS9Eu-Xh.lean.js +1 -0
  269. package/dist/docs/assets/guides_opentelemetry.md.CoZ1kNyd.js +28 -0
  270. package/dist/docs/assets/guides_opentelemetry.md.CoZ1kNyd.lean.js +1 -0
  271. package/dist/docs/assets/{guides_pagerduty.md.BHXMcMtx.js → guides_pagerduty.md.mnKXe9U0.js} +10 -10
  272. package/dist/docs/assets/{guides_slack.md.ClIyi7FI.js → guides_slack.md.BqiGSYGX.js} +21 -8
  273. package/dist/docs/assets/{guides_slack.md.ClIyi7FI.lean.js → guides_slack.md.BqiGSYGX.lean.js} +1 -1
  274. package/dist/docs/assets/{guides_webhooks.md.Cpdc3BDX.js → guides_webhooks.md.BJk63ZTs.js} +9 -5
  275. package/dist/docs/assets/{guides_webhooks.md.Cpdc3BDX.lean.js → guides_webhooks.md.BJk63ZTs.lean.js} +1 -1
  276. package/dist/docs/assets/{hillclimbing.md.Dxvd-0gT.js → hillclimbing.md.By61f3uq.js} +2 -2
  277. package/dist/docs/assets/index.md.CVRjO09Y.js +27 -0
  278. package/dist/docs/assets/index.md.CVRjO09Y.lean.js +1 -0
  279. package/dist/docs/assets/{quickstart.md.D8JDfkKO.js → quickstart.md.DaLk4ZIF.js} +10 -10
  280. package/dist/docs/assets/quickstart.md.DaLk4ZIF.lean.js +1 -0
  281. package/dist/docs/assets/reference_access.md.CExlH_mR.js +1 -0
  282. package/dist/docs/assets/reference_access.md.CExlH_mR.lean.js +1 -0
  283. package/dist/docs/assets/{reference_agent-config.md.CZrbHOfT.js → reference_agent-config.md.11E_xe--.js} +10 -8
  284. package/dist/docs/assets/{reference_agent-config.md.CZrbHOfT.lean.js → reference_agent-config.md.11E_xe--.lean.js} +1 -1
  285. package/dist/docs/assets/{reference_artifacts.md.DLV9MZES.js → reference_artifacts.md.C-hKR2hp.js} +2 -2
  286. package/dist/docs/assets/reference_channels.md.DsJfGSBJ.js +22 -0
  287. package/dist/docs/assets/{reference_channels.md.CNNIS6K7.lean.js → reference_channels.md.DsJfGSBJ.lean.js} +1 -1
  288. package/dist/docs/assets/reference_cli.md.DQ3dCgmk.js +99 -0
  289. package/dist/docs/assets/reference_cli.md.DQ3dCgmk.lean.js +1 -0
  290. package/dist/docs/assets/{reference_connections.md.BJE2Zllp.js → reference_connections.md.BoAotr7_.js} +7 -7
  291. package/dist/docs/assets/{reference_evals.md.Ccwp4x3o.js → reference_evals.md.DYKjGFi-.js} +11 -11
  292. package/dist/docs/assets/{reference_extensions.md.DKxTuCIw.js → reference_extensions.md.pEVj72Xo.js} +9 -9
  293. package/dist/docs/assets/{reference_extensions.md.DKxTuCIw.lean.js → reference_extensions.md.pEVj72Xo.lean.js} +1 -1
  294. package/dist/docs/assets/{reference_hooks.md.CROr0QgC.js → reference_hooks.md.B-bwJuiG.js} +5 -5
  295. package/dist/docs/assets/{reference_http-api.md.Dji-DD_Z.js → reference_http-api.md._RWELr3d.js} +1 -1
  296. package/dist/docs/assets/{reference_instructions.md.BYMVxAkw.js → reference_instructions.md.yL2hXLnl.js} +1 -1
  297. package/dist/docs/assets/reference_limits.md.Da1HegjB.js +8 -0
  298. package/dist/docs/assets/reference_limits.md.Da1HegjB.lean.js +1 -0
  299. package/dist/docs/assets/reference_memory.md.Dd7cyV9V.js +4 -0
  300. package/dist/docs/assets/reference_playground.md.CQiJk9CM.js +1 -0
  301. package/dist/docs/assets/{reference_project-layout.md.mFcS8yDD.js → reference_project-layout.md.BamcPDUn.js} +4 -4
  302. package/dist/docs/assets/{reference_prompt.md.DqPh71XN.js → reference_prompt.md.BMjm1Jp3.js} +2 -2
  303. package/dist/docs/assets/{reference_schedules.md.BqWnJES4.js → reference_schedules.md.RC47aFm4.js} +4 -4
  304. package/dist/docs/assets/{reference_sessions.md.Bi6lHttM.js → reference_sessions.md.C7KFhWXV.js} +1 -1
  305. package/dist/docs/assets/{reference_skills.md.Ckddg6KX.js → reference_skills.md.Dej2zQxi.js} +2 -2
  306. package/dist/docs/assets/{reference_skills.md.Ckddg6KX.lean.js → reference_skills.md.Dej2zQxi.lean.js} +1 -1
  307. package/dist/docs/assets/{reference_subagents.md.ChNGh6HK.js → reference_subagents.md.CAhvW4yS.js} +1 -1
  308. package/dist/docs/assets/{reference_tools.md.Bo0UfT0a.js → reference_tools.md.DQr7Fnhu.js} +10 -10
  309. package/dist/docs/assets/{reference_tools.md.Bo0UfT0a.lean.js → reference_tools.md.DQr7Fnhu.lean.js} +1 -1
  310. package/dist/docs/assets/{style.B9o0luvp.css → style.DK0YX1WL.css} +1 -1
  311. package/dist/docs/assets/{templates_agentic-owners.md.CTEnR0jp.js → templates_agentic-owners.md.Dh2nDSqg.js} +4 -4
  312. package/dist/docs/assets/templates_security-reviewer.md.DnwXdnB5.js +3 -0
  313. package/dist/docs/assets/templates_thermo-quality-review.md.MJIdHkzE.js +3 -0
  314. package/dist/docs/assets/{templates_thermo-quality-review.md.B77UyTrX.lean.js → templates_thermo-quality-review.md.MJIdHkzE.lean.js} +1 -1
  315. package/dist/docs/assets/templates_thermo-review.md.DfN1OFOl.js +3 -0
  316. package/dist/docs/assets/{templates_thermo-review.md.DRJ7mC5U.lean.js → templates_thermo-review.md.DfN1OFOl.lean.js} +1 -1
  317. package/dist/docs/assets/{templates_triage.md.CNN6b0JZ.js → templates_triage.md.BYWMloV4.js} +4 -4
  318. package/dist/docs/assets/troubleshooting.md.AGJ3jDzj.js +1 -0
  319. package/dist/docs/building-with-agents.html +46 -46
  320. package/dist/docs/building-with-agents.md +15 -15
  321. package/dist/docs/changelog.html +39 -39
  322. package/dist/docs/changelog.md +47 -11
  323. package/dist/docs/deployment.html +52 -52
  324. package/dist/docs/deployment.md +110 -48
  325. package/dist/docs/evals.html +47 -47
  326. package/dist/docs/evals.md +11 -11
  327. package/dist/docs/guides/agent-to-agent.html +45 -45
  328. package/dist/docs/guides/agent-to-agent.md +7 -7
  329. package/dist/docs/guides/bitbucket.html +41 -41
  330. package/dist/docs/guides/bitbucket.md +5 -5
  331. package/dist/docs/guides/cloud-agents.html +41 -41
  332. package/dist/docs/guides/cloud-agents.md +3 -3
  333. package/dist/docs/guides/convert-automation.html +49 -49
  334. package/dist/docs/guides/convert-automation.md +16 -15
  335. package/dist/docs/guides/github.html +50 -50
  336. package/dist/docs/guides/github.md +16 -16
  337. package/dist/docs/guides/gitlab.html +41 -41
  338. package/dist/docs/guides/gitlab.md +5 -5
  339. package/dist/docs/guides/grokbot-agents.html +40 -40
  340. package/dist/docs/guides/grokbot-agents.md +8 -14
  341. package/dist/docs/guides/hooks.html +40 -40
  342. package/dist/docs/guides/hooks.md +3 -3
  343. package/dist/docs/guides/improve.html +40 -40
  344. package/dist/docs/guides/improve.md +2 -2
  345. package/dist/docs/guides/jev.html +48 -48
  346. package/dist/docs/guides/jev.md +10 -10
  347. package/dist/docs/guides/mcp-oauth.html +45 -45
  348. package/dist/docs/guides/mcp-oauth.md +8 -8
  349. package/dist/docs/guides/migrate.html +43 -42
  350. package/dist/docs/guides/migrate.md +34 -27
  351. package/dist/docs/guides/opentelemetry.html +50 -59
  352. package/dist/docs/guides/opentelemetry.md +61 -130
  353. package/dist/docs/guides/pagerduty.html +48 -48
  354. package/dist/docs/guides/pagerduty.md +18 -18
  355. package/dist/docs/guides/slack.html +58 -45
  356. package/dist/docs/guides/slack.md +82 -11
  357. package/dist/docs/guides/webhooks.html +46 -42
  358. package/dist/docs/guides/webhooks.md +61 -3
  359. package/dist/docs/hashmap.json +1 -1
  360. package/dist/docs/hillclimbing.html +39 -39
  361. package/dist/docs/hillclimbing.md +2 -2
  362. package/dist/docs/index.html +42 -42
  363. package/dist/docs/index.md +14 -15
  364. package/dist/docs/llms-full.txt +1238 -1243
  365. package/dist/docs/llms.txt +13 -13
  366. package/dist/docs/quickstart.html +48 -48
  367. package/dist/docs/quickstart.md +20 -20
  368. package/dist/docs/reference/access.html +60 -0
  369. package/dist/docs/reference/access.md +22 -0
  370. package/dist/docs/reference/agent-config.html +46 -44
  371. package/dist/docs/reference/agent-config.md +54 -12
  372. package/dist/docs/reference/artifacts.html +39 -39
  373. package/dist/docs/reference/artifacts.md +2 -2
  374. package/dist/docs/reference/channels.html +39 -39
  375. package/dist/docs/reference/channels.md +29 -9
  376. package/dist/docs/reference/cli.html +96 -100
  377. package/dist/docs/reference/cli.md +363 -366
  378. package/dist/docs/reference/connections.html +44 -44
  379. package/dist/docs/reference/connections.md +9 -9
  380. package/dist/docs/reference/evals.html +48 -48
  381. package/dist/docs/reference/evals.md +13 -13
  382. package/dist/docs/reference/extensions.html +46 -46
  383. package/dist/docs/reference/extensions.md +10 -10
  384. package/dist/docs/reference/hooks.html +42 -42
  385. package/dist/docs/reference/hooks.md +11 -11
  386. package/dist/docs/reference/http-api.html +39 -39
  387. package/dist/docs/reference/http-api.md +1 -1
  388. package/dist/docs/reference/instructions.html +39 -39
  389. package/dist/docs/reference/instructions.md +1 -1
  390. package/dist/docs/reference/limits.html +67 -0
  391. package/dist/docs/reference/limits.md +37 -0
  392. package/dist/docs/reference/memory.html +40 -40
  393. package/dist/docs/reference/memory.md +7 -7
  394. package/dist/docs/reference/playground.html +38 -38
  395. package/dist/docs/reference/playground.md +1 -1
  396. package/dist/docs/reference/project-layout.html +41 -41
  397. package/dist/docs/reference/project-layout.md +6 -6
  398. package/dist/docs/reference/prompt.html +39 -39
  399. package/dist/docs/reference/prompt.md +2 -2
  400. package/dist/docs/reference/schedules.html +42 -42
  401. package/dist/docs/reference/schedules.md +4 -4
  402. package/dist/docs/reference/sessions.html +39 -39
  403. package/dist/docs/reference/sessions.md +3 -3
  404. package/dist/docs/reference/skills.html +39 -39
  405. package/dist/docs/reference/skills.md +2 -2
  406. package/dist/docs/reference/subagents.html +39 -39
  407. package/dist/docs/reference/subagents.md +1 -1
  408. package/dist/docs/reference/tools.html +47 -47
  409. package/dist/docs/reference/tools.md +31 -21
  410. package/dist/docs/templates/agentic-owners.html +41 -41
  411. package/dist/docs/templates/agentic-owners.md +7 -7
  412. package/dist/docs/templates/security-reviewer.html +39 -39
  413. package/dist/docs/templates/security-reviewer.md +6 -6
  414. package/dist/docs/templates/thermo-quality-review.html +40 -40
  415. package/dist/docs/templates/thermo-quality-review.md +7 -7
  416. package/dist/docs/templates/thermo-review.html +40 -40
  417. package/dist/docs/templates/thermo-review.md +7 -7
  418. package/dist/docs/templates/triage.html +41 -41
  419. package/dist/docs/templates/triage.md +9 -9
  420. package/dist/docs/troubleshooting.html +38 -38
  421. package/dist/docs/troubleshooting.md +24 -22
  422. package/dist/evals/assertions.d.ts.map +1 -1
  423. package/dist/evals/assertions.js +2 -2
  424. package/dist/evals/expect.d.ts.map +1 -1
  425. package/dist/evals/expect.js +9 -1
  426. package/dist/evals/judge.js +2 -2
  427. package/dist/evals/loaders.d.ts +3 -3
  428. package/dist/evals/loaders.d.ts.map +1 -1
  429. package/dist/evals/loaders.js +6 -3
  430. package/dist/evals/matchers.d.ts +1 -1
  431. package/dist/evals/matchers.d.ts.map +1 -1
  432. package/dist/evals/matchers.js +40 -6
  433. package/dist/evals/reporters.d.ts +2 -2
  434. package/dist/evals/reporters.js +2 -2
  435. package/dist/evals/results.d.ts +1 -1
  436. package/dist/evals/results.js +1 -1
  437. package/dist/evals.d.ts +1 -1
  438. package/dist/evals.js +1 -1
  439. package/dist/executors.d.ts +1 -1
  440. package/dist/executors.d.ts.map +1 -1
  441. package/dist/executors.js +2 -2
  442. package/dist/extensions/cursor-cloud-agents/extension.d.ts +1 -1
  443. package/dist/extensions/cursor-cloud-agents/extension.js +1 -1
  444. package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts.map +1 -1
  445. package/dist/extensions/cursor-cloud-agents/lib/backend.js +13 -2
  446. package/dist/extensions/cursor-cloud-agents/reminders/cloud-agent-stop-watch.js +3 -3
  447. package/dist/extensions/cursor-grokbot-agents/extension.d.ts +7 -13
  448. package/dist/extensions/cursor-grokbot-agents/extension.d.ts.map +1 -1
  449. package/dist/extensions/cursor-grokbot-agents/extension.js +7 -13
  450. package/dist/extensions/cursor-grokbot-agents/lib/backend.d.ts +6 -6
  451. package/dist/extensions/cursor-grokbot-agents/lib/backend.d.ts.map +1 -1
  452. package/dist/extensions/cursor-grokbot-agents/lib/backend.js +8 -7
  453. package/dist/extensions/cursor-grokbot-agents/lib/conversation.d.ts +6 -6
  454. package/dist/extensions/cursor-grokbot-agents/lib/conversation.js +6 -6
  455. package/dist/extensions/improve/extension.d.ts +1 -1
  456. package/dist/extensions/improve/extension.js +1 -1
  457. package/dist/extensions/jev/extension.d.ts +1 -1
  458. package/dist/extensions/jev/extension.js +1 -1
  459. package/dist/extensions/jev/lib/evaluate.d.ts +2 -2
  460. package/dist/extensions/jev/lib/evaluate.d.ts.map +1 -1
  461. package/dist/extensions/jev/lib/evaluate.js +26 -7
  462. package/dist/extensions/jev/skills/gated-write.md +1 -1
  463. package/dist/extensions/slack-communication/extension.d.ts +1 -1
  464. package/dist/extensions/slack-communication/extension.js +1 -1
  465. package/dist/extensions/slack-communication/skills/slack-voice.js +1 -1
  466. package/dist/extensions/slack-communication/tools/post-file.d.ts.map +1 -1
  467. package/dist/extensions/slack-communication/tools/post-file.js +45 -2
  468. package/dist/extensions.d.ts +2 -2
  469. package/dist/extensions.d.ts.map +1 -1
  470. package/dist/extensions.js +7 -3
  471. package/dist/files-backends/cursor-hosted.d.ts.map +1 -1
  472. package/dist/files-backends/cursor-hosted.js +5 -0
  473. package/dist/files-backends/local-fs.d.ts.map +1 -1
  474. package/dist/files-backends/local-fs.js +4 -3
  475. package/dist/filesystem.d.ts +24 -54
  476. package/dist/filesystem.d.ts.map +1 -1
  477. package/dist/filesystem.js +172 -104
  478. package/dist/hooks.d.ts +1 -1
  479. package/dist/hooks.js +1 -1
  480. package/dist/index.d.ts +11 -4
  481. package/dist/index.d.ts.map +1 -1
  482. package/dist/index.js +10 -3
  483. package/dist/internal/advertise-tools.d.ts +3 -3
  484. package/dist/internal/advertise-tools.d.ts.map +1 -1
  485. package/dist/internal/advertise-tools.js +9 -5
  486. package/dist/internal/artifacts-store.d.ts.map +1 -1
  487. package/dist/internal/artifacts-store.js +15 -6
  488. package/dist/internal/as-of.d.ts.map +1 -1
  489. package/dist/internal/as-of.js +4 -3
  490. package/dist/internal/authored-alias-hooks.d.ts +1 -20
  491. package/dist/internal/authored-alias-hooks.d.ts.map +1 -1
  492. package/dist/internal/authored-alias-hooks.js +54 -7
  493. package/dist/internal/authored-loaders.d.ts +2 -2
  494. package/dist/internal/authored-loaders.d.ts.map +1 -1
  495. package/dist/internal/authored-loaders.js +38 -13
  496. package/dist/internal/brand.d.ts.map +1 -1
  497. package/dist/internal/brand.js +25 -2
  498. package/dist/internal/builtin-tools/artifacts.d.ts.map +1 -1
  499. package/dist/internal/builtin-tools/artifacts.js +19 -3
  500. package/dist/internal/channel-dispatch.d.ts.map +1 -1
  501. package/dist/internal/channel-dispatch.js +1 -1
  502. package/dist/internal/channel-state.d.ts.map +1 -1
  503. package/dist/internal/channel-state.js +13 -8
  504. package/dist/internal/chat-client.d.ts.map +1 -1
  505. package/dist/internal/chat-client.js +14 -5
  506. package/dist/internal/cli/command.d.ts +134 -0
  507. package/dist/internal/cli/command.d.ts.map +1 -0
  508. package/dist/internal/cli/command.js +54 -0
  509. package/dist/internal/cli/commands/channels.d.ts +26 -0
  510. package/dist/internal/cli/commands/channels.d.ts.map +1 -0
  511. package/dist/internal/cli/commands/channels.js +524 -0
  512. package/dist/internal/cli/commands/develop.d.ts +15 -0
  513. package/dist/internal/cli/commands/develop.d.ts.map +1 -0
  514. package/dist/internal/cli/commands/develop.js +568 -0
  515. package/dist/internal/cli/commands/hosted.d.ts +22 -0
  516. package/dist/internal/cli/commands/hosted.d.ts.map +1 -0
  517. package/dist/internal/cli/commands/hosted.js +407 -0
  518. package/dist/internal/cli/commands/index.d.ts +4 -0
  519. package/dist/internal/cli/commands/index.d.ts.map +1 -0
  520. package/dist/internal/cli/commands/index.js +84 -0
  521. package/dist/internal/cli/commands/mcp.d.ts +6 -0
  522. package/dist/internal/cli/commands/mcp.d.ts.map +1 -0
  523. package/dist/internal/cli/commands/mcp.js +89 -0
  524. package/dist/internal/cli/commands/project.d.ts +5 -0
  525. package/dist/internal/cli/commands/project.d.ts.map +1 -0
  526. package/dist/internal/cli/commands/project.js +136 -0
  527. package/dist/internal/cli/commands/scaffold.d.ts +12 -0
  528. package/dist/internal/cli/commands/scaffold.d.ts.map +1 -0
  529. package/dist/internal/cli/commands/scaffold.js +279 -0
  530. package/dist/internal/cli/commands/serve.d.ts +11 -0
  531. package/dist/internal/cli/commands/serve.d.ts.map +1 -0
  532. package/dist/internal/cli/commands/serve.js +370 -0
  533. package/dist/internal/cli/commands/session.d.ts +7 -0
  534. package/dist/internal/cli/commands/session.d.ts.map +1 -0
  535. package/dist/internal/cli/commands/session.js +354 -0
  536. package/dist/internal/cli/dispatch.d.ts +46 -0
  537. package/dist/internal/cli/dispatch.d.ts.map +1 -0
  538. package/dist/internal/cli/dispatch.js +385 -0
  539. package/dist/internal/cli/errors.d.ts +51 -0
  540. package/dist/internal/cli/errors.d.ts.map +1 -0
  541. package/dist/internal/cli/errors.js +142 -0
  542. package/dist/internal/cli/flags.d.ts +186 -0
  543. package/dist/internal/cli/flags.d.ts.map +1 -0
  544. package/dist/internal/cli/flags.js +167 -0
  545. package/dist/internal/cli/help-command.d.ts +7 -0
  546. package/dist/internal/cli/help-command.d.ts.map +1 -0
  547. package/dist/internal/cli/help-command.js +60 -0
  548. package/dist/internal/cli/help.d.ts +63 -0
  549. package/dist/internal/cli/help.d.ts.map +1 -0
  550. package/dist/internal/cli/help.js +203 -0
  551. package/dist/internal/cli/io.d.ts +11 -0
  552. package/dist/internal/cli/io.d.ts.map +1 -0
  553. package/dist/internal/cli/io.js +33 -0
  554. package/dist/internal/cli/output.d.ts +54 -0
  555. package/dist/internal/cli/output.d.ts.map +1 -0
  556. package/dist/internal/cli/output.js +132 -0
  557. package/dist/internal/cli/value-kinds.d.ts +20 -0
  558. package/dist/internal/cli/value-kinds.d.ts.map +1 -0
  559. package/dist/internal/cli/value-kinds.js +70 -0
  560. package/dist/internal/cli-ax.d.ts +35 -20
  561. package/dist/internal/cli-ax.d.ts.map +1 -1
  562. package/dist/internal/cli-ax.js +436 -365
  563. package/dist/internal/cli-convert-automation.d.ts +3 -1
  564. package/dist/internal/cli-convert-automation.d.ts.map +1 -1
  565. package/dist/internal/cli-convert-automation.js +52 -20
  566. package/dist/internal/cli-cursor.js +5 -1
  567. package/dist/internal/cli-deploy.d.ts +23 -9
  568. package/dist/internal/cli-deploy.d.ts.map +1 -1
  569. package/dist/internal/cli-deploy.js +234 -508
  570. package/dist/internal/cli-docs.d.ts +1 -1
  571. package/dist/internal/cli-docs.js +3 -2
  572. package/dist/internal/cli-github.js +1 -0
  573. package/dist/internal/cli-images.d.ts.map +1 -1
  574. package/dist/internal/cli-images.js +44 -14
  575. package/dist/internal/cli-invocation.d.ts +22 -0
  576. package/dist/internal/cli-invocation.d.ts.map +1 -0
  577. package/dist/internal/cli-invocation.js +86 -0
  578. package/dist/internal/cli-manifest.d.ts +4 -1
  579. package/dist/internal/cli-manifest.d.ts.map +1 -1
  580. package/dist/internal/cli-manifest.js +16 -4
  581. package/dist/internal/cli-mcp-oauth.d.ts +7 -11
  582. package/dist/internal/cli-mcp-oauth.d.ts.map +1 -1
  583. package/dist/internal/cli-mcp-oauth.js +24 -104
  584. package/dist/internal/cli-mcp.d.ts +17 -28
  585. package/dist/internal/cli-mcp.d.ts.map +1 -1
  586. package/dist/internal/cli-mcp.js +64 -304
  587. package/dist/internal/cli-migrate.d.ts +2 -0
  588. package/dist/internal/cli-migrate.d.ts.map +1 -1
  589. package/dist/internal/cli-migrate.js +42 -14
  590. package/dist/internal/cli-skills.d.ts +30 -2
  591. package/dist/internal/cli-skills.d.ts.map +1 -1
  592. package/dist/internal/cli-skills.js +63 -3
  593. package/dist/internal/cli-slack-context.d.ts +91 -0
  594. package/dist/internal/cli-slack-context.d.ts.map +1 -0
  595. package/dist/internal/cli-slack-context.js +112 -0
  596. package/dist/internal/cli-slack-manual.d.ts +2 -0
  597. package/dist/internal/cli-slack-manual.d.ts.map +1 -1
  598. package/dist/internal/cli-slack-manual.js +12 -0
  599. package/dist/internal/cli-slack.d.ts +1 -49
  600. package/dist/internal/cli-slack.d.ts.map +1 -1
  601. package/dist/internal/cli-slack.js +27 -147
  602. package/dist/internal/cloud-merge.d.ts +2 -4
  603. package/dist/internal/cloud-merge.d.ts.map +1 -1
  604. package/dist/internal/cloud-merge.js +2 -7
  605. package/dist/internal/continuation-channel.d.ts.map +1 -1
  606. package/dist/internal/continuation-channel.js +10 -22
  607. package/dist/internal/continuation-identity.d.ts +33 -12
  608. package/dist/internal/continuation-identity.d.ts.map +1 -1
  609. package/dist/internal/continuation-identity.js +161 -43
  610. package/dist/internal/continuation-registration.d.ts +26 -0
  611. package/dist/internal/continuation-registration.d.ts.map +1 -0
  612. package/dist/internal/continuation-registration.js +35 -0
  613. package/dist/internal/conversation-mirror.d.ts.map +1 -1
  614. package/dist/internal/conversation-mirror.js +23 -14
  615. package/dist/internal/convert-automation/convert-workflow.d.ts.map +1 -1
  616. package/dist/internal/convert-automation/convert-workflow.js +28 -22
  617. package/dist/internal/convert-automation/types.d.ts +1 -1
  618. package/dist/internal/convert-automation/types.js +1 -1
  619. package/dist/internal/cursor/account-mcp.js +1 -1
  620. package/dist/internal/cursor/backend-client.d.ts.map +1 -1
  621. package/dist/internal/cursor/backend-client.js +6 -8
  622. package/dist/internal/cursor/bound-secret-file.d.ts.map +1 -1
  623. package/dist/internal/cursor/bound-secret-file.js +2 -1
  624. package/dist/internal/cursor/credentials.d.ts +4 -17
  625. package/dist/internal/cursor/credentials.d.ts.map +1 -1
  626. package/dist/internal/cursor/credentials.js +11 -27
  627. package/dist/internal/cursor/session-token.d.ts.map +1 -1
  628. package/dist/internal/cursor/session-token.js +3 -4
  629. package/dist/internal/cursor/store-api-client.d.ts.map +1 -1
  630. package/dist/internal/cursor/store-api-client.js +3 -2
  631. package/dist/internal/cursor-agent-template.d.ts +1 -1
  632. package/dist/internal/cursor-agent-template.d.ts.map +1 -1
  633. package/dist/internal/cursor-agent-template.js +2 -2
  634. package/dist/internal/cursor-deployment-relay.d.ts.map +1 -1
  635. package/dist/internal/cursor-deployment-relay.js +24 -2
  636. package/dist/internal/cursor-event-relay.d.ts.map +1 -1
  637. package/dist/internal/cursor-event-relay.js +26 -2
  638. package/dist/internal/cursor-relay-core.d.ts.map +1 -1
  639. package/dist/internal/cursor-relay-core.js +22 -3
  640. package/dist/internal/deploy-client.d.ts +102 -92
  641. package/dist/internal/deploy-client.d.ts.map +1 -1
  642. package/dist/internal/deploy-client.js +143 -178
  643. package/dist/internal/deploy-manifest.d.ts +2 -2
  644. package/dist/internal/deploy-manifest.d.ts.map +1 -1
  645. package/dist/internal/deploy-manifest.js +6 -6
  646. package/dist/internal/describe-error.d.ts +4 -0
  647. package/dist/internal/describe-error.d.ts.map +1 -1
  648. package/dist/internal/describe-error.js +20 -0
  649. package/dist/internal/discovery/agent-config.d.ts +1 -5
  650. package/dist/internal/discovery/agent-config.d.ts.map +1 -1
  651. package/dist/internal/discovery/agent-config.js +5 -11
  652. package/dist/internal/discovery/agent.d.ts.map +1 -1
  653. package/dist/internal/discovery/agent.js +24 -30
  654. package/dist/internal/discovery/channels.d.ts.map +1 -1
  655. package/dist/internal/discovery/channels.js +2 -0
  656. package/dist/internal/discovery/connections.d.ts.map +1 -1
  657. package/dist/internal/discovery/connections.js +6 -4
  658. package/dist/internal/discovery/context.d.ts.map +1 -1
  659. package/dist/internal/discovery/context.js +6 -1
  660. package/dist/internal/discovery/extension-overlay.d.ts +1 -1
  661. package/dist/internal/discovery/extension-overlay.d.ts.map +1 -1
  662. package/dist/internal/discovery/extension-overlay.js +1 -0
  663. package/dist/internal/discovery/extensions.d.ts.map +1 -1
  664. package/dist/internal/discovery/extensions.js +12 -5
  665. package/dist/internal/discovery/fs.d.ts.map +1 -1
  666. package/dist/internal/discovery/fs.js +2 -1
  667. package/dist/internal/discovery/hooks.d.ts.map +1 -1
  668. package/dist/internal/discovery/hooks.js +1 -0
  669. package/dist/internal/discovery/info.d.ts.map +1 -1
  670. package/dist/internal/discovery/info.js +0 -3
  671. package/dist/internal/discovery/instructions.d.ts.map +1 -1
  672. package/dist/internal/discovery/instructions.js +4 -1
  673. package/dist/internal/discovery/instrumentation.js +1 -1
  674. package/dist/internal/discovery/modules.d.ts.map +1 -1
  675. package/dist/internal/discovery/modules.js +4 -1
  676. package/dist/internal/discovery/project.js +1 -1
  677. package/dist/internal/discovery/reminders.d.ts.map +1 -1
  678. package/dist/internal/discovery/reminders.js +1 -0
  679. package/dist/internal/discovery/runtime.d.ts +0 -16
  680. package/dist/internal/discovery/runtime.d.ts.map +1 -1
  681. package/dist/internal/discovery/runtime.js +2 -47
  682. package/dist/internal/discovery/schedules.d.ts.map +1 -1
  683. package/dist/internal/discovery/schedules.js +1 -0
  684. package/dist/internal/discovery/services.d.ts.map +1 -1
  685. package/dist/internal/discovery/services.js +3 -1
  686. package/dist/internal/discovery/skills.d.ts.map +1 -1
  687. package/dist/internal/discovery/skills.js +1 -0
  688. package/dist/internal/discovery/tools.d.ts +1 -1
  689. package/dist/internal/discovery/tools.d.ts.map +1 -1
  690. package/dist/internal/discovery/tools.js +3 -1
  691. package/dist/internal/discovery.d.ts +1 -1
  692. package/dist/internal/discovery.d.ts.map +1 -1
  693. package/dist/internal/discovery.js +1 -1
  694. package/dist/internal/distribution.d.ts +9 -14
  695. package/dist/internal/distribution.d.ts.map +1 -1
  696. package/dist/internal/distribution.js +54 -18
  697. package/dist/internal/docs-site.d.ts.map +1 -1
  698. package/dist/internal/docs-site.js +15 -2
  699. package/dist/internal/dry-run.d.ts +32 -0
  700. package/dist/internal/dry-run.d.ts.map +1 -0
  701. package/dist/internal/dry-run.js +62 -0
  702. package/dist/internal/duration.d.ts.map +1 -1
  703. package/dist/internal/duration.js +1 -0
  704. package/dist/internal/estimate-cost.d.ts.map +1 -1
  705. package/dist/internal/estimate-cost.js +12 -5
  706. package/dist/internal/eval-run-store.d.ts.map +1 -1
  707. package/dist/internal/eval-run-store.js +6 -5
  708. package/dist/internal/eval-runner.d.ts +0 -2
  709. package/dist/internal/eval-runner.d.ts.map +1 -1
  710. package/dist/internal/eval-runner.js +3 -3
  711. package/dist/internal/evals-client.d.ts.map +1 -1
  712. package/dist/internal/evals-client.js +60 -15
  713. package/dist/internal/event-log.d.ts.map +1 -1
  714. package/dist/internal/event-log.js +3 -11
  715. package/dist/internal/event-mapper.d.ts.map +1 -1
  716. package/dist/internal/event-mapper.js +33 -15
  717. package/dist/internal/expected-delivery-failure.d.ts.map +1 -1
  718. package/dist/internal/expected-delivery-failure.js +5 -4
  719. package/dist/internal/fetch-text.d.ts +8 -0
  720. package/dist/internal/fetch-text.d.ts.map +1 -0
  721. package/dist/internal/fetch-text.js +32 -0
  722. package/dist/internal/filesystem/errors.d.ts.map +1 -1
  723. package/dist/internal/filesystem/errors.js +8 -0
  724. package/dist/internal/filesystem/scratch.js +1 -4
  725. package/dist/internal/filesystem/sdk-schemas.d.ts +19 -19
  726. package/dist/internal/filesystem/sdk-schemas.d.ts.map +1 -1
  727. package/dist/internal/filesystem/sdk-schemas.js +15 -21
  728. package/dist/internal/filesystem/tools.d.ts +15 -4
  729. package/dist/internal/filesystem/tools.d.ts.map +1 -1
  730. package/dist/internal/filesystem/tools.js +33 -47
  731. package/dist/internal/filesystem/walk.d.ts.map +1 -1
  732. package/dist/internal/filesystem/walk.js +4 -0
  733. package/dist/internal/framework-file-storage.d.ts.map +1 -1
  734. package/dist/internal/framework-file-storage.js +2 -1
  735. package/dist/internal/frontmatter.d.ts.map +1 -1
  736. package/dist/internal/frontmatter.js +5 -1
  737. package/dist/internal/github-fanout.js +2 -1
  738. package/dist/internal/guest-network.d.ts.map +1 -1
  739. package/dist/internal/guest-network.js +6 -0
  740. package/dist/internal/handleAgentServeTrigger.d.ts +8 -0
  741. package/dist/internal/handleAgentServeTrigger.d.ts.map +1 -1
  742. package/dist/internal/handleAgentServeTrigger.js +27 -1
  743. package/dist/internal/host-kv.d.ts.map +1 -1
  744. package/dist/internal/host-kv.js +4 -2
  745. package/dist/internal/host-otel.d.ts.map +1 -1
  746. package/dist/internal/host-otel.js +2 -8
  747. package/dist/internal/host-platforms.d.ts.map +1 -1
  748. package/dist/internal/host-platforms.js +17 -10
  749. package/dist/internal/hosted-catch-protocol.d.ts.map +1 -1
  750. package/dist/internal/hosted-catch-protocol.js +26 -9
  751. package/dist/internal/hosted-catch.d.ts +13 -10
  752. package/dist/internal/hosted-catch.d.ts.map +1 -1
  753. package/dist/internal/hosted-catch.js +23 -11
  754. package/dist/internal/hosted-delivery-protocol.d.ts +1 -1
  755. package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
  756. package/dist/internal/hosted-delivery-protocol.js +75 -45
  757. package/dist/internal/hosted-delivery.d.ts +1 -2
  758. package/dist/internal/hosted-delivery.d.ts.map +1 -1
  759. package/dist/internal/hosted-delivery.js +27 -32
  760. package/dist/internal/hosted-execution-diag.d.ts.map +1 -1
  761. package/dist/internal/hosted-execution-diag.js +11 -13
  762. package/dist/internal/hosted-execution-flush.js +1 -1
  763. package/dist/internal/hosted-execution-latency.d.ts.map +1 -1
  764. package/dist/internal/hosted-execution-latency.js +12 -1
  765. package/dist/internal/hosted-hints.d.ts +16 -0
  766. package/dist/internal/hosted-hints.d.ts.map +1 -0
  767. package/dist/internal/hosted-hints.js +23 -0
  768. package/dist/internal/hosted-managed-automation.d.ts.map +1 -1
  769. package/dist/internal/hosted-managed-automation.js +1 -0
  770. package/dist/internal/hosted-session-fixture.d.ts +26 -0
  771. package/dist/internal/hosted-session-fixture.d.ts.map +1 -0
  772. package/dist/internal/hosted-session-fixture.js +34 -0
  773. package/dist/internal/hosted-session-view.d.ts +48 -0
  774. package/dist/internal/hosted-session-view.d.ts.map +1 -0
  775. package/dist/internal/hosted-session-view.js +305 -0
  776. package/dist/internal/http-channel.d.ts.map +1 -1
  777. package/dist/internal/http-channel.js +8 -5
  778. package/dist/internal/http-control-plane-session.d.ts.map +1 -1
  779. package/dist/internal/http-control-plane-session.js +8 -9
  780. package/dist/internal/init-interview.js +2 -2
  781. package/dist/internal/init-project.d.ts +7 -13
  782. package/dist/internal/init-project.d.ts.map +1 -1
  783. package/dist/internal/init-project.js +10 -20
  784. package/dist/internal/init-scaffold.js +2 -2
  785. package/dist/internal/inline-stdio-define-stub.d.ts +1 -1
  786. package/dist/internal/inline-stdio-define-stub.d.ts.map +1 -1
  787. package/dist/internal/inline-stdio-define-stub.js +1 -1
  788. package/dist/internal/inline-stdio-mcp.d.ts.map +1 -1
  789. package/dist/internal/inline-stdio-mcp.js +31 -8
  790. package/dist/internal/install-cursor-skills.d.ts +22 -15
  791. package/dist/internal/install-cursor-skills.d.ts.map +1 -1
  792. package/dist/internal/install-cursor-skills.js +66 -31
  793. package/dist/internal/interview/agent-questions.d.ts.map +1 -1
  794. package/dist/internal/interview/agent-questions.js +4 -1
  795. package/dist/internal/interview/question.d.ts +1 -1
  796. package/dist/internal/interview/question.js +1 -1
  797. package/dist/internal/json-schema.d.ts +3 -2
  798. package/dist/internal/json-schema.d.ts.map +1 -1
  799. package/dist/internal/json-schema.js +83 -3
  800. package/dist/internal/json-value.d.ts +20 -0
  801. package/dist/internal/json-value.d.ts.map +1 -0
  802. package/dist/internal/json-value.js +56 -0
  803. package/dist/internal/logs-client.d.ts +4 -25
  804. package/dist/internal/logs-client.d.ts.map +1 -1
  805. package/dist/internal/logs-client.js +17 -174
  806. package/dist/internal/mcp-endpoint.d.ts +1 -1
  807. package/dist/internal/mcp-endpoint.js +2 -1
  808. package/dist/internal/mcp-host.d.ts.map +1 -1
  809. package/dist/internal/mcp-host.js +22 -9
  810. package/dist/internal/mcp-oauth.d.ts +2 -2
  811. package/dist/internal/mcp-oauth.d.ts.map +1 -1
  812. package/dist/internal/mcp-oauth.js +61 -8
  813. package/dist/internal/named-webhook-secret.d.ts +12 -0
  814. package/dist/internal/named-webhook-secret.d.ts.map +1 -1
  815. package/dist/internal/named-webhook-secret.js +18 -0
  816. package/dist/internal/otel/bind-telemetry.d.ts +26 -0
  817. package/dist/internal/otel/bind-telemetry.d.ts.map +1 -0
  818. package/dist/internal/otel/bind-telemetry.js +36 -0
  819. package/dist/internal/otel/collector.d.ts.map +1 -1
  820. package/dist/internal/otel/collector.js +94 -42
  821. package/dist/internal/otel/config.d.ts.map +1 -1
  822. package/dist/internal/otel/config.js +4 -3
  823. package/dist/internal/otel/conversation-span-processor.d.ts.map +1 -1
  824. package/dist/internal/otel/conversation-span-processor.js +5 -2
  825. package/dist/internal/otel/customer.d.ts +1 -5
  826. package/dist/internal/otel/customer.d.ts.map +1 -1
  827. package/dist/internal/otel/customer.js +35 -13
  828. package/dist/internal/otel/http.d.ts +1 -1
  829. package/dist/internal/otel/http.d.ts.map +1 -1
  830. package/dist/internal/otel/http.js +5 -3
  831. package/dist/internal/otel/propagation.d.ts +3 -2
  832. package/dist/internal/otel/propagation.d.ts.map +1 -1
  833. package/dist/internal/otel/propagation.js +3 -2
  834. package/dist/internal/otel/reserved-attributes.d.ts +8 -0
  835. package/dist/internal/otel/reserved-attributes.d.ts.map +1 -0
  836. package/dist/internal/otel/reserved-attributes.js +24 -0
  837. package/dist/internal/otel/runtime.d.ts.map +1 -1
  838. package/dist/internal/otel/runtime.js +9 -2
  839. package/dist/internal/otel/session-telemetry.d.ts +22 -0
  840. package/dist/internal/otel/session-telemetry.d.ts.map +1 -0
  841. package/dist/internal/otel/session-telemetry.js +30 -0
  842. package/dist/internal/otel/telemetry-attributes.d.ts +7 -0
  843. package/dist/internal/otel/telemetry-attributes.d.ts.map +1 -0
  844. package/dist/internal/otel/telemetry-attributes.js +35 -0
  845. package/dist/internal/otel/telemetry-processor.d.ts +7 -0
  846. package/dist/internal/otel/telemetry-processor.d.ts.map +1 -0
  847. package/dist/internal/otel/telemetry-processor.js +47 -0
  848. package/dist/internal/otel/tool-error-class.d.ts.map +1 -1
  849. package/dist/internal/otel/tool-error-class.js +4 -0
  850. package/dist/internal/package-inline-stdio.d.ts.map +1 -1
  851. package/dist/internal/package-inline-stdio.js +2 -2
  852. package/dist/internal/persistent-stage-log-mirror.js +2 -5
  853. package/dist/internal/platform-timers.d.ts.map +1 -1
  854. package/dist/internal/platform-timers.js +32 -1
  855. package/dist/internal/playground/toolchain.d.ts.map +1 -1
  856. package/dist/internal/playground/toolchain.js +16 -3
  857. package/dist/internal/playground-proxy.d.ts +6 -27
  858. package/dist/internal/playground-proxy.d.ts.map +1 -1
  859. package/dist/internal/playground-proxy.js +25 -83
  860. package/dist/internal/private-file.d.ts +2 -0
  861. package/dist/internal/private-file.d.ts.map +1 -0
  862. package/dist/internal/private-file.js +8 -0
  863. package/dist/internal/reminder-control-plane-protocol.d.ts.map +1 -1
  864. package/dist/internal/reminder-control-plane-protocol.js +4 -2
  865. package/dist/internal/reminder-runner.d.ts.map +1 -1
  866. package/dist/internal/reminder-runner.js +12 -25
  867. package/dist/internal/reminder-schedule.js +1 -1
  868. package/dist/internal/reminder-store.d.ts.map +1 -1
  869. package/dist/internal/reminder-store.js +16 -21
  870. package/dist/internal/request-headers.d.ts +2 -2
  871. package/dist/internal/request-headers.d.ts.map +1 -1
  872. package/dist/internal/request-headers.js +1 -1
  873. package/dist/internal/resolve-prod-target.d.ts +9 -65
  874. package/dist/internal/resolve-prod-target.d.ts.map +1 -1
  875. package/dist/internal/resolve-prod-target.js +20 -187
  876. package/dist/internal/resolved-connections.js +1 -1
  877. package/dist/internal/{factory-resource-channel.d.ts → resource-channel.d.ts} +10 -10
  878. package/dist/internal/resource-channel.d.ts.map +1 -0
  879. package/dist/internal/{factory-resource-channel.js → resource-channel.js} +9 -7
  880. package/dist/internal/run-client.d.ts.map +1 -1
  881. package/dist/internal/run-client.js +4 -1
  882. package/dist/internal/sdk-runner.d.ts +2 -2
  883. package/dist/internal/sdk-runner.d.ts.map +1 -1
  884. package/dist/internal/sdk-runner.js +19 -16
  885. package/dist/internal/sdk-subagent-inherit-support.d.ts.map +1 -1
  886. package/dist/internal/sdk-subagent-inherit-support.js +3 -2
  887. package/dist/internal/serve-restart.d.ts +3 -0
  888. package/dist/internal/serve-restart.d.ts.map +1 -1
  889. package/dist/internal/serve-restart.js +8 -4
  890. package/dist/internal/server.d.ts +4 -0
  891. package/dist/internal/server.d.ts.map +1 -1
  892. package/dist/internal/server.js +71 -64
  893. package/dist/internal/session-cost.d.ts +4 -4
  894. package/dist/internal/session-cost.d.ts.map +1 -1
  895. package/dist/internal/session-cost.js +5 -5
  896. package/dist/internal/session-engine.d.ts +22 -8
  897. package/dist/internal/session-engine.d.ts.map +1 -1
  898. package/dist/internal/session-engine.js +170 -75
  899. package/dist/internal/session-links.js +2 -1
  900. package/dist/internal/session-live-publisher.d.ts +0 -7
  901. package/dist/internal/session-live-publisher.d.ts.map +1 -1
  902. package/dist/internal/session-live-publisher.js +20 -7
  903. package/dist/internal/session-run-log.d.ts.map +1 -1
  904. package/dist/internal/session-run-log.js +19 -5
  905. package/dist/internal/session-store.d.ts.map +1 -1
  906. package/dist/internal/session-store.js +17 -3
  907. package/dist/internal/sessions-client.d.ts +2 -0
  908. package/dist/internal/sessions-client.d.ts.map +1 -1
  909. package/dist/internal/sessions-client.js +44 -10
  910. package/dist/internal/shallow-clone.d.ts +258 -0
  911. package/dist/internal/shallow-clone.d.ts.map +1 -0
  912. package/dist/internal/shallow-clone.js +644 -0
  913. package/dist/internal/slack-bot-scopes.d.ts +3 -0
  914. package/dist/internal/slack-bot-scopes.d.ts.map +1 -0
  915. package/dist/internal/slack-bot-scopes.js +2 -0
  916. package/dist/internal/slack-manifest-opt-in.d.ts +26 -0
  917. package/dist/internal/slack-manifest-opt-in.d.ts.map +1 -0
  918. package/dist/internal/slack-manifest-opt-in.js +63 -0
  919. package/dist/internal/slack-provision-client.d.ts +8 -24
  920. package/dist/internal/slack-provision-client.d.ts.map +1 -1
  921. package/dist/internal/slack-provision-client.js +21 -20
  922. package/dist/internal/slack-thread-key.d.ts +8 -3
  923. package/dist/internal/slack-thread-key.d.ts.map +1 -1
  924. package/dist/internal/slack-thread-key.js +6 -6
  925. package/dist/internal/sqlite-experimental-warning.js +1 -1
  926. package/dist/internal/start-log-store.d.ts.map +1 -1
  927. package/dist/internal/start-log-store.js +2 -5
  928. package/dist/internal/storage-coordinator.d.ts.map +1 -1
  929. package/dist/internal/storage-coordinator.js +49 -20
  930. package/dist/internal/stored-eval-run.d.ts +17 -0
  931. package/dist/internal/stored-eval-run.d.ts.map +1 -0
  932. package/dist/internal/stored-eval-run.js +305 -0
  933. package/dist/internal/stream-progress.d.ts.map +1 -1
  934. package/dist/internal/stream-progress.js +1 -1
  935. package/dist/internal/tcp-address.d.ts +4 -0
  936. package/dist/internal/tcp-address.d.ts.map +1 -0
  937. package/dist/internal/tcp-address.js +8 -0
  938. package/dist/internal/terminal-style.js +2 -2
  939. package/dist/internal/testing/pagerduty-continuation-fixtures.d.ts +1 -1
  940. package/dist/internal/testing/pagerduty-continuation-fixtures.js +1 -1
  941. package/dist/internal/testing/scm-continuation-fixtures.d.ts +1 -1
  942. package/dist/internal/testing/scm-continuation-fixtures.js +1 -1
  943. package/dist/internal/testing/slack-continuation-fixtures.d.ts +12 -6
  944. package/dist/internal/testing/slack-continuation-fixtures.d.ts.map +1 -1
  945. package/dist/internal/testing/slack-continuation-fixtures.js +74 -3
  946. package/dist/internal/tool-call-retry.d.ts +35 -7
  947. package/dist/internal/tool-call-retry.d.ts.map +1 -1
  948. package/dist/internal/tool-call-retry.js +108 -108
  949. package/dist/internal/tool-catalog.d.ts.map +1 -1
  950. package/dist/internal/tool-catalog.js +7 -2
  951. package/dist/internal/tool-policy.d.ts +20 -7
  952. package/dist/internal/tool-policy.d.ts.map +1 -1
  953. package/dist/internal/tool-policy.js +39 -11
  954. package/dist/internal/tool-result.d.ts +0 -5
  955. package/dist/internal/tool-result.d.ts.map +1 -1
  956. package/dist/internal/tool-result.js +26 -6
  957. package/dist/internal/trajectory.d.ts.map +1 -1
  958. package/dist/internal/trajectory.js +5 -1
  959. package/dist/internal/turn-outbox.d.ts.map +1 -1
  960. package/dist/internal/turn-outbox.js +1 -0
  961. package/dist/internal/update-check.d.ts +2 -0
  962. package/dist/internal/update-check.d.ts.map +1 -1
  963. package/dist/internal/update-check.js +4 -0
  964. package/dist/internal/workspace.d.ts +3 -4
  965. package/dist/internal/workspace.d.ts.map +1 -1
  966. package/dist/internal/workspace.js +5 -5
  967. package/dist/kv/memory-kv.d.ts +1 -1
  968. package/dist/kv/memory-kv.js +1 -1
  969. package/dist/kv.d.ts +9 -2
  970. package/dist/kv.d.ts.map +1 -1
  971. package/dist/kv.js +10 -2
  972. package/dist/memory.d.ts +1 -1
  973. package/dist/memory.js +1 -1
  974. package/dist/otel-public.d.ts +2 -1
  975. package/dist/otel-public.d.ts.map +1 -1
  976. package/dist/otel-public.js +2 -1
  977. package/dist/otel.d.ts.map +1 -1
  978. package/dist/otel.js +6 -2
  979. package/dist/playground/assets/cursor-icons-16-QUmxS7q3.woff2 +0 -0
  980. package/dist/playground/assets/index-BMpVzZzC.css +1 -0
  981. package/dist/playground/assets/index-_3zz3yh8.js +62 -0
  982. package/dist/playground/index.html +2 -2
  983. package/dist/prompt.d.ts +1 -1
  984. package/dist/prompt.js +1 -1
  985. package/dist/public-deprecated.d.ts +11 -12
  986. package/dist/public-deprecated.d.ts.map +1 -1
  987. package/dist/public-deprecated.js +8 -9
  988. package/dist/reminders.d.ts +2 -2
  989. package/dist/reminders.js +2 -2
  990. package/dist/schedules.d.ts +1 -1
  991. package/dist/schedules.js +1 -1
  992. package/dist/scm.d.ts +2 -0
  993. package/dist/scm.d.ts.map +1 -0
  994. package/dist/scm.js +1 -0
  995. package/dist/skills.d.ts +1 -1
  996. package/dist/skills.js +1 -1
  997. package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
  998. package/dist/storage-backends/cursor-hosted.js +5 -3
  999. package/dist/storage-backends/file-kv.d.ts +3 -2
  1000. package/dist/storage-backends/file-kv.d.ts.map +1 -1
  1001. package/dist/storage-backends/file-kv.js +20 -8
  1002. package/dist/storage.d.ts +2 -3
  1003. package/dist/storage.d.ts.map +1 -1
  1004. package/dist/storage.js +9 -5
  1005. package/dist/telemetry.d.ts +12 -0
  1006. package/dist/telemetry.d.ts.map +1 -0
  1007. package/dist/telemetry.js +11 -0
  1008. package/dist/tools.d.ts +1 -1
  1009. package/dist/tools.d.ts.map +1 -1
  1010. package/dist/tools.js +2 -1
  1011. package/dist/types.d.ts +54 -41
  1012. package/dist/types.d.ts.map +1 -1
  1013. package/dist/types.js +4 -4
  1014. package/docs/README.md +16 -17
  1015. package/docs/building-with-agents.md +16 -16
  1016. package/docs/changelog.md +48 -12
  1017. package/docs/deployment.md +111 -49
  1018. package/docs/evals.md +11 -11
  1019. package/docs/guides/agent-to-agent.md +8 -8
  1020. package/docs/guides/bitbucket.md +5 -5
  1021. package/docs/guides/cloud-agents.md +4 -4
  1022. package/docs/guides/convert-automation.md +17 -16
  1023. package/docs/guides/github.md +16 -16
  1024. package/docs/guides/gitlab.md +5 -5
  1025. package/docs/guides/grokbot-agents.md +8 -14
  1026. package/docs/guides/hooks.md +3 -3
  1027. package/docs/guides/improve.md +2 -2
  1028. package/docs/guides/jev.md +10 -10
  1029. package/docs/guides/mcp-oauth.md +8 -8
  1030. package/docs/guides/migrate.md +35 -28
  1031. package/docs/guides/opentelemetry.md +61 -130
  1032. package/docs/guides/pagerduty.md +18 -18
  1033. package/docs/guides/slack.md +82 -11
  1034. package/docs/guides/webhooks.md +61 -3
  1035. package/docs/hillclimbing.md +2 -2
  1036. package/docs/quickstart.md +21 -21
  1037. package/docs/reference/access.md +27 -0
  1038. package/docs/reference/agent-config.md +54 -12
  1039. package/docs/reference/artifacts.md +2 -2
  1040. package/docs/reference/channels.md +29 -9
  1041. package/docs/reference/cli.md +364 -367
  1042. package/docs/reference/connections.md +9 -9
  1043. package/docs/reference/evals.md +13 -13
  1044. package/docs/reference/extensions.md +10 -10
  1045. package/docs/reference/hooks.md +11 -11
  1046. package/docs/reference/http-api.md +1 -1
  1047. package/docs/reference/instructions.md +1 -1
  1048. package/docs/reference/limits.md +42 -0
  1049. package/docs/reference/memory.md +7 -7
  1050. package/docs/reference/playground.md +1 -1
  1051. package/docs/reference/project-layout.md +6 -6
  1052. package/docs/reference/prompt.md +2 -2
  1053. package/docs/reference/schedules.md +4 -4
  1054. package/docs/reference/sessions.md +3 -3
  1055. package/docs/reference/skills.md +2 -2
  1056. package/docs/reference/subagents.md +1 -1
  1057. package/docs/reference/tools.md +31 -21
  1058. package/docs/templates/agentic-owners.md +7 -7
  1059. package/docs/templates/security-reviewer.md +6 -6
  1060. package/docs/templates/thermo-quality-review.md +7 -7
  1061. package/docs/templates/thermo-review.md +7 -7
  1062. package/docs/templates/triage.md +9 -9
  1063. package/docs/troubleshooting.md +24 -22
  1064. package/package.json +51 -92
  1065. package/scripts/install-cursor-skills.mjs +2 -2
  1066. package/skills/cli/SKILL.md +125 -0
  1067. package/skills/create-agent/SKILL.md +11 -9
  1068. package/skills/debug/SKILL.md +3 -3
  1069. package/skills/deploy/SKILL.md +46 -43
  1070. package/skills/evals/SKILL.md +7 -7
  1071. package/skills/framework-map/SKILL.md +8 -7
  1072. package/skills/github/SKILL.md +4 -4
  1073. package/skills/hillclimb/SKILL.md +3 -3
  1074. package/skills/migrate-v2/SKILL.md +50 -53
  1075. package/skills/otel/SKILL.md +36 -6
  1076. package/skills/setup-slack/SKILL.md +3 -3
  1077. package/templates/agentic-owners/README.md +1 -1
  1078. package/templates/agentic-owners/bot/agent.ts +1 -1
  1079. package/templates/agentic-owners/bot/channels/github.ts +1 -1
  1080. package/templates/agentic-owners/bot/lib/github.ts +2 -2
  1081. package/templates/agentic-owners/bot/lib/owners/parse.ts +1 -1
  1082. package/templates/agentic-owners/bot/lib/owners/policyMode.ts +6 -2
  1083. package/templates/agentic-owners/bot/lib/review.ts +7 -3
  1084. package/templates/agentic-owners/bot/tools/record_review.ts +2 -2
  1085. package/templates/agentic-owners/evals/evals.config.ts +1 -1
  1086. package/templates/agentic-owners/evals/owners.eval.ts +1 -1
  1087. package/templates/agentic-owners/package.json +2 -2
  1088. package/templates/agents-md/README.md +1 -1
  1089. package/templates/agents-md/bot/agent.ts +1 -1
  1090. package/templates/agents-md/bot/channels/github.ts +1 -1
  1091. package/templates/agents-md/bot/channels/queue.ts +5 -3
  1092. package/templates/agents-md/bot/channels/slack.ts +1 -1
  1093. package/templates/agents-md/bot/lib/collect.ts +1 -1
  1094. package/templates/agents-md/bot/schedules/weekly.ts +6 -6
  1095. package/templates/agents-md/bot/tools/apply_agents.ts +2 -2
  1096. package/templates/agents-md/evals/agents.eval.ts +1 -1
  1097. package/templates/agents-md/evals/evals.config.ts +1 -1
  1098. package/templates/agents-md/package.json +2 -2
  1099. package/templates/code-wiki/README.md +1 -1
  1100. package/templates/code-wiki/bot/agent.ts +1 -1
  1101. package/templates/code-wiki/bot/channels/github.ts +3 -3
  1102. package/templates/code-wiki/bot/tools/apply_wiki.ts +3 -3
  1103. package/templates/code-wiki/evals/evals.config.ts +1 -1
  1104. package/templates/code-wiki/evals/wiki.eval.ts +1 -1
  1105. package/templates/code-wiki/package.json +2 -2
  1106. package/templates/demo/README.md +1 -1
  1107. package/templates/demo/bot/agent.ts +1 -1
  1108. package/templates/demo/bot/channels/github.ts +7 -3
  1109. package/templates/demo/bot/channels/queue.ts +5 -5
  1110. package/templates/demo/bot/lib/collect.ts +2 -2
  1111. package/templates/demo/bot/tools/record_demo.ts +2 -2
  1112. package/templates/demo/evals/demo.eval.ts +1 -1
  1113. package/templates/demo/evals/evals.config.ts +1 -1
  1114. package/templates/demo/package.json +2 -2
  1115. package/templates/pr-autofixer/bot/agent.ts +1 -1
  1116. package/templates/pr-autofixer/bot/channels/drive.ts +1 -1
  1117. package/templates/pr-autofixer/bot/channels/github.ts +3 -3
  1118. package/templates/pr-autofixer/bot/channels/slack.ts +1 -1
  1119. package/templates/pr-autofixer/bot/hooks/bind-agent.ts +1 -1
  1120. package/templates/pr-autofixer/bot/lib/affinity.ts +1 -1
  1121. package/templates/pr-autofixer/bot/lib/drive.ts +2 -2
  1122. package/templates/pr-autofixer/bot/lib/merge-watch.ts +4 -4
  1123. package/templates/pr-autofixer/bot/lib/pr-state.ts +1 -1
  1124. package/templates/pr-autofixer/bot/lib/start-drive.ts +2 -2
  1125. package/templates/pr-autofixer/bot/lib/webhook-buffer.ts +1 -1
  1126. package/templates/pr-autofixer/bot/lib/webhook-routing.ts +1 -1
  1127. package/templates/pr-autofixer/bot/tools/drive_pr.ts +1 -1
  1128. package/templates/pr-autofixer/evals/coordinator.eval.ts +1 -1
  1129. package/templates/pr-autofixer/evals/evals.config.ts +1 -1
  1130. package/templates/pr-autofixer/package.json +2 -2
  1131. package/templates/security-help/.gitignore +4 -0
  1132. package/templates/security-help/README.md +1 -1
  1133. package/templates/security-help/bot/agent.ts +1 -1
  1134. package/templates/security-help/bot/channels/github.ts +1 -1
  1135. package/templates/security-help/bot/channels/slack.ts +1 -1
  1136. package/templates/security-help/bot/lib/pr-first-pass.ts +3 -3
  1137. package/templates/security-help/evals/evals.config.ts +1 -1
  1138. package/templates/security-help/evals/security-help.eval.ts +1 -1
  1139. package/templates/security-help/package.json +1 -1
  1140. package/templates/security-reviewer/README.md +1 -1
  1141. package/templates/security-reviewer/bot/agent.ts +1 -1
  1142. package/templates/security-reviewer/bot/channels/github.ts +2 -2
  1143. package/templates/security-reviewer/bot/tools/post_findings.ts +2 -2
  1144. package/templates/security-reviewer/evals/evals.config.ts +1 -1
  1145. package/templates/security-reviewer/evals/review.eval.ts +1 -1
  1146. package/templates/security-reviewer/package.json +2 -2
  1147. package/templates/thermo-quality-review/README.md +1 -1
  1148. package/templates/thermo-quality-review/bot/agent.ts +1 -1
  1149. package/templates/thermo-quality-review/bot/channels/github.ts +2 -2
  1150. package/templates/thermo-quality-review/bot/tools/post_findings.ts +2 -2
  1151. package/templates/thermo-quality-review/evals/evals.config.ts +1 -1
  1152. package/templates/thermo-quality-review/evals/review.eval.ts +1 -1
  1153. package/templates/thermo-quality-review/package.json +2 -2
  1154. package/templates/thermo-review/README.md +1 -1
  1155. package/templates/thermo-review/bot/agent.ts +1 -1
  1156. package/templates/thermo-review/bot/channels/github.ts +2 -2
  1157. package/templates/thermo-review/bot/tools/post_findings.ts +2 -2
  1158. package/templates/thermo-review/evals/evals.config.ts +1 -1
  1159. package/templates/thermo-review/evals/review.eval.ts +1 -1
  1160. package/templates/thermo-review/package.json +2 -2
  1161. package/templates/triage/README.md +2 -2
  1162. package/templates/triage/bot/agent.ts +1 -1
  1163. package/templates/triage/bot/channels/queue.ts +5 -5
  1164. package/templates/triage/bot/channels/webhook.ts +5 -5
  1165. package/templates/triage/bot/hooks/memory.ts +1 -1
  1166. package/templates/triage/bot/lib/actuate.ts +2 -2
  1167. package/templates/triage/bot/tools/record_triage.ts +1 -1
  1168. package/templates/triage/evals/evals.config.ts +1 -1
  1169. package/templates/triage/evals/triage.eval.ts +1 -1
  1170. package/templates/triage/overlays/jira/README.md +1 -1
  1171. package/templates/triage/overlays/jira/bot/mcp-connections/tracker.ts +1 -1
  1172. package/templates/triage/overlays/linear/README.md +1 -1
  1173. package/templates/triage/overlays/linear/bot/mcp-connections/tracker.ts +1 -1
  1174. package/templates/triage/package.json +2 -2
  1175. package/dist/bin/agent-sdk.js +0 -2
  1176. package/dist/docs/assets/building-with-agents.md.FZXrY8Nk.js +0 -9
  1177. package/dist/docs/assets/building-with-agents.md.FZXrY8Nk.lean.js +0 -1
  1178. package/dist/docs/assets/changelog.md.BvHRIiMH.js +0 -1
  1179. package/dist/docs/assets/changelog.md.BvHRIiMH.lean.js +0 -1
  1180. package/dist/docs/assets/chunks/@localSearchIndexroot.BoDEJQWv.js +0 -1
  1181. package/dist/docs/assets/chunks/channel.D2BTz0L-.js +0 -1
  1182. package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.DqByliAC.js +0 -1
  1183. package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.DqByliAC.js +0 -1
  1184. package/dist/docs/assets/chunks/clone.CldT1lbQ.js +0 -1
  1185. package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.Bb4oMe0P.js +0 -1
  1186. package/dist/docs/assets/deployment.md.3MMWuPeV.js +0 -31
  1187. package/dist/docs/assets/deployment.md.3MMWuPeV.lean.js +0 -1
  1188. package/dist/docs/assets/guides_agent-to-agent.md.CwL5cwuE.lean.js +0 -1
  1189. package/dist/docs/assets/guides_cloud-agents.md.BzbzcOyj.js +0 -9
  1190. package/dist/docs/assets/guides_cloud-agents.md.BzbzcOyj.lean.js +0 -1
  1191. package/dist/docs/assets/guides_convert-automation.md.DMEX9nF-.lean.js +0 -1
  1192. package/dist/docs/assets/guides_export-grokbot.md.qo5bxi4h.js +0 -55
  1193. package/dist/docs/assets/guides_export-grokbot.md.qo5bxi4h.lean.js +0 -1
  1194. package/dist/docs/assets/guides_grokbot-agents.md.BwAykJ7U.js +0 -15
  1195. package/dist/docs/assets/guides_migrate.md.CQlGaBKX.js +0 -7
  1196. package/dist/docs/assets/guides_migrate.md.CQlGaBKX.lean.js +0 -1
  1197. package/dist/docs/assets/guides_opentelemetry.md.D4wO7_8v.js +0 -37
  1198. package/dist/docs/assets/guides_opentelemetry.md.D4wO7_8v.lean.js +0 -1
  1199. package/dist/docs/assets/index.md.CAnsLl8D.js +0 -27
  1200. package/dist/docs/assets/index.md.CAnsLl8D.lean.js +0 -1
  1201. package/dist/docs/assets/quickstart.md.D8JDfkKO.lean.js +0 -1
  1202. package/dist/docs/assets/reference_channels.md.CNNIS6K7.js +0 -22
  1203. package/dist/docs/assets/reference_cli.md.1o_TqKdt.js +0 -103
  1204. package/dist/docs/assets/reference_cli.md.1o_TqKdt.lean.js +0 -1
  1205. package/dist/docs/assets/reference_memory.md.BwyJXYZe.js +0 -4
  1206. package/dist/docs/assets/reference_playground.md.q4MI-0td.js +0 -1
  1207. package/dist/docs/assets/templates_grokbot-agents.md.DgpPEs7B.js +0 -5
  1208. package/dist/docs/assets/templates_grokbot-agents.md.DgpPEs7B.lean.js +0 -1
  1209. package/dist/docs/assets/templates_security-reviewer.md.Gh6EF9Us.js +0 -3
  1210. package/dist/docs/assets/templates_thermo-quality-review.md.B77UyTrX.js +0 -3
  1211. package/dist/docs/assets/templates_thermo-review.md.DRJ7mC5U.js +0 -3
  1212. package/dist/docs/assets/troubleshooting.md.DFnoTDlQ.js +0 -1
  1213. package/dist/docs/guides/export-grokbot.html +0 -114
  1214. package/dist/docs/guides/export-grokbot.md +0 -239
  1215. package/dist/docs/templates/grokbot-agents.html +0 -64
  1216. package/dist/docs/templates/grokbot-agents.md +0 -55
  1217. package/dist/internal/cli-init-grokbot.d.ts +0 -29
  1218. package/dist/internal/cli-init-grokbot.d.ts.map +0 -1
  1219. package/dist/internal/cli-init-grokbot.js +0 -181
  1220. package/dist/internal/convert-grokbot/answers.d.ts +0 -127
  1221. package/dist/internal/convert-grokbot/answers.d.ts.map +0 -1
  1222. package/dist/internal/convert-grokbot/answers.js +0 -445
  1223. package/dist/internal/convert-grokbot/bot.d.ts +0 -50
  1224. package/dist/internal/convert-grokbot/bot.d.ts.map +0 -1
  1225. package/dist/internal/convert-grokbot/bot.js +0 -72
  1226. package/dist/internal/convert-grokbot/checks.d.ts +0 -26
  1227. package/dist/internal/convert-grokbot/checks.d.ts.map +0 -1
  1228. package/dist/internal/convert-grokbot/checks.js +0 -170
  1229. package/dist/internal/convert-grokbot/convert.d.ts +0 -60
  1230. package/dist/internal/convert-grokbot/convert.d.ts.map +0 -1
  1231. package/dist/internal/convert-grokbot/convert.js +0 -470
  1232. package/dist/internal/convert-grokbot/handoff.d.ts +0 -44
  1233. package/dist/internal/convert-grokbot/handoff.d.ts.map +0 -1
  1234. package/dist/internal/convert-grokbot/handoff.js +0 -160
  1235. package/dist/internal/convert-grokbot/recipe.d.ts +0 -61
  1236. package/dist/internal/convert-grokbot/recipe.d.ts.map +0 -1
  1237. package/dist/internal/convert-grokbot/recipe.js +0 -94
  1238. package/dist/internal/convert-grokbot/routine.d.ts +0 -51
  1239. package/dist/internal/convert-grokbot/routine.d.ts.map +0 -1
  1240. package/dist/internal/convert-grokbot/routine.js +0 -128
  1241. package/dist/internal/convert-grokbot/slack.d.ts +0 -28
  1242. package/dist/internal/convert-grokbot/slack.d.ts.map +0 -1
  1243. package/dist/internal/convert-grokbot/slack.js +0 -50
  1244. package/dist/internal/factory-resource-channel.d.ts.map +0 -1
  1245. package/dist/internal/legacy-command-guard.d.ts +0 -24
  1246. package/dist/internal/legacy-command-guard.d.ts.map +0 -1
  1247. package/dist/internal/legacy-command-guard.js +0 -47
  1248. package/dist/internal/runtime-dispatch-runner.d.ts +0 -25
  1249. package/dist/internal/runtime-dispatch-runner.d.ts.map +0 -1
  1250. package/dist/internal/runtime-dispatch-runner.js +0 -35
  1251. package/dist/internal/testing/factory-resource-fixtures.d.ts +0 -64
  1252. package/dist/internal/testing/factory-resource-fixtures.d.ts.map +0 -1
  1253. package/dist/internal/testing/factory-resource-fixtures.js +0 -55
  1254. package/dist/playground/assets/cursor-icons-16-DfKNljMZ.woff2 +0 -0
  1255. package/dist/playground/assets/index-B3_YohwW.js +0 -62
  1256. package/dist/playground/assets/index-Cn3-adsJ.css +0 -1
  1257. package/docs/guides/export-grokbot.md +0 -244
  1258. package/docs/templates/grokbot-agents.md +0 -60
  1259. package/schemas/grokbot-answers.schema.json +0 -354
  1260. package/templates/grokbot-agents/README.md +0 -27
  1261. package/templates/grokbot-agents/bot/agent.ts +0 -6
  1262. package/templates/grokbot-agents/bot/extensions/grokbot.ts +0 -5
  1263. package/templates/grokbot-agents/bot/instructions.md +0 -7
  1264. package/templates/grokbot-agents/evals/evals.config.ts +0 -5
  1265. package/templates/grokbot-agents/evals/grokbot-agents.eval.ts +0 -18
  1266. package/templates/grokbot-agents/init.json +0 -18
  1267. package/templates/grokbot-agents/package.json +0 -17
  1268. package/templates/grokbot-agents/tsconfig.json +0 -12
  1269. /package/dist/docs/assets/{evals.md.CHR34K1Y.lean.js → evals.md.OjKb7tNA.lean.js} +0 -0
  1270. /package/dist/docs/assets/{guides_bitbucket.md.CKUayYtD.lean.js → guides_bitbucket.md.DkjkBRU8.lean.js} +0 -0
  1271. /package/dist/docs/assets/{guides_gitlab.md.CtNI4fSH.lean.js → guides_gitlab.md.DCE0p7_w.lean.js} +0 -0
  1272. /package/dist/docs/assets/{guides_jev.md.D7XH4JH3.lean.js → guides_jev.md.Ccw4pedT.lean.js} +0 -0
  1273. /package/dist/docs/assets/{guides_pagerduty.md.BHXMcMtx.lean.js → guides_pagerduty.md.mnKXe9U0.lean.js} +0 -0
  1274. /package/dist/docs/assets/{hillclimbing.md.Dxvd-0gT.lean.js → hillclimbing.md.By61f3uq.lean.js} +0 -0
  1275. /package/dist/docs/assets/{reference_artifacts.md.DLV9MZES.lean.js → reference_artifacts.md.C-hKR2hp.lean.js} +0 -0
  1276. /package/dist/docs/assets/{reference_connections.md.BJE2Zllp.lean.js → reference_connections.md.BoAotr7_.lean.js} +0 -0
  1277. /package/dist/docs/assets/{reference_evals.md.Ccwp4x3o.lean.js → reference_evals.md.DYKjGFi-.lean.js} +0 -0
  1278. /package/dist/docs/assets/{reference_hooks.md.CROr0QgC.lean.js → reference_hooks.md.B-bwJuiG.lean.js} +0 -0
  1279. /package/dist/docs/assets/{reference_http-api.md.Dji-DD_Z.lean.js → reference_http-api.md._RWELr3d.lean.js} +0 -0
  1280. /package/dist/docs/assets/{reference_instructions.md.BYMVxAkw.lean.js → reference_instructions.md.yL2hXLnl.lean.js} +0 -0
  1281. /package/dist/docs/assets/{reference_memory.md.BwyJXYZe.lean.js → reference_memory.md.Dd7cyV9V.lean.js} +0 -0
  1282. /package/dist/docs/assets/{reference_playground.md.q4MI-0td.lean.js → reference_playground.md.CQiJk9CM.lean.js} +0 -0
  1283. /package/dist/docs/assets/{reference_project-layout.md.mFcS8yDD.lean.js → reference_project-layout.md.BamcPDUn.lean.js} +0 -0
  1284. /package/dist/docs/assets/{reference_prompt.md.DqPh71XN.lean.js → reference_prompt.md.BMjm1Jp3.lean.js} +0 -0
  1285. /package/dist/docs/assets/{reference_schedules.md.BqWnJES4.lean.js → reference_schedules.md.RC47aFm4.lean.js} +0 -0
  1286. /package/dist/docs/assets/{reference_sessions.md.Bi6lHttM.lean.js → reference_sessions.md.C7KFhWXV.lean.js} +0 -0
  1287. /package/dist/docs/assets/{reference_subagents.md.ChNGh6HK.lean.js → reference_subagents.md.CAhvW4yS.lean.js} +0 -0
  1288. /package/dist/docs/assets/{templates_agentic-owners.md.CTEnR0jp.lean.js → templates_agentic-owners.md.Dh2nDSqg.lean.js} +0 -0
  1289. /package/dist/docs/assets/{templates_security-reviewer.md.Gh6EF9Us.lean.js → templates_security-reviewer.md.DnwXdnB5.lean.js} +0 -0
  1290. /package/dist/docs/assets/{templates_triage.md.CNN6b0JZ.lean.js → templates_triage.md.BYWMloV4.lean.js} +0 -0
  1291. /package/dist/docs/assets/{troubleshooting.md.DFnoTDlQ.lean.js → troubleshooting.md.AGJ3jDzj.lean.js} +0 -0
@@ -0,0 +1,28 @@
1
+ import{_ as s,c as t,o as a,a3 as i}from"./chunks/framework.BNw1pucY.js";const E=JSON.parse('{"title":"OpenTelemetry","description":"","frontmatter":{},"headers":[],"relativePath":"guides/opentelemetry.md","filePath":"guides/opentelemetry.md"}'),d={name:"guides/opentelemetry.md"};function n(o,e,r,l,h,c){return a(),t("div",null,[...e[0]||(e[0]=[i(`<h1 id="opentelemetry" tabindex="-1">OpenTelemetry <a class="header-anchor" href="#opentelemetry" aria-label="Permalink to &quot;OpenTelemetry&quot;">​</a></h1><p>Agent SDK sends traces, metrics, and logs to an OTLP collector when <code>OTEL_*</code> is set. Record with <code>@opentelemetry/api</code>, and there is no <code>defineOtel</code>.</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:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> OTEL_EXPORTER_OTLP_ENDPOINT</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">https://otel.example.com</span></span>
2
+ <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> OTEL_EXPORTER_OTLP_HEADERS</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;Authorization=Bearer%20</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">$OTEL_TOKEN</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;</span></span>
3
+ <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> OTEL_SERVICE_NAME</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">incident-agent</span></span>
4
+ <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agent-sdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> serve</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --dir</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --dev</span></span></code></pre></div><p><code>http/protobuf</code> is the default, <code>http/json</code> works, <code>grpc</code> warns and falls back to <code>http/protobuf</code>, metrics use delta temporality, and Grafana Cloud rejects delta, so set <code>OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=cumulative</code> for Grafana Cloud or Prometheus. Providers load before <code>bot/agent.ts</code>, so a module-scope meter, tracer, or logger binds to them, and with no endpoint there are no exporters, <code>fetch</code> has no <code>traceparent</code>, and the session collector stays off.</p><h2 id="variables" tabindex="-1">Variables <a class="header-anchor" href="#variables" aria-label="Permalink to &quot;Variables&quot;">​</a></h2><table tabindex="0"><thead><tr><th>Variable</th><th>Effect</th></tr></thead><tbody><tr><td><code>OTEL_EXPORTER_OTLP_ENDPOINT</code></td><td>Base URL. Appends <code>/v1/traces</code>, <code>/v1/metrics</code>, <code>/v1/logs</code>.</td></tr><tr><td><code>OTEL_EXPORTER_OTLP_TRACES_ENDPOINT</code></td><td>Traces URL, used as written. Overrides the base URL.</td></tr><tr><td><code>OTEL_EXPORTER_OTLP_METRICS_ENDPOINT</code></td><td>Metrics URL, used as written. Overrides the base URL.</td></tr><tr><td><code>OTEL_EXPORTER_OTLP_LOGS_ENDPOINT</code></td><td>Logs URL, used as written. Overrides the base URL.</td></tr><tr><td><code>OTEL_EXPORTER_OTLP_HEADERS</code></td><td>Sent on every export. URL-encode values. Reread on each export.</td></tr><tr><td><code>OTEL_EXPORTER_OTLP_PROTOCOL</code></td><td><code>http/protobuf</code> (default) or <code>http/json</code>.</td></tr><tr><td><code>OTEL_SERVICE_NAME</code></td><td><code>service.name</code>. Defaults to the agent name, then <code>unknown_service:node</code>.</td></tr><tr><td><code>OTEL_RESOURCE_ATTRIBUTES</code></td><td><code>service.namespace</code>, <code>service.version</code>, <code>deployment.environment.name</code>.</td></tr><tr><td><code>OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE</code></td><td><code>delta</code> (default), <code>cumulative</code>, or <code>lowmemory</code>.</td></tr><tr><td><code>OTEL_LOGS_EXPORTER</code></td><td><code>otlp</code> exports logs. Unset, <code>none</code>, and <code>console</code> do not.</td></tr><tr><td><code>OTEL_SDK_DISABLED</code></td><td><code>true</code> turns export off.</td></tr><tr><td><code>OTEL_TRACES_EXPORTER</code></td><td><code>none</code> turns traces off.</td></tr><tr><td><code>OTEL_METRICS_EXPORTER</code></td><td><code>none</code> turns metrics off.</td></tr><tr><td><code>OTEL_LOG_USER_PROMPTS</code></td><td><code>1</code> adds prompt text to log records.</td></tr><tr><td><code>OTEL_LOG_TOOL_CONTENT</code></td><td><code>1</code> adds tool payloads to log records.</td></tr></tbody></table><h2 id="hosted-agents" tabindex="-1">Hosted agents <a class="header-anchor" href="#hosted-agents" aria-label="Permalink to &quot;Hosted agents&quot;">​</a></h2><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;">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>
5
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> hosting: {</span></span>
6
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> egressDomains: [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;otlp-gateway-prod-us-east-0.grafana.net&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">],</span></span>
7
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> secretNames: [</span></span>
8
+ <span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;OTEL_EXPORTER_OTLP_ENDPOINT&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
9
+ <span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;OTEL_EXPORTER_OTLP_HEADERS&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
10
+ <span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;OTEL_SERVICE_NAME&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
11
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ],</span></span>
12
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
13
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p><code>egressDomains</code> is a hostname with no scheme or path. Secrets arrive with the first request that has an endpoint, and that export uses those headers and <code>service.name</code>. A later <code>agent-sdk secret set</code> updates headers on the next export, including a rotated key. A URL, protocol, or signal-list change replaces the exporter. <code>service.name</code> is fixed on the first export that attaches, so redeploy to change it.</p><h2 id="what-you-can-record" tabindex="-1">What you can record <a class="header-anchor" href="#what-you-can-record" aria-label="Permalink to &quot;What you can record&quot;">​</a></h2><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;"> { metrics, trace } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;@opentelemetry/api&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
14
+ <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { logs } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;@opentelemetry/api-logs&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
15
+ <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { currentConversationId } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;@grok/agent-sdk/otel&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
16
+ <span class="line"></span>
17
+ <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> tracer</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> trace.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">getTracer</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;incident-agent&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">);</span></span>
18
+ <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> lookups</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> metrics.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">getMeter</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;incident-agent&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">).</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">createCounter</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;incident.lookups&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">);</span></span>
19
+ <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> logger</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> logs.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">getLogger</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;incident-agent&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">);</span></span>
20
+ <span class="line"></span>
21
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">lookups.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">add</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, { </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;cursor.conversation.id&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">currentConversationId</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() });</span></span></code></pre></div><p>Record after secrets load. A span or log that ends before exporters attach is still sent, up to 2048 of each, a metric recorded before the first collect is included, and HTTP, token, and tool spans carry <code>cursor.conversation.id</code>, while a span started during a turn or a tool call gets that attribute, a value you set is kept, the id is not propagated, and a metric gets it only when you set it.</p><h2 id="tag-a-turn" tabindex="-1">Tag a turn <a class="header-anchor" href="#tag-a-turn" aria-label="Permalink to &quot;Tag a turn&quot;">​</a></h2><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:#24292E;--shiki-dark:#E1E4E8;">async </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">execute</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({ key }, ctx) {</span></span>
22
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ctx.telemetry.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">setTraceAttributes</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({ </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;work.item&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: key });</span></span>
23
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ctx.telemetry.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">setMetricAttributes</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({ </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;work.item&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: key });</span></span>
24
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ctx.telemetry.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">setLogAttributes</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({ </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;work.item&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: key });</span></span>
25
+ <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> await</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> jira.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">getIssue</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(key);</span></span>
26
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p><code>ctx.telemetry</code> writes the current turn&#39;s store. A span started in that turn, including a span Agent SDK starts, gets the trace keys. A log record Agent SDK emits gets the log keys. <code>cursor.token.usage</code> recorded for that turn gets the metric keys. The same store is still there for a later tool in the turn. With export on, a later turn of the session keeps it. With export off, the next turn does not.</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;"> { telemetry } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;@grok/agent-sdk/telemetry&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
27
+ <span class="line"></span>
28
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">telemetry.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">setTraceAttributes</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({ </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;work.item&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: ticket });</span></span></code></pre></div><p>The global methods read the active context. Outside a turn they do nothing. Tags stay in this process. They are not written on the <code>baggage</code> header.</p><div class="language-promql vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">promql</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>sum by (work_item) (cursor_token_usage_total)</span></span></code></pre></div><p>Grafana renames <code>.</code> to <code>_</code>, and each distinct metric value is its own series, including a new id on every turn. Keys match <code>[A-Za-z][A-Za-z0-9._-]*</code> and are at most 128 characters, values are 1 to 256 characters, a session holds 32 trace keys, 32 metric keys, and 32 log keys, a later call replaces a key, and a metric value must not be a secret, an email, or a raw user id.</p><p>Outbound calls send <code>traceparent</code> only. With export off, the tags last for that turn, a span in the turn sees them, the next turn does not, and nothing is exported.</p><p><code>ctx.host.otel</code> is deprecated, still runs this release, and logs one warning per process. <code>setAttributes</code> writes one map onto spans and token usage, and the calls above replace it.</p><p>Trace and log keys are accepted as written. A log record keeps a key Agent SDK already set. <code>setMetricAttributes</code> rejects <code>cursor.token.type</code>, <code>agent_sdk.channel</code>, <code>cursor.tool.name</code>, <code>cursor.tool.kind</code>, <code>cursor.tool.status</code>, <code>agent_sdk.turn_status</code>, <code>agent_sdk.subagent_name</code>, <code>agent_sdk.sdk_agent_id</code>, and <code>agent_sdk.sdk_agent_url</code>. The call throws and leaves the runtime value in place.</p><p>Prompt text and tool payloads stay off log records unless <code>OTEL_LOGS_EXPORTER=otlp</code> and <code>OTEL_LOG_USER_PROMPTS</code> or <code>OTEL_LOG_TOOL_CONTENT</code> is set.</p><h2 id="limits" tabindex="-1">Limits <a class="header-anchor" href="#limits" aria-label="Permalink to &quot;Limits&quot;">​</a></h2><p>Custom span processors, samplers, views, your own SDK, library auto-instrumentation, and a <code>register()</code> hook are not supported, and <code>OTEL_TRACES_SAMPLER</code> and <code>OTEL_METRIC_EXPORT_INTERVAL</code> are read when the provider is built, before hosted secrets load, so set them and restart, because a later value only logs a warning. If a module replaces a provider Agent SDK registered, the global API uses that provider and Agent SDK shuts down a provider it created only when it is not the registered one, and if a context manager is already registered, Agent SDK logs a warning and leaves it, so load Agent SDK first or the turn store does not stay on the active context.</p><h2 id="migrating-from-serve-otel" tabindex="-1">Migrating from serve({ otel }) <a class="header-anchor" href="#migrating-from-serve-otel" aria-label="Permalink to &quot;Migrating from serve({ otel })&quot;">​</a></h2><p><code>serve({ otel })</code> is removed, so delete that option, <code>bot/otel.ts</code>, <code>agent/otel.ts</code>, and <code>bot/instrumentation.ts</code>, and do not call <code>defineOtel</code>. Each signal has one URL, and a second exporter for the same signal has no variable.</p><table tabindex="0"><thead><tr><th>Old option</th><th>Set this instead</th></tr></thead><tbody><tr><td><code>serviceName</code></td><td><code>OTEL_SERVICE_NAME</code></td></tr><tr><td><code>serviceVersion</code></td><td><code>service.version</code> in <code>OTEL_RESOURCE_ATTRIBUTES</code></td></tr><tr><td><code>resourceAttributes</code></td><td><code>OTEL_RESOURCE_ATTRIBUTES</code>, comma-separated, URL-encoded values</td></tr><tr><td><code>exporters[].url</code></td><td><code>OTEL_EXPORTER_OTLP_ENDPOINT</code> (appends <code>/v1/traces</code>, <code>/v1/metrics</code>, <code>/v1/logs</code>)</td></tr><tr><td><code>exporters[].url</code> with <code>signals</code></td><td><code>OTEL_EXPORTER_OTLP_TRACES_ENDPOINT</code>, <code>OTEL_EXPORTER_OTLP_METRICS_ENDPOINT</code>, or <code>OTEL_EXPORTER_OTLP_LOGS_ENDPOINT</code>, used as written</td></tr><tr><td><code>exporters[].headers</code></td><td><code>OTEL_EXPORTER_OTLP_HEADERS</code>, comma-separated, URL-encoded values</td></tr><tr><td><code>exporters[].protocol</code></td><td><code>OTEL_EXPORTER_OTLP_PROTOCOL</code>, or <code>OTEL_EXPORTER_OTLP_TRACES_PROTOCOL</code>, <code>OTEL_EXPORTER_OTLP_METRICS_PROTOCOL</code>, <code>OTEL_EXPORTER_OTLP_LOGS_PROTOCOL</code></td></tr><tr><td><code>exporters[].signals</code></td><td>The per-signal URL. <code>OTEL_TRACES_EXPORTER=none</code>, <code>OTEL_METRICS_EXPORTER=none</code>, or <code>OTEL_LOGS_EXPORTER=none</code> stops that signal.</td></tr><tr><td><code>traces: false</code></td><td><code>OTEL_TRACES_EXPORTER=none</code></td></tr><tr><td><code>traces: true</code></td><td>Leave <code>OTEL_TRACES_EXPORTER</code> unset. Traces start when an endpoint is set.</td></tr><tr><td><code>traces.sampleRatio</code></td><td><code>OTEL_TRACES_SAMPLER=parentbased_traceidratio</code> and <code>OTEL_TRACES_SAMPLER_ARG</code>, before process start</td></tr><tr><td><code>metrics: false</code></td><td><code>OTEL_METRICS_EXPORTER=none</code></td></tr><tr><td><code>metrics: true</code></td><td>Leave <code>OTEL_METRICS_EXPORTER</code> unset. Metrics start when a metrics URL is set.</td></tr><tr><td><code>metrics.exportIntervalMillis</code></td><td><code>OTEL_METRIC_EXPORT_INTERVAL</code>, milliseconds, before process start</td></tr><tr><td><code>logs: false</code></td><td>Unset <code>OTEL_LOGS_EXPORTER</code>, or set <code>none</code></td></tr><tr><td><code>logs: true</code></td><td><code>OTEL_LOGS_EXPORTER=otlp</code></td></tr><tr><td><code>logs.userPrompts</code></td><td><code>OTEL_LOGS_EXPORTER=otlp</code> and <code>OTEL_LOG_USER_PROMPTS=1</code></td></tr><tr><td><code>logs.toolContent</code></td><td><code>OTEL_LOGS_EXPORTER=otlp</code> and <code>OTEL_LOG_TOOL_CONTENT=1</code></td></tr><tr><td><code>otel: false</code></td><td>No endpoint, or <code>OTEL_SDK_DISABLED=true</code></td></tr></tbody></table><p>Put those names in <code>hosting.secretNames</code> and the collector host in <code>hosting.egressDomains</code>.</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agent-sdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> secret</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> set</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> my-agent</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> OTEL_SERVICE_NAME</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> OTEL_EXPORTER_OTLP_ENDPOINT</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> OTEL_EXPORTER_OTLP_HEADERS</span></span></code></pre></div>`,30)])])}const k=s(d,[["render",n]]);export{E as __pageData,k as default};
@@ -0,0 +1 @@
1
+ import{_ as s,c as t,o as a,a3 as i}from"./chunks/framework.BNw1pucY.js";const E=JSON.parse('{"title":"OpenTelemetry","description":"","frontmatter":{},"headers":[],"relativePath":"guides/opentelemetry.md","filePath":"guides/opentelemetry.md"}'),d={name:"guides/opentelemetry.md"};function n(o,e,r,l,h,c){return a(),t("div",null,[...e[0]||(e[0]=[i("",30)])])}const k=s(d,[["render",n]]);export{E as __pageData,k as default};
@@ -1,5 +1,5 @@
1
1
  import{_ as e,c as i,o as a,a3 as t}from"./chunks/framework.BNw1pucY.js";const c=JSON.parse('{"title":"PagerDuty","description":"Respond to PagerDuty incidents: investigate a page, follow it through acknowledgement and resolution, and ignore your own actions.","frontmatter":{"title":"PagerDuty","description":"Respond to PagerDuty incidents: investigate a page, follow it through acknowledgement and resolution, and ignore your own actions."},"headers":[],"relativePath":"guides/pagerduty.md","filePath":"guides/pagerduty.md"}'),n={name:"guides/pagerduty.md"};function h(l,s,d,p,r,o){return a(),i("div",null,[...s[0]||(s[0]=[t(`<h1 id="pagerduty-agents" tabindex="-1">PagerDuty agents <a class="header-anchor" href="#pagerduty-agents" aria-label="Permalink to &quot;PagerDuty agents&quot;">​</a></h1><p>A PagerDuty agent wakes when an incident triggers, investigates it, and writes what it found back to the incident. <code>pagerdutyChannel()</code> receives PagerDuty&#39;s v3 webhooks, verifies them, and keeps every later event for the same incident in one session, so the agent sees an acknowledgement, a note, or a responder&#39;s reply in the context of the investigation it already started. Every setting has a default read from a well-known secret, so the channel needs no configuration beyond its hooks; see <a href="#connect">Connect</a> for the variables.</p><h2 id="investigate-a-new-incident" tabindex="-1">Investigate a new incident <a class="header-anchor" href="#investigate-a-new-incident" aria-label="Permalink to &quot;Investigate a new incident&quot;">​</a></h2><p>When an incident triggers, the agent starts a turn with the incident&#39;s title, service, urgency, and link. It reads whatever the investigation needs, and with <code>deliverReplies: true</code> its reply is posted as a note on the incident, where the person on call already looks.</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/channels/pagerduty.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;"> { defaultPagerDutyAuth, pagerdutyChannel } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;@cursor/bdk/channels/pagerduty&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
2
+ <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { defaultPagerDutyAuth, pagerdutyChannel } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;@grok/agent-sdk/channels/pagerduty&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
3
3
  <span class="line"></span>
4
4
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> pagerdutyChannel</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
5
5
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> deliverReplies: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
@@ -18,7 +18,7 @@ import{_ as e,c as i,o as a,a3 as t}from"./chunks/framework.BNw1pucY.js";const c
18
18
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> incident</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> await</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ctx.pagerduty.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">getIncident</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(event.incident.id);</span></span>
19
19
  <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // …</span></span>
20
20
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">},</span></span></code></pre></div><p>Hosted, the agent also declares PagerDuty&#39;s API host and the token:</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/agent.ts</span></span>
21
- <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;@cursor/bdk&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
21
+ <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>
22
22
  <span class="line"></span>
23
23
  <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>
24
24
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> architecture: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;v2&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
@@ -41,16 +41,16 @@ import{_ as e,c as i,o as a,a3 as t}from"./chunks/framework.BNw1pucY.js";const c
41
41
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> auth: </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">defaultPagerDutyAuth</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(ctx),</span></span>
42
42
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> message: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">\`Note on the incident: \${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">note</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">.</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">content</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">}\`</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
43
43
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> };</span></span>
44
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">},</span></span></code></pre></div><p>Add these to the same <code>pagerdutyChannel()</code> declaration as the investigation handler.</p><h2 id="ignore-your-own-actions" tabindex="-1">Ignore your own actions <a class="header-anchor" href="#ignore-your-own-actions" aria-label="Permalink to &quot;Ignore your own actions&quot;">​</a></h2><p>PagerDuty sends the agent&#39;s own changes back as webhook events: the note it posted, or an acknowledgement or resolve made through its PagerDuty user. The channel acknowledges those events without running a hook or starting a turn. The same action by a person is still delivered.</p><p>The channel finds the agent&#39;s user in this order, on each delivery:</p><ol><li>The <code>selfUserIds</code> option, when you pass one. Nothing below is used.</li><li>The <code>PAGERDUTY_USER_ID</code> secret: one PagerDuty user id.</li><li>The user <code>PAGERDUTY_TOKEN</code> acts as, which PagerDuty reports at <code>GET /users/me</code>.</li></ol><p>When none of these names a user, echo skip is off. <code>bdk deploy</code> warns while neither <code>PAGERDUTY_USER_ID</code> nor <code>PAGERDUTY_TOKEN</code> is set, and the agent logs a warning when its token names no single user.</p><p>Inference depends on the kind of token:</p><table tabindex="0"><thead><tr><th><code>PAGERDUTY_TOKEN</code></th><th>Inferred user</th></tr></thead><tbody><tr><td>User token REST API key</td><td>The key&#39;s own user</td></tr><tr><td>OAuth user token (Classic User OAuth or Scoped OAuth), written as <code>Bearer &lt;token&gt;</code></td><td>The user who authorized the app</td></tr><tr><td>General access (account-level) REST API key</td><td>The user whose email is exactly <code>PAGERDUTY_FROM_EMAIL</code>, if set</td></tr><tr><td>Scoped OAuth app token (client credentials)</td><td>The user whose email is exactly <code>PAGERDUTY_FROM_EMAIL</code>, if set</td></tr></tbody></table><p>PagerDuty serves <a href="https://developer.pagerduty.com/api-reference/0b6f8b0c3e8d1-get-the-current-user" target="_blank" rel="noreferrer"><code>GET /users/me</code></a> only to a user-level API key or a token from an OAuth flow, not to an account-level key. An app token <a href="https://docs.pagerduty.com/developer/private-apps" target="_blank" rel="noreferrer">acts as the app</a>, not as a user. With either, the channel looks up <code>PAGERDUTY_FROM_EMAIL</code>, the <code>From</code> user the token writes as, through <code>GET /users?query=</code> and uses the one user whose email matches exactly. The inferred id is kept in the agent&#39;s memory for an hour per token, never in agent storage, and an unresolved answer is retried after five minutes. Hosted, the lookup needs <code>api.pagerduty.com</code> (or your <code>PAGERDUTY_API_BASE_URL</code> host) in <code>hosting.egressDomains</code>, the same entry write-backs need.</p><p>A read-only agent with no token sets the id directly:</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;">bdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> secrets</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> set</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> incident-responder</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> PAGERDUTY_USER_ID</span></span></code></pre></div><p><code>PAGERDUTY_USER_ID</code> holds one id because a deployment has one token and so acts as one PagerDuty user. To skip several users, or to keep the id in code, pass <code>selfUserIds</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:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> pagerdutyChannel</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
44
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">},</span></span></code></pre></div><p>Add these to the same <code>pagerdutyChannel()</code> declaration as the investigation handler.</p><h2 id="ignore-your-own-actions" tabindex="-1">Ignore your own actions <a class="header-anchor" href="#ignore-your-own-actions" aria-label="Permalink to &quot;Ignore your own actions&quot;">​</a></h2><p>PagerDuty sends the agent&#39;s own changes back as webhook events: the note it posted, or an acknowledgement or resolve made through its PagerDuty user. The channel acknowledges those events without running a hook or starting a turn. The same action by a person is still delivered.</p><p>The channel finds the agent&#39;s user in this order, on each delivery:</p><ol><li>The <code>selfUserIds</code> option, when you pass one. Nothing below is used.</li><li>The <code>PAGERDUTY_USER_ID</code> secret: one PagerDuty user id.</li><li>The user <code>PAGERDUTY_TOKEN</code> acts as, which PagerDuty reports at <code>GET /users/me</code>.</li></ol><p>When none of these names a user, echo skip is off. <code>agent-sdk deploy</code> warns while neither <code>PAGERDUTY_USER_ID</code> nor <code>PAGERDUTY_TOKEN</code> is set, and the agent logs a warning when its token names no single user.</p><p>Inference depends on the kind of token:</p><table tabindex="0"><thead><tr><th><code>PAGERDUTY_TOKEN</code></th><th>Inferred user</th></tr></thead><tbody><tr><td>User token REST API key</td><td>The key&#39;s own user</td></tr><tr><td>OAuth user token (Classic User OAuth or Scoped OAuth), written as <code>Bearer &lt;token&gt;</code></td><td>The user who authorized the app</td></tr><tr><td>General access (account-level) REST API key</td><td>The user whose email is exactly <code>PAGERDUTY_FROM_EMAIL</code>, if set</td></tr><tr><td>Scoped OAuth app token (client credentials)</td><td>The user whose email is exactly <code>PAGERDUTY_FROM_EMAIL</code>, if set</td></tr></tbody></table><p>PagerDuty serves <a href="https://developer.pagerduty.com/api-reference/0b6f8b0c3e8d1-get-the-current-user" target="_blank" rel="noreferrer"><code>GET /users/me</code></a> only to a user-level API key or a token from an OAuth flow, not to an account-level key. An app token <a href="https://docs.pagerduty.com/developer/private-apps" target="_blank" rel="noreferrer">acts as the app</a>, not as a user. With either, the channel looks up <code>PAGERDUTY_FROM_EMAIL</code>, the <code>From</code> user the token writes as, through <code>GET /users?query=</code> and uses the one user whose email matches exactly. The inferred id is kept in the agent&#39;s memory for an hour per token, never in agent storage, and an unresolved answer is retried after five minutes. Hosted, the lookup needs <code>api.pagerduty.com</code> (or your <code>PAGERDUTY_API_BASE_URL</code> host) in <code>hosting.egressDomains</code>, the same entry write-backs need.</p><p>A read-only agent with no token sets the id directly:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agent-sdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> secret</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> set</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> incident-responder</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> PAGERDUTY_USER_ID</span></span></code></pre></div><p><code>PAGERDUTY_USER_ID</code> holds one id because a deployment has one token and so acts as one PagerDuty user. To skip several users, or to keep the id in code, pass <code>selfUserIds</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:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> pagerdutyChannel</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
45
45
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> selfUserIds: [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;PBOT001&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">],</span></span>
46
46
  <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> onIncident</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: (</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">ctx</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;"> ({ auth: </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">defaultPagerDutyAuth</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(ctx) }),</span></span>
47
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p><code>selfUserIds: { secretName: &quot;OTHER_NAME&quot; }</code> reads one id from another secret and never falls back to inference.</p><h2 id="events" tabindex="-1">Events <a class="header-anchor" href="#events" aria-label="Permalink to &quot;Events&quot;">​</a></h2><p>Each hook receives one family of v3 events:</p><table tabindex="0"><thead><tr><th>Hook</th><th>Events</th></tr></thead><tbody><tr><td><code>onIncident</code></td><td><code>incident.triggered</code>, <code>.acknowledged</code>, <code>.unacknowledged</code>, <code>.escalated</code>, <code>.reassigned</code>, <code>.delegated</code>, <code>.resolved</code>, <code>.reopened</code>, <code>.priority_updated</code>, <code>.incident_type.changed</code></td></tr><tr><td><code>onNote</code></td><td><code>incident.annotated</code></td></tr><tr><td><code>onResponder</code></td><td><code>incident.responder.added</code>, <code>incident.responder.replied</code></td></tr><tr><td><code>onEvent</code></td><td>Everything else, such as status updates and workflow events</td></tr></tbody></table><p>Without <code>onIncident</code>, a triggered or reopened incident starts a turn and other lifecycle events are acknowledged. Notes, responder events, and the rest are acknowledged until you add their hook. Each hook returns one of three decisions:</p><table tabindex="0"><thead><tr><th>Return</th><th>What happens</th></tr></thead><tbody><tr><td><code>{ auth }</code></td><td>Start or continue a model turn as the event&#39;s actor</td></tr><tr><td><code>{ task }</code></td><td>Acknowledge the webhook, then run host code that may also call <code>send</code></td></tr><tr><td><code>null</code></td><td>Skip the event</td></tr></tbody></table><h2 id="incident-affinity" tabindex="-1">Incident affinity <a class="header-anchor" href="#incident-affinity" aria-label="Permalink to &quot;Incident affinity&quot;">​</a></h2><p>Every event for one incident joins one session, keyed on the incident id. Lifecycle events carry the incident, and notes and responder events name it by reference, so all of them reach the same session.</p><p>A re-trigger after a resolve is a new PagerDuty incident, so it starts a new session. <code>ctx.incidentKey</code> carries the dedup key of the alert that opened an incident (its <code>incident_key</code>, set per alert by a Datadog monitor, a Sentry issue, or a Grafana rule), for an agent that wants to recall what it found the last time the same alert fired.</p><h2 id="connect" tabindex="-1">Connect <a class="header-anchor" href="#connect" aria-label="Permalink to &quot;Connect&quot;">​</a></h2><p>Create a v3 webhook subscription in PagerDuty for the services that should wake the agent, and point it at <code>https://&lt;your-host&gt;/&lt;slug&gt;/v1/channels/pagerduty</code>. Then set the channel&#39;s secrets on the deployment. Locally the same names are environment variables.</p><table tabindex="0"><thead><tr><th>Variable</th><th>Used for</th><th>Override</th></tr></thead><tbody><tr><td><code>PAGERDUTY_WEBHOOK_SECRET</code></td><td>Verifying <code>X-PagerDuty-Signature</code>. Hosted, the platform checks it before any compute starts and answers a bad delivery with <code>401</code></td><td><code>webhookSecret: { secretName }</code></td></tr><tr><td><code>PAGERDUTY_USER_ID</code></td><td>Skipping the agent&#39;s own actions: its PagerDuty user id. Optional when <code>PAGERDUTY_TOKEN</code> names a user</td><td><code>selfUserIds: [ids]</code> or <code>{ secretName }</code></td></tr><tr><td><code>PAGERDUTY_TOKEN</code></td><td>Reply notes (with <code>deliverReplies: true</code>), <code>ctx.pagerduty</code>, and inferring the agent&#39;s user: a REST API key, or an OAuth token as <code>Bearer &lt;token&gt;</code></td><td><code>token: { secretName }</code></td></tr><tr><td><code>PAGERDUTY_FROM_EMAIL</code></td><td>The <code>From</code> user PagerDuty requires for writes made with an account-level key or app token, and the user inferred for those tokens</td><td><code>from: { secretName }</code></td></tr><tr><td><code>PAGERDUTY_API_BASE_URL</code></td><td>The REST host, such as <code>https://api.eu.pagerduty.com</code>. Defaults to <code>https://api.pagerduty.com</code></td><td><code>apiBaseUrl</code></td></tr></tbody></table><p>Set <code>token</code>, <code>from</code>, and <code>apiBaseUrl</code> on <code>pagerdutyChannel()</code>; they cover reply notes, <code>ctx.pagerduty</code>, and inference. <code>createPagerDutyClient()</code> takes the same options for code outside the channel.</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;">bdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> deploy</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --dir</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --slug</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> incident-responder</span></span>
48
- <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">bdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> secrets</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> set</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> incident-responder</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> PAGERDUTY_WEBHOOK_SECRET</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> PAGERDUTY_TOKEN</span></span>
49
- <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">bdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> secrets</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> list</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> incident-responder</span></span></code></pre></div><p><code>bdk deploy</code> warns until <code>PAGERDUTY_WEBHOOK_SECRET</code> is set, and until either <code>PAGERDUTY_USER_ID</code> or <code>PAGERDUTY_TOKEN</code> is. The next delivery uses a new value without another deploy.</p><h3 id="several-subscriptions" tabindex="-1">Several subscriptions <a class="header-anchor" href="#several-subscriptions" aria-label="Permalink to &quot;Several subscriptions&quot;">​</a></h3><p>PagerDuty gives each webhook subscription its own signing secret, so an agent fed by several subscriptions (one per service, say) needs all of them. Put them in <code>PAGERDUTY_WEBHOOK_SECRET</code>, one per line:</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>&lt;signing secret of subscription 1&gt;</span></span>
50
- <span class="line"><span>&lt;signing secret of subscription 2&gt;</span></span></code></pre></div><p>A delivery is admitted when any <code>v1=</code> signature in its <code>X-PagerDuty-Signature</code> header matches any line. Each line is trimmed, blank lines are ignored, and a value without a line break is one secret, used as-is. The value holds at most 32 secrets. Past that, every delivery is rejected rather than checked against only some of them.</p><p>Keep the list in a file, since <code>bdk secrets list</code> never shows values, and set it from stdin, which keeps the line breaks:</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;">bdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> secrets</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> set</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> incident-responder</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> PAGERDUTY_WEBHOOK_SECRET</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> &lt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> pagerduty-webhook-secrets.txt</span></span></code></pre></div><p>Rotate by adding before removing. Add the new secret as a line before PagerDuty starts signing with it, for example before creating the replacement subscription. Remove the old line only once nothing signs with the old secret, for example after deleting the subscription it replaced. While both are live, a delivery signed with either secret verifies, including one whose header carries both signatures. Removing the old line first rejects those deliveries until the new one is added.</p><p>The same format works for every <code>hmacSignatureAuth()</code> secret, including <code>GITHUB_WEBHOOK_SECRET</code> and <code>BITBUCKET_WEBHOOK_SECRET</code>. It needs <code>@cursor/bdk</code> 0.2.25 or later. Earlier versions check the signature again in the agent with the whole value as one secret, so they reject every delivery once the value has a second line.</p><p>Only signature checks read the value as a list. Everywhere else it is used whole: a <code>sharedSecretAuth()</code> header compares the entire value, and a <code>\${NAME}</code> template in an MCP connection&#39;s <code>headers</code> would put the line breaks into the header. Keep a list secret for webhook signing only.</p><p>Until <code>PAGERDUTY_WEBHOOK_SECRET</code> is set, the route accepts only local traffic: loopback deliveries under <code>bdk dev</code>, nothing in production.</p><h2 id="test-locally" tabindex="-1">Test locally <a class="header-anchor" href="#test-locally" aria-label="Permalink to &quot;Test locally&quot;">​</a></h2><p><code>bdk pagerduty replay</code> posts synthesized v3 deliveries for one incident to the running agent, in order. With <code>PAGERDUTY_WEBHOOK_SECRET</code> unset, <code>bdk dev</code> admits them unsigned from loopback; with it set, replay signs them the way PagerDuty does:</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;">bdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> dev</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &amp;</span></span>
51
- <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">bdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> pagerduty</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> replay</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --events</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> triggered,acknowledged,annotated,resolved</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
52
- <span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --comment</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;Rolled back the 09:30 deploy.&quot;</span></span></code></pre></div><p>The trigger comes from PagerDuty itself, and the later events come from a person, so each one joins the session the trigger started. Pass an incident id to start another session, <code>--dry-run</code> to print the bodies, or <code>--out fixtures/pagerduty</code> to save them as fixtures for <a href="./../evals.html">evals</a>. <code>bdk pagerduty events</code> lists the channels and the events each accepts.</p><p>To post a real delivery saved from the webhook&#39;s delivery log, sign it with the secret:</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:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> PAGERDUTY_WEBHOOK_SECRET</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">local-test-secret</span></span>
53
- <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">bdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> dev</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &amp;</span></span>
47
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p><code>selfUserIds: { secretName: &quot;OTHER_NAME&quot; }</code> reads one id from another secret and never falls back to inference.</p><h2 id="events" tabindex="-1">Events <a class="header-anchor" href="#events" aria-label="Permalink to &quot;Events&quot;">​</a></h2><p>Each hook receives one family of v3 events:</p><table tabindex="0"><thead><tr><th>Hook</th><th>Events</th></tr></thead><tbody><tr><td><code>onIncident</code></td><td><code>incident.triggered</code>, <code>.acknowledged</code>, <code>.unacknowledged</code>, <code>.escalated</code>, <code>.reassigned</code>, <code>.delegated</code>, <code>.resolved</code>, <code>.reopened</code>, <code>.priority_updated</code>, <code>.incident_type.changed</code></td></tr><tr><td><code>onNote</code></td><td><code>incident.annotated</code></td></tr><tr><td><code>onResponder</code></td><td><code>incident.responder.added</code>, <code>incident.responder.replied</code></td></tr><tr><td><code>onEvent</code></td><td>Everything else, such as status updates and workflow events</td></tr></tbody></table><p>Without <code>onIncident</code>, a triggered or reopened incident starts a turn and other lifecycle events are acknowledged. Notes, responder events, and the rest are acknowledged until you add their hook. Each hook returns one of three decisions:</p><table tabindex="0"><thead><tr><th>Return</th><th>What happens</th></tr></thead><tbody><tr><td><code>{ auth }</code></td><td>Start or continue a model turn as the event&#39;s actor</td></tr><tr><td><code>{ task }</code></td><td>Acknowledge the webhook, then run host code that may also call <code>send</code></td></tr><tr><td><code>null</code></td><td>Skip the event</td></tr></tbody></table><h2 id="incident-affinity" tabindex="-1">Incident affinity <a class="header-anchor" href="#incident-affinity" aria-label="Permalink to &quot;Incident affinity&quot;">​</a></h2><p>Every event for one incident joins one session, keyed on the incident id. Lifecycle events carry the incident, and notes and responder events name it by reference, so all of them reach the same session.</p><p>A re-trigger after a resolve is a new PagerDuty incident, so it starts a new session. <code>ctx.incidentKey</code> carries the dedup key of the alert that opened an incident (its <code>incident_key</code>, set per alert by a Datadog monitor, a Sentry issue, or a Grafana rule), for an agent that wants to recall what it found the last time the same alert fired.</p><h2 id="connect" tabindex="-1">Connect <a class="header-anchor" href="#connect" aria-label="Permalink to &quot;Connect&quot;">​</a></h2><p>Create a v3 webhook subscription in PagerDuty for the services that should wake the agent, and point it at <code>https://&lt;your-host&gt;/&lt;slug&gt;/v1/channels/pagerduty</code>. Then set the channel&#39;s secrets on the deployment. Locally the same names are environment variables.</p><table tabindex="0"><thead><tr><th>Variable</th><th>Used for</th><th>Override</th></tr></thead><tbody><tr><td><code>PAGERDUTY_WEBHOOK_SECRET</code></td><td>Verifying <code>X-PagerDuty-Signature</code>. Hosted, the platform checks it before any compute starts and answers a bad delivery with <code>401</code></td><td><code>webhookSecret: { secretName }</code></td></tr><tr><td><code>PAGERDUTY_USER_ID</code></td><td>Skipping the agent&#39;s own actions: its PagerDuty user id. Optional when <code>PAGERDUTY_TOKEN</code> names a user</td><td><code>selfUserIds: [ids]</code> or <code>{ secretName }</code></td></tr><tr><td><code>PAGERDUTY_TOKEN</code></td><td>Reply notes (with <code>deliverReplies: true</code>), <code>ctx.pagerduty</code>, and inferring the agent&#39;s user: a REST API key, or an OAuth token as <code>Bearer &lt;token&gt;</code></td><td><code>token: { secretName }</code></td></tr><tr><td><code>PAGERDUTY_FROM_EMAIL</code></td><td>The <code>From</code> user PagerDuty requires for writes made with an account-level key or app token, and the user inferred for those tokens</td><td><code>from: { secretName }</code></td></tr><tr><td><code>PAGERDUTY_API_BASE_URL</code></td><td>The REST host, such as <code>https://api.eu.pagerduty.com</code>. Defaults to <code>https://api.pagerduty.com</code></td><td><code>apiBaseUrl</code></td></tr></tbody></table><p>Set <code>token</code>, <code>from</code>, and <code>apiBaseUrl</code> on <code>pagerdutyChannel()</code>; they cover reply notes, <code>ctx.pagerduty</code>, and inference. <code>createPagerDutyClient()</code> takes the same options for code outside the channel.</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agent-sdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> deploy</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --dir</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --slug</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> incident-responder</span></span>
48
+ <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agent-sdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> secret</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> set</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> incident-responder</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> PAGERDUTY_WEBHOOK_SECRET</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> PAGERDUTY_TOKEN</span></span>
49
+ <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agent-sdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> secret</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> list</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> incident-responder</span></span></code></pre></div><p><code>agent-sdk deploy</code> warns until <code>PAGERDUTY_WEBHOOK_SECRET</code> is set, and until either <code>PAGERDUTY_USER_ID</code> or <code>PAGERDUTY_TOKEN</code> is. The next delivery uses a new value without another deploy.</p><h3 id="several-subscriptions" tabindex="-1">Several subscriptions <a class="header-anchor" href="#several-subscriptions" aria-label="Permalink to &quot;Several subscriptions&quot;">​</a></h3><p>PagerDuty gives each webhook subscription its own signing secret, so an agent fed by several subscriptions (one per service, say) needs all of them. Put them in <code>PAGERDUTY_WEBHOOK_SECRET</code>, one per line:</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>&lt;signing secret of subscription 1&gt;</span></span>
50
+ <span class="line"><span>&lt;signing secret of subscription 2&gt;</span></span></code></pre></div><p>A delivery is admitted when any <code>v1=</code> signature in its <code>X-PagerDuty-Signature</code> header matches any line. Each line is trimmed, blank lines are ignored, and a value without a line break is one secret, used as-is. The value holds at most 32 secrets. Past that, every delivery is rejected rather than checked against only some of them.</p><p>Keep the list in a file, since <code>agent-sdk secret list</code> never shows values, and set it from stdin, which keeps the line breaks:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agent-sdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> secret</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> set</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> incident-responder</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> PAGERDUTY_WEBHOOK_SECRET</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> &lt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> pagerduty-webhook-secrets.txt</span></span></code></pre></div><p>Rotate by adding before removing. Add the new secret as a line before PagerDuty starts signing with it, for example before creating the replacement subscription. Remove the old line only once nothing signs with the old secret, for example after deleting the subscription it replaced. While both are live, a delivery signed with either secret verifies, including one whose header carries both signatures. Removing the old line first rejects those deliveries until the new one is added.</p><p>The same format works for every <code>hmacSignatureAuth()</code> secret, including <code>GITHUB_WEBHOOK_SECRET</code> and <code>BITBUCKET_WEBHOOK_SECRET</code>. It needs <code>@grok/agent-sdk</code> 0.2.25 or later. Earlier versions check the signature again in the agent with the whole value as one secret, so they reject every delivery once the value has a second line.</p><p>Only signature checks read the value as a list. Everywhere else it is used whole: a <code>sharedSecretAuth()</code> header compares the entire value, and a <code>\${NAME}</code> template in an MCP connection&#39;s <code>headers</code> would put the line breaks into the header. Keep a list secret for webhook signing only.</p><p>Until <code>PAGERDUTY_WEBHOOK_SECRET</code> is set, the route accepts only local traffic: loopback deliveries under <code>agent-sdk dev</code>, nothing in production.</p><h2 id="test-locally" tabindex="-1">Test locally <a class="header-anchor" href="#test-locally" aria-label="Permalink to &quot;Test locally&quot;">​</a></h2><p><code>agent-sdk pagerduty replay</code> posts synthesized v3 deliveries for one incident to the running agent, in order. With <code>PAGERDUTY_WEBHOOK_SECRET</code> unset, <code>agent-sdk dev</code> admits them unsigned from loopback; with it set, replay signs them the way PagerDuty does:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agent-sdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> dev</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &amp;</span></span>
51
+ <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agent-sdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> pagerduty</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> replay</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --events</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> triggered,acknowledged,annotated,resolved</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
52
+ <span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --comment</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;Rolled back the 09:30 deploy.&quot;</span></span></code></pre></div><p>The trigger comes from PagerDuty itself, and the later events come from a person, so each one joins the session the trigger started. Pass an incident id to start another session, <code>--dry-run</code> to print the bodies, or <code>--out fixtures/pagerduty</code> to save them as fixtures for <a href="./../evals.html">evals</a>. <code>agent-sdk pagerduty events</code> lists the channels and the events each accepts.</p><p>To post a real delivery saved from the webhook&#39;s delivery log, sign it with the secret:</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:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> PAGERDUTY_WEBHOOK_SECRET</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">local-test-secret</span></span>
53
+ <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agent-sdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> dev</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &amp;</span></span>
54
54
  <span class="line"></span>
55
55
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">body</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">fixtures/pagerduty/incident-triggered.json</span></span>
56
56
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">signature</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">$(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">openssl</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> dgst</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -sha256</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -hmac</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">$PAGERDUTY_WEBHOOK_SECRET</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -hex</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> &lt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">$body</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> awk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &#39;{print $NF}&#39;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span>
@@ -1,5 +1,5 @@
1
- import{_ as a,c as i,o as e,a3 as t}from"./chunks/framework.BNw1pucY.js";const c=JSON.parse('{"title":"Slack","description":"Wake your agent from mentions, DMs, and watched posts, then reply in the thread.","frontmatter":{"title":"Slack","description":"Wake your agent from mentions, DMs, and watched posts, then reply in the thread."},"headers":[],"relativePath":"guides/slack.md","filePath":"guides/slack.md"}'),n={name:"guides/slack.md"};function l(h,s,p,o,k,d){return e(),i("div",null,[...s[0]||(s[0]=[t(`<h1 id="slack-agents" tabindex="-1">Slack agents <a class="header-anchor" href="#slack-agents" aria-label="Permalink to &quot;Slack agents&quot;">​</a></h1><p>A Slack agent wakes when someone mentions it, sends it a DM, or posts in a channel it watches. From there, it keeps the conversation in one thread and can reply all at once, stream the answer live, or decide for itself when to post updates.</p><p>Run <code>bdk slack create --dir .</code>, then <code>bdk slack doctor</code>.</p><h2 id="answer-a-mention-or-dm" tabindex="-1">Answer a mention or DM <a class="header-anchor" href="#answer-a-mention-or-dm" aria-label="Permalink to &quot;Answer a mention or DM&quot;">​</a></h2><p>Mention the bot in a channel or send it a DM, and it will answer in a thread on that message. Any follow-up in the same thread continues the conversation where it left off.</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/channels/slack.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;"> { slackChannel } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;@cursor/bdk/channels/slack&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
1
+ import{_ as a,c as i,o as e,a3 as t}from"./chunks/framework.BNw1pucY.js";const c=JSON.parse('{"title":"Slack","description":"Wake your agent from mentions, DMs, and watched posts, then reply in the thread.","frontmatter":{"title":"Slack","description":"Wake your agent from mentions, DMs, and watched posts, then reply in the thread."},"headers":[],"relativePath":"guides/slack.md","filePath":"guides/slack.md"}'),n={name:"guides/slack.md"};function l(h,s,p,o,d,k){return e(),i("div",null,[...s[0]||(s[0]=[t(`<h1 id="slack-agents" tabindex="-1">Slack agents <a class="header-anchor" href="#slack-agents" aria-label="Permalink to &quot;Slack agents&quot;">​</a></h1><p>A Slack agent wakes when someone mentions it, sends it a DM, or posts in a channel it watches. From there, it keeps the conversation in one thread and can reply all at once, stream the answer live, or decide for itself when to post updates.</p><p>Run <code>agent-sdk slack create --dir .</code>, then <code>agent-sdk slack doctor</code>.</p><h2 id="answer-a-mention-or-dm" tabindex="-1">Answer a mention or DM <a class="header-anchor" href="#answer-a-mention-or-dm" aria-label="Permalink to &quot;Answer a mention or DM&quot;">​</a></h2><p>Mention the bot in a channel or send it a DM, and it will answer in a thread on that message. Any follow-up in the same thread continues the conversation where it left off.</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/channels/slack.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;"> { slackChannel } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;@grok/agent-sdk/channels/slack&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
3
3
  <span class="line"></span>
4
4
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> slackChannel</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
5
5
  <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // TRIAGE_SLACK_BOT_TOKEN and TRIAGE_SLACK_APP_TOKEN</span></span>
@@ -24,7 +24,7 @@ import{_ as a,c as i,o as e,a3 as t}from"./chunks/framework.BNw1pucY.js";const c
24
24
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> toolCards: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
25
25
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
26
26
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><h2 id="let-the-agent-own-every-message" tabindex="-1">Let the agent own every message <a class="header-anchor" href="#let-the-agent-own-every-message" aria-label="Permalink to &quot;Let the agent own every message&quot;">​</a></h2><p>Use agentic mode when the agent should decide how to communicate, not only what to say. The bot reacts to the parent message with eyes and shows a thinking chip, then the agent chooses when to post progress and how to deliver the final reply.</p><p><code>slack-communication</code> gives those posts a Slack-aware voice by default: lead with the result, share progress when the picture changes, and keep tool chatter off the thread. Use <code>tone</code> for the rest of the communication contract, including voice, level of detail, formatting, and how updates should be structured.</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/extensions/slack.ts</span></span>
27
- <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> slackCommunication </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;@cursor/bdk/extensions/slack-communication&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
27
+ <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> slackCommunication </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;@grok/agent-sdk/extensions/slack-communication&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
28
28
  <span class="line"></span>
29
29
  <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;"> slackCommunication</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
30
30
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> tone:</span></span>
@@ -63,13 +63,26 @@ import{_ as a,c as i,o as e,a3 as t}from"./chunks/framework.BNw1pucY.js";const c
63
63
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
64
64
  <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // \`{}\` starts a model turn as the sender.</span></span>
65
65
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {};</span></span>
66
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">},</span></span></code></pre></div><h2 id="thread-affinity" tabindex="-1">Thread affinity <a class="header-anchor" href="#thread-affinity" aria-label="Permalink to &quot;Thread affinity&quot;">​</a></h2><p>A Slack thread maps to one agent session, so every follow-up in that thread resumes the same conversation.</p><h2 id="call-slack-from-deterministic-code-via-ctx" tabindex="-1">Call Slack from deterministic code via <code>ctx</code> <a class="header-anchor" href="#call-slack-from-deterministic-code-via-ctx" aria-label="Permalink to &quot;Call Slack from deterministic code via \`ctx\`&quot;">​</a></h2><p>Channel hooks can post before starting the model turn, which is useful for deterministic acknowledgements such as <code>Looking at this now.</code> The same bot credential also lets tools call Slack later in the turn:</p><ul><li><p>Channel hooks: <code>ctx.thread.post()</code>, <code>ctx.slack.channelId</code>, <code>ctx.slack.threadTs</code></p></li><li><p>Tools: <code>ctx.host.slack.getClient()</code></p></li></ul><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;">onAppMention</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;">ctx</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">message</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>
66
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">},</span></span></code></pre></div><h2 id="thread-affinity" tabindex="-1">Thread affinity <a class="header-anchor" href="#thread-affinity" aria-label="Permalink to &quot;Thread affinity&quot;">​</a></h2><p>Mention the bot in a channel and it answers in a thread on that message. Follow-ups in the same thread continue that session.</p><p>A direct message continues the one session for that DM, including replies under later top-level messages. To give each top-level DM its own session, and keep replies in that message&#39;s thread on it, set the continuation selector:</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;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> slackChannel</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
67
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> continuation: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;slack.dmthread/v2&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
68
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p>Under <code>slack.dmthread/v2</code>, a DM thread behaves like a channel thread: a reply loads the thread&#39;s history, the turn edits only its own placeholder, and an approval click must come from that thread.</p><p>Channel threads keep one session per thread with either selector. <code>slack.none/v2</code> starts a new session on every delivery.</p><h2 id="call-slack-from-deterministic-code-via-ctx" tabindex="-1">Call Slack from deterministic code via <code>ctx</code> <a class="header-anchor" href="#call-slack-from-deterministic-code-via-ctx" aria-label="Permalink to &quot;Call Slack from deterministic code via \`ctx\`&quot;">​</a></h2><p>Channel hooks can post before starting the model turn, which is useful for deterministic acknowledgements such as <code>Looking at this now.</code> The same bot credential also lets tools call Slack later in the turn:</p><ul><li><p>Channel hooks: <code>ctx.thread.post()</code>, <code>ctx.slack.channelId</code>, <code>ctx.slack.threadTs</code></p></li><li><p>Tools: <code>ctx.host.slack.getClient()</code></p></li></ul><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;">onAppMention</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;">ctx</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">message</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>
67
69
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (message.markdown.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">trim</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">===</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) {</span></span>
68
70
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> null</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
69
71
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
70
72
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> await</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ctx.thread.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">post</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;Looking at this now.&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">);</span></span>
71
73
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {};</span></span>
72
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">},</span></span></code></pre></div><p>Use the IDs on the hook <code>ctx</code> when handling an event, and <code>ctx.host.slack.getClient()</code> when a tool needs the Slack Web API.</p><h2 id="connect" tabindex="-1">Connect <a class="header-anchor" href="#connect" aria-label="Permalink to &quot;Connect&quot;">​</a></h2><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;">bdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> login</span></span>
73
- <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">bdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> slack</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> create</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --dir</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .</span></span>
74
- <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">bdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> slack</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> doctor</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --prefix</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> TRIAGE</span></span></code></pre></div><p>After you sign in, <code>slack create</code> opens <strong>Add Slack to this agent</strong> in the browser and writes the resulting tokens to <code>.env.local</code> without printing them. You can open the same wizard from <strong>Integrations</strong> on <a href="https://cursor.com/dashboard" target="_blank" rel="noreferrer">Deployed Agents</a>.</p><p>If Slack requires workspace-admin approval, keep <code>slack create</code> running and open the <strong>Request approval</strong> link printed by the CLI. Installing from the dashboard doesn&#39;t send that request for you. After an admin approves it, return to the dashboard&#39;s <strong>Add Slack</strong> wizard and select <strong>Retry</strong>.</p><p>If you already own the Slack app, initialize it with <code>bdk slack init --manual --dir . --name &quot;Triage&quot;</code> and follow the <a href="./../../skills/setup-slack/SKILL.html">Slack setup skill</a> for installation and tokens.</p><h2 id="test-locally" tabindex="-1">Test locally <a class="header-anchor" href="#test-locally" aria-label="Permalink to &quot;Test locally&quot;">​</a></h2><p>Run <code>doctor</code> first to catch missing credentials, then start the agent and send it the same mention or DM a teammate would.</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;">bdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> slack</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> doctor</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --prefix</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> TRIAGE</span></span>
75
- <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">bdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> serve</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --dir</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --dev</span></span></code></pre></div><h2 id="practices" tabindex="-1">Practices <a class="header-anchor" href="#practices" aria-label="Permalink to &quot;Practices&quot;">​</a></h2><ul><li><p>If the tokens are missing, the Slack channel stays idle while the rest of <code>serve</code> starts normally.</p></li><li><p>Keep <code>channelPosts.allow</code> narrow because each qualifying post can start a model turn.</p></li><li><p>Set <code>envPrefix</code> when two Slack bots share a host so the token names do not collide.</p></li></ul><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="./../reference/cli.html#slack">CLI reference</a>: <code>slack create</code>, <code>doctor</code>, <code>init --manual</code></li><li><a href="./../../skills/setup-slack/SKILL.html"><code>skills/setup-slack/SKILL.md</code></a>: the companion skill for coding agents</li><li><a href="./webhooks.html">Webhooks and custom channels</a>: host prep on mention and DM handlers</li><li><a href="./../evals.html">Evals</a>: freeze a mention as a regression check</li></ul>`,61)])])}const E=a(n,[["render",l]]);export{c as __pageData,E as default};
74
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">},</span></span></code></pre></div><p>Use the IDs on the hook <code>ctx</code> when handling an event, and <code>ctx.host.slack.getClient()</code> when a tool needs the Slack Web API.</p><h2 id="connect" tabindex="-1">Connect <a class="header-anchor" href="#connect" aria-label="Permalink to &quot;Connect&quot;">​</a></h2><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agent-sdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> login</span></span>
75
+ <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agent-sdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> slack</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> create</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --dir</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .</span></span>
76
+ <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agent-sdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> slack</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> doctor</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --prefix</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> TRIAGE</span></span></code></pre></div><p>After you sign in, <code>slack create</code> opens <strong>Add Slack to this agent</strong> in the browser and writes the resulting tokens to <code>.env.local</code> without printing them. You can open the same wizard from <strong>Integrations</strong> on <a href="https://cursor.com/dashboard" target="_blank" rel="noreferrer">Deployed Agents</a>.</p><p>If Slack requires workspace-admin approval, keep <code>slack create</code> running and open the <strong>Request approval</strong> link printed by the CLI. Installing from the dashboard doesn&#39;t send that request for you. After an admin approves it, return to the dashboard&#39;s <strong>Add Slack</strong> wizard and select <strong>Retry</strong>.</p><h3 id="choose-the-bot-scopes" tabindex="-1">Choose the bot scopes <a class="header-anchor" href="#choose-the-bot-scopes" aria-label="Permalink to &quot;Choose the bot scopes&quot;">​</a></h3><p>A Cursor-managed app requests these bot scopes by default:</p><p><code>app_mentions:read</code>, <code>assistant:write</code>, <code>channels:history</code>, <code>channels:read</code>, <code>chat:write</code>, <code>files:read</code>, <code>files:write</code>, <code>groups:history</code>, <code>groups:read</code>, <code>im:history</code>, <code>im:read</code>, <code>im:write</code>, <code>mpim:history</code>, <code>reactions:read</code>, <code>reactions:write</code>, <code>usergroups:read</code>, <code>users:read</code>, <code>users:read.email</code></p><p>To request a different list, set <code>botScopes</code> in <code>slack-manifest.json</code> at the root of the agent project. The app then requests exactly that list:</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>
77
+ <span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> &quot;botScopes&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: [</span></span>
78
+ <span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;app_mentions:read&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
79
+ <span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;assistant:write&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
80
+ <span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;channels:history&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
81
+ <span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;chat:write&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
82
+ <span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;groups:history&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
83
+ <span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;im:history&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
84
+ <span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;reactions:read&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
85
+ <span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;pins:read&quot;</span></span>
86
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ]</span></span>
87
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>Then run <code>agent-sdk slack create</code> again (add <code>--env prod</code> for the production app). The CLI shows the list before it opens the browser. Slack updates the app and installs it again. If the workspace requires admin approval, the approval request lists every scope the app requests.</p><ul><li>The list must include the required scopes: <code>app_mentions:read</code>, <code>assistant:write</code>, <code>channels:history</code>, <code>chat:write</code>, <code>groups:history</code>, <code>im:history</code>, and <code>reactions:read</code>. The Slack channel needs them to receive mentions, DMs, channel posts, and reactions, and to reply.</li><li>If you remove a default scope, the features that use it stop working. For example, file uploads need <code>files:write</code>.</li><li>Use bot scopes only, at most 50. User scopes are not supported.</li><li>Cursor rejects scopes in the Slack Marketplace forbidden families: <code>admin.*</code>, <code>identity.*</code>, <code>search:read*</code>, <code>triggers:*</code>, <code>apps_configuration:*</code>, and <code>workflow.steps:execute</code>.</li><li>Without <code>botScopes</code>, the app requests the default list plus any other scopes it already has. To remove a scope you added, list the scopes you want and run <code>agent-sdk slack create</code> again.</li></ul><p>The person who runs <code>agent-sdk slack create</code> also grants Cursor three user scopes in their own Slack account: <code>app_configurations:read</code>, <code>app_configurations:write</code>, and <code>managed_apps:install</code>. Cursor uses them to create, update, and install the agent&#39;s app. They are not scopes of the agent&#39;s app, and <code>botScopes</code> does not change them.</p><p>If you already own the Slack app, initialize it with <code>agent-sdk slack init --manual --dir . --name &quot;Triage&quot;</code> and follow the <a href="./../../skills/setup-slack/SKILL.html">Slack setup skill</a> for installation and tokens.</p><h2 id="test-locally" tabindex="-1">Test locally <a class="header-anchor" href="#test-locally" aria-label="Permalink to &quot;Test locally&quot;">​</a></h2><p>Run <code>doctor</code> first to catch missing credentials, then start the agent and send it the same mention or DM a teammate would.</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agent-sdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> slack</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> doctor</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --prefix</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> TRIAGE</span></span>
88
+ <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agent-sdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> serve</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --dir</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --dev</span></span></code></pre></div><h2 id="practices" tabindex="-1">Practices <a class="header-anchor" href="#practices" aria-label="Permalink to &quot;Practices&quot;">​</a></h2><ul><li><p>If the tokens are missing, the Slack channel stays idle while the rest of <code>serve</code> starts normally.</p></li><li><p>Keep <code>channelPosts.allow</code> narrow because each qualifying post can start a model turn.</p></li><li><p>Set <code>envPrefix</code> when two Slack bots share a host so the token names do not collide.</p></li></ul><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="./../reference/cli.html#slack">CLI reference</a>: <code>slack create</code>, <code>doctor</code>, <code>init --manual</code></li><li><a href="./../../skills/setup-slack/SKILL.html"><code>skills/setup-slack/SKILL.md</code></a>: the companion skill for coding agents</li><li><a href="./webhooks.html">Webhooks and custom channels</a>: host prep on mention and DM handlers</li><li><a href="./../evals.html">Evals</a>: freeze a mention as a regression check</li></ul>`,73)])])}const E=a(n,[["render",l]]);export{c as __pageData,E as default};
@@ -1 +1 @@
1
- import{_ as a,c as i,o as e,a3 as t}from"./chunks/framework.BNw1pucY.js";const c=JSON.parse('{"title":"Slack","description":"Wake your agent from mentions, DMs, and watched posts, then reply in the thread.","frontmatter":{"title":"Slack","description":"Wake your agent from mentions, DMs, and watched posts, then reply in the thread."},"headers":[],"relativePath":"guides/slack.md","filePath":"guides/slack.md"}'),n={name:"guides/slack.md"};function l(h,s,p,o,k,d){return e(),i("div",null,[...s[0]||(s[0]=[t("",61)])])}const E=a(n,[["render",l]]);export{c as __pageData,E as default};
1
+ import{_ as a,c as i,o as e,a3 as t}from"./chunks/framework.BNw1pucY.js";const c=JSON.parse('{"title":"Slack","description":"Wake your agent from mentions, DMs, and watched posts, then reply in the thread.","frontmatter":{"title":"Slack","description":"Wake your agent from mentions, DMs, and watched posts, then reply in the thread."},"headers":[],"relativePath":"guides/slack.md","filePath":"guides/slack.md"}'),n={name:"guides/slack.md"};function l(h,s,p,o,d,k){return e(),i("div",null,[...s[0]||(s[0]=[t("",73)])])}const E=a(n,[["render",l]]);export{c as __pageData,E as default};
@@ -1,5 +1,5 @@
1
1
  import{_ as i,c as a,o as e,a3 as n}from"./chunks/framework.BNw1pucY.js";const E=JSON.parse('{"title":"Webhooks & custom channels","description":"Receive provider events, keep one conversation per domain object, and deliver agent replies back out.","frontmatter":{"title":"Webhooks & custom channels","description":"Receive provider events, keep one conversation per domain object, and deliver agent replies back out."},"headers":[],"relativePath":"guides/webhooks.md","filePath":"guides/webhooks.md"}'),t={name:"guides/webhooks.md"};function h(l,s,p,k,r,d){return e(),a("div",null,[...s[0]||(s[0]=[n(`<h1 id="webhook-agents" tabindex="-1">Webhook agents <a class="header-anchor" href="#webhook-agents" aria-label="Permalink to &quot;Webhook agents&quot;">​</a></h1><p>A custom channel turns an event from another system into an agent conversation, then sends the result back to the system that started it. Use one when the built-in <a href="./../reference/http-api.html">HTTP API</a> does not match the provider&#39;s payload, conversation key, or reply path.</p><p>Author <code>bot/channels/&lt;id&gt;.ts</code>. Its routes mount under <code>/&lt;slug&gt;/v1/channels/&lt;id&gt;</code>.</p><h2 id="receive-a-webhook-and-send-the-answer-back" tabindex="-1">Receive a webhook and send the answer back <a class="header-anchor" href="#receive-a-webhook-and-send-the-answer-back" aria-label="Permalink to &quot;Receive a webhook and send the answer back&quot;">​</a></h2><p>When a ticket system sends a new message, this endpoint responds with <code>202 Accepted</code> and an empty body right away. The agent keeps working after the HTTP request ends, and its completed answer appears as a comment on the ticket.</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/channels/tickets.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;"> { defineChannel, POST } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;@cursor/bdk/channels&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
2
+ <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { defineChannel, POST } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;@grok/agent-sdk/channels&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
3
3
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { z } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;zod&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
4
4
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { postTicketComment } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;../lib/tickets.js&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
5
5
  <span class="line"></span>
@@ -41,7 +41,11 @@ import{_ as i,c as a,o as e,a3 as n}from"./chunks/framework.BNw1pucY.js";const E
41
41
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> state: { ticketId: body.ticketId },</span></span>
42
42
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> title: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">\`Ticket \${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">body</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">.</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">ticketId</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">}\`</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
43
43
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> })</span></span>
44
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">);</span></span></code></pre></div><p>The channel owns this key. Callers only need to send the domain ID they already know.</p><h2 id="prepare-evidence-before-the-turn" tabindex="-1">Prepare evidence before the turn <a class="header-anchor" href="#prepare-evidence-before-the-turn" aria-label="Permalink to &quot;Prepare evidence before the turn&quot;">​</a></h2><p>Webhook payloads often contain little more than an object ID. This handler fetches the full ticket through a deterministic tool and writes the result to <code>ticket.json</code>, so the model begins with a stable snapshot instead of spending the turn looking for context.</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;">handler</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;">_request</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, { </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">callTool</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">send</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;">body</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>
44
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">);</span></span></code></pre></div><p>The channel owns this key. Callers only need to send the domain ID they already know.</p><h2 id="keep-one-hosted-session-per-thread" tabindex="-1">Keep one hosted session per thread <a class="header-anchor" href="#keep-one-hosted-session-per-thread" aria-label="Permalink to &quot;Keep one hosted session per thread&quot;">​</a></h2><p>On Cursor-managed hosting, the deployment picks the session for a custom-route request before your handler runs. By default, each request starts a new session, even when the handler passes the same <code>continuationToken</code>. To join requests, the sender adds the <code>X-BDK-Session-Key</code> header. Requests with the same value on one channel go to one session, and their turns run in the order the requests arrive.</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">curl</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -X</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> POST</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">$AGENT_ALIAS_URL</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">/v1/channels/tickets/ticket&quot;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
45
+ <span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -H</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;X-Agent-Alias-Token: </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">$AGENT_ALIAS_TOKEN</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
46
+ <span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -H</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;X-BDK-Session-Key: ticket:ENG-142&quot;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
47
+ <span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -H</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &#39;content-type: application/json&#39;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
48
+ <span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -d</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &#39;{&quot;ticketId&quot;:&quot;ENG-142&quot;,&quot;message&quot;:&quot;CSV export returns 500&quot;}&#39;</span></span></code></pre></div><p>Most webhook providers cannot set this header. Put a small relay in front of the deployment that reads the thread ID from the payload and forwards the request with the header.</p><p>The header has these rules:</p><ul><li>The route must admit the sender with the alias token or <code>sharedSecretAuth()</code>. If the route admits the sender with <code>hmacSignatureAuth()</code> or <code>publicEndpoint()</code>, hosting answers <code>400</code>. An HMAC signature covers the body and not the header, so a copy of one signed request could be sent again under a different key.</li><li>The value must be 1 to 256 printable ASCII characters, with no space and no comma. Hosting answers <code>400</code> for any other value, and no turn starts.</li><li>A key belongs to one channel on one deployment. The same value on a different channel or deployment starts a different session.</li><li>Only <code>defineChannel</code> routes read the header. Prebuilt channels, such as <code>githubChannel()</code>, keep their own conversation keys.</li><li>The handler still receives the header in <code>request.headers</code>.</li><li>Hosting stores the value with the request. Do not put secrets or personal data in it.</li><li>Local <code>agent-sdk serve</code> ignores the header. Keep the <code>continuationToken</code> in the handler, so local runs join requests the same way.</li></ul><p>Two limits apply:</p><ul><li>Hosting does not deduplicate requests. If the sender retries a request, the session runs a second turn.</li><li>A <a href="./../reference/schedules.html#reminders">reminder</a> that a keyed session sets fires in that session, but it can run at the same time as a turn from a request.</li></ul><h2 id="prepare-evidence-before-the-turn" tabindex="-1">Prepare evidence before the turn <a class="header-anchor" href="#prepare-evidence-before-the-turn" aria-label="Permalink to &quot;Prepare evidence before the turn&quot;">​</a></h2><p>Webhook payloads often contain little more than an object ID. This handler fetches the full ticket through a deterministic tool and writes the result to <code>ticket.json</code>, so the model begins with a stable snapshot instead of spending the turn looking for context.</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;">handler</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;">_request</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, { </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">callTool</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">send</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;">body</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>
45
49
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> prepared</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> await</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> callTool</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;prepare_ticket&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, {</span></span>
46
50
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ticketId: body.ticketId,</span></span>
47
51
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> });</span></span>
@@ -63,7 +67,7 @@ import{_ as i,c as a,o as e,a3 as n}from"./chunks/framework.BNw1pucY.js";const E
63
67
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> })</span></span>
64
68
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> );</span></span>
65
69
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> new</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Response</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">null</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, { status: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">202</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> });</span></span>
66
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">},</span></span></code></pre></div><p>The same <code>message.completed</code> handler from the first example delivers the answer back to the ticket. When preparation fails, the handler reports that on the ticket instead.</p><h2 id="routes-receive-events-deliver" tabindex="-1">Routes receive, events deliver <a class="header-anchor" href="#routes-receive-events-deliver" aria-label="Permalink to &quot;Routes receive, events deliver&quot;">​</a></h2><p>Routes own inbound HTTP. A route validates the request, decides whether to start or resume a turn, and acknowledges the caller with <code>202</code>. The channel&#39;s <code>events</code> handlers receive session events later, which is where you deliver the model&#39;s answer or report a failure to the originating system.</p><h2 id="validate-payloads-with-zod" tabindex="-1">Validate payloads with Zod <a class="header-anchor" href="#validate-payloads-with-zod" aria-label="Permalink to &quot;Validate payloads with Zod&quot;">​</a></h2><p><code>POST</code>, <code>PUT</code>, and <code>PATCH</code> routes require a Zod <code>bodySchema</code>; <code>GET</code> requires a <code>querySchema</code>. Validation runs before the handler, and the parsed value arrives as typed <code>body</code> or <code>query</code>. Use <code>z.unknown()</code> when the provider controls a variable payload and your own parser will narrow it.</p><p>The route description and schema also appear in <code>GET /v1/info</code>. The playground uses them to add a <strong>Try</strong> action and a matching slash command, so you can exercise the same handler without building a separate test UI.</p><h2 id="use-handler-context" tabindex="-1">Use handler context <a class="header-anchor" href="#use-handler-context" aria-label="Permalink to &quot;Use handler context&quot;">​</a></h2><p>The handler context keeps deterministic setup and model work in one route:</p><ul><li><p><code>send</code> starts or resumes the agent conversation.</p></li><li><p><code>callTool</code> runs an authored server tool without starting a model turn.</p></li><li><p><code>waitUntil</code> keeps background work alive after the handler returns. Await <code>send</code> when later handler code needs the session handle, such as calling <code>session.waitForCompletion()</code> before reporting the turn outcome to the provider.</p></li><li><p><code>host</code> provides authenticated services for API calls made by channel code.</p></li></ul><p>The full handler API lives in the <a href="./../reference/channels.html#handler-arguments">Channels reference</a>.</p><h2 id="protect-public-webhooks" tabindex="-1">Protect public webhooks <a class="header-anchor" href="#protect-public-webhooks" aria-label="Permalink to &quot;Protect public webhooks&quot;">​</a></h2><p>Custom routes accept direct loopback requests by default. They reject forwarded requests, so a tunnel or reverse proxy does not silently turn a local development endpoint into a public one.</p><p>Before accepting remote traffic, choose an explicit boundary. <code>bearerAuth()</code> works when the sender can attach an authorization header. On managed hosting, webhook providers often cannot attach the agent alias token, so <code>publicEndpoint()</code> lets that custom channel bypass it. That opens the route to every caller; verify the provider signature before starting a turn or calling a tool.</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;"> { defineChannel, POST, publicEndpoint } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;@cursor/bdk/channels&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
70
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">},</span></span></code></pre></div><p>The same <code>message.completed</code> handler from the first example delivers the answer back to the ticket. When preparation fails, the handler reports that on the ticket instead.</p><h2 id="routes-receive-events-deliver" tabindex="-1">Routes receive, events deliver <a class="header-anchor" href="#routes-receive-events-deliver" aria-label="Permalink to &quot;Routes receive, events deliver&quot;">​</a></h2><p>Routes own inbound HTTP. A route validates the request, decides whether to start or resume a turn, and acknowledges the caller with <code>202</code>. The channel&#39;s <code>events</code> handlers receive session events later, which is where you deliver the model&#39;s answer or report a failure to the originating system.</p><h2 id="validate-payloads-with-zod" tabindex="-1">Validate payloads with Zod <a class="header-anchor" href="#validate-payloads-with-zod" aria-label="Permalink to &quot;Validate payloads with Zod&quot;">​</a></h2><p><code>POST</code>, <code>PUT</code>, and <code>PATCH</code> routes require a Zod <code>bodySchema</code>; <code>GET</code> requires a <code>querySchema</code>. Validation runs before the handler, and the parsed value arrives as typed <code>body</code> or <code>query</code>. Use <code>z.unknown()</code> when the provider controls a variable payload and your own parser will narrow it.</p><p>The route description and schema also appear in <code>GET /v1/info</code>. The playground uses them to add a <strong>Try</strong> action and a matching slash command, so you can exercise the same handler without building a separate test UI.</p><h2 id="use-handler-context" tabindex="-1">Use handler context <a class="header-anchor" href="#use-handler-context" aria-label="Permalink to &quot;Use handler context&quot;">​</a></h2><p>The handler context keeps deterministic setup and model work in one route:</p><ul><li><p><code>send</code> starts or resumes the agent conversation.</p></li><li><p><code>callTool</code> runs an authored server tool without starting a model turn.</p></li><li><p><code>waitUntil</code> keeps background work alive after the handler returns. Await <code>send</code> when later handler code needs the session handle, such as calling <code>session.waitForCompletion()</code> before reporting the turn outcome to the provider.</p></li><li><p><code>host</code> provides authenticated services for API calls made by channel code.</p></li></ul><p>The full handler API lives in the <a href="./../reference/channels.html#handler-arguments">Channels reference</a>.</p><h2 id="protect-public-webhooks" tabindex="-1">Protect public webhooks <a class="header-anchor" href="#protect-public-webhooks" aria-label="Permalink to &quot;Protect public webhooks&quot;">​</a></h2><p>Custom routes accept direct loopback requests by default. They reject forwarded requests, so a tunnel or reverse proxy does not silently turn a local development endpoint into a public one.</p><p>Under <code>--dev</code>, a provider channel with no webhook secret (GitHub, GitLab, Bitbucket, PagerDuty, Origin) accepts a request only when the peer is loopback and the <code>Host</code> header is <code>localhost</code>, <code>127.x</code>, or <code>::1</code>. Local replays and <code>gh webhook forward</code> still work. A tunnel sends its public hostname, so the server refuses it. To receive deliveries through a tunnel, set the channel&#39;s webhook secret (for example <code>GITLAB_WEBHOOK_SECRET</code>) in the provider and in your shell before you start <code>agent-sdk dev</code>.</p><p>Before accepting remote traffic, choose an explicit boundary. <code>bearerAuth()</code> works when the sender can attach an authorization header. On managed hosting, webhook providers often cannot attach the agent alias token, so <code>publicEndpoint()</code> lets that custom channel bypass it. That opens the route to every caller; verify the provider signature before starting a turn or calling a tool.</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;"> { defineChannel, POST, publicEndpoint } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;@grok/agent-sdk/channels&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
67
71
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { z } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;zod&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
68
72
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { verifyProviderSignature } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;../lib/tickets.js&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
69
73
  <span class="line"></span>
@@ -85,9 +89,9 @@ import{_ as i,c as a,o as e,a3 as n}from"./chunks/framework.BNw1pucY.js";const E
85
89
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
86
90
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }),</span></span>
87
91
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ],</span></span>
88
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p>Because a hosted handler runs after the <code>202</code>, a delivery with a bad signature is dropped silently rather than rejected. When the provider sends a shared secret header or signs the raw body with HMAC-SHA256, use <code>sharedSecretAuth()</code> or <code>hmacSignatureAuth()</code> instead. Hosting checks those policies before the handler runs and answers a bad delivery with <code>401</code>.</p><p><code>publicEndpoint()</code> only opens this channel&#39;s routes. The built-in session and tool APIs stay private. See <a href="./../reference/channels.html#auth-policies">Auth policies</a> for bearer tokens and the complete policy reference.</p><h2 id="test-locally" tabindex="-1">Test locally <a class="header-anchor" href="#test-locally" aria-label="Permalink to &quot;Test locally&quot;">​</a></h2><p>Run the agent in development mode, then replay the same payload the provider will send. The route should answer <code>202</code> with an empty body right away, and the resulting session should appear in the playground while the reply is delivered.</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>bdk serve --dir . --dev</span></span>
92
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p>Because a hosted handler runs after the <code>202</code>, a delivery with a bad signature is dropped silently rather than rejected. When the provider sends a shared secret header or signs the raw body with HMAC-SHA256, use <code>sharedSecretAuth()</code> or <code>hmacSignatureAuth()</code> instead. Hosting checks those policies before the handler runs and answers a bad delivery with <code>401</code>.</p><p><code>publicEndpoint()</code> only opens this channel&#39;s routes. The built-in session and tool APIs stay private. See <a href="./../reference/channels.html#auth-policies">Auth policies</a> for bearer tokens and the complete policy reference.</p><h2 id="test-locally" tabindex="-1">Test locally <a class="header-anchor" href="#test-locally" aria-label="Permalink to &quot;Test locally&quot;">​</a></h2><p>Run the agent in development mode, then replay the same payload the provider will send. The route should answer <code>202</code> with an empty body right away, and the resulting session should appear in the playground while the reply is delivered.</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 serve --dir . --dev</span></span>
89
93
  <span class="line"><span></span></span>
90
94
  <span class="line"><span>curl -sS -X POST \\</span></span>
91
95
  <span class="line"><span> http://127.0.0.1:3000/&lt;slug&gt;/v1/channels/tickets/ticket \\</span></span>
92
96
  <span class="line"><span> -H &#39;content-type: application/json&#39; \\</span></span>
93
- <span class="line"><span> -d &#39;{&quot;ticketId&quot;:&quot;ENG-142&quot;,&quot;message&quot;:&quot;CSV export returns 500&quot;}&#39;</span></span></code></pre></div><p>Keep representative payloads under <code>fixtures/</code> and pass them with <code>--data-binary @fixtures/&lt;event&gt;.json</code>. You can also open the route&#39;s <strong>Try</strong> action in the playground for manual probes.</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="./../reference/channels.html">Channels reference</a>: route methods, handler arguments, events, state, and auth policies</li><li><a href="./../templates/triage.html">Triage Linear or Jira issues</a>: a complete signed tracker webhook with reply delivery</li><li><a href="./../reference/http-api.html">HTTP API</a>: built-in session, follow-up, stream, and tool routes</li><li><a href="./../deployment.html#use-the-hosted-agent">Deployment</a>: stable hosted URLs and alias-token behavior</li><li><a href="./../evals.html">Evals</a>: turn saved payloads into regression fixtures</li></ul>`,37)])])}const c=i(t,[["render",h]]);export{E as __pageData,c as default};
97
+ <span class="line"><span> -d &#39;{&quot;ticketId&quot;:&quot;ENG-142&quot;,&quot;message&quot;:&quot;CSV export returns 500&quot;}&#39;</span></span></code></pre></div><p>Keep representative payloads under <code>fixtures/</code> and pass them with <code>--data-binary @fixtures/&lt;event&gt;.json</code>. You can also open the route&#39;s <strong>Try</strong> action in the playground for manual probes.</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="./../reference/channels.html">Channels reference</a>: route methods, handler arguments, events, state, and auth policies</li><li><a href="./../templates/triage.html">Triage Linear or Jira issues</a>: a complete signed tracker webhook with reply delivery</li><li><a href="./../reference/http-api.html">HTTP API</a>: built-in session, follow-up, stream, and tool routes</li><li><a href="./../deployment.html#use-the-hosted-agent">Deployment</a>: stable hosted URLs and alias-token behavior</li><li><a href="./../evals.html">Evals</a>: turn saved payloads into regression fixtures</li></ul>`,46)])])}const c=i(t,[["render",h]]);export{E as __pageData,c as default};
@@ -1 +1 @@
1
- import{_ as i,c as a,o as e,a3 as n}from"./chunks/framework.BNw1pucY.js";const E=JSON.parse('{"title":"Webhooks & custom channels","description":"Receive provider events, keep one conversation per domain object, and deliver agent replies back out.","frontmatter":{"title":"Webhooks & custom channels","description":"Receive provider events, keep one conversation per domain object, and deliver agent replies back out."},"headers":[],"relativePath":"guides/webhooks.md","filePath":"guides/webhooks.md"}'),t={name:"guides/webhooks.md"};function h(l,s,p,k,r,d){return e(),a("div",null,[...s[0]||(s[0]=[n("",37)])])}const c=i(t,[["render",h]]);export{E as __pageData,c as default};
1
+ import{_ as i,c as a,o as e,a3 as n}from"./chunks/framework.BNw1pucY.js";const E=JSON.parse('{"title":"Webhooks & custom channels","description":"Receive provider events, keep one conversation per domain object, and deliver agent replies back out.","frontmatter":{"title":"Webhooks & custom channels","description":"Receive provider events, keep one conversation per domain object, and deliver agent replies back out."},"headers":[],"relativePath":"guides/webhooks.md","filePath":"guides/webhooks.md"}'),t={name:"guides/webhooks.md"};function h(l,s,p,k,r,d){return e(),a("div",null,[...s[0]||(s[0]=[n("",46)])])}const c=i(t,[["render",h]]);export{E as __pageData,c as default};