@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.
- package/dist/channels/deployments/deployments-channel.d.ts +2 -2
- package/dist/channels/deployments/deployments-channel.d.ts.map +1 -1
- package/dist/channels/deployments/deployments-channel.js +7 -6
- package/dist/channels/deployments/index.d.ts +2 -3
- package/dist/channels/deployments/index.d.ts.map +1 -1
- package/dist/channels/deployments/index.js +2 -3
- package/dist/channels/deployments/types.d.ts +14 -14
- package/dist/channels/deployments/types.d.ts.map +1 -1
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +3 -3
- package/dist/docs/assets/{app.kqdC1N7p.js → app.DUOPbN18.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.CxCtxfDE.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.DXDE2WgG.js → VPLocalSearchBox.CmWbGcGk.js} +1 -1
- package/dist/docs/assets/chunks/{theme.DFYqbyta.js → theme.S57OeOLA.js} +2 -2
- package/dist/docs/assets/{reference_channels.md.G5GysZ7e.js → reference_channels.md.CboFd5IH.js} +1 -1
- package/dist/docs/building-with-agents.html +3 -3
- package/dist/docs/concepts.html +3 -3
- package/dist/docs/deployment.html +3 -3
- package/dist/docs/evals.html +3 -3
- package/dist/docs/example-agents/approval-buddy.html +3 -3
- package/dist/docs/example-agents/benny.html +3 -3
- package/dist/docs/example-agents/bugbot.html +3 -3
- package/dist/docs/example-agents/codebase-wiki.html +3 -3
- package/dist/docs/example-agents/codeowners-review.html +3 -3
- package/dist/docs/example-agents/concierge.html +3 -3
- package/dist/docs/example-agents/fsd.html +3 -3
- package/dist/docs/example-agents/index.html +3 -3
- package/dist/docs/example-agents/knowledge-base.html +3 -3
- package/dist/docs/example-agents/oncall.html +3 -3
- package/dist/docs/example-agents/security-reviewer.html +3 -3
- package/dist/docs/example-agents/slack-agent.html +3 -3
- package/dist/docs/example-agents/weather-agent.html +3 -3
- package/dist/docs/guides/agent-to-agent.html +3 -3
- package/dist/docs/guides/cloud-runtime.html +3 -3
- package/dist/docs/guides/convert-automation.html +3 -3
- package/dist/docs/guides/github.html +3 -3
- package/dist/docs/guides/human-in-the-loop.html +3 -3
- package/dist/docs/guides/mcp-oauth.html +3 -3
- package/dist/docs/guides/opentelemetry.html +3 -3
- package/dist/docs/guides/slack.html +3 -3
- package/dist/docs/guides/webhooks.html +3 -3
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +3 -3
- package/dist/docs/index.html +3 -3
- package/dist/docs/quickstart.html +3 -3
- package/dist/docs/reference/agent-config.html +3 -3
- package/dist/docs/reference/artifacts.html +3 -3
- package/dist/docs/reference/channels.html +5 -5
- package/dist/docs/reference/cli.html +3 -3
- package/dist/docs/reference/connections.html +3 -3
- package/dist/docs/reference/hooks.html +3 -3
- package/dist/docs/reference/http-api.html +3 -3
- package/dist/docs/reference/instructions.html +3 -3
- package/dist/docs/reference/playground.html +3 -3
- package/dist/docs/reference/project-layout.html +3 -3
- package/dist/docs/reference/prompt.html +3 -3
- package/dist/docs/reference/schedules.html +3 -3
- package/dist/docs/reference/sessions.html +3 -3
- package/dist/docs/reference/skills.html +3 -3
- package/dist/docs/reference/subagents.html +3 -3
- package/dist/docs/reference/tools.html +3 -3
- package/dist/docs/scaffolding-agents.html +3 -3
- package/dist/docs/storage.html +3 -3
- package/dist/docs/templates/agentic-owners.html +3 -3
- package/dist/docs/templates/demo.html +3 -3
- package/dist/docs/templates/pr-autofixer.html +3 -3
- package/dist/docs/templates/security-reviewer.html +3 -3
- package/dist/docs/templates/triage.html +3 -3
- package/dist/docs/troubleshooting.html +3 -3
- package/dist/internal/cursor-deployment-relay.d.ts +4 -4
- package/dist/internal/cursor-deployment-relay.d.ts.map +1 -1
- package/dist/internal/cursor-deployment-relay.js +33 -32
- package/dist/internal/server.js +13 -13
- package/dist/playground/assets/index-CMe7imuc.css +1 -0
- package/dist/playground/assets/{index-Cspgk9jC.js → index-JaFLlugp.js} +45 -45
- package/dist/playground/index.html +2 -2
- package/docs/reference/channels.md +13 -11
- package/package.json +1 -1
- package/src/channels/deployments/deployments-channel.ts +7 -6
- package/src/channels/deployments/index.ts +2 -3
- package/src/channels/deployments/types.ts +14 -14
- package/src/internal/cursor-deployment-relay.ts +38 -36
- package/src/internal/server.ts +13 -13
- package/dist/docs/assets/chunks/@localSearchIndexroot.BqhvUA76.js +0 -1
- package/dist/playground/assets/index-ChETdG-_.css +0 -1
- /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 `
|
|
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
|
|
36
|
-
for (const entry of options.
|
|
37
|
-
const subscription = typeof entry === "string" ? {
|
|
38
|
-
// Case-folded only: `Deployment.
|
|
39
|
-
// the server keys subscriptions the same way.
|
|
40
|
-
const
|
|
41
|
-
if (
|
|
42
|
-
throw new Error(`deploymentsChannel: invalid
|
|
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:
|
|
51
|
+
throw new Error(`deploymentsChannel: deploy source "${deploySourceUri}" subscribes to no events.`);
|
|
52
52
|
}
|
|
53
|
-
// Later entries for the same
|
|
54
|
-
// silently replacing it.
|
|
55
|
-
const existing =
|
|
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
|
-
|
|
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
|
|
69
|
-
// empty list means deregister, so the host simply never
|
|
70
|
-
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
-
|
|
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.
|
|
138
|
+
this.loggedSkippedSources.clear();
|
|
138
139
|
const lines = [];
|
|
139
140
|
const confirmed = [];
|
|
140
|
-
for (const status of (_a = result.
|
|
141
|
-
const wanted = options.subscriptions.find((subscription) => subscription.
|
|
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.
|
|
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.
|
|
147
|
-
confirmed.push(status.
|
|
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.
|
|
181
|
+
typeof envelope.deploySourceUri !== "string") {
|
|
181
182
|
return false;
|
|
182
183
|
}
|
|
183
|
-
const subscription = this.subscribed.get(envelope.
|
|
184
|
+
const subscription = this.subscribed.get(envelope.deploySourceUri);
|
|
184
185
|
if (subscription === undefined) {
|
|
185
|
-
if (!this.
|
|
186
|
-
this.
|
|
187
|
-
this.options.logger(`[agent-sdk] deployment-events: skipping events for ${envelope.
|
|
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
|
}
|
package/dist/internal/server.js
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
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({
|
|
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
|
|
1780
|
-
// however many channels named it. Per-channel environment and
|
|
1781
|
-
// filtering happens at dispatch.
|
|
1782
|
-
const
|
|
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 =
|
|
1785
|
+
const existing = bySource.get(subscription.deploySourceUri);
|
|
1786
1786
|
if (existing === undefined) {
|
|
1787
|
-
|
|
1788
|
-
|
|
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: [...
|
|
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 ${
|
|
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) {
|