@cursor/july 0.1.100 → 0.1.101

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 (254) hide show
  1. package/dist/bin/agent-serve.js +3 -2
  2. package/dist/channels/deployments/deployments-channel.d.ts +41 -5
  3. package/dist/channels/deployments/deployments-channel.d.ts.map +1 -1
  4. package/dist/channels/deployments/deployments-channel.js +88 -8
  5. package/dist/channels/deployments/types.d.ts +4 -3
  6. package/dist/channels/deployments/types.d.ts.map +1 -1
  7. package/dist/channels/origin/defaults.d.ts +43 -0
  8. package/dist/channels/origin/defaults.d.ts.map +1 -0
  9. package/dist/channels/origin/defaults.js +111 -0
  10. package/dist/channels/origin/index.d.ts +2 -0
  11. package/dist/channels/origin/index.d.ts.map +1 -1
  12. package/dist/channels/origin/index.js +2 -0
  13. package/dist/channels/origin/origin-channel.d.ts +2 -1
  14. package/dist/channels/origin/origin-channel.d.ts.map +1 -1
  15. package/dist/channels/origin/origin-channel.js +24 -3
  16. package/dist/channels/origin/state.d.ts +32 -0
  17. package/dist/channels/origin/state.d.ts.map +1 -0
  18. package/dist/channels/origin/state.js +23 -0
  19. package/dist/channels/origin/types.d.ts +23 -1
  20. package/dist/channels/origin/types.d.ts.map +1 -1
  21. package/dist/channels/slack/api.d.ts.map +1 -1
  22. package/dist/channels/slack/api.js +2 -1
  23. package/dist/channels/slack/code-fences.d.ts +17 -0
  24. package/dist/channels/slack/code-fences.d.ts.map +1 -0
  25. package/dist/channels/slack/code-fences.js +168 -0
  26. package/dist/channels/slack/index.d.ts +1 -0
  27. package/dist/channels/slack/index.d.ts.map +1 -1
  28. package/dist/channels/slack/index.js +1 -0
  29. package/dist/channels/slack/live-delivery.d.ts.map +1 -1
  30. package/dist/channels/slack/live-delivery.js +11 -4
  31. package/dist/connections.d.ts +18 -2
  32. package/dist/connections.d.ts.map +1 -1
  33. package/dist/connections.js +18 -2
  34. package/dist/docs/404.html +2 -2
  35. package/dist/docs/ab.html +4 -4
  36. package/dist/docs/assets/{app.DZ1e0Ycq.js → app.BASO9Kih.js} +1 -1
  37. package/dist/docs/assets/chunks/@localSearchIndexroot.DbFXINq2.js +1 -0
  38. package/dist/docs/assets/chunks/{VPLocalSearchBox.l8omwc6D.js → VPLocalSearchBox.DwkqxoE0.js} +1 -1
  39. package/dist/docs/assets/chunks/{theme.JVcD6gel.js → theme.CCil_13e.js} +2 -2
  40. package/dist/docs/assets/{reference_connections.md.BiGoBAk2.js → reference_connections.md.Di6jJAXF.js} +12 -2
  41. package/dist/docs/assets/{reference_connections.md.BiGoBAk2.lean.js → reference_connections.md.Di6jJAXF.lean.js} +1 -1
  42. package/dist/docs/assets/{reference_http-api.md.BEJx9XVj.js → reference_http-api.md.oySXBO8o.js} +1 -1
  43. package/dist/docs/building-with-agents.html +4 -4
  44. package/dist/docs/concepts.html +4 -4
  45. package/dist/docs/deployment.html +4 -4
  46. package/dist/docs/evals.html +4 -4
  47. package/dist/docs/guides/agent-to-agent.html +4 -4
  48. package/dist/docs/guides/cloud-runtime.html +4 -4
  49. package/dist/docs/guides/convert-automation.html +4 -4
  50. package/dist/docs/guides/github.html +4 -4
  51. package/dist/docs/guides/human-in-the-loop.html +4 -4
  52. package/dist/docs/guides/mcp-oauth.html +4 -4
  53. package/dist/docs/guides/opentelemetry.html +4 -4
  54. package/dist/docs/guides/slack.html +4 -4
  55. package/dist/docs/guides/webhooks.html +4 -4
  56. package/dist/docs/hashmap.json +1 -1
  57. package/dist/docs/hillclimbing.html +4 -4
  58. package/dist/docs/index.html +4 -4
  59. package/dist/docs/llms-full.txt +32 -1
  60. package/dist/docs/quickstart.html +4 -4
  61. package/dist/docs/reference/agent-config.html +4 -4
  62. package/dist/docs/reference/artifacts.html +4 -4
  63. package/dist/docs/reference/channels.html +4 -4
  64. package/dist/docs/reference/cli.html +4 -4
  65. package/dist/docs/reference/connections.html +16 -6
  66. package/dist/docs/reference/connections.md +31 -0
  67. package/dist/docs/reference/hooks.html +4 -4
  68. package/dist/docs/reference/http-api.html +6 -6
  69. package/dist/docs/reference/http-api.md +1 -1
  70. package/dist/docs/reference/instructions.html +4 -4
  71. package/dist/docs/reference/playground.html +4 -4
  72. package/dist/docs/reference/project-layout.html +4 -4
  73. package/dist/docs/reference/prompt.html +4 -4
  74. package/dist/docs/reference/schedules.html +4 -4
  75. package/dist/docs/reference/sessions.html +4 -4
  76. package/dist/docs/reference/skills.html +4 -4
  77. package/dist/docs/reference/subagents.html +4 -4
  78. package/dist/docs/reference/tools.html +4 -4
  79. package/dist/docs/scaffolding-agents.html +4 -4
  80. package/dist/docs/skills/ab.html +4 -4
  81. package/dist/docs/skills/create-agent.html +4 -4
  82. package/dist/docs/skills/debug.html +4 -4
  83. package/dist/docs/skills/evals.html +4 -4
  84. package/dist/docs/skills/framework-map.html +4 -4
  85. package/dist/docs/skills/github.html +4 -4
  86. package/dist/docs/skills/hillclimb.html +4 -4
  87. package/dist/docs/skills/index.html +4 -4
  88. package/dist/docs/skills/mcp-auth.html +4 -4
  89. package/dist/docs/skills/otel.html +4 -4
  90. package/dist/docs/skills/setup-slack.html +4 -4
  91. package/dist/docs/storage.html +4 -4
  92. package/dist/docs/templates/agentic-owners.html +4 -4
  93. package/dist/docs/templates/agents-md.html +4 -4
  94. package/dist/docs/templates/code-wiki.html +4 -4
  95. package/dist/docs/templates/demo.html +4 -4
  96. package/dist/docs/templates/pr-autofixer.html +4 -4
  97. package/dist/docs/templates/security-help.html +4 -4
  98. package/dist/docs/templates/security-reviewer.html +4 -4
  99. package/dist/docs/templates/triage.html +4 -4
  100. package/dist/docs/troubleshooting.html +4 -4
  101. package/dist/extensions/cursor-cloud-agents/extension.d.ts +55 -0
  102. package/dist/extensions/cursor-cloud-agents/extension.d.ts.map +1 -0
  103. package/dist/extensions/cursor-cloud-agents/extension.js +64 -0
  104. package/dist/extensions/cursor-cloud-agents/lib/cloud.d.ts +30 -0
  105. package/dist/extensions/cursor-cloud-agents/lib/cloud.d.ts.map +1 -0
  106. package/dist/extensions/cursor-cloud-agents/lib/cloud.js +45 -0
  107. package/dist/extensions/cursor-cloud-agents/lib/fleet.d.ts +25 -0
  108. package/dist/extensions/cursor-cloud-agents/lib/fleet.d.ts.map +1 -0
  109. package/dist/extensions/cursor-cloud-agents/lib/fleet.js +85 -0
  110. package/dist/extensions/cursor-cloud-agents/lib/repos.d.ts +15 -0
  111. package/dist/extensions/cursor-cloud-agents/lib/repos.d.ts.map +1 -0
  112. package/dist/extensions/cursor-cloud-agents/lib/repos.js +55 -0
  113. package/dist/extensions/cursor-cloud-agents/skills/handoff.md +27 -0
  114. package/dist/extensions/cursor-cloud-agents/tools/follow_up.d.ts +4 -0
  115. package/dist/extensions/cursor-cloud-agents/tools/follow_up.d.ts.map +1 -0
  116. package/dist/extensions/cursor-cloud-agents/tools/follow_up.js +37 -0
  117. package/dist/extensions/cursor-cloud-agents/tools/launch.d.ts +4 -0
  118. package/dist/extensions/cursor-cloud-agents/tools/launch.d.ts.map +1 -0
  119. package/dist/extensions/cursor-cloud-agents/tools/launch.js +83 -0
  120. package/dist/extensions/cursor-cloud-agents/tools/list.d.ts +4 -0
  121. package/dist/extensions/cursor-cloud-agents/tools/list.d.ts.map +1 -0
  122. package/dist/extensions/cursor-cloud-agents/tools/list.js +36 -0
  123. package/dist/extensions/cursor-cloud-agents/tools/status.d.ts +4 -0
  124. package/dist/extensions/cursor-cloud-agents/tools/status.d.ts.map +1 -0
  125. package/dist/extensions/cursor-cloud-agents/tools/status.js +41 -0
  126. package/dist/extensions.d.ts +49 -0
  127. package/dist/extensions.d.ts.map +1 -0
  128. package/dist/extensions.js +75 -0
  129. package/dist/index.d.ts +2 -1
  130. package/dist/index.d.ts.map +1 -1
  131. package/dist/index.js +2 -1
  132. package/dist/internal/advertise-tools.d.ts +4 -1
  133. package/dist/internal/advertise-tools.d.ts.map +1 -1
  134. package/dist/internal/advertise-tools.js +20 -1
  135. package/dist/internal/as-of.d.ts +18 -0
  136. package/dist/internal/as-of.d.ts.map +1 -1
  137. package/dist/internal/as-of.js +131 -0
  138. package/dist/internal/cli-deploy.d.ts.map +1 -1
  139. package/dist/internal/cli-deploy.js +64 -19
  140. package/dist/internal/continuation-identity.d.ts.map +1 -1
  141. package/dist/internal/continuation-identity.js +3 -1
  142. package/dist/internal/cursor/hosted-deployment-secrets.d.ts +16 -0
  143. package/dist/internal/cursor/hosted-deployment-secrets.d.ts.map +1 -0
  144. package/dist/internal/cursor/hosted-deployment-secrets.js +61 -0
  145. package/dist/internal/cursor-deployment-relay.d.ts +15 -1
  146. package/dist/internal/cursor-deployment-relay.d.ts.map +1 -1
  147. package/dist/internal/cursor-deployment-relay.js +46 -7
  148. package/dist/internal/deploy-client.d.ts +23 -0
  149. package/dist/internal/deploy-client.d.ts.map +1 -1
  150. package/dist/internal/deploy-client.js +54 -12
  151. package/dist/internal/discovery.d.ts.map +1 -1
  152. package/dist/internal/discovery.js +415 -120
  153. package/dist/internal/distribution.d.ts.map +1 -1
  154. package/dist/internal/distribution.js +5 -0
  155. package/dist/internal/framework-file-storage.d.ts +3 -3
  156. package/dist/internal/framework-file-storage.d.ts.map +1 -1
  157. package/dist/internal/framework-file-storage.js +34 -5
  158. package/dist/internal/hosted-delivery.d.ts +3 -1
  159. package/dist/internal/hosted-delivery.d.ts.map +1 -1
  160. package/dist/internal/hosted-delivery.js +19 -32
  161. package/dist/internal/hosted-execution-diag.d.ts +5 -0
  162. package/dist/internal/hosted-execution-diag.d.ts.map +1 -1
  163. package/dist/internal/hosted-execution-diag.js +5 -0
  164. package/dist/internal/hosted-execution-flush.d.ts +46 -0
  165. package/dist/internal/hosted-execution-flush.d.ts.map +1 -0
  166. package/dist/internal/hosted-execution-flush.js +81 -0
  167. package/dist/internal/mcp-endpoint.js +1 -0
  168. package/dist/internal/mcp-host.d.ts +2 -1
  169. package/dist/internal/mcp-host.d.ts.map +1 -1
  170. package/dist/internal/mcp-host.js +35 -15
  171. package/dist/internal/review-comments.d.ts +1 -1
  172. package/dist/internal/review-comments.d.ts.map +1 -1
  173. package/dist/internal/review-comments.js +4 -4
  174. package/dist/internal/server.d.ts +3 -0
  175. package/dist/internal/server.d.ts.map +1 -1
  176. package/dist/internal/server.js +79 -104
  177. package/dist/internal/session-engine.d.ts +9 -7
  178. package/dist/internal/session-engine.d.ts.map +1 -1
  179. package/dist/internal/session-engine.js +45 -34
  180. package/dist/internal/session-run-log.d.ts +2 -1
  181. package/dist/internal/session-run-log.d.ts.map +1 -1
  182. package/dist/internal/session-run-log.js +2 -1
  183. package/dist/internal/start-log-store.d.ts +60 -0
  184. package/dist/internal/start-log-store.d.ts.map +1 -0
  185. package/dist/internal/start-log-store.js +151 -0
  186. package/dist/internal/tool-policy.d.ts +8 -0
  187. package/dist/internal/tool-policy.d.ts.map +1 -1
  188. package/dist/internal/tool-policy.js +19 -7
  189. package/dist/playground/assets/{index-DVs98vPL.js → index-BnNN1-EK.js} +45 -45
  190. package/dist/playground/assets/index-DBQCwFp0.css +1 -0
  191. package/dist/playground/index.html +2 -2
  192. package/dist/storage-protocol.d.ts +24 -0
  193. package/dist/storage-protocol.d.ts.map +1 -1
  194. package/dist/storage-protocol.js +33 -0
  195. package/dist/storage.d.ts +1 -1
  196. package/dist/storage.d.ts.map +1 -1
  197. package/dist/storage.js +1 -1
  198. package/dist/types.d.ts +118 -6
  199. package/dist/types.d.ts.map +1 -1
  200. package/dist/types.js +29 -1
  201. package/docs/reference/connections.md +31 -0
  202. package/docs/reference/http-api.md +1 -1
  203. package/package.json +18 -4
  204. package/src/bin/agent-serve.ts +11 -2
  205. package/src/channels/deployments/deployments-channel.ts +117 -8
  206. package/src/channels/deployments/types.ts +4 -3
  207. package/src/channels/origin/defaults.ts +143 -0
  208. package/src/channels/origin/index.ts +2 -0
  209. package/src/channels/origin/origin-channel.ts +37 -1
  210. package/src/channels/origin/state.ts +54 -0
  211. package/src/channels/origin/types.ts +24 -0
  212. package/src/channels/slack/api.ts +2 -1
  213. package/src/channels/slack/code-fences.ts +183 -0
  214. package/src/channels/slack/index.ts +1 -0
  215. package/src/channels/slack/live-delivery.ts +16 -13
  216. package/src/connections.ts +18 -1
  217. package/src/extensions/cursor-cloud-agents/extension.ts +118 -0
  218. package/src/extensions/cursor-cloud-agents/lib/cloud.ts +79 -0
  219. package/src/extensions/cursor-cloud-agents/lib/fleet.ts +109 -0
  220. package/src/extensions/cursor-cloud-agents/lib/repos.ts +81 -0
  221. package/src/extensions/cursor-cloud-agents/skills/handoff.md +27 -0
  222. package/src/extensions/cursor-cloud-agents/tools/follow_up.ts +29 -0
  223. package/src/extensions/cursor-cloud-agents/tools/launch.ts +84 -0
  224. package/src/extensions/cursor-cloud-agents/tools/list.ts +31 -0
  225. package/src/extensions/cursor-cloud-agents/tools/status.ts +39 -0
  226. package/src/extensions.ts +98 -0
  227. package/src/index.ts +2 -0
  228. package/src/internal/advertise-tools.ts +37 -12
  229. package/src/internal/as-of.ts +163 -0
  230. package/src/internal/cli-deploy.ts +86 -23
  231. package/src/internal/continuation-identity.ts +3 -1
  232. package/src/internal/cursor/hosted-deployment-secrets.ts +72 -0
  233. package/src/internal/cursor-deployment-relay.ts +65 -8
  234. package/src/internal/deploy-client.ts +73 -18
  235. package/src/internal/discovery.ts +470 -113
  236. package/src/internal/distribution.ts +5 -0
  237. package/src/internal/framework-file-storage.ts +39 -5
  238. package/src/internal/hosted-delivery.ts +38 -63
  239. package/src/internal/hosted-execution-diag.ts +6 -0
  240. package/src/internal/hosted-execution-flush.ts +142 -0
  241. package/src/internal/mcp-endpoint.ts +1 -0
  242. package/src/internal/mcp-host.ts +40 -14
  243. package/src/internal/review-comments.ts +5 -2
  244. package/src/internal/server.ts +81 -100
  245. package/src/internal/session-engine.ts +56 -28
  246. package/src/internal/session-run-log.ts +2 -1
  247. package/src/internal/start-log-store.ts +177 -0
  248. package/src/internal/tool-policy.ts +39 -9
  249. package/src/storage-protocol.ts +37 -0
  250. package/src/storage.ts +1 -0
  251. package/src/types.ts +172 -14
  252. package/dist/docs/assets/chunks/@localSearchIndexroot.j70vvPL4.js +0 -1
  253. package/dist/playground/assets/index-BszoQDc6.css +0 -1
  254. /package/dist/docs/assets/{reference_http-api.md.BEJx9XVj.lean.js → reference_http-api.md.oySXBO8o.lean.js} +0 -0
