@cursor/july 0.1.107 → 0.1.108

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 (302) hide show
  1. package/README.md +10 -5
  2. package/dist/bin/agent-serve.js +30 -8
  3. package/dist/channels/github/github-channel.js +8 -5
  4. package/dist/channels/github/types.d.ts +5 -1
  5. package/dist/channels/github/types.d.ts.map +1 -1
  6. package/dist/channels/origin/origin-channel.d.ts.map +1 -1
  7. package/dist/channels/origin/origin-channel.js +27 -13
  8. package/dist/channels/origin/types.d.ts +5 -1
  9. package/dist/channels/origin/types.d.ts.map +1 -1
  10. package/dist/channels.d.ts +45 -0
  11. package/dist/channels.d.ts.map +1 -1
  12. package/dist/channels.js +106 -7
  13. package/dist/connections.d.ts +2 -1
  14. package/dist/connections.d.ts.map +1 -1
  15. package/dist/connections.js +2 -1
  16. package/dist/docs/404.html +2 -2
  17. package/dist/docs/ab.html +4 -4
  18. package/dist/docs/assets/{app.CtuckIiL.js → app.BASKM3M4.js} +1 -1
  19. package/dist/docs/assets/chunks/@localSearchIndexroot.BHZYsNVi.js +1 -0
  20. package/dist/docs/assets/chunks/{VPLocalSearchBox.Bkkhnu8K.js → VPLocalSearchBox.BOKxlYGP.js} +1 -1
  21. package/dist/docs/assets/chunks/{theme.DhpIe0Pa.js → theme.DbDZW-zb.js} +2 -2
  22. package/dist/docs/assets/{deployment.md.MFPKqsqI.js → deployment.md.JenwuCCB.js} +4 -4
  23. package/dist/docs/assets/{deployment.md.MFPKqsqI.lean.js → deployment.md.JenwuCCB.lean.js} +1 -1
  24. package/dist/docs/assets/{evals.md.CbMoebP1.js → evals.md.C1ekS3k2.js} +1 -1
  25. package/dist/docs/assets/guides_cloud-agents.md.BsloyHdY.js +9 -0
  26. package/dist/docs/assets/{guides_cloud-agents.md.DS8RIjwx.lean.js → guides_cloud-agents.md.BsloyHdY.lean.js} +1 -1
  27. package/dist/docs/assets/{guides_github.md.c0gdGJ-D.js → guides_github.md.BH33UEBJ.js} +1 -1
  28. package/dist/docs/assets/{guides_grokbot-agents.md.DVqdhBKb.js → guides_grokbot-agents.md.DyV-WArv.js} +1 -1
  29. package/dist/docs/assets/guides_improve.md.BGVk32bK.js +14 -0
  30. package/dist/docs/assets/guides_improve.md.BGVk32bK.lean.js +1 -0
  31. package/dist/docs/assets/{guides_slack.md.9oHPye9o.js → guides_slack.md.D4RVMM4G.js} +3 -3
  32. package/dist/docs/assets/{guides_slack.md.9oHPye9o.lean.js → guides_slack.md.D4RVMM4G.lean.js} +1 -1
  33. package/dist/docs/assets/index.md.BjH1w2ZW.js +5 -0
  34. package/dist/docs/assets/{reference_agent-config.md.CHNpiyp4.js → reference_agent-config.md.CvoL6pof.js} +1 -1
  35. package/dist/docs/assets/{reference_cli.md.Dm67hd2D.js → reference_cli.md.Ca26u0Es.js} +6 -6
  36. package/dist/docs/assets/{reference_cli.md.Dm67hd2D.lean.js → reference_cli.md.Ca26u0Es.lean.js} +1 -1
  37. package/dist/docs/assets/{reference_connections.md.Di6jJAXF.js → reference_connections.md.BojkC6c5.js} +1 -1
  38. package/dist/docs/assets/{reference_extensions.md.CGmMLblt.js → reference_extensions.md.CPWt00ds.js} +1 -1
  39. package/dist/docs/assets/{scaffolding-agents.md.em43xlY1.js → scaffolding-agents.md.Kctn3OVb.js} +1 -1
  40. package/dist/docs/assets/{skills_create-agent.md.BVoWPcan.js → skills_create-agent.md.Q3h6Je-e.js} +1 -1
  41. package/dist/docs/assets/{skills_debug.md.CDbPhHfg.js → skills_debug.md.CVjCXMFF.js} +1 -1
  42. package/dist/docs/assets/{skills_debug.md.CDbPhHfg.lean.js → skills_debug.md.CVjCXMFF.lean.js} +1 -1
  43. package/dist/docs/assets/{skills_evals.md.723kpUmA.js → skills_evals.md.BhovOvrl.js} +1 -1
  44. package/dist/docs/assets/skills_framework-map.md.D-tFZhFS.js +1 -0
  45. package/dist/docs/assets/{skills_framework-map.md.haibFyoB.lean.js → skills_framework-map.md.D-tFZhFS.lean.js} +1 -1
  46. package/dist/docs/assets/{skills_github.md.D0JahM8c.js → skills_github.md.hgFX_oKY.js} +1 -1
  47. package/dist/docs/assets/troubleshooting.md.CYEAO9bM.js +1 -0
  48. package/dist/docs/building-with-agents.html +4 -4
  49. package/dist/docs/concepts.html +4 -4
  50. package/dist/docs/deployment.html +7 -7
  51. package/dist/docs/deployment.md +7 -2
  52. package/dist/docs/evals.html +6 -6
  53. package/dist/docs/evals.md +3 -2
  54. package/dist/docs/guides/agent-to-agent.html +4 -4
  55. package/dist/docs/guides/cloud-agents.html +6 -6
  56. package/dist/docs/guides/cloud-agents.md +4 -3
  57. package/dist/docs/guides/convert-automation.html +4 -4
  58. package/dist/docs/guides/github.html +5 -5
  59. package/dist/docs/guides/github.md +2 -1
  60. package/dist/docs/guides/grokbot-agents.html +6 -6
  61. package/dist/docs/guides/grokbot-agents.md +2 -2
  62. package/dist/docs/guides/human-in-the-loop.html +4 -4
  63. package/dist/docs/guides/improve.html +40 -0
  64. package/dist/docs/guides/improve.md +91 -0
  65. package/dist/docs/guides/mcp-oauth.html +4 -4
  66. package/dist/docs/guides/opentelemetry.html +5 -5
  67. package/dist/docs/guides/slack.html +6 -6
  68. package/dist/docs/guides/slack.md +2 -1
  69. package/dist/docs/guides/webhooks.html +4 -4
  70. package/dist/docs/hashmap.json +1 -1
  71. package/dist/docs/hillclimbing.html +4 -4
  72. package/dist/docs/index.html +6 -6
  73. package/dist/docs/index.md +4 -0
  74. package/dist/docs/llms-full.txt +158 -33
  75. package/dist/docs/llms.txt +1 -0
  76. package/dist/docs/quickstart.html +4 -4
  77. package/dist/docs/reference/agent-config.html +6 -6
  78. package/dist/docs/reference/agent-config.md +5 -2
  79. package/dist/docs/reference/artifacts.html +4 -4
  80. package/dist/docs/reference/channels.html +4 -4
  81. package/dist/docs/reference/cli.html +10 -10
  82. package/dist/docs/reference/cli.md +18 -11
  83. package/dist/docs/reference/connections.html +6 -6
  84. package/dist/docs/reference/connections.md +2 -1
  85. package/dist/docs/reference/extensions.html +6 -6
  86. package/dist/docs/reference/extensions.md +2 -0
  87. package/dist/docs/reference/hooks.html +4 -4
  88. package/dist/docs/reference/http-api.html +4 -4
  89. package/dist/docs/reference/instructions.html +4 -4
  90. package/dist/docs/reference/playground.html +4 -4
  91. package/dist/docs/reference/project-layout.html +4 -4
  92. package/dist/docs/reference/prompt.html +4 -4
  93. package/dist/docs/reference/result.html +4 -4
  94. package/dist/docs/reference/schedules.html +4 -4
  95. package/dist/docs/reference/sessions.html +4 -4
  96. package/dist/docs/reference/skills.html +4 -4
  97. package/dist/docs/reference/subagents.html +4 -4
  98. package/dist/docs/reference/tools.html +4 -4
  99. package/dist/docs/scaffolding-agents.html +5 -5
  100. package/dist/docs/scaffolding-agents.md +2 -1
  101. package/dist/docs/skills/ab.html +4 -4
  102. package/dist/docs/skills/create-agent.html +6 -6
  103. package/dist/docs/skills/create-agent.md +1 -1
  104. package/dist/docs/skills/debug.html +5 -5
  105. package/dist/docs/skills/debug.md +1 -1
  106. package/dist/docs/skills/evals.html +6 -6
  107. package/dist/docs/skills/evals.md +1 -1
  108. package/dist/docs/skills/framework-map.html +5 -5
  109. package/dist/docs/skills/framework-map.md +4 -2
  110. package/dist/docs/skills/github.html +6 -6
  111. package/dist/docs/skills/github.md +1 -1
  112. package/dist/docs/skills/hillclimb.html +4 -4
  113. package/dist/docs/skills/index.html +4 -4
  114. package/dist/docs/skills/mcp-auth.html +4 -4
  115. package/dist/docs/skills/otel.html +4 -4
  116. package/dist/docs/skills/setup-slack.html +4 -4
  117. package/dist/docs/storage.html +4 -4
  118. package/dist/docs/templates/agentic-owners.html +4 -4
  119. package/dist/docs/templates/agents-md.html +4 -4
  120. package/dist/docs/templates/code-wiki.html +4 -4
  121. package/dist/docs/templates/demo.html +4 -4
  122. package/dist/docs/templates/grokbot-agents.html +4 -4
  123. package/dist/docs/templates/pr-autofixer.html +4 -4
  124. package/dist/docs/templates/security-help.html +4 -4
  125. package/dist/docs/templates/security-reviewer.html +4 -4
  126. package/dist/docs/templates/triage.html +4 -4
  127. package/dist/docs/troubleshooting.html +5 -5
  128. package/dist/docs/troubleshooting.md +1 -1
  129. package/dist/extensions/improve/extension.d.ts +46 -0
  130. package/dist/extensions/improve/extension.d.ts.map +1 -0
  131. package/dist/extensions/improve/extension.js +41 -0
  132. package/dist/extensions/improve/skills/yourself.d.ts +4 -0
  133. package/dist/extensions/improve/skills/yourself.d.ts.map +1 -0
  134. package/dist/extensions/improve/skills/yourself.js +43 -0
  135. package/dist/internal/builtin-tools/artifacts.d.ts.map +1 -1
  136. package/dist/internal/builtin-tools/artifacts.js +2 -3
  137. package/dist/internal/channel-route-dispatch.d.ts +13 -0
  138. package/dist/internal/channel-route-dispatch.d.ts.map +1 -0
  139. package/dist/internal/channel-route-dispatch.js +62 -0
  140. package/dist/internal/channel-state.d.ts +17 -0
  141. package/dist/internal/channel-state.d.ts.map +1 -0
  142. package/dist/internal/channel-state.js +78 -0
  143. package/dist/internal/cli-ax.d.ts +7 -0
  144. package/dist/internal/cli-ax.d.ts.map +1 -1
  145. package/dist/internal/cli-ax.js +99 -1
  146. package/dist/internal/cli-cursor.d.ts.map +1 -1
  147. package/dist/internal/cli-cursor.js +2 -0
  148. package/dist/internal/cli-deploy.d.ts.map +1 -1
  149. package/dist/internal/cli-deploy.js +38 -14
  150. package/dist/internal/cli-mcp-oauth.d.ts.map +1 -1
  151. package/dist/internal/cli-mcp-oauth.js +15 -0
  152. package/dist/internal/cli-mcp.d.ts.map +1 -1
  153. package/dist/internal/cli-mcp.js +12 -0
  154. package/dist/internal/cli-slack.d.ts.map +1 -1
  155. package/dist/internal/cli-slack.js +8 -2
  156. package/dist/internal/cursor/credentials.d.ts +8 -2
  157. package/dist/internal/cursor/credentials.d.ts.map +1 -1
  158. package/dist/internal/cursor/credentials.js +27 -5
  159. package/dist/internal/deploy-client.d.ts +27 -0
  160. package/dist/internal/deploy-client.d.ts.map +1 -1
  161. package/dist/internal/deploy-client.js +32 -0
  162. package/dist/internal/deploy-manifest.d.ts +23 -0
  163. package/dist/internal/deploy-manifest.d.ts.map +1 -1
  164. package/dist/internal/deploy-manifest.js +84 -1
  165. package/dist/internal/describe-error.d.ts +1 -0
  166. package/dist/internal/describe-error.d.ts.map +1 -1
  167. package/dist/internal/describe-error.js +25 -0
  168. package/dist/internal/guest-network.d.ts +4 -10
  169. package/dist/internal/guest-network.d.ts.map +1 -1
  170. package/dist/internal/guest-network.js +42 -26
  171. package/dist/internal/hosted-admission-adapter.d.ts +2 -0
  172. package/dist/internal/hosted-admission-adapter.d.ts.map +1 -1
  173. package/dist/internal/hosted-catch-protocol.d.ts +51 -0
  174. package/dist/internal/hosted-catch-protocol.d.ts.map +1 -0
  175. package/dist/internal/hosted-catch-protocol.js +103 -0
  176. package/dist/internal/hosted-catch.d.ts +40 -0
  177. package/dist/internal/hosted-catch.d.ts.map +1 -0
  178. package/dist/internal/hosted-catch.js +149 -0
  179. package/dist/internal/hosted-delivery-protocol.d.ts +41 -0
  180. package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
  181. package/dist/internal/hosted-delivery-protocol.js +249 -0
  182. package/dist/internal/hosted-delivery.d.ts +10 -1
  183. package/dist/internal/hosted-delivery.d.ts.map +1 -1
  184. package/dist/internal/hosted-delivery.js +100 -22
  185. package/dist/internal/hosted-execution-diag.d.ts +4 -1
  186. package/dist/internal/hosted-execution-diag.d.ts.map +1 -1
  187. package/dist/internal/hosted-execution-diag.js +13 -4
  188. package/dist/internal/hosted-execution-flush.d.ts +3 -0
  189. package/dist/internal/hosted-execution-flush.d.ts.map +1 -1
  190. package/dist/internal/hosted-execution-flush.js +2 -4
  191. package/dist/internal/http-control-plane-session.d.ts +30 -0
  192. package/dist/internal/http-control-plane-session.d.ts.map +1 -0
  193. package/dist/internal/http-control-plane-session.js +83 -0
  194. package/dist/internal/legacy-command-guard.d.ts +22 -0
  195. package/dist/internal/legacy-command-guard.d.ts.map +1 -0
  196. package/dist/internal/legacy-command-guard.js +51 -0
  197. package/dist/internal/platform-timers.d.ts +7 -0
  198. package/dist/internal/platform-timers.d.ts.map +1 -1
  199. package/dist/internal/platform-timers.js +139 -0
  200. package/dist/internal/reminder-control-plane-protocol.d.ts +2 -0
  201. package/dist/internal/reminder-control-plane-protocol.d.ts.map +1 -1
  202. package/dist/internal/reminder-control-plane-protocol.js +9 -2
  203. package/dist/internal/reminder-runner.d.ts +8 -0
  204. package/dist/internal/reminder-runner.d.ts.map +1 -1
  205. package/dist/internal/reminder-runner.js +36 -9
  206. package/dist/internal/resolve-prod-target.d.ts +2 -0
  207. package/dist/internal/resolve-prod-target.d.ts.map +1 -1
  208. package/dist/internal/resolve-prod-target.js +13 -0
  209. package/dist/internal/sdk-runner.d.ts.map +1 -1
  210. package/dist/internal/sdk-runner.js +4 -3
  211. package/dist/internal/server.d.ts.map +1 -1
  212. package/dist/internal/server.js +57 -56
  213. package/dist/internal/session-engine.d.ts +2 -6
  214. package/dist/internal/session-engine.d.ts.map +1 -1
  215. package/dist/internal/session-engine.js +95 -67
  216. package/dist/playground/assets/{index-Bq2HpEQB.js → index-BMDqAeXu.js} +28 -28
  217. package/dist/playground/assets/index-LUgJoWdL.css +1 -0
  218. package/dist/playground/index.html +2 -2
  219. package/dist/storage-backends/cursor-hosted.d.ts +6 -0
  220. package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
  221. package/dist/storage-backends/cursor-hosted.js +29 -1
  222. package/dist/types.d.ts +33 -5
  223. package/dist/types.d.ts.map +1 -1
  224. package/docs/README.md +4 -0
  225. package/docs/deployment.md +7 -2
  226. package/docs/evals.md +3 -2
  227. package/docs/guides/cloud-agents.md +4 -3
  228. package/docs/guides/github.md +2 -1
  229. package/docs/guides/grokbot-agents.md +2 -2
  230. package/docs/guides/improve.md +96 -0
  231. package/docs/guides/slack.md +2 -1
  232. package/docs/reference/agent-config.md +5 -2
  233. package/docs/reference/cli.md +18 -11
  234. package/docs/reference/connections.md +2 -1
  235. package/docs/reference/extensions.md +2 -0
  236. package/docs/scaffolding-agents.md +2 -1
  237. package/docs/troubleshooting.md +1 -1
  238. package/package.json +8 -1
  239. package/skills/create-agent/SKILL.md +1 -1
  240. package/skills/debug/SKILL.md +1 -1
  241. package/skills/evals/SKILL.md +1 -1
  242. package/skills/framework-map/SKILL.md +4 -2
  243. package/skills/github/SKILL.md +1 -1
  244. package/src/bin/agent-serve.ts +27 -2
  245. package/src/channels/github/github-channel.ts +8 -8
  246. package/src/channels/github/types.ts +5 -0
  247. package/src/channels/origin/origin-channel.ts +29 -13
  248. package/src/channels/origin/types.ts +5 -0
  249. package/src/channels.ts +157 -10
  250. package/src/connections.ts +2 -1
  251. package/src/extensions/improve/extension.ts +70 -0
  252. package/src/extensions/improve/skills/yourself.ts +50 -0
  253. package/src/internal/builtin-tools/artifacts.ts +2 -3
  254. package/src/internal/channel-route-dispatch.ts +66 -0
  255. package/src/internal/channel-state.ts +96 -0
  256. package/src/internal/cli-ax.ts +110 -1
  257. package/src/internal/cli-cursor.ts +4 -1
  258. package/src/internal/cli-deploy.ts +50 -10
  259. package/src/internal/cli-mcp-oauth.ts +18 -0
  260. package/src/internal/cli-mcp.ts +11 -0
  261. package/src/internal/cli-slack.ts +15 -2
  262. package/src/internal/cursor/credentials.ts +35 -7
  263. package/src/internal/deploy-client.ts +54 -0
  264. package/src/internal/deploy-manifest.ts +115 -1
  265. package/src/internal/describe-error.ts +28 -0
  266. package/src/internal/guest-network.ts +43 -29
  267. package/src/internal/hosted-admission-adapter.ts +2 -0
  268. package/src/internal/hosted-catch-protocol.ts +130 -0
  269. package/src/internal/hosted-catch.ts +192 -0
  270. package/src/internal/hosted-delivery-protocol.ts +387 -0
  271. package/src/internal/hosted-delivery.ts +155 -22
  272. package/src/internal/hosted-execution-diag.ts +21 -3
  273. package/src/internal/hosted-execution-flush.ts +6 -3
  274. package/src/internal/http-control-plane-session.ts +104 -0
  275. package/src/internal/legacy-command-guard.ts +59 -0
  276. package/src/internal/platform-timers.ts +191 -0
  277. package/src/internal/reminder-control-plane-protocol.ts +15 -2
  278. package/src/internal/reminder-runner.ts +60 -9
  279. package/src/internal/resolve-prod-target.ts +15 -0
  280. package/src/internal/sdk-runner.ts +2 -1
  281. package/src/internal/server.ts +89 -79
  282. package/src/internal/session-engine.ts +141 -83
  283. package/src/storage-backends/cursor-hosted.ts +40 -1
  284. package/src/types.ts +39 -6
  285. package/dist/docs/assets/chunks/@localSearchIndexroot.DXXZxiMv.js +0 -1
  286. package/dist/docs/assets/guides_cloud-agents.md.DS8RIjwx.js +0 -9
  287. package/dist/docs/assets/index.md.BW_6tOgR.js +0 -5
  288. package/dist/docs/assets/skills_framework-map.md.haibFyoB.js +0 -1
  289. package/dist/docs/assets/troubleshooting.md.Cus_YZga.js +0 -1
  290. package/dist/playground/assets/index-CZKKNlmb.css +0 -1
  291. /package/dist/docs/assets/{evals.md.CbMoebP1.lean.js → evals.md.C1ekS3k2.lean.js} +0 -0
  292. /package/dist/docs/assets/{guides_github.md.c0gdGJ-D.lean.js → guides_github.md.BH33UEBJ.lean.js} +0 -0
  293. /package/dist/docs/assets/{guides_grokbot-agents.md.DVqdhBKb.lean.js → guides_grokbot-agents.md.DyV-WArv.lean.js} +0 -0
  294. /package/dist/docs/assets/{index.md.BW_6tOgR.lean.js → index.md.BjH1w2ZW.lean.js} +0 -0
  295. /package/dist/docs/assets/{reference_agent-config.md.CHNpiyp4.lean.js → reference_agent-config.md.CvoL6pof.lean.js} +0 -0
  296. /package/dist/docs/assets/{reference_connections.md.Di6jJAXF.lean.js → reference_connections.md.BojkC6c5.lean.js} +0 -0
  297. /package/dist/docs/assets/{reference_extensions.md.CGmMLblt.lean.js → reference_extensions.md.CPWt00ds.lean.js} +0 -0
  298. /package/dist/docs/assets/{scaffolding-agents.md.em43xlY1.lean.js → scaffolding-agents.md.Kctn3OVb.lean.js} +0 -0
  299. /package/dist/docs/assets/{skills_create-agent.md.BVoWPcan.lean.js → skills_create-agent.md.Q3h6Je-e.lean.js} +0 -0
  300. /package/dist/docs/assets/{skills_evals.md.723kpUmA.lean.js → skills_evals.md.BhovOvrl.lean.js} +0 -0
  301. /package/dist/docs/assets/{skills_github.md.D0JahM8c.lean.js → skills_github.md.hgFX_oKY.lean.js} +0 -0
  302. /package/dist/docs/assets/{troubleshooting.md.Cus_YZga.lean.js → troubleshooting.md.CYEAO9bM.lean.js} +0 -0
