@cursor/july 0.1.105 → 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 (395) hide show
  1. package/README.md +10 -5
  2. package/dist/bin/agent-serve.js +31 -16
  3. package/dist/channels/bitbucket/types.d.ts +2 -4
  4. package/dist/channels/bitbucket/types.d.ts.map +1 -1
  5. package/dist/channels/deployments/types.d.ts +5 -8
  6. package/dist/channels/deployments/types.d.ts.map +1 -1
  7. package/dist/channels/github/github-channel.js +8 -5
  8. package/dist/channels/github/types.d.ts +7 -5
  9. package/dist/channels/github/types.d.ts.map +1 -1
  10. package/dist/channels/gitlab/types.d.ts +2 -5
  11. package/dist/channels/gitlab/types.d.ts.map +1 -1
  12. package/dist/channels/origin/origin-channel.d.ts.map +1 -1
  13. package/dist/channels/origin/origin-channel.js +27 -13
  14. package/dist/channels/origin/types.d.ts +7 -4
  15. package/dist/channels/origin/types.d.ts.map +1 -1
  16. package/dist/channels/slack/defaults.d.ts.map +1 -1
  17. package/dist/channels/slack/defaults.js +3 -0
  18. package/dist/channels/slack/dispatch.d.ts.map +1 -1
  19. package/dist/channels/slack/dispatch.js +1 -1
  20. package/dist/channels/slack/live-delivery.d.ts.map +1 -1
  21. package/dist/channels/slack/live-delivery.js +48 -11
  22. package/dist/channels/slack/types.d.ts +4 -3
  23. package/dist/channels/slack/types.d.ts.map +1 -1
  24. package/dist/channels.d.ts +45 -0
  25. package/dist/channels.d.ts.map +1 -1
  26. package/dist/channels.js +106 -7
  27. package/dist/connections.d.ts +2 -1
  28. package/dist/connections.d.ts.map +1 -1
  29. package/dist/connections.js +2 -1
  30. package/dist/docs/404.html +3 -3
  31. package/dist/docs/ab.html +6 -6
  32. package/dist/docs/assets/{app.BVwaffdK.js → app.BASKM3M4.js} +1 -1
  33. package/dist/docs/assets/chunks/@localSearchIndexroot.BHZYsNVi.js +1 -0
  34. package/dist/docs/assets/chunks/{VPLocalSearchBox.WuWTZ1x8.js → VPLocalSearchBox.BOKxlYGP.js} +2 -2
  35. package/dist/docs/assets/chunks/{theme.BYdI_6sF.js → theme.DbDZW-zb.js} +2 -2
  36. package/dist/docs/assets/{deployment.md.MFPKqsqI.js → deployment.md.JenwuCCB.js} +4 -4
  37. package/dist/docs/assets/{deployment.md.MFPKqsqI.lean.js → deployment.md.JenwuCCB.lean.js} +1 -1
  38. package/dist/docs/assets/{evals.md.CbMoebP1.js → evals.md.C1ekS3k2.js} +1 -1
  39. package/dist/docs/assets/guides_cloud-agents.md.BsloyHdY.js +9 -0
  40. package/dist/docs/assets/{guides_cloud-agents.md.DS8RIjwx.lean.js → guides_cloud-agents.md.BsloyHdY.lean.js} +1 -1
  41. package/dist/docs/assets/{guides_github.md.c0gdGJ-D.js → guides_github.md.BH33UEBJ.js} +1 -1
  42. package/dist/docs/assets/{guides_grokbot-agents.md.DVqdhBKb.js → guides_grokbot-agents.md.DyV-WArv.js} +1 -1
  43. package/dist/docs/assets/guides_improve.md.BGVk32bK.js +14 -0
  44. package/dist/docs/assets/guides_improve.md.BGVk32bK.lean.js +1 -0
  45. package/dist/docs/assets/{guides_opentelemetry.md.COh9jFVg.js → guides_opentelemetry.md.SCRMskno.js} +3 -3
  46. package/dist/docs/assets/{guides_opentelemetry.md.COh9jFVg.lean.js → guides_opentelemetry.md.SCRMskno.lean.js} +1 -1
  47. package/dist/docs/assets/{guides_slack.md.9oHPye9o.js → guides_slack.md.D4RVMM4G.js} +3 -3
  48. package/dist/docs/assets/{guides_slack.md.9oHPye9o.lean.js → guides_slack.md.D4RVMM4G.lean.js} +1 -1
  49. package/dist/docs/assets/index.md.BjH1w2ZW.js +5 -0
  50. package/dist/docs/assets/{reference_agent-config.md.CHNpiyp4.js → reference_agent-config.md.CvoL6pof.js} +1 -1
  51. package/dist/docs/assets/{reference_channels.md.DBGcaB7m.js → reference_channels.md.D-qTqwcq.js} +2 -2
  52. package/dist/docs/assets/{reference_channels.md.DBGcaB7m.lean.js → reference_channels.md.D-qTqwcq.lean.js} +1 -1
  53. package/dist/docs/assets/{reference_cli.md.C6Lo8SEd.js → reference_cli.md.Ca26u0Es.js} +6 -6
  54. package/dist/docs/assets/{reference_cli.md.C6Lo8SEd.lean.js → reference_cli.md.Ca26u0Es.lean.js} +1 -1
  55. package/dist/docs/assets/{reference_connections.md.Di6jJAXF.js → reference_connections.md.BojkC6c5.js} +1 -1
  56. package/dist/docs/assets/{reference_extensions.md.CGmMLblt.js → reference_extensions.md.CPWt00ds.js} +1 -1
  57. package/dist/docs/assets/{scaffolding-agents.md.em43xlY1.js → scaffolding-agents.md.Kctn3OVb.js} +1 -1
  58. package/dist/docs/assets/{skills_create-agent.md.BVoWPcan.js → skills_create-agent.md.Q3h6Je-e.js} +1 -1
  59. package/dist/docs/assets/{skills_debug.md.CDbPhHfg.js → skills_debug.md.CVjCXMFF.js} +1 -1
  60. package/dist/docs/assets/{skills_debug.md.CDbPhHfg.lean.js → skills_debug.md.CVjCXMFF.lean.js} +1 -1
  61. package/dist/docs/assets/{skills_evals.md.723kpUmA.js → skills_evals.md.BhovOvrl.js} +1 -1
  62. package/dist/docs/assets/skills_framework-map.md.D-tFZhFS.js +1 -0
  63. package/dist/docs/assets/{skills_framework-map.md.haibFyoB.lean.js → skills_framework-map.md.D-tFZhFS.lean.js} +1 -1
  64. package/dist/docs/assets/{skills_github.md.D0JahM8c.js → skills_github.md.hgFX_oKY.js} +1 -1
  65. package/dist/docs/assets/{skills_otel.md.CqhobH3B.js → skills_otel.md.B5Ddv1xH.js} +1 -1
  66. package/dist/docs/assets/{style.BRuM8477.css → style.DCD_zyg3.css} +1 -1
  67. package/dist/docs/assets/troubleshooting.md.CYEAO9bM.js +1 -0
  68. package/dist/docs/building-with-agents.html +6 -6
  69. package/dist/docs/concepts.html +5 -5
  70. package/dist/docs/deployment.html +9 -9
  71. package/dist/docs/deployment.md +7 -2
  72. package/dist/docs/evals.html +8 -8
  73. package/dist/docs/evals.md +3 -2
  74. package/dist/docs/guides/agent-to-agent.html +6 -6
  75. package/dist/docs/guides/cloud-agents.html +7 -7
  76. package/dist/docs/guides/cloud-agents.md +4 -3
  77. package/dist/docs/guides/convert-automation.html +6 -6
  78. package/dist/docs/guides/github.html +7 -7
  79. package/dist/docs/guides/github.md +2 -1
  80. package/dist/docs/guides/grokbot-agents.html +7 -7
  81. package/dist/docs/guides/grokbot-agents.md +2 -2
  82. package/dist/docs/guides/human-in-the-loop.html +6 -6
  83. package/dist/docs/guides/improve.html +40 -0
  84. package/dist/docs/guides/improve.md +91 -0
  85. package/dist/docs/guides/mcp-oauth.html +6 -6
  86. package/dist/docs/guides/opentelemetry.html +8 -8
  87. package/dist/docs/guides/opentelemetry.md +3 -4
  88. package/dist/docs/guides/slack.html +8 -8
  89. package/dist/docs/guides/slack.md +2 -1
  90. package/dist/docs/guides/webhooks.html +6 -6
  91. package/dist/docs/hashmap.json +1 -1
  92. package/dist/docs/hillclimbing.html +6 -6
  93. package/dist/docs/index.html +8 -8
  94. package/dist/docs/index.md +4 -0
  95. package/dist/docs/llms-full.txt +180 -61
  96. package/dist/docs/llms.txt +1 -0
  97. package/dist/docs/quickstart.html +6 -6
  98. package/dist/docs/reference/agent-config.html +7 -7
  99. package/dist/docs/reference/agent-config.md +5 -2
  100. package/dist/docs/reference/artifacts.html +6 -6
  101. package/dist/docs/reference/channels.html +7 -7
  102. package/dist/docs/reference/channels.md +11 -19
  103. package/dist/docs/reference/cli.html +11 -11
  104. package/dist/docs/reference/cli.md +23 -13
  105. package/dist/docs/reference/connections.html +8 -8
  106. package/dist/docs/reference/connections.md +2 -1
  107. package/dist/docs/reference/extensions.html +7 -7
  108. package/dist/docs/reference/extensions.md +2 -0
  109. package/dist/docs/reference/hooks.html +6 -6
  110. package/dist/docs/reference/http-api.html +6 -6
  111. package/dist/docs/reference/instructions.html +6 -6
  112. package/dist/docs/reference/playground.html +5 -5
  113. package/dist/docs/reference/project-layout.html +6 -6
  114. package/dist/docs/reference/prompt.html +6 -6
  115. package/dist/docs/reference/result.html +6 -6
  116. package/dist/docs/reference/schedules.html +6 -6
  117. package/dist/docs/reference/sessions.html +5 -5
  118. package/dist/docs/reference/skills.html +6 -6
  119. package/dist/docs/reference/subagents.html +6 -6
  120. package/dist/docs/reference/tools.html +6 -6
  121. package/dist/docs/scaffolding-agents.html +6 -6
  122. package/dist/docs/scaffolding-agents.md +2 -1
  123. package/dist/docs/skills/ab.html +6 -6
  124. package/dist/docs/skills/create-agent.html +8 -8
  125. package/dist/docs/skills/create-agent.md +1 -1
  126. package/dist/docs/skills/debug.html +6 -6
  127. package/dist/docs/skills/debug.md +1 -1
  128. package/dist/docs/skills/evals.html +8 -8
  129. package/dist/docs/skills/evals.md +1 -1
  130. package/dist/docs/skills/framework-map.html +6 -6
  131. package/dist/docs/skills/framework-map.md +4 -2
  132. package/dist/docs/skills/github.html +8 -8
  133. package/dist/docs/skills/github.md +1 -1
  134. package/dist/docs/skills/hillclimb.html +6 -6
  135. package/dist/docs/skills/index.html +5 -5
  136. package/dist/docs/skills/mcp-auth.html +6 -6
  137. package/dist/docs/skills/otel.html +8 -8
  138. package/dist/docs/skills/otel.md +3 -3
  139. package/dist/docs/skills/setup-slack.html +6 -6
  140. package/dist/docs/storage.html +6 -6
  141. package/dist/docs/templates/agentic-owners.html +6 -6
  142. package/dist/docs/templates/agents-md.html +6 -6
  143. package/dist/docs/templates/code-wiki.html +6 -6
  144. package/dist/docs/templates/demo.html +6 -6
  145. package/dist/docs/templates/grokbot-agents.html +6 -6
  146. package/dist/docs/templates/pr-autofixer.html +6 -6
  147. package/dist/docs/templates/security-help.html +6 -6
  148. package/dist/docs/templates/security-reviewer.html +6 -6
  149. package/dist/docs/templates/triage.html +6 -6
  150. package/dist/docs/troubleshooting.html +6 -6
  151. package/dist/docs/troubleshooting.md +1 -1
  152. package/dist/extensions/improve/extension.d.ts +46 -0
  153. package/dist/extensions/improve/extension.d.ts.map +1 -0
  154. package/dist/extensions/improve/extension.js +41 -0
  155. package/dist/extensions/improve/skills/yourself.d.ts +4 -0
  156. package/dist/extensions/improve/skills/yourself.d.ts.map +1 -0
  157. package/dist/extensions/improve/skills/yourself.js +43 -0
  158. package/dist/index.d.ts +4 -5
  159. package/dist/index.d.ts.map +1 -1
  160. package/dist/index.js +3 -4
  161. package/dist/internal/builtin-tools/artifacts.d.ts.map +1 -1
  162. package/dist/internal/builtin-tools/artifacts.js +2 -3
  163. package/dist/internal/channel-route-dispatch.d.ts +13 -0
  164. package/dist/internal/channel-route-dispatch.d.ts.map +1 -0
  165. package/dist/internal/channel-route-dispatch.js +62 -0
  166. package/dist/internal/channel-state.d.ts +17 -0
  167. package/dist/internal/channel-state.d.ts.map +1 -0
  168. package/dist/internal/channel-state.js +78 -0
  169. package/dist/internal/cli-ax.d.ts +7 -0
  170. package/dist/internal/cli-ax.d.ts.map +1 -1
  171. package/dist/internal/cli-ax.js +99 -1
  172. package/dist/internal/cli-cursor.d.ts.map +1 -1
  173. package/dist/internal/cli-cursor.js +2 -0
  174. package/dist/internal/cli-deploy.d.ts.map +1 -1
  175. package/dist/internal/cli-deploy.js +61 -25
  176. package/dist/internal/cli-mcp-oauth.d.ts.map +1 -1
  177. package/dist/internal/cli-mcp-oauth.js +15 -0
  178. package/dist/internal/cli-mcp.d.ts.map +1 -1
  179. package/dist/internal/cli-mcp.js +12 -0
  180. package/dist/internal/cli-slack.d.ts.map +1 -1
  181. package/dist/internal/cli-slack.js +8 -2
  182. package/dist/internal/cursor/backend-client.d.ts +25 -0
  183. package/dist/internal/cursor/backend-client.d.ts.map +1 -1
  184. package/dist/internal/cursor/backend-client.js +57 -2
  185. package/dist/internal/cursor/credentials.d.ts +8 -2
  186. package/dist/internal/cursor/credentials.d.ts.map +1 -1
  187. package/dist/internal/cursor/credentials.js +27 -5
  188. package/dist/internal/deploy-client.d.ts +35 -0
  189. package/dist/internal/deploy-client.d.ts.map +1 -1
  190. package/dist/internal/deploy-client.js +46 -0
  191. package/dist/internal/deploy-manifest.d.ts +26 -0
  192. package/dist/internal/deploy-manifest.d.ts.map +1 -1
  193. package/dist/internal/deploy-manifest.js +99 -13
  194. package/dist/internal/describe-error.d.ts +1 -0
  195. package/dist/internal/describe-error.d.ts.map +1 -1
  196. package/dist/internal/describe-error.js +25 -0
  197. package/dist/internal/discovery/agent.d.ts.map +1 -1
  198. package/dist/internal/discovery/agent.js +1 -0
  199. package/dist/internal/discovery/info.d.ts.map +1 -1
  200. package/dist/internal/discovery/info.js +7 -3
  201. package/dist/internal/discovery/modules.d.ts +1 -1
  202. package/dist/internal/discovery/modules.d.ts.map +1 -1
  203. package/dist/internal/discovery/modules.js +1 -0
  204. package/dist/internal/discovery/project.d.ts.map +1 -1
  205. package/dist/internal/discovery/project.js +3 -0
  206. package/dist/internal/discovery/reminders.d.ts +7 -0
  207. package/dist/internal/discovery/reminders.d.ts.map +1 -0
  208. package/dist/internal/discovery/reminders.js +65 -0
  209. package/dist/internal/discovery/subagent.js +1 -0
  210. package/dist/internal/distribution.d.ts +5 -0
  211. package/dist/internal/distribution.d.ts.map +1 -1
  212. package/dist/internal/distribution.js +17 -0
  213. package/dist/internal/framework-storage-selection.d.ts +14 -3
  214. package/dist/internal/framework-storage-selection.d.ts.map +1 -1
  215. package/dist/internal/framework-storage-selection.js +36 -6
  216. package/dist/internal/guest-network.d.ts +4 -10
  217. package/dist/internal/guest-network.d.ts.map +1 -1
  218. package/dist/internal/guest-network.js +44 -26
  219. package/dist/internal/hosted-admission-adapter.d.ts +2 -0
  220. package/dist/internal/hosted-admission-adapter.d.ts.map +1 -1
  221. package/dist/internal/hosted-catch-protocol.d.ts +51 -0
  222. package/dist/internal/hosted-catch-protocol.d.ts.map +1 -0
  223. package/dist/internal/hosted-catch-protocol.js +103 -0
  224. package/dist/internal/hosted-catch.d.ts +40 -0
  225. package/dist/internal/hosted-catch.d.ts.map +1 -0
  226. package/dist/internal/hosted-catch.js +149 -0
  227. package/dist/internal/hosted-delivery-protocol.d.ts +89 -0
  228. package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
  229. package/dist/internal/hosted-delivery-protocol.js +309 -0
  230. package/dist/internal/hosted-delivery.d.ts +20 -1
  231. package/dist/internal/hosted-delivery.d.ts.map +1 -1
  232. package/dist/internal/hosted-delivery.js +179 -36
  233. package/dist/internal/hosted-execution-diag.d.ts +4 -1
  234. package/dist/internal/hosted-execution-diag.d.ts.map +1 -1
  235. package/dist/internal/hosted-execution-diag.js +13 -4
  236. package/dist/internal/hosted-execution-flush.d.ts +3 -0
  237. package/dist/internal/hosted-execution-flush.d.ts.map +1 -1
  238. package/dist/internal/hosted-execution-flush.js +2 -4
  239. package/dist/internal/http-control-plane-session.d.ts +30 -0
  240. package/dist/internal/http-control-plane-session.d.ts.map +1 -0
  241. package/dist/internal/http-control-plane-session.js +83 -0
  242. package/dist/internal/legacy-command-guard.d.ts +22 -0
  243. package/dist/internal/legacy-command-guard.d.ts.map +1 -0
  244. package/dist/internal/legacy-command-guard.js +51 -0
  245. package/dist/internal/local-control-plane.d.ts +18 -2
  246. package/dist/internal/local-control-plane.d.ts.map +1 -1
  247. package/dist/internal/local-control-plane.js +199 -17
  248. package/dist/internal/platform-timers.d.ts +7 -0
  249. package/dist/internal/platform-timers.d.ts.map +1 -1
  250. package/dist/internal/platform-timers.js +139 -0
  251. package/dist/internal/reminder-control-plane-protocol.d.ts +189 -0
  252. package/dist/internal/reminder-control-plane-protocol.d.ts.map +1 -0
  253. package/dist/internal/reminder-control-plane-protocol.js +251 -0
  254. package/dist/internal/reminder-runner.d.ts +56 -6
  255. package/dist/internal/reminder-runner.d.ts.map +1 -1
  256. package/dist/internal/reminder-runner.js +372 -57
  257. package/dist/internal/reminder-schedule.d.ts +5 -2
  258. package/dist/internal/reminder-schedule.d.ts.map +1 -1
  259. package/dist/internal/reminder-schedule.js +8 -6
  260. package/dist/internal/reminder-store.d.ts +24 -7
  261. package/dist/internal/reminder-store.d.ts.map +1 -1
  262. package/dist/internal/reminder-store.js +6 -5
  263. package/dist/internal/request-error-status.d.ts +2 -0
  264. package/dist/internal/request-error-status.d.ts.map +1 -1
  265. package/dist/internal/request-error-status.js +22 -3
  266. package/dist/internal/resolve-prod-target.d.ts +2 -0
  267. package/dist/internal/resolve-prod-target.d.ts.map +1 -1
  268. package/dist/internal/resolve-prod-target.js +13 -0
  269. package/dist/internal/scm/pr-url.d.ts +40 -0
  270. package/dist/internal/scm/pr-url.d.ts.map +1 -1
  271. package/dist/internal/scm/pr-url.js +93 -14
  272. package/dist/internal/sdk-runner.d.ts.map +1 -1
  273. package/dist/internal/sdk-runner.js +4 -3
  274. package/dist/internal/server.d.ts.map +1 -1
  275. package/dist/internal/server.js +118 -77
  276. package/dist/internal/session-engine.d.ts +6 -6
  277. package/dist/internal/session-engine.d.ts.map +1 -1
  278. package/dist/internal/session-engine.js +100 -67
  279. package/dist/playground/assets/{index-BaQzjaNK.js → index-BMDqAeXu.js} +34 -34
  280. package/dist/playground/assets/index-LUgJoWdL.css +1 -0
  281. package/dist/playground/index.html +2 -2
  282. package/dist/reminders.d.ts +24 -5
  283. package/dist/reminders.d.ts.map +1 -1
  284. package/dist/reminders.js +28 -5
  285. package/dist/storage-backends/cursor-hosted.d.ts +6 -0
  286. package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
  287. package/dist/storage-backends/cursor-hosted.js +29 -1
  288. package/dist/types.d.ts +122 -25
  289. package/dist/types.d.ts.map +1 -1
  290. package/docs/README.md +4 -0
  291. package/docs/deployment.md +7 -2
  292. package/docs/evals.md +3 -2
  293. package/docs/guides/cloud-agents.md +4 -3
  294. package/docs/guides/github.md +2 -1
  295. package/docs/guides/grokbot-agents.md +2 -2
  296. package/docs/guides/improve.md +96 -0
  297. package/docs/guides/opentelemetry.md +3 -4
  298. package/docs/guides/slack.md +2 -1
  299. package/docs/reference/agent-config.md +5 -2
  300. package/docs/reference/channels.md +11 -19
  301. package/docs/reference/cli.md +23 -13
  302. package/docs/reference/connections.md +2 -1
  303. package/docs/reference/extensions.md +2 -0
  304. package/docs/scaffolding-agents.md +2 -1
  305. package/docs/troubleshooting.md +1 -1
  306. package/package.json +10 -3
  307. package/skills/create-agent/SKILL.md +1 -1
  308. package/skills/debug/SKILL.md +1 -1
  309. package/skills/evals/SKILL.md +1 -1
  310. package/skills/framework-map/SKILL.md +4 -2
  311. package/skills/github/SKILL.md +1 -1
  312. package/skills/otel/SKILL.md +3 -3
  313. package/src/bin/agent-serve.ts +28 -11
  314. package/src/channels/bitbucket/types.ts +2 -4
  315. package/src/channels/deployments/types.ts +5 -8
  316. package/src/channels/github/github-channel.ts +8 -8
  317. package/src/channels/github/types.ts +7 -4
  318. package/src/channels/gitlab/types.ts +2 -5
  319. package/src/channels/origin/origin-channel.ts +29 -13
  320. package/src/channels/origin/types.ts +7 -3
  321. package/src/channels/slack/defaults.ts +3 -0
  322. package/src/channels/slack/dispatch.ts +1 -0
  323. package/src/channels/slack/live-delivery.ts +53 -12
  324. package/src/channels/slack/types.ts +4 -3
  325. package/src/channels.ts +157 -10
  326. package/src/connections.ts +2 -1
  327. package/src/extensions/improve/extension.ts +70 -0
  328. package/src/extensions/improve/skills/yourself.ts +50 -0
  329. package/src/index.ts +6 -3
  330. package/src/internal/builtin-tools/artifacts.ts +2 -3
  331. package/src/internal/channel-route-dispatch.ts +66 -0
  332. package/src/internal/channel-state.ts +96 -0
  333. package/src/internal/cli-ax.ts +110 -1
  334. package/src/internal/cli-cursor.ts +4 -1
  335. package/src/internal/cli-deploy.ts +80 -22
  336. package/src/internal/cli-mcp-oauth.ts +18 -0
  337. package/src/internal/cli-mcp.ts +11 -0
  338. package/src/internal/cli-slack.ts +15 -2
  339. package/src/internal/cursor/backend-client.ts +90 -2
  340. package/src/internal/cursor/credentials.ts +35 -7
  341. package/src/internal/deploy-client.ts +70 -0
  342. package/src/internal/deploy-manifest.ts +131 -12
  343. package/src/internal/describe-error.ts +28 -0
  344. package/src/internal/discovery/agent.ts +1 -0
  345. package/src/internal/discovery/info.ts +6 -0
  346. package/src/internal/discovery/modules.ts +2 -4
  347. package/src/internal/discovery/project.ts +3 -0
  348. package/src/internal/discovery/reminders.ts +65 -0
  349. package/src/internal/discovery/subagent.ts +1 -0
  350. package/src/internal/distribution.ts +20 -0
  351. package/src/internal/framework-storage-selection.ts +43 -6
  352. package/src/internal/guest-network.ts +46 -29
  353. package/src/internal/hosted-admission-adapter.ts +2 -0
  354. package/src/internal/hosted-catch-protocol.ts +130 -0
  355. package/src/internal/hosted-catch.ts +192 -0
  356. package/src/internal/hosted-delivery-protocol.ts +483 -0
  357. package/src/internal/hosted-delivery.ts +303 -43
  358. package/src/internal/hosted-execution-diag.ts +21 -3
  359. package/src/internal/hosted-execution-flush.ts +6 -3
  360. package/src/internal/http-control-plane-session.ts +104 -0
  361. package/src/internal/legacy-command-guard.ts +59 -0
  362. package/src/internal/local-control-plane.ts +281 -22
  363. package/src/internal/platform-timers.ts +191 -0
  364. package/src/internal/reminder-control-plane-protocol.ts +512 -0
  365. package/src/internal/reminder-runner.ts +481 -57
  366. package/src/internal/reminder-schedule.ts +11 -6
  367. package/src/internal/reminder-store.ts +27 -7
  368. package/src/internal/request-error-status.ts +27 -3
  369. package/src/internal/resolve-prod-target.ts +15 -0
  370. package/src/internal/scm/pr-url.ts +167 -20
  371. package/src/internal/sdk-runner.ts +2 -1
  372. package/src/internal/server.ts +151 -88
  373. package/src/internal/session-engine.ts +146 -83
  374. package/src/reminders.ts +35 -4
  375. package/src/storage-backends/cursor-hosted.ts +40 -1
  376. package/src/types.ts +134 -26
  377. package/dist/docs/assets/chunks/@localSearchIndexroot.CJxMklAy.js +0 -1
  378. package/dist/docs/assets/guides_cloud-agents.md.DS8RIjwx.js +0 -9
  379. package/dist/docs/assets/index.md.BW_6tOgR.js +0 -5
  380. package/dist/docs/assets/skills_framework-map.md.haibFyoB.js +0 -1
  381. package/dist/docs/assets/troubleshooting.md.Cus_YZga.js +0 -1
  382. package/dist/playground/assets/index-CceqnLTX.css +0 -1
  383. /package/dist/docs/assets/{evals.md.CbMoebP1.lean.js → evals.md.C1ekS3k2.lean.js} +0 -0
  384. /package/dist/docs/assets/{guides_github.md.c0gdGJ-D.lean.js → guides_github.md.BH33UEBJ.lean.js} +0 -0
  385. /package/dist/docs/assets/{guides_grokbot-agents.md.DVqdhBKb.lean.js → guides_grokbot-agents.md.DyV-WArv.lean.js} +0 -0
  386. /package/dist/docs/assets/{index.md.BW_6tOgR.lean.js → index.md.BjH1w2ZW.lean.js} +0 -0
  387. /package/dist/docs/assets/{reference_agent-config.md.CHNpiyp4.lean.js → reference_agent-config.md.CvoL6pof.lean.js} +0 -0
  388. /package/dist/docs/assets/{reference_connections.md.Di6jJAXF.lean.js → reference_connections.md.BojkC6c5.lean.js} +0 -0
  389. /package/dist/docs/assets/{reference_extensions.md.CGmMLblt.lean.js → reference_extensions.md.CPWt00ds.lean.js} +0 -0
  390. /package/dist/docs/assets/{scaffolding-agents.md.em43xlY1.lean.js → scaffolding-agents.md.Kctn3OVb.lean.js} +0 -0
  391. /package/dist/docs/assets/{skills_create-agent.md.BVoWPcan.lean.js → skills_create-agent.md.Q3h6Je-e.lean.js} +0 -0
  392. /package/dist/docs/assets/{skills_evals.md.723kpUmA.lean.js → skills_evals.md.BhovOvrl.lean.js} +0 -0
  393. /package/dist/docs/assets/{skills_github.md.D0JahM8c.lean.js → skills_github.md.hgFX_oKY.lean.js} +0 -0
  394. /package/dist/docs/assets/{skills_otel.md.CqhobH3B.lean.js → skills_otel.md.B5Ddv1xH.lean.js} +0 -0
  395. /package/dist/docs/assets/{troubleshooting.md.Cus_YZga.lean.js → troubleshooting.md.CYEAO9bM.lean.js} +0 -0
