@cursor/july 0.1.96 → 0.1.99

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (381) hide show
  1. package/AGENTS.md +1 -1
  2. package/README.md +3 -2
  3. package/dist/bin/agent-serve.js +13 -3
  4. package/dist/channels/github/github-channel.d.ts.map +1 -1
  5. package/dist/channels/github/github-channel.js +16 -0
  6. package/dist/channels/origin/api.d.ts +15 -4
  7. package/dist/channels/origin/api.d.ts.map +1 -1
  8. package/dist/channels/origin/api.js +19 -3
  9. package/dist/channels/origin/binding.d.ts +11 -0
  10. package/dist/channels/origin/binding.d.ts.map +1 -1
  11. package/dist/channels/origin/binding.js +41 -25
  12. package/dist/channels/origin/index.d.ts +1 -0
  13. package/dist/channels/origin/index.d.ts.map +1 -1
  14. package/dist/channels/origin/index.js +1 -0
  15. package/dist/channels/origin/origin-channel.d.ts +2 -0
  16. package/dist/channels/origin/origin-channel.d.ts.map +1 -1
  17. package/dist/channels/origin/origin-channel.js +40 -4
  18. package/dist/channels/origin/reactions.d.ts +56 -0
  19. package/dist/channels/origin/reactions.d.ts.map +1 -0
  20. package/dist/channels/origin/reactions.js +67 -0
  21. package/dist/channels/origin/types.d.ts +11 -0
  22. package/dist/channels/origin/types.d.ts.map +1 -1
  23. package/dist/channels/slack/approvals.d.ts +16 -0
  24. package/dist/channels/slack/approvals.d.ts.map +1 -1
  25. package/dist/channels/slack/approvals.js +86 -0
  26. package/dist/channels/slack/cli-project.d.ts +19 -0
  27. package/dist/channels/slack/cli-project.d.ts.map +1 -0
  28. package/dist/channels/slack/cli-project.js +234 -0
  29. package/dist/channels/slack/defaults.d.ts.map +1 -1
  30. package/dist/channels/slack/defaults.js +142 -63
  31. package/dist/channels/slack/dispatch.d.ts.map +1 -1
  32. package/dist/channels/slack/dispatch.js +1 -1
  33. package/dist/channels/slack/init.d.ts +3 -2
  34. package/dist/channels/slack/init.d.ts.map +1 -1
  35. package/dist/channels/slack/init.js +5 -5
  36. package/dist/channels/slack/interactive.d.ts +2 -1
  37. package/dist/channels/slack/interactive.d.ts.map +1 -1
  38. package/dist/channels/slack/interactive.js +15 -4
  39. package/dist/channels/slack/live-delivery.d.ts +1 -1
  40. package/dist/channels/slack/live-delivery.d.ts.map +1 -1
  41. package/dist/channels/slack/live-delivery.js +4 -2
  42. package/dist/channels/slack/manifest.d.ts +1 -1
  43. package/dist/channels/slack/manifest.js +1 -1
  44. package/dist/channels/slack/progress-delivery.d.ts +28 -0
  45. package/dist/channels/slack/progress-delivery.d.ts.map +1 -0
  46. package/dist/channels/slack/progress-delivery.js +115 -0
  47. package/dist/channels/slack/setup.d.ts +1 -1
  48. package/dist/channels/slack/setup.d.ts.map +1 -1
  49. package/dist/channels/slack/setup.js +10 -6
  50. package/dist/channels/slack/slack-channel.d.ts.map +1 -1
  51. package/dist/channels/slack/slack-channel.js +1 -0
  52. package/dist/channels/slack/tool-approval-events.d.ts.map +1 -1
  53. package/dist/channels/slack/tool-approval-events.js +91 -1
  54. package/dist/channels/slack/types.d.ts +9 -1
  55. package/dist/channels/slack/types.d.ts.map +1 -1
  56. package/dist/docs/404.html +2 -2
  57. package/dist/docs/ab.html +4 -4
  58. package/dist/docs/assets/{app.jXleCmOc.js → app.BplEAZ3S.js} +1 -1
  59. package/dist/docs/assets/chunks/@localSearchIndexroot.DpuI4i7Z.js +1 -0
  60. package/dist/docs/assets/chunks/{VPLocalSearchBox.8LhyglIT.js → VPLocalSearchBox.CHXyv4wP.js} +1 -1
  61. package/dist/docs/assets/chunks/{theme.9ged-pr2.js → theme.BTcsZmjQ.js} +2 -2
  62. package/dist/docs/assets/{deployment.md.D9msOFOW.js → deployment.md.MFPKqsqI.js} +2 -2
  63. package/dist/docs/assets/{guides_mcp-oauth.md.DPYmBCbV.js → guides_mcp-oauth.md.CN-6YmTJ.js} +4 -4
  64. package/dist/docs/assets/{guides_mcp-oauth.md.DPYmBCbV.lean.js → guides_mcp-oauth.md.CN-6YmTJ.lean.js} +1 -1
  65. package/dist/docs/assets/guides_slack.md.VDXQV3ja.js +22 -0
  66. package/dist/docs/assets/guides_slack.md.VDXQV3ja.lean.js +1 -0
  67. package/dist/docs/assets/index.md.CVeRUOeZ.js +5 -0
  68. package/dist/docs/assets/{reference_agent-config.md.Cp_x38Nl.js → reference_agent-config.md.BHeYMgme.js} +1 -1
  69. package/dist/docs/assets/{reference_cli.md.CCnG-nJx.js → reference_cli.md.DfoeyvL0.js} +9 -6
  70. package/dist/docs/assets/{reference_cli.md.CCnG-nJx.lean.js → reference_cli.md.DfoeyvL0.lean.js} +1 -1
  71. package/dist/docs/assets/{reference_connections.md.BH8Oc0D0.js → reference_connections.md.DxldvyIB.js} +4 -3
  72. package/dist/docs/assets/{reference_http-api.md.D89k1mdm.js → reference_http-api.md.BEJx9XVj.js} +2 -2
  73. package/dist/docs/assets/reference_sessions.md.NxFP_CAC.js +1 -0
  74. package/dist/docs/assets/{reference_tools.md.BHeXn2id.js → reference_tools.md.CvAHsdSp.js} +10 -2
  75. package/dist/docs/assets/{reference_tools.md.BHeXn2id.lean.js → reference_tools.md.CvAHsdSp.lean.js} +1 -1
  76. package/dist/docs/assets/templates_agents-md.md.CXSMZljE.js +2 -0
  77. package/dist/docs/assets/templates_agents-md.md.CXSMZljE.lean.js +1 -0
  78. package/dist/docs/assets/troubleshooting.md.DCiPBhYs.js +1 -0
  79. package/dist/docs/building-with-agents.html +4 -4
  80. package/dist/docs/concepts.html +4 -4
  81. package/dist/docs/deployment.html +7 -7
  82. package/dist/docs/deployment.md +5 -4
  83. package/dist/docs/design/runtime-abstraction.md +1757 -0
  84. package/dist/docs/evals.html +4 -4
  85. package/dist/docs/guides/agent-to-agent.html +4 -4
  86. package/dist/docs/guides/cloud-runtime.html +4 -4
  87. package/dist/docs/guides/convert-automation.html +4 -4
  88. package/dist/docs/guides/github.html +4 -4
  89. package/dist/docs/guides/human-in-the-loop.html +4 -4
  90. package/dist/docs/guides/mcp-oauth.html +8 -8
  91. package/dist/docs/guides/mcp-oauth.md +26 -8
  92. package/dist/docs/guides/opentelemetry.html +4 -4
  93. package/dist/docs/guides/slack.html +17 -33
  94. package/dist/docs/guides/slack.md +92 -201
  95. package/dist/docs/guides/webhooks.html +4 -4
  96. package/dist/docs/hashmap.json +1 -1
  97. package/dist/docs/hillclimbing.html +4 -4
  98. package/dist/docs/index.html +6 -6
  99. package/dist/docs/index.md +5 -3
  100. package/dist/docs/llms-full.txt +2065 -637
  101. package/dist/docs/llms.txt +3 -2
  102. package/dist/docs/quickstart.html +4 -4
  103. package/dist/docs/reference/agent-config.html +6 -6
  104. package/dist/docs/reference/agent-config.md +2 -2
  105. package/dist/docs/reference/artifacts.html +4 -4
  106. package/dist/docs/reference/channels.html +4 -4
  107. package/dist/docs/reference/cli.html +13 -10
  108. package/dist/docs/reference/cli.md +32 -16
  109. package/dist/docs/reference/connections.html +9 -8
  110. package/dist/docs/reference/connections.md +6 -3
  111. package/dist/docs/reference/hooks.html +4 -4
  112. package/dist/docs/reference/http-api.html +7 -7
  113. package/dist/docs/reference/http-api.md +3 -1
  114. package/dist/docs/reference/instructions.html +4 -4
  115. package/dist/docs/reference/playground.html +4 -4
  116. package/dist/docs/reference/project-layout.html +4 -4
  117. package/dist/docs/reference/prompt.html +4 -4
  118. package/dist/docs/reference/schedules.html +4 -4
  119. package/dist/docs/reference/sessions.html +5 -5
  120. package/dist/docs/reference/sessions.md +4 -2
  121. package/dist/docs/reference/skills.html +4 -4
  122. package/dist/docs/reference/subagents.html +4 -4
  123. package/dist/docs/reference/tools.html +15 -7
  124. package/dist/docs/reference/tools.md +34 -2
  125. package/dist/docs/scaffolding-agents.html +4 -4
  126. package/dist/docs/storage.html +4 -4
  127. package/dist/docs/templates/agentic-owners.html +4 -4
  128. package/dist/docs/templates/agents-md.html +28 -0
  129. package/dist/docs/templates/agents-md.md +105 -0
  130. package/dist/docs/templates/code-wiki.html +5 -5
  131. package/dist/docs/templates/demo.html +4 -4
  132. package/dist/docs/templates/pr-autofixer.html +4 -4
  133. package/dist/docs/templates/security-help.html +4 -4
  134. package/dist/docs/templates/security-reviewer.html +5 -5
  135. package/dist/docs/templates/triage.html +4 -4
  136. package/dist/docs/troubleshooting.html +5 -5
  137. package/dist/docs/troubleshooting.md +2 -2
  138. package/dist/evals/run-facts.d.ts.map +1 -1
  139. package/dist/evals/run-facts.js +27 -0
  140. package/dist/files-backends/cursor-hosted.d.ts +3 -2
  141. package/dist/files-backends/cursor-hosted.d.ts.map +1 -1
  142. package/dist/files-backends/cursor-hosted.js +3 -2
  143. package/dist/index.d.ts +1 -0
  144. package/dist/index.d.ts.map +1 -1
  145. package/dist/index.js +1 -0
  146. package/dist/internal/advertise-tools.d.ts.map +1 -1
  147. package/dist/internal/advertise-tools.js +15 -9
  148. package/dist/internal/approval-gate.d.ts +12 -13
  149. package/dist/internal/approval-gate.d.ts.map +1 -1
  150. package/dist/internal/approval-gate.js +16 -21
  151. package/dist/internal/as-of.d.ts +19 -0
  152. package/dist/internal/as-of.d.ts.map +1 -0
  153. package/dist/internal/as-of.js +82 -0
  154. package/dist/internal/chat-client.js +10 -0
  155. package/dist/internal/cli-deploy.d.ts +6 -0
  156. package/dist/internal/cli-deploy.d.ts.map +1 -1
  157. package/dist/internal/cli-deploy.js +149 -21
  158. package/dist/internal/cli-mcp-oauth.js +8 -18
  159. package/dist/internal/cli-slack-manual.d.ts +24 -2
  160. package/dist/internal/cli-slack-manual.d.ts.map +1 -1
  161. package/dist/internal/cli-slack-manual.js +251 -20
  162. package/dist/internal/cli-slack.d.ts +9 -2
  163. package/dist/internal/cli-slack.d.ts.map +1 -1
  164. package/dist/internal/cli-slack.js +29 -82
  165. package/dist/internal/cursor/account-mcp.d.ts +1 -0
  166. package/dist/internal/cursor/account-mcp.d.ts.map +1 -1
  167. package/dist/internal/cursor/account-mcp.js +17 -0
  168. package/dist/internal/cursor-agent-template.d.ts +1 -1
  169. package/dist/internal/cursor-agent-template.d.ts.map +1 -1
  170. package/dist/internal/cursor-agent-template.js +1 -0
  171. package/dist/internal/cursor-event-relay.d.ts.map +1 -1
  172. package/dist/internal/cursor-event-relay.js +5 -6
  173. package/dist/internal/deploy-client.d.ts +17 -0
  174. package/dist/internal/deploy-client.d.ts.map +1 -1
  175. package/dist/internal/deploy-client.js +31 -10
  176. package/dist/internal/env-file.d.ts +19 -0
  177. package/dist/internal/env-file.d.ts.map +1 -0
  178. package/dist/internal/env-file.js +90 -0
  179. package/dist/internal/framework-file-storage.d.ts +11 -17
  180. package/dist/internal/framework-file-storage.d.ts.map +1 -1
  181. package/dist/internal/framework-file-storage.js +17 -40
  182. package/dist/internal/framework-storage-selection.d.ts +13 -11
  183. package/dist/internal/framework-storage-selection.d.ts.map +1 -1
  184. package/dist/internal/framework-storage-selection.js +37 -26
  185. package/dist/internal/hosted-admission-adapter.d.ts +28 -0
  186. package/dist/internal/hosted-admission-adapter.d.ts.map +1 -0
  187. package/dist/internal/hosted-admission-adapter.js +7 -0
  188. package/dist/internal/hosted-delivery-protocol.d.ts +13 -1
  189. package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
  190. package/dist/internal/hosted-delivery-protocol.js +8 -1
  191. package/dist/internal/hosted-delivery.d.ts +21 -1
  192. package/dist/internal/hosted-delivery.d.ts.map +1 -1
  193. package/dist/internal/hosted-delivery.js +101 -34
  194. package/dist/internal/hosted-execution-diag.d.ts +59 -0
  195. package/dist/internal/hosted-execution-diag.d.ts.map +1 -0
  196. package/dist/internal/hosted-execution-diag.js +187 -0
  197. package/dist/internal/http-channel.d.ts.map +1 -1
  198. package/dist/internal/http-channel.js +85 -2
  199. package/dist/internal/init-project.d.ts.map +1 -1
  200. package/dist/internal/init-project.js +2 -0
  201. package/dist/internal/logs-client.d.ts +5 -0
  202. package/dist/internal/logs-client.d.ts.map +1 -1
  203. package/dist/internal/logs-client.js +5 -0
  204. package/dist/internal/mcp-endpoint.js +2 -3
  205. package/dist/internal/mcp-host.d.ts +10 -0
  206. package/dist/internal/mcp-host.d.ts.map +1 -1
  207. package/dist/internal/mcp-host.js +57 -8
  208. package/dist/internal/mcp-oauth-on-demand.d.ts +68 -0
  209. package/dist/internal/mcp-oauth-on-demand.d.ts.map +1 -0
  210. package/dist/internal/mcp-oauth-on-demand.js +287 -0
  211. package/dist/internal/mcp-oauth-persist.d.ts +42 -0
  212. package/dist/internal/mcp-oauth-persist.d.ts.map +1 -0
  213. package/dist/internal/mcp-oauth-persist.js +92 -0
  214. package/dist/internal/mcp-oauth.d.ts +1 -0
  215. package/dist/internal/mcp-oauth.d.ts.map +1 -1
  216. package/dist/internal/mcp-oauth.js +10 -2
  217. package/dist/internal/null-kv-storage.d.ts +48 -0
  218. package/dist/internal/null-kv-storage.d.ts.map +1 -0
  219. package/dist/internal/null-kv-storage.js +58 -0
  220. package/dist/internal/otel/collector.d.ts.map +1 -1
  221. package/dist/internal/otel/collector.js +22 -9
  222. package/dist/internal/server.d.ts +6 -0
  223. package/dist/internal/server.d.ts.map +1 -1
  224. package/dist/internal/server.js +123 -33
  225. package/dist/internal/session-engine.d.ts +88 -3
  226. package/dist/internal/session-engine.d.ts.map +1 -1
  227. package/dist/internal/session-engine.js +538 -46
  228. package/dist/internal/session-run-log.d.ts +120 -0
  229. package/dist/internal/session-run-log.d.ts.map +1 -0
  230. package/dist/internal/session-run-log.js +359 -0
  231. package/dist/internal/sessions-client.d.ts +9 -7
  232. package/dist/internal/sessions-client.d.ts.map +1 -1
  233. package/dist/internal/sessions-client.js +3 -1
  234. package/dist/internal/storage-coordinator.d.ts +13 -0
  235. package/dist/internal/storage-coordinator.d.ts.map +1 -1
  236. package/dist/internal/storage-coordinator.js +37 -6
  237. package/dist/internal/storage-roles.d.ts +5 -0
  238. package/dist/internal/storage-roles.d.ts.map +1 -1
  239. package/dist/internal/stream-progress.d.ts.map +1 -1
  240. package/dist/internal/stream-progress.js +10 -0
  241. package/dist/internal/tool-policy.d.ts +29 -9
  242. package/dist/internal/tool-policy.d.ts.map +1 -1
  243. package/dist/internal/tool-policy.js +24 -0
  244. package/dist/internal/trajectory.d.ts.map +1 -1
  245. package/dist/internal/trajectory.js +10 -0
  246. package/dist/internal/turn-outbox.d.ts +24 -0
  247. package/dist/internal/turn-outbox.d.ts.map +1 -0
  248. package/dist/internal/turn-outbox.js +80 -0
  249. package/dist/playground/assets/index-D7rGZNjy.css +1 -0
  250. package/dist/playground/assets/index-jzNbJENa.js +69 -0
  251. package/dist/playground/index.html +2 -2
  252. package/dist/storage-backends/cursor-hosted.d.ts +1 -1
  253. package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
  254. package/dist/storage-backends/cursor-hosted.js +12 -0
  255. package/dist/storage-protocol.d.ts +8 -0
  256. package/dist/storage-protocol.d.ts.map +1 -1
  257. package/dist/storage-protocol.js +8 -0
  258. package/dist/storage.d.ts +8 -0
  259. package/dist/storage.d.ts.map +1 -1
  260. package/dist/tools.d.ts +12 -2
  261. package/dist/tools.d.ts.map +1 -1
  262. package/dist/types.d.ts +88 -7
  263. package/dist/types.d.ts.map +1 -1
  264. package/docs/README.md +5 -3
  265. package/docs/deployment.md +5 -4
  266. package/docs/design/runtime-abstraction.md +1757 -0
  267. package/docs/guides/mcp-oauth.md +26 -8
  268. package/docs/guides/slack.md +93 -202
  269. package/docs/reference/agent-config.md +2 -2
  270. package/docs/reference/cli.md +32 -16
  271. package/docs/reference/connections.md +6 -3
  272. package/docs/reference/http-api.md +3 -1
  273. package/docs/reference/sessions.md +4 -2
  274. package/docs/reference/tools.md +34 -2
  275. package/docs/templates/agents-md.md +110 -0
  276. package/docs/troubleshooting.md +2 -2
  277. package/package.json +1 -1
  278. package/skills/create-agent/SKILL.md +2 -1
  279. package/skills/mcp-auth/SKILL.md +6 -3
  280. package/skills/setup-slack/SKILL.md +23 -13
  281. package/src/bin/agent-serve.ts +12 -1
  282. package/src/channels/github/github-channel.ts +17 -0
  283. package/src/channels/origin/api.ts +24 -5
  284. package/src/channels/origin/binding.ts +55 -26
  285. package/src/channels/origin/index.ts +1 -0
  286. package/src/channels/origin/origin-channel.ts +78 -10
  287. package/src/channels/origin/reactions.ts +82 -0
  288. package/src/channels/origin/types.ts +11 -0
  289. package/src/channels/slack/approvals.ts +105 -0
  290. package/src/channels/slack/cli-project.ts +267 -0
  291. package/src/channels/slack/defaults.ts +165 -74
  292. package/src/channels/slack/dispatch.ts +2 -0
  293. package/src/channels/slack/init.ts +10 -5
  294. package/src/channels/slack/interactive.ts +35 -9
  295. package/src/channels/slack/live-delivery.ts +5 -3
  296. package/src/channels/slack/manifest.ts +1 -1
  297. package/src/channels/slack/progress-delivery.ts +133 -0
  298. package/src/channels/slack/setup.ts +10 -6
  299. package/src/channels/slack/slack-channel.ts +1 -0
  300. package/src/channels/slack/tool-approval-events.ts +93 -0
  301. package/src/channels/slack/types.ts +9 -1
  302. package/src/evals/run-facts.ts +32 -0
  303. package/src/files-backends/cursor-hosted.ts +3 -2
  304. package/src/index.ts +4 -0
  305. package/src/internal/advertise-tools.ts +31 -10
  306. package/src/internal/approval-gate.ts +20 -29
  307. package/src/internal/as-of.ts +107 -0
  308. package/src/internal/chat-client.ts +19 -0
  309. package/src/internal/cli-deploy.ts +203 -13
  310. package/src/internal/cli-mcp-oauth.ts +7 -21
  311. package/src/internal/cli-slack-manual.ts +350 -18
  312. package/src/internal/cli-slack.ts +40 -84
  313. package/src/internal/cursor/account-mcp.ts +21 -0
  314. package/src/internal/cursor-agent-template.ts +1 -0
  315. package/src/internal/cursor-event-relay.ts +5 -6
  316. package/src/internal/deploy-client.ts +43 -0
  317. package/src/internal/env-file.ts +84 -0
  318. package/src/internal/framework-file-storage.ts +18 -46
  319. package/src/internal/framework-storage-selection.ts +41 -25
  320. package/src/internal/hosted-admission-adapter.ts +42 -0
  321. package/src/internal/hosted-delivery-protocol.ts +14 -2
  322. package/src/internal/hosted-delivery.ts +169 -44
  323. package/src/internal/hosted-execution-diag.ts +252 -0
  324. package/src/internal/http-channel.ts +107 -0
  325. package/src/internal/init-project.ts +2 -0
  326. package/src/internal/logs-client.ts +5 -0
  327. package/src/internal/mcp-endpoint.ts +13 -4
  328. package/src/internal/mcp-host.ts +77 -11
  329. package/src/internal/mcp-oauth-on-demand.ts +352 -0
  330. package/src/internal/mcp-oauth-persist.ts +127 -0
  331. package/src/internal/mcp-oauth.ts +17 -1
  332. package/src/internal/null-kv-storage.ts +74 -0
  333. package/src/internal/otel/collector.ts +30 -0
  334. package/src/internal/server.ts +159 -11
  335. package/src/internal/session-engine.ts +691 -57
  336. package/src/internal/session-run-log.ts +584 -0
  337. package/src/internal/sessions-client.ts +17 -8
  338. package/src/internal/storage-coordinator.ts +49 -9
  339. package/src/internal/storage-roles.ts +7 -0
  340. package/src/internal/stream-progress.ts +19 -0
  341. package/src/internal/tool-policy.ts +49 -9
  342. package/src/internal/trajectory.ts +10 -0
  343. package/src/internal/turn-outbox.ts +85 -0
  344. package/src/storage-backends/cursor-hosted.ts +13 -1
  345. package/src/storage-protocol.ts +10 -0
  346. package/src/storage.ts +12 -0
  347. package/src/tools.ts +12 -2
  348. package/src/types.ts +93 -8
  349. package/templates/agents-md/README.md +39 -0
  350. package/templates/agents-md/agent/agent.ts +8 -0
  351. package/templates/agents-md/agent/channels/github.ts +10 -0
  352. package/templates/agents-md/agent/channels/queue.ts +28 -0
  353. package/templates/agents-md/agent/channels/slack.ts +9 -0
  354. package/templates/agents-md/agent/instructions.md +39 -0
  355. package/templates/agents-md/agent/lib/collect.ts +439 -0
  356. package/templates/agents-md/agent/lib/config.ts +8 -0
  357. package/templates/agents-md/agent/lib/paths.ts +51 -0
  358. package/templates/agents-md/agent/schedules/weekly.ts +17 -0
  359. package/templates/agents-md/agent/tools/apply_agents.ts +226 -0
  360. package/templates/agents-md/evals/agents.eval.ts +135 -0
  361. package/templates/agents-md/evals/evals.config.ts +5 -0
  362. package/templates/agents-md/init.json +38 -0
  363. package/templates/agents-md/package.json +18 -0
  364. package/templates/agents-md/tsconfig.json +12 -0
  365. package/dist/docs/assets/chunks/@localSearchIndexroot.DFoGuETX.js +0 -1
  366. package/dist/docs/assets/guides_slack.md.C32HsdKk.js +0 -38
  367. package/dist/docs/assets/guides_slack.md.C32HsdKk.lean.js +0 -1
  368. package/dist/docs/assets/index.md.CI93Ltlb.js +0 -5
  369. package/dist/docs/assets/reference_sessions.md.D0mIh4KK.js +0 -1
  370. package/dist/docs/assets/troubleshooting.md.Ctv3T8C2.js +0 -1
  371. package/dist/docs/design/agsh.md +0 -406
  372. package/dist/playground/assets/index-B1DDvBeC.css +0 -1
  373. package/dist/playground/assets/index-Cx9CclK_.js +0 -88
  374. package/docs/design/agsh.md +0 -406
  375. /package/dist/docs/assets/{deployment.md.D9msOFOW.lean.js → deployment.md.MFPKqsqI.lean.js} +0 -0
  376. /package/dist/docs/assets/{index.md.CI93Ltlb.lean.js → index.md.CVeRUOeZ.lean.js} +0 -0
  377. /package/dist/docs/assets/{reference_agent-config.md.Cp_x38Nl.lean.js → reference_agent-config.md.BHeYMgme.lean.js} +0 -0
  378. /package/dist/docs/assets/{reference_connections.md.BH8Oc0D0.lean.js → reference_connections.md.DxldvyIB.lean.js} +0 -0
  379. /package/dist/docs/assets/{reference_http-api.md.D89k1mdm.lean.js → reference_http-api.md.BEJx9XVj.lean.js} +0 -0
  380. /package/dist/docs/assets/{reference_sessions.md.D0mIh4KK.lean.js → reference_sessions.md.NxFP_CAC.lean.js} +0 -0
  381. /package/dist/docs/assets/{troubleshooting.md.Ctv3T8C2.lean.js → troubleshooting.md.DCiPBhYs.lean.js} +0 -0
