@cursor/july 0.1.95 → 0.1.97

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 (424) hide show
  1. package/AGENTS.md +3 -4
  2. package/README.md +3 -2
  3. package/dist/bin/agent-serve.js +14 -3
  4. package/dist/channels/deployments/types.d.ts +1 -1
  5. package/dist/channels/deployments/types.d.ts.map +1 -1
  6. package/dist/channels/deployments/types.js +1 -0
  7. package/dist/channels/origin/api.d.ts +72 -15
  8. package/dist/channels/origin/api.d.ts.map +1 -1
  9. package/dist/channels/origin/api.js +185 -28
  10. package/dist/channels/origin/binding.d.ts +13 -2
  11. package/dist/channels/origin/binding.d.ts.map +1 -1
  12. package/dist/channels/origin/binding.js +41 -25
  13. package/dist/channels/origin/checks.d.ts +6 -6
  14. package/dist/channels/origin/checks.js +6 -6
  15. package/dist/channels/origin/cursor-account.d.ts +5 -3
  16. package/dist/channels/origin/cursor-account.d.ts.map +1 -1
  17. package/dist/channels/origin/cursor-account.js +5 -3
  18. package/dist/channels/origin/index.d.ts +1 -0
  19. package/dist/channels/origin/index.d.ts.map +1 -1
  20. package/dist/channels/origin/index.js +1 -0
  21. package/dist/channels/origin/origin-channel.d.ts.map +1 -1
  22. package/dist/channels/origin/origin-channel.js +3 -0
  23. package/dist/channels/origin/reactions.d.ts +56 -0
  24. package/dist/channels/origin/reactions.d.ts.map +1 -0
  25. package/dist/channels/origin/reactions.js +67 -0
  26. package/dist/channels/origin/types.d.ts +11 -0
  27. package/dist/channels/origin/types.d.ts.map +1 -1
  28. package/dist/channels/slack/api.d.ts +9 -0
  29. package/dist/channels/slack/api.d.ts.map +1 -1
  30. package/dist/channels/slack/api.js +36 -5
  31. package/dist/channels/slack/approvals.d.ts +16 -0
  32. package/dist/channels/slack/approvals.d.ts.map +1 -1
  33. package/dist/channels/slack/approvals.js +86 -0
  34. package/dist/channels/slack/cli-project.d.ts +19 -0
  35. package/dist/channels/slack/cli-project.d.ts.map +1 -0
  36. package/dist/channels/slack/cli-project.js +234 -0
  37. package/dist/channels/slack/defaults.d.ts.map +1 -1
  38. package/dist/channels/slack/defaults.js +110 -81
  39. package/dist/channels/slack/dispatch.d.ts +7 -1
  40. package/dist/channels/slack/dispatch.d.ts.map +1 -1
  41. package/dist/channels/slack/dispatch.js +47 -23
  42. package/dist/channels/slack/inbound.d.ts +8 -0
  43. package/dist/channels/slack/inbound.d.ts.map +1 -1
  44. package/dist/channels/slack/inbound.js +32 -0
  45. package/dist/channels/slack/init.d.ts +3 -2
  46. package/dist/channels/slack/init.d.ts.map +1 -1
  47. package/dist/channels/slack/init.js +5 -5
  48. package/dist/channels/slack/interactive.d.ts +2 -1
  49. package/dist/channels/slack/interactive.d.ts.map +1 -1
  50. package/dist/channels/slack/interactive.js +15 -4
  51. package/dist/channels/slack/live-delivery.d.ts +26 -29
  52. package/dist/channels/slack/live-delivery.d.ts.map +1 -1
  53. package/dist/channels/slack/live-delivery.js +172 -73
  54. package/dist/channels/slack/manifest.d.ts +1 -1
  55. package/dist/channels/slack/manifest.d.ts.map +1 -1
  56. package/dist/channels/slack/manifest.js +6 -2
  57. package/dist/channels/slack/nudge-carrier.d.ts +2 -0
  58. package/dist/channels/slack/nudge-carrier.d.ts.map +1 -1
  59. package/dist/channels/slack/nudge-carrier.js +48 -1
  60. package/dist/channels/slack/setup.d.ts +1 -1
  61. package/dist/channels/slack/setup.d.ts.map +1 -1
  62. package/dist/channels/slack/setup.js +10 -6
  63. package/dist/channels/slack/slack-channel.d.ts.map +1 -1
  64. package/dist/channels/slack/slack-channel.js +3 -2
  65. package/dist/channels/slack/tool-approval-events.d.ts.map +1 -1
  66. package/dist/channels/slack/tool-approval-events.js +91 -1
  67. package/dist/docs/404.html +2 -2
  68. package/dist/docs/ab.html +4 -4
  69. package/dist/docs/assets/{app.BBj0klBO.js → app.B3rWNYE1.js} +1 -1
  70. package/dist/docs/assets/chunks/@localSearchIndexroot.BU9nHdnQ.js +1 -0
  71. package/dist/docs/assets/chunks/{VPLocalSearchBox.CUEXpL78.js → VPLocalSearchBox.C1lhqJJR.js} +1 -1
  72. package/dist/docs/assets/chunks/{theme.DabmQnia.js → theme.B40_SXuv.js} +2 -2
  73. package/dist/docs/assets/{deployment.md.D9msOFOW.js → deployment.md.MFPKqsqI.js} +2 -2
  74. package/dist/docs/assets/{guides_mcp-oauth.md.DPYmBCbV.js → guides_mcp-oauth.md.CN-6YmTJ.js} +4 -4
  75. package/dist/docs/assets/{guides_mcp-oauth.md.DPYmBCbV.lean.js → guides_mcp-oauth.md.CN-6YmTJ.lean.js} +1 -1
  76. package/dist/docs/assets/guides_slack.md.VDXQV3ja.js +22 -0
  77. package/dist/docs/assets/guides_slack.md.VDXQV3ja.lean.js +1 -0
  78. package/dist/docs/assets/index.md.CVeRUOeZ.js +5 -0
  79. package/dist/docs/assets/{index.md.BoHaMdeZ.lean.js → index.md.CVeRUOeZ.lean.js} +1 -1
  80. package/dist/docs/assets/{reference_agent-config.md.Cp_x38Nl.js → reference_agent-config.md.BHeYMgme.js} +1 -1
  81. package/dist/docs/assets/{reference_cli.md.BsMOxDvh.js → reference_cli.md.RyZf5OTE.js} +10 -6
  82. package/dist/docs/assets/{reference_cli.md.BsMOxDvh.lean.js → reference_cli.md.RyZf5OTE.lean.js} +1 -1
  83. package/dist/docs/assets/{reference_connections.md.BH8Oc0D0.js → reference_connections.md.DxldvyIB.js} +4 -3
  84. package/dist/docs/assets/{reference_http-api.md.D89k1mdm.js → reference_http-api.md.5zOAbV86.js} +1 -1
  85. package/dist/docs/assets/reference_sessions.md.NxFP_CAC.js +1 -0
  86. package/dist/docs/assets/{reference_tools.md.BHeXn2id.js → reference_tools.md.B84gw9Ii.js} +1 -1
  87. package/dist/docs/assets/templates_agents-md.md.CXSMZljE.js +2 -0
  88. package/dist/docs/assets/templates_agents-md.md.CXSMZljE.lean.js +1 -0
  89. package/dist/docs/assets/templates_code-wiki.md.CDYZIBFN.js +2 -0
  90. package/dist/docs/assets/templates_code-wiki.md.CDYZIBFN.lean.js +1 -0
  91. package/dist/docs/assets/troubleshooting.md.DCiPBhYs.js +1 -0
  92. package/dist/docs/building-with-agents.html +4 -4
  93. package/dist/docs/concepts.html +4 -4
  94. package/dist/docs/deployment.html +7 -7
  95. package/dist/docs/deployment.md +5 -4
  96. package/dist/docs/evals.html +4 -4
  97. package/dist/docs/guides/agent-to-agent.html +4 -4
  98. package/dist/docs/guides/cloud-runtime.html +4 -4
  99. package/dist/docs/guides/convert-automation.html +4 -4
  100. package/dist/docs/guides/github.html +4 -4
  101. package/dist/docs/guides/human-in-the-loop.html +4 -4
  102. package/dist/docs/guides/mcp-oauth.html +8 -8
  103. package/dist/docs/guides/mcp-oauth.md +26 -8
  104. package/dist/docs/guides/opentelemetry.html +4 -4
  105. package/dist/docs/guides/slack.html +17 -33
  106. package/dist/docs/guides/slack.md +92 -201
  107. package/dist/docs/guides/webhooks.html +4 -4
  108. package/dist/docs/hashmap.json +1 -1
  109. package/dist/docs/hillclimbing.html +4 -4
  110. package/dist/docs/index.html +6 -6
  111. package/dist/docs/index.md +7 -3
  112. package/dist/docs/llms-full.txt +398 -653
  113. package/dist/docs/llms.txt +3 -2
  114. package/dist/docs/quickstart.html +4 -4
  115. package/dist/docs/reference/agent-config.html +6 -6
  116. package/dist/docs/reference/agent-config.md +2 -2
  117. package/dist/docs/reference/artifacts.html +4 -4
  118. package/dist/docs/reference/channels.html +4 -4
  119. package/dist/docs/reference/cli.html +14 -10
  120. package/dist/docs/reference/cli.md +39 -16
  121. package/dist/docs/reference/connections.html +9 -8
  122. package/dist/docs/reference/connections.md +6 -3
  123. package/dist/docs/reference/hooks.html +4 -4
  124. package/dist/docs/reference/http-api.html +6 -6
  125. package/dist/docs/reference/http-api.md +2 -1
  126. package/dist/docs/reference/instructions.html +4 -4
  127. package/dist/docs/reference/playground.html +4 -4
  128. package/dist/docs/reference/project-layout.html +4 -4
  129. package/dist/docs/reference/prompt.html +4 -4
  130. package/dist/docs/reference/schedules.html +4 -4
  131. package/dist/docs/reference/sessions.html +5 -5
  132. package/dist/docs/reference/sessions.md +4 -2
  133. package/dist/docs/reference/skills.html +4 -4
  134. package/dist/docs/reference/subagents.html +4 -4
  135. package/dist/docs/reference/tools.html +6 -6
  136. package/dist/docs/reference/tools.md +9 -2
  137. package/dist/docs/scaffolding-agents.html +4 -4
  138. package/dist/docs/storage.html +4 -4
  139. package/dist/docs/templates/agentic-owners.html +4 -4
  140. package/dist/docs/templates/agents-md.html +28 -0
  141. package/dist/docs/templates/agents-md.md +105 -0
  142. package/dist/docs/templates/code-wiki.html +28 -0
  143. package/dist/docs/templates/code-wiki.md +91 -0
  144. package/dist/docs/templates/demo.html +5 -5
  145. package/dist/docs/templates/pr-autofixer.html +4 -4
  146. package/dist/docs/templates/security-help.html +4 -4
  147. package/dist/docs/templates/security-reviewer.html +5 -5
  148. package/dist/docs/templates/triage.html +4 -4
  149. package/dist/docs/troubleshooting.html +5 -5
  150. package/dist/docs/troubleshooting.md +2 -2
  151. package/dist/evals/run-facts.d.ts.map +1 -1
  152. package/dist/evals/run-facts.js +27 -0
  153. package/dist/files-backends/cursor-hosted.d.ts +26 -4
  154. package/dist/files-backends/cursor-hosted.d.ts.map +1 -1
  155. package/dist/files-backends/cursor-hosted.js +32 -4
  156. package/dist/internal/advertise-tools.d.ts +2 -0
  157. package/dist/internal/advertise-tools.d.ts.map +1 -1
  158. package/dist/internal/advertise-tools.js +30 -10
  159. package/dist/internal/approval-gate.d.ts +12 -13
  160. package/dist/internal/approval-gate.d.ts.map +1 -1
  161. package/dist/internal/approval-gate.js +16 -21
  162. package/dist/internal/bounded.d.ts +7 -0
  163. package/dist/internal/bounded.d.ts.map +1 -0
  164. package/dist/internal/bounded.js +32 -0
  165. package/dist/internal/chat-client.js +10 -0
  166. package/dist/internal/cli-deploy.d.ts +5 -0
  167. package/dist/internal/cli-deploy.d.ts.map +1 -1
  168. package/dist/internal/cli-deploy.js +57 -18
  169. package/dist/internal/cli-mcp-oauth.js +8 -18
  170. package/dist/internal/cli-slack-manual.d.ts +24 -2
  171. package/dist/internal/cli-slack-manual.d.ts.map +1 -1
  172. package/dist/internal/cli-slack-manual.js +251 -20
  173. package/dist/internal/cli-slack.d.ts +9 -2
  174. package/dist/internal/cli-slack.d.ts.map +1 -1
  175. package/dist/internal/cli-slack.js +29 -82
  176. package/dist/internal/conversation-mirror.d.ts +11 -8
  177. package/dist/internal/conversation-mirror.d.ts.map +1 -1
  178. package/dist/internal/conversation-mirror.js +116 -55
  179. package/dist/internal/cursor/account-mcp.d.ts +1 -0
  180. package/dist/internal/cursor/account-mcp.d.ts.map +1 -1
  181. package/dist/internal/cursor/account-mcp.js +17 -0
  182. package/dist/internal/cursor/backend-client.d.ts.map +1 -1
  183. package/dist/internal/cursor/backend-client.js +22 -48
  184. package/dist/internal/cursor/session-token.d.ts +45 -0
  185. package/dist/internal/cursor/session-token.d.ts.map +1 -0
  186. package/dist/internal/cursor/session-token.js +99 -0
  187. package/dist/internal/cursor-agent-template.d.ts +1 -1
  188. package/dist/internal/cursor-agent-template.d.ts.map +1 -1
  189. package/dist/internal/cursor-agent-template.js +2 -0
  190. package/dist/internal/deploy-client.d.ts +17 -0
  191. package/dist/internal/deploy-client.d.ts.map +1 -1
  192. package/dist/internal/deploy-client.js +31 -10
  193. package/dist/internal/env-file.d.ts +19 -0
  194. package/dist/internal/env-file.d.ts.map +1 -0
  195. package/dist/internal/env-file.js +90 -0
  196. package/dist/internal/framework-file-storage.d.ts +61 -0
  197. package/dist/internal/framework-file-storage.d.ts.map +1 -0
  198. package/dist/internal/framework-file-storage.js +210 -0
  199. package/dist/internal/framework-storage-selection.d.ts +11 -5
  200. package/dist/internal/framework-storage-selection.d.ts.map +1 -1
  201. package/dist/internal/framework-storage-selection.js +38 -11
  202. package/dist/internal/hosted-delivery-protocol.d.ts +7 -0
  203. package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
  204. package/dist/internal/hosted-delivery-protocol.js +7 -0
  205. package/dist/internal/hosted-delivery.d.ts +13 -0
  206. package/dist/internal/hosted-delivery.d.ts.map +1 -1
  207. package/dist/internal/hosted-delivery.js +64 -19
  208. package/dist/internal/hosted-execution-diag.d.ts +48 -0
  209. package/dist/internal/hosted-execution-diag.d.ts.map +1 -0
  210. package/dist/internal/hosted-execution-diag.js +150 -0
  211. package/dist/internal/http-channel.d.ts.map +1 -1
  212. package/dist/internal/http-channel.js +81 -1
  213. package/dist/internal/init-project.d.ts.map +1 -1
  214. package/dist/internal/init-project.js +4 -0
  215. package/dist/internal/install-cursor-skills.d.ts.map +1 -1
  216. package/dist/internal/install-cursor-skills.js +1 -3
  217. package/dist/internal/logs-client.d.ts +5 -0
  218. package/dist/internal/logs-client.d.ts.map +1 -1
  219. package/dist/internal/logs-client.js +5 -0
  220. package/dist/internal/managed-delivery.d.ts +80 -0
  221. package/dist/internal/managed-delivery.d.ts.map +1 -0
  222. package/dist/internal/managed-delivery.js +86 -0
  223. package/dist/internal/mcp-endpoint.js +2 -3
  224. package/dist/internal/mcp-host.d.ts +10 -0
  225. package/dist/internal/mcp-host.d.ts.map +1 -1
  226. package/dist/internal/mcp-host.js +57 -8
  227. package/dist/internal/mcp-oauth-on-demand.d.ts +68 -0
  228. package/dist/internal/mcp-oauth-on-demand.d.ts.map +1 -0
  229. package/dist/internal/mcp-oauth-on-demand.js +287 -0
  230. package/dist/internal/mcp-oauth-persist.d.ts +42 -0
  231. package/dist/internal/mcp-oauth-persist.d.ts.map +1 -0
  232. package/dist/internal/mcp-oauth-persist.js +92 -0
  233. package/dist/internal/mcp-oauth.d.ts +1 -0
  234. package/dist/internal/mcp-oauth.d.ts.map +1 -1
  235. package/dist/internal/mcp-oauth.js +10 -2
  236. package/dist/internal/otel/collector.d.ts.map +1 -1
  237. package/dist/internal/otel/collector.js +22 -9
  238. package/dist/internal/runtime-dispatch-runner.d.ts +5 -1
  239. package/dist/internal/runtime-dispatch-runner.d.ts.map +1 -1
  240. package/dist/internal/runtime-dispatch-runner.js +7 -0
  241. package/dist/internal/sdk-runner.d.ts +11 -0
  242. package/dist/internal/sdk-runner.d.ts.map +1 -1
  243. package/dist/internal/sdk-runner.js +39 -8
  244. package/dist/internal/server.d.ts +3 -0
  245. package/dist/internal/server.d.ts.map +1 -1
  246. package/dist/internal/server.js +49 -21
  247. package/dist/internal/session-engine.d.ts +101 -3
  248. package/dist/internal/session-engine.d.ts.map +1 -1
  249. package/dist/internal/session-engine.js +577 -46
  250. package/dist/internal/sessions-client.d.ts +9 -7
  251. package/dist/internal/sessions-client.d.ts.map +1 -1
  252. package/dist/internal/sessions-client.js +3 -1
  253. package/dist/internal/steering.d.ts +15 -0
  254. package/dist/internal/steering.d.ts.map +1 -0
  255. package/dist/internal/steering.js +18 -0
  256. package/dist/internal/storage-coordinator.d.ts +7 -0
  257. package/dist/internal/storage-coordinator.d.ts.map +1 -1
  258. package/dist/internal/storage-coordinator.js +28 -5
  259. package/dist/internal/storage-roles.d.ts +5 -0
  260. package/dist/internal/storage-roles.d.ts.map +1 -1
  261. package/dist/internal/stream-progress.d.ts.map +1 -1
  262. package/dist/internal/stream-progress.js +10 -0
  263. package/dist/internal/tool-policy.d.ts +9 -1
  264. package/dist/internal/tool-policy.d.ts.map +1 -1
  265. package/dist/internal/tool-policy.js +13 -0
  266. package/dist/internal/trajectory.d.ts.map +1 -1
  267. package/dist/internal/trajectory.js +10 -0
  268. package/dist/internal/turn-outbox.d.ts +24 -0
  269. package/dist/internal/turn-outbox.d.ts.map +1 -0
  270. package/dist/internal/turn-outbox.js +80 -0
  271. package/dist/playground/assets/{index-CZA1uEWA.js → index-DrkI6y5O.js} +51 -51
  272. package/dist/playground/assets/index-DzNGwm7q.css +1 -0
  273. package/dist/playground/index.html +2 -2
  274. package/dist/storage-backends/cursor-hosted.d.ts +9 -6
  275. package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
  276. package/dist/storage-backends/cursor-hosted.js +16 -3
  277. package/dist/storage.d.ts +8 -0
  278. package/dist/storage.d.ts.map +1 -1
  279. package/dist/types.d.ts +65 -8
  280. package/dist/types.d.ts.map +1 -1
  281. package/docs/README.md +7 -3
  282. package/docs/deployment.md +5 -4
  283. package/docs/guides/mcp-oauth.md +26 -8
  284. package/docs/guides/slack.md +93 -202
  285. package/docs/reference/agent-config.md +2 -2
  286. package/docs/reference/cli.md +39 -16
  287. package/docs/reference/connections.md +6 -3
  288. package/docs/reference/http-api.md +2 -1
  289. package/docs/reference/sessions.md +4 -2
  290. package/docs/reference/tools.md +9 -2
  291. package/docs/templates/agents-md.md +110 -0
  292. package/docs/templates/code-wiki.md +96 -0
  293. package/docs/troubleshooting.md +2 -2
  294. package/package.json +2 -2
  295. package/skills/ab/SKILL.md +13 -97
  296. package/skills/create-agent/SKILL.md +124 -223
  297. package/skills/debug/SKILL.md +34 -68
  298. package/skills/evals/SKILL.md +55 -180
  299. package/skills/framework-map/SKILL.md +83 -145
  300. package/skills/github/SKILL.md +53 -111
  301. package/skills/hillclimb/SKILL.md +40 -163
  302. package/skills/mcp-auth/SKILL.md +51 -107
  303. package/skills/otel/SKILL.md +22 -68
  304. package/skills/setup-slack/SKILL.md +91 -212
  305. package/src/bin/agent-serve.ts +13 -1
  306. package/src/channels/deployments/types.ts +1 -0
  307. package/src/channels/origin/api.ts +264 -33
  308. package/src/channels/origin/binding.ts +57 -28
  309. package/src/channels/origin/checks.ts +6 -6
  310. package/src/channels/origin/cursor-account.ts +5 -3
  311. package/src/channels/origin/index.ts +1 -0
  312. package/src/channels/origin/origin-channel.ts +4 -0
  313. package/src/channels/origin/reactions.ts +82 -0
  314. package/src/channels/origin/types.ts +11 -0
  315. package/src/channels/slack/api.ts +41 -5
  316. package/src/channels/slack/approvals.ts +105 -0
  317. package/src/channels/slack/cli-project.ts +267 -0
  318. package/src/channels/slack/defaults.ts +122 -93
  319. package/src/channels/slack/dispatch.ts +56 -22
  320. package/src/channels/slack/inbound.ts +43 -0
  321. package/src/channels/slack/init.ts +10 -5
  322. package/src/channels/slack/interactive.ts +35 -9
  323. package/src/channels/slack/live-delivery.ts +235 -114
  324. package/src/channels/slack/manifest.ts +6 -2
  325. package/src/channels/slack/nudge-carrier.ts +48 -1
  326. package/src/channels/slack/setup.ts +10 -6
  327. package/src/channels/slack/slack-channel.ts +3 -0
  328. package/src/channels/slack/tool-approval-events.ts +93 -0
  329. package/src/evals/run-facts.ts +32 -0
  330. package/src/files-backends/cursor-hosted.ts +40 -7
  331. package/src/internal/advertise-tools.ts +49 -12
  332. package/src/internal/approval-gate.ts +20 -29
  333. package/src/internal/bounded.ts +28 -0
  334. package/src/internal/chat-client.ts +19 -0
  335. package/src/internal/cli-deploy.ts +91 -9
  336. package/src/internal/cli-mcp-oauth.ts +7 -21
  337. package/src/internal/cli-slack-manual.ts +350 -18
  338. package/src/internal/cli-slack.ts +40 -84
  339. package/src/internal/conversation-mirror.ts +145 -69
  340. package/src/internal/cursor/account-mcp.ts +21 -0
  341. package/src/internal/cursor/backend-client.ts +34 -58
  342. package/src/internal/cursor/session-token.ts +115 -0
  343. package/src/internal/cursor-agent-template.ts +2 -0
  344. package/src/internal/deploy-client.ts +43 -0
  345. package/src/internal/env-file.ts +84 -0
  346. package/src/internal/framework-file-storage.ts +228 -0
  347. package/src/internal/framework-storage-selection.ts +51 -11
  348. package/src/internal/hosted-delivery-protocol.ts +7 -0
  349. package/src/internal/hosted-delivery.ts +107 -24
  350. package/src/internal/hosted-execution-diag.ts +207 -0
  351. package/src/internal/http-channel.ts +99 -0
  352. package/src/internal/init-project.ts +4 -0
  353. package/src/internal/install-cursor-skills.ts +1 -4
  354. package/src/internal/logs-client.ts +5 -0
  355. package/src/internal/managed-delivery.ts +125 -0
  356. package/src/internal/mcp-endpoint.ts +13 -4
  357. package/src/internal/mcp-host.ts +77 -11
  358. package/src/internal/mcp-oauth-on-demand.ts +352 -0
  359. package/src/internal/mcp-oauth-persist.ts +127 -0
  360. package/src/internal/mcp-oauth.ts +17 -1
  361. package/src/internal/otel/collector.ts +30 -0
  362. package/src/internal/runtime-dispatch-runner.ts +10 -0
  363. package/src/internal/sdk-runner.ts +56 -8
  364. package/src/internal/server.ts +61 -9
  365. package/src/internal/session-engine.ts +723 -60
  366. package/src/internal/sessions-client.ts +17 -8
  367. package/src/internal/steering.ts +17 -0
  368. package/src/internal/storage-coordinator.ts +38 -8
  369. package/src/internal/storage-roles.ts +7 -0
  370. package/src/internal/stream-progress.ts +19 -0
  371. package/src/internal/tool-policy.ts +18 -0
  372. package/src/internal/trajectory.ts +10 -0
  373. package/src/internal/turn-outbox.ts +85 -0
  374. package/src/storage-backends/cursor-hosted.ts +22 -8
  375. package/src/storage.ts +12 -0
  376. package/src/types.ts +70 -9
  377. package/templates/agents-md/README.md +39 -0
  378. package/templates/agents-md/agent/agent.ts +8 -0
  379. package/templates/agents-md/agent/channels/github.ts +10 -0
  380. package/templates/agents-md/agent/channels/queue.ts +28 -0
  381. package/templates/agents-md/agent/channels/slack.ts +9 -0
  382. package/templates/agents-md/agent/instructions.md +39 -0
  383. package/templates/agents-md/agent/lib/collect.ts +439 -0
  384. package/templates/agents-md/agent/lib/config.ts +8 -0
  385. package/templates/agents-md/agent/lib/paths.ts +51 -0
  386. package/templates/agents-md/agent/schedules/weekly.ts +17 -0
  387. package/templates/agents-md/agent/tools/apply_agents.ts +226 -0
  388. package/templates/agents-md/evals/agents.eval.ts +135 -0
  389. package/templates/agents-md/evals/evals.config.ts +5 -0
  390. package/templates/agents-md/init.json +38 -0
  391. package/templates/agents-md/package.json +18 -0
  392. package/templates/agents-md/tsconfig.json +12 -0
  393. package/templates/code-wiki/README.md +34 -0
  394. package/templates/code-wiki/agent/agent.ts +8 -0
  395. package/templates/code-wiki/agent/channels/github.ts +144 -0
  396. package/templates/code-wiki/agent/instructions.md +39 -0
  397. package/templates/code-wiki/agent/lib/repos.ts +5 -0
  398. package/templates/code-wiki/agent/lib/wiki.ts +22 -0
  399. package/templates/code-wiki/agent/tools/apply_wiki.ts +219 -0
  400. package/templates/code-wiki/evals/evals.config.ts +5 -0
  401. package/templates/code-wiki/evals/wiki.eval.ts +132 -0
  402. package/templates/code-wiki/init.json +25 -0
  403. package/templates/code-wiki/package.json +18 -0
  404. package/templates/code-wiki/tsconfig.json +12 -0
  405. package/dist/docs/assets/chunks/@localSearchIndexroot.oqPawjiD.js +0 -1
  406. package/dist/docs/assets/guides_slack.md.C32HsdKk.js +0 -38
  407. package/dist/docs/assets/guides_slack.md.C32HsdKk.lean.js +0 -1
  408. package/dist/docs/assets/index.md.BoHaMdeZ.js +0 -5
  409. package/dist/docs/assets/reference_sessions.md.D0mIh4KK.js +0 -1
  410. package/dist/docs/assets/troubleshooting.md.Ctv3T8C2.js +0 -1
  411. package/dist/docs/design/agsh.md +0 -406
  412. package/dist/internal/deployment-scm-event-stream.d.ts +0 -116
  413. package/dist/internal/deployment-scm-event-stream.d.ts.map +0 -1
  414. package/dist/internal/deployment-scm-event-stream.js +0 -474
  415. package/dist/playground/assets/index-CF7hUDnQ.css +0 -1
  416. package/docs/design/agsh.md +0 -406
  417. package/src/internal/deployment-scm-event-stream.ts +0 -593
  418. /package/dist/docs/assets/{deployment.md.D9msOFOW.lean.js → deployment.md.MFPKqsqI.lean.js} +0 -0
  419. /package/dist/docs/assets/{reference_agent-config.md.Cp_x38Nl.lean.js → reference_agent-config.md.BHeYMgme.lean.js} +0 -0
  420. /package/dist/docs/assets/{reference_connections.md.BH8Oc0D0.lean.js → reference_connections.md.DxldvyIB.lean.js} +0 -0
  421. /package/dist/docs/assets/{reference_http-api.md.D89k1mdm.lean.js → reference_http-api.md.5zOAbV86.lean.js} +0 -0
  422. /package/dist/docs/assets/{reference_sessions.md.D0mIh4KK.lean.js → reference_sessions.md.NxFP_CAC.lean.js} +0 -0
  423. /package/dist/docs/assets/{reference_tools.md.BHeXn2id.lean.js → reference_tools.md.B84gw9Ii.lean.js} +0 -0
  424. /package/dist/docs/assets/{troubleshooting.md.Ctv3T8C2.lean.js → troubleshooting.md.DCiPBhYs.lean.js} +0 -0