@@ -29,12 +29,12 @@
29
29
  * union for control-plane consumers.
30
30
  */
31
31
  import { z } from "zod";
32
- import { isPublicEndpointPolicy } from "../channels.js";
32
+ import { catchAuthDeclaration, isPublicEndpointPolicy, } from "../channels.js";
33
33
  import { isCursorHostedStorage } from "../storage-backends/cursor-hosted.js";
34
34
  import { applyAgentContinuationDefaults, channelContinuationIdentity, channelDeclaredEventTypes, handshakeChannelContinuation, } from "./continuation-channel.js";
35
35
  import { CONTINUATION_SELECTORS, } from "./continuation-identity.js";
36
36
  import { projectInfo, runtimeArchitectureCompatibilityError, } from "./discovery.js";
37
- import { packageVersion } from "./distribution.js";
37
+ import { packageGitSha, packageVersion } from "./distribution.js";
38
38
  export const DEPLOY_MANIFEST_VERSION = 1;
39
39
  /**
40
40
  * Versioned wire contract for the CP-consumed declaration fields. Kept
@@ -42,10 +42,42 @@ export const DEPLOY_MANIFEST_VERSION = 1;
42
42
  * use {@link parseAgentDeployManifest} and the explicit interfaces below.
43
43
  */
44
44
  const continuationIdentitySchema = z.enum(CONTINUATION_SELECTORS);
