@cursor/july 0.1.108 → 0.1.109

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 (343) hide show
  1. package/AGENTS.md +2 -6
  2. package/README.md +3 -6
  3. package/dist/channels/bitbucket/api.d.ts +41 -0
  4. package/dist/channels/bitbucket/api.d.ts.map +1 -1
  5. package/dist/channels/bitbucket/api.js +260 -0
  6. package/dist/channels/bitbucket/binding.d.ts +4 -0
  7. package/dist/channels/bitbucket/binding.d.ts.map +1 -1
  8. package/dist/channels/bitbucket/binding.js +16 -0
  9. package/dist/channels/bitbucket/index.d.ts +1 -1
  10. package/dist/channels/bitbucket/index.d.ts.map +1 -1
  11. package/dist/channels/bitbucket/index.js +1 -1
  12. package/dist/channels/gitlab/api.d.ts +27 -0
  13. package/dist/channels/gitlab/api.d.ts.map +1 -1
  14. package/dist/channels/gitlab/api.js +88 -0
  15. package/dist/channels/gitlab/binding.d.ts +5 -0
  16. package/dist/channels/gitlab/binding.d.ts.map +1 -1
  17. package/dist/channels/gitlab/binding.js +10 -0
  18. package/dist/channels/gitlab/index.d.ts +1 -1
  19. package/dist/channels/gitlab/index.d.ts.map +1 -1
  20. package/dist/channels/gitlab/index.js +1 -1
  21. package/dist/channels/slack/dispatch.d.ts +10 -0
  22. package/dist/channels/slack/dispatch.d.ts.map +1 -1
  23. package/dist/channels/slack/dispatch.js +20 -3
  24. package/dist/channels/slack/slack-channel.d.ts +12 -5
  25. package/dist/channels/slack/slack-channel.d.ts.map +1 -1
  26. package/dist/channels/slack/slack-channel.js +59 -8
  27. package/dist/docs/404.html +2 -2
  28. package/dist/docs/assets/{app.BASKM3M4.js → app.Cr-wVbnB.js} +1 -1
  29. package/dist/docs/assets/{building-with-agents.md.CUSWxlP_.js → building-with-agents.md.D0KbSkJn.js} +2 -2
  30. package/dist/docs/assets/{building-with-agents.md.CUSWxlP_.lean.js → building-with-agents.md.D0KbSkJn.lean.js} +1 -1
  31. package/dist/docs/assets/chunks/@localSearchIndexroot.CFVQ4S17.js +1 -0
  32. package/dist/docs/assets/chunks/{VPLocalSearchBox.BOKxlYGP.js → VPLocalSearchBox.CVQERt56.js} +1 -1
  33. package/dist/docs/assets/chunks/{theme.DbDZW-zb.js → theme.Dnsd3XOn.js} +2 -2
  34. package/dist/docs/assets/concepts.md.B4o63Gul.js +1 -0
  35. package/dist/docs/assets/evals.md.C7JLjoEP.js +211 -0
  36. package/dist/docs/assets/evals.md.C7JLjoEP.lean.js +1 -0
  37. package/dist/docs/assets/guides_bitbucket.md.DZPzmUjU.js +10 -0
  38. package/dist/docs/assets/guides_bitbucket.md.DZPzmUjU.lean.js +1 -0
  39. package/dist/docs/assets/{guides_github.md.BH33UEBJ.js → guides_github.md.TZaTZlfz.js} +13 -3
  40. package/dist/docs/assets/{guides_github.md.BH33UEBJ.lean.js → guides_github.md.TZaTZlfz.lean.js} +1 -1
  41. package/dist/docs/assets/guides_gitlab.md.BmqwQfdG.js +14 -0
  42. package/dist/docs/assets/guides_gitlab.md.BmqwQfdG.lean.js +1 -0
  43. package/dist/docs/assets/{guides_webhooks.md.DKdA43Qm.js → guides_webhooks.md.CJK484ex.js} +2 -2
  44. package/dist/docs/assets/{hillclimbing.md.CpTGTCle.js → hillclimbing.md.BOiVo1tf.js} +1 -1
  45. package/dist/docs/assets/index.md.DD9Q2XuJ.js +5 -0
  46. package/dist/docs/assets/{index.md.BjH1w2ZW.lean.js → index.md.DD9Q2XuJ.lean.js} +1 -1
  47. package/dist/docs/assets/{reference_channels.md.D-qTqwcq.js → reference_channels.md.CAo-iK4j.js} +2 -2
  48. package/dist/docs/assets/{reference_channels.md.D-qTqwcq.lean.js → reference_channels.md.CAo-iK4j.lean.js} +1 -1
  49. package/dist/docs/assets/{reference_cli.md.Ca26u0Es.js → reference_cli.md.Deg7849l.js} +1 -1
  50. package/dist/docs/assets/{reference_extensions.md.CPWt00ds.js → reference_extensions.md.ZAVUyuEX.js} +2 -2
  51. package/dist/docs/assets/{reference_hooks.md.Ddt5DdgJ.js → reference_hooks.md.BlM_bOg6.js} +3 -3
  52. package/dist/docs/assets/{reference_hooks.md.Ddt5DdgJ.lean.js → reference_hooks.md.BlM_bOg6.lean.js} +1 -1
  53. package/dist/docs/assets/{reference_http-api.md.oySXBO8o.js → reference_http-api.md.BwaCo-VO.js} +1 -1
  54. package/dist/docs/assets/{reference_playground.md.4myJPxrf.js → reference_playground.md.DLnoaczX.js} +1 -1
  55. package/dist/docs/assets/{reference_playground.md.4myJPxrf.lean.js → reference_playground.md.DLnoaczX.lean.js} +1 -1
  56. package/dist/docs/assets/{reference_project-layout.md.DuBu9a96.js → reference_project-layout.md.BEU8MtQV.js} +3 -3
  57. package/dist/docs/assets/{reference_project-layout.md.DuBu9a96.lean.js → reference_project-layout.md.BEU8MtQV.lean.js} +1 -1
  58. package/dist/docs/assets/reference_sessions.md.CyXV1MUw.js +1 -0
  59. package/dist/docs/assets/skills_deploy.md.CWqi_ZxW.js +35 -0
  60. package/dist/docs/assets/skills_deploy.md.CWqi_ZxW.lean.js +1 -0
  61. package/dist/docs/assets/{skills_evals.md.BhovOvrl.js → skills_evals.md.DFxYPErF.js} +3 -3
  62. package/dist/docs/assets/skills_evals.md.DFxYPErF.lean.js +1 -0
  63. package/dist/docs/assets/{skills_framework-map.md.D-tFZhFS.js → skills_framework-map.md.BxLSOhSY.js} +1 -1
  64. package/dist/docs/assets/skills_index.md.DL7EHaQ-.js +1 -0
  65. package/dist/docs/assets/skills_index.md.DL7EHaQ-.lean.js +1 -0
  66. package/dist/docs/assets/{storage.md.BOHeqk2M.js → storage.md.BUrhJ-Zz.js} +4 -4
  67. package/dist/docs/assets/{storage.md.BOHeqk2M.lean.js → storage.md.BUrhJ-Zz.lean.js} +1 -1
  68. package/dist/docs/building-with-agents.html +5 -5
  69. package/dist/docs/building-with-agents.md +3 -2
  70. package/dist/docs/concepts.html +5 -5
  71. package/dist/docs/concepts.md +2 -4
  72. package/dist/docs/deployment.html +4 -4
  73. package/dist/docs/evals.html +161 -35
  74. package/dist/docs/evals.md +612 -297
  75. package/dist/docs/guides/agent-to-agent.html +4 -4
  76. package/dist/docs/guides/bitbucket.html +36 -0
  77. package/dist/docs/guides/bitbucket.md +84 -0
  78. package/dist/docs/guides/cloud-agents.html +4 -4
  79. package/dist/docs/guides/convert-automation.html +4 -4
  80. package/dist/docs/guides/github.html +17 -7
  81. package/dist/docs/guides/github.md +31 -0
  82. package/dist/docs/guides/gitlab.html +40 -0
  83. package/dist/docs/guides/gitlab.md +92 -0
  84. package/dist/docs/guides/grokbot-agents.html +4 -4
  85. package/dist/docs/guides/human-in-the-loop.html +4 -4
  86. package/dist/docs/guides/improve.html +4 -4
  87. package/dist/docs/guides/mcp-oauth.html +4 -4
  88. package/dist/docs/guides/opentelemetry.html +4 -4
  89. package/dist/docs/guides/slack.html +5 -5
  90. package/dist/docs/guides/webhooks.html +6 -6
  91. package/dist/docs/guides/webhooks.md +4 -2
  92. package/dist/docs/hashmap.json +1 -1
  93. package/dist/docs/hillclimbing.html +6 -6
  94. package/dist/docs/hillclimbing.md +2 -2
  95. package/dist/docs/index.html +6 -6
  96. package/dist/docs/index.md +10 -6
  97. package/dist/docs/llms-full.txt +1113 -778
  98. package/dist/docs/llms.txt +6 -5
  99. package/dist/docs/quickstart.html +4 -4
  100. package/dist/docs/reference/agent-config.html +4 -4
  101. package/dist/docs/reference/artifacts.html +4 -4
  102. package/dist/docs/reference/channels.html +6 -6
  103. package/dist/docs/reference/channels.md +16 -3
  104. package/dist/docs/reference/cli.html +6 -6
  105. package/dist/docs/reference/cli.md +6 -4
  106. package/dist/docs/reference/connections.html +4 -4
  107. package/dist/docs/reference/extensions.html +7 -7
  108. package/dist/docs/reference/extensions.md +0 -3
  109. package/dist/docs/reference/hooks.html +7 -7
  110. package/dist/docs/reference/hooks.md +9 -12
  111. package/dist/docs/reference/http-api.html +6 -6
  112. package/dist/docs/reference/http-api.md +2 -3
  113. package/dist/docs/reference/instructions.html +4 -4
  114. package/dist/docs/reference/playground.html +5 -5
  115. package/dist/docs/reference/playground.md +0 -4
  116. package/dist/docs/reference/project-layout.html +7 -7
  117. package/dist/docs/reference/project-layout.md +1 -8
  118. package/dist/docs/reference/prompt.html +4 -4
  119. package/dist/docs/reference/result.html +4 -4
  120. package/dist/docs/reference/schedules.html +4 -4
  121. package/dist/docs/reference/sessions.html +5 -5
  122. package/dist/docs/reference/sessions.md +1 -2
  123. package/dist/docs/reference/skills.html +4 -4
  124. package/dist/docs/reference/subagents.html +4 -4
  125. package/dist/docs/reference/tools.html +4 -4
  126. package/dist/docs/scaffolding-agents.html +4 -4
  127. package/dist/docs/skills/create-agent.html +4 -4
  128. package/dist/docs/skills/debug.html +4 -4
  129. package/dist/docs/skills/deploy.html +61 -0
  130. package/dist/docs/skills/deploy.md +161 -0
  131. package/dist/docs/skills/evals.html +8 -8
  132. package/dist/docs/skills/evals.md +44 -6
  133. package/dist/docs/skills/framework-map.html +5 -5
  134. package/dist/docs/skills/framework-map.md +1 -2
  135. package/dist/docs/skills/github.html +4 -4
  136. package/dist/docs/skills/hillclimb.html +4 -4
  137. package/dist/docs/skills/index.html +6 -6
  138. package/dist/docs/skills/index.md +1 -1
  139. package/dist/docs/skills/mcp-auth.html +4 -4
  140. package/dist/docs/skills/otel.html +4 -4
  141. package/dist/docs/skills/setup-slack.html +4 -4
  142. package/dist/docs/storage.html +8 -8
  143. package/dist/docs/storage.md +15 -24
  144. package/dist/docs/templates/agentic-owners.html +4 -4
  145. package/dist/docs/templates/agents-md.html +4 -4
  146. package/dist/docs/templates/code-wiki.html +4 -4
  147. package/dist/docs/templates/demo.html +4 -4
  148. package/dist/docs/templates/grokbot-agents.html +4 -4
  149. package/dist/docs/templates/pr-autofixer.html +4 -4
  150. package/dist/docs/templates/security-help.html +4 -4
  151. package/dist/docs/templates/security-reviewer.html +4 -4
  152. package/dist/docs/templates/triage.html +4 -4
  153. package/dist/docs/troubleshooting.html +4 -4
  154. package/dist/extensions.d.ts +2 -3
  155. package/dist/extensions.d.ts.map +1 -1
  156. package/dist/extensions.js +2 -5
  157. package/dist/index.d.ts +2 -3
  158. package/dist/index.d.ts.map +1 -1
  159. package/dist/index.js +1 -2
  160. package/dist/internal/authored-alias-hooks.d.ts +5 -0
  161. package/dist/internal/authored-alias-hooks.d.ts.map +1 -1
  162. package/dist/internal/authored-alias-hooks.js +17 -0
  163. package/dist/internal/authored-loaders.d.ts +4 -0
  164. package/dist/internal/authored-loaders.d.ts.map +1 -1
  165. package/dist/internal/authored-loaders.js +21 -2
  166. package/dist/internal/cli-ax.d.ts +1 -2
  167. package/dist/internal/cli-ax.d.ts.map +1 -1
  168. package/dist/internal/cli-ax.js +1 -2
  169. package/dist/internal/continuation-channel.d.ts.map +1 -1
  170. package/dist/internal/continuation-channel.js +2 -2
  171. package/dist/internal/continuation-identity.js +8 -3
  172. package/dist/internal/discovery/agent.d.ts +1 -1
  173. package/dist/internal/discovery/agent.d.ts.map +1 -1
  174. package/dist/internal/discovery/agent.js +0 -5
  175. package/dist/internal/discovery/extension-overlay.d.ts +1 -2
  176. package/dist/internal/discovery/extension-overlay.d.ts.map +1 -1
  177. package/dist/internal/discovery/extension-overlay.js +0 -14
  178. package/dist/internal/discovery/extensions.d.ts +1 -2
  179. package/dist/internal/discovery/extensions.d.ts.map +1 -1
  180. package/dist/internal/discovery/extensions.js +4 -22
  181. package/dist/internal/discovery/info.d.ts.map +1 -1
  182. package/dist/internal/discovery/info.js +42 -24
  183. package/dist/internal/discovery/modules.js +0 -1
  184. package/dist/internal/discovery/project.d.ts.map +1 -1
  185. package/dist/internal/discovery/project.js +0 -16
  186. package/dist/internal/eval-runner.js +0 -1
  187. package/dist/internal/framework-file-storage.d.ts +4 -5
  188. package/dist/internal/framework-file-storage.d.ts.map +1 -1
  189. package/dist/internal/framework-file-storage.js +4 -5
  190. package/dist/internal/framework-storage-selection.d.ts +2 -2
  191. package/dist/internal/framework-storage-selection.js +2 -2
  192. package/dist/internal/init-scaffold.d.ts.map +1 -1
  193. package/dist/internal/init-scaffold.js +1 -2
  194. package/dist/internal/install-cursor-skills.d.ts +5 -2
  195. package/dist/internal/install-cursor-skills.d.ts.map +1 -1
  196. package/dist/internal/install-cursor-skills.js +25 -5
  197. package/dist/internal/run-client.d.ts +1 -1
  198. package/dist/internal/sdk-runner.js +1 -1
  199. package/dist/internal/server.js +0 -14
  200. package/dist/internal/session-engine.d.ts +5 -35
  201. package/dist/internal/session-engine.d.ts.map +1 -1
  202. package/dist/internal/session-engine.js +17 -162
  203. package/dist/internal/storage-coordinator.d.ts +5 -19
  204. package/dist/internal/storage-coordinator.d.ts.map +1 -1
  205. package/dist/internal/storage-coordinator.js +3 -62
  206. package/dist/internal/storage-roles.d.ts +4 -9
  207. package/dist/internal/storage-roles.d.ts.map +1 -1
  208. package/dist/internal/storage-roles.js +2 -2
  209. package/dist/playground/assets/index-Bhxzrcf6.css +1 -0
  210. package/dist/playground/assets/index-CqLX5uF3.js +67 -0
  211. package/dist/playground/index.html +2 -2
  212. package/dist/storage-backends/cursor-hosted-v2.d.ts +4 -5
  213. package/dist/storage-backends/cursor-hosted-v2.d.ts.map +1 -1
  214. package/dist/storage-backends/cursor-hosted-v2.js +4 -5
  215. package/dist/storage-backends/cursor-hosted.d.ts +1 -2
  216. package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
  217. package/dist/storage-backends/cursor-hosted.js +0 -30
  218. package/dist/storage-backends/file-kv.d.ts +9 -12
  219. package/dist/storage-backends/file-kv.d.ts.map +1 -1
  220. package/dist/storage-backends/file-kv.js +11 -47
  221. package/dist/storage-protocol.d.ts +3 -11
  222. package/dist/storage-protocol.d.ts.map +1 -1
  223. package/dist/storage-protocol.js +3 -11
  224. package/dist/storage.d.ts +8 -36
  225. package/dist/storage.d.ts.map +1 -1
  226. package/dist/storage.js +8 -44
  227. package/dist/types.d.ts +20 -57
  228. package/dist/types.d.ts.map +1 -1
  229. package/docs/README.md +10 -6
  230. package/docs/building-with-agents.md +3 -2
  231. package/docs/concepts.md +2 -4
  232. package/docs/evals.md +613 -298
  233. package/docs/guides/bitbucket.md +89 -0
  234. package/docs/guides/github.md +31 -0
  235. package/docs/guides/gitlab.md +97 -0
  236. package/docs/guides/webhooks.md +4 -2
  237. package/docs/hillclimbing.md +2 -2
  238. package/docs/reference/channels.md +16 -3
  239. package/docs/reference/cli.md +6 -4
  240. package/docs/reference/extensions.md +0 -3
  241. package/docs/reference/hooks.md +9 -12
  242. package/docs/reference/http-api.md +2 -3
  243. package/docs/reference/playground.md +0 -4
  244. package/docs/reference/project-layout.md +1 -8
  245. package/docs/reference/sessions.md +1 -2
  246. package/docs/skills/index.md +2 -2
  247. package/docs/storage.md +15 -24
  248. package/package.json +1 -7
  249. package/skills/deploy/SKILL.md +169 -0
  250. package/skills/evals/SKILL.md +45 -8
  251. package/skills/framework-map/SKILL.md +1 -2
  252. package/src/channels/bitbucket/api.ts +341 -0
  253. package/src/channels/bitbucket/binding.ts +25 -0
  254. package/src/channels/bitbucket/index.ts +2 -0
  255. package/src/channels/gitlab/api.ts +123 -0
  256. package/src/channels/gitlab/binding.ts +12 -0
  257. package/src/channels/gitlab/index.ts +1 -0
  258. package/src/channels/slack/dispatch.ts +30 -0
  259. package/src/channels/slack/slack-channel.ts +69 -7
  260. package/src/extensions.ts +2 -6
  261. package/src/index.ts +0 -3
  262. package/src/internal/authored-alias-hooks.ts +32 -0
  263. package/src/internal/authored-loaders.ts +26 -2
  264. package/src/internal/cli-ax.ts +1 -2
  265. package/src/internal/continuation-channel.ts +2 -1
  266. package/src/internal/continuation-identity.ts +10 -2
  267. package/src/internal/discovery/agent.ts +1 -7
  268. package/src/internal/discovery/extension-overlay.ts +0 -18
  269. package/src/internal/discovery/extensions.ts +2 -26
  270. package/src/internal/discovery/info.ts +3 -13
  271. package/src/internal/discovery/modules.ts +0 -1
  272. package/src/internal/discovery/project.ts +0 -16
  273. package/src/internal/eval-runner.ts +0 -1
  274. package/src/internal/framework-file-storage.ts +4 -5
  275. package/src/internal/framework-storage-selection.ts +2 -2
  276. package/src/internal/init-scaffold.ts +1 -2
  277. package/src/internal/install-cursor-skills.ts +38 -5
  278. package/src/internal/run-client.ts +1 -1
  279. package/src/internal/sdk-runner.ts +1 -1
  280. package/src/internal/server.ts +0 -16
  281. package/src/internal/session-engine.ts +14 -202
  282. package/src/internal/storage-coordinator.ts +5 -76
  283. package/src/internal/storage-roles.ts +4 -9
  284. package/src/storage-backends/cursor-hosted-v2.ts +4 -7
  285. package/src/storage-backends/cursor-hosted.ts +0 -37
  286. package/src/storage-backends/file-kv.ts +10 -51
  287. package/src/storage-protocol.ts +3 -17
  288. package/src/storage.ts +10 -101
  289. package/src/types.ts +19 -56
  290. package/templates/demo/README.md +10 -6
  291. package/templates/demo/agent/channels/github.ts +2 -0
  292. package/templates/demo/agent/channels/queue.ts +6 -2
  293. package/templates/demo/agent/lib/repos.ts +5 -0
  294. package/templates/demo/init.json +25 -0
  295. package/dist/ab.d.ts +0 -209
  296. package/dist/ab.d.ts.map +0 -1
  297. package/dist/ab.js +0 -246
  298. package/dist/docs/ab.html +0 -80
  299. package/dist/docs/ab.md +0 -332
  300. package/dist/docs/assets/ab.md.mlVgqvSk.js +0 -54
  301. package/dist/docs/assets/ab.md.mlVgqvSk.lean.js +0 -1
  302. package/dist/docs/assets/chunks/@localSearchIndexroot.BHZYsNVi.js +0 -1
  303. package/dist/docs/assets/concepts.md.DgEcZOfT.js +0 -1
  304. package/dist/docs/assets/evals.md.C1ekS3k2.js +0 -85
  305. package/dist/docs/assets/evals.md.C1ekS3k2.lean.js +0 -1
  306. package/dist/docs/assets/index.md.BjH1w2ZW.js +0 -5
  307. package/dist/docs/assets/reference_sessions.md.CueyOHSL.js +0 -1
  308. package/dist/docs/assets/skills_ab.md.CsFNatVx.js +0 -26
  309. package/dist/docs/assets/skills_ab.md.CsFNatVx.lean.js +0 -1
  310. package/dist/docs/assets/skills_evals.md.BhovOvrl.lean.js +0 -1
  311. package/dist/docs/assets/skills_index.md.DKwIxzGg.js +0 -1
  312. package/dist/docs/assets/skills_index.md.DKwIxzGg.lean.js +0 -1
  313. package/dist/docs/skills/ab.html +0 -52
  314. package/dist/docs/skills/ab.md +0 -50
  315. package/dist/internal/ab-collector.d.ts +0 -44
  316. package/dist/internal/ab-collector.d.ts.map +0 -1
  317. package/dist/internal/ab-collector.js +0 -142
  318. package/dist/internal/ab-fold.d.ts +0 -36
  319. package/dist/internal/ab-fold.d.ts.map +0 -1
  320. package/dist/internal/ab-fold.js +0 -175
  321. package/dist/internal/ab-snapshot.d.ts +0 -68
  322. package/dist/internal/ab-snapshot.d.ts.map +0 -1
  323. package/dist/internal/ab-snapshot.js +0 -208
  324. package/dist/internal/discovery/ab.d.ts +0 -9
  325. package/dist/internal/discovery/ab.d.ts.map +0 -1
  326. package/dist/internal/discovery/ab.js +0 -113
  327. package/dist/playground/assets/index-BMDqAeXu.js +0 -67
  328. package/dist/playground/assets/index-LUgJoWdL.css +0 -1
  329. package/docs/ab.md +0 -337
  330. package/skills/ab/SKILL.md +0 -58
  331. package/src/ab.ts +0 -430
  332. package/src/internal/ab-collector.ts +0 -200
  333. package/src/internal/ab-fold.ts +0 -232
  334. package/src/internal/ab-snapshot.ts +0 -331
  335. package/src/internal/discovery/ab.ts +0 -131
  336. /package/dist/docs/assets/{concepts.md.DgEcZOfT.lean.js → concepts.md.B4o63Gul.lean.js} +0 -0
  337. /package/dist/docs/assets/{guides_webhooks.md.DKdA43Qm.lean.js → guides_webhooks.md.CJK484ex.lean.js} +0 -0
  338. /package/dist/docs/assets/{hillclimbing.md.CpTGTCle.lean.js → hillclimbing.md.BOiVo1tf.lean.js} +0 -0
  339. /package/dist/docs/assets/{reference_cli.md.Ca26u0Es.lean.js → reference_cli.md.Deg7849l.lean.js} +0 -0
  340. /package/dist/docs/assets/{reference_extensions.md.CPWt00ds.lean.js → reference_extensions.md.ZAVUyuEX.lean.js} +0 -0
  341. /package/dist/docs/assets/{reference_http-api.md.oySXBO8o.lean.js → reference_http-api.md.BwaCo-VO.lean.js} +0 -0
  342. /package/dist/docs/assets/{reference_sessions.md.CueyOHSL.lean.js → reference_sessions.md.CyXV1MUw.lean.js} +0 -0
  343. /package/dist/docs/assets/{skills_framework-map.md.D-tFZhFS.lean.js → skills_framework-map.md.BxLSOhSY.lean.js} +0 -0
