neon 8.15.1 → 8.16.1
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 +8 -6
- package/dist/_chunks/{checkout-BpOcFaAi.js → checkout-CNBIS3gA.js} +3 -3
- package/dist/_chunks/{claim-DlLZmcq0.js → claim-m5sIJdm5.js} +1 -1
- package/dist/_chunks/{config-BjCm5cfr.js → config-CgtJH8xE.js} +1 -1
- package/dist/_chunks/{databases-DC2h6IW2.js → databases-B2Yapqme.js} +9 -4
- package/dist/_chunks/{deploy-DmEEhux0.js → deploy-Bs5gmi4Q.js} +1 -1
- package/dist/_chunks/{dev-DlUJFzRs.js → dev-DxiIp4c9.js} +3 -3
- package/dist/_chunks/{functions-3ypiRwZK.js → functions-PHaU-kRb.js} +1 -1
- package/dist/_chunks/{git-j6xSVo3e.js → git-DRUZBCmZ.js} +2 -2
- package/dist/_chunks/{link-nAiuWKfg.js → link-CNO-HxHN.js} +2 -2
- package/dist/_chunks/{mcp-BznTRK3w.js → mcp-SvqWzHnT.js} +6 -4
- package/dist/_chunks/{roles-xRuu0462.js → roles-BVc69rjG.js} +9 -4
- package/dist/_chunks/{status-BC4XXuuE.js → status-BlrzeKyA.js} +1 -1
- package/dist/commands/bootstrap.js +1 -1
- package/dist/commands/checkout.js +1 -1
- package/dist/commands/claim.js +1 -1
- package/dist/commands/config.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/deploy.js +1 -1
- package/dist/commands/dev.js +1 -1
- package/dist/commands/env.js +1 -1
- package/dist/commands/functions.js +1 -1
- package/dist/commands/functions_new.js +1 -1
- package/dist/commands/git.js +1 -1
- package/dist/commands/index.js +16 -16
- package/dist/commands/link.js +1 -1
- package/dist/commands/mcp.js +1 -1
- package/dist/commands/plugins.js +1 -1
- package/dist/commands/roles.js +1 -1
- package/dist/commands/skills.js +1 -1
- package/dist/commands/status.js +1 -1
- package/dist/commands/subscribe.js +1 -1
- package/dist/index.js +1 -1
- package/dist/init/agents.js +11 -3
- package/dist/init/auth.js +2 -2
- package/dist/init/detect.js +1 -2
- package/dist/init/link.js +1 -1
- package/dist/init/plan.js +2 -63
- package/dist/init/run.js +7 -7
- package/dist/init/tooling.js +5 -5
- package/dist/init/unknown_agent_arg.js +63 -0
- package/dist/init/wizard.js +2 -2
- package/dist/mcp/agents.js +25 -5
- package/dist/mcp/install.js +95 -30
- package/dist/mcp/targets.js +2 -3
- package/dist/plugins/run.js +0 -2
- package/dist/plugins/targets.js +5 -4
- package/dist/skills/catalog.js +0 -10
- package/dist/skills/targets.js +1 -2
- package/dist/update_notifier.js +1 -1
- package/dist/utils/ai_gateway_notice.js +1 -1
- package/package.json +8 -7
- package/dist/_chunks/{bootstrap-BDkvsAVJ.js → bootstrap-vAtWRZXa.js} +2 -2
- package/dist/_chunks/{env-BOt9AZ1j.js → env-BtG4vH55.js} +1 -1
- package/dist/_chunks/{plugins-B2Gym8Lw.js → plugins-7cxVcgay.js} +3 -3
- package/dist/_chunks/{skills-DKgafm65.js → skills-Bv8oKKwE.js} +3 -3
package/dist/init/tooling.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { log } from "../log.js";
|
|
2
2
|
import { getCliName } from "../utils/cli_name.js";
|
|
3
|
-
import {
|
|
3
|
+
import { detectProjectAgents } from "../mcp/agents.js";
|
|
4
4
|
import { MCP_OAUTH_FALLBACK, PROGRESS } from "./copy.js";
|
|
5
|
+
import { assertNamedAgentTooling, chooseYesAgentTooling, collectYesAgents, initYesSupportedAgents, noDetectedAgentsMessage, planAgentSteps, planToolingSteps, planYesAgentSteps, resolveInitAgentSetup } from "./plan.js";
|
|
5
6
|
import { CannotMintApiKeyError } from "../mcp/mint.js";
|
|
6
7
|
import { detectAgent } from "./detect_host.js";
|
|
7
8
|
import { AgentSelectionSkipped, canPickAgentsInteractively } from "../utils/agent_picker.js";
|
|
8
|
-
import { a as mcpInstallError, s as reportMcpInstall } from "../_chunks/mcp-
|
|
9
|
-
import { l as reportPluginsInstall, o as installPlugins, s as pluginsInstallError } from "../_chunks/plugins-
|
|
10
|
-
import { c as skillsInstallError, o as installSkills, s as reportSkillsInstall } from "../_chunks/skills-
|
|
9
|
+
import { a as mcpInstallError, s as reportMcpInstall } from "../_chunks/mcp-SvqWzHnT.js";
|
|
10
|
+
import { l as reportPluginsInstall, o as installPlugins, s as pluginsInstallError } from "../_chunks/plugins-7cxVcgay.js";
|
|
11
|
+
import { c as skillsInstallError, o as installSkills, s as reportSkillsInstall } from "../_chunks/skills-Bv8oKKwE.js";
|
|
11
12
|
import { runAuthenticatedMcp } from "./auth.js";
|
|
12
13
|
import { raceSigint } from "./cancelled.js";
|
|
13
14
|
import { pickAgentSetupInteractively } from "./wizard.js";
|
|
14
|
-
import { detectProjectAgents } from "add-mcp";
|
|
15
15
|
// src/init/tooling.ts
|
|
16
16
|
const defaultProjectAgents = (cwd) => detectProjectAgents(cwd);
|
|
17
17
|
const TOOLING_STEP_LABELS = {
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// src/init/unknown_agent_arg.ts
|
|
2
|
+
const UNKNOWN_AGENT_COMMANDS = ["link"];
|
|
3
|
+
const unknownAgentArgHint = (command, cliName) => `${cliName} ${command} has no --agent. Pass --project-id <id> to link without a TTY, or run ${cliName} ${command} in a terminal.`;
|
|
4
|
+
const BOOLEAN_FLAGS = /* @__PURE__ */ new Set([
|
|
5
|
+
"-y",
|
|
6
|
+
"--yes",
|
|
7
|
+
"--default",
|
|
8
|
+
"--force",
|
|
9
|
+
"-h",
|
|
10
|
+
"--help",
|
|
11
|
+
"-v",
|
|
12
|
+
"--version",
|
|
13
|
+
"--color",
|
|
14
|
+
"--no-color",
|
|
15
|
+
"--analytics",
|
|
16
|
+
"--no-analytics",
|
|
17
|
+
"--oauth",
|
|
18
|
+
"--project",
|
|
19
|
+
"--global",
|
|
20
|
+
"--read-only",
|
|
21
|
+
"--readonly",
|
|
22
|
+
"--clear",
|
|
23
|
+
"--checks",
|
|
24
|
+
"--no-checks",
|
|
25
|
+
"--env-pull",
|
|
26
|
+
"--no-env-pull",
|
|
27
|
+
"--no-agent-setup",
|
|
28
|
+
"--no-link",
|
|
29
|
+
"--no-config",
|
|
30
|
+
"--claimable",
|
|
31
|
+
"--config",
|
|
32
|
+
"--list",
|
|
33
|
+
"--list-templates",
|
|
34
|
+
"--force-auth",
|
|
35
|
+
"--no-force-auth"
|
|
36
|
+
]);
|
|
37
|
+
const isUnknownAgentCommand = (token) => {
|
|
38
|
+
for (const command of UNKNOWN_AGENT_COMMANDS) if (command === token) return true;
|
|
39
|
+
return false;
|
|
40
|
+
};
|
|
41
|
+
const commandFromArgv = (argv) => {
|
|
42
|
+
let skipValue = false;
|
|
43
|
+
for (const token of argv) {
|
|
44
|
+
if (skipValue) {
|
|
45
|
+
skipValue = false;
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
if (token === "--") break;
|
|
49
|
+
if (token.startsWith("-")) {
|
|
50
|
+
const flag = token.split("=")[0];
|
|
51
|
+
if (flag !== void 0 && !token.includes("=") && !BOOLEAN_FLAGS.has(flag)) skipValue = true;
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
if (isUnknownAgentCommand(token)) return token;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
const rewriteUnknownAgentArg = (input) => {
|
|
58
|
+
if (input.message !== "Unknown argument: agent" && input.message !== "Unknown argument: a") return;
|
|
59
|
+
const command = commandFromArgv(input.argv);
|
|
60
|
+
if (command === void 0) return;
|
|
61
|
+
return unknownAgentArgHint(command, input.cliName);
|
|
62
|
+
};
|
|
63
|
+
export { rewriteUnknownAgentArg };
|
package/dist/init/wizard.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { CONFIG_INIT_SERVICES } from "../config_template.js";
|
|
2
|
-
import { getAgentDisplayName, listMcpAgentIds } from "../mcp/agents.js";
|
|
3
|
-
import { INIT_NEEDS_YES_OR_TERMINAL } from "./plan.js";
|
|
4
2
|
import { installedPackageManagers } from "../utils/package_manager.js";
|
|
3
|
+
import { getAgentDisplayName, listMcpAgentIds } from "../mcp/agents.js";
|
|
5
4
|
import { AGENT_DETECTED_DESCRIPTION, AGENT_MCP_PICKER_MESSAGE, AGENT_MCP_SKIP_MESSAGE, AGENT_OTHER_DESCRIPTION, AGENT_PICKER_MESSAGE, AGENT_PLUGIN_SKIP_MESSAGE, AGENT_SETUP_MESSAGE, AGENT_SETUP_PLUGIN_DESCRIPTION, AGENT_SETUP_PLUGIN_TITLE, AGENT_SETUP_SKILLS_DESCRIPTION, AGENT_SETUP_SKILLS_TITLE, AGENT_SETUP_SKIP_DESCRIPTION, AGENT_SETUP_SKIP_TITLE, AGENT_SKILLS_PICKER_MESSAGE, AGENT_SKILLS_SKIP_MESSAGE, CONFIG_CONFIRM_HINT, CONFIG_CONFIRM_MESSAGE, MCP_AUTH_API_KEY_DESCRIPTION, MCP_AUTH_API_KEY_TITLE, MCP_AUTH_MESSAGE, MCP_AUTH_OAUTH_DESCRIPTION, MCP_AUTH_OAUTH_TITLE, MCP_SCOPE_GLOBAL_DESCRIPTION, MCP_SCOPE_GLOBAL_TITLE, MCP_SCOPE_MESSAGE, MCP_SCOPE_PROJECT_DESCRIPTION, MCP_SCOPE_PROJECT_TITLE, MODE_CUSTOM_DESCRIPTION, MODE_CUSTOM_TITLE, MODE_MESSAGE, MODE_RECOMMENDED_DESCRIPTION, MODE_RECOMMENDED_TITLE, PACKAGE_MANAGER_MESSAGE, PROJECT_SETUP_CLAIMABLE_DESCRIPTION, PROJECT_SETUP_CLAIMABLE_TITLE, PROJECT_SETUP_LINK_DESCRIPTION, PROJECT_SETUP_LINK_TITLE, PROJECT_SETUP_MESSAGE, SERVICES_HINT, SERVICES_MESSAGE, SKILLS_PICKER_MESSAGE, agentUnusableCommandDescription } from "./copy.js";
|
|
6
5
|
import { POSTGRES_SERVICE_CHOICE, keepPostgresSelected } from "../utils/service_picker.js";
|
|
6
|
+
import { INIT_NEEDS_YES_OR_TERMINAL } from "./plan.js";
|
|
7
7
|
import { canPickAgentsInteractively, pickAgentsInteractively } from "../utils/agent_picker.js";
|
|
8
8
|
import { NEON_SKILL_CATALOG, listSkillIds } from "../skills/catalog.js";
|
|
9
9
|
import { InitCancelled, restoreCursorVisibilityOnAbort } from "./cancelled.js";
|
package/dist/mcp/agents.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { agents, detectGlobalAgents, getAgentTypes } from "add-mcp";
|
|
1
|
+
import { agents, detectGlobalAgents, detectProjectAgents as detectProjectAgents$1, getAgentTypes } from "add-mcp";
|
|
2
2
|
// src/mcp/agents.ts
|
|
3
|
+
const UNSUPPORTED_AGENTS = /* @__PURE__ */ new Set(["mastracode"]);
|
|
4
|
+
const isSupportedAgent = (id) => !UNSUPPORTED_AGENTS.has(id);
|
|
3
5
|
const AGENT_ALIASES = {
|
|
4
6
|
cursor: "cursor",
|
|
5
7
|
copilot: "vscode",
|
|
@@ -25,10 +27,25 @@ const AGENT_ALIASES = {
|
|
|
25
27
|
mcporter: "mcporter",
|
|
26
28
|
zed: "zed",
|
|
27
29
|
grok: "grok-build",
|
|
28
|
-
"grok-build": "grok-build"
|
|
30
|
+
"grok-build": "grok-build",
|
|
31
|
+
"factory-droid": "factory-droid",
|
|
32
|
+
droid: "factory-droid",
|
|
33
|
+
factory: "factory-droid",
|
|
34
|
+
fx: "fx",
|
|
35
|
+
hermes: "hermes",
|
|
36
|
+
"hermes-agent": "hermes",
|
|
37
|
+
junie: "junie",
|
|
38
|
+
"kilo-code": "kilo-code",
|
|
39
|
+
kilo: "kilo-code",
|
|
40
|
+
"kimi-code": "kimi-code",
|
|
41
|
+
kimi: "kimi-code",
|
|
42
|
+
"kimi-code-cli": "kimi-code",
|
|
43
|
+
"kiro-cli": "kiro-cli",
|
|
44
|
+
kiro: "kiro-cli",
|
|
45
|
+
pi: "pi"
|
|
29
46
|
};
|
|
30
47
|
function listMcpAgentIds() {
|
|
31
|
-
return getAgentTypes();
|
|
48
|
+
return getAgentTypes().filter(isSupportedAgent);
|
|
32
49
|
}
|
|
33
50
|
function getAgentDisplayName(id) {
|
|
34
51
|
return agents[id].displayName;
|
|
@@ -48,7 +65,10 @@ function resolveAddMcpAgentId(rawAgent) {
|
|
|
48
65
|
return resolved;
|
|
49
66
|
}
|
|
50
67
|
async function detectInstalledAgents() {
|
|
51
|
-
return detectGlobalAgents();
|
|
68
|
+
return (await detectGlobalAgents()).filter(isSupportedAgent);
|
|
69
|
+
}
|
|
70
|
+
function detectProjectAgents(cwd) {
|
|
71
|
+
return detectProjectAgents$1(cwd).filter(isSupportedAgent);
|
|
52
72
|
}
|
|
53
73
|
function uniqueAgentIds(ids) {
|
|
54
74
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -60,4 +80,4 @@ function uniqueAgentIds(ids) {
|
|
|
60
80
|
}
|
|
61
81
|
return out;
|
|
62
82
|
}
|
|
63
|
-
export { agentSupportsHttpMcp, agentSupportsProjectMcp, detectInstalledAgents, getAgentDisplayName, listMcpAgentIds, resolveAddMcpAgentId, tryResolveAddMcpAgentId, uniqueAgentIds };
|
|
83
|
+
export { agentSupportsHttpMcp, agentSupportsProjectMcp, detectInstalledAgents, detectProjectAgents, getAgentDisplayName, listMcpAgentIds, resolveAddMcpAgentId, tryResolveAddMcpAgentId, uniqueAgentIds };
|
package/dist/mcp/install.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { getCliName } from "../utils/cli_name.js";
|
|
2
|
+
import { chmodSync, existsSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { basename, dirname, join, relative } from "node:path";
|
|
4
4
|
import { execFileSync } from "node:child_process";
|
|
5
|
+
import { agents, upsertServer } from "add-mcp";
|
|
6
|
+
import { parse } from "jsonc-parser";
|
|
5
7
|
// src/mcp/install.ts
|
|
6
8
|
const NEON_MCP_URL = "https://mcp.neon.tech/mcp";
|
|
7
9
|
const NEON_MCP_NAME = "Neon";
|
|
@@ -45,6 +47,7 @@ function neonMcpUrl(options = {}) {
|
|
|
45
47
|
}
|
|
46
48
|
const BEARER_RE = /Bearer\s+([^\s"]+)/i;
|
|
47
49
|
function nestedValue(root, key) {
|
|
50
|
+
if (key === "") return root;
|
|
48
51
|
let current = root;
|
|
49
52
|
for (const part of key.split(".")) {
|
|
50
53
|
if (!current || typeof current !== "object" || Array.isArray(current)) return;
|
|
@@ -77,35 +80,50 @@ function neonApiKeyFromFile(path, configKey) {
|
|
|
77
80
|
} catch {
|
|
78
81
|
return;
|
|
79
82
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
83
|
+
const errors = [];
|
|
84
|
+
const parsed = parse(raw, errors, { allowTrailingComma: true });
|
|
85
|
+
if (errors.length === 0) return bearerFromNeonMcpConfig(neonServers(nestedValue(parsed, configKey)));
|
|
86
|
+
const neonBlock = raw.match(/\[mcp_servers\.Neon\][\s\S]*?(?=\n\[|$)/)?.[0];
|
|
87
|
+
if (!neonBlock) return;
|
|
88
|
+
const url = neonBlock.match(/^url\s*=\s*"([^"]*)"/m)?.[1];
|
|
89
|
+
if (!url || !isNeonMcpUrl(url)) return;
|
|
90
|
+
return BEARER_RE.exec(neonBlock)?.[1];
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Claude Code installs first so that a GitHub Copilot CLI install in the same run resolves to
|
|
94
|
+
* the `.mcp.json` Claude Code creates, rather than to `.github/mcp.json`.
|
|
95
|
+
*/
|
|
96
|
+
function mcpInstallOrder(selected) {
|
|
97
|
+
return [...selected.filter((agent) => agent === "claude-code"), ...selected.filter((agent) => agent !== "claude-code")];
|
|
89
98
|
}
|
|
90
|
-
|
|
99
|
+
/** The file add-mcp's `upsertServer` writes for this agent when `selected` install in `mcpInstallOrder`. */
|
|
100
|
+
function configPathFor(agent, scope, cwd, selected) {
|
|
91
101
|
const spec = agents[agent];
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
102
|
+
const local = scope === "project";
|
|
103
|
+
if (local && !spec.localConfigPath) return;
|
|
104
|
+
if (local && agent === "github-copilot-cli" && selected.includes("claude-code")) return join(cwd, ".mcp.json");
|
|
105
|
+
if (spec.resolveConfigPath) return spec.resolveConfigPath(spec, {
|
|
106
|
+
local,
|
|
107
|
+
cwd
|
|
108
|
+
});
|
|
109
|
+
return local && spec.localConfigPath ? join(cwd, spec.localConfigPath) : spec.configPath;
|
|
97
110
|
}
|
|
98
|
-
|
|
111
|
+
/** Where an existing Neon entry can sit, depending on the file's current layout. */
|
|
112
|
+
function configKeysFor(agent, scope) {
|
|
99
113
|
const spec = agents[agent];
|
|
100
|
-
if (
|
|
101
|
-
return
|
|
114
|
+
if (agent === "opencode") return ["mcp.servers", "mcp"];
|
|
115
|
+
if (agent === "github-copilot-cli" && scope === "project") return ["mcpServers", ""];
|
|
116
|
+
if (scope === "project" && spec.localConfigKey) return [spec.localConfigKey];
|
|
117
|
+
return [spec.configKey];
|
|
102
118
|
}
|
|
103
119
|
function existingNeonApiKey(options) {
|
|
104
120
|
for (const agent of options.agents) {
|
|
105
|
-
const path = configPathFor(agent, options.scope, options.cwd);
|
|
121
|
+
const path = configPathFor(agent, options.scope, options.cwd, options.agents);
|
|
106
122
|
if (!path) continue;
|
|
107
|
-
const
|
|
108
|
-
|
|
123
|
+
for (const configKey of configKeysFor(agent, options.scope)) {
|
|
124
|
+
const key = neonApiKeyFromFile(path, configKey);
|
|
125
|
+
if (key) return key;
|
|
126
|
+
}
|
|
109
127
|
}
|
|
110
128
|
}
|
|
111
129
|
function isTrackedByGit(cwd, relativePath) {
|
|
@@ -129,15 +147,31 @@ function isTrackedByGit(cwd, relativePath) {
|
|
|
129
147
|
}
|
|
130
148
|
function trackedProjectMcpConfig(options) {
|
|
131
149
|
for (const agent of options.agents) {
|
|
132
|
-
const
|
|
133
|
-
if (!
|
|
150
|
+
const path = configPathFor(agent, "project", options.cwd, options.agents);
|
|
151
|
+
if (!path) continue;
|
|
152
|
+
const relativePath = relative(options.cwd, path);
|
|
134
153
|
if (isTrackedByGit(options.cwd, relativePath)) return relativePath;
|
|
135
154
|
}
|
|
136
155
|
}
|
|
137
|
-
function mcpUnsupportedReason(agent, scope) {
|
|
156
|
+
function mcpUnsupportedReason(agent, scope, auth) {
|
|
138
157
|
const spec = agents[agent];
|
|
139
158
|
if (!spec.supportedTransports.includes("http")) return spec.unsupportedTransportMessage ?? `${spec.displayName} does not support remote HTTP MCP servers.`;
|
|
140
159
|
if (scope === "project" && !spec.localConfigPath) return `${spec.displayName} does not support project-level MCP config.`;
|
|
160
|
+
if (agent === "fx" && auth === "api-key") return `fx does not accept an API key in its MCP config. Run \`${getCliName()} mcp --oauth --agent fx\`.`;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* add-mcp refuses a project-level Claude Code install while `.github/mcp.json` exists without
|
|
164
|
+
* `.mcp.json`, because GitHub Copilot CLI reads `.mcp.json` first once it exists. Neon writes
|
|
165
|
+
* Claude Code's file anyway, so it creates `.mcp.json` before calling add-mcp.
|
|
166
|
+
*/
|
|
167
|
+
function createClaudeProjectConfig(cwd) {
|
|
168
|
+
const path = join(cwd, ".mcp.json");
|
|
169
|
+
if (existsSync(path) || !existsSync(join(cwd, ".github", "mcp.json"))) return;
|
|
170
|
+
writeFileSync(path, "{\n \"mcpServers\": {}\n}\n");
|
|
171
|
+
return path;
|
|
172
|
+
}
|
|
173
|
+
function errorMessage(err) {
|
|
174
|
+
return err instanceof Error ? err.message : String(err);
|
|
141
175
|
}
|
|
142
176
|
function gitignoreProjectConfig(path) {
|
|
143
177
|
const dir = dirname(path);
|
|
@@ -171,7 +205,7 @@ function redactSecrets(text) {
|
|
|
171
205
|
function installNeonMcpServer(options) {
|
|
172
206
|
const auth = options.auth ?? { kind: "oauth" };
|
|
173
207
|
const url = options.url ?? "https://mcp.neon.tech/mcp";
|
|
174
|
-
const unsupported = mcpUnsupportedReason(options.agent, options.scope);
|
|
208
|
+
const unsupported = mcpUnsupportedReason(options.agent, options.scope, auth.kind);
|
|
175
209
|
if (unsupported) return {
|
|
176
210
|
ok: false,
|
|
177
211
|
unsupported: true,
|
|
@@ -185,10 +219,41 @@ function installNeonMcpServer(options) {
|
|
|
185
219
|
type: "http",
|
|
186
220
|
url
|
|
187
221
|
};
|
|
222
|
+
const cwd = options.cwd ?? process.cwd();
|
|
223
|
+
let created;
|
|
224
|
+
if (options.agent === "claude-code" && options.scope === "project") try {
|
|
225
|
+
created = createClaudeProjectConfig(cwd);
|
|
226
|
+
} catch (err) {
|
|
227
|
+
return {
|
|
228
|
+
ok: false,
|
|
229
|
+
unsupported: false,
|
|
230
|
+
error: `Could not create ${join(cwd, ".mcp.json")}: ${errorMessage(err)}`
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
if (options.scope === "project" && auth.kind === "api-key") {
|
|
234
|
+
const tracked = trackedProjectMcpConfig({
|
|
235
|
+
agents: [options.agent],
|
|
236
|
+
cwd
|
|
237
|
+
});
|
|
238
|
+
if (tracked) return {
|
|
239
|
+
ok: false,
|
|
240
|
+
unsupported: false,
|
|
241
|
+
error: `${tracked} is tracked by git. Untrack it before writing an API key, or pass --oauth.`
|
|
242
|
+
};
|
|
243
|
+
}
|
|
188
244
|
const result = upsertServer(options.agent, NEON_MCP_NAME, server, {
|
|
189
245
|
local: options.scope === "project",
|
|
190
|
-
cwd
|
|
246
|
+
cwd
|
|
191
247
|
});
|
|
248
|
+
if (!result.success && created) try {
|
|
249
|
+
rmSync(created, { force: true });
|
|
250
|
+
} catch (err) {
|
|
251
|
+
return {
|
|
252
|
+
ok: false,
|
|
253
|
+
unsupported: false,
|
|
254
|
+
error: `${redactSecrets(result.error ?? "Failed to write Neon MCP server config")} Could not remove ${created}: ${errorMessage(err)}`
|
|
255
|
+
};
|
|
256
|
+
}
|
|
192
257
|
if (result.success) {
|
|
193
258
|
if (auth.kind === "api-key") {
|
|
194
259
|
const paths = [result.path, ...result.extraPaths ?? []];
|
|
@@ -212,4 +277,4 @@ function installNeonMcpServer(options) {
|
|
|
212
277
|
error: redactSecrets(result.error ?? "Failed to write Neon MCP server config")
|
|
213
278
|
};
|
|
214
279
|
}
|
|
215
|
-
export { NEON_MCP_CATEGORIES, NEON_MCP_NAME, NEON_MCP_URL, existingNeonApiKey, installNeonMcpServer, isMcpCategory, isNeonMcpUrl, mcpUnsupportedReason, neonMcpUrl, parseMcpCategories, trackedProjectMcpConfig };
|
|
280
|
+
export { NEON_MCP_CATEGORIES, NEON_MCP_NAME, NEON_MCP_URL, existingNeonApiKey, installNeonMcpServer, isMcpCategory, isNeonMcpUrl, mcpInstallOrder, mcpUnsupportedReason, neonMcpUrl, parseMcpCategories, trackedProjectMcpConfig };
|
package/dist/mcp/targets.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { detectInstalledAgents, listMcpAgentIds, resolveAddMcpAgentId, uniqueAgentIds } from "./agents.js";
|
|
1
|
+
import { detectInstalledAgents, detectProjectAgents, listMcpAgentIds, resolveAddMcpAgentId, uniqueAgentIds } from "./agents.js";
|
|
2
2
|
import { mcpUnsupportedReason } from "./install.js";
|
|
3
|
-
import { detectProjectAgents } from "add-mcp";
|
|
4
3
|
// src/mcp/targets.ts
|
|
5
4
|
function mcpInstallableAgents(scope) {
|
|
6
5
|
return listMcpAgentIds().filter((id) => mcpUnsupportedReason(id, scope) === void 0);
|
|
@@ -14,7 +13,7 @@ function resolveInstallTargets(options) {
|
|
|
14
13
|
const install = [];
|
|
15
14
|
const skipped = [];
|
|
16
15
|
for (const agent of requested) {
|
|
17
|
-
const error = mcpUnsupportedReason(agent, options.scope);
|
|
16
|
+
const error = mcpUnsupportedReason(agent, options.scope, options.auth);
|
|
18
17
|
if (error) skipped.push({
|
|
19
18
|
agent,
|
|
20
19
|
error
|
package/dist/plugins/run.js
CHANGED
package/dist/plugins/targets.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { detectInstalledAgents, listMcpAgentIds, tryResolveAddMcpAgentId, uniqueAgentIds } from "../mcp/agents.js";
|
|
1
|
+
import { detectInstalledAgents, detectProjectAgents, listMcpAgentIds, tryResolveAddMcpAgentId, uniqueAgentIds } from "../mcp/agents.js";
|
|
2
2
|
import "../init/agents.js";
|
|
3
3
|
import { pluginsChildEnv } from "./child_env.js";
|
|
4
4
|
import { delimiter, dirname, join, resolve } from "node:path";
|
|
5
|
-
import { detectProjectAgents } from "add-mcp";
|
|
6
5
|
import { spawnSync } from "node:child_process";
|
|
7
6
|
import which from "which";
|
|
8
7
|
// src/plugins/targets.ts
|
|
@@ -29,13 +28,15 @@ const PLUGINS_TARGET_BY_TYPE = {
|
|
|
29
28
|
product: "Grok Build",
|
|
30
29
|
versionPrefix: "grok"
|
|
31
30
|
}
|
|
32
|
-
}
|
|
31
|
+
},
|
|
32
|
+
"kimi-code": { target: "kimi" }
|
|
33
33
|
};
|
|
34
34
|
const pluginsTargets = () => [...new Set(Object.values(PLUGINS_TARGET_BY_TYPE))];
|
|
35
35
|
const USER_SCOPE_ONLY_TARGETS = /* @__PURE__ */ new Set([
|
|
36
36
|
"vscode",
|
|
37
37
|
"github-copilot",
|
|
38
|
-
"grok"
|
|
38
|
+
"grok",
|
|
39
|
+
"kimi"
|
|
39
40
|
]);
|
|
40
41
|
/** npx runs the plugins CLI with every `node_modules/.bin` from `cwd` up to the root ahead of PATH. */
|
|
41
42
|
const pluginsCommandSearchPath = (cwd, path) => {
|
package/dist/skills/catalog.js
CHANGED
|
@@ -33,16 +33,6 @@ const NEON_SKILL_CATALOG = [
|
|
|
33
33
|
source: AGENT_SKILLS_SOURCE,
|
|
34
34
|
defaultSelected: true
|
|
35
35
|
},
|
|
36
|
-
{
|
|
37
|
-
skill: "neon-postgres-branches",
|
|
38
|
-
source: AGENT_SKILLS_SOURCE,
|
|
39
|
-
defaultSelected: true
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
skill: "neon-postgres-egress-optimizer",
|
|
43
|
-
source: AGENT_SKILLS_SOURCE,
|
|
44
|
-
defaultSelected: true
|
|
45
|
-
},
|
|
46
36
|
{
|
|
47
37
|
skill: "neon-realtime",
|
|
48
38
|
source: AGENT_SKILLS_SOURCE,
|
package/dist/skills/targets.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { detectInstalledAgents, listMcpAgentIds, uniqueAgentIds } from "../mcp/agents.js";
|
|
1
|
+
import { detectInstalledAgents, detectProjectAgents, listMcpAgentIds, uniqueAgentIds } from "../mcp/agents.js";
|
|
2
2
|
import { getSkillsAgentName, supportsSkills } from "../init/agents.js";
|
|
3
|
-
import { detectProjectAgents } from "add-mcp";
|
|
4
3
|
// src/skills/targets.ts
|
|
5
4
|
const skillsInstallableAgents = () => listMcpAgentIds().filter((id) => supportsSkills(id));
|
|
6
5
|
const detectSkillsAgents = async (options) => {
|
package/dist/update_notifier.js
CHANGED
|
@@ -7,8 +7,8 @@ import { existsSync, readFileSync, realpathSync } from "node:fs";
|
|
|
7
7
|
import { basename, dirname, join } from "node:path";
|
|
8
8
|
import { fileURLToPath } from "node:url";
|
|
9
9
|
import { spawn } from "node:child_process";
|
|
10
|
-
import which from "which";
|
|
11
10
|
import semver from "semver";
|
|
11
|
+
import which from "which";
|
|
12
12
|
// src/update_notifier.ts
|
|
13
13
|
const DAY_MS = 864e5;
|
|
14
14
|
const CHECK_INTERVAL_MS = DAY_MS;
|
|
@@ -68,7 +68,7 @@ const buildAiGatewayNotice = ({ subscriptionType, modelIds, upgradeUrl, moreMode
|
|
|
68
68
|
};
|
|
69
69
|
if (modelIds !== void 0 && modelIds.length > 0 && !hasFlagshipModels(modelIds)) return {
|
|
70
70
|
level: "warning",
|
|
71
|
-
message: `
|
|
71
|
+
message: `Not every model is enabled for your account yet, so some models are missing from the catalog. Request access to more models here: ${moreModelsUrl}`
|
|
72
72
|
};
|
|
73
73
|
return null;
|
|
74
74
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "neon",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.16.1",
|
|
4
4
|
"description": "CLI tool for Neon, the cloud backend primitives built around Lakebase Postgres",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"neon",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@clack/prompts": "0.10.1",
|
|
47
47
|
"@hono/node-server": "2.0.4",
|
|
48
48
|
"@segment/analytics-node": "1.3.0",
|
|
49
|
-
"add-mcp": "2.
|
|
49
|
+
"add-mcp": "2.6.0",
|
|
50
50
|
"ajv": "^8.20.0",
|
|
51
51
|
"ajv-formats": "^3.0.1",
|
|
52
52
|
"chalk": "5.3.0",
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
"diff": "5.2.0",
|
|
56
56
|
"execa": "^9.5.2",
|
|
57
57
|
"fflate": "^0.8.3",
|
|
58
|
+
"jsonc-parser": "3.3.1",
|
|
58
59
|
"open": "^10.2.0",
|
|
59
60
|
"openid-client": "6.8.1",
|
|
60
61
|
"pg": "^8.20.0",
|
|
@@ -72,10 +73,10 @@
|
|
|
72
73
|
"yaml": "^2.9.0",
|
|
73
74
|
"yargs": "17.7.2",
|
|
74
75
|
"yoctocolors": "^2.1.2",
|
|
75
|
-
"@neon/config": "1.
|
|
76
|
+
"@neon/config-runtime": "1.11.0",
|
|
76
77
|
"@neon/realtime": "0.1.2",
|
|
77
78
|
"@neon/sdk": "7.7.0",
|
|
78
|
-
"@neon/config
|
|
79
|
+
"@neon/config": "1.10.0"
|
|
79
80
|
},
|
|
80
81
|
"optionalDependencies": {
|
|
81
82
|
"@napi-rs/keyring": "1.3.0",
|
|
@@ -111,11 +112,11 @@
|
|
|
111
112
|
"tsx": "4.22.3",
|
|
112
113
|
"typescript": "^5.9.0",
|
|
113
114
|
"vitest": "^3.0.9",
|
|
114
|
-
"@neon-internals/cli-core": "0.0.0",
|
|
115
115
|
"@neon-internals/env-core": "0.0.38",
|
|
116
|
+
"@neon-internals/cli-core": "0.0.0",
|
|
116
117
|
"@neon/env": "1.6.8",
|
|
117
|
-
"@neon/
|
|
118
|
-
"@neon/
|
|
118
|
+
"@neon/functions": "0.11.0",
|
|
119
|
+
"@neon/e2e-harness": "0.0.0"
|
|
119
120
|
},
|
|
120
121
|
"publishConfig": {
|
|
121
122
|
"access": "public",
|
|
@@ -4,13 +4,13 @@ import { log } from "../log.js";
|
|
|
4
4
|
import { recordCommandSuccessExtras, recordScaffoldedTemplate } from "../analytics.js";
|
|
5
5
|
import { getCliName } from "../utils/cli_name.js";
|
|
6
6
|
import { helpCsv, helpEpilogue } from "../utils/help_text.js";
|
|
7
|
-
import { coerceAgentFlag } from "../utils/agent_flag.js";
|
|
8
|
-
import { assertNamedAgentTooling, chooseYesAgentTooling, initPluginAgents, initSkillsMcpAgents, postScaffoldActions, projectContextFile, resolveNamedAgents } from "../init/plan.js";
|
|
9
7
|
import { formatInstallCommand, inferPackageManager, installArgs, installedPackageManagers, resolvePackageManager, runCommand } from "../utils/package_manager.js";
|
|
10
8
|
import { writer } from "../writer.js";
|
|
11
9
|
import { FALLBACK_TEMPLATES, ensureTargetUsable, fetchTemplates, findTemplate, scaffoldTemplate, templateIds } from "../init/bootstrap.js";
|
|
12
10
|
import { agentSetupDoneLabel, formatInitDone, printInitBanner, printInitDone, shouldPrintInitBanner } from "../init/chrome.js";
|
|
13
11
|
import { runAuthenticatedLink } from "../init/link.js";
|
|
12
|
+
import { coerceAgentFlag } from "../utils/agent_flag.js";
|
|
13
|
+
import { assertNamedAgentTooling, chooseYesAgentTooling, initPluginAgents, initSkillsMcpAgents, postScaffoldActions, projectContextFile, resolveNamedAgents } from "../init/plan.js";
|
|
14
14
|
import { formatTemplateTitle } from "../init/template_title.js";
|
|
15
15
|
import { pickAgentSetupInteractively, pickInitLinkInteractively } from "../init/wizard.js";
|
|
16
16
|
import { runAgentTooling } from "../init/tooling.js";
|
|
@@ -7,9 +7,9 @@ import { deprecatedServiceMessage, parseServices, servicesFlagValue, servicesOpt
|
|
|
7
7
|
import { mergeEnvFile, readEnvFile, resolveEnvFilePath } from "../env_file.js";
|
|
8
8
|
import { t as NEON_ENV_VAR_KEYS, u as isFunctionBaseUrlKey } from "./env-JgoSsmyt.js";
|
|
9
9
|
import { ENV_PULL_KEY_HELP, ENV_PULL_SERVICES, envKeysForSelection, envPullFlagValue, ownedEnvServiceKeys, parseEnvPullKeys } from "../env_services.js";
|
|
10
|
-
import { i as dropClaimableUnsupported, o as resolveNeonEnvVars } from "./env-CIFMBEon.js";
|
|
11
10
|
import { fillSingleProject, resolveBranchRef } from "../utils/enrichers.js";
|
|
12
11
|
import { warnAiGateway } from "../utils/ai_gateway_notice.js";
|
|
12
|
+
import { i as dropClaimableUnsupported, o as resolveNeonEnvVars } from "./env-CIFMBEon.js";
|
|
13
13
|
import { formatPulledEnv, pulledBranch } from "../commands/env_output.js";
|
|
14
14
|
import { existsSync } from "node:fs";
|
|
15
15
|
import chalk from "chalk";
|
|
@@ -2,13 +2,13 @@ import { t as __exportAll } from "./rolldown-runtime-BJohB4LM.js";
|
|
|
2
2
|
import { log } from "../log.js";
|
|
3
3
|
import { recordCommandSuccessExtras } from "../analytics.js";
|
|
4
4
|
import { helpCsv, helpEpilogue } from "../utils/help_text.js";
|
|
5
|
+
import { writer } from "../writer.js";
|
|
6
|
+
import { noPassthrough } from "../utils/flags.js";
|
|
5
7
|
import { getAgentDisplayName } from "../mcp/agents.js";
|
|
6
|
-
import { NEON_MCP_URL } from "../mcp/install.js";
|
|
7
8
|
import "../init/agents.js";
|
|
8
9
|
import { pluginsCommandProblemText, pluginsInstallableAgents } from "../plugins/targets.js";
|
|
9
|
-
import { writer } from "../writer.js";
|
|
10
|
-
import { noPassthrough } from "../utils/flags.js";
|
|
11
10
|
import { AGENT_PLUGIN_SKIP_MESSAGE } from "../init/copy.js";
|
|
11
|
+
import { NEON_MCP_URL } from "../mcp/install.js";
|
|
12
12
|
import { canPickAgentsInteractively, skippableAgentPicker } from "../utils/agent_picker.js";
|
|
13
13
|
import { resolvePluginsPlan } from "../plugins/plan.js";
|
|
14
14
|
import { NEON_PLUGIN_NAME, PLUGIN_SKILLS, PLUGIN_SOURCE, neonPluginsRetryCommand, pluginsAddArgs, runPluginsCli } from "../plugins/run.js";
|
|
@@ -2,12 +2,12 @@ import { t as __exportAll } from "./rolldown-runtime-BJohB4LM.js";
|
|
|
2
2
|
import { log } from "../log.js";
|
|
3
3
|
import { recordCommandSuccessExtras } from "../analytics.js";
|
|
4
4
|
import { helpCsv, helpEpilogue } from "../utils/help_text.js";
|
|
5
|
-
import { getAgentDisplayName } from "../mcp/agents.js";
|
|
6
|
-
import "../init/agents.js";
|
|
7
|
-
import { mappedSkillsAgentNames, skillsInstallableAgents } from "../skills/targets.js";
|
|
8
5
|
import { writer } from "../writer.js";
|
|
9
6
|
import { noPassthrough } from "../utils/flags.js";
|
|
7
|
+
import { getAgentDisplayName } from "../mcp/agents.js";
|
|
8
|
+
import "../init/agents.js";
|
|
10
9
|
import { AGENT_SKILLS_SKIP_MESSAGE } from "../init/copy.js";
|
|
10
|
+
import { mappedSkillsAgentNames, skillsInstallableAgents } from "../skills/targets.js";
|
|
11
11
|
import { canPickAgentsInteractively, skippableAgentPicker } from "../utils/agent_picker.js";
|
|
12
12
|
import { skillsHelpValues, skillsYesHelp } from "../skills/catalog.js";
|
|
13
13
|
import { lockPath, neonSkillsUpdateCommand, readLockedSkills, refreshSkillsCheckCache, scopeLabel, skillsCheckCachePath, skillsStatusRows } from "../skills/freshness.js";
|