@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install-cursor-skills.d.ts","sourceRoot":"","sources":["../../src/internal/install-cursor-skills.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"install-cursor-skills.d.ts","sourceRoot":"","sources":["../../src/internal/install-cursor-skills.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAsBH,+EAA+E;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CAAC,CAsB9B"}
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Offer to install the package's coding-agent skills into the user's
|
|
3
|
-
* personal Cursor skills dir under `~/.cursor/skills/
|
|
3
|
+
* personal Cursor skills dir under `~/.cursor/skills/agentsdk/<skill>/`.
|
|
4
4
|
*
|
|
5
|
-
* Cursor walks `~/.cursor/skills` recursively, so the `
|
|
5
|
+
* Cursor walks `~/.cursor/skills` recursively, so the `agentsdk/` folder is
|
|
6
6
|
* only organizational — identity comes from the leaf folder that holds
|
|
7
|
-
* SKILL.md.
|
|
7
|
+
* SKILL.md. Installed copies get `alwaysApply: true` so Cursor injects the
|
|
8
|
+
* skill body as a global rule instead of leaving it as an on-demand catalog
|
|
9
|
+
* entry. Skipped for `--json` / non-TTY hosts.
|
|
10
|
+
*
|
|
11
|
+
* Consumer installs (`npm install` / `npx` of `@cursor/july`) also copy
|
|
12
|
+
* these skills from a postinstall hook. That path never prompts and never
|
|
13
|
+
* fails the package install. The monorepo source checkout is not a consumer
|
|
14
|
+
* install, so `pnpm install` in everysphere does not overwrite `~/.cursor`.
|
|
8
15
|
*/
|
|
9
16
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
10
17
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -19,40 +26,67 @@ import { access, chmod, cp, mkdir, readdir, readFile, rm, stat, writeFile, } fro
|
|
|
19
26
|
import { homedir } from "node:os";
|
|
20
27
|
import { join } from "node:path";
|
|
21
28
|
import { CLI_COMMAND_NAME, packageRootDir } from "./distribution.js";
|
|
29
|
+
import { parseFrontmatter } from "./frontmatter.js";
|
|
22
30
|
import { stdoutPalette } from "./terminal-style.js";
|
|
23
31
|
/** Monorepo-only skill; excluded from the published package. */
|
|
24
32
|
const SKIP_SKILL_DIRS = new Set(["operate"]);
|
|
25
33
|
/** Category folder under ~/.cursor/skills (Cursor discovers nested skills). */
|
|
26
|
-
export const CURSOR_SKILLS_NAMESPACE = "
|
|
34
|
+
export const CURSOR_SKILLS_NAMESPACE = "agentsdk";
|
|
35
|
+
/** Pre-rename install folder. Install deletes this so `/agentkit-*` rows disappear. */
|
|
36
|
+
export const LEGACY_CURSOR_SKILLS_NAMESPACE = "agentkit";
|
|
27
37
|
/** How long the `init` offer waits for an answer before skipping the install. */
|
|
28
38
|
export const SKILL_PROMPT_TIMEOUT_MS = 45000;
|
|
39
|
+
/**
|
|
40
|
+
* Override the resolved `~/.cursor/skills` directory (not the user home).
|
|
41
|
+
* Used by the postinstall hook in tests and publish smoke.
|
|
42
|
+
*/
|
|
43
|
+
export const CURSOR_JULY_SKILLS_HOME_ENV = "CURSOR_JULY_SKILLS_HOME";
|
|
44
|
+
/** Set to `1` to skip the postinstall skill copy. */
|
|
45
|
+
export const CURSOR_JULY_SKIP_SKILL_INSTALL_ENV = "CURSOR_JULY_SKIP_SKILL_INSTALL";
|
|
29
46
|
export function cursorSkillsHome(home) {
|
|
30
47
|
var _a;
|
|
31
|
-
if (home
|
|
32
|
-
|
|
33
|
-
|
|
48
|
+
if (home !== undefined) {
|
|
49
|
+
return join(home.trim() === "" ? homedir() : home, ".cursor", "skills");
|
|
50
|
+
}
|
|
51
|
+
const override = (_a = process.env[CURSOR_JULY_SKILLS_HOME_ENV]) === null || _a === void 0 ? void 0 : _a.trim();
|
|
52
|
+
if (override !== undefined && override !== "") {
|
|
53
|
+
return override;
|
|
54
|
+
}
|
|
55
|
+
return join(homedir(), ".cursor", "skills");
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* True when this package root is an installed copy under `node_modules`
|
|
59
|
+
* (npm, pnpm, yarn, npx, global), not the everysphere source checkout.
|
|
60
|
+
*/
|
|
61
|
+
export function isConsumerPackageInstall(packageRoot) {
|
|
62
|
+
// Segment check only — split on both separators so a Windows path still
|
|
63
|
+
// matches when this runs (or is tested) on POSIX. Do not rewrite the path.
|
|
64
|
+
return packageRoot.split(/[\\/]/).includes("node_modules");
|
|
34
65
|
}
|
|
35
|
-
/** `~/.cursor/skills/
|
|
36
|
-
export function
|
|
66
|
+
/** `~/.cursor/skills/agentsdk` — where package skills are installed. */
|
|
67
|
+
export function agentsdkCursorSkillsDir(skillsHome = cursorSkillsHome()) {
|
|
37
68
|
return join(skillsHome, CURSOR_SKILLS_NAMESPACE);
|
|
38
69
|
}
|
|
39
|
-
/**
|
|
70
|
+
/** Pre-rename `~/.cursor/skills/agentkit`. */
|
|
71
|
+
export function legacyAgentkitCursorSkillsDir(skillsHome = cursorSkillsHome()) {
|
|
72
|
+
return join(skillsHome, LEGACY_CURSOR_SKILLS_NAMESPACE);
|
|
73
|
+
}
|
|
74
|
+
/** Absolute install path for one skill: `…/agentsdk/<leafDir>`. */
|
|
40
75
|
export function skillInstallPath(skill, skillsHome = cursorSkillsHome()) {
|
|
41
|
-
return join(
|
|
76
|
+
return join(agentsdkCursorSkillsDir(skillsHome), skill.leafDir);
|
|
42
77
|
}
|
|
43
78
|
/**
|
|
44
79
|
* Skills shipped next to the running package. Uses the frontmatter `name`
|
|
45
|
-
* when present, otherwise `
|
|
80
|
+
* when present, otherwise `agentsdk-<dir>`.
|
|
46
81
|
*/
|
|
47
82
|
export function listShippedPackageSkills() {
|
|
48
83
|
return __awaiter(this, arguments, void 0, function* (packageRoot = packageRootDir()) {
|
|
49
|
-
var _a;
|
|
50
84
|
const skillsRoot = join(packageRoot, "skills");
|
|
51
85
|
let entries;
|
|
52
86
|
try {
|
|
53
87
|
entries = yield readdir(skillsRoot, { withFileTypes: true });
|
|
54
88
|
}
|
|
55
|
-
catch (
|
|
89
|
+
catch (_a) {
|
|
56
90
|
return [];
|
|
57
91
|
}
|
|
58
92
|
const skills = [];
|
|
@@ -65,11 +99,12 @@ export function listShippedPackageSkills() {
|
|
|
65
99
|
try {
|
|
66
100
|
yield access(skillMd);
|
|
67
101
|
}
|
|
68
|
-
catch (
|
|
102
|
+
catch (_b) {
|
|
69
103
|
continue;
|
|
70
104
|
}
|
|
71
105
|
const raw = yield readFile(skillMd, "utf8");
|
|
72
|
-
const name = (
|
|
106
|
+
const name = parseFrontmatter(raw).data.name ||
|
|
107
|
+
`${CURSOR_SKILLS_NAMESPACE}-${entry.name}`;
|
|
73
108
|
skills.push({ name, leafDir: entry.name, sourceDir });
|
|
74
109
|
}
|
|
75
110
|
skills.sort((a, b) => a.leafDir.localeCompare(b.leafDir));
|
|
@@ -77,7 +112,7 @@ export function listShippedPackageSkills() {
|
|
|
77
112
|
});
|
|
78
113
|
}
|
|
79
114
|
/**
|
|
80
|
-
* Skills that do not yet have a SKILL.md under ~/.cursor/skills/
|
|
115
|
+
* Skills that do not yet have a SKILL.md under ~/.cursor/skills/agentsdk/.
|
|
81
116
|
* Install still overwrites every shipped skill when the user confirms — this
|
|
82
117
|
* helper is for messaging (fresh install vs update).
|
|
83
118
|
*/
|
|
@@ -99,13 +134,15 @@ export function findMissingCursorSkills(options) {
|
|
|
99
134
|
});
|
|
100
135
|
}
|
|
101
136
|
/**
|
|
102
|
-
* Copy each skill directory into `skillsHome/
|
|
137
|
+
* Copy each skill directory into `skillsHome/agentsdk/<leafDir>/`.
|
|
103
138
|
* Always overwrites so a package upgrade refreshes local Cursor skills.
|
|
104
|
-
* Strips monorepo-only frontmatter
|
|
139
|
+
* Strips monorepo-only frontmatter, sets `alwaysApply: true` so Cursor
|
|
140
|
+
* loads the body into context, and removes leaf dirs no longer shipped.
|
|
141
|
+
* Also deletes leftover `skillsHome/agentkit/` from the previous namespace.
|
|
105
142
|
*/
|
|
106
143
|
export function installCursorSkills(skills_1) {
|
|
107
144
|
return __awaiter(this, arguments, void 0, function* (skills, skillsHome = cursorSkillsHome()) {
|
|
108
|
-
const namespaceDir =
|
|
145
|
+
const namespaceDir = agentsdkCursorSkillsDir(skillsHome);
|
|
109
146
|
yield mkdir(namespaceDir, { recursive: true });
|
|
110
147
|
const removed = yield orphanLeaves(namespaceDir, skills);
|
|
111
148
|
for (const leaf of removed) {
|
|
@@ -128,7 +165,8 @@ export function installCursorSkills(skills_1) {
|
|
|
128
165
|
}
|
|
129
166
|
installed.push(skill.leafDir);
|
|
130
167
|
}
|
|
131
|
-
|
|
168
|
+
const removedLegacyNamespace = yield removeLegacyCursorSkillsNamespace(skillsHome);
|
|
169
|
+
return { installed, removed, removedLegacyNamespace };
|
|
132
170
|
});
|
|
133
171
|
}
|
|
134
172
|
function makeTreeWritable(root) {
|
|
@@ -171,14 +209,42 @@ function orphanLeaves(namespaceDir, skills) {
|
|
|
171
209
|
.map((entry) => entry.name);
|
|
172
210
|
});
|
|
173
211
|
}
|
|
174
|
-
/** Drop
|
|
212
|
+
/** Drop leftover `skillsHome/agentkit` from the previous install namespace. */
|
|
213
|
+
function removeLegacyCursorSkillsNamespace(skillsHome) {
|
|
214
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
215
|
+
const legacyDir = legacyAgentkitCursorSkillsDir(skillsHome);
|
|
216
|
+
try {
|
|
217
|
+
yield stat(legacyDir);
|
|
218
|
+
}
|
|
219
|
+
catch (_a) {
|
|
220
|
+
return false;
|
|
221
|
+
}
|
|
222
|
+
yield rm(legacyDir, { recursive: true, force: true });
|
|
223
|
+
return true;
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
function hasLegacyCursorSkillsNamespace(skillsHome) {
|
|
227
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
228
|
+
try {
|
|
229
|
+
yield stat(legacyAgentkitCursorSkillsDir(skillsHome));
|
|
230
|
+
return true;
|
|
231
|
+
}
|
|
232
|
+
catch (_a) {
|
|
233
|
+
return false;
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Drop monorepo `paths` globs, set `alwaysApply: true` so Cursor injects the
|
|
239
|
+
* body as a global rule, and fix package doc links for ~/.cursor installs.
|
|
240
|
+
*/
|
|
175
241
|
export function prepareSkillMarkdownForCursorInstall(content) {
|
|
176
242
|
var _a;
|
|
177
243
|
const match = /^---\r?\n([\s\S]*?)\r?\n---/.exec(content);
|
|
178
244
|
if (match === null) {
|
|
179
245
|
return content;
|
|
180
246
|
}
|
|
181
|
-
const frontmatter = stripPathsFromFrontmatter((_a = match[1]) !== null && _a !== void 0 ? _a : "");
|
|
247
|
+
const frontmatter = withAlwaysApply(stripPathsFromFrontmatter((_a = match[1]) !== null && _a !== void 0 ? _a : ""));
|
|
182
248
|
const body = content.slice(match[0].length);
|
|
183
249
|
const adjustedBody = body.replace(/\[`docs\/([^`]+)`\]\(\.\.\/\.\.\/docs\/[^)]+\)/g, "docs/$1 in the @cursor/july package");
|
|
184
250
|
return `---\n${frontmatter.trimEnd()}\n---${adjustedBody}`;
|
|
@@ -201,24 +267,42 @@ function stripPathsFromFrontmatter(frontmatter) {
|
|
|
201
267
|
}
|
|
202
268
|
return out.join("\n");
|
|
203
269
|
}
|
|
270
|
+
/** Cursor loads `alwaysApply: true` skills as global rules, not catalog rows. */
|
|
271
|
+
function withAlwaysApply(frontmatter) {
|
|
272
|
+
const without = frontmatter
|
|
273
|
+
.split(/\r?\n/)
|
|
274
|
+
.filter((line) => !/^\s*alwaysApply\s*:/.test(line))
|
|
275
|
+
.join("\n")
|
|
276
|
+
.replace(/\n+$/, "");
|
|
277
|
+
if (without === "") {
|
|
278
|
+
return "alwaysApply: true";
|
|
279
|
+
}
|
|
280
|
+
return `${without}\nalwaysApply: true`;
|
|
281
|
+
}
|
|
204
282
|
/** What an install would do, for the offer and for `install-skills`. */
|
|
205
283
|
export function planSkillInstall(options) {
|
|
206
284
|
return __awaiter(this, void 0, void 0, function* () {
|
|
207
285
|
var _a;
|
|
208
286
|
const skillsHome = (_a = options === null || options === void 0 ? void 0 : options.skillsHome) !== null && _a !== void 0 ? _a : cursorSkillsHome();
|
|
209
|
-
const directory =
|
|
287
|
+
const directory = agentsdkCursorSkillsDir(skillsHome);
|
|
210
288
|
const shipped = yield listShippedPackageSkills(options === null || options === void 0 ? void 0 : options.packageRoot);
|
|
211
|
-
const
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
289
|
+
const present = yield Promise.all(shipped.map((skill) => __awaiter(this, void 0, void 0, function* () {
|
|
290
|
+
try {
|
|
291
|
+
yield access(join(skillInstallPath(skill, skillsHome), "SKILL.md"));
|
|
292
|
+
return true;
|
|
293
|
+
}
|
|
294
|
+
catch (_a) {
|
|
295
|
+
return false;
|
|
296
|
+
}
|
|
297
|
+
})));
|
|
215
298
|
return {
|
|
216
299
|
shipped,
|
|
217
300
|
skillsHome,
|
|
218
301
|
directory,
|
|
219
302
|
leaves: shipped.map((skill) => skill.leafDir),
|
|
220
|
-
firstInstall:
|
|
303
|
+
firstInstall: present.every((isPresent) => !isPresent),
|
|
221
304
|
orphans: yield orphanLeaves(directory, shipped),
|
|
305
|
+
hasLegacyNamespace: yield hasLegacyCursorSkillsNamespace(skillsHome),
|
|
222
306
|
};
|
|
223
307
|
});
|
|
224
308
|
}
|
|
@@ -230,12 +314,55 @@ export function formatSkillInstall(plan, result) {
|
|
|
230
314
|
if (result.removed.length > 0) {
|
|
231
315
|
lines.push(` removed: ${result.removed.join(", ")}`);
|
|
232
316
|
}
|
|
317
|
+
if (result.removedLegacyNamespace) {
|
|
318
|
+
lines.push(` removed: ${legacyAgentkitCursorSkillsDir(plan.skillsHome)} (legacy namespace)`);
|
|
319
|
+
}
|
|
233
320
|
lines.push(` location: ${plan.directory}`);
|
|
234
321
|
return `${lines.join("\n")}\n`;
|
|
235
322
|
}
|
|
323
|
+
/**
|
|
324
|
+
* Copy shipped coding-agent skills into ~/.cursor/skills/agentsdk during a
|
|
325
|
+
* consumer `npm install` / `npx`. Never throws: a failed copy must not fail
|
|
326
|
+
* the package install. No-op in the monorepo source tree and when
|
|
327
|
+
* `CURSOR_JULY_SKIP_SKILL_INSTALL=1`.
|
|
328
|
+
*/
|
|
329
|
+
export function syncCursorSkillsOnPackageInstall() {
|
|
330
|
+
return __awaiter(this, arguments, void 0, function* (options = {}) {
|
|
331
|
+
var _a, _b, _c, _d;
|
|
332
|
+
try {
|
|
333
|
+
const env = (_a = options.env) !== null && _a !== void 0 ? _a : process.env;
|
|
334
|
+
if (env[CURSOR_JULY_SKIP_SKILL_INSTALL_ENV] === "1") {
|
|
335
|
+
return { status: "skipped", reason: "opt-out" };
|
|
336
|
+
}
|
|
337
|
+
const packageRoot = (_b = options.packageRoot) !== null && _b !== void 0 ? _b : packageRootDir();
|
|
338
|
+
const consumer = (_c = options.consumer) !== null && _c !== void 0 ? _c : isConsumerPackageInstall(packageRoot);
|
|
339
|
+
if (!consumer) {
|
|
340
|
+
return { status: "skipped", reason: "not-consumer" };
|
|
341
|
+
}
|
|
342
|
+
const plan = yield planSkillInstall({
|
|
343
|
+
packageRoot,
|
|
344
|
+
skillsHome: options.skillsHome,
|
|
345
|
+
});
|
|
346
|
+
if (plan.shipped.length === 0) {
|
|
347
|
+
return { status: "skipped", reason: "no-skills" };
|
|
348
|
+
}
|
|
349
|
+
const result = yield installCursorSkills(plan.shipped, plan.skillsHome);
|
|
350
|
+
const out = (_d = options.out) !== null && _d !== void 0 ? _d : ((text) => process.stderr.write(text));
|
|
351
|
+
out(formatSkillInstall(plan, result));
|
|
352
|
+
return {
|
|
353
|
+
status: "installed",
|
|
354
|
+
installed: result.installed,
|
|
355
|
+
removed: result.removed,
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
catch (_e) {
|
|
359
|
+
return { status: "skipped", reason: "error" };
|
|
360
|
+
}
|
|
361
|
+
});
|
|
362
|
+
}
|
|
236
363
|
/**
|
|
237
364
|
* On a TTY, offer to install/update every shipped package skill into
|
|
238
|
-
* ~/.cursor/skills/
|
|
365
|
+
* ~/.cursor/skills/agentsdk (always overwriting). No-op when non-interactive
|
|
239
366
|
* or the package ships no skills. An unanswered prompt skips the install
|
|
240
367
|
* rather than blocking the caller — see `SKILL_PROMPT_TIMEOUT_MS`.
|
|
241
368
|
*/
|
|
@@ -265,6 +392,9 @@ export function offerInstallCursorSkills() {
|
|
|
265
392
|
if (plan.orphans.length > 0) {
|
|
266
393
|
out(c.dim(` (deletes ${plan.orphans.join(", ")})\n`));
|
|
267
394
|
}
|
|
395
|
+
if (plan.hasLegacyNamespace) {
|
|
396
|
+
out(c.dim(` (deletes leftover ${legacyAgentkitCursorSkillsDir(plan.skillsHome)})\n`));
|
|
397
|
+
}
|
|
268
398
|
const confirm = (_c = options.confirm) !== null && _c !== void 0 ? _c : ((q) => promptYesNo(q, {
|
|
269
399
|
defaultYes: true,
|
|
270
400
|
out,
|
|
@@ -285,24 +415,6 @@ export function offerInstallCursorSkills() {
|
|
|
285
415
|
return { installed: result.installed, skipped: false };
|
|
286
416
|
});
|
|
287
417
|
}
|
|
288
|
-
function parseSkillName(skillMd) {
|
|
289
|
-
var _a;
|
|
290
|
-
var _b;
|
|
291
|
-
const match = /^---\r?\n([\s\S]*?)\r?\n---/.exec(skillMd);
|
|
292
|
-
if (match === null) {
|
|
293
|
-
return undefined;
|
|
294
|
-
}
|
|
295
|
-
const nameLine = /^name:\s*(.+)\s*$/m.exec((_b = match[1]) !== null && _b !== void 0 ? _b : "");
|
|
296
|
-
if (nameLine === null) {
|
|
297
|
-
return undefined;
|
|
298
|
-
}
|
|
299
|
-
const raw = (_a = nameLine[1]) === null || _a === void 0 ? void 0 : _a.trim();
|
|
300
|
-
if (raw === undefined || raw === "") {
|
|
301
|
-
return undefined;
|
|
302
|
-
}
|
|
303
|
-
// Strip optional quotes around the YAML scalar.
|
|
304
|
-
return raw.replace(/^["']|["']$/g, "");
|
|
305
|
-
}
|
|
306
418
|
/**
|
|
307
419
|
* Ask a yes/no question. Resolves `undefined` when the answer never comes —
|
|
308
420
|
* the prompt timed out, or stdin closed on an empty line.
|
|
@@ -3,6 +3,13 @@ import type { JsonSchemaObject } from "../types.js";
|
|
|
3
3
|
export declare function isZodSchema(value: unknown): value is z.ZodTypeAny;
|
|
4
4
|
/** Convert an authored input schema into the JSON Schema shown to the model. */
|
|
5
5
|
export declare function toolInputJsonSchema(inputSchema: z.ZodTypeAny | JsonSchemaObject | undefined): JsonSchemaObject;
|
|
6
|
+
/**
|
|
7
|
+
* Convert an authored output schema into the JSON Schema advertised on the
|
|
8
|
+
* tool. Unlike {@link toolInputJsonSchema} there is no fallback: an
|
|
9
|
+
* undeclared output schema stays undeclared (the MCP field is optional), and
|
|
10
|
+
* outputs are never validated against it.
|
|
11
|
+
*/
|
|
12
|
+
export declare function toolOutputJsonSchema(outputSchema: z.ZodTypeAny | JsonSchemaObject | undefined): JsonSchemaObject | undefined;
|
|
6
13
|
export type ToolInputValidation = {
|
|
7
14
|
ok: true;
|
|
8
15
|
value: unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-schema.d.ts","sourceRoot":"","sources":["../../src/internal/json-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAQpD,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,CAAC,CAAC,UAAU,CAYjE;AAED,gFAAgF;AAChF,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,CAAC,CAAC,UAAU,GAAG,gBAAgB,GAAG,SAAS,GACvD,gBAAgB,
|
|
1
|
+
{"version":3,"file":"json-schema.d.ts","sourceRoot":"","sources":["../../src/internal/json-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAQpD,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,CAAC,CAAC,UAAU,CAYjE;AAED,gFAAgF;AAChF,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,CAAC,CAAC,UAAU,GAAG,gBAAgB,GAAG,SAAS,GACvD,gBAAgB,CAKlB;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,YAAY,EAAE,CAAC,CAAC,UAAU,GAAG,gBAAgB,GAAG,SAAS,GACxD,gBAAgB,GAAG,SAAS,CAK9B;AAgBD,MAAM,MAAM,mBAAmB,GAC3B;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAC5B;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnC;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,CAAC,CAAC,UAAU,GAAG,gBAAgB,GAAG,SAAS,EACxD,IAAI,EAAE,OAAO,GACZ,mBAAmB,CAerB"}
|
|
@@ -21,15 +21,30 @@ export function toolInputJsonSchema(inputSchema) {
|
|
|
21
21
|
if (inputSchema === undefined) {
|
|
22
22
|
return ANY_OBJECT_SCHEMA;
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
return authoredSchemaToJsonSchema(inputSchema);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Convert an authored output schema into the JSON Schema advertised on the
|
|
28
|
+
* tool. Unlike {@link toolInputJsonSchema} there is no fallback: an
|
|
29
|
+
* undeclared output schema stays undeclared (the MCP field is optional), and
|
|
30
|
+
* outputs are never validated against it.
|
|
31
|
+
*/
|
|
32
|
+
export function toolOutputJsonSchema(outputSchema) {
|
|
33
|
+
if (outputSchema === undefined) {
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
return authoredSchemaToJsonSchema(outputSchema);
|
|
37
|
+
}
|
|
38
|
+
function authoredSchemaToJsonSchema(schema) {
|
|
39
|
+
if (isZodSchema(schema)) {
|
|
40
|
+
const converted = zodToJsonSchema(schema, {
|
|
26
41
|
$refStrategy: "none",
|
|
27
42
|
target: "jsonSchema7",
|
|
28
43
|
});
|
|
29
44
|
delete converted.$schema;
|
|
30
45
|
return converted;
|
|
31
46
|
}
|
|
32
|
-
return
|
|
47
|
+
return schema;
|
|
33
48
|
}
|
|
34
49
|
/**
|
|
35
50
|
* Validate tool-call args before `execute` runs. Zod schemas validate (and
|
|
@@ -140,11 +140,9 @@ function buildToolMcpServer(engine, sessionId) {
|
|
|
140
140
|
});
|
|
141
141
|
const tools = engine.project.agent.tools.filter((tool) => tool.execution === "server");
|
|
142
142
|
server.setRequestHandler(ListToolsRequestSchema, () => Promise.resolve({
|
|
143
|
-
tools: tools.map((tool) => ({
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
inputSchema: tool.inputSchema,
|
|
147
|
-
})),
|
|
143
|
+
tools: tools.map((tool) => (Object.assign({ name: tool.name, description: tool.description, inputSchema: tool.inputSchema }, (tool.outputSchema === undefined
|
|
144
|
+
? {}
|
|
145
|
+
: { outputSchema: tool.outputSchema })))),
|
|
148
146
|
}));
|
|
149
147
|
server.setRequestHandler(CallToolRequestSchema, (request) => __awaiter(this, void 0, void 0, function* () {
|
|
150
148
|
var _a;
|
|
@@ -204,9 +202,11 @@ function buildConnectionBridgeMcpServer(engine, sessionId, connectionName) {
|
|
|
204
202
|
}
|
|
205
203
|
const tools = yield engine.host.mcp.listTools(connectionName);
|
|
206
204
|
return {
|
|
207
|
-
tools: tools.map((tool) => { var _a; return (Object.assign(Object.assign({ name: tool.name }, (tool.description === undefined
|
|
205
|
+
tools: tools.map((tool) => { var _a; return (Object.assign(Object.assign(Object.assign({ name: tool.name }, (tool.description === undefined
|
|
206
|
+
? {}
|
|
207
|
+
: { description: tool.description })), { inputSchema: (_a = tool.inputSchema) !== null && _a !== void 0 ? _a : { type: "object" } }), (tool.outputSchema === undefined
|
|
208
208
|
? {}
|
|
209
|
-
: {
|
|
209
|
+
: { outputSchema: tool.outputSchema }))); }),
|
|
210
210
|
};
|
|
211
211
|
}));
|
|
212
212
|
server.setRequestHandler(CallToolRequestSchema, (request) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -181,11 +181,13 @@ export function isStaleMcpSessionError(error) {
|
|
|
181
181
|
return code === 404;
|
|
182
182
|
}
|
|
183
183
|
function toToolInfo(tool) {
|
|
184
|
-
return Object.assign(Object.assign({ name: tool.name }, (tool.description === undefined
|
|
184
|
+
return Object.assign(Object.assign(Object.assign({ name: tool.name }, (tool.description === undefined
|
|
185
185
|
? {}
|
|
186
186
|
: { description: tool.description })), (tool.inputSchema === undefined
|
|
187
187
|
? {}
|
|
188
|
-
: { inputSchema: tool.inputSchema }))
|
|
188
|
+
: { inputSchema: tool.inputSchema })), (tool.outputSchema === undefined
|
|
189
|
+
? {}
|
|
190
|
+
: { outputSchema: tool.outputSchema }));
|
|
189
191
|
}
|
|
190
192
|
function openConnection(connection) {
|
|
191
193
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -46,7 +46,24 @@ type ProviderArgs = {
|
|
|
46
46
|
onRedirect?: (url: URL) => void;
|
|
47
47
|
tokens?: OAuthTokens;
|
|
48
48
|
clientInformation?: OAuthClientInformationFull;
|
|
49
|
+
/**
|
|
50
|
+
* True when authorize/token requests must NOT carry the RFC 8707
|
|
51
|
+
* `resource` indicator, read off the server's protected-resource
|
|
52
|
+
* metadata (`cursor_omit_resource_indicator`). Entra rejects the
|
|
53
|
+
* indicator with AADSTS9010010, so Microsoft 365 flows through Cursor's
|
|
54
|
+
* REST-as-MCP translator fail pre-auth without this.
|
|
55
|
+
*/
|
|
56
|
+
omitResourceIndicator?: boolean;
|
|
49
57
|
};
|
|
58
|
+
/**
|
|
59
|
+
* Reads the Cursor REST-as-MCP translator's OAuth quirk off the resource's
|
|
60
|
+
* RFC 9728 protected-resource metadata. Deliberately self-contained
|
|
61
|
+
* (`@cursor/july` publishes to public npm with no private workspace
|
|
62
|
+
* dependencies — see `waitForMcpOAuthCallback`): matches the translator
|
|
63
|
+
* path shape on any origin so local translators work, and fails to the
|
|
64
|
+
* default behavior (indicator kept) when the PRM is unreachable.
|
|
65
|
+
*/
|
|
66
|
+
export declare function fetchOmitResourceIndicatorFromPrm(resourceUrl: string, fetchImpl?: typeof fetch): Promise<boolean>;
|
|
50
67
|
export declare class HostMcpOAuthProvider implements OAuthClientProvider {
|
|
51
68
|
private tokensValue;
|
|
52
69
|
private clientInfo;
|
|
@@ -54,6 +71,11 @@ export declare class HostMcpOAuthProvider implements OAuthClientProvider {
|
|
|
54
71
|
private redirect;
|
|
55
72
|
private readonly meta;
|
|
56
73
|
private readonly args;
|
|
74
|
+
/**
|
|
75
|
+
* Assigned only when the PRM sets `cursor_omit_resource_indicator`; left
|
|
76
|
+
* absent otherwise so the SDK's default resource validation applies.
|
|
77
|
+
*/
|
|
78
|
+
readonly validateResourceURL: (() => Promise<URL | undefined>) | undefined;
|
|
57
79
|
constructor(args: ProviderArgs);
|
|
58
80
|
get redirectUrl(): string;
|
|
59
81
|
get clientMetadata(): OAuthClientMetadata;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-oauth.d.ts","sourceRoot":"","sources":["../../src/internal/mcp-oauth.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,KAAK,EACV,0BAA0B,EAC1B,mBAAmB,EACnB,WAAW,EACZ,MAAM,0CAA0C,CAAC;AAGlD,eAAO,MAAM,uBAAuB,OAAO,CAAC;AAC5C,eAAO,MAAM,uBAAuB,cAAc,CAAC;AACnD,eAAO,MAAM,sBAAsB,EAAE,MAAgF,CAAC;AAEtH,uCAAuC;AACvC,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAO5D;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,mBAAmB,CAO3E;AAED,wBAAgB,aAAa,CAC3B,UAAU,EAAE,MAAM,EAClB,GAA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1B,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;CACjC,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAgBhC;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;;GAKG;AACH,wBAAsB,uBAAuB,CAAC,IAAI,EAAE;IAClD,gBAAgB,EAAE,MAAM,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CA8F/B;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAsB7C"}
|
|
@@ -210,12 +210,49 @@ export class FileMcpOAuthStore {
|
|
|
210
210
|
});
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
|
+
/**
|
|
214
|
+
* Reads the Cursor REST-as-MCP translator's OAuth quirk off the resource's
|
|
215
|
+
* RFC 9728 protected-resource metadata. Deliberately self-contained
|
|
216
|
+
* (`@cursor/july` publishes to public npm with no private workspace
|
|
217
|
+
* dependencies — see `waitForMcpOAuthCallback`): matches the translator
|
|
218
|
+
* path shape on any origin so local translators work, and fails to the
|
|
219
|
+
* default behavior (indicator kept) when the PRM is unreachable.
|
|
220
|
+
*/
|
|
221
|
+
export function fetchOmitResourceIndicatorFromPrm(resourceUrl_1) {
|
|
222
|
+
return __awaiter(this, arguments, void 0, function* (resourceUrl, fetchImpl = fetch) {
|
|
223
|
+
let url;
|
|
224
|
+
try {
|
|
225
|
+
url = new URL(resourceUrl);
|
|
226
|
+
}
|
|
227
|
+
catch (_a) {
|
|
228
|
+
return false;
|
|
229
|
+
}
|
|
230
|
+
if (!/^\/rest-mcp\/[^/]+\/mcp\/?$/.test(url.pathname)) {
|
|
231
|
+
return false;
|
|
232
|
+
}
|
|
233
|
+
const prmUrl = `${url.origin}/.well-known/oauth-protected-resource${url.pathname.replace(/\/+$/, "")}`;
|
|
234
|
+
try {
|
|
235
|
+
const response = yield fetchImpl(prmUrl);
|
|
236
|
+
if (!response.ok) {
|
|
237
|
+
return false;
|
|
238
|
+
}
|
|
239
|
+
const document = (yield response.json());
|
|
240
|
+
return document.cursor_omit_resource_indicator === true;
|
|
241
|
+
}
|
|
242
|
+
catch (_b) {
|
|
243
|
+
return false;
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
}
|
|
213
247
|
export class HostMcpOAuthProvider {
|
|
214
248
|
constructor(args) {
|
|
215
249
|
var _a;
|
|
216
250
|
this.args = args;
|
|
217
251
|
this.tokensValue = args.tokens;
|
|
218
252
|
this.clientInfo = args.clientInformation;
|
|
253
|
+
if (args.omitResourceIndicator === true) {
|
|
254
|
+
this.validateResourceURL = () => __awaiter(this, void 0, void 0, function* () { return undefined; });
|
|
255
|
+
}
|
|
219
256
|
this.meta = {
|
|
220
257
|
redirect_uris: [(_a = args.redirectUrl) !== null && _a !== void 0 ? _a : MCP_OAUTH_CALLBACK_URL],
|
|
221
258
|
token_endpoint_auth_method: "none",
|
|
@@ -293,9 +330,10 @@ export function createHostMcpOAuthProvider(args) {
|
|
|
293
330
|
return __awaiter(this, void 0, void 0, function* () {
|
|
294
331
|
var _a;
|
|
295
332
|
const store = (_a = args.store) !== null && _a !== void 0 ? _a : new FileMcpOAuthStore();
|
|
296
|
-
const [fileTokens, fileClient] = yield Promise.all([
|
|
333
|
+
const [fileTokens, fileClient, omitResourceIndicator] = yield Promise.all([
|
|
297
334
|
store.loadTokens(args.identifier, args.resourceUrl),
|
|
298
335
|
store.loadClientInformation(args.identifier, args.resourceUrl),
|
|
336
|
+
fetchOmitResourceIndicatorFromPrm(args.resourceUrl),
|
|
299
337
|
]);
|
|
300
338
|
return new HostMcpOAuthProvider({
|
|
301
339
|
identifier: args.identifier,
|
|
@@ -304,6 +342,7 @@ export function createHostMcpOAuthProvider(args) {
|
|
|
304
342
|
tokens: fileTokens !== null && fileTokens !== void 0 ? fileTokens : tokensFromEnv(args.identifier),
|
|
305
343
|
clientInformation: fileClient !== null && fileClient !== void 0 ? fileClient : clientIdFromEnv(args.identifier),
|
|
306
344
|
onRedirect: args.onRedirect,
|
|
345
|
+
omitResourceIndicator,
|
|
307
346
|
});
|
|
308
347
|
});
|
|
309
348
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-inline-stdio.d.ts","sourceRoot":"","sources":["../../src/internal/package-inline-stdio.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,KAAK,EACV,mBAAmB,EACnB,2BAA2B,EAE5B,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"package-inline-stdio.d.ts","sourceRoot":"","sources":["../../src/internal/package-inline-stdio.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,KAAK,EACV,mBAAmB,EACnB,2BAA2B,EAE5B,MAAM,aAAa,CAAC;AAmCrB,wBAAsB,4BAA4B,CAAC,OAAO,EAAE;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,2BAA2B,CAAC,OAAO,CAAC,CAAC;IAC5C,aAAa,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAsE/B"}
|
|
@@ -16,7 +16,7 @@ import { createRequire } from "node:module";
|
|
|
16
16
|
import { dirname, join } from "node:path";
|
|
17
17
|
import { fileURLToPath } from "node:url";
|
|
18
18
|
import * as esbuild from "esbuild";
|
|
19
|
-
import { toolInputJsonSchema } from "./json-schema.js";
|
|
19
|
+
import { toolInputJsonSchema, toolOutputJsonSchema } from "./json-schema.js";
|
|
20
20
|
const require = createRequire(import.meta.url);
|
|
21
21
|
const CONNECTION_SPECIFIERS = new Set([
|
|
22
22
|
"@anysphere/agent-serve/connections",
|
|
@@ -31,10 +31,10 @@ function sibling(basename) {
|
|
|
31
31
|
function jsonSchemaCatalog(tools) {
|
|
32
32
|
const catalog = {};
|
|
33
33
|
for (const [name, tool] of Object.entries(tools)) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
const outputSchema = toolOutputJsonSchema(tool.outputSchema);
|
|
35
|
+
catalog[name] = Object.assign({ description: tool.description, inputSchema: toolInputJsonSchema(tool.inputSchema) }, (outputSchema === undefined
|
|
36
|
+
? {}
|
|
37
|
+
: { outputSchema: outputSchema }));
|
|
38
38
|
}
|
|
39
39
|
return catalog;
|
|
40
40
|
}
|