@cursor/july 0.1.68 → 0.1.74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (252) hide show
  1. package/AGENTS.md +17 -13
  2. package/README.md +23 -11
  3. package/dist/bin/agent-serve.js +10 -7
  4. package/dist/channels/github/api.d.ts +2 -0
  5. package/dist/channels/github/api.d.ts.map +1 -1
  6. package/dist/channels/github/api.js +2 -1
  7. package/dist/channels/github/binding.d.ts +7 -0
  8. package/dist/channels/github/binding.d.ts.map +1 -1
  9. package/dist/channels/github/binding.js +4 -0
  10. package/dist/channels/github/checks.d.ts +99 -0
  11. package/dist/channels/github/checks.d.ts.map +1 -0
  12. package/dist/channels/github/checks.js +108 -0
  13. package/dist/channels/github/cursor-account.d.ts +4 -4
  14. package/dist/channels/github/cursor-account.d.ts.map +1 -1
  15. package/dist/channels/github/cursor-account.js +7 -5
  16. package/dist/channels/github/index.d.ts +1 -0
  17. package/dist/channels/github/index.d.ts.map +1 -1
  18. package/dist/channels/github/index.js +1 -0
  19. package/dist/channels/github/types.d.ts +8 -0
  20. package/dist/channels/github/types.d.ts.map +1 -1
  21. package/dist/channels/slack/manifest.d.ts +2 -2
  22. package/dist/channels/slack/manifest.d.ts.map +1 -1
  23. package/dist/channels/slack/manifest.js +13 -11
  24. package/dist/channels/slack/types.d.ts +2 -2
  25. package/dist/channels/slack/types.d.ts.map +1 -1
  26. package/dist/connections.d.ts +17 -5
  27. package/dist/connections.d.ts.map +1 -1
  28. package/dist/connections.js +17 -5
  29. package/dist/docs/404.html +2 -2
  30. package/dist/docs/ab.html +3 -3
  31. package/dist/docs/assets/{app.C5XUTCw9.js → app.BETd-WqU.js} +1 -1
  32. package/dist/docs/assets/chunks/@localSearchIndexroot.DM5INS71.js +1 -0
  33. package/dist/docs/assets/chunks/{VPLocalSearchBox.CGDTAYHY.js → VPLocalSearchBox.wEaGEmV9.js} +1 -1
  34. package/dist/docs/assets/chunks/{theme.lPixh250.js → theme.DNDicFOP.js} +2 -2
  35. package/dist/docs/assets/{concepts.md.CqOsxbMU.js → concepts.md.BXAm6G-C.js} +1 -1
  36. package/dist/docs/assets/{guides_mcp-oauth.md.C7G7IykG.js → guides_mcp-oauth.md.CzEB6RaG.js} +1 -1
  37. package/dist/docs/assets/{reference_agent-config.md.DHkkvcEZ.js → reference_agent-config.md.BZnEKfEc.js} +3 -4
  38. package/dist/docs/assets/{reference_agent-config.md.DHkkvcEZ.lean.js → reference_agent-config.md.BZnEKfEc.lean.js} +1 -1
  39. package/dist/docs/assets/{reference_cli.md.Cl14Jfo3.js → reference_cli.md.TAaYU8br.js} +3 -3
  40. package/dist/docs/assets/{reference_cli.md.Cl14Jfo3.lean.js → reference_cli.md.TAaYU8br.lean.js} +1 -1
  41. package/dist/docs/assets/{reference_connections.md.Bwswbm6H.js → reference_connections.md.Cu3N-S3Q.js} +18 -11
  42. package/dist/docs/assets/{reference_connections.md.Bwswbm6H.lean.js → reference_connections.md.Cu3N-S3Q.lean.js} +1 -1
  43. package/dist/docs/assets/{reference_sessions.md.DBVFi2Sx.js → reference_sessions.md.B0DdlM-K.js} +1 -1
  44. package/dist/docs/assets/{reference_tools.md.Wmvb7Lob.js → reference_tools.md.DTg_kEsx.js} +1 -1
  45. package/dist/docs/assets/scaffolding-agents.md.CiGsJ1aw.js +1 -0
  46. package/dist/docs/assets/{scaffolding-agents.md.CrWSA0Ko.lean.js → scaffolding-agents.md.CiGsJ1aw.lean.js} +1 -1
  47. package/dist/docs/assets/troubleshooting.md.DQ-hYuZT.js +1 -0
  48. package/dist/docs/building-with-agents.html +3 -3
  49. package/dist/docs/concepts.html +5 -5
  50. package/dist/docs/deployment.html +3 -3
  51. package/dist/docs/evals.html +3 -3
  52. package/dist/docs/example-agents/approval-buddy.html +3 -3
  53. package/dist/docs/example-agents/benny.html +3 -3
  54. package/dist/docs/example-agents/bugbot.html +3 -3
  55. package/dist/docs/example-agents/codebase-wiki.html +3 -3
  56. package/dist/docs/example-agents/codeowners-review.html +3 -3
  57. package/dist/docs/example-agents/concierge.html +3 -3
  58. package/dist/docs/example-agents/fsd.html +3 -3
  59. package/dist/docs/example-agents/index.html +3 -3
  60. package/dist/docs/example-agents/knowledge-base.html +3 -3
  61. package/dist/docs/example-agents/oncall.html +3 -3
  62. package/dist/docs/example-agents/security-reviewer.html +3 -3
  63. package/dist/docs/example-agents/slack-agent.html +3 -3
  64. package/dist/docs/example-agents/weather-agent.html +3 -3
  65. package/dist/docs/guides/agent-to-agent.html +3 -3
  66. package/dist/docs/guides/cloud-runtime.html +3 -3
  67. package/dist/docs/guides/convert-automation.html +3 -3
  68. package/dist/docs/guides/github.html +3 -3
  69. package/dist/docs/guides/human-in-the-loop.html +3 -3
  70. package/dist/docs/guides/mcp-oauth.html +5 -5
  71. package/dist/docs/guides/opentelemetry.html +3 -3
  72. package/dist/docs/guides/slack.html +3 -3
  73. package/dist/docs/guides/webhooks.html +3 -3
  74. package/dist/docs/hashmap.json +1 -1
  75. package/dist/docs/hillclimbing.html +3 -3
  76. package/dist/docs/index.html +3 -3
  77. package/dist/docs/quickstart.html +3 -3
  78. package/dist/docs/reference/agent-config.html +5 -6
  79. package/dist/docs/reference/artifacts.html +3 -3
  80. package/dist/docs/reference/channels.html +3 -3
  81. package/dist/docs/reference/cli.html +6 -6
  82. package/dist/docs/reference/connections.html +20 -13
  83. package/dist/docs/reference/hooks.html +3 -3
  84. package/dist/docs/reference/http-api.html +3 -3
  85. package/dist/docs/reference/instructions.html +3 -3
  86. package/dist/docs/reference/playground.html +3 -3
  87. package/dist/docs/reference/project-layout.html +3 -3
  88. package/dist/docs/reference/prompt.html +3 -3
  89. package/dist/docs/reference/schedules.html +3 -3
  90. package/dist/docs/reference/sessions.html +5 -5
  91. package/dist/docs/reference/skills.html +3 -3
  92. package/dist/docs/reference/subagents.html +3 -3
  93. package/dist/docs/reference/tools.html +5 -5
  94. package/dist/docs/scaffolding-agents.html +5 -5
  95. package/dist/docs/storage.html +3 -3
  96. package/dist/docs/templates/agentic-owners.html +3 -3
  97. package/dist/docs/templates/demo.html +3 -3
  98. package/dist/docs/templates/pr-autofixer.html +3 -3
  99. package/dist/docs/templates/security-reviewer.html +3 -3
  100. package/dist/docs/templates/triage.html +3 -3
  101. package/dist/docs/troubleshooting.html +5 -5
  102. package/dist/internal/advertise-tools.d.ts +11 -6
  103. package/dist/internal/advertise-tools.d.ts.map +1 -1
  104. package/dist/internal/advertise-tools.js +63 -30
  105. package/dist/internal/cli-deploy.d.ts.map +1 -1
  106. package/dist/internal/cli-deploy.js +2 -4
  107. package/dist/internal/cli-skills.d.ts +4 -2
  108. package/dist/internal/cli-skills.d.ts.map +1 -1
  109. package/dist/internal/cli-skills.js +8 -3
  110. package/dist/internal/convert-automation/convert-workflow.d.ts.map +1 -1
  111. package/dist/internal/convert-automation/convert-workflow.js +2 -10
  112. package/dist/internal/cursor/account-mcp.d.ts +29 -3
  113. package/dist/internal/cursor/account-mcp.d.ts.map +1 -1
  114. package/dist/internal/cursor/account-mcp.js +147 -67
  115. package/dist/internal/cursor/backend-client.d.ts +11 -6
  116. package/dist/internal/cursor/backend-client.d.ts.map +1 -1
  117. package/dist/internal/cursor/backend-client.js +32 -10
  118. package/dist/internal/cursor-account-mcp-auth.d.ts +11 -0
  119. package/dist/internal/cursor-account-mcp-auth.d.ts.map +1 -1
  120. package/dist/internal/cursor-account-mcp-auth.js +69 -0
  121. package/dist/internal/deploy-client.d.ts +0 -7
  122. package/dist/internal/deploy-client.d.ts.map +1 -1
  123. package/dist/internal/deploy-client.js +2 -4
  124. package/dist/internal/deploy-manifest.d.ts +15 -24
  125. package/dist/internal/deploy-manifest.d.ts.map +1 -1
  126. package/dist/internal/deploy-manifest.js +38 -27
  127. package/dist/internal/deployment-scm-event-stream.d.ts +4 -1
  128. package/dist/internal/deployment-scm-event-stream.d.ts.map +1 -1
  129. package/dist/internal/deployment-scm-event-stream.js +15 -1
  130. package/dist/internal/discovery.d.ts.map +1 -1
  131. package/dist/internal/discovery.js +42 -10
  132. package/dist/internal/init-project.d.ts.map +1 -1
  133. package/dist/internal/init-project.js +7 -106
  134. package/dist/internal/init-scaffold.d.ts +8 -0
  135. package/dist/internal/init-scaffold.d.ts.map +1 -0
  136. package/dist/internal/init-scaffold.js +168 -0
  137. package/dist/internal/inline-stdio-mcp.d.ts +2 -0
  138. package/dist/internal/inline-stdio-mcp.d.ts.map +1 -1
  139. package/dist/internal/inline-stdio-mcp.js +10 -8
  140. package/dist/internal/install-cursor-skills.d.ts +71 -16
  141. package/dist/internal/install-cursor-skills.d.ts.map +1 -1
  142. package/dist/internal/install-cursor-skills.js +160 -48
  143. package/dist/internal/json-schema.d.ts +7 -0
  144. package/dist/internal/json-schema.d.ts.map +1 -1
  145. package/dist/internal/json-schema.js +18 -3
  146. package/dist/internal/mcp-endpoint.js +7 -7
  147. package/dist/internal/mcp-host.js +4 -2
  148. package/dist/internal/mcp-oauth.d.ts +22 -0
  149. package/dist/internal/mcp-oauth.d.ts.map +1 -1
  150. package/dist/internal/mcp-oauth.js +40 -1
  151. package/dist/internal/package-inline-stdio.d.ts.map +1 -1
  152. package/dist/internal/package-inline-stdio.js +5 -5
  153. package/dist/internal/review-comments.d.ts +97 -0
  154. package/dist/internal/review-comments.d.ts.map +1 -1
  155. package/dist/internal/review-comments.js +151 -0
  156. package/dist/internal/sanitize-mcp-tool-name.d.ts +20 -0
  157. package/dist/internal/sanitize-mcp-tool-name.d.ts.map +1 -0
  158. package/dist/internal/sanitize-mcp-tool-name.js +30 -0
  159. package/dist/internal/sdk-runner.d.ts.map +1 -1
  160. package/dist/internal/sdk-runner.js +6 -2
  161. package/dist/internal/session-engine.d.ts.map +1 -1
  162. package/dist/internal/session-engine.js +4 -6
  163. package/dist/internal/shallow-clone.d.ts +94 -39
  164. package/dist/internal/shallow-clone.d.ts.map +1 -1
  165. package/dist/internal/shallow-clone.js +188 -68
  166. package/dist/internal/terminal-style.d.ts +18 -0
  167. package/dist/internal/terminal-style.d.ts.map +1 -1
  168. package/dist/internal/terminal-style.js +46 -1
  169. package/dist/internal/workspace.d.ts +2 -0
  170. package/dist/internal/workspace.d.ts.map +1 -1
  171. package/dist/internal/workspace.js +5 -0
  172. package/dist/playground/assets/index-D_8I9TM0.js +85 -0
  173. package/dist/playground/assets/index-M3nSMc6_.css +1 -0
  174. package/dist/playground/index.html +2 -2
  175. package/dist/tools.d.ts +7 -0
  176. package/dist/tools.d.ts.map +1 -1
  177. package/dist/types.d.ts +28 -3
  178. package/dist/types.d.ts.map +1 -1
  179. package/docs/concepts.md +4 -4
  180. package/docs/guides/mcp-oauth.md +3 -1
  181. package/docs/reference/agent-config.md +11 -12
  182. package/docs/reference/cli.md +16 -8
  183. package/docs/reference/connections.md +44 -26
  184. package/docs/reference/sessions.md +2 -2
  185. package/docs/reference/tools.md +1 -1
  186. package/docs/scaffolding-agents.md +14 -6
  187. package/docs/troubleshooting.md +3 -2
  188. package/package.json +6 -1
  189. package/scripts/install-cursor-skills.mjs +36 -0
  190. package/skills/ab/SKILL.md +1 -1
  191. package/skills/create-agent/SKILL.md +13 -10
  192. package/skills/debug/SKILL.md +3 -2
  193. package/skills/evals/SKILL.md +1 -1
  194. package/skills/framework-map/SKILL.md +7 -7
  195. package/skills/github/SKILL.md +1 -1
  196. package/skills/hillclimb/SKILL.md +1 -1
  197. package/skills/mcp-auth/SKILL.md +9 -7
  198. package/skills/otel/SKILL.md +1 -1
  199. package/skills/setup-slack/SKILL.md +1 -1
  200. package/src/bin/agent-serve.ts +10 -7
  201. package/src/channels/github/api.ts +6 -1
  202. package/src/channels/github/binding.ts +21 -0
  203. package/src/channels/github/checks.ts +179 -0
  204. package/src/channels/github/cursor-account.ts +9 -6
  205. package/src/channels/github/index.ts +1 -0
  206. package/src/channels/github/types.ts +8 -0
  207. package/src/channels/slack/manifest.ts +8 -10
  208. package/src/channels/slack/types.ts +2 -2
  209. package/src/connections.ts +17 -5
  210. package/src/internal/advertise-tools.ts +72 -23
  211. package/src/internal/cli-deploy.ts +4 -15
  212. package/src/internal/cli-skills.ts +10 -2
  213. package/src/internal/convert-automation/convert-workflow.ts +2 -11
  214. package/src/internal/cursor/account-mcp.ts +208 -73
  215. package/src/internal/cursor/backend-client.ts +45 -11
  216. package/src/internal/cursor-account-mcp-auth.ts +83 -0
  217. package/src/internal/deploy-client.ts +0 -10
  218. package/src/internal/deploy-manifest.ts +33 -39
  219. package/src/internal/deployment-scm-event-stream.ts +17 -1
  220. package/src/internal/discovery.ts +47 -3
  221. package/src/internal/init-project.ts +7 -133
  222. package/src/internal/init-scaffold.ts +176 -0
  223. package/src/internal/inline-stdio-mcp.ts +13 -0
  224. package/src/internal/install-cursor-skills.ts +204 -49
  225. package/src/internal/json-schema.ts +24 -3
  226. package/src/internal/mcp-endpoint.ts +6 -0
  227. package/src/internal/mcp-host.ts +4 -0
  228. package/src/internal/mcp-oauth.ts +55 -1
  229. package/src/internal/package-inline-stdio.ts +5 -1
  230. package/src/internal/review-comments.ts +245 -0
  231. package/src/internal/sanitize-mcp-tool-name.ts +33 -0
  232. package/src/internal/sdk-runner.ts +6 -3
  233. package/src/internal/session-engine.ts +7 -0
  234. package/src/internal/shallow-clone.ts +293 -105
  235. package/src/internal/terminal-style.ts +67 -1
  236. package/src/internal/workspace.ts +6 -0
  237. package/src/tools.ts +7 -0
  238. package/src/types.ts +32 -4
  239. package/templates/agentic-owners/agent/agent.ts +3 -0
  240. package/templates/demo/agent/agent.ts +3 -0
  241. package/templates/security-reviewer/agent/agent.ts +3 -0
  242. package/templates/triage/agent/agent.ts +3 -0
  243. package/dist/docs/assets/chunks/@localSearchIndexroot.DvUR3lv9.js +0 -1
  244. package/dist/docs/assets/scaffolding-agents.md.CrWSA0Ko.js +0 -1
  245. package/dist/docs/assets/troubleshooting.md.CuVztCKs.js +0 -1
  246. package/dist/playground/assets/index-CoL7xCJl.css +0 -1
  247. package/dist/playground/assets/index-yxs1heea.js +0 -85
  248. /package/dist/docs/assets/{concepts.md.CqOsxbMU.lean.js → concepts.md.BXAm6G-C.lean.js} +0 -0
  249. /package/dist/docs/assets/{guides_mcp-oauth.md.C7G7IykG.lean.js → guides_mcp-oauth.md.CzEB6RaG.lean.js} +0 -0
  250. /package/dist/docs/assets/{reference_sessions.md.DBVFi2Sx.lean.js → reference_sessions.md.B0DdlM-K.lean.js} +0 -0
  251. /package/dist/docs/assets/{reference_tools.md.Wmvb7Lob.lean.js → reference_tools.md.DTg_kEsx.lean.js} +0 -0
  252. /package/dist/docs/assets/{troubleshooting.md.CuVztCKs.lean.js → troubleshooting.md.DQ-hYuZT.lean.js} +0 -0
