@cursor/july 0.1.107 → 0.1.109

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 (523) hide show
  1. package/AGENTS.md +2 -6
  2. package/README.md +13 -11
  3. package/dist/bin/agent-serve.js +30 -8
  4. package/dist/channels/bitbucket/api.d.ts +41 -0
  5. package/dist/channels/bitbucket/api.d.ts.map +1 -1
  6. package/dist/channels/bitbucket/api.js +260 -0
  7. package/dist/channels/bitbucket/binding.d.ts +4 -0
  8. package/dist/channels/bitbucket/binding.d.ts.map +1 -1
  9. package/dist/channels/bitbucket/binding.js +16 -0
  10. package/dist/channels/bitbucket/index.d.ts +1 -1
  11. package/dist/channels/bitbucket/index.d.ts.map +1 -1
  12. package/dist/channels/bitbucket/index.js +1 -1
  13. package/dist/channels/github/github-channel.js +8 -5
  14. package/dist/channels/github/types.d.ts +5 -1
  15. package/dist/channels/github/types.d.ts.map +1 -1
  16. package/dist/channels/gitlab/api.d.ts +27 -0
  17. package/dist/channels/gitlab/api.d.ts.map +1 -1
  18. package/dist/channels/gitlab/api.js +88 -0
  19. package/dist/channels/gitlab/binding.d.ts +5 -0
  20. package/dist/channels/gitlab/binding.d.ts.map +1 -1
  21. package/dist/channels/gitlab/binding.js +10 -0
  22. package/dist/channels/gitlab/index.d.ts +1 -1
  23. package/dist/channels/gitlab/index.d.ts.map +1 -1
  24. package/dist/channels/gitlab/index.js +1 -1
  25. package/dist/channels/origin/origin-channel.d.ts.map +1 -1
  26. package/dist/channels/origin/origin-channel.js +27 -13
  27. package/dist/channels/origin/types.d.ts +5 -1
  28. package/dist/channels/origin/types.d.ts.map +1 -1
  29. package/dist/channels/slack/dispatch.d.ts +10 -0
  30. package/dist/channels/slack/dispatch.d.ts.map +1 -1
  31. package/dist/channels/slack/dispatch.js +20 -3
  32. package/dist/channels/slack/slack-channel.d.ts +12 -5
  33. package/dist/channels/slack/slack-channel.d.ts.map +1 -1
  34. package/dist/channels/slack/slack-channel.js +59 -8
  35. package/dist/channels.d.ts +45 -0
  36. package/dist/channels.d.ts.map +1 -1
  37. package/dist/channels.js +106 -7
  38. package/dist/connections.d.ts +2 -1
  39. package/dist/connections.d.ts.map +1 -1
  40. package/dist/connections.js +2 -1
  41. package/dist/docs/404.html +2 -2
  42. package/dist/docs/assets/{app.CtuckIiL.js → app.Cr-wVbnB.js} +1 -1
  43. package/dist/docs/assets/{building-with-agents.md.CUSWxlP_.js → building-with-agents.md.D0KbSkJn.js} +2 -2
  44. package/dist/docs/assets/{building-with-agents.md.CUSWxlP_.lean.js → building-with-agents.md.D0KbSkJn.lean.js} +1 -1
  45. package/dist/docs/assets/chunks/@localSearchIndexroot.CFVQ4S17.js +1 -0
  46. package/dist/docs/assets/chunks/{VPLocalSearchBox.Bkkhnu8K.js → VPLocalSearchBox.CVQERt56.js} +1 -1
  47. package/dist/docs/assets/chunks/{theme.DhpIe0Pa.js → theme.Dnsd3XOn.js} +2 -2
  48. package/dist/docs/assets/concepts.md.B4o63Gul.js +1 -0
  49. package/dist/docs/assets/{deployment.md.MFPKqsqI.js → deployment.md.JenwuCCB.js} +4 -4
  50. package/dist/docs/assets/{deployment.md.MFPKqsqI.lean.js → deployment.md.JenwuCCB.lean.js} +1 -1
  51. package/dist/docs/assets/evals.md.C7JLjoEP.js +211 -0
  52. package/dist/docs/assets/evals.md.C7JLjoEP.lean.js +1 -0
  53. package/dist/docs/assets/guides_bitbucket.md.DZPzmUjU.js +10 -0
  54. package/dist/docs/assets/guides_bitbucket.md.DZPzmUjU.lean.js +1 -0
  55. package/dist/docs/assets/guides_cloud-agents.md.BsloyHdY.js +9 -0
  56. package/dist/docs/assets/{guides_cloud-agents.md.DS8RIjwx.lean.js → guides_cloud-agents.md.BsloyHdY.lean.js} +1 -1
  57. package/dist/docs/assets/{guides_github.md.c0gdGJ-D.js → guides_github.md.TZaTZlfz.js} +13 -3
  58. package/dist/docs/assets/{guides_github.md.c0gdGJ-D.lean.js → guides_github.md.TZaTZlfz.lean.js} +1 -1
  59. package/dist/docs/assets/guides_gitlab.md.BmqwQfdG.js +14 -0
  60. package/dist/docs/assets/guides_gitlab.md.BmqwQfdG.lean.js +1 -0
  61. package/dist/docs/assets/{guides_grokbot-agents.md.DVqdhBKb.js → guides_grokbot-agents.md.DyV-WArv.js} +1 -1
  62. package/dist/docs/assets/guides_improve.md.BGVk32bK.js +14 -0
  63. package/dist/docs/assets/guides_improve.md.BGVk32bK.lean.js +1 -0
  64. package/dist/docs/assets/{guides_slack.md.9oHPye9o.js → guides_slack.md.D4RVMM4G.js} +3 -3
  65. package/dist/docs/assets/{guides_slack.md.9oHPye9o.lean.js → guides_slack.md.D4RVMM4G.lean.js} +1 -1
  66. package/dist/docs/assets/{guides_webhooks.md.DKdA43Qm.js → guides_webhooks.md.CJK484ex.js} +2 -2
  67. package/dist/docs/assets/{hillclimbing.md.CpTGTCle.js → hillclimbing.md.BOiVo1tf.js} +1 -1
  68. package/dist/docs/assets/index.md.DD9Q2XuJ.js +5 -0
  69. package/dist/docs/assets/{index.md.BW_6tOgR.lean.js → index.md.DD9Q2XuJ.lean.js} +1 -1
  70. package/dist/docs/assets/{reference_agent-config.md.CHNpiyp4.js → reference_agent-config.md.CvoL6pof.js} +1 -1
  71. package/dist/docs/assets/{reference_channels.md.D-qTqwcq.js → reference_channels.md.CAo-iK4j.js} +2 -2
  72. package/dist/docs/assets/{reference_channels.md.D-qTqwcq.lean.js → reference_channels.md.CAo-iK4j.lean.js} +1 -1
  73. package/dist/docs/assets/{reference_cli.md.Dm67hd2D.js → reference_cli.md.Deg7849l.js} +7 -7
  74. package/dist/docs/assets/{reference_cli.md.Dm67hd2D.lean.js → reference_cli.md.Deg7849l.lean.js} +1 -1
  75. package/dist/docs/assets/{reference_connections.md.Di6jJAXF.js → reference_connections.md.BojkC6c5.js} +1 -1
  76. package/dist/docs/assets/{reference_extensions.md.CGmMLblt.js → reference_extensions.md.ZAVUyuEX.js} +3 -3
  77. package/dist/docs/assets/{reference_hooks.md.Ddt5DdgJ.js → reference_hooks.md.BlM_bOg6.js} +3 -3
  78. package/dist/docs/assets/{reference_hooks.md.Ddt5DdgJ.lean.js → reference_hooks.md.BlM_bOg6.lean.js} +1 -1
  79. package/dist/docs/assets/{reference_http-api.md.oySXBO8o.js → reference_http-api.md.BwaCo-VO.js} +1 -1
  80. package/dist/docs/assets/{reference_playground.md.4myJPxrf.js → reference_playground.md.DLnoaczX.js} +1 -1
  81. package/dist/docs/assets/{reference_playground.md.4myJPxrf.lean.js → reference_playground.md.DLnoaczX.lean.js} +1 -1
  82. package/dist/docs/assets/{reference_project-layout.md.DuBu9a96.js → reference_project-layout.md.BEU8MtQV.js} +3 -3
  83. package/dist/docs/assets/{reference_project-layout.md.DuBu9a96.lean.js → reference_project-layout.md.BEU8MtQV.lean.js} +1 -1
  84. package/dist/docs/assets/reference_sessions.md.CyXV1MUw.js +1 -0
  85. package/dist/docs/assets/{scaffolding-agents.md.em43xlY1.js → scaffolding-agents.md.Kctn3OVb.js} +1 -1
  86. package/dist/docs/assets/{skills_create-agent.md.BVoWPcan.js → skills_create-agent.md.Q3h6Je-e.js} +1 -1
  87. package/dist/docs/assets/{skills_debug.md.CDbPhHfg.js → skills_debug.md.CVjCXMFF.js} +1 -1
  88. package/dist/docs/assets/{skills_debug.md.CDbPhHfg.lean.js → skills_debug.md.CVjCXMFF.lean.js} +1 -1
  89. package/dist/docs/assets/skills_deploy.md.CWqi_ZxW.js +35 -0
  90. package/dist/docs/assets/skills_deploy.md.CWqi_ZxW.lean.js +1 -0
  91. package/dist/docs/assets/skills_evals.md.DFxYPErF.js +25 -0
  92. package/dist/docs/assets/skills_evals.md.DFxYPErF.lean.js +1 -0
  93. package/dist/docs/assets/skills_framework-map.md.BxLSOhSY.js +1 -0
  94. package/dist/docs/assets/{skills_framework-map.md.haibFyoB.lean.js → skills_framework-map.md.BxLSOhSY.lean.js} +1 -1
  95. package/dist/docs/assets/{skills_github.md.D0JahM8c.js → skills_github.md.hgFX_oKY.js} +1 -1
  96. package/dist/docs/assets/skills_index.md.DL7EHaQ-.js +1 -0
  97. package/dist/docs/assets/skills_index.md.DL7EHaQ-.lean.js +1 -0
  98. package/dist/docs/assets/{storage.md.BOHeqk2M.js → storage.md.BUrhJ-Zz.js} +4 -4
  99. package/dist/docs/assets/{storage.md.BOHeqk2M.lean.js → storage.md.BUrhJ-Zz.lean.js} +1 -1
  100. package/dist/docs/assets/troubleshooting.md.CYEAO9bM.js +1 -0
  101. package/dist/docs/building-with-agents.html +5 -5
  102. package/dist/docs/building-with-agents.md +3 -2
  103. package/dist/docs/concepts.html +5 -5
  104. package/dist/docs/concepts.md +2 -4
  105. package/dist/docs/deployment.html +7 -7
  106. package/dist/docs/deployment.md +7 -2
  107. package/dist/docs/evals.html +161 -35
  108. package/dist/docs/evals.md +612 -296
  109. package/dist/docs/guides/agent-to-agent.html +4 -4
  110. package/dist/docs/guides/bitbucket.html +36 -0
  111. package/dist/docs/guides/bitbucket.md +84 -0
  112. package/dist/docs/guides/cloud-agents.html +6 -6
  113. package/dist/docs/guides/cloud-agents.md +4 -3
  114. package/dist/docs/guides/convert-automation.html +4 -4
  115. package/dist/docs/guides/github.html +17 -7
  116. package/dist/docs/guides/github.md +33 -1
  117. package/dist/docs/guides/gitlab.html +40 -0
  118. package/dist/docs/guides/gitlab.md +92 -0
  119. package/dist/docs/guides/grokbot-agents.html +6 -6
  120. package/dist/docs/guides/grokbot-agents.md +2 -2
  121. package/dist/docs/guides/human-in-the-loop.html +4 -4
  122. package/dist/docs/guides/improve.html +40 -0
  123. package/dist/docs/guides/improve.md +91 -0
  124. package/dist/docs/guides/mcp-oauth.html +4 -4
  125. package/dist/docs/guides/opentelemetry.html +5 -5
  126. package/dist/docs/guides/slack.html +7 -7
  127. package/dist/docs/guides/slack.md +2 -1
  128. package/dist/docs/guides/webhooks.html +6 -6
  129. package/dist/docs/guides/webhooks.md +4 -2
  130. package/dist/docs/hashmap.json +1 -1
  131. package/dist/docs/hillclimbing.html +6 -6
  132. package/dist/docs/hillclimbing.md +2 -2
  133. package/dist/docs/index.html +6 -6
  134. package/dist/docs/index.md +14 -6
  135. package/dist/docs/llms-full.txt +1274 -814
  136. package/dist/docs/llms.txt +7 -5
  137. package/dist/docs/quickstart.html +4 -4
  138. package/dist/docs/reference/agent-config.html +6 -6
  139. package/dist/docs/reference/agent-config.md +5 -2
  140. package/dist/docs/reference/artifacts.html +4 -4
  141. package/dist/docs/reference/channels.html +6 -6
  142. package/dist/docs/reference/channels.md +16 -3
  143. package/dist/docs/reference/cli.html +11 -11
  144. package/dist/docs/reference/cli.md +24 -15
  145. package/dist/docs/reference/connections.html +6 -6
  146. package/dist/docs/reference/connections.md +2 -1
  147. package/dist/docs/reference/extensions.html +8 -8
  148. package/dist/docs/reference/extensions.md +2 -3
  149. package/dist/docs/reference/hooks.html +7 -7
  150. package/dist/docs/reference/hooks.md +9 -12
  151. package/dist/docs/reference/http-api.html +6 -6
  152. package/dist/docs/reference/http-api.md +2 -3
  153. package/dist/docs/reference/instructions.html +4 -4
  154. package/dist/docs/reference/playground.html +5 -5
  155. package/dist/docs/reference/playground.md +0 -4
  156. package/dist/docs/reference/project-layout.html +7 -7
  157. package/dist/docs/reference/project-layout.md +1 -8
  158. package/dist/docs/reference/prompt.html +4 -4
  159. package/dist/docs/reference/result.html +4 -4
  160. package/dist/docs/reference/schedules.html +4 -4
  161. package/dist/docs/reference/sessions.html +5 -5
  162. package/dist/docs/reference/sessions.md +1 -2
  163. package/dist/docs/reference/skills.html +4 -4
  164. package/dist/docs/reference/subagents.html +4 -4
  165. package/dist/docs/reference/tools.html +4 -4
  166. package/dist/docs/scaffolding-agents.html +5 -5
  167. package/dist/docs/scaffolding-agents.md +2 -1
  168. package/dist/docs/skills/create-agent.html +6 -6
  169. package/dist/docs/skills/create-agent.md +1 -1
  170. package/dist/docs/skills/debug.html +5 -5
  171. package/dist/docs/skills/debug.md +1 -1
  172. package/dist/docs/skills/deploy.html +61 -0
  173. package/dist/docs/skills/deploy.md +161 -0
  174. package/dist/docs/skills/evals.html +8 -8
  175. package/dist/docs/skills/evals.md +44 -6
  176. package/dist/docs/skills/framework-map.html +5 -5
  177. package/dist/docs/skills/framework-map.md +5 -4
  178. package/dist/docs/skills/github.html +6 -6
  179. package/dist/docs/skills/github.md +1 -1
  180. package/dist/docs/skills/hillclimb.html +4 -4
  181. package/dist/docs/skills/index.html +6 -6
  182. package/dist/docs/skills/index.md +1 -1
  183. package/dist/docs/skills/mcp-auth.html +4 -4
  184. package/dist/docs/skills/otel.html +4 -4
  185. package/dist/docs/skills/setup-slack.html +4 -4
  186. package/dist/docs/storage.html +8 -8
  187. package/dist/docs/storage.md +15 -24
  188. package/dist/docs/templates/agentic-owners.html +4 -4
  189. package/dist/docs/templates/agents-md.html +4 -4
  190. package/dist/docs/templates/code-wiki.html +4 -4
  191. package/dist/docs/templates/demo.html +4 -4
  192. package/dist/docs/templates/grokbot-agents.html +4 -4
  193. package/dist/docs/templates/pr-autofixer.html +4 -4
  194. package/dist/docs/templates/security-help.html +4 -4
  195. package/dist/docs/templates/security-reviewer.html +4 -4
  196. package/dist/docs/templates/triage.html +4 -4
  197. package/dist/docs/troubleshooting.html +5 -5
  198. package/dist/docs/troubleshooting.md +1 -1
  199. package/dist/extensions/improve/extension.d.ts +46 -0
  200. package/dist/extensions/improve/extension.d.ts.map +1 -0
  201. package/dist/extensions/improve/extension.js +41 -0
  202. package/dist/extensions/improve/skills/yourself.d.ts +4 -0
  203. package/dist/extensions/improve/skills/yourself.d.ts.map +1 -0
  204. package/dist/extensions/improve/skills/yourself.js +43 -0
  205. package/dist/extensions.d.ts +2 -3
  206. package/dist/extensions.d.ts.map +1 -1
  207. package/dist/extensions.js +2 -5
  208. package/dist/index.d.ts +2 -3
  209. package/dist/index.d.ts.map +1 -1
  210. package/dist/index.js +1 -2
  211. package/dist/internal/authored-alias-hooks.d.ts +5 -0
  212. package/dist/internal/authored-alias-hooks.d.ts.map +1 -1
  213. package/dist/internal/authored-alias-hooks.js +17 -0
  214. package/dist/internal/authored-loaders.d.ts +4 -0
  215. package/dist/internal/authored-loaders.d.ts.map +1 -1
  216. package/dist/internal/authored-loaders.js +21 -2
  217. package/dist/internal/builtin-tools/artifacts.d.ts.map +1 -1
  218. package/dist/internal/builtin-tools/artifacts.js +2 -3
  219. package/dist/internal/channel-route-dispatch.d.ts +13 -0
  220. package/dist/internal/channel-route-dispatch.d.ts.map +1 -0
  221. package/dist/internal/channel-route-dispatch.js +62 -0
  222. package/dist/internal/channel-state.d.ts +17 -0
  223. package/dist/internal/channel-state.d.ts.map +1 -0
  224. package/dist/internal/channel-state.js +78 -0
  225. package/dist/internal/cli-ax.d.ts +8 -2
  226. package/dist/internal/cli-ax.d.ts.map +1 -1
  227. package/dist/internal/cli-ax.js +100 -3
  228. package/dist/internal/cli-cursor.d.ts.map +1 -1
  229. package/dist/internal/cli-cursor.js +2 -0
  230. package/dist/internal/cli-deploy.d.ts.map +1 -1
  231. package/dist/internal/cli-deploy.js +38 -14
  232. package/dist/internal/cli-mcp-oauth.d.ts.map +1 -1
  233. package/dist/internal/cli-mcp-oauth.js +15 -0
  234. package/dist/internal/cli-mcp.d.ts.map +1 -1
  235. package/dist/internal/cli-mcp.js +12 -0
  236. package/dist/internal/cli-slack.d.ts.map +1 -1
  237. package/dist/internal/cli-slack.js +8 -2
  238. package/dist/internal/continuation-channel.d.ts.map +1 -1
  239. package/dist/internal/continuation-channel.js +2 -2
  240. package/dist/internal/continuation-identity.js +8 -3
  241. package/dist/internal/cursor/credentials.d.ts +8 -2
  242. package/dist/internal/cursor/credentials.d.ts.map +1 -1
  243. package/dist/internal/cursor/credentials.js +27 -5
  244. package/dist/internal/deploy-client.d.ts +27 -0
  245. package/dist/internal/deploy-client.d.ts.map +1 -1
  246. package/dist/internal/deploy-client.js +32 -0
  247. package/dist/internal/deploy-manifest.d.ts +23 -0
  248. package/dist/internal/deploy-manifest.d.ts.map +1 -1
  249. package/dist/internal/deploy-manifest.js +84 -1
  250. package/dist/internal/describe-error.d.ts +1 -0
  251. package/dist/internal/describe-error.d.ts.map +1 -1
  252. package/dist/internal/describe-error.js +25 -0
  253. package/dist/internal/discovery/agent.d.ts +1 -1
  254. package/dist/internal/discovery/agent.d.ts.map +1 -1
  255. package/dist/internal/discovery/agent.js +0 -5
  256. package/dist/internal/discovery/extension-overlay.d.ts +1 -2
  257. package/dist/internal/discovery/extension-overlay.d.ts.map +1 -1
  258. package/dist/internal/discovery/extension-overlay.js +0 -14
  259. package/dist/internal/discovery/extensions.d.ts +1 -2
  260. package/dist/internal/discovery/extensions.d.ts.map +1 -1
  261. package/dist/internal/discovery/extensions.js +4 -22
  262. package/dist/internal/discovery/info.d.ts.map +1 -1
  263. package/dist/internal/discovery/info.js +42 -24
  264. package/dist/internal/discovery/modules.js +0 -1
  265. package/dist/internal/discovery/project.d.ts.map +1 -1
  266. package/dist/internal/discovery/project.js +0 -16
  267. package/dist/internal/eval-runner.js +0 -1
  268. package/dist/internal/framework-file-storage.d.ts +4 -5
  269. package/dist/internal/framework-file-storage.d.ts.map +1 -1
  270. package/dist/internal/framework-file-storage.js +4 -5
  271. package/dist/internal/framework-storage-selection.d.ts +2 -2
  272. package/dist/internal/framework-storage-selection.js +2 -2
  273. package/dist/internal/guest-network.d.ts +4 -10
  274. package/dist/internal/guest-network.d.ts.map +1 -1
  275. package/dist/internal/guest-network.js +42 -26
  276. package/dist/internal/hosted-admission-adapter.d.ts +2 -0
  277. package/dist/internal/hosted-admission-adapter.d.ts.map +1 -1
  278. package/dist/internal/hosted-catch-protocol.d.ts +51 -0
  279. package/dist/internal/hosted-catch-protocol.d.ts.map +1 -0
  280. package/dist/internal/hosted-catch-protocol.js +103 -0
  281. package/dist/internal/hosted-catch.d.ts +40 -0
  282. package/dist/internal/hosted-catch.d.ts.map +1 -0
  283. package/dist/internal/hosted-catch.js +149 -0
  284. package/dist/internal/hosted-delivery-protocol.d.ts +41 -0
  285. package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
  286. package/dist/internal/hosted-delivery-protocol.js +249 -0
  287. package/dist/internal/hosted-delivery.d.ts +10 -1
  288. package/dist/internal/hosted-delivery.d.ts.map +1 -1
  289. package/dist/internal/hosted-delivery.js +100 -22
  290. package/dist/internal/hosted-execution-diag.d.ts +4 -1
  291. package/dist/internal/hosted-execution-diag.d.ts.map +1 -1
  292. package/dist/internal/hosted-execution-diag.js +13 -4
  293. package/dist/internal/hosted-execution-flush.d.ts +3 -0
  294. package/dist/internal/hosted-execution-flush.d.ts.map +1 -1
  295. package/dist/internal/hosted-execution-flush.js +2 -4
  296. package/dist/internal/http-control-plane-session.d.ts +30 -0
  297. package/dist/internal/http-control-plane-session.d.ts.map +1 -0
  298. package/dist/internal/http-control-plane-session.js +83 -0
  299. package/dist/internal/init-scaffold.d.ts.map +1 -1
  300. package/dist/internal/init-scaffold.js +1 -2
  301. package/dist/internal/install-cursor-skills.d.ts +5 -2
  302. package/dist/internal/install-cursor-skills.d.ts.map +1 -1
  303. package/dist/internal/install-cursor-skills.js +25 -5
  304. package/dist/internal/legacy-command-guard.d.ts +22 -0
  305. package/dist/internal/legacy-command-guard.d.ts.map +1 -0
  306. package/dist/internal/legacy-command-guard.js +51 -0
  307. package/dist/internal/platform-timers.d.ts +7 -0
  308. package/dist/internal/platform-timers.d.ts.map +1 -1
  309. package/dist/internal/platform-timers.js +139 -0
  310. package/dist/internal/reminder-control-plane-protocol.d.ts +2 -0
  311. package/dist/internal/reminder-control-plane-protocol.d.ts.map +1 -1
  312. package/dist/internal/reminder-control-plane-protocol.js +9 -2
  313. package/dist/internal/reminder-runner.d.ts +8 -0
  314. package/dist/internal/reminder-runner.d.ts.map +1 -1
  315. package/dist/internal/reminder-runner.js +36 -9
  316. package/dist/internal/resolve-prod-target.d.ts +2 -0
  317. package/dist/internal/resolve-prod-target.d.ts.map +1 -1
  318. package/dist/internal/resolve-prod-target.js +13 -0
  319. package/dist/internal/run-client.d.ts +1 -1
  320. package/dist/internal/sdk-runner.d.ts.map +1 -1
  321. package/dist/internal/sdk-runner.js +5 -4
  322. package/dist/internal/server.d.ts.map +1 -1
  323. package/dist/internal/server.js +57 -70
  324. package/dist/internal/session-engine.d.ts +7 -41
  325. package/dist/internal/session-engine.d.ts.map +1 -1
  326. package/dist/internal/session-engine.js +110 -227
  327. package/dist/internal/storage-coordinator.d.ts +5 -19
  328. package/dist/internal/storage-coordinator.d.ts.map +1 -1
  329. package/dist/internal/storage-coordinator.js +3 -62
  330. package/dist/internal/storage-roles.d.ts +4 -9
  331. package/dist/internal/storage-roles.d.ts.map +1 -1
  332. package/dist/internal/storage-roles.js +2 -2
  333. package/dist/playground/assets/index-Bhxzrcf6.css +1 -0
  334. package/dist/playground/assets/index-CqLX5uF3.js +67 -0
  335. package/dist/playground/index.html +2 -2
  336. package/dist/storage-backends/cursor-hosted-v2.d.ts +4 -5
  337. package/dist/storage-backends/cursor-hosted-v2.d.ts.map +1 -1
  338. package/dist/storage-backends/cursor-hosted-v2.js +4 -5
  339. package/dist/storage-backends/cursor-hosted.d.ts +7 -2
  340. package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
  341. package/dist/storage-backends/cursor-hosted.js +29 -31
  342. package/dist/storage-backends/file-kv.d.ts +9 -12
  343. package/dist/storage-backends/file-kv.d.ts.map +1 -1
  344. package/dist/storage-backends/file-kv.js +11 -47
  345. package/dist/storage-protocol.d.ts +3 -11
  346. package/dist/storage-protocol.d.ts.map +1 -1
  347. package/dist/storage-protocol.js +3 -11
  348. package/dist/storage.d.ts +8 -36
  349. package/dist/storage.d.ts.map +1 -1
  350. package/dist/storage.js +8 -44
  351. package/dist/types.d.ts +53 -62
  352. package/dist/types.d.ts.map +1 -1
  353. package/docs/README.md +14 -6
  354. package/docs/building-with-agents.md +3 -2
  355. package/docs/concepts.md +2 -4
  356. package/docs/deployment.md +7 -2
  357. package/docs/evals.md +613 -297
  358. package/docs/guides/bitbucket.md +89 -0
  359. package/docs/guides/cloud-agents.md +4 -3
  360. package/docs/guides/github.md +33 -1
  361. package/docs/guides/gitlab.md +97 -0
  362. package/docs/guides/grokbot-agents.md +2 -2
  363. package/docs/guides/improve.md +96 -0
  364. package/docs/guides/slack.md +2 -1
  365. package/docs/guides/webhooks.md +4 -2
  366. package/docs/hillclimbing.md +2 -2
  367. package/docs/reference/agent-config.md +5 -2
  368. package/docs/reference/channels.md +16 -3
  369. package/docs/reference/cli.md +24 -15
  370. package/docs/reference/connections.md +2 -1
  371. package/docs/reference/extensions.md +2 -3
  372. package/docs/reference/hooks.md +9 -12
  373. package/docs/reference/http-api.md +2 -3
  374. package/docs/reference/playground.md +0 -4
  375. package/docs/reference/project-layout.md +1 -8
  376. package/docs/reference/sessions.md +1 -2
  377. package/docs/scaffolding-agents.md +2 -1
  378. package/docs/skills/index.md +2 -2
  379. package/docs/storage.md +15 -24
  380. package/docs/troubleshooting.md +1 -1
  381. package/package.json +8 -7
  382. package/skills/create-agent/SKILL.md +1 -1
  383. package/skills/debug/SKILL.md +1 -1
  384. package/skills/deploy/SKILL.md +169 -0
  385. package/skills/evals/SKILL.md +45 -8
  386. package/skills/framework-map/SKILL.md +5 -4
  387. package/skills/github/SKILL.md +1 -1
  388. package/src/bin/agent-serve.ts +27 -2
  389. package/src/channels/bitbucket/api.ts +341 -0
  390. package/src/channels/bitbucket/binding.ts +25 -0
  391. package/src/channels/bitbucket/index.ts +2 -0
  392. package/src/channels/github/github-channel.ts +8 -8
  393. package/src/channels/github/types.ts +5 -0
  394. package/src/channels/gitlab/api.ts +123 -0
  395. package/src/channels/gitlab/binding.ts +12 -0
  396. package/src/channels/gitlab/index.ts +1 -0
  397. package/src/channels/origin/origin-channel.ts +29 -13
  398. package/src/channels/origin/types.ts +5 -0
  399. package/src/channels/slack/dispatch.ts +30 -0
  400. package/src/channels/slack/slack-channel.ts +69 -7
  401. package/src/channels.ts +157 -10
  402. package/src/connections.ts +2 -1
  403. package/src/extensions/improve/extension.ts +70 -0
  404. package/src/extensions/improve/skills/yourself.ts +50 -0
  405. package/src/extensions.ts +2 -6
  406. package/src/index.ts +0 -3
  407. package/src/internal/authored-alias-hooks.ts +32 -0
  408. package/src/internal/authored-loaders.ts +26 -2
  409. package/src/internal/builtin-tools/artifacts.ts +2 -3
  410. package/src/internal/channel-route-dispatch.ts +66 -0
  411. package/src/internal/channel-state.ts +96 -0
  412. package/src/internal/cli-ax.ts +111 -3
  413. package/src/internal/cli-cursor.ts +4 -1
  414. package/src/internal/cli-deploy.ts +50 -10
  415. package/src/internal/cli-mcp-oauth.ts +18 -0
  416. package/src/internal/cli-mcp.ts +11 -0
  417. package/src/internal/cli-slack.ts +15 -2
  418. package/src/internal/continuation-channel.ts +2 -1
  419. package/src/internal/continuation-identity.ts +10 -2
  420. package/src/internal/cursor/credentials.ts +35 -7
  421. package/src/internal/deploy-client.ts +54 -0
  422. package/src/internal/deploy-manifest.ts +115 -1
  423. package/src/internal/describe-error.ts +28 -0
  424. package/src/internal/discovery/agent.ts +1 -7
  425. package/src/internal/discovery/extension-overlay.ts +0 -18
  426. package/src/internal/discovery/extensions.ts +2 -26
  427. package/src/internal/discovery/info.ts +3 -13
  428. package/src/internal/discovery/modules.ts +0 -1
  429. package/src/internal/discovery/project.ts +0 -16
  430. package/src/internal/eval-runner.ts +0 -1
  431. package/src/internal/framework-file-storage.ts +4 -5
  432. package/src/internal/framework-storage-selection.ts +2 -2
  433. package/src/internal/guest-network.ts +43 -29
  434. package/src/internal/hosted-admission-adapter.ts +2 -0
  435. package/src/internal/hosted-catch-protocol.ts +130 -0
  436. package/src/internal/hosted-catch.ts +192 -0
  437. package/src/internal/hosted-delivery-protocol.ts +387 -0
  438. package/src/internal/hosted-delivery.ts +155 -22
  439. package/src/internal/hosted-execution-diag.ts +21 -3
  440. package/src/internal/hosted-execution-flush.ts +6 -3
  441. package/src/internal/http-control-plane-session.ts +104 -0
  442. package/src/internal/init-scaffold.ts +1 -2
  443. package/src/internal/install-cursor-skills.ts +38 -5
  444. package/src/internal/legacy-command-guard.ts +59 -0
  445. package/src/internal/platform-timers.ts +191 -0
  446. package/src/internal/reminder-control-plane-protocol.ts +15 -2
  447. package/src/internal/reminder-runner.ts +60 -9
  448. package/src/internal/resolve-prod-target.ts +15 -0
  449. package/src/internal/run-client.ts +1 -1
  450. package/src/internal/sdk-runner.ts +3 -2
  451. package/src/internal/server.ts +89 -95
  452. package/src/internal/session-engine.ts +155 -285
  453. package/src/internal/storage-coordinator.ts +5 -76
  454. package/src/internal/storage-roles.ts +4 -9
  455. package/src/storage-backends/cursor-hosted-v2.ts +4 -7
  456. package/src/storage-backends/cursor-hosted.ts +40 -38
  457. package/src/storage-backends/file-kv.ts +10 -51
  458. package/src/storage-protocol.ts +3 -17
  459. package/src/storage.ts +10 -101
  460. package/src/types.ts +58 -62
  461. package/templates/demo/README.md +10 -6
  462. package/templates/demo/agent/channels/github.ts +2 -0
  463. package/templates/demo/agent/channels/queue.ts +6 -2
  464. package/templates/demo/agent/lib/repos.ts +5 -0
  465. package/templates/demo/init.json +25 -0
  466. package/dist/ab.d.ts +0 -209
  467. package/dist/ab.d.ts.map +0 -1
  468. package/dist/ab.js +0 -246
  469. package/dist/docs/ab.html +0 -80
  470. package/dist/docs/ab.md +0 -332
  471. package/dist/docs/assets/ab.md.mlVgqvSk.js +0 -54
  472. package/dist/docs/assets/ab.md.mlVgqvSk.lean.js +0 -1
  473. package/dist/docs/assets/chunks/@localSearchIndexroot.DXXZxiMv.js +0 -1
  474. package/dist/docs/assets/concepts.md.DgEcZOfT.js +0 -1
  475. package/dist/docs/assets/evals.md.CbMoebP1.js +0 -85
  476. package/dist/docs/assets/evals.md.CbMoebP1.lean.js +0 -1
  477. package/dist/docs/assets/guides_cloud-agents.md.DS8RIjwx.js +0 -9
  478. package/dist/docs/assets/index.md.BW_6tOgR.js +0 -5
  479. package/dist/docs/assets/reference_sessions.md.CueyOHSL.js +0 -1
  480. package/dist/docs/assets/skills_ab.md.CsFNatVx.js +0 -26
  481. package/dist/docs/assets/skills_ab.md.CsFNatVx.lean.js +0 -1
  482. package/dist/docs/assets/skills_evals.md.723kpUmA.js +0 -25
  483. package/dist/docs/assets/skills_evals.md.723kpUmA.lean.js +0 -1
  484. package/dist/docs/assets/skills_framework-map.md.haibFyoB.js +0 -1
  485. package/dist/docs/assets/skills_index.md.DKwIxzGg.js +0 -1
  486. package/dist/docs/assets/skills_index.md.DKwIxzGg.lean.js +0 -1
  487. package/dist/docs/assets/troubleshooting.md.Cus_YZga.js +0 -1
  488. package/dist/docs/skills/ab.html +0 -52
  489. package/dist/docs/skills/ab.md +0 -50
  490. package/dist/internal/ab-collector.d.ts +0 -44
  491. package/dist/internal/ab-collector.d.ts.map +0 -1
  492. package/dist/internal/ab-collector.js +0 -142
  493. package/dist/internal/ab-fold.d.ts +0 -36
  494. package/dist/internal/ab-fold.d.ts.map +0 -1
  495. package/dist/internal/ab-fold.js +0 -175
  496. package/dist/internal/ab-snapshot.d.ts +0 -68
  497. package/dist/internal/ab-snapshot.d.ts.map +0 -1
  498. package/dist/internal/ab-snapshot.js +0 -208
  499. package/dist/internal/discovery/ab.d.ts +0 -9
  500. package/dist/internal/discovery/ab.d.ts.map +0 -1
  501. package/dist/internal/discovery/ab.js +0 -113
  502. package/dist/playground/assets/index-Bq2HpEQB.js +0 -67
  503. package/dist/playground/assets/index-CZKKNlmb.css +0 -1
  504. package/docs/ab.md +0 -337
  505. package/skills/ab/SKILL.md +0 -58
  506. package/src/ab.ts +0 -430
  507. package/src/internal/ab-collector.ts +0 -200
  508. package/src/internal/ab-fold.ts +0 -232
  509. package/src/internal/ab-snapshot.ts +0 -331
  510. package/src/internal/discovery/ab.ts +0 -131
  511. /package/dist/docs/assets/{concepts.md.DgEcZOfT.lean.js → concepts.md.B4o63Gul.lean.js} +0 -0
  512. /package/dist/docs/assets/{guides_grokbot-agents.md.DVqdhBKb.lean.js → guides_grokbot-agents.md.DyV-WArv.lean.js} +0 -0
  513. /package/dist/docs/assets/{guides_webhooks.md.DKdA43Qm.lean.js → guides_webhooks.md.CJK484ex.lean.js} +0 -0
  514. /package/dist/docs/assets/{hillclimbing.md.CpTGTCle.lean.js → hillclimbing.md.BOiVo1tf.lean.js} +0 -0
  515. /package/dist/docs/assets/{reference_agent-config.md.CHNpiyp4.lean.js → reference_agent-config.md.CvoL6pof.lean.js} +0 -0
  516. /package/dist/docs/assets/{reference_connections.md.Di6jJAXF.lean.js → reference_connections.md.BojkC6c5.lean.js} +0 -0
  517. /package/dist/docs/assets/{reference_extensions.md.CGmMLblt.lean.js → reference_extensions.md.ZAVUyuEX.lean.js} +0 -0
  518. /package/dist/docs/assets/{reference_http-api.md.oySXBO8o.lean.js → reference_http-api.md.BwaCo-VO.lean.js} +0 -0
  519. /package/dist/docs/assets/{reference_sessions.md.CueyOHSL.lean.js → reference_sessions.md.CyXV1MUw.lean.js} +0 -0
  520. /package/dist/docs/assets/{scaffolding-agents.md.em43xlY1.lean.js → scaffolding-agents.md.Kctn3OVb.lean.js} +0 -0
  521. /package/dist/docs/assets/{skills_create-agent.md.BVoWPcan.lean.js → skills_create-agent.md.Q3h6Je-e.lean.js} +0 -0
  522. /package/dist/docs/assets/{skills_github.md.D0JahM8c.lean.js → skills_github.md.hgFX_oKY.lean.js} +0 -0
  523. /package/dist/docs/assets/{troubleshooting.md.Cus_YZga.lean.js → troubleshooting.md.CYEAO9bM.lean.js} +0 -0
