@cursor/july 0.1.114 → 0.2.1

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 (206) hide show
  1. package/dist/channels/slack/channel-watch.d.ts +19 -3
  2. package/dist/channels/slack/channel-watch.d.ts.map +1 -1
  3. package/dist/channels/slack/channel-watch.js +48 -9
  4. package/dist/channels/slack/inbound.d.ts +7 -0
  5. package/dist/channels/slack/inbound.d.ts.map +1 -1
  6. package/dist/channels/slack/inbound.js +23 -0
  7. package/dist/channels/slack/slack-channel.d.ts.map +1 -1
  8. package/dist/channels/slack/slack-channel.js +87 -8
  9. package/dist/channels/slack/types.d.ts +11 -12
  10. package/dist/channels/slack/types.d.ts.map +1 -1
  11. package/dist/docs/404.html +2 -2
  12. package/dist/docs/assets/{app.BqkJwOZ-.js → app.D23Y-7Tp.js} +4 -4
  13. package/dist/docs/assets/chunks/@localSearchIndexroot.CzCCM7N8.js +1 -0
  14. package/dist/docs/assets/chunks/{VPLocalSearchBox.BJAi2KiV.js → VPLocalSearchBox.CWBeTFRZ.js} +1 -1
  15. package/dist/docs/assets/chunks/{arc.BZpXTgvV.js → arc.DSF2O3pm.js} +1 -1
  16. package/dist/docs/assets/chunks/{architectureDiagram-Q4EWVU46.WYI-7F-Y.js → architectureDiagram-Q4EWVU46.J52Wzbkg.js} +1 -1
  17. package/dist/docs/assets/chunks/{baseUniq.CZaUPpg0.js → baseUniq.CQS3LPCt.js} +1 -1
  18. package/dist/docs/assets/chunks/{blockDiagram-DXYQGD6D.D6UES2pD.js → blockDiagram-DXYQGD6D.Dw339Gr5.js} +1 -1
  19. package/dist/docs/assets/chunks/{c4Diagram-AHTNJAMY.cwebIe4i.js → c4Diagram-AHTNJAMY.BUdtOaRZ.js} +1 -1
  20. package/dist/docs/assets/chunks/channel.Bfu4df88.js +1 -0
  21. package/dist/docs/assets/chunks/{chunk-4BX2VUAB.fVyFnjxg.js → chunk-4BX2VUAB.CuOrkEqk.js} +1 -1
  22. package/dist/docs/assets/chunks/{chunk-4TB4RGXK.BanufG1c.js → chunk-4TB4RGXK.BJNBcY7U.js} +1 -1
  23. package/dist/docs/assets/chunks/{chunk-55IACEB6.VaSMz5-2.js → chunk-55IACEB6.VJK5LAm_.js} +1 -1
  24. package/dist/docs/assets/chunks/{chunk-EDXVE4YY.CN2diZOM.js → chunk-EDXVE4YY.BYYLihvj.js} +1 -1
  25. package/dist/docs/assets/chunks/{chunk-FMBD7UC4.g4ivypu3.js → chunk-FMBD7UC4.CmoW8BXP.js} +1 -1
  26. package/dist/docs/assets/chunks/{chunk-OYMX7WX6.GZXKn9JJ.js → chunk-OYMX7WX6.DTGY4C-M.js} +1 -1
  27. package/dist/docs/assets/chunks/{chunk-QZHKN3VN.itXxJZCd.js → chunk-QZHKN3VN.Cg5n67vl.js} +1 -1
  28. package/dist/docs/assets/chunks/{chunk-YZCP3GAM.-rw2GfvX.js → chunk-YZCP3GAM.C3GR_ia5.js} +1 -1
  29. package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.DdfgtaWs.js +1 -0
  30. package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.DdfgtaWs.js +1 -0
  31. package/dist/docs/assets/chunks/clone.rkmfti6d.js +1 -0
  32. package/dist/docs/assets/chunks/{cose-bilkent-S5V4N54A.CmaI5br0.js → cose-bilkent-S5V4N54A.BTRG8N3b.js} +1 -1
  33. package/dist/docs/assets/chunks/{dagre-KV5264BT.4wY9S4Kt.js → dagre-KV5264BT.Bob_bp_p.js} +1 -1
  34. package/dist/docs/assets/chunks/{diagram-5BDNPKRD.Pc3c0u9W.js → diagram-5BDNPKRD.ggPcs9uO.js} +1 -1
  35. package/dist/docs/assets/chunks/{diagram-G4DWMVQ6.CYrWz-nj.js → diagram-G4DWMVQ6.BP0qyJkp.js} +1 -1
  36. package/dist/docs/assets/chunks/{diagram-MMDJMWI5.Bgj5hukb.js → diagram-MMDJMWI5.B0X24UKr.js} +1 -1
  37. package/dist/docs/assets/chunks/{diagram-TYMM5635.DGMEXalS.js → diagram-TYMM5635.B4rXHFVt.js} +1 -1
  38. package/dist/docs/assets/chunks/{erDiagram-SMLLAGMA.GepTV9Im.js → erDiagram-SMLLAGMA._55Rt9oX.js} +1 -1
  39. package/dist/docs/assets/chunks/{flowDiagram-DWJPFMVM.DVKywg3j.js → flowDiagram-DWJPFMVM.DGP4XvR5.js} +1 -1
  40. package/dist/docs/assets/chunks/{ganttDiagram-T4ZO3ILL.C7qt9Mlo.js → ganttDiagram-T4ZO3ILL.BtXtkL4E.js} +1 -1
  41. package/dist/docs/assets/chunks/{gitGraphDiagram-UUTBAWPF.U30_r82P.js → gitGraphDiagram-UUTBAWPF.B9cPWblK.js} +1 -1
  42. package/dist/docs/assets/chunks/{graph.CyyMyAWv.js → graph.D8HzNexS.js} +1 -1
  43. package/dist/docs/assets/chunks/{infoDiagram-42DDH7IO.Dn9ACW3y.js → infoDiagram-42DDH7IO.Bw7CQUpi.js} +1 -1
  44. package/dist/docs/assets/chunks/{ishikawaDiagram-UXIWVN3A.DlIdIGOA.js → ishikawaDiagram-UXIWVN3A.MwkzF6nQ.js} +1 -1
  45. package/dist/docs/assets/chunks/{journeyDiagram-VCZTEJTY.DZj4vy4E.js → journeyDiagram-VCZTEJTY.DIGFF-3C.js} +1 -1
  46. package/dist/docs/assets/chunks/{kanban-definition-6JOO6SKY.Dl63eMUV.js → kanban-definition-6JOO6SKY.DhYef2BN.js} +1 -1
  47. package/dist/docs/assets/chunks/{layout.BLHZLWPH.js → layout.C0XUxuPi.js} +1 -1
  48. package/dist/docs/assets/chunks/{linear.aXKGKaNw.js → linear.BwNPpZex.js} +1 -1
  49. package/dist/docs/assets/chunks/{min.zWnFcpcc.js → min.CwAQdL7z.js} +1 -1
  50. package/dist/docs/assets/chunks/{mindmap-definition-QFDTVHPH.Qs4MQBea.js → mindmap-definition-QFDTVHPH.pWsSVLsP.js} +1 -1
  51. package/dist/docs/assets/chunks/{pieDiagram-DEJITSTG.BmPHgsk7.js → pieDiagram-DEJITSTG.BDJ3FbBy.js} +1 -1
  52. package/dist/docs/assets/chunks/{quadrantDiagram-34T5L4WZ.D5MQ3gwA.js → quadrantDiagram-34T5L4WZ.Co80izyB.js} +1 -1
  53. package/dist/docs/assets/chunks/{requirementDiagram-MS252O5E.CkdUFrO7.js → requirementDiagram-MS252O5E.JveKw4yx.js} +1 -1
  54. package/dist/docs/assets/chunks/{sankeyDiagram-XADWPNL6.KZrljrAV.js → sankeyDiagram-XADWPNL6.B0A7adPi.js} +1 -1
  55. package/dist/docs/assets/chunks/{sequenceDiagram-FGHM5R23.XMoEW-Lx.js → sequenceDiagram-FGHM5R23.d6JZ5Hre.js} +1 -1
  56. package/dist/docs/assets/chunks/{stateDiagram-FHFEXIEX.BmTzePLj.js → stateDiagram-FHFEXIEX.DWnL0NQl.js} +1 -1
  57. package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.ZEetPk0E.js +1 -0
  58. package/dist/docs/assets/chunks/{theme.BfQzpxsg.js → theme.MJTLx0hh.js} +2 -2
  59. package/dist/docs/assets/chunks/{timeline-definition-GMOUNBTQ.Dug0oamp.js → timeline-definition-GMOUNBTQ.CFS7Ai4c.js} +1 -1
  60. package/dist/docs/assets/chunks/{vennDiagram-DHZGUBPP.BOTHrEFu.js → vennDiagram-DHZGUBPP.CwSlnjCf.js} +1 -1
  61. package/dist/docs/assets/chunks/wardley-RL74JXVD.3gurI8YA.js +162 -0
  62. package/dist/docs/assets/chunks/{wardleyDiagram-NUSXRM2D.CoXKdfi6.js → wardleyDiagram-NUSXRM2D.B_8mvtjh.js} +1 -1
  63. package/dist/docs/assets/chunks/{xychartDiagram-5P7HB3ND.DXoSCjAW.js → xychartDiagram-5P7HB3ND.DtjU5H85.js} +1 -1
  64. package/dist/docs/assets/{guides_slack.md.Bo96y42E.js → guides_slack.md.Bjw2r2gL.js} +5 -5
  65. package/dist/docs/assets/{guides_slack.md.Bo96y42E.lean.js → guides_slack.md.Bjw2r2gL.lean.js} +1 -1
  66. package/dist/docs/assets/reference_cli.md.BvnQM8wd.js +97 -0
  67. package/dist/docs/assets/reference_cli.md.BvnQM8wd.lean.js +1 -0
  68. package/dist/docs/building-with-agents.html +35 -35
  69. package/dist/docs/deployment.html +35 -35
  70. package/dist/docs/evals.html +35 -35
  71. package/dist/docs/guides/agent-to-agent.html +35 -35
  72. package/dist/docs/guides/bitbucket.html +35 -35
  73. package/dist/docs/guides/cloud-agents.html +35 -35
  74. package/dist/docs/guides/convert-automation.html +35 -35
  75. package/dist/docs/guides/github.html +35 -35
  76. package/dist/docs/guides/gitlab.html +35 -35
  77. package/dist/docs/guides/grokbot-agents.html +35 -35
  78. package/dist/docs/guides/hooks.html +35 -35
  79. package/dist/docs/guides/improve.html +35 -35
  80. package/dist/docs/guides/jev.html +35 -35
  81. package/dist/docs/guides/mcp-oauth.html +35 -35
  82. package/dist/docs/guides/opentelemetry.html +35 -35
  83. package/dist/docs/guides/slack.html +39 -39
  84. package/dist/docs/guides/slack.md +16 -1
  85. package/dist/docs/guides/webhooks.html +35 -35
  86. package/dist/docs/hashmap.json +1 -1
  87. package/dist/docs/hillclimbing.html +35 -35
  88. package/dist/docs/index.html +35 -35
  89. package/dist/docs/llms-full.txt +699 -752
  90. package/dist/docs/llms.txt +1 -1
  91. package/dist/docs/quickstart.html +35 -35
  92. package/dist/docs/reference/agent-config.html +35 -35
  93. package/dist/docs/reference/artifacts.html +35 -35
  94. package/dist/docs/reference/channels.html +35 -35
  95. package/dist/docs/reference/cli.html +127 -125
  96. package/dist/docs/reference/cli.md +685 -753
  97. package/dist/docs/reference/connections.html +35 -35
  98. package/dist/docs/reference/evals.html +35 -35
  99. package/dist/docs/reference/extensions.html +35 -35
  100. package/dist/docs/reference/hooks.html +35 -35
  101. package/dist/docs/reference/http-api.html +35 -35
  102. package/dist/docs/reference/instructions.html +35 -35
  103. package/dist/docs/reference/playground.html +35 -35
  104. package/dist/docs/reference/project-layout.html +35 -35
  105. package/dist/docs/reference/prompt.html +35 -35
  106. package/dist/docs/reference/schedules.html +35 -35
  107. package/dist/docs/reference/sessions.html +35 -35
  108. package/dist/docs/reference/skills.html +35 -35
  109. package/dist/docs/reference/subagents.html +35 -35
  110. package/dist/docs/reference/tools.html +35 -35
  111. package/dist/docs/templates/agentic-owners.html +35 -35
  112. package/dist/docs/templates/pr-autofixer.html +35 -35
  113. package/dist/docs/templates/security-reviewer.html +35 -35
  114. package/dist/docs/templates/thermo-quality-review.html +35 -35
  115. package/dist/docs/templates/thermo-review.html +35 -35
  116. package/dist/docs/templates/triage.html +35 -35
  117. package/dist/docs/troubleshooting.html +35 -35
  118. package/dist/files-backends/cursor-hosted.d.ts +11 -17
  119. package/dist/files-backends/cursor-hosted.d.ts.map +1 -1
  120. package/dist/files-backends/cursor-hosted.js +13 -41
  121. package/dist/index.d.ts +1 -1
  122. package/dist/index.d.ts.map +1 -1
  123. package/dist/internal/artifacts-store.d.ts +11 -0
  124. package/dist/internal/artifacts-store.d.ts.map +1 -1
  125. package/dist/internal/artifacts-store.js +113 -18
  126. package/dist/internal/cli-deploy.d.ts.map +1 -1
  127. package/dist/internal/cli-deploy.js +9 -1
  128. package/dist/internal/cursor/cursor-api-transport.d.ts +37 -0
  129. package/dist/internal/cursor/cursor-api-transport.d.ts.map +1 -0
  130. package/dist/internal/cursor/cursor-api-transport.js +44 -0
  131. package/dist/internal/cursor/hosted-store-secrets.d.ts +21 -0
  132. package/dist/internal/cursor/hosted-store-secrets.d.ts.map +1 -1
  133. package/dist/internal/cursor/hosted-store-secrets.js +26 -0
  134. package/dist/internal/cursor/store-api-client.d.ts +82 -0
  135. package/dist/internal/cursor/store-api-client.d.ts.map +1 -0
  136. package/dist/internal/cursor/store-api-client.js +227 -0
  137. package/dist/internal/deploy-client.d.ts +6 -0
  138. package/dist/internal/deploy-client.d.ts.map +1 -1
  139. package/dist/internal/deploy-client.js +3 -0
  140. package/dist/internal/deploy-manifest.d.ts +8 -0
  141. package/dist/internal/deploy-manifest.d.ts.map +1 -1
  142. package/dist/internal/deploy-manifest.js +7 -1
  143. package/dist/internal/discovery/agent-config.d.ts +3 -1
  144. package/dist/internal/discovery/agent-config.d.ts.map +1 -1
  145. package/dist/internal/discovery/agent-config.js +7 -4
  146. package/dist/internal/framework-storage-selection.d.ts +1 -1
  147. package/dist/internal/framework-storage-selection.d.ts.map +1 -1
  148. package/dist/internal/platform-timers.d.ts.map +1 -1
  149. package/dist/internal/platform-timers.js +20 -2
  150. package/dist/internal/reminder-runner.d.ts +79 -1
  151. package/dist/internal/reminder-runner.d.ts.map +1 -1
  152. package/dist/internal/reminder-runner.js +287 -46
  153. package/dist/internal/server.d.ts.map +1 -1
  154. package/dist/internal/server.js +7 -0
  155. package/dist/internal/session-engine.d.ts.map +1 -1
  156. package/dist/internal/session-engine.js +13 -15
  157. package/dist/internal/store-api-protocol.d.ts +134 -0
  158. package/dist/internal/store-api-protocol.d.ts.map +1 -0
  159. package/dist/internal/store-api-protocol.js +126 -0
  160. package/dist/memory.d.ts +49 -10
  161. package/dist/memory.d.ts.map +1 -1
  162. package/dist/memory.js +193 -50
  163. package/dist/playground/assets/{index-CrMWlgUU.js → index-Cs0MKsv4.js} +30 -30
  164. package/dist/playground/assets/index-DLwnR9ys.css +1 -0
  165. package/dist/playground/index.html +2 -2
  166. package/dist/reminders.d.ts +1 -1
  167. package/dist/reminders.d.ts.map +1 -1
  168. package/dist/types.d.ts +44 -10
  169. package/dist/types.d.ts.map +1 -1
  170. package/docs/guides/slack.md +16 -1
  171. package/docs/reference/cli.md +686 -754
  172. package/package.json +1 -1
  173. package/skills/setup-slack/SKILL.md +1 -1
  174. package/src/channels/slack/channel-watch.ts +57 -8
  175. package/src/channels/slack/inbound.ts +24 -0
  176. package/src/channels/slack/slack-channel.ts +127 -4
  177. package/src/channels/slack/types.ts +11 -12
  178. package/src/files-backends/cursor-hosted.ts +31 -68
  179. package/src/index.ts +1 -0
  180. package/src/internal/artifacts-store.ts +131 -25
  181. package/src/internal/cli-deploy.ts +12 -1
  182. package/src/internal/cursor/cursor-api-transport.ts +73 -0
  183. package/src/internal/cursor/hosted-store-secrets.ts +35 -0
  184. package/src/internal/cursor/store-api-client.ts +360 -0
  185. package/src/internal/deploy-client.ts +9 -0
  186. package/src/internal/deploy-manifest.ts +15 -0
  187. package/src/internal/discovery/agent-config.ts +8 -6
  188. package/src/internal/framework-storage-selection.ts +1 -1
  189. package/src/internal/platform-timers.ts +24 -2
  190. package/src/internal/reminder-runner.ts +454 -66
  191. package/src/internal/server.ts +8 -0
  192. package/src/internal/session-engine.ts +17 -22
  193. package/src/internal/store-api-protocol.ts +222 -0
  194. package/src/memory.ts +240 -59
  195. package/src/reminders.ts +1 -0
  196. package/src/types.ts +47 -10
  197. package/dist/docs/assets/chunks/@localSearchIndexroot.BnSgidYE.js +0 -1
  198. package/dist/docs/assets/chunks/channel.DdM5EfNW.js +0 -1
  199. package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.CjfGHeg2.js +0 -1
  200. package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.CjfGHeg2.js +0 -1
  201. package/dist/docs/assets/chunks/clone.wSOICb_f.js +0 -1
  202. package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.Cu5X28zZ.js +0 -1
  203. package/dist/docs/assets/chunks/wardley-RL74JXVD.DXy2i1LS.js +0 -162
  204. package/dist/docs/assets/reference_cli.md.DLWDz9ij.js +0 -95
  205. package/dist/docs/assets/reference_cli.md.DLWDz9ij.lean.js +0 -1
  206. package/dist/playground/assets/index-C61EWMBK.css +0 -1