@@ -16,9 +16,13 @@
16
16
  * auth-less connections go through the shared `host.mcp` registry, which
17
17
  * also covers serve-resolved transports (Cursor account bridges, peers).
18
18
  *
19
- * Everything here fails closed: a listing failure, an invalid tool name,
20
- * or a name collision throws, and the engine fails the turn rather than
21
- * running it with a silently shrunken toolset.
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.
22
26
  */
23
27
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
24
28
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
@@ -30,12 +34,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
30
34
  });
31
35
  };
32
36
  import { brandDefinition } from "./brand.js";
37
+ import { sanitizeMcpToolName, suffixMcpToolName, } from "./sanitize-mcp-tool-name.js";
33
38
  /**
34
- * The rule advertised tool names must match — the same shape discovery
35
- * enforces for authored tool filenames (its `NAME_PATTERN`), since both
36
- * become the tool name the model sees.
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).
37
43
  */
38
- export const ADVERTISED_TOOL_NAME_PATTERN = /^[A-Za-z0-9][A-Za-z0-9_-]*$/;
44
+ export const ADVERTISED_TOOL_NAME_PATTERN = /^[A-Za-z0-9_-]{1,128}$/;
39
45
  const ANY_OBJECT_SCHEMA = {
40
46
  type: "object",
41
47
  additionalProperties: true,
@@ -64,9 +70,10 @@ export function resolveAdvertisedTools(args) {
64
70
  catch (error) {
65
71
  throw new Error(`Failed to list tools on advertised connection "${connection.name}": ${describeError(error)}`, { cause: error });
66
72
  }
67
- for (const info of listed) {
68
- resolved.push(toDiscoveredTool(connection, info, claimed, source));
69
- claimed.add(info.name);
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);
70
77
  }
71
78
  }