@@ -1,129 +1,58 @@
1
1
  ---
2
2
  name: agentsdk-evals
3
3
  description: >-
4
- Author and run Agent SDK defineEval cases (single- or multi-datapoint).
5
- Use when writing, fixing, seeding, or hillclimbing evals; AskQuestion
6
- whether to generate samples or upload data. Materialize API-backed
7
- fixtures first. Live A/B metrics: defineAB (skills/ab), not defineEval.
4
+ Author and run defineEval cases. Use when writing, fixing, seeding,
5
+ or hillclimbing evals. Ask whether to generate samples or take
6
+ uploaded data. Materialize API-backed fixtures first. Live A/B is
7
+ defineAB (skills/ab), not defineEval.
8
8
  ---
9
9
 
10
10
  # Agent SDK evals
11
11
 
12
- Public docs index: `node_modules/@cursor/july/dist/docs/llms.txt`. A running
13
- host serves the same index at `/docs/llms.txt`.
12
+ Fixed input, model turn, gates on the trajectory. Files live at
13
+ project-root `evals/**/*.eval.ts`. `agent/evals/` is ignored.
14
14
 
15
- Evals are the ratchet that makes iteration trustworthy: a fixed input, a
16
- model turn, and gates over the recorded trajectory. They live at the
17
- **project root** `evals/**/*.eval.ts` (never `agent/evals/` — that slot is
18
- ignored).
19
-
20
- For **live A/B metrics** while the agent serves traffic, use `defineAB`
21
- under `agent/ab` (`packages/agent-serve/skills/ab/SKILL.md`). That plug-in
22
- enrolls via sticky `split` and calls `onSample`; it is not a test runner
23
- and does not replace `defineEval` gates.
24
-
25
- **Identity**
26
-
27
- - File id = path under `evals/` without `.eval.ts`
28
- (`evals/weather.eval.ts` → `weather`).
29
- - Single datapoint (`test`): case id = file id
30
- (`evals/weather/nyc.eval.ts` → `weather/nyc`).
31
- - Multiple datapoints (`cases`): case id = `<fileId>/<case.id>`
32
- (`evals/weather.eval.ts` + `{ id: "nyc" }` → `weather/nyc`).
15
+ Live traffic variants: `skills/ab/SKILL.md`. That is not a test
16
+ runner.
33
17
 
