@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.
- package/AGENTS.md +17 -13
- package/README.md +23 -11
- package/dist/bin/agent-serve.js +10 -7
- package/dist/channels/github/api.d.ts +2 -0
- package/dist/channels/github/api.d.ts.map +1 -1
- package/dist/channels/github/api.js +2 -1
- package/dist/channels/github/binding.d.ts +7 -0
- package/dist/channels/github/binding.d.ts.map +1 -1
- package/dist/channels/github/binding.js +4 -0
- package/dist/channels/github/checks.d.ts +99 -0
- package/dist/channels/github/checks.d.ts.map +1 -0
- package/dist/channels/github/checks.js +108 -0
- package/dist/channels/github/cursor-account.d.ts +4 -4
- package/dist/channels/github/cursor-account.d.ts.map +1 -1
- package/dist/channels/github/cursor-account.js +7 -5
- package/dist/channels/github/index.d.ts +1 -0
- package/dist/channels/github/index.d.ts.map +1 -1
- package/dist/channels/github/index.js +1 -0
- package/dist/channels/github/types.d.ts +8 -0
- package/dist/channels/github/types.d.ts.map +1 -1
- package/dist/channels/slack/manifest.d.ts +2 -2
- package/dist/channels/slack/manifest.d.ts.map +1 -1
- package/dist/channels/slack/manifest.js +13 -11
- package/dist/channels/slack/types.d.ts +2 -2
- package/dist/channels/slack/types.d.ts.map +1 -1
- package/dist/connections.d.ts +17 -5
- package/dist/connections.d.ts.map +1 -1
- package/dist/connections.js +17 -5
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +3 -3
- package/dist/docs/assets/{app.C5XUTCw9.js → app.BETd-WqU.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.DM5INS71.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.CGDTAYHY.js → VPLocalSearchBox.wEaGEmV9.js} +1 -1
- package/dist/docs/assets/chunks/{theme.lPixh250.js → theme.DNDicFOP.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_cli.md.Cl14Jfo3.js → reference_cli.md.TAaYU8br.js} +3 -3
- package/dist/docs/assets/{reference_cli.md.Cl14Jfo3.lean.js → reference_cli.md.TAaYU8br.lean.js} +1 -1
- package/dist/docs/assets/{reference_connections.md.Bwswbm6H.js → reference_connections.md.Cu3N-S3Q.js} +18 -11
- package/dist/docs/assets/{reference_connections.md.Bwswbm6H.lean.js → reference_connections.md.Cu3N-S3Q.lean.js} +1 -1
- package/dist/docs/assets/{reference_sessions.md.DBVFi2Sx.js → reference_sessions.md.B0DdlM-K.js} +1 -1
- package/dist/docs/assets/{reference_tools.md.Wmvb7Lob.js → reference_tools.md.DTg_kEsx.js} +1 -1
- package/dist/docs/assets/scaffolding-agents.md.CiGsJ1aw.js +1 -0
- package/dist/docs/assets/{scaffolding-agents.md.CrWSA0Ko.lean.js → scaffolding-agents.md.CiGsJ1aw.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 +6 -6
- package/dist/docs/reference/connections.html +20 -13
- package/dist/docs/reference/hooks.html +3 -3
- package/dist/docs/reference/http-api.html +3 -3
- package/dist/docs/reference/instructions.html +3 -3
- package/dist/docs/reference/playground.html +3 -3
- package/dist/docs/reference/project-layout.html +3 -3
- package/dist/docs/reference/prompt.html +3 -3
- package/dist/docs/reference/schedules.html +3 -3
- package/dist/docs/reference/sessions.html +5 -5
- package/dist/docs/reference/skills.html +3 -3
- package/dist/docs/reference/subagents.html +3 -3
- package/dist/docs/reference/tools.html +5 -5
- package/dist/docs/scaffolding-agents.html +5 -5
- package/dist/docs/storage.html +3 -3
- package/dist/docs/templates/agentic-owners.html +3 -3
- package/dist/docs/templates/demo.html +3 -3
- package/dist/docs/templates/pr-autofixer.html +3 -3
- package/dist/docs/templates/security-reviewer.html +3 -3
- package/dist/docs/templates/triage.html +3 -3
- package/dist/docs/troubleshooting.html +5 -5
- package/dist/internal/advertise-tools.d.ts +11 -6
- package/dist/internal/advertise-tools.d.ts.map +1 -1
- package/dist/internal/advertise-tools.js +63 -30
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +2 -4
- package/dist/internal/cli-skills.d.ts +4 -2
- package/dist/internal/cli-skills.d.ts.map +1 -1
- package/dist/internal/cli-skills.js +8 -3
- package/dist/internal/convert-automation/convert-workflow.d.ts.map +1 -1
- package/dist/internal/convert-automation/convert-workflow.js +2 -10
- package/dist/internal/cursor/account-mcp.d.ts +29 -3
- package/dist/internal/cursor/account-mcp.d.ts.map +1 -1
- package/dist/internal/cursor/account-mcp.js +147 -67
- package/dist/internal/cursor/backend-client.d.ts +11 -6
- package/dist/internal/cursor/backend-client.d.ts.map +1 -1
- package/dist/internal/cursor/backend-client.js +32 -10
- package/dist/internal/cursor-account-mcp-auth.d.ts +11 -0
- package/dist/internal/cursor-account-mcp-auth.d.ts.map +1 -1
- package/dist/internal/cursor-account-mcp-auth.js +69 -0
- package/dist/internal/deploy-client.d.ts +0 -7
- package/dist/internal/deploy-client.d.ts.map +1 -1
- package/dist/internal/deploy-client.js +2 -4
- package/dist/internal/deploy-manifest.d.ts +15 -24
- package/dist/internal/deploy-manifest.d.ts.map +1 -1
- package/dist/internal/deploy-manifest.js +38 -27
- package/dist/internal/deployment-scm-event-stream.d.ts +4 -1
- package/dist/internal/deployment-scm-event-stream.d.ts.map +1 -1
- package/dist/internal/deployment-scm-event-stream.js +15 -1
- package/dist/internal/discovery.d.ts.map +1 -1
- package/dist/internal/discovery.js +42 -10
- package/dist/internal/init-project.d.ts.map +1 -1
- package/dist/internal/init-project.js +7 -106
- package/dist/internal/init-scaffold.d.ts +8 -0
- package/dist/internal/init-scaffold.d.ts.map +1 -0
- package/dist/internal/init-scaffold.js +168 -0
- package/dist/internal/inline-stdio-mcp.d.ts +2 -0
- package/dist/internal/inline-stdio-mcp.d.ts.map +1 -1
- package/dist/internal/inline-stdio-mcp.js +10 -8
- package/dist/internal/install-cursor-skills.d.ts +71 -16
- package/dist/internal/install-cursor-skills.d.ts.map +1 -1
- package/dist/internal/install-cursor-skills.js +160 -48
- package/dist/internal/json-schema.d.ts +7 -0
- package/dist/internal/json-schema.d.ts.map +1 -1
- package/dist/internal/json-schema.js +18 -3
- package/dist/internal/mcp-endpoint.js +7 -7
- package/dist/internal/mcp-host.js +4 -2
- package/dist/internal/mcp-oauth.d.ts +22 -0
- package/dist/internal/mcp-oauth.d.ts.map +1 -1
- package/dist/internal/mcp-oauth.js +40 -1
- package/dist/internal/package-inline-stdio.d.ts.map +1 -1
- package/dist/internal/package-inline-stdio.js +5 -5
- package/dist/internal/review-comments.d.ts +97 -0
- package/dist/internal/review-comments.d.ts.map +1 -1
- package/dist/internal/review-comments.js +151 -0
- package/dist/internal/sanitize-mcp-tool-name.d.ts +20 -0
- package/dist/internal/sanitize-mcp-tool-name.d.ts.map +1 -0
- package/dist/internal/sanitize-mcp-tool-name.js +30 -0
- package/dist/internal/sdk-runner.d.ts.map +1 -1
- package/dist/internal/sdk-runner.js +6 -2
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +4 -6
- package/dist/internal/shallow-clone.d.ts +94 -39
- package/dist/internal/shallow-clone.d.ts.map +1 -1
- package/dist/internal/shallow-clone.js +188 -68
- package/dist/internal/terminal-style.d.ts +18 -0
- package/dist/internal/terminal-style.d.ts.map +1 -1
- package/dist/internal/terminal-style.js +46 -1
- package/dist/internal/workspace.d.ts +2 -0
- package/dist/internal/workspace.d.ts.map +1 -1
- package/dist/internal/workspace.js +5 -0
- package/dist/playground/assets/index-D_8I9TM0.js +85 -0
- package/dist/playground/assets/index-M3nSMc6_.css +1 -0
- package/dist/playground/index.html +2 -2
- package/dist/tools.d.ts +7 -0
- package/dist/tools.d.ts.map +1 -1
- package/dist/types.d.ts +28 -3
- package/dist/types.d.ts.map +1 -1
- package/docs/concepts.md +4 -4
- package/docs/guides/mcp-oauth.md +3 -1
- package/docs/reference/agent-config.md +11 -12
- package/docs/reference/cli.md +16 -8
- package/docs/reference/connections.md +44 -26
- package/docs/reference/sessions.md +2 -2
- package/docs/reference/tools.md +1 -1
- package/docs/scaffolding-agents.md +14 -6
- package/docs/troubleshooting.md +3 -2
- package/package.json +6 -1
- package/scripts/install-cursor-skills.mjs +36 -0
- package/skills/ab/SKILL.md +1 -1
- package/skills/create-agent/SKILL.md +13 -10
- package/skills/debug/SKILL.md +3 -2
- package/skills/evals/SKILL.md +1 -1
- package/skills/framework-map/SKILL.md +7 -7
- package/skills/github/SKILL.md +1 -1
- package/skills/hillclimb/SKILL.md +1 -1
- package/skills/mcp-auth/SKILL.md +9 -7
- package/skills/otel/SKILL.md +1 -1
- package/skills/setup-slack/SKILL.md +1 -1
- package/src/bin/agent-serve.ts +10 -7
- package/src/channels/github/api.ts +6 -1
- package/src/channels/github/binding.ts +21 -0
- package/src/channels/github/checks.ts +179 -0
- package/src/channels/github/cursor-account.ts +9 -6
- package/src/channels/github/index.ts +1 -0
- package/src/channels/github/types.ts +8 -0
- package/src/channels/slack/manifest.ts +8 -10
- package/src/channels/slack/types.ts +2 -2
- package/src/connections.ts +17 -5
- package/src/internal/advertise-tools.ts +72 -23
- package/src/internal/cli-deploy.ts +4 -15
- package/src/internal/cli-skills.ts +10 -2
- package/src/internal/convert-automation/convert-workflow.ts +2 -11
- package/src/internal/cursor/account-mcp.ts +208 -73
- package/src/internal/cursor/backend-client.ts +45 -11
- package/src/internal/cursor-account-mcp-auth.ts +83 -0
- package/src/internal/deploy-client.ts +0 -10
- package/src/internal/deploy-manifest.ts +33 -39
- package/src/internal/deployment-scm-event-stream.ts +17 -1
- package/src/internal/discovery.ts +47 -3
- package/src/internal/init-project.ts +7 -133
- package/src/internal/init-scaffold.ts +176 -0
- package/src/internal/inline-stdio-mcp.ts +13 -0
- package/src/internal/install-cursor-skills.ts +204 -49
- package/src/internal/json-schema.ts +24 -3
- package/src/internal/mcp-endpoint.ts +6 -0
- package/src/internal/mcp-host.ts +4 -0
- package/src/internal/mcp-oauth.ts +55 -1
- package/src/internal/package-inline-stdio.ts +5 -1
- package/src/internal/review-comments.ts +245 -0
- package/src/internal/sanitize-mcp-tool-name.ts +33 -0
- package/src/internal/sdk-runner.ts +6 -3
- package/src/internal/session-engine.ts +7 -0
- package/src/internal/shallow-clone.ts +293 -105
- package/src/internal/terminal-style.ts +67 -1
- package/src/internal/workspace.ts +6 -0
- package/src/tools.ts +7 -0
- package/src/types.ts +32 -4
- package/templates/agentic-owners/agent/agent.ts +3 -0
- package/templates/demo/agent/agent.ts +3 -0
- package/templates/security-reviewer/agent/agent.ts +3 -0
- package/templates/triage/agent/agent.ts +3 -0
- package/dist/docs/assets/chunks/@localSearchIndexroot.DvUR3lv9.js +0 -1
- package/dist/docs/assets/scaffolding-agents.md.CrWSA0Ko.js +0 -1
- package/dist/docs/assets/troubleshooting.md.CuVztCKs.js +0 -1
- package/dist/playground/assets/index-CoL7xCJl.css +0 -1
- package/dist/playground/assets/index-yxs1heea.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/{reference_tools.md.Wmvb7Lob.lean.js → reference_tools.md.DTg_kEsx.lean.js} +0 -0
- /package/dist/docs/assets/{troubleshooting.md.CuVztCKs.lean.js → troubleshooting.md.DQ-hYuZT.lean.js} +0 -0
|
@@ -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
|
|
123
|
-
* to that tier so github-proxy / `/github-token` can
|
|
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
|
-
|
|
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
|
|
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";
|
|
@@ -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
|
-
|
|
33
|
-
|
|
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
|
|
138
|
+
const includeAgentView = options.assistant !== false;
|
|
139
139
|
|
|
140
|
-
const botScopes =
|
|
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
|
-
|
|
167
|
+
agent_view: includeAgentView
|
|
168
168
|
? {
|
|
169
|
-
|
|
170
|
-
|
|
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 `
|
|
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 `
|
|
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
|
package/src/connections.ts
CHANGED
|
@@ -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 `
|
|
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/
|
|
46
|
-
* export default defineConnection({
|
|
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({
|
|
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({
|
|
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
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
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
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
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
|
-
|
|
111
|
-
|
|
112
|
-
|
|
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
|
-
|
|
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:
|
|
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
|
-
//
|
|
670
|
-
//
|
|
671
|
-
|
|
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/
|
|
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:
|
|
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
|
-
`;
|