@@ -92,6 +92,35 @@ export interface GitLabClient {
92
92
  request<T = unknown>(input: GitLabRequestInput): Promise<T>;
93
93
  }
94
94
 
95
+ export interface GitLabApiMergeRequest {
96
+ iid: number;
97
+ title?: string;
98
+ description?: string;
99
+ state?: string;
100
+ draft?: boolean;
101
+ webUrl?: string;
102
+ headSha?: string;
103
+ sourceBranch?: string;
104
+ targetBranch?: string;
105
+ authorUsername?: string;
106
+ baseSha?: string;
107
+ changedFilesCount?: number;
108
+ }
109
+
110
+ export interface GitLabApiMergeRequestDiff {
111
+ oldPath: string;
112
+ newPath: string;
113
+ patch?: string;
114
+ status: "added" | "modified" | "removed" | "renamed";
115
+ }
116
+
117
+ /** Project-bound merge-request reads shared by GitLab agents. */
118
+ export interface GitLabApi {
119
+ getMergeRequest(iid: number): Promise<GitLabApiMergeRequest>;
120
+ getMergeBaseSha(base: string, headSha: string): Promise<string | undefined>;
121
+ listMergeRequestDiffs(iid: number): Promise<GitLabApiMergeRequestDiff[]>;
122
+ }
123
+
95
124
  function envValue(value: string | undefined): string | undefined {
96
125
  const trimmed = value?.trim();
97
126
  return trimmed === undefined || trimmed === "" ? undefined : trimmed;
@@ -136,6 +165,100 @@ export function gitlabProjectPathSegment(project: number | string): string {
136
165
  : encodeURIComponent(project.replace(/^\/+|\/+$/g, ""));
137
166
  }
138
167
 
168
+ function asRecord(value: unknown): Record<string, unknown> | undefined {
169
+ return typeof value === "object" && value !== null && !Array.isArray(value)
170
+ ? (value as Record<string, unknown>)
171
+ : undefined;
172
+ }
173
+
174
+ function nonEmptyString(value: unknown): string | undefined {
175
+ return typeof value === "string" && value !== "" ? value : undefined;
176
+ }
177
+
178
+ const GITLAB_DIFFS_PER_PAGE = 100;
179
+
180
+ export function createGitLabApi(
181
+ client: Pick<GitLabClient, "request">,
182
+ project: number | string
183
+ ): GitLabApi {
184
+ const projectPath = `/projects/${gitlabProjectPathSegment(project)}`;
185
+ return {
186
+ async getMergeRequest(iid) {
187
+ const raw = await client.request<Record<string, unknown>>({
188
+ method: "GET",
189
+ path: `${projectPath}/merge_requests/${iid}`,
190
+ });
191
+ const diffRefs = asRecord(raw.diff_refs);
192
+ const changesCount = nonEmptyString(raw.changes_count);
193
+ return {
194
+ iid: (raw.iid as number | null | undefined) ?? iid,
195
+ title: raw.title as string | undefined,
196
+ description:
197
+ raw.description === null
198
+ ? undefined
199
+ : (raw.description as string | undefined),
200
+ state: raw.state as string | undefined,
201
+ draft:
202
+ typeof raw.draft === "boolean"
203
+ ? raw.draft
204
+ : typeof raw.work_in_progress === "boolean"
205
+ ? raw.work_in_progress
206
+ : undefined,
207
+ webUrl: raw.web_url as string | undefined,
208
+ headSha:
209
+ (raw.sha as string | null | undefined) ??
210
+ (diffRefs?.head_sha as string | undefined),
211
+ sourceBranch: raw.source_branch as string | undefined,
212
+ targetBranch: raw.target_branch as string | undefined,
213
+ authorUsername: asRecord(raw.author)?.username as string | undefined,
214
+ baseSha: nonEmptyString(diffRefs?.base_sha),
215
+ changedFilesCount:
216
+ changesCount !== undefined && /^\d+$/.test(changesCount)
217
+ ? Number(changesCount)
218
+ : undefined,
219
+ };
220
+ },
221
+ async getMergeBaseSha(base, headSha) {
222
+ const data = await client.request<{ id?: string }>({
223
+ method: "GET",
224
+ path: `${projectPath}/repository/merge_base?refs[]=${encodeURIComponent(base)}&refs[]=${encodeURIComponent(headSha)}`,
225
+ });
226
+ return nonEmptyString(data.id);
227
+ },
228
+ async listMergeRequestDiffs(iid) {
229
+ const files: GitLabApiMergeRequestDiff[] = [];
230
+ for (let page = 1; ; page += 1) {
231
+ const diffs = await client.request<Record<string, unknown>[]>({
232
+ method: "GET",
233
+ path: `${projectPath}/merge_requests/${iid}/diffs`,
234
+ query: { page, per_page: GITLAB_DIFFS_PER_PAGE },
235
+ });
236
+ for (const diff of diffs) {
237
+ const status =
238
+ diff.new_file === true
239
+ ? "added"
240
+ : diff.deleted_file === true
241
+ ? "removed"
242
+ : diff.renamed_file === true
243
+ ? "renamed"
244
+ : "modified";
245
+ const rawPatch =
246
+ typeof diff.diff === "string" ? diff.diff : undefined;
247
+ files.push({
248
+ oldPath: diff.old_path as string,
249
+ newPath: diff.new_path as string,
250
+ status,
251
+ patch: rawPatch?.replace(/\n$/, ""),
252
+ });
253
+ }
254
+ if (diffs.length < GITLAB_DIFFS_PER_PAGE) {
255
+ return files;
256
+ }
257
+ }
258
+ },
259
+ };
260
+ }
261
+
139
262
  function buildQuery(query: GitLabRequestInput["query"]): string {
140
263
  if (query === undefined) {
141
264
  return "";
@@ -176,6 +176,18 @@ export function gitlabMergeRequestUrl(
176
176
  return explicit ?? `${project.webUrl}/-/merge_requests/${iid}`;
177
177
  }
178
178
 
179
+ /**
180
+ * Whether an `update` payload marks a draft merge request ready. GitLab uses
181
+ * either `changes.draft` or the legacy `changes.work_in_progress` shape.
182
+ */
183
+ export function gitlabDraftMarkedReady(
184
+ payload: Record<string, unknown>
185
+ ): boolean {
186
+ const changes = asRecord(payload.changes);
187
+ const draft = asRecord(changes?.draft ?? changes?.work_in_progress);
188
+ return draft?.current === false && draft.previous !== false;
189
+ }
190
+
179
191
  /** Normalize a merge-request record (`object_attributes` or `merge_request`). */
180
192
  export function gitlabMergeRequestFromRecord(
181
193
  project: GitLabProjectRef,
@@ -22,6 +22,7 @@ export * from "./api.js";
22
22
  export {
23
23
  buildGitLabBinding,
24
24
  type GitLabHandle,
25
+ gitlabDraftMarkedReady,
25
26
  gitlabMergeRequestFromRecord,
26
27
  gitlabMergeRequestUrl,
27
28
  gitlabProjectFromPayload,
@@ -8,6 +8,7 @@ import {
8
8
  type MailboxContinuation,
9
9
  normalizeIdentity,
10
10
  } from "../../internal/continuation-identity.js";
11
+ import { isDeferredChannelSession } from "../../internal/deferred-channel-session.js";
11
12
  import { routeLocalIngressContinuation } from "../../internal/local-ingress.js";
12
13
  import { steeringEnabled } from "../../internal/steering.js";
13
14
  import type {
@@ -189,6 +190,14 @@ export interface SlackInboundDispatchDeps extends SlackContinuationProbes {
189
190
  */
190
191
  suggestedPrompts?: SlackSuggestedPrompt[];
191
192
  suggestedPromptsTitle?: string;
193
+ /**
194
+ * Rethrow handler failures out of the dispatch promise instead of
195
+ * swallowing them after the error log. Hosted admission sets this so a
196
+ * throwing handler rejects `waitUntil` and surfaces as a retryable 503
197
+ * to the control plane (matching the GitHub/Origin adapters); the
198
+ * long-lived Socket Mode loop keeps the swallow-and-log default.
199
+ */
200
+ propagateHandlerErrors?: boolean;
192
201
  }
193
202
 
194
203
  function triggeringMergeMessage(
@@ -267,6 +276,8 @@ export async function dispatchInboundMessage(args: {
267
276
  followUpStatus?: boolean;
268
277
  blockExternals?: boolean;
269
278
  continuation?: ContinuationIdentity;
279
+ /** See {@link SlackInboundDispatchDeps.propagateHandlerErrors}. */
280
+ propagateHandlerErrors?: boolean;
270
281
  }): Promise<void> {
271
282
  const { message, kind } = args;
272
283
  const log = args.log ?? defaultSlackLog;
@@ -399,6 +410,9 @@ export async function dispatchInboundMessage(args: {
399
410
  thread_ts: message.threadTs,
400
411
  event_id: args.eventId,
401
412
  });
413
+ if (args.propagateHandlerErrors === true) {
414
+ throw error;
415
+ }
402
416
  return;
403
417
  }
404
418
  if (decision === null || decision === undefined) {
@@ -527,6 +541,19 @@ export async function dispatchInboundMessage(args: {
527
541
 
528
542
  try {
529
543
  const session = await args.send(prompt, sendOptions);
544
+ if (isDeferredChannelSession(session)) {
545
+ // Hosted admission captured the send; the control plane allocates
546
+ // the session and runs the turn only after this delivery is
547
+ // acknowledged, so there is nothing to observe or coalesce yet.
548
+ log.info("session send captured (hosted admission)", {
549
+ kind,
550
+ continuation,
551
+ channel: message.channelId,
552
+ thread_ts: message.threadTs,
553
+ event_id: args.eventId,
554
+ });
555
+ return;
556
+ }
530
557
  log.info(
531
558
  session.coalesced === true ? "session coalesced" : "session start",
532
559
  {
@@ -659,6 +686,7 @@ export function dispatchInboundFromEventBody(
659
686
  kind: "app_mention",
660
687
  message: mention,
661
688
  handler: deps.onAppMention,
689
+ propagateHandlerErrors: deps.propagateHandlerErrors,
662
690
  send: deps.send,
663
691
  credentials: deps.credentials,
664
692
  host: deps.host,
@@ -702,6 +730,7 @@ export function dispatchInboundFromEventBody(
702
730
  kind: "direct_message",
703
731
  message: dm,
704
732
  handler: deps.onDirectMessage,
733
+ propagateHandlerErrors: deps.propagateHandlerErrors,
705
734
  send: deps.send,
706
735
  credentials: deps.credentials,
707
736
  host: deps.host,
@@ -739,6 +768,7 @@ export function dispatchInboundFromEventBody(
739
768
  kind: "reaction_added",
740
769
  message: reaction,
741
770
  handler: deps.onReactionAdded,
771
+ propagateHandlerErrors: deps.propagateHandlerErrors,
742
772
  send: deps.send,
743
773
  credentials: deps.credentials,
744
774
  host: deps.host,
@@ -1,17 +1,29 @@
1
1
  /**
2
- * `slackChannel()` — platform channel pack for Slack (Socket Mode).
2
+ * `slackChannel()` — platform channel pack for Slack.
3
3
  *
4
- * Inbound events arrive over a WebSocket (`SLACK_APP_TOKEN`); no public
5
- * Request URL or Events HTTP route is required. When `toolApprovals`
6
- * is enabled, Approve/Deny buttons arrive as Socket Mode `interactive`
7
- * envelopes.
4
+ * Local / self-hosted transport is Socket Mode: inbound events arrive over
5
+ * a WebSocket (`SLACK_APP_TOKEN`); no public Request URL or Events HTTP
6
+ * route is required. When `toolApprovals` is enabled, Approve/Deny buttons
7
+ * arrive as Socket Mode `interactive` envelopes.
8
+ *
9
+ * Hosted v2 transport is the control plane's Events API ingest: the CP
10
+ * verifies the managed app's signature, fans out on the declared
11
+ * `slackEventTypes` (`app_mention`, `message`), and delivers the full
12
+ * `event_callback` body through hosted admission — the attached adapter
13
+ * routes it through the same inbound dispatch as Socket Mode. Without an
14
+ * app token the socket transport idles, so a hosted pod never needs one.
8
15
  */
9
16
 
10
17
  import { allowAll, defineChannel } from "../../channels.js";
18
+ import {
19
+ skipped,
20
+ withPropagatingBackgroundErrors,
21
+ } from "../../internal/channel-dispatch.js";
11
22
  import {
12
23
  continuationSource,
13
24
  normalizeIdentity,
14
25
  } from "../../internal/continuation-identity.js";
26
+ import { attachHostedAdmissionAdapter } from "../../internal/hosted-admission-adapter.js";
15
27
  import type {
16
28
  ArtifactsApi,
17
29
  ChannelDefinition,
@@ -51,7 +63,7 @@ import {
51
63
  emptySlackChannelState,
52
64
  type SlackInboundDispatchDeps,
53
65
  } from "./dispatch.js";
54
- import { createEventIdDedupe } from "./event-id-dedupe.js";
66
+ import { createEventIdDedupe, type EventIdDedupe } from "./event-id-dedupe.js";
55
67
  import {
56
68
  dispatchBlockAction,
57
69
  dispatchInteractiveFromPayload,
@@ -159,6 +171,18 @@ export function slackChannel(
159
171
  normalizeBotMentionAllowlist(botMentions.allowFrom);
160
172
  }
161
173
  const eventIds = createEventIdDedupe();
174
+ // Hosted v2 event capability, matching what the engagement flags can
175
+ // dispatch: mentions ride `app_mention`; DMs and watched channel posts
176
+ // both arrive as `message`. Membership of `slack.thread/v2` admits
177
+ // exactly these two, so `reaction_added` (hosted follow-up only inside
178
+ // an existing thread) is deliberately not declared.
179
+ const slackEventTypes: string[] = [];
180
+ if (mentionsEnabled) {
181
+ slackEventTypes.push("app_mention");
182
+ }
183
+ if (directMessagesEnabled || channelPosts !== undefined) {
184
+ slackEventTypes.push("message");
185
+ }
162
186
  const toolApprovals = options.toolApprovals === true;
163
187
  const interactivity = options.interactivity === true;
164
188
  const onBlockAction = options.onBlockAction;
@@ -201,6 +225,9 @@ export function slackChannel(
201
225
  waitUntil: (promise: Promise<unknown>) => void;
202
226
  host: HostContext;
203
227
  artifacts: ArtifactsApi;
228
+ /** Override the channel-level dedupe (hosted admission passes a fresh one). */
229
+ eventIds?: EventIdDedupe;
230
+ propagateHandlerErrors?: boolean;
204
231
  hasContinuationSession?: (continuationToken: string) => Promise<boolean>;
205
232
  isContinuationBusy?: (continuationToken: string) => Promise<boolean>;
206
233
  getContinuationLastBotMessageTs?: (
@@ -216,7 +243,8 @@ export function slackChannel(
216
243
  onDirectMessage,
217
244
  ...(onReactionAdded === undefined ? {} : { onReactionAdded }),
218
245
  credentials,
219
- eventIds,
246
+ eventIds: args.eventIds ?? eventIds,
247
+ propagateHandlerErrors: args.propagateHandlerErrors,
220
248
  host: args.host,
221
249
  artifacts: args.artifacts,
222
250
  log: getLog(),
@@ -253,6 +281,10 @@ export function slackChannel(
253
281
  routes: [],
254
282
  meta: {
255
283
  kind: "slack",
284
+ // Omitted (not empty) when nothing dispatches, so fanout never
285
+ // materializes a subscription with no event types.
286
+ slackEventTypes:
287
+ slackEventTypes.length === 0 ? undefined : slackEventTypes,
256
288
  ...(channelPosts === undefined
257
289
  ? {}
258
290
  : { slackChannelPosts: [...channelPosts.allow] }),
@@ -551,6 +583,36 @@ export function slackChannel(
551
583
  });
552
584
 
553
585
  slackChannelOptionsByDefinition.set(definition, options);
586
+ attachHostedAdmissionAdapter(definition, {
587
+ kind: "slack",
588
+ prepareArgs: withPropagatingBackgroundErrors,
589
+ // The payload is the full `event_callback` body the CP verified — the
590
+ // same shape Socket Mode unwraps — so it routes through the same
591
+ // inbound dispatch. Outcomes: a captured `send` overrides the fallback
592
+ // tag below, so `skipped` surfaces when the engagement rules declined
593
+ // (`not_engaged`) or no handler takes the shape (`not_dispatchable`);
594
+ // a throwing handler rejects `waitUntil` (propagateHandlerErrors) and
595
+ // hosted admission answers a retryable 503, like the PR adapters.
596
+ // The channel-level event_id dedupe is deliberately bypassed with a
597
+ // fresh instance per delivery: the control plane's app-scoped ingress
598
+ // claim already dedupes Slack retries, and on a warm pod the local set
599
+ // would otherwise swallow the control plane's own retry of a delivery
600
+ // that failed after the id was marked handled.
601
+ dispatch: async ({ payload, args }) => {
602
+ const dispatched = dispatchInboundFromEventBody(
603
+ payload,
604
+ inboundDeps({
605
+ send: args.send,
606
+ waitUntil: args.waitUntil,
607
+ host: args.host,
608
+ artifacts: args.artifacts,
609
+ eventIds: createEventIdDedupe(),
610
+ propagateHandlerErrors: true,
611
+ })
612
+ );
613
+ return skipped(dispatched ? "not_engaged" : "not_dispatchable");
614
+ },
615
+ });
554
616
 
555
617
  return definition;
556
618
  }
package/src/extensions.ts CHANGED
@@ -4,8 +4,8 @@
4
4
  * An extension is a directory laid out like `agent/`: `extension.ts`
5
5
  * declares it; `tools/`, `skills/`, `mcp-connections/`,
6
6
  * `host-connections/`, `hooks/`, `channels/`, `schedules/`,
7
- * `subagents/`, `instructions`, `ab.ts` / `ab/`, `artifacts.ts`,
8
- * and `sandbox/workspace/` are its contributions. `lib/` holds
7
+ * `subagents/`, `instructions`, `artifacts.ts`, and
8
+ * `sandbox/workspace/` are its contributions. `lib/` holds
9
9
  * shared code.
10
10
  *
11
11
  * ```ts
@@ -162,10 +162,6 @@ export function disableInstructions(): DisabledDefinition {
162
162
  return disable();
163
163
  }
164
164
 
165
- export function disableAB(): DisabledDefinition {
166
- return disable();
167
- }
168
-
169
165
  export function disableArtifacts(): DisabledDefinition {
170
166
  return disable();
171
167
  }
package/src/index.ts CHANGED
@@ -31,7 +31,6 @@ import type {
31
31
  ServeOptions,
32
32
  } from "./types.js";
33
33
 
34
- export { defineAB } from "./ab.js";
35
34
  export { defineArtifacts } from "./artifacts.js";
36
35
  // Authoring helpers (also available on their focused subpath exports).
37
36
  export {
@@ -55,7 +54,6 @@ export {
55
54
  cursorPlugin,
56
55
  defineExtension,
57
56
  disable,
58
- disableAB,
59
57
  disableArtifacts,
60
58
  disableChannel,
61
59
  disableConnection,
@@ -190,7 +188,6 @@ export { defineSkill } from "./skills.js";
190
188
  export type {
191
189
  DurableSessionRecord,
192
190
  DurableSessionSummary,
193
- StorageABTable,
194
191
  StorageCasTable,
195
192
  StorageConfig,
196
193
  StorageContext,
@@ -20,10 +20,16 @@
20
20
  // Null-prototype copies so specifiers like "constructor" or "__proto__"
21
21
  // can never resolve to inherited Object.prototype members.
22
22
  let directAliases = toNullProtoMap({});
23
+ let sourceFallbackAliases = toNullProtoMap({});
23
24
  let sourceTreeFallbackParentURL: string | undefined;
24
25
 
25
26
  export interface AuthoredAliasHookData {
26
27
  directAliases: Record<string, string>;
28
+ /**
29
+ * Framework exports omitted from the running distribution. Resolve these
30
+ * against an authored project's `anysphere-source` package condition.
31
+ */
32
+ sourceFallbackAliases?: string[];
27
33
  /**
28
34
  * `file:` URL of the running `@cursor/july` package.json. Bare imports
29
35
  * from monorepo `packages/agent-serve/` source retry against this parent
@@ -40,6 +46,11 @@ function toNullProtoMap(
40
46
 
41
47
  export function initialize(data: AuthoredAliasHookData): void {
42
48
  directAliases = toNullProtoMap(data.directAliases);
49
+ sourceFallbackAliases = toNullProtoMap(
50
+ Object.fromEntries(
51
+ (data.sourceFallbackAliases ?? []).map((specifier) => [specifier, "1"])
52
+ )
53
+ );
43
54
  const parent = data.sourceTreeFallbackParentURL;
44
55
  sourceTreeFallbackParentURL =
45
56
  typeof parent === "string" && parent !== "" ? parent : undefined;
@@ -65,6 +76,9 @@ export function resolve(
65
76
  if (direct !== undefined) {
66
77
  return { url: direct, shortCircuit: true };
67
78
  }
79
+ if (sourceFallbackAliases[specifier] !== undefined) {
80
+ return nextResolve(specifier, withCondition(context, "anysphere-source"));
81
+ }
68
82
  if (
69
83
  sourceTreeFallbackParentURL !== undefined &&
70
84
  isBarePackageSpecifier(specifier) &&
@@ -95,6 +109,24 @@ function withParentURL(context: unknown, parentURL: string): unknown {
95
109
  return { parentURL };
96
110
  }
97
111
 
112
+ function withCondition(context: unknown, condition: string): unknown {
113
+ const record =
114
+ context !== null && typeof context === "object"
115
+ ? (context as Record<string, unknown>)
116
+ : {};
117
+ const conditions = Array.isArray(record["conditions"])
118
+ ? record["conditions"].filter(
119
+ (value): value is string => typeof value === "string"
120
+ )
121
+ : [];
122
+ return {
123
+ ...record,
124
+ conditions: conditions.includes(condition)
125
+ ? conditions
126
+ : [...conditions, condition],
127
+ };
128
+ }
129
+
98
130
  function isBarePackageSpecifier(specifier: string): boolean {
99
131
  if (specifier.length === 0) {
100
132
  return false;
@@ -18,10 +18,11 @@
18
18
  * tsconfig paths already cover them.
19
19
  */
20
20
 
21
+ import { existsSync } from "node:fs";
21
22
  import { stat } from "node:fs/promises";
22
23
  import { register as registerModuleHooks } from "node:module";
23
24
  import { join } from "node:path";
24
- import { pathToFileURL } from "node:url";
25
+ import { fileURLToPath, pathToFileURL } from "node:url";
25
26
  import type { AuthoredAliasHookData } from "./authored-alias-hooks.js";
26
27
  import {
27
28
  CLI_COMMAND_NAME,
@@ -61,6 +62,22 @@ export function authoredModuleSpecifier(
61
62
  return url.href;
62
63
  }
63
64
 
65
+ export function partitionFrameworkAliases(aliases: Record<string, string>): {
66
+ directAliases: Record<string, string>;
67
+ sourceFallbackAliases: string[];
68
+ } {
69
+ const directAliases: Record<string, string> = {};
70
+ const sourceFallbackAliases: string[] = [];
71
+ for (const [specifier, url] of Object.entries(aliases)) {
72
+ if (existsSync(fileURLToPath(url))) {
73
+ directAliases[specifier] = url;
74
+ } else {
75
+ sourceFallbackAliases.push(specifier);
76
+ }
77
+ }
78
+ return { directAliases, sourceFallbackAliases };
79
+ }
80
+
64
81
  /**
65
82
  * Dynamically import an authored TypeScript/JavaScript module, re-reading it
66
83
  * from disk when the file's mtime has changed since the last import.
@@ -165,8 +182,15 @@ function registerFrameworkAliases(): void {
165
182
  return;
166
183
  }
167
184
  const hooksUrl = new URL("./authored-alias-hooks.js", import.meta.url);
185
+ const { directAliases, sourceFallbackAliases } = partitionFrameworkAliases(
186
+ frameworkAliases()
187
+ );
168
188
  const data: AuthoredAliasHookData = {
169
- directAliases: frameworkAliases(),
189
+ directAliases,
190
+ // Internal-only exports stay out of the public package. When one is
191
+ // mounted by an agent in this source checkout, resolve that one import
192
+ // through the checkout's `anysphere-source` export instead.
193
+ sourceFallbackAliases,
170
194
  // Hosted factory agents relative-import this package's src/ from a
171
195
  // monorepo checkout while npm install ran only in the agent directory.
172
196
  // Bare specifiers from that tree retry against this package.json.
@@ -3,8 +3,7 @@
3
3
  * init / run / trajectory / eval
4
4
  *
5
5
  * Coding agents get JSON-first output, ephemeral local servers, and
6
- * filesystem-first evals under evals/ (*.eval.ts). Live A/B metrics
7
- * (`defineAB` under `agent/ab`) plug into serve — there is no `ab` CLI.
6
+ * filesystem-first evals under evals/ (*.eval.ts).
8
7
  */
9
8
 
10
9
  import { mkdir, mkdtemp, writeFile } from "node:fs/promises";
@@ -222,7 +222,8 @@ export function channelDeclaredEventTypes(
222
222
  meta?.gitlabWebhookEvents ??
223
223
  meta?.bitbucketWebhookEvents ??
224
224
  meta?.deploymentEventTypes ??
225
- meta?.factoryEventTypes
225
+ meta?.factoryEventTypes ??
226
+ meta?.slackEventTypes
226
227
  );
227
228
  }
228
229
 
@@ -787,14 +787,22 @@ function extractSlack(payload: unknown): string | undefined {
787
787
  if (record === undefined) {
788
788
  return undefined;
789
789
  }
790
+ // Events-API deliveries are the full event_callback body, so the
791
+ // identity fields live under `event`. Top-level fields still win for
792
+ // pre-flattened payloads (Socket Mode local dev, tests). Keep in
793
+ // lockstep with the control-plane twin (SlackThreadExtractor).
794
+ const event = asRecord(record.event);
790
795
  const channelId =
791
796
  nonEmpty(record.channelId) ??
792
797
  nonEmpty(record.channel_id) ??
793
- nonEmpty(record.channel);
798
+ nonEmpty(record.channel) ??
799
+ nonEmpty(event?.channel);
794
800
  const threadTs =
795
801
  nonEmpty(record.threadTs) ??
796
802
  nonEmpty(record.thread_ts) ??
797
- nonEmpty(record.ts);
803
+ nonEmpty(event?.thread_ts) ??
804
+ nonEmpty(record.ts) ??
805
+ nonEmpty(event?.ts);
798
806
  if (channelId === undefined || threadTs === undefined) {
799
807
  return undefined;
800
808
  }
@@ -12,7 +12,6 @@ import {
12
12
  import {
13
13
  type ArtifactsDefinition,
14
14
  DEFAULT_MODEL,
15
- type DiscoveredAB,
16
15
  type DiscoveredChannel,
17
16
  type DiscoveredHook,
18
17
  type DiscoveredSchedule,
@@ -50,7 +49,7 @@ export interface LoadedRootAgent {
50
49
  agent: ResolvedAgent;
51
50
  projectSlots: Pick<
52
51
  ExtensionContributions,
53
- "hooks" | "channels" | "schedules" | "abs" | "artifacts"
52
+ "hooks" | "channels" | "schedules" | "artifacts"
54
53
  >;
55
54
  }
56
55
 
@@ -66,7 +65,6 @@ export async function loadAgent(
66
65
  hooks: [],
67
66
  channels: [],
68
67
  schedules: [],
69
- abs: [],
70
68
  artifacts: undefined,
71
69
  },
72
70
  };
@@ -92,7 +90,6 @@ export async function loadAgent(
92
90
  const hooks: DiscoveredHook[] = [];
93
91
  const channels: DiscoveredChannel[] = [];
94
92
  const schedules: DiscoveredSchedule[] = [];
95
- const abs: DiscoveredAB[] = [];
96
93
  const instructionParts: string[] = [];
97
94
  const contributions = {
98
95
  tools,
@@ -105,7 +102,6 @@ export async function loadAgent(
105
102
  schedules,
106
103
  instructionParts,
107
104
  seedFiles,
108
- abs,
109
105
  artifacts: undefined as ArtifactsDefinition | undefined,
110
106
  };
111
107
  const extensions = await appendExtensions(
@@ -351,7 +347,6 @@ export async function loadAgent(
351
347
  hooks,
352
348
  channels,
353
349
  schedules,
354
- abs,
355
350
  artifacts: contributions.artifacts,
356
351
  },
357
352
  };
@@ -374,7 +369,6 @@ export async function warnUnknownSlots(
374
369
  "schedules",
375
370
  "reminders",
376
371
  "hooks",
377
- "ab",
378
372
  "sandbox",
379
373
  "lib",
380
374
  // Vite playground custom tool chips (agent/playground/tools).
@@ -6,7 +6,6 @@
6
6
  import { join } from "node:path";
7
7
  import type {
8
8
  ArtifactsDefinition,
9
- DiscoveredAB,
10
9
  DiscoveredChannel,
11
10
  DiscoveredHook,
12
11
  DiscoveredSchedule,
@@ -14,7 +13,6 @@ import type {
14
13
  ResolvedAgent,
15
14
  } from "../../types.js";
16
15
  import { getDefinitionKind } from "../brand.js";
17
- import { loadABs } from "./ab.js";
18
16
  import { loadChannels } from "./channels.js";
19
17
  import { type DiscoveryContext, displayPath, errorMessage } from "./context.js";
20
18
  import {
@@ -202,22 +200,6 @@ export async function overlayInstructionsFragment(
202
200
  return loadInstructions(ctx, overlayDir, undefined, false);
203
201
  }
204
202
 
205
- export async function overlayAbs(
206
- ctx: DiscoveryContext,
207
- site: OverlaySite,
208
- contributed: Map<string, DiscoveredAB>,
209
- overlayDir: string
210
- ): Promise<void> {
211
- const loaded = await loadABs(ctx, overlayDir, (source, path) => {
212
- if (!contributed.delete(source)) {
213
- unknownContribution(ctx, path, "disableAB", source, site.ns);
214
- }
215
- });
216
- for (const experiment of loaded) {
217
- contributed.set(experiment.source ?? experiment.name, experiment);
218
- }
219
- }
220
-
221
203
  export async function overlayArtifacts(
222
204
  ctx: DiscoveryContext,
223
205
  overlayDir: string,