@cursor/july 0.1.94 → 0.1.95

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 (209) hide show
  1. package/dist/channels/github/github-channel.d.ts.map +1 -1
  2. package/dist/channels/github/github-channel.js +14 -2
  3. package/dist/channels/github/types.d.ts +18 -3
  4. package/dist/channels/github/types.d.ts.map +1 -1
  5. package/dist/channels/origin/origin-channel.d.ts.map +1 -1
  6. package/dist/channels/origin/origin-channel.js +11 -3
  7. package/dist/channels/origin/origin-webhook.d.ts +11 -1
  8. package/dist/channels/origin/origin-webhook.d.ts.map +1 -1
  9. package/dist/channels/origin/origin-webhook.js +23 -3
  10. package/dist/channels/origin/types.d.ts +8 -0
  11. package/dist/channels/origin/types.d.ts.map +1 -1
  12. package/dist/channels/slack/pr-ref.d.ts +7 -1
  13. package/dist/channels/slack/pr-ref.d.ts.map +1 -1
  14. package/dist/channels/slack/pr-ref.js +42 -23
  15. package/dist/docs/404.html +2 -2
  16. package/dist/docs/ab.html +4 -4
  17. package/dist/docs/assets/{app.CFDEas4I.js → app.BBj0klBO.js} +1 -1
  18. package/dist/docs/assets/chunks/@localSearchIndexroot.oqPawjiD.js +1 -0
  19. package/dist/docs/assets/chunks/{VPLocalSearchBox.B1IIYpYS.js → VPLocalSearchBox.CUEXpL78.js} +1 -1
  20. package/dist/docs/assets/chunks/{theme.Ct4NSiLm.js → theme.DabmQnia.js} +2 -2
  21. package/dist/docs/assets/index.md.BoHaMdeZ.js +5 -0
  22. package/dist/docs/assets/{index.md.DRakGHFe.lean.js → index.md.BoHaMdeZ.lean.js} +1 -1
  23. package/dist/docs/assets/{reference_cli.md.Cw6_ICYG.js → reference_cli.md.BsMOxDvh.js} +3 -2
  24. package/dist/docs/assets/{reference_cli.md.Cw6_ICYG.lean.js → reference_cli.md.BsMOxDvh.lean.js} +1 -1
  25. package/dist/docs/assets/{reference_skills.md.8son6Hjm.js → reference_skills.md.BFW9retM.js} +3 -3
  26. package/dist/docs/assets/{templates_agentic-owners.md.DqtPdm6f.js → templates_agentic-owners.md.BZSH4N9z.js} +1 -1
  27. package/dist/docs/assets/{templates_demo.md.DhFcWN6j.js → templates_demo.md.BeQX9V3H.js} +1 -1
  28. package/dist/docs/assets/{templates_pr-autofixer.md.DU7dQpor.js → templates_pr-autofixer.md.x5zl6-GT.js} +2 -2
  29. package/dist/docs/assets/{templates_pr-autofixer.md.DU7dQpor.lean.js → templates_pr-autofixer.md.x5zl6-GT.lean.js} +1 -1
  30. package/dist/docs/assets/templates_security-help.md.C3Ny_Qr2.js +4 -0
  31. package/dist/docs/assets/templates_security-help.md.C3Ny_Qr2.lean.js +1 -0
  32. package/dist/docs/assets/{templates_security-reviewer.md.CTa7u_l1.js → templates_security-reviewer.md.lshxbCLK.js} +2 -2
  33. package/dist/docs/assets/{templates_security-reviewer.md.CTa7u_l1.lean.js → templates_security-reviewer.md.lshxbCLK.lean.js} +1 -1
  34. package/dist/docs/assets/{templates_triage.md.CVlpctKS.js → templates_triage.md.Co4UNzkZ.js} +3 -3
  35. package/dist/docs/assets/{templates_triage.md.CVlpctKS.lean.js → templates_triage.md.Co4UNzkZ.lean.js} +1 -1
  36. package/dist/docs/building-with-agents.html +4 -4
  37. package/dist/docs/concepts.html +4 -4
  38. package/dist/docs/deployment.html +4 -4
  39. package/dist/docs/evals.html +4 -4
  40. package/dist/docs/guides/agent-to-agent.html +4 -4
  41. package/dist/docs/guides/cloud-runtime.html +4 -4
  42. package/dist/docs/guides/convert-automation.html +4 -4
  43. package/dist/docs/guides/github.html +4 -4
  44. package/dist/docs/guides/human-in-the-loop.html +4 -4
  45. package/dist/docs/guides/mcp-oauth.html +4 -4
  46. package/dist/docs/guides/opentelemetry.html +4 -4
  47. package/dist/docs/guides/slack.html +4 -4
  48. package/dist/docs/guides/webhooks.html +4 -4
  49. package/dist/docs/hashmap.json +1 -1
  50. package/dist/docs/hillclimbing.html +4 -4
  51. package/dist/docs/index.html +6 -6
  52. package/dist/docs/index.md +3 -1
  53. package/dist/docs/llms-full.txt +90 -26
  54. package/dist/docs/llms.txt +1 -0
  55. package/dist/docs/quickstart.html +4 -4
  56. package/dist/docs/reference/agent-config.html +4 -4
  57. package/dist/docs/reference/artifacts.html +4 -4
  58. package/dist/docs/reference/channels.html +4 -4
  59. package/dist/docs/reference/cli.html +7 -6
  60. package/dist/docs/reference/cli.md +3 -1
  61. package/dist/docs/reference/connections.html +4 -4
  62. package/dist/docs/reference/hooks.html +4 -4
  63. package/dist/docs/reference/http-api.html +4 -4
  64. package/dist/docs/reference/instructions.html +4 -4
  65. package/dist/docs/reference/playground.html +4 -4
  66. package/dist/docs/reference/project-layout.html +4 -4
  67. package/dist/docs/reference/prompt.html +4 -4
  68. package/dist/docs/reference/schedules.html +4 -4
  69. package/dist/docs/reference/sessions.html +4 -4
  70. package/dist/docs/reference/skills.html +7 -7
  71. package/dist/docs/reference/subagents.html +4 -4
  72. package/dist/docs/reference/tools.html +4 -4
  73. package/dist/docs/scaffolding-agents.html +4 -4
  74. package/dist/docs/storage.html +4 -4
  75. package/dist/docs/templates/agentic-owners.html +7 -7
  76. package/dist/docs/templates/agentic-owners.md +1 -1
  77. package/dist/docs/templates/demo.html +6 -6
  78. package/dist/docs/templates/demo.md +3 -2
  79. package/dist/docs/templates/pr-autofixer.html +6 -6
  80. package/dist/docs/templates/pr-autofixer.md +7 -13
  81. package/dist/docs/templates/security-help.html +30 -0
  82. package/dist/docs/templates/security-help.md +65 -0
  83. package/dist/docs/templates/security-reviewer.html +6 -6
  84. package/dist/docs/templates/security-reviewer.md +1 -2
  85. package/dist/docs/templates/triage.html +7 -7
  86. package/dist/docs/templates/triage.md +2 -6
  87. package/dist/docs/troubleshooting.html +4 -4
  88. package/dist/files-backends/cursor-hosted.d.ts +6 -2
  89. package/dist/files-backends/cursor-hosted.d.ts.map +1 -1
  90. package/dist/files-backends/cursor-hosted.js +2 -2
  91. package/dist/files.d.ts +2 -0
  92. package/dist/files.d.ts.map +1 -1
  93. package/dist/files.js +5 -0
  94. package/dist/internal/cli-deploy.d.ts.map +1 -1
  95. package/dist/internal/cli-deploy.js +135 -6
  96. package/dist/internal/conversation-mirror.d.ts +82 -0
  97. package/dist/internal/conversation-mirror.d.ts.map +1 -0
  98. package/dist/internal/conversation-mirror.js +251 -0
  99. package/dist/internal/deferred-channel-session.d.ts +20 -0
  100. package/dist/internal/deferred-channel-session.d.ts.map +1 -0
  101. package/dist/internal/deferred-channel-session.js +62 -0
  102. package/dist/internal/deploy-client.d.ts +13 -1
  103. package/dist/internal/deploy-client.d.ts.map +1 -1
  104. package/dist/internal/deploy-client.js +11 -1
  105. package/dist/internal/deploy-manifest.d.ts.map +1 -1
  106. package/dist/internal/deploy-manifest.js +11 -5
  107. package/dist/internal/discovery.d.ts.map +1 -1
  108. package/dist/internal/discovery.js +22 -2
  109. package/dist/internal/framework-storage-selection.d.ts +32 -16
  110. package/dist/internal/framework-storage-selection.d.ts.map +1 -1
  111. package/dist/internal/framework-storage-selection.js +51 -17
  112. package/dist/internal/hosted-admission-context.d.ts +20 -0
  113. package/dist/internal/hosted-admission-context.d.ts.map +1 -0
  114. package/dist/internal/hosted-admission-context.js +31 -0
  115. package/dist/internal/hosted-delivery-protocol.d.ts +5 -0
  116. package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
  117. package/dist/internal/hosted-delivery-protocol.js +33 -1
  118. package/dist/internal/hosted-delivery.d.ts +4 -2
  119. package/dist/internal/hosted-delivery.d.ts.map +1 -1
  120. package/dist/internal/hosted-delivery.js +75 -35
  121. package/dist/internal/hosted-managed-automation.d.ts +30 -0
  122. package/dist/internal/hosted-managed-automation.d.ts.map +1 -0
  123. package/dist/internal/hosted-managed-automation.js +58 -0
  124. package/dist/internal/review-comments.d.ts.map +1 -1
  125. package/dist/internal/review-comments.js +10 -98
  126. package/dist/internal/scm/pr-url.d.ts +14 -0
  127. package/dist/internal/scm/pr-url.d.ts.map +1 -0
  128. package/dist/internal/scm/pr-url.js +65 -0
  129. package/dist/internal/sdk-runner.d.ts +14 -0
  130. package/dist/internal/sdk-runner.d.ts.map +1 -1
  131. package/dist/internal/sdk-runner.js +41 -2
  132. package/dist/internal/server.d.ts.map +1 -1
  133. package/dist/internal/server.js +10 -2
  134. package/dist/internal/session-engine.d.ts.map +1 -1
  135. package/dist/internal/session-engine.js +9 -0
  136. package/dist/playground/assets/index-CF7hUDnQ.css +1 -0
  137. package/dist/playground/assets/{index-B3JCyigB.js → index-CZA1uEWA.js} +48 -48
  138. package/dist/playground/index.html +2 -2
  139. package/dist/storage-backends/cursor-hosted.d.ts +7 -2
  140. package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
  141. package/dist/storage-backends/cursor-hosted.js +2 -2
  142. package/docs/README.md +3 -1
  143. package/docs/reference/cli.md +3 -1
  144. package/docs/templates/agentic-owners.md +1 -1
  145. package/docs/templates/demo.md +3 -2
  146. package/docs/templates/pr-autofixer.md +7 -13
  147. package/docs/templates/security-help.md +70 -0
  148. package/docs/templates/security-reviewer.md +1 -2
  149. package/docs/templates/triage.md +2 -6
  150. package/package.json +1 -1
  151. package/src/channels/github/github-channel.ts +23 -8
  152. package/src/channels/github/types.ts +19 -2
  153. package/src/channels/origin/origin-channel.ts +13 -1
  154. package/src/channels/origin/origin-webhook.ts +27 -3
  155. package/src/channels/origin/types.ts +8 -0
  156. package/src/channels/slack/pr-ref.ts +56 -25
  157. package/src/files-backends/cursor-hosted.ts +9 -3
  158. package/src/files.ts +11 -0
  159. package/src/internal/cli-deploy.ts +171 -7
  160. package/src/internal/conversation-mirror.ts +330 -0
  161. package/src/internal/deferred-channel-session.ts +61 -0
  162. package/src/internal/deploy-client.ts +24 -1
  163. package/src/internal/deploy-manifest.ts +10 -5
  164. package/src/internal/discovery.ts +25 -2
  165. package/src/internal/framework-storage-selection.ts +61 -19
  166. package/src/internal/hosted-admission-context.ts +37 -0
  167. package/src/internal/hosted-delivery-protocol.ts +44 -1
  168. package/src/internal/hosted-delivery.ts +95 -40
  169. package/src/internal/hosted-managed-automation.ts +72 -0
  170. package/src/internal/review-comments.ts +10 -113
  171. package/src/internal/scm/pr-url.ts +95 -0
  172. package/src/internal/sdk-runner.ts +57 -2
  173. package/src/internal/server.ts +10 -0
  174. package/src/internal/session-engine.ts +12 -0
  175. package/src/storage-backends/cursor-hosted.ts +10 -3
  176. package/templates/agentic-owners/README.md +1 -1
  177. package/templates/agentic-owners/agent/agent.ts +0 -10
  178. package/templates/agentic-owners/agent/channels/github.ts +5 -14
  179. package/templates/agentic-owners/agent/lib/config.ts +0 -8
  180. package/templates/agentic-owners/agent/lib/review.ts +2 -15
  181. package/templates/agentic-owners/agent/tools/record_review.ts +2 -4
  182. package/templates/demo/agent/agent.ts +0 -10
  183. package/templates/pr-autofixer/README.md +0 -2
  184. package/templates/pr-autofixer/agent/agent.ts +0 -11
  185. package/templates/pr-autofixer/agent/channels/slack.ts +0 -7
  186. package/templates/pr-autofixer/agent/lib/pr-state.ts +5 -17
  187. package/templates/pr-autofixer/agent/lib/repos.ts +0 -1
  188. package/templates/security-help/README.md +2 -2
  189. package/templates/security-help/agent/agent.ts +1 -2
  190. package/templates/security-help/agent/channels/slack.ts +0 -3
  191. package/templates/security-help/agent/instructions.md +9 -10
  192. package/templates/security-help/agent/skills/access-request.md +1 -1
  193. package/templates/security-help/agent/skills/faq.md +31 -0
  194. package/templates/security-help/agent/skills/security-playbooks.md +1 -1
  195. package/templates/security-help/package.json +1 -2
  196. package/templates/security-reviewer/agent/agent.ts +0 -10
  197. package/templates/triage/agent/agent.ts +0 -10
  198. package/templates/triage/agent/channels/queue.ts +1 -1
  199. package/templates/triage/agent/channels/webhook.ts +1 -3
  200. package/dist/docs/assets/chunks/@localSearchIndexroot.DU3U2Ij2.js +0 -1
  201. package/dist/docs/assets/index.md.DRakGHFe.js +0 -5
  202. package/dist/playground/assets/index-D9N7-q97.css +0 -1
  203. package/templates/security-help/agent/knowledge/faq/approvals.md +0 -5
  204. package/templates/security-help/agent/knowledge/faq/channels.md +0 -6
  205. package/templates/security-help/agent/knowledge/faq/phishing.md +0 -10
  206. package/templates/security-help/agent/skills/security-first-pass.md +0 -15
  207. /package/dist/docs/assets/{reference_skills.md.8son6Hjm.lean.js → reference_skills.md.BFW9retM.lean.js} +0 -0
  208. /package/dist/docs/assets/{templates_agentic-owners.md.DqtPdm6f.lean.js → templates_agentic-owners.md.BZSH4N9z.lean.js} +0 -0
  209. /package/dist/docs/assets/{templates_demo.md.DhFcWN6j.lean.js → templates_demo.md.BeQX9V3H.lean.js} +0 -0
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Durable mirror for the SDK runner's conversation store.
3
+ *
4
+ * The Cursor SDK keeps each local conversation in SQLite under the engine's
5
+ * state root (`runner/index.db` + `runner/agents/agent-<hash>/store.db`).
6
+ * That disk dies with the pod: on architecture v2, session **records** and
7
+ * event chunks survive replacement through the control-plane storage mirror
8
+ * (framework-storage-selection.ts), but the conversation itself was never
9
+ * hydrated anywhere — a replacement pod resumed every thread as a fresh
10
+ * conversation.
11
+ *
12
+ * This module mirrors the conversation through the SDK's own store APIs —
13
+ * the agent document (which carries `sdkMetadata.blobEncryptionKey`, without
14
+ * which the checkpoint blobs cannot be decrypted) plus its content-addressed
15
+ * checkpoint blobs — into the deployment's shared file storage. On
16
+ * Cursor-managed hosting that is the Agent Store reached over
17
+ * `/v0/agent-serve-files` presigned URLs: the store is **not mounted** as a
18
+ * filesystem in the engine VM (the FUSE mount at
19
+ * {@link DEPLOYMENT_STORE_MOUNT_PATH} exists only on cloud-runtime VMs), so
20
+ * the mirror moves bytes through the {@link FileSink} contract instead.
21
+ *
22
+ * Going through the store APIs rather than copying `store.db` files sidesteps
23
+ * WAL consistency and the shared `index.db` (per-session raw copies would
24
+ * clobber other sessions' rows); checkpoint blobs are content-addressed, so
25
+ * repeat persists upload only what is new.
26
+ *
27
+ * Timing: the runner hydrates before `Agent.resume` (so a follow-up landing
28
+ * on a fresh pod — including a v2 hosted-execution delivery — finds the
29
+ * conversation before the turn runs) and persists after each local turn
30
+ * settles, **awaited**, because a hosted pod can be parked immediately after
31
+ * the execution reply.
32
+ *
33
+ * Run rows and run events are deliberately not mirrored: they are per-pod
34
+ * bookkeeping (turn numbers, stream offsets), and the durable session event
35
+ * stream already lives in the control-plane storage mirror.
36
+ */
37
+ import type { LocalAgentStore } from "@cursor/sdk";
38
+ import { type FileSink } from "../files.js";
39
+ import type { AgentProject } from "../types.js";
40
+ /**
41
+ * Persist/restore one SDK conversation between a {@link LocalAgentStore} and
42
+ * durable file storage. Implemented by {@link createConversationMirror};
43
+ * consumed by the SDK runner.
44
+ */
45
+ export interface ConversationMirror {
46
+ /**
47
+ * Restore `sdkAgentId`'s conversation into `store` when the store does not
48
+ * already hold it. Resolves `true` when a conversation was restored,
49
+ * `false` on a definitive miss (never persisted, or already local — the
50
+ * caller falls through to its fresh-conversation path). A sink **failure**
51
+ * propagates: an outage must fail the turn (retryable) rather than
52
+ * silently fork the thread onto a fresh conversation.
53
+ */
54
+ hydrate(store: LocalAgentStore, sdkAgentId: string): Promise<boolean>;
55
+ /**
56
+ * Mirror `sdkAgentId`'s conversation from `store` to the sink
57
+ * (last write wins). No-op until the conversation has a checkpoint.
58
+ */
59
+ persist(store: LocalAgentStore, sdkAgentId: string): Promise<void>;
60
+ }
61
+ export interface CreateConversationMirrorOptions {
62
+ sink: FileSink;
63
+ /** Agent name baked into every minted key. */
64
+ agentName: string;
65
+ logger?: (line: string) => void;
66
+ }
67
+ /** Build a {@link ConversationMirror} over a {@link FileSink}. */
68
+ export declare function createConversationMirror(options: CreateConversationMirrorOptions): ConversationMirror;
69
+ /**
70
+ * Whether (and over which sink) this serve process mirrors conversations.
71
+ *
72
+ * Selected for architecture-v2 agents on Cursor-managed hosting — the same
73
+ * generation signal as framework-storage-selection.ts, plus a provisioned
74
+ * deployment file store. Self-hosted v2 keeps everything on the state root
75
+ * (the operator owns the disk), and v1 keeps today's behavior while it runs.
76
+ */
77
+ export declare function selectConversationMirror(input: {
78
+ project: AgentProject;
79
+ logger?: (line: string) => void;
80
+ env?: Record<string, string | undefined>;
81
+ }): ConversationMirror | undefined;
82
+ //# sourceMappingURL=conversation-mirror.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversation-mirror.d.ts","sourceRoot":"","sources":["../../src/internal/conversation-mirror.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,KAAK,EAAsB,eAAe,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAK5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAKhD;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;;;;OAOG;IACH,OAAO,CAAC,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACtE;;;OAGG;IACH,OAAO,CAAC,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACpE;AAYD,MAAM,WAAW,+BAA+B;IAC9C,IAAI,EAAE,QAAQ,CAAC;IACf,8CAA8C;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC;AAED,kEAAkE;AAClE,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,+BAA+B,GACvC,kBAAkB,CAwJpB;AAsDD;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE;IAC9C,OAAO,EAAE,YAAY,CAAC;IACtB,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;CAC1C,GAAG,kBAAkB,GAAG,SAAS,CAqBjC"}
@@ -0,0 +1,251 @@
1
+ /**
2
+ * Durable mirror for the SDK runner's conversation store.
3
+ *
4
+ * The Cursor SDK keeps each local conversation in SQLite under the engine's
5
+ * state root (`runner/index.db` + `runner/agents/agent-<hash>/store.db`).
6
+ * That disk dies with the pod: on architecture v2, session **records** and
7
+ * event chunks survive replacement through the control-plane storage mirror
8
+ * (framework-storage-selection.ts), but the conversation itself was never
9
+ * hydrated anywhere — a replacement pod resumed every thread as a fresh
10
+ * conversation.
11
+ *
12
+ * This module mirrors the conversation through the SDK's own store APIs —
13
+ * the agent document (which carries `sdkMetadata.blobEncryptionKey`, without
14
+ * which the checkpoint blobs cannot be decrypted) plus its content-addressed
15
+ * checkpoint blobs — into the deployment's shared file storage. On
16
+ * Cursor-managed hosting that is the Agent Store reached over
17
+ * `/v0/agent-serve-files` presigned URLs: the store is **not mounted** as a
18
+ * filesystem in the engine VM (the FUSE mount at
19
+ * {@link DEPLOYMENT_STORE_MOUNT_PATH} exists only on cloud-runtime VMs), so
20
+ * the mirror moves bytes through the {@link FileSink} contract instead.
21
+ *
22
+ * Going through the store APIs rather than copying `store.db` files sidesteps
23
+ * WAL consistency and the shared `index.db` (per-session raw copies would
24
+ * clobber other sessions' rows); checkpoint blobs are content-addressed, so
25
+ * repeat persists upload only what is new.
26
+ *
27
+ * Timing: the runner hydrates before `Agent.resume` (so a follow-up landing
28
+ * on a fresh pod — including a v2 hosted-execution delivery — finds the
29
+ * conversation before the turn runs) and persists after each local turn
30
+ * settles, **awaited**, because a hosted pod can be parked immediately after
31
+ * the execution reply.
32
+ *
33
+ * Run rows and run events are deliberately not mirrored: they are per-pod
34
+ * bookkeeping (turn numbers, stream offsets), and the durable session event
35
+ * stream already lives in the control-plane storage mirror.
36
+ */
37
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
38
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
39
+ return new (P || (P = Promise))(function (resolve, reject) {
40
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
41
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
42
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
43
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
44
+ });
45
+ };
46
+ import { agentStoreKeys } from "../files.js";
47
+ import { cursorHostedFiles, isCursorHostedFilesAvailable, } from "../files-backends/cursor-hosted.js";
48
+ import { resolveApiKeySync } from "./cursor/credentials.js";
49
+ import { AGENT_SERVE_GENERATION_ENV_VAR } from "./cursor-relay-core.js";
50
+ import { describeError } from "./describe-error.js";
51
+ /** Build a {@link ConversationMirror} over a {@link FileSink}. */
52
+ export function createConversationMirror(options) {
53
+ var _a;
54
+ const { sink, agentName } = options;
55
+ const logger = (_a = options.logger) !== null && _a !== void 0 ? _a : (() => { });
56
+ /** Blob ids known to be in the sink, per SDK agent id (upload dedupe). */
57
+ const mirrored = new Map();
58
+ /**
59
+ * Per-conversation serialization so a persist cannot interleave with a
60
+ * hydrate (or another persist) for the same conversation.
61
+ */
62
+ const chains = new Map();
63
+ function serialize(sdkAgentId, run) {
64
+ var _a;
65
+ const previous = (_a = chains.get(sdkAgentId)) !== null && _a !== void 0 ? _a : Promise.resolve();
66
+ const next = previous.then(run, run);
67
+ chains.set(sdkAgentId, next.catch(() => { }));
68
+ return next;
69
+ }
70
+ function mirroredBlobIds(sdkAgentId) {
71
+ return __awaiter(this, void 0, void 0, function* () {
72
+ var _a;
73
+ const cached = mirrored.get(sdkAgentId);
74
+ if (cached !== undefined) {
75
+ return cached;
76
+ }
77
+ // Seed from the previous manifest so a fresh pod does not re-upload the
78
+ // whole history on its first persist. A miss (or parse failure) seeds
79
+ // empty — re-uploading is wasteful, never wrong.
80
+ const seeded = new Set();
81
+ try {
82
+ const manifest = yield readManifest(sink, agentName, sdkAgentId);
83
+ for (const blobId of (_a = manifest === null || manifest === void 0 ? void 0 : manifest.blobIds) !== null && _a !== void 0 ? _a : []) {
84
+ seeded.add(blobId);
85
+ }
86
+ }
87
+ catch (error) {
88
+ logger(`[agent-sdk] conversation mirror: could not read the prior manifest for ${sdkAgentId} (${describeError(error)}); re-uploading blobs`);
89
+ }
90
+ mirrored.set(sdkAgentId, seeded);
91
+ return seeded;
92
+ });
93
+ }
94
+ return {
95
+ persist(store, sdkAgentId) {
96
+ return serialize(sdkAgentId, () => __awaiter(this, void 0, void 0, function* () {
97
+ const document = yield store.agents.get({ agentId: sdkAgentId });
98
+ if (document === null || document.latestCheckpoint == null) {
99
+ // Nothing restorable yet (no conversation, or no checkpoint).
100
+ return;
101
+ }
102
+ const uploaded = yield mirroredBlobIds(sdkAgentId);
103
+ const blobIds = yield listCheckpointBlobIds(store, sdkAgentId);
104
+ for (const blobId of blobIds) {
105
+ if (uploaded.has(blobId)) {
106
+ continue;
107
+ }
108
+ const bytes = yield store.checkpoints.get({
109
+ agentId: sdkAgentId,
110
+ blobId,
111
+ });
112
+ if (bytes === null) {
113
+ continue;
114
+ }
115
+ yield sink.put(agentStoreKeys.conversationBlob(agentName, sdkAgentId, blobId), bytes);
116
+ // Content-addressed: once in the sink, never re-uploaded.
117
+ uploaded.add(blobId);
118
+ }
119
+ const manifest = {
120
+ v: 1,
121
+ // The referenced run is pod-local bookkeeping and is not mirrored;
122
+ // a hydrated store must not point at a run row it does not hold.
123
+ agent: Object.assign(Object.assign({}, document), { activeRunId: null }),
124
+ blobIds: blobIds.filter((blobId) => uploaded.has(blobId)),
125
+ persistedAtMs: Date.now(),
126
+ };
127
+ // Manifest last: it only ever references blobs already uploaded.
128
+ yield sink.put(agentStoreKeys.conversationManifest(agentName, sdkAgentId), new TextEncoder().encode(JSON.stringify(manifest)));
129
+ }));
130
+ },
131
+ hydrate(store, sdkAgentId) {
132
+ return serialize(sdkAgentId, () => __awaiter(this, void 0, void 0, function* () {
133
+ var _a;
134
+ const existing = yield store.agents.get({ agentId: sdkAgentId });
135
+ if (existing !== null) {
136
+ return false;
137
+ }
138
+ const manifest = yield readManifest(sink, agentName, sdkAgentId);
139
+ if (manifest === undefined) {
140
+ return false;
141
+ }
142
+ const rootBlobId = (_a = manifest.agent.latestCheckpoint) === null || _a === void 0 ? void 0 : _a.rootBlobId;
143
+ const restored = new Set();
144
+ for (const blobId of manifest.blobIds) {
145
+ const body = yield sink.get(agentStoreKeys.conversationBlob(agentName, sdkAgentId, blobId));
146
+ const bytes = body === undefined
147
+ ? undefined
148
+ : body instanceof Uint8Array
149
+ ? body
150
+ : body.body;
151
+ if (bytes === undefined) {
152
+ // Definitive absence (never uploaded, or deleted). A missing
153
+ // root blob makes the conversation unrestorable — fall through
154
+ // to the caller's fresh-conversation path rather than creating
155
+ // an agent row whose checkpoint cannot load.
156
+ if (blobId === rootBlobId) {
157
+ logger(`[agent-sdk] conversation mirror: the root checkpoint blob for ${sdkAgentId} is missing from the sink; treating the conversation as unrestorable`);
158
+ return false;
159
+ }
160
+ continue;
161
+ }
162
+ if ((yield store.checkpoints.get({ agentId: sdkAgentId, blobId })) ===
163
+ null) {
164
+ yield store.checkpoints.create({
165
+ agentId: sdkAgentId,
166
+ blobId,
167
+ data: bytes,
168
+ });
169
+ }
170
+ restored.add(blobId);
171
+ }
172
+ if (rootBlobId !== undefined && !restored.has(rootBlobId)) {
173
+ logger(`[agent-sdk] conversation mirror: the manifest for ${sdkAgentId} does not list its root checkpoint blob; treating the conversation as unrestorable`);
174
+ return false;
175
+ }
176
+ yield store.agents.create({
177
+ agent: Object.assign(Object.assign({}, manifest.agent), { activeRunId: null }),
178
+ });
179
+ mirrored.set(sdkAgentId, restored);
180
+ logger(`[agent-sdk] conversation mirror: restored the conversation for ${sdkAgentId} (${restored.size} checkpoint blob(s))`);
181
+ return true;
182
+ }));
183
+ },
184
+ };
185
+ }
186
+ function readManifest(sink, agentName, sdkAgentId) {
187
+ return __awaiter(this, void 0, void 0, function* () {
188
+ const body = yield sink.get(agentStoreKeys.conversationManifest(agentName, sdkAgentId));
189
+ if (body === undefined) {
190
+ return undefined;
191
+ }
192
+ const bytes = body instanceof Uint8Array ? body : body.body;
193
+ const parsed = JSON.parse(new TextDecoder().decode(bytes));
194
+ if (parsed === null ||
195
+ typeof parsed !== "object" ||
196
+ parsed.v !== 1) {
197
+ throw new Error(`conversation mirror: unsupported manifest for ${sdkAgentId}`);
198
+ }
199
+ const manifest = parsed;
200
+ if (manifest.agent === null ||
201
+ typeof manifest.agent !== "object" ||
202
+ manifest.agent.agentId !== sdkAgentId ||
203
+ !Array.isArray(manifest.blobIds)) {
204
+ throw new Error(`conversation mirror: malformed manifest for ${sdkAgentId}`);
205
+ }
206
+ return manifest;
207
+ });
208
+ }
209
+ function listCheckpointBlobIds(store, sdkAgentId) {
210
+ return __awaiter(this, void 0, void 0, function* () {
211
+ const blobIds = [];
212
+ let cursor;
213
+ do {
214
+ const page = yield store.checkpoints.list({
215
+ filter: { agentIds: [sdkAgentId], cursor },
216
+ });
217
+ blobIds.push(...page.items);
218
+ cursor = page.nextCursor;
219
+ } while (cursor !== undefined);
220
+ return blobIds;
221
+ });
222
+ }
223
+ /**
224
+ * Whether (and over which sink) this serve process mirrors conversations.
225
+ *
226
+ * Selected for architecture-v2 agents on Cursor-managed hosting — the same
227
+ * generation signal as framework-storage-selection.ts, plus a provisioned
228
+ * deployment file store. Self-hosted v2 keeps everything on the state root
229
+ * (the operator owns the disk), and v1 keeps today's behavior while it runs.
230
+ */
231
+ export function selectConversationMirror(input) {
232
+ var _a;
233
+ if (input.project.agent.architecture !== "v2") {
234
+ return undefined;
235
+ }
236
+ const env = (_a = input.env) !== null && _a !== void 0 ? _a : process.env;
237
+ if (env[AGENT_SERVE_GENERATION_ENV_VAR] === undefined ||
238
+ !isCursorHostedFilesAvailable(env)) {
239
+ return undefined;
240
+ }
241
+ return createConversationMirror({
242
+ sink: cursorHostedFiles({
243
+ // Full chain (env → key file → stored login): frozen engines listen
244
+ // unsigned and bind CURSOR_API_KEY_FILE at task time, after this sink
245
+ // is constructed.
246
+ apiKey: () => { var _a; return (_a = resolveApiKeySync()) === null || _a === void 0 ? void 0 : _a.apiKey; },
247
+ }),
248
+ agentName: input.project.name,
249
+ logger: input.logger,
250
+ });
251
+ }
@@ -0,0 +1,20 @@
1
+ import type { ChannelSession } from "../types.js";
2
+ /**
3
+ * Authored code touched a member of the deferred handle that needs the live
4
+ * session. This is deterministic (the session never exists during admission),
5
+ * so the admission route surfaces it as a non-retryable 422 rather than a
6
+ * retryable failure.
7
+ */
8
+ export declare class DeferredChannelSessionError extends Error {
9
+ constructor(member: string);
10
+ }
11
+ /**
12
+ * Inert `ChannelSession` returned by the hosted-admission `send` stub: every
13
+ * member fails loudly via {@link DeferredChannelSessionError}. Caveat: new
14
+ * OPTIONAL members added to `ChannelSession` slip through this factory
15
+ * silently (reads return `undefined`) until a throwing getter is added here.
16
+ */
17
+ export declare function createDeferredChannelSession(): ChannelSession;
18
+ /** True when `send()` returned a hosted-admission capture handle. */
19
+ export declare function isDeferredChannelSession(session: ChannelSession): boolean;
20
+ //# sourceMappingURL=deferred-channel-session.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deferred-channel-session.d.ts","sourceRoot":"","sources":["../../src/internal/deferred-channel-session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAIlD;;;;;GAKG;AACH,qBAAa,2BAA4B,SAAQ,KAAK;IACpD,YAAY,MAAM,EAAE,MAAM,EAQzB;CACF;AAMD;;;;;GAKG;AACH,wBAAgB,4BAA4B,IAAI,cAAc,CAuB7D;AAED,qEAAqE;AACrE,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAEzE"}
@@ -0,0 +1,62 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ const deferredSessions = new WeakSet();
11
+ /**
12
+ * Authored code touched a member of the deferred handle that needs the live
13
+ * session. This is deterministic (the session never exists during admission),
14
+ * so the admission route surfaces it as a non-retryable 422 rather than a
15
+ * retryable failure.
16
+ */
17
+ export class DeferredChannelSessionError extends Error {
18
+ constructor(member) {
19
+ super(`ChannelSession.${member} is not available on a send() captured ` +
20
+ "during hosted admission: the control plane allocates the session " +
21
+ "(and runs the turn) only after this delivery is acknowledged, so " +
22
+ "the handle cannot observe it yet. Move work that needs the live " +
23
+ "session into the session turn instead.");
24
+ }
25
+ }
26
+ function unavailable(member) {
27
+ throw new DeferredChannelSessionError(member);
28
+ }
29
+ /**
30
+ * Inert `ChannelSession` returned by the hosted-admission `send` stub: every
31
+ * member fails loudly via {@link DeferredChannelSessionError}. Caveat: new
32
+ * OPTIONAL members added to `ChannelSession` slip through this factory
33
+ * silently (reads return `undefined`) until a throwing getter is added here.
34
+ */
35
+ export function createDeferredChannelSession() {
36
+ const session = {
37
+ get id() {
38
+ return unavailable("id");
39
+ },
40
+ get continuationToken() {
41
+ return unavailable("continuationToken");
42
+ },
43
+ get isNew() {
44
+ return unavailable("isNew");
45
+ },
46
+ get coalesced() {
47
+ return unavailable("coalesced");
48
+ },
49
+ get info() {
50
+ return unavailable("info");
51
+ },
52
+ getEventStream: () => __awaiter(this, void 0, void 0, function* () { return unavailable("getEventStream()"); }),
53
+ waitForCompletion: () => __awaiter(this, void 0, void 0, function* () { return unavailable("waitForCompletion()"); }),
54
+ setContinuationToken: () => __awaiter(this, void 0, void 0, function* () { return unavailable("setContinuationToken()"); }),
55
+ };
56
+ deferredSessions.add(session);
57
+ return session;
58
+ }
59
+ /** True when `send()` returned a hosted-admission capture handle. */
60
+ export function isDeferredChannelSession(session) {
61
+ return deferredSessions.has(session);
62
+ }
@@ -142,6 +142,15 @@ export interface AgentkitDeployAccepted {
142
142
  releaseId: string;
143
143
  status: string;
144
144
  }
