@cursor/july 0.1.96 → 0.1.99

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 (381) hide show
  1. package/AGENTS.md +1 -1
  2. package/README.md +3 -2
  3. package/dist/bin/agent-serve.js +13 -3
  4. package/dist/channels/github/github-channel.d.ts.map +1 -1
  5. package/dist/channels/github/github-channel.js +16 -0
  6. package/dist/channels/origin/api.d.ts +15 -4
  7. package/dist/channels/origin/api.d.ts.map +1 -1
  8. package/dist/channels/origin/api.js +19 -3
  9. package/dist/channels/origin/binding.d.ts +11 -0
  10. package/dist/channels/origin/binding.d.ts.map +1 -1
  11. package/dist/channels/origin/binding.js +41 -25
  12. package/dist/channels/origin/index.d.ts +1 -0
  13. package/dist/channels/origin/index.d.ts.map +1 -1
  14. package/dist/channels/origin/index.js +1 -0
  15. package/dist/channels/origin/origin-channel.d.ts +2 -0
  16. package/dist/channels/origin/origin-channel.d.ts.map +1 -1
  17. package/dist/channels/origin/origin-channel.js +40 -4
  18. package/dist/channels/origin/reactions.d.ts +56 -0
  19. package/dist/channels/origin/reactions.d.ts.map +1 -0
  20. package/dist/channels/origin/reactions.js +67 -0
  21. package/dist/channels/origin/types.d.ts +11 -0
  22. package/dist/channels/origin/types.d.ts.map +1 -1
  23. package/dist/channels/slack/approvals.d.ts +16 -0
  24. package/dist/channels/slack/approvals.d.ts.map +1 -1
  25. package/dist/channels/slack/approvals.js +86 -0
  26. package/dist/channels/slack/cli-project.d.ts +19 -0
  27. package/dist/channels/slack/cli-project.d.ts.map +1 -0
  28. package/dist/channels/slack/cli-project.js +234 -0
  29. package/dist/channels/slack/defaults.d.ts.map +1 -1
  30. package/dist/channels/slack/defaults.js +142 -63
  31. package/dist/channels/slack/dispatch.d.ts.map +1 -1
  32. package/dist/channels/slack/dispatch.js +1 -1
  33. package/dist/channels/slack/init.d.ts +3 -2
  34. package/dist/channels/slack/init.d.ts.map +1 -1
  35. package/dist/channels/slack/init.js +5 -5
  36. package/dist/channels/slack/interactive.d.ts +2 -1
  37. package/dist/channels/slack/interactive.d.ts.map +1 -1
  38. package/dist/channels/slack/interactive.js +15 -4
  39. package/dist/channels/slack/live-delivery.d.ts +1 -1
  40. package/dist/channels/slack/live-delivery.d.ts.map +1 -1
  41. package/dist/channels/slack/live-delivery.js +4 -2
  42. package/dist/channels/slack/manifest.d.ts +1 -1
  43. package/dist/channels/slack/manifest.js +1 -1
  44. package/dist/channels/slack/progress-delivery.d.ts +28 -0
  45. package/dist/channels/slack/progress-delivery.d.ts.map +1 -0
  46. package/dist/channels/slack/progress-delivery.js +115 -0
  47. package/dist/channels/slack/setup.d.ts +1 -1
  48. package/dist/channels/slack/setup.d.ts.map +1 -1
  49. package/dist/channels/slack/setup.js +10 -6
  50. package/dist/channels/slack/slack-channel.d.ts.map +1 -1
  51. package/dist/channels/slack/slack-channel.js +1 -0
  52. package/dist/channels/slack/tool-approval-events.d.ts.map +1 -1
  53. package/dist/channels/slack/tool-approval-events.js +91 -1
  54. package/dist/channels/slack/types.d.ts +9 -1
  55. package/dist/channels/slack/types.d.ts.map +1 -1
  56. package/dist/docs/404.html +2 -2
  57. package/dist/docs/ab.html +4 -4
  58. package/dist/docs/assets/{app.jXleCmOc.js → app.BplEAZ3S.js} +1 -1
  59. package/dist/docs/assets/chunks/@localSearchIndexroot.DpuI4i7Z.js +1 -0
  60. package/dist/docs/assets/chunks/{VPLocalSearchBox.8LhyglIT.js → VPLocalSearchBox.CHXyv4wP.js} +1 -1
  61. package/dist/docs/assets/chunks/{theme.9ged-pr2.js → theme.BTcsZmjQ.js} +2 -2
  62. package/dist/docs/assets/{deployment.md.D9msOFOW.js → deployment.md.MFPKqsqI.js} +2 -2
  63. package/dist/docs/assets/{guides_mcp-oauth.md.DPYmBCbV.js → guides_mcp-oauth.md.CN-6YmTJ.js} +4 -4
  64. package/dist/docs/assets/{guides_mcp-oauth.md.DPYmBCbV.lean.js → guides_mcp-oauth.md.CN-6YmTJ.lean.js} +1 -1
  65. package/dist/docs/assets/guides_slack.md.VDXQV3ja.js +22 -0
  66. package/dist/docs/assets/guides_slack.md.VDXQV3ja.lean.js +1 -0
  67. package/dist/docs/assets/index.md.CVeRUOeZ.js +5 -0
  68. package/dist/docs/assets/{reference_agent-config.md.Cp_x38Nl.js → reference_agent-config.md.BHeYMgme.js} +1 -1
  69. package/dist/docs/assets/{reference_cli.md.CCnG-nJx.js → reference_cli.md.DfoeyvL0.js} +9 -6
  70. package/dist/docs/assets/{reference_cli.md.CCnG-nJx.lean.js → reference_cli.md.DfoeyvL0.lean.js} +1 -1
  71. package/dist/docs/assets/{reference_connections.md.BH8Oc0D0.js → reference_connections.md.DxldvyIB.js} +4 -3
  72. package/dist/docs/assets/{reference_http-api.md.D89k1mdm.js → reference_http-api.md.BEJx9XVj.js} +2 -2
  73. package/dist/docs/assets/reference_sessions.md.NxFP_CAC.js +1 -0
  74. package/dist/docs/assets/{reference_tools.md.BHeXn2id.js → reference_tools.md.CvAHsdSp.js} +10 -2
  75. package/dist/docs/assets/{reference_tools.md.BHeXn2id.lean.js → reference_tools.md.CvAHsdSp.lean.js} +1 -1
  76. package/dist/docs/assets/templates_agents-md.md.CXSMZljE.js +2 -0
  77. package/dist/docs/assets/templates_agents-md.md.CXSMZljE.lean.js +1 -0
  78. package/dist/docs/assets/troubleshooting.md.DCiPBhYs.js +1 -0
  79. package/dist/docs/building-with-agents.html +4 -4
  80. package/dist/docs/concepts.html +4 -4
  81. package/dist/docs/deployment.html +7 -7
  82. package/dist/docs/deployment.md +5 -4
  83. package/dist/docs/design/runtime-abstraction.md +1757 -0
  84. package/dist/docs/evals.html +4 -4
  85. package/dist/docs/guides/agent-to-agent.html +4 -4
  86. package/dist/docs/guides/cloud-runtime.html +4 -4
  87. package/dist/docs/guides/convert-automation.html +4 -4
  88. package/dist/docs/guides/github.html +4 -4
  89. package/dist/docs/guides/human-in-the-loop.html +4 -4
  90. package/dist/docs/guides/mcp-oauth.html +8 -8
  91. package/dist/docs/guides/mcp-oauth.md +26 -8
  92. package/dist/docs/guides/opentelemetry.html +4 -4
  93. package/dist/docs/guides/slack.html +17 -33
  94. package/dist/docs/guides/slack.md +92 -201
  95. package/dist/docs/guides/webhooks.html +4 -4
  96. package/dist/docs/hashmap.json +1 -1
  97. package/dist/docs/hillclimbing.html +4 -4
  98. package/dist/docs/index.html +6 -6
  99. package/dist/docs/index.md +5 -3
  100. package/dist/docs/llms-full.txt +2065 -637
  101. package/dist/docs/llms.txt +3 -2
  102. package/dist/docs/quickstart.html +4 -4
  103. package/dist/docs/reference/agent-config.html +6 -6
  104. package/dist/docs/reference/agent-config.md +2 -2
  105. package/dist/docs/reference/artifacts.html +4 -4
  106. package/dist/docs/reference/channels.html +4 -4
  107. package/dist/docs/reference/cli.html +13 -10
  108. package/dist/docs/reference/cli.md +32 -16
  109. package/dist/docs/reference/connections.html +9 -8
  110. package/dist/docs/reference/connections.md +6 -3
  111. package/dist/docs/reference/hooks.html +4 -4
  112. package/dist/docs/reference/http-api.html +7 -7
  113. package/dist/docs/reference/http-api.md +3 -1
  114. package/dist/docs/reference/instructions.html +4 -4
  115. package/dist/docs/reference/playground.html +4 -4
  116. package/dist/docs/reference/project-layout.html +4 -4
  117. package/dist/docs/reference/prompt.html +4 -4
  118. package/dist/docs/reference/schedules.html +4 -4
  119. package/dist/docs/reference/sessions.html +5 -5
  120. package/dist/docs/reference/sessions.md +4 -2
  121. package/dist/docs/reference/skills.html +4 -4
  122. package/dist/docs/reference/subagents.html +4 -4
  123. package/dist/docs/reference/tools.html +15 -7
  124. package/dist/docs/reference/tools.md +34 -2
  125. package/dist/docs/scaffolding-agents.html +4 -4
  126. package/dist/docs/storage.html +4 -4
  127. package/dist/docs/templates/agentic-owners.html +4 -4
  128. package/dist/docs/templates/agents-md.html +28 -0
  129. package/dist/docs/templates/agents-md.md +105 -0
  130. package/dist/docs/templates/code-wiki.html +5 -5
  131. package/dist/docs/templates/demo.html +4 -4
  132. package/dist/docs/templates/pr-autofixer.html +4 -4
  133. package/dist/docs/templates/security-help.html +4 -4
  134. package/dist/docs/templates/security-reviewer.html +5 -5
  135. package/dist/docs/templates/triage.html +4 -4
  136. package/dist/docs/troubleshooting.html +5 -5
  137. package/dist/docs/troubleshooting.md +2 -2
  138. package/dist/evals/run-facts.d.ts.map +1 -1
  139. package/dist/evals/run-facts.js +27 -0
  140. package/dist/files-backends/cursor-hosted.d.ts +3 -2
  141. package/dist/files-backends/cursor-hosted.d.ts.map +1 -1
  142. package/dist/files-backends/cursor-hosted.js +3 -2
  143. package/dist/index.d.ts +1 -0
  144. package/dist/index.d.ts.map +1 -1
  145. package/dist/index.js +1 -0
  146. package/dist/internal/advertise-tools.d.ts.map +1 -1
  147. package/dist/internal/advertise-tools.js +15 -9
  148. package/dist/internal/approval-gate.d.ts +12 -13
  149. package/dist/internal/approval-gate.d.ts.map +1 -1
  150. package/dist/internal/approval-gate.js +16 -21
  151. package/dist/internal/as-of.d.ts +19 -0
  152. package/dist/internal/as-of.d.ts.map +1 -0
  153. package/dist/internal/as-of.js +82 -0
  154. package/dist/internal/chat-client.js +10 -0
  155. package/dist/internal/cli-deploy.d.ts +6 -0
  156. package/dist/internal/cli-deploy.d.ts.map +1 -1
  157. package/dist/internal/cli-deploy.js +149 -21
  158. package/dist/internal/cli-mcp-oauth.js +8 -18
  159. package/dist/internal/cli-slack-manual.d.ts +24 -2
  160. package/dist/internal/cli-slack-manual.d.ts.map +1 -1
  161. package/dist/internal/cli-slack-manual.js +251 -20
  162. package/dist/internal/cli-slack.d.ts +9 -2
  163. package/dist/internal/cli-slack.d.ts.map +1 -1
  164. package/dist/internal/cli-slack.js +29 -82
  165. package/dist/internal/cursor/account-mcp.d.ts +1 -0
  166. package/dist/internal/cursor/account-mcp.d.ts.map +1 -1
  167. package/dist/internal/cursor/account-mcp.js +17 -0
  168. package/dist/internal/cursor-agent-template.d.ts +1 -1
  169. package/dist/internal/cursor-agent-template.d.ts.map +1 -1
  170. package/dist/internal/cursor-agent-template.js +1 -0
  171. package/dist/internal/cursor-event-relay.d.ts.map +1 -1
  172. package/dist/internal/cursor-event-relay.js +5 -6
  173. package/dist/internal/deploy-client.d.ts +17 -0
  174. package/dist/internal/deploy-client.d.ts.map +1 -1
  175. package/dist/internal/deploy-client.js +31 -10
  176. package/dist/internal/env-file.d.ts +19 -0
  177. package/dist/internal/env-file.d.ts.map +1 -0
  178. package/dist/internal/env-file.js +90 -0
  179. package/dist/internal/framework-file-storage.d.ts +11 -17
  180. package/dist/internal/framework-file-storage.d.ts.map +1 -1
  181. package/dist/internal/framework-file-storage.js +17 -40
  182. package/dist/internal/framework-storage-selection.d.ts +13 -11
  183. package/dist/internal/framework-storage-selection.d.ts.map +1 -1
  184. package/dist/internal/framework-storage-selection.js +37 -26
  185. package/dist/internal/hosted-admission-adapter.d.ts +28 -0
  186. package/dist/internal/hosted-admission-adapter.d.ts.map +1 -0
  187. package/dist/internal/hosted-admission-adapter.js +7 -0
  188. package/dist/internal/hosted-delivery-protocol.d.ts +13 -1
  189. package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
  190. package/dist/internal/hosted-delivery-protocol.js +8 -1
  191. package/dist/internal/hosted-delivery.d.ts +21 -1
  192. package/dist/internal/hosted-delivery.d.ts.map +1 -1
  193. package/dist/internal/hosted-delivery.js +101 -34
  194. package/dist/internal/hosted-execution-diag.d.ts +59 -0
  195. package/dist/internal/hosted-execution-diag.d.ts.map +1 -0
  196. package/dist/internal/hosted-execution-diag.js +187 -0
  197. package/dist/internal/http-channel.d.ts.map +1 -1
  198. package/dist/internal/http-channel.js +85 -2
  199. package/dist/internal/init-project.d.ts.map +1 -1
  200. package/dist/internal/init-project.js +2 -0
  201. package/dist/internal/logs-client.d.ts +5 -0
  202. package/dist/internal/logs-client.d.ts.map +1 -1
  203. package/dist/internal/logs-client.js +5 -0
  204. package/dist/internal/mcp-endpoint.js +2 -3
  205. package/dist/internal/mcp-host.d.ts +10 -0
  206. package/dist/internal/mcp-host.d.ts.map +1 -1
  207. package/dist/internal/mcp-host.js +57 -8
  208. package/dist/internal/mcp-oauth-on-demand.d.ts +68 -0
  209. package/dist/internal/mcp-oauth-on-demand.d.ts.map +1 -0
  210. package/dist/internal/mcp-oauth-on-demand.js +287 -0
  211. package/dist/internal/mcp-oauth-persist.d.ts +42 -0
  212. package/dist/internal/mcp-oauth-persist.d.ts.map +1 -0
  213. package/dist/internal/mcp-oauth-persist.js +92 -0
  214. package/dist/internal/mcp-oauth.d.ts +1 -0
  215. package/dist/internal/mcp-oauth.d.ts.map +1 -1
  216. package/dist/internal/mcp-oauth.js +10 -2
  217. package/dist/internal/null-kv-storage.d.ts +48 -0
  218. package/dist/internal/null-kv-storage.d.ts.map +1 -0
  219. package/dist/internal/null-kv-storage.js +58 -0
  220. package/dist/internal/otel/collector.d.ts.map +1 -1
  221. package/dist/internal/otel/collector.js +22 -9
  222. package/dist/internal/server.d.ts +6 -0
  223. package/dist/internal/server.d.ts.map +1 -1
  224. package/dist/internal/server.js +123 -33
  225. package/dist/internal/session-engine.d.ts +88 -3
  226. package/dist/internal/session-engine.d.ts.map +1 -1
  227. package/dist/internal/session-engine.js +538 -46
  228. package/dist/internal/session-run-log.d.ts +120 -0
  229. package/dist/internal/session-run-log.d.ts.map +1 -0
  230. package/dist/internal/session-run-log.js +359 -0
  231. package/dist/internal/sessions-client.d.ts +9 -7
  232. package/dist/internal/sessions-client.d.ts.map +1 -1
  233. package/dist/internal/sessions-client.js +3 -1
  234. package/dist/internal/storage-coordinator.d.ts +13 -0
  235. package/dist/internal/storage-coordinator.d.ts.map +1 -1
  236. package/dist/internal/storage-coordinator.js +37 -6
  237. package/dist/internal/storage-roles.d.ts +5 -0
  238. package/dist/internal/storage-roles.d.ts.map +1 -1
  239. package/dist/internal/stream-progress.d.ts.map +1 -1
  240. package/dist/internal/stream-progress.js +10 -0
  241. package/dist/internal/tool-policy.d.ts +29 -9
  242. package/dist/internal/tool-policy.d.ts.map +1 -1
  243. package/dist/internal/tool-policy.js +24 -0
  244. package/dist/internal/trajectory.d.ts.map +1 -1
  245. package/dist/internal/trajectory.js +10 -0
  246. package/dist/internal/turn-outbox.d.ts +24 -0
  247. package/dist/internal/turn-outbox.d.ts.map +1 -0
  248. package/dist/internal/turn-outbox.js +80 -0
  249. package/dist/playground/assets/index-D7rGZNjy.css +1 -0
  250. package/dist/playground/assets/index-jzNbJENa.js +69 -0
  251. package/dist/playground/index.html +2 -2
  252. package/dist/storage-backends/cursor-hosted.d.ts +1 -1
  253. package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
  254. package/dist/storage-backends/cursor-hosted.js +12 -0
  255. package/dist/storage-protocol.d.ts +8 -0
  256. package/dist/storage-protocol.d.ts.map +1 -1
  257. package/dist/storage-protocol.js +8 -0
  258. package/dist/storage.d.ts +8 -0
  259. package/dist/storage.d.ts.map +1 -1
  260. package/dist/tools.d.ts +12 -2
  261. package/dist/tools.d.ts.map +1 -1
  262. package/dist/types.d.ts +88 -7
  263. package/dist/types.d.ts.map +1 -1
  264. package/docs/README.md +5 -3
  265. package/docs/deployment.md +5 -4
  266. package/docs/design/runtime-abstraction.md +1757 -0
  267. package/docs/guides/mcp-oauth.md +26 -8
  268. package/docs/guides/slack.md +93 -202
  269. package/docs/reference/agent-config.md +2 -2
  270. package/docs/reference/cli.md +32 -16
  271. package/docs/reference/connections.md +6 -3
  272. package/docs/reference/http-api.md +3 -1
  273. package/docs/reference/sessions.md +4 -2
  274. package/docs/reference/tools.md +34 -2
  275. package/docs/templates/agents-md.md +110 -0
  276. package/docs/troubleshooting.md +2 -2
  277. package/package.json +1 -1
  278. package/skills/create-agent/SKILL.md +2 -1
  279. package/skills/mcp-auth/SKILL.md +6 -3
  280. package/skills/setup-slack/SKILL.md +23 -13
  281. package/src/bin/agent-serve.ts +12 -1
  282. package/src/channels/github/github-channel.ts +17 -0
  283. package/src/channels/origin/api.ts +24 -5
  284. package/src/channels/origin/binding.ts +55 -26
  285. package/src/channels/origin/index.ts +1 -0
  286. package/src/channels/origin/origin-channel.ts +78 -10
  287. package/src/channels/origin/reactions.ts +82 -0
  288. package/src/channels/origin/types.ts +11 -0
  289. package/src/channels/slack/approvals.ts +105 -0
  290. package/src/channels/slack/cli-project.ts +267 -0
  291. package/src/channels/slack/defaults.ts +165 -74
  292. package/src/channels/slack/dispatch.ts +2 -0
  293. package/src/channels/slack/init.ts +10 -5
  294. package/src/channels/slack/interactive.ts +35 -9
  295. package/src/channels/slack/live-delivery.ts +5 -3
  296. package/src/channels/slack/manifest.ts +1 -1
  297. package/src/channels/slack/progress-delivery.ts +133 -0
  298. package/src/channels/slack/setup.ts +10 -6
  299. package/src/channels/slack/slack-channel.ts +1 -0
  300. package/src/channels/slack/tool-approval-events.ts +93 -0
  301. package/src/channels/slack/types.ts +9 -1
  302. package/src/evals/run-facts.ts +32 -0
  303. package/src/files-backends/cursor-hosted.ts +3 -2
  304. package/src/index.ts +4 -0
  305. package/src/internal/advertise-tools.ts +31 -10
  306. package/src/internal/approval-gate.ts +20 -29
  307. package/src/internal/as-of.ts +107 -0
  308. package/src/internal/chat-client.ts +19 -0
  309. package/src/internal/cli-deploy.ts +203 -13
  310. package/src/internal/cli-mcp-oauth.ts +7 -21
  311. package/src/internal/cli-slack-manual.ts +350 -18
  312. package/src/internal/cli-slack.ts +40 -84
  313. package/src/internal/cursor/account-mcp.ts +21 -0
  314. package/src/internal/cursor-agent-template.ts +1 -0
  315. package/src/internal/cursor-event-relay.ts +5 -6
  316. package/src/internal/deploy-client.ts +43 -0
  317. package/src/internal/env-file.ts +84 -0
  318. package/src/internal/framework-file-storage.ts +18 -46
  319. package/src/internal/framework-storage-selection.ts +41 -25
  320. package/src/internal/hosted-admission-adapter.ts +42 -0
  321. package/src/internal/hosted-delivery-protocol.ts +14 -2
  322. package/src/internal/hosted-delivery.ts +169 -44
  323. package/src/internal/hosted-execution-diag.ts +252 -0
  324. package/src/internal/http-channel.ts +107 -0
  325. package/src/internal/init-project.ts +2 -0
  326. package/src/internal/logs-client.ts +5 -0
  327. package/src/internal/mcp-endpoint.ts +13 -4
  328. package/src/internal/mcp-host.ts +77 -11
  329. package/src/internal/mcp-oauth-on-demand.ts +352 -0
  330. package/src/internal/mcp-oauth-persist.ts +127 -0
  331. package/src/internal/mcp-oauth.ts +17 -1
  332. package/src/internal/null-kv-storage.ts +74 -0
  333. package/src/internal/otel/collector.ts +30 -0
  334. package/src/internal/server.ts +159 -11
  335. package/src/internal/session-engine.ts +691 -57
  336. package/src/internal/session-run-log.ts +584 -0
  337. package/src/internal/sessions-client.ts +17 -8
  338. package/src/internal/storage-coordinator.ts +49 -9
  339. package/src/internal/storage-roles.ts +7 -0
  340. package/src/internal/stream-progress.ts +19 -0
  341. package/src/internal/tool-policy.ts +49 -9
  342. package/src/internal/trajectory.ts +10 -0
  343. package/src/internal/turn-outbox.ts +85 -0
  344. package/src/storage-backends/cursor-hosted.ts +13 -1
  345. package/src/storage-protocol.ts +10 -0
  346. package/src/storage.ts +12 -0
  347. package/src/tools.ts +12 -2
  348. package/src/types.ts +93 -8
  349. package/templates/agents-md/README.md +39 -0
  350. package/templates/agents-md/agent/agent.ts +8 -0
  351. package/templates/agents-md/agent/channels/github.ts +10 -0
  352. package/templates/agents-md/agent/channels/queue.ts +28 -0
  353. package/templates/agents-md/agent/channels/slack.ts +9 -0
  354. package/templates/agents-md/agent/instructions.md +39 -0
  355. package/templates/agents-md/agent/lib/collect.ts +439 -0
  356. package/templates/agents-md/agent/lib/config.ts +8 -0
  357. package/templates/agents-md/agent/lib/paths.ts +51 -0
  358. package/templates/agents-md/agent/schedules/weekly.ts +17 -0
  359. package/templates/agents-md/agent/tools/apply_agents.ts +226 -0
  360. package/templates/agents-md/evals/agents.eval.ts +135 -0
  361. package/templates/agents-md/evals/evals.config.ts +5 -0
  362. package/templates/agents-md/init.json +38 -0
  363. package/templates/agents-md/package.json +18 -0
  364. package/templates/agents-md/tsconfig.json +12 -0
  365. package/dist/docs/assets/chunks/@localSearchIndexroot.DFoGuETX.js +0 -1
  366. package/dist/docs/assets/guides_slack.md.C32HsdKk.js +0 -38
  367. package/dist/docs/assets/guides_slack.md.C32HsdKk.lean.js +0 -1
  368. package/dist/docs/assets/index.md.CI93Ltlb.js +0 -5
  369. package/dist/docs/assets/reference_sessions.md.D0mIh4KK.js +0 -1
  370. package/dist/docs/assets/troubleshooting.md.Ctv3T8C2.js +0 -1
  371. package/dist/docs/design/agsh.md +0 -406
  372. package/dist/playground/assets/index-B1DDvBeC.css +0 -1
  373. package/dist/playground/assets/index-Cx9CclK_.js +0 -88
  374. package/docs/design/agsh.md +0 -406
  375. /package/dist/docs/assets/{deployment.md.D9msOFOW.lean.js → deployment.md.MFPKqsqI.lean.js} +0 -0
  376. /package/dist/docs/assets/{index.md.CI93Ltlb.lean.js → index.md.CVeRUOeZ.lean.js} +0 -0
  377. /package/dist/docs/assets/{reference_agent-config.md.Cp_x38Nl.lean.js → reference_agent-config.md.BHeYMgme.lean.js} +0 -0
  378. /package/dist/docs/assets/{reference_connections.md.BH8Oc0D0.lean.js → reference_connections.md.DxldvyIB.lean.js} +0 -0
  379. /package/dist/docs/assets/{reference_http-api.md.D89k1mdm.lean.js → reference_http-api.md.BEJx9XVj.lean.js} +0 -0
  380. /package/dist/docs/assets/{reference_sessions.md.D0mIh4KK.lean.js → reference_sessions.md.NxFP_CAC.lean.js} +0 -0
  381. /package/dist/docs/assets/{troubleshooting.md.Ctv3T8C2.lean.js → troubleshooting.md.DCiPBhYs.lean.js} +0 -0