72
79
  return resolved;
@@ -99,33 +106,59 @@ export function sourceForConnection(connection, session, hostMcp) {
99
106
  return hostMcp.oneOff(Object.assign(Object.assign({}, connection), { transport: Object.assign(Object.assign({}, transport), { headers: Object.assign(Object.assign({}, transport.headers), evaluated.headers) }) }));
100
107
  });
101
108
  }
102
- function toDiscoveredTool(connection, info, claimed, source) {
103
- var _a;
104
- if (!ADVERTISED_TOOL_NAME_PATTERN.test(info.name)) {
105
- throw new Error(`Advertised connection "${connection.name}" serves tool name "${info.name}", which must match ${ADVERTISED_TOOL_NAME_PATTERN} (it becomes the tool name the model sees).`);
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
+ }
106
126
  }
107
- if (claimed.has(info.name)) {
108
- throw new Error(`Advertised connection "${connection.name}" serves tool "${info.name}", which collides with an authored agent/tools/ tool or another advertised connection.`);
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
+ });
109
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;
110
151
  const description = info.description === undefined || info.description.trim() === ""
111
152
  ? `${info.name} — MCP tool on the "${connection.name}" connection, forwarded 1:1.`
112
153
  : info.description;
113
154
  const inputSchema = (_a = info.inputSchema) !== null && _a !== void 0 ? _a : ANY_OBJECT_SCHEMA;