34
18
  ```bash
35
- agent-sdk eval --dir . --list # all datapoints
36
- agent-sdk eval --dir . --json # run all
37
- agent-sdk eval --dir . weather/nyc # one datapoint
38
- agent-sdk eval --dir . weather # every datapoint in that file
39
- agent-sdk eval --dir . weather forecast # several files
19
+ agent-sdk eval --dir . --list
20
+ agent-sdk eval --dir . --json
21
+ agent-sdk eval --dir . weather/nyc
40
22
  agent-sdk eval --dir . --tag smoke
41
- agent-sdk eval --dir . --verbose
42
23
  ```
43
24
 
44
- `eval` (like `run`) boots an ephemeral server on port 0 with a temp state
45
- root outside the project, so cases don't inherit ambient monorepo rules and
46
- don't pollute `.agent-serve/`. Point `--url` at a running server instead to
47
- eval a live agent. Model turns require `CURSOR_API_KEY`.
48
-
49
- ## Seeding / adding samples (required fork)
25
+ | Form | Case id |
26
+ | --- | --- |
27
+ | `evals/weather.eval.ts` + `test` | `weather` |
28
+ | `evals/weather/nyc.eval.ts` + `test` | `weather/nyc` |
29
+ | `evals/weather.eval.ts` + `{ id: "nyc" }` | `weather/nyc` |
50
30
 