@@ -8,8 +8,8 @@
8
8
  />
9
9
  <meta name="viewport" content="width=device-width, initial-scale=1" />
10
10
  <title>agent-serve playground</title>
11
- <script type="module" crossorigin src="./assets/index-Bq2HpEQB.js"></script>
12
- <link rel="stylesheet" crossorigin href="./assets/index-CZKKNlmb.css">
11
+ <script type="module" crossorigin src="./assets/index-CqLX5uF3.js"></script>
12
+ <link rel="stylesheet" crossorigin href="./assets/index-Bhxzrcf6.css">
13
13
  </head>
14
14
  <body>
15
15
  <div id="root"></div>
@@ -25,15 +25,15 @@
25
25
  * pagination. `list` / `listKeys` below drain every page, so the v1
26
26
  * truncated-scan failure mode does not exist here.
27
27
  *
28
- * Eval runs and A/B samples still ride the v1 storage proxy's dedicated
29
- * tables (`evals` / `abs` below); moving them to factorydb is a separate
30
- * follow-up from the KV cutover.
28
+ * Eval runs still ride the v1 storage proxy's dedicated table (`evals`
29
+ * below); moving them to factorydb is a separate follow-up from the KV
30
+ * cutover.
31
31
  *
32
32
  * This backend is platform-selected for architecture v2