114
- const definition = brandDefinition("tool", {
115
- description,
116
- inputSchema,
117
- execute: (input) => __awaiter(this, void 0, void 0, function* () {
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* () {
118
158
  return formatMcpToolResult(connection.name, info.name, yield source.callTool(info.name, input !== null && input !== void 0 ? input : {}));
119
- }),
120
- });
121
- return {
122
- name: info.name,
123
- description,
124
- inputSchema,
125
- execution: "server",
126
- needsApproval: false,
127
- definition,
128
- };
159
+ }) }));
160
+ return Object.assign(Object.assign({ name: exposedName, description,
161
+ inputSchema }, (outputSchema === undefined ? {} : { outputSchema })), { execution: "server", needsApproval: false, definition });
129
162
  }
130
163
  /**
131
164
  * Render an MCP call result for the model: text parts joined, non-text
@@ -1 +1 @@
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;AAK5B,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;IACd;;;OAGG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,6DAA6D;IAC7D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+DAA+D;IAC/D,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAA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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"}
@@ -25,7 +25,6 @@ import { cursorExternalApiUrl, resolveApiKey, SIGN_IN_HINT, } from "./cursor/cre
25
25
  import { authorizeCursorAccountConnectors } from "./cursor-account-mcp-auth.js";
26
26
  import { readDeployTemplate } from "./cursor-agent-template.js";
27
27
  import { AgentServeDeployClient, DeployApiError, deploymentServiceAccountId, slugFromDirectoryName, TERMINAL_DEPLOY_STATUSES, validateDeploymentSlug, } from "./deploy-client.js";
28
- import { buildAgentDeployManifest, } from "./deploy-manifest.js";
29
28
  import { inferDeployGitSource } from "./deploy-source.js";
30
29
  import { isAgentProjectDir, listChildAgentDirs, loadAgentProject, } from "./discovery.js";
31
30
  import { CLI_COMMAND_NAME as CLI } from "./distribution.js";
@@ -433,10 +432,10 @@ function deployOne(ctx, options, target, extras) {
433
432
  }
434
433
  // Today's only source shape: the control plane builds from a git ref.
435
434
  // See DeploySource for the artifact seam.
436
- const source = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ kind: "git-ref", gitRepoUrl }, (gitRef === undefined ? {} : { gitRef })), (agentPath === undefined ? {} : { agentPath })), (options.cursorEventsRepos === undefined ||
435
+ const source = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ kind: "git-ref", gitRepoUrl }, (gitRef === undefined ? {} : { gitRef })), (agentPath === undefined ? {} : { agentPath })), (options.cursorEventsRepos === undefined ||
437
436
  options.cursorEventsRepos.length === 0
438
437
  ? {}
439
- : { cursorEventRepos: options.cursorEventsRepos })), (egressAllowedDomains.length === 0 ? {} : { egressAllowedDomains })), { publicRoutePaths: publicRoutePaths.length === 0 ? undefined : publicRoutePaths }), (manifest === undefined ? {} : { manifest: manifest.deployManifest }));
438
+ : { cursorEventRepos: options.cursorEventsRepos })), (egressAllowedDomains.length === 0 ? {} : { egressAllowedDomains })), { publicRoutePaths: publicRoutePaths.length === 0 ? undefined : publicRoutePaths });
440
439
  let accepted;
441
440
  try {
442
441
  accepted = yield ctx.client.deploy({
@@ -595,7 +594,6 @@ function readDeployManifest(dir) {
595
594
  .filter((channel) => { var _a; return ((_a = channel.definition.auth) !== null && _a !== void 0 ? _a : []).some(isPublicEndpointPolicy); })
596
595
  .map((channel) => channel.id),
597
596
  httpChannelPublicEndpoint: ((_a = project.httpChannel.auth) !== null && _a !== void 0 ? _a : []).some(isPublicEndpointPolicy),
598
- deployManifest: buildAgentDeployManifest(project),
599
597
  };
600
598
  });
601
599
  }
@@ -1,9 +1,11 @@
1
1
  /**
2
2
  * `install-skills` — install the package's coding-agent skills into
3
- * `~/.cursor/skills/agentkit/` without running `init`.
3
+ * `~/.cursor/skills/agentsdk/` without running `init`.
4
4
  *
5
5
  * Never prompts: running the command is the confirmation. The interactive
6
- * offer lives in `init`.
6
+ * offer lives in `init`. Consumer `npm install` / `npx` copies the same
7
+ * skills in postinstall (with `alwaysApply: true` so Cursor injects them);
8
+ * this command refreshes them without reinstalling.
7
9
  */