package/AGENTS.md CHANGED
@@ -52,7 +52,7 @@ which reads these files. Open them directly. There are no
52
52
 
53
53
  Hosted-platform debug (stopped / slow start / health-fail, Datadog
54
54
  `cursor.agent_serve.*`) is the monorepo skill
55
- `.cursor/skills/debugging/debug-agent-serve-deployment/SKILL.md` — it does
55
+ `.cursor/skills/debugging/debug-agentsdk-deployment/SKILL.md` — it does
56
56
  not ship with `@cursor/july`. Dual-pod alerts:
57
57
  `docs/agent-serve/orphan-engines-runbook.md`.
58
58
 
package/README.md CHANGED
@@ -620,8 +620,9 @@ info and materialized workspace, and the call is recorded on the
620
620
  session's event stream as `actions.requested` / `action.result` under a
621
621
  per-call `turnId`. That call is visible in the playground, NDJSON
622
622
  trace, and trajectories like any model-initiated call. Session-bound
623
- calls are serialized with model turns: while a turn is running the call
624
- is rejected with `409 session_busy`.
623
+ writes are serialized with model turns: while a turn is running a
624
+ write-effect call is rejected with `409 session_busy`, while a
625
+ read-effect call runs alongside the turn.
625
626
 
626
627
  Unknown tools are rejected with the available tool names, `execution:
627
628
  "agent"` tools cannot be called on the host (400), schema-invalid input is a
