@cursor/july 0.1.104 → 0.1.107

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 (286) hide show
  1. package/dist/bin/agent-serve.js +1 -8
  2. package/dist/channels/bitbucket/types.d.ts +2 -4
  3. package/dist/channels/bitbucket/types.d.ts.map +1 -1
  4. package/dist/channels/deployments/deployments-channel.d.ts.map +1 -1
  5. package/dist/channels/deployments/deployments-channel.js +1 -0
  6. package/dist/channels/deployments/types.d.ts +7 -8
  7. package/dist/channels/deployments/types.d.ts.map +1 -1
  8. package/dist/channels/github/types.d.ts +2 -4
  9. package/dist/channels/github/types.d.ts.map +1 -1
  10. package/dist/channels/gitlab/types.d.ts +2 -5
  11. package/dist/channels/gitlab/types.d.ts.map +1 -1
  12. package/dist/channels/origin/types.d.ts +2 -3
  13. package/dist/channels/origin/types.d.ts.map +1 -1
  14. package/dist/channels/slack/defaults.d.ts.map +1 -1
  15. package/dist/channels/slack/defaults.js +3 -0
  16. package/dist/channels/slack/dispatch.d.ts.map +1 -1
  17. package/dist/channels/slack/dispatch.js +1 -1
  18. package/dist/channels/slack/live-delivery.d.ts.map +1 -1
  19. package/dist/channels/slack/live-delivery.js +48 -11
  20. package/dist/channels/slack/types.d.ts +4 -3
  21. package/dist/channels/slack/types.d.ts.map +1 -1
  22. package/dist/docs/404.html +3 -3
  23. package/dist/docs/ab.html +6 -6
  24. package/dist/docs/assets/{app.DbMWUyGb.js → app.CtuckIiL.js} +1 -1
  25. package/dist/docs/assets/chunks/@localSearchIndexroot.DXXZxiMv.js +1 -0
  26. package/dist/docs/assets/chunks/{VPLocalSearchBox.DcNeTh9o.js → VPLocalSearchBox.Bkkhnu8K.js} +2 -2
  27. package/dist/docs/assets/chunks/{theme.DMjhY3gl.js → theme.DhpIe0Pa.js} +2 -2
  28. package/dist/docs/assets/guides_grokbot-agents.md.DVqdhBKb.js +9 -0
  29. package/dist/docs/assets/guides_grokbot-agents.md.DVqdhBKb.lean.js +1 -0
  30. package/dist/docs/assets/{guides_opentelemetry.md.COh9jFVg.js → guides_opentelemetry.md.SCRMskno.js} +3 -3
  31. package/dist/docs/assets/{guides_opentelemetry.md.COh9jFVg.lean.js → guides_opentelemetry.md.SCRMskno.lean.js} +1 -1
  32. package/dist/docs/assets/index.md.BW_6tOgR.js +5 -0
  33. package/dist/docs/assets/index.md.BW_6tOgR.lean.js +1 -0
  34. package/dist/docs/assets/{reference_channels.md.DBGcaB7m.js → reference_channels.md.D-qTqwcq.js} +2 -2
  35. package/dist/docs/assets/{reference_channels.md.DBGcaB7m.lean.js → reference_channels.md.D-qTqwcq.lean.js} +1 -1
  36. package/dist/docs/assets/{reference_cli.md.CJNc_xYK.js → reference_cli.md.Dm67hd2D.js} +3 -2
  37. package/dist/docs/assets/{reference_extensions.md.DykHW3qL.js → reference_extensions.md.CGmMLblt.js} +1 -1
  38. package/dist/docs/assets/{skills_otel.md.CqhobH3B.js → skills_otel.md.B5Ddv1xH.js} +1 -1
  39. package/dist/docs/assets/{style.BRuM8477.css → style.DCD_zyg3.css} +1 -1
  40. package/dist/docs/assets/templates_grokbot-agents.md.c1s6Flp9.js +3 -0
  41. package/dist/docs/assets/templates_grokbot-agents.md.c1s6Flp9.lean.js +1 -0
  42. package/dist/docs/building-with-agents.html +6 -6
  43. package/dist/docs/concepts.html +5 -5
  44. package/dist/docs/deployment.html +6 -6
  45. package/dist/docs/evals.html +6 -6
  46. package/dist/docs/guides/agent-to-agent.html +6 -6
  47. package/dist/docs/guides/cloud-agents.html +6 -6
  48. package/dist/docs/guides/convert-automation.html +6 -6
  49. package/dist/docs/guides/github.html +6 -6
  50. package/dist/docs/guides/grokbot-agents.html +35 -0
  51. package/dist/docs/guides/grokbot-agents.md +88 -0
  52. package/dist/docs/guides/human-in-the-loop.html +6 -6
  53. package/dist/docs/guides/mcp-oauth.html +6 -6
  54. package/dist/docs/guides/opentelemetry.html +8 -8
  55. package/dist/docs/guides/opentelemetry.md +3 -4
  56. package/dist/docs/guides/slack.html +6 -6
  57. package/dist/docs/guides/webhooks.html +6 -6
  58. package/dist/docs/hashmap.json +1 -1
  59. package/dist/docs/hillclimbing.html +6 -6
  60. package/dist/docs/index.html +8 -8
  61. package/dist/docs/index.md +6 -1
  62. package/dist/docs/llms-full.txt +178 -30
  63. package/dist/docs/llms.txt +2 -0
  64. package/dist/docs/quickstart.html +6 -6
  65. package/dist/docs/reference/agent-config.html +6 -6
  66. package/dist/docs/reference/artifacts.html +6 -6
  67. package/dist/docs/reference/channels.html +7 -7
  68. package/dist/docs/reference/channels.md +11 -19
  69. package/dist/docs/reference/cli.html +10 -9
  70. package/dist/docs/reference/cli.md +7 -3
  71. package/dist/docs/reference/connections.html +6 -6
  72. package/dist/docs/reference/extensions.html +7 -7
  73. package/dist/docs/reference/extensions.md +2 -0
  74. package/dist/docs/reference/hooks.html +6 -6
  75. package/dist/docs/reference/http-api.html +6 -6
  76. package/dist/docs/reference/instructions.html +6 -6
  77. package/dist/docs/reference/playground.html +5 -5
  78. package/dist/docs/reference/project-layout.html +6 -6
  79. package/dist/docs/reference/prompt.html +6 -6
  80. package/dist/docs/reference/result.html +6 -6
  81. package/dist/docs/reference/schedules.html +6 -6
  82. package/dist/docs/reference/sessions.html +5 -5
  83. package/dist/docs/reference/skills.html +6 -6
  84. package/dist/docs/reference/subagents.html +6 -6
  85. package/dist/docs/reference/tools.html +6 -6
  86. package/dist/docs/scaffolding-agents.html +5 -5
  87. package/dist/docs/skills/ab.html +6 -6
  88. package/dist/docs/skills/create-agent.html +6 -6
  89. package/dist/docs/skills/debug.html +5 -5
  90. package/dist/docs/skills/evals.html +6 -6
  91. package/dist/docs/skills/framework-map.html +5 -5
  92. package/dist/docs/skills/github.html +6 -6
  93. package/dist/docs/skills/hillclimb.html +6 -6
  94. package/dist/docs/skills/index.html +5 -5
  95. package/dist/docs/skills/mcp-auth.html +6 -6
  96. package/dist/docs/skills/otel.html +8 -8
  97. package/dist/docs/skills/otel.md +3 -3
  98. package/dist/docs/skills/setup-slack.html +6 -6
  99. package/dist/docs/storage.html +6 -6
  100. package/dist/docs/templates/agentic-owners.html +6 -6
  101. package/dist/docs/templates/agents-md.html +6 -6
  102. package/dist/docs/templates/code-wiki.html +6 -6
  103. package/dist/docs/templates/demo.html +6 -6
  104. package/dist/docs/templates/grokbot-agents.html +29 -0
  105. package/dist/docs/templates/grokbot-agents.md +48 -0
  106. package/dist/docs/templates/pr-autofixer.html +6 -6
  107. package/dist/docs/templates/security-help.html +6 -6
  108. package/dist/docs/templates/security-reviewer.html +6 -6
  109. package/dist/docs/templates/triage.html +6 -6
  110. package/dist/docs/troubleshooting.html +5 -5
  111. package/dist/files.d.ts +7 -2
  112. package/dist/files.d.ts.map +1 -1
  113. package/dist/files.js +7 -2
  114. package/dist/index.d.ts +4 -5
  115. package/dist/index.d.ts.map +1 -1
  116. package/dist/index.js +3 -4
  117. package/dist/internal/cli-deploy.d.ts.map +1 -1
  118. package/dist/internal/cli-deploy.js +23 -11
  119. package/dist/internal/cursor/backend-client.d.ts +25 -0
  120. package/dist/internal/cursor/backend-client.d.ts.map +1 -1
  121. package/dist/internal/cursor/backend-client.js +57 -2
  122. package/dist/internal/cursor-agent-template.d.ts +1 -1
  123. package/dist/internal/cursor-agent-template.d.ts.map +1 -1
  124. package/dist/internal/cursor-agent-template.js +1 -0
  125. package/dist/internal/deploy-client.d.ts +8 -0
  126. package/dist/internal/deploy-client.d.ts.map +1 -1
  127. package/dist/internal/deploy-client.js +14 -0
  128. package/dist/internal/deploy-manifest.d.ts +3 -0
  129. package/dist/internal/deploy-manifest.d.ts.map +1 -1
  130. package/dist/internal/deploy-manifest.js +15 -12
  131. package/dist/internal/discovery/agent.d.ts.map +1 -1
  132. package/dist/internal/discovery/agent.js +1 -0
  133. package/dist/internal/discovery/info.d.ts.map +1 -1
  134. package/dist/internal/discovery/info.js +7 -3
  135. package/dist/internal/discovery/modules.d.ts +1 -1
  136. package/dist/internal/discovery/modules.d.ts.map +1 -1
  137. package/dist/internal/discovery/modules.js +1 -0
  138. package/dist/internal/discovery/project.d.ts.map +1 -1
  139. package/dist/internal/discovery/project.js +3 -0
  140. package/dist/internal/discovery/reminders.d.ts +7 -0
  141. package/dist/internal/discovery/reminders.d.ts.map +1 -0
  142. package/dist/internal/discovery/reminders.js +65 -0
  143. package/dist/internal/discovery/subagent.js +1 -0
  144. package/dist/internal/distribution.d.ts +5 -0
  145. package/dist/internal/distribution.d.ts.map +1 -1
  146. package/dist/internal/distribution.js +17 -0
  147. package/dist/internal/framework-file-storage.d.ts +3 -1
  148. package/dist/internal/framework-file-storage.d.ts.map +1 -1
  149. package/dist/internal/framework-file-storage.js +3 -1
  150. package/dist/internal/framework-storage-selection.d.ts +14 -3
  151. package/dist/internal/framework-storage-selection.d.ts.map +1 -1
  152. package/dist/internal/framework-storage-selection.js +36 -6
  153. package/dist/internal/guest-network.d.ts.map +1 -1
  154. package/dist/internal/guest-network.js +2 -0
  155. package/dist/internal/hosted-delivery-protocol.d.ts +48 -0
  156. package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
  157. package/dist/internal/hosted-delivery-protocol.js +60 -0
  158. package/dist/internal/hosted-delivery.d.ts +17 -0
  159. package/dist/internal/hosted-delivery.d.ts.map +1 -1
  160. package/dist/internal/hosted-delivery.js +112 -19
  161. package/dist/internal/hosted-managed-automation.d.ts.map +1 -1
  162. package/dist/internal/hosted-managed-automation.js +27 -2
  163. package/dist/internal/init-project.d.ts.map +1 -1
  164. package/dist/internal/init-project.js +4 -1
  165. package/dist/internal/local-control-plane.d.ts +18 -2
  166. package/dist/internal/local-control-plane.d.ts.map +1 -1
  167. package/dist/internal/local-control-plane.js +199 -17
  168. package/dist/internal/reminder-control-plane-protocol.d.ts +187 -0
  169. package/dist/internal/reminder-control-plane-protocol.d.ts.map +1 -0
  170. package/dist/internal/reminder-control-plane-protocol.js +244 -0
  171. package/dist/internal/reminder-runner.d.ts +48 -6
  172. package/dist/internal/reminder-runner.d.ts.map +1 -1
  173. package/dist/internal/reminder-runner.js +336 -48
  174. package/dist/internal/reminder-schedule.d.ts +5 -2
  175. package/dist/internal/reminder-schedule.d.ts.map +1 -1
  176. package/dist/internal/reminder-schedule.js +8 -6
  177. package/dist/internal/reminder-store.d.ts +24 -7
  178. package/dist/internal/reminder-store.d.ts.map +1 -1
  179. package/dist/internal/reminder-store.js +6 -5
  180. package/dist/internal/request-error-status.d.ts +2 -0
  181. package/dist/internal/request-error-status.d.ts.map +1 -1
  182. package/dist/internal/request-error-status.js +22 -3
  183. package/dist/internal/scm/pr-url.d.ts +40 -0
  184. package/dist/internal/scm/pr-url.d.ts.map +1 -1
  185. package/dist/internal/scm/pr-url.js +93 -14
  186. package/dist/internal/sdk-runner.d.ts +12 -0
  187. package/dist/internal/sdk-runner.d.ts.map +1 -1
  188. package/dist/internal/sdk-runner.js +18 -0
  189. package/dist/internal/server.d.ts.map +1 -1
  190. package/dist/internal/server.js +78 -30
  191. package/dist/internal/session-engine.d.ts +12 -0
  192. package/dist/internal/session-engine.d.ts.map +1 -1
  193. package/dist/internal/session-engine.js +137 -52
  194. package/dist/internal/store-mirror.d.ts +2 -2
  195. package/dist/internal/store-mirror.js +2 -2
  196. package/dist/internal/tenant-slack/relay.d.ts +2 -0
  197. package/dist/internal/tenant-slack/relay.d.ts.map +1 -1
  198. package/dist/internal/tenant-slack/relay.js +18 -8
  199. package/dist/internal/workspace-sync.d.ts +31 -6
  200. package/dist/internal/workspace-sync.d.ts.map +1 -1
  201. package/dist/internal/workspace-sync.js +67 -12
  202. package/dist/internal/workspace.d.ts +9 -0
  203. package/dist/internal/workspace.d.ts.map +1 -1
  204. package/dist/internal/workspace.js +16 -0
  205. package/dist/playground/assets/index-Bq2HpEQB.js +67 -0
  206. package/dist/playground/assets/index-CZKKNlmb.css +1 -0
  207. package/dist/playground/index.html +2 -2
  208. package/dist/reminders.d.ts +24 -5
  209. package/dist/reminders.d.ts.map +1 -1
  210. package/dist/reminders.js +28 -5
  211. package/dist/types.d.ts +98 -28
  212. package/dist/types.d.ts.map +1 -1
  213. package/docs/README.md +6 -1
  214. package/docs/guides/grokbot-agents.md +93 -0
  215. package/docs/guides/opentelemetry.md +3 -4
  216. package/docs/reference/channels.md +11 -19
  217. package/docs/reference/cli.md +7 -3
  218. package/docs/reference/extensions.md +2 -0
  219. package/docs/templates/grokbot-agents.md +53 -0
  220. package/package.json +12 -3
  221. package/skills/otel/SKILL.md +3 -3
  222. package/src/bin/agent-serve.ts +1 -9
  223. package/src/channels/bitbucket/types.ts +2 -4
  224. package/src/channels/deployments/deployments-channel.ts +1 -0
  225. package/src/channels/deployments/types.ts +7 -8
  226. package/src/channels/github/types.ts +2 -4
  227. package/src/channels/gitlab/types.ts +2 -5
  228. package/src/channels/origin/types.ts +2 -3
  229. package/src/channels/slack/defaults.ts +3 -0
  230. package/src/channels/slack/dispatch.ts +1 -0
  231. package/src/channels/slack/live-delivery.ts +53 -12
  232. package/src/channels/slack/types.ts +4 -3
  233. package/src/files.ts +9 -2
  234. package/src/index.ts +6 -3
  235. package/src/internal/cli-deploy.ts +30 -12
  236. package/src/internal/cursor/backend-client.ts +90 -2
  237. package/src/internal/cursor-agent-template.ts +1 -0
  238. package/src/internal/deploy-client.ts +16 -0
  239. package/src/internal/deploy-manifest.ts +16 -11
  240. package/src/internal/discovery/agent.ts +1 -0
  241. package/src/internal/discovery/info.ts +6 -0
  242. package/src/internal/discovery/modules.ts +2 -4
  243. package/src/internal/discovery/project.ts +3 -0
  244. package/src/internal/discovery/reminders.ts +65 -0
  245. package/src/internal/discovery/subagent.ts +1 -0
  246. package/src/internal/distribution.ts +20 -0
  247. package/src/internal/framework-file-storage.ts +3 -1
  248. package/src/internal/framework-storage-selection.ts +43 -6
  249. package/src/internal/guest-network.ts +3 -0
  250. package/src/internal/hosted-delivery-protocol.ts +96 -0
  251. package/src/internal/hosted-delivery.ts +207 -28
  252. package/src/internal/hosted-managed-automation.ts +49 -5
  253. package/src/internal/init-project.ts +4 -1
  254. package/src/internal/local-control-plane.ts +281 -22
  255. package/src/internal/reminder-control-plane-protocol.ts +499 -0
  256. package/src/internal/reminder-runner.ts +421 -48
  257. package/src/internal/reminder-schedule.ts +11 -6
  258. package/src/internal/reminder-store.ts +27 -7
  259. package/src/internal/request-error-status.ts +27 -3
  260. package/src/internal/scm/pr-url.ts +167 -20
  261. package/src/internal/sdk-runner.ts +19 -0
  262. package/src/internal/server.ts +85 -16
  263. package/src/internal/session-engine.ts +173 -56
  264. package/src/internal/store-mirror.ts +2 -2
  265. package/src/internal/tenant-slack/relay.ts +28 -4
  266. package/src/internal/workspace-sync.ts +84 -12
  267. package/src/internal/workspace.ts +20 -0
  268. package/src/reminders.ts +35 -4
  269. package/src/types.ts +104 -28
  270. package/templates/grokbot-agents/README.md +26 -0
  271. package/templates/grokbot-agents/agent/agent.ts +6 -0
  272. package/templates/grokbot-agents/agent/extensions/grokbot.ts +5 -0
  273. package/templates/grokbot-agents/agent/instructions.md +7 -0
  274. package/templates/grokbot-agents/evals/evals.config.ts +5 -0
  275. package/templates/grokbot-agents/evals/grokbot-agents.eval.ts +18 -0
  276. package/templates/grokbot-agents/init.json +18 -0
  277. package/templates/grokbot-agents/package.json +17 -0
  278. package/templates/grokbot-agents/tsconfig.json +12 -0
  279. package/dist/docs/assets/chunks/@localSearchIndexroot.Bqsulb9K.js +0 -1
  280. package/dist/docs/assets/index.md.D75GWhPl.js +0 -5
  281. package/dist/docs/assets/index.md.D75GWhPl.lean.js +0 -1
  282. package/dist/playground/assets/index-8YiozU89.js +0 -67
  283. package/dist/playground/assets/index-MbMxXg-y.css +0 -1
  284. /package/dist/docs/assets/{reference_cli.md.CJNc_xYK.lean.js → reference_cli.md.Dm67hd2D.lean.js} +0 -0
  285. /package/dist/docs/assets/{reference_extensions.md.DykHW3qL.lean.js → reference_extensions.md.CGmMLblt.lean.js} +0 -0
  286. /package/dist/docs/assets/{skills_otel.md.CqhobH3B.lean.js → skills_otel.md.B5Ddv1xH.lean.js} +0 -0