33
33
  * (framework-storage-selection.ts) — authors never import it; `agent/storage.ts`
34
34
  * is rejected on v2.
35
35
  */
36
- import type { StorageABTable, StorageCasTable, StorageConfig, StorageEvalsTable } from "../storage.js";
36
+ import type { StorageCasTable, StorageConfig, StorageEvalsTable } from "../storage.js";
37
37
  import type { JsonValue } from "../types.js";
38
38
  import { CURSOR_HOSTED_STORAGE, type CursorHostedStorageOptions } from "./cursor-hosted.js";
39
39
  /** Wire shape of the v2 `get` route. `null` ⇒ JSON `undefined`. */
@@ -68,7 +68,6 @@ type CursorHostedStorageV2Methods = Required<Pick<StorageConfig, "put" | "get" |
68
68
  readonly [CURSOR_HOSTED_STORAGE]: true;
69
69
  cas: StorageCasTable;
70
70
  evals: StorageEvalsTable;
71
- abs: StorageABTable;
72
71
  };
73
72
  /**
74
73
  * Architecture-v2 `defineStorage` methods (AgentSDK v2 KV proxy → factorydb
@@ -1 +1 @@
1
- {"version":3,"file":"cursor-hosted-v2.d.ts","sourceRoot":"","sources":["../../src/storage-backends/cursor-hosted-v2.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,aAAa,EAEb,iBAAiB,EAClB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,SAAS,EAAiC,MAAM,aAAa,CAAC;AAC5E,OAAO,EACL,qBAAqB,EACrB,KAAK,0BAA0B,EAGhC,MAAM,oBAAoB,CAAC;AAI5B,mEAAmE;AACnE,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,OAAO,CAAC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
26
26
  * truncated-scan failure mode does not exist here.
27
27
  *
28
- * Eval runs and A/B samples still ride the v1 storage proxy's dedicated
29
- * tables (`evals` / `abs` below); moving them to factorydb is a separate
30
- * follow-up from the KV cutover.
28
+ * Eval runs still ride the v1 storage proxy's dedicated table (`evals`
29
+ * below); moving them to factorydb is a separate follow-up from the KV
30
+ * cutover.
31
31
  *
32
32
  * This backend is platform-selected for architecture v2
33
33
  * (framework-storage-selection.ts) — authors never import it; `agent/storage.ts`
@@ -92,7 +92,7 @@ function listAllPages(options, body) {
92
92
  * rest.
93
93
  */