51
- Whenever the task is to **create, seed, or expand** eval cases (not merely
52
- run or tweak an existing gate), start with the `AskQuestion` tool. Do not
53
- assume a source of fixtures.
31
+ `eval` boots an ephemeral server and a temp state root. `--url`
32
+ points at a running agent. Model turns need `CURSOR_API_KEY`.
54
33
 
55
- ### Step 1 — who supplies the samples?
34
+ ## Seeding
56
35
 
57
- Use `AskQuestion` (single-select). Put the recommended option first and
58
- label it `(recommended)`. Do **not** put code blocks inside the question
59
- prompt (they render poorly); keep the prompt short plain text.
36
+ Creating or expanding cases: `AskQuestion` first.
60
37
 
61
38
  | Question | Options |
62
39
  | --- | --- |
63
40
  | **How should we get eval samples?** | Generate test eval samples for me `(recommended)` · I will add / upload the data manually |
64
41
 
65
- If `AskQuestion` is unavailable, ask the same fork in plain chat and wait.
66
-
67
- ### Step 2a user chose manual
68
-
69
- Tell the user the **shape** of the data (see “The API” below) and **how to
70
- upload it**. Do not invent cases until they provide files (or paste content
71
- to write). After they add data, run `agent-sdk eval --dir <project>
72
- --list` to confirm discovery, then wire any missing gates.
73
-
74
- If the uploaded data is **API-backed** (PR URLs, pinned SHAs, gold labels,
75
- snapshot ids) rather than self-contained prompts/diffs, **materialize
76
- fixtures first** — see “When eval data needs API calls to render” below.
77
-
78
- **How to upload:**
79
-
80
- 1. Add or edit `.eval.ts` files under the project’s `evals/` directory.
81
- 2. Ensure `evals/evals.config.ts` exists with `maxConcurrency`.
82
- 3. Optional fixtures beside the case or under `fixtures/`.
83
- 4. Tell the agent once the files are in place — or paste case bodies in chat
84
- and ask the agent to write the file.
85
- 5. Verify: `agent-sdk eval --dir <project> --list` shows the new ids.
86
-
87
- ### Step 2b — user chose agent-generated samples
88
-
89
- 1. Use `AskQuestion` again for count (single-select), recommended first:
90
-
91
- | Question | Options |
92
- | --- | --- |
93
- | **How many test samples should I create?** | `3` `(recommended)` · `5` · `10` · Other (enter a number) |
94
-
95
- 2. Inspect the agent (tools, instructions, existing `evals/`) and invent
96
- that many **distinct** datapoints: frozen prompts + decision/shape gates,
97
- not exact prose. Follow “What good cases assert” below.
98
- 3. **Append** — prefer adding entries to an existing file’s `cases` array
99
- when the suite fits; otherwise create a new `evals/<suite>.eval.ts` with
100
- `cases`. Never overwrite or weaken an existing datapoint. Case ids must
101
- not collide with `agent-sdk eval --dir <project> --list`.
102
- 4. Create `evals/evals.config.ts` if missing (`maxConcurrency: 20` is fine
103
- for now; hard limit 200 for model provider request limits).
104
- 5. Re-list to confirm, then optionally run `--tag smoke` if you tagged any.
42
+ 1. **Manual.** They provide files or paste. Show the shape below.
43
+ Do not invent cases. Then `eval --list` and wire gates.
44
+ API-backed pointers (PR URLs, SHAs, gold labels): materialize
45
+ under `fixtures/` first.
46
+ 2. **Generated.** Ask count (`3` recommended). Append to an
47
+ existing `cases` array when it fits. Never overwrite or weaken
48
+ a datapoint. Create `evals/evals.config.ts` if missing
49
+ (`maxConcurrency: 20`; cap 200).
105
50
 