@@ -240,8 +240,11 @@ console.log(`listening on ${handle.url}`);
240
240
  Host settings match the documented [CLI](./cli.md) `serve` flags.
241
241
  `serve()` also accepts `discovery` (project-loading options) and
242
242
  `mode: "single" | "multi"`. The Cursor credential resolves in one order
243
- everywhere: explicit `apiKey`, then `CURSOR_API_KEY`, then the key
244
- stored by `agent-sdk login`.
243
+ everywhere: explicit `apiKey`, then `CURSOR_API_KEY`, then
244
+ `CURSOR_API_KEY_FILE` (hosted default `/run/cursor/secrets/CURSOR_API_KEY`
245
+ when unset), then `CURSOR_SERVICE_ACCOUNT_KEY`, then the key stored by
246
+ `agent-sdk login`. On a host that has both the service-account key and a
247
+ bind file, the file principal wins.
245
248
 
246
249
  ## What's next
247
250
 
@@ -109,7 +109,7 @@ the agent project. Slugged mounts get a subdirectory named for the slug.
109
109
  | `--host` | Bind this host. The default is loopback-only `127.0.0.1`. |
110
110
  | `--dev` | Disable automatic schedule and reminder firing, admit unsigned loopback GitHub deliveries, and widen playground session access on loopback. |
