@cursor/july 0.1.68 → 0.1.73
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/AGENTS.md +4 -5
- package/README.md +23 -11
- package/dist/bin/agent-serve.js +3 -2
- package/dist/channels/github/api.d.ts +2 -0
- package/dist/channels/github/api.d.ts.map +1 -1
- package/dist/channels/github/api.js +2 -1
- package/dist/channels/github/binding.d.ts +7 -0
- package/dist/channels/github/binding.d.ts.map +1 -1
- package/dist/channels/github/binding.js +4 -0
- package/dist/channels/github/checks.d.ts +99 -0
- package/dist/channels/github/checks.d.ts.map +1 -0
- package/dist/channels/github/checks.js +108 -0
- package/dist/channels/github/cursor-account.d.ts +4 -4
- package/dist/channels/github/cursor-account.d.ts.map +1 -1
- package/dist/channels/github/cursor-account.js +7 -5
- package/dist/channels/github/index.d.ts +1 -0
- package/dist/channels/github/index.d.ts.map +1 -1
- package/dist/channels/github/index.js +1 -0
- package/dist/channels/github/types.d.ts +8 -0
- package/dist/channels/github/types.d.ts.map +1 -1
- package/dist/channels/slack/manifest.d.ts +2 -2
- package/dist/channels/slack/manifest.d.ts.map +1 -1
- package/dist/channels/slack/manifest.js +13 -11
- package/dist/channels/slack/types.d.ts +2 -2
- package/dist/channels/slack/types.d.ts.map +1 -1
- package/dist/connections.d.ts +17 -5
- package/dist/connections.d.ts.map +1 -1
- package/dist/connections.js +17 -5
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +3 -3
- package/dist/docs/assets/{app.C5XUTCw9.js → app.CdbcFD8T.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.DQad--_z.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.CGDTAYHY.js → VPLocalSearchBox.D_NKImM7.js} +1 -1
- package/dist/docs/assets/chunks/{theme.lPixh250.js → theme.CMvz7cu9.js} +2 -2
- package/dist/docs/assets/{concepts.md.CqOsxbMU.js → concepts.md.BXAm6G-C.js} +1 -1
- package/dist/docs/assets/{guides_mcp-oauth.md.C7G7IykG.js → guides_mcp-oauth.md.CzEB6RaG.js} +1 -1
- package/dist/docs/assets/{reference_agent-config.md.DHkkvcEZ.js → reference_agent-config.md.BZnEKfEc.js} +3 -4
- package/dist/docs/assets/{reference_agent-config.md.DHkkvcEZ.lean.js → reference_agent-config.md.BZnEKfEc.lean.js} +1 -1
- package/dist/docs/assets/{reference_connections.md.Bwswbm6H.js → reference_connections.md.Cu3N-S3Q.js} +18 -11
- package/dist/docs/assets/{reference_connections.md.Bwswbm6H.lean.js → reference_connections.md.Cu3N-S3Q.lean.js} +1 -1
- package/dist/docs/assets/{reference_sessions.md.DBVFi2Sx.js → reference_sessions.md.B0DdlM-K.js} +1 -1
- package/dist/docs/assets/{reference_tools.md.Wmvb7Lob.js → reference_tools.md.DTg_kEsx.js} +1 -1
- package/dist/docs/assets/troubleshooting.md.DQ-hYuZT.js +1 -0
- package/dist/docs/building-with-agents.html +3 -3
- package/dist/docs/concepts.html +5 -5
- 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 +5 -5
- 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 +5 -6
- package/dist/docs/reference/artifacts.html +3 -3
- package/dist/docs/reference/channels.html +3 -3
- package/dist/docs/reference/cli.html +3 -3
- package/dist/docs/reference/connections.html +20 -13
- 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 +5 -5
- package/dist/docs/reference/skills.html +3 -3
- package/dist/docs/reference/subagents.html +3 -3
- package/dist/docs/reference/tools.html +5 -5
- 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 +5 -5
- package/dist/internal/advertise-tools.d.ts +11 -6
- package/dist/internal/advertise-tools.d.ts.map +1 -1
- package/dist/internal/advertise-tools.js +63 -30
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +2 -4
- package/dist/internal/convert-automation/convert-workflow.d.ts.map +1 -1
- package/dist/internal/convert-automation/convert-workflow.js +2 -10
- package/dist/internal/cursor/account-mcp.d.ts +29 -3
- package/dist/internal/cursor/account-mcp.d.ts.map +1 -1
- package/dist/internal/cursor/account-mcp.js +147 -67
- package/dist/internal/cursor/backend-client.d.ts +11 -6
- package/dist/internal/cursor/backend-client.d.ts.map +1 -1
- package/dist/internal/cursor/backend-client.js +32 -10
- package/dist/internal/cursor-account-mcp-auth.d.ts +11 -0
- package/dist/internal/cursor-account-mcp-auth.d.ts.map +1 -1
- package/dist/internal/cursor-account-mcp-auth.js +69 -0
- package/dist/internal/deploy-client.d.ts +0 -7
- package/dist/internal/deploy-client.d.ts.map +1 -1
- package/dist/internal/deploy-client.js +2 -4
- package/dist/internal/deploy-manifest.d.ts +15 -24
- package/dist/internal/deploy-manifest.d.ts.map +1 -1
- package/dist/internal/deploy-manifest.js +38 -27
- package/dist/internal/deployment-scm-event-stream.d.ts +4 -1
- package/dist/internal/deployment-scm-event-stream.d.ts.map +1 -1
- package/dist/internal/deployment-scm-event-stream.js +15 -1
- package/dist/internal/discovery.d.ts.map +1 -1
- package/dist/internal/discovery.js +42 -10
- package/dist/internal/init-project.d.ts.map +1 -1
- package/dist/internal/init-project.js +7 -106
- package/dist/internal/init-scaffold.d.ts +8 -0
- package/dist/internal/init-scaffold.d.ts.map +1 -0
- package/dist/internal/init-scaffold.js +168 -0
- package/dist/internal/inline-stdio-mcp.d.ts +2 -0
- package/dist/internal/inline-stdio-mcp.d.ts.map +1 -1
- package/dist/internal/inline-stdio-mcp.js +10 -8
- package/dist/internal/json-schema.d.ts +7 -0
- package/dist/internal/json-schema.d.ts.map +1 -1
- package/dist/internal/json-schema.js +18 -3
- package/dist/internal/mcp-endpoint.js +7 -7
- package/dist/internal/mcp-host.js +4 -2
- package/dist/internal/mcp-oauth.d.ts +22 -0
- package/dist/internal/mcp-oauth.d.ts.map +1 -1
- package/dist/internal/mcp-oauth.js +40 -1
- package/dist/internal/package-inline-stdio.d.ts.map +1 -1
- package/dist/internal/package-inline-stdio.js +5 -5
- package/dist/internal/review-comments.d.ts +97 -0
- package/dist/internal/review-comments.d.ts.map +1 -1
- package/dist/internal/review-comments.js +151 -0
- package/dist/internal/sanitize-mcp-tool-name.d.ts +20 -0
- package/dist/internal/sanitize-mcp-tool-name.d.ts.map +1 -0
- package/dist/internal/sanitize-mcp-tool-name.js +30 -0
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +4 -6
- package/dist/internal/shallow-clone.d.ts +94 -39
- package/dist/internal/shallow-clone.d.ts.map +1 -1
- package/dist/internal/shallow-clone.js +188 -68
- package/dist/internal/terminal-style.d.ts +18 -0
- package/dist/internal/terminal-style.d.ts.map +1 -1
- package/dist/internal/terminal-style.js +46 -1
- package/dist/internal/workspace.d.ts +2 -0
- package/dist/internal/workspace.d.ts.map +1 -1
- package/dist/internal/workspace.js +5 -0
- package/dist/playground/assets/index-77uhu5Kr.css +1 -0
- package/dist/playground/assets/{index-yxs1heea.js → index-D4buox4m.js} +42 -42
- package/dist/playground/index.html +2 -2
- package/dist/tools.d.ts +7 -0
- package/dist/tools.d.ts.map +1 -1
- package/dist/types.d.ts +28 -3
- package/dist/types.d.ts.map +1 -1
- package/docs/concepts.md +4 -4
- package/docs/guides/mcp-oauth.md +3 -1
- package/docs/reference/agent-config.md +11 -12
- package/docs/reference/connections.md +44 -26
- package/docs/reference/sessions.md +2 -2
- package/docs/reference/tools.md +1 -1
- package/docs/troubleshooting.md +3 -2
- package/package.json +4 -1
- package/skills/create-agent/SKILL.md +12 -9
- package/skills/debug/SKILL.md +2 -1
- package/skills/framework-map/SKILL.md +6 -6
- package/skills/mcp-auth/SKILL.md +8 -6
- package/src/bin/agent-serve.ts +3 -2
- package/src/channels/github/api.ts +6 -1
- package/src/channels/github/binding.ts +21 -0
- package/src/channels/github/checks.ts +179 -0
- package/src/channels/github/cursor-account.ts +9 -6
- package/src/channels/github/index.ts +1 -0
- package/src/channels/github/types.ts +8 -0
- package/src/channels/slack/manifest.ts +8 -10
- package/src/channels/slack/types.ts +2 -2
- package/src/connections.ts +17 -5
- package/src/internal/advertise-tools.ts +72 -23
- package/src/internal/cli-deploy.ts +4 -15
- package/src/internal/convert-automation/convert-workflow.ts +2 -11
- package/src/internal/cursor/account-mcp.ts +208 -73
- package/src/internal/cursor/backend-client.ts +45 -11
- package/src/internal/cursor-account-mcp-auth.ts +83 -0
- package/src/internal/deploy-client.ts +0 -10
- package/src/internal/deploy-manifest.ts +33 -39
- package/src/internal/deployment-scm-event-stream.ts +17 -1
- package/src/internal/discovery.ts +47 -3
- package/src/internal/init-project.ts +7 -133
- package/src/internal/init-scaffold.ts +176 -0
- package/src/internal/inline-stdio-mcp.ts +13 -0
- package/src/internal/json-schema.ts +24 -3
- package/src/internal/mcp-endpoint.ts +6 -0
- package/src/internal/mcp-host.ts +4 -0
- package/src/internal/mcp-oauth.ts +55 -1
- package/src/internal/package-inline-stdio.ts +5 -1
- package/src/internal/review-comments.ts +245 -0
- package/src/internal/sanitize-mcp-tool-name.ts +33 -0
- package/src/internal/session-engine.ts +7 -0
- package/src/internal/shallow-clone.ts +293 -105
- package/src/internal/terminal-style.ts +67 -1
- package/src/internal/workspace.ts +6 -0
- package/src/tools.ts +7 -0
- package/src/types.ts +32 -4
- package/templates/agentic-owners/agent/agent.ts +3 -0
- package/templates/demo/agent/agent.ts +3 -0
- package/templates/security-reviewer/agent/agent.ts +3 -0
- package/templates/triage/agent/agent.ts +3 -0
- package/dist/docs/assets/chunks/@localSearchIndexroot.DvUR3lv9.js +0 -1
- package/dist/docs/assets/troubleshooting.md.CuVztCKs.js +0 -1
- package/dist/playground/assets/index-CoL7xCJl.css +0 -1
- /package/dist/docs/assets/{concepts.md.CqOsxbMU.lean.js → concepts.md.BXAm6G-C.lean.js} +0 -0
- /package/dist/docs/assets/{guides_mcp-oauth.md.C7G7IykG.lean.js → guides_mcp-oauth.md.CzEB6RaG.lean.js} +0 -0
- /package/dist/docs/assets/{reference_sessions.md.DBVFi2Sx.lean.js → reference_sessions.md.B0DdlM-K.lean.js} +0 -0
- /package/dist/docs/assets/{reference_tools.md.Wmvb7Lob.lean.js → reference_tools.md.DTg_kEsx.lean.js} +0 -0
- /package/dist/docs/assets/{troubleshooting.md.CuVztCKs.lean.js → troubleshooting.md.DQ-hYuZT.lean.js} +0 -0
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* clock — `exportedAt` comes from the caller.
|
|
7
7
|
*/
|
|
8
8
|
import { CLI_COMMAND_NAME, PACKAGE_NAME } from "../distribution.js";
|
|
9
|
+
import { MEMORY_TS } from "../init-scaffold.js";
|
|
9
10
|
import { pascalCase, SlugRegistry, slugify } from "./slug.js";
|
|
10
11
|
export function convertWorkflow(input) {
|
|
11
12
|
var _a, _b;
|
|
@@ -80,7 +81,7 @@ export function convertWorkflow(input) {
|
|
|
80
81
|
const hasSlackAction = ((_d = workflow.actions) !== null && _d !== void 0 ? _d : []).some((action) => action.slack !== undefined || action.readSlack !== undefined);
|
|
81
82
|
const hasSlackConnection = hasSlackAction && emitSlackAccountConnection(automation, out);
|
|
82
83
|
if (workflow.memoryEnabled === true) {
|
|
83
|
-
out.files.push({ path: "agent/hooks/memory.ts", contents:
|
|
84
|
+
out.files.push({ path: "agent/hooks/memory.ts", contents: MEMORY_TS });
|
|
84
85
|
}
|
|
85
86
|
out.setupSteps.push(...behaviorSteps(workflow, out.warnings, {
|
|
86
87
|
hasSlackChannel: slackTriggers.length > 0,
|
|
@@ -987,12 +988,3 @@ function jsonComment(value) {
|
|
|
987
988
|
function dedupe(values) {
|
|
988
989
|
return [...new Set(values)];
|
|
989
990
|
}
|
|
990
|
-
/** Memory hook contents — identical to the `initProject` scaffold. */
|
|
991
|
-
const MEMORY_HOOK = `// Journals every turn (timestamp, session, user message, result) so
|
|
992
|
-
// future sessions can recall past work. The journal is shared across every
|
|
993
|
-
// session — and every user — of this agent. Pass your own MemoryBackend to
|
|
994
|
-
// change where memories live, or delete this file to opt out.
|
|
995
|
-
import { memoryHook } from "${PACKAGE_NAME}/memory";
|
|
996
|
-
|
|
997
|
-
export default memoryHook();
|
|
998
|
-
`;
|
|
@@ -15,7 +15,12 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import type { AgentProject, AuthPolicy } from "../../types.js";
|
|
17
17
|
import type { EngineResolvedConnection } from "../session-engine.js";
|
|
18
|
+
import { type TerminalPalette } from "../terminal-style.js";
|
|
18
19
|
import type { AccountMcpServer, CursorBackendClient } from "./backend-client.js";
|
|
20
|
+
/** Dashboard Integrations & MCP — reconnect team / account connectors. */
|
|
21
|
+
export declare const CURSOR_ACCOUNT_MCP_DASHBOARD_URL = "https://cursor.com/dashboard/integrations";
|
|
22
|
+
/** Cursor app Settings → MCP (Connect / Authenticate on the named row). */
|
|
23
|
+
export declare const CURSOR_ACCOUNT_MCP_SETTINGS_DEEPLINK = "cursor://anysphere.cursor-deeplink/customize?tab=mcp";
|
|
19
24
|
export interface CursorAccountConnectionRef {
|
|
20
25
|
/** Connection (MCP server) name — the filename under `agent/mcp-connections/`. */
|
|
21
26
|
name: string;
|
|
@@ -52,12 +57,15 @@ export declare class CursorAccountMcpBridge {
|
|
|
52
57
|
readonly secret: string;
|
|
53
58
|
private readonly client;
|
|
54
59
|
private readonly logger;
|
|
60
|
+
private readonly palette;
|
|
55
61
|
private readonly secretPolicy;
|
|
56
62
|
private readonly allowRemoteCallers;
|
|
57
63
|
private readonly catalogs;
|
|
58
64
|
constructor(args: {
|
|
59
65
|
client: CursorBackendClient;
|
|
60
66
|
logger?: (line: string) => void;
|
|
67
|
+
/** Defaults to stdout; tests pass `makePalette(false)` for a plain box. */
|
|
68
|
+
palette?: TerminalPalette;
|
|
61
69
|
/**
|
|
62
70
|
* Admit non-loopback callers presenting the secret. Only set when the
|
|
63
71
|
* serve host configured a `publicUrl` (cloud turns reach the bridge
|
|
@@ -78,9 +86,9 @@ export declare class CursorAccountMcpBridge {
|
|
|
78
86
|
handle(request: Request, ref: CursorAccountConnectionRef): Promise<Response>;
|
|
79
87
|
/**
|
|
80
88
|
* Startup DX: log the account's connector statuses for `refs` without
|
|
81
|
-
* blocking serve startup.
|
|
82
|
-
*
|
|
83
|
-
*
|
|
89
|
+
* blocking serve startup. Healthy catalogs stay a one-line summary;
|
|
90
|
+
* `needsAuth` / `error` / empty catalogs render a yellow warning box with
|
|
91
|
+
* reconnect URLs.
|
|
84
92
|
*
|
|
85
93
|
* Returns a promise that settles when every ref's log lines are written —
|
|
86
94
|
* callers may ignore it; tests can await it.
|
|
@@ -97,6 +105,24 @@ export declare class CursorAccountMcpBridge {
|
|
|
97
105
|
*/
|
|
98
106
|
private getCatalog;
|
|
99
107
|
}
|
|
108
|
+
export interface CursorAccountMcpWarningServer {
|
|
109
|
+
serverIdentifier: string;
|
|
110
|
+
status: string;
|
|
111
|
+
toolCount: number;
|
|
112
|
+
errorDetail?: string;
|
|
113
|
+
/** Minted OAuth URL for a `needsAuth` connector, when the probe succeeded. */
|
|
114
|
+
authUrl?: string;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Yellow warning panel for unhealthy / missing Cursor-account connectors.
|
|
118
|
+
* One box replaces the old stacked `[agent-sdk]` log lines.
|
|
119
|
+
*/
|
|
120
|
+
export declare function formatCursorAccountMcpWarningBox(args: {
|
|
121
|
+
connectionName: string;
|
|
122
|
+
servers: readonly CursorAccountMcpWarningServer[];
|
|
123
|
+
palette?: TerminalPalette;
|
|
124
|
+
hyperlinks?: boolean;
|
|
125
|
+
}): string;
|
|
100
126
|
/** One-line status for the preflight summary (`name (12 tools)` / `name (error: …)`). */
|
|
101
127
|
export declare function formatServerStatusSummary(server: AccountMcpServer, errorDetail?: string): string;
|
|
102
128
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-mcp.d.ts","sourceRoot":"","sources":["../../../src/internal/cursor/account-mcp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AASH,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"account-mcp.d.ts","sourceRoot":"","sources":["../../../src/internal/cursor/account-mcp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG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CAWT;AAwDD,yFAAyF;AACzF,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,gBAAgB,EACxB,WAAW,CAAC,EAAE,MAAM,GACnB,MAAM,CAkBR;AAED;;;;GAIG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,IAAI,CAAC,mBAAmB,EAAE,uBAAuB,CAAC,EAC1D,gBAAgB,EAAE,MAAM,GACvB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CA4B7B"}
|
|
@@ -27,8 +27,12 @@ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
|
27
27
|
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
28
28
|
import { bearerAuth } from "../../channels.js";
|
|
29
29
|
import { isCursorAccountTransport } from "../../types.js";
|
|
30
|
+
import { probeConnectorAuthUrls } from "../cursor-account-mcp-auth.js";
|
|
31
|
+
import { LOG_PREFIX } from "../distribution.js";
|
|
30
32
|
import { handleStatelessMcpRequest } from "../mcp-endpoint.js";
|
|
31
33
|
import { isLoopbackAddress } from "../net.js";
|
|
34
|
+
import { sanitizeMcpToolName, suffixMcpToolName, } from "../sanitize-mcp-tool-name.js";
|
|
35
|
+
import { colorEnabledFor, formatTerminalBox, stdoutPalette, terminalHyperlink, } from "../terminal-style.js";
|
|
32
36
|
/** Catalog freshness window; a miss inside it re-uses the cached listing. */
|
|
33
37
|
const CATALOG_TTL_MS = 60000;
|
|
34
38
|
/**
|
|
@@ -36,8 +40,10 @@ const CATALOG_TTL_MS = 60000;
|
|
|
36
40
|
* a model hallucinating tool names cannot turn into a backend hot loop.
|
|
37
41
|
*/
|
|
38
42
|
const FORCE_REFRESH_MIN_INTERVAL_MS = 5000;
|
|
39
|
-
/** MCP
|
|
40
|
-
const
|
|
43
|
+
/** Dashboard Integrations & MCP — reconnect team / account connectors. */
|
|
44
|
+
export const CURSOR_ACCOUNT_MCP_DASHBOARD_URL = "https://cursor.com/dashboard/integrations";
|
|
45
|
+
/** Cursor app Settings → MCP (Connect / Authenticate on the named row). */
|
|
46
|
+
export const CURSOR_ACCOUNT_MCP_SETTINGS_DEEPLINK = "cursor://anysphere.cursor-deeplink/customize?tab=mcp";
|
|
41
47
|
/**
|
|
42
48
|
* Collect `cursorAccount` connections across `mounts`, grouped by mount
|
|
43
49
|
* slug. Purely structural — per-connector validation happens live against
|
|
@@ -85,12 +91,13 @@ export function resolveCursorAccountConnections(args) {
|
|
|
85
91
|
}
|
|
86
92
|
export class CursorAccountMcpBridge {
|
|
87
93
|
constructor(args) {
|
|
88
|
-
var _a;
|
|
94
|
+
var _a, _b;
|
|
89
95
|
/** Per-boot shared secret; resolved connections carry it as a bearer. */
|
|
90
96
|
this.secret = randomBytes(32).toString("hex");
|
|
91
97
|
this.catalogs = new Map();
|
|
92
98
|
this.client = args.client;
|
|
93
99
|
this.logger = (_a = args.logger) !== null && _a !== void 0 ? _a : (() => { });
|
|
100
|
+
this.palette = (_b = args.palette) !== null && _b !== void 0 ? _b : stdoutPalette();
|
|
94
101
|
this.secretPolicy = bearerAuth(this.secret);
|
|
95
102
|
this.allowRemoteCallers = args.allowRemoteCallers === true;
|
|
96
103
|
}
|
|
@@ -129,9 +136,9 @@ export class CursorAccountMcpBridge {
|
|
|
129
136
|
}
|
|
130
137
|
/**
|
|
131
138
|
* Startup DX: log the account's connector statuses for `refs` without
|
|
132
|
-
* blocking serve startup.
|
|
133
|
-
*
|
|
134
|
-
*
|
|
139
|
+
* blocking serve startup. Healthy catalogs stay a one-line summary;
|
|
140
|
+
* `needsAuth` / `error` / empty catalogs render a yellow warning box with
|
|
141
|
+
* reconnect URLs.
|
|
135
142
|
*
|
|
136
143
|
* Returns a promise that settles when every ref's log lines are written —
|
|
137
144
|
* callers may ignore it; tests can await it.
|
|
@@ -143,44 +150,46 @@ export class CursorAccountMcpBridge {
|
|
|
143
150
|
return __awaiter(this, void 0, void 0, function* () {
|
|
144
151
|
try {
|
|
145
152
|
const catalog = yield this.getCatalog(ref);
|
|
146
|
-
|
|
147
|
-
|
|
153
|
+
const errorDetails = new Map();
|
|
154
|
+
const needsAuthNames = catalog.servers
|
|
155
|
+
.filter((server) => server.status === "needsAuth")
|
|
156
|
+
.map((server) => server.serverIdentifier);
|
|
157
|
+
const [authUrls] = yield Promise.all([
|
|
158
|
+
probeConnectorAuthUrls({
|
|
159
|
+
client: this.client,
|
|
160
|
+
identifiers: needsAuthNames,
|
|
161
|
+
}),
|
|
162
|
+
Promise.all(catalog.servers
|
|
163
|
+
.filter((server) => server.status === "error")
|
|
164
|
+
.map((server) => __awaiter(this, void 0, void 0, function* () {
|
|
165
|
+
const detail = yield diagnoseConnectorError(this.client, server.serverIdentifier);
|
|
166
|
+
if (detail !== undefined) {
|
|
167
|
+
errorDetails.set(server.serverIdentifier, detail);
|
|
168
|
+
}
|
|
169
|
+
}))),
|
|
170
|
+
]);
|
|
171
|
+
const unhealthy = catalog.servers.some((server) => server.status === "needsAuth" || server.status === "error");
|
|
172
|
+
if (catalog.servers.length === 0 || unhealthy) {
|
|
173
|
+
this.logger(formatCursorAccountMcpWarningBox({
|
|
174
|
+
connectionName: ref.name,
|
|
175
|
+
servers: catalog.servers.map((server) => ({
|
|
176
|
+
serverIdentifier: server.serverIdentifier,
|
|
177
|
+
status: server.status,
|
|
178
|
+
toolCount: server.tools.length,
|
|
179
|
+
errorDetail: errorDetails.get(server.serverIdentifier),
|
|
180
|
+
authUrl: authUrls.get(server.serverIdentifier),
|
|
181
|
+
})),
|
|
182
|
+
palette: this.palette,
|
|
183
|
+
}));
|
|
148
184
|
return;
|
|
149
185
|
}
|
|
150
|
-
const errorDetails = new Map();
|
|
151
|
-
yield Promise.all(catalog.servers
|
|
152
|
-
.filter((server) => server.status === "error")
|
|
153
|
-
.map((server) => __awaiter(this, void 0, void 0, function* () {
|
|
154
|
-
const detail = yield diagnoseConnectorError(this.client, server.serverIdentifier);
|
|
155
|
-
if (detail !== undefined) {
|
|
156
|
-
errorDetails.set(server.serverIdentifier, detail);
|
|
157
|
-
}
|
|
158
|
-
})));
|
|
159
186
|
const summary = catalog.servers
|
|
160
187
|
.map((server) => formatServerStatusSummary(server, errorDetails.get(server.serverIdentifier)))
|
|
161
188
|
.join(", ");
|
|
162
|
-
this.logger(
|
|
163
|
-
const needsAuth = catalog.servers.filter((server) => server.status === "needsAuth");
|
|
164
|
-
if (needsAuth.length > 0) {
|
|
165
|
-
this.logger(`[agent-sdk] Cursor account MCP connection "${ref.name}": ${needsAuth
|
|
166
|
-
.map((server) => server.serverIdentifier)
|
|
167
|
-
.join(", ")} need re-authorization in Cursor (dashboard → MCP / Settings → MCP) before their tools appear`);
|
|
168
|
-
}
|
|
169
|
-
const errored = catalog.servers.filter((server) => server.status === "error");
|
|
170
|
-
if (errored.length > 0) {
|
|
171
|
-
const details = errored
|
|
172
|
-
.map((server) => {
|
|
173
|
-
const detail = errorDetails.get(server.serverIdentifier);
|
|
174
|
-
return detail === undefined
|
|
175
|
-
? server.serverIdentifier
|
|
176
|
-
: `${server.serverIdentifier} (${detail})`;
|
|
177
|
-
})
|
|
178
|
-
.join("; ");
|
|
179
|
-
this.logger(`[agent-sdk] Cursor account MCP connection "${ref.name}": ${details} — Cursor backend could not use this connector (not a missing agent-sdk login). Re-check the server in Cursor dashboard → MCP, confirm the URL is healthy, and retry after the backend can reach it`);
|
|
180
|
-
}
|
|
189
|
+
this.logger(`${LOG_PREFIX} Cursor account MCP connection "${ref.name}": ${summary}`);
|
|
181
190
|
}
|
|
182
191
|
catch (error) {
|
|
183
|
-
this.logger(
|
|
192
|
+
this.logger(`${LOG_PREFIX} Cursor account MCP connection "${ref.name}" preflight failed: ${describeError(error)}`);
|
|
184
193
|
}
|
|
185
194
|
});
|
|
186
195
|
}
|
|
@@ -192,11 +201,9 @@ export class CursorAccountMcpBridge {
|
|
|
192
201
|
server.setRequestHandler(ListToolsRequestSchema, () => __awaiter(this, void 0, void 0, function* () {
|
|
193
202
|
const catalog = yield this.getCatalog(ref);
|
|
194
203
|
return {
|
|
195
|
-
tools: catalog.tools.map((tool) => ({
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
inputSchema: tool.inputSchema,
|
|
199
|
-
})),
|
|
204
|
+
tools: catalog.tools.map((tool) => (Object.assign({ name: tool.exposedName, description: tool.description, inputSchema: tool.inputSchema }, (tool.outputSchema === undefined
|
|
205
|
+
? {}
|
|
206
|
+
: { outputSchema: tool.outputSchema })))),
|
|
200
207
|
};
|
|
201
208
|
}));
|
|
202
209
|
server.setRequestHandler(CallToolRequestSchema, (request) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -308,7 +315,7 @@ function buildCatalog(servers) {
|
|
|
308
315
|
const byBase = new Map();
|
|
309
316
|
for (const server of servers) {
|
|
310
317
|
for (const tool of server.tools) {
|
|
311
|
-
const base =
|
|
318
|
+
const base = sanitizeMcpToolName(tool.name);
|
|
312
319
|
const group = byBase.get(base);
|
|
313
320
|
const item = { serverIdentifier: server.serverIdentifier, tool };
|
|
314
321
|
if (group === undefined) {
|
|
@@ -335,45 +342,118 @@ function buildCatalog(servers) {
|
|
|
335
342
|
});
|
|
336
343
|
group.forEach(({ serverIdentifier, tool }, index) => {
|
|
337
344
|
let suffixIndex = index;
|
|
338
|
-
let exposedName =
|
|
345
|
+
let exposedName = suffixMcpToolName(base, suffixIndex);
|
|
339
346
|
while (byExposedName.has(exposedName)) {
|
|
340
347
|
suffixIndex++;
|
|
341
|
-
exposedName =
|
|
348
|
+
exposedName = suffixMcpToolName(base, suffixIndex);
|
|
342
349
|
}
|
|
343
|
-
const entry = {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
serverIdentifier,
|
|
347
|
-
description: tool.description,
|
|
348
|
-
inputSchema: tool.inputSchema,
|
|
349
|
-
};
|
|
350
|
+
const entry = Object.assign({ exposedName, backendName: tool.name, serverIdentifier, description: tool.description, inputSchema: tool.inputSchema }, (tool.outputSchema === undefined
|
|
351
|
+
? {}
|
|
352
|
+
: { outputSchema: tool.outputSchema }));
|
|
350
353
|
tools.push(entry);
|
|
351
354
|
byExposedName.set(entry.exposedName, entry);
|
|
352
355
|
});
|
|
353
356
|
}
|
|
354
357
|
return { servers, tools, byExposedName };
|
|
355
358
|
}
|
|
356
|
-
/** Connector display names can contain anything (spaces, dots, emoji). */
|
|
357
|
-
function sanitizeToolName(name) {
|
|
358
|
-
const cleaned = name
|
|
359
|
-
.replace(/[^a-zA-Z0-9_-]/g, "_")
|
|
360
|
-
.slice(0, MAX_TOOL_NAME_LENGTH);
|
|
361
|
-
return cleaned === "" ? "tool" : cleaned;
|
|
362
|
-
}
|
|
363
|
-
/** `base` for the first claimant, `base_2` / `base_3` … for colliders. */
|
|
364
|
-
function suffixToolName(base, index) {
|
|
365
|
-
if (index === 0) {
|
|
366
|
-
return base;
|
|
367
|
-
}
|
|
368
|
-
const suffix = `_${index + 1}`;
|
|
369
|
-
return `${base.slice(0, MAX_TOOL_NAME_LENGTH - suffix.length)}${suffix}`;
|
|
370
|
-
}
|
|
371
359
|
function trimTrailingSlash(url) {
|
|
372
360
|
return url.endsWith("/") ? url.slice(0, -1) : url;
|
|
373
361
|
}
|
|
374
362
|
function describeError(error) {
|
|
375
363
|
return error instanceof Error ? error.message : String(error);
|
|
376
364
|
}
|
|
365
|
+
const MAX_ERROR_DETAIL_CHARS = 72;
|
|
366
|
+
function truncateDetail(detail) {
|
|
367
|
+
const trimmed = detail.trim();
|
|
368
|
+
if (trimmed.length <= MAX_ERROR_DETAIL_CHARS) {
|
|
369
|
+
return trimmed;
|
|
370
|
+
}
|
|
371
|
+
return `${trimmed.slice(0, MAX_ERROR_DETAIL_CHARS - 1)}…`;
|
|
372
|
+
}
|
|
373
|
+
function formatWarningStatusRow(server, nameWidth, hyperlinks) {
|
|
374
|
+
const name = server.serverIdentifier.padEnd(nameWidth);
|
|
375
|
+
switch (server.status) {
|
|
376
|
+
case "needsAuth":
|
|
377
|
+
return `${name} ${terminalHyperlink(connectUrl(server.authUrl), "Connect", hyperlinks)}`;
|
|
378
|
+
case "connected":
|
|
379
|
+
return `${name} ${server.toolCount} tools`;
|
|
380
|
+
case "error": {
|
|
381
|
+
const detail = server.errorDetail === undefined || server.errorDetail.trim() === ""
|
|
382
|
+
? "backend could not reach connector"
|
|
383
|
+
: truncateDetail(server.errorDetail);
|
|
384
|
+
return `${name} error: ${detail}`;
|
|
385
|
+
}
|
|
386
|
+
default:
|
|
387
|
+
return `${name} ${server.status}`;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
function connectUrl(authUrl) {
|
|
391
|
+
var _a;
|
|
392
|
+
const minted = (_a = authUrl === null || authUrl === void 0 ? void 0 : authUrl.trim()) !== null && _a !== void 0 ? _a : "";
|
|
393
|
+
if (minted.startsWith("https://") &&
|
|
394
|
+
!minted.includes("\u001b") &&
|
|
395
|
+
!minted.includes("\u0007")) {
|
|
396
|
+
return minted;
|
|
397
|
+
}
|
|
398
|
+
return CURSOR_ACCOUNT_MCP_DASHBOARD_URL;
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* Yellow warning panel for unhealthy / missing Cursor-account connectors.
|
|
402
|
+
* One box replaces the old stacked `[agent-sdk]` log lines.
|
|
403
|
+
*/
|
|
404
|
+
export function formatCursorAccountMcpWarningBox(args) {
|
|
405
|
+
var _a, _b;
|
|
406
|
+
const palette = (_a = args.palette) !== null && _a !== void 0 ? _a : stdoutPalette();
|
|
407
|
+
const hyperlinks = (_b = args.hyperlinks) !== null && _b !== void 0 ? _b : colorEnabledFor();
|
|
408
|
+
const copy = warningCopy(Object.assign(Object.assign({}, args), { hyperlinks }));
|
|
409
|
+
return `\n${formatTerminalBox([copy.title, "", ...copy.intro, ...copy.actions], {
|
|
410
|
+
color: palette.yellow,
|
|
411
|
+
padding: 2,
|
|
412
|
+
})}`;
|
|
413
|
+
}
|
|
414
|
+
function warningCopy(args) {
|
|
415
|
+
const empty = args.servers.length === 0;
|
|
416
|
+
const hasAuth = args.servers.some((server) => server.status === "needsAuth");
|
|
417
|
+
const hasError = args.servers.some((server) => server.status === "error");
|
|
418
|
+
const nameWidth = Math.max(0, ...args.servers.map((server) => server.serverIdentifier.length));
|
|
419
|
+
const statusRows = args.servers.map((server) => formatWarningStatusRow(server, nameWidth, args.hyperlinks));
|
|
420
|
+
const links = [
|
|
421
|
+
` ${CURSOR_ACCOUNT_MCP_SETTINGS_DEEPLINK}`,
|
|
422
|
+
` ${CURSOR_ACCOUNT_MCP_DASHBOARD_URL}`,
|
|
423
|
+
];
|
|
424
|
+
const restart = "Then press Enter to restart this serve.";
|
|
425
|
+
if (empty) {
|
|
426
|
+
return {
|
|
427
|
+
title: "No matching MCP connectors",
|
|
428
|
+
intro: [
|
|
429
|
+
`No matching connectors on this account ("${args.connectionName}").`,
|
|
430
|
+
],
|
|
431
|
+
actions: [
|
|
432
|
+
"",
|
|
433
|
+
"Connect servers in Cursor, or fix the `servers` filter.",
|
|
434
|
+
...links,
|
|
435
|
+
],
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
if (hasAuth && !hasError) {
|
|
439
|
+
return {
|
|
440
|
+
title: "MCP authorization needed",
|
|
441
|
+
intro: statusRows,
|
|
442
|
+
actions: ["", restart, "", "Or reconnect at:", ...links],
|
|
443
|
+
};
|
|
444
|
+
}
|
|
445
|
+
return {
|
|
446
|
+
title: hasAuth ? "MCP authorization needed" : "MCP connector error",
|
|
447
|
+
intro: statusRows,
|
|
448
|
+
actions: [
|
|
449
|
+
"",
|
|
450
|
+
"Re-check the server URL is healthy, then reconnect at:",
|
|
451
|
+
...links,
|
|
452
|
+
"",
|
|
453
|
+
restart,
|
|
454
|
+
],
|
|
455
|
+
};
|
|
456
|
+
}
|
|
377
457
|
/** One-line status for the preflight summary (`name (12 tools)` / `name (error: …)`). */
|
|
378
458
|
export function formatServerStatusSummary(server, errorDetail) {
|
|
379
459
|
switch (server.status) {
|
|
@@ -51,6 +51,12 @@ export interface AccountMcpTool {
|
|
|
51
51
|
description: string;
|
|
52
52
|
/** JSON Schema for the tool input (defaulted when the server omits it). */
|
|
53
53
|
inputSchema: Record<string, unknown>;
|
|
54
|
+
/**
|
|
55
|
+
* JSON Schema for the tool's structured output. Present only when the
|
|
56
|
+
* connector's server declares one — absent stays absent (never defaulted),
|
|
57
|
+
* matching the optional MCP `Tool.outputSchema` field.
|
|
58
|
+
*/
|
|
59
|
+
outputSchema?: Record<string, unknown>;
|
|
54
60
|
}
|
|
55
61
|
export interface AccountMcpServer {
|
|
56
62
|
serverIdentifier: string;
|
|
@@ -112,16 +118,15 @@ export declare class CursorBackendClient {
|
|
|
112
118
|
teamId?: number;
|
|
113
119
|
}): Promise<AvailableMcpServer[]>;
|
|
114
120
|
/**
|
|
115
|
-
* Probe connectors
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
* probes flip `requiresAuth` off.
|
|
121
|
+
* Probe connectors and mint OAuth `authUrl`s where authorization is
|
|
122
|
+
* needed. With `serviceAccountId`, this is the dashboard Authenticate
|
|
123
|
+
* flow for a hosted deployment's service account. Omit it to probe the
|
|
124
|
+
* signed-in user (local `serve` preflight).
|
|
120
125
|
*/
|
|
121
126
|
checkHttpMcpStatus(args: {
|
|
122
127
|
serverIds: number[];
|
|
123
128
|
oauthRedirectUri: string;
|
|
124
|
-
serviceAccountId
|
|
129
|
+
serviceAccountId?: string;
|
|
125
130
|
}): Promise<McpConnectorStatus[]>;
|
|
126
131
|
/** Mint a short-lived GitHub token scoped to the requested repositories. */
|
|
127
132
|
getGithubToken(repos: readonly string[], options?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backend-client.d.ts","sourceRoot":"","sources":["../../../src/internal/cursor/backend-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,qBAAa,kBAAmB,SAAQ,KAAK;IAGzC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM;IACxB,QAAQ,CAAC,YAAY,CAAC,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uEAAuE;IACvE,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;CAC1B,GAAG,OAAO,CAAC,IAAI,CAAC,CAmChB"}
|
|
@@ -66,6 +66,8 @@ const mcpToolSchema = z.object({
|
|
|
66
66
|
description: z.string().optional(),
|
|
67
67
|
/** `google.protobuf.Value` — an arbitrary JSON Schema object. */
|
|
68
68
|
inputSchema: z.unknown().optional(),
|
|
69
|
+
/** Flat JSON-string output schema (`output_schema_json` on the proto). */
|
|
70
|
+
outputSchemaJson: z.string().optional(),
|
|
69
71
|
});
|
|
70
72
|
const getAvailableMcpServersResponseSchema = z.object({
|
|
71
73
|
servers: z
|
|
@@ -203,11 +205,11 @@ export class CursorBackendClient {
|
|
|
203
205
|
return ((_a = parsed.servers) !== null && _a !== void 0 ? _a : []).map((server) => { var _a; return ({
|
|
204
206
|
serverIdentifier: server.serverIdentifier,
|
|
205
207
|
status: server.status,
|
|
206
|
-
tools: ((_a = server.tools) !== null && _a !== void 0 ? _a : []).map((tool) => {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
inputSchema: normalizeInputSchema(tool.inputSchema),
|
|
210
|
-
})
|
|
208
|
+
tools: ((_a = server.tools) !== null && _a !== void 0 ? _a : []).map((tool) => {
|
|
209
|
+
var _a;
|
|
210
|
+
const outputSchema = parseOutputSchemaJson(tool.outputSchemaJson);
|
|
211
|
+
return Object.assign({ name: tool.name, description: (_a = tool.description) !== null && _a !== void 0 ? _a : "", inputSchema: normalizeInputSchema(tool.inputSchema) }, (outputSchema === undefined ? {} : { outputSchema }));
|
|
212
|
+
}),
|
|
211
213
|
}); });
|
|
212
214
|
});
|
|
213
215
|
}
|
|
@@ -252,11 +254,10 @@ export class CursorBackendClient {
|
|
|
252
254
|
});
|
|
253
255
|
}
|
|
254
256
|
/**
|
|
255
|
-
* Probe connectors
|
|
256
|
-
*
|
|
257
|
-
*
|
|
258
|
-
*
|
|
259
|
-
* probes flip `requiresAuth` off.
|
|
257
|
+
* Probe connectors and mint OAuth `authUrl`s where authorization is
|
|
258
|
+
* needed. With `serviceAccountId`, this is the dashboard Authenticate
|
|
259
|
+
* flow for a hosted deployment's service account. Omit it to probe the
|
|
260
|
+
* signed-in user (local `serve` preflight).
|
|
260
261
|
*/
|
|
261
262
|
checkHttpMcpStatus(args) {
|
|
262
263
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -495,6 +496,27 @@ function normalizeInputSchema(schema) {
|
|
|
495
496
|
}
|
|
496
497
|
return { type: "object", properties: {} };
|
|
497
498
|
}
|
|
499
|
+
/**
|
|
500
|
+
* Parse the proto's flat-JSON-string output schema. Unlike
|
|
501
|
+
* {@link normalizeInputSchema} there is no fallback: outputSchema is optional
|
|
502
|
+
* on the MCP wire, so absence (or malformed JSON crossing the backend
|
|
503
|
+
* boundary) means omitted.
|
|
504
|
+
*/
|
|
505
|
+
function parseOutputSchemaJson(outputSchemaJson) {
|
|
506
|
+
if (outputSchemaJson === undefined) {
|
|
507
|
+
return undefined;
|
|
508
|
+
}
|
|
509
|
+
let parsed;
|
|
510
|
+
try {
|
|
511
|
+
parsed = JSON.parse(outputSchemaJson);
|
|
512
|
+
}
|
|
513
|
+
catch (_a) {
|
|
514
|
+
return undefined;
|
|
515
|
+
}
|
|
516
|
+
return typeof parsed === "object" && parsed !== null && !Array.isArray(parsed)
|
|
517
|
+
? parsed
|
|
518
|
+
: undefined;
|
|
519
|
+
}
|
|
498
520
|
function toCallResult(result) {
|
|
499
521
|
var _a;
|
|
500
522
|
if (result.success !== undefined) {
|
|
@@ -52,4 +52,15 @@ export interface AuthorizeCursorAccountConnectorsResult {
|
|
|
52
52
|
* each (sequentially), polled until the backend stores the token.
|
|
53
53
|
*/
|
|
54
54
|
export declare function authorizeCursorAccountConnectors(args: AuthorizeCursorAccountConnectorsArgs): Promise<AuthorizeCursorAccountConnectorsResult>;
|
|
55
|
+
/**
|
|
56
|
+
* Mint OAuth `authUrl`s for connectors matching `identifiers` (name or
|
|
57
|
+
* `serverIdentifier`). Omit `serviceAccountId` to probe the signed-in user
|
|
58
|
+
* (local `serve` preflight). Failures return an empty map so the caller
|
|
59
|
+
* can fall back to the dashboard URL.
|
|
60
|
+
*/
|
|
61
|
+
export declare function probeConnectorAuthUrls(args: {
|
|
62
|
+
client: Pick<CursorBackendClient, "getAvailableMcpServers" | "checkHttpMcpStatus">;
|
|
63
|
+
identifiers: readonly string[];
|
|
64
|
+
serviceAccountId?: string;
|
|
65
|
+
}): Promise<Map<string, string>>;
|
|
55
66
|
//# sourceMappingURL=cursor-account-mcp-auth.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cursor-account-mcp-auth.d.ts","sourceRoot":"","sources":["../../src/internal/cursor-account-mcp-auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAEV,mBAAmB,EAEpB,MAAM,4BAA4B,CAAC;AAOpC,iFAAiF;AACjF,wBAAgB,mBAAmB,IAAI,MAAM,CAM5C;AAED,MAAM,WAAW,oCAAoC;IACnD,aAAa,EAAE,IAAI,CACjB,mBAAmB,EACnB,wBAAwB,GAAG,oBAAoB,CAChD,CAAC;IACF,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,2DAA2D;IAC3D,gBAAgB,EAAE,MAAM,CAAC;IACzB,sCAAsC;IACtC,cAAc,EAAE,MAAM,CAAC;IACvB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IAC/B,yEAAyE;IACzE,WAAW,EAAE,OAAO,CAAC;IACrB,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,kBAAkB;IAClB,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,KAAK,C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M,KAAK,IAAI,CAAC;IAC5B,kBAAkB;IAClB,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,sCAAsC;IACrD,0DAA0D;IAC1D,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,gDAAgD;IAChD,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,8CAA8C;IAC9C,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACjD;AAMD;;;;GAIG;AACH,wBAAsB,gCAAgC,CACpD,IAAI,EAAE,oCAAoC,GACzC,OAAO,CAAC,sCAAsC,CAAC,CA8FjD;AA2DD;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAAC,IAAI,EAAE;IACjD,MAAM,EAAE,IAAI,CACV,mBAAmB,EACnB,wBAAwB,GAAG,oBAAoB,CAChD,CAAC;IACF,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CA0C/B"}
|
|
@@ -143,6 +143,75 @@ function selectConnectors(available, filter) {
|
|
|
143
143
|
}
|
|
144
144
|
return { servers, unmatched };
|
|
145
145
|
}
|
|
146
|
+
function uniqueConnectorMatch(available, identifier) {
|
|
147
|
+
const wanted = identifier.trim().toLowerCase();
|
|
148
|
+
if (wanted === "") {
|
|
149
|
+
return undefined;
|
|
150
|
+
}
|
|
151
|
+
const byIdentifier = available.filter((server) => { var _a; return ((_a = server.serverIdentifier) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === wanted; });
|
|
152
|
+
if (byIdentifier.length === 1) {
|
|
153
|
+
return byIdentifier[0];
|
|
154
|
+
}
|
|
155
|
+
if (byIdentifier.length > 1) {
|
|
156
|
+
return undefined;
|
|
157
|
+
}
|
|
158
|
+
const byName = available.filter((server) => server.name.toLowerCase() === wanted);
|
|
159
|
+
if (byName.length === 1) {
|
|
160
|
+
return byName[0];
|
|
161
|
+
}
|
|
162
|
+
return undefined;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Mint OAuth `authUrl`s for connectors matching `identifiers` (name or
|
|
166
|
+
* `serverIdentifier`). Omit `serviceAccountId` to probe the signed-in user
|
|
167
|
+
* (local `serve` preflight). Failures return an empty map so the caller
|
|
168
|
+
* can fall back to the dashboard URL.
|
|
169
|
+
*/
|
|
170
|
+
export function probeConnectorAuthUrls(args) {
|
|
171
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
172
|
+
var _a, _b;
|
|
173
|
+
const urls = new Map();
|
|
174
|
+
if (args.identifiers.length === 0) {
|
|
175
|
+
return urls;
|
|
176
|
+
}
|
|
177
|
+
try {
|
|
178
|
+
const available = yield args.client.getAvailableMcpServers();
|
|
179
|
+
const matched = [];
|
|
180
|
+
const seen = new Set();
|
|
181
|
+
for (const identifier of args.identifiers) {
|
|
182
|
+
const match = uniqueConnectorMatch(available, identifier);
|
|
183
|
+
if (match === undefined || seen.has(match.id)) {
|
|
184
|
+
continue;
|
|
185
|
+
}
|
|
186
|
+
seen.add(match.id);
|
|
187
|
+
matched.push(match);
|
|
188
|
+
}
|
|
189
|
+
if (matched.length === 0) {
|
|
190
|
+
return urls;
|
|
191
|
+
}
|
|
192
|
+
const statuses = yield args.client.checkHttpMcpStatus({
|
|
193
|
+
serverIds: matched.map((server) => server.id),
|
|
194
|
+
oauthRedirectUri: mcpOauthRedirectUri(),
|
|
195
|
+
serviceAccountId: args.serviceAccountId,
|
|
196
|
+
});
|
|
197
|
+
const statusById = new Map(statuses.map((status) => [status.id, status]));
|
|
198
|
+
for (const identifier of args.identifiers) {
|
|
199
|
+
const match = uniqueConnectorMatch(available, identifier);
|
|
200
|
+
if (match === undefined) {
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
203
|
+
const authUrl = (_b = (_a = statusById.get(match.id)) === null || _a === void 0 ? void 0 : _a.authUrl) === null || _b === void 0 ? void 0 : _b.trim();
|
|
204
|
+
if (authUrl !== undefined && authUrl !== "") {
|
|
205
|
+
urls.set(identifier, authUrl);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
return urls;
|
|
209
|
+
}
|
|
210
|
+
catch (_c) {
|
|
211
|
+
return urls;
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
}
|
|
146
215
|
function pollUntilAuthorized(args) {
|
|
147
216
|
return __awaiter(this, void 0, void 0, function* () {
|
|
148
217
|
const deadline = Date.now() + args.pollTimeoutMs;
|