106
- ## The API
51
+ ## API
107
52
 
108
53
  ```ts
109
- import { defineEval, includes, equals, satisfies } from "@cursor/july/evals";
54
+ import { defineEval, includes, satisfies } from "@cursor/july/evals";
110
55
 
111
- // Single datapoint (case id = file path under evals/)
112
- export default defineEval({
113
- description: "Uses get_weather for temperature questions.",
114
- tags: ["smoke"],
115
- timeoutMs: 120_000,
116
- async test(t) {
117
- await t.send("What's the temperature in NYC?");
118
- t.succeeded();
119
- t.calledTool("get_weather");
120
- t.notCalledTool("save_weather_note");
121
- t.messageIncludes(/°|[FC]/);
122
- t.check(t.reply, includes("NYC"));
123
- },
124
- });
125
-
126
- // Multiple datapoints in one file (ids = <fileId>/<case.id>)
127
56
  export default defineEval({
128
57
  tags: ["smoke", "weather"],
129
58
  cases: [
@@ -134,100 +63,46 @@ export default defineEval({
134
63
  await t.send("What's the temperature in NYC?");
135
64
  t.succeeded();
136
65
  t.calledTool("get_weather");
66
+ t.notCalledTool("save_weather_note");
137
67
  t.check(t.reply, includes(/°|[FC]/));
138
68
  },
139
69
  },
140
- {
141
- id: "paris",
142
- async test(t) {
143
- await t.send("What's the weather in Paris?");
144
- t.succeeded();
145
- t.calledTool("get_weather");
146
- },
147
- },
148
70
  ],
149
71
  });
150
72
  ```