@@ -27,6 +27,9 @@
27
27
  * `defineConnection({ effects })` filters the listing before names are
28
28
  * assigned: only tools whose MCP annotations classify as an intended
29
29
  * effect are advertised. Unclassified tools are omitted, not guessed.
30
+ * `defineConnection({ tools: [...] })` keeps only the named tools.
31
+ * `disallowedTools` drops names. A name filter that matches nothing on
32
+ * the server fails the turn.
30
33
  * Tools whose `annotations.title` is `do-not-call` are dropped as well
31
34
  * (vendor host-UI / MCP Apps helpers that still carry `readOnlyHint`).
32
35
  */
@@ -39,6 +42,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
39
42
  step((generator = generator.apply(thisArg, _arguments || [])).next());
40
43
  });
41
44
  };
45
+ import { connectionAllowsTool, } from "../types.js";
42
46
  import { brandDefinition } from "./brand.js";
43
47
  import { sanitizeMcpToolName, suffixMcpToolName, } from "./sanitize-mcp-tool-name.js";
44
48
  import { classifyAnnotationsEffect } from "./tool-policy.js";
@@ -70,7 +74,12 @@ export function resolveAdvertisedTools(args) {
70
74
  try {
71
75
  const source = yield sourceFor(connection, args.session, args.hostMcp);
72
76
  const listed = yield source.listTools();
73
- return { connection, ok: true, source, listed };
77
+ return {
78
+ connection,
79
+ ok: true,
80
+ source,
81
+ listed: listed.filter((info) => connectionAllowsTool(connection, info.name)),
82
+ };
74
83
  }
75
84
  catch (error) {
76
85
  return { connection, ok: false, error };
@@ -88,6 +97,16 @@ export function resolveAdvertisedTools(args) {
88
97
  throw new Error(`Failed to list tools on advertised connection "${connection.name}": ${describeError(listing.error)}`, { cause: listing.error });
89
98
  }
90
99
  const { source, listed } = listing;
100
+ if ((connection.tools !== undefined ||
101
+ connection.disallowedTools !== undefined) &&
102
+ listed.length === 0) {
103
+ const error = new Error(`Advertised connection "${connection.name}" tool filter matched no tools on the server.`);
104
+ if (args.onConnectionError !== undefined) {
105
+ args.onConnectionError(connection.name, error);
106
+ continue;
107
+ }
108
+ throw error;
109
+ }
91
110
  const intended = listed.filter((info) => !isDoNotCallTool(info.annotations) &&
92
111
  matchesIntendedEffects(info.annotations, connection.effects));
93
112
  const exposed = exposeListedTools(intended, claimed);
@@ -16,4 +16,22 @@ export declare function assertTimeArgs(tools: readonly {
16
16
  };
17
17
  }[], asOf: string | undefined): void;
18
18
  export declare function timeArgViolation(input: unknown, timeArgs: readonly string[], asOf: string): string | undefined;
19
+ /** Relative expressions or instants after `asOf`. Numeric epochs need `timeArgs`. */
20
+ export declare function forwardTimeArgument(input: unknown, asOf: string): string | undefined;
21
+ /**
22
+ * The string-typed time-window properties a tool's input schema declares.
23
+ * String-typed only: a numeric `from` is a pagination offset more often than
24
+ * an instant, and requiring an ISO value there would break the call.
25
+ */
26
+ export declare function schemaTimeWindowKeys(inputSchema: {
27
+ properties?: Record<string, unknown>;
28
+ } | undefined): string[];
29
+ /**
30
+ * An omitted time window on a vendor tool is not "no window" — the vendor
31
+ * fills it with a live default (Datadog: `now-1h`..`now`), which the walker
32
+ * cannot see because the value is never present. In a frozen session a call
33
+ * that omits a schema-declared window key is refused so the model supplies
34
+ * the bound explicitly, where {@link forwardTimeArgument} then checks it.
35
+ */
36
+ export declare function missingTimeWindow(input: unknown, windowKeys: readonly string[], asOf: string): string | undefined;
19
37
  //# sourceMappingURL=as-of.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"as-of.d.ts","sourceRoot":"","sources":["../../src/internal/as-of.ts"],"names":[],"mappings":"AAEA,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,YAAY,KAAK,EAAE,MAAM,EAMxB;CACF;AAWD,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAS3E;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,M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AM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC;CACxD,EAAE,EACH,IAAI,EAAE,MAAM,GAAG,SAAS,GACvB,IAAI,CAeN;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,SAAS,MAAM,EAAE,EAC3B,IAAI,EAAE,MAAM,GACX,MAAM,GAAG,SAAS,CA0BpB;AA6CD,qFAAqF;AACrF,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,MAAM,GACX,MAAM,GAAG,SAAS,CAmCpB;AAqBD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE;IAAE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GAAG,SAAS,GAChE,MAAM,EAAE,CAoBV;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,OAAO,EACd,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,IAAI,EAAE,MAAM,GACX,MAAM,GAAG,SAAS,CAkBpB"}
@@ -80,3 +80,134 @@ export function timeArgViolation(input, timeArgs, asOf) {
80
80
  }
81
81
  return undefined;
82
82
  }