package/dist/index.d.ts CHANGED
@@ -37,7 +37,7 @@ export { agentStoreMemoryBackend, fileMemoryBackend, memoryHook, } from "./memor
37
37
  export type { OtelConfig, OtelDefinition, OtelExporterConfig } from "./otel.js";
38
38
  export type { PromptTag } from "./prompt.js";
39
39
  export { prompt } from "./prompt.js";
40
- export type { ReminderBusyPolicy, ReminderCreateInput, ReminderDefinition, ReminderFireContext, ReminderFireResult, ReminderHandlerConfig, ReminderHostApi, ReminderInfo, ReminderReschedule, ReminderScheduleKind, ReminderStatus, ReminderTarget, ReminderUntilContext, } from "./reminders.js";
40
+ export type { ReminderBusyPolicy, ReminderCreateInput, ReminderDefinition, ReminderFireContext, ReminderFireResult, ReminderFollowupOptions, ReminderHandlerConfig, ReminderHostApi, ReminderInfo, ReminderReschedule, ReminderScheduleKind, ReminderStatus, ReminderTarget, ReminderUntilContext, } from "./reminders.js";
41
41
  export { defineReminder } from "./reminders.js";
42
42
  export { defineResult } from "./result.js";
43
43
  export { defineSchedule } from "./schedules.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,OAAO,EACL,KAAK,uBAAuB,EAE7B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EACV,WAAW,EACX,qBAAqB,EACrB,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,sBAAsB,EACtB,YAAY,EACb,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,EACL,QAAQ,EACR,UAAU,EACV,MAAM,EACN,aAAa,EACb,GAAG,EACH,QAAQ,EACR,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,KAAK,EACL,IAAI,EACJ,GAAG,EACH,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EACL,YAAY,EACZ,eAAe,EACf,OAAO,EACP,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,WAAW,EACX,mBAAmB,EACnB,eAAe,EACf,YAAY,EACZ,eAAe,EACf,WAAW,GACZ,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,QAAQ,EACR,SAAS,EACT,UAAU,EACV,QAAQ,EACR,UAAU,EACV,WAAW,EACX,SAAS,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,GAAG,qBAAqB,CAEtE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,kBAAkB,GACzB,sBAAsB,CAExB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,KAAK,CACzB,YAAY,EAAE,MAAM,GAAG,YAAY,EACnC,OAAO,GAAE,YAAY,GAAG;IACtB,SAAS,CAAC,EAAE,uBAAuB,CAAC;IACpC;;;;OAIG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;CACtB,GACL,OAAO,CAAC,gBAAgB,CAAC,CAqB3B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,OAAO,EACL,KAAK,uBAAuB,EAE7B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EACV,WAAW,EACX,qBAAqB,EACrB,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,sBAAsB,EACtB,YAAY,EACb,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,EACL,QAAQ,EACR,UAAU,EACV,MAAM,EACN,aAAa,EACb,GAAG,EACH,QAAQ,EACR,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,KAAK,EACL,IAAI,EACJ,GAAG,EACH,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EACL,YAAY,EACZ,eAAe,EACf,OAAO,EACP,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,WAAW,EACX,mBAAmB,EACnB,eAAe,EACf,YAAY,EACZ,eAAe,EACf,WAAW,GACZ,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,QAAQ,EACR,SAAS,EACT,UAAU,EACV,QAAQ,EACR,UAAU,EACV,WAAW,EACX,SAAS,EACT,UAAU,EACV,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GAAG,qBAAqB,CAEtE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,kBAAkB,GACzB,sBAAsB,CAExB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,KAAK,CACzB,YAAY,EAAE,MAAM,GAAG,YAAY,EACnC,OAAO,GAAE,YAAY,GAAG;IACtB,SAAS,CAAC,EAAE,uBAAuB,CAAC;IACpC;;;;OAIG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;CACtB,GACL,OAAO,CAAC,gBAAgB,CAAC,CAqB3B"}