94
94
  export function cursorHostedStorageV2(options = {}) {
95
- // Eval runs and A/B samples stay on the v1 proxy's dedicated tables.
95
+ // Eval runs stay on the v1 proxy's dedicated table.
96
96
  const v1 = cursorHostedStorage(options);
97
97
  return {
98
98
  [CURSOR_HOSTED_STORAGE]: true,
@@ -159,6 +159,5 @@ export function cursorHostedStorageV2(options = {}) {
159
159
  },
160
160
  },
161
161
  evals: v1.evals,
162
- abs: v1.abs,
163
162
  };
164
163
  }
@@ -21,7 +21,7 @@
21
21
  * });
22
22
  * ```
23
23
  */
24
- import type { StorageABTable, StorageCasTable, StorageConfig, StorageEvalsTable } from "../storage.js";
24
+ import type { StorageCasTable, StorageConfig, StorageEvalsTable } from "../storage.js";
25
25
  import type { JsonValue } from "../types.js";
26
26
  /**
27
27
  * Reserved so user `secrets set` cannot smuggle a Bugbot DSN into the pod.
@@ -73,7 +73,6 @@ type CursorHostedStorageMethods = Required<Pick<StorageConfig, "put" | "get" | "
73
73
  readonly [CURSOR_HOSTED_STORAGE]: true;
74
74
  cas: StorageCasTable;
75
75
  evals: StorageEvalsTable;
76
- abs: StorageABTable;
77
76
  };
78
77
  /** Wire shape of the `get-with-version` route. `null` ⇒ JSON `undefined`. */
79
78
  export interface KvGetWithVersionResponse {
@@ -101,6 +100,12 @@ export interface KvListKeysResponse {
101
100
  */
102
101
  truncated?: boolean;
103
102
  }
103
+ export declare class StorageRpcError extends Error {
104
+ readonly code = "agent_dependency_failed";
105
+ readonly reasonCode: string;
106
+ readonly status: number;
107
+ constructor(message: string, reasonCode: string, status: number);
108
+ }
104
109
  /**
105
110
  * One authenticated POST to the control-plane proxy. Shared with the
106
111
  * architecture-v2 backend (`cursor-hosted-v2.ts`), which speaks a different
@@ -1 +1 @@
1
- {"version":3,"file":"cursor-hosted.d.ts","sourceRoot":"","sources":["../../src/storage-backends/cursor-hosted.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAKH,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,aAAa,EAEb,iBAAiB,EAClB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,SAAS,EAAiC,MAAM,aAAa,CAAC;AAW5E;;;GAGG;AACH,eAAO,MAAM,+CAA+C,EAC1D,cAAuB,CAAC;AAE1B;;;GAGG;AACH,eAAO,MAAM,iCAAiC,EAC5C,2BAAoC,CAAC;AAEvC;;;GAGG;AACH,eAAO,MAAM,8BAA8B,EAAE,SAAS;IACpD,OAAO,+CAA+C;IACtD,OAAO,iCAAiC;CAIzC,CAAC;AAEF,MAAM,WAAW,0BAA0B;IACzC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;IACzC,0BAA0B;IAC1B,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;CACtB;AAED;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,EAAE,OAAO,MAE1C,CAAC;AAEF,4EAA4E;AAC5E,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAM7D;AAED,KAAK,0BAA0B,GAAG,QAAQ,CACxC,IAAI,CAAC,aAAa,EAAE,KAAK,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,YAAY,CAAC,C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;IACvB,iEAAiE;IACjE,OAAO,EAAE;QAAE,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CAC9D;AAED,2CAA2C;AAC3C,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,EAAE,CAAC;IACf;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAaD,qBAAa,eAAgB,SAAQ,KAAK;IACxC,QAAQ,CAAC,IAAI,6BAA6B;IAC1C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB,YAAY,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAK9D;CACF;AAyCD;;;;GAIG;AACH,wBAAsB,UAAU,CAAC,CAAC,EAChC,OAAO,EAAE,0BAA0B,EACnC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,CAAC,CAAC,CAoDZ;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,GAAE,0BAA+B,GACvC,0BAA0B,CAqH5B"}
@@ -70,6 +70,25 @@ export function isCursorHostedStorage(value) {
70
70
  value !== null &&
71
71
  value[CURSOR_HOSTED_STORAGE] === true);
72
72
  }
73
+ const STORAGE_RPC_ERROR_CODES = new Set([
74
+ "agentsdk_kv_credential_missing",
75
+ "agentsdk_kv_cursor_invalid",
76
+ "agentsdk_kv_deployment_unbound",
77
+ "agentsdk_kv_key_invalid",
78
+ "agentsdk_kv_request_invalid",
79
+ "agentsdk_kv_storage_not_allowed",
80
+ "agentsdk_kv_value_invalid",
81
+ "agentsdk_kv_version_invalid",
82
+ ]);
83
+ export class StorageRpcError extends Error {
84
+ constructor(message, reasonCode, status) {
85
+ super(message);
86
+ this.code = "agent_dependency_failed";
87
+ this.name = "StorageRpcError";
88
+ this.reasonCode = reasonCode;
89
+ this.status = status;
90
+ }
91
+ }
73
92
  function toCasResult(response) {
74
93
  var _a;
75
94
  if (response.ok) {
@@ -140,7 +159,16 @@ export function storageRpc(options, path, body) {
140
159
  typeof parsed.error === "string"
141
160
  ? parsed.error
142
161
  : `HTTP ${response.status}`;
143
- throw new Error(`cursorHostedStorage ${path}: ${error}`);
162
+ const candidate = parsed !== null &&
163
+ typeof parsed === "object" &&
164
+ "code" in parsed &&
165
+ typeof parsed.code === "string"
166
+ ? parsed.code
167
+ : undefined;
168
+ const code = candidate !== undefined && STORAGE_RPC_ERROR_CODES.has(candidate)
169
+ ? candidate
170
+ : "agentsdk_storage_http_error";
171
+ throw new StorageRpcError(`cursorHostedStorage ${path}: ${error}`, code, response.status);
144
172
  }
145
173
  return parsed;
146
174
  });
@@ -258,35 +286,5 @@ export function cursorHostedStorage(options = {}) {
258
286
  });
259
287
  },
260
288
  },
261
- abs: {
262
- putSample(sample, ctx) {
263
- return __awaiter(this, void 0, void 0, function* () {
264
- yield storageRpc(options, "/internal/agent-serve/storage/abs/put-sample", {
265
- agentName: ctx.agentName,
266
- sample,
267
- });
268
- });
269
- },
270
- putSnapshot(snapshot, ctx) {
271
- return __awaiter(this, void 0, void 0, function* () {
272
- yield storageRpc(options, "/internal/agent-serve/storage/abs/put-snapshot", {
273
- agentName: ctx.agentName,
274
- snapshot,
275
- });
276
- });
277
- },
278
- getSnapshot(ctx) {
279
- return __awaiter(this, void 0, void 0, function* () {
280
- var _a;
281
- const result = yield storageRpc(options, "/internal/agent-serve/storage/abs/get-snapshot", {
282
- agentName: ctx.agentName,
283
- });
284
- if (!result.found) {
285
- return undefined;
286
- }
287
- return (_a = result.snapshot) !== null && _a !== void 0 ? _a : undefined;
288
- });
289
- },
290
- },
291
289
  };
292
290
  }
@@ -1,19 +1,17 @@
1
1
  /**
2
- * File-backed `defineStorage` helper: a file-per-key KV store plus
3
- * file-backed `evals` / `abs` tables.
2
+ * File-backed `defineStorage` helper: a file-per-key KV store plus a
3
+ * file-backed `evals` table.
4
4
  *
5
5
  * Implements the whole `defineStorage` surface with zero external
6
6
  * dependencies: the four KV methods against a flat directory of JSON files
7
7
  * (one file per key, filename = URI-encoded key), the `cas`
8
8
  * group (single-process conditional writes — see the `cas` member below),
9
- * eval runs as
10
- * `eval-runs/<agent>/<runId>.json`, and A/B metrics as
11
- * `ab/<agent>/samples.ndjson` (append-only) plus `ab/<agent>/snapshot.json`
12
- * (latest aggregate). KV keys carry the agent name inside the framework
13
- * key scheme, but the evals/abs tables have no such scheme — the agent
14
- * subdirectory keeps agents sharing one storage `dir` from mixing or
15
- * overwriting each other's history. Swap this for a real backend
16
- * (Postgres, S3, …) in production; the contracts are identical.
9
+ * and eval runs as `eval-runs/<agent>/<runId>.json`. KV keys carry the
10
+ * agent name inside the framework key scheme, but the evals table has no
11
+ * such scheme — the agent subdirectory keeps agents sharing one storage
12
+ * `dir` from mixing or overwriting each other's history. Swap this for a
13
+ * real backend (Postgres, S3, …) in production; the contracts are
14
+ * identical.
17
15
  *
18
16
  * Layout notes:
19
17
  * - KV filenames encode the full key (`encodeURIComponent(key) + ".json"`),
@@ -26,7 +24,7 @@
26
24
  * real failure (anything else throws) — on the lazy-restore path a
27
25
  * throw correctly fails the follow-up instead of forking the session.
28
26
  */
29
- import type { StorageABTable, StorageCasTable, StorageConfig, StorageEvalsTable } from "../storage.js";
27
+ import type { StorageCasTable, StorageConfig, StorageEvalsTable } from "../storage.js";
30
28
  export interface FileKvOptions {
31
29
  /**
32
30
  * Directory holding the storage files, relative to the agent project root
@@ -37,7 +35,6 @@ export interface FileKvOptions {
37
35
  type FileKvMethods = Required<Pick<StorageConfig, "put" | "get" | "delete" | "list">> & {
38
36
  cas: StorageCasTable;
39
37
  evals: StorageEvalsTable;
40
- abs: StorageABTable;
41
38
  };
42
39
  /** File-backed `defineStorage` methods, ready to spread into `defineStorage({...})`. */
43
40
  export declare function fileKv(options?: FileKvOptions): FileKvMethods;
@@ -1 +1 @@
1
- {"version":3,"file":"file-kv.d.ts","sourceRoot":"","sources":["../../src/storage-backends/file-kv.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAeH,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,aAAa,EAGb,iBAAiB,EAClB,MAAM,eAAe,CAAC;AAGvB,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,KAAK,aAAa,GAAG,QAAQ,CAC3B,IAAI,CAAC,aAAa,EAAE,KAAK,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC,CACvD,GAAG;IACF,GAAG,EAAE,eAAe,CAAC;IACrB,KAAK,EAAE,iBAAiB,CAAC;IACzB,GAAG,EAAE,cAAc,CAAC;CACrB,CAAC;AAEF,wFAAwF;AACxF,wBAAgB,MAAM,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,aAAa,CA6O7D"}
1
+ {"version":3,"file":"file-kv.d.ts","sourceRoot":"","sources":["../../src/storage-backends/file-kv.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAaH,OAAO,KAAK,EACV,eAAe,EACf,aAAa,EAGb,iBAAiB,EAClB,MAAM,eAAe,CAAC;AAGvB,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,KAAK,aAAa,GAAG,QAAQ,CAC3B,IAAI,CAAC,aAAa,EAAE,KAAK,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC,CACvD,GAAG;IACF,GAAG,EAAE,eAAe,CAAC;IACrB,KAAK,EAAE,iBAAiB,CAAC;CAC1B,CAAC;AAEF,wFAAwF;AACxF,wBAAgB,MAAM,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,aAAa,CA0M7D"}
@@ -1,19 +1,17 @@
1
1
  /**
2
- * File-backed `defineStorage` helper: a file-per-key KV store plus
3
- * file-backed `evals` / `abs` tables.
2
+ * File-backed `defineStorage` helper: a file-per-key KV store plus a
3
+ * file-backed `evals` table.
4
4
  *
5
5
  * Implements the whole `defineStorage` surface with zero external
6
6
  * dependencies: the four KV methods against a flat directory of JSON files
7
7
  * (one file per key, filename = URI-encoded key), the `cas`
8
8
  * group (single-process conditional writes — see the `cas` member below),
9
- * eval runs as
10
- * `eval-runs/<agent>/<runId>.json`, and A/B metrics as
11
- * `ab/<agent>/samples.ndjson` (append-only) plus `ab/<agent>/snapshot.json`
12
- * (latest aggregate). KV keys carry the agent name inside the framework
13
- * key scheme, but the evals/abs tables have no such scheme — the agent
14
- * subdirectory keeps agents sharing one storage `dir` from mixing or
15
- * overwriting each other's history. Swap this for a real backend
16
- * (Postgres, S3, …) in production; the contracts are identical.
9
+ * and eval runs as `eval-runs/<agent>/<runId>.json`. KV keys carry the
10
+ * agent name inside the framework key scheme, but the evals table has no
11
+ * such scheme — the agent subdirectory keeps agents sharing one storage
12
+ * `dir` from mixing or overwriting each other's history. Swap this for a
13
+ * real backend (Postgres, S3, …) in production; the contracts are
14
+ * identical.
17
15
  *
18
16
  * Layout notes:
19
17
  * - KV filenames encode the full key (`encodeURIComponent(key) + ".json"`),
@@ -36,7 +34,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
36
34
  });
37
35
  };
38
36
  import { createHash, randomUUID } from "node:crypto";
39
- import { appendFile, mkdir, readdir, readFile, rename, rm, writeFile, } from "node:fs/promises";
37
+ import { mkdir, readdir, readFile, rename, rm, writeFile, } from "node:fs/promises";
40
38
  import { isAbsolute, join } from "node:path";
41
39
  /** File-backed `defineStorage` methods, ready to spread into `defineStorage({...})`. */
42
40
  export function fileKv(options) {
@@ -45,10 +43,9 @@ export function fileKv(options) {
45
43
  const dir = (_a = options === null || options === void 0 ? void 0 : options.dir) !== null && _a !== void 0 ? _a : ".agent-serve/kv";
46
44
  return isAbsolute(dir) ? dir : join(ctx.projectRoot, dir);
47
45
  };
48
- // The evals/abs tables are scoped per agent (KV keys already carry the
49
- // agent name via the framework key scheme).
46
+ // The evals table is scoped per agent (KV keys already carry the agent
47
+ // name via the framework key scheme).
50
48
  const evalRunsDir = (ctx) => join(resolveDir(ctx), "eval-runs", encodeURIComponent(ctx.agentName));
51
- const abDir = (ctx) => join(resolveDir(ctx), "ab", encodeURIComponent(ctx.agentName));
52
49
  const filePath = (ctx, key) => join(resolveDir(ctx), `${encodeURIComponent(key)}.json`);
53
50
  const readRaw = (ctx, key) => __awaiter(this, void 0, void 0, function* () {
54
51
  try {
@@ -230,39 +227,6 @@ export function fileKv(options) {
230
227
  });
231
228
  },
232
229
  },
233
- // A/B metrics: append-only sample log + latest aggregate snapshot,
234
- // both under ab/<agent>/.
235
- abs: {
236
- putSample(sample, ctx) {
237
- return __awaiter(this, void 0, void 0, function* () {
238
- const dir = abDir(ctx);
239
- yield mkdir(dir, { recursive: true });
240
- yield appendFile(join(dir, "samples.ndjson"), `${JSON.stringify(sample)}\n`, "utf8");
241
- });
242
- },
243
- putSnapshot(snapshot, ctx) {
244
- return __awaiter(this, void 0, void 0, function* () {
245
- yield writeJsonAtomic({
246
- dir: abDir(ctx),
247
- fileName: "snapshot.json",
248
- value: snapshot,
249
- });
250
- });
251
- },
252
- getSnapshot(ctx) {
253
- return __awaiter(this, void 0, void 0, function* () {
254
- try {
255
- return JSON.parse(yield readFile(join(abDir(ctx), "snapshot.json"), "utf8"));
256
- }
257
- catch (error) {
258
- if (error.code === "ENOENT") {
259
- return undefined;
260
- }
261
- throw error;
262
- }
263
- });
264
- },
265
- },
266
230
  };
267
231
  }
268
232
  /** Content-hash version token for a stored JSON text. */
@@ -26,10 +26,9 @@ export declare const AGENTSDK_STORAGE_KEY_ROOT: "agentsdk/v1";
26
26
  * | `{root}/{agent}/continuation/{channelId}/{token}` | `{ sessionId }` |
27
27
  * | `{root}/{agent}/kv/{key}` | Author JSON via `HostContext.kv` |
28
28
  *
29
- * The `eval-runs` / `ab-samples` / `ab-snapshot` families are minted only
30
- * by the tables `defineStorage` derives over the KV core; a backend that
31
- * authors dedicated `StorageConfig.evals` / `StorageConfig.abs` groups never
32
- * sees them.
29
+ * The `eval-runs` family is minted only by the table `defineStorage`
30
+ * derives over the KV core; a backend that authors a dedicated
31
+ * `StorageConfig.evals` group never sees it.
33
32
  */
34
33
  declare function createStorageKeys(root: string): {
35
34
  readonly session: (agent: string, sessionId: string) => string;
@@ -63,13 +62,6 @@ declare function createStorageKeys(root: string): {
63
62
  /** One playground eval-run snapshot (derived `evals` table). */
64
63
  readonly evalRun: (agent: string, runId: string) => string;
65
64
  readonly evalRunsPrefix: (agent: string) => string;
66
- /**
67
- * One A/B metric sample (derived `abs` table); the segments mirror the
68
- * dedicated table's row identity (experiment + sessionId + at).
69
- */
70
- readonly abSample: (agent: string, experiment: string, sessionId: string, at: string) => string;
71
- /** Latest aggregate A/B snapshot (derived `abs` table, LWW). */
72
- readonly abSnapshot: (agent: string) => string;
73
65
  };
74
66
  export type StorageKeys = ReturnType<typeof createStorageKeys>;
75
67
  /** Architecture-v1 keys. Kept stable for existing deployments. */
@@ -1 +1 @@
1
- {"version":3,"file":"storage-protocol.d.ts","sourceRoot":"","sources":["../src/storage-protocol.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,2CAA2C;AAC3C,eAAO,MAAM,gBAAgB,EAAG,aAAsB,CAAC;AAEvD;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAG,aAAsB,CAAC;AAShE;;;;;;;;;;;;;;;;;;GAkBG;AACH,iBAAS,iBAAiB,CAAC,IAAI,EAAE,MAAM;aAEnC,OAAO,UAAU,MAAM,aAAa,MAAM,KAAG,MAAM;aAEnD,aAAa,UAAU,MAAM,KAAG,MAAM;aACtC,aAAa,UACJ,MAAM,aACF,MAAM,cACL,MAAM,KACjB,MAAM;aAET,mBAAmB,UAAU,MAAM,aAAa,MAAM,KAAG,MAAM;IAE/D;;;;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AO,CAYjE,CAAC"}
@@ -33,10 +33,9 @@ const DURABLE_SESSION_RECORD_KEY_RE = /^(agentkit|agentsdk)\/v1\/([^/]+)\/sessio
33
33
  * | `{root}/{agent}/continuation/{channelId}/{token}` | `{ sessionId }` |
34
34
  * | `{root}/{agent}/kv/{key}` | Author JSON via `HostContext.kv` |
35
35
  *
36
- * The `eval-runs` / `ab-samples` / `ab-snapshot` families are minted only
37
- * by the tables `defineStorage` derives over the KV core; a backend that
38
- * authors dedicated `StorageConfig.evals` / `StorageConfig.abs` groups never
39
- * sees them.
36
+ * The `eval-runs` family is minted only by the table `defineStorage`
37
+ * derives over the KV core; a backend that authors a dedicated
38
+ * `StorageConfig.evals` group never sees it.
40
39
  */
41
40
  function createStorageKeys(root) {
42
41
  return {
@@ -71,13 +70,6 @@ function createStorageKeys(root) {
71
70
  /** One playground eval-run snapshot (derived `evals` table). */
72
71
  evalRun: (agent, runId) => `${root}/${agent}/eval-runs/${keySegment(runId)}`,
73
72
  evalRunsPrefix: (agent) => `${root}/${agent}/eval-runs/`,
74
- /**
75
- * One A/B metric sample (derived `abs` table); the segments mirror the
76
- * dedicated table's row identity (experiment + sessionId + at).
77
- */
78
- abSample: (agent, experiment, sessionId, at) => `${root}/${agent}/ab-samples/${keySegment(experiment)}/${keySegment(sessionId)}/${keySegment(at)}`,
79
- /** Latest aggregate A/B snapshot (derived `abs` table, LWW). */
80
- abSnapshot: (agent) => `${root}/${agent}/ab-snapshot`,
81
73
  };
82
74
  }
83
75
  /** Architecture-v1 keys. Kept stable for existing deployments. */
package/dist/storage.d.ts CHANGED
@@ -4,16 +4,15 @@
4
4
  * Author `agent/storage.ts` with {@link defineStorage} to mirror the
5
5
  * framework's durable state into storage you own (a database, S3, a data
6
6
  * pipeline, …). Without it, state lives under `--state-root` on local disk
7
- * only, and eval/A/B history stays in process memory.
7
+ * only, and eval history stays in process memory.
8
8
  *
9
9
  * The sink is a plain key-value store — put/get/delete/list, no schema —
10
10
  * plus a conditional-write group ({@link StorageConfig.cas}; optional).
11
11
  * Implementing that small KV core is enough for
12
- * FULL functionality: eval-run and A/B history are derived over the core
13
- * when the optional dedicated tables ({@link StorageConfig.evals} and
14
- * {@link StorageConfig.abs}) are not authored those groups exist as
15
- * backend-native optimizations (a real table, an analytics pipeline),
16
- * not as required-or-lose-history hooks:
12
+ * FULL functionality: eval-run history is derived over the core when the
13
+ * optional dedicated table ({@link StorageConfig.evals}) is not authored —
14
+ * that group exists as a backend-native optimization (a real table, an
15
+ * analytics pipeline), not as a required-or-lose-history hook:
17
16
  *
18
17
  * ```ts
