@cursor/july 0.1.16 → 0.1.17
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/README.md +9 -4
- package/dist/bin/agent-serve.js +60 -2
- package/dist/channels/slack/api.d.ts.map +1 -1
- package/dist/channels/slack/api.js +13 -3
- package/dist/channels/slack/auth.d.ts +7 -1
- package/dist/channels/slack/auth.d.ts.map +1 -1
- package/dist/channels/slack/auth.js +14 -0
- package/dist/channels/slack/blocks.d.ts +61 -0
- package/dist/channels/slack/blocks.d.ts.map +1 -0
- package/dist/channels/slack/blocks.js +90 -0
- package/dist/channels/slack/defaults.d.ts +2 -0
- package/dist/channels/slack/defaults.d.ts.map +1 -1
- package/dist/channels/slack/defaults.js +29 -3
- package/dist/channels/slack/dispatch.d.ts +3 -17
- package/dist/channels/slack/dispatch.d.ts.map +1 -1
- package/dist/channels/slack/index.d.ts +1 -0
- package/dist/channels/slack/index.d.ts.map +1 -1
- package/dist/channels/slack/index.js +1 -0
- package/dist/channels/slack/interactive.d.ts +39 -3
- package/dist/channels/slack/interactive.d.ts.map +1 -1
- package/dist/channels/slack/interactive.js +152 -7
- package/dist/channels/slack/manifest.d.ts +3 -0
- package/dist/channels/slack/manifest.d.ts.map +1 -1
- package/dist/channels/slack/manifest.js +3 -0
- package/dist/channels/slack/setup.d.ts +4 -1
- package/dist/channels/slack/setup.d.ts.map +1 -1
- package/dist/channels/slack/setup.js +16 -2
- package/dist/channels/slack/slack-channel.d.ts.map +1 -1
- package/dist/channels/slack/slack-channel.js +24 -3
- package/dist/channels/slack/types.d.ts +77 -0
- package/dist/channels/slack/types.d.ts.map +1 -1
- package/dist/connections.d.ts +4 -1
- package/dist/connections.d.ts.map +1 -1
- package/dist/connections.js +4 -1
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +3 -3
- package/dist/docs/assets/{app.DjHC-Ggf.js → app.BbEXr2KO.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.DCBsrfwP.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.DwviwmIq.js → VPLocalSearchBox.DBEi4HDp.js} +1 -1
- package/dist/docs/assets/chunks/{theme.BIpeYSon.js → theme.DGfptcHw.js} +2 -2
- package/dist/docs/assets/{guides_mcp-oauth.md.DqmEOQY1.js → guides_mcp-oauth.md.Dd8EgSem.js} +3 -2
- package/dist/docs/assets/{guides_mcp-oauth.md.DqmEOQY1.lean.js → guides_mcp-oauth.md.Dd8EgSem.lean.js} +1 -1
- package/dist/docs/assets/{guides_slack.md.FWale6Ip.js → guides_slack.md.D_xFKlnF.js} +1 -1
- package/dist/docs/assets/{reference_connections.md.CsSr3rDz.js → reference_connections.md.B9Q3TOve.js} +12 -5
- package/dist/docs/assets/{reference_connections.md.CsSr3rDz.lean.js → reference_connections.md.B9Q3TOve.lean.js} +1 -1
- package/dist/docs/building-with-agents.html +3 -3
- package/dist/docs/concepts.html +3 -3
- 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/github.html +3 -3
- package/dist/docs/guides/human-in-the-loop.html +3 -3
- package/dist/docs/guides/mcp-oauth.html +6 -5
- package/dist/docs/guides/slack.html +5 -5
- 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 +3 -3
- package/dist/docs/reference/channels.html +3 -3
- package/dist/docs/reference/cli.html +3 -3
- package/dist/docs/reference/connections.html +14 -7
- 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 +3 -3
- package/dist/docs/reference/skills.html +3 -3
- package/dist/docs/reference/subagents.html +3 -3
- package/dist/docs/reference/tools.html +3 -3
- package/dist/docs/scaffolding-agents.html +3 -3
- package/dist/docs/storage.html +3 -3
- package/dist/docs/troubleshooting.html +3 -3
- package/dist/evals/assertions.d.ts +190 -0
- package/dist/evals/assertions.d.ts.map +1 -0
- package/dist/evals/assertions.js +461 -0
- package/dist/evals/expect.d.ts +95 -0
- package/dist/evals/expect.d.ts.map +1 -0
- package/dist/evals/expect.js +194 -0
- package/dist/evals/judge.d.ts +133 -0
- package/dist/evals/judge.d.ts.map +1 -0
- package/dist/evals/judge.js +228 -0
- package/dist/evals/loaders.d.ts +51 -0
- package/dist/evals/loaders.d.ts.map +1 -0
- package/dist/evals/loaders.js +124 -0
- package/dist/evals/matchers.d.ts +95 -0
- package/dist/evals/matchers.d.ts.map +1 -0
- package/dist/evals/matchers.js +145 -0
- package/dist/evals/reporters.d.ts +70 -0
- package/dist/evals/reporters.d.ts.map +1 -0
- package/dist/evals/reporters.js +221 -0
- package/dist/evals/results.d.ts +103 -0
- package/dist/evals/results.d.ts.map +1 -0
- package/dist/evals/results.js +28 -0
- package/dist/evals/run-facts.d.ts +77 -0
- package/dist/evals/run-facts.d.ts.map +1 -0
- package/dist/evals/run-facts.js +187 -0
- package/dist/evals.d.ts +118 -31
- package/dist/evals.d.ts.map +1 -1
- package/dist/evals.js +46 -12
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/cli-ax.d.ts +27 -0
- package/dist/internal/cli-ax.d.ts.map +1 -1
- package/dist/internal/cli-ax.js +90 -12
- package/dist/internal/cli-mcp.d.ts +8 -0
- package/dist/internal/cli-mcp.d.ts.map +1 -1
- package/dist/internal/cli-mcp.js +98 -0
- package/dist/internal/cli-slack.d.ts +29 -1
- package/dist/internal/cli-slack.d.ts.map +1 -1
- package/dist/internal/cli-slack.js +777 -12
- package/dist/internal/deploy-client.d.ts +7 -0
- package/dist/internal/deploy-client.d.ts.map +1 -1
- package/dist/internal/deploy-client.js +9 -0
- package/dist/internal/discovery.d.ts.map +1 -1
- package/dist/internal/discovery.js +29 -9
- package/dist/internal/distribution.d.ts.map +1 -1
- package/dist/internal/distribution.js +2 -0
- package/dist/internal/eval-judge-model.d.ts +59 -0
- package/dist/internal/eval-judge-model.d.ts.map +1 -0
- package/dist/internal/eval-judge-model.js +131 -0
- package/dist/internal/eval-run-store.d.ts.map +1 -1
- package/dist/internal/eval-run-store.js +12 -20
- package/dist/internal/eval-runner.d.ts +31 -25
- package/dist/internal/eval-runner.d.ts.map +1 -1
- package/dist/internal/eval-runner.js +329 -126
- package/dist/internal/evals-client.d.ts.map +1 -1
- package/dist/internal/evals-client.js +4 -1
- package/dist/internal/local-env.d.ts +8 -0
- package/dist/internal/local-env.d.ts.map +1 -0
- package/dist/internal/local-env.js +47 -0
- package/dist/internal/playground/static.d.ts +3 -0
- package/dist/internal/playground/static.d.ts.map +1 -1
- package/dist/internal/playground/static.js +3 -0
- package/dist/internal/run-client.d.ts +15 -0
- package/dist/internal/run-client.d.ts.map +1 -1
- package/dist/internal/run-client.js +3 -2
- package/dist/internal/sdk-runner.d.ts +36 -1
- package/dist/internal/sdk-runner.d.ts.map +1 -1
- package/dist/internal/sdk-runner.js +65 -25
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +10 -1
- package/dist/internal/session-engine.d.ts +18 -5
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +72 -19
- package/dist/internal/slack-provision-client.d.ts +130 -0
- package/dist/internal/slack-provision-client.d.ts.map +1 -0
- package/dist/internal/slack-provision-client.js +284 -0
- package/dist/playground/assets/cursor-icons-16-f_W_ogc-.woff2 +0 -0
- package/dist/playground/assets/index-CidizGZv.css +1 -0
- package/dist/playground/assets/index-DNqirsrK.js +85 -0
- package/dist/playground/index.html +2 -2
- package/dist/types.d.ts +70 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +26 -0
- package/docs/guides/mcp-oauth.md +10 -5
- package/docs/guides/slack.md +3 -2
- package/docs/reference/connections.md +28 -18
- package/package.json +20 -2
- package/skills/create-agent/SKILL.md +15 -7
- package/skills/debug/SKILL.md +3 -1
- package/skills/mcp-auth/SKILL.md +1 -1
- package/skills/setup-slack/SKILL.md +173 -11
- package/src/bin/agent-serve.ts +63 -2
- package/src/channels/slack/api.ts +16 -3
- package/src/channels/slack/auth.ts +16 -1
- package/src/channels/slack/blocks.ts +139 -0
- package/src/channels/slack/defaults.ts +32 -4
- package/src/channels/slack/dispatch.ts +3 -18
- package/src/channels/slack/index.ts +1 -0
- package/src/channels/slack/interactive.ts +183 -19
- package/src/channels/slack/manifest.ts +3 -0
- package/src/channels/slack/setup.ts +16 -2
- package/src/channels/slack/slack-channel.ts +37 -6
- package/src/channels/slack/types.ts +89 -0
- package/src/connections.ts +4 -1
- package/src/evals/assertions.ts +704 -0
- package/src/evals/expect.ts +272 -0
- package/src/evals/judge.ts +346 -0
- package/src/evals/loaders.ts +113 -0
- package/src/evals/matchers.ts +246 -0
- package/src/evals/reporters.ts +274 -0
- package/src/evals/results.ts +132 -0
- package/src/evals/run-facts.ts +274 -0
- package/src/evals.ts +205 -42
- package/src/index.ts +2 -0
- package/src/internal/cli-ax.ts +134 -15
- package/src/internal/cli-mcp.ts +118 -5
- package/src/internal/cli-slack.ts +993 -15
- package/src/internal/deploy-client.ts +10 -0
- package/src/internal/discovery.ts +31 -5
- package/src/internal/distribution.ts +2 -0
- package/src/internal/eval-judge-model.ts +148 -0
- package/src/internal/eval-run-store.ts +10 -14
- package/src/internal/eval-runner.ts +460 -214
- package/src/internal/evals-client.ts +5 -0
- package/src/internal/local-env.ts +53 -0
- package/src/internal/playground/static.ts +3 -0
- package/src/internal/run-client.ts +17 -1
- package/src/internal/sdk-runner.ts +103 -22
- package/src/internal/server.ts +10 -0
- package/src/internal/session-engine.ts +89 -21
- package/src/internal/slack-provision-client.ts +438 -0
- package/src/types.ts +92 -4
- package/dist/channels/slack/post-update-delivery.d.ts +0 -85
- package/dist/channels/slack/post-update-delivery.d.ts.map +0 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.DZtu0ZIc.js +0 -1
- package/dist/internal/json-dir-store.d.ts +0 -32
- package/dist/internal/json-dir-store.d.ts.map +0 -1
- package/dist/internal/persistence-coordinator.d.ts +0 -127
- package/dist/internal/persistence-coordinator.d.ts.map +0 -1
- package/dist/persistence.d.ts +0 -184
- package/dist/persistence.d.ts.map +0 -1
- package/dist/playground/assets/cursor-icons-16-CQ50JpfO.woff2 +0 -0
- package/dist/playground/assets/index-Bwl4Onx4.js +0 -85
- package/dist/playground/assets/index-ByV4nfch.css +0 -1
- /package/dist/docs/assets/{guides_slack.md.FWale6Ip.lean.js → guides_slack.md.D_xFKlnF.lean.js} +0 -0
package/src/internal/cli-mcp.ts
CHANGED
|
@@ -29,6 +29,8 @@
|
|
|
29
29
|
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
30
30
|
import { homedir } from "node:os";
|
|
31
31
|
import { dirname, join } from "node:path";
|
|
32
|
+
import { resolveDeployAuth } from "./cli-deploy.js";
|
|
33
|
+
import { DeployApiError } from "./deploy-client.js";
|
|
32
34
|
import { CLI_COMMAND_NAME as CLI, LOG_PREFIX } from "./distribution.js";
|
|
33
35
|
import {
|
|
34
36
|
ProdTargetError,
|
|
@@ -77,9 +79,16 @@ export interface McpCliOptions {
|
|
|
77
79
|
print?: boolean;
|
|
78
80
|
/** `install`: machine-readable output. */
|
|
79
81
|
json?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* `install --prod`: write a REMOTE HTTP entry pointing at the stable Cursor
|
|
84
|
+
* MCP gateway (`<api>/…/mcp/<team>/<slug>`) instead of the local stdio
|
|
85
|
+
* proxy. For remote-only MCP hosts (Glass) that cannot spawn stdio.
|
|
86
|
+
*/
|
|
87
|
+
remote?: boolean;
|
|
80
88
|
/** Injected seams for tests. */
|
|
81
89
|
fetchImpl?: typeof fetch;
|
|
82
90
|
resolveProdTargetImpl?: typeof resolveProdTarget;
|
|
91
|
+
resolveDeployAuthImpl?: typeof resolveDeployAuth;
|
|
83
92
|
stdin?: NodeJS.ReadableStream;
|
|
84
93
|
stdout?: { write(chunk: string): unknown };
|
|
85
94
|
err?: (text: string) => void;
|
|
@@ -490,10 +499,9 @@ function requestIdsOf(line: string): Array<string | number> {
|
|
|
490
499
|
// install: write the entry into ~/.cursor/mcp.json
|
|
491
500
|
// ============================================================================
|
|
492
501
|
|
|
493
|
-
|
|
494
|
-
command: string;
|
|
495
|
-
|
|
496
|
-
}
|
|
502
|
+
type McpJsonEntry =
|
|
503
|
+
| { command: string; args: string[] }
|
|
504
|
+
| { url: string; headers?: Record<string, string> };
|
|
497
505
|
|
|
498
506
|
export async function cmdMcpInstall(options: McpCliOptions): Promise<number> {
|
|
499
507
|
const err = options.err ?? defaultErr;
|
|
@@ -502,9 +510,16 @@ export async function cmdMcpInstall(options: McpCliOptions): Promise<number> {
|
|
|
502
510
|
err("--prod and --url are mutually exclusive\n");
|
|
503
511
|
return 1;
|
|
504
512
|
}
|
|
513
|
+
if (options.remote === true) {
|
|
514
|
+
if (options.prod !== true) {
|
|
515
|
+
err("--remote requires --prod (the hosted deployment MCP gateway)\n");
|
|
516
|
+
return 1;
|
|
517
|
+
}
|
|
518
|
+
return cmdMcpInstallRemote(options);
|
|
519
|
+
}
|
|
505
520
|
|
|
506
521
|
let name: string;
|
|
507
|
-
let entry:
|
|
522
|
+
let entry: { command: string; args: string[] };
|
|
508
523
|
if (options.prod === true) {
|
|
509
524
|
let slug: string;
|
|
510
525
|
try {
|
|
@@ -598,6 +613,104 @@ export async function cmdMcpInstall(options: McpCliOptions): Promise<number> {
|
|
|
598
613
|
return 0;
|
|
599
614
|
}
|
|
600
615
|
|
|
616
|
+
/**
|
|
617
|
+
* `mcp install --prod --remote` — write a REMOTE HTTP entry pointing at the
|
|
618
|
+
* stable Cursor MCP gateway for the hosted deployment, for MCP hosts that
|
|
619
|
+
* cannot spawn the stdio proxy (Glass / Sand). The gateway mints/refreshes
|
|
620
|
+
* engineAccess server-side, so the entry never carries a pod hostname or a
|
|
621
|
+
* short-lived port token — only the durable, stable gateway URL.
|
|
622
|
+
*
|
|
623
|
+
* Auth: this headless/CLI entry sends the `agentkit login` API key as a
|
|
624
|
+
* bearer against the user-API-key gateway surface. That key is written to
|
|
625
|
+
* `mcp.json` in plain text (flagged below); a signed-in Cursor client
|
|
626
|
+
* (Glass) can instead use the session gateway surface with no header at all
|
|
627
|
+
* once first-party session attachment ships (see PR follow-ups).
|
|
628
|
+
*/
|
|
629
|
+
async function cmdMcpInstallRemote(options: McpCliOptions): Promise<number> {
|
|
630
|
+
const err = options.err ?? defaultErr;
|
|
631
|
+
const stdout = options.stdout ?? process.stdout;
|
|
632
|
+
|
|
633
|
+
let slug: string;
|
|
634
|
+
try {
|
|
635
|
+
slug = resolveProdSlug({
|
|
636
|
+
dir: options.dir,
|
|
637
|
+
cwd: options.cwd,
|
|
638
|
+
slug: options.slug,
|
|
639
|
+
});
|
|
640
|
+
} catch (error) {
|
|
641
|
+
err(`${describeError(error)}\n`);
|
|
642
|
+
return 1;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
const resolveAuthImpl = options.resolveDeployAuthImpl ?? resolveDeployAuth;
|
|
646
|
+
const auth = await resolveAuthImpl({
|
|
647
|
+
team: options.team,
|
|
648
|
+
apiKey: options.apiKey,
|
|
649
|
+
fetchImpl: options.fetchImpl,
|
|
650
|
+
err,
|
|
651
|
+
});
|
|
652
|
+
if (typeof auth === "number") {
|
|
653
|
+
return auth;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
// Verify the deployment resolves before writing config that cannot work.
|
|
657
|
+
// This read is admin-tier, but calling the gateway only needs team
|
|
658
|
+
// membership — so a 403 means "cannot verify", not "cannot use": warn and
|
|
659
|
+
// still write the entry rather than locking members out of their own agent.
|
|
660
|
+
try {
|
|
661
|
+
await auth.client.getDeployment({ teamId: auth.teamId, slug });
|
|
662
|
+
} catch (error) {
|
|
663
|
+
if (error instanceof DeployApiError && error.status === 403) {
|
|
664
|
+
err(
|
|
665
|
+
`Could not verify deployment "${slug}" (reading deployments needs team-admin); writing the entry anyway.\n`
|
|
666
|
+
);
|
|
667
|
+
} else {
|
|
668
|
+
err(`${describeError(error)}\n`);
|
|
669
|
+
if (error instanceof DeployApiError && error.status === 404) {
|
|
670
|
+
err(`Deploy it first: ${CLI} deploy --slug ${slug}\n`);
|
|
671
|
+
}
|
|
672
|
+
return 1;
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
const name = resolveServerName(options.name, slug);
|
|
677
|
+
const url = auth.client.mcpGatewayUrl(auth.teamId, slug);
|
|
678
|
+
const entry: { url: string; headers?: Record<string, string> } = {
|
|
679
|
+
url,
|
|
680
|
+
headers: { Authorization: `Bearer ${auth.apiKey}` },
|
|
681
|
+
};
|
|
682
|
+
|
|
683
|
+
if (options.print === true) {
|
|
684
|
+
stdout.write(
|
|
685
|
+
`${JSON.stringify({ mcpServers: { [name]: entry } }, null, 2)}\n`
|
|
686
|
+
);
|
|
687
|
+
return 0;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
const path = cursorMcpJsonPath();
|
|
691
|
+
try {
|
|
692
|
+
await upsertMcpJsonEntry(path, name, entry);
|
|
693
|
+
} catch (error) {
|
|
694
|
+
err(`${describeError(error)}\n`);
|
|
695
|
+
return 1;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
err(
|
|
699
|
+
"note: the API key is written to mcp.json in plain text; it is a durable " +
|
|
700
|
+
"credential for a remote MCP host that cannot spawn the stdio proxy.\n"
|
|
701
|
+
);
|
|
702
|
+
if (options.json === true) {
|
|
703
|
+
stdout.write(`${JSON.stringify({ ok: true, path, name, entry })}\n`);
|
|
704
|
+
return 0;
|
|
705
|
+
}
|
|
706
|
+
stdout.write(
|
|
707
|
+
`Installed remote MCP server "${name}" in ${path}\n` +
|
|
708
|
+
` ${url}\n` +
|
|
709
|
+
"Cursor watches this file; the server appears without a restart.\n"
|
|
710
|
+
);
|
|
711
|
+
return 0;
|
|
712
|
+
}
|
|
713
|
+
|
|
601
714
|
/** `~/.cursor/mcp.json` — the user-level Cursor MCP config. */
|
|
602
715
|
export function cursorMcpJsonPath(
|
|
603
716
|
home: string = process.env.HOME ?? homedir()
|