@@ -46,7 +46,18 @@ export declare class ArtifactsStore {
46
46
  * parsed output — defaults and coercions applied — is what gets stored.
47
47
  */
48
48
  private resolveKindAndData;
49
+ /**
50
+ * Trim to the retention cap from listing metadata alone. Past the cap
51
+ * this runs on every new-row insert, so it must not hydrate row bodies:
52
+ * on the Agent Store that is one read per row (~`max` reads per insert,
53
+ * forever, since eviction trims right back to the cap) — the 2026-09-18
54
+ * read storm on the security-reviewer deployment. The store listing
55
+ * carries last-modified metadata, and a row is rewritten on every upsert,
56
+ * so listing mtime orders rows the same way their `updatedAt` does.
57
+ */
49
58
  private evictPastCap;
59
+ /** The `excess` oldest row ids, cheapest available ordering first. */
60
+ private oldestRowIds;
50
61
  }
51
62
  /** Deterministic id for a keyed tag (same key ⇒ same id ⇒ upsert). */
52
63
  export declare function artifactIdForKey(key: string): string;
@@ -1 +1 @@
1
- {"version":3,"file":"artifacts-store.d.ts","sourceRoot":"","sources":["../../src/internal/artifacts-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAaH,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAK5D,OAAO,KAAK,EACV,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,gBAAgB,EAEjB,MAAM,aAAa,CAAC;AAkBrB,MAAM,WAAW,2BAA2B;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,M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AAC;AAsCrB,MAAM,WAAW,2BAA2B;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,kDAAkD;IAClD,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,4EAA4E;IAC5E,IAAI,CAAC,EAAE,QAAQ,CAAC;CACjB;AAED,6DAA6D;AAC7D,eAAO,MAAM,qBAAqB,aAAa,CAAC;AAEhD;;;;;GAKG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAmB;IACxC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAuB;IAC/C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA8B;IACrD,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAS;IAC7B,4EAA4E;IAC5E,OAAO,CAAC,QAAQ,CAAuC;IAEvD,YAAY,OAAO,EAAE,2BAA2B,EAa/C;IAED,GAAG,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,cAAc,CAAC,CAIpD;YAEa,aAAa;IAkD3B,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAEnD;IAED,sEAAsE;IACtE,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAEtD;IAEK,IAAI,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAUjE;IAED;;;;;OAKG;IACH,OAAO,CAAC,kBAAkB;IA8B1B;;;;;;;;OAQG;YACW,YAAY;IAc1B,sEAAsE;YACxD,YAAY;CAyB3B;AAED,sEAAsE;AACtE,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAKpD"}
@@ -22,6 +22,15 @@ import { join } from "node:path";
22
22
  import { resolveArtifactsMax } from "../artifacts.js";
23
23
  import { agentStoreKeys } from "../files.js";
24
24
  import { cursorHostedFiles, isCursorHostedFilesAvailable, } from "../files-backends/cursor-hosted.js";
25
+ import { mapBounded } from "./bounded.js";
26
+ /**
27
+ * Row-body hydration fan-out cap. `list()` fetches one object per row; on
28
+ * the Agent Store each fetch is a control-plane request, and an unbounded
29
+ * `Promise.all` over ~1k rows is a fleet-visible read burst (the 2026-09-18
30
+ * Agent Store read storm was this exact fan-out, run once per insert by the
31
+ * pre-metadata eviction path).
32
+ */
33
+ const ROW_HYDRATION_CONCURRENCY = 8;
25
34
  /** Kind used by freeform tags when no kinds are declared. */
26
35
  export const ARTIFACT_DEFAULT_KIND = "artifact";
27
36
  /**
@@ -148,22 +157,53 @@ export class ArtifactsStore {
148
157
  }
149
158
  return { kind, data: input.data };
150
159
  }
160
+ /**
161
+ * Trim to the retention cap from listing metadata alone. Past the cap
162
+ * this runs on every new-row insert, so it must not hydrate row bodies:
163
+ * on the Agent Store that is one read per row (~`max` reads per insert,
164
+ * forever, since eviction trims right back to the cap) — the 2026-09-18
165
+ * read storm on the security-reviewer deployment. The store listing
166
+ * carries last-modified metadata, and a row is rewritten on every upsert,
167
+ * so listing mtime orders rows the same way their `updatedAt` does.
168
+ */
151
169
  evictPastCap() {
152
170
  return __awaiter(this, void 0, void 0, function* () {
153
- if ((yield this.rows.count()) <= this.max) {
171
+ const metas = yield this.rows.listMeta();
172
+ const excess = metas.length - this.max;
173
+ if (excess <= 0) {
154
174
  return;
155
175
  }
156
- const records = yield this.rows.list();
157
- if (records.length <= this.max) {
158
- return;
176
+ for (const id of yield this.oldestRowIds(metas, excess)) {
177
+ yield this.rows.delete(id);
178
+ // Without the row body there is no `content` flag to consult; delete
179
+ // the payload unconditionally — absent payloads delete as a no-op.
180
+ yield this.content.delete(id);
159
181
  }
160
- const oldestFirst = records.sort((a, b) => byNewestUpdated(b, a));
161
- for (const record of oldestFirst.slice(0, records.length - this.max)) {
162
- yield this.rows.delete(record.id);
163
- if (record.content !== undefined) {
164
- yield this.content.delete(record.id);
165
- }
182
+ });
183
+ }
184
+ /** The `excess` oldest row ids, cheapest available ordering first. */
185
+ oldestRowIds(metas, excess) {
186
+ return __awaiter(this, void 0, void 0, function* () {
187
+ if (metas.some(meta => meta.mtimeMs !== undefined)) {
188
+ // A store that tracks mtimes must never regress to per-insert
189
+ // hydration. The rare entry missing one (anomalous on such a store)
190
+ // sorts oldest via the comparator's `?? 0` and gets evicted first —
191
+ // evicting an anomaly beats re-reading every row on every insert.
192
+ return metas
193
+ .sort(byOldestModified)
194
+ .slice(0, excess)
195
+ .map(meta => meta.id);
166
196
  }
197
+ // A store that tracks no modification times at all (the local
198
+ // filesystem store, deliberately) leaves only the rows' own
199
+ // `updatedAt`: hydrate — bounded — and order exactly. Corrupt rows
200
+ // drop out of `list()`, so recompute the excess against the rows that
201
+ // actually parsed.
202
+ const records = yield this.rows.list();
203
+ return records
204
+ .sort((a, b) => byNewestUpdated(b, a))
205
+ .slice(0, Math.max(0, records.length - this.max))
206
+ .map(record => record.id);
167
207
  });
168
208
  }
169
209
  }
@@ -174,6 +214,18 @@ export function artifactIdForKey(key) {
174
214
  }
175
215
  return `art_${createHash("sha256").update(key, "utf8").digest("hex").slice(0, 32)}`;
176
216
  }
217
+ /**
218
+ * Oldest-modified first. Store mtimes can be coarse (S3 rounds to the
219
+ * second), so equal stamps tie-break by id — deterministic, and within a
220
+ * same-stamp cohort any victim is equally past the retention cap.
221
+ */
222
+ function byOldestModified(a, b) {
223
+ var _a, _b;
224
+ if (a.mtimeMs !== b.mtimeMs) {
225
+ return ((_a = a.mtimeMs) !== null && _a !== void 0 ? _a : 0) - ((_b = b.mtimeMs) !== null && _b !== void 0 ? _b : 0);
226
+ }
227
+ return a.id < b.id ? -1 : a.id > b.id ? 1 : 0;
228
+ }
177
229
  function byNewestUpdated(a, b) {
178
230
  if (a.updatedAt !== b.updatedAt) {
179
231
  return a.updatedAt < b.updatedAt ? 1 : -1;
@@ -245,7 +297,7 @@ function createSinkRowStore(sink, agentName) {
245
297
  list() {
246
298
  return __awaiter(this, void 0, void 0, function* () {
247
299
  const entries = yield sink.list(agentStoreKeys.artifactRowPrefix(agentName));
248
- const bodies = yield Promise.all(entries.map(entry => sink.get(entry.key)));
300
+ const bodies = yield mapBounded(entries, ROW_HYDRATION_CONCURRENCY, entry => sink.get(entry.key));
249
301
  const records = [];
250
302
  for (const body of bodies) {
251
303
  const record = parseRecordBytes(sinkBody(body));
@@ -256,14 +308,43 @@ function createSinkRowStore(sink, agentName) {
256
308
  return records;
257
309
  });
258
310
  },
259
- count() {
311
+ listMeta() {
260
312
  return __awaiter(this, void 0, void 0, function* () {
261
- const entries = yield sink.list(agentStoreKeys.artifactRowPrefix(agentName));
262
- return entries.length;
313
+ const prefix = agentStoreKeys.artifactRowPrefix(agentName);
314
+ const metas = [];
315
+ for (const entry of yield sink.list(prefix)) {
316
+ const id = rowIdFromName(entry.key.slice(prefix.length));
317
+ if (id !== undefined) {
318
+ metas.push({ id, mtimeMs: entry.mtimeMs });
319
+ }
320
+ }
321
+ return metas;
263
322
  });
264
323
  },
265
324
  };
266
325
  }
326
+ /**
327
+ * Invert the row naming scheme (`encodeURIComponent(id) + ".json"`).
328
+ * Foreign keys under the prefix — no `.json` suffix, malformed escapes,
329
+ * non-canonical encodings — read as absent rather than throwing. The
330
+ * round-trip check matters for eviction: a name that decodes but does not
331
+ * re-encode to itself (`a+b.json`, `foo bar.json`) would count toward the
332
+ * cap yet be undeletable through `key(id)`, leaving a phantom victim that
333
+ * every subsequent insert re-selects and fails to remove.
334
+ */
335
+ function rowIdFromName(name) {
336
+ if (!name.endsWith(".json") || name.includes("/")) {
337
+ return undefined;
338
+ }
339
+ const encoded = name.slice(0, -".json".length);
340
+ try {
341
+ const id = decodeURIComponent(encoded);
342
+ return encodeURIComponent(id) === encoded ? id : undefined;
343
+ }
344
+ catch (_a) {
345
+ return undefined;
346
+ }
347
+ }
267
348
  function createSinkContentStore(sink, agentName) {
268
349
  const key = (id) => agentStoreKeys.artifactContent(agentName, id);
269
350
  return {
@@ -344,18 +425,32 @@ function createFilesystemRowStore(stateRoot) {
344
425
  return records;
345
426
  });
346
427
  },
347
- count() {
428
+ listMeta() {
348
429
  return __awaiter(this, void 0, void 0, function* () {
430
+ // No mtimes on purpose: local rows are cheap to hydrate, and the
431
+ // rows' own `updatedAt` orders eviction exactly, immune to coarse
432
+ // filesystem timestamp granularity.
433
+ let names;
349
434
  try {
350
- const names = yield readdir(dir);
351
- return names.filter(name => !name.startsWith(".") && name.endsWith(".json")).length;
435
+ names = yield readdir(dir);
352
436
  }
353
437
  catch (error) {
354
438
  if (error.code === "ENOENT") {
355
- return 0;
439
+ return [];
356
440
  }
357
441
  throw error;
358
442
  }
443
+ const metas = [];
444
+ for (const name of names) {
445
+ if (name.startsWith(".")) {
446
+ continue;
447
+ }
448
+ const id = rowIdFromName(name);
449
+ if (id !== undefined) {
450
+ metas.push({ id });
451
+ }
452
+ }
453
+ return metas;
359
454
  });
360
455
  },
361
456
  };
@@ -1 +1 @@
1
- {"version":3,"file":"cli-deploy.d.ts","sourceRoot":"","sources":["../../src/internal/cli-deploy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAiBH,OAAO,EAOL,sBAAsB,EAevB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,KAAK,SAAS,EAAwB,MAAM,oBAAoB,CAAC;AAE1E,OAAO,EACL,KAAK,aAAa,EAMnB,MAAM,gBAAgB,CAAC;AAoBxB,8EAA8E;AAC9E,MAAM,MAAM,YAAY,GAAG,aAAa,CAAC;AAEzC;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAChC,MAAM,EAAE,SAAS,YAAY,EAAE,KAC5B,OAAO,CAAC,YAAY,EAAE,GAAG,IAAI,CAAC,CAAC;AAEpC,MAAM,WAAW,gBAAgB;IAC/B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,6DAA6D;IAC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AAO,CAAC,MAAM,CAAC,CAqCjB;AAuGD,wEAAwE;AACxE,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,CAAC,cAAc,GAC5B,MAAM,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAuCnC"}
@@ -1160,12 +1160,17 @@ export function cmdStop(slug, options) {
1160
1160
  }
1161
1161
  }
1162
1162
  const cancellation = "cancellation" in accepted ? accepted.cancellation : undefined;
1163
+ // The backend escalates a publisher's stop of a multi-tenant app to the
1164
+ // application-level suspension; say so, and how to undo it.
1165
+ const stoppedGlobally = "scope" in accepted && accepted.scope === "global";
1163
1166
  if (ctx.noWait) {
1164
1167
  if (ctx.json) {
1165
1168
  ctx.out(`${JSON.stringify(accepted, null, 2)}\n`);
1166
1169
  }
1167
1170
  else {
1168
- ctx.out(`Stop accepted for ${slug} (status: ${accepted.status}).\n`);
1171
+ ctx.out(stoppedGlobally
1172
+ ? `Stop accepted for ${slug} across all tenants (status: ${accepted.status}).\n`
1173
+ : `Stop accepted for ${slug} (status: ${accepted.status}).\n`);
1169
1174
  }
1170
1175
  return (cancellation === null || cancellation === void 0 ? void 0 : cancellation.failed) === 0 || cancellation === undefined ? 0 : 1;
1171
1176
  }
@@ -1182,6 +1187,9 @@ export function cmdStop(slug, options) {
1182
1187
  if (ctx.json) {
1183
1188
  ctx.out(`${JSON.stringify(detail, null, 2)}\n`);
1184
1189
  }
1190
+ else if (stoppedGlobally) {
1191
+ ctx.out(`Stopped ${slug} across all tenants (team ${ctx.teamId}); resume with \`${CLI} start ${slug} --global\`.\n`);
1192
+ }
1185
1193
  else {
1186
1194
  ctx.out(`Stopped ${slug} (team ${ctx.teamId}).\n`);
1187
1195
  }
@@ -0,0 +1,37 @@
1
+ /**
2
+ * The one resolution of "which Cursor control plane, as whom" for hosted
3
+ * transports. The verb-lane files sink (`files-backends/cursor-hosted.ts`)
4
+ * and the domain-lane store API client (`store-api-client.ts`) both build on
5
+ * these, so the pod credential and base URL resolve identically on every
6
+ * wire — one place to change, no drift between lanes.
7
+ */
8
+ /**
9
+ * Same default as the hosted storage backend, inlined so these entrypoints
10
+ * do not import CLI code.
11
+ */
12
+ export declare const DEFAULT_CURSOR_EXTERNAL_API_URL = "https://api.cursor.com";
13
+ export interface CursorApiTransportOptions {
14
+ /** Control-plane base URL (default: `CURSOR_API_BASE_URL`, else api.cursor.com). */
15
+ baseUrl?: string;
16
+ /** Bearer credential (default: `CURSOR_API_KEY`). */
17
+ apiKey?: string;
18
+ /**
19
+ * Lazy credential, re-resolved on every call and preferred over
20
+ * {@link apiKey} — hosted freeze snapshots listen unsigned and bind the
21
+ * key file after serve start. Kept separate so `apiKey` stays a plain
22
+ * string.
23
+ */
24
+ resolveApiKey?: () => string | undefined;
25
+ /** Test seam; defaults to global fetch. */
26
+ fetch?: typeof fetch;
27
+ }
28
+ export declare function resolveCursorApiBaseUrl(options: CursorApiTransportOptions): string;
29
+ /**
30
+ * The pod credential is the whole authorization on every hosted wire: the
31
+ * API resolves the caller's deployment from it, so there is no second,
32
+ * narrower credential to manage. Fails loudly rather than defaulting —
33
+ * calling the control plane as nobody is worse than not calling.
34
+ */
35
+ export declare function resolveCursorApiKey(options: CursorApiTransportOptions): string;
36
+ export declare function resolveCursorApiFetch(options: CursorApiTransportOptions): typeof fetch;
37
+ //# sourceMappingURL=cursor-api-transport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cursor-api-transport.d.ts","sourceRoot":"","sources":["../../../src/internal/cursor/cursor-api-transport.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AACH,eAAO,MAAM,+BAA+B,2BAA2B,CAAC;AAExE,MAAM,WAAW,yBAAyB;IACxC,oFAAoF;IACpF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;IACzC,2CAA2C;IAC3C,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;CACtB;AAOD,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,yBAAyB,GACjC,MAAM,CAMR;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,yBAAyB,GACjC,MAAM,CASR;AAED,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,yBAAyB,GACjC,OAAO,KAAK,CAMd"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * The one resolution of "which Cursor control plane, as whom" for hosted
3
+ * transports. The verb-lane files sink (`files-backends/cursor-hosted.ts`)
4
+ * and the domain-lane store API client (`store-api-client.ts`) both build on
5
+ * these, so the pod credential and base URL resolve identically on every
6
+ * wire — one place to change, no drift between lanes.
7
+ */
8
+ /**
9
+ * Same default as the hosted storage backend, inlined so these entrypoints
10
+ * do not import CLI code.
11
+ */
12
+ export const DEFAULT_CURSOR_EXTERNAL_API_URL = "https://api.cursor.com";
13
+ function trimTrailingSlash(raw) {
14
+ const trimmed = raw.trim();
15
+ return trimmed.endsWith("/") ? trimmed.slice(0, -1) : trimmed;
16
+ }
17
+ export function resolveCursorApiBaseUrl(options) {
18
+ var _a, _b;
19
+ return trimTrailingSlash((_b = (_a = options.baseUrl) !== null && _a !== void 0 ? _a : process.env.CURSOR_API_BASE_URL) !== null && _b !== void 0 ? _b : DEFAULT_CURSOR_EXTERNAL_API_URL);
20
+ }
21
+ /**
22
+ * The pod credential is the whole authorization on every hosted wire: the
23
+ * API resolves the caller's deployment from it, so there is no second,
24
+ * narrower credential to manage. Fails loudly rather than defaulting —
25
+ * calling the control plane as nobody is worse than not calling.
26
+ */
27
+ export function resolveCursorApiKey(options) {
28
+ var _a, _b;
29
+ var _c;
30
+ const configured = (_c = (_a = options.resolveApiKey) === null || _a === void 0 ? void 0 : _a.call(options)) !== null && _c !== void 0 ? _c : options.apiKey;
31
+ const key = (_b = (configured !== null && configured !== void 0 ? configured : process.env.CURSOR_API_KEY)) === null || _b === void 0 ? void 0 : _b.trim();
32
+ if (key === undefined || key === "") {
33
+ throw new Error("Cursor hosted transport requires CURSOR_API_KEY (deployment pod credential on Cursor hosting)");
34
+ }
35
+ return key;
36
+ }
37
+ export function resolveCursorApiFetch(options) {
38
+ var _a;
39
+ const impl = (_a = options.fetch) !== null && _a !== void 0 ? _a : globalThis.fetch;
40
+ if (typeof impl !== "function") {
41
+ throw new Error("Cursor hosted transport requires fetch");
42
+ }
43
+ return impl;
44
+ }
@@ -16,6 +16,27 @@ export declare const DEFAULT_AGENT_SERVE_STORE_PROTOCOL_FILE = "/run/cursor/secr
16
16
  * directions.
17
17
  */
18
18
  export declare const AGENT_SERVE_FACTORY_FLUSH_PROTOCOL = "factory-flush-v1";
19
+ /**
20
+ * Pin value additionally enabling the domain-call lane
21
+ * (`POST /internal/agentsdk/store/api/<call>`), where the server owns the
22
+ * storage pattern for framework state — starting with `memory.append`. A
23
+ * strict superset of {@link AGENT_SERVE_FACTORY_FLUSH_PROTOCOL}: verbs keep
24
+ * riding the factory flush wire under this pin too. The same fail-safe
25
+ * applies in both directions — an unknown value keeps today's behavior, and
26
+ * re-pinning to `factory-flush-v1` turns the domain lane back off without a
27
+ * client change.
28
+ */
29
+ export declare const AGENT_SERVE_FACTORY_API_PROTOCOL = "factory-api-v1";
30
+ /**
31
+ * Does this pin select the factory flush wire for the store verbs? True for
32
+ * the flush pin and for the domain-API superset pin.
33
+ */
34
+ export declare function storeProtocolEnablesFactoryFlush(protocol: string | undefined): boolean;
35
+ /**
36
+ * Does this pin enable the domain-call lane (server-owned storage patterns)?
37
+ * Only its exact value does; everything else keeps the client-side patterns.
38
+ */
39
+ export declare function storeProtocolEnablesStoreApi(protocol: string | undefined): boolean;
19
40
  /** Deployment user-land store: env, then task-bind file. */
20
41
  export declare function resolveDeploymentStoreSourceIdSync(env?: NodeJS.ProcessEnv): string | undefined;
21
42
  /** Engine framework store: env, then task-bind file. */
@@ -1 +1 @@
1
- {"version":3,"file":"hosted-store-secrets.d.ts","sourceRoot":"","sources":["../../../src/internal/cursor/hosted-store-secrets.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,eAAO,MAAM,wCAAwC,oDACF,CAAC;AAEpD,eAAO,MAAM,kDAAkD,8DACF,CAAC;AAE9D,eAAO,MAAM,uCAAuC,mDACF,CAAC;AAEnD;;;;;GAKG;AACH,eAAO,MAAM,kCAAkC,qBAAqB,CAAC;AA8BrE,4DAA4D;AAC5D,wBAAgB,kCAAkC,CAChD,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,MAAM,GAAG,SAAS,CAUpB;AAED,wDAAwD;AACxD,wBAAgB,iCAAiC,CAC/C,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,MAAM,GAAG,SAAS,CAUpB;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,MAAM,GAAG,SAAS,CAUpB;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,uBAAuB,EAAE,MAAM,CAAC;IAChC,sBAAsB,EAAE,MAAM,CAAC;CAChC,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,kCAAkC,CAChD,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,uBAAuB,CAYzB"}
1
+ {"version":3,"file":"hosted-store-secrets.d.ts","sourceRoot":"","sources":["../../../src/internal/cursor/hosted-store-secrets.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,eAAO,MAAM,wCAAwC,oDACF,CAAC;AAEpD,eAAO,MAAM,kDAAkD,8DACF,CAAC;AAE9D,eAAO,MAAM,uCAAuC,mDACF,CAAC;AAEnD;;;;;GAKG;AACH,eAAO,MAAM,kCAAkC,qBAAqB,CAAC;AAErE;;;;;;;;;GASG;AACH,eAAO,MAAM,gCAAgC,mBAAmB,CAAC;AAEjE;;;GAGG;AACH,wBAAgB,gCAAgC,CAC9C,QAAQ,EAAE,MAAM,GAAG,SAAS,GAC3B,OAAO,CAKT;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,MAAM,GAAG,SAAS,GAC3B,OAAO,CAET;AA8BD,4DAA4D;AAC5D,wBAAgB,kCAAkC,CAChD,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,MAAM,GAAG,SAAS,CAUpB;AAED,wDAAwD;AACxD,wBAAgB,iCAAiC,CAC/C,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,MAAM,GAAG,SAAS,CAUpB;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,MAAM,GAAG,SAAS,CAUpB;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,uBAAuB,EAAE,MAAM,CAAC;IAChC,sBAAsB,EAAE,MAAM,CAAC;CAChC,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,kCAAkC,CAChD,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,uBAAuB,CAYzB"}
@@ -17,6 +17,32 @@ export const DEFAULT_AGENT_SERVE_STORE_PROTOCOL_FILE = "/run/cursor/secrets/AGEN
17
17
  * directions.
18
18
  */
19
19
  export const AGENT_SERVE_FACTORY_FLUSH_PROTOCOL = "factory-flush-v1";
20
+ /**
21
+ * Pin value additionally enabling the domain-call lane
22
+ * (`POST /internal/agentsdk/store/api/<call>`), where the server owns the
23
+ * storage pattern for framework state — starting with `memory.append`. A
24
+ * strict superset of {@link AGENT_SERVE_FACTORY_FLUSH_PROTOCOL}: verbs keep
25
+ * riding the factory flush wire under this pin too. The same fail-safe
26
+ * applies in both directions — an unknown value keeps today's behavior, and
27
+ * re-pinning to `factory-flush-v1` turns the domain lane back off without a
28
+ * client change.
29
+ */
30
+ export const AGENT_SERVE_FACTORY_API_PROTOCOL = "factory-api-v1";
31
+ /**
32
+ * Does this pin select the factory flush wire for the store verbs? True for
33
+ * the flush pin and for the domain-API superset pin.
34
+ */
35
+ export function storeProtocolEnablesFactoryFlush(protocol) {
36
+ return (protocol === AGENT_SERVE_FACTORY_FLUSH_PROTOCOL ||
37
+ protocol === AGENT_SERVE_FACTORY_API_PROTOCOL);
38
+ }
39
+ /**
40
+ * Does this pin enable the domain-call lane (server-owned storage patterns)?
41
+ * Only its exact value does; everything else keeps the client-side patterns.
42
+ */
43
+ export function storeProtocolEnablesStoreApi(protocol) {
44
+ return protocol === AGENT_SERVE_FACTORY_API_PROTOCOL;
45
+ }
20
46
  const STORE_SOURCE_ID_ENV = "AGENT_SERVE_STORE_SOURCE_ID";
21
47
  const FRAMEWORK_STORE_SOURCE_ID_ENV = "AGENT_SERVE_FRAMEWORK_STORE_SOURCE_ID";
22
48
  const STORE_SOURCE_ID_FILE_ENV = "AGENT_SERVE_STORE_SOURCE_ID_FILE";
@@ -0,0 +1,82 @@
1
+ /**
2
+ * The store API client: July's one gateway to the factory domain-call lane,
3
+ * `POST /internal/agentsdk/store/api/<call>`. This module owns the whole
4
+ * transport — base URL and deployment credential (the same resolution the
5
+ * files sink uses, via `cursor-api-transport.ts`), envelope encoding,
6
+ * response validation, typed error mapping, and the bounded backoff policy.
7
+ * Feature modules (`memory.ts`, later `session-run-log.ts`, …) call typed
8
+ * methods like {@link StoreApiClient.memoryAppend} and never hand-roll
9
+ * fetch; future domain calls (`sessionRun.report`, `startLog.flush`, …) are
10
+ * added here as new methods on this one client.
11
+ *
12
+ * The lane is selected per pod by the task-bound store protocol pin:
13
+ * {@link isStoreApiLaneEnabled} is true only under the exact
14
+ * `factory-api-v1` pin AND with a provisioned deployment store. The
15
+ * availability check is not redundant: the pin file is written by the hosted
16
+ * task bind, but a local-dev env var could name the pin without any store to
17
+ * serve reads — appending into the void. Both resolve lazily per call, so a
18
+ * pin bound after serve start takes effect without a restart.
19
+ */
20
+ import { type CursorApiTransportOptions } from "./cursor-api-transport.js";
21
+ export interface StoreApiClientOptions extends CursorApiTransportOptions {
22
+ /** Deployment store source id override (lane availability check). */
23
+ storeSourceId?: string;
24
+ /** Lazy store source id, preferred over {@link storeSourceId}. */
25
+ resolveStoreSourceId?: () => string | undefined;
26
+ /** Lazy store protocol pin (default: env, then the task-bound file). */
27
+ resolveStoreProtocol?: () => string | undefined;
28
+ /** Backoff sleep override (tests). */
29
+ sleep?: (ms: number) => Promise<void>;
30
+ /** Jitter source override (tests). Returns [0, 1). */
31
+ random?: () => number;
32
+ }
33
+ /**
34
+ * How one domain call failed, after the client's bounded retries:
35
+ *
36
+ * - `rejected` — the server (or the client's own pre-check) refused the
37
+ * payload with a typed 4xx. Deterministic; never retried.
38
+ * - `shed` — 429 from the per-deployment limiter or kill switch. Retried
39
+ * only within the small Retry-After bound below; retrying harder against
40
+ * a shed is exactly the stampede the domain lane exists to prevent.
41
+ * - `unavailable` — 5xx or a network failure, retried up to the attempt
42
+ * bound.
43
+ * - `bad_response` — a 2xx whose body failed the response schema; a
44
+ * contract break, not a transient, so never retried.
45
+ */
46
+ export type StoreApiFailureKind = "rejected" | "shed" | "unavailable" | "bad_response";
47
+ export declare class StoreApiCallError extends Error {
48
+ readonly kind: StoreApiFailureKind;
49
+ readonly status?: number | undefined;
50
+ constructor(kind: StoreApiFailureKind, message: string, status?: number | undefined);
51
+ }
52
+ /**
53
+ * Is the domain-call lane on for this pod? Exact pin match plus a
54
+ * provisioned deployment store; anything else keeps the client-side
55
+ * patterns, fail-safe in both directions like the flush pin itself.
56
+ */
57
+ export declare function isStoreApiLaneEnabled(options?: StoreApiClientOptions): boolean;
58
+ export type StoreApiClient = {
59
+ /**
60
+ * One `memory.append` domain call: the server appends the record to a
61
+ * server-owned journal shard. Resolves on success; throws
62
+ * {@link StoreApiCallError} after the bounded retries. The caller owns the
63
+ * failure policy (memory drops the record — appending is advisory).
64
+ */
65
+ memoryAppend(payload: {
66
+ agent: string;
67
+ record: Record<string, unknown>;
68
+ }): Promise<void>;
69
+ /**
70
+ * One `memory.read` domain call plus the presigned byte fetch: the server
71
+ * flushes the agent's pending append buffer (best-effort) and presigns
72
+ * the canonical journal; this method then downloads it. Undefined while
73
+ * the agent has no journal. Throws {@link StoreApiCallError} after the
74
+ * bounded retries — the caller owns the failure policy (hydration keeps
75
+ * the existing mirror).
76
+ */
77
+ memoryReadContent(payload: {
78
+ agent: string;
79
+ }): Promise<Uint8Array | undefined>;
80
+ };
81
+ export declare function createStoreApiClient(options?: StoreApiClientOptions): StoreApiClient;
82
+ //# sourceMappingURL=store-api-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store-api-client.d.ts","sourceRoot":"","sources":["../../../src/internal/cursor/store-api-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAYH,OAAO,EACL,KAAK,yBAAyB,EAI/B,MAAM,2BAA2B,CAAC;AAOnC,MAAM,WAAW,qBAAsB,SAAQ,yBAAyB;IACtE,qEAAqE;IACrE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kEAAkE;IAClE,oBAAoB,CAAC,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;IAChD,wEAAwE;IACxE,oBAAoB,CAAC,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;IAChD,sCAAsC;IACtC,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,sDAAsD;IACtD,MAAM,CAAC,EAAE,MAAM,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,mBAAmB,GAC3B,UAAU,GACV,MAAM,GACN,aAAa,GACb,cAAc,CAAC;AAEnB,qBAAa,iBAAkB,SAAQ,KAAK;IAExC,QAAQ,CAAC,IAAI,EAAE,mBAAmB;IAElC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM;IAH1B,YACW,IAAI,EAAE,mBAAmB,EAClC,OAAO,EAAE,MAAM,EACN,MAAM,CAAC,EAAE,MAAM,YAAA,EAIzB;CACF;AA6BD;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,OAAO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