111
111
  | `--mode` | Use `multi` for slugged routes and an index, or `single` for one agent at the unslugged `/v1/*`. The default is `multi`. |
112
- | `--api-key` | Use this Cursor API key. The command falls back to `CURSOR_API_KEY`, then the stored login. |
112
+ | `--api-key` | Use this Cursor API key. Otherwise the command uses `CURSOR_API_KEY`, then `CURSOR_API_KEY_FILE` (hosted default `/run/cursor/secrets/CURSOR_API_KEY` when unset), then `CURSOR_SERVICE_ACCOUNT_KEY`, then the stored login. |
113
113
  | `--state-root` | Store sessions, streams, workspaces, and channel state here. Keep durable production state outside the agent repository. |
114
114
  | `--bearer-token` | Require this bearer token on routes without authored auth. Mutually exclusive with `--allow-anonymous`. |
115
115
  | `--allow-anonymous` | Admit every caller as one `anonymous` principal. Use only behind a trusted network boundary. |
@@ -557,10 +557,14 @@ runtime, and Cursor account MCP connections. `--key-name` changes the
557
557
  name of a browser-minted key. `login --api-key` validates and stores a
558
558
  key you already created.
559
559
 
560
- `whoami` shows which credential is active and why. `CURSOR_API_KEY`
561
- takes precedence over the stored login. `logout` removes the local
562
- credential file but doesn't revoke the API key. Revoke it in the Cursor
563
- dashboard when it should stop working.
560
+ `whoami` shows which credential is active and why. An explicit key
561
+ wins, then `CURSOR_API_KEY`, then `CURSOR_API_KEY_FILE` (hosted default
562
+ `/run/cursor/secrets/CURSOR_API_KEY` when unset), then
563
+ `CURSOR_SERVICE_ACCOUNT_KEY`, then the stored login. A host that has
564
+ both the service-account key and a bind file authenticates as the file
565
+ principal. `logout` removes the local credential file but doesn't
566
+ revoke the API key. Revoke it in the Cursor dashboard when it should
567
+ stop working.
564
568
 