@@ -2,14 +2,19 @@
2
2
  * Reminder document store used by the local control plane
3
3
  * (`<stateRoot>/control-plane/reminders/`).
4
4
  *
5
- * Handlers (`run` / function `until`) are not serializable — they live only
6
- * in the in-memory {@link ReminderRunner} registry. The control plane holds
7
- * schedule, prompt, target, and status so prompt-form reminders survive
8
- * restart.
5
+ * Anonymous `run` / function `until` handlers are not serializable — they live
6
+ * only in the in-memory {@link ReminderRunner} registry. Named `handler` +
7
+ * `args` and prompt-form reminders survive restart (handlers resolve from
8
+ * `agent/reminders/` on every fire).
9
9
  */
10
- import type { ReminderBusyPolicy, ReminderScheduleKind, ReminderStatus } from "../types.js";
10
+ import type { JsonObject, ReminderBusyPolicy, ReminderScheduleKind, ReminderStatus } from "../types.js";
11
11
  export declare const REMINDER_SNAPSHOT_VERSION: 1;
12
12
  export type { ReminderBusyPolicy, ReminderScheduleKind, ReminderStatus, } from "../types.js";
13
+ /**
14
+ * Internal record status. `firing` is CP claim state and must not appear on
15
+ * public {@link ReminderStatus} / {@link ReminderInfo}.
16
+ */
17
+ export type ReminderRecordStatus = ReminderStatus | "firing";
13
18
  /** Serializable reminder record (no function bodies). */
