@cursor/july 0.1.84 → 0.1.85

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 (86) hide show
  1. package/dist/channels/deployments/deployments-channel.d.ts +2 -2
  2. package/dist/channels/deployments/deployments-channel.d.ts.map +1 -1
  3. package/dist/channels/deployments/deployments-channel.js +7 -6
  4. package/dist/channels/deployments/index.d.ts +2 -3
  5. package/dist/channels/deployments/index.d.ts.map +1 -1
  6. package/dist/channels/deployments/index.js +2 -3
  7. package/dist/channels/deployments/types.d.ts +14 -14
  8. package/dist/channels/deployments/types.d.ts.map +1 -1
  9. package/dist/docs/404.html +2 -2
  10. package/dist/docs/ab.html +3 -3
  11. package/dist/docs/assets/{app.kqdC1N7p.js → app.DUOPbN18.js} +1 -1
  12. package/dist/docs/assets/chunks/@localSearchIndexroot.CxCtxfDE.js +1 -0
  13. package/dist/docs/assets/chunks/{VPLocalSearchBox.DXDE2WgG.js → VPLocalSearchBox.CmWbGcGk.js} +1 -1
  14. package/dist/docs/assets/chunks/{theme.DFYqbyta.js → theme.S57OeOLA.js} +2 -2
  15. package/dist/docs/assets/{reference_channels.md.G5GysZ7e.js → reference_channels.md.CboFd5IH.js} +1 -1
  16. package/dist/docs/building-with-agents.html +3 -3
  17. package/dist/docs/concepts.html +3 -3
  18. package/dist/docs/deployment.html +3 -3
  19. package/dist/docs/evals.html +3 -3
  20. package/dist/docs/example-agents/approval-buddy.html +3 -3
  21. package/dist/docs/example-agents/benny.html +3 -3
  22. package/dist/docs/example-agents/bugbot.html +3 -3
  23. package/dist/docs/example-agents/codebase-wiki.html +3 -3
  24. package/dist/docs/example-agents/codeowners-review.html +3 -3
  25. package/dist/docs/example-agents/concierge.html +3 -3
  26. package/dist/docs/example-agents/fsd.html +3 -3
  27. package/dist/docs/example-agents/index.html +3 -3
  28. package/dist/docs/example-agents/knowledge-base.html +3 -3
  29. package/dist/docs/example-agents/oncall.html +3 -3
  30. package/dist/docs/example-agents/security-reviewer.html +3 -3
  31. package/dist/docs/example-agents/slack-agent.html +3 -3
  32. package/dist/docs/example-agents/weather-agent.html +3 -3
  33. package/dist/docs/guides/agent-to-agent.html +3 -3
  34. package/dist/docs/guides/cloud-runtime.html +3 -3
  35. package/dist/docs/guides/convert-automation.html +3 -3
  36. package/dist/docs/guides/github.html +3 -3
  37. package/dist/docs/guides/human-in-the-loop.html +3 -3
  38. package/dist/docs/guides/mcp-oauth.html +3 -3
  39. package/dist/docs/guides/opentelemetry.html +3 -3
  40. package/dist/docs/guides/slack.html +3 -3
  41. package/dist/docs/guides/webhooks.html +3 -3
  42. package/dist/docs/hashmap.json +1 -1
  43. package/dist/docs/hillclimbing.html +3 -3
  44. package/dist/docs/index.html +3 -3
  45. package/dist/docs/quickstart.html +3 -3
  46. package/dist/docs/reference/agent-config.html +3 -3
  47. package/dist/docs/reference/artifacts.html +3 -3
  48. package/dist/docs/reference/channels.html +5 -5
  49. package/dist/docs/reference/cli.html +3 -3
  50. package/dist/docs/reference/connections.html +3 -3
  51. package/dist/docs/reference/hooks.html +3 -3
  52. package/dist/docs/reference/http-api.html +3 -3
  53. package/dist/docs/reference/instructions.html +3 -3
  54. package/dist/docs/reference/playground.html +3 -3
  55. package/dist/docs/reference/project-layout.html +3 -3
  56. package/dist/docs/reference/prompt.html +3 -3
  57. package/dist/docs/reference/schedules.html +3 -3
  58. package/dist/docs/reference/sessions.html +3 -3
  59. package/dist/docs/reference/skills.html +3 -3
  60. package/dist/docs/reference/subagents.html +3 -3
  61. package/dist/docs/reference/tools.html +3 -3
  62. package/dist/docs/scaffolding-agents.html +3 -3
  63. package/dist/docs/storage.html +3 -3
  64. package/dist/docs/templates/agentic-owners.html +3 -3
  65. package/dist/docs/templates/demo.html +3 -3
  66. package/dist/docs/templates/pr-autofixer.html +3 -3
  67. package/dist/docs/templates/security-reviewer.html +3 -3
  68. package/dist/docs/templates/triage.html +3 -3
  69. package/dist/docs/troubleshooting.html +3 -3
  70. package/dist/internal/cursor-deployment-relay.d.ts +4 -4
  71. package/dist/internal/cursor-deployment-relay.d.ts.map +1 -1
  72. package/dist/internal/cursor-deployment-relay.js +33 -32
  73. package/dist/internal/server.js +13 -13
  74. package/dist/playground/assets/index-CMe7imuc.css +1 -0
  75. package/dist/playground/assets/{index-Cspgk9jC.js → index-JaFLlugp.js} +45 -45
  76. package/dist/playground/index.html +2 -2
  77. package/docs/reference/channels.md +13 -11
  78. package/package.json +1 -1
  79. package/src/channels/deployments/deployments-channel.ts +7 -6
  80. package/src/channels/deployments/index.ts +2 -3
  81. package/src/channels/deployments/types.ts +14 -14
  82. package/src/internal/cursor-deployment-relay.ts +38 -36
  83. package/src/internal/server.ts +13 -13
  84. package/dist/docs/assets/chunks/@localSearchIndexroot.BqhvUA76.js +0 -1
  85. package/dist/playground/assets/index-ChETdG-_.css +0 -1
  86. /package/dist/docs/assets/{reference_channels.md.G5GysZ7e.lean.js → reference_channels.md.CboFd5IH.lean.js} +0 -0