151
73
 
152
- Project-wide defaults in `evals/evals.config.ts` (required once):
153
-
154
74
  ```ts
155
- import {
156
- defineEvalConfig,
157
- persistEvalRunsToDir,
158
- } from "@cursor/july/evals";
75
+ import { defineEvalConfig } from "@cursor/july/evals";
159
76
 
160
77
  export default defineEvalConfig({
161
- maxConcurrency: 20, // required; hard-capped at 200 (model provider limits)
162
- // Playground batches are memory-only unless you set persistRuns:
163
- // maxPlaygroundRuns: 50, // optional; default 20; playground history only
164
- // persistRuns: persistEvalRunsToDir(".agent-serve/eval-runs"),
78
+ maxConcurrency: 20,
165
79
  });
166
80
  ```
167
81
 
168
- - Either a single `test(t)` **or** a `cases: [{ id, test }, …]` array not
169
- both. Prefer `cases` for multiple related datapoints.
170
- - `t.send(message, options?)` runs one turn and waits for park/fail.
171
- Options: `workspaceDir`, `workspaceFiles` (`{ path: contents }` seeded
172
- before the first turn). Multiple `t.send` calls share the session.
173
- - `t.reply` / `t.events` / `t.sessionId` for assertions and correlation.
174
- - `t.metric(name, value)` — structured scores on the case snapshot (playground
175
- badges + CLI). Prefer this over encoding scores only in `t.log`.
176
- - Builders: `includes(string | RegExp)`, `equals(value)`,
177
- `satisfies(predicate, label)`.
178
-
179
- ### Playground customization (optional)
180
-
181
- Drop `agent/playground/evals.tsx` exporting `agentName` (must match
182
- `defineAgent({ name })`) and
183
- `default: { RunSummary?, CaseMetrics?, CaseExtras? }`. The playground
184
- loads these via Vite glob (`factory/*`). Without a
185
- module, cases still show default `t.metric` badges.
186
-
187
- ## What good cases assert
188
-
189
- Gate **decisions and shape, not prose**. Model wording varies run to run;
190
- tool choice, tool avoidance, and output structure shouldn't.
191
-
192
- 1. `t.succeeded()` — always, first.
193
- 2. The tool decision: `calledTool` for the intended path, `notCalledTool`
194
- for the tempting wrong one (the pair is stronger than either alone).
195
- 3. Output shape: a regex for the contract (`/°|[FC]/`, a JSON marker, a
196
- findings-block fence) — not exact sentences.
197
- 4. For structured output, parse `t.reply` and `t.check` fields with
198
- `satisfies` rather than substring-matching JSON.
199
- 5. When a shape gate keeps failing on model formatting, tighten the output
200
- contract in instructions and re-run — do not move rendering into a host
201
- tool to make the gate pass. That trades a prompt fix for permanent code.
202
-
203
- Anti-patterns: asserting exact phrasing; more than ~5 gates in one case
204
- (split it); cases that depend on live external state that drifts (pin the
205
- input instead — see fixtures).
206
-
207
- ## Fixture strategy by agent type
208
-
209
- | Agent surface | Fixture source |
210
- | --- | --- |
211
- | Chat / domain assistant | A canonical prompt string, chosen once and frozen |
212
- | Tool-heavy | `agent-sdk call <tool> --dir . --input '{...}'` first, then the prompt that should trigger it |
213
- | GitHub webhook | `github replay … --dry-run --out fixtures/github` (see `packages/agent-serve/skills/github/SKILL.md`) |
214
- | PR reviewer with host prep | A small fixed PR the team controls; assert on findings shape, not counts |
215
- | Workspace-dependent | `workspaceFiles` in `t.send` — never machine-local paths |
82
+ Either `test(t)` or `cases`, not both. `t.send` waits for park/fail.
83
+ `workspaceFiles` seeds the first turn. Assert with `t.succeeded()`,
84
+ `calledTool` / `notCalledTool`, `t.check(t.reply, )`, `t.metric`.
216
85
 
217
- ### When eval data needs API calls to render (rate limits)
86
+ ## What to gate
218
87
 
219
- If samples are **pointers** (PR URL, SHAs, `gold_labels`) rather than
220
- self-contained evidence, do **not** wire live `t.send(prUrl)` matrices.
221
- Materialize once under `fixtures/` at pinned SHAs, point cases at those
222
- files, gate on decision/shape against gold, and keep a tiny `--tag smoke`
223
- subset for any full-pipeline runs.
88
+ Decisions and shape, not prose.
224
89
 
225
- ## The ratchet rule (hillclimbing)
90
+ 1. `t.succeeded()` first
91
+ 2. Intended tool + the tempting wrong one
92
+ 3. A shape regex or `satisfies` on parsed fields
93
+ 4. If formatting keeps failing, tighten instructions. Do not move
94
+ rendering into a host tool.
226
95
 
227
- Every hillclimb round that **keeps** a change must land an eval that would
228
- have failed before the change. Never weaken a gate to make a round pass.
96
+ Anti-patterns: exact phrasing; more than ~5 gates (split); live
97
+ drifting inputs (pin them).
229
98
 
230
- ```ts
231
- const toolResults = t.events.filter((e) => e.type === "action.result");
232
- t.check(toolResults.length, satisfies((n) => (n as number) <= 4, "≤4 tool calls"));
233
- ```
99
+ | Surface | Fixture |
100
+ | --- | --- |
101
+ | Chat | One frozen prompt |
102
+ | Tool-heavy | `agent-sdk call` first, then the prompt |
103
+ | GitHub | `github replay … --dry-run --out fixtures/github` |
104
+ | Host-prep PR review | A team-owned PR; gate findings shape, not counts |
105
+ | Workspace | `workspaceFiles` in `t.send` |
106
+
107
+ Every kept hillclimb change lands an eval that would have failed
108
+ before it. Never weaken a gate to pass a round.
@@ -1,165 +1,103 @@
1
1
  ---
2
2
  name: agentsdk-framework-map
3
3
  description: >-