565
569
  Login and account RPCs honor `CURSOR_API_BASE_URL`. The SDK harness
566
570
  honors `CURSOR_BACKEND_URL`. Set both to the same URL, or keys minted
@@ -598,9 +602,9 @@ agent-sdk deploy [--dir <path>] [--slug <slug> | --all] [--team <id>]
598
602
  [--no-wait] [--json]
599
603
  ```
600
604
 
601
- Managed hosting requires team-admin permission and the team's
602
- cloud-agent entitlement. `--team` defaults to the signed-in account's
603
- team.
605
+ Managed hosting requires team membership and the team's cloud-agent
606
+ entitlement. A team service-account API key with agent access can
607
+ deploy. `--team` defaults to the signed-in account's team.
604
608
 
605
609
  For a single project, the slug defaults to a normalized version of the
606
610
  directory name. Deployment slugs contain lowercase letters, digits, `_`,
@@ -843,8 +847,9 @@ checklist. It doesn't change files.
843
847
  `slack create` opens the signed-in Cursor dashboard wizard. Finish Slack
844
848
  consent and the bot name there. The CLI writes the token pair into
845
849
  `<dir>/.env.local` and runs `doctor`. It requires a signed-in host
846
- (`agent-sdk login` or `CURSOR_API_KEY`). `--prod` provisions the
847
- production app; the default is the development app. `--name` / `--icon`
850
+ (`agent-sdk login` or `CURSOR_API_KEY`). A team service-account key
851
+ cannot create Slack apps. `--prod` provisions the production app; the
852
+ default is the development app. `--name` / `--icon`
848
853
  / `--channel-posts` prefill the wizard. A second create for the same
849
854
  slug and env overwrites the live Slack app. If Slack needs a workspace
850
855
  admin's approval, the wizard waits; keep the CLI running, open Slack's
@@ -957,7 +962,9 @@ These environment variables affect the CLI and its channel packs.
957
962
 
958
963
  | Variable | Meaning |
959
964
  | --- | --- |
960
- | `CURSOR_API_KEY` | Cursor credential. It takes precedence over the stored login. |
965
+ | `CURSOR_API_KEY` | Cursor credential. It takes precedence over `CURSOR_API_KEY_FILE`, `CURSOR_SERVICE_ACCOUNT_KEY`, and the stored login. |
966
+ | `CURSOR_API_KEY_FILE` | Path to a Cursor credential file. Used when `CURSOR_API_KEY` is unset. When this variable is unset, the hosted default `/run/cursor/secrets/CURSOR_API_KEY` is tried. A present file takes precedence over `CURSOR_SERVICE_ACCOUNT_KEY` and the stored login. |
967
+ | `CURSOR_SERVICE_ACCOUNT_KEY` | Team service-account credential. Used when `CURSOR_API_KEY` and `CURSOR_API_KEY_FILE` (including the hosted default path) are unset. It takes precedence over the stored login. |
961
968
  | `CURSOR_API_BASE_URL` | Backend used by login, account, deployment, and event-relay RPCs. |
962
969
  | `CURSOR_BACKEND_URL` | Backend used by the Cursor SDK harness. |
963
970
  | `AGENT_SERVE_CONFIG_DIR` | Directory for stored credentials and update-check state. Defaults to the CLI config directory under `~/.config`. |
@@ -224,7 +224,8 @@ Name the file `account.ts`. `cursor.ts` collides with the IDE `cursor`
224
224
  MCP namespace. `advertiseTools: true` puts connector tools on local
225
225
  turns by name. Without it they sit behind harness meta-tools.
226
226
 
227
- The host must be signed in (`agent-sdk login` or `CURSOR_API_KEY`).
227
+ The host must be signed in (`agent-sdk login`, `CURSOR_API_KEY`, or
228
+ `CURSOR_SERVICE_ACCOUNT_KEY`).
228
229
  `serve` fails fast at startup otherwise, and logs each connector's live
229
230
  status (`connected`, `needsAuth`, `error`) as it starts.
230
231
 
@@ -265,6 +265,8 @@ Continue with these pages:
265
265
  lets an agent launch and steer cloud agents
266
266
  - [Cursor Grok Bot agents](../guides/grokbot-agents.md): the extension
267
267
  that lets an agent talk to Grok Bot agents
268
+ - [Self-improvement](../guides/improve.md): the extension that lets an
269
+ agent change its own source through a cloud agent and a pull request
268
270
  - [Tools](./tools.md): the tool contract extensions contribute to
269
271
  - [Skills](./skills.md): the skill forms an extension can carry
270
272
  - [Project layout](./project-layout.md): where `agent/extensions/` sits
@@ -113,7 +113,8 @@ Cursor checks the project in this order:
113
113
 
114
114
  Validation, discovery, direct server-tool calls, and server startup work
115
115
  without a Cursor credential. Model turns and evals need
116
- `CURSOR_API_KEY` or a saved `agent-sdk login`.
116
+ `CURSOR_API_KEY`, then `CURSOR_API_KEY_FILE` (hosted default `/run/cursor/secrets/CURSOR_API_KEY`), then `CURSOR_SERVICE_ACCOUNT_KEY`, then a saved
117
+ `agent-sdk login`.
117
118
 
118
119
  ## What happens after the first agent works?
119
120
 
@@ -30,7 +30,7 @@ not on `PATH`, use `npx @cursor/july`.
30
30
  | What you see | What to do |
31
31
  | --- | --- |
32
32
  | Built-in file reads and greps fail; the turn retries for a long time | Run under Node 22.13+ (or `tsx`), never Bun. Look for `NGHTTP2_FRAME_SIZE_ERROR` in logs. |
33
- | The turn fails immediately with an API-key error | Sign in with `agent-sdk login`, or set `CURSOR_API_KEY`. Discovery, `info`, `call`, and serve bring-up work without a key; model turns need one. |
33
+ | The turn fails immediately with an API-key error | Sign in with `agent-sdk login`, or set `CURSOR_API_KEY` or `CURSOR_SERVICE_ACCOUNT_KEY`. Discovery, `info`, `call`, and serve bring-up work without a key; model turns need one. |
34
34
  | Replies quote rules or `AGENTS.md` from outside your agent project | The session workspace inherited parent-folder config. Nested git checkouts default `local.cwd` to a per-project cache directory under `~/.cache`. Point `defineAgent({ local: { cwd } })` at a checkout only when the agent should inherit that tree, or set `--state-root` to a clean directory (for example under `/tmp`). |
35
35
  | Yellow box shows Datadog/Linear tools, but the model lists `GetDynamicTools` / IDE `cursor` tools and never calls them | Attached MCP sits behind harness meta-tools, or the harness cwd is still inside another checkout. Set `advertiseTools: true` for named tools on local turns. Check `GET /v1/info` `local.cwd` and `connections[].advertiseTools`. |
36
36
  | Server tools, skills, or workspace seed files never appear | Server tools and sandbox seeds apply on the local runtime (cloud server tools need `--public-url` / `--cloud-tools-url`). Skills reach cloud through the Agent Store when hosting or a personal `CURSOR_API_KEY` is available; otherwise only skills already in the cloud repo. `validate` warns when this combination is present. |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cursor/july",
3
- "version": "0.1.107",
3
+ "version": "0.1.108",
4
4
  "description": "(early alpha) Filesystem-first framework for defining Cursor agents as markdown and TypeScript and serving them over channels with the Cursor SDK.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "repository": {
@@ -146,6 +146,13 @@
146
146
  "import": "./dist/extensions/cursor-grokbot-agents/extension.js",
147
147
  "default": "./dist/extensions/cursor-grokbot-agents/extension.js"
148
148
  },
149
+ "./extensions/improve": {
150
+ "anysphere-source": "./src/extensions/improve/extension.ts",
151
+ "bun": "./dist/extensions/improve/extension.js",
152
+ "types": "./dist/extensions/improve/extension.d.ts",
153
+ "import": "./dist/extensions/improve/extension.js",
154
+ "default": "./dist/extensions/improve/extension.js"
155
+ },
149
156
  "./schedules": {
150
157
  "anysphere-source": "./src/schedules.ts",
151
158
  "types": "./dist/schedules.d.ts",
@@ -133,7 +133,7 @@ npx tsc --noEmit -p ./<slug>
133
133
  tsx does not typecheck. Tool `execute` must return JSON-shaped
134
134
  values: object literals or `type` aliases, not `interface` types.
135
135
 
136
- Model turns need `CURSOR_API_KEY`. Without one, finish the
136
+ Model turns need a Cursor credential (`CURSOR_API_KEY`, then `CURSOR_API_KEY_FILE`, then `CURSOR_SERVICE_ACCOUNT_KEY`, then `agent-sdk login`). Without one, finish the
137
137
  key-free checks, confirm `run` fails with only the API-key error,
138
138
  and hand these over:
139
139
 
@@ -34,7 +34,7 @@ Local `agent-sdk serve`. Hosted start or health failures:
34
34
  | `403` on stream | Wrong principal. Same auth as create; beyond loopback send `--bearer-token`. |
35
35
  | Works on loopback, blocked via tunnel | `localDevStrict()` rejects forwarded headers. Use `--bearer-token`. Never `--allow-anonymous` with account MCP. |
36
36
  | Slack `channel idle … missing credentials` | Expected. `slack doctor --prefix <PREFIX>`. |
37
- | Immediate API-key error | Model turns need `CURSOR_API_KEY`. |
37
+ | Immediate API-key error | Model turns need a Cursor credential (`CURSOR_API_KEY`, then `CURSOR_API_KEY_FILE`, then `CURSOR_SERVICE_ACCOUNT_KEY`, then `agent-sdk login`). |
38
38
  | Approvals or sandbox seeds missing | `runtime: "cloud"`. Those are local only. `validate` warns. |
39
39
  | `validate` clean, CI typecheck fails | tsx skipped types. JSON-shaped returns; `type` not `interface`. |
40
40
 
@@ -29,7 +29,7 @@ agent-sdk eval --dir . --tag smoke
29
29
  | `evals/weather.eval.ts` + `{ id: "nyc" }` | `weather/nyc` |
30
30
 
31
31
  `eval` boots an ephemeral server and a temp state root. `--url`
32
- points at a running agent. Model turns need `CURSOR_API_KEY`.
32
+ points at a running agent. Model turns need a Cursor credential (`CURSOR_API_KEY`, then `CURSOR_API_KEY_FILE`, then `CURSOR_SERVICE_ACCOUNT_KEY`, then `agent-sdk login`).
33
33
 
34
34
  ## Seeding
35
35
 
@@ -28,8 +28,10 @@ Public docs: `node_modules/@cursor/july/dist/docs/llms.txt` or
28
28
  per-project cache directory under `~/.cache`. Point cwd at a
29
29
  checkout only when the agent must inherit that tree.
30
30
  5. **Attached MCP is nameless** until `advertiseTools: true`.
31
- 6. **Model turns need `CURSOR_API_KEY`.** `validate`, `info`, `call`,
32
- and `serve` bring-up do not.
31
+ 6. **Model turns need a Cursor credential** (`CURSOR_API_KEY`, then
32
+ `CURSOR_API_KEY_FILE`, then `CURSOR_SERVICE_ACCOUNT_KEY`, then
33
+ `agent-sdk login`). `validate`,
34
+ `info`, `call`, and `serve` bring-up do not.
33
35
 
34
36
  ## Folder structure
35
37
 
@@ -48,7 +48,7 @@ at deploy. Repos must share one GitHub owner.
48
48
 
49
49
  | Source | When |
50
50
  | --- | --- |
51
- | `cursorAccount` + `serve --cursor-events` | Preferred. Signed-in host (`agent-sdk login` / `CURSOR_API_KEY`). Repos from the channel and from repeatable `--repo owner/name`. Cap 20, one GitHub owner |
51
+ | `cursorAccount` + `serve --cursor-events` | Preferred. Signed-in host (`agent-sdk login`, `CURSOR_API_KEY`, or `CURSOR_SERVICE_ACCOUNT_KEY`). Repos from the channel and from repeatable `--repo owner/name`. Cap 20, one GitHub owner |
52
52
  | HTTP `POST /<slug>/v1/channels/github` with a webhook secret | `allowAll()` + `X-Hub-Signature-256` |
53
53
  | HTTP, no secret | Loopback only. `serve --dev` also admits unsigned loopback (fixtures / forward) |
54
54
 
@@ -99,6 +99,7 @@ Usage:
99
99
  ${CLI} session <sessionId> [--url <baseUrl> | --prod]
100
100
  [--json | --text | --events] [--out <file.ndjson>]
101
101
  [--slug <slug>] [--team <id>] [--dir <path>]
102
+ or: --prod [<sessionId>] --slug <slug> --message "…" [--dry-run] [--as-of <instant>]
102
103
  ${CLI} cost [sessionId] [--url <baseUrl> | --prod] [--json]
103
104
  [--slug <slug>] [--team <id>] [--dir <path>]
104
105
  ${CLI} playground [--url <baseUrl> | --prod] [--session <id>] [--print]
@@ -108,6 +109,7 @@ Usage:
108
109
  [--session <id>] [--continuation-token <t>]
109
110
  [--events <file.ndjson>] [--no-events] [--text]
110
111
  [--timeout-ms <n>] [--no-stream] [--slug <slug>] [--team <id>]
112
+ [--dry-run] [--as-of <instant>]
111
113
  ${CLI} trajectory --events <file.ndjson> [--text]
112
114
  ${CLI} call <tool> [--input <json>] [--dir <path> | --url <baseUrl> | --prod]
113
115
  [--session <id>] [--slug <slug>] [--team <id>]
@@ -197,6 +199,10 @@ Commands:
197
199
  Writes a single events.ndjson trace (summarize with trajectory).
198
200
  Streams tool calls and reply text to stderr when stderr is a TTY.
199
201
  Pass --prod to hit the hosted deployment instead of a local server.
202
+ On an AgentSDK v2 slug, --prod starts a hosted session through
203
+ the control plane (Temporal, no resident engine); --session
204
+ ses_… resumes that exact session. A 404 falls back to the v1
205
+ engine alias.
200
206
  trajectory Summarize an events.ndjson file into a trajectory.
201
207
  call Call an authored server tool deterministically (no model turn)
202
208
  via POST /v1/tools/:toolName. --session runs it inside an
@@ -311,8 +317,11 @@ Options:
311
317
  ALB/ECS checks; use single when one agent is the whole host.
312
318
  --dev Dev mode: mounts POST /v1/dev/schedules/:scheduleId and
313
319
  disables the cron runner (dispatch schedules by hand).
314
- --api-key Cursor API key (defaults to CURSOR_API_KEY, then the
315
- stored \`${CLI} login\` credential).
320
+ --api-key Cursor API key (defaults to CURSOR_API_KEY, then
321
+ CURSOR_API_KEY_FILE hosted default
322
+ /run/cursor/secrets/CURSOR_API_KEY when unset —
323
+ then CURSOR_SERVICE_ACCOUNT_KEY, then the stored
324
+ \`${CLI} login\` credential).
316
325
  --key-name login: label for the minted API key (defaults to
317
326
  "${CLI} (<hostname>)").
318
327
  --state-root Durable state directory (default <dir>/.agent-serve). Put it
@@ -361,6 +370,9 @@ Options:
361
370
  --dir basename. Mutually exclusive with --url. Requires
362
371
  \`${CLI} login\`. For eval, this is how you opt into the
363
372
  persisted server-side batch (default is local).
373
+ --dry-run run/session --prod: mark the hosted v2 turn non-mutating.
374
+ --as-of run/session --prod: freeze the session clock at this
375
+ timezone-bearing ISO-8601 instant.
364
376
  --once logs: print current progress / log buffer once and exit
365
377
  (default is to follow).
366
378
  --print playground/docs: print the URL only; do not open a
@@ -571,6 +583,7 @@ async function main(argv: string[]): Promise<number> {
571
583
  context: { type: "string" },
572
584
  comment: { type: "string" },
573
585
  "dry-run": { type: "boolean", default: false },
586
+ "as-of": { type: "string" },
574
587
  out: { type: "string" },
575
588
  team: { type: "string" },
576
589
  "no-wait": { type: "boolean", default: false },
@@ -914,6 +927,8 @@ async function main(argv: string[]): Promise<number> {
914
927
  stateRoot: values["state-root"],
915
928
  timeoutMs: parseTimeoutMs(values["timeout-ms"]),
916
929
  stream: values["no-stream"] ? false : undefined,
930
+ dryRun: values["dry-run"],
931
+ asOf: values["as-of"],
917
932
  })
918
933
  );
919
934
  }
@@ -1094,6 +1109,10 @@ async function main(argv: string[]): Promise<number> {
1094
1109
  }
1095
1110
 
1096
1111
  case "session": {
1112
+ const messages = await loadMessages(
1113
+ values.message,
1114
+ values["messages-file"]
1115
+ );
1097
1116
  return cmdSession(
1098
1117
  positionals[0],
1099
1118
  axFromOptions({
@@ -1108,6 +1127,10 @@ async function main(argv: string[]): Promise<number> {
1108
1127
  text: values.text,
1109
1128
  rawEvents: values["raw-events"],
1110
1129
  out: values.out,
1130
+ messages,
1131
+ sessionId: values["session-id"] ?? values.session,
1132
+ dryRun: values["dry-run"],
1133
+ asOf: values["as-of"],
1111
1134
  })
1112
1135
  );
1113
1136
  }
@@ -1488,6 +1511,8 @@ function axFromOptions(
1488
1511
  sessionId: partial.sessionId,
1489
1512
  resume: partial.resume,
1490
1513
  continuationToken: partial.continuationToken,
1514
+ dryRun: partial.dryRun,
1515
+ asOf: partial.asOf,
1491
1516
  timeoutMs: partial.timeoutMs,
1492
1517
  events: partial.events,
1493
1518
  text: partial.text,
@@ -831,11 +831,9 @@ async function handlePullRequest(input: {
831
831
  dispatch.message ?? defaultGitHubPullRequestMessage(ctx, pullRequest),
832
832
  ...(dispatch.context ?? []),
833
833
  ].join("\n");
834
- const cloud = await resolveCloudOptions(
835
- input.options.cloud,
836
- ctx,
837
- pullRequest
838
- );
834
+ const cloud =
835
+ dispatch.cloud ??
836
+ (await resolveCloudOptions(input.options.cloud, ctx, pullRequest));
839
837
  return startTurn({
840
838
  options: input.options,
841
839
  args: input.args,
@@ -1558,6 +1556,8 @@ async function startTurn(input: {
1558
1556
  }): Promise<Response> {
1559
1557
  const files = input.dispatch.workspaceFiles;
1560
1558
  const lazy = typeof files === "function";
1559
+ const cloud = input.dispatch.cloud ?? input.cloud;
1560
+ const state = { ...input.dispatch.state, ...input.state };
1561
1561
 
1562
1562
  const sendTurn = async () => {
1563
1563
  const workspaceFiles = lazy ? await files() : files;
@@ -1568,11 +1568,11 @@ async function startTurn(input: {
1568
1568
  ? { continuationToken: githubContinuationKey(input.ctx) }
1569
1569
  : {}),
1570
1570
  title: input.dispatch.title ?? defaultGitHubTitle(input.ctx),
1571
- ...(input.cloud === undefined ? {} : { cloud: input.cloud }),
1571
+ cloud,
1572
1572
  ...(workspaceFiles === undefined ? {} : { workspaceFiles }),
1573
- state: input.state as unknown as JsonValue,
1573
+ state: state as unknown as JsonValue,
1574
1574
  // Resume must refresh headSha / refs without wiping sticky banner id.
1575
- refreshState: input.state as unknown as JsonValue,
1575
+ refreshState: state as unknown as JsonValue,
1576
1576
  });
1577
1577
  };
1578
1578
 
@@ -7,6 +7,7 @@ import type {
7
7
  ChannelEventHandlers,
8
8
  ChannelStartArgs,
9
9
  HostContext,
10
+ JsonObject,
10
11
  SendMessageFn,
11
12
  SendMessageOptions,
12
13
  } from "../../types.js";
@@ -355,6 +356,10 @@ export interface GitHubTurnDispatch {
355
356
  message?: string;
356
357
  /** Optional session title override. */
357
358
  title?: string;
359
+ /** Per-turn cloud options. Overrides the channel-level `cloud` resolver. */
360
+ cloud?: AgentCloudOptions;
361
+ /** Extra durable channel state. Provider-owned fields take precedence. */
362
+ state?: JsonObject;
358
363
  /**
359
364
  * Seeded into the session workspace before the turn (`send`'s
360
365
  * `workspaceFiles`). A function runs after the webhook is
@@ -99,13 +99,20 @@ function asBoolean(value: unknown): boolean | undefined {
99
99
  function originActor(value: unknown): OriginActor | undefined {
100
100
  const record = asRecord(value);
101
101
  if (record === undefined) return undefined;
102
- const nestedUser = asRecord(record.user);
103
- const nestedApp = asRecord(record.app);
104
- const id =
105
- asNonEmptyString(nestedUser?.id) ??
106
- asNonEmptyString(nestedApp?.id) ??
107
- asNonEmptyString(asRecord(record.serviceAccount)?.id) ??
108
- asNonEmptyString(record.id);
102
+
103
+ const nestedActors = [
104
+ ["user", asRecord(record.user)],
105
+ ["app", asRecord(record.app)],
106
+ ["service_account", asRecord(record.serviceAccount)],
107
+ ] as const;
108
+ for (const [kind, actor] of nestedActors) {
109
+ const id = asNonEmptyString(actor?.id);
110
+ if (id !== undefined) {
111
+ return { id, kind };
112
+ }
113
+ }
114
+
115
+ const id = asNonEmptyString(record.id);
109
116
  if (id === undefined) return undefined;
110
117
  const kind = asNonEmptyString(record.kind);
111
118
  return kind === undefined ? { id } : { id, kind };
@@ -361,16 +368,20 @@ export function defaultOriginAuth(
361
368
  ctx: Omit<OriginEventContext, "host" | "artifacts" | "origin">
362
369
  ): AuthContext {
363
370
  const senderId = ctx.sender?.id;
371
+ const senderKind = ctx.sender?.kind;
364
372
  return {
365
373
  authenticator: "origin-webhook",
366
374
  principalId: senderId ?? "origin",
367
- principalType: ctx.sender?.kind === "app" ? "service" : "user",
375
+ principalType:
376
+ senderKind === "app" || senderKind === "service_account"
377
+ ? "service"
378
+ : "user",
368
379
  attributes: {
369
380
  conversation_kind: "pull_request",
370
381
  repository: ctx.repository.fullName,
371
382
  ...(ctx.deliveryId === undefined ? {} : { delivery_id: ctx.deliveryId }),
372
383
  ...(senderId === undefined ? {} : { subject: senderId }),
373
- ...(ctx.sender?.kind === undefined ? {} : { user_type: ctx.sender.kind }),
384
+ ...(senderKind === undefined ? {} : { user_type: senderKind }),
374
385
  issuer: `origin:${ctx.repository.owner}`,
375
386
  },
376
387
  };
@@ -461,17 +472,19 @@ async function startTurn(input: {
461
472
  state: OriginChannelState;
462
473
  }): Promise<Response> {
463
474
  const source = continuationSource(input.options.continuation, "origin");
475
+ const cloud = input.dispatch.cloud ?? input.cloud;
476
+ const state = { ...input.dispatch.state, ...input.state };
464
477
  const session = await input.args.send(input.message, {
465
478
  auth: input.dispatch.auth,
466
479
  ...(source === "engine"
467
480
  ? { continuationToken: originContinuationKey(input.ctx) }
468
481
  : {}),
469
482
  title: input.dispatch.title ?? defaultOriginTitle(input.ctx),
470
- ...(input.cloud === undefined ? {} : { cloud: input.cloud }),
471
- state: input.state as unknown as JsonValue,
483
+ cloud,
484
+ state: state as unknown as JsonValue,
472
485
  // Resume must refresh the triggering comment / delivery identifiers so
473
486
  // reply delivery targets the latest wake, not the session's first.
474
- refreshState: input.state as unknown as JsonValue,
487
+ refreshState: state as unknown as JsonValue,
475
488
  });
476
489
  return turnStarted(session);
477
490
  }
@@ -605,7 +618,10 @@ export async function dispatchOriginWebhook(input: {
605
618
  ctx,
606
619
  dispatch,
607
620
  extra: { event: eventType },
608
- message: `Origin comment on ${ctx.repository.fullName}#${ctx.pullRequestNumber}`,
621
+ message:
622
+ commentBody.trim() === ""
623
+ ? `Origin comment on ${ctx.repository.fullName}#${ctx.pullRequestNumber}`
624
+ : commentBody.trim(),
609
625
  triggeringCommentId: commentId,
610
626
  });
611
627
  }
@@ -7,6 +7,7 @@ import type {
7
7
  ChannelEventHandlers,
8
8
  ChannelStartArgs,
9
9
  HostContext,
10
+ JsonObject,
10
11
  SendMessageFn,
11
12
  } from "../../types.js";
12
13
  import type { OriginTokenProvider } from "./api.js";
@@ -95,6 +96,10 @@ export type OriginTurnDispatch = {
95
96
  message?: string;
96
97
  title?: string;
97
98
  context?: readonly string[];
99
+ /** Per-turn cloud options. Overrides the channel-level `cloud` resolver. */
100
+ cloud?: AgentCloudOptions;
101
+ /** Extra durable channel state. Provider-owned fields take precedence. */
102
+ state?: JsonObject;
98
103
  };
99
104
 
100
105
  /** Bound per-delivery helpers passed to an {@link OriginTaskDispatch.task}. */