145
+ /**
146
+ * One release component of a v2 multi-component deploy: a stable key (the
147
+ * child agent's slug) plus that agent's directory relative to the repo
148
+ * root.
149
+ */
150
+ export interface AgentkitDeployComponent {
151
+ componentKey: string;
152
+ agentPath?: string;
153
+ }
145
154
  /** Customer-visible v2 deploy status (`GET /internal/agentkit/deployments/:slug`). */
146
155
  export type AgentkitCustomerStatus = "pending" | "deploying" | "running" | "failed" | "stopped";
147
156
  export type AgentkitDeployProgress = "queued" | "creating" | "building" | "starting" | "finalizing" | "running" | "failed" | "stopped";
@@ -213,7 +222,9 @@ export declare class AgentServeDeployClient {
213
222
  /**
214
223
  * Create or redeploy onto the v2 control plane
215
224
  * (`POST /internal/agentkit/deployments`). 202 means accepted; poll
216
- * {@link getAgentkitDeploy} until a terminal status.
225
+ * {@link getAgentkitDeploy} until a terminal status. `components` deploys
226
+ * one application with several release components (one per agent
227
+ * directory); it is mutually exclusive with `agentPath`.
217
228
  */
218
229
  deployAgentkit(args: {
219
230
  teamId: number;
@@ -221,6 +232,7 @@ export declare class AgentServeDeployClient {
221
232
  gitRepoUrl: string;
222
233
  gitRef?: string;
223
234
  agentPath?: string;
235
+ components?: AgentkitDeployComponent[];
224
236
  repositories?: string[];
225
237
  }): Promise<AgentkitDeployAccepted>;
226
238
  getAgentkitDeploy(args: {
@@ -1 +1 @@
1
- {"version":3,"file":"deploy-client.d.ts","sourceRoot":"","sources":["../../src/internal/deploy-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAUH,MAAM,MAAM,gBAAgB,GACxB,SAAS,GACT,WAAW,GACX,SAAS,GACT,UAAU,GACV,QAAQ,GACR,UAAU,GACV,SAAS,GACT,UAAU,CAAC;AAEf,sEAAsE;AACtE,MAAM,M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IAED;;;;OAIG;IACG,mBAAmB,CAAC,IAAI,EAAE;QAC9B,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;KACd,GAAG,OAAO,CAAC,MAAM,CAAC,CAOlB;IAED;;;;;OAKG;IACG,gBAAgB,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAsBxE;IAED,4DAA4D;IAC5D,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEpC;IAED;;;;;OAKG;IACH,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAElD;YAEa,OAAO;CAyCtB"}
@@ -302,14 +302,23 @@ export class AgentServeDeployClient {
302
302
  /**
303
303
  * Create or redeploy onto the v2 control plane
304
304
  * (`POST /internal/agentkit/deployments`). 202 means accepted; poll
305
- * {@link getAgentkitDeploy} until a terminal status.
305
+ * {@link getAgentkitDeploy} until a terminal status. `components` deploys
306
+ * one application with several release components (one per agent
307
+ * directory); it is mutually exclusive with `agentPath`.
306
308
  */
307
309
  deployAgentkit(args) {
308
310
  return __awaiter(this, void 0, void 0, function* () {
311
+ var _a;
309
312
  const slugError = validateDeploymentSlug(args.slug);
310
313
  if (slugError !== undefined) {
311
314
  throw new DeployApiError(slugError, 400);
312
315
  }
316
+ for (const component of (_a = args.components) !== null && _a !== void 0 ? _a : []) {
317
+ const keyError = validateDeploymentSlug(component.componentKey);
318
+ if (keyError !== undefined) {
319
+ throw new DeployApiError(`Invalid component key ${JSON.stringify(component.componentKey)}: use lowercase letters, digits, '-' or '_' (max 64 chars)`, 400);
320
+ }
321
+ }
313
322
  const raw = yield this.request({
314
323
  method: "POST",
315
324
  path: "/internal/agentkit/deployments",
@@ -319,6 +328,7 @@ export class AgentServeDeployClient {
319
328
  gitRepoUrl: args.gitRepoUrl,
320
329
  gitRef: args.gitRef,
321
330
  agentPath: args.agentPath,
331
+ components: args.components,
322
332
  repositories: args.repositories !== undefined && args.repositories.length > 0
323
333
  ? args.repositories
324
334
  : undefined,
@@ -1 +1 @@
1
- {"version":3,"file":"deploy-manifest.d.ts","sourceRoot":"","sources":["../../src/internal/deploy-manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAIH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAclE,eAAO,MAAM,uBAAuB,EAAE,CAAK,CAAC;AAiC5C,MAAM,WAAW,+BAA+B;IAC9C,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,4EAA4E;IAC5E,gBAAgB,CAAC,EAAE,eAAe,GAAG,OAAO,GAAG,MAAM,CAAC;IACtD;;;;OAIG;IACH,YAAY,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAC3B;;;;;;;OAOG;IACH,QAAQ,EAAE,KAAK,CAAC;QACd,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;QACtB,YAAY,EAAE,oBAAoB,CAAC;KACpC,CAAC,CAAC;CACJ;AAED,MAAM,WAAW,qBAAqB;IACpC,eAAe,EAAE,CAAC,CAAC;IACnB,6BAA6B;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,yDAAyD;IACzD,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,+BAA+B,CAAC;IAC9C;;;OAGG;IACH,IAAI,EAAE,gBAAgB,CAAC;CACxB;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,YAAY,EACrB,OAAO,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAA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MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GAChD,qBAAqB,CA0DvB;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,OAAO,GACX,qBAAqB,GAAG,SAAS,CAOnC"}
@@ -100,11 +100,17 @@ export function buildAgentDeployManifest(project, options) {
100
100
  manifestVersion: DEPLOY_MANIFEST_VERSION,
101
101
  generatedAtMs: (_b = options === null || options === void 0 ? void 0 : options.nowMs) !== null && _b !== void 0 ? _b : Date.now(),
102
102
  cliVersion: (_c = options === null || options === void 0 ? void 0 : options.cliVersion) !== null && _c !== void 0 ? _c : packageVersion(),
103
- declarations: Object.assign(Object.assign({ egressDomains: [...((_d = (_a = project.agent.hosting) === null || _a === void 0 ? void 0 : _a.egressDomains) !== null && _d !== void 0 ? _d : [])], publicRoutePaths, frameworkStorage: project.storage === undefined
104
- ? "none"
105
- : isCursorHostedStorage(project.storage)
106
- ? "cursor-hosted"
107
- : "other" }, (project.agent.architecture === undefined
103
+ declarations: Object.assign(Object.assign({ egressDomains: [...((_d = (_a = project.agent.hosting) === null || _a === void 0 ? void 0 : _a.egressDomains) !== null && _d !== void 0 ? _d : [])], publicRoutePaths,
104
+ // v2 ignores authored storage; deploy manifests describe
105
+ // Cursor-hosted deployments, where framework-storage-selection.ts
106
+ // injects the Cursor-hosted mirror.
107
+ frameworkStorage: project.agent.architecture === "v2"
108
+ ? "cursor-hosted"
109
+ : project.storage === undefined
110
+ ? "none"
111
+ : isCursorHostedStorage(project.storage)
112
+ ? "cursor-hosted"
113
+ : "other" }, (project.agent.architecture === undefined
108
114
  ? {}
109
115
  : { architecture: project.agent.architecture })), { channels }),
110
116
  info: projectInfo(project),
@@ -1 +1 @@
1
- {"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../src/internal/discovery.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAkBH,OAAO,EACL,KAAK,iBAAiB,EAItB,KAAK,YAAY,EACjB,KAAK,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C,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,YAAY,CAAA;CAAE,CAAC,CAAC,CA6BzD;AAED;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,uBAAuB,GAAG;IACjC,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;CACtB,GACL,OAAO,CAAC,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,YAAY,CAAA;CAAE,CAAC,CAAC,CAgBzD;AAWD,iFAAiF;AACjF,eAAO,MAAM,cAAc,EAAE,GAAG,CAAC,MAAM,CAIrC,CAAC;AAEH,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,YAAY,CAAC,CA0EvB;AAED,qEAAqE;AACrE,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAElE;AAED,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,MAAM,CAOnE;AAyOD,wBAAgB,qCAAqC,CAAC,KAAK,EAAE;IAC3D,OAAO,EAAE,YAAY,CAAC;IACtB,YAAY,CAAC,EAAE,iBAAiB,CAAC;CAClC,GAAG,MAAM,GAAG,SAAS,CAIrB;AA6nBD;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAiB3E;AAqiCD,wBAAgB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,gBAAgB,CAgKnE"}
@@ -212,7 +212,7 @@ export function loadAgentProject(dir_1) {
212
212
  const hooks = yield loadHooks(ctx, join(agentDir, "hooks"));
213
213
  const abs = yield loadABs(ctx, agentDir);
214
214
  const abConfig = yield loadABConfig(ctx, agentDir);
215
- const storage = yield loadStorage(ctx, agentDir);
215
+ const storage = yield loadStorage(ctx, agentDir, agent.architecture);
216
216
  const artifacts = yield loadArtifacts(ctx, agentDir);
217
217
  const otel = yield loadOtel(ctx, agentDir);
218
218
  yield appendArtifactTool(ctx, agentDir, agent, artifacts);
@@ -1728,12 +1728,32 @@ function loadABConfig(ctx, agentDir) {
1728
1728
  // ============================================================================
1729
1729
  // Storage (agent/storage.ts)
1730
1730
  // ============================================================================
1731
- function loadStorage(ctx, agentDir) {
1731
+ function loadStorage(ctx, agentDir, architecture) {
1732
1732
  return __awaiter(this, void 0, void 0, function* () {
1733
1733
  const path = yield findModuleFile(agentDir, "storage");
1734
1734
  if (path === undefined) {
1735
1735
  return undefined;
1736
1736
  }
1737
+ if (architecture === "v2") {
1738
+ // Storage is a hosting-mode decision on v2, made by
1739
+ // framework-storage-selection.ts: the state root when self-hosted,
1740
+ // Cursor-managed storage on Cursor hosting. Fail early (error
1741
+ // diagnostics refuse serve and deploy) rather than silently running
1742
+ // with storage the author believes they configured. Not imported.
1743
+ ctx.diagnostics.push({
1744
+ severity: "error",
1745
+ path: displayPath(ctx, path),
1746
+ message: 'agent/storage.ts is not supported on architecture "v2": the platform selects storage (the local state root when self-hosted; Cursor-managed storage on Cursor hosting). Delete the file.',
1747
+ });
1748
+ return undefined;
1749
+ }
1750
+ // v1 keeps loading the authored sink, with notice: defineStorage is going
1751
+ // away with the v1 control plane.
1752
+ ctx.diagnostics.push({
1753
+ severity: "warning",
1754
+ path: displayPath(ctx, path),
1755
+ message: 'agent/storage.ts (defineStorage) is deprecated and going away: architecture "v2" selects storage automatically (the local state root when self-hosted; Cursor-managed storage on Cursor hosting). Still honored on v1.',
1756
+ });
1737
1757
  const definition = yield importDefault(ctx, path, "storage");
1738
1758
  return definition;
1739
1759
  });