19
18
  * import { defineStorage } from "@cursor/july/storage";
@@ -25,7 +24,6 @@
25
24
  * list: (prefix) => db.listByPrefix(prefix), // [{ key, value }] in key order
26
25
  * cas: { getWithVersion: ..., putIfAbsent: ..., putIfVersion: ..., listKeys: ... },
27
26
  * evals: { put: ..., delete: ..., list: ... }, // eval-runs table
28
- * abs: { putSample: ... }, // A/B table
29
27
  * });
30
28
  * ```
31
29
  *
@@ -50,9 +48,7 @@
50
48
  * event log under `--state-root` remains the live source of truth; this
51
49
  * interface is the durable mirror.
52
50
  */
53
- import type { ABMetricSample } from "./ab.js";
54
51
  import type { EvalRunSnapshot } from "./evals.js";
55
- import type { ABSnapshot } from "./internal/ab-snapshot.js";
56
52
  import type { JsonValue, KvCasResult, KvVersionedEntry } from "./types.js";
57
53
  export type { DurableSessionRecord, DurableSessionSummary, StorageKeys, } from "./storage-protocol.js";
58
54
  export { AGENTSDK_STORAGE_KEY_ROOT, agentSdkStorageKeys, frameworkStartLogId, GOLDEN_DURABLE_SESSION_RECORD, isDurableSessionRecordKey, keySegment, MAX_KEY_SEGMENT_BYTES, parseDurableSessionRecord, STORAGE_KEY_ROOT, storageKeys, storageKeysForArchitecture, summarizeDurableSessionRecord, } from "./storage-protocol.js";
@@ -130,21 +126,6 @@ export interface StorageEvalsTable {
130
126
  /** All saved runs (any order). Called once when the serve process hydrates. */
131
127
  list(ctx: StorageContext): EvalRunSnapshot[] | Promise<EvalRunSnapshot[]>;
132
128
  }
133
- /**
134
- * Dedicated table for live A/B metrics: one row per cumulative metric
135
- * sample (unique per `experiment` + `sessionId` + `at` — one boundary
136
- * event emits a sample per enrolled experiment), plus — optionally — the latest
137
- * aggregate snapshot so a replacement host with no local sessions can
138
- * still serve the A/Bs surface.
139
- */
140
- export interface StorageABTable {
141
- /** Append one cumulative metric sample (turn complete/fail). */
142
- putSample(sample: ABMetricSample, ctx: StorageContext): void | Promise<void>;
143
- /** Upsert the latest aggregate snapshot (framework-throttled). Optional. */
144
- putSnapshot?(snapshot: ABSnapshot, ctx: StorageContext): void | Promise<void>;
145
- /** Latest saved aggregate snapshot (replacement-host backfill). Optional. */
146
- getSnapshot?(ctx: StorageContext): ABSnapshot | undefined | null | Promise<ABSnapshot | undefined | null>;
147
- }
148
129
  /**
149
130
  * Conditional writes (CAS) — the coordination tier of the storage backend
150
131
  * contract. Plain storage works without it, so existing backends keep
@@ -152,9 +133,8 @@ export interface StorageABTable {
152
133
  * it, so implementing this group yourself only comes up for BYO storage.
153
134
  *
154
135
  * Grouped under {@link StorageConfig.cas} rather than as loose methods —
155
- * matching the `evals` / `abs` table groups — so `defineStorage`
156
- * validates the whole group at once: there is no meaningful
157
- * half-implementation.
136
+ * matching the `evals` table group — so `defineStorage` validates the
137
+ * whole group at once: there is no meaningful half-implementation.
158
138
  *
159
139
  * Version tokens are opaque per-key strings that change on every
160
140
  * successful write (counter, UUID, content hash — whatever is cheap for
@@ -187,14 +167,6 @@ export interface StorageConfig {
187
167
  * memory (lost on restart).
188
168
  */
189
169
  evals?: StorageEvalsTable;
190
- /**
191
- * Dedicated A/B table — a backend-native optimization, not a
192
- * requirement. When omitted, `defineStorage` derives it over the KV
193
- * core: `putSample` and `putSnapshot` need only core `put` (always
194
- * present), `getSnapshot` additionally needs core `get`. Session event
195
- * logs remain the assignment/fold source of truth either way.
196
- */
197
- abs?: StorageABTable;
198
170
  /**
199
171
  * Conditional writes (CAS). Optional for plain storage — existing
200
172
  * backends keep working without it. The built-in backends (`fileKv`,
@@ -213,7 +185,7 @@ export interface StorageConfig {
213
185
  delete?(key: string, ctx: StorageContext): void | Promise<void>;
214
186
  /**
215
187
  * Point lookup. Optional — required for **lazy restore** (resolving a
216
- * continuation token on a replacement host) and the A/B backfill.
188
+ * continuation token on a replacement host).
217
189
  * Return `undefined`/`null` only for a **definitive** miss: on the lazy
218
190
  * restore path a throw propagates and fails the follow-up (retryable) —
219
191
  * a store outage must not read as "unknown token", which would fork the
@@ -1 +1 @@
1
- {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../src/storage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAG5D,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE3E,YAAY,EACV,oBAAoB,EACpB,qBAAqB,EACrB,WAAW,GACZ,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,yBAAyB,EACzB,mBAAmB,EACnB,mBAAmB,EACnB,6BAA6B,EAC7B,yBAAyB,EACzB,UAAU,EACV,qBAAqB,EACrB,yBAAyB,EACzB,gBAAgB,EAChB,WAAW,EACX,0BAA0B,EAC1B,6BAA6B,GAC9B,MAAM,uBAAuB,CAAC;AAM/B,wEAAwE;AACxE,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,SAAS,CAAC;CAClB;AAED,yCAAyC;AACzC,MAAM,WAAW,cAAc;IAC7B,uEAAuE;IACvE,SAAS,EAAE,MAAM,CAAC;IAClB,sEAAsE;IACtE,WAAW,EAAE,M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AAS,GAAG;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3C,OAAO,EACH,KAAK,GACL;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAA;KAAE,CAAC;CACtE;AAED,wEAAwE;AACxE,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,aAAa,GAAG,SAAS,GAChC,qBAAqB,CA8BvB"}
package/dist/storage.js CHANGED
@@ -4,16 +4,15 @@
4
4
  * Author `agent/storage.ts` with {@link defineStorage} to mirror the
5
5
  * framework's durable state into storage you own (a database, S3, a data
6
6
  * pipeline, …). Without it, state lives under `--state-root` on local disk
7
- * only, and eval/A/B history stays in process memory.
7
+ * only, and eval history stays in process memory.
8
8
  *
9
9
  * The sink is a plain key-value store — put/get/delete/list, no schema —
10
10
  * plus a conditional-write group ({@link StorageConfig.cas}; optional).
11
11
  * Implementing that small KV core is enough for
12
- * FULL functionality: eval-run and A/B history are derived over the core
13
- * when the optional dedicated tables ({@link StorageConfig.evals} and
14
- * {@link StorageConfig.abs}) are not authored those groups exist as
15
- * backend-native optimizations (a real table, an analytics pipeline),
16
- * not as required-or-lose-history hooks:
12
+ * FULL functionality: eval-run history is derived over the core when the
13
+ * optional dedicated table ({@link StorageConfig.evals}) is not authored —
14
+ * that group exists as a backend-native optimization (a real table, an
15
+ * analytics pipeline), not as a required-or-lose-history hook:
17
16
  *
18
17
  * ```ts
