@cursor/bdk 0.2.1

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 (2104) hide show
  1. package/AGENTS.md +341 -0
  2. package/LICENSE.md +3 -0
  3. package/README.md +1190 -0
  4. package/dist/artifacts.d.ts +34 -0
  5. package/dist/artifacts.d.ts.map +1 -0
  6. package/dist/artifacts.js +51 -0
  7. package/dist/bin/agent-sdk.js +2 -0
  8. package/dist/bin/agent-serve.d.ts +19 -0
  9. package/dist/bin/agent-serve.d.ts.map +1 -0
  10. package/dist/bin/agent-serve.js +1578 -0
  11. package/dist/channels/bitbucket/api.d.ts +217 -0
  12. package/dist/channels/bitbucket/api.d.ts.map +1 -0
  13. package/dist/channels/bitbucket/api.js +664 -0
  14. package/dist/channels/bitbucket/binding.d.ts +75 -0
  15. package/dist/channels/bitbucket/binding.d.ts.map +1 -0
  16. package/dist/channels/bitbucket/binding.js +277 -0
  17. package/dist/channels/bitbucket/bitbucket-channel.d.ts +33 -0
  18. package/dist/channels/bitbucket/bitbucket-channel.d.ts.map +1 -0
  19. package/dist/channels/bitbucket/bitbucket-channel.js +120 -0
  20. package/dist/channels/bitbucket/bitbucket-webhook.d.ts +61 -0
  21. package/dist/channels/bitbucket/bitbucket-webhook.d.ts.map +1 -0
  22. package/dist/channels/bitbucket/bitbucket-webhook.js +384 -0
  23. package/dist/channels/bitbucket/checks.d.ts +67 -0
  24. package/dist/channels/bitbucket/checks.d.ts.map +1 -0
  25. package/dist/channels/bitbucket/checks.js +102 -0
  26. package/dist/channels/bitbucket/cursor-account.d.ts +37 -0
  27. package/dist/channels/bitbucket/cursor-account.d.ts.map +1 -0
  28. package/dist/channels/bitbucket/cursor-account.js +65 -0
  29. package/dist/channels/bitbucket/defaults.d.ts +26 -0
  30. package/dist/channels/bitbucket/defaults.d.ts.map +1 -0
  31. package/dist/channels/bitbucket/defaults.js +67 -0
  32. package/dist/channels/bitbucket/events.d.ts +22 -0
  33. package/dist/channels/bitbucket/events.d.ts.map +1 -0
  34. package/dist/channels/bitbucket/events.js +60 -0
  35. package/dist/channels/bitbucket/index.d.ts +34 -0
  36. package/dist/channels/bitbucket/index.d.ts.map +1 -0
  37. package/dist/channels/bitbucket/index.js +33 -0
  38. package/dist/channels/bitbucket/replay.d.ts +63 -0
  39. package/dist/channels/bitbucket/replay.d.ts.map +1 -0
  40. package/dist/channels/bitbucket/replay.js +302 -0
  41. package/dist/channels/bitbucket/state.d.ts +35 -0
  42. package/dist/channels/bitbucket/state.d.ts.map +1 -0
  43. package/dist/channels/bitbucket/state.js +21 -0
  44. package/dist/channels/bitbucket/types.d.ts +227 -0
  45. package/dist/channels/bitbucket/types.d.ts.map +1 -0
  46. package/dist/channels/bitbucket/types.js +1 -0
  47. package/dist/channels/change-monitors/change-monitors-channel.d.ts +5 -0
  48. package/dist/channels/change-monitors/change-monitors-channel.d.ts.map +1 -0
  49. package/dist/channels/change-monitors/change-monitors-channel.js +45 -0
  50. package/dist/channels/change-monitors/index.d.ts +4 -0
  51. package/dist/channels/change-monitors/index.d.ts.map +1 -0
  52. package/dist/channels/change-monitors/index.js +2 -0
  53. package/dist/channels/change-monitors/types.d.ts +42 -0
  54. package/dist/channels/change-monitors/types.d.ts.map +1 -0
  55. package/dist/channels/change-monitors/types.js +1 -0
  56. package/dist/channels/checks.d.ts +121 -0
  57. package/dist/channels/checks.d.ts.map +1 -0
  58. package/dist/channels/checks.js +86 -0
  59. package/dist/channels/deployments/deployments-channel.d.ts +95 -0
  60. package/dist/channels/deployments/deployments-channel.d.ts.map +1 -0
  61. package/dist/channels/deployments/deployments-channel.js +196 -0
  62. package/dist/channels/deployments/index.d.ts +25 -0
  63. package/dist/channels/deployments/index.d.ts.map +1 -0
  64. package/dist/channels/deployments/index.js +24 -0
  65. package/dist/channels/deployments/types.d.ts +83 -0
  66. package/dist/channels/deployments/types.d.ts.map +1 -0
  67. package/dist/channels/deployments/types.js +7 -0
  68. package/dist/channels/github/api.d.ts +133 -0
  69. package/dist/channels/github/api.d.ts.map +1 -0
  70. package/dist/channels/github/api.js +320 -0
  71. package/dist/channels/github/auth.d.ts +67 -0
  72. package/dist/channels/github/auth.d.ts.map +1 -0
  73. package/dist/channels/github/auth.js +233 -0
  74. package/dist/channels/github/binding.d.ts +86 -0
  75. package/dist/channels/github/binding.d.ts.map +1 -0
  76. package/dist/channels/github/binding.js +114 -0
  77. package/dist/channels/github/checks.d.ts +64 -0
  78. package/dist/channels/github/checks.d.ts.map +1 -0
  79. package/dist/channels/github/checks.js +98 -0
  80. package/dist/channels/github/cursor-account.d.ts +102 -0
  81. package/dist/channels/github/cursor-account.d.ts.map +1 -0
  82. package/dist/channels/github/cursor-account.js +194 -0
  83. package/dist/channels/github/defaults.d.ts +23 -0
  84. package/dist/channels/github/defaults.d.ts.map +1 -0
  85. package/dist/channels/github/defaults.js +157 -0
  86. package/dist/channels/github/events.d.ts +18 -0
  87. package/dist/channels/github/events.d.ts.map +1 -0
  88. package/dist/channels/github/events.js +56 -0
  89. package/dist/channels/github/forward.d.ts +139 -0
  90. package/dist/channels/github/forward.d.ts.map +1 -0
  91. package/dist/channels/github/forward.js +267 -0
  92. package/dist/channels/github/github-channel.d.ts +146 -0
  93. package/dist/channels/github/github-channel.d.ts.map +1 -0
  94. package/dist/channels/github/github-channel.js +1804 -0
  95. package/dist/channels/github/index.d.ts +54 -0
  96. package/dist/channels/github/index.d.ts.map +1 -0
  97. package/dist/channels/github/index.js +53 -0
  98. package/dist/channels/github/progress.d.ts +84 -0
  99. package/dist/channels/github/progress.d.ts.map +1 -0
  100. package/dist/channels/github/progress.js +236 -0
  101. package/dist/channels/github/replay.d.ts +115 -0
  102. package/dist/channels/github/replay.d.ts.map +1 -0
  103. package/dist/channels/github/replay.js +278 -0
  104. package/dist/channels/github/state.d.ts +47 -0
  105. package/dist/channels/github/state.d.ts.map +1 -0
  106. package/dist/channels/github/state.js +53 -0
  107. package/dist/channels/github/types.d.ts +491 -0
  108. package/dist/channels/github/types.d.ts.map +1 -0
  109. package/dist/channels/github/types.js +1 -0
  110. package/dist/channels/gitlab/api.d.ts +118 -0
  111. package/dist/channels/gitlab/api.d.ts.map +1 -0
  112. package/dist/channels/gitlab/api.js +234 -0
  113. package/dist/channels/gitlab/binding.d.ts +63 -0
  114. package/dist/channels/gitlab/binding.d.ts.map +1 -0
  115. package/dist/channels/gitlab/binding.js +147 -0
  116. package/dist/channels/gitlab/checks.d.ts +110 -0
  117. package/dist/channels/gitlab/checks.d.ts.map +1 -0
  118. package/dist/channels/gitlab/checks.js +122 -0
  119. package/dist/channels/gitlab/cursor-account.d.ts +36 -0
  120. package/dist/channels/gitlab/cursor-account.d.ts.map +1 -0
  121. package/dist/channels/gitlab/cursor-account.js +64 -0
  122. package/dist/channels/gitlab/defaults.d.ts +25 -0
  123. package/dist/channels/gitlab/defaults.d.ts.map +1 -0
  124. package/dist/channels/gitlab/defaults.js +55 -0
  125. package/dist/channels/gitlab/events.d.ts +12 -0
  126. package/dist/channels/gitlab/events.d.ts.map +1 -0
  127. package/dist/channels/gitlab/events.js +26 -0
  128. package/dist/channels/gitlab/gitlab-channel.d.ts +33 -0
  129. package/dist/channels/gitlab/gitlab-channel.d.ts.map +1 -0
  130. package/dist/channels/gitlab/gitlab-channel.js +120 -0
  131. package/dist/channels/gitlab/gitlab-webhook.d.ts +45 -0
  132. package/dist/channels/gitlab/gitlab-webhook.d.ts.map +1 -0
  133. package/dist/channels/gitlab/gitlab-webhook.js +388 -0
  134. package/dist/channels/gitlab/index.d.ts +31 -0
  135. package/dist/channels/gitlab/index.d.ts.map +1 -0
  136. package/dist/channels/gitlab/index.js +30 -0
  137. package/dist/channels/gitlab/replay.d.ts +105 -0
  138. package/dist/channels/gitlab/replay.d.ts.map +1 -0
  139. package/dist/channels/gitlab/replay.js +199 -0
  140. package/dist/channels/gitlab/state.d.ts +33 -0
  141. package/dist/channels/gitlab/state.d.ts.map +1 -0
  142. package/dist/channels/gitlab/state.js +23 -0
  143. package/dist/channels/gitlab/types.d.ts +211 -0
  144. package/dist/channels/gitlab/types.d.ts.map +1 -0
  145. package/dist/channels/gitlab/types.js +1 -0
  146. package/dist/channels/issues/index.d.ts +4 -0
  147. package/dist/channels/issues/index.d.ts.map +1 -0
  148. package/dist/channels/issues/index.js +2 -0
  149. package/dist/channels/issues/issues-channel.d.ts +5 -0
  150. package/dist/channels/issues/issues-channel.d.ts.map +1 -0
  151. package/dist/channels/issues/issues-channel.js +35 -0
  152. package/dist/channels/issues/types.d.ts +33 -0
  153. package/dist/channels/issues/types.d.ts.map +1 -0
  154. package/dist/channels/issues/types.js +1 -0
  155. package/dist/channels/origin/api.d.ts +157 -0
  156. package/dist/channels/origin/api.d.ts.map +1 -0
  157. package/dist/channels/origin/api.js +379 -0
  158. package/dist/channels/origin/binding.d.ts +57 -0
  159. package/dist/channels/origin/binding.d.ts.map +1 -0
  160. package/dist/channels/origin/binding.js +57 -0
  161. package/dist/channels/origin/checks.d.ts +119 -0
  162. package/dist/channels/origin/checks.d.ts.map +1 -0
  163. package/dist/channels/origin/checks.js +145 -0
  164. package/dist/channels/origin/cursor-account.d.ts +24 -0
  165. package/dist/channels/origin/cursor-account.d.ts.map +1 -0
  166. package/dist/channels/origin/cursor-account.js +35 -0
  167. package/dist/channels/origin/defaults.d.ts +43 -0
  168. package/dist/channels/origin/defaults.d.ts.map +1 -0
  169. package/dist/channels/origin/defaults.js +109 -0
  170. package/dist/channels/origin/events.d.ts +10 -0
  171. package/dist/channels/origin/events.d.ts.map +1 -0
  172. package/dist/channels/origin/events.js +25 -0
  173. package/dist/channels/origin/index.d.ts +35 -0
  174. package/dist/channels/origin/index.d.ts.map +1 -0
  175. package/dist/channels/origin/index.js +34 -0
  176. package/dist/channels/origin/origin-channel.d.ts +72 -0
  177. package/dist/channels/origin/origin-channel.d.ts.map +1 -0
  178. package/dist/channels/origin/origin-channel.js +634 -0
  179. package/dist/channels/origin/origin-webhook.d.ts +69 -0
  180. package/dist/channels/origin/origin-webhook.d.ts.map +1 -0
  181. package/dist/channels/origin/origin-webhook.js +231 -0
  182. package/dist/channels/origin/reactions.d.ts +56 -0
  183. package/dist/channels/origin/reactions.d.ts.map +1 -0
  184. package/dist/channels/origin/reactions.js +58 -0
  185. package/dist/channels/origin/state.d.ts +32 -0
  186. package/dist/channels/origin/state.d.ts.map +1 -0
  187. package/dist/channels/origin/state.js +23 -0
  188. package/dist/channels/origin/types.d.ts +257 -0
  189. package/dist/channels/origin/types.d.ts.map +1 -0
  190. package/dist/channels/origin/types.js +1 -0
  191. package/dist/channels/slack/agentic-delivery.d.ts +23 -0
  192. package/dist/channels/slack/agentic-delivery.d.ts.map +1 -0
  193. package/dist/channels/slack/agentic-delivery.js +566 -0
  194. package/dist/channels/slack/agentic-posted.d.ts +30 -0
  195. package/dist/channels/slack/agentic-posted.d.ts.map +1 -0
  196. package/dist/channels/slack/agentic-posted.js +102 -0
  197. package/dist/channels/slack/agentic-signals.d.ts +48 -0
  198. package/dist/channels/slack/agentic-signals.d.ts.map +1 -0
  199. package/dist/channels/slack/agentic-signals.js +199 -0
  200. package/dist/channels/slack/api.d.ts +171 -0
  201. package/dist/channels/slack/api.d.ts.map +1 -0
  202. package/dist/channels/slack/api.js +613 -0
  203. package/dist/channels/slack/approvals.d.ts +48 -0
  204. package/dist/channels/slack/approvals.d.ts.map +1 -0
  205. package/dist/channels/slack/approvals.js +233 -0
  206. package/dist/channels/slack/assistant.d.ts +23 -0
  207. package/dist/channels/slack/assistant.d.ts.map +1 -0
  208. package/dist/channels/slack/assistant.js +67 -0
  209. package/dist/channels/slack/attachments.d.ts +82 -0
  210. package/dist/channels/slack/attachments.d.ts.map +1 -0
  211. package/dist/channels/slack/attachments.js +503 -0
  212. package/dist/channels/slack/auth.d.ts +46 -0
  213. package/dist/channels/slack/auth.d.ts.map +1 -0
  214. package/dist/channels/slack/auth.js +95 -0
  215. package/dist/channels/slack/blocks.d.ts +61 -0
  216. package/dist/channels/slack/blocks.d.ts.map +1 -0
  217. package/dist/channels/slack/blocks.js +90 -0
  218. package/dist/channels/slack/bot-mentions.d.ts +108 -0
  219. package/dist/channels/slack/bot-mentions.d.ts.map +1 -0
  220. package/dist/channels/slack/bot-mentions.js +257 -0
  221. package/dist/channels/slack/channel-watch.d.ts +76 -0
  222. package/dist/channels/slack/channel-watch.d.ts.map +1 -0
  223. package/dist/channels/slack/channel-watch.js +264 -0
  224. package/dist/channels/slack/cli-project.d.ts +19 -0
  225. package/dist/channels/slack/cli-project.d.ts.map +1 -0
  226. package/dist/channels/slack/cli-project.js +228 -0
  227. package/dist/channels/slack/code-fences.d.ts +17 -0
  228. package/dist/channels/slack/code-fences.d.ts.map +1 -0
  229. package/dist/channels/slack/code-fences.js +166 -0
  230. package/dist/channels/slack/constants.d.ts +25 -0
  231. package/dist/channels/slack/constants.d.ts.map +1 -0
  232. package/dist/channels/slack/constants.js +35 -0
  233. package/dist/channels/slack/credentials.d.ts +35 -0
  234. package/dist/channels/slack/credentials.d.ts.map +1 -0
  235. package/dist/channels/slack/credentials.js +88 -0
  236. package/dist/channels/slack/defaults.d.ts +50 -0
  237. package/dist/channels/slack/defaults.d.ts.map +1 -0
  238. package/dist/channels/slack/defaults.js +630 -0
  239. package/dist/channels/slack/dispatch.d.ts +141 -0
  240. package/dist/channels/slack/dispatch.d.ts.map +1 -0
  241. package/dist/channels/slack/dispatch.js +730 -0
  242. package/dist/channels/slack/doctor.d.ts +40 -0
  243. package/dist/channels/slack/doctor.d.ts.map +1 -0
  244. package/dist/channels/slack/doctor.js +291 -0
  245. package/dist/channels/slack/eval-directive.d.ts +59 -0
  246. package/dist/channels/slack/eval-directive.d.ts.map +1 -0
  247. package/dist/channels/slack/eval-directive.js +269 -0
  248. package/dist/channels/slack/event-id-dedupe.d.ts +10 -0
  249. package/dist/channels/slack/event-id-dedupe.d.ts.map +1 -0
  250. package/dist/channels/slack/event-id-dedupe.js +23 -0
  251. package/dist/channels/slack/external-policy.d.ts +28 -0
  252. package/dist/channels/slack/external-policy.d.ts.map +1 -0
  253. package/dist/channels/slack/external-policy.js +64 -0
  254. package/dist/channels/slack/footer.d.ts +33 -0
  255. package/dist/channels/slack/footer.d.ts.map +1 -0
  256. package/dist/channels/slack/footer.js +85 -0
  257. package/dist/channels/slack/inbound.d.ts +98 -0
  258. package/dist/channels/slack/inbound.d.ts.map +1 -0
  259. package/dist/channels/slack/inbound.js +314 -0
  260. package/dist/channels/slack/index.d.ts +53 -0
  261. package/dist/channels/slack/index.d.ts.map +1 -0
  262. package/dist/channels/slack/index.js +52 -0
  263. package/dist/channels/slack/init.d.ts +45 -0
  264. package/dist/channels/slack/init.d.ts.map +1 -0
  265. package/dist/channels/slack/init.js +126 -0
  266. package/dist/channels/slack/interactive.d.ts +65 -0
  267. package/dist/channels/slack/interactive.d.ts.map +1 -0
  268. package/dist/channels/slack/interactive.js +310 -0
  269. package/dist/channels/slack/links.d.ts +10 -0
  270. package/dist/channels/slack/links.d.ts.map +1 -0
  271. package/dist/channels/slack/links.js +19 -0
  272. package/dist/channels/slack/live-delivery.d.ts +77 -0
  273. package/dist/channels/slack/live-delivery.d.ts.map +1 -0
  274. package/dist/channels/slack/live-delivery.js +399 -0
  275. package/dist/channels/slack/log.d.ts +25 -0
  276. package/dist/channels/slack/log.d.ts.map +1 -0
  277. package/dist/channels/slack/log.js +44 -0
  278. package/dist/channels/slack/manifest.d.ts +80 -0
  279. package/dist/channels/slack/manifest.d.ts.map +1 -0
  280. package/dist/channels/slack/manifest.js +159 -0
  281. package/dist/channels/slack/message-body.d.ts +13 -0
  282. package/dist/channels/slack/message-body.d.ts.map +1 -0
  283. package/dist/channels/slack/message-body.js +74 -0
  284. package/dist/channels/slack/nudge-carrier.d.ts +21 -0
  285. package/dist/channels/slack/nudge-carrier.d.ts.map +1 -0
  286. package/dist/channels/slack/nudge-carrier.js +213 -0
  287. package/dist/channels/slack/nudge-store.d.ts +77 -0
  288. package/dist/channels/slack/nudge-store.d.ts.map +1 -0
  289. package/dist/channels/slack/nudge-store.js +315 -0
  290. package/dist/channels/slack/paint-start.d.ts +22 -0
  291. package/dist/channels/slack/paint-start.d.ts.map +1 -0
  292. package/dist/channels/slack/paint-start.js +91 -0
  293. package/dist/channels/slack/placeholder.d.ts +62 -0
  294. package/dist/channels/slack/placeholder.d.ts.map +1 -0
  295. package/dist/channels/slack/placeholder.js +266 -0
  296. package/dist/channels/slack/pr-ref.d.ts +24 -0
  297. package/dist/channels/slack/pr-ref.d.ts.map +1 -0
  298. package/dist/channels/slack/pr-ref.js +55 -0
  299. package/dist/channels/slack/progress-delivery.d.ts +28 -0
  300. package/dist/channels/slack/progress-delivery.d.ts.map +1 -0
  301. package/dist/channels/slack/progress-delivery.js +122 -0
  302. package/dist/channels/slack/reasoning-card.d.ts +38 -0
  303. package/dist/channels/slack/reasoning-card.d.ts.map +1 -0
  304. package/dist/channels/slack/reasoning-card.js +103 -0
  305. package/dist/channels/slack/reasoning-chip.d.ts +8 -0
  306. package/dist/channels/slack/reasoning-chip.d.ts.map +1 -0
  307. package/dist/channels/slack/reasoning-chip.js +30 -0
  308. package/dist/channels/slack/recording-sink.d.ts +29 -0
  309. package/dist/channels/slack/recording-sink.d.ts.map +1 -0
  310. package/dist/channels/slack/recording-sink.js +140 -0
  311. package/dist/channels/slack/redact.d.ts +2 -0
  312. package/dist/channels/slack/redact.d.ts.map +1 -0
  313. package/dist/channels/slack/redact.js +5 -0
  314. package/dist/channels/slack/reply-options.d.ts +47 -0
  315. package/dist/channels/slack/reply-options.d.ts.map +1 -0
  316. package/dist/channels/slack/reply-options.js +193 -0
  317. package/dist/channels/slack/setup.d.ts +33 -0
  318. package/dist/channels/slack/setup.d.ts.map +1 -0
  319. package/dist/channels/slack/setup.js +101 -0
  320. package/dist/channels/slack/slack-channel.d.ts +43 -0
  321. package/dist/channels/slack/slack-channel.d.ts.map +1 -0
  322. package/dist/channels/slack/slack-channel.js +534 -0
  323. package/dist/channels/slack/socket-mode.d.ts +26 -0
  324. package/dist/channels/slack/socket-mode.d.ts.map +1 -0
  325. package/dist/channels/slack/socket-mode.js +114 -0
  326. package/dist/channels/slack/stop.d.ts +14 -0
  327. package/dist/channels/slack/stop.d.ts.map +1 -0
  328. package/dist/channels/slack/stop.js +22 -0
  329. package/dist/channels/slack/stream.d.ts +38 -0
  330. package/dist/channels/slack/stream.d.ts.map +1 -0
  331. package/dist/channels/slack/stream.js +30 -0
  332. package/dist/channels/slack/thread-context.d.ts +79 -0
  333. package/dist/channels/slack/thread-context.d.ts.map +1 -0
  334. package/dist/channels/slack/thread-context.js +396 -0
  335. package/dist/channels/slack/tool-approval-events.d.ts +38 -0
  336. package/dist/channels/slack/tool-approval-events.d.ts.map +1 -0
  337. package/dist/channels/slack/tool-approval-events.js +224 -0
  338. package/dist/channels/slack/tool-cards.d.ts +22 -0
  339. package/dist/channels/slack/tool-cards.d.ts.map +1 -0
  340. package/dist/channels/slack/tool-cards.js +172 -0
  341. package/dist/channels/slack/tool-chip.d.ts +9 -0
  342. package/dist/channels/slack/tool-chip.d.ts.map +1 -0
  343. package/dist/channels/slack/tool-chip.js +23 -0
  344. package/dist/channels/slack/types.d.ts +751 -0
  345. package/dist/channels/slack/types.d.ts.map +1 -0
  346. package/dist/channels/slack/types.js +4 -0
  347. package/dist/channels/slack/upload.d.ts +13 -0
  348. package/dist/channels/slack/upload.d.ts.map +1 -0
  349. package/dist/channels/slack/upload.js +135 -0
  350. package/dist/channels.d.ts +175 -0
  351. package/dist/channels.d.ts.map +1 -0
  352. package/dist/channels.js +417 -0
  353. package/dist/connections.d.ts +131 -0
  354. package/dist/connections.d.ts.map +1 -0
  355. package/dist/connections.js +131 -0
  356. package/dist/dashboard-session-url.d.ts +15 -0
  357. package/dist/dashboard-session-url.d.ts.map +1 -0
  358. package/dist/dashboard-session-url.js +25 -0
  359. package/dist/docs/404.html +24 -0
  360. package/dist/docs/architecture.svg +59 -0
  361. package/dist/docs/assets/app.JVQvbRO-.js +309 -0
  362. package/dist/docs/assets/building-with-agents.md.-fcjCmJU.js +9 -0
  363. package/dist/docs/assets/building-with-agents.md.-fcjCmJU.lean.js +1 -0
  364. package/dist/docs/assets/chunks/@localSearchIndexroot.Caw9W1pM.js +1 -0
  365. package/dist/docs/assets/chunks/VPLocalSearchBox.BkhY63uW.js +9 -0
  366. package/dist/docs/assets/chunks/arc.Cc1unYd3.js +1 -0
  367. package/dist/docs/assets/chunks/architectureDiagram-Q4EWVU46.CAY_TPVz.js +36 -0
  368. package/dist/docs/assets/chunks/baseUniq.my2VD3Xm.js +1 -0
  369. package/dist/docs/assets/chunks/blockDiagram-DXYQGD6D.CQXAOmqd.js +132 -0
  370. package/dist/docs/assets/chunks/c4Diagram-AHTNJAMY.D0AsQFSX.js +10 -0
  371. package/dist/docs/assets/chunks/channel.Sapo9HJZ.js +1 -0
  372. package/dist/docs/assets/chunks/chunk-4BX2VUAB.DZjhgNls.js +1 -0
  373. package/dist/docs/assets/chunks/chunk-4TB4RGXK.qdcp_qbo.js +206 -0
  374. package/dist/docs/assets/chunks/chunk-55IACEB6.BHXoZhJ-.js +1 -0
  375. package/dist/docs/assets/chunks/chunk-EDXVE4YY.Cds_Vwj3.js +1 -0
  376. package/dist/docs/assets/chunks/chunk-FMBD7UC4.CSl0HknT.js +15 -0
  377. package/dist/docs/assets/chunks/chunk-OYMX7WX6.DJMvAt5N.js +231 -0
  378. package/dist/docs/assets/chunks/chunk-QZHKN3VN.BYQzBK9D.js +1 -0
  379. package/dist/docs/assets/chunks/chunk-YZCP3GAM.BAvw7N4o.js +1 -0
  380. package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.NPiy3Hz7.js +1 -0
  381. package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.NPiy3Hz7.js +1 -0
  382. package/dist/docs/assets/chunks/clone.zl2qolPE.js +1 -0
  383. package/dist/docs/assets/chunks/cose-bilkent-S5V4N54A.Buf3seya.js +1 -0
  384. package/dist/docs/assets/chunks/cytoscape.esm.BQk4lpUV.js +331 -0
  385. package/dist/docs/assets/chunks/dagre-KV5264BT.DMGGa3uA.js +4 -0
  386. package/dist/docs/assets/chunks/defaultLocale.C4B-KCzX.js +1 -0
  387. package/dist/docs/assets/chunks/diagram-5BDNPKRD.DDjnwRmY.js +10 -0
  388. package/dist/docs/assets/chunks/diagram-G4DWMVQ6.RwyrIr8Q.js +24 -0
  389. package/dist/docs/assets/chunks/diagram-MMDJMWI5.DRvQV16Z.js +43 -0
  390. package/dist/docs/assets/chunks/diagram-TYMM5635.Dw8W9BTk.js +24 -0
  391. package/dist/docs/assets/chunks/erDiagram-SMLLAGMA.DQT1Hnwf.js +85 -0
  392. package/dist/docs/assets/chunks/flowDiagram-DWJPFMVM.6_Aky-ut.js +162 -0
  393. package/dist/docs/assets/chunks/framework.BNw1pucY.js +19 -0
  394. package/dist/docs/assets/chunks/ganttDiagram-T4ZO3ILL.DHIwqnqN.js +292 -0
  395. package/dist/docs/assets/chunks/gitGraphDiagram-UUTBAWPF.CGd_eJbn.js +106 -0
  396. package/dist/docs/assets/chunks/graph.ChMEylkh.js +1 -0
  397. package/dist/docs/assets/chunks/infoDiagram-42DDH7IO.Cd4gMyAz.js +2 -0
  398. package/dist/docs/assets/chunks/init.Gi6I4Gst.js +1 -0
  399. package/dist/docs/assets/chunks/ishikawaDiagram-UXIWVN3A.D1uw7MXq.js +70 -0
  400. package/dist/docs/assets/chunks/journeyDiagram-VCZTEJTY.AWLXtelc.js +139 -0
  401. package/dist/docs/assets/chunks/kanban-definition-6JOO6SKY.CagPhAn5.js +89 -0
  402. package/dist/docs/assets/chunks/katex.DkKDou_j.js +257 -0
  403. package/dist/docs/assets/chunks/layout.ClTBBkE_.js +1 -0
  404. package/dist/docs/assets/chunks/linear.SwS2rOLA.js +1 -0
  405. package/dist/docs/assets/chunks/min.By_x-Btb.js +1 -0
  406. package/dist/docs/assets/chunks/mindmap-definition-QFDTVHPH.By_RAMaP.js +96 -0
  407. package/dist/docs/assets/chunks/ordinal.DBvzRdQf.js +1 -0
  408. package/dist/docs/assets/chunks/pieDiagram-DEJITSTG.DfAl9sy4.js +30 -0
  409. package/dist/docs/assets/chunks/quadrantDiagram-34T5L4WZ.CNuqFRBj.js +7 -0
  410. package/dist/docs/assets/chunks/requirementDiagram-MS252O5E.DJ5CmTCl.js +84 -0
  411. package/dist/docs/assets/chunks/sankeyDiagram-XADWPNL6.D-T_AKJj.js +10 -0
  412. package/dist/docs/assets/chunks/sequenceDiagram-FGHM5R23.BRn9WcrR.js +157 -0
  413. package/dist/docs/assets/chunks/stateDiagram-FHFEXIEX.F12urmm7.js +1 -0
  414. package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2._auCa3fR.js +1 -0
  415. package/dist/docs/assets/chunks/theme.zK3OJa_C.js +2 -0
  416. package/dist/docs/assets/chunks/timeline-definition-GMOUNBTQ.B7GiQBeC.js +120 -0
  417. package/dist/docs/assets/chunks/vennDiagram-DHZGUBPP.D0niwuY_.js +34 -0
  418. package/dist/docs/assets/chunks/virtual_mermaid-config.DDnGl6nM.js +1 -0
  419. package/dist/docs/assets/chunks/wardley-RL74JXVD.1zhHNRsx.js +162 -0
  420. package/dist/docs/assets/chunks/wardleyDiagram-NUSXRM2D.DKaqpT7K.js +20 -0
  421. package/dist/docs/assets/chunks/xychartDiagram-5P7HB3ND.e8BPicch.js +7 -0
  422. package/dist/docs/assets/deployment.md.nGo1yIsa.js +32 -0
  423. package/dist/docs/assets/deployment.md.nGo1yIsa.lean.js +1 -0
  424. package/dist/docs/assets/evals.md.CCAtNcuL.js +72 -0
  425. package/dist/docs/assets/evals.md.CCAtNcuL.lean.js +1 -0
  426. package/dist/docs/assets/guides_agent-to-agent.md.CGkicXeB.js +41 -0
  427. package/dist/docs/assets/guides_agent-to-agent.md.CGkicXeB.lean.js +1 -0
  428. package/dist/docs/assets/guides_bitbucket.md.Cb3LPKt3.js +145 -0
  429. package/dist/docs/assets/guides_bitbucket.md.Cb3LPKt3.lean.js +1 -0
  430. package/dist/docs/assets/guides_cloud-agents.md.BuEkDCwo.js +10 -0
  431. package/dist/docs/assets/guides_cloud-agents.md.BuEkDCwo.lean.js +1 -0
  432. package/dist/docs/assets/guides_convert-automation.md.Ci-Y2iD5.js +43 -0
  433. package/dist/docs/assets/guides_convert-automation.md.Ci-Y2iD5.lean.js +1 -0
  434. package/dist/docs/assets/guides_github.md.C2_DSWlE.js +156 -0
  435. package/dist/docs/assets/guides_github.md.C2_DSWlE.lean.js +1 -0
  436. package/dist/docs/assets/guides_gitlab.md.BM27P43u.js +153 -0
  437. package/dist/docs/assets/guides_gitlab.md.BM27P43u.lean.js +1 -0
  438. package/dist/docs/assets/guides_grokbot-agents.md.yxVbSlKA.js +16 -0
  439. package/dist/docs/assets/guides_grokbot-agents.md.yxVbSlKA.lean.js +1 -0
  440. package/dist/docs/assets/guides_hooks.md.BWoiNaMq.js +50 -0
  441. package/dist/docs/assets/guides_hooks.md.BWoiNaMq.lean.js +1 -0
  442. package/dist/docs/assets/guides_improve.md.COtL-6ft.js +22 -0
  443. package/dist/docs/assets/guides_improve.md.COtL-6ft.lean.js +1 -0
  444. package/dist/docs/assets/guides_jev.md.BNDm14Gy.js +151 -0
  445. package/dist/docs/assets/guides_jev.md.BNDm14Gy.lean.js +1 -0
  446. package/dist/docs/assets/guides_mcp-oauth.md.Cu6mhZ_3.js +50 -0
  447. package/dist/docs/assets/guides_mcp-oauth.md.Cu6mhZ_3.lean.js +1 -0
  448. package/dist/docs/assets/guides_opentelemetry.md.DLlIB5rv.js +35 -0
  449. package/dist/docs/assets/guides_opentelemetry.md.DLlIB5rv.lean.js +1 -0
  450. package/dist/docs/assets/guides_slack.md.ZbHQETOT.js +70 -0
  451. package/dist/docs/assets/guides_slack.md.ZbHQETOT.lean.js +1 -0
  452. package/dist/docs/assets/guides_webhooks.md.D0furjw0.js +92 -0
  453. package/dist/docs/assets/guides_webhooks.md.D0furjw0.lean.js +1 -0
  454. package/dist/docs/assets/hillclimbing.md.Biy0m-Qb.js +7 -0
  455. package/dist/docs/assets/hillclimbing.md.Biy0m-Qb.lean.js +1 -0
  456. package/dist/docs/assets/index.md.CVc_oOA3.js +27 -0
  457. package/dist/docs/assets/index.md.CVc_oOA3.lean.js +1 -0
  458. package/dist/docs/assets/inter-italic-cyrillic-ext.r48I6akx.woff2 +0 -0
  459. package/dist/docs/assets/inter-italic-cyrillic.By2_1cv3.woff2 +0 -0
  460. package/dist/docs/assets/inter-italic-greek-ext.1u6EdAuj.woff2 +0 -0
  461. package/dist/docs/assets/inter-italic-greek.DJ8dCoTZ.woff2 +0 -0
  462. package/dist/docs/assets/inter-italic-latin-ext.CN1xVJS-.woff2 +0 -0
  463. package/dist/docs/assets/inter-italic-latin.C2AdPX0b.woff2 +0 -0
  464. package/dist/docs/assets/inter-italic-vietnamese.BSbpV94h.woff2 +0 -0
  465. package/dist/docs/assets/inter-roman-cyrillic-ext.BBPuwvHQ.woff2 +0 -0
  466. package/dist/docs/assets/inter-roman-cyrillic.C5lxZ8CY.woff2 +0 -0
  467. package/dist/docs/assets/inter-roman-greek-ext.CqjqNYQ-.woff2 +0 -0
  468. package/dist/docs/assets/inter-roman-greek.BBVDIX6e.woff2 +0 -0
  469. package/dist/docs/assets/inter-roman-latin-ext.4ZJIpNVo.woff2 +0 -0
  470. package/dist/docs/assets/inter-roman-latin.Di8DUHzh.woff2 +0 -0
  471. package/dist/docs/assets/inter-roman-vietnamese.BjW4sHH5.woff2 +0 -0
  472. package/dist/docs/assets/quickstart.md.wG4shE1f.js +168 -0
  473. package/dist/docs/assets/quickstart.md.wG4shE1f.lean.js +1 -0
  474. package/dist/docs/assets/reference_agent-config.md.DzGI777n.js +32 -0
  475. package/dist/docs/assets/reference_agent-config.md.DzGI777n.lean.js +1 -0
  476. package/dist/docs/assets/reference_artifacts.md.IFFC5Zln.js +18 -0
  477. package/dist/docs/assets/reference_artifacts.md.IFFC5Zln.lean.js +1 -0
  478. package/dist/docs/assets/reference_channels.md.mbNtKCiR.js +23 -0
  479. package/dist/docs/assets/reference_channels.md.mbNtKCiR.lean.js +1 -0
  480. package/dist/docs/assets/reference_cli.md.BK2QUH67.js +97 -0
  481. package/dist/docs/assets/reference_cli.md.BK2QUH67.lean.js +1 -0
  482. package/dist/docs/assets/reference_connections.md._XpKiOaF.js +63 -0
  483. package/dist/docs/assets/reference_connections.md._XpKiOaF.lean.js +1 -0
  484. package/dist/docs/assets/reference_evals.md.DqNyHMA6.js +56 -0
  485. package/dist/docs/assets/reference_evals.md.DqNyHMA6.lean.js +1 -0
  486. package/dist/docs/assets/reference_extensions.md.CPPrkWlJ.js +58 -0
  487. package/dist/docs/assets/reference_extensions.md.CPPrkWlJ.lean.js +1 -0
  488. package/dist/docs/assets/reference_hooks.md.Dg3dEugd.js +45 -0
  489. package/dist/docs/assets/reference_hooks.md.Dg3dEugd.lean.js +1 -0
  490. package/dist/docs/assets/reference_http-api.md.BZOvhCqY.js +11 -0
  491. package/dist/docs/assets/reference_http-api.md.BZOvhCqY.lean.js +1 -0
  492. package/dist/docs/assets/reference_instructions.md.Bdwscs4G.js +14 -0
  493. package/dist/docs/assets/reference_instructions.md.Bdwscs4G.lean.js +1 -0
  494. package/dist/docs/assets/reference_playground.md.BdQzRJc2.js +1 -0
  495. package/dist/docs/assets/reference_playground.md.BdQzRJc2.lean.js +1 -0
  496. package/dist/docs/assets/reference_project-layout.md.CpLQ9j4K.js +25 -0
  497. package/dist/docs/assets/reference_project-layout.md.CpLQ9j4K.lean.js +1 -0
  498. package/dist/docs/assets/reference_prompt.md.BQZB4eaV.js +9 -0
  499. package/dist/docs/assets/reference_prompt.md.BQZB4eaV.lean.js +1 -0
  500. package/dist/docs/assets/reference_schedules.md.BVU5EFbz.js +47 -0
  501. package/dist/docs/assets/reference_schedules.md.BVU5EFbz.lean.js +1 -0
  502. package/dist/docs/assets/reference_sessions.md.BtpTjZmh.js +1 -0
  503. package/dist/docs/assets/reference_sessions.md.BtpTjZmh.lean.js +1 -0
  504. package/dist/docs/assets/reference_skills.md.Cy00QMKS.js +15 -0
  505. package/dist/docs/assets/reference_skills.md.Cy00QMKS.lean.js +1 -0
  506. package/dist/docs/assets/reference_subagents.md.B8oyeXOI.js +10 -0
  507. package/dist/docs/assets/reference_subagents.md.B8oyeXOI.lean.js +1 -0
  508. package/dist/docs/assets/reference_tools.md.hg2Wi5Bq.js +90 -0
  509. package/dist/docs/assets/reference_tools.md.hg2Wi5Bq.lean.js +1 -0
  510. package/dist/docs/assets/style.C130MVnH.css +1 -0
  511. package/dist/docs/assets/templates_agentic-owners.md.BykUiZ8j.js +14 -0
  512. package/dist/docs/assets/templates_agentic-owners.md.BykUiZ8j.lean.js +1 -0
  513. package/dist/docs/assets/templates_security-reviewer.md.DXMmKl_o.js +2 -0
  514. package/dist/docs/assets/templates_security-reviewer.md.DXMmKl_o.lean.js +1 -0
  515. package/dist/docs/assets/templates_thermo-quality-review.md.Dg1p1MsG.js +3 -0
  516. package/dist/docs/assets/templates_thermo-quality-review.md.Dg1p1MsG.lean.js +1 -0
  517. package/dist/docs/assets/templates_thermo-review.md.Dlylkowj.js +3 -0
  518. package/dist/docs/assets/templates_thermo-review.md.Dlylkowj.lean.js +1 -0
  519. package/dist/docs/assets/templates_triage.md.CvJyx81N.js +9 -0
  520. package/dist/docs/assets/templates_triage.md.CvJyx81N.lean.js +1 -0
  521. package/dist/docs/assets/troubleshooting.md.BzZSu1Gz.js +1 -0
  522. package/dist/docs/assets/troubleshooting.md.BzZSu1Gz.lean.js +1 -0
  523. package/dist/docs/building-with-agents.html +68 -0
  524. package/dist/docs/building-with-agents.md +135 -0
  525. package/dist/docs/deployment.html +91 -0
  526. package/dist/docs/deployment.md +211 -0
  527. package/dist/docs/evals.html +131 -0
  528. package/dist/docs/evals.md +257 -0
  529. package/dist/docs/guides/agent-to-agent.html +100 -0
  530. package/dist/docs/guides/agent-to-agent.md +152 -0
  531. package/dist/docs/guides/bitbucket.html +204 -0
  532. package/dist/docs/guides/bitbucket.md +288 -0
  533. package/dist/docs/guides/cloud-agents.html +69 -0
  534. package/dist/docs/guides/cloud-agents.md +90 -0
  535. package/dist/docs/guides/convert-automation.html +102 -0
  536. package/dist/docs/guides/convert-automation.md +183 -0
  537. package/dist/docs/guides/github.html +215 -0
  538. package/dist/docs/guides/github.md +326 -0
  539. package/dist/docs/guides/gitlab.html +212 -0
  540. package/dist/docs/guides/gitlab.md +294 -0
  541. package/dist/docs/guides/grokbot-agents.html +75 -0
  542. package/dist/docs/guides/grokbot-agents.md +142 -0
  543. package/dist/docs/guides/hooks.html +109 -0
  544. package/dist/docs/guides/hooks.md +114 -0
  545. package/dist/docs/guides/improve.html +81 -0
  546. package/dist/docs/guides/improve.md +134 -0
  547. package/dist/docs/guides/jev.html +210 -0
  548. package/dist/docs/guides/jev.md +294 -0
  549. package/dist/docs/guides/mcp-oauth.html +109 -0
  550. package/dist/docs/guides/mcp-oauth.md +162 -0
  551. package/dist/docs/guides/opentelemetry.html +94 -0
  552. package/dist/docs/guides/opentelemetry.md +153 -0
  553. package/dist/docs/guides/slack.html +129 -0
  554. package/dist/docs/guides/slack.md +273 -0
  555. package/dist/docs/guides/webhooks.html +151 -0
  556. package/dist/docs/guides/webhooks.md +236 -0
  557. package/dist/docs/hashmap.json +1 -0
  558. package/dist/docs/hillclimbing.html +66 -0
  559. package/dist/docs/hillclimbing.md +137 -0
  560. package/dist/docs/index.html +86 -0
  561. package/dist/docs/index.md +114 -0
  562. package/dist/docs/llms-full.txt +8439 -0
  563. package/dist/docs/llms.txt +62 -0
  564. package/dist/docs/quickstart.html +227 -0
  565. package/dist/docs/quickstart.md +306 -0
  566. package/dist/docs/reference/agent-config.html +91 -0
  567. package/dist/docs/reference/agent-config.md +188 -0
  568. package/dist/docs/reference/artifacts.html +77 -0
  569. package/dist/docs/reference/artifacts.md +116 -0
  570. package/dist/docs/reference/channels.html +82 -0
  571. package/dist/docs/reference/channels.md +198 -0
  572. package/dist/docs/reference/cli.html +156 -0
  573. package/dist/docs/reference/cli.md +904 -0
  574. package/dist/docs/reference/connections.html +122 -0
  575. package/dist/docs/reference/connections.md +272 -0
  576. package/dist/docs/reference/evals.html +115 -0
  577. package/dist/docs/reference/evals.md +287 -0
  578. package/dist/docs/reference/extensions.html +117 -0
  579. package/dist/docs/reference/extensions.md +193 -0
  580. package/dist/docs/reference/hooks.html +104 -0
  581. package/dist/docs/reference/hooks.md +190 -0
  582. package/dist/docs/reference/http-api.html +70 -0
  583. package/dist/docs/reference/http-api.md +231 -0
  584. package/dist/docs/reference/instructions.html +73 -0
  585. package/dist/docs/reference/instructions.md +63 -0
  586. package/dist/docs/reference/playground.html +60 -0
  587. package/dist/docs/reference/playground.md +42 -0
  588. package/dist/docs/reference/project-layout.html +84 -0
  589. package/dist/docs/reference/project-layout.md +115 -0
  590. package/dist/docs/reference/prompt.html +68 -0
  591. package/dist/docs/reference/prompt.md +50 -0
  592. package/dist/docs/reference/schedules.html +106 -0
  593. package/dist/docs/reference/schedules.md +170 -0
  594. package/dist/docs/reference/sessions.html +60 -0
  595. package/dist/docs/reference/sessions.md +160 -0
  596. package/dist/docs/reference/skills.html +74 -0
  597. package/dist/docs/reference/skills.md +75 -0
  598. package/dist/docs/reference/subagents.html +69 -0
  599. package/dist/docs/reference/subagents.md +62 -0
  600. package/dist/docs/reference/tools.html +149 -0
  601. package/dist/docs/reference/tools.md +324 -0
  602. package/dist/docs/templates/agentic-owners.html +73 -0
  603. package/dist/docs/templates/agentic-owners.md +95 -0
  604. package/dist/docs/templates/security-reviewer.html +61 -0
  605. package/dist/docs/templates/security-reviewer.md +85 -0
  606. package/dist/docs/templates/thermo-quality-review.html +62 -0
  607. package/dist/docs/templates/thermo-quality-review.md +78 -0
  608. package/dist/docs/templates/thermo-review.html +62 -0
  609. package/dist/docs/templates/thermo-review.md +77 -0
  610. package/dist/docs/templates/triage.html +68 -0
  611. package/dist/docs/templates/triage.md +97 -0
  612. package/dist/docs/troubleshooting.html +60 -0
  613. package/dist/docs/troubleshooting.md +143 -0
  614. package/dist/docs/vp-icons.css +0 -0
  615. package/dist/evals/assertions.d.ts +199 -0
  616. package/dist/evals/assertions.d.ts.map +1 -0
  617. package/dist/evals/assertions.js +459 -0
  618. package/dist/evals/expect.d.ts +95 -0
  619. package/dist/evals/expect.d.ts.map +1 -0
  620. package/dist/evals/expect.js +187 -0
  621. package/dist/evals/judge.d.ts +133 -0
  622. package/dist/evals/judge.d.ts.map +1 -0
  623. package/dist/evals/judge.js +224 -0
  624. package/dist/evals/loaders.d.ts +51 -0
  625. package/dist/evals/loaders.d.ts.map +1 -0
  626. package/dist/evals/loaders.js +124 -0
  627. package/dist/evals/matchers.d.ts +95 -0
  628. package/dist/evals/matchers.d.ts.map +1 -0
  629. package/dist/evals/matchers.js +142 -0
  630. package/dist/evals/reporters.d.ts +70 -0
  631. package/dist/evals/reporters.d.ts.map +1 -0
  632. package/dist/evals/reporters.js +220 -0
  633. package/dist/evals/results.d.ts +103 -0
  634. package/dist/evals/results.d.ts.map +1 -0
  635. package/dist/evals/results.js +27 -0
  636. package/dist/evals/run-facts.d.ts +77 -0
  637. package/dist/evals/run-facts.d.ts.map +1 -0
  638. package/dist/evals/run-facts.js +214 -0
  639. package/dist/evals.d.ts +446 -0
  640. package/dist/evals.d.ts.map +1 -0
  641. package/dist/evals.js +292 -0
  642. package/dist/extensions/cursor-cloud-agents/extension.d.ts +57 -0
  643. package/dist/extensions/cursor-cloud-agents/extension.d.ts.map +1 -0
  644. package/dist/extensions/cursor-cloud-agents/extension.js +66 -0
  645. package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts +78 -0
  646. package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts.map +1 -0
  647. package/dist/extensions/cursor-cloud-agents/lib/backend.js +280 -0
  648. package/dist/extensions/cursor-cloud-agents/lib/fleet.d.ts +25 -0
  649. package/dist/extensions/cursor-cloud-agents/lib/fleet.d.ts.map +1 -0
  650. package/dist/extensions/cursor-cloud-agents/lib/fleet.js +81 -0
  651. package/dist/extensions/cursor-cloud-agents/lib/inputs.d.ts +5 -0
  652. package/dist/extensions/cursor-cloud-agents/lib/inputs.d.ts.map +1 -0
  653. package/dist/extensions/cursor-cloud-agents/lib/inputs.js +4 -0
  654. package/dist/extensions/cursor-cloud-agents/lib/repos.d.ts +15 -0
  655. package/dist/extensions/cursor-cloud-agents/lib/repos.d.ts.map +1 -0
  656. package/dist/extensions/cursor-cloud-agents/lib/repos.js +53 -0
  657. package/dist/extensions/cursor-cloud-agents/lib/transcript.d.ts +8 -0
  658. package/dist/extensions/cursor-cloud-agents/lib/transcript.d.ts.map +1 -0
  659. package/dist/extensions/cursor-cloud-agents/lib/transcript.js +15 -0
  660. package/dist/extensions/cursor-cloud-agents/skills/handoff.md +37 -0
  661. package/dist/extensions/cursor-cloud-agents/tools/cancel.d.ts +4 -0
  662. package/dist/extensions/cursor-cloud-agents/tools/cancel.d.ts.map +1 -0
  663. package/dist/extensions/cursor-cloud-agents/tools/cancel.js +26 -0
  664. package/dist/extensions/cursor-cloud-agents/tools/dump.d.ts +4 -0
  665. package/dist/extensions/cursor-cloud-agents/tools/dump.d.ts.map +1 -0
  666. package/dist/extensions/cursor-cloud-agents/tools/dump.js +54 -0
  667. package/dist/extensions/cursor-cloud-agents/tools/get.d.ts +4 -0
  668. package/dist/extensions/cursor-cloud-agents/tools/get.d.ts.map +1 -0
  669. package/dist/extensions/cursor-cloud-agents/tools/get.js +25 -0
  670. package/dist/extensions/cursor-cloud-agents/tools/launch.d.ts +4 -0
  671. package/dist/extensions/cursor-cloud-agents/tools/launch.d.ts.map +1 -0
  672. package/dist/extensions/cursor-cloud-agents/tools/launch.js +59 -0
  673. package/dist/extensions/cursor-cloud-agents/tools/list.d.ts +4 -0
  674. package/dist/extensions/cursor-cloud-agents/tools/list.d.ts.map +1 -0
  675. package/dist/extensions/cursor-cloud-agents/tools/list.js +36 -0
  676. package/dist/extensions/cursor-cloud-agents/tools/reply.d.ts +4 -0
  677. package/dist/extensions/cursor-cloud-agents/tools/reply.d.ts.map +1 -0
  678. package/dist/extensions/cursor-cloud-agents/tools/reply.js +35 -0
  679. package/dist/extensions/improve/extension.d.ts +48 -0
  680. package/dist/extensions/improve/extension.d.ts.map +1 -0
  681. package/dist/extensions/improve/extension.js +43 -0
  682. package/dist/extensions/improve/skills/yourself.d.ts +4 -0
  683. package/dist/extensions/improve/skills/yourself.d.ts.map +1 -0
  684. package/dist/extensions/improve/skills/yourself.js +43 -0
  685. package/dist/extensions/jev/extension.d.ts +43 -0
  686. package/dist/extensions/jev/extension.d.ts.map +1 -0
  687. package/dist/extensions/jev/extension.js +47 -0
  688. package/dist/extensions/jev/lib/evaluate.d.ts +101 -0
  689. package/dist/extensions/jev/lib/evaluate.d.ts.map +1 -0
  690. package/dist/extensions/jev/lib/evaluate.js +167 -0
  691. package/dist/extensions/jev/skills/gated-write.md +25 -0
  692. package/dist/extensions/jev/skills/questions.md +33 -0
  693. package/dist/extensions/jev/tools/evaluate.d.ts +4 -0
  694. package/dist/extensions/jev/tools/evaluate.d.ts.map +1 -0
  695. package/dist/extensions/jev/tools/evaluate.js +83 -0
  696. package/dist/extensions/slack-communication/extension.d.ts +28 -0
  697. package/dist/extensions/slack-communication/extension.d.ts.map +1 -0
  698. package/dist/extensions/slack-communication/extension.js +32 -0
  699. package/dist/extensions/slack-communication/skills/slack-voice.d.ts +5 -0
  700. package/dist/extensions/slack-communication/skills/slack-voice.d.ts.map +1 -0
  701. package/dist/extensions/slack-communication/skills/slack-voice.js +52 -0
  702. package/dist/extensions/slack-communication/tools/delete-message.d.ts +4 -0
  703. package/dist/extensions/slack-communication/tools/delete-message.d.ts.map +1 -0
  704. package/dist/extensions/slack-communication/tools/delete-message.js +29 -0
  705. package/dist/extensions/slack-communication/tools/edit-message.d.ts +4 -0
  706. package/dist/extensions/slack-communication/tools/edit-message.d.ts.map +1 -0
  707. package/dist/extensions/slack-communication/tools/edit-message.js +37 -0
  708. package/dist/extensions/slack-communication/tools/post-card.d.ts +4 -0
  709. package/dist/extensions/slack-communication/tools/post-card.d.ts.map +1 -0
  710. package/dist/extensions/slack-communication/tools/post-card.js +25 -0
  711. package/dist/extensions/slack-communication/tools/post-file.d.ts +4 -0
  712. package/dist/extensions/slack-communication/tools/post-file.d.ts.map +1 -0
  713. package/dist/extensions/slack-communication/tools/post-file.js +75 -0
  714. package/dist/extensions/slack-communication/tools/post-update.d.ts +4 -0
  715. package/dist/extensions/slack-communication/tools/post-update.d.ts.map +1 -0
  716. package/dist/extensions/slack-communication/tools/post-update.js +36 -0
  717. package/dist/extensions/slack-communication/tools/react.d.ts +4 -0
  718. package/dist/extensions/slack-communication/tools/react.d.ts.map +1 -0
  719. package/dist/extensions/slack-communication/tools/react.js +27 -0
  720. package/dist/extensions/slack-communication/tools/set-status.d.ts +4 -0
  721. package/dist/extensions/slack-communication/tools/set-status.d.ts.map +1 -0
  722. package/dist/extensions/slack-communication/tools/set-status.js +18 -0
  723. package/dist/extensions.d.ts +85 -0
  724. package/dist/extensions.d.ts.map +1 -0
  725. package/dist/extensions.js +140 -0
  726. package/dist/files-backends/agent-store-presigned-url.d.ts +3 -0
  727. package/dist/files-backends/agent-store-presigned-url.d.ts.map +1 -0
  728. package/dist/files-backends/agent-store-presigned-url.js +223 -0
  729. package/dist/files-backends/cursor-hosted.d.ts +126 -0
  730. package/dist/files-backends/cursor-hosted.d.ts.map +1 -0
  731. package/dist/files-backends/cursor-hosted.js +978 -0
  732. package/dist/files-backends/local-fs.d.ts +33 -0
  733. package/dist/files-backends/local-fs.d.ts.map +1 -0
  734. package/dist/files-backends/local-fs.js +195 -0
  735. package/dist/files.d.ts +225 -0
  736. package/dist/files.d.ts.map +1 -0
  737. package/dist/files.js +152 -0
  738. package/dist/filesystem.d.ts +484 -0
  739. package/dist/filesystem.d.ts.map +1 -0
  740. package/dist/filesystem.js +1698 -0
  741. package/dist/hooks.d.ts +25 -0
  742. package/dist/hooks.d.ts.map +1 -0
  743. package/dist/hooks.js +25 -0
  744. package/dist/index.d.ts +84 -0
  745. package/dist/index.d.ts.map +1 -0
  746. package/dist/index.js +109 -0
  747. package/dist/internal/advertise-tools.d.ts +95 -0
  748. package/dist/internal/advertise-tools.d.ts.map +1 -0
  749. package/dist/internal/advertise-tools.js +265 -0
  750. package/dist/internal/approval-gate.d.ts +33 -0
  751. package/dist/internal/approval-gate.d.ts.map +1 -0
  752. package/dist/internal/approval-gate.js +80 -0
  753. package/dist/internal/artifacts-store.d.ts +125 -0
  754. package/dist/internal/artifacts-store.d.ts.map +1 -0
  755. package/dist/internal/artifacts-store.js +737 -0
  756. package/dist/internal/as-of.d.ts +37 -0
  757. package/dist/internal/as-of.d.ts.map +1 -0
  758. package/dist/internal/as-of.js +207 -0
  759. package/dist/internal/auth.d.ts +12 -0
  760. package/dist/internal/auth.d.ts.map +1 -0
  761. package/dist/internal/auth.js +34 -0
  762. package/dist/internal/authored-alias-hooks.d.ts +42 -0
  763. package/dist/internal/authored-alias-hooks.d.ts.map +1 -0
  764. package/dist/internal/authored-alias-hooks.js +93 -0
  765. package/dist/internal/authored-loaders.d.ts +50 -0
  766. package/dist/internal/authored-loaders.d.ts.map +1 -0
  767. package/dist/internal/authored-loaders.js +182 -0
  768. package/dist/internal/bounded-int.d.ts +11 -0
  769. package/dist/internal/bounded-int.d.ts.map +1 -0
  770. package/dist/internal/bounded-int.js +13 -0
  771. package/dist/internal/bounded.d.ts +7 -0
  772. package/dist/internal/bounded.d.ts.map +1 -0
  773. package/dist/internal/bounded.js +32 -0
  774. package/dist/internal/brand.d.ts +6 -0
  775. package/dist/internal/brand.d.ts.map +1 -0
  776. package/dist/internal/brand.js +17 -0
  777. package/dist/internal/browser-origin-guard.d.ts +19 -0
  778. package/dist/internal/browser-origin-guard.d.ts.map +1 -0
  779. package/dist/internal/browser-origin-guard.js +51 -0
  780. package/dist/internal/builtin-tools/artifacts.d.ts +10 -0
  781. package/dist/internal/builtin-tools/artifacts.d.ts.map +1 -0
  782. package/dist/internal/builtin-tools/artifacts.js +66 -0
  783. package/dist/internal/builtin-tools/index.d.ts +17 -0
  784. package/dist/internal/builtin-tools/index.d.ts.map +1 -0
  785. package/dist/internal/builtin-tools/index.js +40 -0
  786. package/dist/internal/builtin-tools/reminders.d.ts +9 -0
  787. package/dist/internal/builtin-tools/reminders.d.ts.map +1 -0
  788. package/dist/internal/builtin-tools/reminders.js +134 -0
  789. package/dist/internal/channel-dispatch.d.ts +43 -0
  790. package/dist/internal/channel-dispatch.d.ts.map +1 -0
  791. package/dist/internal/channel-dispatch.js +75 -0
  792. package/dist/internal/channel-route-dispatch.d.ts +13 -0
  793. package/dist/internal/channel-route-dispatch.d.ts.map +1 -0
  794. package/dist/internal/channel-route-dispatch.js +62 -0
  795. package/dist/internal/channel-state.d.ts +17 -0
  796. package/dist/internal/channel-state.d.ts.map +1 -0
  797. package/dist/internal/channel-state.js +69 -0
  798. package/dist/internal/chat-client.d.ts +45 -0
  799. package/dist/internal/chat-client.d.ts.map +1 -0
  800. package/dist/internal/chat-client.js +478 -0
  801. package/dist/internal/cli-ax.d.ts +233 -0
  802. package/dist/internal/cli-ax.d.ts.map +1 -0
  803. package/dist/internal/cli-ax.js +1864 -0
  804. package/dist/internal/cli-bitbucket.d.ts +33 -0
  805. package/dist/internal/cli-bitbucket.d.ts.map +1 -0
  806. package/dist/internal/cli-bitbucket.js +360 -0
  807. package/dist/internal/cli-convert-automation.d.ts +39 -0
  808. package/dist/internal/cli-convert-automation.d.ts.map +1 -0
  809. package/dist/internal/cli-convert-automation.js +281 -0
  810. package/dist/internal/cli-cursor.d.ts +38 -0
  811. package/dist/internal/cli-cursor.d.ts.map +1 -0
  812. package/dist/internal/cli-cursor.js +226 -0
  813. package/dist/internal/cli-deploy.d.ts +164 -0
  814. package/dist/internal/cli-deploy.d.ts.map +1 -0
  815. package/dist/internal/cli-deploy.js +1930 -0
  816. package/dist/internal/cli-docs.d.ts +34 -0
  817. package/dist/internal/cli-docs.d.ts.map +1 -0
  818. package/dist/internal/cli-docs.js +173 -0
  819. package/dist/internal/cli-github.d.ts +47 -0
  820. package/dist/internal/cli-github.d.ts.map +1 -0
  821. package/dist/internal/cli-github.js +639 -0
  822. package/dist/internal/cli-gitlab.d.ts +37 -0
  823. package/dist/internal/cli-gitlab.d.ts.map +1 -0
  824. package/dist/internal/cli-gitlab.js +379 -0
  825. package/dist/internal/cli-images.d.ts +68 -0
  826. package/dist/internal/cli-images.d.ts.map +1 -0
  827. package/dist/internal/cli-images.js +604 -0
  828. package/dist/internal/cli-manifest.d.ts +19 -0
  829. package/dist/internal/cli-manifest.d.ts.map +1 -0
  830. package/dist/internal/cli-manifest.js +49 -0
  831. package/dist/internal/cli-mcp-oauth.d.ts +51 -0
  832. package/dist/internal/cli-mcp-oauth.d.ts.map +1 -0
  833. package/dist/internal/cli-mcp-oauth.js +318 -0
  834. package/dist/internal/cli-mcp.d.ts +75 -0
  835. package/dist/internal/cli-mcp.d.ts.map +1 -0
  836. package/dist/internal/cli-mcp.js +684 -0
  837. package/dist/internal/cli-skills.d.ts +21 -0
  838. package/dist/internal/cli-skills.d.ts.map +1 -0
  839. package/dist/internal/cli-skills.js +77 -0
  840. package/dist/internal/cli-slack-manual.d.ts +42 -0
  841. package/dist/internal/cli-slack-manual.d.ts.map +1 -0
  842. package/dist/internal/cli-slack-manual.js +325 -0
  843. package/dist/internal/cli-slack.d.ts +59 -0
  844. package/dist/internal/cli-slack.d.ts.map +1 -0
  845. package/dist/internal/cli-slack.js +695 -0
  846. package/dist/internal/cloud-merge.d.ts +25 -0
  847. package/dist/internal/cloud-merge.d.ts.map +1 -0
  848. package/dist/internal/cloud-merge.js +36 -0
  849. package/dist/internal/cloud-turn-cost.d.ts +42 -0
  850. package/dist/internal/cloud-turn-cost.d.ts.map +1 -0
  851. package/dist/internal/cloud-turn-cost.js +113 -0
  852. package/dist/internal/continuation-channel.d.ts +48 -0
  853. package/dist/internal/continuation-channel.d.ts.map +1 -0
  854. package/dist/internal/continuation-channel.js +154 -0
  855. package/dist/internal/continuation-identity.d.ts +113 -0
  856. package/dist/internal/continuation-identity.d.ts.map +1 -0
  857. package/dist/internal/continuation-identity.js +749 -0
  858. package/dist/internal/conversation-mirror.d.ts +85 -0
  859. package/dist/internal/conversation-mirror.d.ts.map +1 -0
  860. package/dist/internal/conversation-mirror.js +342 -0
  861. package/dist/internal/convert-automation/convert-workflow.d.ts +10 -0
  862. package/dist/internal/convert-automation/convert-workflow.d.ts.map +1 -0
  863. package/dist/internal/convert-automation/convert-workflow.js +998 -0
  864. package/dist/internal/convert-automation/slug.d.ts +9 -0
  865. package/dist/internal/convert-automation/slug.d.ts.map +1 -0
  866. package/dist/internal/convert-automation/slug.js +28 -0
  867. package/dist/internal/convert-automation/types.d.ts +202 -0
  868. package/dist/internal/convert-automation/types.d.ts.map +1 -0
  869. package/dist/internal/convert-automation/types.js +13 -0
  870. package/dist/internal/cron.d.ts +17 -0
  871. package/dist/internal/cron.d.ts.map +1 -0
  872. package/dist/internal/cron.js +60 -0
  873. package/dist/internal/cursor/account-mcp.d.ts +135 -0
  874. package/dist/internal/cursor/account-mcp.d.ts.map +1 -0
  875. package/dist/internal/cursor/account-mcp.js +510 -0
  876. package/dist/internal/cursor/backend-client.d.ts +224 -0
  877. package/dist/internal/cursor/backend-client.d.ts.map +1 -0
  878. package/dist/internal/cursor/backend-client.js +720 -0
  879. package/dist/internal/cursor/bound-secret-file.d.ts +56 -0
  880. package/dist/internal/cursor/bound-secret-file.d.ts.map +1 -0
  881. package/dist/internal/cursor/bound-secret-file.js +88 -0
  882. package/dist/internal/cursor/credentials.d.ts +195 -0
  883. package/dist/internal/cursor/credentials.d.ts.map +1 -0
  884. package/dist/internal/cursor/credentials.js +475 -0
  885. package/dist/internal/cursor/cursor-api-transport.d.ts +37 -0
  886. package/dist/internal/cursor/cursor-api-transport.d.ts.map +1 -0
  887. package/dist/internal/cursor/cursor-api-transport.js +44 -0
  888. package/dist/internal/cursor/github-credentials.d.ts +44 -0
  889. package/dist/internal/cursor/github-credentials.d.ts.map +1 -0
  890. package/dist/internal/cursor/github-credentials.js +191 -0
  891. package/dist/internal/cursor/hosted-bound-secrets.d.ts +41 -0
  892. package/dist/internal/cursor/hosted-bound-secrets.d.ts.map +1 -0
  893. package/dist/internal/cursor/hosted-bound-secrets.js +54 -0
  894. package/dist/internal/cursor/hosted-deployment-secrets.d.ts +30 -0
  895. package/dist/internal/cursor/hosted-deployment-secrets.d.ts.map +1 -0
  896. package/dist/internal/cursor/hosted-deployment-secrets.js +81 -0
  897. package/dist/internal/cursor/hosted-store-secrets.d.ts +63 -0
  898. package/dist/internal/cursor/hosted-store-secrets.d.ts.map +1 -0
  899. package/dist/internal/cursor/hosted-store-secrets.js +112 -0
  900. package/dist/internal/cursor/session-token.d.ts +45 -0
  901. package/dist/internal/cursor/session-token.d.ts.map +1 -0
  902. package/dist/internal/cursor/session-token.js +97 -0
  903. package/dist/internal/cursor/store-api-client.d.ts +82 -0
  904. package/dist/internal/cursor/store-api-client.d.ts.map +1 -0
  905. package/dist/internal/cursor/store-api-client.js +226 -0
  906. package/dist/internal/cursor-account-mcp-auth.d.ts +66 -0
  907. package/dist/internal/cursor-account-mcp-auth.d.ts.map +1 -0
  908. package/dist/internal/cursor-account-mcp-auth.js +241 -0
  909. package/dist/internal/cursor-agent-template.d.ts +9 -0
  910. package/dist/internal/cursor-agent-template.d.ts.map +1 -0
  911. package/dist/internal/cursor-agent-template.js +43 -0
  912. package/dist/internal/cursor-deployment-relay.d.ts +95 -0
  913. package/dist/internal/cursor-deployment-relay.d.ts.map +1 -0
  914. package/dist/internal/cursor-deployment-relay.js +233 -0
  915. package/dist/internal/cursor-event-relay.d.ts +243 -0
  916. package/dist/internal/cursor-event-relay.d.ts.map +1 -0
  917. package/dist/internal/cursor-event-relay.js +424 -0
  918. package/dist/internal/cursor-relay-core.d.ts +160 -0
  919. package/dist/internal/cursor-relay-core.d.ts.map +1 -0
  920. package/dist/internal/cursor-relay-core.js +470 -0
  921. package/dist/internal/deferred-channel-session.d.ts +20 -0
  922. package/dist/internal/deferred-channel-session.d.ts.map +1 -0
  923. package/dist/internal/deferred-channel-session.js +62 -0
  924. package/dist/internal/deploy-client.d.ts +576 -0
  925. package/dist/internal/deploy-client.d.ts.map +1 -0
  926. package/dist/internal/deploy-client.js +987 -0
  927. package/dist/internal/deploy-manifest.d.ts +135 -0
  928. package/dist/internal/deploy-manifest.d.ts.map +1 -0
  929. package/dist/internal/deploy-manifest.js +231 -0
  930. package/dist/internal/deploy-source.d.ts +38 -0
  931. package/dist/internal/deploy-source.d.ts.map +1 -0
  932. package/dist/internal/deploy-source.js +136 -0
  933. package/dist/internal/describe-error.d.ts +4 -0
  934. package/dist/internal/describe-error.d.ts.map +1 -0
  935. package/dist/internal/describe-error.js +29 -0
  936. package/dist/internal/dev-mode.d.ts +13 -0
  937. package/dist/internal/dev-mode.d.ts.map +1 -0
  938. package/dist/internal/dev-mode.js +17 -0
  939. package/dist/internal/discovery/agent-config.d.ts +48 -0
  940. package/dist/internal/discovery/agent-config.d.ts.map +1 -0
  941. package/dist/internal/discovery/agent-config.js +224 -0
  942. package/dist/internal/discovery/agent.d.ts +16 -0
  943. package/dist/internal/discovery/agent.d.ts.map +1 -0
  944. package/dist/internal/discovery/agent.js +326 -0
  945. package/dist/internal/discovery/channels.d.ts +10 -0
  946. package/dist/internal/discovery/channels.d.ts.map +1 -0
  947. package/dist/internal/discovery/channels.js +97 -0
  948. package/dist/internal/discovery/connections.d.ts +13 -0
  949. package/dist/internal/discovery/connections.d.ts.map +1 -0
  950. package/dist/internal/discovery/connections.js +429 -0
  951. package/dist/internal/discovery/context.d.ts +20 -0
  952. package/dist/internal/discovery/context.d.ts.map +1 -0
  953. package/dist/internal/discovery/context.js +30 -0
  954. package/dist/internal/discovery/cursor-plugin.d.ts +25 -0
  955. package/dist/internal/discovery/cursor-plugin.d.ts.map +1 -0
  956. package/dist/internal/discovery/cursor-plugin.js +549 -0
  957. package/dist/internal/discovery/extension-overlay.d.ts +31 -0
  958. package/dist/internal/discovery/extension-overlay.d.ts.map +1 -0
  959. package/dist/internal/discovery/extension-overlay.js +173 -0
  960. package/dist/internal/discovery/extensions.d.ts +27 -0
  961. package/dist/internal/discovery/extensions.d.ts.map +1 -0
  962. package/dist/internal/discovery/extensions.js +352 -0
  963. package/dist/internal/discovery/fs.d.ts +15 -0
  964. package/dist/internal/discovery/fs.d.ts.map +1 -0
  965. package/dist/internal/discovery/fs.js +115 -0
  966. package/dist/internal/discovery/hooks.d.ts +7 -0
  967. package/dist/internal/discovery/hooks.d.ts.map +1 -0
  968. package/dist/internal/discovery/hooks.js +61 -0
  969. package/dist/internal/discovery/info.d.ts +6 -0
  970. package/dist/internal/discovery/info.d.ts.map +1 -0
  971. package/dist/internal/discovery/info.js +168 -0
  972. package/dist/internal/discovery/instructions.d.ts +7 -0
  973. package/dist/internal/discovery/instructions.d.ts.map +1 -0
  974. package/dist/internal/discovery/instructions.js +95 -0
  975. package/dist/internal/discovery/modules.d.ts +20 -0
  976. package/dist/internal/discovery/modules.d.ts.map +1 -0
  977. package/dist/internal/discovery/modules.js +104 -0
  978. package/dist/internal/discovery/names.d.ts +12 -0
  979. package/dist/internal/discovery/names.d.ts.map +1 -0
  980. package/dist/internal/discovery/names.js +37 -0
  981. package/dist/internal/discovery/project.d.ts +51 -0
  982. package/dist/internal/discovery/project.d.ts.map +1 -0
  983. package/dist/internal/discovery/project.js +290 -0
  984. package/dist/internal/discovery/reminders.d.ts +7 -0
  985. package/dist/internal/discovery/reminders.d.ts.map +1 -0
  986. package/dist/internal/discovery/reminders.js +65 -0
  987. package/dist/internal/discovery/runtime.d.ts +34 -0
  988. package/dist/internal/discovery/runtime.d.ts.map +1 -0
  989. package/dist/internal/discovery/runtime.js +97 -0
  990. package/dist/internal/discovery/schedules.d.ts +7 -0
  991. package/dist/internal/discovery/schedules.d.ts.map +1 -0
  992. package/dist/internal/discovery/schedules.js +118 -0
  993. package/dist/internal/discovery/seed-files.d.ts +7 -0
  994. package/dist/internal/discovery/seed-files.d.ts.map +1 -0
  995. package/dist/internal/discovery/seed-files.js +41 -0
  996. package/dist/internal/discovery/services.d.ts +26 -0
  997. package/dist/internal/discovery/services.d.ts.map +1 -0
  998. package/dist/internal/discovery/services.js +138 -0
  999. package/dist/internal/discovery/skills.d.ts +11 -0
  1000. package/dist/internal/discovery/skills.d.ts.map +1 -0
  1001. package/dist/internal/discovery/skills.js +156 -0
  1002. package/dist/internal/discovery/subagent.d.ts +16 -0
  1003. package/dist/internal/discovery/subagent.d.ts.map +1 -0
  1004. package/dist/internal/discovery/subagent.js +129 -0
  1005. package/dist/internal/discovery/tools.d.ts +18 -0
  1006. package/dist/internal/discovery/tools.d.ts.map +1 -0
  1007. package/dist/internal/discovery/tools.js +155 -0
  1008. package/dist/internal/discovery.d.ts +15 -0
  1009. package/dist/internal/discovery.d.ts.map +1 -0
  1010. package/dist/internal/discovery.js +13 -0
  1011. package/dist/internal/distribution.d.ts +65 -0
  1012. package/dist/internal/distribution.d.ts.map +1 -0
  1013. package/dist/internal/distribution.js +102 -0
  1014. package/dist/internal/docs-site.d.ts +41 -0
  1015. package/dist/internal/docs-site.d.ts.map +1 -0
  1016. package/dist/internal/docs-site.js +234 -0
  1017. package/dist/internal/duration.d.ts +8 -0
  1018. package/dist/internal/duration.d.ts.map +1 -0
  1019. package/dist/internal/duration.js +35 -0
  1020. package/dist/internal/env-file.d.ts +19 -0
  1021. package/dist/internal/env-file.d.ts.map +1 -0
  1022. package/dist/internal/env-file.js +90 -0
  1023. package/dist/internal/eval-judge-model.d.ts +59 -0
  1024. package/dist/internal/eval-judge-model.d.ts.map +1 -0
  1025. package/dist/internal/eval-judge-model.js +129 -0
  1026. package/dist/internal/eval-run-store.d.ts +119 -0
  1027. package/dist/internal/eval-run-store.d.ts.map +1 -0
  1028. package/dist/internal/eval-run-store.js +468 -0
  1029. package/dist/internal/eval-runner.d.ts +98 -0
  1030. package/dist/internal/eval-runner.d.ts.map +1 -0
  1031. package/dist/internal/eval-runner.js +615 -0
  1032. package/dist/internal/evals-client.d.ts +104 -0
  1033. package/dist/internal/evals-client.d.ts.map +1 -0
  1034. package/dist/internal/evals-client.js +303 -0
  1035. package/dist/internal/event-log.d.ts +94 -0
  1036. package/dist/internal/event-log.d.ts.map +1 -0
  1037. package/dist/internal/event-log.js +347 -0
  1038. package/dist/internal/event-mapper.d.ts +123 -0
  1039. package/dist/internal/event-mapper.d.ts.map +1 -0
  1040. package/dist/internal/event-mapper.js +370 -0
  1041. package/dist/internal/expected-delivery-failure.d.ts +3 -0
  1042. package/dist/internal/expected-delivery-failure.d.ts.map +1 -0
  1043. package/dist/internal/expected-delivery-failure.js +28 -0
  1044. package/dist/internal/factory-resource-channel.d.ts +33 -0
  1045. package/dist/internal/factory-resource-channel.d.ts.map +1 -0
  1046. package/dist/internal/factory-resource-channel.js +77 -0
  1047. package/dist/internal/filesystem/errors.d.ts +64 -0
  1048. package/dist/internal/filesystem/errors.d.ts.map +1 -0
  1049. package/dist/internal/filesystem/errors.js +172 -0
  1050. package/dist/internal/filesystem/format.d.ts +28 -0
  1051. package/dist/internal/filesystem/format.d.ts.map +1 -0
  1052. package/dist/internal/filesystem/format.js +212 -0
  1053. package/dist/internal/filesystem/merge.d.ts +34 -0
  1054. package/dist/internal/filesystem/merge.d.ts.map +1 -0
  1055. package/dist/internal/filesystem/merge.js +196 -0
  1056. package/dist/internal/filesystem/nearest.d.ts +14 -0
  1057. package/dist/internal/filesystem/nearest.d.ts.map +1 -0
  1058. package/dist/internal/filesystem/nearest.js +101 -0
  1059. package/dist/internal/filesystem/scratch.d.ts +59 -0
  1060. package/dist/internal/filesystem/scratch.d.ts.map +1 -0
  1061. package/dist/internal/filesystem/scratch.js +204 -0
  1062. package/dist/internal/filesystem/sdk-schemas.d.ts +29 -0
  1063. package/dist/internal/filesystem/sdk-schemas.d.ts.map +1 -0
  1064. package/dist/internal/filesystem/sdk-schemas.js +153 -0
  1065. package/dist/internal/filesystem/tools.d.ts +42 -0
  1066. package/dist/internal/filesystem/tools.d.ts.map +1 -0
  1067. package/dist/internal/filesystem/tools.js +631 -0
  1068. package/dist/internal/filesystem/walk.d.ts +77 -0
  1069. package/dist/internal/filesystem/walk.d.ts.map +1 -0
  1070. package/dist/internal/filesystem/walk.js +350 -0
  1071. package/dist/internal/framework-file-storage.d.ts +75 -0
  1072. package/dist/internal/framework-file-storage.d.ts.map +1 -0
  1073. package/dist/internal/framework-file-storage.js +338 -0
  1074. package/dist/internal/framework-storage-selection.d.ts +66 -0
  1075. package/dist/internal/framework-storage-selection.d.ts.map +1 -0
  1076. package/dist/internal/framework-storage-selection.js +123 -0
  1077. package/dist/internal/frontmatter.d.ts +20 -0
  1078. package/dist/internal/frontmatter.d.ts.map +1 -0
  1079. package/dist/internal/frontmatter.js +87 -0
  1080. package/dist/internal/github-fanout.d.ts +32 -0
  1081. package/dist/internal/github-fanout.d.ts.map +1 -0
  1082. package/dist/internal/github-fanout.js +120 -0
  1083. package/dist/internal/guest-network.d.ts +98 -0
  1084. package/dist/internal/guest-network.d.ts.map +1 -0
  1085. package/dist/internal/guest-network.js +326 -0
  1086. package/dist/internal/handleAgentServeTrigger.d.ts +91 -0
  1087. package/dist/internal/handleAgentServeTrigger.d.ts.map +1 -0
  1088. package/dist/internal/handleAgentServeTrigger.js +199 -0
  1089. package/dist/internal/host-files.d.ts +29 -0
  1090. package/dist/internal/host-files.d.ts.map +1 -0
  1091. package/dist/internal/host-files.js +274 -0
  1092. package/dist/internal/host-kv.d.ts +21 -0
  1093. package/dist/internal/host-kv.d.ts.map +1 -0
  1094. package/dist/internal/host-kv.js +77 -0
  1095. package/dist/internal/host-otel.d.ts +25 -0
  1096. package/dist/internal/host-otel.d.ts.map +1 -0
  1097. package/dist/internal/host-otel.js +162 -0
  1098. package/dist/internal/host-platforms.d.ts +58 -0
  1099. package/dist/internal/host-platforms.d.ts.map +1 -0
  1100. package/dist/internal/host-platforms.js +126 -0
  1101. package/dist/internal/hosted-admission-adapter.d.ts +36 -0
  1102. package/dist/internal/hosted-admission-adapter.d.ts.map +1 -0
  1103. package/dist/internal/hosted-admission-adapter.js +7 -0
  1104. package/dist/internal/hosted-admission-context.d.ts +20 -0
  1105. package/dist/internal/hosted-admission-context.d.ts.map +1 -0
  1106. package/dist/internal/hosted-admission-context.js +31 -0
  1107. package/dist/internal/hosted-catch-protocol.d.ts +51 -0
  1108. package/dist/internal/hosted-catch-protocol.d.ts.map +1 -0
  1109. package/dist/internal/hosted-catch-protocol.js +87 -0
  1110. package/dist/internal/hosted-catch.d.ts +40 -0
  1111. package/dist/internal/hosted-catch.d.ts.map +1 -0
  1112. package/dist/internal/hosted-catch.js +146 -0
  1113. package/dist/internal/hosted-delivery-protocol.d.ts +199 -0
  1114. package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -0
  1115. package/dist/internal/hosted-delivery-protocol.js +516 -0
  1116. package/dist/internal/hosted-delivery.d.ts +110 -0
  1117. package/dist/internal/hosted-delivery.d.ts.map +1 -0
  1118. package/dist/internal/hosted-delivery.js +768 -0
  1119. package/dist/internal/hosted-execution-diag.d.ts +75 -0
  1120. package/dist/internal/hosted-execution-diag.d.ts.map +1 -0
  1121. package/dist/internal/hosted-execution-diag.js +220 -0
  1122. package/dist/internal/hosted-execution-flush.d.ts +50 -0
  1123. package/dist/internal/hosted-execution-flush.d.ts.map +1 -0
  1124. package/dist/internal/hosted-execution-flush.js +71 -0
  1125. package/dist/internal/hosted-execution-latency.d.ts +80 -0
  1126. package/dist/internal/hosted-execution-latency.d.ts.map +1 -0
  1127. package/dist/internal/hosted-execution-latency.js +218 -0
  1128. package/dist/internal/hosted-managed-automation.d.ts +30 -0
  1129. package/dist/internal/hosted-managed-automation.d.ts.map +1 -0
  1130. package/dist/internal/hosted-managed-automation.js +83 -0
  1131. package/dist/internal/hosting.d.ts +53 -0
  1132. package/dist/internal/hosting.d.ts.map +1 -0
  1133. package/dist/internal/hosting.js +93 -0
  1134. package/dist/internal/http-channel-define.d.ts +11 -0
  1135. package/dist/internal/http-channel-define.d.ts.map +1 -0
  1136. package/dist/internal/http-channel-define.js +18 -0
  1137. package/dist/internal/http-channel.d.ts +54 -0
  1138. package/dist/internal/http-channel.d.ts.map +1 -0
  1139. package/dist/internal/http-channel.js +534 -0
  1140. package/dist/internal/http-control-plane-session.d.ts +34 -0
  1141. package/dist/internal/http-control-plane-session.d.ts.map +1 -0
  1142. package/dist/internal/http-control-plane-session.js +93 -0
  1143. package/dist/internal/ids.d.ts +19 -0
  1144. package/dist/internal/ids.d.ts.map +1 -0
  1145. package/dist/internal/ids.js +34 -0
  1146. package/dist/internal/incoming-headers-to-fetch.d.ts +10 -0
  1147. package/dist/internal/incoming-headers-to-fetch.d.ts.map +1 -0
  1148. package/dist/internal/incoming-headers-to-fetch.js +41 -0
  1149. package/dist/internal/init-interview.d.ts +67 -0
  1150. package/dist/internal/init-interview.d.ts.map +1 -0
  1151. package/dist/internal/init-interview.js +295 -0
  1152. package/dist/internal/init-project.d.ts +175 -0
  1153. package/dist/internal/init-project.d.ts.map +1 -0
  1154. package/dist/internal/init-project.js +531 -0
  1155. package/dist/internal/init-scaffold.d.ts +9 -0
  1156. package/dist/internal/init-scaffold.d.ts.map +1 -0
  1157. package/dist/internal/init-scaffold.js +172 -0
  1158. package/dist/internal/inline-stdio-define-stub.d.ts +3 -0
  1159. package/dist/internal/inline-stdio-define-stub.d.ts.map +1 -0
  1160. package/dist/internal/inline-stdio-define-stub.js +4 -0
  1161. package/dist/internal/inline-stdio-mcp.d.ts +34 -0
  1162. package/dist/internal/inline-stdio-mcp.d.ts.map +1 -0
  1163. package/dist/internal/inline-stdio-mcp.js +176 -0
  1164. package/dist/internal/install-cursor-skills.d.ts +164 -0
  1165. package/dist/internal/install-cursor-skills.d.ts.map +1 -0
  1166. package/dist/internal/install-cursor-skills.js +498 -0
  1167. package/dist/internal/is-record.d.ts +2 -0
  1168. package/dist/internal/is-record.d.ts.map +1 -0
  1169. package/dist/internal/is-record.js +3 -0
  1170. package/dist/internal/json-schema.d.ts +25 -0
  1171. package/dist/internal/json-schema.d.ts.map +1 -0
  1172. package/dist/internal/json-schema.js +76 -0
  1173. package/dist/internal/legacy-command-guard.d.ts +22 -0
  1174. package/dist/internal/legacy-command-guard.d.ts.map +1 -0
  1175. package/dist/internal/legacy-command-guard.js +51 -0
  1176. package/dist/internal/listen-port.d.ts +22 -0
  1177. package/dist/internal/listen-port.d.ts.map +1 -0
  1178. package/dist/internal/listen-port.js +77 -0
  1179. package/dist/internal/local-control-plane.d.ts +59 -0
  1180. package/dist/internal/local-control-plane.d.ts.map +1 -0
  1181. package/dist/internal/local-control-plane.js +351 -0
  1182. package/dist/internal/local-env.d.ts +10 -0
  1183. package/dist/internal/local-env.d.ts.map +1 -0
  1184. package/dist/internal/local-env.js +55 -0
  1185. package/dist/internal/local-ingress.d.ts +35 -0
  1186. package/dist/internal/local-ingress.d.ts.map +1 -0
  1187. package/dist/internal/local-ingress.js +44 -0
  1188. package/dist/internal/log-ring.d.ts +23 -0
  1189. package/dist/internal/log-ring.d.ts.map +1 -0
  1190. package/dist/internal/log-ring.js +42 -0
  1191. package/dist/internal/logs-client.d.ts +79 -0
  1192. package/dist/internal/logs-client.d.ts.map +1 -0
  1193. package/dist/internal/logs-client.js +350 -0
  1194. package/dist/internal/map-pool.d.ts +11 -0
  1195. package/dist/internal/map-pool.d.ts.map +1 -0
  1196. package/dist/internal/map-pool.js +48 -0
  1197. package/dist/internal/mcp-endpoint.d.ts +72 -0
  1198. package/dist/internal/mcp-endpoint.d.ts.map +1 -0
  1199. package/dist/internal/mcp-endpoint.js +530 -0
  1200. package/dist/internal/mcp-host.d.ts +84 -0
  1201. package/dist/internal/mcp-host.d.ts.map +1 -0
  1202. package/dist/internal/mcp-host.js +391 -0
  1203. package/dist/internal/mcp-oauth-on-demand.d.ts +68 -0
  1204. package/dist/internal/mcp-oauth-on-demand.d.ts.map +1 -0
  1205. package/dist/internal/mcp-oauth-on-demand.js +287 -0
  1206. package/dist/internal/mcp-oauth-persist.d.ts +42 -0
  1207. package/dist/internal/mcp-oauth-persist.d.ts.map +1 -0
  1208. package/dist/internal/mcp-oauth-persist.js +90 -0
  1209. package/dist/internal/mcp-oauth.d.ts +118 -0
  1210. package/dist/internal/mcp-oauth.d.ts.map +1 -0
  1211. package/dist/internal/mcp-oauth.js +450 -0
  1212. package/dist/internal/net.d.ts +5 -0
  1213. package/dist/internal/net.d.ts.map +1 -0
  1214. package/dist/internal/net.js +28 -0
  1215. package/dist/internal/open-browser.d.ts +5 -0
  1216. package/dist/internal/open-browser.d.ts.map +1 -0
  1217. package/dist/internal/open-browser.js +34 -0
  1218. package/dist/internal/otel/attrs.d.ts +7 -0
  1219. package/dist/internal/otel/attrs.d.ts.map +1 -0
  1220. package/dist/internal/otel/attrs.js +13 -0
  1221. package/dist/internal/otel/collector.d.ts +43 -0
  1222. package/dist/internal/otel/collector.d.ts.map +1 -0
  1223. package/dist/internal/otel/collector.js +650 -0
  1224. package/dist/internal/otel/config.d.ts +40 -0
  1225. package/dist/internal/otel/config.d.ts.map +1 -0
  1226. package/dist/internal/otel/config.js +231 -0
  1227. package/dist/internal/otel/http.d.ts +13 -0
  1228. package/dist/internal/otel/http.d.ts.map +1 -0
  1229. package/dist/internal/otel/http.js +95 -0
  1230. package/dist/internal/otel/mcp.d.ts +16 -0
  1231. package/dist/internal/otel/mcp.d.ts.map +1 -0
  1232. package/dist/internal/otel/mcp.js +55 -0
  1233. package/dist/internal/otel/propagation.d.ts +6 -0
  1234. package/dist/internal/otel/propagation.d.ts.map +1 -0
  1235. package/dist/internal/otel/propagation.js +14 -0
  1236. package/dist/internal/otel/runtime.d.ts +46 -0
  1237. package/dist/internal/otel/runtime.d.ts.map +1 -0
  1238. package/dist/internal/otel/runtime.js +333 -0
  1239. package/dist/internal/package-inline-stdio.d.ts +12 -0
  1240. package/dist/internal/package-inline-stdio.d.ts.map +1 -0
  1241. package/dist/internal/package-inline-stdio.js +99 -0
  1242. package/dist/internal/peer-connections.d.ts +44 -0
  1243. package/dist/internal/peer-connections.d.ts.map +1 -0
  1244. package/dist/internal/peer-connections.js +67 -0
  1245. package/dist/internal/platform-schedule-sync.d.ts +17 -0
  1246. package/dist/internal/platform-schedule-sync.d.ts.map +1 -0
  1247. package/dist/internal/platform-schedule-sync.js +70 -0
  1248. package/dist/internal/platform-timers.d.ts +35 -0
  1249. package/dist/internal/platform-timers.d.ts.map +1 -0
  1250. package/dist/internal/platform-timers.js +277 -0
  1251. package/dist/internal/playground/static.d.ts +52 -0
  1252. package/dist/internal/playground/static.d.ts.map +1 -0
  1253. package/dist/internal/playground/static.js +231 -0
  1254. package/dist/internal/playground/toolchain.d.ts +57 -0
  1255. package/dist/internal/playground/toolchain.d.ts.map +1 -0
  1256. package/dist/internal/playground/toolchain.js +229 -0
  1257. package/dist/internal/playground-proxy.d.ts +69 -0
  1258. package/dist/internal/playground-proxy.d.ts.map +1 -0
  1259. package/dist/internal/playground-proxy.js +474 -0
  1260. package/dist/internal/process-memory-telemetry.d.ts +89 -0
  1261. package/dist/internal/process-memory-telemetry.d.ts.map +1 -0
  1262. package/dist/internal/process-memory-telemetry.js +244 -0
  1263. package/dist/internal/project-layout.d.ts +7 -0
  1264. package/dist/internal/project-layout.d.ts.map +1 -0
  1265. package/dist/internal/project-layout.js +24 -0
  1266. package/dist/internal/prompt-context.d.ts +38 -0
  1267. package/dist/internal/prompt-context.d.ts.map +1 -0
  1268. package/dist/internal/prompt-context.js +89 -0
  1269. package/dist/internal/reminder-control-plane-protocol.d.ts +189 -0
  1270. package/dist/internal/reminder-control-plane-protocol.d.ts.map +1 -0
  1271. package/dist/internal/reminder-control-plane-protocol.js +246 -0
  1272. package/dist/internal/reminder-runner.d.ts +208 -0
  1273. package/dist/internal/reminder-runner.d.ts.map +1 -0
  1274. package/dist/internal/reminder-runner.js +1231 -0
  1275. package/dist/internal/reminder-schedule.d.ts +25 -0
  1276. package/dist/internal/reminder-schedule.d.ts.map +1 -0
  1277. package/dist/internal/reminder-schedule.js +82 -0
  1278. package/dist/internal/reminder-store.d.ts +78 -0
  1279. package/dist/internal/reminder-store.d.ts.map +1 -0
  1280. package/dist/internal/reminder-store.js +126 -0
  1281. package/dist/internal/request-error-status.d.ts +14 -0
  1282. package/dist/internal/request-error-status.d.ts.map +1 -0
  1283. package/dist/internal/request-error-status.js +76 -0
  1284. package/dist/internal/request-headers.d.ts +11 -0
  1285. package/dist/internal/request-headers.d.ts.map +1 -0
  1286. package/dist/internal/request-headers.js +14 -0
  1287. package/dist/internal/resolve-prod-target.d.ts +84 -0
  1288. package/dist/internal/resolve-prod-target.d.ts.map +1 -0
  1289. package/dist/internal/resolve-prod-target.js +259 -0
  1290. package/dist/internal/resolved-connections.d.ts +62 -0
  1291. package/dist/internal/resolved-connections.d.ts.map +1 -0
  1292. package/dist/internal/resolved-connections.js +93 -0
  1293. package/dist/internal/router.d.ts +33 -0
  1294. package/dist/internal/router.d.ts.map +1 -0
  1295. package/dist/internal/router.js +93 -0
  1296. package/dist/internal/run-client.d.ts +68 -0
  1297. package/dist/internal/run-client.d.ts.map +1 -0
  1298. package/dist/internal/run-client.js +239 -0
  1299. package/dist/internal/runtime-dispatch-runner.d.ts +24 -0
  1300. package/dist/internal/runtime-dispatch-runner.d.ts.map +1 -0
  1301. package/dist/internal/runtime-dispatch-runner.js +54 -0
  1302. package/dist/internal/sanitize-mcp-tool-name.d.ts +20 -0
  1303. package/dist/internal/sanitize-mcp-tool-name.d.ts.map +1 -0
  1304. package/dist/internal/sanitize-mcp-tool-name.js +28 -0
  1305. package/dist/internal/schedule-runner.d.ts +31 -0
  1306. package/dist/internal/schedule-runner.d.ts.map +1 -0
  1307. package/dist/internal/schedule-runner.js +127 -0
  1308. package/dist/internal/scm/pr-url.d.ts +56 -0
  1309. package/dist/internal/scm/pr-url.d.ts.map +1 -0
  1310. package/dist/internal/scm/pr-url.js +152 -0
  1311. package/dist/internal/sdk-runner.d.ts +190 -0
  1312. package/dist/internal/sdk-runner.d.ts.map +1 -0
  1313. package/dist/internal/sdk-runner.js +714 -0
  1314. package/dist/internal/serve-restart.d.ts +42 -0
  1315. package/dist/internal/serve-restart.d.ts.map +1 -0
  1316. package/dist/internal/serve-restart.js +85 -0
  1317. package/dist/internal/server.d.ts +34 -0
  1318. package/dist/internal/server.d.ts.map +1 -0
  1319. package/dist/internal/server.js +2464 -0
  1320. package/dist/internal/session-cost.d.ts +50 -0
  1321. package/dist/internal/session-cost.d.ts.map +1 -0
  1322. package/dist/internal/session-cost.js +157 -0
  1323. package/dist/internal/session-engine.d.ts +912 -0
  1324. package/dist/internal/session-engine.d.ts.map +1 -0
  1325. package/dist/internal/session-engine.js +4493 -0
  1326. package/dist/internal/session-links.d.ts +14 -0
  1327. package/dist/internal/session-links.d.ts.map +1 -0
  1328. package/dist/internal/session-links.js +67 -0
  1329. package/dist/internal/session-run-log.d.ts +122 -0
  1330. package/dist/internal/session-run-log.d.ts.map +1 -0
  1331. package/dist/internal/session-run-log.js +345 -0
  1332. package/dist/internal/session-store.d.ts +73 -0
  1333. package/dist/internal/session-store.d.ts.map +1 -0
  1334. package/dist/internal/session-store.js +310 -0
  1335. package/dist/internal/session-urls.d.ts +10 -0
  1336. package/dist/internal/session-urls.d.ts.map +1 -0
  1337. package/dist/internal/session-urls.js +25 -0
  1338. package/dist/internal/sessions-client.d.ts +50 -0
  1339. package/dist/internal/sessions-client.d.ts.map +1 -0
  1340. package/dist/internal/sessions-client.js +207 -0
  1341. package/dist/internal/skill-catalog.d.ts +28 -0
  1342. package/dist/internal/skill-catalog.d.ts.map +1 -0
  1343. package/dist/internal/skill-catalog.js +41 -0
  1344. package/dist/internal/skills-sync.d.ts +24 -0
  1345. package/dist/internal/skills-sync.d.ts.map +1 -0
  1346. package/dist/internal/skills-sync.js +56 -0
  1347. package/dist/internal/slack-provision-client.d.ts +198 -0
  1348. package/dist/internal/slack-provision-client.d.ts.map +1 -0
  1349. package/dist/internal/slack-provision-client.js +346 -0
  1350. package/dist/internal/slack-thread-key.d.ts +7 -0
  1351. package/dist/internal/slack-thread-key.d.ts.map +1 -0
  1352. package/dist/internal/slack-thread-key.js +10 -0
  1353. package/dist/internal/sleep.d.ts +2 -0
  1354. package/dist/internal/sleep.d.ts.map +1 -0
  1355. package/dist/internal/sleep.js +3 -0
  1356. package/dist/internal/start-log-store.d.ts +60 -0
  1357. package/dist/internal/start-log-store.d.ts.map +1 -0
  1358. package/dist/internal/start-log-store.js +149 -0
  1359. package/dist/internal/steering.d.ts +15 -0
  1360. package/dist/internal/steering.d.ts.map +1 -0
  1361. package/dist/internal/steering.js +18 -0
  1362. package/dist/internal/storage-coordinator.d.ts +203 -0
  1363. package/dist/internal/storage-coordinator.d.ts.map +1 -0
  1364. package/dist/internal/storage-coordinator.js +705 -0
  1365. package/dist/internal/storage-roles.d.ts +78 -0
  1366. package/dist/internal/storage-roles.d.ts.map +1 -0
  1367. package/dist/internal/storage-roles.js +24 -0
  1368. package/dist/internal/storage.d.ts +2 -0
  1369. package/dist/internal/storage.d.ts.map +1 -0
  1370. package/dist/internal/storage.js +1 -0
  1371. package/dist/internal/store-api-protocol.d.ts +134 -0
  1372. package/dist/internal/store-api-protocol.d.ts.map +1 -0
  1373. package/dist/internal/store-api-protocol.js +124 -0
  1374. package/dist/internal/store-mirror.d.ts +29 -0
  1375. package/dist/internal/store-mirror.d.ts.map +1 -0
  1376. package/dist/internal/store-mirror.js +70 -0
  1377. package/dist/internal/stream-progress.d.ts +14 -0
  1378. package/dist/internal/stream-progress.d.ts.map +1 -0
  1379. package/dist/internal/stream-progress.js +229 -0
  1380. package/dist/internal/terminal-style.d.ts +40 -0
  1381. package/dist/internal/terminal-style.d.ts.map +1 -0
  1382. package/dist/internal/terminal-style.js +94 -0
  1383. package/dist/internal/testing/factory-resource-fixtures.d.ts +48 -0
  1384. package/dist/internal/testing/factory-resource-fixtures.d.ts.map +1 -0
  1385. package/dist/internal/testing/factory-resource-fixtures.js +41 -0
  1386. package/dist/internal/testing/scm-continuation-fixtures.d.ts +33 -0
  1387. package/dist/internal/testing/scm-continuation-fixtures.d.ts.map +1 -0
  1388. package/dist/internal/testing/scm-continuation-fixtures.js +253 -0
  1389. package/dist/internal/tool-catalog.d.ts +31 -0
  1390. package/dist/internal/tool-catalog.d.ts.map +1 -0
  1391. package/dist/internal/tool-catalog.js +70 -0
  1392. package/dist/internal/tool-policy.d.ts +110 -0
  1393. package/dist/internal/tool-policy.d.ts.map +1 -0
  1394. package/dist/internal/tool-policy.js +138 -0
  1395. package/dist/internal/tool-result.d.ts +20 -0
  1396. package/dist/internal/tool-result.d.ts.map +1 -0
  1397. package/dist/internal/tool-result.js +45 -0
  1398. package/dist/internal/trajectory.d.ts +69 -0
  1399. package/dist/internal/trajectory.d.ts.map +1 -0
  1400. package/dist/internal/trajectory.js +351 -0
  1401. package/dist/internal/turn-cost.d.ts +41 -0
  1402. package/dist/internal/turn-cost.d.ts.map +1 -0
  1403. package/dist/internal/turn-cost.js +109 -0
  1404. package/dist/internal/turn-governor.d.ts +54 -0
  1405. package/dist/internal/turn-governor.d.ts.map +1 -0
  1406. package/dist/internal/turn-governor.js +111 -0
  1407. package/dist/internal/turn-lease-store.d.ts +44 -0
  1408. package/dist/internal/turn-lease-store.d.ts.map +1 -0
  1409. package/dist/internal/turn-lease-store.js +139 -0
  1410. package/dist/internal/turn-outbox.d.ts +24 -0
  1411. package/dist/internal/turn-outbox.d.ts.map +1 -0
  1412. package/dist/internal/turn-outbox.js +80 -0
  1413. package/dist/internal/update-check.d.ts +93 -0
  1414. package/dist/internal/update-check.d.ts.map +1 -0
  1415. package/dist/internal/update-check.js +427 -0
  1416. package/dist/internal/v2-hosting.d.ts +31 -0
  1417. package/dist/internal/v2-hosting.d.ts.map +1 -0
  1418. package/dist/internal/v2-hosting.js +33 -0
  1419. package/dist/internal/workspace-sync.d.ts +47 -0
  1420. package/dist/internal/workspace-sync.d.ts.map +1 -0
  1421. package/dist/internal/workspace-sync.js +104 -0
  1422. package/dist/internal/workspace.d.ts +151 -0
  1423. package/dist/internal/workspace.d.ts.map +1 -0
  1424. package/dist/internal/workspace.js +455 -0
  1425. package/dist/kv/memory-kv.d.ts +24 -0
  1426. package/dist/kv/memory-kv.d.ts.map +1 -0
  1427. package/dist/kv/memory-kv.js +104 -0
  1428. package/dist/kv.d.ts +18 -0
  1429. package/dist/kv.d.ts.map +1 -0
  1430. package/dist/kv.js +16 -0
  1431. package/dist/memory.d.ts +138 -0
  1432. package/dist/memory.d.ts.map +1 -0
  1433. package/dist/memory.js +401 -0
  1434. package/dist/otel-public.d.ts +7 -0
  1435. package/dist/otel-public.d.ts.map +1 -0
  1436. package/dist/otel-public.js +5 -0
  1437. package/dist/otel.d.ts +131 -0
  1438. package/dist/otel.d.ts.map +1 -0
  1439. package/dist/otel.js +186 -0
  1440. package/dist/playground/assets/cursor-icons-16-4RnoYH3n.woff2 +0 -0
  1441. package/dist/playground/assets/index-BMV_IcEE.css +1 -0
  1442. package/dist/playground/assets/index-FFdUqTt_.js +71 -0
  1443. package/dist/playground/index.html +17 -0
  1444. package/dist/prompt.d.ts +39 -0
  1445. package/dist/prompt.d.ts.map +1 -0
  1446. package/dist/prompt.js +70 -0
  1447. package/dist/reminders.d.ts +42 -0
  1448. package/dist/reminders.d.ts.map +1 -0
  1449. package/dist/reminders.js +45 -0
  1450. package/dist/schedules.d.ts +23 -0
  1451. package/dist/schedules.d.ts.map +1 -0
  1452. package/dist/schedules.js +26 -0
  1453. package/dist/skills.d.ts +22 -0
  1454. package/dist/skills.d.ts.map +1 -0
  1455. package/dist/skills.js +22 -0
  1456. package/dist/storage-backends/cursor-hosted-v2.d.ts +82 -0
  1457. package/dist/storage-backends/cursor-hosted-v2.d.ts.map +1 -0
  1458. package/dist/storage-backends/cursor-hosted-v2.js +171 -0
  1459. package/dist/storage-backends/cursor-hosted.d.ts +107 -0
  1460. package/dist/storage-backends/cursor-hosted.d.ts.map +1 -0
  1461. package/dist/storage-backends/cursor-hosted.js +278 -0
  1462. package/dist/storage-backends/file-kv.d.ts +42 -0
  1463. package/dist/storage-backends/file-kv.d.ts.map +1 -0
  1464. package/dist/storage-backends/file-kv.js +254 -0
  1465. package/dist/storage-protocol.d.ts +142 -0
  1466. package/dist/storage-protocol.d.ts.map +1 -0
  1467. package/dist/storage-protocol.js +201 -0
  1468. package/dist/storage.d.ts +254 -0
  1469. package/dist/storage.d.ts.map +1 -0
  1470. package/dist/storage.js +154 -0
  1471. package/dist/tools.d.ts +132 -0
  1472. package/dist/tools.d.ts.map +1 -0
  1473. package/dist/tools.js +77 -0
  1474. package/dist/types.d.ts +3375 -0
  1475. package/dist/types.d.ts.map +1 -0
  1476. package/dist/types.js +189 -0
  1477. package/docs/README.md +119 -0
  1478. package/docs/building-with-agents.md +140 -0
  1479. package/docs/deployment.md +216 -0
  1480. package/docs/evals.md +262 -0
  1481. package/docs/guides/agent-to-agent.md +157 -0
  1482. package/docs/guides/bitbucket.md +293 -0
  1483. package/docs/guides/cloud-agents.md +95 -0
  1484. package/docs/guides/convert-automation.md +188 -0
  1485. package/docs/guides/github.md +331 -0
  1486. package/docs/guides/gitlab.md +299 -0
  1487. package/docs/guides/grokbot-agents.md +147 -0
  1488. package/docs/guides/hooks.md +119 -0
  1489. package/docs/guides/improve.md +139 -0
  1490. package/docs/guides/jev.md +299 -0
  1491. package/docs/guides/mcp-oauth.md +167 -0
  1492. package/docs/guides/opentelemetry.md +158 -0
  1493. package/docs/guides/slack.md +278 -0
  1494. package/docs/guides/webhooks.md +241 -0
  1495. package/docs/hillclimbing.md +142 -0
  1496. package/docs/quickstart.md +311 -0
  1497. package/docs/reference/agent-config.md +193 -0
  1498. package/docs/reference/artifacts.md +121 -0
  1499. package/docs/reference/channels.md +203 -0
  1500. package/docs/reference/cli.md +909 -0
  1501. package/docs/reference/connections.md +277 -0
  1502. package/docs/reference/evals.md +292 -0
  1503. package/docs/reference/extensions.md +198 -0
  1504. package/docs/reference/hooks.md +195 -0
  1505. package/docs/reference/http-api.md +236 -0
  1506. package/docs/reference/instructions.md +68 -0
  1507. package/docs/reference/playground.md +47 -0
  1508. package/docs/reference/project-layout.md +120 -0
  1509. package/docs/reference/prompt.md +55 -0
  1510. package/docs/reference/schedules.md +175 -0
  1511. package/docs/reference/sessions.md +165 -0
  1512. package/docs/reference/skills.md +80 -0
  1513. package/docs/reference/subagents.md +67 -0
  1514. package/docs/reference/tools.md +329 -0
  1515. package/docs/templates/agentic-owners.md +100 -0
  1516. package/docs/templates/security-reviewer.md +90 -0
  1517. package/docs/templates/thermo-quality-review.md +83 -0
  1518. package/docs/templates/thermo-review.md +82 -0
  1519. package/docs/templates/triage.md +102 -0
  1520. package/docs/troubleshooting.md +148 -0
  1521. package/package.json +384 -0
  1522. package/scripts/install-cursor-skills.mjs +29 -0
  1523. package/skills/create-agent/SKILL.md +170 -0
  1524. package/skills/debug/SKILL.md +43 -0
  1525. package/skills/deploy/SKILL.md +169 -0
  1526. package/skills/evals/SKILL.md +145 -0
  1527. package/skills/framework-map/SKILL.md +125 -0
  1528. package/skills/github/SKILL.md +110 -0
  1529. package/skills/hillclimb/SKILL.md +63 -0
  1530. package/skills/mcp-auth/SKILL.md +84 -0
  1531. package/skills/otel/SKILL.md +50 -0
  1532. package/skills/setup-slack/SKILL.md +149 -0
  1533. package/src/artifacts.ts +65 -0
  1534. package/src/bin/agent-serve.ts +1833 -0
  1535. package/src/channels/bitbucket/api.ts +891 -0
  1536. package/src/channels/bitbucket/binding.ts +417 -0
  1537. package/src/channels/bitbucket/bitbucket-channel.ts +162 -0
  1538. package/src/channels/bitbucket/bitbucket-webhook.ts +519 -0
  1539. package/src/channels/bitbucket/checks.ts +146 -0
  1540. package/src/channels/bitbucket/cursor-account.ts +106 -0
  1541. package/src/channels/bitbucket/defaults.ts +100 -0
  1542. package/src/channels/bitbucket/events.ts +74 -0
  1543. package/src/channels/bitbucket/index.ts +51 -0
  1544. package/src/channels/bitbucket/replay.ts +421 -0
  1545. package/src/channels/bitbucket/state.ts +59 -0
  1546. package/src/channels/bitbucket/types.ts +261 -0
  1547. package/src/channels/change-monitors/change-monitors-channel.ts +63 -0
  1548. package/src/channels/change-monitors/index.ts +8 -0
  1549. package/src/channels/change-monitors/types.ts +42 -0
  1550. package/src/channels/checks.ts +185 -0
  1551. package/src/channels/deployments/deployments-channel.ts +224 -0
  1552. package/src/channels/deployments/index.ts +25 -0
  1553. package/src/channels/deployments/types.ts +92 -0
  1554. package/src/channels/github/api.ts +526 -0
  1555. package/src/channels/github/auth.ts +254 -0
  1556. package/src/channels/github/binding.ts +233 -0
  1557. package/src/channels/github/checks.ts +145 -0
  1558. package/src/channels/github/cursor-account.ts +303 -0
  1559. package/src/channels/github/defaults.ts +168 -0
  1560. package/src/channels/github/events.ts +67 -0
  1561. package/src/channels/github/forward.ts +359 -0
  1562. package/src/channels/github/github-channel.ts +2334 -0
  1563. package/src/channels/github/index.ts +54 -0
  1564. package/src/channels/github/progress.ts +365 -0
  1565. package/src/channels/github/replay.ts +372 -0
  1566. package/src/channels/github/state.ts +124 -0
  1567. package/src/channels/github/types.ts +590 -0
  1568. package/src/channels/gitlab/api.ts +329 -0
  1569. package/src/channels/gitlab/binding.ts +231 -0
  1570. package/src/channels/gitlab/checks.ts +228 -0
  1571. package/src/channels/gitlab/cursor-account.ts +105 -0
  1572. package/src/channels/gitlab/defaults.ts +80 -0
  1573. package/src/channels/gitlab/events.ts +37 -0
  1574. package/src/channels/gitlab/gitlab-channel.ts +160 -0
  1575. package/src/channels/gitlab/gitlab-webhook.ts +509 -0
  1576. package/src/channels/gitlab/index.ts +44 -0
  1577. package/src/channels/gitlab/replay.ts +328 -0
  1578. package/src/channels/gitlab/state.ts +55 -0
  1579. package/src/channels/gitlab/types.ts +247 -0
  1580. package/src/channels/issues/index.ts +9 -0
  1581. package/src/channels/issues/issues-channel.ts +45 -0
  1582. package/src/channels/issues/types.ts +38 -0
  1583. package/src/channels/origin/api.ts +507 -0
  1584. package/src/channels/origin/binding.ts +114 -0
  1585. package/src/channels/origin/checks.ts +250 -0
  1586. package/src/channels/origin/cursor-account.ts +58 -0
  1587. package/src/channels/origin/defaults.ts +140 -0
  1588. package/src/channels/origin/events.ts +35 -0
  1589. package/src/channels/origin/index.ts +35 -0
  1590. package/src/channels/origin/origin-channel.ts +815 -0
  1591. package/src/channels/origin/origin-webhook.ts +296 -0
  1592. package/src/channels/origin/reactions.ts +72 -0
  1593. package/src/channels/origin/state.ts +54 -0
  1594. package/src/channels/origin/types.ts +295 -0
  1595. package/src/channels/slack/agentic-delivery.ts +634 -0
  1596. package/src/channels/slack/agentic-posted.ts +135 -0
  1597. package/src/channels/slack/agentic-signals.ts +231 -0
  1598. package/src/channels/slack/api.ts +761 -0
  1599. package/src/channels/slack/approvals.ts +279 -0
  1600. package/src/channels/slack/assistant.ts +76 -0
  1601. package/src/channels/slack/attachments.ts +596 -0
  1602. package/src/channels/slack/auth.ts +127 -0
  1603. package/src/channels/slack/blocks.ts +131 -0
  1604. package/src/channels/slack/bot-mentions.ts +318 -0
  1605. package/src/channels/slack/channel-watch.ts +314 -0
  1606. package/src/channels/slack/cli-project.ts +249 -0
  1607. package/src/channels/slack/code-fences.ts +171 -0
  1608. package/src/channels/slack/constants.ts +38 -0
  1609. package/src/channels/slack/credentials.ts +88 -0
  1610. package/src/channels/slack/defaults.ts +714 -0
  1611. package/src/channels/slack/dispatch.ts +1060 -0
  1612. package/src/channels/slack/doctor.ts +338 -0
  1613. package/src/channels/slack/eval-directive.ts +306 -0
  1614. package/src/channels/slack/event-id-dedupe.ts +30 -0
  1615. package/src/channels/slack/external-policy.ts +75 -0
  1616. package/src/channels/slack/footer.ts +106 -0
  1617. package/src/channels/slack/inbound.ts +416 -0
  1618. package/src/channels/slack/index.ts +53 -0
  1619. package/src/channels/slack/init.ts +169 -0
  1620. package/src/channels/slack/interactive.ts +406 -0
  1621. package/src/channels/slack/links.ts +23 -0
  1622. package/src/channels/slack/live-delivery.ts +489 -0
  1623. package/src/channels/slack/log.ts +70 -0
  1624. package/src/channels/slack/manifest.ts +239 -0
  1625. package/src/channels/slack/message-body.ts +82 -0
  1626. package/src/channels/slack/nudge-carrier.ts +224 -0
  1627. package/src/channels/slack/nudge-store.ts +334 -0
  1628. package/src/channels/slack/paint-start.ts +93 -0
  1629. package/src/channels/slack/placeholder.ts +358 -0
  1630. package/src/channels/slack/pr-ref.ts +74 -0
  1631. package/src/channels/slack/progress-delivery.ts +138 -0
  1632. package/src/channels/slack/reasoning-card.ts +125 -0
  1633. package/src/channels/slack/reasoning-chip.ts +41 -0
  1634. package/src/channels/slack/recording-sink.ts +167 -0
  1635. package/src/channels/slack/redact.ts +6 -0
  1636. package/src/channels/slack/reply-options.ts +279 -0
  1637. package/src/channels/slack/setup.ts +125 -0
  1638. package/src/channels/slack/slack-channel.ts +744 -0
  1639. package/src/channels/slack/socket-mode.ts +140 -0
  1640. package/src/channels/slack/stop.ts +25 -0
  1641. package/src/channels/slack/stream.ts +66 -0
  1642. package/src/channels/slack/thread-context.ts +485 -0
  1643. package/src/channels/slack/tool-approval-events.ts +233 -0
  1644. package/src/channels/slack/tool-cards.ts +198 -0
  1645. package/src/channels/slack/tool-chip.ts +34 -0
  1646. package/src/channels/slack/types.ts +782 -0
  1647. package/src/channels/slack/upload.ts +137 -0
  1648. package/src/channels.ts +543 -0
  1649. package/src/connections.ts +153 -0
  1650. package/src/dashboard-session-url.ts +30 -0
  1651. package/src/evals/assertions.ts +688 -0
  1652. package/src/evals/expect.ts +250 -0
  1653. package/src/evals/judge.ts +329 -0
  1654. package/src/evals/loaders.ts +111 -0
  1655. package/src/evals/matchers.ts +223 -0
  1656. package/src/evals/reporters.ts +257 -0
  1657. package/src/evals/results.ts +130 -0
  1658. package/src/evals/run-facts.ts +306 -0
  1659. package/src/evals.ts +709 -0
  1660. package/src/extensions/cursor-cloud-agents/extension.ts +114 -0
  1661. package/src/extensions/cursor-cloud-agents/lib/backend.ts +386 -0
  1662. package/src/extensions/cursor-cloud-agents/lib/fleet.ts +98 -0
  1663. package/src/extensions/cursor-cloud-agents/lib/inputs.ts +5 -0
  1664. package/src/extensions/cursor-cloud-agents/lib/repos.ts +68 -0
  1665. package/src/extensions/cursor-cloud-agents/lib/transcript.ts +19 -0
  1666. package/src/extensions/cursor-cloud-agents/skills/handoff.md +37 -0
  1667. package/src/extensions/cursor-cloud-agents/tools/cancel.ts +19 -0
  1668. package/src/extensions/cursor-cloud-agents/tools/dump.ts +47 -0
  1669. package/src/extensions/cursor-cloud-agents/tools/get.ts +18 -0
  1670. package/src/extensions/cursor-cloud-agents/tools/launch.ts +60 -0
  1671. package/src/extensions/cursor-cloud-agents/tools/list.ts +31 -0
  1672. package/src/extensions/cursor-cloud-agents/tools/reply.ts +34 -0
  1673. package/src/extensions/improve/extension.ts +69 -0
  1674. package/src/extensions/improve/skills/yourself.ts +50 -0
  1675. package/src/extensions/jev/extension.ts +95 -0
  1676. package/src/extensions/jev/lib/evaluate.ts +266 -0
  1677. package/src/extensions/jev/skills/gated-write.md +25 -0
  1678. package/src/extensions/jev/skills/questions.md +33 -0
  1679. package/src/extensions/jev/tools/evaluate.ts +82 -0
  1680. package/src/extensions/slack-communication/evals/harness.ts +705 -0
  1681. package/src/extensions/slack-communication/evals/slack-communication.eval.ts +830 -0
  1682. package/src/extensions/slack-communication/evals/slack-placeholder.eval.ts +172 -0
  1683. package/src/extensions/slack-communication/extension.ts +44 -0
  1684. package/src/extensions/slack-communication/skills/slack-voice.ts +56 -0
  1685. package/src/extensions/slack-communication/tools/delete-message.ts +33 -0
  1686. package/src/extensions/slack-communication/tools/edit-message.ts +42 -0
  1687. package/src/extensions/slack-communication/tools/post-card.ts +28 -0
  1688. package/src/extensions/slack-communication/tools/post-file.ts +82 -0
  1689. package/src/extensions/slack-communication/tools/post-update.ts +40 -0
  1690. package/src/extensions/slack-communication/tools/react.ts +30 -0
  1691. package/src/extensions/slack-communication/tools/set-status.ts +21 -0
  1692. package/src/extensions.ts +179 -0
  1693. package/src/files-backends/agent-store-presigned-url.ts +11 -0
  1694. package/src/files-backends/cursor-hosted.ts +1212 -0
  1695. package/src/files-backends/local-fs.ts +163 -0
  1696. package/src/files.ts +293 -0
  1697. package/src/filesystem.ts +2005 -0
  1698. package/src/hooks.ts +30 -0
  1699. package/src/index.ts +259 -0
  1700. package/src/internal/advertise-tools.ts +370 -0
  1701. package/src/internal/approval-gate.ts +103 -0
  1702. package/src/internal/artifacts-store.ts +825 -0
  1703. package/src/internal/as-of.ts +257 -0
  1704. package/src/internal/auth.ts +46 -0
  1705. package/src/internal/authored-alias-hooks.ts +138 -0
  1706. package/src/internal/authored-loaders.ts +188 -0
  1707. package/src/internal/bounded-int.ts +24 -0
  1708. package/src/internal/bounded.ts +25 -0
  1709. package/src/internal/brand.ts +28 -0
  1710. package/src/internal/browser-origin-guard.ts +67 -0
  1711. package/src/internal/builtin-tools/artifacts.ts +62 -0
  1712. package/src/internal/builtin-tools/index.ts +53 -0
  1713. package/src/internal/builtin-tools/reminders.ts +145 -0
  1714. package/src/internal/channel-dispatch.ts +129 -0
  1715. package/src/internal/channel-route-dispatch.ts +58 -0
  1716. package/src/internal/channel-state.ts +83 -0
  1717. package/src/internal/chat-client.ts +594 -0
  1718. package/src/internal/cli-ax.ts +2273 -0
  1719. package/src/internal/cli-bitbucket.ts +438 -0
  1720. package/src/internal/cli-convert-automation.ts +335 -0
  1721. package/src/internal/cli-cursor.ts +282 -0
  1722. package/src/internal/cli-deploy.ts +2486 -0
  1723. package/src/internal/cli-docs.ts +192 -0
  1724. package/src/internal/cli-github.ts +806 -0
  1725. package/src/internal/cli-gitlab.ts +452 -0
  1726. package/src/internal/cli-images.ts +672 -0
  1727. package/src/internal/cli-manifest.ts +56 -0
  1728. package/src/internal/cli-mcp-oauth.ts +395 -0
  1729. package/src/internal/cli-mcp.ts +808 -0
  1730. package/src/internal/cli-skills.ts +99 -0
  1731. package/src/internal/cli-slack-manual.ts +418 -0
  1732. package/src/internal/cli-slack.ts +874 -0
  1733. package/src/internal/cloud-merge.ts +51 -0
  1734. package/src/internal/cloud-turn-cost.ts +159 -0
  1735. package/src/internal/continuation-channel.ts +233 -0
  1736. package/src/internal/continuation-identity.ts +935 -0
  1737. package/src/internal/conversation-mirror.ts +423 -0
  1738. package/src/internal/convert-automation/convert-workflow.ts +1377 -0
  1739. package/src/internal/convert-automation/slug.ts +29 -0
  1740. package/src/internal/convert-automation/types.ts +212 -0
  1741. package/src/internal/cron.ts +76 -0
  1742. package/src/internal/cursor/account-mcp.ts +692 -0
  1743. package/src/internal/cursor/backend-client.ts +978 -0
  1744. package/src/internal/cursor/bound-secret-file.ts +101 -0
  1745. package/src/internal/cursor/credentials.ts +560 -0
  1746. package/src/internal/cursor/cursor-api-transport.ts +65 -0
  1747. package/src/internal/cursor/github-credentials.ts +228 -0
  1748. package/src/internal/cursor/hosted-bound-secrets.ts +71 -0
  1749. package/src/internal/cursor/hosted-deployment-secrets.ts +100 -0
  1750. package/src/internal/cursor/hosted-store-secrets.ts +152 -0
  1751. package/src/internal/cursor/session-token.ts +111 -0
  1752. package/src/internal/cursor/store-api-client.ts +323 -0
  1753. package/src/internal/cursor-account-mcp-auth.ts +303 -0
  1754. package/src/internal/cursor-agent-template.ts +50 -0
  1755. package/src/internal/cursor-deployment-relay.ts +315 -0
  1756. package/src/internal/cursor-event-relay.ts +675 -0
  1757. package/src/internal/cursor-relay-core.ts +563 -0
  1758. package/src/internal/deferred-channel-session.ts +61 -0
  1759. package/src/internal/deploy-client.ts +1504 -0
  1760. package/src/internal/deploy-manifest.ts +361 -0
  1761. package/src/internal/deploy-source.ts +144 -0
  1762. package/src/internal/describe-error.ts +32 -0
  1763. package/src/internal/dev-mode.ts +20 -0
  1764. package/src/internal/discovery/agent-config.ts +288 -0
  1765. package/src/internal/discovery/agent.ts +381 -0
  1766. package/src/internal/discovery/channels.ts +100 -0
  1767. package/src/internal/discovery/connections.ts +505 -0
  1768. package/src/internal/discovery/context.ts +38 -0
  1769. package/src/internal/discovery/cursor-plugin.ts +628 -0
  1770. package/src/internal/discovery/extension-overlay.ts +247 -0
  1771. package/src/internal/discovery/extensions.ts +490 -0
  1772. package/src/internal/discovery/fs.ts +103 -0
  1773. package/src/internal/discovery/hooks.ts +63 -0
  1774. package/src/internal/discovery/info.ts +174 -0
  1775. package/src/internal/discovery/instructions.ts +98 -0
  1776. package/src/internal/discovery/modules.ts +107 -0
  1777. package/src/internal/discovery/names.ts +45 -0
  1778. package/src/internal/discovery/project.ts +319 -0
  1779. package/src/internal/discovery/reminders.ts +65 -0
  1780. package/src/internal/discovery/runtime.ts +158 -0
  1781. package/src/internal/discovery/schedules.ts +120 -0
  1782. package/src/internal/discovery/seed-files.ts +34 -0
  1783. package/src/internal/discovery/services.ts +151 -0
  1784. package/src/internal/discovery/skills.ts +174 -0
  1785. package/src/internal/discovery/subagent.ts +138 -0
  1786. package/src/internal/discovery/tools.ts +170 -0
  1787. package/src/internal/discovery.ts +27 -0
  1788. package/src/internal/distribution.ts +126 -0
  1789. package/src/internal/docs-site.ts +248 -0
  1790. package/src/internal/duration.ts +37 -0
  1791. package/src/internal/env-file.ts +83 -0
  1792. package/src/internal/eval-judge-model.ts +142 -0
  1793. package/src/internal/eval-run-store.ts +585 -0
  1794. package/src/internal/eval-runner.ts +823 -0
  1795. package/src/internal/evals-client.ts +475 -0
  1796. package/src/internal/event-log.ts +342 -0
  1797. package/src/internal/event-mapper.ts +480 -0
  1798. package/src/internal/expected-delivery-failure.ts +34 -0
  1799. package/src/internal/factory-resource-channel.ts +103 -0
  1800. package/src/internal/filesystem/errors.ts +207 -0
  1801. package/src/internal/filesystem/format.ts +253 -0
  1802. package/src/internal/filesystem/merge.ts +192 -0
  1803. package/src/internal/filesystem/nearest.ts +112 -0
  1804. package/src/internal/filesystem/scratch.ts +239 -0
  1805. package/src/internal/filesystem/sdk-schemas.ts +204 -0
  1806. package/src/internal/filesystem/tools.ts +804 -0
  1807. package/src/internal/filesystem/walk.ts +366 -0
  1808. package/src/internal/fixtures/units-server.ts +52 -0
  1809. package/src/internal/framework-file-storage.ts +357 -0
  1810. package/src/internal/framework-storage-selection.ts +156 -0
  1811. package/src/internal/frontmatter.ts +108 -0
  1812. package/src/internal/github-fanout.ts +144 -0
  1813. package/src/internal/guest-network.ts +391 -0
  1814. package/src/internal/handleAgentServeTrigger.ts +286 -0
  1815. package/src/internal/host-files.ts +341 -0
  1816. package/src/internal/host-kv.ts +81 -0
  1817. package/src/internal/host-otel.ts +231 -0
  1818. package/src/internal/host-platforms.ts +170 -0
  1819. package/src/internal/hosted-admission-adapter.ts +47 -0
  1820. package/src/internal/hosted-admission-context.ts +37 -0
  1821. package/src/internal/hosted-catch-protocol.ts +112 -0
  1822. package/src/internal/hosted-catch.ts +179 -0
  1823. package/src/internal/hosted-delivery-protocol.ts +787 -0
  1824. package/src/internal/hosted-delivery.ts +1152 -0
  1825. package/src/internal/hosted-execution-diag.ts +291 -0
  1826. package/src/internal/hosted-execution-flush.ts +136 -0
  1827. package/src/internal/hosted-execution-latency.ts +301 -0
  1828. package/src/internal/hosted-managed-automation.ts +116 -0
  1829. package/src/internal/hosting.ts +107 -0
  1830. package/src/internal/http-channel-define.ts +25 -0
  1831. package/src/internal/http-channel.ts +669 -0
  1832. package/src/internal/http-control-plane-session.ts +110 -0
  1833. package/src/internal/ids.ts +39 -0
  1834. package/src/internal/incoming-headers-to-fetch.ts +45 -0
  1835. package/src/internal/init-interview.ts +360 -0
  1836. package/src/internal/init-project.ts +711 -0
  1837. package/src/internal/init-scaffold.ts +182 -0
  1838. package/src/internal/inline-stdio-define-stub.ts +4 -0
  1839. package/src/internal/inline-stdio-mcp.ts +230 -0
  1840. package/src/internal/install-cursor-skills.ts +601 -0
  1841. package/src/internal/is-record.ts +3 -0
  1842. package/src/internal/json-schema.ts +95 -0
  1843. package/src/internal/legacy-command-guard.ts +54 -0
  1844. package/src/internal/listen-port.ts +85 -0
  1845. package/src/internal/local-control-plane.ts +442 -0
  1846. package/src/internal/local-env.ts +59 -0
  1847. package/src/internal/local-ingress.ts +90 -0
  1848. package/src/internal/log-ring.ts +59 -0
  1849. package/src/internal/logs-client.ts +477 -0
  1850. package/src/internal/map-pool.ts +39 -0
  1851. package/src/internal/mcp-endpoint.ts +747 -0
  1852. package/src/internal/mcp-host.ts +481 -0
  1853. package/src/internal/mcp-oauth-on-demand.ts +337 -0
  1854. package/src/internal/mcp-oauth-persist.ts +118 -0
  1855. package/src/internal/mcp-oauth.ts +549 -0
  1856. package/src/internal/net.ts +29 -0
  1857. package/src/internal/open-browser.ts +41 -0
  1858. package/src/internal/otel/attrs.ts +16 -0
  1859. package/src/internal/otel/collector.ts +937 -0
  1860. package/src/internal/otel/config.ts +287 -0
  1861. package/src/internal/otel/http.ts +122 -0
  1862. package/src/internal/otel/mcp.ts +56 -0
  1863. package/src/internal/otel/propagation.ts +17 -0
  1864. package/src/internal/otel/runtime.ts +441 -0
  1865. package/src/internal/package-inline-stdio.ts +114 -0
  1866. package/src/internal/peer-connections.ts +96 -0
  1867. package/src/internal/platform-schedule-sync.ts +75 -0
  1868. package/src/internal/platform-timers.ts +365 -0
  1869. package/src/internal/playground/static.ts +278 -0
  1870. package/src/internal/playground/toolchain.ts +270 -0
  1871. package/src/internal/playground-proxy.ts +564 -0
  1872. package/src/internal/process-memory-telemetry.ts +334 -0
  1873. package/src/internal/project-layout.ts +31 -0
  1874. package/src/internal/prompt-context.ts +116 -0
  1875. package/src/internal/reminder-control-plane-protocol.ts +482 -0
  1876. package/src/internal/reminder-runner.ts +1559 -0
  1877. package/src/internal/reminder-schedule.ts +104 -0
  1878. package/src/internal/reminder-store.ts +176 -0
  1879. package/src/internal/request-error-status.ts +95 -0
  1880. package/src/internal/request-headers.ts +21 -0
  1881. package/src/internal/resolve-prod-target.ts +334 -0
  1882. package/src/internal/resolved-connections.ts +190 -0
  1883. package/src/internal/router.ts +143 -0
  1884. package/src/internal/run-client.ts +354 -0
  1885. package/src/internal/runtime-dispatch-runner.ts +50 -0
  1886. package/src/internal/sanitize-mcp-tool-name.ts +31 -0
  1887. package/src/internal/schedule-runner.ts +154 -0
  1888. package/src/internal/scm/pr-url.ts +245 -0
  1889. package/src/internal/sdk-runner.ts +948 -0
  1890. package/src/internal/serve-restart.ts +113 -0
  1891. package/src/internal/server.ts +3135 -0
  1892. package/src/internal/session-cost.ts +208 -0
  1893. package/src/internal/session-engine.ts +5602 -0
  1894. package/src/internal/session-links.ts +84 -0
  1895. package/src/internal/session-run-log.ts +535 -0
  1896. package/src/internal/session-store.ts +307 -0
  1897. package/src/internal/session-urls.ts +32 -0
  1898. package/src/internal/sessions-client.ts +239 -0
  1899. package/src/internal/skill-catalog.ts +66 -0
  1900. package/src/internal/skills-sync.ts +55 -0
  1901. package/src/internal/slack-provision-client.ts +544 -0
  1902. package/src/internal/slack-thread-key.ts +11 -0
  1903. package/src/internal/sleep.ts +3 -0
  1904. package/src/internal/start-log-store.ts +164 -0
  1905. package/src/internal/steering.ts +17 -0
  1906. package/src/internal/storage-coordinator.ts +800 -0
  1907. package/src/internal/storage-roles.ts +86 -0
  1908. package/src/internal/storage.ts +1 -0
  1909. package/src/internal/store-api-protocol.ts +205 -0
  1910. package/src/internal/store-mirror.ts +73 -0
  1911. package/src/internal/stream-progress.ts +294 -0
  1912. package/src/internal/terminal-style.ts +133 -0
  1913. package/src/internal/testing/factory-resource-fixtures.ts +84 -0
  1914. package/src/internal/testing/scm-continuation-fixtures.ts +285 -0
  1915. package/src/internal/tool-catalog.ts +104 -0
  1916. package/src/internal/tool-policy.ts +222 -0
  1917. package/src/internal/tool-result.ts +50 -0
  1918. package/src/internal/trajectory.ts +418 -0
  1919. package/src/internal/turn-cost.ts +136 -0
  1920. package/src/internal/turn-governor.ts +145 -0
  1921. package/src/internal/turn-lease-store.ts +144 -0
  1922. package/src/internal/turn-outbox.ts +77 -0
  1923. package/src/internal/update-check.ts +517 -0
  1924. package/src/internal/v2-hosting.ts +52 -0
  1925. package/src/internal/workspace-sync.ts +114 -0
  1926. package/src/internal/workspace.ts +505 -0
  1927. package/src/kv/memory-kv.ts +94 -0
  1928. package/src/kv.ts +18 -0
  1929. package/src/memory.ts +487 -0
  1930. package/src/otel-public.ts +24 -0
  1931. package/src/otel.ts +320 -0
  1932. package/src/prompt.ts +80 -0
  1933. package/src/reminders.ts +65 -0
  1934. package/src/schedules.ts +31 -0
  1935. package/src/skills.ts +27 -0
  1936. package/src/storage-backends/cursor-hosted-v2.ts +204 -0
  1937. package/src/storage-backends/cursor-hosted.ts +388 -0
  1938. package/src/storage-backends/file-kv.ts +276 -0
  1939. package/src/storage-protocol.ts +261 -0
  1940. package/src/storage.ts +408 -0
  1941. package/src/tools.ts +166 -0
  1942. package/src/types.ts +3725 -0
  1943. package/templates/agentic-owners/README.md +76 -0
  1944. package/templates/agentic-owners/bot/agent.ts +8 -0
  1945. package/templates/agentic-owners/bot/channels/github.ts +63 -0
  1946. package/templates/agentic-owners/bot/instructions.md +34 -0
  1947. package/templates/agentic-owners/bot/lib/config.ts +5 -0
  1948. package/templates/agentic-owners/bot/lib/github.ts +217 -0
  1949. package/templates/agentic-owners/bot/lib/owners/README.md +50 -0
  1950. package/templates/agentic-owners/bot/lib/owners/constants.ts +22 -0
  1951. package/templates/agentic-owners/bot/lib/owners/decision.ts +454 -0
  1952. package/templates/agentic-owners/bot/lib/owners/handles.ts +54 -0
  1953. package/templates/agentic-owners/bot/lib/owners/match.ts +219 -0
  1954. package/templates/agentic-owners/bot/lib/owners/matching.ts +78 -0
  1955. package/templates/agentic-owners/bot/lib/owners/parse.ts +565 -0
  1956. package/templates/agentic-owners/bot/lib/owners/policyMode.ts +57 -0
  1957. package/templates/agentic-owners/bot/lib/owners/prompt.ts +64 -0
  1958. package/templates/agentic-owners/bot/lib/owners/prompts/base-review.md +105 -0
  1959. package/templates/agentic-owners/bot/lib/owners/types.ts +50 -0
  1960. package/templates/agentic-owners/bot/lib/review.ts +722 -0
  1961. package/templates/agentic-owners/bot/tools/record_review.ts +62 -0
  1962. package/templates/agentic-owners/evals/evals.config.ts +5 -0
  1963. package/templates/agentic-owners/evals/owners.eval.ts +111 -0
  1964. package/templates/agentic-owners/package.json +20 -0
  1965. package/templates/agentic-owners/tsconfig.json +12 -0
  1966. package/templates/agents-md/README.md +42 -0
  1967. package/templates/agents-md/bot/agent.ts +8 -0
  1968. package/templates/agents-md/bot/channels/github.ts +10 -0
  1969. package/templates/agents-md/bot/channels/queue.ts +28 -0
  1970. package/templates/agents-md/bot/channels/slack.ts +9 -0
  1971. package/templates/agents-md/bot/instructions.md +39 -0
  1972. package/templates/agents-md/bot/lib/collect.ts +415 -0
  1973. package/templates/agents-md/bot/lib/config.ts +8 -0
  1974. package/templates/agents-md/bot/lib/paths.ts +49 -0
  1975. package/templates/agents-md/bot/schedules/weekly.ts +17 -0
  1976. package/templates/agents-md/bot/tools/apply_agents.ts +218 -0
  1977. package/templates/agents-md/evals/agents.eval.ts +135 -0
  1978. package/templates/agents-md/evals/evals.config.ts +5 -0
  1979. package/templates/agents-md/init.json +38 -0
  1980. package/templates/agents-md/package.json +18 -0
  1981. package/templates/agents-md/tsconfig.json +12 -0
  1982. package/templates/code-wiki/README.md +37 -0
  1983. package/templates/code-wiki/bot/agent.ts +8 -0
  1984. package/templates/code-wiki/bot/channels/github.ts +125 -0
  1985. package/templates/code-wiki/bot/instructions.md +39 -0
  1986. package/templates/code-wiki/bot/lib/repos.ts +5 -0
  1987. package/templates/code-wiki/bot/lib/wiki.ts +22 -0
  1988. package/templates/code-wiki/bot/tools/apply_wiki.ts +210 -0
  1989. package/templates/code-wiki/evals/evals.config.ts +5 -0
  1990. package/templates/code-wiki/evals/wiki.eval.ts +124 -0
  1991. package/templates/code-wiki/init.json +25 -0
  1992. package/templates/code-wiki/package.json +18 -0
  1993. package/templates/code-wiki/tsconfig.json +12 -0
  1994. package/templates/demo/README.md +40 -0
  1995. package/templates/demo/bot/agent.ts +8 -0
  1996. package/templates/demo/bot/channels/github.ts +48 -0
  1997. package/templates/demo/bot/channels/queue.ts +34 -0
  1998. package/templates/demo/bot/instructions.md +8 -0
  1999. package/templates/demo/bot/lib/collect.ts +66 -0
  2000. package/templates/demo/bot/lib/repos.ts +5 -0
  2001. package/templates/demo/bot/tools/record_demo.ts +37 -0
  2002. package/templates/demo/evals/demo.eval.ts +29 -0
  2003. package/templates/demo/evals/evals.config.ts +5 -0
  2004. package/templates/demo/init.json +25 -0
  2005. package/templates/demo/package.json +18 -0
  2006. package/templates/demo/tsconfig.json +12 -0
  2007. package/templates/grokbot-agents/README.md +29 -0
  2008. package/templates/grokbot-agents/bot/agent.ts +6 -0
  2009. package/templates/grokbot-agents/bot/extensions/grokbot.ts +5 -0
  2010. package/templates/grokbot-agents/bot/instructions.md +7 -0
  2011. package/templates/grokbot-agents/evals/evals.config.ts +5 -0
  2012. package/templates/grokbot-agents/evals/grokbot-agents.eval.ts +18 -0
  2013. package/templates/grokbot-agents/init.json +18 -0
  2014. package/templates/grokbot-agents/package.json +17 -0
  2015. package/templates/grokbot-agents/tsconfig.json +12 -0
  2016. package/templates/pr-autofixer/bot/agent.ts +11 -0
  2017. package/templates/pr-autofixer/bot/channels/drive.ts +37 -0
  2018. package/templates/pr-autofixer/bot/channels/github.ts +155 -0
  2019. package/templates/pr-autofixer/bot/channels/slack.ts +16 -0
  2020. package/templates/pr-autofixer/bot/hooks/bind-agent.ts +19 -0
  2021. package/templates/pr-autofixer/bot/instructions.md +83 -0
  2022. package/templates/pr-autofixer/bot/lib/affinity.ts +24 -0
  2023. package/templates/pr-autofixer/bot/lib/drive-schemas.ts +18 -0
  2024. package/templates/pr-autofixer/bot/lib/drive.ts +73 -0
  2025. package/templates/pr-autofixer/bot/lib/merge-watch.ts +116 -0
  2026. package/templates/pr-autofixer/bot/lib/pr-state.ts +40 -0
  2027. package/templates/pr-autofixer/bot/lib/repos.ts +18 -0
  2028. package/templates/pr-autofixer/bot/lib/start-drive.ts +113 -0
  2029. package/templates/pr-autofixer/bot/lib/webhook-buffer.ts +215 -0
  2030. package/templates/pr-autofixer/bot/lib/webhook-routing.ts +231 -0
  2031. package/templates/pr-autofixer/bot/tools/drive_pr.ts +22 -0
  2032. package/templates/pr-autofixer/evals/coordinator.eval.ts +16 -0
  2033. package/templates/pr-autofixer/evals/evals.config.ts +5 -0
  2034. package/templates/pr-autofixer/init.json +25 -0
  2035. package/templates/pr-autofixer/package.json +18 -0
  2036. package/templates/pr-autofixer/tsconfig.json +12 -0
  2037. package/templates/security-help/README.md +40 -0
  2038. package/templates/security-help/bot/agent.ts +17 -0
  2039. package/templates/security-help/bot/channels/github.ts +13 -0
  2040. package/templates/security-help/bot/channels/slack.ts +84 -0
  2041. package/templates/security-help/bot/instructions.md +19 -0
  2042. package/templates/security-help/bot/lib/pr-first-pass.ts +40 -0
  2043. package/templates/security-help/bot/lib/repos.ts +5 -0
  2044. package/templates/security-help/bot/skills/access-request.md +10 -0
  2045. package/templates/security-help/bot/skills/faq.md +31 -0
  2046. package/templates/security-help/bot/skills/security-playbooks.md +12 -0
  2047. package/templates/security-help/bot/skills/security-pr-first-pass.md +12 -0
  2048. package/templates/security-help/evals/evals.config.ts +5 -0
  2049. package/templates/security-help/evals/security-help.eval.ts +51 -0
  2050. package/templates/security-help/init.json +31 -0
  2051. package/templates/security-help/package.json +17 -0
  2052. package/templates/security-help/tsconfig.json +12 -0
  2053. package/templates/security-reviewer/README.md +34 -0
  2054. package/templates/security-reviewer/bot/agent.ts +8 -0
  2055. package/templates/security-reviewer/bot/channels/github.ts +43 -0
  2056. package/templates/security-reviewer/bot/instructions.md +22 -0
  2057. package/templates/security-reviewer/bot/lib/repos.ts +5 -0
  2058. package/templates/security-reviewer/bot/tools/post_findings.ts +68 -0
  2059. package/templates/security-reviewer/evals/evals.config.ts +5 -0
  2060. package/templates/security-reviewer/evals/review.eval.ts +50 -0
  2061. package/templates/security-reviewer/init.json +25 -0
  2062. package/templates/security-reviewer/package.json +18 -0
  2063. package/templates/security-reviewer/tsconfig.json +12 -0
  2064. package/templates/thermo-quality-review/README.md +38 -0
  2065. package/templates/thermo-quality-review/bot/agent.ts +8 -0
  2066. package/templates/thermo-quality-review/bot/channels/github.ts +39 -0
  2067. package/templates/thermo-quality-review/bot/instructions.md +43 -0
  2068. package/templates/thermo-quality-review/bot/tools/post_findings.ts +67 -0
  2069. package/templates/thermo-quality-review/evals/evals.config.ts +5 -0
  2070. package/templates/thermo-quality-review/evals/review.eval.ts +59 -0
  2071. package/templates/thermo-quality-review/package.json +18 -0
  2072. package/templates/thermo-quality-review/tsconfig.json +12 -0
  2073. package/templates/thermo-review/README.md +38 -0
  2074. package/templates/thermo-review/bot/agent.ts +8 -0
  2075. package/templates/thermo-review/bot/channels/github.ts +39 -0
  2076. package/templates/thermo-review/bot/instructions.md +40 -0
  2077. package/templates/thermo-review/bot/tools/post_findings.ts +67 -0
  2078. package/templates/thermo-review/evals/evals.config.ts +5 -0
  2079. package/templates/thermo-review/evals/review.eval.ts +50 -0
  2080. package/templates/thermo-review/package.json +18 -0
  2081. package/templates/thermo-review/tsconfig.json +12 -0
  2082. package/templates/triage/README.md +50 -0
  2083. package/templates/triage/bot/agent.ts +8 -0
  2084. package/templates/triage/bot/channels/queue.ts +40 -0
  2085. package/templates/triage/bot/channels/webhook.ts +44 -0
  2086. package/templates/triage/bot/hooks/memory.ts +3 -0
  2087. package/templates/triage/bot/instructions.md +38 -0
  2088. package/templates/triage/bot/lib/actuate.ts +703 -0
  2089. package/templates/triage/bot/lib/parse-queue-event.ts +166 -0
  2090. package/templates/triage/bot/lib/tracker.ts +5 -0
  2091. package/templates/triage/bot/lib/types.ts +48 -0
  2092. package/templates/triage/bot/lib/verify-webhook.ts +79 -0
  2093. package/templates/triage/bot/skills/triage-rubric.md +44 -0
  2094. package/templates/triage/bot/tools/record_triage.ts +29 -0
  2095. package/templates/triage/evals/evals.config.ts +5 -0
  2096. package/templates/triage/evals/triage.eval.ts +64 -0
  2097. package/templates/triage/overlays/jira/README.md +24 -0
  2098. package/templates/triage/overlays/jira/bot/lib/tracker.ts +8 -0
  2099. package/templates/triage/overlays/jira/bot/mcp-connections/tracker.ts +6 -0
  2100. package/templates/triage/overlays/linear/README.md +24 -0
  2101. package/templates/triage/overlays/linear/bot/lib/tracker.ts +8 -0
  2102. package/templates/triage/overlays/linear/bot/mcp-connections/tracker.ts +6 -0
  2103. package/templates/triage/package.json +18 -0
  2104. package/templates/triage/tsconfig.json +12 -0