45
+ const CATCH_MAX_ROUTES = 32;
46
+ const CATCH_MAX_AUTH_POLICIES = 4;
47
+ const catchDeclarationSchema = z.object({
48
+ routes: z
49
+ .array(z.object({
50
+ method: z.enum(["GET", "POST", "PUT", "PATCH", "DELETE"]),
51
+ path: z.string().min(1).max(1024),
52
+ }))
53
+ .min(1)
54
+ .max(CATCH_MAX_ROUTES),
55
+ auth: z
56
+ .array(z.discriminatedUnion("kind", [
57
+ z.object({
58
+ kind: z.literal("header"),
59
+ header: z.string().min(1).max(128),
60
+ secret: z.string().min(1).max(64),
61
+ }),
62
+ z.object({
63
+ kind: z.literal("hmac-sha256"),
64
+ header: z.string().min(1).max(128),
65
+ secret: z.string().min(1).max(64),
66
+ prefix: z.string().max(32).optional(),
67
+ }),
68
+ z.object({ kind: z.literal("public") }),
69
+ ]))
70
+ .min(1)
71
+ .max(CATCH_MAX_AUTH_POLICIES),
72
+ });
45
73
  const agentDeployManifestV1Schema = z.object({
46
74
  manifestVersion: z.literal(DEPLOY_MANIFEST_VERSION),
47
75
  generatedAtMs: z.number().int().nonnegative(),
48
76
  cliVersion: z.string().min(1),
77
+ cliGitSha: z
78
+ .string()
79
+ .regex(/^[0-9a-f]{40,64}$/)
80
+ .optional(),
49
81
  declarations: z.object({
50
82
  egressDomains: z.array(z.string().min(1)).max(64),
51
83
  publicRoutePaths: z.array(z.string().min(1)).max(64),
@@ -57,6 +89,7 @@ const agentDeployManifestV1Schema = z.object({
57
89
  kind: z.string().min(1).max(32).optional(),
58
90
  eventTypes: z.array(z.string().min(1).max(64)).max(64).optional(),
59
91
  continuation: continuationIdentitySchema,
92
+ catch: catchDeclarationSchema.optional(),
60
93
  }))
61
94
  .max(64),
62
95
  }),
@@ -69,7 +102,7 @@ const agentDeployManifestV1Schema = z.object({
69
102
  */
70
103
  export function buildAgentDeployManifest(project, options) {
71
104
  var _a;
72
- var _b, _c, _d;
105
+ var _b, _c, _d, _e;
73
106
  const runtimeArchitectureError = runtimeArchitectureCompatibilityError(project.agent);
74
107
  if (runtimeArchitectureError !== undefined) {
75
108
  throw new Error(runtimeArchitectureError);
@@ -89,6 +122,7 @@ export function buildAgentDeployManifest(project, options) {
89
122
  kind,
90
123
  eventTypes,
91
124
  continuation: channelContinuationIdentity(channel.definition),
125
+ catch: channelCatchDeclaration(channel.definition),
92
126
  };
93
127
  });
94
128
  // Same mapping as `july deploy` (cli-deploy.ts): channels declared public
@@ -100,22 +134,74 @@ export function buildAgentDeployManifest(project, options) {
100
134
  manifestVersion: DEPLOY_MANIFEST_VERSION,
101
135
  generatedAtMs: (_b = options === null || options === void 0 ? void 0 : options.nowMs) !== null && _b !== void 0 ? _b : Date.now(),
102
136
  cliVersion: (_c = options === null || options === void 0 ? void 0 : options.cliVersion) !== null && _c !== void 0 ? _c : packageVersion(),
103
- declarations: Object.assign(Object.assign({ egressDomains: [...((_d = (_a = project.agent.hosting) === null || _a === void 0 ? void 0 : _a.egressDomains) !== null && _d !== void 0 ? _d : [])], publicRoutePaths,
104
- // v2 ignores authored storage; deploy manifests describe
105
- // Cursor-hosted deployments, where framework-storage-selection.ts
106
- // injects the Cursor-hosted mirror.
107
- frameworkStorage: project.agent.architecture === "v2"
137
+ cliGitSha: (_d = options === null || options === void 0 ? void 0 : options.cliGitSha) !== null && _d !== void 0 ? _d : packageGitSha(),
138
+ declarations: Object.assign(Object.assign({ egressDomains: [...((_e = (_a = project.agent.hosting) === null || _a === void 0 ? void 0 : _a.egressDomains) !== null && _e !== void 0 ? _e : [])], publicRoutePaths,
139
+ // Deploy manifests describe Cursor-hosted deployments. When the agent
140
+ // authors no storage, framework-storage-selection.ts injects the
141
+ // platform Cursor-hosted mirror for both v1 and v2.
142
+ frameworkStorage: project.storage === undefined
108
143
  ? "cursor-hosted"
109
- : project.storage === undefined
110
- ? "none"
111
- : isCursorHostedStorage(project.storage)
112
- ? "cursor-hosted"
113
- : "other" }, (project.agent.architecture === undefined
144
+ : isCursorHostedStorage(project.storage)
145
+ ? "cursor-hosted"
146
+ : "other" }, (project.agent.architecture === undefined
114
147
  ? {}
115
148
  : { architecture: project.agent.architecture })), { channels }),
116
149
  info: projectInfo(project),
117
150
  };
118
151
  }
152
+ /**
153
+ * Catch declaration for one authored channel: its routes, gated by the
154
+ * catch-capable policies in its auth chain (`sharedSecretAuth`,
155
+ * `hmacSignatureAuth`, or `publicEndpoint()` for handler-verified routes).
156
+ * A routed channel with none of those declares nothing and is not reachable
157
+ * through the catch API.
158
+ */
159
+ export function channelCatchDeclaration(definition) {
160
+ var _a, _b;
161
+ const routes = (_a = definition.routes) !== null && _a !== void 0 ? _a : [];
162
+ if (routes.length === 0) {
163
+ return undefined;
164
+ }
165
+ const declared = ((_b = definition.auth) !== null && _b !== void 0 ? _b : [])
166
+ .map(catchAuthDeclaration)
167
+ .filter((declaration) => declaration !== undefined);
168
+ if (declared.length === 0) {
169
+ return undefined;
170
+ }
171
+ // An auth chain is any-of, so `publicEndpoint()` beside secret policies
172
+ // admits everything locally and on the control plane alike. Declare one
173
+ // `public` entry (the control plane then decrypts nothing) but keep the
174
+ // shared-secret header policies next to it: they are what the control
175
+ // plane uses to strip those header values before the request is
176
+ // claim-checked, and senders keep sending the secret regardless of
177
+ // whether anything still checks it. HMAC policies carry body digests,
178
+ // not secrets, so nothing is lost by dropping them.
179
+ const isPublic = declared.some((policy) => policy.kind === "public");
180
+ const auth = isPublic
181
+ ? [
182
+ { kind: "public" },
183
+ ...declared.filter((policy) => policy.kind === "header"),
184
+ ]
185
+ : declared;
186
+ if (routes.length > CATCH_MAX_ROUTES) {
187
+ if (isPublic) {
188
+ // publicEndpoint() channels deployed before catch existed; they stay
189
+ // reachable the way they were (not through catch) rather than
190
+ // failing the deploy.
191
+ return undefined;
192
+ }
193
+ throw new Error(`Catch channels may declare at most ${CATCH_MAX_ROUTES} routes (got ${routes.length}).`);
194
+ }
195
+ if (auth.length > CATCH_MAX_AUTH_POLICIES) {
196
+ throw new Error(isPublic
197
+ ? `Catch channels may declare at most ${CATCH_MAX_AUTH_POLICIES} auth policies; publicEndpoint() plus ${String(auth.length - 1)} sharedSecretAuth() policies is ${String(auth.length)}. Drop publicEndpoint() or the shared-secret policies it makes dead.`
198
+ : `Catch channels may declare at most ${CATCH_MAX_AUTH_POLICIES} secret policies (got ${auth.length}).`);
199
+ }
200
+ return {
201
+ routes: routes.map((route) => ({ method: route.method, path: route.path })),
202
+ auth,
203
+ };
204
+ }
119
205
  /**
120
206
  * Parse an untrusted manifest (round-trip check for the CLI's own output;
121
207
  * the CP re-validates server-side with its own copy of the contract).
@@ -1,3 +1,4 @@
1
1
  /** Stable string for logging / HTTP error bodies. */
2
2
  export declare function describeError(error: unknown): string;
3
+ export declare function describeErrorCode(error: unknown): string | undefined;
3
4
  //# sourceMappingURL=describe-error.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"describe-error.d.ts","sourceRoot":"","sources":["../../src/internal/describe-error.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAEpD"}
1
+ {"version":3,"file":"describe-error.d.ts","sourceRoot":"","sources":["../../src/internal/describe-error.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAEpD;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CA0BpE"}
@@ -2,3 +2,28 @@
2
2
  export function describeError(error) {
3
3
  return error instanceof Error ? error.message : String(error);
4
4
  }
5
+ export function describeErrorCode(error) {
6
+ if (typeof error === "object" && error !== null && "code" in error) {
7
+ const numericCode = error.code;
8
+ if (numericCode === 1) {
9
+ return "canceled";
10
+ }
11
+ if (numericCode === 14) {
12
+ return "unavailable";
13
+ }
14
+ if (numericCode === 2) {
15
+ return "unknown";
16
+ }
17
+ }
18
+ if (typeof error === "object" &&
19
+ error !== null &&
20
+ "name" in error &&
21
+ error.name === "AbortError") {
22
+ return "ABORT_ERR";
23
+ }
24
+ if (typeof error !== "object" || error === null || !("code" in error)) {
25
+ return undefined;
26
+ }
27
+ const code = error.code;
28
+ return typeof code === "string" && code.length <= 64 ? code : undefined;
29
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/internal/discovery/agent.ts"],"names":[],"mappings":"AAAA;;GAEG;AASH,OAAO,EAOL,KAAK,aAAa,EACnB,MAAM,gBAAgB,CAAC;AAcxB,OAAO,EAAE,KAAK,gBAAgB,EAAe,MAAM,cAAc,CAAC;AAClE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAc9D,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,aAAa,CAAC;IACrB,YAAY,EAAE,IAAI,CAChB,sBAAsB,EACtB,OAAO,GAAG,UAAU,GAAG,WAAW,GAAG,KAAK,GAAG,WAAW,CACzD,CAAC;CACH;AAED,wBAAsB,SAAS,CAC7B,GAAG,EAAE,gBAAgB,EACrB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,GACzC,OAAO,CAAC,eAAe,CAAC,CAyS1B;AAED,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,gBAAgB,EACrB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,CA0Cf"}
1
+ {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/internal/discovery/agent.ts"],"names":[],"mappings":"AAAA;;GAEG;AASH,OAAO,EAOL,KAAK,aAAa,EACnB,MAAM,gBAAgB,CAAC;AAcxB,OAAO,EAAE,KAAK,gBAAgB,EAAe,MAAM,cAAc,CAAC;AAClE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAc9D,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,aAAa,CAAC;IACrB,YAAY,EAAE,IAAI,CAChB,sBAAsB,EACtB,OAAO,GAAG,UAAU,GAAG,WAAW,GAAG,KAAK,GAAG,WAAW,CACzD,CAAC;CACH;AAED,wBAAsB,SAAS,CAC7B,GAAG,EAAE,gBAAgB,EACrB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,GACzC,OAAO,CAAC,eAAe,CAAC,CAyS1B;AAED,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,gBAAgB,EACrB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,CA2Cf"}
@@ -294,6 +294,7 @@ export function warnUnknownSlots(ctx, agentDir) {
294
294
  "subagents",
295
295
  "channels",
296
296
  "schedules",
297
+ "reminders",
297
298
  "hooks",
298
299
  "ab",
299
300
  "sandbox",
@@ -1 +1 @@
1
- {"version":3,"file":"info.d.ts","sourceRoot":"","sources":["../../../src/internal/discovery/info.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,gBAAgB,EAEtB,MAAM,gBAAgB,CAAC;AAKxB,wBAAgB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,gBAAgB,CA6KnE"}
1
+ {"version":3,"file":"info.d.ts","sourceRoot":"","sources":["../../../src/internal/discovery/info.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,gBAAgB,EAEtB,MAAM,gBAAgB,CAAC;AAKxB,wBAAgB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,gBAAgB,CAmLnE"}
@@ -9,7 +9,7 @@ import { MCP_ENDPOINT_PATH, mcpEndpointToolNames } from "../mcp-endpoint.js";
9
9
  import { connectionTransportLabel } from "./connections.js";
10
10
  export function projectInfo(project) {
11
11
  var _a, _b, _c, _d;
12
- var _e, _f;
12
+ var _e, _f, _g, _h;
13
13
  const agent = project.agent;
14
14
  const httpRoutes = [
15
15
  { method: "POST", path: "/v1/session", url: "/v1/session" },
@@ -125,7 +125,11 @@ export function projectInfo(project) {
125
125
  name: schedule.name,
126
126
  cron: schedule.cron,
127
127
  kind: schedule.kind,
128
- })), hooks: project.hooks.map((hook) => hook.name), abs: project.abs.map((experiment) => experiment.name) }, (project.abConfig === undefined && project.abs.length === 0
128
+ })), reminders: ((_f = project.reminders) !== null && _f !== void 0 ? _f : []).length === 0
129
+ ? undefined
130
+ : ((_g = project.reminders) !== null && _g !== void 0 ? _g : []).map((reminder) => ({
131
+ name: reminder.name,
132
+ })), hooks: project.hooks.map((hook) => hook.name), abs: project.abs.map((experiment) => experiment.name) }, (project.abConfig === undefined && project.abs.length === 0
129
133
  ? {}
130
134
  : {
131
135
  abConfig: {
@@ -138,7 +142,7 @@ export function projectInfo(project) {
138
142
  : { name: project.storage.name }, artifacts: project.artifacts === undefined
139
143
  ? undefined
140
144
  : {
141
- kinds: Object.keys((_f = project.artifacts.kinds) !== null && _f !== void 0 ? _f : {}),
145
+ kinds: Object.keys((_h = project.artifacts.kinds) !== null && _h !== void 0 ? _h : {}),
142
146
  agentTool: project.artifacts.agentTool === true,
143
147
  max: resolveArtifactsMax(project.artifacts),
144
148
  }, result: project.result === undefined ? undefined : true, otel: project.otel === undefined
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import type { DefinitionKind } from "../../types.js";
5
5
  import { type DiscoveryContext } from "./context.js";
6
- type ImportableKind = Exclude<DefinitionKind, "instructions" | "eval" | "reminder">;
6
+ type ImportableKind = Exclude<DefinitionKind, "instructions" | "eval">;
7
7
  /** The module files of a slot directory whose filenames are valid names. */
8
8
  export declare function moduleEntries(ctx: DiscoveryContext, dir: string, kind: "tool" | "connection"): Promise<Array<{
9
9
  name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../../../src/internal/discovery/modules.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EAAE,KAAK,gBAAgB,EAA6B,MAAM,cAAc,CAAC;AAIhF,KAAK,cAAc,GAAG,OAAO,CAC3B,cAAc,EACd,cAAc,GAAG,MAAM,GAAG,UAAU,CACrC,CAAC;AAEF,4EAA4E;AAC5E,wBAAsB,aAAa,CACjC,GAAG,EAAE,gBAAgB,EACrB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,GAAG,YAAY,GAC1B,OAAO,CAAC,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAwBhD;AAED;;;GAGG;AACH,wBAAsB,aAAa,CACjC,GAAG,EAAE,gBAAgB,EACrB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,cAAc,GAAG,SAAS,cAAc,EAAE,GACnD,OAAO,CAAC,OAAO,CAAC,CA6BlB;AAED,sFAAsF;AACtF,wBAAgB,UAAU,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAKvD"}
1
+ {"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../../../src/internal/discovery/modules.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EAAE,KAAK,gBAAgB,EAA6B,MAAM,cAAc,CAAC;AAIhF,KAAK,cAAc,GAAG,OAAO,CAAC,cAAc,EAAE,cAAc,GAAG,MAAM,CAAC,CAAC;AAEvE,4EAA4E;AAC5E,wBAAsB,aAAa,CACjC,GAAG,EAAE,gBAAgB,EACrB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,GAAG,YAAY,GAC1B,OAAO,CAAC,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAwBhD;AAED;;;GAGG;AACH,wBAAsB,aAAa,CACjC,GAAG,EAAE,gBAAgB,EACrB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,cAAc,GAAG,SAAS,cAAc,EAAE,GACnD,OAAO,CAAC,OAAO,CAAC,CA6BlB;AAED,sFAAsF;AACtF,wBAAgB,UAAU,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAKvD"}
@@ -98,6 +98,7 @@ const DEFINE_HELPER_NAME = {
98
98
  channel: "defineChannel",
99
99
  "http-channel": "httpChannel",
100
100
  schedule: "defineSchedule",
101
+ reminder: "defineReminder",
101
102
  hook: "defineHook",
102
103
  ab: "defineAB",
103
104
  storage: "defineStorage",
@@ -1 +1 @@
1
- {"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../../src/internal/discovery/project.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EACV,YAAY,EAEZ,UAAU,EACX,MAAM,gBAAgB,CAAC;AASxB,OAAO,EAIL,KAAK,uBAAuB,EAC7B,MAAM,cAAc,CAAC;AAmBtB;;;;GAIG;AACH,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CASrE;AAED,sEAAsE;AACtE,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;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AG,EAAE,MAAM,CAAC;CACb;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,aAAa,EAAE,CAAC,CA2B1B;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,YAAY,CAAA;CAAE,CAAC,CAAC,CA6BzD;AAED;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,uBAAuB,GAAG;IACjC,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;CACtB,GACL,OAAO,CAAC,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,YAAY,CAAA;CAAE,CAAC,CAAC,CAgBzD;AAcD,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,YAAY,CAAC,CAqHvB;AA0BD,qEAAqE;AACrE,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAElE;AAED,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,MAAM,CAOnE"}
@@ -32,6 +32,7 @@ import { defaultImportModule, displayPath, } from "./context.js";
32
32
  import { hasFlatLayoutMarkers, isDirectory, readPackageName, sortedEntries, } from "./fs.js";
33
33
  import { loadHooks } from "./hooks.js";
34
34
  import { NAME_PATTERN } from "./names.js";
35
+ import { loadReminders } from "./reminders.js";
35
36
  import { loadSchedules } from "./schedules.js";
36
37
  import { appendArtifactTool, loadArtifacts, loadOtel, loadResult, loadStorage, mergeArtifacts, } from "./services.js";
37
38
  /**
@@ -199,6 +200,7 @@ export function loadAgentProject(dir_1) {
199
200
  }
200
201
  const schedules = yield loadSchedules(ctx, join(agentDir, "schedules"));
201
202
  schedules.push(...projectSlots.schedules);
203
+ const reminders = yield loadReminders(ctx, join(agentDir, "reminders"));
202
204
  const hooks = yield loadHooks(ctx, join(agentDir, "hooks"));
203
205
  hooks.push(...projectSlots.hooks);
204
206
  const abs = yield loadABs(ctx, agentDir);
@@ -247,6 +249,7 @@ export function loadAgentProject(dir_1) {
247
249
  httpChannel: resolvedHttpChannel,
248
250
  channels,
249
251
  schedules,
252
+ reminders,
250
253
  hooks,
251
254
  abs,
252
255
  abConfig,
@@ -0,0 +1,7 @@
1
+ /**
2
+ * `agent/reminders/*.ts`: named durable reminder fire handlers.
3
+ */
4
+ import type { DiscoveredReminder } from "../../types.js";
5
+ import { type DiscoveryContext } from "./context.js";
6
+ export declare function loadReminders(ctx: DiscoveryContext, remindersDir: string, onDisable?: (name: string, path: string) => void): Promise<DiscoveredReminder[]>;
7
+ //# sourceMappingURL=reminders.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reminders.d.ts","sourceRoot":"","sources":["../../../src/internal/discovery/reminders.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,kBAAkB,EAAsB,MAAM,gBAAgB,CAAC;AAE7E,OAAO,EAAE,KAAK,gBAAgB,EAAe,MAAM,cAAc,CAAC;AAKlE,wBAAsB,aAAa,CACjC,GAAG,EAAE,gBAAgB,EACrB,YAAY,EAAE,MAAM,EACpB,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,GAC/C,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAgD/B"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * `agent/reminders/*.ts`: named durable reminder fire handlers.
3
+ */
4
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
5
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
6
+ return new (P || (P = Promise))(function (resolve, reject) {
7
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
8
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
9
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
10
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
11
+ });
12
+ };
13
+ import { basename, extname, relative } from "node:path";
14
+ import { getDefinitionKind } from "../brand.js";
15
+ import { displayPath } from "./context.js";
16
+ import { isDirectory, isModuleFile, toPosix, walkFiles } from "./fs.js";
17
+ import { importDefault } from "./modules.js";
18
+ import { NAME_PATTERN } from "./names.js";
19
+ export function loadReminders(ctx, remindersDir, onDisable) {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ if (!(yield isDirectory(remindersDir))) {
22
+ return [];
23
+ }
24
+ const reminders = [];
25
+ for (const filePath of yield walkFiles(remindersDir)) {
26
+ const rel = toPosix(relative(remindersDir, filePath));
27
+ if (!isModuleFile(basename(filePath))) {
28
+ continue;
29
+ }
30
+ const name = rel.slice(0, -extname(rel).length);
31
+ if (!NAME_PATTERN.test(name) || name.includes("__")) {
32
+ ctx.diagnostics.push({
33
+ severity: "error",
34
+ path: displayPath(ctx, filePath),
35
+ message: name.includes("__")
36
+ ? `Reminder name "${name}" may not contain "__"; it is reserved for extension contributions (\`<ns>__<name>\`).`
37
+ : `Reminder name "${name}" must match ${NAME_PATTERN}.`,
38
+ });
39
+ continue;
40
+ }
41
+ const definition = yield importDefault(ctx, filePath, onDisable === undefined ? "reminder" : ["reminder", "disabled"]);
42
+ if (definition === undefined) {
43
+ continue;
44
+ }
45
+ if (getDefinitionKind(definition) === "disabled") {
46
+ onDisable === null || onDisable === void 0 ? void 0 : onDisable(name, filePath);
47
+ continue;
48
+ }
49
+ const reminder = definition;
50
+ if (typeof reminder.run !== "function") {
51
+ ctx.diagnostics.push({
52
+ severity: "error",
53
+ path: displayPath(ctx, filePath),
54
+ message: "Reminder handlers require a `run` function.",
55
+ });
56
+ continue;
57
+ }
58
+ reminders.push({
59
+ name,
60
+ definition: reminder,
61
+ });
62
+ }
63
+ return reminders;
64
+ });
65
+ }
@@ -112,6 +112,7 @@ function warnUnsupportedSubagentSlots(ctx, subagentDir) {
112
112
  ["subagents", "nested subagents"],
113
113
  ["channels", "channels"],
114
114
  ["schedules", "schedules"],
115
+ ["reminders", "reminders"],
115
116
  ["hooks", "hooks"],
116
117
  ["sandbox", "sandbox files"],
117
118
  ];
@@ -31,6 +31,11 @@ export declare function isCompiledDistribution(): boolean;
31
31
  export declare function packageRootDir(): string;
32
32
  /** Version of the running package (from its own package.json). */
33
33
  export declare function packageVersion(): string;
34
+ /**
35
+ * Git commit of a checkout-built framework distribution. Published npm
36
+ * packages do not carry this marker and return undefined.
37
+ */
38
+ export declare function packageGitSha(): string | undefined;
34
39
  /** Facts `agent-sdk version` / `--version` print. */
35
40
  export interface CliVersionInfo {
36
41
  /** Published npm name (`@cursor/july`). */
@@ -1 +1 @@
1
- {"version":3,"file":"distribution.d.ts","sourceRoot":"","sources":["../../src/internal/distribution.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,sEAAsE;AACtE,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,WAAW,cAAc,CAAC;AACvC,eAAO,MAAM,UAAU,EAAE,MAA2B,CAAC;AACrD,eAAO,MAAM,gBAAgB,EAAE,MAAiC,CAAC;AAEjE,4DAA4D;AAC5D,eAAO,MAAM,gBAAgB,cAAc,CAAC;AAE5C;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAGhD;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAYD,kEAAkE;AAClE,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED,qDAAqD;AACrD,MAAM,WAAW,cAAc;IAC7B,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,cAAc,IAAI,cAAc,CAK/C;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CAMrE;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAYzD"}
1
+ {"version":3,"file":"distribution.d.ts","sourceRoot":"","sources":["../../src/internal/distribution.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,sEAAsE;AACtE,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAI3C;;;GAGG;AACH,eAAO,MAAM,WAAW,cAAc,CAAC;AACvC,eAAO,MAAM,UAAU,EAAE,MAA2B,CAAC;AACrD,eAAO,MAAM,gBAAgB,EAAE,MAAiC,CAAC;AAEjE,4DAA4D;AAC5D,eAAO,MAAM,gBAAgB,cAAc,CAAC;AAE5C;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAGhD;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAYD,kEAAkE;AAClE,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED;;;GAGG;AACH,wBAAgB,aAAa,IAAI,MAAM,GAAG,SAAS,CAYlD;AAED,qDAAqD;AACrD,MAAM,WAAW,cAAc;IAC7B,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,cAAc,IAAI,cAAc,CAK/C;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CAMrE;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAYzD"}
@@ -11,6 +11,8 @@ import { join } from "node:path";
11
11
  import { fileURLToPath, pathToFileURL } from "node:url";
12
12
  /** Published npm package name (pre-launch codename for Agent SDK). */
13
13
  export const PACKAGE_NAME = "@cursor/july";
14
+ const HOSTED_WORKTREE_SHA_FILENAME = ".cursor-hosted-worktree-sha";
15
+ const GIT_COMMIT_SHA_RE = /^[0-9a-f]{40,64}$/;
14
16
  /**
15
17
  * Bracketed product tag for stderr / ServeOptions.logger lines
16
18
  * (`[agent-sdk] …`, `[agent-sdk/slack] …`).
@@ -45,6 +47,21 @@ function packageManifest() {
45
47
  export function packageVersion() {
46
48
  return packageManifest().version;
47
49
  }
50
+ /**
51
+ * Git commit of a checkout-built framework distribution. Published npm
52
+ * packages do not carry this marker and return undefined.
53
+ */
54
+ export function packageGitSha() {
55
+ try {
56
+ const sha = readFileSync(join(packageRootDir(), "dist", HOSTED_WORKTREE_SHA_FILENAME), "utf8")
57
+ .trim()
58
+ .toLowerCase();
59
+ return GIT_COMMIT_SHA_RE.test(sha) ? sha : undefined;
60
+ }
61
+ catch (_a) {
62
+ return undefined;
63
+ }
64
+ }
48
65
  export function cliVersionInfo() {
49
66
  return {
50
67
  name: PACKAGE_NAME,
@@ -13,7 +13,10 @@
13
13
  * That selection is a hosting-mode question, not an authoring question.
14
14
  * Architecture v2 moves it here: `agent/storage.ts` is rejected at
15
15
  * discovery (error diagnostic, so serve and deploy fail early), and the
16
- * platform picks the default
16
+ * platform picks the default. Architecture v1 with no authored file now
17
+ * uses the same hosted-vs-self-hosted split, so deleting `agent/storage.ts`
18
+ * (required to deploy the same tree onto v2) does not drop the Cursor-hosted
19
+ * session mirror on a still-v1 pod.
17
20
  *
18
21
  * - **Cursor-managed hosting** (the deployment-generation environment
19
22
  * variable is set, same signal that registers `GET /v1/manifest`):
@@ -33,8 +36,10 @@
33
36
  * - **Self-hosted**: no mirror. `--state-root` is the durable copy, which
34
37
  * is correct when the operator owns the disk.
35
38
  *
36
- * v1 keeps the authored definition (or nothing) so existing deployments are
37
- * untouched while they run.
39
+ * v1 still honors an authored `agent/storage.ts` when present. Hosted v1
40
+ * pods with no authored file get the Cursor-hosted lazy mirror (gated on
41
+ * `AGENT_SERVE_DEPLOYMENT_ID`, the same signal the previous authored sinks
42
+ * used). Self-hosted v1 with no authored file stays disk-only.
38
43
  *
39
44
  * Local disk is not part of this decision. `<stateRoot>/sessions/<id>/`
40
45
  * already holds `session.json` and `events.ndjson` unconditionally, through
@@ -43,6 +48,12 @@
43
48
  */
44
49
  import { type StorageDefinition } from "../storage.js";
45
50
  import type { AgentArchitecture } from "../types.js";
51
+ /**
52
+ * Hosted v2 event-chunk flush debounce. Matches the session view's live poll
53
+ * cadence; a streaming turn still caps each chunk at the coordinator's batch
54
+ * limit, so a long turn writes a few dozen chunks rather than one per event.
55
+ */
56
+ export declare const HOSTED_V2_EVENT_FLUSH_DEBOUNCE_MS = 2000;
46
57
  export interface FrameworkStorageSelectionInput {
47
58
  /** `agent/storage.ts`, when the author wrote one (v1 only: discovery rejects it on v2). */
48
59
  readonly authored: StorageDefinition | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"framework-storage-selection.d.ts","sourceRoot":"","sources":["../../src/internal/framework-storage-selection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAGH,OAAO,EAAiB,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AASrD,MAAM,WAAW,8BAA8B;IAC7C,2FAA2F;IAC3F,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,GAAG,SAAS,CAAC;IACjD,0DAA0D;IAC1D,QAAQ,CAAC,YAAY,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAC;IACtD,iEAAiE;IACjE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;CACnD;AAED;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,8BAA8B,GACpC,iBAAiB,GAAG,SAAS,CAwD/B"}
1
+ {"version":3,"file":"framework-storage-selection.d.ts","sourceRoot":"","sources":["../../src/internal/framework-storage-selection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAGH,OAAO,EAAiB,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAMtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AASrD;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,OAAQ,CAAC;AAEvD,MAAM,WAAW,8BAA8B;IAC7C,2FAA2F;IAC3F,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,GAAG,SAAS,CAAC;IACjD,0DAA0D;IAC1D,QAAQ,CAAC,YAAY,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAC;IACtD,iEAAiE;IACjE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;CACnD;AAED;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,8BAA8B,GACpC,iBAAiB,GAAG,SAAS,CA6E/B"}
@@ -13,7 +13,10 @@
13
13
  * That selection is a hosting-mode question, not an authoring question.
14
14
  * Architecture v2 moves it here: `agent/storage.ts` is rejected at
15
15
  * discovery (error diagnostic, so serve and deploy fail early), and the
16
- * platform picks the default
16
+ * platform picks the default. Architecture v1 with no authored file now
17
+ * uses the same hosted-vs-self-hosted split, so deleting `agent/storage.ts`
18
+ * (required to deploy the same tree onto v2) does not drop the Cursor-hosted
19
+ * session mirror on a still-v1 pod.
17
20
  *
18
21
  * - **Cursor-managed hosting** (the deployment-generation environment
19
22
  * variable is set, same signal that registers `GET /v1/manifest`):
@@ -33,8 +36,10 @@
33
36
  * - **Self-hosted**: no mirror. `--state-root` is the durable copy, which
34
37
  * is correct when the operator owns the disk.
35
38
  *
36
- * v1 keeps the authored definition (or nothing) so existing deployments are
37
- * untouched while they run.
39
+ * v1 still honors an authored `agent/storage.ts` when present. Hosted v1
40
+ * pods with no authored file get the Cursor-hosted lazy mirror (gated on
41
+ * `AGENT_SERVE_DEPLOYMENT_ID`, the same signal the previous authored sinks
42
+ * used). Self-hosted v1 with no authored file stays disk-only.
38
43
  *
39
44
  * Local disk is not part of this decision. `<stateRoot>/sessions/<id>/`
40
45
  * already holds `session.json` and `events.ndjson` unconditionally, through
@@ -43,10 +48,17 @@
43
48
  */
44
49
  import { cursorHostedFiles } from "../files-backends/cursor-hosted.js";
45
50
  import { defineStorage } from "../storage.js";
51
+ import { AGENT_SERVE_DEPLOYMENT_ID_ENV_VAR, cursorHostedStorage, } from "../storage-backends/cursor-hosted.js";
46
52
  import { cursorHostedStorageV2 } from "../storage-backends/cursor-hosted-v2.js";
47
53
  import { resolveApiKeySync } from "./cursor/credentials.js";
48
54
  import { composeFrameworkStorage, fileSinkStorageCore, frameworkGuardedCas, } from "./framework-file-storage.js";
49
55
  import { resolveAgentV2Hosting } from "./v2-hosting.js";
56
+ /**
57
+ * Hosted v2 event-chunk flush debounce. Matches the session view's live poll
58
+ * cadence; a streaming turn still caps each chunk at the coordinator's batch
59
+ * limit, so a long turn writes a few dozen chunks rather than one per event.
60
+ */
61
+ export const HOSTED_V2_EVENT_FLUSH_DEBOUNCE_MS = 2000;
50
62
  /**
51
63
  * Pick the backend for framework session state.
52
64
  *
@@ -54,9 +66,19 @@ import { resolveAgentV2Hosting } from "./v2-hosting.js";
54
66
  * disk is the only copy.
55
67
  */
56
68
  export function selectFrameworkStorageDefinition(input) {
69
+ var _a, _b;
57
70
  if (input.architecture !== "v2") {
58
- // v1: the author decides, or there is no mirror.
59
- return input.authored;
71
+ if (input.authored !== undefined) {
72
+ return input.authored;
73
+ }
74
+ const env = (_a = input.env) !== null && _a !== void 0 ? _a : process.env;
75
+ if (((_b = env[AGENT_SERVE_DEPLOYMENT_ID_ENV_VAR]) !== null && _b !== void 0 ? _b : "").trim() !== "") {
76
+ // Hosted v1 pod with no authored sink: keep the Cursor-hosted
77
+ // mirror (lazy restore) so agents can delete `agent/storage.ts`
78
+ // without losing durability while they still run architecture v1.
79
+ return defineStorage(Object.assign({ name: "cursor-hosted (lazy restore)", policy: { restore: "off" } }, cursorHostedStorage()));
80
+ }
81
+ return undefined;
60
82
  }
61
83
  if (input.authored !== undefined) {
62
84
  // Discovery rejects agent/storage.ts on v2 before an engine is built;
@@ -77,7 +99,15 @@ export function selectFrameworkStorageDefinition(input) {
77
99
  // backend it is per-key HTTP round trips before the listener even
78
100
  // comes up). Follow-ups restore lazily by continuation or session id;
79
101
  // GET /v1/sessions lists from the sink either way.
80
- const policy = { restore: "off" };
102
+ //
103
+ // Events flush on a quiet-period debounce rather than only at turn end so
104
+ // the read-only session view and dashboard trace (which have no resident
105
+ // engine to ask) see steps mid-turn. The turn-end record still lands
106
+ // before the execution reply: drainSessionDurability forces the flush.
107
+ const policy = {
108
+ restore: "off",
109
+ debounceMs: HOSTED_V2_EVENT_FLUSH_DEBOUNCE_MS,
110
+ };
81
111
  // Full chain (env → bind file → stored login): frozen engines listen
82
112
  // unsigned and bind store ids + CURSOR_API_KEY at task time, after this
83
113
  // definition is constructed.
@@ -12,11 +12,9 @@
12
12
  * so leftover races still return 503 `guest_network_unavailable` instead of
13
13
  * a redacted 500.
14
14
  *
15
- * Quiet guest Connect (`TypeError: fetch failed` with no errno, Connect
16
- * `[unknown]`/`[canceled]`/`[unavailable]`, headers/body timeout) is a
17
- * stall, not a dead NIC. Those become `guest_connect_stalled` so TAS
18
- * retries the same pod — including when `waitForCompletion` resolves
19
- * with that message instead of throwing.
15
+ * Quiet guest Connect failures with a typed Connect/undici code are stalls,
16
+ * not dead NICs. Those become `guest_connect_stalled` so TAS retries the same
17
+ * pod. Untyped errors stay unknown rather than being classified from prose.
20
18
  */
21
19
  export declare const GUEST_NETWORK_UNAVAILABLE = "guest_network_unavailable";
22
20
  export declare const GUEST_CONNECT_STALLED = "guest_connect_stalled";
@@ -39,9 +37,7 @@ export declare class GuestNetworkUnavailableError extends Error {
39
37
  }
40
38
  /**
41
39
  * True when the error (or anything on its `cause` chain, or inside an
42
- * `AggregateError`) is a network-level fetch failure. Connect-web wraps
43
- * undici's `TypeError: fetch failed` as `ConnectError` and keeps the
44
- * original on `cause`.
40
+ * `AggregateError`) carries a known network-level code.
45
41
  */
46
42
  export declare function isTransientGuestNetworkError(error: unknown): boolean;
47
43
  export declare function hasGuestNetworkErrno(error: unknown): boolean;
@@ -52,8 +48,6 @@ export declare function hasGuestNetworkErrno(error: unknown): boolean;
52
48
  * mapper can return `guest_connect_stalled` instead of a mystery 503.
53
49
  */
54
50
  export declare function isQuietGuestConnectStall(error: unknown): boolean;
55
- /** Message-only form for `waitForCompletion` outcomes that do not throw. */
56
- export declare function isQuietGuestConnectStallMessage(message: string): boolean;
57
51
  /** Last-line wait inside an already-open hosted POST. */
58
52
  export declare const DEFAULT_WAIT_TIMEOUT_MS = 8000;
59
53
  export type GuestNetworkWaitOptions = {
@@ -1 +1 @@
1
- {"version":3,"file":"guest-network.d.ts","sourceRoot":"","sources":["../../src/internal/guest-network.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,eAAO,MAAM,yBAAyB,8BAA8B,CAAC;AACrE,eAAO,MAAM,qBAAqB,0BAA0B,CAAC;AAE7D,sEAAsE;AACtE,eAAO,MAAM,kBAAkB,sBAAsB,CAAC;AAEtD;;;;GAIG;AACH,eAAO,MAAM,mCAAmC,QAAS,CAAC;AAuB1D,qBAAa,4BAA6B,SAAQ,KAAK;IACrD,QAAQ,CAAC,IAAI,EAAE,OAAO,yBAAyB,CAA6B;IAC5E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAE/B,YACE,OAAO,SAAsD,EAC7D,MAAM,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