19
18
  * import { defineStorage } from "@cursor/july/storage";
@@ -25,7 +24,6 @@
25
24
  * list: (prefix) => db.listByPrefix(prefix), // [{ key, value }] in key order
26
25
  * cas: { getWithVersion: ..., putIfAbsent: ..., putIfVersion: ..., listKeys: ... },
27
26
  * evals: { put: ..., delete: ..., list: ... }, // eval-runs table
28
- * abs: { putSample: ... }, // A/B table
29
27
  * });
30
28
  * ```
31
29
  *
@@ -100,25 +98,13 @@ export function defineStorage(config) {
100
98
  .join(", ")} must be ${missingCasHooks.length === 1 ? "a function" : "functions"} when the cas group is set`);
101
99
  }
102
100
  }
103
- if (config.abs !== undefined) {
104
- if (typeof config.abs.putSample !== "function") {
105
- throw new Error("defineStorage: abs.putSample must be a function when the abs table is set");
106
- }
107
- for (const hook of ["putSnapshot", "getSnapshot"]) {
108
- const value = config.abs[hook];
109
- if (value !== undefined && typeof value !== "function") {
110
- throw new Error(`defineStorage: abs.${hook} must be a function when set`);
111
- }
112
- }
113
- }
114
101
  // Validate eagerly so a bad policy fails at discovery, not first flush.