@@ -0,0 +1,3375 @@
1
+ /**
2
+ * Public types for @cursor/bdk.
3
+ *
4
+ * The framework is filesystem-first: customers author an agent as files under
5
+ * an `agent/` directory (markdown for prose, TypeScript for typed behavior),
6
+ * and the framework discovers those files, compiles them into an
7
+ * {@link AgentProject}, and serves the agent over channels using the Cursor
8
+ * SDK as the execution harness.
9
+ */
10
+ import type { InteractionUpdate, SDKCustomTool, ToolName } from "@cursor/sdk";
11
+ import type { z } from "zod";
12
+ import type { FileSystem } from "./filesystem.js";
13
+ import type { ContinuationClaim, ContinuationIdentity, MailboxContinuation } from "./internal/continuation-identity.js";
14
+ import type { OtelConfig, OtelDefinition } from "./otel.js";
15
+ import type { StorageDefinition } from "./storage.js";
16
+ export type JsonPrimitive = string | number | boolean | null;
17
+ export type JsonValue = JsonPrimitive | JsonValue[] | JsonObject;
18
+ export type JsonObject = {
19
+ [key: string]: JsonValue;
20
+ };
21
+ /** A plain JSON Schema object (already-serialized tool input schema). */
22
+ export type JsonSchemaObject = Record<string, unknown>;
23
+ /**
24
+ * Discriminates the `define*` helper that produced a module's default export
25
+ * so discovery can validate that a file landed in the right authored slot.
26
+ */
27
+ export type DefinitionKind = "agent" | "instructions" | "tool" | "skill" | "extension" | "disabled-tool" | "disabled-connection" | "disabled" | "connection" | "channel" | "http-channel" | "schedule" | "reminder" | "hook" | "eval" | "storage" | "artifacts" | "otel";
28
+ export interface BrandedDefinition<K extends DefinitionKind> {
29
+ readonly __agentServe: K;
30
+ }
31
+ /**
32
+ * A Cursor model selection. Either a bare model id (`"gpt-5.2"`) or an id
33
+ * with model parameters, mirroring the Cursor SDK's `ModelSelection`.
34
+ */
35
+ export type ModelSetting = string | {
36
+ id: string;
37
+ params?: Array<{
38
+ id: string;
39
+ value: string;
40
+ }>;
41
+ };
42
+ /**
43
+ * Model used when the root agent omits `model` (local Cursor agents have no
44
+ * harness-level default of their own).
45
+ */
46
+ export declare const DEFAULT_MODEL: ModelSetting;
47
+ /** Runtime selector. New public agents use the default local runtime. */
48
+ export type AgentRuntime = "local" | "cloud" | "grokbot";
49
+ /** Options used when launching Cursor cloud agents. */
50
+ export interface AgentCloudOptions {
51
+ env?: {
52
+ type: "cloud";
53
+ name?: string;
54
+ } | {
55
+ type: "pool";
56
+ name?: string;
57
+ } | {
58
+ type: "machine";
59
+ name?: string;
60
+ };
61
+ repos?: Array<{
62
+ url: string;
63
+ startingRef?: string;
64
+ prUrl?: string;
65
+ }>;
66
+ workOnCurrentBranch?: boolean;
67
+ autoCreatePR?: boolean;
68
+ skipReviewerRequest?: boolean;
69
+ /**
70
+ * Per-session env vars injected into the cloud agent's shell.
71
+ * When set, the cloud API mints the SDK agent id (persisted as
72
+ * {@link SessionRecord.sdkAgentId}).
73
+ */
74
+ envVars?: Record<string, string>;
75
+ }
76
+ /** Safe `/v1/info` projection of {@link AgentCloudOptions}; secret values are omitted. */
77
+ export type AgentCloudPublicInfo = Omit<AgentCloudOptions, "envVars"> & {
78
+ envVarsConfigured?: boolean;
79
+ };
80
+ export declare function toPublicCloudInfo(cloud: AgentCloudOptions): AgentCloudPublicInfo;
81
+ /**
82
+ * Session-scoped facts a `root` factory needs and does not otherwise
83
+ * have at `defineAgent` time. The factory returns a handle: each
84
+ * method must observe the current binding. Do not snapshot the tree.
85
+ */
86
+ export interface RootContext {
87
+ sessionId: string;
88
+ agentName?: string;
89
+ continuationKey?: string;
90
+ host?: {
91
+ files: HostFilesApi;
92
+ reminders?: ReminderHostApi;
93
+ kv?: HostKvApi;
94
+ };
95
+ }
96
+ /** Input to `defineAgent` (authored at `agent/agent.ts`). */
97
+ export interface AgentConfig {
98
+ /**
99
+ * Cursor model to run the agent on. Defaults to {@link DEFAULT_MODEL} on
100
+ * the root agent when omitted. Subagents omit it to inherit the parent's
101
+ * model.
102
+ */
103
+ model?: ModelSetting;
104
+ /**
105
+ * Models to try, in order, when {@link model} is rejected before the
106
+ * turn produces any output: catalog refusal ("Cannot use this model")
107
+ * or a capacity error (`resource_exhausted` / `[unavailable]`). The
108
+ * rejection is usually inside agent creation, before authored tools
109
+ * run, so a fallback list on the agent is the only retry that can save
110
+ * the turn. Each entry is the same shape as {@link model}.
111
+ */
112
+ fallbacks?: readonly ModelSetting[];
113
+ /**
114
+ * What this agent is for. Required on subagents: the parent model reads it
115
+ * to decide when to delegate. Optional (documentation only) on the root.
116
+ */
117
+ description?: string;
118
+ /** Display name override. Defaults to the package name / directory name. */
119
+ name?: string;
120
+ /**
121
+ * Inline instructions. Prefer `instructions.md` next to `agent.ts`; this
122
+ * exists for subagents and generated configs.
123
+ */
124
+ instructions?: string;
125
+ /**
126
+ * Execution runtime. Defaults to `"local"`. Compatibility strings
127
+ * `"cloud"` and `"grokbot"` remain for agents that already ship; they
128
+ * are not a product surface. New agents omit this field.
129
+ */
130
+ runtime?: AgentRuntime;
131
+ /**
132
+ * The FileSystem the model can see. Omit it and the root is the host
133
+ * disk. A static handle (`tempFs`, `unionFs`, ...) is that object on
134
+ * every session — writes are shared. Pass `(ctx) => …` and return a
135
+ * new handle per session when you want isolation. A factory that
136
+ * returns the same object still shares. Incompatible with
137
+ * {@link local} `cwd` / `workspaceDir` / `sandbox` and with
138
+ * {@link runtime} `"cloud"`.
139
+ */
140
+ root?: FileSystem | ((ctx: RootContext) => FileSystem | Promise<FileSystem>);
141
+ /**
142
+ * Cloud attach defaults merged under per-session
143
+ * {@link SendMessageOptions.cloud}. Used by existing agents that still
144
+ * set {@link runtime} `"cloud"` and by hybrid channel/tool handoffs.
145
+ * In-process `agent/tools` run on local turns only.
146
+ */
147
+ cloud?: AgentCloudOptions;
148
+ /** Local harness defaults. */
149
+ local?: AgentLocalOptions;
150
+ /**
151
+ * Managed-hosting declarations (`agent-sdk deploy` onto Cursor's
152
+ * agent-serve hosting). The manifest is the source of truth: deploy reads
153
+ * it and sends it with the deployment request. Ignored by local serving.
154
+ */
155
+ hosting?: AgentHostingOptions;
156
+ /**
157
+ * Engine-wide turn admission limits. See {@link AgentConcurrencyOptions}.
158
+ */
159
+ concurrency?: AgentConcurrencyOptions;
160
+ /**
161
+ * Framework-provided model-facing tools, opted in per capability. See
162
+ * {@link BuiltinToolsConfig}.
163
+ */
164
+ builtinTools?: BuiltinToolsConfig;
165
+ /**
166
+ * Allowlist of built-in harness tools offered to the model
167
+ * (`AgentOptions.tools` on the SDK). Opt-in by design: unset keeps the
168
+ * model's full standard toolset, and once set the agent gets exactly
169
+ * what it names — nothing more, `[]` meaning no native built-in tools.
170
+ * There is deliberately no exclusion form: an agent that restricts
171
+ * tools states what it keeps, so tools the platform adds later stay
172
+ * off until someone opts in.
173
+ *
174
+ * `"mcp"` is always granted alongside a configured allowlist. It is
175
+ * transport, not capability: this kit's own server tools reach the
176
+ * model over the SDK custom-tool MCP path, so omitting it would
177
+ * silently strand `agent/tools/`. What MCP actually exposes stays
178
+ * governed by the second layer — the tools you author, the connections
179
+ * you declare, and the harness cwd's ambient `.cursor` config (point
180
+ * `local.cwd` outside checkouts whose MCP servers the agent must not
181
+ * see, and `local.sandbox` makes MCP calls fail closed).
182
+ *
183
+ * Names use the SDK's public tool vocabulary (`"shell"`, `"read"`,
184
+ * `"edit"`, `"grep"`, `"glob"`, `"ls"`, `"task"`, ...). `"shell"` is a
185
+ * capability group that also grants shell stdin writes — and is what
186
+ * `execution: "agent"` tool scripts run through, so an allowlist
187
+ * without it strands them (discovery warns). `"task"` gates subagents.
188
+ * Unknown names fail the turn (`ConfigurationError` at `Agent.create`).
189
+ *
190
+ * This is not a security boundary against the serve host: like
191
+ * `local.sandbox`, it only shapes what the model can call.
192
+ */
193
+ tools?: ToolName[];
194
+ /**
195
+ * Hosted architecture. Defaults to `"v2"`. Set `"v1"` to stay on the
196
+ * resident-engine architecture.
197
+ */
198
+ architecture?: AgentArchitecture;
199
+ /**
200
+ * Persistent hosting for `architecture: "v2"`.
201
+ *
202
+ * Default (`false`): each session boots a pod from the release snapshot;
203
+ * framework and author state are mirrored to Cursor stores because pod
204
+ * disks are disposable.
205
+ *
206
+ * `true`: one long-lived pod per deployment runs each deployed version as
207
+ * a container over one state directory on the pod's disk. Nothing is
208
+ * mirrored: that directory is the durable copy. A redeploy starts the new
209
+ * version beside the old one on the same state, then drains the old one.
210
+ */
211
+ persistent?: boolean;
212
+ }
213
+ /** Hosted architecture on {@link AgentConfig.architecture}. */
214
+ export type AgentArchitecture = "v1" | "v2";
215
+ /**
216
+ * Built-in tools on {@link AgentConfig.builtinTools}. Each enabled
217
+ * capability materializes as ordinary server tools at discovery time, so
218
+ * turns, direct calls, `info`, and the playground treat them like authored
219
+ * tools. Authored tools with the same name win with a warning.
220
+ */
221
+ export interface BuiltinToolsConfig {
222
+ /**
223
+ * Reminder tools bound to the current conversation, over
224
+ * {@link HostContext.reminders}: `reminders_create`, `reminders_list`,
225
+ * and `reminders_cancel` (the name the framework's reminder fire prompt
226
+ * tells the model to call when a stop condition is met). Sessions
227
+ * without a continuation key cannot arm reminders.
228
+ */
229
+ reminders?: boolean;
230
+ }
231
+ /**
232
+ * Turn admission limits on {@link AgentConfig.concurrency}.
233
+ *
234
+ * ```ts
235
+ * export default defineAgent({
236
+ * // At most 3 sessions run a model turn at once; the rest queue FIFO.
237
+ * concurrency: { maxRunningTurns: 3 },
238
+ * });
239
+ * ```
240
+ */
241
+ export interface AgentConcurrencyOptions {
242
+ /**
243
+ * Max model turns running at once across **all** of this agent's
244
+ * sessions. When every slot is busy, newly admitted turns queue FIFO
245
+ * (surfaced as a durable `turn.queued` event and `queued: true` on
246
+ * `GET /v1/sessions`) instead of failing; each queued turn starts as
247
+ * soon as a slot frees. Positive integer, hard-capped at
248
+ * {@link MAX_RUNNING_TURNS_LIMIT}. Omit for unlimited.
249
+ *
250
+ * A queued turn still counts as `running` for busy semantics
251
+ * (follow-ups preempt it; direct write-effect tool calls get
252
+ * `SessionBusyError`),
253
+ * and a follow-up that preempts a queued turn re-queues at the back.
254
+ */
255
+ maxRunningTurns?: number;
256
+ }
257
+ /**
258
+ * Hard ceiling for {@link AgentConcurrencyOptions.maxRunningTurns}.
259
+ * Matches the eval harness ceiling: each running turn issues model
260
+ * provider requests, so unbounded parallelism is never meaningful.
261
+ */
262
+ export declare const MAX_RUNNING_TURNS_LIMIT = 200;
263
+ /**
264
+ * Managed-hosting block on {@link AgentConfig.hosting}.
265
+ */
266
+ export interface AgentHostingOptions {
267
+ /**
268
+ * Domains the deployed engine pod may reach (egress allowlist), e.g.
269
+ * `"api.example.com"` or `"*.example.com"` (single leading wildcard).
270
+ * Lowercase hostnames with at least two labels and an alphabetic TLD;
271
+ * max 20. `agent-sdk deploy` sends these as `egressAllowedDomains`
272
+ * (unioned with any `--allow-domain` flags). Only valid on repo-backed
273
+ * deployments. Deployment-scoped like {@link secretNames}: not capped by
274
+ * the team's Cloud Agent egress allowlist. The platform still merges a
275
+ * bootstrap set (npm, Slack, Cursor API) at provision time.
276
+ */
277
+ egressDomains?: string[];
278
+ /**
279
+ * Secret names this agent expects at runtime (declarative documentation;
280
+ * values are never authored in files). `agent-sdk deploy` warns when a
281
+ * declared name is not set on the deployment — set values with
282
+ * `agent-sdk secrets set <slug> NAME`.
283
+ */
284
+ secretNames?: string[];
285
+ /**
286
+ * Name of a container image the team pushed with
287
+ * `agent-sdk images push <local-image> --name <name>`; the deployed agent
288
+ * runs inside it instead of the platform's default `node:22` image. The
289
+ * image must be `linux/amd64` and provide `bash`, `node` (>= 22.13) and
290
+ * `npm` on `PATH`. Requires `architecture: "v2"`; today only
291
+ * `persistent: true` agents honor it. Deploy pins the image bytes it saw
292
+ * (sha256); pushing the same name again takes effect on the next deploy.
293
+ */
294
+ image?: string;
295
+ }
296
+ /**
297
+ * Local runtime options on {@link AgentConfig.local}.
298
+ */
299
+ export interface AgentLocalOptions {
300
+ /**
301
+ * Default local harness cwd parent. Absolute, or relative to the agent
302
+ * project root. Each session uses `<cwd>/<sessionId>` unless a per-send
303
+ * {@link SendMessageOptions.workspaceDir} overrides it.
304
+ *
305
+ * When omitted, a project nested in another git repo (a monorepo package)
306
+ * defaults to `~/.cache/agent-serve/<dir>` so Cursor does not load the
307
+ * enclosing checkout's AGENTS.md, rules, skills, or MCP servers. A
308
+ * standalone git root keeps the in-project session workspace. Point this
309
+ * at a checkout when the agent must inherit that tree.
310
+ */
311
+ cwd?: string;
312
+ /**
313
+ * One harness cwd shared by every session, for agents that work inside an
314
+ * existing checkout. Absolute, or relative to the agent project root.
315
+ * Takes precedence over {@link cwd}; a per-send
316
+ * {@link SendMessageOptions.workspaceDir} still wins over both.
317
+ *
318
+ * The SDK keys its local executor — Cursor rules, skills, MCP, the ignore
319
+ * mappings — on the harness cwd, so a shared directory resolves the
320
+ * workspace once per serve process instead of once per session. With
321
+ * `cwd`'s `<cwd>/<sessionId>` layout that cache never hits, and on a large
322
+ * repo each session pays the full scan again.
323
+ *
324
+ * Sessions are no longer isolated from each other on disk: they share a
325
+ * working tree, and a file one turn writes is visible to the next. Agent
326
+ * scaffold (`AGENTS.md`, skills, tool scripts) is kept out of the shared
327
+ * directory and delivered inline instead, so pointing this at a repo does
328
+ * not write Agent SDK files into it — but `workspaceFiles` still lands in
329
+ * the harness cwd, as it does for a per-send override.
330
+ */
331
+ workspaceDir?: string;
332
+ /**
333
+ * Run the harness inside Cursor's local sandbox (`sandboxOptions.enabled`
334
+ * on the SDK). Off by default, matching the SDK: shell then auto-approves
335
+ * and inherits the serve process environment — including any credentials
336
+ * the host holds.
337
+ *
338
+ * Turn this on for agents whose turns read untrusted input (webhook
339
+ * payloads, PR diffs, inbound chat). It is a real tool boundary rather
340
+ * than a prompt-level one, so it still holds when the model is steered
341
+ * into ignoring its instructions.
342
+ */
343
+ sandbox?: boolean;
344
+ }
345
+ export type AgentConfigDefinition = AgentConfig & BrandedDefinition<"agent">;
346
+ /** Input to `defineInstructions` (authored at `agent/instructions.ts`). */
347
+ export interface InstructionsConfig {
348
+ markdown: string;
349
+ }
350
+ export type InstructionsDefinition = InstructionsConfig & BrandedDefinition<"instructions">;
351
+ export type ToolResultContent = {
352
+ type: "text";
353
+ text: string;
354
+ } | {
355
+ type: "image";
356
+ data: string;
357
+ mimeType?: string;
358
+ };
359
+ /**
360
+ * JSON-ish value a tool may return. Unlike {@link JsonValue} this permits
361
+ * `undefined` leaves (and thus optional object properties), because the
362
+ * result is JSON-serialized before it reaches the model and `undefined`
363
+ * fields are simply dropped — so authored tools can return objects shaped by
364
+ * optional fields without fighting the type system.
365
+ */
366
+ export type ToolResultValue = string | number | boolean | null | undefined | ToolResultValue[] | readonly ToolResultValue[] | {
367
+ [key: string]: ToolResultValue;
368
+ };
369
+ /**
370
+ * What a tool's `execute` may return. Strings are passed to the model
371
+ * verbatim, JSON values are serialized, and the envelope form carries rich
372
+ * content and an error flag.
373
+ */
374
+ export type ToolExecuteResult = ToolResultValue | {
375
+ content: ToolResultContent[];
376
+ isError?: boolean;
377
+ /**
378
+ * Structured result for tools that declare an `outputSchema`: MCP
379
+ * clients require `structuredContent` on calls to schema-declaring
380
+ * tools. Plain-object returns get it filled in automatically; the
381
+ * envelope form (needed for images or `isError`) sets it here.
382
+ */
383
+ structuredContent?: JsonObject;
384
+ };
385
+ /** Repo-agnostic GitHub client on the agent-serve host. */
386
+ export interface HostGitHubClient {
387
+ getOctokit(): Promise<import("@octokit/rest").Octokit>;
388
+ }
389
+ /** Bot-token Slack Web API client on the agent-serve host. */
390
+ export interface HostSlackClient {
391
+ getClient(): Promise<import("@slack/web-api").WebClient>;
392
+ }
393
+ /** Host-side handle for calling an MCP connection from a server tool or channel handler. */
394
+ export interface HostMcpRegistry {
395
+ /** MCP connection names (filenames under `agent/mcp-connections/`). */
396
+ names(): string[];
397
+ listTools(connectionName: string): Promise<HostMcpToolInfo[]>;
398
+ callTool(connectionName: string, toolName: string, args?: Record<string, unknown>): Promise<HostMcpCallResult>;
399
+ }
400
+ /**
401
+ * MCP spec tool annotations (`Tool.annotations`, 2025-03-26 revision).
402
+ *
403
+ * A closed type on purpose: these are exactly the fields listing-time
404
+ * bounding keeps, so the type matches what a reader can ever see — and the
405
+ * hints are behavioral, so a misspelled or wrong-typed key must not
406
+ * masquerade as a declaration.
407
+ */
408
+ export interface McpToolAnnotations {
409
+ /** Human-readable display name for the tool, length-capped at listing. */
410
+ title?: string;
411
+ /** The tool does not modify its environment. */
412
+ readOnlyHint?: boolean;
413
+ /** The tool may perform destructive updates (meaningful when not read-only). */
414
+ destructiveHint?: boolean;
415
+ /** Repeated calls with the same arguments have no additional effect. */
416
+ idempotentHint?: boolean;
417
+ /** The tool may interact with an open world of external entities. */
418
+ openWorldHint?: boolean;
419
+ }
420
+ export interface HostMcpToolInfo {
421
+ name: string;
422
+ description?: string;
423
+ inputSchema?: JsonObject;
424
+ outputSchema?: JsonObject;
425
+ /**
426
+ * MCP spec tool annotations, bounded at listing time to the
427
+ * {@link McpToolAnnotations} fields. Untrusted server hints — consumers
428
+ * that classify on them must fail closed when absent, and absent is
429
+ * exactly what a server that declares nothing produces.
430
+ */
431
+ annotations?: McpToolAnnotations;
432
+ }
433
+ export interface HostMcpCallResult {
434
+ content: Array<{
435
+ type: "text";
436
+ text: string;
437
+ } | {
438
+ type: "image";
439
+ data: string;
440
+ mimeType?: string;
441
+ } | {
442
+ type: string;
443
+ [key: string]: unknown;
444
+ }>;
445
+ isError?: boolean;
446
+ structuredContent?: JsonObject;
447
+ }
448
+ /**
449
+ * Durable Slack follow-up nudge + ask-claim API attached to {@link HostContext}.
450
+ * Used for mid-turn inject, boundary resume skip, and delayed-parent dedupe.
451
+ */
452
+ export interface SlackNudgeHostApi {
453
+ append(input: {
454
+ continuationKey: string;
455
+ sourceTs: string;
456
+ text: string;
457
+ author?: string;
458
+ }): Promise<boolean>;
459
+ /** Drain pending nudges and return a `<slack_followup>` block, if any. */
460
+ drainFormatted(continuationKey: string): Promise<string | undefined>;
461
+ clear(continuationKey: string): Promise<void>;
462
+ hasUndelivered(continuationKey: string): Promise<boolean>;
463
+ isDelivered(continuationKey: string, sourceTs: string): Promise<boolean>;
464
+ /** Claim `channelId:message.ts` exactly once (false = already seen). */
465
+ tryClaimAsk(channelId: string, messageTs: string): Promise<boolean>;
466
+ /** Release a claim after a failed send so Slack redelivery can retry. */
467
+ releaseAsk(channelId: string, messageTs: string): Promise<void>;
468
+ }
469
+ /**
470
+ * Shared host services available on every tool / hook / channel / schedule
471
+ * surface. Channel packs attach this as `ctx.host` so handlers can tap
472
+ * GitHub, Slack, or MCP without the pack depending on another platform.
473
+ */
474
+ export interface HostContext {
475
+ /**
476
+ * Authored MCP connections (`agent/mcp-connections/*` and
477
+ * `agent/host-connections/*`). Call a specific MCP tool deterministically
478
+ * without going through the agent loop.
479
+ */
480
+ mcp: HostMcpRegistry;
481
+ /**
482
+ * Host GitHub client (PAT / env / `gh auth` / App). Prefer webhook
483
+ * `ctx.github` (installation-scoped) when handling a GitHub delivery.
484
+ */
485
+ github: HostGitHubClient;
486
+ /** Host Slack Web API client (`SLACK_BOT_TOKEN` / channel envPrefix). */
487
+ slack: HostSlackClient;
488
+ /**
489
+ * Per-session reminders (create / list / cancel / dispatch). Present once
490
+ * the serve host has attached a {@link ReminderRunner}.
491
+ */
492
+ reminders?: ReminderHostApi;
493
+ /**
494
+ * Slack ask-dedupe / nudge helpers. Always present on a live
495
+ * {@link SessionEngine} host. A busy Slack thread's follow-ups queue here
496
+ * and reach the running agent at its next tool boundary, via the workspace
497
+ * carrier hook; whatever the carrier does not reach in time still drains
498
+ * into the boundary turn, deduped by source ts.
499
+ */
500
+ slackNudges?: SlackNudgeHostApi;
501
+ /**
502
+ * Playground eval batches (`/v1/dev/evals*`). Present once the serve host
503
+ * has attached an {@link import("./evals.js").HostEvalsApi}. Used by the
504
+ * built-in Slack `eval` directive and available to tools/handlers.
505
+ */
506
+ evals?: import("./evals.js").HostEvalsApi;
507
+ /**
508
+ * Author-facing durable JSON KV (`agentkit/v1/{agent}/kv/…`). Backed by
509
+ * `agent/storage.ts` (`defineStorage`) when authored; otherwise files
510
+ * under `--state-root/kv`. Prefer this over ad-hoc files under the
511
+ * project tree so state survives host replacement.
512
+ */
513
+ kv: HostKvApi;
514
+ /**
515
+ * Author-facing durable files (`agentkit/v1/{agent}/files/…`). On
516
+ * Cursor-managed hosting they live in the deployment's durable store;
517
+ * otherwise under `--state-root/files`. Use this for file-shaped state —
518
+ * evidence, reports, hand-offs to a delegated run — that must outlive the
519
+ * process.
520
+ */
521
+ files: HostFilesApi;
522
+ /**
523
+ * Author-facing OpenTelemetry metrics and session tags. Always present.
524
+ * Counters and histograms no-op when no meter is running. `setAttributes`
525
+ * still tags the open session when a collector is attached.
526
+ */
527
+ otel: HostOtelApi;
528
+ }
529
+ /** Host-facing JSON key-value API attached to {@link HostContext.kv}. */
530
+ export interface HostKvApi {
531
+ /** Read one value. Miss → `undefined`. */
532
+ get(key: string): Promise<JsonValue | undefined>;
533
+ /** Write or replace one value. */
534
+ put(key: string, value: JsonValue): Promise<void>;
535
+ /** Remove one key. No-op when missing. */
536
+ delete(key: string): Promise<void>;
537
+ }
538
+ /** A value plus its opaque version token, as returned by CAS-capable reads. */
539
+ export interface KvVersionedEntry {
540
+ value: JsonValue;
541
+ /**
542
+ * Opaque per-key token that changes on every successful write. Callers
543
+ * must not parse it — backends mint whatever is cheap for them (a
544
+ * counter, a UUID, an `updated_at`/`xmin` pair, …).
545
+ */
546
+ version: string;
547
+ }
548
+ /**
549
+ * Outcome of a conditional write. On conflict the backend returns the
550
+ * entry it observed (`undefined` when the key is absent), so a CAS retry
551
+ * loop gets its re-read for free instead of paying a second round trip.
552
+ */
553
+ export type KvCasResult = {
554
+ ok: true;
555
+ version: string;
556
+ } | {
557
+ ok: false;
558
+ current: KvVersionedEntry | undefined;
559
+ };
560
+ /**
561
+ * Conditional-write superset of {@link HostKvApi}. Version-token CAS was
562
+ * chosen over compare-value: every candidate backend can mint a cheap
563
+ * opaque token (counter, UUID, row version), while compare-value would
564
+ * force deep JSON equality with key-order pitfalls on each of them. The
565
+ * agent-facing `host.kv` stays plain {@link HostKvApi}; storage backends
566
+ * supply CAS via the optional `cas` group on `defineStorage`.
567
+ */
568
+ export interface HostKvCasApi extends HostKvApi {
569
+ /** Read one value with its version token. Miss → `undefined`. */
570
+ getWithVersion(key: string): Promise<KvVersionedEntry | undefined>;
571
+ /** Create the key only when absent. Conflict returns the existing entry. */
572
+ putIfAbsent(key: string, value: JsonValue): Promise<KvCasResult>;
573
+ /**
574
+ * Replace the value only when the key still carries `expectedVersion`.
575
+ * Conflict (version moved, or key deleted) returns the current entry.
576
+ */
577
+ putIfVersion(key: string, value: JsonValue, expectedVersion: string): Promise<KvCasResult>;
578
+ /** All keys under a prefix, in ascending key order. */
579
+ listKeys(prefix: string): Promise<string[]>;
580
+ }
581
+ /**
582
+ * Runtime probe: does this KV implement the CAS superset? Only for
583
+ * stores of unknown provenance — e.g. a caller-supplied {@link HostKvApi}
584
+ * object whose static type does not carry the CAS methods. A
585
+ * `defineStorage` backend declares CAS through its `cas` group instead
586
+ * and never needs probing.
587
+ */
588
+ export declare function supportsKvCas(kv: HostKvApi): kv is HostKvCasApi;
589
+ /**
590
+ * Which set of files a call addresses.
591
+ *
592
+ * `"session"` (the default) is private to one session. `"deployment"` is shared
593
+ * by every session of the agent and survives redeploys; `partition` subdivides
594
+ * it for author-chosen groupings such as a pull request or a customer.
595
+ */
596
+ export type HostFilesScope = "session" | "deployment" | {
597
+ kind: "session";
598
+ sessionId?: string;
599
+ } | {
600
+ kind: "deployment";
601
+ partition?: string;
602
+ };
603
+ /** Scope selector shared by every {@link HostFilesApi} call. */
604
+ export interface HostFilesCallOptions {
605
+ scope?: HostFilesScope;
606
+ }
607
+ /** One entry from {@link HostFilesApi.list}. */
608
+ export interface HostFileEntry {
609
+ /** Path within the scope, as authors address it. */
610
+ path: string;
611
+ size: number;
612
+ /** Last-modified epoch ms, when the sink tracks one. */
613
+ mtimeMs?: number;
614
+ }
615
+ /** Result of {@link HostFilesApi.stat}. */
616
+ export interface HostFileStat {
617
+ size: number;
618
+ mtimeMs?: number;
619
+ /** Opaque version tag; pass back as `ifMatch` to make a write conditional. */
620
+ etag?: string;
621
+ }
622
+ /**
623
+ * What the configured sink actually supports. Read these instead of assuming:
624
+ * the same authored code runs against local disk, an Agent Store, and whatever
625
+ * a customer plugged in, and those differ in ways that change correctness.
626
+ */
627
+ export interface HostFilesCapabilities {
628
+ /**
629
+ * Conditional writes are enforced, so a lost race raises
630
+ * `FileConflictError` instead of silently clobbering. False means
631
+ * last-writer-wins.
632
+ */
633
+ conflictDetection: boolean;
634
+ /**
635
+ * Files have a real local path ({@link HostFilesApi.materializedPath}) the
636
+ * harness can open with ordinary file tools. False means the model cannot
637
+ * reach them directly — only authored handler code (tools, hooks) can,
638
+ * through this API.
639
+ */
640
+ materialized: boolean;
641
+ /** Largest value the sink accepts, when it declares a limit. */
642
+ maxBytes?: number;
643
+ }
644
+ /**
645
+ * Durable files attached to {@link HostContext.files}.
646
+ *
647
+ * Deliberately not a filesystem: no handles, no seeking, no rename, no
648
+ * directories, no errno. Paths are addresses within a {@link HostFilesScope},
649
+ * never filesystem paths — {@link materializedPath} is the one place a real
650
+ * path appears, and it is `undefined` whenever the sink keeps no local copy.
651
+ */
652
+ export interface HostFilesApi {
653
+ /** What the configured sink supports. */
654
+ readonly capabilities: HostFilesCapabilities;
655
+ /** Bind `"session"`-scoped calls to `sessionId`. */
656
+ forSession(sessionId: string): HostFilesApi;
657
+ /** Read as text. Miss → `undefined`. */
658
+ read(path: string, options?: HostFilesCallOptions & {
659
+ encoding?: BufferEncoding;
660
+ }): Promise<string | undefined>;
661
+ /** Read as bytes. Miss → `undefined`. */
662
+ readBytes(path: string, options?: HostFilesCallOptions): Promise<Uint8Array | undefined>;
663
+ /**
664
+ * Write or replace. Pass `ifMatch` with a {@link HostFileStat.etag} to make
665
+ * the write conditional, or `null` to require that it does not exist —
666
+ * enforced only when {@link HostFilesCapabilities.conflictDetection} is set.
667
+ */
668
+ write(path: string, data: string | Uint8Array, options?: HostFilesCallOptions & {
669
+ ifMatch?: string | null;
670
+ }): Promise<void>;
671
+ /** Remove one path. No-op when missing. */
672
+ remove(path: string, options?: HostFilesCallOptions): Promise<void>;
673
+ /** Entries whose path starts with `prefix` (all when omitted), in path order. */
674
+ list(prefix?: string, options?: HostFilesCallOptions): Promise<HostFileEntry[]>;
675
+ exists(path: string, options?: HostFilesCallOptions): Promise<boolean>;
676
+ stat(path: string, options?: HostFilesCallOptions): Promise<HostFileStat | undefined>;
677
+ /**
678
+ * Absolute local path the harness can read, or `undefined` when the sink
679
+ * keeps no local copy. Never use it as an identity — pass paths and scopes
680
+ * to the other calls so the same code works against a sink that has none.
681
+ */
682
+ materializedPath(path: string, options?: HostFilesCallOptions): string | undefined;
683
+ }
684
+ /** Attribute bag accepted by {@link HostOtelApi}. `undefined` values are dropped. */
685
+ export type HostOtelAttributes = Record<string, string | number | boolean | undefined>;
686
+ /**
687
+ * Author-facing OpenTelemetry surface on {@link HostContext.otel}.
688
+ *
689
+ * Metrics and tags only — no custom spans, and no raw OTel `Meter` /
690
+ * `Tracer`. First-party names (`cursor.token.usage`, …) and join keys
691
+ * (`cursor.conversation.id`, `agent_sdk.session_id`, `agent_sdk.agent`,
692
+ * …) are reserved.
693
+ */
694
+ export interface HostOtelApi {
695
+ /** True when a meter is running and `increment` / `record` export. */
696
+ readonly enabled: boolean;
697
+ /**
698
+ * Merge tags onto this host binding. On a session-bound host they join
699
+ * open turn/tool spans and later first-party metrics. Unbound tags
700
+ * stay on this host instance only.
701
+ */
702
+ setAttributes(attributes: HostOtelAttributes): void;
703
+ /** Add 1 to a counter. */
704
+ increment(name: string, attributes?: HostOtelAttributes): void;
705
+ /** Add `value` to a counter. */
706
+ increment(name: string, value: number, attributes?: HostOtelAttributes): void;
707
+ /** Record one histogram observation. */
708
+ record(name: string, value: number, attributes?: HostOtelAttributes): void;
709
+ }
710
+ /** Runtime context handed to a tool's `execute`. */
711
+ export interface ToolContext {
712
+ /** Correlates with `actions.requested` / `action.result` stream events. */
713
+ toolCallId?: string;
714
+ /** The session this tool call runs inside. */
715
+ session: SessionInfo;
716
+ /** Absolute path of the session's materialized workspace directory. */
717
+ workspaceDir: string;
718
+ /**
719
+ * Absolute path of the agent's durable state root (shared across every
720
+ * session of this agent).
721
+ */
722
+ stateRoot: string;
723
+ /** Shared host services (MCP / GitHub / Slack). */
724
+ host: HostContext;
725
+ /**
726
+ * Start or resume a session on any channel (cross-channel handoff).
727
+ * Same semantics as a channel route's `send`, with an explicit channel id.
728
+ * `auth` defaults to this tool call's session principal (like HTTP
729
+ * channel `send`); pass explicitly to override.
730
+ */
731
+ send(channelId: string, message: string, options?: SendMessageOptions): Promise<ChannelSession>;
732
+ /** Look up a session on a channel (e.g. refresh `sdkAgentId` after a turn). */
733
+ getSession(channelId: string, sessionId: string): Promise<ChannelSession | null>;
734
+ /**
735
+ * Durable artifacts, bound to this tool call's session: `tag` auto-fills
736
+ * `sessionId` (and `turnId` when known).
737
+ */
738
+ artifacts: ArtifactsApi;
739
+ /**
740
+ * Append a session event onto this call's in-flight turn. Same shape as a
741
+ * Task subagent stream (`parentCallId`, `subagent.called` /
742
+ * `subagent.completed`). Omitted for scratch `callTool` with no session.
743
+ */
744
+ emit?: (payload: SessionEventPayload) => void;
745
+ /** The session's frozen `asOf`, or the wall clock. Use instead of `Date.now()`. */
746
+ now(): Date;
747
+ /**
748
+ * The session's frozen instant (ISO-8601), when it has one. Present exactly
749
+ * when this is an `asOf` session. A tool that reaches other tools itself —
750
+ * the script sandbox — reads it to apply the same forward-time guard to the
751
+ * calls it makes, which do not pass back through the host's gate.
752
+ */
753
+ asOf?: string;
754
+ }
755
+ /**
756
+ * Where a tool's body runs.
757
+ *
758
+ * - `"server"` (default): in-process on the agent-serve host via Cursor SDK
759
+ * custom tools. Only available when the agent {@link AgentConfig.runtime}
760
+ * is `"local"`.
761
+ * - `"agent"` — materialized into the session workspace as a shell
762
+ * script the Cursor agent invokes. Requires
763
+ * {@link ToolConfig.script}; `execute` is not used.
764
+ */
765
+ export type ToolExecution = "server" | "agent";
766
+ /**
767
+ * Whether a server tool call must pause for human approval before
768
+ * `execute` runs. Boolean always gates; a predicate decides per call from
769
+ * validated input only (no {@link ToolContext} — runs before the gate).
770
+ */
771
+ export type ToolNeedsApproval<TInput> = boolean | ((input: TInput) => boolean | Promise<boolean>);
772
+ /**
773
+ * Whether invoking a tool can change anything outside this session.
774
+ *
775
+ * `"read"` cannot, by construction — a query, a file read, a listing.
776
+ * `"write"` changes something a person or another agent will later see: an
777
+ * external system (a comment, a message, a ticket) or shared storage another
778
+ * session reads back.
779
+ *
780
+ * This is what {@link SendMessageOptions.dryRun} enforces. In a dry-run
781
+ * session a write is answered by the host and never executed, while reads run
782
+ * for real — so an agent can be run against real data to see what it *would*
783
+ * have done.
784
+ *
785
+ * A tool that declares nothing is treated as a write: a dry run promises
786
+ * "nothing outside this session changed", which it cannot promise about a tool
787
+ * it knows nothing about. An unannotated tool is therefore useless in a dry
788
+ * run.
789
+ */
790
+ export type ToolEffect = "read" | "write";
791
+ /** Authored `defineConnection({ effects })` — one effect or a set. */
792
+ export type ConnectionEffects = ToolEffect | readonly ToolEffect[];
793
+ export declare function isToolEffect(value: unknown): value is ToolEffect;
794
+ /**
795
+ * Normalize authored {@link ConnectionConfig.effects} to a unique list.
796
+ * Invalid values are left for discovery to reject — this only collapses
797
+ * `"read"` / `["read"]` / duplicates.
798
+ */
799
+ export declare function normalizeConnectionEffects(effects: ConnectionEffects): ToolEffect[];
800
+ /**
801
+ * Trim, drop blanks, and unique-preserve authored
802
+ * {@link ConnectionConfig.tools} name lists. Invalid shapes are left
803
+ * for discovery.
804
+ */
805
+ export declare function normalizeConnectionTools(tools: readonly string[]): string[];
806
+ /** True when `toolName` passes the connection's `tools` / `disallowedTools` filter. */
807
+ export declare function connectionAllowsTool(filter: {
808
+ tools?: readonly string[];
809
+ disallowedTools?: readonly string[];
810
+ }, toolName: string): boolean;
811
+ /**
812
+ * A tool's declared {@link ToolEffect} — fixed, or decided per call from
813
+ * validated input for tools that read or write depending on their arguments
814
+ * (an HTTP request keyed on method, a SQL tool keyed on statement).
815
+ */
816
+ export type ToolEffectDeclaration<TInput> = ToolEffect | ((input: TInput) => ToolEffect);
817
+ export interface ToolConfig<TInput> {
818
+ description: string;
819
+ /**
820
+ * Where the tool body runs. Defaults to `"server"` (in-process on the
821
+ * agent-serve process). Use `"agent"` to materialize a workspace script
822
+ * the Cursor agent invokes instead.
823
+ */
824
+ execution?: ToolExecution;
825
+ /**
826
+ * Zod schema (validated before `execute` runs) or a plain JSON Schema
827
+ * object (forwarded to the model as-is, unvalidated). Omit to accept any
828
+ * JSON object.
829
+ */
830
+ inputSchema?: z.ZodType<TInput> | JsonSchemaObject;
831
+ /**
832
+ * JSON Schema for the tool's structured output (`Tool.outputSchema` from
833
+ * the MCP spec), as a zod schema (converted, never validated against) or a
834
+ * plain JSON Schema object. Advertised when declared and omitted
835
+ * otherwise — results are not validated against it.
836
+ */
837
+ outputSchema?: z.ZodTypeAny | JsonSchemaObject;
838
+ /**
839
+ * When true (or when the predicate returns true), the host parks the
840
+ * in-flight tool call until a human approves or denies via
841
+ * `POST /v1/session/:sessionId/approvals/:callId`. Only supported for
842
+ * `execution: "server"` tools on the local runtime.
843
+ */
844
+ needsApproval?: ToolNeedsApproval<TInput>;
845
+ /**
846
+ * Whether this tool changes anything outside the session. Undeclared means
847
+ * write, so a dry run stubs it — see {@link ToolEffect}.
848
+ */
849
+ effect?: ToolEffectDeclaration<TInput>;
850
+ /**
851
+ * Input properties that carry time bounds. In a session created with
852
+ * {@link SendMessageOptions.asOf}, every named argument must be an
853
+ * absolute ISO-8601 instant with a timezone, no later than the session's
854
+ * frozen instant — a call that omits one, or supplies a relative or later
855
+ * value, is refused so the model retries with absolute bounds. Names must
856
+ * exist in {@link inputSchema}; a session with `asOf` refuses to start
857
+ * otherwise, because a misspelled name would silently check nothing.
858
+ * Ignored in sessions without `asOf`.
859
+ */
860
+ timeArgs?: readonly string[];
861
+ /**
862
+ * What a write tool returns in a dry-run session instead of executing.
863
+ *
864
+ * Omit for a tool whose result the caller only acknowledges. Supply one when
865
+ * the result is read structurally — a caller that uses `result.revision`
866
+ * breaks on a bare string — so a dry run stays on the same path production
867
+ * takes. Ignored unless {@link effect} resolves to `"write"`.
868
+ */
869
+ dryRunResult?: ToolExecuteResult | ((input: TInput) => ToolExecuteResult);
870
+ /**
871
+ * In-process implementation. Required when {@link execution} is
872
+ * `"server"` (the default); ignored for `"agent"` tools.
873
+ */
874
+ execute?: (input: TInput, ctx: ToolContext) => ToolExecuteResult | Promise<ToolExecuteResult>;
875
+ /**
876
+ * Agent tools: shell script body written into the session workspace.
877
+ * Receives a JSON object on stdin and should print the result on
878
+ * stdout. Required when {@link execution} is `"agent"`.
879
+ */
880
+ script?: string;
881
+ }
882
+ /** Discovered tool definition with erased input generics. */
883
+ export interface ToolDefinition extends BrandedDefinition<"tool"> {
884
+ readonly description: string;
885
+ readonly execution?: ToolExecution;
886
+ readonly inputSchema?: z.ZodTypeAny | JsonSchemaObject;
887
+ readonly outputSchema?: z.ZodTypeAny | JsonSchemaObject;
888
+ readonly needsApproval?: ToolNeedsApproval<never>;
889
+ readonly effect?: ToolEffectDeclaration<never>;
890
+ readonly timeArgs?: readonly string[];
891
+ readonly dryRunResult?: ToolExecuteResult | ((input: never) => ToolExecuteResult);
892
+ readonly execute?: (input: never, ctx: ToolContext) => ToolExecuteResult | Promise<ToolExecuteResult>;
893
+ readonly script?: string;
894
+ }
895
+ /** Input to `defineSkill` (authored at `agent/skills/<name>.ts`). */
896
+ export interface SkillConfig {
897
+ /** Routing hint advertised to the model in the skills catalog. */
898
+ description?: string;
899
+ /** The skill body (becomes `SKILL.md`). */
900
+ markdown: string;
901
+ /** Package-relative sibling files, e.g. `references/checklist.md`. */
902
+ files?: Record<string, string>;
903
+ }
904
+ export type SkillDefinition = SkillConfig & BrandedDefinition<"skill">;
905
+ /**
906
+ * Input to `defineExtension`, the `extension.ts` at the root of an
907
+ * agent-shaped tree (`tools/`, `skills/`, `lib/`).
908
+ */
909
+ export interface ExtensionOptions<TConfig, TInput = TConfig> {
910
+ /** The tree's directory; pass `import.meta.dirname`. */
911
+ root: string;
912
+ /** What the extension adds; shown by `info`. */
913
+ description?: string;
914
+ /** Mount configuration schema. A consumer's settings are validated at mount. */
915
+ config?: z.ZodType<TConfig, z.ZodTypeDef, TInput>;
916
+ /** Choose which contribution groups this mount includes. */
917
+ contributions?: (config: TConfig) => ExtensionContributionSelection;
918
+ }
919
+ /** Contribution groups a configured extension mount may include or omit. */
920
+ export interface ExtensionContributionSelection {
921
+ /** Include tools from the extension tree. Defaults to true. */
922
+ tools?: boolean;
923
+ /** Include skills from the extension tree. Defaults to true. */
924
+ skills?: boolean;
925
+ }
926
+ /**
927
+ * What `extension.ts` default-exports. A consumer calls it from
928
+ * `agent/extensions/<ns>.ts` to mount the extension with a configuration;
929
+ * the extension's own modules import it to read that configuration.
930
+ */
931
+ export interface Extension<TConfig = undefined, TInput = TConfig> extends ExtensionDeclaration {
932
+ (...args: undefined extends TInput ? [config?: TInput] : [config: TInput]): ExtensionMount;
933
+ /** The mounted configuration (schema defaults applied); throws before the mount. */
934
+ readonly config: TConfig;
935
+ }
936
+ /** The mount-independent part of an {@link Extension}: an agent-shaped tree. */
937
+ export interface ExtensionDeclaration {
938
+ readonly root: string;
939
+ readonly description: string | undefined;
940
+ }
941
+ /** A Cursor plugin directory declared by `cursorPlugin`. */
942
+ export interface CursorPluginDeclaration extends ExtensionDeclaration {
943
+ readonly layout: "cursor-plugin";
944
+ readonly variables: Record<string, string>;
945
+ }
946
+ /** What `agent/extensions/<ns>.ts` default-exports. */
947
+ export interface ExtensionMount extends BrandedDefinition<"extension"> {
948
+ readonly extension: ExtensionDeclaration | CursorPluginDeclaration;
949
+ readonly config: unknown;
950
+ readonly contributions?: ExtensionContributionSelection;
951
+ }
952
+ /** `cursorPlugin({ ... })`: mount a Cursor plugin directory as an extension. */
953
+ export interface CursorPluginOptions {
954
+ /**
955
+ * The plugin directory: the one holding `.cursor-plugin/plugin.json`
956
+ * (or `.claude-plugin/plugin.json` / `plugin.json`). A relative path
957
+ * resolves against the project root.
958
+ */
959
+ path: string;
960
+ /**
961
+ * Values for the `${NAME}` placeholders in the plugin's MCP config, the
962
+ * variables a Cursor install prompts for. Names the mount omits fall back
963
+ * to `process.env`; a placeholder nothing resolves fails discovery.
964
+ */
965
+ variables?: Record<string, string>;
966
+ }
967
+ /**
968
+ * `export default disableTool()` in a directory mount's `tools/<name>.ts`
969
+ * removes the extension's `<ns>__<name>`.
970
+ */
971
+ export type DisabledToolDefinition = BrandedDefinition<"disabled-tool">;
972
+ /**
973
+ * `export default disableConnection()` in a directory mount's
974
+ * `mcp-connections/<server>.ts` removes the extension's `<ns>__<server>`.
975
+ */
976
+ export type DisabledConnectionDefinition = BrandedDefinition<"disabled-connection">;
977
+ /**
978
+ * `export default disable()` / `disableSkill()` / `disableHook()` /
979
+ * `disableChannel()` / `disableSchedule()` / `disableSubagent()` /
980
+ * `disableInstructions()` / `disableArtifacts()` in a directory mount
981
+ * removes that contribution from the matching overlay slot.
982
+ */
983
+ export type DisabledDefinition = BrandedDefinition<"disabled">;
984
+ /** One mounted extension and the names it contributed. */
985
+ export interface DiscoveredExtension {
986
+ /** Mount namespace: the filename stem or directory name under `agent/extensions/`. */
987
+ name: string;
988
+ description?: string;
989
+ /** Composed tool names (`<ns>__<name>`), overrides applied. */
990
+ tools: string[];
991
+ /** Composed skill names (`<ns>__<name>`), overrides applied. */
992
+ skills: string[];
993
+ /** Composed MCP connection names (`<ns>__<server>`). */
994
+ connections: string[];
995
+ /** Composed host MCP connection names (`<ns>__<server>`). */
996
+ hostConnections: string[];
997
+ /** Composed subagent names (`<ns>__<id>`). */
998
+ subagents: string[];
999
+ /** Composed hook names (`<ns>__<name>`). */
1000
+ hooks: string[];
1001
+ /** Composed channel ids (`<ns>__<id>`). */
1002
+ channels: string[];
1003
+ /** Composed schedule names (`<ns>__<name>`). */
1004
+ schedules: string[];
1005
+ /** Whether the mount contributed an instructions fragment. */
1006
+ instructions: boolean;
1007
+ /** Workspace seed paths the mount contributed. */
1008
+ seedFiles: string[];
1009
+ /** Composed artifact kind names (`<ns>__<kind>`). */
1010
+ artifactKinds: string[];
1011
+ }
1012
+ /**
1013
+ * Transport for an MCP connection, mirroring the Cursor SDK's
1014
+ * `McpServerConfig` shapes — plus two agent-serve variants that stay
1015
+ * symbolic until the server starts:
1016
+ *
1017
+ * - `agent` addresses a **peer agent** mounted on the same serve host by
1018
+ * slug; it resolves to that agent's MCP endpoint (`/<slug>/v1/mcp`).
1019
+ * - `cursorAccount` exposes the **Cursor account's MCP connectors** (the
1020
+ * HTTP/SSE servers the operator already authorized in Cursor). It
1021
+ * resolves to a bridge on this host that executes every tool **on the
1022
+ * Cursor backend** with the account's stored OAuth credentials — tokens
1023
+ * never reach this host.
1024
+ */
1025
+ export type ConnectionTransport = {
1026
+ type?: "stdio";
1027
+ command: string;
1028
+ args?: string[];
1029
+ env?: Record<string, string>;
1030
+ cwd?: string;
1031
+ } | {
1032
+ type?: "http" | "sse";
1033
+ url: string;
1034
+ headers?: Record<string, string>;
1035
+ /** Host PKCE OAuth; `agent-sdk mcp oauth <name>`. No Authorization header. */
1036
+ oauth?: true;
1037
+ } | {
1038
+ /** Slug of a peer agent mounted on the same serve host. */
1039
+ agent: string;
1040
+ } | {
1041
+ /** Expose the Cursor account's MCP connectors (backend-executed). */
1042
+ cursorAccount: true;
1043
+ /**
1044
+ * Restrict to these connector names after discovery normalization.
1045
+ * Authored configs may also pass `"*"` / `["*"]` (see
1046
+ * {@link ConnectionConfig}); those normalize to `undefined` (= all).
1047
+ */
1048
+ servers?: string[];
1049
+ };
1050
+ /** True for the peer-agent transport variant (`{ agent: "<slug>" }`). */
1051
+ export declare function isPeerConnectionTransport(transport: ConnectionTransport): transport is {
1052
+ agent: string;
1053
+ };
1054
+ /** True for the Cursor account transport variant (`{ cursorAccount: true }`). */
1055
+ export declare function isCursorAccountTransport(transport: ConnectionTransport): transport is {
1056
+ cursorAccount: true;
1057
+ servers?: string[];
1058
+ };
1059
+ /**
1060
+ * Normalize an authored Cursor account `servers` filter.
1061
+ *
1062
+ * `undefined`, `"*"`, and `["*"]` (after trim) all mean every connected
1063
+ * HTTP/SSE server on the account. Returns a concrete allowlist, or
1064
+ * `undefined` for all. Does not validate emptiness, blank entries, or a
1065
+ * mixed `"*"` + names list — discovery owns those diagnostics.
1066
+ */
1067
+ export declare function normalizeCursorAccountServers(servers: string[] | "*" | undefined): string[] | undefined;
1068
+ /** True when an authored allowlist mixes `"*"` with other connector names. */
1069
+ export declare function cursorAccountServersHasMixedWildcard(servers: string[] | "*" | undefined): boolean;
1070
+ /**
1071
+ * True for an HTTP/SSE transport authorized with host PKCE OAuth
1072
+ * (`defineConnection({ url, oauth: true })`). The tokens live on the serve
1073
+ * host (`mcp-auth.json` / `MCP_OAUTH_*`), so only host-side MCP clients can
1074
+ * use them.
1075
+ */
1076
+ export declare function isHostOauthConnectionTransport(transport: ConnectionTransport): transport is Extract<ConnectionTransport, {
1077
+ url: string;
1078
+ }> & {
1079
+ oauth: true;
1080
+ };
1081
+ /**
1082
+ * True for transports that stay symbolic at discovery time and are resolved
1083
+ * by the serve host once it is listening (peers and the Cursor account
1084
+ * bridge). Symbolic transports never reach the SDK or the host MCP registry
1085
+ * unresolved.
1086
+ */
1087
+ export declare function isSymbolicConnectionTransport(transport: ConnectionTransport): boolean;
1088
+ /** One TypeScript tool on `defineConnection({ tools })`. */
1089
+ export type InlineStdioToolConfig = {
1090
+ description: string;
1091
+ inputSchema?: z.ZodTypeAny | JsonSchemaObject;
1092
+ /** Output JSON Schema (zod converted, never validated); advertised when declared. */
1093
+ outputSchema?: z.ZodTypeAny | JsonSchemaObject;
1094
+ execute: (input: JsonObject) => unknown | Promise<unknown>;
1095
+ };
1096
+ /** `defineConnection({ tools })`. TypeScript in; stdio MCP out. */
1097
+ export type InlineStdioConnectionConfig = {
1098
+ tools: Record<string, InlineStdioToolConfig>;
1099
+ };
1100
+ /**
1101
+ * Authored MCP connection config (`defineConnection(...)`).
1102
+ *
1103
+ * For Cursor account connections, `servers` may be omitted, `"*"`, or
1104
+ * `["*"]` to forward every connected HTTP/SSE connector; a concrete
1105
+ * `string[]` allowlists by connector name. Discovery normalizes the
1106
+ * wildcard forms to an unfiltered {@link ConnectionTransport}.
1107
+ *
1108
+ * `{ tools }` authors TypeScript handlers. Discovery packages them into a
1109
+ * stdio MCP server the agent environment can spawn.
1110
+ */
1111
+ export type ConnectionConfig = (((Exclude<ConnectionTransport, {
1112
+ cursorAccount: true;
1113
+ }> | {
1114
+ cursorAccount: true;
1115
+ /**
1116
+ * Which account connectors to expose.
1117
+ *
1118
+ * - Omit, pass `"*"`, or pass `["*"]` to forward **every** connected
1119
+ * HTTP/SSE server on the account (no per-connector allowlist).
1120
+ * - Pass connector names as they appear in the Cursor account's MCP
1121
+ * config (e.g. `["Linear", "Notion"]`) to restrict the set.
1122
+ */
1123
+ servers?: string[] | "*";
1124
+ }) & {
1125
+ /**
1126
+ * Tool-name allowlist. Same shape as {@link AgentConfig.tools}:
1127
+ * when set, only these MCP tool names (the server's `tools/list`
1128
+ * names) are advertised and callable through `host.mcp`. Names
1129
+ * the server does not list are omitted, not guessed.
1130
+ *
1131
+ * A list of names is an allowlist. An object of handlers authors
1132
+ * TypeScript tools ({@link InlineStdioConnectionConfig}).
1133
+ *
1134
+ * On a model-visible connection this requires {@link advertiseTools}:
1135
+ * an attached server would still expose every tool. On
1136
+ * `host-connections/` it restricts `host.mcp` alone.
1137
+ *
1138
+ * Combines with {@link disallowedTools} as deny-wins.
1139
+ */
1140
+ tools?: readonly string[];
1141
+ }) | InlineStdioConnectionConfig) & {
1142
+ /** Documentation only; shown in `info` output. */
1143
+ description?: string;
1144
+ /**
1145
+ * Per-session auth: called at turn-build time with the session's
1146
+ * {@link SessionInfo}, returning headers merged over the transport's
1147
+ * static `headers` for that session's use of this connection. This is
1148
+ * how a multi-tenant agent injects the caller's identity — it derives
1149
+ * who the session is for host-side and mints a tenant-scoped
1150
+ * credential; the model never sees a tenant parameter and can never
1151
+ * choose the tenant.
1152
+ *
1153
+ * Derive the identity from durable session facts — `session.auth`,
1154
+ * `session.id`, or your channel's own session state. Do **not** key it
1155
+ * off `session.continuationKey`: it is a channel routing key, and channels
1156
+ * may re-key it independently of the authenticated principal.
1157
+ *
1158
+ * Works attached or advertised. Advertised connections
1159
+ * ({@link advertiseTools}) open per-operation clients with the
1160
+ * evaluated headers. Attached connections ride the turn's SDK
1161
+ * `mcpServers`, passed on every send rather than pinned on the cached
1162
+ * per-session agent handle, so every turn — follow-ups, reminder
1163
+ * wakes — runs on headers evaluated for that turn. The cost: when any
1164
+ * attached connection has `auth`, *all* of the agent's attached
1165
+ * connections are configured per send, so the harness opens fresh MCP
1166
+ * clients for them each turn (stdio servers respawn per turn — avoid
1167
+ * pairing an auth'd connection with a stateful stdio server), and
1168
+ * workspace prewarm omits auth'd connections rather than attaching
1169
+ * them without an identity.
1170
+ *
1171
+ * HTTP/SSE transports only, not combinable with `oauth: true`
1172
+ * (discovery rejects both). A callback that throws fails the turn: a
1173
+ * turn never silently runs without the connection's identity.
1174
+ * `host.mcp` calls from server tools keep the static headers only.
1175
+ */
1176
+ auth?: ConnectionAuthProvider;
1177
+ /**
1178
+ * Advertise this connection's tools by name instead of leaving them
1179
+ * behind the MCP meta-tools: at turn-build time the engine lists the
1180
+ * connection's tools and synthesizes a named 1:1 passthrough server
1181
+ * tool per entry — the server's own names, descriptions, and live
1182
+ * schemas — merged into the authored `agent/tools/` catalog. The raw
1183
+ * connection is then not attached to the model (it stays available on
1184
+ * `host.mcp`), so each tool appears exactly once.
1185
+ *
1186
+ * Fail-closed: a `listTools` failure, an invalid tool name, or a name
1187
+ * collision (with an authored tool or another advertised connection)
1188
+ * fails the turn — a turn never silently runs with a shrunken toolset.
1189
+ * The listing runs once per turn; point this at endpoints that can
1190
+ * answer `tools/list` cheaply. Tools whose MCP `annotations.title` is
1191
+ * `do-not-call` are omitted (vendor host-UI / MCP Apps helpers).
1192
+ */
1193
+ advertiseTools?: boolean;
1194
+ /**
1195
+ * With {@link advertiseTools}, a `listTools` or `auth` failure skips this
1196
+ * connection (zero tools from it) instead of failing the turn. Other
1197
+ * advertised connections still fail closed. Requires `advertiseTools`.
1198
+ */
1199
+ optional?: boolean;
1200
+ /**
1201
+ * Intended effects of tools this connection serves. When set, only
1202
+ * tools whose classified effect is in this set are advertised — a
1203
+ * connection that wants reads never puts a write, or a tool nothing
1204
+ * classified, in the model's toolset.
1205
+ *
1206
+ * Classification is the same fail-closed read of MCP annotations the
1207
+ * dry-run gate uses (`readOnlyHint` / `destructiveHint`). A tool the
1208
+ * server does not classify is omitted, not guessed. Servers that leave
1209
+ * tools unannotated stay empty here until they annotate or a trusted
1210
+ * listing injects a known-read hint.
1211
+ *
1212
+ * Requires {@link advertiseTools}: this filters the named passthroughs
1213
+ * the model sees. A single value (`"read"`) and an array (`["read"]`)
1214
+ * are the same.
1215
+ */
1216
+ effects?: ConnectionEffects;
1217
+ /**
1218
+ * Tool-name denylist. Same shape as the Cursor SDK's
1219
+ * `disallowedTools`: when set, these MCP tool names are omitted from
1220
+ * the advertised set and rejected on `host.mcp`. Combines with
1221
+ * {@link ConnectionConfig.tools} as deny-wins.
1222
+ *
1223
+ * On a model-visible connection this requires {@link advertiseTools}.
1224
+ * On `host-connections/` it restricts `host.mcp` alone.
1225
+ */
1226
+ disallowedTools?: readonly string[];
1227
+ };
1228
+ /**
1229
+ * Per-session connection auth on {@link ConnectionConfig.auth}: session →
1230
+ * headers merged over the transport's static headers for that session's
1231
+ * turns. See the field docs for the fail-closed semantics.
1232
+ */
1233
+ export type ConnectionAuthProvider = (session: SessionInfo) => ConnectionAuthResult | Promise<ConnectionAuthResult>;
1234
+ /** What a {@link ConnectionAuthProvider} returns. */
1235
+ export type ConnectionAuthResult = {
1236
+ headers: Record<string, string>;
1237
+ };
1238
+ /** True when the connection authors tools instead of a spawn/URL/peer. */
1239
+ export declare function isInlineStdioConnection(connection: ConnectionConfig): connection is InlineStdioConnectionConfig & {
1240
+ description?: string;
1241
+ };
1242
+ /**
1243
+ * An MCP connection is available to the agent (SDK `mcpServers`), host
1244
+ * (`ctx.host.mcp`), and channel/schedule handlers.
1245
+ */
1246
+ export type ConnectionDefinition = ConnectionConfig & BrandedDefinition<"connection">;
1247
+ /** Who initiated a session (or an authenticated channel request). */
1248
+ export interface AuthContext {
1249
+ /** Which policy authenticated the caller, e.g. `"local-dev"`. */
1250
+ authenticator: string;
1251
+ principalId: string;
1252
+ principalType: "user" | "service" | "runtime";
1253
+ attributes?: Record<string, string>;
1254
+ }
1255
+ export interface AuthRequestInfo {
1256
+ /** Client IP, or null when the host cannot provide it. */
1257
+ requestIp: string | null;
1258
+ }
1259
+ /**
1260
+ * A route auth policy. Return an {@link AuthContext} to admit the request,
1261
+ * or null to pass to the next policy in the chain. A request is rejected
1262
+ * with 401 when every policy in the chain returns null.
1263
+ */
1264
+ export type AuthPolicy = (request: Request, info: AuthRequestInfo) => AuthContext | null | Promise<AuthContext | null>;
1265
+ export interface SessionEventEnvelope {
1266
+ /** Monotonic per-session event index; reconnect with `?startIndex=`. */
1267
+ index: number;
1268
+ sessionId: string;
1269
+ /** Present on turn-scoped events. */
1270
+ turnId?: string;
1271
+ /** ISO-8601 timestamp. */
1272
+ at: string;
1273
+ }
1274
+ export interface ActionCall {
1275
+ callId: string;
1276
+ toolName: string;
1277
+ args?: unknown;
1278
+ /**
1279
+ * When set, this tool call belongs to a nested subagent turn whose
1280
+ * parent `task` tool call id is `parentCallId`.
1281
+ */
1282
+ parentCallId?: string;
1283
+ }
1284
+ /** Human decision for a parked {@link ToolConfig.needsApproval} tool call. */
1285
+ export type ApprovalDecision = "approve" | "deny";
1286
+ /** Durable record of a tool call waiting on human approval. */
1287
+ export interface PendingApproval {
1288
+ callId: string;
1289
+ turnId: string;
1290
+ toolName: string;
1291
+ args: unknown;
1292
+ requestedAt: string;
1293
+ }
1294
+ /** Durable record of a tool call waiting on MCP authorization. */
1295
+ export interface PendingAuth {
1296
+ callId: string;
1297
+ turnId: string;
1298
+ toolName: string;
1299
+ connection: string;
1300
+ authUrl: string;
1301
+ requestedAt: string;
1302
+ }
1303
+ export type SessionEventPayload = {
1304
+ type: "session.started";
1305
+ data: {
1306
+ channelId: string;
1307
+ dryRun?: boolean;
1308
+ };
1309
+ } | {
1310
+ /** Cursor SDK agent id is known (cloud: `bc-…`; local: session id). */
1311
+ type: "agent.bound";
1312
+ data: {
1313
+ sdkAgentId: string;
1314
+ url?: string;
1315
+ };
1316
+ } | {
1317
+ type: "message.received";
1318
+ data: {
1319
+ text: string;
1320
+ };
1321
+ } | {
1322
+ /**
1323
+ * The turn was admitted while every {@link AgentConcurrencyOptions.maxRunningTurns}
1324
+ * slot was busy; it waits FIFO and `turn.started` follows once a slot
1325
+ * frees. `position` is 1-based among waiting turns at enqueue time.
1326
+ */
1327
+ type: "turn.queued";
1328
+ data: {
1329
+ position: number;
1330
+ maxRunningTurns: number;
1331
+ };
1332
+ } | {
1333
+ type: "turn.started";
1334
+ data: Record<string, never>;
1335
+ } | {
1336
+ type: "step.started";
1337
+ data: {
1338
+ stepId: number;
1339
+ };
1340
+ } | {
1341
+ type: "step.completed";
1342
+ data: {
1343
+ stepId: number;
1344
+ durationMs: number;
1345
+ };
1346
+ } | {
1347
+ type: "reasoning.appended";
1348
+ data: {
1349
+ delta: string;
1350
+ text: string;
1351
+ parentCallId?: string;
1352
+ };
1353
+ } | {
1354
+ type: "reasoning.completed";
1355
+ data: {
1356
+ durationMs?: number;
1357
+ parentCallId?: string;
1358
+ };
1359
+ } | {
1360
+ type: "message.appended";
1361
+ data: {
1362
+ delta: string;
1363
+ text: string;
1364
+ parentCallId?: string;
1365
+ };
1366
+ } | {
1367
+ type: "message.completed";
1368
+ data: {
1369
+ text: string;
1370
+ finishReason: "stop" | "tool_call";
1371
+ parentCallId?: string;
1372
+ };
1373
+ } | {
1374
+ type: "actions.requested";
1375
+ data: {
1376
+ calls: ActionCall[];
1377
+ parentCallId?: string;
1378
+ };
1379
+ } | {
1380
+ /**
1381
+ * A server tool with {@link ToolConfig.needsApproval} is parked until
1382
+ * a human resolves it. The turn stays running; send follow-ups
1383
+ * after `session.waiting` as usual.
1384
+ */
1385
+ type: "action.approval_requested";
1386
+ data: {
1387
+ callId: string;
1388
+ toolName: string;
1389
+ args?: unknown;
1390
+ parentCallId?: string;
1391
+ };
1392
+ } | {
1393
+ type: "action.approval_resolved";
1394
+ data: {
1395
+ callId: string;
1396
+ toolName: string;
1397
+ decision: ApprovalDecision;
1398
+ by?: string;
1399
+ parentCallId?: string;
1400
+ };
1401
+ } | {
1402
+ /**
1403
+ * A host MCP call/list needs OAuth. The turn stays running until
1404
+ * the human completes the `authUrl` and the runtime retries.
1405
+ */
1406
+ type: "action.auth_requested";
1407
+ data: {
1408
+ callId: string;
1409
+ toolName: string;
1410
+ connection: string;
1411
+ authUrl: string;
1412
+ parentCallId?: string;
1413
+ };
1414
+ } | {
1415
+ type: "action.auth_resolved";
1416
+ data: {
1417
+ callId: string;
1418
+ toolName: string;
1419
+ connection: string;
1420
+ decision: ApprovalDecision;
1421
+ by?: string;
1422
+ parentCallId?: string;
1423
+ };
1424
+ } | {
1425
+ type: "action.result";
1426
+ data: {
1427
+ callId: string;
1428
+ toolName: string;
1429
+ output?: unknown;
1430
+ isError: boolean;
1431
+ /**
1432
+ * The tool never ran: a write answered by the host in a `dryRun`
1433
+ * session. `actions.requested` still carries the arguments the model
1434
+ * chose, so this is the marker that separates "what it would have
1435
+ * done" from a real effect when reading a trajectory.
1436
+ */
1437
+ stubbed?: true;
1438
+ parentCallId?: string;
1439
+ };
1440
+ } | {
1441
+ /**
1442
+ * A dry-run call was refused because nothing classifies the tool's
1443
+ * effect: the MCP server sent no readOnlyHint/destructiveHint and no
1444
+ * server-side classification exists for it. The per-run count of these
1445
+ * is the coverage signal — how much of a backtest was actually
1446
+ * runnable, reported rather than assumed.
1447
+ */
1448
+ type: "action.effect_unclassified";
1449
+ data: {
1450
+ callId: string;
1451
+ toolName: string;
1452
+ connection?: string;
1453
+ };
1454
+ } | {
1455
+ type: "subagent.called";
1456
+ data: {
1457
+ callId: string;
1458
+ name?: string;
1459
+ description?: string;
1460
+ };
1461
+ } | {
1462
+ type: "subagent.completed";
1463
+ data: {
1464
+ callId: string;
1465
+ name?: string;
1466
+ };
1467
+ } | {
1468
+ /** An artifact was tagged for this session (see {@link ArtifactsApi.tag}). */
1469
+ type: "artifact.tagged";
1470
+ data: {
1471
+ id: string;
1472
+ kind: string;
1473
+ key?: string;
1474
+ title?: string;
1475
+ data: JsonValue;
1476
+ source: ArtifactSource;
1477
+ };
1478
+ } | {
1479
+ type: "turn.completed";
1480
+ data: {
1481
+ result?: string;
1482
+ usage?: TurnUsage;
1483
+ cost?: TurnCost;
1484
+ };
1485
+ } | {
1486
+ /**
1487
+ * The harness accepted the turn and named the run. Emitted once the
1488
+ * send lands, so a channel can show the request id while the turn is
1489
+ * still going rather than after it. Quote it verbatim when correlating
1490
+ * with backend logs — never abbreviated.
1491
+ */
1492
+ type: "turn.bound";
1493
+ data: {
1494
+ requestId: string;
1495
+ };
1496
+ } | {
1497
+ type: "turn.failed";
1498
+ data: {
1499
+ message: string;
1500
+ /** Machine-readable terminal status. Omitted on legacy stored events. */
1501
+ status?: "error" | "cancelled";
1502
+ };
1503
+ } | {
1504
+ /**
1505
+ * A Slack follow-up queued mid-turn reached the running agent: the
1506
+ * workspace carrier moved it from `pending/` to `delivered/` at a tool
1507
+ * boundary. Channels use this to reposition a live progress message
1508
+ * below the follow-up, which Slack cannot do any other way.
1509
+ */
1510
+ type: "nudge.delivered";
1511
+ data: Record<string, never>;
1512
+ } | {
1513
+ type: "session.waiting";
1514
+ data: Record<string, never>;
1515
+ } | {
1516
+ type: "session.completed";
1517
+ data: Record<string, never>;
1518
+ } | {
1519
+ type: "session.failed";
1520
+ data: {
1521
+ message: string;
1522
+ };
1523
+ };
1524
+ export type SessionEvent = SessionEventEnvelope & SessionEventPayload;
1525
+ export type SessionEventType = SessionEventPayload["type"];
1526
+ export interface TurnUsage {
1527
+ inputTokens: number;
1528
+ outputTokens: number;
1529
+ cacheReadTokens: number;
1530
+ cacheWriteTokens: number;
1531
+ reasoningTokens?: number;
1532
+ }
1533
+ /**
1534
+ * Dollar cost of one turn's token usage (one agent loop pass).
1535
+ * Recorded on `turn.completed` events so traces, the playground, and the
1536
+ * CLI can aggregate spend. Computed by
1537
+ * `POST /v1/models/estimate-cost` — billed usage events when available
1538
+ * (credits, discounts, CTF), otherwise live catalog pricing.
1539
+ */
1540
+ export interface TurnCost {
1541
+ /** Charged total for the turn, in USD. */
1542
+ totalUsd: number;
1543
+ inputUsd: number;
1544
+ outputUsd: number;
1545
+ cacheReadUsd: number;
1546
+ cacheWriteUsd: number;
1547
+ /** Model id the cost was priced against. */
1548
+ model: string;
1549
+ /** `"usage"` is billed events; `"catalog"` is live list pricing. */
1550
+ source: "usage" | "catalog";
1551
+ rawCostCents?: number;
1552
+ chargedCents?: number;
1553
+ }
1554
+ export type SessionMode = "chat" | "task";
1555
+ /**
1556
+ * Why the session exists. `"eval"` is regression traffic (`defineEval` /
1557
+ * `agent-sdk eval` / playground Evals). Default `"live"`.
1558
+ */
1559
+ export type SessionPurpose = "live" | "eval";
1560
+ /** Read-only view of a session, handed to tools, hooks, and channel events. */
1561
+ export interface SessionInfo {
1562
+ id: string;
1563
+ channelId: string;
1564
+ mode: SessionMode;
1565
+ /** Omit / `"live"` for production traffic; `"eval"` for eval harness sessions. */
1566
+ purpose?: SessionPurpose;
1567
+ /** True when write-classified tool calls are answered by the host. */
1568
+ dryRun?: boolean;
1569
+ /** Frozen instant this session reads at; absent means the wall clock. */
1570
+ asOf?: string;
1571
+ auth: AuthContext | null;
1572
+ title?: string;
1573
+ /**
1574
+ * Channel-local continuation key when the session is addressable for
1575
+ * follow-ups / reminders. Null when the session is not re-keyable.
1576
+ */
1577
+ continuationKey?: string | null;
1578
+ /**
1579
+ * Cursor SDK agent id once bound (hosted ids start with `bc-`; local
1580
+ * turns use the session id). Hosted ids are minted during the first
1581
+ * send, so read this from a fresh `getSession()` handle after a turn
1582
+ * completes — unless the session was created with a seeded
1583
+ * {@link SendMessageOptions.sdkAgentId}.
1584
+ */
1585
+ sdkAgentId?: string;
1586
+ }
1587
+ /** Persisted session record (stored at `sessions/<id>/session.json`). */
1588
+ export interface SessionRecord {
1589
+ sessionId: string;
1590
+ channelId: string;
1591
+ mode: SessionMode;
1592
+ /**
1593
+ * `"eval"` for harness sessions. Older records omit this (treated as
1594
+ * `"live"`).
1595
+ */
1596
+ purpose?: SessionPurpose;
1597
+ /** Frozen at create from {@link SendMessageOptions.dryRun}. */
1598
+ dryRun?: boolean;
1599
+ /** Frozen at create from {@link SendMessageOptions.asOf}. */
1600
+ asOf?: string;
1601
+ /** Channel-local continuation key; null when the session is not addressable. */
1602
+ continuationKey: string | null;
1603
+ /**
1604
+ * Rotating HTTP follow-up credential for a channel-owned session.
1605
+ * Omitted until HTTP accepts the first follow-up.
1606
+ */
1607
+ httpContinuationKey?: string;
1608
+ auth: AuthContext | null;
1609
+ title?: string;
1610
+ channelState?: JsonValue;
1611
+ /** Cursor SDK agent id for this session. */
1612
+ sdkAgentId?: string;
1613
+ /**
1614
+ * When set, local harness turns use this directory as `cwd` (e.g. a PR
1615
+ * worktree). Session scaffold files still land under the session workspace.
1616
+ */
1617
+ workspaceOverride?: string;
1618
+ /**
1619
+ * One-shot files for the next turn (see
1620
+ * {@link SendMessageOptions.workspaceFiles}). Cleared after apply.
1621
+ */
1622
+ pendingWorkspaceFiles?: Record<string, string | {
1623
+ encoding: "base64";
1624
+ data: string;
1625
+ mimeType?: string;
1626
+ }>;
1627
+ /**
1628
+ * One-shot vision images for the next turn (see
1629
+ * {@link SendMessageOptions.images}). Cleared after apply.
1630
+ */
1631
+ pendingImages?: Array<{
1632
+ data: string;
1633
+ mimeType: string;
1634
+ }>;
1635
+ /**
1636
+ * Per-session cloud attach options captured at session creation, merged
1637
+ * over the agent's static `cloud` config on every turn of this session.
1638
+ */
1639
+ cloudOverride?: AgentCloudOptions;
1640
+ /**
1641
+ * Server-tool calls parked for human approval. Cleared when resolved
1642
+ * or when the host process restarts without a live waiter (the in-flight
1643
+ * SDK tool callback cannot be resumed after process restart).
1644
+ */
1645
+ pendingApprovals?: PendingApproval[];
1646
+ /**
1647
+ * Server-tool MCP calls parked for host or Cursor-account OAuth.
1648
+ * Cleared when resolved or when the host restarts without a live waiter.
1649
+ */
1650
+ pendingAuths?: PendingAuth[];
1651
+ turnCount: number;
1652
+ createdAt: string;
1653
+ updatedAt: string;
1654
+ }
1655
+ export interface TurnOutcome {
1656
+ status: "finished" | "error" | "cancelled";
1657
+ result?: string;
1658
+ errorMessage?: string;
1659
+ /** Stable machine-readable runner code when the failure supplied one. */
1660
+ errorCode?: string;
1661
+ /** Why a cancelled turn stopped, when the engine observed the boundary. */
1662
+ cancellationReason?: "signal" | "runner";
1663
+ usage?: TurnUsage;
1664
+ /** Cost of {@link usage} from the Cloud Agents cost endpoint. */
1665
+ cost?: TurnCost;
1666
+ }
1667
+ /**
1668
+ * Session metadata returned by `GET /v1/sessions` (and consumed by the
1669
+ * bundled playground). Includes the current wire-format continuation token:
1670
+ * the listing is a testing/observability surface for callers already
1671
+ * admitted by the route auth chain.
1672
+ */
1673
+ export interface SessionSummary {
1674
+ sessionId: string;
1675
+ channelId: string;
1676
+ mode: SessionMode;
1677
+ title?: string;
1678
+ turnCount: number;
1679
+ /** True while a turn is executing right now (including queued turns). */
1680
+ running: boolean;
1681
+ /**
1682
+ * True while the session's admitted turn is waiting for a
1683
+ * {@link AgentConcurrencyOptions.maxRunningTurns} slot (subset of
1684
+ * {@link running}). Omitted when the agent has no turn limit.
1685
+ */
1686
+ queued?: boolean;
1687
+ createdAt: string;
1688
+ updatedAt: string;
1689
+ /** True when write-classified tool calls are answered by the host. */
1690
+ dryRun?: boolean;
1691
+ /** Active wire token for HTTP follow-ups, or null when not addressable. */
1692
+ continuationToken: string | null;
1693
+ /**
1694
+ * Conversation permalink (Slack thread, else GitHub PR).
1695
+ */
1696
+ externalUrl?: string;
1697
+ /** GitHub PR when the session is about one. */
1698
+ prUrl?: string;
1699
+ }
1700
+ /**
1701
+ * Where `GET /v1/sessions` loaded rows from.
1702
+ * - `cursor-hosted` — durable Bugbot `agent_serve_kv` via `cursorHostedStorage`
1703
+ * - `local` — the serve process `--state-root` session store
1704
+ */
1705
+ export type SessionListSource = "cursor-hosted" | "local";
1706
+ /**
1707
+ * A session handle scoped to the channel that owns it. This is what channel
1708
+ * route handlers get back from `send()` / `getSession()`.
1709
+ */
1710
+ export interface ChannelSession {
1711
+ readonly id: string;
1712
+ /** Channel-local continuation key currently addressing this session. */
1713
+ readonly continuationToken: string | null;
1714
+ /** True when this `send()` created the session. */
1715
+ readonly isNew: boolean;
1716
+ /**
1717
+ * True when `admission: "coalesce"` enqueued this message behind an
1718
+ * in-flight turn instead of starting immediately (Slack busy path).
1719
+ */
1720
+ readonly coalesced?: boolean;
1721
+ readonly info: SessionInfo;
1722
+ /**
1723
+ * Replay recorded events from `startIndex`, then follow live (NDJSON).
1724
+ * A handle from `send()` defaults `startIndex` to this admission so a
1725
+ * resumed continuation does not replay earlier turns.
1726
+ */
1727
+ getEventStream(options?: {
1728
+ startIndex?: number;
1729
+ }): Promise<ReadableStream<Uint8Array>>;
1730
+ /**
1731
+ * Resolves after the currently running turn reaches a terminal event and
1732
+ * handlers already queued for that session have settled.
1733
+ */
1734
+ waitForCompletion(): Promise<TurnOutcome>;
1735
+ /** Re-key the session's channel-local continuation token. */
1736
+ setContinuationToken(token: string | null): Promise<void>;
1737
+ }
1738
+ export interface SendMessageOptions {
1739
+ /**
1740
+ * Who is sending; flows to `session.auth` on newly created sessions.
1741
+ * On HTTP channel routes, defaults to the request principal from
1742
+ * {@link ChannelHandlerArgs.auth}. Pass explicitly to override (e.g.
1743
+ * `null` or a Slack-derived principal).
1744
+ */
1745
+ auth?: AuthContext | null;
1746
+ /**
1747
+ * Channel-local continuation token. When it addresses an existing session
1748
+ * the message is a follow-up; otherwise a new session is created keyed by
1749
+ * this token. Omit to always create a fresh session.
1750
+ *
1751
+ * `/v2` selectors refuse this field — pass {@link mailboxContinuation} or
1752
+ * a structured {@link claim} instead.
1753
+ */
1754
+ continuationToken?: string;
1755
+ /**
1756
+ * v2 mailbox stamp from the control plane (hosted verified ingress or
1757
+ * the local CP). Channel adapters do not extract. Ignored on v1.
1758
+ */
1759
+ mailboxContinuation?: MailboxContinuation;
1760
+ /**
1761
+ * v2 host join. Never a concatenated `pr:owner/repo#N` string — the
1762
+ * registry mints `cont:` bytes from this claim.
1763
+ */
1764
+ claim?: ContinuationClaim;
1765
+ /** Initial channel state for newly created sessions. */
1766
+ state?: JsonValue;
1767
+ /**
1768
+ * On resume (continuation hit), shallow-merge into the existing session
1769
+ * channel state before the turn starts. Null / undefined values in the
1770
+ * patch do not overwrite existing keys, so sticky fields (stream ts,
1771
+ * progress banner comment id, …) survive while wake-derived fields
1772
+ * (`headSha`, refs) refresh. Ignored on create; pass {@link state} there.
1773
+ */
1774
+ refreshState?: JsonValue;
1775
+ /** Session display title (applied when creating a new session). */
1776
+ title?: string;
1777
+ /**
1778
+ * Session purpose at create time. `"eval"` marks regression traffic so
1779
+ * hooks and telemetry can tell it from live sessions.
1780
+ */
1781
+ purpose?: SessionPurpose;
1782
+ /**
1783
+ * Answer every write-classified tool call from the host instead of running
1784
+ * it, for this session's whole life (create only — a follow-up cannot clear
1785
+ * it, so a session that starts as a rehearsal stays one).
1786
+ *
1787
+ * Reads execute, writes are answered and recorded, and the arguments the
1788
+ * model chose stay on the session log as the record of the intended action.
1789
+ */
1790
+ dryRun?: boolean;
1791
+ /**
1792
+ * ISO-8601 instant with a timezone, frozen at create: the prompt states
1793
+ * it, {@link ToolContext.now} returns it, and every tool call is checked
1794
+ * against it — a relative time argument (`now-1h`), an absolute one after
1795
+ * the instant, or an omitted window a vendor schema declares is refused so
1796
+ * the model retries with explicit absolute bounds. Tools may also declare
1797
+ * {@link ToolConfig.timeArgs} for precise per-field checking. The check
1798
+ * reads arguments, not behavior: a tool that reads present state without a
1799
+ * time argument still answers from the present.
1800
+ */
1801
+ asOf?: string;
1802
+ /**
1803
+ * Absolute directory used as the local harness `cwd` for this session.
1804
+ * On create, sets the session workspace. On resume (continuation hit),
1805
+ * refreshes `workspaceOverride` when the path differs — e.g. a newer PR
1806
+ * worktree after synchronize.
1807
+ */
1808
+ workspaceDir?: string;
1809
+ /**
1810
+ * Relative path to contents for the next turn. On create, queued for the
1811
+ * first turn; on resume, merged into pending files. Prefer this over
1812
+ * {@link workspaceDir} when you only need to inject a few host-prepared
1813
+ * files. Values may be utf8 strings or
1814
+ * `{ encoding: "base64", data }` blobs (Slack attachments, binary docs).
1815
+ */
1816
+ workspaceFiles?: Record<string, string | {
1817
+ encoding: "base64";
1818
+ data: string;
1819
+ mimeType?: string;
1820
+ }>;
1821
+ /**
1822
+ * Base64 images for this turn's Cursor SDK `send({ images })` (vision).
1823
+ * Cleared after the turn starts. Slack inbound fills this from uploads.
1824
+ */
1825
+ images?: Array<{
1826
+ data: string;
1827
+ mimeType: string;
1828
+ }>;
1829
+ /**
1830
+ * Per-session cloud attach options, merged over the agent's static
1831
+ * `cloud` config (new sessions only). When set, this session attaches
1832
+ * even if {@link AgentConfig.runtime} is `"local"`. Cannot be combined
1833
+ * with {@link clearCloudOverride}.
1834
+ */
1835
+ cloud?: AgentCloudOptions;
1836
+ /**
1837
+ * Clear cloud attach options retained by an existing continuation
1838
+ * session before starting this turn. Cannot be combined with
1839
+ * {@link cloud}. No-op on a new session.
1840
+ */
1841
+ clearCloudOverride?: boolean;
1842
+ /**
1843
+ * Seed the Cursor SDK agent id for a new session (ignored when the
1844
+ * continuation token matches an existing session). A `bc-…` value
1845
+ * reattaches the first turn to that hosted conversation.
1846
+ */
1847
+ sdkAgentId?: string;
1848
+ /**
1849
+ * Turn admission when a session is already busy.
1850
+ * - `"preempt"` (default) — interrupt the in-flight turn (HTTP / MCP).
1851
+ * - `"coalesce"` — enqueue and return without interrupting (Slack).
1852
+ */
1853
+ admission?: "preempt" | "coalesce";
1854
+ /**
1855
+ * Optional source message timestamp for coalesce queue items. When a
1856
+ * mid-turn nudge already delivered this `sourceTs`, boundary resume skips it.
1857
+ */
1858
+ coalesceSourceTs?: string;
1859
+ }
1860
+ export type SendMessageFn = (message: string, options?: SendMessageOptions) => Promise<ChannelSession>;
1861
+ /**
1862
+ * Channel id recorded on the synthetic session info handed to tools invoked
1863
+ * directly (outside any existing session).
1864
+ */
1865
+ export declare const DIRECT_TOOL_CALL_CHANNEL_ID = "direct";
1866
+ /** Options for {@link CallToolFn} — calling an authored tool directly. */
1867
+ export interface CallToolOptions {
1868
+ /** Who is calling; becomes the tool context's session auth. */
1869
+ auth?: AuthContext | null;
1870
+ /**
1871
+ * Address the session by its wire continuation token
1872
+ * (`<channelId>:<key>`, as `/v1/sessions` lists it). A token that maps
1873
+ * to a live (or restorable) session behaves exactly like passing that
1874
+ * session's {@link sessionId} — ownership check, turn serialization, and
1875
+ * event recording included. A token with no session behind it runs the
1876
+ * call scratch-bound with the token's channel id and continuation key as
1877
+ * the call's session identity, so deployments whose tools resolve state
1878
+ * from the continuation key (e.g. VFS mounts rebuilt by a binding
1879
+ * resolver) can serve it with no live session. Mutually exclusive with
1880
+ * {@link sessionId}.
1881
+ */
1882
+ continuationToken?: string;
1883
+ /**
1884
+ * Run the tool inside an existing session: the tool sees that session's
1885
+ * info and materialized workspace, and the call is recorded on the
1886
+ * session's event stream (`actions.requested` / `action.result` under a
1887
+ * per-call `turnId`). Rejected while a model turn is running on the
1888
+ * session. Omit to run against an ephemeral scratch workspace under
1889
+ * `<stateRoot>/tool-calls/<callId>` (materialized with seed files and
1890
+ * removed after the call) with a synthetic
1891
+ * {@link DIRECT_TOOL_CALL_CHANNEL_ID} session info.
1892
+ */
1893
+ sessionId?: string;
1894
+ }
1895
+ /** Result of a direct (deterministic) tool call. */
1896
+ export interface ToolCallOutcome {
1897
+ toolName: string;
1898
+ /** Correlates with the recorded events for session-bound calls. */
1899
+ callId: string;
1900
+ /** True when the tool threw or returned an error envelope. */
1901
+ isError: boolean;
1902
+ /** Normalized result, exactly as the model would receive it. */
1903
+ result: unknown;
1904
+ /**
1905
+ * Human-readable failure text when {@link isError} is true (joined text
1906
+ * parts from the error envelope, or a string result). Prefer this over
1907
+ * re-parsing {@link result} in channel handlers.
1908
+ */
1909
+ errorMessage?: string;
1910
+ durationMs: number;
1911
+ /** Present when the call ran inside an existing session. */
1912
+ sessionId?: string;
1913
+ /**
1914
+ * Present (true) when a session-bound call could not materialize a
1915
+ * session-owned harness cwd and ran in a scratch workspace instead.
1916
+ * The session identity still applied (read-effect calls only get here),
1917
+ * but `ctx.workspaceDir` was not the session workspace — callers
1918
+ * rendering results as session state should surface this.
1919
+ *
1920
+ * A shared `local.workspaceDir` the host cannot create (a phantom path
1921
+ * like `/repo`) is kept as-is and does not set this flag.
1922
+ */
1923
+ scratchWorkspace?: true;
1924
+ }
1925
+ /**
1926
+ * Call an authored server tool (`agent/tools/<name>.ts`) deterministically:
1927
+ * the input is validated against the tool's schema (zod schemas validate;
1928
+ * plain JSON Schema inputs pass through unvalidated, matching the model
1929
+ * path) and `execute` runs in-process, without a model turn deciding to
1930
+ * call it. Rejects unknown tools, `execution: "agent"` tools, and invalid
1931
+ * input by throwing.
1932
+ */
1933
+ export type CallToolFn = (toolName: string, input?: unknown, options?: CallToolOptions) => Promise<ToolCallOutcome>;
1934
+ export type RouteMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
1935
+ export interface ChannelHandlerArgs {
1936
+ /** Route parameters extracted from the path pattern. */
1937
+ params: Record<string, string>;
1938
+ requestIp: string | null;
1939
+ /** Auth context resolved by the channel's auth chain. */
1940
+ auth: AuthContext | null;
1941
+ /**
1942
+ * Validated JSON body when the route declares `bodySchema` (Zod).
1943
+ * Prefer this over `request.json()` so the body is not read twice.
1944
+ */
1945
+ body?: unknown;
1946
+ /**
1947
+ * Validated query object when the route declares `querySchema` (Zod).
1948
+ * Built from `URLSearchParams` (string values) before validation.
1949
+ */
1950
+ query?: unknown;
1951
+ /** Shared host services (MCP / GitHub / Slack). Same as tool `ctx.host`. */
1952
+ host: HostContext;
1953
+ /** Start or resume a session on this channel. */
1954
+ send: SendMessageFn;
1955
+ /** Look up an existing session on this channel. */
1956
+ getSession(sessionId: string): Promise<ChannelSession | null>;
1957
+ /** Hand inbound work to a different channel (cross-channel hand-off). */
1958
+ receive(channel: ChannelDefinition | HttpChannelDefinition | string, input: ReceiveInput): Promise<ChannelSession>;
1959
+ /** Call an authored server tool directly (no model turn). */
1960
+ callTool: CallToolFn;
1961
+ /** Extend server lifetime tracking for background work. */
1962
+ waitUntil(promise: Promise<unknown>): void;
1963
+ /**
1964
+ * Absolute playground + NDJSON trace URLs for a session on this agent
1965
+ * mount (single-agent `""` or multi-agent `"/<slug>"`). Prefer this over
1966
+ * rebuilding paths from the request URL.
1967
+ */
1968
+ sessionUrls(request: Request, sessionId: string): {
1969
+ playgroundUrl: string;
1970
+ traceUrl: string;
1971
+ };
1972
+ /**
1973
+ * Durable artifacts (unbound — channel handlers have no ambient session;
1974
+ * pass `sessionId` in `tag` input to attribute one).
1975
+ */
1976
+ artifacts: ArtifactsApi;
1977
+ /** Hosted Slack admission uses this to paint a warm follow-up. */
1978
+ hasContinuationSession?(continuationToken: string): Promise<boolean>;
1979
+ isContinuationBusy?(continuationToken: string): Promise<boolean>;
1980
+ getContinuationLastBotMessageTs?(continuationToken: string): Promise<string | undefined>;
1981
+ interruptContinuation?(continuationToken: string): Promise<boolean>;
1982
+ }
1983
+ export type ChannelRouteHandler = (request: Request, args: ChannelHandlerArgs) => Response | Promise<Response>;
1984
+ /**
1985
+ * Channel HTTP routes must declare a Zod schema (plain JSON Schema objects
1986
+ * are not accepted — TypeScript will reject them).
1987
+ */
1988
+ export type ChannelRouteSchema = z.ZodTypeAny;
1989
+ /** Handler args with a required, schema-inferred `query`. */
1990
+ export type ChannelHandlerArgsWithQuery<TQuery> = ChannelHandlerArgs & {
1991
+ query: TQuery;
1992
+ };
1993
+ /** Handler args with a required, schema-inferred `body`. */
1994
+ export type ChannelHandlerArgsWithBody<TBody> = ChannelHandlerArgs & {
1995
+ body: TBody;
1996
+ };
1997
+ /** Handler args with inferred `body` and optional inferred `query`. */
1998
+ export type ChannelHandlerArgsWithBodyAndQuery<TBody, TQuery> = ChannelHandlerArgs & {
1999
+ body: TBody;
2000
+ query: TQuery;
2001
+ };
2002
+ /**
2003
+ * GET routes must declare a Zod `querySchema` (use `z.object({})` when there
2004
+ * are no query params — path params still live on `args.params`).
2005
+ */
2006
+ export interface ChannelGetRouteSpec<TQuery extends z.ZodTypeAny = z.ZodTypeAny> {
2007
+ description?: string;
2008
+ querySchema: TQuery;
2009
+ handler: (request: Request, args: ChannelHandlerArgsWithQuery<z.infer<TQuery>>) => Response | Promise<Response>;
2010
+ }
2011
+ /**
2012
+ * POST / PUT / PATCH routes must declare a Zod `bodySchema`. Optional
2013
+ * `querySchema` when the route also reads search params.
2014
+ */
2015
+ export interface ChannelBodyRouteSpec<TBody extends z.ZodTypeAny = z.ZodTypeAny, TQuery extends z.ZodTypeAny | undefined = undefined> {
2016
+ description?: string;
2017
+ bodySchema: TBody;
2018
+ querySchema?: TQuery;
2019
+ handler: (request: Request, args: TQuery extends z.ZodTypeAny ? ChannelHandlerArgsWithBodyAndQuery<z.infer<TBody>, z.infer<TQuery>> : ChannelHandlerArgsWithBody<z.infer<TBody>>) => Response | Promise<Response>;
2020
+ }
2021
+ /**
2022
+ * DELETE routes may declare Zod schemas when useful; neither is required.
2023
+ */
2024
+ export interface ChannelDeleteRouteSpec<TBody extends z.ZodTypeAny | undefined = undefined, TQuery extends z.ZodTypeAny | undefined = undefined> {
2025
+ description?: string;
2026
+ bodySchema?: TBody;
2027
+ querySchema?: TQuery;
2028
+ handler: ChannelRouteHandler;
2029
+ }
2030
+ export interface ChannelRoute {
2031
+ method: RouteMethod;
2032
+ path: string;
2033
+ handler: ChannelRouteHandler;
2034
+ description?: string;
2035
+ bodySchema?: ChannelRouteSchema;
2036
+ querySchema?: ChannelRouteSchema;
2037
+ }
2038
+ /** Input to a channel's `receive` hook (and to `args.receive(...)`). */
2039
+ export interface ReceiveInput {
2040
+ message: string;
2041
+ auth: AuthContext | null;
2042
+ /** Channel-specific delivery target (e.g. a chat channel id). */
2043
+ target?: JsonObject;
2044
+ }
2045
+ /**
2046
+ * Per-event channel context. `state` is mutable. Turn events receive the
2047
+ * state snapshot captured for that turn; handler mutations are recursively
2048
+ * merged into the latest persisted state so fields refreshed by overlapping
2049
+ * deliveries survive. At paths changed by the handler, objects merge
2050
+ * recursively, arrays and scalars replace the latest value, and deletion
2051
+ * removes the latest value. Events outside a turn receive current live state.
2052
+ */
2053
+ export interface ChannelEventContext<TState = JsonValue> {
2054
+ channelId: string;
2055
+ state: TState;
2056
+ continuationToken: string | null;
2057
+ setContinuationToken(token: string | null): Promise<void>;
2058
+ }
2059
+ /** Per-event session context shared by channel `events` handlers and hooks. */
2060
+ export interface SessionContext {
2061
+ session: SessionInfo;
2062
+ /**
2063
+ * Shared host services (MCP / GitHub / Slack / kv / files). Same as
2064
+ * tool `ctx.host`. `files` and `otel` are bound to this session, so a
2065
+ * relative path cannot read another session's files.
2066
+ */
2067
+ host: HostContext;
2068
+ /**
2069
+ * Durable artifacts bound to this event's session and turn. `tag`
2070
+ * auto-fills both ids and rejects a conflicting explicit `sessionId`.
2071
+ */
2072
+ artifacts: ArtifactsApi;
2073
+ }
2074
+ export type ChannelEventHandler<TState = JsonValue, TEvent extends SessionEvent = SessionEvent> = (event: TEvent, channel: ChannelEventContext<TState>, ctx: SessionContext) => void | Promise<void>;
2075
+ /** Handlers are keyed by event type and receive the narrowed event. */
2076
+ export type ChannelEventHandlers<TState = JsonValue> = {
2077
+ [K in SessionEventType]?: ChannelEventHandler<TState, Extract<SessionEvent, {
2078
+ type: K;
2079
+ }>>;
2080
+ } & {
2081
+ "*"?: ChannelEventHandler<TState, SessionEvent>;
2082
+ };
2083
+ /** Bound helpers passed to {@link ChannelConfig.onStart}. */
2084
+ export interface ChannelStartArgs {
2085
+ send: SendMessageFn;
2086
+ /**
2087
+ * Hosted architecture from {@link AgentConfig.architecture}. Discovery
2088
+ * fills `"v2"` when the author omits it. Host pipelines that call
2089
+ * `send()` themselves (instead of letting the channel adapter stamp
2090
+ * continuation) branch on this so v1 `continuationToken` and v2 `claim`
2091
+ * stay mutually exclusive.
2092
+ */
2093
+ architecture?: AgentArchitecture;
2094
+ getSession(sessionId: string): Promise<ChannelSession | null>;
2095
+ receive(channel: ChannelDefinition | HttpChannelDefinition | string, input: ReceiveInput): Promise<ChannelSession>;
2096
+ /** Call an authored server tool directly (no model turn). */
2097
+ callTool: CallToolFn;
2098
+ /**
2099
+ * Append an assistant message to a session without a model turn and without
2100
+ * a user `message.received` bubble. Prefer this over `send()` when a host
2101
+ * task already produced the final text (e.g. after staged `callTool`s).
2102
+ */
2103
+ emitAssistantMessage(sessionId: string, text: string): Promise<void>;
2104
+ /** Shared host services (MCP / GitHub / Slack). Same as {@link ChannelHandlerArgs.host}. */
2105
+ host: HostContext;
2106
+ waitUntil(promise: Promise<unknown>): void;
2107
+ /**
2108
+ * Whether a live session already exists for a continuation token on this
2109
+ * channel (includes lazy restore from storage).
2110
+ */
2111
+ hasContinuationSession(continuationToken: string): Promise<boolean>;
2112
+ /**
2113
+ * Whether a model turn is in flight (or being admitted) for the session
2114
+ * addressed by this continuation token.
2115
+ */
2116
+ isContinuationBusy(continuationToken: string): Promise<boolean>;
2117
+ /**
2118
+ * Slack warm-delta watermark: last agent reply ts recorded on the session's
2119
+ * channel state (`lastBotMessageTs`), when present.
2120
+ */
2121
+ getContinuationLastBotMessageTs(continuationToken: string): Promise<string | undefined>;
2122
+ /**
2123
+ * Interrupt the in-flight turn for a continuation token and clear any
2124
+ * coalesced follow-ups queued behind it. Returns whether work was active.
2125
+ */
2126
+ interruptContinuation(continuationToken: string): Promise<boolean>;
2127
+ /**
2128
+ * Approve or deny a parked {@link ToolConfig.needsApproval} tool call
2129
+ * for a session on this channel. Channel packs (e.g. Slack Block Kit
2130
+ * buttons) use this to unblock the turn without going through the HTTP
2131
+ * approvals route.
2132
+ */
2133
+ resolveApproval(sessionId: string, callId: string, decision: ApprovalDecision, auth: AuthContext | null, options?: {
2134
+ asSessionOwner?: boolean;
2135
+ }): Promise<PendingApproval>;
2136
+ /**
2137
+ * Mark a parked MCP auth as connected or cancelled. Channel packs
2138
+ * (Slack "Connected") use this; the public OAuth callback also
2139
+ * resolves after `finishAuth`.
2140
+ */
2141
+ resolveAuth(sessionId: string, callId: string, decision: ApprovalDecision, auth: AuthContext | null, options?: {
2142
+ asSessionOwner?: boolean;
2143
+ }): Promise<PendingAuth>;
2144
+ /**
2145
+ * Server log sink (same as {@link ServeOptions.logger}). Channel packs
2146
+ * should prefer this over `console.*` so CLI/eval hosts can redirect.
2147
+ */
2148
+ logger: (line: string) => void;
2149
+ /**
2150
+ * Durable artifacts (unbound, same facade as
2151
+ * {@link ChannelHandlerArgs.artifacts}) — for host pipelines the channel
2152
+ * drives outside any route handler.
2153
+ */
2154
+ artifacts: ArtifactsApi;
2155
+ }
2156
+ /**
2157
+ * Metadata a channel pack attaches for discovery, `projectInfo`, and CLI
2158
+ * helpers (e.g. `agent-sdk github forward`). Most fields are descriptive;
2159
+ * explicitly documented protocol fields may also be consumed by the host.
2160
+ */
2161
+ export interface ChannelMeta {
2162
+ /** Well-known pack kind, e.g. `"github"` or `"slack"`. */
2163
+ kind?: string;
2164
+ /**
2165
+ * For GitHub webhook packs: the webhook event names this channel is wired
2166
+ * to dispatch on. Used to derive `gh webhook forward --events`.
2167
+ */
2168
+ githubWebhookEvents?: readonly string[];
2169
+ /**
2170
+ * For Origin webhook packs: the Origin event types this channel is wired
2171
+ * to dispatch on. Used by `--cursor-events` to subscribe `provider: "origin"`.
2172
+ */
2173
+ originWebhookEvents?: readonly string[];
2174
+ /**
2175
+ * For GitLab webhook packs: the `object_kind`s this channel is wired to
2176
+ * dispatch on (`merge_request`, `note`, `push`, `pipeline`, `tag_push`).
2177
+ */
2178
+ gitlabWebhookEvents?: readonly string[];
2179
+ /**
2180
+ * For Bitbucket webhook packs: the event keys this channel is wired to
2181
+ * dispatch on, in the Cloud vocabulary (`pullrequest:created`, …).
2182
+ */
2183
+ bitbucketWebhookEvents?: readonly string[];
2184
+ /**
2185
+ * For deployments packs: the factory event types this channel is wired
2186
+ * to dispatch on. Extracted into the deploy manifest as `eventTypes`.
2187
+ */
2188
+ deploymentEventTypes?: readonly string[];
2189
+ /**
2190
+ * For Change Monitor checkpoint and Factory issue packs: the factory
2191
+ * event types this channel is wired to dispatch on. Extracted into the
2192
+ * deploy manifest as `eventTypes`. Kept separate from
2193
+ * `deploymentEventTypes`.
2194
+ */
2195
+ factoryEventTypes?: readonly string[];
2196
+ /**
2197
+ * For Slack packs: the Events API event types this channel dispatches on
2198
+ * (`app_mention`, `message`), derived from `engagement`. Extracted into
2199
+ * the deploy manifest as `eventTypes` so hosted v2 fanout subscribes to
2200
+ * exactly these. Local Socket Mode ignores it (the socket delivers
2201
+ * whatever the app manifest subscribed to).
2202
+ */
2203
+ slackEventTypes?: readonly string[];
2204
+ /**
2205
+ * Static agentic-reply protocol for hosted Slack ingress. Only literals
2206
+ * belong here: the control plane persists this declaration at deploy time
2207
+ * and may act before author code starts.
2208
+ */
2209
+ slackReply?: {
2210
+ mode: "agentic";
2211
+ ack: string;
2212
+ placeholder?: string;
2213
+ };
2214
+ /**
2215
+ * For Slack packs with the opt-in channel watch: the allowlisted channels
2216
+ * (ids or `#names`) this channel dispatches on without a mention. Surfaced
2217
+ * by `info` so watched channels are auditable.
2218
+ */
2219
+ slackChannelPosts?: readonly string[];
2220
+ /**
2221
+ * Author-facing notices about deprecated options the pack still honored.
2222
+ * Discovery surfaces each one as a `validate` warning on the channel file.
2223
+ */
2224
+ deprecations?: readonly string[];
2225
+ }
2226
+ export interface ChannelConfig<TState = JsonValue> {
2227
+ /**
2228
+ * Route auth chain. Defaults to `[localDevStrict()]`. Include
2229
+ * `publicEndpoint()` to serve this channel WITHOUT the platform alias
2230
+ * token on Cursor hosting (for webhook senders that cannot attach custom
2231
+ * headers — the handler must verify deliveries itself).
2232
+ */
2233
+ auth?: AuthPolicy[];
2234
+ routes?: ChannelRoute[];
2235
+ /**
2236
+ * Descriptive metadata for tooling (kind, webhook events). Attached by
2237
+ * channel packs; ignored by the router and session engine.
2238
+ */
2239
+ meta?: ChannelMeta;
2240
+ /** Initial per-session channel state (JSON-serializable). */
2241
+ state?: TState;
2242
+ /**
2243
+ * Owns inbound cross-channel hand-offs. When omitted, `receive` starts a
2244
+ * fresh session with the input message.
2245
+ */
2246
+ receive?: (input: ReceiveInput, args: {
2247
+ send: SendMessageFn;
2248
+ artifacts: ArtifactsApi;
2249
+ }) => Promise<ChannelSession | undefined | void> | ChannelSession | void;
2250
+ /** Stream-event handlers for sessions owned by this channel. */
2251
+ events?: ChannelEventHandlers<TState>;
2252
+ /** Called once when the server mounts this channel. Optional stop via onStop. */
2253
+ onStart?: (args: ChannelStartArgs) => void | Promise<void>;
2254
+ /** Called when the server shuts down. */
2255
+ onStop?: () => void | Promise<void>;
2256
+ }
2257
+ export type ChannelDefinition<TState = JsonValue> = ChannelConfig<TState> & BrandedDefinition<"channel">;
2258
+ /** Configuration for the built-in HTTP session channel. */
2259
+ export interface HttpChannelConfig {
2260
+ /** Route auth chain. Defaults to `[localDevStrict()]`. */
2261
+ auth?: AuthPolicy[];
2262
+ /**
2263
+ * Continuation selector. Omit this to inherit the agent architecture's
2264
+ * default. Set it explicitly only when migrating persisted identities.
2265
+ */
2266
+ continuation?: ContinuationIdentity;
2267
+ /**
2268
+ * Transform the inbound message before the agent sees it (e.g. prepend
2269
+ * request-specific context).
2270
+ */
2271
+ onMessage?: (message: string, info: {
2272
+ auth: AuthContext | null;
2273
+ }) => string | Promise<string>;
2274
+ /**
2275
+ * Bind host state after the control plane names this session's mailbox
2276
+ * key and before `send()`.
2277
+ */
2278
+ onAdmit?: (info: HttpSessionAdmitInfo) => void | Promise<void>;
2279
+ /** Stream-event handlers for sessions created over HTTP. */
2280
+ events?: ChannelEventHandlers;
2281
+ }
2282
+ /** Subject of a hosted HTTP startSession, seen by {@link HttpChannelConfig.onAdmit}. */
2283
+ export type HttpSessionAdmitInfo = {
2284
+ message: string;
2285
+ sessionKey: string;
2286
+ dryRun?: boolean;
2287
+ asOf?: string;
2288
+ host: HostContext;
2289
+ };
2290
+ /** Reject a hosted startSession subject from {@link HttpChannelConfig.onAdmit}. */
2291
+ export declare class HttpSessionAdmitError extends Error {
2292
+ readonly status: 400;
2293
+ constructor(message: string);
2294
+ }
2295
+ export type HttpChannelDefinition = HttpChannelConfig & BrandedDefinition<"http-channel">;
2296
+ export interface HookContext extends SessionContext {
2297
+ agent: {
2298
+ name: string;
2299
+ };
2300
+ channel: {
2301
+ id: string;
2302
+ continuationToken: string | null;
2303
+ };
2304
+ /**
2305
+ * Durable channel state for this session (the turn snapshot when
2306
+ * dispatching inside a turn). Same blob `send({ state })` stamped;
2307
+ * survives process restart. Null when the session has none.
2308
+ */
2309
+ channelState: JsonValue | null;
2310
+ /**
2311
+ * Absolute path of the agent's durable state root (shared across every
2312
+ * session of this agent). Hooks that maintain derived state (e.g. the
2313
+ * memory journal) write here.
2314
+ */
2315
+ stateRoot: string;
2316
+ /**
2317
+ * Durable artifacts, bound to this hook's session: `tag` auto-fills
2318
+ * `sessionId` (and `turnId` when known).
2319
+ */
2320
+ artifacts: ArtifactsApi;
2321
+ }
2322
+ export type HookHandler<TEvent extends SessionEvent = SessionEvent> = (event: TEvent, ctx: HookContext) => void | Promise<void>;
2323
+ /** Handlers are keyed by event type and receive the narrowed event. */
2324
+ export type HookEventHandlers = {
2325
+ [K in SessionEventType]?: HookHandler<Extract<SessionEvent, {
2326
+ type: K;
2327
+ }>>;
2328
+ } & {
2329
+ "*"?: HookHandler;
2330
+ };
2331
+ export interface HookConfig {
2332
+ events: HookEventHandlers;
2333
+ }
2334
+ export type HookDefinition = HookConfig & BrandedDefinition<"hook">;
2335
+ /** One declared artifact kind (see {@link ArtifactsConfig.kinds}). */
2336
+ export interface ArtifactKindConfig {
2337
+ /**
2338
+ * What this kind holds. Also the model-facing prompt for the
2339
+ * `tag_artifact` built-in tool when {@link ArtifactsConfig.agentTool}
2340
+ * is enabled.
2341
+ */
2342
+ description: string;
2343
+ /**
2344
+ * Optional Zod schema; `tag` validates the payload against it and
2345
+ * persists the parsed output (defaults and coercions applied), so
2346
+ * the schema's output must stay JSON-serializable.
2347
+ */
2348
+ schema?: z.ZodType;
2349
+ }
2350
+ /** Input to `defineArtifacts` (authored at `agent/artifacts.ts`). */
2351
+ export interface ArtifactsConfig {
2352
+ /**
2353
+ * Declared artifact kinds. With kinds declared, `tag` only accepts
2354
+ * these; with none, any kind string is accepted freeform.
2355
+ */
2356
+ kinds?: Record<string, ArtifactKindConfig>;
2357
+ /**
2358
+ * Expose the model-facing `tag_artifact` built-in tool generated from
2359
+ * {@link kinds}. Requires at least one declared kind.
2360
+ */
2361
+ agentTool?: boolean;
2362
+ /**
2363
+ * Retention cap (default 1000). On insert past the cap, the
2364
+ * oldest-updated artifact is evicted.
2365
+ */
2366
+ max?: number;
2367
+ }
2368
+ export type ArtifactsDefinition = ArtifactsConfig & BrandedDefinition<"artifacts">;
2369
+ /** Who tagged an artifact: host code, or the model via `tag_artifact`. */
2370
+ export type ArtifactSource = "host" | "model";
2371
+ /** One durable tagged artifact. */
2372
+ export interface ArtifactRecord {
2373
+ /** Stable id: derived from {@link key} when present, else random. */
2374
+ id: string;
2375
+ kind: string;
2376
+ /** Author-chosen upsert key (same key ⇒ same id ⇒ replaces the row). */
2377
+ key?: string;
2378
+ title?: string;
2379
+ data: JsonValue;
2380
+ /** Present when the artifact carries a file/blob payload (served at `GET /v1/artifacts/:id/content`). */
2381
+ content?: {
2382
+ size: number;
2383
+ contentType?: string;
2384
+ };
2385
+ sessionId?: string;
2386
+ turnId?: string;
2387
+ source: ArtifactSource;
2388
+ createdAt: string;
2389
+ updatedAt: string;
2390
+ }
2391
+ /** Input to {@link ArtifactsApi.tag}. */
2392
+ export interface ArtifactTagInput {
2393
+ /** Defaults to `"artifact"` when no kinds are declared. */
2394
+ kind?: string;
2395
+ data: JsonValue;
2396
+ title?: string;
2397
+ /** Upsert key: tagging the same key again replaces the row. */
2398
+ key?: string;
2399
+ /**
2400
+ * File/blob payload, served via `GET /v1/artifacts/:id/content`.
2401
+ * Re-tagging a keyed artifact without `contents` keeps the existing payload.
2402
+ */
2403
+ contents?: string | Uint8Array;
2404
+ /** MIME type reported when serving {@link contents}. */
2405
+ contentType?: string;
2406
+ /**
2407
+ * Session to attribute (and stream an `artifact.tagged` event to). On
2408
+ * session-bound facades ({@link ToolContext.artifacts},
2409
+ * {@link HookContext.artifacts}) this is auto-filled and a different
2410
+ * value is rejected; unbound facades
2411
+ * ({@link ChannelHandlerArgs.artifacts}) accept it explicitly.
2412
+ */
2413
+ sessionId?: string;
2414
+ turnId?: string;
2415
+ /** Defaults to `"host"`. */
2416
+ source?: ArtifactSource;
2417
+ }
2418
+ /** Filter for {@link ArtifactsApi.list} and {@link ArtifactsApi.page}. */
2419
+ export interface ArtifactListFilter {
2420
+ kind?: string;
2421
+ sessionId?: string;
2422
+ }
2423
+ /** Options for {@link ArtifactsApi.page}. */
2424
+ export interface ArtifactPageOptions extends ArtifactListFilter {
2425
+ /** Page size, clamped to 1–1000. Default 200. */
2426
+ limit?: number;
2427
+ /**
2428
+ * Opaque resume position from the previous page's
2429
+ * {@link ArtifactPage.nextCursor}. Pass the same filter on every page of
2430
+ * one walk; the cursor marks a position, not a query.
2431
+ */
2432
+ cursor?: string;
2433
+ }
2434
+ /** One page of {@link ArtifactsApi.page} results, newest-updated first. */
2435
+ export interface ArtifactPage {
2436
+ records: ArtifactRecord[];
2437
+ /**
2438
+ * Present while rows remain to examine; pass back as
2439
+ * {@link ArtifactPageOptions.cursor}. Each call reads a bounded number of
2440
+ * rows, so with a sparse filter a page can carry fewer records than
2441
+ * `limit` — even none — while `nextCursor` says the walk is not done.
2442
+ */
2443
+ nextCursor?: string;
2444
+ }
2445
+ /**
2446
+ * The artifacts API, attached as `ctx.artifacts` on tools
2447
+ * ({@link ToolContext}), hooks ({@link HookContext}), and channel handlers
2448
+ * ({@link ChannelHandlerArgs}). Tool and hook facades are session-bound:
2449
+ * `tag` auto-fills the session; the channel facade is unbound.
2450
+ */
2451
+ export interface ArtifactsApi {
2452
+ /** Tag (upsert) one artifact. See {@link ArtifactTagInput}. */
2453
+ tag(input: ArtifactTagInput): Promise<ArtifactRecord>;
2454
+ /**
2455
+ * Tagged artifacts, newest-updated first — the newest page only (at most
2456
+ * 200 records). Walk the full set with {@link ArtifactsApi.page}.
2457
+ */
2458
+ list(filter?: ArtifactListFilter): Promise<ArtifactRecord[]>;
2459
+ /** Bounded, cursor-paginated artifacts, newest-updated first. */
2460
+ page(options?: ArtifactPageOptions): Promise<ArtifactPage>;
2461
+ }
2462
+ export interface ScheduleHandlerArgs {
2463
+ /** Hand the scheduled work to a channel. */
2464
+ receive: (channel: ChannelDefinition | HttpChannelDefinition | string, input: ReceiveInput) => Promise<ChannelSession>;
2465
+ /** Call an authored server tool directly (no model turn). */
2466
+ callTool: CallToolFn;
2467
+ /** Keep the dispatch alive past handler return. */
2468
+ waitUntil(promise: Promise<unknown>): void;
2469
+ /** Pre-built app principal for work the agent does on its own behalf. */
2470
+ appAuth: AuthContext;
2471
+ /** Shared host services (MCP / GitHub / Slack). Same as tool `ctx.host`. */
2472
+ host: HostContext;
2473
+ /**
2474
+ * Durable artifacts (unbound — schedule handlers have no ambient session;
2475
+ * pass `sessionId` explicitly to attribute).
2476
+ */
2477
+ artifacts: ArtifactsApi;
2478
+ }
2479
+ export interface ScheduleConfig {
2480
+ /** Standard 5-field cron expression, evaluated in UTC. */
2481
+ cron: string;
2482
+ /** Fire-and-forget prompt (task mode). Mutually exclusive with `run`. */
2483
+ markdown?: string;
2484
+ /** Handler form: full control over dispatch. */
2485
+ run?: (args: ScheduleHandlerArgs) => void | Promise<void>;
2486
+ }
2487
+ export type ScheduleDefinition = ScheduleConfig & BrandedDefinition<"schedule">;
2488
+ /**
2489
+ * Authored at `agent/reminders/<name>.ts`. The registry name is the module
2490
+ * stem. Pass the discovered definition to {@link ReminderCreateInput.handler}
2491
+ * with serializable {@link ReminderCreateInput.args}; the engine persists the
2492
+ * stem, not the function.
2493
+ */
2494
+ export interface ReminderHandlerConfig {
2495
+ /**
2496
+ * Invoked on every fire with {@link ReminderFireContext} (including the
2497
+ * create-time {@link ReminderFireContext.args} blob).
2498
+ */
2499
+ run: (ctx: ReminderFireContext) => Promise<ReminderFireResult>;
2500
+ }
2501
+ export type ReminderDefinition = ReminderHandlerConfig & BrandedDefinition<"reminder">;
2502
+ export interface DiscoveredReminder {
2503
+ name: string;
2504
+ definition: ReminderDefinition;
2505
+ }
2506
+ export type ReminderBusyPolicy = "skipIfBusy" | "queueBehindTurn";
2507
+ /** Public reminder status. Internal claim state (`firing`) is not exposed. */
2508
+ export type ReminderStatus = "armed" | "completed" | "cancelled" | "disarmed";
2509
+ export type ReminderScheduleKind = "every" | "cron" | "delay" | "at";
2510
+ export type ReminderFireResult = {
2511
+ action: "skip";
2512
+ reschedule?: ReminderReschedule;
2513
+ } | {
2514
+ action: "delivered";
2515
+ reschedule?: ReminderReschedule;
2516
+ } | {
2517
+ action: "stop";
2518
+ };
2519
+ export interface ReminderReschedule {
2520
+ delay?: string | number;
2521
+ at?: Date | string;
2522
+ }
2523
+ export interface ReminderTarget {
2524
+ channelId: string;
2525
+ continuationToken: string;
2526
+ [key: string]: unknown;
2527
+ }
2528
+ export interface ReminderUntilContext {
2529
+ id: string;
2530
+ purpose: string;
2531
+ fireCount: number;
2532
+ target: ReminderTarget;
2533
+ host: HostContext;
2534
+ mcp: HostMcpRegistry;
2535
+ }
2536
+ /**
2537
+ * Send fields a reminder followup may carry onto the turn it starts, the
2538
+ * subset of {@link SendMessageOptions} a host pipeline needs when the fire
2539
+ * itself prepares the turn (channel state for a later host hook,
2540
+ * a session title, a cloud-attach reset). Continuation addressing stays the
2541
+ * reminder's stored binding and is not overridable here.
2542
+ */
2543
+ export interface ReminderFollowupOptions {
2544
+ /** Initial channel state when the followup creates the session. */
2545
+ state?: JsonValue;
2546
+ /** Shallow-merged into an existing session's channel state (see {@link SendMessageOptions.refreshState}). */
2547
+ refreshState?: JsonValue;
2548
+ /** Session display title (applied when creating a new session). */
2549
+ title?: string;
2550
+ /** See {@link SendMessageOptions.clearCloudOverride}. */
2551
+ clearCloudOverride?: boolean;
2552
+ /**
2553
+ * Open a new session under this principal when the stored continuation
2554
+ * has none anywhere (pod or durable storage) — the session an inbound
2555
+ * delivery on that key would create, so later deliveries under the same
2556
+ * principal keep joining it. A durable session that exists but cannot be
2557
+ * materialized still throws, matching prompt fires: opening over it would
2558
+ * shadow the record. Omitted, a missing session also keeps the existing
2559
+ * behavior: the followup throws.
2560
+ */
2561
+ openAuth?: AuthContext;
2562
+ }
2563
+ export interface ReminderFireContext extends ReminderUntilContext {
2564
+ appAuth: AuthContext;
2565
+ /**
2566
+ * Serializable args from {@link ReminderCreateInput.args} when the fire
2567
+ * uses a named {@link ReminderCreateInput.handler}. Empty object otherwise.
2568
+ */
2569
+ args: JsonObject;
2570
+ /**
2571
+ * Wake the reminder's already-bound session (target is implicit). On a
2572
+ * hosted architecture v2 deployment this resolves after the woken turn
2573
+ * completes, because the pod may stop once the fire's outcome is applied;
2574
+ * locally and on v1 it resolves as soon as the turn is admitted.
2575
+ */
2576
+ followup(args: {
2577
+ message: string;
2578
+ } & ReminderFollowupOptions): Promise<ChannelSession>;
2579
+ cancel(reason?: string): Promise<void>;
2580
+ /**
2581
+ * Durable artifacts (unbound — the reminder is bound to a continuation
2582
+ * token, not a resolved session; pass `sessionId` in `tag` input to
2583
+ * attribute one).
2584
+ */
2585
+ artifacts: ArtifactsApi;
2586
+ }
2587
+ /**
2588
+ * Create a durable wake bound to a channel continuation.
2589
+ *
2590
+ * Exactly one of `prompt` | `handler` | `run`, and exactly one of
2591
+ * `every` | `cron` | `delay` | `at`. Prompt fires always follow up into the
2592
+ * bound session. Named `handler` resolves `agent/reminders/<name>.ts` on
2593
+ * every fire (survives restart). Anonymous `run` stays supported on local
2594
+ * and hosted v1; hosted architecture v2 rejects it at create.
2595
+ *
2596
+ * @example Recurring (host policy)
2597
+ * ```ts
2598
+ * await host.reminders.create({
2599
+ * purpose: "merge_conflict_watch",
2600
+ * channelId: "drive",
2601
+ * continuationToken,
2602
+ * every: "30m",
2603
+ * async run({ followup, host }) {
2604
+ * if (await isPrClosed(host)) return { action: "stop" };
2605
+ * if (!(await isConflicted(host))) return { action: "skip" };
2606
+ * await followup({ message: "Merge conflict detected." });
2607
+ * return { action: "delivered" };
2608
+ * },
2609
+ * });
2610
+ * ```
2611
+ *
2612
+ * @example Named handler (durable across restart / hosted v2)
2613
+ * ```ts
2614
+ * // agent/reminders/verdict_recheck.ts
2615
+ * export default defineReminder({
2616
+ * async run({ args, followup }) {
2617
+ * // ...
2618
+ * return { action: "delivered" };
2619
+ * },
2620
+ * });
2621
+ *
2622
+ * import verdictRecheck from "./reminders/verdict_recheck.js";
2623
+ *
2624
+ * await host.reminders.create({
2625
+ * purpose: "verdict_recheck",
2626
+ * channelId: "origin",
2627
+ * continuationToken,
2628
+ * delay: "15m",
2629
+ * handler: verdictRecheck,
2630
+ * args: { headSha: "abc" },
2631
+ * });
2632
+ * ```
2633
+ *
2634
+ * @example One-shot (agent tool / prompt form)
2635
+ * ```ts
2636
+ * await host.reminders.create({
2637
+ * purpose: "ci_recheck",
2638
+ * channelId: "drive",
2639
+ * continuationToken,
2640
+ * delay: "2h",
2641
+ * prompt: "Re-check CI. Only act if still failing.",
2642
+ * until: "Cancel once CI is green or the PR is merged.",
2643
+ * });
2644
+ * ```
2645
+ */
2646
+ export interface ReminderCreateInput {
2647
+ purpose: string;
2648
+ /** Channel that owns the session (e.g. `drive`). */
2649
+ channelId: string;
2650
+ /** Channel-local continuation key for the bound session. */
2651
+ continuationToken: string;
2652
+ /** Optional opaque metadata (e.g. `{ prUrl }`). */
2653
+ target?: Record<string, unknown>;
2654
+ /** Exactly one of prompt, handler, or run. */
2655
+ prompt?: string;
2656
+ /**
2657
+ * A definition discovered from `agent/reminders/<name>.ts`, or its stem
2658
+ * for compatibility. Mutually exclusive with `prompt` and `run`. The
2659
+ * definition form avoids coupling callers to a filename string; discovery
2660
+ * resolves it to the stable stem persisted by the control plane. Do not
2661
+ * combine with {@link until}; encode stop conditions in {@link args} and
2662
+ * the handler body.
2663
+ */
2664
+ handler?: ReminderDefinition | string;
2665
+ /**
2666
+ * Serializable args for {@link handler} (UTF-8 JSON capped at 32 KiB).
2667
+ * Only valid with `handler`.
2668
+ */
2669
+ args?: JsonObject;
2670
+ run?: (ctx: ReminderFireContext) => Promise<ReminderFireResult>;
2671
+ /** Exactly one schedule shape. */
2672
+ every?: string;
2673
+ cron?: string;
2674
+ delay?: string | number;
2675
+ at?: Date | string | number;
2676
+ /**
2677
+ * Auto-cancel: function (host evaluates, true → cancel) XOR prompt string
2678
+ * (agent-facing stop condition; platform does not interpret it).
2679
+ * Valid with `prompt` (string until) and legacy `run` (function until on
2680
+ * local / hosted v1). Not valid with named `handler`. Function until is
2681
+ * rejected on hosted architecture v2.
2682
+ */
2683
+ until?: string | ((ctx: ReminderUntilContext) => Promise<boolean>);
2684
+ /**
2685
+ * Defaults: recurring → `skipIfBusy`; one-shot → `queueBehindTurn`.
2686
+ */
2687
+ busyPolicy?: ReminderBusyPolicy;
2688
+ }
2689
+ export interface ReminderInfo {
2690
+ id: string;
2691
+ purpose: string;
2692
+ channelId: string;
2693
+ continuationToken: string;
2694
+ target?: Record<string, unknown>;
2695
+ scheduleKind: ReminderScheduleKind;
2696
+ scheduleValue: string;
2697
+ prompt?: string;
2698
+ /** Named handler stem when create used `handler`. */
2699
+ handler?: string;
2700
+ /** Serializable args when create used `handler`. */
2701
+ args?: JsonObject;
2702
+ untilPrompt?: string;
2703
+ busyPolicy: ReminderBusyPolicy;
2704
+ status: ReminderStatus;
2705
+ disarmReason?: string;
2706
+ fireCount: number;
2707
+ nextFireAt: string;
2708
+ createdAt: string;
2709
+ updatedAt: string;
2710
+ hasRunHandler: boolean;
2711
+ hasUntilFn: boolean;
2712
+ }
2713
+ /** Host-facing reminder API attached to {@link HostContext.reminders}. */
2714
+ export interface ReminderHostApi {
2715
+ /** Arm a reminder. See {@link ReminderCreateInput}. */
2716
+ create(input: ReminderCreateInput): Promise<ReminderInfo>;
2717
+ /** List reminders, optionally filtered. */
2718
+ list(filter?: {
2719
+ status?: ReminderStatus;
2720
+ purpose?: string;
2721
+ continuationToken?: string;
2722
+ }): Promise<ReminderInfo[]>;
2723
+ /** Cancel one reminder by id. No-op (returns undefined) if unknown. */
2724
+ cancel(id: string, reason?: string): Promise<ReminderInfo | undefined>;
2725
+ /** Cancel all armed reminders for a continuation token. Returns count. */
2726
+ cancelForContinuation(continuationToken: string, reason: string): Promise<number>;
2727
+ /**
2728
+ * Re-key armed reminders after a channel rotates a session's continuation
2729
+ * token, so earlier reminders keep waking the conversation. The engine
2730
+ * calls this from `setContinuationToken`; channels rarely need to.
2731
+ */
2732
+ rekeyContinuation(channelId: string, oldToken: string, newToken: string): Promise<number>;
2733
+ /**
2734
+ * Fire immediately (dev / hillclimb).
2735
+ * `outcome` is `"noop"` when already firing or not armed.
2736
+ */
2737
+ dispatch(id: string): Promise<{
2738
+ reminderId: string;
2739
+ outcome: "fired" | "noop";
2740
+ reason?: string;
2741
+ }>;
2742
+ }
2743
+ export interface Diagnostic {
2744
+ severity: "error" | "warning";
2745
+ /** Repo-relative or absolute path of the offending file. */
2746
+ path?: string;
2747
+ message: string;
2748
+ }
2749
+ export interface DiscoveredTool {
2750
+ name: string;
2751
+ description: string;
2752
+ /** JSON Schema advertised to the model. */
2753
+ inputSchema: JsonSchemaObject;
2754
+ /** Output JSON Schema, advertised only when the tool declares one. */
2755
+ outputSchema?: JsonSchemaObject;
2756
+ /** Where the tool body runs. Defaults to `"server"`. */
2757
+ execution: ToolExecution;
2758
+ /**
2759
+ * True when the tool may park for human approval (boolean true or a
2760
+ * predicate). Runtime evaluation still runs the predicate per call.
2761
+ */
2762
+ needsApproval: boolean;
2763
+ /**
2764
+ * The tool's declared {@link ToolEffect} when it declares one statically, or
2765
+ * `"dynamic"` when it declares a predicate resolved per call. Absent when it
2766
+ * declares nothing, which a dry run treats as a write.
2767
+ */
2768
+ effect?: ToolEffect | "dynamic";
2769
+ /**
2770
+ * MCP spec tool annotations, present only on advertised MCP passthroughs
2771
+ * whose server declared them (see {@link HostMcpToolInfo.annotations}).
2772
+ * Authored tools declare {@link effect} instead. Untrusted hints,
2773
+ * propagated so the harness listing carries them and so effect
2774
+ * classification can read them; absent is the fail-closed state.
2775
+ */
2776
+ annotations?: McpToolAnnotations;
2777
+ /**
2778
+ * True for a 1:1 MCP passthrough synthesized from an advertised
2779
+ * connection's listing. The policy treats these differently from authored
2780
+ * tools when nothing declares an effect: an undeclared authored tool is
2781
+ * stubbed as a write in a dry run, an unclassifiable advertised tool is
2782
+ * refused — see `decideToolCall`.
2783
+ */
2784
+ advertised?: true;
2785
+ /** Name of the advertising connection an advertised tool came from. */
2786
+ connection?: string;
2787
+ /** Mounted extension this tool came from; absent for `agent/tools/`. */
2788
+ extension?: string;
2789
+ /**
2790
+ * Agent tools: script body materialized under
2791
+ * `.agent-serve/tools/<name>.sh`.
2792
+ */
2793
+ script?: string;
2794
+ definition: ToolDefinition;
2795
+ }
2796
+ /** A packaged-skill sibling file: inline contents or a file to copy. */
2797
+ export type SkillFileSource = {
2798
+ contents: string;
2799
+ } | {
2800
+ sourcePath: string;
2801
+ };
2802
+ export interface DiscoveredSkill {
2803
+ name: string;
2804
+ description: string;
2805
+ /** SKILL.md body (without generated frontmatter). */
2806
+ markdown: string;
2807
+ /** Package-relative sibling files. */
2808
+ files: Record<string, SkillFileSource>;
2809
+ /** Mounted extension this skill came from; absent for `agent/skills/`. */
2810
+ extension?: string;
2811
+ }
2812
+ export interface DiscoveredConnection {
2813
+ name: string;
2814
+ transport: ConnectionTransport;
2815
+ description?: string;
2816
+ /** Per-session auth from {@link ConnectionConfig.auth} (http/sse only). */
2817
+ auth?: ConnectionAuthProvider;
2818
+ /** Advertise-by-name from {@link ConnectionConfig.advertiseTools}. */
2819
+ advertiseTools?: boolean;
2820
+ /** Skip a listing failure instead of failing the turn. */
2821
+ optional?: boolean;
2822
+ /**
2823
+ * Normalized intended effects from {@link ConnectionConfig.effects}.
2824
+ * Absent means every listed tool is advertised.
2825
+ */
2826
+ effects?: readonly ToolEffect[];
2827
+ /**
2828
+ * Normalized tool-name allowlist from {@link ConnectionConfig.tools}.
2829
+ * Absent means every listed tool is kept.
2830
+ */
2831
+ tools?: readonly string[];
2832
+ /**
2833
+ * Normalized tool-name denylist from
2834
+ * {@link ConnectionConfig.disallowedTools}.
2835
+ */
2836
+ disallowedTools?: readonly string[];
2837
+ }
2838
+ export interface DiscoveredChannel {
2839
+ id: string;
2840
+ definition: ChannelDefinition;
2841
+ }
2842
+ export interface DiscoveredSchedule {
2843
+ name: string;
2844
+ cron: string;
2845
+ kind: "markdown" | "run";
2846
+ definition: ScheduleDefinition;
2847
+ }
2848
+ export interface DiscoveredHook {
2849
+ name: string;
2850
+ definition: HookDefinition;
2851
+ }
2852
+ export interface SeedFile {
2853
+ /** Path inside the session workspace. */
2854
+ relativePath: string;
2855
+ /** Absolute path of the authored source file. */
2856
+ sourcePath: string;
2857
+ }
2858
+ /** A fully resolved agent (the root agent or a subagent). */
2859
+ export interface ResolvedAgent {
2860
+ name: string;
2861
+ description?: string;
2862
+ model?: ModelSetting;
2863
+ /**
2864
+ * Remaining models from {@link AgentConfig.fallbacks}, in order. The
2865
+ * runner steps down this list when the primary model is rejected before
2866
+ * the turn produces output (catalog refusal or capacity).
2867
+ */
2868
+ modelFallbacks?: readonly ModelSetting[];
2869
+ /**
2870
+ * Composed system prompt: identity preamble from {@link name}, then
2871
+ * authored `instructions.md` / `.ts` / dir (or inline `agent.ts`).
2872
+ */
2873
+ instructions?: string;
2874
+ /** Execution runtime. Root agents default to `"local"`. */
2875
+ runtime: AgentRuntime;
2876
+ /**
2877
+ * Authored {@link AgentConfig.root}. The factory is persisted, not a
2878
+ * serialized tree. A resumed session calls it again (or reuses the handle).
2879
+ */
2880
+ root?: FileSystem | ((ctx: RootContext) => FileSystem | Promise<FileSystem>);
2881
+ /** Resolved {@link AgentConfig.cloud} for this agent. */
2882
+ cloud?: AgentCloudOptions;
2883
+ /**
2884
+ * Resolved local harness options from {@link AgentConfig.local}
2885
+ * (`cwd` is absolute — relative paths resolved against the project root).
2886
+ */
2887
+ local?: AgentLocalOptions;
2888
+ /**
2889
+ * Built-in harness tool allowlist from {@link AgentConfig.tools}, with
2890
+ * the "mcp" transport grant injected. Named apart from {@link tools}
2891
+ * (the authored `agent/tools/` list).
2892
+ */
2893
+ allowedTools?: ToolName[];
2894
+ /** Managed-hosting declarations from {@link AgentConfig.hosting}. */
2895
+ hosting?: AgentHostingOptions;
2896
+ /** Validated turn admission limits from {@link AgentConfig.concurrency}. */
2897
+ concurrency?: AgentConcurrencyOptions;
2898
+ /**
2899
+ * Validated architecture from {@link AgentConfig.architecture}.
2900
+ * Omitted authors resolve to `"v2"`. `"v2"` deploys onto the v2
2901
+ * control plane and stamps kind `/v2` continuation defaults onto
2902
+ * channels that omitted a selector.
2903
+ */
2904
+ architecture?: AgentArchitecture;
2905
+ persistent?: boolean;
2906
+ tools: DiscoveredTool[];
2907
+ skills: DiscoveredSkill[];
2908
+ /**
2909
+ * Mounted `agent/extensions/`. Their contributions are already merged
2910
+ * into the agent and project lists; this records provenance.
2911
+ */
2912
+ extensions?: DiscoveredExtension[];
2913
+ connections: DiscoveredConnection[];
2914
+ /**
2915
+ * MCP connections from `agent/host-connections/`. Host tools and
2916
+ * `mcp oauth` see them; the model does not.
2917
+ */
2918
+ hostConnections?: DiscoveredConnection[];
2919
+ subagents: ResolvedAgent[];
2920
+ seedFiles: SeedFile[];
2921
+ }
2922
+ /** The compiled project manifest produced by `loadAgentProject`. */
2923
+ export interface AgentProject {
2924
+ /** App root (the directory containing package.json / agent/). */
2925
+ rootDir: string;
2926
+ /** The authored agent directory. */
2927
+ agentDir: string;
2928
+ name: string;
2929
+ agent: ResolvedAgent;
2930
+ /** Built-in HTTP session channel. */
2931
+ httpChannel: HttpChannelDefinition;
2932
+ channels: DiscoveredChannel[];
2933
+ schedules: DiscoveredSchedule[];
2934
+ /** Named reminder handlers from `agent/reminders/*` (optional / additive). */
2935
+ reminders?: DiscoveredReminder[];
2936
+ hooks: DiscoveredHook[];
2937
+ /** Optional `agent/storage.ts` (`defineStorage`). */
2938
+ storage?: StorageDefinition;
2939
+ /** Optional `agent/artifacts.ts` (`defineArtifacts`). */
2940
+ artifacts?: ArtifactsDefinition;
2941
+ /** Optional `agent/otel.ts` (`defineOtel`). */
2942
+ otel?: OtelDefinition;
2943
+ diagnostics: Diagnostic[];
2944
+ }
2945
+ /** JSON-safe projection of one channel HTTP route on `GET /v1/info`. */
2946
+ export interface AgentChannelRouteInfo {
2947
+ method: RouteMethod;
2948
+ /** Authored path (e.g. `"/findings"`), or the absolute path for built-in http. */
2949
+ path: string;
2950
+ /** Mount path including `/v1/channels/<id>` (or absolute for built-in http). */
2951
+ url: string;
2952
+ description?: string;
2953
+ bodySchema?: JsonSchemaObject;
2954
+ querySchema?: JsonSchemaObject;
2955
+ }
2956
+ /** JSON-safe projection of the manifest returned by `GET /v1/info`. */
2957
+ export interface AgentProjectInfo {
2958
+ name: string;
2959
+ /** Short agent description when authored on `defineAgent`. */
2960
+ description?: string;
2961
+ model?: ModelSetting;
2962
+ runtime: AgentRuntime;
2963
+ cloud?: AgentCloudPublicInfo;
2964
+ /** Local harness options when authored (`cwd` absolute). */
2965
+ local?: {
2966
+ cwd?: string;
2967
+ };
2968
+ /** Managed-hosting declarations when authored (egress allowlist, expected secrets, container image). */
2969
+ hosting?: {
2970
+ egressDomains?: string[];
2971
+ secretNames?: string[];
2972
+ image?: string;
2973
+ };
2974
+ /** Turn admission limits when authored (`concurrency` on `agent.ts`). */
2975
+ concurrency?: {
2976
+ maxRunningTurns?: number;
2977
+ };
2978
+ /**
2979
+ * The agent's own MCP surface (mounted at `<base>/v1/mcp`): other agents
2980
+ * and MCP clients delegate to this agent through these tools.
2981
+ */
2982
+ mcp: {
2983
+ path: string;
2984
+ tools: string[];
2985
+ };
2986
+ instructions?: {
2987
+ chars: number;
2988
+ preview: string;
2989
+ };
2990
+ tools: Array<{
2991
+ name: string;
2992
+ description: string;
2993
+ execution: ToolExecution;
2994
+ needsApproval: boolean;
2995
+ /**
2996
+ * The tool's declared {@link ToolEffect} when static, `"dynamic"` when
2997
+ * declared as a predicate. Absent when the author declared nothing —
2998
+ * "unknown", not "mutates".
2999
+ */
3000
+ effect?: ToolEffect | "dynamic";
3001
+ inputSchema: JsonSchemaObject;
3002
+ }>;
3003
+ skills: Array<{
3004
+ name: string;
3005
+ description: string;
3006
+ }>;
3007
+ /** Mounted extensions and the tool / skill names each contributed. */
3008
+ extensions: DiscoveredExtension[];
3009
+ connections: Array<{
3010
+ name: string;
3011
+ transport: string;
3012
+ advertiseTools?: boolean;
3013
+ optional?: boolean;
3014
+ effects?: readonly ToolEffect[];
3015
+ tools?: readonly string[];
3016
+ disallowedTools?: readonly string[];
3017
+ /**
3018
+ * Present only for `cursorAccount` connections: the connector-name
3019
+ * allowlist, or `"*"` for every connected server. Structured twin of the
3020
+ * `cursor-account[:a,b]` transport label so consumers (e.g. the
3021
+ * dashboard's connector scoping) never parse the display string.
3022
+ */
3023
+ cursorAccountServers?: string[] | "*";
3024
+ }>;
3025
+ subagents: Array<{
3026
+ name: string;
3027
+ description?: string;
3028
+ model?: ModelSetting;
3029
+ }>;
3030
+ channels: Array<{
3031
+ id: string;
3032
+ routes: AgentChannelRouteInfo[];
3033
+ /** Pack kind when the channel declares one (e.g. `"github"`). */
3034
+ kind?: string;
3035
+ /** GitHub webhook events the channel dispatches on, when declared. */
3036
+ githubWebhookEvents?: readonly string[];
3037
+ /** Origin webhook event types the channel dispatches on, when declared. */
3038
+ originWebhookEvents?: readonly string[];
3039
+ /** GitLab `object_kind`s the channel dispatches on, when declared. */
3040
+ gitlabWebhookEvents?: readonly string[];
3041
+ /** Bitbucket event keys (Cloud vocabulary) the channel dispatches on. */
3042
+ bitbucketWebhookEvents?: readonly string[];
3043
+ /** Factory deployment event types the channel dispatches on, when declared. */
3044
+ deploymentEventTypes?: readonly string[];
3045
+ /** Change Monitor checkpoint or Factory issue event types the channel dispatches on, when declared. */
3046
+ factoryEventTypes?: readonly string[];
3047
+ /** Slack Events API event types the channel dispatches on, when declared. */
3048
+ slackEventTypes?: readonly string[];
3049
+ /** Slack channels watched for posts (opt-in channel watch), when declared. */
3050
+ slackChannelPosts?: readonly string[];
3051
+ }>;
3052
+ schedules: Array<{
3053
+ name: string;
3054
+ cron: string;
3055
+ kind: "markdown" | "run";
3056
+ }>;
3057
+ /** Named reminder handlers (`agent/reminders/<name>.ts`) when present. */
3058
+ reminders?: Array<{
3059
+ name: string;
3060
+ }>;
3061
+ hooks: string[];
3062
+ /** Project storage sink from `agent/storage.ts`, when authored. */
3063
+ storage?: {
3064
+ name?: string;
3065
+ };
3066
+ otel?: {
3067
+ serviceName?: string;
3068
+ enabled: true;
3069
+ };
3070
+ /** Declared artifact kinds from `agent/artifacts.ts`, when authored. */
3071
+ artifacts?: {
3072
+ kinds: string[];
3073
+ agentTool: boolean;
3074
+ max: number;
3075
+ };
3076
+ diagnostics: Diagnostic[];
3077
+ }
3078
+ /**
3079
+ * A streaming update from the harness, re-exported from the Cursor SDK's
3080
+ * delta vocabulary.
3081
+ */
3082
+ export type RunnerUpdate = InteractionUpdate;
3083
+ export interface RunnerSubagent {
3084
+ name: string;
3085
+ description: string;
3086
+ prompt: string;
3087
+ model?: ModelSetting;
3088
+ }
3089
+ export interface RunnerTurnRequest {
3090
+ sessionId: string;
3091
+ /**
3092
+ * Cursor SDK agent id to create/resume. Defaults to {@link sessionId}
3093
+ * for local agents; cloud agents use the persisted `bc-…` id after
3094
+ * the first turn.
3095
+ */
3096
+ sdkAgentId?: string;
3097
+ /** Absolute path of the session's materialized workspace. */
3098
+ workspaceDir: string;
3099
+ /** Resolved FileSystem handle when {@link AgentConfig.root} is set. */
3100
+ root?: FileSystem;
3101
+ /** Run the local harness sandboxed ({@link AgentLocalOptions.sandbox}). */
3102
+ sandbox?: boolean;
3103
+ /** Built-in tool allowlist ({@link AgentConfig.tools}, resolved). */
3104
+ tools?: ToolName[];
3105
+ /**
3106
+ * Native tools hidden on the Cursor SDK agent because synthesized
3107
+ * FileSystem tools own those names. Host-default omitted `tools` only.
3108
+ */
3109
+ disallowedTools?: ToolName[];
3110
+ /** Absolute path for runner-owned durable state (conversation store). */
3111
+ runnerStateDir: string;
3112
+ prompt: string;
3113
+ isFirstTurn: boolean;
3114
+ /**
3115
+ * Base64 images for this turn (Cursor SDK `SDKUserMessage.images`).
3116
+ * Set from {@link SendMessageOptions.images} / Slack attachments.
3117
+ */
3118
+ images?: Array<{
3119
+ data: string;
3120
+ mimeType: string;
3121
+ }>;
3122
+ model?: ModelSetting;
3123
+ /**
3124
+ * Models to open the turn on, in order, after {@link model} is rejected
3125
+ * (catalog refusal or `resource_exhausted` / `[unavailable]`) and before
3126
+ * any output was streamed.
3127
+ */
3128
+ modelFallbacks?: readonly ModelSetting[];
3129
+ runtime: AgentRuntime;
3130
+ /**
3131
+ * The agent's display name. Grokbot turns address the caller's hosted
3132
+ * Grok Bot agent of this name: every SDK session of one agent forwards
3133
+ * into the same hosted agent and conversation.
3134
+ */
3135
+ agentName?: string;
3136
+ /** Cloud attach options for this turn, when the engine attached. */
3137
+ cloud?: AgentCloudOptions;
3138
+ /**
3139
+ * Composed instructions ({@link ResolvedAgent.instructions} plus identity
3140
+ * and tool catalog) delivered as the harness system prompt.
3141
+ */
3142
+ instructions?: string;
3143
+ /**
3144
+ * defineAgent directory slug for personal-key cloud creates. Injected
3145
+ * by the engine — not part of authored {@link AgentCloudOptions}.
3146
+ */
3147
+ agentServeAgent?: string;
3148
+ /** In-process tools, already bound to the session's tool context. */
3149
+ customTools: Record<string, SDKCustomTool>;
3150
+ /** MCP servers from `agent/mcp-connections/`. */
3151
+ mcpServers: Record<string, ConnectionTransport>;
3152
+ /**
3153
+ * Configure {@link mcpServers} on every send instead of once on the
3154
+ * cached SDK agent handle. Set when an attached connection has
3155
+ * per-session `auth`: its headers are re-evaluated at turn-build time,
3156
+ * and a handle-pinned copy would keep the first turn's credentials until
3157
+ * the handle recycles. The SDK builds the send's MCP session from exactly
3158
+ * this set (fresh clients each turn — stdio servers respawn per turn),
3159
+ * and the create/resume/prewarm options carry no `mcpServers` at all, so
3160
+ * the local executor cache key stays stable while credentials rotate.
3161
+ */
3162
+ perSendMcpServers?: boolean;
3163
+ subagents: RunnerSubagent[];
3164
+ onUpdate: (update: RunnerUpdate) => void | Promise<void>;
3165
+ /** Called once the SDK agent is open so the engine can persist its id. */
3166
+ onSdkAgentId?: (sdkAgentId: string) => void | Promise<void>;
3167
+ /**
3168
+ * Called once the harness names the run, before it produces anything.
3169
+ * Surfaces the request id while the turn is still running rather than at
3170
+ * its end.
3171
+ */
3172
+ onRequestId?: (requestId: string) => void | Promise<void>;
3173
+ /**
3174
+ * Abort the in-flight run when signalled. The engine aborts this when a
3175
+ * follow-up message preempts the current turn; the runner maps it to
3176
+ * `run.cancel()`, which tears down execution and marks the SDK run terminal.
3177
+ */
3178
+ signal?: AbortSignal;
3179
+ /**
3180
+ * Expire any run still marked active on the SDK agent before starting this
3181
+ * one (local runtime `force`). Set on follow-up turns so a preempted or
3182
+ * crash-wedged run can never block the next send with "already has active
3183
+ * run".
3184
+ */
3185
+ forceExpireActiveRun?: boolean;
3186
+ }
3187
+ export interface ServeOptions {
3188
+ /** Port to listen on. Defaults to 3000 (0 picks an ephemeral port). */
3189
+ port?: number;
3190
+ /** Host to bind. Defaults to 127.0.0.1. */
3191
+ host?: string;
3192
+ /**
3193
+ * Dev mode: mounts `POST /v1/dev/schedules/:scheduleId` and
3194
+ * `POST /v1/dev/reminders/:reminderId`, and disables the cron / reminder
3195
+ * auto-fire runners (dispatch by hand while iterating).
3196
+ */
3197
+ dev?: boolean;
3198
+ /** Durable state directory. Defaults to `<rootDir>/.agent-serve`. */
3199
+ stateRoot?: string;
3200
+ /**
3201
+ * Cursor API key for the SDK runner and Cursor account MCP connections.
3202
+ * When omitted, falls back to `CURSOR_API_KEY`, then
3203
+ * `CURSOR_API_KEY_FILE` (hosted default `/run/cursor/secrets/CURSOR_API_KEY`
3204
+ * when unset), then `CURSOR_SERVICE_ACCOUNT_KEY`, then the credential
3205
+ * stored by `agent-sdk login`. A bind file wins over
3206
+ * `CURSOR_SERVICE_ACCOUNT_KEY`.
3207
+ */
3208
+ apiKey?: string;
3209
+ /** Run schedules on their cron cadence. Defaults to `!dev`. */
3210
+ schedules?: boolean;
3211
+ /**
3212
+ * Arm reminder deadline timers automatically. Defaults to `!dev`
3213
+ * (same as schedules). Prompt-form reminders still persist on the
3214
+ * control plane in `--dev`; fire them via `POST /v1/dev/reminders/:id`
3215
+ * or `handle.dispatchReminder`.
3216
+ */
3217
+ reminders?: boolean;
3218
+ /**
3219
+ * Serve the bundled web playground at `/playground` (chat, streaming,
3220
+ * tool calls, sessions, schedule dispatch). Defaults to true; the API
3221
+ * routes it drives keep their normal auth chain either way.
3222
+ */
3223
+ playground?: boolean;
3224
+ /**
3225
+ * Serve the built documentation site at `/docs` ("docs" is a reserved
3226
+ * slug). Defaults to true. The site is auto-built when missing and the
3227
+ * vitepress toolchain is present; published installs ship it prebuilt.
3228
+ */
3229
+ docs?: boolean;
3230
+ /**
3231
+ * Replace the default `[localDevStrict()]` route auth with
3232
+ * `[bearerAuth(authToken)]` on every channel that doesn't author its own
3233
+ * auth chain. Use when exposing the server beyond loopback (e.g. through
3234
+ * a tunnel, where every request arrives from 127.0.0.1 and loopback-only
3235
+ * policies would admit everyone). Authored `auth` arrays still win.
3236
+ */
3237
+ authToken?: string;
3238
+ /**
3239
+ * Replace the default loopback-only route auth with `[allowAll()]` on every
3240
+ * channel that doesn't author its own auth chain. For temporary demos behind
3241
+ * a trusted network boundary (e.g. Tailscale) — do not combine with
3242
+ * {@link authToken}. Authored `auth` arrays still win.
3243
+ */
3244
+ allowAnonymous?: boolean;
3245
+ /**
3246
+ * Allow {@link allowAnonymous} together with
3247
+ * `githubChannel({ cursorAccount })`. Without this opt-in, `serve` refuses
3248
+ * to start because every admitted anonymous caller could drive sessions
3249
+ * that hold the signed-in account's repo-scoped GitHub credential. Set it
3250
+ * only when the network boundary already authenticates callers (e.g. an
3251
+ * SSO/Okta proxy in front of the host).
3252
+ */
3253
+ allowAnonymousCursorGithub?: boolean;
3254
+ /**
3255
+ * Allow `--allow-anonymous` together with a `runtime: "grokbot"` mount.
3256
+ * Off by default: grokbot turns execute on the signed-in account's hosted
3257
+ * Grok Bot computer, so an anonymous caller could drive Shell and other
3258
+ * box tools there. Set it only when the network boundary already
3259
+ * authenticates callers (e.g. an SSO/Okta proxy in front of the host).
3260
+ */
3261
+ allowAnonymousGrokbot?: boolean;
3262
+ /**
3263
+ * Allow {@link allowAnonymous} together with
3264
+ * `defineConnection({ cursorAccount: true })`. Without this opt-in, `serve`
3265
+ * refuses to start because every admitted anonymous caller could drive the
3266
+ * signed-in account's MCP connectors. Set it only when the network boundary
3267
+ * already authenticates callers (e.g. an SSO/Okta proxy, or the hosted
3268
+ * agent-serve alias token).
3269
+ */
3270
+ allowAnonymousCursorAccountMcp?: boolean;
3271
+ /**
3272
+ * Public base URL where this server is reachable from outside the host
3273
+ * (e.g. `https://agents.example.com`).
3274
+ */
3275
+ publicUrl?: string;
3276
+ /**
3277
+ * Hosting-injected HTTP MCP URL that proxies this deployment's
3278
+ * `/v1/mcp/tools`. The resolved Cursor API key authenticates requests.
3279
+ */
3280
+ cloudToolsUrl?: string;
3281
+ /**
3282
+ * Pull SCM webhook events from `/v0/scm-events` (Cursor account auth).
3283
+ * GitHub and Origin subscriptions are registered independently.
3284
+ * The stream is read as the host's Cursor user, so this requires a signed-in
3285
+ * host: `serve` throws when no key resolves from `apiKey` here,
3286
+ * {@link ServeOptions.apiKey}, `CURSOR_API_KEY`, `CURSOR_API_KEY_FILE`
3287
+ * (hosted default `/run/cursor/secrets/CURSOR_API_KEY` when unset),
3288
+ * `CURSOR_SERVICE_ACCOUNT_KEY`, or `agent-sdk login`.
3289
+ */
3290
+ cursorEvents?: {
3291
+ repos: string[];
3292
+ baseUrl?: string;
3293
+ apiKey?: string;
3294
+ };
3295
+ logger?: (line: string) => void;
3296
+ /**
3297
+ * OpenTelemetry export. Pass a config object, or `false` to force-disable
3298
+ * even when `OTEL_EXPORTER_OTLP_*` env vars / `agent/otel.ts` are set.
3299
+ * When omitted, env + authored `defineOtel` still enable export.
3300
+ */
3301
+ otel?: OtelConfig | false;
3302
+ }
3303
+ /** One agent mounted on a server (its URL slug + compiled project). */
3304
+ export interface MountedAgentInfo {
3305
+ /**
3306
+ * URL slug the agent is mounted under. Empty string in single-agent mode
3307
+ * (routes at `/v1/...`); the directory name in multi-agent mode (routes at
3308
+ * `/<slug>/v1/...`).
3309
+ */
3310
+ slug: string;
3311
+ project: AgentProject;
3312
+ /** Absolute base URL for this agent (server URL + `/<slug>` when slugged). */
3313
+ url: string;
3314
+ }
3315
+ export interface AgentServeHandle {
3316
+ url: string;
3317
+ port: number;
3318
+ /**
3319
+ * The single served agent's project. In multi-agent mode this is the first
3320
+ * mounted agent; use {@link agents} for the full set.
3321
+ */
3322
+ project: AgentProject;
3323
+ /** Every agent mounted on this server. One entry in single-agent mode. */
3324
+ agents: MountedAgentInfo[];
3325
+ /**
3326
+ * Dispatch a schedule by name. In multi-agent mode pass the agent slug as
3327
+ * the second argument to target a specific agent.
3328
+ */
3329
+ dispatchSchedule(name: string, slug?: string): Promise<{
3330
+ sessionIds: string[];
3331
+ }>;
3332
+ /**
3333
+ * Create a per-session reminder. In multi-agent mode pass `slug` in options.
3334
+ */
3335
+ createReminder(input: ReminderCreateInput, slug?: string): Promise<ReminderInfo>;
3336
+ /** List reminders for an agent. */
3337
+ listReminders(filter?: {
3338
+ status?: ReminderStatus;
3339
+ purpose?: string;
3340
+ continuationToken?: string;
3341
+ }, slug?: string): Promise<ReminderInfo[]>;
3342
+ /** Cancel a reminder by id. */
3343
+ cancelReminder(id: string, options?: {
3344
+ reason?: string;
3345
+ slug?: string;
3346
+ }): Promise<ReminderInfo | undefined>;
3347
+ /**
3348
+ * Fire a reminder immediately (same path as the deadline timer / dev route).
3349
+ * `outcome` is `"noop"` when the reminder was already firing or not armed.
3350
+ */
3351
+ dispatchReminder(id: string, slug?: string): Promise<{
3352
+ reminderId: string;
3353
+ outcome: "fired" | "noop";
3354
+ reason?: string;
3355
+ }>;
3356
+ /**
3357
+ * Call an authored server tool deterministically (no model turn). In
3358
+ * multi-agent mode pass the agent slug in the options to target a
3359
+ * specific agent.
3360
+ */
3361
+ callTool(toolName: string, input?: unknown, options?: CallToolOptions & {
3362
+ slug?: string;
3363
+ }): Promise<ToolCallOutcome>;
3364
+ /**
3365
+ * Vite HMR playground URL when `serve --dev` auto-started it (local
3366
+ * checkout with the vite toolchain). Prefer this over the static
3367
+ * `/playground` mount while iterating on the SPA. Multi-agent HMR serves
3368
+ * the agents index at this URL and each SPA at `/<slug>/playground`.
3369
+ */
3370
+ playgroundDevUrl?: string;
3371
+ /** Where the built documentation site is mounted (`<url>/docs`), when served. */
3372
+ docsUrl?: string;
3373
+ close(): Promise<void>;
3374
+ }
3375
+ //# sourceMappingURL=types.d.ts.map