4
- Orientation for @cursor/july folder structure, local vs cloud
5
- runtimes, sessions, state layout, and invariants (Node not Bun, root
6
- evals/, typecheck after tsx). Use when creating, editing, or running
7
- Agent SDK projects with agent/agent.ts and agent/instructions.md.
4
+ Orient on Agent SDK layout, local vs cloud runtime, sessions, and
5
+ invariants (Node not Bun, root evals/, typecheck after tsx). Use
6
+ when creating, editing, or running a project with agent/agent.ts.
8
7
  ---
9
8
 
10
9
  # Agent SDK framework map
11
10
 
12
- `@cursor/july` serves agents defined as ordinary files: markdown
13
- for prose, TypeScript for typed behavior, under an `agent/` directory. The
14
- framework discovers the files, compiles a manifest, and serves the agent
15
- over HTTP/Slack/GitHub channels, with the Cursor SDK + harness as the
16
- execution engine. Ground truth is the package `README.md` (full reference)
17
- and `AGENTS.md` (coding-agent loop) — this skill is the map, not the spec.
18
-
19
- Public docs index: `node_modules/@cursor/july/dist/docs/llms.txt`. A running
20
- host serves the same index at `/docs/llms.txt`.
21
-
22
- Run the CLI as `agent-sdk <cmd>`. In the everysphere monorepo there is no
23
- installed bin use:
24
-
25
- ```bash
26
- cd packages/agent-serve
27
- pnpm exec tsx src/bin/agent-serve.ts <cmd> ...
28
- ```
29
-
30
- ## Hard invariants (violating these wastes hours)
31
-
32
- 1. **Node 22+, never Bun.** Bun's HTTP/2 client corrupts harness
33
- tool-result streams (`NGHTTP2_FRAME_SIZE_ERROR`): every built-in
34
- read/grep the model makes fails and turns degrade into 8-minute retry
35
- loops. All package mise tasks already use tsx.
36
- 2. **Evals live at the project root `evals/`**, never `agent/evals/` (that
37
- path is silently ignored).
38
- 3. **tsx strips types without checking them.** `validate`/`run` passing
39
- does not mean the code typechecks — run the repo's TypeScript check
40
- (in everysphere: `dev check typecheck packages/agent-serve/... --timeout 120`)
41
- before shipping. Classic miss: a tool `execute` return that fails
42
- `ToolExecuteResult` — returns must be JSON-shaped, so use object
43
- literals or `type` aliases, not `interface` types.
44
- 4. **Harness cwd in a nested git repo.** Discovery defaults `local.cwd` to
45
- `~/.cache/agent-serve/<dir>` so ancestor `AGENTS.md` / `.cursor` / IDE
46
- MCP do not leak into playground turns. Set cwd at a checkout only when
47
- the agent must inherit that tree. Attached MCP is invisible by name
48
- until `advertiseTools: true`.
49
- 5. **A model turn needs `CURSOR_API_KEY`.** Everything structural
50
- (`validate`, `info`, `call`, `serve` bring-up) works without one.
11
+ `@cursor/july` discovers files under `agent/` and serves the agent
12
+ over HTTP, Slack, and GitHub. Markdown is prose. TypeScript is typed
13
+ behavior. Ground truth: package `README.md` and `AGENTS.md`.
14
+
15
+ CLI is `agent-sdk` (Node, never Bun).
16
+
17
+ Public docs: `node_modules/@cursor/july/dist/docs/llms.txt` or
18
+ `/docs/llms.txt` on a running host.
19
+
20
+ ## Invariants
21
+
22
+ 1. **Node 22.13+, never Bun.** Bun corrupts harness tool-result
23
+ streams (`NGHTTP2_FRAME_SIZE_ERROR`).
24
+ 2. **Evals live at project-root `evals/`.** `agent/evals/` is ignored.
25
+ 3. **tsx does not typecheck.** Tool `execute` must return JSON-shaped
26
+ values: object literals or `type` aliases, not `interface` types.
27
+ 4. **Nested git checkouts.** Discovery sets `local.cwd` to a
28
+ per-project cache directory under `~/.cache`. Point cwd at a
29
+ checkout only when the agent must inherit that tree.
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.
51
33
 
52
34
  ## Folder structure
53
35
 
54
- One file per concept; the path is the identity. Full details for each
55
- path live under README "Folder structure".
36
+ Path is identity. Full list: README "Folder structure".
56
37
 
57
- | Path | What it is |
38
+ | Path | Role |
58
39
  | --- | --- |
59
- | `agent/agent.ts` | `defineAgent({ model?, runtime?, cloud?, local? })`; model defaults to `grok-4.5` with `effort=high`, `fast=true` |
60
- | `agent/instructions.md` | Always-on system prompt (required; `.ts`/dir forms exist) |
61
- | `agent/tools/<name>.ts` | One typed tool; filename = tool name. `execution: "server"` (in-process, default) or `"agent"` (script that runs where the agent runs) |
62
- | `agent/skills/*` | SKILL.md-convention procedures, loaded on demand |
63
- | `agent/mcp-connections/<name>.ts` | MCP servers. Do not name an account connection `cursor.ts`. `advertiseTools: true` for named tools on local turns. `{ tools }` authors TypeScript the Agent SDK packages as stdio MCP. |
64
- | `agent/host-connections/<name>.ts` | Privileged MCP for `ctx.host.mcp` and `mcp oauth`. The model never sees them. |
65
- | `agent/subagents/<id>/` | Child agent dir (`description` required; per-subagent tools/skills/MCP connections ignored for now) |
66
- | `agent/channels/*.ts` | HTTP surfaces beyond the built-in session API; `slack.ts` / `github.ts` use the platform packs |
67
- | `agent/hooks/*.ts` | Observe-only event subscribers (never fatal) |
68
- | `agent/ab.ts` or `agent/ab/*.ts` | Live A/B metrics (`defineAB`); sticky `split` + `onSample` |
69
- | `agent/ab.config.ts` | Optional A/B `maxPlaygroundSessions` / `persistSamples` / `persistSnapshots` |
70
- | `agent/otel.ts` | OpenTelemetry export (`defineOtel`); also `OTEL_EXPORTER_OTLP_*` env |
71
- | `agent/schedules/*` | Cron-driven runs (UTC, 5-field; never auto-fire under `--dev`) |
72
- | `agent/sandbox/workspace/` | Files seeded into each session workspace (local runtime only) |
73
- | `agent/lib/` | Import-only shared code, never discovered |
74
- | `evals/**/*.eval.ts` | Filesystem evals; case id = path under `evals/` |
75
-
76
- ## Local vs cloud runtime
77
-
78
- `runtime: "local"` (default) runs turns on the Cursor SDK local harness on
79
- the serve host; `runtime: "cloud"` runs them on Cursor cloud agents
80
- (`bc-...` ids, needs `cloud: { repos: [...] }`).
40
+ | `agent/agent.ts` | `defineAgent({ model?, runtime?, cloud?, local? })` |
41
+ | `agent/instructions.md` | Always-on system prompt (required) |
42
+ | `agent/tools/<name>.ts` | One tool. `execution: "server"` or `"agent"` |
43
+ | `agent/skills/*` | On-demand procedures |
44
+ | `agent/mcp-connections/<name>.ts` | MCP. Never name an account file `cursor.ts`. `advertiseTools: true` for named local tools |
45
+ | `agent/host-connections/<name>.ts` | Privileged MCP for `ctx.host.mcp` / `mcp oauth` |
46
+ | `agent/subagents/<id>/` | Child agent (`description` required) |
47
+ | `agent/channels/*.ts` | Slack / GitHub / custom HTTP |
48
+ | `agent/hooks/*.ts` | Observe-only |
49
+ | `agent/ab.ts` or `agent/ab/*.ts` | Live A/B (`defineAB`) |
50
+ | `agent/otel.ts` | OpenTelemetry (`defineOtel`) |
51
+ | `agent/schedules/*` | Cron. Never auto-fire under `--dev` |
52
+ | `agent/sandbox/workspace/` | Session seed files (local only) |
53
+ | `agent/lib/` | Import-only. Never discovered |
54
+ | `evals/**/*.eval.ts` | Case id is the path under `evals/` |
55
+
56
+ ## Local vs cloud
57
+
58
+ `runtime: "local"` (default) runs on the serve host.
59
+ `runtime: "cloud"` needs `cloud: { repos: [...] }`.
81
60
 
