@cursor/july 0.1.62 → 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 +11 -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/channel-watch.d.ts +2 -1
- package/dist/channels/slack/channel-watch.d.ts.map +1 -1
- package/dist/channels/slack/channel-watch.js +7 -3
- package/dist/channels/slack/dispatch.d.ts +9 -0
- package/dist/channels/slack/dispatch.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.js +41 -21
- 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 +14 -11
- package/dist/channels/slack/nudge-store.d.ts +16 -0
- package/dist/channels/slack/nudge-store.d.ts.map +1 -1
- package/dist/channels/slack/nudge-store.js +53 -0
- package/dist/channels/slack/slack-channel.d.ts.map +1 -1
- package/dist/channels/slack/slack-channel.js +4 -1
- package/dist/channels/slack/types.d.ts +24 -7
- 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.B-biogkN.js → app.CdbcFD8T.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.DQad--_z.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.DZqKtFZS.js → VPLocalSearchBox.D_NKImM7.js} +1 -1
- package/dist/docs/assets/chunks/{theme.BwC5zP2r.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.CSQiNzre.js → reference_connections.md.Cu3N-S3Q.js} +26 -9
- package/dist/docs/assets/reference_connections.md.Cu3N-S3Q.lean.js +1 -0
- package/dist/docs/assets/{reference_sessions.md.DBVFi2Sx.js → reference_sessions.md.B0DdlM-K.js} +1 -1
- package/dist/docs/assets/{reference_tools.md.kJfJAP2m.js → reference_tools.md.DTg_kEsx.js} +2 -2
- package/dist/docs/assets/{reference_tools.md.kJfJAP2m.lean.js → reference_tools.md.DTg_kEsx.lean.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 +28 -11
- 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/files-backends/agent-store-presigned-url.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/advertise-tools.d.ts +79 -0
- package/dist/internal/advertise-tools.d.ts.map +1 -0
- package/dist/internal/advertise-tools.js +185 -0
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +7 -1
- package/dist/internal/cli-manifest.d.ts +19 -0
- package/dist/internal/cli-manifest.d.ts.map +1 -0
- package/dist/internal/cli-manifest.js +49 -0
- package/dist/internal/cli-slack.d.ts.map +1 -1
- package/dist/internal/cli-slack.js +9 -1
- 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/cursor-agent-template.d.ts +9 -0
- package/dist/internal/cursor-agent-template.d.ts.map +1 -0
- package/dist/internal/cursor-agent-template.js +37 -0
- package/dist/internal/deploy-client.d.ts +1 -0
- package/dist/internal/deploy-client.d.ts.map +1 -1
- package/dist/internal/deploy-client.js +18 -2
- package/dist/internal/deploy-manifest.d.ts +76 -0
- package/dist/internal/deploy-manifest.d.ts.map +1 -0
- package/dist/internal/deploy-manifest.js +117 -0
- package/dist/internal/deployment-scm-event-stream.d.ts +116 -0
- package/dist/internal/deployment-scm-event-stream.d.ts.map +1 -0
- package/dist/internal/deployment-scm-event-stream.js +474 -0
- package/dist/internal/discovery.d.ts.map +1 -1
- package/dist/internal/discovery.js +111 -10
- package/dist/internal/init-project.d.ts.map +1 -1
- package/dist/internal/init-project.js +12 -123
- 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.d.ts +18 -0
- package/dist/internal/mcp-host.d.ts.map +1 -1
- package/dist/internal/mcp-host.js +43 -5
- 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/sdk-runner.d.ts +1 -1
- package/dist/internal/sdk-runner.d.ts.map +1 -1
- package/dist/internal/sdk-runner.js +36 -13
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +18 -0
- package/dist/internal/session-engine.d.ts +66 -0
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +428 -110
- package/dist/internal/shallow-clone.d.ts +170 -0
- package/dist/internal/shallow-clone.d.ts.map +1 -0
- package/dist/internal/shallow-clone.js +412 -0
- package/dist/internal/slack-provision-client.d.ts +2 -0
- package/dist/internal/slack-provision-client.d.ts.map +1 -1
- package/dist/internal/slack-provision-client.js +1 -0
- 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/turn-lease-store.d.ts +44 -0
- package/dist/internal/turn-lease-store.d.ts.map +1 -0
- package/dist/internal/turn-lease-store.js +139 -0
- package/dist/internal/workspace.d.ts +14 -0
- package/dist/internal/workspace.d.ts.map +1 -1
- package/dist/internal/workspace.js +33 -0
- package/dist/playground/assets/index-77uhu5Kr.css +1 -0
- package/dist/playground/assets/index-D4buox4m.js +85 -0
- package/dist/playground/index.html +2 -2
- package/dist/storage-protocol.d.ts +122 -0
- package/dist/storage-protocol.d.ts.map +1 -0
- package/dist/storage-protocol.js +173 -0
- package/dist/storage.d.ts +2 -72
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +2 -82
- package/dist/tools.d.ts +7 -0
- package/dist/tools.d.ts.map +1 -1
- package/dist/types.d.ts +141 -6
- 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 +108 -10
- package/docs/reference/sessions.md +2 -2
- package/docs/reference/tools.md +14 -0
- package/docs/troubleshooting.md +3 -2
- package/package.json +7 -2
- 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 +12 -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/channel-watch.ts +6 -3
- package/src/channels/slack/dispatch.ts +40 -3
- package/src/channels/slack/manifest.ts +9 -10
- package/src/channels/slack/nudge-store.ts +56 -0
- package/src/channels/slack/slack-channel.ts +3 -0
- package/src/channels/slack/types.ts +24 -7
- package/src/connections.ts +17 -5
- package/src/index.ts +5 -0
- package/src/internal/advertise-tools.ts +278 -0
- package/src/internal/cli-deploy.ts +11 -1
- package/src/internal/cli-manifest.ts +63 -0
- package/src/internal/cli-slack.ts +10 -1
- 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/cursor-agent-template.ts +46 -0
- package/src/internal/deploy-client.ts +25 -6
- package/src/internal/deploy-manifest.ts +161 -0
- package/src/internal/deployment-scm-event-stream.ts +593 -0
- package/src/internal/discovery.ts +132 -3
- package/src/internal/init-project.ts +18 -153
- 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 +70 -9
- 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/sdk-runner.ts +50 -11
- package/src/internal/server.ts +19 -0
- package/src/internal/session-engine.ts +392 -19
- package/src/internal/shallow-clone.ts +595 -0
- package/src/internal/slack-provision-client.ts +3 -0
- package/src/internal/terminal-style.ts +67 -1
- package/src/internal/turn-lease-store.ts +147 -0
- package/src/internal/workspace.ts +33 -0
- package/src/storage-protocol.ts +247 -0
- package/src/storage.ts +16 -110
- package/src/tools.ts +7 -0
- package/src/types.ts +149 -7
- package/templates/agentic-owners/agent/agent.ts +3 -0
- package/templates/demo/agent/agent.ts +3 -0
- package/templates/pr-autofixer/agent/lib/drive-schemas.ts +4 -1
- package/templates/security-reviewer/agent/agent.ts +3 -0
- package/templates/triage/agent/agent.ts +3 -0
- package/dist/docs/assets/chunks/@localSearchIndexroot.5ozYNf74.js +0 -1
- package/dist/docs/assets/reference_connections.md.CSQiNzre.lean.js +0 -1
- package/dist/docs/assets/troubleshooting.md.CuVztCKs.js +0 -1
- package/dist/playground/assets/index-B4rcOgeP.css +0 -1
- package/dist/playground/assets/index-DXcY42Jv.js +0 -85
- /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/{troubleshooting.md.CuVztCKs.lean.js → troubleshooting.md.DQ-hYuZT.lean.js} +0 -0
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Advertised connection tools (`defineConnection({ advertiseTools: true })`).
|
|
3
|
+
*
|
|
4
|
+
* The session engine calls {@link resolveAdvertisedTools} while building
|
|
5
|
+
* every local turn: for each advertising connection it lists the server's
|
|
6
|
+
* tools and synthesizes a named 1:1 passthrough server tool per entry —
|
|
7
|
+
* the server's own names, descriptions, and live schemas — merged into the
|
|
8
|
+
* authored `agent/tools/` catalog. Because it runs at turn-build time it
|
|
9
|
+
* covers every way a turn starts (dispatcher sends, follow-ups, reminder
|
|
10
|
+
* fires that call the engine directly) and survives process restarts,
|
|
11
|
+
* since nothing is parked in memory between turns.
|
|
12
|
+
*
|
|
13
|
+
* Connections with per-session `auth` are listed and called through a
|
|
14
|
+
* one-off client carrying that session's headers (the registry's cached
|
|
15
|
+
* per-name client would leak one session's identity into another);
|
|
16
|
+
* auth-less connections go through the shared `host.mcp` registry, which
|
|
17
|
+
* also covers serve-resolved transports (Cursor account bridges, peers).
|
|
18
|
+
*
|
|
19
|
+
* Advertised names follow the Cursor-account MCP bridge
|
|
20
|
+
* (`packages/agent-serve/src/internal/cursor/account-mcp.ts`): slug
|
|
21
|
+
* `[^a-zA-Z0-9_-]` to `_`, collision suffixes `_2` / `_3`, and call the
|
|
22
|
+
* original advertised name. That is the same mapping `packages/agent`
|
|
23
|
+
* `normalizeMcpToolName` uses for IDE/Sand MCP tools. A listing failure
|
|
24
|
+
* still fails the turn rather than running it with a silently shrunken
|
|
25
|
+
* toolset.
|
|
26
|
+
*/
|
|
27
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
28
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
29
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
30
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
31
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
32
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
33
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
import { brandDefinition } from "./brand.js";
|
|
37
|
+
import { sanitizeMcpToolName, suffixMcpToolName, } from "./sanitize-mcp-tool-name.js";
|
|
38
|
+
/**
|
|
39
|
+
* Model-facing advertised names after {@link sanitizeMcpToolName} — the
|
|
40
|
+
* same MCP-client shape the Cursor-account bridge documents
|
|
41
|
+
* (`^[a-zA-Z0-9_-]{1,128}$`). Authored `agent/tools/` filenames stay on
|
|
42
|
+
* discovery's stricter `NAME_PATTERN` (must start alphanumeric).
|
|
43
|
+
*/
|
|
44
|
+
export const ADVERTISED_TOOL_NAME_PATTERN = /^[A-Za-z0-9_-]{1,128}$/;
|
|
45
|
+
const ANY_OBJECT_SCHEMA = {
|
|
46
|
+
type: "object",
|
|
47
|
+
additionalProperties: true,
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Resolve the advertised tools for one session. Returns `[]` when no
|
|
51
|
+
* connection advertises; throws (failing the turn) when a listing fails
|
|
52
|
+
* or a definition is invalid.
|
|
53
|
+
*/
|
|
54
|
+
export function resolveAdvertisedTools(args) {
|
|
55
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
+
var _a;
|
|
57
|
+
const advertising = args.agent.connections.filter((connection) => connection.advertiseTools === true);
|
|
58
|
+
if (advertising.length === 0) {
|
|
59
|
+
return [];
|
|
60
|
+
}
|
|
61
|
+
const sourceFor = (_a = args.sourceFor) !== null && _a !== void 0 ? _a : sourceForConnection;
|
|
62
|
+
const claimed = new Set(args.agent.tools.map((tool) => tool.name));
|
|
63
|
+
const resolved = [];
|
|
64
|
+
for (const connection of advertising) {
|
|
65
|
+
const source = yield sourceFor(connection, args.session, args.hostMcp);
|
|
66
|
+
let listed;
|
|
67
|
+
try {
|
|
68
|
+
listed = yield source.listTools();
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
throw new Error(`Failed to list tools on advertised connection "${connection.name}": ${describeError(error)}`, { cause: error });
|
|
72
|
+
}
|
|
73
|
+
const exposed = exposeListedTools(listed, claimed);
|
|
74
|
+
for (const { info, exposedName } of exposed) {
|
|
75
|
+
resolved.push(toDiscoveredTool(connection, info, exposedName, source));
|
|
76
|
+
claimed.add(exposedName);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return resolved;
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* The production source for one advertising connection: the shared
|
|
84
|
+
* `host.mcp` registry client for auth-less connections (which also covers
|
|
85
|
+
* serve-resolved transports — Cursor account bridges, peers), or a
|
|
86
|
+
* registry one-off with the session's headers substituted when the
|
|
87
|
+
* connection has per-session `auth`. The auth callback is evaluated once
|
|
88
|
+
* per turn, here; the one-off opens a fresh client per operation so one
|
|
89
|
+
* session's identity can never serve another's call.
|
|
90
|
+
*/
|
|
91
|
+
export function sourceForConnection(connection, session, hostMcp) {
|
|
92
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
93
|
+
if (connection.auth === undefined) {
|
|
94
|
+
return {
|
|
95
|
+
listTools: () => hostMcp.listTools(connection.name),
|
|
96
|
+
callTool: (toolName, callArgs) => hostMcp.callTool(connection.name, toolName, callArgs),
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
const transport = connection.transport;
|
|
100
|
+
if (!("url" in transport)) {
|
|
101
|
+
// Discovery rejects auth on non-URL transports; guard for callers that
|
|
102
|
+
// bypass discovery (hand-built projects).
|
|
103
|
+
throw new Error(`Connection "${connection.name}" has per-session auth but no URL transport.`);
|
|
104
|
+
}
|
|
105
|
+
const evaluated = yield connection.auth(session);
|
|
106
|
+
return hostMcp.oneOff(Object.assign(Object.assign({}, connection), { transport: Object.assign(Object.assign({}, transport), { headers: Object.assign(Object.assign({}, transport.headers), evaluated.headers) }) }));
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Same catalog rule as the Cursor-account bridge: slug illegal characters,
|
|
111
|
+
* then `_2` / `_3` … for colliders (including authored tools already in
|
|
112
|
+
* `claimed`). Suffix assignment is stable for a colliding group: sort by
|
|
113
|
+
* original advertised name, independent of `listTools` order.
|
|
114
|
+
*/
|
|
115
|
+
function exposeListedTools(listed, claimed) {
|
|
116
|
+
const byBase = new Map();
|
|
117
|
+
for (const info of listed) {
|
|
118
|
+
const base = sanitizeMcpToolName(info.name);
|
|
119
|
+
const group = byBase.get(base);
|
|
120
|
+
if (group === undefined) {
|
|
121
|
+
byBase.set(base, [info]);
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
group.push(info);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
const taken = new Set(claimed);
|
|
128
|
+
const exposedNameByInfo = new Map();
|
|
129
|
+
const sortedBases = [...byBase.keys()].sort((left, right) => left < right ? -1 : left > right ? 1 : 0);
|
|
130
|
+
for (const base of sortedBases) {
|
|
131
|
+
const group = byBase.get(base);
|
|
132
|
+
group.sort((left, right) => left.name < right.name ? -1 : left.name > right.name ? 1 : 0);
|
|
133
|
+
group.forEach((info, index) => {
|
|
134
|
+
let suffixIndex = index;
|
|
135
|
+
let exposedName = suffixMcpToolName(base, suffixIndex);
|
|
136
|
+
while (taken.has(exposedName)) {
|
|
137
|
+
suffixIndex++;
|
|
138
|
+
exposedName = suffixMcpToolName(base, suffixIndex);
|
|
139
|
+
}
|
|
140
|
+
taken.add(exposedName);
|
|
141
|
+
exposedNameByInfo.set(info, exposedName);
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
return listed.map((info) => ({
|
|
145
|
+
info,
|
|
146
|
+
exposedName: exposedNameByInfo.get(info),
|
|
147
|
+
}));
|
|
148
|
+
}
|
|
149
|
+
function toDiscoveredTool(connection, info, exposedName, source) {
|
|
150
|
+
var _a;
|
|
151
|
+
const description = info.description === undefined || info.description.trim() === ""
|
|
152
|
+
? `${info.name} — MCP tool on the "${connection.name}" connection, forwarded 1:1.`
|
|
153
|
+
: info.description;
|
|
154
|
+
const inputSchema = (_a = info.inputSchema) !== null && _a !== void 0 ? _a : ANY_OBJECT_SCHEMA;
|
|
155
|
+
const outputSchema = info.outputSchema;
|
|
156
|
+
const definition = brandDefinition("tool", Object.assign(Object.assign({ description,
|
|
157
|
+
inputSchema }, (outputSchema === undefined ? {} : { outputSchema })), { execute: (input) => __awaiter(this, void 0, void 0, function* () {
|
|
158
|
+
return formatMcpToolResult(connection.name, info.name, yield source.callTool(info.name, input !== null && input !== void 0 ? input : {}));
|
|
159
|
+
}) }));
|
|
160
|
+
return Object.assign(Object.assign({ name: exposedName, description,
|
|
161
|
+
inputSchema }, (outputSchema === undefined ? {} : { outputSchema })), { execution: "server", needsApproval: false, definition });
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Render an MCP call result for the model: text parts joined, non-text
|
|
165
|
+
* parts noted by type, `isError` surfaced as a thrown error so the turn
|
|
166
|
+
* records a tool error instead of error-shaped prose.
|
|
167
|
+
*/
|
|
168
|
+
export function formatMcpToolResult(connectionName, toolName, result) {
|
|
169
|
+
const parts = result.content.map((item) => item.type === "text" && typeof item.text === "string"
|
|
170
|
+
? item.text
|
|
171
|
+
: `[${item.type} content omitted]`);
|
|
172
|
+
const text = parts.join("\n").trim();
|
|
173
|
+
if (result.isError === true) {
|
|
174
|
+
throw new Error(text === "" ? `${connectionName} tool ${toolName} failed` : text);
|
|
175
|
+
}
|
|
176
|
+
if (text !== "") {
|
|
177
|
+
return text;
|
|
178
|
+
}
|
|
179
|
+
return result.structuredContent !== undefined
|
|
180
|
+
? JSON.stringify(result.structuredContent, null, 2)
|
|
181
|
+
: "(empty result)";
|
|
182
|
+
}
|
|
183
|
+
function describeError(error) {
|
|
184
|
+
return error instanceof Error ? error.message : String(error);
|
|
185
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-deploy.d.ts","sourceRoot":"","sources":["../../src/internal/cli-deploy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"cli-deploy.d.ts","sourceRoot":"","sources":["../../src/internal/cli-deploy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAgBH,OAAO,EACL,sBAAsB,EAcvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,KAAK,SAAS,EAAwB,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EACL,KAAK,aAAa,EAInB,MAAM,gBAAgB,CAAC;AAaxB,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;I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MD,wBAAsB,OAAO,CAC3B,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,MAAM,CAAC,CAqCjB;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;AAMD,wBAAsB,aAAa,CACjC,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,KAAK,EAAE,MAAM,EAAE,EACf,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,MAAM,CAAC,CA4EjB;AAED,wBAAsB,cAAc,CAClC,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,MAAM,CAAC,CAkCjB;AAED,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,MAAM,CAAC,CA4BjB;AAoED,wEAAwE;AACxE,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,CAAC,cAAc,GAC5B,MAAM,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAuCnC"}
|
|
@@ -23,6 +23,7 @@ import { isCursorAccountTransport, } from "../types.js";
|
|
|
23
23
|
import { CursorBackendClient } from "./cursor/backend-client.js";
|
|
24
24
|
import { cursorExternalApiUrl, resolveApiKey, SIGN_IN_HINT, } from "./cursor/credentials.js";
|
|
25
25
|
import { authorizeCursorAccountConnectors } from "./cursor-account-mcp-auth.js";
|
|
26
|
+
import { readDeployTemplate } from "./cursor-agent-template.js";
|
|
26
27
|
import { AgentServeDeployClient, DeployApiError, deploymentServiceAccountId, slugFromDirectoryName, TERMINAL_DEPLOY_STATUSES, validateDeploymentSlug, } from "./deploy-client.js";
|
|
27
28
|
import { inferDeployGitSource } from "./deploy-source.js";
|
|
28
29
|
import { isAgentProjectDir, listChildAgentDirs, loadAgentProject, } from "./discovery.js";
|
|
@@ -437,7 +438,12 @@ function deployOne(ctx, options, target, extras) {
|
|
|
437
438
|
: { cursorEventRepos: options.cursorEventsRepos })), (egressAllowedDomains.length === 0 ? {} : { egressAllowedDomains })), { publicRoutePaths: publicRoutePaths.length === 0 ? undefined : publicRoutePaths });
|
|
438
439
|
let accepted;
|
|
439
440
|
try {
|
|
440
|
-
accepted = yield ctx.client.deploy({
|
|
441
|
+
accepted = yield ctx.client.deploy({
|
|
442
|
+
teamId: ctx.teamId,
|
|
443
|
+
slug,
|
|
444
|
+
source,
|
|
445
|
+
template: readDeployTemplate(dir),
|
|
446
|
+
});
|
|
441
447
|
}
|
|
442
448
|
catch (error) {
|
|
443
449
|
return renderApiError(error, ctx.err);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `july manifest` — print the offline deploy manifest (Wd-1 of
|
|
3
|
+
* `docs/agent-serve/agent-sdk-event-ingress-plan.md`).
|
|
4
|
+
*
|
|
5
|
+
* Loads the agent project from disk and emits the statically-derived
|
|
6
|
+
* metadata the control plane stores at deploy time: declared GitHub webhook
|
|
7
|
+
* events, egress domains, public routes, and the full `/v1/info` payload.
|
|
8
|
+
* Runs entirely offline — no VM, no engine, no network.
|
|
9
|
+
*/
|
|
10
|
+
export interface CmdManifestOptions {
|
|
11
|
+
dir: string;
|
|
12
|
+
/** Compact single-line JSON (machine consumption); default pretty. */
|
|
13
|
+
json?: boolean;
|
|
14
|
+
/** Test seams. */
|
|
15
|
+
out?: (line: string) => void;
|
|
16
|
+
err?: (line: string) => void;
|
|
17
|
+
}
|
|
18
|
+
export declare function cmdManifest(options: CmdManifestOptions): Promise<number>;
|
|
19
|
+
//# sourceMappingURL=cli-manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-manifest.d.ts","sourceRoot":"","sources":["../../src/internal/cli-manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAQH,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,sEAAsE;IACtE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,kBAAkB;IAClB,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9B;AAED,wBAAsB,WAAW,CAC/B,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,MAAM,CAAC,CAmCjB"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `july manifest` — print the offline deploy manifest (Wd-1 of
|
|
3
|
+
* `docs/agent-serve/agent-sdk-event-ingress-plan.md`).
|
|
4
|
+
*
|
|
5
|
+
* Loads the agent project from disk and emits the statically-derived
|
|
6
|
+
* metadata the control plane stores at deploy time: declared GitHub webhook
|
|
7
|
+
* events, egress domains, public routes, and the full `/v1/info` payload.
|
|
8
|
+
* Runs entirely offline — no VM, no engine, no network.
|
|
9
|
+
*/
|
|
10
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
11
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
12
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
13
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
14
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
15
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
16
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
import { buildAgentDeployManifest, parseAgentDeployManifest, } from "./deploy-manifest.js";
|
|
20
|
+
import { isAgentProjectDir, loadAgentProject } from "./discovery.js";
|
|
21
|
+
export function cmdManifest(options) {
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
var _a, _b;
|
|
24
|
+
const out = (_a = options.out) !== null && _a !== void 0 ? _a : ((line) => process.stdout.write(line));
|
|
25
|
+
const err = (_b = options.err) !== null && _b !== void 0 ? _b : ((line) => process.stderr.write(line));
|
|
26
|
+
if (!(yield isAgentProjectDir(options.dir))) {
|
|
27
|
+
err(`No agent project found at ${options.dir} (expected an agent.ts default-exporting defineAgent({ ... })).\n`);
|
|
28
|
+
return 1;
|
|
29
|
+
}
|
|
30
|
+
const project = yield loadAgentProject(options.dir);
|
|
31
|
+
for (const diagnostic of project.diagnostics) {
|
|
32
|
+
err(`${diagnostic.severity}: ${diagnostic.message}\n`);
|
|
33
|
+
}
|
|
34
|
+
if (project.diagnostics.some((d) => d.severity === "error")) {
|
|
35
|
+
return 1;
|
|
36
|
+
}
|
|
37
|
+
const manifest = buildAgentDeployManifest(project);
|
|
38
|
+
// Round-trip through the wire schema so `july manifest` can never emit
|
|
39
|
+
// something the control plane contract would reject.
|
|
40
|
+
if (parseAgentDeployManifest(JSON.parse(JSON.stringify(manifest))) === undefined) {
|
|
41
|
+
err("internal error: generated manifest failed schema validation\n");
|
|
42
|
+
return 1;
|
|
43
|
+
}
|
|
44
|
+
out(options.json === true
|
|
45
|
+
? `${JSON.stringify(manifest)}\n`
|
|
46
|
+
: `${JSON.stringify(manifest, null, 2)}\n`);
|
|
47
|
+
return 0;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file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,OAAO,CAAC;IAChB,mEAAmE;IACnE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,2EAA2E;IAC3E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,kBAAkB;IAClB,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;IACzB,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,UAAU,CAAC,EAAE,OAAO,cAAc,CAAC;IACnC,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,OAAO,CAAC,EAAE,eAAe,CAAC;CAC3B;AA4CD,wBAAsB,QAAQ,CAC5B,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,MAAM,CAAC,CA4BjB;AA6RD,wBAAsB,cAAc,CAClC,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,MAAM,CAAC,CAoLjB;AAiDD,wBAAsB,eAAe,CACnC,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,MAAM,CAAC,CA4CjB;AAED,wBAAsB,YAAY,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAsD5E"}
|
|
@@ -283,7 +283,15 @@ function writePendingAdminWait(ctx, poll) {
|
|
|
283
283
|
? poll.oauthAuthorizeUrl
|
|
284
284
|
: undefined;
|
|
285
285
|
ctx.err(`Waiting for a Slack admin to approve the app${appSuffix}.\n\n`);
|
|
286
|
-
if (
|
|
286
|
+
if (poll.approvalRequest === "pending") {
|
|
287
|
+
// Already in the admin queue: nothing to file, so no browser hop.
|
|
288
|
+
ctx.err(ctx.dim(` Approval request sent; workspace owners were notified.\n\n`));
|
|
289
|
+
if (requestUrl !== undefined) {
|
|
290
|
+
ctx.err(ctx.dim(` Send a reminder from:\n\n`));
|
|
291
|
+
ctx.err(` ${requestUrl}\n\n`);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
else if (requestUrl !== undefined) {
|
|
287
295
|
ctx.err(ctx.dim(` Slack will notify workspace owners once the request is in their queue.\n` +
|
|
288
296
|
` Open this page to file it or send a reminder:\n\n`));
|
|
289
297
|
ctx.err(` ${requestUrl}\n\n`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert-workflow.d.ts","sourceRoot":"","sources":["../../../src/internal/convert-automation/convert-workflow.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"convert-workflow.d.ts","sourceRoot":"","sources":["../../../src/internal/convert-automation/convert-workflow.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAKV,oBAAoB,EACpB,qBAAqB,EAQtB,MAAM,YAAY,CAAC;AAUpB,wBAAgB,eAAe,CAC7B,KAAK,EAAE,oBAAoB,GAC1B,qBAAqB,CA4GvB"}
|
|
@@ -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;AASH,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAU/D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACV,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,qBAAqB,CAAC;AAU7B,0EAA0E;AAC1E,eAAO,MAAM,gCAAgC,8CACA,CAAC;AAC9C,2EAA2E;AAC3E,eAAO,MAAM,oCAAoC,yDACO,CAAC;AAMzD,MAAM,WAAW,0BAA0B;IACzC,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAC;IACb,sEAAsE;IACtE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAA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