83
+ // Whole-string only: a query that merely contains "now" is not a bound.
84
+ // Duration-only strings (`30m`, `2h`) and last/this plus a non-window word
85
+ // (`last modified`) are not time bounds. Calendar-aligned `now/d` is.
86
+ const TIME_UNIT = "(?:s|sec|secs|second|seconds|m|min|mins|minute|minutes|h|hr|hrs|hour|hours|d|day|days|w|week|weeks|mo|month|months|y|yr|yrs|year|years)";
87
+ const WINDOW_WORD = "(?:second|seconds|minute|minutes|hour|hours|day|days|week|weeks|month|months|year|years|quarter|quarters|weekend|monday|tuesday|wednesday|thursday|friday|saturday|sunday|morning|afternoon|evening|night)";
88
+ const RELATIVE_TIME_EXPRESSION = new RegExp(`^(?:now(?:\\s*[+-]\\s*\\d+\\s*${TIME_UNIT}\\b.*|/[a-zA-Z]+.*)?|[+-]\\d+\\s*${TIME_UNIT}|today|yesterday|tomorrow|(?:last|this)\\s+${WINDOW_WORD})$`, "i");
89
+ function forwardTimeReason(value, asOf, frozenMs) {
90
+ if (typeof value !== "string") {
91
+ return undefined;
92
+ }
93
+ const trimmed = value.trim();
94
+ if (trimmed === "") {
95
+ return undefined;
96
+ }
97
+ if (RELATIVE_TIME_EXPRESSION.test(trimmed)) {
98
+ return (`Argument ${JSON.stringify(value)} is a relative time expression, ` +
99
+ `which reads against the real present. This session reads the world ` +
100
+ `as of ${asOf}; supply an absolute ISO-8601 instant with a timezone ` +
101
+ `at or before that instant and retry.`);
102
+ }
103
+ const instant = parseInstant(trimmed);
104
+ if (instant !== undefined && instant.getTime() > frozenMs) {
105
+ return (`Argument ${JSON.stringify(value)} is later than the instant this ` +
106
+ `session reads the world as of (${asOf}). Supply a bound at or before ` +
107
+ `that instant and retry.`);
108
+ }
109
+ return undefined;
110
+ }
111
+ /** Relative expressions or instants after `asOf`. Numeric epochs need `timeArgs`. */
112
+ export function forwardTimeArgument(input, asOf) {
113
+ const frozenMs = new Date(asOf).getTime();
114
+ const seen = new Set();
115
+ const walk = (value, depth) => {
116
+ if (depth > 8) {
117
+ return undefined;
118
+ }
119
+ const reason = forwardTimeReason(value, asOf, frozenMs);
120
+ if (reason !== undefined) {
121
+ return reason;
122
+ }
123
+ if (Array.isArray(value)) {
124
+ for (const item of value) {
125
+ const found = walk(item, depth + 1);
126
+ if (found !== undefined) {
127
+ return found;
128
+ }
129
+ }
130
+ return undefined;
131
+ }
132
+ if (typeof value === "object" && value !== null) {
133
+ if (seen.has(value)) {
134
+ return undefined;
135
+ }
136
+ seen.add(value);
137
+ for (const item of Object.values(value)) {
138
+ const found = walk(item, depth + 1);
139
+ if (found !== undefined) {
140
+ return found;
141
+ }
142
+ }
143
+ }
144
+ return undefined;
145
+ };
146
+ return walk(input, 0);
147
+ }
148
+ /**
149
+ * Property names that carry a query's time window when a vendor schema
150
+ * declares them. Deliberately narrower than the embedded-filter key list:
151
+ * these must be safe to *require*, so only unambiguous window names — never
152
+ * `timestamp`/`date`, which name data fields more often than bounds.
153
+ */
154
+ const TIME_WINDOW_KEYS = new Set([
155
+ "from",
156
+ "to",
157
+ "since",
158
+ "until",
159
+ "start",
160
+ "end",
161
+ "start_time",
162
+ "end_time",
163
+ "starttime",
164
+ "endtime",
165
+ ]);
166
+ /**
167
+ * The string-typed time-window properties a tool's input schema declares.
168
+ * String-typed only: a numeric `from` is a pagination offset more often than
169
+ * an instant, and requiring an ISO value there would break the call.
170
+ */
171
+ export function schemaTimeWindowKeys(inputSchema) {
172
+ const properties = inputSchema === null || inputSchema === void 0 ? void 0 : inputSchema.properties;
173
+ if (properties === undefined) {
174
+ return [];
175
+ }
176
+ const keys = [];
177
+ for (const [name, spec] of Object.entries(properties)) {
178
+ if (!TIME_WINDOW_KEYS.has(name.toLowerCase())) {
179
+ continue;
180
+ }
181
+ const type = typeof spec === "object" && spec !== null
182
+ ? spec.type
183
+ : undefined;
184
+ const types = Array.isArray(type) ? type : [type];
185
+ if (types.includes("string")) {
186
+ keys.push(name);
187
+ }
188
+ }
189
+ return keys;
190
+ }
191
+ /**
192
+ * An omitted time window on a vendor tool is not "no window" — the vendor
193
+ * fills it with a live default (Datadog: `now-1h`..`now`), which the walker
194
+ * cannot see because the value is never present. In a frozen session a call
195
+ * that omits a schema-declared window key is refused so the model supplies
196
+ * the bound explicitly, where {@link forwardTimeArgument} then checks it.
197
+ */
198
+ export function missingTimeWindow(input, windowKeys, asOf) {
199
+ if (windowKeys.length === 0) {
200
+ return undefined;
201
+ }
202
+ const record = typeof input === "object" && input !== null
203
+ ? input
204
+ : {};
205
+ const missing = windowKeys.filter((key) => record[key] === undefined);
206
+ if (missing.length === 0) {
207
+ return undefined;
208
+ }
209
+ return (`This tool fills omitted time bounds (${missing.join(", ")}) with a ` +
210
+ `live default window, which reads the real present. This session reads ` +
211
+ `the world as of ${asOf}; supply each bound explicitly as an absolute ` +
212
+ `ISO-8601 instant with a timezone at or before that instant and retry.`);
213
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"cli-deploy.d.ts","sourceRoot":"","sources":["../../src/internal/cli-deploy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAiBH,OAAO,EAKL,sBAAsB,EAevB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,KAAK,SAAS,EAAwB,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EACL,KAAK,aAAa,EAMnB,MAAM,gBAAgB,CAAC;AAexB,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;IAC7D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+DAA+D;IAC/D,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,gFAAgF;IAChF,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,kBAAkB;IAClB,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;IACzB,iFAAiF;IACj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AAC,MAAM,CAAC,CA0DjB;AAMD,wBAAsB,SAAS,CAC7B,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,MAAM,CAAC,CAuCjB;AAMD,wBAAsB,cAAc,CAClC,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,MAAM,CAAC,CA4BjB;AAMD,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,MAAM,CAAC,CA6BjB;AAqBD,wBAAsB,aAAa,CACjC,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,KAAK,EAAE,MAAM,EAAE,EACf,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,MAAM,CAAC,CAoFjB;AAED,wBAAsB,cAAc,CAClC,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,MAAM,CAAC,CAsCjB;AAED,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,MAAM,CAAC,CAqCjB;AAoED,wEAAwE;AACxE,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,CAAC,cAAc,GAC5B,MAAM,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAuCnC"}
@@ -161,6 +161,10 @@ export function cmdDeploy(options) {
161
161
  if (manifests.every((manifest) => manifest.architecture === "v2")) {
162
162
  return deployAgentsdkApplication(ctx, options, targets, {
163
163
  hasScmChannels: manifests.some((manifest) => manifest.hasScmChannels),
164
+ declaredSecretNames: [
165
+ ...new Set(manifests.flatMap((manifest) => { var _a; var _b; return (_b = (_a = manifest.hosting) === null || _a === void 0 ? void 0 : _a.secretNames) !== null && _b !== void 0 ? _b : []; })),
166
+ ],
167
+ hasDeploymentsChannels: manifests.some((manifest) => manifest.hasDeploymentsChannels),
164
168
  });
165
169
  }
166
170
  if (!ctx.json &&
@@ -498,6 +502,8 @@ function deployOne(ctx, options, target, extras) {
498
502
  agentPath,
499
503
  repositories: options.cursorEventsRepos,
500
504
  hasScmChannels: manifest.hasScmChannels,
505
+ declaredSecretNames: hosting === null || hosting === void 0 ? void 0 : hosting.secretNames,
506
+ hasDeploymentsChannels: manifest.hasDeploymentsChannels,
501
507
  multiTenant: options.multiTenant === true,
502
508
  });
503
509
  }
@@ -639,13 +645,7 @@ function deployAgentsdkApplication(ctx, options, targets, declarations) {
639
645
  .map((component) => { var _a; return ` component: ${component.componentKey} (${(_a = component.agentPath) !== null && _a !== void 0 ? _a : "."})\n`; })
640
646
  .join(""));
641
647
  }