@@ -37,6 +37,7 @@ import { cmdManifest } from "../internal/cli-manifest.js";
37
37
  import { CLI_COMMAND_NAME as CLI, formatCliVersion, PACKAGE_NAME, packageVersion, } from "../internal/distribution.js";
38
38
  import { loadAgentLocalEnv } from "../internal/local-env.js";
39
39
  import { ENTER_RESTART_EXIT_CODE, isServeRestartWorker, runEnterRestartSupervisor, } from "../internal/serve-restart.js";
40
+ import { flushSessionRunFatal } from "../internal/session-run-log.js";
40
41
  import { clearTerminal, stdoutPalette } from "../internal/terminal-style.js";
41
42
  import { cmdUpdate, warnIfOutdated } from "../internal/update-check.js";
42
43
  const HELP = `${CLI} — serve a filesystem-defined Cursor agent over channels
@@ -403,6 +404,8 @@ Options:
403
404
  GITHUB_WEBHOOK_SECRET). github: --events overrides the
404
405
  derived webhook event list.
405
406
  --install github: install the cli/gh-webhook extension if missing.
407
+ slack init --manual: require Slack CLI app install.
408
+ --no-install slack init --manual: skip Slack CLI app install.
406
409
  --action github replay: event action (e.g. opened, synchronize).
407
410
  --conclusion github replay: CI conclusion (check_run/suite/status).
408
411
  --comment github replay: comment body for comment events.
@@ -517,6 +520,7 @@ function main(argv) {
517
520
  secret: { type: "string" },
518
521
  channel: { type: "string", multiple: true },
519
522
  install: { type: "boolean", default: false },
523
+ "no-install": { type: "boolean", default: false },
520
524
  action: { type: "string" },
521
525
  conclusion: { type: "string" },
522
526
  context: { type: "string" },
@@ -530,6 +534,8 @@ function main(argv) {
530
534
  all: { type: "boolean", default: false },
531
535
  "cursor-events-repo": { type: "string", multiple: true },
532
536
  "allow-domain": { type: "string", multiple: true },
537
+ // Hidden Anysphere-only flag; omitted from help.
538
+ "multi-tenant": { type: "boolean", default: false },
533
539
  "from-argv": { type: "boolean", default: false },
534
540
  strict: { type: "boolean", default: false },
535
541
  junit: { type: "string" },
@@ -577,6 +583,8 @@ function main(argv) {
577
583
  icon: values.icon,
578
584
  force: values.force,
579
585
  manual: values.manual,
586
+ install: values.install,
587
+ noInstall: values["no-install"],
580
588
  iconSource: positionals[0] === "icon" ? positionals[1] : undefined,
581
589
  });
582
590
  }
@@ -684,11 +692,11 @@ function main(argv) {
684
692
  // `--repo` is repeatable for `serve --cursor-events`; deploy targets a
685
693
  // single source repo, so the last one wins.
686
694
  const repo = (_c = values.repo) === null || _c === void 0 ? void 0 : _c.at(-1);
687
- return cmdDeploy(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, deployOptionsFromValues(values)), { dir }), (values.slug === undefined ? {} : { slug: values.slug })), { all: values.all === true }), (repo === undefined ? {} : { repo })), (values.ref === undefined ? {} : { ref: values.ref })), (values.path === undefined ? {} : { path: values.path })), (values["cursor-events-repo"] === undefined
695
+ return cmdDeploy(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, deployOptionsFromValues(values)), { dir }), (values.slug === undefined ? {} : { slug: values.slug })), { all: values.all === true }), (repo === undefined ? {} : { repo })), (values.ref === undefined ? {} : { ref: values.ref })), (values.path === undefined ? {} : { path: values.path })), (values["cursor-events-repo"] === undefined
688
696
  ? {}
689
697
  : { cursorEventsRepos: values["cursor-events-repo"] })), (values["allow-domain"] === undefined
690
698
  ? {}
691
- : { allowDomains: values["allow-domain"] })));
699
+ : { allowDomains: values["allow-domain"] })), { multiTenant: values["multi-tenant"] === true }));
692
700
  }
693
701
  case "manifest": {
694
702
  // Offline extraction of deploy metadata (events, egress, routes,
@@ -1436,7 +1444,9 @@ function installTransportErrorGuards() {
1436
1444
  return;
1437
1445
  }
1438
1446
  process.stderr.write(`[agent-sdk] uncaughtException: ${(_a = error.stack) !== null && _a !== void 0 ? _a : error.message}\n`);
1439
- process.exit(1);
1447
+ void flushSessionRunFatal(error).finally(() => {
1448
+ process.exit(1);
1449
+ });
1440
1450
  });
1441
1451
  }
1442
1452
  installTransportErrorGuards();
@@ -1 +1 @@
1
- {"version":3,"file":"github-channel.d.ts","sourceRoot":"","sources":["../../../src/channels/github/github-channel.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAGV,WAAW,EACX,iBAAiB,EAEjB,kBAAkB,EAGnB,MAAM,gBAAgB,CAAC;AAiBxB,OAAO,EAEL,KAAK,kBAAkB,EAExB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EACV,oBAAoB,EAKpB,aAAa,EAEb,qBAAqB,EAErB,kBAAkB,EAGlB,sBAAsB,EAMtB,kBAAkB,EAClB,UAAU,EAEX,MAAM,YAAY,CAAC;AAEpB;;;;GAIG;AACH,KAAK,mBAAmB,GAAG,IAAI,CAC7B,kBAAkB,EAClB,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,SAAS,CACvD,CAAC;AAqFF;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,mBAAmB,GAAG,WAAW,CA2BvE;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,mBAAmB,GAAG,MAAM,CAGtE;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC1C,GAAG,EAAE,MAAM,GACV,oBAAoB,GAAG,SAAS,CAUlC;AAED,wDAAwD;AACxD,wBAAgB,gCAAgC,CAC9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,EAAE,MAAM,GAAG,SAAS,GAC1B,OAAO,CAeT"}
1
+ {"version":3,"file":"github-channel.d.ts","sourceRoot":"","sources":["../../../src/channels/github/github-channel.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAGV,WAAW,EACX,iBAAiB,EAEjB,kBAAkB,EAGnB,MAAM,gBAAgB,CAAC;AAiBxB,OAAO,EAEL,KAAK,kBAAkB,EAExB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EACV,oBAAoB,EAKpB,aAAa,EAEb,qBAAqB,EAErB,kBAAkB,EAGlB,sBAAsB,EAMtB,kBAAkB,EAClB,UAAU,EAEX,MAAM,YAAY,CAAC;AAEpB;;;;GAIG;AACH,KAAK,mBAAmB,GAAG,IAAI,CAC7B,kBAAkB,EAClB,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,SAAS,CACvD,CAAC;AAqFF;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,mBAAmB,GAAG,WAAW,CA2BvE;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,mBAAmB,GAAG,MAAM,CAGtE;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC1C,GAAG,EAAE,MAAM,GACV,oBAAoB,GAAG,SAAS,CAUlC;AAED,wDAAwD;AACxD,wBAAgB,gCAAgC,CAC9C,GAAG,EAAE,mBAAmB,GACvB,MAAM,CAER;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,mBAAmB,GAAG,MAAM,CAEnE;AAED,qDAAqD;AACrD,wBAAgB,6BAA6B,CAC3C,GAAG,EAAE,mBAAmB,GACvB,MAAM,CAER;AAED,wBAAgB,+BAA+B,CAC7C,GAAG,EAAE,mBAAmB,EACxB,WAAW,EAAE,sBAAsB,GAClC,MA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MAAM,GAAG,MAAM,CAAC;AAe7D,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,QAAQ,GACjB,qBAAqB,GAAG,SAAS,CAEnC;AAQD,wBAAgB,qCAAqC,CACnD,IAAI,EAAE,kBAAkB,GACvB,kBAAkB,CAEpB;AAED,wBAAsB,qBAAqB,CAAC,KAAK,EAAE;IACjD,OAAO,EAAE,oBAAoB,CAAC;IAC9B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,kBAAkB,CAAC;CAC1B,GAAG,OAAO,CAAC,QAAQ,CAAC,CAEpB;AA2GD;;;GAGG;AACH,wBAAsB,0BAA0B,CAAC,KAAK,EAAE;IACtD,OAAO,EAAE,oBAAoB,CAAC;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,kBAAkB,CAAC;IACzB,mEAAmE;IACnE,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC,GAAG,OAAO,CAAC,QAAQ,CAAC,CA2CpB;AAQD;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,MAAM,GACjB,oBAAoB,GAAG,SAAS,CAElC;AAED,wBAAgB,aAAa,CAC3B,OAAO,GAAE,oBAAyB,GACjC,iBAAiB,CAAC,kBAAkB,CAAC,CA8HvC;AAg6BD,wEAAwE;AACxE,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,UAAU,GAAG,SAAS,EAC9B,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,OAAO,CAeT"}
@@ -13,6 +13,7 @@ import { allowAll, defineChannel, localDevStrict, loopbackGitHubDev, POST, } fro
13
13
  import { continuationSource, normalizeIdentity, } from "../../internal/continuation-identity.js";
14
14
  import { isDeferredChannelSession } from "../../internal/deferred-channel-session.js";
15
15
  import { isDevMode } from "../../internal/dev-mode.js";
16
+ import { attachHostedAdmissionAdapter } from "../../internal/hosted-admission-adapter.js";
16
17
  import { bindLocalIngressSend } from "../../internal/local-ingress.js";
17
18
  import { resolveCredentialValue } from "./auth.js";
18
19
  import { buildGitHubBinding, } from "./binding.js";
@@ -523,6 +524,21 @@ export function githubChannel(options = {}) {
523
524
  ],
524
525
  });
525
526
  githubChannelOptionsByDefinition.set(definition, channelOptions);
527
+ attachHostedAdmissionAdapter(definition, {
528
+ kind: GITHUB_CHANNEL_KIND,
529
+ prepareArgs: withPropagatingGitHubBackgroundErrors,
530
+ dispatch: ({ eventType, payload, deliveryId, args }) => dispatchGitHubWebhook({
531
+ options: channelOptions,
532
+ eventName: eventType,
533
+ payload,
534
+ deliveryId,
535
+ args,
536
+ }),
537
+ getOutcome: (response) => {
538
+ const outcome = getGitHubDispatchOutcome(response);
539
+ return outcome === "skip" || outcome === "task" ? outcome : undefined;
540
+ },
541
+ });
526
542
  if (cursorCredentials !== undefined) {
527
543
  registerGithubCursorAccountRuntime(definition, {
528
544
  options,
@@ -9,8 +9,8 @@
9
9
  * from options first, then the environment: `ORIGIN_APP_ID` (or
10
10
  * `AGENT_SERVE_ORIGIN_APP_ID`), `ORIGIN_APP_INSTALLATION_ID`,
11
11
  * `ORIGIN_APP_PRIVATE_KEY` (PKCS8 PEM for the app's Ed25519 key; literal
12
- * `\n` sequences are normalized), and `ORIGIN_API_BASE_URL` for the public
13
- * REST base.
12
+ * `\n` sequences are normalized), `ORIGIN_API_BASE_URL` for the public REST
13
+ * base, and `ORIGIN_RPC_BASE_URL` for the first-party ConnectRPC base.
14
14
  *
15
15
  * Hosted v2 forks configure none of that: their only credential is the
16
16
  * deployment service account's `CURSOR_API_KEY`, exchanged for a Cursor
@@ -26,6 +26,14 @@
26
26
  * `origin-webhook.ts`).
27
27
  */
28
28
  export declare const DEFAULT_ORIGIN_PUBLIC_API_BASE_URL = "https://api.cursor.com";
29
+ /**
30
+ * Origin's first-party ConnectRPC host (`origin.v1.OriginService`). Separate
31
+ * deployment from {@link DEFAULT_ORIGIN_PUBLIC_API_BASE_URL}: a handful of
32
+ * workflow operations — comment reactions among them — have no
33
+ * `/v1/origin/...` REST binding yet and are only reachable as Connect unary
34
+ * JSON here.
35
+ */
36
+ export declare const DEFAULT_ORIGIN_RPC_BASE_URL = "https://api.origin.cursor.com";
29
37
  export type OriginApiMethod = "DELETE" | "GET" | "PATCH" | "POST" | "PUT";
30
38
  /** Normalized Origin REST failure — the `GitHubApiError` analogue. */
31
39
  export declare class OriginApiError extends Error {
@@ -63,6 +71,8 @@ export declare function resolveOriginAppCredentialParts(env?: NodeJS.ProcessEnv)
63
71
  export declare function resolveOriginAppCredentials(env?: NodeJS.ProcessEnv): OriginAppCredentials | undefined;
64
72
  /** Public Origin REST base. Trailing slashes are stripped for path joins. */
65
73
  export declare function originPublicApiBaseUrl(env?: NodeJS.ProcessEnv): string;
74
+ /** Origin ConnectRPC base. Trailing slashes are stripped for path joins. */
75
+ export declare function originRpcBaseUrl(env?: NodeJS.ProcessEnv): string;
66
76
  /**
67
77
  * Exchange endpoint for Cursor-account session tokens. Override with
68
78
  * `AGENT_SERVE_CURSOR_SESSION_EXCHANGE_URL`; defaults to the Cursor backend.
@@ -103,9 +113,10 @@ export interface OriginClientOptions {
103
113
  token?: string | OriginTokenProvider;
104
114
  /**
105
115
  * App credentials to mint installation tokens from. Defaults to the
106
- * environment ({@link resolveOriginAppCredentials}).
116
+ * environment ({@link resolveOriginAppCredentials}). Pass `false` to
117
+ * disable app credential lookup and force the Cursor-account exchange.
107
118
  */
108
- credentials?: OriginAppCredentials;
119
+ credentials?: OriginAppCredentials | false;
109
120
  /** Public Origin REST base. Defaults to `ORIGIN_API_BASE_URL` / prod. */
110
121
  apiBaseUrl?: string;
111
122
  /** Injectable fetch for tests. */
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/channels/origin/api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAcH;;;;GAIG;AACH,eAAO,MAA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EAAE,MAAM,CAAC;IACpB,kCAAkC;IAClC,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACrB;;;;;OAKG;IACH,qBAAqB,CAAC,EAClB,OAAO,GACP;QACE,SAAS,CAAC,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;QACrC,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;CACP;AAED,yEAAyE;AACzE,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,OAAO,CAAC,CAAC,GAAG,OAAO,EAAE,KAAK,EAAE;QAC1B,MAAM,EAAE,eAAe,CAAC;QACxB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,OAAO,CAAC;KAChB,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CAChB;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,GAAE,mBAAwB,GAChC,YAAY,CA6Gd"}
@@ -9,8 +9,8 @@
9
9
  * from options first, then the environment: `ORIGIN_APP_ID` (or
10
10
  * `AGENT_SERVE_ORIGIN_APP_ID`), `ORIGIN_APP_INSTALLATION_ID`,
11
11
  * `ORIGIN_APP_PRIVATE_KEY` (PKCS8 PEM for the app's Ed25519 key; literal
12
- * `\n` sequences are normalized), and `ORIGIN_API_BASE_URL` for the public
13
- * REST base.
12
+ * `\n` sequences are normalized), `ORIGIN_API_BASE_URL` for the public REST
13
+ * base, and `ORIGIN_RPC_BASE_URL` for the first-party ConnectRPC base.
14
14
  *
15
15
  * Hosted v2 forks configure none of that: their only credential is the
16
16
  * deployment service account's `CURSOR_API_KEY`, exchanged for a Cursor
@@ -39,6 +39,14 @@ import { CURSOR_SESSION_EXCHANGE_PATH, exchangeCursorApiKeyForSession, SESSION_T
39
39
  * `origin-webhook.ts`).
40
40
  */
41
41
  export const DEFAULT_ORIGIN_PUBLIC_API_BASE_URL = "https://api.cursor.com";
42
+ /**
43
+ * Origin's first-party ConnectRPC host (`origin.v1.OriginService`). Separate
44
+ * deployment from {@link DEFAULT_ORIGIN_PUBLIC_API_BASE_URL}: a handful of
45
+ * workflow operations — comment reactions among them — have no
46
+ * `/v1/origin/...` REST binding yet and are only reachable as Connect unary
47
+ * JSON here.
48
+ */
49
+ export const DEFAULT_ORIGIN_RPC_BASE_URL = "https://api.origin.cursor.com";
42
50
  /** Fixed audience for Origin app JWTs (`APP_TOKEN_AUDIENCE` backend-side). */
43
51
  const ORIGIN_APP_TOKEN_AUDIENCE = "origin-apps";
44
52
  const APP_JWT_TTL_SECONDS = 5 * 60;
@@ -94,6 +102,12 @@ export function originPublicApiBaseUrl(env = process.env) {
94
102
  const fromEnv = (_a = envValue(env.ORIGIN_API_BASE_URL)) === null || _a === void 0 ? void 0 : _a.replace(/\/+$/, "");
95
103
  return fromEnv !== null && fromEnv !== void 0 ? fromEnv : DEFAULT_ORIGIN_PUBLIC_API_BASE_URL;
96
104
  }
105
+ /** Origin ConnectRPC base. Trailing slashes are stripped for path joins. */
106
+ export function originRpcBaseUrl(env = process.env) {
107
+ var _a;
108
+ const fromEnv = (_a = envValue(env.ORIGIN_RPC_BASE_URL)) === null || _a === void 0 ? void 0 : _a.replace(/\/+$/, "");
109
+ return fromEnv !== null && fromEnv !== void 0 ? fromEnv : DEFAULT_ORIGIN_RPC_BASE_URL;
110
+ }
97
111
  function base64UrlJson(value) {
98
112
  return Buffer.from(JSON.stringify(value)).toString("base64url");
99
113
  }
@@ -295,7 +309,9 @@ export function createOriginClient(options = {}) {
295
309
  return yield options.token();
296
310
  }
297
311
  if (tokenProvider === undefined) {
298
- const credentials = (_a = options.credentials) !== null && _a !== void 0 ? _a : resolveOriginAppCredentials();
312
+ const credentials = options.credentials === false
313
+ ? undefined
314
+ : ((_a = options.credentials) !== null && _a !== void 0 ? _a : resolveOriginAppCredentials());
299
315
  const exchange = (_b = options.cursorAccountExchange) !== null && _b !== void 0 ? _b : true;
300
316
  const exchangeOptions = exchange === false ? undefined : exchange === true ? {} : exchange;
301
317
  const getExchangeApiKey = (_c = exchangeOptions === null || exchangeOptions === void 0 ? void 0 : exchangeOptions.getApiKey) !== null && _c !== void 0 ? _c : (() => { var _a; return (_a = resolveApiKeySync()) === null || _a === void 0 ? void 0 : _a.apiKey; });
@@ -10,6 +10,7 @@
10
10
  */
11
11
  import { type OriginApiMethod } from "./api.js";
12
12
  import { type OriginCheck, type OriginCheckCreateInput } from "./checks.js";
13
+ import { type OriginCommentReactionInput } from "./reactions.js";
13
14
  import type { OriginAppOptions, OriginRepositoryRef } from "./types.js";
14
15
  /** Origin operations exposed to hooks (`ctx.origin`). */
15
16
  export interface OriginHandle {
@@ -31,11 +32,21 @@ export interface OriginHandle {
31
32
  * installation, or the deployment service account on hosted v2 forks.
32
33
  */
33
34
  createCheck(input: Omit<OriginCheckCreateInput, "origin" | "owner" | "repo">): Promise<OriginCheck>;
35
+ /**
36
+ * Add or remove one reaction on a PR comment — the Origin analogue of
37
+ * GitHub's `thread.react("eyes")`. Needs
38
+ * `repository:pull_requests:reviews:write`. Reactions have no REST
39
+ * binding, so this call goes to Origin's ConnectRPC host rather than the
40
+ * public API base {@link request} uses.
41
+ */
42
+ reactToComment(input: OriginCommentReactionInput): Promise<void>;
34
43
  }
35
44
  export declare function buildOriginBinding(input: {
36
45
  repository: OriginRepositoryRef;
37
46
  /** Installation id from the delivery envelope, when present. */
38
47
  installationId?: string;
48
+ /** Force the signed-in Cursor account / deployment SA credential path. */
49
+ cursorAccount?: boolean;
39
50
  /** Channel-authored outbound app credentials / API base. */
40
51
  app?: OriginAppOptions;
41
52
  /** Injectable fetch for tests. */
@@ -1 +1 @@
1
- {"version":3,"file":"binding.d.ts","sourceRoot":"","sources":["../../../src/channels/origin/binding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAEL,KAAK,eAAe,EAGrB,MAAM,UAAU,CAAC;AAClB,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,sBAAsB,EA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AY;IAC3B,yEAAyE;IACzE,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,UAAU,EAAE,mBAAmB,CAAC;IAChC;;;OAGG;IACH,OAAO,CAAC,CAAC,GAAG,OAAO,EAAE,KAAK,EAAE;QAC1B,MAAM,EAAE,eAAe,CAAC;QACxB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,OAAO,CAAC;KAChB,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACf;;;;OAIG;IACH,WAAW,CACT,KAAK,EAAE,IAAI,CAAC,sBAAsB,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC,GAC/D,OAAO,CAAC,WAAW,CAAC,CAAC;IACxB;;;;;;OAMG;IACH,cAAc,CAAC,KAAK,EAAE,0BAA0B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAClE;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE;IACxC,UAAU,EAAE,mBAAmB,CAAC;IAChC,gEAAgE;IAChE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,0EAA0E;IAC1E,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,4DAA4D;IAC5D,GAAG,CAAC,EAAE,gBAAgB,CAAC;IACvB,kCAAkC;IAClC,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;CACtB,GAAG,YAAY,CAqDf"}
@@ -8,38 +8,54 @@
8
8
  * `ORIGIN_APP_PRIVATE_KEY`); the delivery's installation id fills in when
9
9
  * neither pins one — the GitHub webhook `installation.id` analogue.
10
10
  */
11
- import { createOriginClient, resolveOriginAppCredentialParts, } from "./api.js";
11
+ import { createOriginClient, originRpcBaseUrl, resolveOriginAppCredentialParts, } from "./api.js";
12
12
  import { createOriginCheck, } from "./checks.js";
13
+ import { setOriginCommentReaction, } from "./reactions.js";
13
14
  export function buildOriginBinding(input) {
14
15
  var _a;
15
16
  var _b;
16
- let client;
17
- const getClient = () => {
18
- var _a, _b, _c, _d, _e;
19
- var _f, _g, _h, _j;
20
- if (client === undefined) {
21
- const fromEnv = resolveOriginAppCredentialParts();
22
- const appId = (_f = (_a = input.app) === null || _a === void 0 ? void 0 : _a.appId) !== null && _f !== void 0 ? _f : fromEnv.appId;
23
- const installationId = (_h = (_g = (_b = input.app) === null || _b === void 0 ? void 0 : _b.installationId) !== null && _g !== void 0 ? _g : input.installationId) !== null && _h !== void 0 ? _h : fromEnv.installationId;
24
- const privateKey = (_j = (_c = input.app) === null || _c === void 0 ? void 0 : _c.privateKey) !== null && _j !== void 0 ? _j : fromEnv.privateKey;
25
- const credentials = appId !== undefined &&
26
- installationId !== undefined &&
27
- privateKey !== undefined
28
- ? { appId, installationId, privateKey }
29
- : undefined;
30
- client = createOriginClient({
31
- token: (_d = input.app) === null || _d === void 0 ? void 0 : _d.token,
32
- credentials,
33
- apiBaseUrl: (_e = input.app) === null || _e === void 0 ? void 0 : _e.apiBaseUrl,
34
- fetch: input.fetch,
35
- });
36
- }
37
- return client;
17
+ const buildClient = (apiBaseUrl) => {
18
+ var _a, _b, _c, _d;
19
+ var _e, _f, _g, _h;
20
+ const fromEnv = input.cursorAccount
21
+ ? {}
22
+ : resolveOriginAppCredentialParts();
23
+ const appId = (_e = (_a = input.app) === null || _a === void 0 ? void 0 : _a.appId) !== null && _e !== void 0 ? _e : fromEnv.appId;
24
+ const installationId = (_g = (_f = (_b = input.app) === null || _b === void 0 ? void 0 : _b.installationId) !== null && _f !== void 0 ? _f : input.installationId) !== null && _g !== void 0 ? _g : fromEnv.installationId;
25
+ const privateKey = (_h = (_c = input.app) === null || _c === void 0 ? void 0 : _c.privateKey) !== null && _h !== void 0 ? _h : fromEnv.privateKey;
26
+ const credentials = appId !== undefined &&
27
+ installationId !== undefined &&
28
+ privateKey !== undefined
29
+ ? { appId, installationId, privateKey }
30
+ : undefined;
31
+ return createOriginClient({
32
+ token: input.cursorAccount ? undefined : (_d = input.app) === null || _d === void 0 ? void 0 : _d.token,
33
+ credentials: input.cursorAccount ? false : credentials,
34
+ apiBaseUrl,
35
+ fetch: input.fetch,
36
+ });
37
+ };
38
+ // Public REST and ConnectRPC are separate Origin deployments, so the
39
+ // handle keeps a client per host. Both stay lazy: a hook that touches
40
+ // neither needs no credential.
41
+ let restClient;
42
+ const getRestClient = () => {
43
+ var _a;
44
+ restClient !== null && restClient !== void 0 ? restClient : (restClient = buildClient((_a = input.app) === null || _a === void 0 ? void 0 : _a.apiBaseUrl));
45
+ return restClient;
46
+ };
47
+ let rpcClient;
48
+ const getRpcClient = () => {
49
+ var _a;
50
+ var _b;
51
+ rpcClient !== null && rpcClient !== void 0 ? rpcClient : (rpcClient = buildClient((_b = (_a = input.app) === null || _a === void 0 ? void 0 : _a.rpcBaseUrl) !== null && _b !== void 0 ? _b : originRpcBaseUrl()));
52
+ return rpcClient;
38
53
  };
39
54
  return {
40
55
  installationId: (_b = (_a = input.app) === null || _a === void 0 ? void 0 : _a.installationId) !== null && _b !== void 0 ? _b : input.installationId,
41
56
  repository: input.repository,
42
- request: (request) => getClient().request(request),
43
- createCheck: (check) => createOriginCheck(Object.assign(Object.assign({}, check), { origin: getClient(), owner: input.repository.owner, repo: input.repository.name })),
57
+ request: (request) => getRestClient().request(request),
58
+ createCheck: (check) => createOriginCheck(Object.assign(Object.assign({}, check), { origin: getRestClient(), owner: input.repository.owner, repo: input.repository.name })),
59
+ reactToComment: (reaction) => setOriginCommentReaction(Object.assign(Object.assign({}, reaction), { origin: getRpcClient() })),
44
60
  };
45
61
  }
@@ -28,5 +28,6 @@ export * from "./cursor-account.js";
28
28
  export * from "./events.js";
29
29
  export * from "./origin-channel.js";
30
30
  export * from "./origin-webhook.js";
31
+ export * from "./reactions.js";
31
32
  export * from "./types.js";
32
33
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/channels/origin/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/channels/origin/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC"}
@@ -28,4 +28,5 @@ export * from "./cursor-account.js";
28
28
  export * from "./events.js";
29
29
  export * from "./origin-channel.js";
30
30
  export * from "./origin-webhook.js";
31
+ export * from "./reactions.js";
31
32
  export * from "./types.js";
@@ -23,6 +23,8 @@ export declare function originIngressExtractPayload(envelope: OriginWebhookEnvel
23
23
  export declare function defaultOriginTitle(ctx: Pick<OriginEventContext, "repository" | "pullRequestNumber">): string;
24
24
  export declare function defaultOriginPullRequestMessage(ctx: Omit<OriginEventContext, "host" | "artifacts" | "origin">, pullRequest: OriginPullRequestEvent): string;
25
25
  export declare function defaultOriginPullRequestDispatch(ctx: Omit<OriginEventContext, "host" | "artifacts" | "origin">, pullRequest: OriginPullRequestEvent): OriginTurnDispatch | null;
26
+ export type OriginDispatchOutcome = "skip" | "send" | "task";
27
+ export declare function getOriginDispatchOutcome(response: Response): OriginDispatchOutcome | undefined;
26
28
  /**
27
29
  * Core Origin webhook dispatch used by {@link originChannel} routes and by
28
30
  * {@link handleAgentServeTrigger} fan-out. Signature verification is the
@@ -1 +1 @@
1
- {"version":3,"file":"origin-channel.d.ts","sourceRoot":"","sources":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,MAAM,CAAC;IACb,OAAO,EAAE;QACP,QAAQ,EAAE,KAAK,CAAC;YACd,EAAE,EAAE,MAAM,CAAC;YACX,UAAU,EAAE;gBACV,IAAI,CAAC,EAAE;oBAAE,IAAI,CAAC,EAAE,MAAM,CAAC;oBAAC,mBAAmB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;iBAAE,CAAC;aACnE,CAAC;SACH,CAAC,CAAC;KACJ,CAAC;CACH;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,aAAa,CAAC,oBAAoB,CAAC,GAC1C,mBAAmB,EAAE,CAgBvB"}
@@ -10,7 +10,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  import { z } from "zod";
11
11
  import { allowAll, defineChannel, localDevStrict, loopbackOnly, POST, } from "../../channels.js";
12
12
  import { continuationSource, normalizeIdentity, } from "../../internal/continuation-identity.js";
13
+ import { isDeferredChannelSession } from "../../internal/deferred-channel-session.js";
13
14
  import { isDevMode } from "../../internal/dev-mode.js";
15
+ import { attachHostedAdmissionAdapter } from "../../internal/hosted-admission-adapter.js";
14
16
  import { bindLocalIngressSend } from "../../internal/local-ingress.js";
15
17
  import { buildOriginBinding } from "./binding.js";
16
18
  import { parseCursorOriginRepoScope, registerOriginCursorAccountRuntime, } from "./cursor-account.js";
@@ -222,6 +224,7 @@ export function parseOriginPullRequestEvent(input) {
222
224
  repository,
223
225
  pullRequestNumber: number,
224
226
  pullRequestUrl: url,
227
+ pullRequestAuthor: author,
225
228
  payload,
226
229
  sender: originSender(input.envelope, payload),
227
230
  },
@@ -304,11 +307,21 @@ function enrichEventContext(input) {
304
307
  return Object.assign(Object.assign({}, input.ctx), { host: input.args.host, artifacts: input.args.artifacts, origin: buildOriginBinding({
305
308
  repository: input.ctx.repository,
306
309
  installationId: input.ctx.installationId,
310
+ cursorAccount: input.options.cursorAccount !== undefined &&
311
+ input.options.cursorAccount !== false,
307
312
  app: input.options.app,
308
313
  }) });
309
314
  }
315
+ const dispatchOutcomeByResponse = new WeakMap();
316
+ function withDispatchOutcome(response, outcome) {
317
+ dispatchOutcomeByResponse.set(response, outcome);
318
+ return response;
319
+ }
320
+ export function getOriginDispatchOutcome(response) {
321
+ return dispatchOutcomeByResponse.get(response);
322
+ }
310
323
  function skipped(reason, extra = {}) {
311
- return Response.json(Object.assign({ ok: true, skipped: true, reason }, extra));
324
+ return withDispatchOutcome(Response.json(Object.assign({ ok: true, skipped: true, reason }, extra)), "skip");
312
325
  }
313
326
  function acknowledgeTask(args, dispatch, extra) {
314
327
  args.waitUntil(new Promise((resolve, reject) => {
@@ -318,7 +331,7 @@ function acknowledgeTask(args, dispatch, extra) {
318
331
  .then(() => resolve(), reject);
319
332
  });
320
333
  }));
321
- return Response.json(Object.assign({ ok: true, dispatched: true, mode: "task" }, extra), { status: 202 });
334
+ return withDispatchOutcome(Response.json(Object.assign({ ok: true, dispatched: true, mode: "task" }, extra), { status: 202 }), "task");
322
335
  }
323
336
  function startTurn(input) {
324
337
  return __awaiter(this, void 0, void 0, function* () {
@@ -327,12 +340,17 @@ function startTurn(input) {
327
340
  const session = yield input.args.send(input.message, Object.assign(Object.assign(Object.assign({ auth: input.dispatch.auth }, (source === "engine"
328
341
  ? { continuationToken: originContinuationKey(input.ctx) }
329
342
  : {})), { title: (_a = input.dispatch.title) !== null && _a !== void 0 ? _a : defaultOriginTitle(input.ctx) }), (input.cloud === undefined ? {} : { cloud: input.cloud })));
330
- return Response.json({
343
+ if (isDeferredChannelSession(session)) {
344
+ // Hosted admission captured the send; the control plane allocates the
345
+ // session after acknowledgement, so there is nothing to report yet.
346
+ return withDispatchOutcome(Response.json({ ok: true, dispatched: true, mode: "turn" }, { status: 202 }), "send");
347
+ }
348
+ return withDispatchOutcome(Response.json({
331
349
  ok: true,
332
350
  sessionId: session.id,
333
351
  isNew: session.isNew,
334
352
  continuationToken: session.continuationToken,
335
- });
353
+ }), "send");
336
354
  });
337
355
  }
338
356
  function resolveCloudOptions(cloud, ctx, pullRequest) {
@@ -592,6 +610,24 @@ export function originChannel(options = {}) {
592
610
  ],
593
611
  });
594
612
  originChannelOptionsByDefinition.set(definition, channelOptions);
613
+ attachHostedAdmissionAdapter(definition, {
614
+ kind: ORIGIN_CHANNEL_KIND,
615
+ dispatch: (_a) => __awaiter(this, [_a], void 0, function* ({ payload, args }) {
616
+ const envelope = parseOriginWebhookEnvelope(payload);
617
+ if (envelope === null) {
618
+ return Response.json({ ok: false, error: "invalid_origin_payload" }, { status: 400 });
619
+ }
620
+ return dispatchOriginWebhook({
621
+ options: channelOptions,
622
+ envelope,
623
+ args,
624
+ });
625
+ }),
626
+ getOutcome: (response) => {
627
+ const outcome = getOriginDispatchOutcome(response);
628
+ return outcome === "skip" || outcome === "task" ? outcome : undefined;
629
+ },
630
+ });
595
631
  if (usesCursorAccount) {
596
632
  registerOriginCursorAccountRuntime(definition, {
597
633
  options: channelOptions,
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Origin PR comment reactions — the Origin analogue of the GitHub channel's
3
+ * `thread.react("eyes")`.
4
+ *
5
+ * Unlike checks and comments, reactions have no `/v1/origin/...` REST
6
+ * binding. The only write is Connect unary JSON against Origin's first-party
7
+ * service (`origin.v1.OriginService/SetCommentReaction`), which lives on a
8
+ * different host than the public REST API — {@link originRpcBaseUrl}, not
9
+ * {@link originPublicApiBaseUrl}. `ctx.origin.reactToComment` already points
10
+ * at the right one; a hand-built client must too.
11
+ *
12
+ * Writing needs `repository:pull_requests:reviews:write`: an `oit_…`
13
+ * installation token for app channels, or a deployment service-account
14
+ * session (hosted v2 forks). Origin rejects reactions on comments that
15
+ * belong to an unsubmitted review. API failures throw `OriginApiError`.
16
+ */
17
+ import type { OriginApiMethod } from "./api.js";
18
+ /** Any client that can call Origin's ConnectRPC host. */
19
+ export interface OriginReactionClient {
20
+ request<T = unknown>(input: {
21
+ method: OriginApiMethod;
22
+ path: string;
23
+ body?: unknown;
24
+ }): Promise<T>;
25
+ }
26
+ /** Connect unary route backing {@link setOriginCommentReaction}. */
27
+ export declare const SET_ORIGIN_COMMENT_REACTION_PATH = "/origin.v1.OriginService/SetCommentReaction";
28
+ /**
29
+ * The eight reactions Origin accepts. Anything else is rejected with
30
+ * `invalid_argument`, so channels get a compile error instead of a 400.
31
+ */
32
+ export declare const ORIGIN_COMMENT_REACTIONS: readonly ["👍", "👎", "😄", "🎉", "😕", "❤️", "🚀", "👀"];
33
+ export type OriginCommentReaction = (typeof ORIGIN_COMMENT_REACTIONS)[number];
34
+ export interface OriginCommentReactionInput {
35
+ /** Origin comment TypeID (`cmt_…`), i.e. `comment.id` on a comment hook. */
36
+ commentId: string;
37
+ emoji: OriginCommentReaction;
38
+ /** `false` removes the reaction. Removing one that is absent is a no-op. */
39
+ active?: boolean;
40
+ }
41
+ /**
42
+ * Add (or, with `active: false`, remove) one reaction on an Origin PR
43
+ * comment as the client's own principal.
44
+ *
45
+ * ```ts
46
+ * await setOriginCommentReaction({
47
+ * origin: createOriginClient({ apiBaseUrl: originRpcBaseUrl() }),
48
+ * commentId: comment.id,
49
+ * emoji: "👀",
50
+ * });
51
+ * ```
52
+ */
53
+ export declare function setOriginCommentReaction(input: OriginCommentReactionInput & {
54
+ origin: OriginReactionClient;
55
+ }): Promise<void>;
56
+ //# sourceMappingURL=reactions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reactions.d.ts","sourceRoot":"","sources":["../../../src/channels/origin/reactions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,yDAAyD;AACzD,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,CAAC,GAAG,OAAO,EAAE,KAAK,EAAE;QAC1B,MAAM,EAAE,eAAe,CAAC;QACxB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,OAAO,CAAC;KAChB,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CAChB;AAED,oEAAoE;AACpE,eAAO,MAAM,gCAAgC,gDACE,CAAC;AAEhD;;;GAGG;AACH,eAAO,MAAM,wBAAwB,YACnC,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,CACI,CAAC;AAEX,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9E,MAAM,WAAW,0BAA0B;IACzC,4EAA4E;IAC5E,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,qBAAqB,CAAC;IAC7B,4EAA4E;IAC5E,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,wBAAwB,CAC5C,KAAK,EAAE,0BAA0B,GAAG;IAAE,MAAM,EAAE,oBAAoB,CAAA;CAAE,GACnE,OAAO,CAAC,IAAI,CAAC,CAUf"}