8
10
  export interface InstallSkillsCliOptions {
9
11
  json?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"cli-skills.d.ts","sourceRoot":"","sources":["../../src/internal/cli-skills.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAWH,MAAM,WAAW,uBAAuB;IACtC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,gFAAgF;IAChF,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,gCAAgC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9B;AAED,wBAAsB,gBAAgB,CACpC,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,MAAM,CAAC,CA4CjB"}
1
+ {"version":3,"file":"cli-skills.d.ts","sourceRoot":"","sources":["../../src/internal/cli-skills.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAYH,MAAM,WAAW,uBAAuB;IACtC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,gFAAgF;IAChF,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,gCAAgC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9B;AAED,wBAAsB,gBAAgB,CACpC,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,MAAM,CAAC,CA4CjB"}
@@ -1,9 +1,11 @@
1
1
  /**
2
2
  * `install-skills` — install the package's coding-agent skills into
3
- * `~/.cursor/skills/agentkit/` without running `init`.
3
+ * `~/.cursor/skills/agentsdk/` without running `init`.
4
4
  *
5
5
  * Never prompts: running the command is the confirmation. The interactive
6
- * offer lives in `init`.
6
+ * offer lives in `init`. Consumer `npm install` / `npx` copies the same
7
+ * skills in postinstall (with `alwaysApply: true` so Cursor injects them);
8
+ * this command refreshes them without reinstalling.
7
9
  */
8
10
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
9
11
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
@@ -15,7 +17,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
15
17
  });