642
- // Components bake sequentially on the control plane, so the default wait
643
- // budget is per component; otherwise a 2+ component deploy routinely hits
644
- // the client-side timeout while the server-side deploy is still fine. An
645
- // explicitly passed timeout always wins.
646
- const waitCtx = options.timeoutMs === undefined
647
- ? Object.assign(Object.assign({}, ctx), { timeoutMs: ctx.timeoutMs * targets.length }) : ctx;
648
- return deployOneAgentsdk(waitCtx, undefined, {
648
+ return deployOneAgentsdk(ctx, undefined, {
649
649
  slug,
650
650
  gitRepoUrl,
651
651
  gitRef,
@@ -653,6 +653,8 @@ function deployAgentsdkApplication(ctx, options, targets, declarations) {
653
653
  components,
654
654
  repositories: options.cursorEventsRepos,
655
655
  hasScmChannels: declarations.hasScmChannels,
656
+ declaredSecretNames: declarations.declaredSecretNames,
657
+ hasDeploymentsChannels: declarations.hasDeploymentsChannels,
656
658
  multiTenant: options.multiTenant === true,
657
659
  });
658
660
  });
@@ -718,6 +720,8 @@ function deployOneAgentsdk(ctx, extras, args) {
718
720
  ctx.err(`Deployment ${slug} ended ${detail.status}${deployFailureDetail(detail.lastError)}\n`);
719
721
  return 1;
720
722
  }
723
+ warnMissingSecrets(ctx, slug, args.declaredSecretNames, detail.secretNames);
724
+ const watchesRepositories = args.hasScmChannels || args.hasDeploymentsChannels === true;
721
725
  ctx.out(`Deployed ${slug} (team ${ctx.teamId})\n` +
722
726
  ` status: running\n` +
723
727
  ` architecture: v2\n` +
@@ -728,13 +732,14 @@ function deployOneAgentsdk(ctx, extras, args) {
728
732
  : ` components: ${args.components
729
733
  .map((component) => component.componentKey)
730
734
  .join(", ")}\n`) +
731
- (detail.repositories === undefined || !args.hasScmChannels
735
+ (detail.repositories === undefined || !watchesRepositories
732
736
  ? ""
733
737
  : ` watching: ${detail.repositories.length === 0 ? "(nothing)" : detail.repositories.join(", ")}\n`));
734
- // An agent with GitHub/Origin channels bound to no repository scope gets
735
- // no deliveries at all, which is otherwise invisible in this output.
736
- if (args.hasScmChannels && ((_a = detail.repositories) === null || _a === void 0 ? void 0 : _a.length) === 0) {
737
- ctx.err(`warning: ${slug} watches no repositories, so its GitHub/Origin channels receive no events.\n` +
738
+ // An agent with GitHub/Origin/deployments channels bound to no repository
739
+ // scope gets no deliveries at all (deployments channels receive the
740
+ // watched repos' deployment events), which is otherwise invisible here.
741
+ if (watchesRepositories && ((_a = detail.repositories) === null || _a === void 0 ? void 0 : _a.length) === 0) {
742
+ ctx.err(`warning: ${slug} watches no repositories, so its GitHub/Origin/deployments channels receive no events.\n` +
738
743
  ` Redeploy with --cursor-events-repo <owner>/<name> to set the scope.\n`);
739
744
  }
740
745
  return 0;
@@ -833,6 +838,7 @@ function readDeployManifest(dir) {
833
838
  const kind = (_a = channel.definition.meta) === null || _a === void 0 ? void 0 : _a.kind;
834
839
  return kind === "github" || kind === "origin";
835
840
  }),
841
+ hasDeploymentsChannels: project.channels.some((channel) => { var _a; return ((_a = channel.definition.meta) === null || _a === void 0 ? void 0 : _a.kind) === "deployments"; }),
836
842
  };
837
843
  });