@@ -1,406 +0,0 @@
1
- # agsh: a shell for deployed agents
2
-
3
- ## What this is
4
-
5
- `agsh` (agent shell) is a standalone CLI that connects to one agent-sdk
6
- deployment and turns the agent's live tool surface into commands. Every tool
7
- the deployment can execute (authored server tools and tools provided by the
8
- agent's MCP connections) becomes a subcommand with a synopsis derived from its
9
- input schema, a man-page style `--help`, and a place in an interactive shell.
10
-
11
- It is a separate binary and a separate package from `agent-sdk`. The
12
- `agent-sdk` CLI stays what it is today: the developer workflow tool for
13
- authoring, validating, deploying, and debugging agent projects. `agsh` is the
14
- operator's tool for working *inside* one deployed agent. The split also keeps
15
- heavy presentation dependencies (markdown rendering, syntax highlighting, the
16
- shell interpreter) out of `@cursor/july`, which ships to every agent project.
17
-
18
- ## The experience
19
-
20
- ```
21
- $ agsh help # list of commands, man-page style
22
- $ agsh read --help # man-page style: NAME, SYNOPSIS, DESCRIPTION, OPTIONS
23
- $ agsh read /repo/README.md
24
- $ agsh datadog_list_monitors --query "service:api"
25
- $ agsh # bare: interactive shell on a TTY, script from stdin otherwise
26
- ❯ ls /repo | grep -i readme
27
- ❯ read /repo/config.json | jq .version
28
- ```
29
-
30
- Every invocation binds to the deployment's latest session by default, with
31
- `--session` and `--continuation-token` overrides, and prints the session
32
- identifier as a final stderr line.
33
-
34
- ## Configuration
35
-
36
- `agsh` is a client only; it never boots an agent. Every invocation needs a
37
- target deployment, given by flags or by environment variables. Flags always
38
- win over the environment.
39
-
40
- Global command line options, accepted on every command and on the bare shell
41
- launch:
42
-
43
- | Option | Environment default | Meaning |
44
- | --- | --- | --- |
45
- | `--target <url \| name>` | `AGENT_SHELL_TARGET` | The deployment to talk to: a URL is a local deployment (`http://127.0.0.1:39400/executor`), a name a production one (`change-monitor-executor`). |
46
- | `--team <team>` | `AGENT_SHELL_TEAM` | Team override for production resolution, when the login spans several. |
47
- | `--bearer-token <token>` | `AGENT_SHELL_BEARER_TOKEN` | Explicit bearer auth for a deployment that is not behind the Cursor login. |
48
- | `--session <id>` | | Bind to a specific session instead of the latest. |
49
- | `--continuation-token <token>` | | Bind by continuation token instead of session id. |
50
- | `--output <text\|json>` | | Result rendering: human-friendly views (default) or raw JSON. |
51
- | `-h`, `--help` | | Per-command help. |
52
-
53
- One parameter carries the whole target selection, and the value's shape
54
- encodes the mode: a URL (`http://` or `https://`) targets a local
55
- deployment, anything else names a production one. Two options with a
56
- precedence rule would invite exactly the confusion a target selector must
57
- not have; with one parameter the only rule is that the flag beats the
58
- environment. A URL is self-contained down to the agent because one local
59
- agent-sdk serve process hosts every agent of the project (change-monitor's
60
- dev stack mounts `/executor` and `/planner` from a single port); a
61
- production deployment is a single agent, so its name is the complete
62
- address (`--team` narrows resolution when the login spans several).
63
- Authentication defaults to the stored Cursor login (the same engine-access
64
- credential agent-sdk uses); `--bearer-token` is the escape hatch for direct
65
- deployments. Session flags are per invocation and have no environment
66
- default: a session is state, not configuration. Color output follows the
67
- `NO_COLOR` convention and TTY detection; there is no agsh-specific color
68
- setting. No configuration file: one environment variable pins a working
69
- target for a terminal session
70
- (`AGENT_SHELL_TARGET=change-monitor-executor`, or a URL for a local stack),
71
- which is the whole persistent-configuration need.
72
-
73
- With no target from flags or environment, every command fails with a message
74
- naming both ways to provide one.
75
-
76
- ## Architecture
77
-
78
- ### A new package
79
-
80
- A new workspace package (working name `packages/agsh`, bin `agsh`) that
81
- depends on `@cursor/july` for target resolution, stored Cursor login, and the
82
- HTTP client plumbing. It owns the presentation stack: `marked` for terminal
83
- markdown (moved out of `@cursor/july`), with syntax highlighting (`shiki`)
84
- arriving in the phase that renders code; the shell interpreter is
85
- purpose-built (see Rationale).
86
- No new abstraction seam between the two packages; `agsh` imports what it
87
- needs until a second consumer justifies extracting a thin client.
88
-
89
- ### The tool catalog
90
-
91
- At startup `agsh` fetches one live catalog of everything invocable on the
92
- deployment. This is the piece the current `/v1/info` cannot provide: `/v1/info`
93
- projects the authored manifest, and connection tools only exist at runtime,
94
- resolved per session under the connection's auth. A new endpoint provides the
95
- live view (see Backend changes).
96
-
97
- Catalog entries carry exactly one identifier each: the tool name exactly as
98
- the agent sees it. Authored server tools keep their authored name (`read`).
99
- Connection tools appear under their model-facing advertised name (the
100
- sanitized passthrough name from `advertise-tools.ts`, e.g.
101
- `datadog_list_monitors`). The CLI never invents a different naming format:
102
- a tool name copied from a session transcript is a valid `agsh` command, and
103
- vice versa. Where a tool came from — the upstream connector name when the
104
- tool declares one, the connection name otherwise — is a field on the
105
- catalog entry, not part of the identifier.
106
-
107
- ### Two command tiers
108
-
109
- Each catalog entry becomes a command, through one of two shapes:
110
-
111
- **Curated commands for builtin tools.** The well-known tool names (`ls`,
112
- `read`, `grep`, `glob`, `diff`, ...) get hand-designed, POSIX-flavored
113
- command shapes, hardcoded in `agsh` next to their titles. These tools are
114
- what an operator types all day; their shapes should feel like the unix
115
- commands they mirror, not like generated bindings. A curated shape decides
116
- which schema fields are positional operands and which are flags, and every
117
- input has exactly one spelling: an operand is only an operand, never also a
118
- flag.
119
-
120
- ```
121
- $ agsh read /repo/package.json --limit 2
122
- {
123
- "name": "change-monitor",
124
- → ses_a99d1b69c329eb75a2ec8603
125
-
126
- $ agsh grep -i -A 2 toolEffect /repo/src
127
- src/tool-policy.ts:12:export type ToolEffect = "read" | "write";
128
- ...
129
- → ses_a99d1b69c329eb75a2ec8603
130
-
131
- $ agsh ls /repo --ignore-globs '*.test.ts' --ignore-globs 'node_modules/**'
132
- ```
133
-
134
- `read` takes its path as an operand mapped to the schema's `path` field, with
135
- `--offset` and `--limit` as integer flags. `grep` follows POSIX grep:
136
- `grep [options] <pattern> [path]`, with the rg-style options (`-i`, `-A`,
137
- `-B`, `-C`, `--output-mode`, `--head-limit`) mapping onto the schema fields
138
- of the same names (kebab-cased). `ls` shows array input: an array field's flag repeats once
139
- per element. A curated shape binds to the deployment's live schema at
140
- startup; when a deployment's tool lacks the expected field, the command
141
- degrades to the generic shape below rather than guessing.
142
-
143
- A curated shape may also reformat the tool's text result toward the unix
144
- command's own output conventions: the VFS ls tool returns the model-facing
145
- tree (` - name/` rows under a header), and `agsh ls` prints it as standard
146
- ls does, one name per line with the trailing slash kept on directories. The
147
- tool's result string itself stays what the model sees; when a result does
148
- not match the expected shape it prints verbatim.
149
-
150
- **Generated commands for MCP tools.** Connection tools are dynamically
151
- discovered, so no special treatment is possible; they get a uniform
152
- schema-derived mapping:
153
-
154
- - Every schema property is accepted as one flag, spelled as the
155
- kebab-cased property name (`org_slug` → `--org-slug`) — the unix
156
- convention; kebab collisions gain a numeric suffix. Properties already
157
- shaped like flags (grep's `-i`) stay literal. No positionals, no other
158
- aliases.
159
- - Object-typed properties flatten recursively into one flag per leaf,
160
- dash-joined (`--telemetry-context` for `telemetry.context`), so every
161
- option reads as a plain value; a free-form object with no declared
162
- properties stays one JSON-valued flag. A leaf is required only when its
163
- whole ancestor chain is.
164
- - Values are coerced by schema type: booleans are valueless flags, numbers
165
- and integers are parsed, arrays accept the flag repeated once per element,
166
- enums are validated before the call.
167
-
168
- ```
169
- $ agsh datadog_list_monitors --query "service:api" --limit 10
170
- ```
171
-
172
- In both tiers `-h`/`--help` and the global target and session flags are
173
- reserved and injected, a flag that names no schema property fails before any
174
- request (listing the tool's actual properties), and the bound session prints
175
- as a final stderr line.
176
-
177
- ### Result rendering
178
-
179
- Raw JSON on a terminal is not an experience for people, so `--output=text`
180
- (the default) renders structured results through a small set of views,
181
- selected automatically by the shape of the value each call actually returned;
182
- tool metadata plays no part, since most tools advertise no output schema, and
183
- many return structured data as JSON text. A string result that parses as a
184
- JSON object or array counts as structured. An array of objects renders as a
185
- table (columns are the union of keys, missing cells stay blank, the table
186
- clamps to the terminal width); a single object renders as a property view
187
- (aligned keys, scalar lists as bullets, nested structures indented); an
188
- object that is nothing but an error wrapper renders as an `Error:` line;
189
- plain text prints verbatim. `--output=json` renders the structured value as
190
- raw JSON. The rendering never depends on the TTY: piped and interactive
191
- output carry the same content, only color follows TTY detection.
192
-
193
- ### Help rendering
194
-
195
- `--help` on a tool renders a man-page layout: NAME (the tool name, with the
196
- tool's `title` beside it when the catalog carries one; titles are curated
197
- data, never derived from the description), SYNOPSIS (operands from the
198
- curated shape; options never enumerate — they summarize as `[options...]`,
199
- man-page style, so the line stays bounded), DESCRIPTION (the tool
200
- description rendered as terminal markdown), OPERANDS (positional arguments,
201
- curated commands only), and OPTIONS. Descriptions of operands and options
202
- come from the schema's property descriptions. Effect and approval metadata
203
- render as notes when declared. Everything except the curated shape derives
204
- from `GET /v1/tools/:name`; nothing else is hand-written per tool.
205
-
206
- ```
207
- $ agsh read --help
208
- NAME
209
- read - Read a file
210
-
211
- SYNOPSIS
212
- read [options...] <path>
213
-
214
- DESCRIPTION
215
- Reads a file from the local filesystem. This tool can also read image
216
- files when called with the appropriate path. Formats supported:
217
- jpeg/jpg, png, gif, webp.
218
-
219
- OPERANDS
220
- <path>
221
- The absolute path of the file to read.
222
-
223
- OPTIONS
224
- --offset <integer>
225
- The line number to start reading from. Positive values are 1-indexed
226
- from the start of the file. Negative values count backwards from the
227
- end. Only provide if the file is too large to read at once.
228
-
229
- --limit <integer>
230
- The number of lines to read. Only provide if the file is too large
231
- to read at once.
232
-
233
- NOTES
234
- Effect: read (performs no writes).
235
- ```
236
-
237
- `agsh help` lists the available command names grouped by source, authored
238
- tools first, then one group per upstream connector (its name is the group
239
- header — one aggregating connection can host tools from several connectors,
240
- and the connector name is what an operator recognizes). Each row is the
241
- name, with the title beside it when the tool declares one; everything else
242
- lives behind the command's `--help`:
243
-
244
- The agent's description renders as a DESCRIPTION section when the deployment
245
- declares one (`/v1/info` carries both name and description).
246
-
247
- ```
248
- $ agsh help
249
- NAME
250
- change-monitor-executor
251
-
252
- DESCRIPTION
253
- Executes monitoring plans against changed code.
254
-
255
- COMMANDS
256
- diff Show workspace changes
257
- glob Find files by pattern
258
- grep Search file contents
259
- ls List a directory
260
- read Read a file
261
- report_change_issue
262
- report_change_succeeded
263
-
264
- DATADOG
265
- datadog_list_monitors List monitors
266
- ...
267
-
268
- Run any command with --help for its synopsis and options.
269
- ```
270
-
271
- ### Shell mode
272
-
273
- Invoked bare, `agsh` starts a shell. On a TTY this is a REPL; on a pipe it
274
- reads a script from stdin, so `echo 'ls /' | agsh` and here-docs work.
275
-
276
- The interpreter is purpose-built and minimal: tokenizing (quotes, escapes),
277
- pipelines, and `;` / `&&` / `||`. The command namespace is exactly the
278
- deployment's tool catalog plus a small curated set of local pipe filters
279
- (`head`, `tail`, `wc`, stdin-filtering `grep`), so a tool name can never be
280
- shadowed. There is no local filesystem, no variables, no control flow: agsh
281
- has nothing local to operate on, and every command is a single traced
282
- `POST /v1/tools/:name` call.
283
-
284
- The shell binds one session identity at launch (latest by default) and keeps
285
- it for the whole run, so a sequence of tool calls observes one consistent
286
- session context.
287
-
288
- ## Backend changes on the agent-sdk runtime
289
-
290
- Two read endpoints, mirroring the invocation path:
291
-
292
- **`GET /v1/tools`: the live tool listing.** Returns the session's tool
293
- namespace exactly as a turn would assemble it: authored server tools plus the
294
- advertised passthrough tools synthesized from connections, under their
295
- model-facing names. Entries are light (name, source, and `title` when one is
296
- known); everything else lives behind the detail endpoint. Titles have two
297
- sources and no new authoring surface: connection tools inherit the upstream
298
- server's MCP title, which the host already propagates length-capped off
299
- listings; tools that do not come from MCP get theirs from a hardcoded
300
- name-to-title table in the runtime's endpoint implementation, covering the
301
- well-known tool names. A tool in neither place has no title. Accepts the same
302
- optional session binding as invocation (`session` or `continuationToken`)
303
- because advertised inventories can be tenant-scoped and resolved per session.
304
- Implementation reuses the existing plumbing: the discovered manifest for
305
- authored tools and the advertise-tools synthesis (`McpHost.listTools`, or the
306
- `oneOff` path when per-session auth substitution applies) for connection
307
- tools. This is not a duplicate of `/v1/info`: the info document stays the
308
- static authored manifest; the listing is the runtime view that only the
309
- running deployment can answer.
310
-
311
- **`GET /v1/tools/:name`: one tool's full description.** Description, input
312
- schema, output schema when declared, effect when declared, approval
313
- requirement, and source connection. Same path as invocation
314
- (`POST /v1/tools/:name`), different method: GET describes what POST executes,
315
- for the same identifier.
316
-
317
- Invocation needs no new naming scheme. Advertised connection tools are
318
- synthesized as ordinary server tools in the session's namespace, so
319
- `POST /v1/tools/:name` addresses them by their model-facing name like any
320
- authored tool, with the same session binding, policy checks, and per-call
321
- tracing. (The direct-call path did need the synthesis step added: it now
322
- resolves the advertised listing for the call's session identity when the
323
- authored lookup misses.)
324
-
325
- Phase 1 ships the minimal runtime surface agsh calls: the `effect`
326
- projection in `/v1/info` (rendered in per-tool help), the scratch-workspace
327
- fallback on direct calls, and `continuationToken` binding on
328
- `POST /v1/tools/:toolName`. The detail endpoint in phase 2 also closes the
329
- output-schema gap; `/v1/info` stays as it is.
330
-
331
- ## Local development loop
332
-
333
- `factory/change-monitor` is the test bed. Its `pnpm start` already serves the
334
- planner and executor locally through the agent-sdk dev runtime
335
- (`agent-sdk serve --dir . --dev`). The loop:
336
-
337
- 1. `cd factory/change-monitor && pnpm start` (local stack, both agents).
338
- 2. `agsh --target http://127.0.0.1:<port>/<agent>` against it, via a dev shim
339
- analogous to `agent-sdk-dev` so the CLI runs from the worktree.
340
- 3. Iterate end to end: VFS verbs (`ls`, `read`, `grep`, `glob`, `diff`) for the
341
- authored-tool path, and the planner's tenant connectors for the
342
- connection-tool path once `GET /v1/tools` exists.
343
-
344
- ## Removing the inspector surface from agent-sdk
345
-
346
- The inspector CLI is still on development branches, so nothing migrates: the
347
- CLI-side code is removed from `agent-sdk` and `agsh` is built in its place.
348
-
349
- - The verb commands (`ls`, `read`, `grep`, `glob`, `diff`) become the
350
- curated tier: their hand-designed shapes, schema-binding logic (including
351
- the candidate-field fallback), and session binding carry over. The
352
- schema-to-argv flag mapping seeds the generated tier for MCP tools.
353
- - The `tools` and `skills` commands disappear entirely. `agsh help` and
354
- per-tool `--help` are the discovery surface.
355
- - `marked` and `shiki` leave `@cursor/july`; agsh's help rendering takes
356
- `marked`, and `shiki` returns when agsh ships syntax highlighting.
357
- `agent-sdk` keeps its developer workflow commands unchanged.
358
-
359
- ## Plan
360
-
361
- 1. **Package and core invocation.** Create the package, port target
362
- resolution, the schema-to-argv mapping, and help rendering from the
363
- inspector code. Authored tools only, against the existing endpoints.
364
- Verified end to end on the local change-monitor stack.
365
- 2. **Live catalog.** Add `GET /v1/tools` and `GET /v1/tools/:name` to
366
- the agent-sdk runtime, with the hardcoded title table for non-MCP tools, and verify
367
- direct invocation resolves advertised connection tools by their
368
- model-facing names. Connection tools appear as commands. Verified against
369
- the planner's connectors.
370
- 3. **Shell mode.** The purpose-built mini-shell: REPL on TTY, script on
371
- stdin, tools as the command namespace, one session per shell run.
372
- 4. **Cleanup.** Remove the inspector CLI surface and presentation
373
- dependencies from `@cursor/july`.
374
-
375
- ## Rationale and rejected alternatives
376
-
377
- **Why not extend `agent-sdk`.** The audiences differ: `agent-sdk` is for the
378
- person building and deploying an agent; this tool is for the person operating
379
- inside one. Bundling also forces every agent project to carry markdown
380
- rendering, syntax highlighting, and a bash interpreter it never uses.
381
-
382
- **Name.** `agsh` reads as "agent shell", is four characters, collides with
383
- nothing common, and works as a shell prompt name. Considered: `august`
384
- (pairs with `july` but says nothing about purpose), `toolsh` (awkward to
385
- pronounce), `cursor-shell` (too broad; this is scoped to one agent).
386
-
387
- **Why a REST catalog instead of the MCP endpoint.** The deployment already
388
- speaks MCP at `/v1/mcp/tools`, including a per-connection bridge, but the
389
- bridge is bound to an active turn and speaks JSON-RPC. The CLI wants a plain
390
- authenticated GET with session binding that returns the assembled tool
391
- namespace under the names the model sees. Wrapping that in MCP framing buys
392
- nothing for a first-party client.
393
-
394
- **Why a purpose-built interpreter instead of just-bash.** just-bash was the
395
- original plan (a full bash emulation with a custom-command extension point),
396
- and a prototype disproved it: custom commands replace its coreutils but can
397
- never shadow its shell builtins, and `read`, `test`, `type`, and `help` are
398
- builtins — so the flagship `read` tool is unreachable, and the precedence is
399
- not ours to control (vercel-labs owns the package). No other embeddable JS
400
- shell interpreter has a workable custom-command story (mvdan-sh's JS build
401
- does not expose one; bash-parser is a parser only). agsh also needs almost
402
- none of bash: no local filesystem, no variables, no control flow — just
403
- tokenizing, pipelines, and a command namespace it fully owns. A TypeScript
404
- REPL with tools as async functions (the shape of change-monitor's `script`
405
- tool) was considered and kept as a possible later addition; it trades away
406
- the unix muscle memory the curated commands exist for.