16
18
  };
17
19
  import { CLI_COMMAND_NAME } from "./distribution.js";
18
- import { formatSkillInstall, installCursorSkills, planSkillInstall, } from "./install-cursor-skills.js";
20
+ import { formatSkillInstall, installCursorSkills, LEGACY_CURSOR_SKILLS_NAMESPACE, planSkillInstall, } from "./install-cursor-skills.js";
19
21
  import { stdoutPalette } from "./terminal-style.js";
20
22
  export function cmdInstallSkills() {
21
23
  return __awaiter(this, arguments, void 0, function* (options = {}) {
@@ -67,6 +69,9 @@ function previewBlock(plan) {
67
69
  if (plan.orphans.length > 0) {
68
70
  lines.push(` removes: ${plan.orphans.join(", ")}`);
69
71
  }
72
+ if (plan.hasLegacyNamespace) {
73
+ lines.push(` removes: ${LEGACY_CURSOR_SKILLS_NAMESPACE}/ (legacy namespace)`);
74
+ }
70
75
  lines.push(` location: ${plan.directory}`);
71
76
  return `${lines.join("\n")}\n`;
72
77
  }
@@ -1 +1 @@
1
- {"version":3,"file":"convert-workflow.d.ts","sourceRoot":"","sources":["../../../src/internal/convert-automation/convert-workflow.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAKV,oBAAoB,EACpB,qBAAqB,EAQtB,MAAM,YAAY,CAAC;AAUpB,wBAAgB,eAAe,CAC7B,KAAK,EAAE,oBAAoB,GAC1B,qBAAqB,CA4GvB"}
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: MEMORY_HOOK });
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. Surfaces "needsAuth" / "error" connectors with
82
- * remediation hints (and a backend probe detail for `error`), and filters
83
- * that matched nothing (typo'd connector names).
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;AAI/D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,KAAK,EACV,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,qBAAqB,CAAC;AAgB7B,MAAM,WAAW,0BAA0B;IACzC,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAC;IACb,sEAAsE;IAC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;;;;OAQG;IACH,YAAY,CAAC,IAAI,EAAE,0BAA0B,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAI9D;YAEa,YAAY;IAiE1B,OAAO,CAAC,WAAW;IA8EnB,0EAA0E;YAC5D,QAAQ;IAatB;;;;OAIG;IACH,OAAO,CAAC,UAAU;CAwCnB;AA0ED,MAAM,WAAW,6BAA6B;IAC5C,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8EAA8E;IAC9E,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AA+CD;;;GAGG;AACH,wBAAgB,gCAAgC,CAAC,IAAI,EAAE;IACrD,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,SAAS,6BAA6B,EAAE,CAAC;IAClD,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,GAAG,MAAM,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 clients commonly enforce `^[a-zA-Z0-9_-]{1,128}$` for tool names. */
40
- const MAX_TOOL_NAME_LENGTH = 128;
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. Surfaces "needsAuth" / "error" connectors with
133
- * remediation hints (and a backend probe detail for `error`), and filters
134
- * that matched nothing (typo'd connector names).
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
- if (catalog.servers.length === 0) {
147
- this.logger(`[agent-sdk] Cursor account MCP connection "${ref.name}": no matching connectors on this account — connect servers in Cursor (dashboard → MCP) or fix the \`servers\` filter`);
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(`[agent-sdk] Cursor account MCP connection "${ref.name}": ${summary}`);
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(`[agent-sdk] Cursor account MCP connection "${ref.name}" preflight failed: ${describeError(error)}`);
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
- name: tool.exposedName,
197
- description: tool.description,
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 = sanitizeToolName(tool.name);
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 = suffixToolName(base, suffixIndex);
345
+ let exposedName = suffixMcpToolName(base, suffixIndex);
339
346
  while (byExposedName.has(exposedName)) {
340
347
  suffixIndex++;
341
- exposedName = suffixToolName(base, suffixIndex);
348
+ exposedName = suffixMcpToolName(base, suffixIndex);
342
349
  }
343
- const entry = {
344
- exposedName,
345
- backendName: tool.name,
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) {