838
844
  }
@@ -1013,6 +1019,9 @@ function renderAgentkitDeploymentStatus(ctx, detail) {
1013
1019
  ? "(nothing)"
1014
1020
  : detail.repositories.join(", ")}`);
1015
1021
  }
1022
+ if (detail.secretNames !== undefined && detail.secretNames.length > 0) {
1023
+ lines.push(` secrets: ${detail.secretNames.join(", ")}`);
1024
+ }
1016
1025
  if (detail.lastError !== null && detail.lastError !== undefined) {
1017
1026
  lines.push(` last error: ${sanitizeCustomerError(detail.lastError)}`);
1018
1027
  }
@@ -1198,6 +1207,20 @@ export function cmdRotatePodCredential(slug, options) {
1198
1207
  // ============================================================================
1199
1208
  // secrets set|list|unset
1200
1209
  // ============================================================================
1210
+ function secretDeploymentArchitecture(ctx, slug) {
1211
+ return __awaiter(this, void 0, void 0, function* () {
1212
+ try {
1213
+ yield ctx.client.getAgentkitDeploy({ teamId: ctx.teamId, slug });
1214
+ return "v2";
1215
+ }
1216
+ catch (error) {
1217
+ if (error instanceof DeployApiError && error.status === 404) {
1218
+ return "v1";
1219
+ }
1220
+ throw error;
1221
+ }
1222
+ });
1223
+ }
1201
1224
  export function cmdSecretsSet(slug, specs, options) {
1202
1225
  return __awaiter(this, void 0, void 0, function* () {
1203
1226
  var _a, _b, _c;
@@ -1248,11 +1271,19 @@ export function cmdSecretsSet(slug, specs, options) {
1248
1271
  }
1249
1272
  let secretNames;
1250
1273
  try {
1251
- secretNames = yield ctx.client.setSecrets({
1252
- teamId: ctx.teamId,
1253
- slug,
1254
- secrets,
1255
- });
1274
+ const architecture = yield secretDeploymentArchitecture(ctx, slug);
1275
+ secretNames =
1276
+ architecture === "v2"
1277
+ ? yield ctx.client.setAgentkitSecrets({
1278
+ teamId: ctx.teamId,
1279
+ slug,
1280
+ secrets,
1281
+ })
1282
+ : yield ctx.client.setSecrets({
1283
+ teamId: ctx.teamId,
1284
+ slug,
1285
+ secrets,
1286
+ });
1256
1287
  }
1257
1288
  catch (error) {
1258
1289
  return renderApiError(error, ctx.err);
@@ -1280,7 +1311,11 @@ export function cmdSecretsList(slug, options) {
1280
1311
  }
1281
1312
  let secrets;
1282
1313
  try {
1283
- secrets = yield ctx.client.listSecrets({ teamId: ctx.teamId, slug });
1314
+ const architecture = yield secretDeploymentArchitecture(ctx, slug);
1315
+ secrets =
1316
+ architecture === "v2"
1317
+ ? yield ctx.client.listAgentkitSecrets({ teamId: ctx.teamId, slug })
1318
+ : yield ctx.client.listSecrets({ teamId: ctx.teamId, slug });
1284
1319
  }
1285
1320
  catch (error) {
1286
1321
  return renderApiError(error, ctx.err);
@@ -1309,7 +1344,17 @@ export function cmdSecretsUnset(slug, name, options) {
1309
1344
  return ctx;
1310
1345
  }
1311
1346
  try {
1312
- yield ctx.client.deleteSecret({ teamId: ctx.teamId, slug, name });
1347
+ const architecture = yield secretDeploymentArchitecture(ctx, slug);
1348
+ if (architecture === "v2") {
1349
+ yield ctx.client.deleteAgentkitSecret({
1350
+ teamId: ctx.teamId,
1351
+ slug,
1352
+ name,
1353
+ });
1354
+ }
1355
+ else {
1356
+ yield ctx.client.deleteSecret({ teamId: ctx.teamId, slug, name });
1357
+ }
1313
1358
  }
1314
1359
  catch (error) {
1315
1360
  if (error instanceof DeployApiError && error.status === 404) {
@@ -1 +1 @@
1
- {"version":3,"file":"continuation-identity.d.ts","sourceRoot":"","sources":["../../src/internal/continuation-identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,MAAM,MAAM,gBAAgB,GACxB,IAAI,GACJ,OAAO,GACP,QAAQ,GACR,WAAW,GACX,YAAY,CAAC;AAEjB,eAAO,MAAM,sBAAsB,YACjC,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EACrB,2BAA2B,EAC3B,SAAS,EACT,SAAS,CACD,CAAC;AAEX,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAC3E,MAAM,MAAM,oBAAoB,GAAG,oBAAoB,CAAC;AAC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CAAC,QAAQ,CAAC,EAChE,OAAO,EAAE,mBAAmB,GAAG,SAAS,GACvC,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,KAAK,OAAO,CAAC,QAAQ,CAAC,CAS5D"}
@@ -77,7 +77,9 @@ export const BUILTINS = [
77
77
  {
78
78
  type: "deployment",
79
79
  kind: "deployments",
80
- events: ["deployment.created", "deployment.succeeded"],
80
+ // All three factory stream events carry `deploymentId`; keep in
81
+ // lockstep with the control plane's `conversation/deployments.ts`.
82
+ events: ["deployment.created", "deployment.succeeded", "deployment.failed"],
81
83
  format: "deployments:{deploymentId}",
82
84
  },
83
85
  ];
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Task-time application secrets for hosted v2 freeze restores.
3
+ *
4
+ * The deployment host rewrites this tmpfs document before each admission and
5
+ * execution request. July reloads it synchronously because the process was
6
+ * already running in the frozen snapshot when the task-specific values
7
+ * arrived.
8
+ */
9
+ export declare const DEFAULT_AGENT_SERVE_DEPLOYMENT_SECRETS_FILE = "/run/cursor/secrets/AGENT_SERVE_DEPLOYMENT_SECRETS.json";
10
+ /**
11
+ * Refresh `process.env` from the latest bound document. A missing or malformed
12
+ * file is a no-op; an empty valid document removes values loaded by an earlier
13
+ * bind after the deployment secret was unset.
14
+ */
15
+ export declare function refreshBoundDeploymentSecrets(path?: string): void;
16
+ //# sourceMappingURL=hosted-deployment-secrets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hosted-deployment-secrets.d.ts","sourceRoot":"","sources":["../../../src/internal/cursor/hosted-deployment-secrets.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,eAAO,MAAM,2CAA2C,4DACG,CAAC;AAqC5D;;;;GAIG;AACH,wBAAgB,6BAA6B,CAC3C,IAAI,GAAE,MAAoD,GACzD,IAAI,CAeN"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Task-time application secrets for hosted v2 freeze restores.
3
+ *
4
+ * The deployment host rewrites this tmpfs document before each admission and
5
+ * execution request. July reloads it synchronously because the process was
6
+ * already running in the frozen snapshot when the task-specific values
7
+ * arrived.
8
+ */
9
+ import { readFileSync } from "node:fs";
10
+ export const DEFAULT_AGENT_SERVE_DEPLOYMENT_SECRETS_FILE = "/run/cursor/secrets/AGENT_SERVE_DEPLOYMENT_SECRETS.json";
11
+ const SECRET_NAME_PATTERN = /^[A-Z][A-Z0-9_]{0,63}$/;
12
+ const appliedSecretNames = new Set();
13
+ function parseBoundSecrets(path) {
14
+ let parsed;
15
+ try {
16
+ parsed = JSON.parse(readFileSync(path, "utf8"));
17
+ }
18
+ catch (_a) {
19
+ return undefined;
20
+ }
21
+ if (parsed === null || typeof parsed !== "object") {
22
+ return undefined;
23
+ }
24
+ const envelope = parsed;
25
+ if (envelope.v !== 1 ||
26
+ envelope.secrets === null ||
27
+ typeof envelope.secrets !== "object" ||
28
+ Array.isArray(envelope.secrets)) {
29
+ return undefined;
30
+ }
31
+ const secrets = {};
32
+ for (const [name, value] of Object.entries(envelope.secrets)) {
33
+ if (SECRET_NAME_PATTERN.test(name) &&
34
+ !name.startsWith("CURSOR_") &&
35
+ typeof value === "string") {
36
+ secrets[name] = value;
37
+ }
38
+ }
39
+ return secrets;
40
+ }
41
+ /**
42
+ * Refresh `process.env` from the latest bound document. A missing or malformed
43
+ * file is a no-op; an empty valid document removes values loaded by an earlier
44
+ * bind after the deployment secret was unset.
45
+ */
46
+ export function refreshBoundDeploymentSecrets(path = DEFAULT_AGENT_SERVE_DEPLOYMENT_SECRETS_FILE) {
47
+ const secrets = parseBoundSecrets(path);
48
+ if (secrets === undefined) {
49
+ return;
50
+ }
51
+ for (const name of appliedSecretNames) {
52
+ if (!(name in secrets)) {
53
+ delete process.env[name];
54
+ }
55
+ }
56
+ appliedSecretNames.clear();
57
+ for (const [name, value] of Object.entries(secrets)) {
58
+ process.env[name] = value;
59
+ appliedSecretNames.add(name);
60
+ }
61
+ }
@@ -18,22 +18,36 @@ export interface ResolvedSubscription {
18
18
  environments: string[];
19
19
  events: Set<DeploymentEventType>;
20
20
  }
21
+ export type DeploymentSubscriptionSource = readonly ResolvedSubscription[] | (() => readonly ResolvedSubscription[]);
21
22
  export interface DeploymentEventRelayOptions {
22
23
  baseUrl: string;
23
24
  apiKey: string;
24
25
  stateDir: string;
25
- subscriptions: readonly ResolvedSubscription[];
26
+ /**
27
+ * Snapshot or a getter. A getter is re-read on every registration
28
+ * heartbeat so a channel that refreshes `deploySourceUris` after start
29
+ * can add sources without restarting the relay.
30
+ */
31
+ subscriptions: DeploymentSubscriptionSource;
26
32
  dispatch: (event: DeploymentEvent) => Promise<void>;
27
33
  logger: (line: string) => void;
28
34
  fetchImpl?: typeof fetch;
29
35
  pollWaitMs?: number;
30
36
  }
37
+ /** Current subscriptions: a live getter, otherwise the snapshot. */
38
+ export declare function currentDeploymentSubscriptions(subscriptions: DeploymentSubscriptionSource): readonly ResolvedSubscription[];
31
39
  /** Normalize the channel's `deploySourceUris` option into concrete subscriptions. */
32
40
  export declare function resolveDeploymentSubscriptions(options: {
33
41
  deploySourceUris: readonly (string | DeploymentSubscription)[];
34
42
  environments?: readonly string[];
35
43
  events?: readonly DeploymentEventType[];
36
44
  }): ResolvedSubscription[];
45
+ /**
46
+ * Union per-channel subscriptions, widening events and environments when
47
+ * the same deploy source appears more than once. An empty environment
48
+ * list means every environment and absorbs a narrower list.
49
+ */
50
+ export declare function mergeResolvedSubscriptions(groups: readonly (readonly ResolvedSubscription[])[]): ResolvedSubscription[];
37
51
  /** Whether one confirmed subscription wants this event. */
38
52
  export declare function deploymentEventMatches(subscription: ResolvedSubscription, envelope: DeploymentEvent): boolean;
39
53
  /** One channel the host can deliver a deployment event to. */
@@ -1 +1 @@
1
- {"version":3,"file":"cursor-deployment-relay.d.ts","sourceRoot":"","sources":["../../src/internal/cursor-deployment-relay.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACnB,sBAAsB,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