@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
@@ -119,22 +119,25 @@ export function parseCursorGithubRepoScope(
119
119
 
120
120
  /**
121
121
  * Hosted `cursorAccount` mints `checks:write` on the `contents-write` tier.
122
- * Enabling `progress.commitStatus` opts a `pr-write` (or omitted) channel up
123
- * to that tier so github-proxy / `/github-token` can post Checks API runs.
124
- * `"read"` cannot post merge-box checks.
122
+ * Enabling `progress.commitStatus` or `checks: true` opts a `pr-write` (or
123
+ * omitted) channel up to that tier so github-proxy / `/github-token` can
124
+ * post Checks API runs. `"read"` cannot post merge-box checks.
125
125
  */
126
126
  export function cursorGithubPermissionsForChannel(
127
- options: Pick<GitHubChannelOptions, "progress">,
127
+ options: Pick<GitHubChannelOptions, "progress" | "checks">,
128
128
  authored: CursorGithubPermissions | undefined = "pr-write"
129
129
  ): CursorGithubPermissions {
130
130
  const base = authored ?? "pr-write";
131
131
  const commitStatus = options.progress?.commitStatus;
132
- if (commitStatus === undefined || commitStatus === false) {
132
+ const wantsChecks =
133
+ options.checks === true ||
134
+ (commitStatus !== undefined && commitStatus !== false);
135
+ if (!wantsChecks) {
133
136
  return base;
134
137
  }
135
138
  if (base === "read") {
136
139
  throw new Error(
137
- 'progress.commitStatus needs checks:write; cursorAccount permissions: "read" cannot post merge-box checks. Use "pr-write" or "contents-write".'
140
+ 'progress.commitStatus / checks need checks:write; cursorAccount permissions: "read" cannot post merge-box checks. Use "pr-write" or "contents-write".'
138
141
  );
139
142
  }
140
143
  return "contents-write";
@@ -43,6 +43,7 @@
43
43
  export * from "./api.js";
44
44
  export * from "./auth.js";
45
45
  export * from "./binding.js";
46
+ export * from "./checks.js";
46
47
  export * from "./defaults.js";
47
48
  export * from "./events.js";
48
49
  export * from "./forward.js";
@@ -546,6 +546,14 @@ export interface GitHubChannelOptions {
546
546
  * and sticky banner are opt-in via `commitStatus` / `banner`.
547
547
  */
548
548
  progress?: GitHubProgressConfig;
549
+ /**
550
+ * Declare that this channel posts its own CI checks
551
+ * (`ctx.github.createCheck` / `createGitHubCheck`). With `cursorAccount`,
552
+ * opts the minted token up to `permissions: "contents-write"` so the
553
+ * hosted lease includes `checks:write` — same opt-up as
554
+ * `progress.commitStatus`. Has no effect on App / PAT credentials.
555
+ */
556
+ checks?: boolean;
549
557
  /**
550
558
  * When false, skip posting assistant / error comments back to GitHub.
551
559
  * Defaults to true.
@@ -29,8 +29,8 @@ export interface SlackAppManifest {
29
29
  display_name: string;
30
30
  always_online: boolean;
31
31
  };
32
- assistant_view?: {
33
- assistant_description: string;
32
+ agent_view?: {
33
+ agent_description: string;
34
34
  suggested_prompts: Array<{ title: string; message: string }>;
35
35
  };
36
36
  app_home?: {
@@ -135,9 +135,9 @@ export function buildSlackManifest(
135
135
  : options.name;
136
136
  const botName = options.botDisplayName ?? toBotDisplayName(options.name, env);
137
137
  const description = options.description ?? defaultDescription(options.name);
138
- const includeAssistant = options.assistant !== false;
138
+ const includeAgentView = options.assistant !== false;
139
139
 
140
- const botScopes = includeAssistant
140
+ const botScopes = includeAgentView
141
141
  ? [...BOT_SCOPES]
142
142
  : BOT_SCOPES.filter((scope) => scope !== "assistant:write");
143
143
 
@@ -164,14 +164,12 @@ export function buildSlackManifest(
164
164
  messages_tab_enabled: true,
165
165
  messages_tab_read_only_enabled: false,
166
166
  },
167
- ...(includeAssistant
167
+ agent_view: includeAgentView
168
168
  ? {
169
- assistant_view: {
170
- assistant_description: description,
171
- suggested_prompts: suggested,
172
- },
169
+ agent_description: description,
170
+ suggested_prompts: suggested,
173
171
  }
174
- : {}),
172
+ : undefined,
175
173
  },
176
174
  oauth_config: {
177
175
  scopes: {
@@ -651,7 +651,7 @@ export interface SlackManifestOptions {
651
651
  env: "dev" | "prod";
652
652
  /** Optional short description shown in the Slack app. */
653
653
  description?: string;
654
- /** Include `assistant_view` + `assistant:write` for typing status. */
654
+ /** Include `agent_view` + `assistant:write` for typing status. */
655
655
  assistant?: boolean;
656
656
  /**
657
657
  * Enable Slack interactivity (needed for Approve/Deny cards).
@@ -663,7 +663,7 @@ export interface SlackManifestOptions {
663
663
  * channel watch (`engagement.channelPosts`). Defaults to `false`.
664
664
  */
665
665
  channelPosts?: boolean;
666
- /** Seed suggested prompts into the manifest `assistant_view`. */
666
+ /** Seed suggested prompts into the manifest `agent_view`. */
667
667
  suggestedPrompts?: Array<{ title: string; message: string }>;
668
668
  /**
669
669
  * Emit `settings.managed_app_settings`. Defaults to `true` — Cursor
@@ -4,7 +4,8 @@
4
4
  * A connection gives tools from an external MCP server. The filename
5
5
  * becomes the connection (server) name. Available to the agent (SDK
6
6
  * `mcpServers`), host (`ctx.host.mcp`), and channel/schedule handlers.
7
- * Pass `hostOnly: true` to keep it off the model (still on `host.mcp`).
7
+ * Pass `advertiseTools: true` for named tools on local turns. Pass
8
+ * `hostOnly: true` to keep it off the model (still on `host.mcp`).
8
9
  *
9
10
  * ```ts
10
11
  * import { defineConnection } from "@anysphere/agent-serve/connections";
@@ -42,13 +43,24 @@
42
43
  * to be signed in (`agent-serve login` or `CURSOR_API_KEY`):
43
44
  *
44
45
  * ```ts
45
- * // agent/mcp-connections/cursor.ts — every connected server (no allowlist)
46
- * export default defineConnection({ cursorAccount: true });
46
+ * // agent/mcp-connections/account.ts — every connected server (no allowlist)
47
+ * export default defineConnection({
48
+ * cursorAccount: true,
49
+ * advertiseTools: true,
50
+ * });
47
51
  * // equivalent explicit form:
48
- * export default defineConnection({ cursorAccount: true, servers: "*" });
52
+ * export default defineConnection({
53
+ * cursorAccount: true,
54
+ * servers: "*",
55
+ * advertiseTools: true,
56
+ * });
49
57
  *
50
58
  * // or restrict to specific connectors by name
51
- * export default defineConnection({ cursorAccount: true, servers: ["Linear"] });
59
+ * export default defineConnection({
60
+ * cursorAccount: true,
61
+ * servers: ["Linear"],
62
+ * advertiseTools: true,
63
+ * });
52
64
  * ```
53
65
  *
54
66
  * A **peer MCP connection** addresses another agent mounted on the same serve
@@ -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
 
24
28
  import type {
@@ -33,6 +37,10 @@ import type {
33
37
  } from "../types.js";
34
38
  import { brandDefinition } from "./brand.js";
35
39
  import type { HostMcpOneOff } from "./mcp-host.js";
40
+ import {
41
+ sanitizeMcpToolName,
42
+ suffixMcpToolName,
43
+ } from "./sanitize-mcp-tool-name.js";
36
44
 
37
45
  /**
38
46
  * What the resolver needs from the host MCP registry: the shared cached
@@ -50,12 +58,12 @@ export interface AdvertiseHostMcp {
50
58
  }
51
59
 
52
60
  /**
53
- * The rule advertised tool names must match — the same shape discovery
54
- * enforces for authored tool filenames (its `NAME_PATTERN`), since both
55
- * become the tool name the model sees.
61
+ * Model-facing advertised names after {@link sanitizeMcpToolName} — the
62
+ * same MCP-client shape the Cursor-account bridge documents
63
+ * (`^[a-zA-Z0-9_-]{1,128}$`). Authored `agent/tools/` filenames stay on
64
+ * discovery's stricter `NAME_PATTERN` (must start alphanumeric).
56
65
  */
57
- export const ADVERTISED_TOOL_NAME_PATTERN: RegExp =
58
- /^[A-Za-z0-9][A-Za-z0-9_-]*$/;
66
+ export const ADVERTISED_TOOL_NAME_PATTERN: RegExp = /^[A-Za-z0-9_-]{1,128}$/;
59
67
 
60
68
  const ANY_OBJECT_SCHEMA: JsonSchemaObject = {
61
69
  type: "object",
@@ -107,9 +115,10 @@ export async function resolveAdvertisedTools(args: {
107
115
  { cause: error }
108
116
  );
109
117
  }
110
- for (const info of listed) {
111
- resolved.push(toDiscoveredTool(connection, info, claimed, source));
112
- claimed.add(info.name);
118
+ const exposed = exposeListedTools(listed, claimed);
119
+ for (const { info, exposedName } of exposed) {
120
+ resolved.push(toDiscoveredTool(connection, info, exposedName, source));
121
+ claimed.add(exposedName);
113
122
  }
114
123
  }
115
124
  return resolved;
@@ -154,30 +163,69 @@ export async function sourceForConnection(
154
163
  });
155
164
  }
156
165
 
166
+ /**
167
+ * Same catalog rule as the Cursor-account bridge: slug illegal characters,
168
+ * then `_2` / `_3` … for colliders (including authored tools already in
169
+ * `claimed`). Suffix assignment is stable for a colliding group: sort by
170
+ * original advertised name, independent of `listTools` order.
171
+ */
172
+ function exposeListedTools(
173
+ listed: HostMcpToolInfo[],
174
+ claimed: ReadonlySet<string>
175
+ ): Array<{ info: HostMcpToolInfo; exposedName: string }> {
176
+ const byBase = new Map<string, HostMcpToolInfo[]>();
177
+ for (const info of listed) {
178
+ const base = sanitizeMcpToolName(info.name);
179
+ const group = byBase.get(base);
180
+ if (group === undefined) {
181
+ byBase.set(base, [info]);
182
+ } else {
183
+ group.push(info);
184
+ }
185
+ }
186
+ const taken = new Set(claimed);
187
+ const exposedNameByInfo = new Map<HostMcpToolInfo, string>();
188
+ const sortedBases = [...byBase.keys()].sort((left, right) =>
189
+ left < right ? -1 : left > right ? 1 : 0
190
+ );
191
+ for (const base of sortedBases) {
192
+ const group = byBase.get(base)!;
193
+ group.sort((left, right) =>
194
+ left.name < right.name ? -1 : left.name > right.name ? 1 : 0
195
+ );
196
+ group.forEach((info, index) => {
197
+ let suffixIndex = index;
198
+ let exposedName = suffixMcpToolName(base, suffixIndex);
199
+ while (taken.has(exposedName)) {
200
+ suffixIndex++;
201
+ exposedName = suffixMcpToolName(base, suffixIndex);
202
+ }
203
+ taken.add(exposedName);
204
+ exposedNameByInfo.set(info, exposedName);
205
+ });
206
+ }
207
+ return listed.map((info) => ({
208
+ info,
209
+ exposedName: exposedNameByInfo.get(info)!,
210
+ }));
211
+ }
212
+
157
213
  function toDiscoveredTool(
158
214
  connection: DiscoveredConnection,
159
215
  info: HostMcpToolInfo,
160
- claimed: ReadonlySet<string>,
216
+ exposedName: string,
161
217
  source: AdvertisedToolSource
162
218
  ): DiscoveredTool {
163
- if (!ADVERTISED_TOOL_NAME_PATTERN.test(info.name)) {
164
- throw new Error(
165
- `Advertised connection "${connection.name}" serves tool name "${info.name}", which must match ${ADVERTISED_TOOL_NAME_PATTERN} (it becomes the tool name the model sees).`
166
- );
167
- }
168
- if (claimed.has(info.name)) {
169
- throw new Error(
170
- `Advertised connection "${connection.name}" serves tool "${info.name}", which collides with an authored agent/tools/ tool or another advertised connection.`
171
- );
172
- }
173
219
  const description =
174
220
  info.description === undefined || info.description.trim() === ""
175
221
  ? `${info.name} — MCP tool on the "${connection.name}" connection, forwarded 1:1.`
176
222
  : info.description;
177
223
  const inputSchema = info.inputSchema ?? ANY_OBJECT_SCHEMA;
224
+ const outputSchema = info.outputSchema;
178
225
  const definition: ToolDefinition = brandDefinition("tool", {
179
226
  description,
180
227
  inputSchema,
228
+ ...(outputSchema === undefined ? {} : { outputSchema }),
181
229
  execute: async (input: Record<string, unknown>) =>
182
230
  formatMcpToolResult(
183
231
  connection.name,
@@ -186,9 +234,10 @@ function toDiscoveredTool(
186
234
  ),
187
235
  } as unknown as ToolDefinition);
188
236
  return {
189
- name: info.name,
237
+ name: exposedName,
190
238
  description,
191
239
  inputSchema,
240
+ ...(outputSchema === undefined ? {} : { outputSchema }),
192
241
  execution: "server",
193
242
  needsApproval: false,
194
243
  definition,
@@ -39,10 +39,6 @@ import {
39
39
  TERMINAL_DEPLOY_STATUSES,
40
40
  validateDeploymentSlug,
41
41
  } from "./deploy-client.js";
42
- import {
43
- type AgentDeployManifestV1,
44
- buildAgentDeployManifest,
45
- } from "./deploy-manifest.js";
46
42
  import { type GitRunner, inferDeployGitSource } from "./deploy-source.js";
47
43
  import {
48
44
  type ChildAgentDir,
@@ -666,9 +662,10 @@ async function deployOne(
666
662
  ...(egressAllowedDomains.length === 0 ? {} : { egressAllowedDomains }),
667
663
  publicRoutePaths:
668
664
  publicRoutePaths.length === 0 ? undefined : publicRoutePaths,
669
- // Offline metadata extraction (Wd): the CP persists this before any VM
670
- // starts. Directories without an agent project send no manifest.
671
- ...(manifest === undefined ? {} : { manifest: manifest.deployManifest }),
665
+ // Deliberately NO manifest here: the control plane captures it from the
666
+ // provisioned engine (`GET /v1/manifest` after the health probe), which
667
+ // is the single write path for deploy manifests. `july manifest` remains
668
+ // available for local visibility only.
672
669
  };
673
670
 
674
671
  let accepted: DeployAccepted;
@@ -864,13 +861,6 @@ interface DeployManifest {
864
861
  * (only `/v1/channels/…` subtrees can be public); surfaced as a warning.
865
862
  */
866
863
  httpChannelPublicEndpoint: boolean;
867
- /**
868
- * The offline deploy manifest (Wd): derived event declarations, channel
869
- * kinds, egress, routes, and the full `/v1/info` payload. Attached to the
870
- * deploy request so the control plane stores metadata before any VM
871
- * starts; servers that predate manifest storage strip the field.
872
- */
873
- deployManifest: AgentDeployManifestV1;
874
864
  }
875
865
 
876
866
  /**
@@ -895,7 +885,6 @@ async function readDeployManifest(dir: string): Promise<DeployManifest> {
895
885
  httpChannelPublicEndpoint: (project.httpChannel.auth ?? []).some(
896
886
  isPublicEndpointPolicy
897
887
  ),
898
- deployManifest: buildAgentDeployManifest(project),
899
888
  };
900
889
  }
901
890
 
@@ -1,15 +1,18 @@
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
 
9
11
  import { CLI_COMMAND_NAME } from "./distribution.js";
10
12
  import {
11
13
  formatSkillInstall,
12
14
  installCursorSkills,
15
+ LEGACY_CURSOR_SKILLS_NAMESPACE,
13
16
  planSkillInstall,
14
17
  type SkillInstallPlan,
15
18
  } from "./install-cursor-skills.js";
@@ -90,6 +93,11 @@ function previewBlock(plan: SkillInstallPlan): string {
90
93
  if (plan.orphans.length > 0) {
91
94
  lines.push(` removes: ${plan.orphans.join(", ")}`);
92
95
  }
96
+ if (plan.hasLegacyNamespace) {
97
+ lines.push(
98
+ ` removes: ${LEGACY_CURSOR_SKILLS_NAMESPACE}/ (legacy namespace)`
99
+ );
100
+ }
93
101
  lines.push(` location: ${plan.directory}`);
94
102
  return `${lines.join("\n")}\n`;
95
103
  }
@@ -7,6 +7,7 @@
7
7
  */
8
8
 
9
9
  import { CLI_COMMAND_NAME, PACKAGE_NAME } from "../distribution.js";
10
+ import { MEMORY_TS } from "../init-scaffold.js";
10
11
  import { pascalCase, SlugRegistry, slugify } from "./slug.js";
11
12
  import type {
12
13
  ActionJson,
@@ -128,7 +129,7 @@ export function convertWorkflow(
128
129
  hasSlackAction && emitSlackAccountConnection(automation, out);
129
130
 
130
131
  if (workflow.memoryEnabled === true) {
131
- out.files.push({ path: "agent/hooks/memory.ts", contents: MEMORY_HOOK });
132
+ out.files.push({ path: "agent/hooks/memory.ts", contents: MEMORY_TS });
132
133
  }
133
134
 
134
135
  out.setupSteps.push(
@@ -1410,13 +1411,3 @@ function jsonComment(value: unknown): string[] {
1410
1411
  function dedupe(values: string[]): string[] {
1411
1412
  return [...new Set(values)];
1412
1413
  }
1413
-
1414
- /** Memory hook contents — identical to the `initProject` scaffold. */
1415
- const MEMORY_HOOK = `// Journals every turn (timestamp, session, user message, result) so
1416
- // future sessions can recall past work. The journal is shared across every
1417
- // session — and every user — of this agent. Pass your own MemoryBackend to
1418
- // change where memories live, or delete this file to opt out.
1419
- import { memoryHook } from "${PACKAGE_NAME}/memory";
1420
-
1421
- export default memoryHook();
1422
- `;