14
19
  export interface ReminderRecord {
15
20
  version: typeof REMINDER_SNAPSHOT_VERSION;
@@ -25,8 +30,15 @@ export interface ReminderRecord {
25
30
  /** Raw schedule value: every/delay string, cron expression, or ISO `at`. */
26
31
  scheduleValue: string;
27
32
  intervalMs?: number;
28
- /** Prompt form — mutually exclusive with in-memory `run`. */
33
+ /** Prompt form — mutually exclusive with `handler` and in-memory `run`. */
29
34
  prompt?: string;
35
+ /**
36
+ * Named handler stem (`agent/reminders/<name>.ts`). Mutually exclusive with
37
+ * `prompt` and in-memory `run`.
38
+ */
39
+ handler?: string;
40
+ /** Serializable args for {@link handler}. */
41
+ args?: JsonObject;
30
42
  /**
31
43
  * True when create() registered a `run` handler. Handlers are not
32
44
  * serializable; after restart, armed records with this flag and no live
@@ -38,9 +50,14 @@ export interface ReminderRecord {
38
50
  /** Natural-language until (agent-facing); function until is in-memory only. */
39
51
  untilPrompt?: string;
40
52
  busyPolicy: ReminderBusyPolicy;
41
- status: ReminderStatus;
53
+ status: ReminderRecordStatus;
42
54
  disarmReason?: string;
43
55
  fireCount: number;
56
+ /**
57
+ * CAS generation. Cancel/rekey and successful outcome apply bump this so
58
+ * in-flight outcomes cannot resurrect a superseded reminder.
59
+ */
60
+ generation?: number;
44
61
  nextFireAtMs: number;
45
62
  createdAt: string;
46
63
  updatedAt: string;
@@ -1 +1 @@
1
- {"version":3,"file":"reminder-store.d.ts","sourceRoot":"","sources":["../../src/internal/reminder-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAWH,OAAO,KAAK,EACV,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,EACf,MAAM,aAAa,CAAC;AAErB,eAAO,MAAM,yBAAyB,EAAG,CAAU,CAAC;AAEpD,YAAY,EACV,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,GACf,MAAM,aAAa,CAAC;AAErB,yDAAyD;AACzD,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,yBAAyB,CAAC;IAC1C,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,SAAS,EAAE,MAAM,CAAC;IAClB,yEAAyE;IACzE,iBAAiB,EAAE,MAAM,CAAC;IAC1B,0DAA0D;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,YAAY,EAAE,oBAAoB,CAAC;IACnC,4EAA4E;IAC5E,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6DAA6D;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,aAAa,EAAE,OAAO,CAAC;IACvB,yEAAyE;IACzE,UAAU,EAAE,OAAO,CAAC;IACpB,+EAA+E;IAC/E,WAAW,CAAC,EAAE,MAAM,CA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AAC,IAAI,CAAC,CAEhC;IAEK,IAAI,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC,CAiBtC;IAEK,SAAS,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC,CAI3C;IAEK,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAsBzD;IAEK,IAAI,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAYhD;IAEK,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEtC;CACF"}
@@ -2,10 +2,10 @@
2
2
  * Reminder document store used by the local control plane
3
3
  * (`<stateRoot>/control-plane/reminders/`).
4
4
  *
5
- * Handlers (`run` / function `until`) are not serializable — they live only
6
- * in the in-memory {@link ReminderRunner} registry. The control plane holds
7
- * schedule, prompt, target, and status so prompt-form reminders survive
8
- * restart.
5
+ * Anonymous `run` / function `until` handlers are not serializable — they live
6
+ * only in the in-memory {@link ReminderRunner} registry. Named `handler` +
7
+ * `args` and prompt-form reminders survive restart (handlers resolve from
8
+ * `agent/reminders/` on every fire).
9
9
  */
10
10
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
11
11
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
@@ -74,7 +74,8 @@ export class ReminderStore {
74
74
  listArmed() {
75
75
  return __awaiter(this, void 0, void 0, function* () {
76
76
  const all = yield this.list();
77
- return all.filter((r) => r.status === "armed");
77
+ // Treat in-flight claims as still armed for restart / listing purposes.
78
+ return all.filter((r) => r.status === "armed" || r.status === "firing");
78
79
  });
79
80
  }
80
81
  get(id) {
@@ -1,7 +1,9 @@
1
+ import { type HostedGuestRetryDisposition } from "./hosted-delivery-protocol.js";
1
2
  export interface MappedRequestError {
2
3
  status: 400 | 403 | 409 | 503;
3
4
  code: string;
4
5
  message: string;
6
+ retry: HostedGuestRetryDisposition;
5
7
  }
6
8
  /**
7
9
  * Expected throw → HTTP mapping used by `handleRequest` and hosted flush.
@@ -1 +1 @@
1
- {"version":3,"file":"request-error-status.d.ts","sourceRoot":"","sources":["../../src/internal/request-error-status.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,OAAO,GACb,kBAAkB,GAAG,SAAS,CA4ChC;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAElE"}
1
+ {"version":3,"file":"request-error-status.d.ts","sourceRoot":"","sources":["../../src/internal/request-error-status.ts"],"names":[],"mappings":"AASA,OAAO,EAGL,KAAK,2BAA2B,EACjC,MAAM,+BAA+B,CAAC;AAGvC,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,2BAA2B,CAAC;CACpC;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,OAAO,GACb,kBAAkB,GAAG,SAAS,CA8DhC;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAElE"}
@@ -1,6 +1,7 @@
1
1
  import { InvalidAsOfError, VacuousTimeArgsError } from "./as-of.js";
2
2
  import { V2EngineError } from "./continuation-identity.js";
3
3
  import { GUEST_CONNECT_STALLED, GUEST_NETWORK_UNAVAILABLE, GuestNetworkUnavailableError, hasGuestNetworkErrno, isQuietGuestConnectStall, } from "./guest-network.js";
4
+ import { HOSTED_GUEST_RETRY_TERMINAL, HOSTED_GUEST_RETRY_TRANSIENT, } from "./hosted-delivery-protocol.js";
4
5
  import { SessionAuthError, SessionBusyError } from "./session-engine.js";
5
6
  /**
6
7
  * Expected throw → HTTP mapping used by `handleRequest` and hosted flush.
@@ -8,21 +9,37 @@ import { SessionAuthError, SessionBusyError } from "./session-engine.js";
8
9
  */
9
10
  export function mapThrownRequestError(error) {
10
11
  if (error instanceof SessionBusyError) {
11
- return { status: 409, code: "session_busy", message: error.message };
12
+ return {
13
+ status: 409,
14
+ code: "session_busy",
15
+ message: error.message,
16
+ retry: HOSTED_GUEST_RETRY_TRANSIENT,
17
+ };
12
18
  }
13
19
  if (error instanceof V2EngineError) {
14
20
  return {
15
21
  status: 409,
16
22
  code: "v2_identity_conflict",
17
23
  message: "Control-plane session identity conflicts with existing state.",
24
+ retry: HOSTED_GUEST_RETRY_TERMINAL,
18
25
  };
19
26
  }
20
27
  if (error instanceof SessionAuthError) {
21
- return { status: 403, code: "forbidden", message: error.message };
28
+ return {
29
+ status: 403,
30
+ code: "forbidden",
31
+ message: error.message,
32
+ retry: HOSTED_GUEST_RETRY_TERMINAL,
33
+ };
22
34
  }
23
35
  if (error instanceof InvalidAsOfError ||
24
36
  error instanceof VacuousTimeArgsError) {
25
- return { status: 400, code: "invalid_request", message: error.message };
37
+ return {
38
+ status: 400,
39
+ code: "invalid_request",
40
+ message: error.message,
41
+ retry: HOSTED_GUEST_RETRY_TERMINAL,
42
+ };
26
43
  }
27
44
  if (error instanceof GuestNetworkUnavailableError ||
28
45
  hasGuestNetworkErrno(error)) {
@@ -32,6 +49,7 @@ export function mapThrownRequestError(error) {
32
49
  message: error instanceof Error
33
50
  ? error.message
34
51
  : "Guest network is not ready for outbound requests.",
52
+ retry: HOSTED_GUEST_RETRY_TRANSIENT,
35
53
  };
36
54
  }
37
55
  if (isQuietGuestConnectStall(error)) {
@@ -41,6 +59,7 @@ export function mapThrownRequestError(error) {
41
59
  message: error instanceof Error
42
60
  ? error.message
43
61
  : "Guest Connect stalled without a network errno.",
62
+ retry: HOSTED_GUEST_RETRY_TRANSIENT,
44
63
  };
45
64
  }
46
65
  return undefined;
@@ -1,8 +1,18 @@
1
1
  /**
2
2
  * Provider-neutral PR URL parse. GitHub.com plus the Origin page shapes
3
3
  * humans paste: cursor.com/codebase, review.cursor.com/pr, origin.cursor.com.
4
+ *
5
+ * {@link parseScmPrUrl} is the wider parse the review seams use: it also
6
+ * recognizes GitLab merge requests (`/-/merge_requests/<iid>` on any host),
7
+ * Bitbucket Cloud / Data Center pull requests, and GitHub Enterprise Server
8
+ * (`/<owner>/<repo>/pull/<n>` on a host that is none of the above). The
9
+ * narrow {@link parsePrUrl} keeps its github.com + Origin contract for the
10
+ * free-text callers (Slack `pr-ref`) where "any host with /pull/N" would be
11
+ * too eager.
4
12
  */
5
13
  export type PrProvider = "github" | "origin";
14
+ /** Every SCM the review seams can address. */
15
+ export type ScmPrProvider = PrProvider | "gitlab" | "bitbucket";
6
16
  export type ParsedPrUrl = {
7
17
  provider: PrProvider;
8
18
  owner: string;
@@ -10,5 +20,35 @@ export type ParsedPrUrl = {
10
20
  number: number;
11
21
  url: string;
12
22
  };
23
+ export type ParsedScmPrUrl = {
24
+ provider: ScmPrProvider;
25
+ /**
26
+ * Namespace half of the repo: GitHub owner, GitLab group path (nested
27
+ * groups joined with `/`), Bitbucket workspace / project key (`~user`
28
+ * for Data Center personal repos).
29
+ */
30
+ owner: string;
31
+ repo: string;
32
+ number: number;
33
+ /** Canonical PR page URL. */
34
+ url: string;
35
+ /**
36
+ * Hostname the PR lives on (lowercase). `github.com` for dotcom, the
37
+ * GHES hostname for GitHub Enterprise, `gitlab.com` or the self-managed
38
+ * host for GitLab, `bitbucket.org` or the Data Center host for Bitbucket.
39
+ * Origin PRs report the Origin page host.
40
+ */
41
+ host: string;
42
+ };
43
+ /** github.com and Origin only — the contract free-text PR references use. */
13
44
  export declare function parsePrUrl(raw: string): ParsedPrUrl | undefined;
45
+ /**
46
+ * Every provider shape, including GitHub Enterprise Server. The GitLab and
47
+ * Bitbucket path shapes are unambiguous on any host; a plain
48
+ * `/<owner>/<repo>/pull/<n>` on a host that is not github.com, Origin,
49
+ * GitLab, or Bitbucket is taken as GHES (the only remaining forge with that
50
+ * route). Callers that must not accept arbitrary hosts use
51
+ * {@link parsePrUrl}.
52
+ */
53
+ export declare function parseScmPrUrl(raw: string): ParsedScmPrUrl | undefined;
14
54
  //# sourceMappingURL=pr-url.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pr-url.d.ts","sourceRoot":"","sources":["../../../src/internal/scm/pr-url.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE7C,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,EAAE,UAAU,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAuCF,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CA0C/D"}
1
+ {"version":3,"file":"pr-url.d.ts","sourceRoot":"","sources":["../../../src/internal/scm/pr-url.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE7C,8CAA8C;AAC9C,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,QAAQ,GAAG,WAAW,CAAC;AAEhE,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,EAAE,UAAU,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE,aAAa,CAAC;IACxB;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,6BAA6B;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ;;;;;OAKG;IACH,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAoDF,6EAA6E;AAC7E,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAY/D;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAyHrE"}
@@ -1,6 +1,14 @@
1
1
  /**
2
2
  * Provider-neutral PR URL parse. GitHub.com plus the Origin page shapes
3
3
  * humans paste: cursor.com/codebase, review.cursor.com/pr, origin.cursor.com.
4
+ *
5
+ * {@link parseScmPrUrl} is the wider parse the review seams use: it also
6
+ * recognizes GitLab merge requests (`/-/merge_requests/<iid>` on any host),
7
+ * Bitbucket Cloud / Data Center pull requests, and GitHub Enterprise Server
8
+ * (`/<owner>/<repo>/pull/<n>` on a host that is none of the above). The
9
+ * narrow {@link parsePrUrl} keeps its github.com + Origin contract for the
10
+ * free-text callers (Slack `pr-ref`) where "any host with /pull/N" would be
11
+ * too eager.
4
12
  */
5
13
  const ORIGIN_PAGE = /^origin(-[a-z0-9]+)?\.cursor\.com$/i;
6
14
  function positiveInt(raw) {
@@ -13,14 +21,18 @@ function positiveInt(raw) {
13
21
  }
14
22
  return n;
15
23
  }
16
- function parsed(provider, owner, repo, number) {
17
- if (owner === undefined || repo === undefined || number === undefined) {
24
+ function parsed(provider, host, owner, repo, number, url) {
25
+ if (owner === undefined ||
26
+ owner === "" ||
27
+ repo === undefined ||
28
+ repo === "" ||
29
+ number === undefined) {
18
30
  return undefined;
19
31
  }
20
- const url = provider === "origin"
32
+ const canonical = url !== null && url !== void 0 ? url : (provider === "origin"
21
33
  ? `https://cursor.com/codebase/${owner}/${repo}/pull/${number}`
22
- : `https://github.com/${owner}/${repo}/pull/${number}`;
23
- return { provider, owner, repo, number, url };
34
+ : `https://${host}/${owner}/${repo}/pull/${number}`);
35
+ return { provider, owner, repo, number, url: canonical, host };
24
36
  }
25
37
  /** Strip Slack mrkdwn wrappers and trailing punctuation before `URL`. */
26
38
  function normalizeRaw(raw) {
@@ -29,7 +41,32 @@ function normalizeRaw(raw) {
29
41
  .replace(/^[<[]+/, "")
30
42
  .replace(/[>\].,;]+$/, "");
31
43
  }
44
+ function isGithubDotCom(host) {
45
+ return host === "github.com" || host === "www.github.com";
46
+ }
47
+ /** github.com and Origin only — the contract free-text PR references use. */
32
48
  export function parsePrUrl(raw) {
49
+ const wide = parseScmPrUrl(raw);
50
+ if (wide === undefined) {
51
+ return undefined;
52
+ }
53
+ if (wide.provider === "origin") {
54
+ return Object.assign(Object.assign({}, wide), { provider: "origin" });
55
+ }
56
+ if (wide.provider === "github" && isGithubDotCom(wide.host)) {
57
+ return Object.assign(Object.assign({}, wide), { provider: "github" });
58
+ }
59
+ return undefined;
60
+ }
61
+ /**
62
+ * Every provider shape, including GitHub Enterprise Server. The GitLab and
63
+ * Bitbucket path shapes are unambiguous on any host; a plain
64
+ * `/<owner>/<repo>/pull/<n>` on a host that is not github.com, Origin,
65
+ * GitLab, or Bitbucket is taken as GHES (the only remaining forge with that
66
+ * route). Callers that must not accept arbitrary hosts use
67
+ * {@link parsePrUrl}.
68
+ */
69
+ export function parseScmPrUrl(raw) {
33
70
  let url;
34
71
  try {
35
72
  url = new URL(normalizeRaw(raw));
@@ -37,29 +74,71 @@ export function parsePrUrl(raw) {
37
74
  catch (_a) {
38
75
  return undefined;
39
76
  }
77
+ if (url.protocol !== "https:" && url.protocol !== "http:") {
78
+ return undefined;
79
+ }
40
80
  const parts = url.pathname.split("/").filter(Boolean);
41
81
  const host = url.hostname.toLowerCase();
42
- if ((host === "github.com" || host === "www.github.com") &&
43
- parts.length >= 4 &&
44
- parts[2] === "pull") {
45
- return parsed("github", parts[0], parts[1], positiveInt(parts[3]));
46
- }
47
82
  if (ORIGIN_PAGE.test(host) && parts.length >= 4 && parts[2] === "github") {
48
- return parsed("origin", parts[0], parts[1], positiveInt(parts[3]));
83
+ return parsed("origin", host, parts[0], parts[1], positiveInt(parts[3]));
49
84
  }
50
85
  if ((host === "cursor.com" || host === "www.cursor.com") &&
51
86
  parts[0] === "codebase" &&
52
87
  parts.length >= 5 &&
53
88
  parts[3] === "pull") {
54
- return parsed("origin", parts[1], parts[2], positiveInt(parts[4]));
89
+ return parsed("origin", host, parts[1], parts[2], positiveInt(parts[4]));
55
90
  }
56
91
  if (host === "review.cursor.com" && parts[0] === "pr") {
57
92
  if (parts.length >= 5 && parts[3] === "github") {
58
- return parsed("origin", parts[1], parts[2], positiveInt(parts[4]));
93
+ return parsed("origin", host, parts[1], parts[2], positiveInt(parts[4]));
59
94
  }
60
95
  if (parts.length >= 4) {
61
- return parsed("origin", parts[1], parts[2], positiveInt(parts[3]));
96
+ return parsed("origin", host, parts[1], parts[2], positiveInt(parts[3]));
62
97
  }
63
98
  }
99
+ // GitLab MR page: /<group>/[<subgroup>/…]<project>/-/merge_requests/<iid>
100
+ const separator = parts.indexOf("-");
101
+ if (separator >= 2 &&
102
+ parts[separator + 1] === "merge_requests" &&
103
+ parts.length >= separator + 3) {
104
+ const owner = parts.slice(0, separator - 1).join("/");
105
+ const repo = parts[separator - 1];
106
+ const number = positiveInt(parts[separator + 2]);
107
+ return parsed("gitlab", host, owner, repo, number, number === undefined
108
+ ? undefined
109
+ : `https://${host}/${owner}/${repo}/-/merge_requests/${number}`);
110
+ }
111
+ // Bitbucket Cloud: bitbucket.org/<workspace>/<slug>/pull-requests/<id>
112
+ if ((host === "bitbucket.org" || host === "www.bitbucket.org") &&
113
+ parts.length >= 4 &&
114
+ parts[2] === "pull-requests") {
115
+ const number = positiveInt(parts[3]);
116
+ return parsed("bitbucket", "bitbucket.org", parts[0], parts[1], number, number === undefined
117
+ ? undefined
118
+ : `https://bitbucket.org/${parts[0]}/${parts[1]}/pull-requests/${number}`);
119
+ }
120
+ // Bitbucket Data Center: [/<context>]/projects/<KEY>/repos/<slug>/pull-requests/<id>
121
+ // (personal repos: /users/<name>/repos/<slug>/…, full name `~name/slug`).
122
+ const dc = parts.findIndex((part, index) => (part === "projects" || part === "users") &&
123
+ parts[index + 2] === "repos" &&
124
+ parts[index + 4] === "pull-requests");
125
+ if (dc !== -1 && parts.length >= dc + 6) {
126
+ const number = positiveInt(parts[dc + 5]);
127
+ const owner = parts[dc] === "users" ? `~${parts[dc + 1]}` : parts[dc + 1];
128
+ const slug = parts[dc + 3];
129
+ const context = parts.slice(0, dc).join("/");
130
+ return parsed("bitbucket", host, owner, slug, number, number === undefined
131
+ ? undefined
132
+ : `${url.origin}/${context === "" ? "" : `${context}/`}${parts.slice(dc, dc + 4).join("/")}/pull-requests/${number}`);
133
+ }
134
+ // GitHub (dotcom or Enterprise Server): /<owner>/<repo>/pull/<n>. Checked
135
+ // last so the forge-specific shapes above win on shared hosts.
136
+ if (parts.length >= 4 &&
137
+ parts[2] === "pull" &&
138
+ !ORIGIN_PAGE.test(host) &&
139
+ !/(^|\.)cursor\.com$/.test(host)) {
140
+ const githubHost = isGithubDotCom(host) ? "github.com" : host;
141
+ return parsed("github", githubHost, parts[0], parts[1], positiveInt(parts[3]));
142
+ }
64
143
  return undefined;
65
144
  }
@@ -105,6 +105,18 @@ export declare class CursorSdkRunner implements AgentRunner {
105
105
  * {@link dispose}; dropping it early would tear the workspace back down.
106
106
  */
107
107
  prewarm(request: RunnerPrewarmRequest): Promise<PrewarmOutcome>;
108
+ /**
109
+ * Drop the cached SDK agent for this session, if one is open.
110
+ *
111
+ * Hosted v2 parks and hibernates this process as soon as the execution
112
+ * reply lands on non-interactive channels. A leftover handle still holds
113
+ * the pre-freeze Connect/HTTP2 session; the next wake then reuses it and
114
+ * `AgentService/Run` never starts. Call after `waitForCompletion` so the
115
+ * hibernate snapshot has an empty cache. Slack's interactive hot-window
116
+ * still reuses handles because that path does not go through hosted
117
+ * delivery.
118
+ */
119
+ evictSession(sessionId: string): void;
108
120
  dispose(): Promise<void>;
109
121
  private getAgent;
110
122
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"sdk-runner.d.ts","sourceRoot":"","sources":["../../src/internal/sdk-runner.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAOL,KAAK,eAAe,EACpB,KAAK,cAAc,EAEnB,KAAK,SAAS,EAEf,MAAM,aAAa,CAAC;AAErB,OAAO,EAEL,KAAK,YAAY,EAEjB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAEjB,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAMnE,gFAAgF;AAChF,MAAM,MAAM,eAAe,GAAG,oBAAoB,GAAG,oBAAoB,CAAC;AAE1E,2EAA2E;AAC3E,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAC1D,KAAK,CAAC,CAAC,OAAO,EAAE;QACd,SAAS,EAAE,MAAM,CAAC;QAClB,IAAI,EAAE,MAAM,CAAC;KACd,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAC7B;;;;;OAKG;IACH,OAAO,CAAC,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IACjE,OAAO,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B;AAED;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG,IAAI,CACrC,iBAAiB,EACf,cAAc,GACd,gBAAgB,GAChB,SAAS,GACT,OAAO,GACP,iBAAiB,GACjB,YAAY,GACZ,mBAAmB,GACnB,WAAW,GACX,OAAO,CACV,CAAC;AAEF,6EAA6E;AAC7E,MAAM,MAAM,cAAc,GACtB;IAAE,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAA;CAAE,GACzB;IAAE,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC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AajB;AAED,4EAA4E;AAC5E,wBAAgB,0BAA0B,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAE9D;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,MAAM,GACd,OAAO,CAMT;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,YAAY,GAAG,cAAc,CAQpE;AAiGD,wBAAgB,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,GAAG,MAAM,CAExE"}
@@ -290,6 +290,24 @@ export class CursorSdkRunner {
290
290
  return { warmed: true };
291
291
  });
292
292
  }
293
+ /**
294
+ * Drop the cached SDK agent for this session, if one is open.
295
+ *
296
+ * Hosted v2 parks and hibernates this process as soon as the execution
297
+ * reply lands on non-interactive channels. A leftover handle still holds
298
+ * the pre-freeze Connect/HTTP2 session; the next wake then reuses it and
299
+ * `AgentService/Run` never starts. Call after `waitForCompletion` so the
300
+ * hibernate snapshot has an empty cache. Slack's interactive hot-window
301
+ * still reuses handles because that path does not go through hosted
302
+ * delivery.
303
+ */
304
+ evictSession(sessionId) {
305
+ const cached = this.agents.get(sessionId);
306
+ if (cached === undefined) {
307
+ return;
308
+ }
309
+ this.evictAgent(sessionId, cached.agent);
310
+ }
293
311
  dispose() {
294
312
  return __awaiter(this, void 0, void 0, function* () {
295
313
  const releases = this.prewarmReleases.splice(0);
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/internal/server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAoDH,OAAO,KAAK,EACV,YAAY,EACZ,gBAAgB,EAOhB,YAAY,EACb,MAAM,aAAa,CAAC;AA2FrB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AA8CpE,OAAO,EAAE,KAAK,WAAW,EAAmB,MAAM,iBAAiB,CAAC;AASpE,OAAO,EAEL,wBAAwB,EAEzB,MAAM,sB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