115
102
  resolveStoragePolicy(config.policy);
116
103
  // A backend that implements only the KV core gets full functionality:
117
- // the dedicated tables are backend-native optimizations, derived over
118
- // the core when absent. Authored groups always win.
104
+ // the dedicated table is a backend-native optimization, derived over
105
+ // the core when absent. An authored group always wins.
119
106
  const derivedEvals = config.evals === undefined ? deriveEvalsTable(config) : undefined;
120
- const derivedAbs = config.abs === undefined ? deriveAbsTable(config) : undefined;
121
- return brandDefinition("storage", Object.assign(Object.assign(Object.assign({}, config), (derivedEvals === undefined ? {} : { evals: derivedEvals })), (derivedAbs === undefined ? {} : { abs: derivedAbs })));
107
+ return brandDefinition("storage", Object.assign(Object.assign({}, config), (derivedEvals === undefined ? {} : { evals: derivedEvals })));
122
108
  }
123
109
  /**
124
110
  * Eval-runs table over the KV core: one key per run under
@@ -142,28 +128,6 @@ function deriveEvalsTable(config) {
142
128
  }),
143
129
  };
144
130
  }
145
- /**
146
- * A/B table over the KV core. Each sample lands as its own key (identity
147
- * = experiment + sessionId + at, matching the dedicated table's row
148
- * uniqueness): appending to one array value would need read-modify-write
149
- * — lost updates under concurrent writers without CAS, and unbounded
150
- * value growth — while a key per sample keeps `putSample` a blind put
151
- * with real append-only semantics. The aggregate snapshot lives at one
152
- * fixed key via plain `put` (last-write-wins is correct for "latest").
153
- * Requires only core `put`; `getSnapshot` is included when core `get`
154
- * exists.
155
- */
156
- function deriveAbsTable(config) {
157
- const get = config.get;
158
- return Object.assign({ putSample: (sample, ctx) => config.put(storageKeys.abSample(ctx.agentName, sample.experiment, sample.sessionId, sample.at), sample, ctx), putSnapshot: (snapshot, ctx) => config.put(storageKeys.abSnapshot(ctx.agentName), snapshot, ctx) }, (get === undefined
159
- ? {}
160
- : {
161
- getSnapshot: (ctx) => __awaiter(this, void 0, void 0, function* () {
162
- const value = yield get(storageKeys.abSnapshot(ctx.agentName), ctx);
163
- return (value !== null && value !== void 0 ? value : undefined);
164
- }),
165
- }));
166
- }
167
131
  // ============================================================================
168
132
  // Policy resolution
169
133
  // ============================================================================