@@ -29,17 +29,17 @@ var __rest = (this && this.__rest) || function (s, e) {
29
29
  };
30
30
  import { CursorRelayCore } from "./cursor-relay-core.js";
31
31
  const DEFAULT_EVENTS = ["deployment.succeeded"];
32
- /** Normalize the channel's `repos` option into concrete subscriptions. */
32
+ /** Normalize the channel's `deploySourceUris` option into concrete subscriptions. */
33
33
  export function resolveDeploymentSubscriptions(options) {
34
34
  var _a, _b, _c, _d;
35
- const byRepo = new Map();
36
- for (const entry of options.repos) {
37
- const subscription = typeof entry === "string" ? { repo: entry } : entry;
38
- // Case-folded only: `Deployment.repository` has no documented format, and
39
- // the server keys subscriptions the same way.
40
- const repo = subscription.repo.trim().toLowerCase();
41
- if (repo === "") {
42
- throw new Error(`deploymentsChannel: invalid repo "${subscription.repo}".`);
35
+ const bySource = new Map();
36
+ for (const entry of options.deploySourceUris) {
37
+ const subscription = typeof entry === "string" ? { deploySourceUri: entry } : entry;
38
+ // Case-folded only: `Deployment.deploy_source_uri` has no documented
39
+ // format, and the server keys subscriptions the same way.
40
+ const deploySourceUri = subscription.deploySourceUri.trim().toLowerCase();
41
+ if (deploySourceUri === "") {
42
+ throw new Error(`deploymentsChannel: invalid deploy source "${subscription.deploySourceUri}".`);
43
43
  }
44
44
  const environments = [
45
45
  ...new Set(((_b = (_a = subscription.environments) !== null && _a !== void 0 ? _a : options.environments) !== null && _b !== void 0 ? _b : [])
@@ -48,13 +48,13 @@ export function resolveDeploymentSubscriptions(options) {
48
48
  ];
49
49
  const events = new Set((_d = (_c = subscription.events) !== null && _c !== void 0 ? _c : options.events) !== null && _d !== void 0 ? _d : DEFAULT_EVENTS);
50
50
  if (events.size === 0) {
51
- throw new Error(`deploymentsChannel: repo "${repo}" subscribes to no events.`);
51
+ throw new Error(`deploymentsChannel: deploy source "${deploySourceUri}" subscribes to no events.`);
52
52
  }
53
- // Later entries for the same repo widen the earlier one rather than
54
- // silently replacing it.
55
- const existing = byRepo.get(repo);
53
+ // Later entries for the same deploy source widen the earlier one rather
54
+ // than silently replacing it.
55
+ const existing = bySource.get(deploySourceUri);
56
56
  if (existing === undefined) {
57
- byRepo.set(repo, { repo, environments, events });
57
+ bySource.set(deploySourceUri, { deploySourceUri, environments, events });
58
58
  continue;
59
59
  }
60
60
  for (const event of events)
@@ -65,9 +65,10 @@ export function resolveDeploymentSubscriptions(options) {
65
65
  : [...new Set([...existing.environments, ...environments])];
66
66
  }
67
67
  // Empty is legal here and means "this channel wants nothing", which is how
68
- // an env-configured channel stays inert without a repo list. The wire-level
69
- // empty list means deregister, so the host simply never registers it.
70
- return [...byRepo.values()];
68
+ // an env-configured channel stays inert without a deploy-source list. The
69
+ // wire-level empty list means deregister, so the host simply never
70
+ // registers it.
71
+ return [...bySource.values()];
71
72
  }
72
73
  /** Whether one confirmed subscription wants this event. */
73
74
  export function deploymentEventMatches(subscription, envelope) {
@@ -89,7 +90,7 @@ export function deploymentEventMatches(subscription, envelope) {
89
90
  export function fanOutDeploymentEvent(input) {
90
91
  return __awaiter(this, void 0, void 0, function* () {
91
92
  const { event, logger } = input;
92
- const matched = input.targets.filter((target) => target.subscriptions.some((subscription) => subscription.repo === event.repo &&
93
+ const matched = input.targets.filter((target) => target.subscriptions.some((subscription) => subscription.deploySourceUri === event.deploySourceUri &&
93
94
  deploymentEventMatches(subscription, event)));
94
95
  const failures = [];
95
96
  for (const target of matched) {
@@ -101,7 +102,7 @@ export function fanOutDeploymentEvent(input) {
101
102
  logger(`[agent-sdk] deployment-events: ${target.name} failed on ${event.eventId}: ${error instanceof Error ? error.message : String(error)}`);
102
103
  }
103
104
  }
104
- logger(`[agent-sdk] deployment-events: ${event.eventType} ${event.repo}@${event.sha} (${event.environment}) → ${matched.length - failures.length}/${matched.length} channel(s)`);
105
+ logger(`[agent-sdk] deployment-events: ${event.eventType} ${event.deploySourceUri}@${event.deployVersion} (${event.environment}) → ${matched.length - failures.length}/${matched.length} channel(s)`);
105
106
  if (failures.length > 0 && failures.length === matched.length) {
106
107
  throw new Error(`deployment-events: every subscribed channel failed on ${event.eventId} (${failures.join(", ")})`);
107
108
  }
@@ -111,7 +112,7 @@ export class DeploymentEventRelay {
111
112
  constructor(options) {
112
113
  this.options = options;
113
114
  this.subscribed = new Map();
114
- this.loggedSkippedRepos = new Set();
115
+ this.loggedSkippedSources = new Set();
115
116
  const adapter = {
116
117
  logPrefix: "deployment-events",
117
118
  subscribePath: "/v0/deployment-events/subscriptions",
@@ -119,7 +120,7 @@ export class DeploymentEventRelay {
119
120
  buildRegistrationBody: (consumerId) => ({
120
121
  consumerId,
121
122
  subscriptions: options.subscriptions.map((subscription) => ({
122
- repo: subscription.repo,
123
+ deploySourceUri: subscription.deploySourceUri,
123
124
  environments: subscription.environments,
124
125
  events: [...subscription.events],
125
126
  })),
@@ -134,17 +135,17 @@ export class DeploymentEventRelay {
134
135
  var _a, _b;
135
136
  const result = json;
136
137
  this.subscribed = new Map();
137
- this.loggedSkippedRepos.clear();
138
+ this.loggedSkippedSources.clear();
138
139
  const lines = [];
139
140
  const confirmed = [];
140
- for (const status of (_a = result.repos) !== null && _a !== void 0 ? _a : []) {
141
- const wanted = options.subscriptions.find((subscription) => subscription.repo === status.repo);
141
+ for (const status of (_a = result.deploySourceUris) !== null && _a !== void 0 ? _a : []) {
142
+ const wanted = options.subscriptions.find((subscription) => subscription.deploySourceUri === status.deploySourceUri);
142
143
  if (!status.isSubscribed || wanted === undefined) {
143
- lines.push(`not subscribed to ${status.repo}: ${(_b = status.detail) !== null && _b !== void 0 ? _b : "unknown reason"}`);
144
+ lines.push(`not subscribed to ${status.deploySourceUri}: ${(_b = status.detail) !== null && _b !== void 0 ? _b : "unknown reason"}`);
144
145
  continue;
145
146
  }
146
- this.subscribed.set(status.repo, wanted);
147
- confirmed.push(status.repo);
147
+ this.subscribed.set(status.deploySourceUri, wanted);
148
+ confirmed.push(status.deploySourceUri);
148
149
  }
149
150
  if (confirmed.length > 0) {
150
151
  const kinds = [
@@ -177,14 +178,14 @@ export class DeploymentEventRelay {
177
178
  const envelope = event;
178
179
  if (envelope === null ||
179
180
  typeof envelope !== "object" ||
180
- typeof envelope.repo !== "string") {
181
+ typeof envelope.deploySourceUri !== "string") {
181
182
  return false;
182
183
  }
183
- const subscription = this.subscribed.get(envelope.repo);
184
+ const subscription = this.subscribed.get(envelope.deploySourceUri);
184
185
  if (subscription === undefined) {
185
- if (!this.loggedSkippedRepos.has(envelope.repo)) {
186
- this.loggedSkippedRepos.add(envelope.repo);
187
- this.options.logger(`[agent-sdk] deployment-events: skipping events for ${envelope.repo}: not in this host's subscription (another consumer of this API key likely subscribed it)`);
186
+ if (!this.loggedSkippedSources.has(envelope.deploySourceUri)) {
187
+ this.loggedSkippedSources.add(envelope.deploySourceUri);
188
+ this.options.logger(`[agent-sdk] deployment-events: skipping events for ${envelope.deploySourceUri}: not in this host's subscription (another consumer of this API key likely subscribed it)`);
188
189
  }
189
190
  return false;
190
191
  }
@@ -1745,7 +1745,7 @@ function collectCursorDeploymentTargets(runtimes, skipped) {
1745
1745
  }
1746
1746
  const subscriptions = resolveDeploymentSubscriptions(options);
1747
1747
  if (subscriptions.length === 0) {
1748
- // Declared the channel but named no repositories — usually an unset
1748
+ // Declared the channel but named no deploy sources — usually an unset
1749
1749
  // env var. Say so rather than starting a relay that receives nothing.
1750
1750
  skipped.push(`${runtime.slug || runtime.project.name}/${channel.id}`);
1751
1751
  continue;
@@ -1758,7 +1758,7 @@ function collectCursorDeploymentTargets(runtimes, skipped) {
1758
1758
  /**
1759
1759
  * Cursor deployment-events relay: automatic when a mounted agent authored
1760
1760
  * `deploymentsChannel({ ... })`. One relay per process reads
1761
- * `/v0/deployment-events` for the union of every channel's repositories, and
1761
+ * `/v0/deployment-events` for the union of every channel's deploy sources, and
1762
1762
  * each event is routed to the channels that asked for it — the same ownership
1763
1763
  * `startCursorSlackRelay` and `startCursorEventRelay` have.
1764
1764
  */
@@ -1768,24 +1768,24 @@ function startCursorDeploymentRelay(input) {
1768
1768
  const skipped = [];
1769
1769
  const targets = collectCursorDeploymentTargets(runtimes, skipped);
1770
1770
  if (skipped.length > 0) {
1771
- logger(`[agent-sdk] deployment-events: no repositories declared on ${skipped.join(", ")}; those channels receive nothing`);
1771
+ logger(`[agent-sdk] deployment-events: no deploy sources declared on ${skipped.join(", ")}; those channels receive nothing`);
1772
1772
  }
1773
1773
  if (targets.length === 0) {
1774
1774
  return undefined;
1775
1775
  }
1776
1776
  if (accountKey === undefined) {
1777
- throw new Error(`This project has channels subscribed to deployment events (deploymentsChannel({ repos })) but the host is not signed in to Cursor. ${SIGN_IN_HINT}`);
1777
+ throw new Error(`This project has channels subscribed to deployment events (deploymentsChannel({ deploySourceUris })) but the host is not signed in to Cursor. ${SIGN_IN_HINT}`);
1778
1778
  }
1779
- // Union across channels: one registration per repo for the whole process,
1780
- // however many channels named it. Per-channel environment and event-type
1781
- // filtering happens at dispatch.
1782
- const byRepo = new Map();
1779
+ // Union across channels: one registration per deploy source for the whole
1780
+ // process, however many channels named it. Per-channel environment and
1781
+ // event-type filtering happens at dispatch.
1782
+ const bySource = new Map();
1783
1783
  for (const target of targets) {
1784
1784
  for (const subscription of target.subscriptions) {
1785
- const existing = byRepo.get(subscription.repo);
1785
+ const existing = bySource.get(subscription.deploySourceUri);
1786
1786
  if (existing === undefined) {
1787
- byRepo.set(subscription.repo, {
1788
- repo: subscription.repo,
1787
+ bySource.set(subscription.deploySourceUri, {
1788
+ deploySourceUri: subscription.deploySourceUri,
1789
1789
  environments: [...subscription.environments],
1790
1790
  events: new Set(subscription.events),
1791
1791
  });
@@ -1813,7 +1813,7 @@ function startCursorDeploymentRelay(input) {
1813
1813
  baseUrl: cursorExternalApiUrl(),
1814
1814
  apiKey: accountKey.apiKey,
1815
1815
  stateDir: join(baseStateRoot, "deployment-events"),
1816
- subscriptions: [...byRepo.values()],
1816
+ subscriptions: [...bySource.values()],
1817
1817
  logger,
1818
1818
  dispatch: (event) => __awaiter(this, void 0, void 0, function* () {
1819
1819
  return fanOutDeploymentEvent({
@@ -1835,7 +1835,7 @@ function startCursorDeploymentRelay(input) {
1835
1835
  }),
1836
1836
  });
1837
1837
  relay.start();
1838
- logger(`[agent-sdk] deployment-events: relaying ${byRepo.size} repository subscription(s) to ${targets.length} channel(s)`);
1838
+ logger(`[agent-sdk] deployment-events: relaying ${bySource.size} deploy-source subscription(s) to ${targets.length} channel(s)`);
1839
1839
  return relay;
1840
1840
  }
1841
1841
  function startCursorSlackRelay(input) {