82
61
  | Capability | local | cloud |
83
62
  | --- | --- | --- |
84
- | Server tools (`execution: "server"`) | yes | yes on managed hosting; self-hosted needs `--public-url` |
63
+ | Server tools | yes | yes on managed hosting; self-hosted needs `--public-url` |
85
64
  | Tool approvals | yes | no |
86
- | Agent tools (`execution: "agent"` scripts) | yes | yes |
87
- | Skills | yes | yes |
65
+ | Agent tools / skills | yes | yes |
88
66
  | sandbox seeds | yes | no |
89
- | Instructions | `AGENTS.md` in session workspace | prepended to first prompt |
90
- | Checkout of a repo/PR | you arrange it | the VM carries it |
91
-
92
- Rule of thumb: per-PR worktrees on the serve host die at
93
- "hundreds of engineers issuing PRs" — when the job needs a repo checkout at
94
- scale, use cloud and keep the host to routing, briefs, and bookkeeping.
95
- `validate` warns when cloud is combined with local-only capabilities.
96
-
97
- ## Sessions, tokens, streams
98
-
99
- Two handles, two owners:
100
-
101
- - **continuationToken:** credential for continuing a conversation. HTTP
102
- follow-ups rotate it; stale tokens get `409`.
103
- - **sessionId** runtime-owned handle for streaming/inspection
104
- (`GET /v1/session/:id/stream?startIndex=N`, durable NDJSON replay).
105
-
106
- A follow-up to a busy HTTP/MCP session **interrupts the in-flight turn**
107
- and waits for it to settle before the new turn sends. Slack uses
108
- **coalesce** instead (enqueue + boundary drain; see
109
- `docs/reference/sessions.md`). `POST /v1/session/:id/stop` interrupts
110
- without sending. Session-bound deterministic tool calls are rejected with
111
- `409 session_busy` while a turn runs.
112
-
113
- Key built-in routes (each agent, under `/<slug>` in multi-agent mode):
114
- `POST /v1/session`, `POST /v1/session/:id`, `GET /v1/session/:id/stream`,
115
- `GET /v1/sessions`, `POST /v1/tools/:toolName` (deterministic call),
116
- `GET/POST /v1/session/:id/approvals[/:callId]`, `GET /v1/info`,
117
- `GET /v1/health`, and in dev `POST /v1/dev/schedules/:id`,
118
- `POST /v1/dev/reminders/:id`.
119
-
120
- ## State layout
121
-
122
- ```
123
- <project>/.agent-serve/ # or <stateRoot>/<slug>/ under serve
124
- sessions/<id>/session.json # metadata
125
- sessions/<id>/events.ndjson # durable stream (replayable)
126
- sessions/<id>/workspace/ # the harness cwd for that session
127
- traces/<sessionId>.ndjson # written by `run`
128
- runner/ # SDK conversation store
129
- ```
130
-
131
- Delete a session directory to forget a conversation.
67
+ | Checkout | you arrange it | the VM carries it |
68
+
69
+ Use cloud when the job needs a checkout at scale. `validate` warns
70
+ when cloud is combined with local-only capabilities.
71
+
72
+ ## Sessions
73
+
74
+ - **continuationToken** continues a conversation. HTTP follow-ups
75
+ rotate it. Stale tokens return `409`.
76
+ - **sessionId** is the inspect handle
77
+ (`GET /v1/session/:id/stream?startIndex=N`).
78
+
79
+ A follow-up to a busy HTTP/MCP session interrupts the in-flight
80
+ turn. Slack coalesces. Routes: `docs/reference/http-api.md`.
81
+ Session files live under the project state directory
82
+ (`--state-root`).
132
83
 
133
84
  ## Where logic belongs
134
85
 
135
- The model is the engine; TypeScript is the boundary layer. Code earns its
136
- place on the deterministic path for side-effect gates and actuation,
137
- idempotency/dedupe of external writes, auth/secrets, evidence seeding, and
138
- hard caps at API boundaries. Formatting, summarizing, classification,
139
- wording, and composing human-facing output belong to the model, under an
140
- output contract in instructions/skills — prose lives in `.md` files, not TS
141
- string builders. When `agent/lib/` + `tools/` dwarf instructions + skills,
142
- you are usually looking at a service with a vestigial model turn, or at
143
- framework gaps patched agent-side that should be fixed upstream. The
144
- budget table and smells: `create-agent/SKILL.md` § "The deterministic-path
145
- budget".
146
-
147
- ## The loop
148
-
149
- Edit inspect → run → assert. Canonical commands and flags live in
150
- `AGENTS.md` (`validate` / `info` / `call` / `run` / `eval` / `serve`).
151
- Serve only your agent's directory during bring-up — mounting a parent
152
- folder mounts every sibling agent too.
153
-
154
- ## Where to go next
155
-
156
- - Scaffolding → `packages/agent-serve/skills/create-agent/SKILL.md`
157
- - Evals → `packages/agent-serve/skills/evals/SKILL.md`
158
- - Live A/B metrics → `packages/agent-serve/skills/ab/SKILL.md`
159
- - OpenTelemetry → `packages/agent-serve/skills/otel/SKILL.md`
160
- - GitHub webhooks → `packages/agent-serve/skills/github/SKILL.md`
161
- - Slack → `packages/agent-serve/skills/setup-slack/SKILL.md`
162
- - Host MCP OAuth → `packages/agent-serve/skills/mcp-auth/SKILL.md`
163
- - Local triage → `packages/agent-serve/skills/debug/SKILL.md`
164
- - Measured improvement → `packages/agent-serve/skills/hillclimb/SKILL.md`
165
- - Dogfood / deploy → `packages/agent-serve/skills/operate/SKILL.md`
86
+ Code: side-effect gates, write dedupe, auth, evidence seeding, hard
87
+ API caps. Model: formatting, summarizing, classification, replies.
88
+ Budget: `skills/create-agent/SKILL.md`.
89
+
90
+ Loop: `validate` / `info` / `call` / `run` / `eval` / `serve`. Serve
91
+ only this agent's directory.
92
+
93
+ | Task | Skill |
94
+ | --- | --- |
95
+ | Scaffold | `skills/create-agent/SKILL.md` |
96
+ | Evals | `skills/evals/SKILL.md` |
97
+ | Live A/B | `skills/ab/SKILL.md` |
98
+ | OpenTelemetry | `skills/otel/SKILL.md` |
99
+ | GitHub | `skills/github/SKILL.md` |
100
+ | Slack | `skills/setup-slack/SKILL.md` |
101
+ | Host MCP OAuth | `skills/mcp-auth/SKILL.md` |
102
+ | Local triage | `skills/debug/SKILL.md` |
103
+ | Measured improvement | `skills/hillclimb/SKILL.md` |