neon 8.15.1 → 8.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +6 -4
  2. package/dist/_chunks/{checkout-BpOcFaAi.js → checkout-CNBIS3gA.js} +3 -3
  3. package/dist/_chunks/{claim-DlLZmcq0.js → claim-m5sIJdm5.js} +1 -1
  4. package/dist/_chunks/{config-BjCm5cfr.js → config-CgtJH8xE.js} +1 -1
  5. package/dist/_chunks/{databases-DC2h6IW2.js → databases-B2Yapqme.js} +9 -4
  6. package/dist/_chunks/{deploy-DmEEhux0.js → deploy-Bs5gmi4Q.js} +1 -1
  7. package/dist/_chunks/{dev-DlUJFzRs.js → dev-DxiIp4c9.js} +3 -3
  8. package/dist/_chunks/{functions-3ypiRwZK.js → functions-PHaU-kRb.js} +1 -1
  9. package/dist/_chunks/{git-j6xSVo3e.js → git-DRUZBCmZ.js} +2 -2
  10. package/dist/_chunks/{link-nAiuWKfg.js → link-CNO-HxHN.js} +2 -2
  11. package/dist/_chunks/{mcp-BznTRK3w.js → mcp-SvqWzHnT.js} +6 -4
  12. package/dist/_chunks/{roles-xRuu0462.js → roles-BVc69rjG.js} +9 -4
  13. package/dist/_chunks/{status-BC4XXuuE.js → status-BlrzeKyA.js} +1 -1
  14. package/dist/commands/bootstrap.js +1 -1
  15. package/dist/commands/checkout.js +1 -1
  16. package/dist/commands/claim.js +1 -1
  17. package/dist/commands/config.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/deploy.js +1 -1
  20. package/dist/commands/dev.js +1 -1
  21. package/dist/commands/env.js +1 -1
  22. package/dist/commands/functions.js +1 -1
  23. package/dist/commands/functions_new.js +1 -1
  24. package/dist/commands/git.js +1 -1
  25. package/dist/commands/index.js +16 -16
  26. package/dist/commands/link.js +1 -1
  27. package/dist/commands/mcp.js +1 -1
  28. package/dist/commands/plugins.js +1 -1
  29. package/dist/commands/roles.js +1 -1
  30. package/dist/commands/skills.js +1 -1
  31. package/dist/commands/status.js +1 -1
  32. package/dist/commands/subscribe.js +1 -1
  33. package/dist/index.js +1 -1
  34. package/dist/init/agents.js +11 -3
  35. package/dist/init/auth.js +2 -2
  36. package/dist/init/detect.js +1 -2
  37. package/dist/init/link.js +1 -1
  38. package/dist/init/plan.js +2 -63
  39. package/dist/init/run.js +7 -7
  40. package/dist/init/tooling.js +5 -5
  41. package/dist/init/unknown_agent_arg.js +63 -0
  42. package/dist/init/wizard.js +2 -2
  43. package/dist/mcp/agents.js +25 -5
  44. package/dist/mcp/install.js +95 -30
  45. package/dist/mcp/targets.js +2 -3
  46. package/dist/plugins/targets.js +5 -4
  47. package/dist/skills/targets.js +1 -2
  48. package/dist/update_notifier.js +1 -1
  49. package/dist/utils/ai_gateway_notice.js +1 -1
  50. package/package.json +7 -6
  51. package/dist/_chunks/{bootstrap-BDkvsAVJ.js → bootstrap-vAtWRZXa.js} +2 -2
  52. package/dist/_chunks/{env-BOt9AZ1j.js → env-BtG4vH55.js} +1 -1
  53. package/dist/_chunks/{plugins-B2Gym8Lw.js → plugins-7cxVcgay.js} +3 -3
  54. package/dist/_chunks/{skills-DKgafm65.js → skills-Bv8oKKwE.js} +3 -3
package/README.md CHANGED
@@ -951,7 +951,9 @@ On a TTY the command asks for config location (global is the default), then agen
951
951
 
952
952
  `-y` skips those questions. `neon mcp -y` writes `https://mcp.neon.tech/mcp` into global config for globally installed apps, else the host CLI agent, reuses an existing Neon MCP API key or mints an account-wide key, leaves write tools enabled, exposes every tool category, and does not pin a project (including from `.neon`). `--agent`, `--project`, `--oauth`, `--read-only`, `--project-id` and `--category` still apply with `-y`. `--read-only` and `--category` are flags only and are never prompted. A linked project-folder install asks whether to pin MCP tools to that `.neon` project (`?projectId=`). If you pin and selected API-key auth, the minted key is limited to that project too. An unlinked project folder does not ask. Global installs never add that param unless you pass `--project-id`. Without a TTY, pass `-y` to mint into every detected agent, `--agent <name>` to name them, or `--oauth` to write the URL only. If `-y` finds no agent, it exits: pass `--agent <name>`, run from a supported agent, or omit `-y` in a terminal to pick. `neon mcp --help` lists the server URL, those `-y` defaults, the supported agent names, and the `--category` values.
953
953
 
954
- Supported agents: `antigravity`, `cline`, `cline-cli`, `claude-code`, `codex`, `cursor`, `gemini-cli`, `goose`, `github-copilot-cli`, `grok-build`, `mcporter`, `opencode`, `vscode`, `windsurf`, `zed`. Project installs drop `antigravity`, `cline`, `cline-cli`, `goose` and `windsurf`. `claude-desktop` is a known name that is then skipped.
954
+ Supported agents: `antigravity`, `cline`, `cline-cli`, `claude-code`, `codex`, `cursor`, `factory-droid`, `fx`, `gemini-cli`, `goose`, `github-copilot-cli`, `grok-build`, `hermes`, `junie`, `kilo-code`, `kimi-code`, `kiro-cli`, `mcporter`, `opencode`, `pi`, `vscode`, `windsurf`, `zed`. Project installs drop `antigravity`, `cline`, `cline-cli`, `fx`, `goose`, `hermes` and `windsurf`. `claude-desktop` is a known name that is then skipped. fx only takes `--oauth`; with an API key it is skipped. Pi reads MCP servers through [`pi-mcp-adapter`](https://github.com/nicobailon/pi-mcp-adapter) (`pi install npm:pi-mcp-adapter`).
955
+
956
+ GitHub Copilot CLI project installs write into `.mcp.json`, or into `.github/mcp.json` when only that file exists. Claude Code project installs always write `.mcp.json`. Copilot CLI reads `.mcp.json` first, so once that file exists it no longer reads `.github/mcp.json`.
955
957
 
956
958
  The default mints an account-wide API key (or reuses the Bearer already configured for Neon at `https://mcp.neon.tech/mcp`) and writes it into each selected agent's config. That key reaches everything the account can, in every organization. Revoke it with `neon api-keys revoke <id>`. `--oauth` writes the URL with no `Authorization` header; the agent signs in on first use. `--project` writes into the project config (`.cursor/mcp.json` and similar). `--read-only` adds `?readonly=true`. `--project-id` adds `?projectId=` and, when a key is minted, limits that key to the named project. Accepting the linked-project pin does the same. Revoke a project-scoped key with `neon api-keys revoke <id> --org-id <org>`. A reused Bearer keeps the scope it already has. `--category` adds `?category=` (repeatable or comma-separated: `projects`, `branches`, `schema`, `querying`, `neon_auth`, `data_api`, `observability`, `docs`). `--read-only` and `--category` restrict which MCP tools the server exposes; they do not change what the minted key can do.
957
959
 
@@ -996,7 +998,7 @@ On a TTY the command asks which agents and which skills, then installs. Detected
996
998
 
997
999
  `--skill` names by source repo: `neondatabase/agent-skills` (`neon`, `neon-ai-gateway`, `neon-auth`, `neon-functions`, `neon-object-storage`, `neon-postgres`, `neon-postgres-branches`, `neon-postgres-egress-optimizer`, `neon-realtime`); `neondatabase/neon-for-agent-platforms` (`neon-postgres-agent-platforms`).
998
1000
 
999
- Supported agents match `neon mcp`, minus agents that cannot install skills: `antigravity`, `cline`, `cline-cli`, `claude-code`, `claude-desktop`, `codex`, `cursor`, `gemini-cli`, `goose`, `github-copilot-cli`, `grok-build`, `opencode`, `vscode`, `windsurf`, `zed`. `mcporter` is a known MCP name that is then skipped. `neon skills --help` lists the same skill and agent values, and that `-y` leaves out `neon-postgres-agent-platforms`.
1001
+ Supported agents match `neon mcp`, minus agents that cannot install skills: `antigravity`, `cline`, `cline-cli`, `claude-code`, `claude-desktop`, `codex`, `cursor`, `factory-droid`, `fx`, `gemini-cli`, `goose`, `github-copilot-cli`, `grok-build`, `hermes`, `junie`, `kilo-code`, `kimi-code`, `kiro-cli`, `opencode`, `pi`, `vscode`, `windsurf`, `zed`. `mcporter` is a known MCP name that is then skipped. `neon skills --help` lists the same skill and agent values, and that `-y` leaves out `neon-postgres-agent-platforms`.
1000
1002
 
1001
1003
  ## Ask the Neon assistant (`ask`)
1002
1004
 
@@ -1054,11 +1056,11 @@ On a TTY the command asks which agents, then installs. Detected agents start sel
1054
1056
 
1055
1057
  `-y` skips those questions and installs into detected agents: project-folder markers such as `.cursor`, else the agent driving the CLI. `--agent` / `-a` names coding agents and skips the agent picker. `--global -y` uses installed apps, else the host CLI agent. Without a TTY, pass `-y` or `--agent <name>`. If `-y` finds no agent, it exits: pass `--agent <name>`, run from a supported agent, or omit `-y` in a terminal to pick.
1056
1058
 
1057
- Default scope is `project`. `--global` is `user`. On macOS and Linux, Cursor and Claude Code store the plugin cache under `~/.claude/plugins`; on Windows, Cursor installs into Cursor extensions. `project` vs `user` is the scope field the plugins CLI records, not a directory in the repo. VS Code, GitHub Copilot CLI, and Grok Build only install user-level: they are skipped at the default scope with a warning, and a VS Code-only project fails if nothing else is selected. Pass `--global` for those.
1059
+ Default scope is `project`. `--global` is `user`. On macOS and Linux, Cursor and Claude Code store the plugin cache under `~/.claude/plugins`; on Windows, Cursor installs into Cursor extensions. `project` vs `user` is the scope field the plugins CLI records, not a directory in the repo. VS Code, GitHub Copilot CLI, Grok Build, and Kimi Code only install user-level: they are skipped at the default scope with a warning, and a VS Code-only project fails if nothing else is selected. Pass `--global` for those.
1058
1060
 
1059
1061
  GitHub Copilot CLI and Grok Build install through their own CLIs (`copilot`, `grok`), so `neon plugins` runs `copilot --version` or `grok --version` first. A command that is missing, fails, or (for Copilot) is older than 0.0.400 is skipped with a warning under `-y`, fails an explicit `--agent`, and in `neon init` gets Neon skills and MCP instead of the plugin. The other agents install by writing files, so their detected config directory is enough.
1060
1062
 
1061
- Supported agents with a plugins mapping: `claude-code`, `claude-desktop`, `codex`, `cursor`, `github-copilot-cli`, `grok-build`, `vscode`. `claude-desktop` installs as Claude Code; detecting both produces one install and lists both names in the table. `mcporter` is a known MCP name that is then skipped.
1063
+ Supported agents with a plugins mapping: `claude-code`, `claude-desktop`, `codex`, `cursor`, `github-copilot-cli`, `grok-build`, `kimi-code`, `vscode`. `claude-desktop` installs as Claude Code; detecting both produces one install and lists both names in the table. `mcporter` is a known MCP name that is then skipped.
1062
1064
 
1063
1065
  The plugins CLI installs every plugin it finds in the Neon plugin package. Today that is `neon-postgres` from `neondatabase/agent-skills`. It includes the Neon MCP server (`https://mcp.neon.tech/mcp`) and these skills: `neon`, `neon-ai-gateway`, `neon-auth`, `neon-functions`, `neon-object-storage`, `neon-postgres`, `neon-postgres-branches`, `neon-postgres-egress-optimizer`, `neon-realtime`. It does not include `neon-postgres-agent-platforms`.
1064
1066
 
@@ -11,9 +11,9 @@ import { looksLikeBranchId } from "../utils/formats.js";
11
11
  import { fillSingleProject, listAllProjectBranches } from "../utils/enrichers.js";
12
12
  import { buildCheckoutEvent, readGitContext } from "../utils/git.js";
13
13
  import { buildHookBranch, loadHookConfig, resolveHookEnv, runCheckoutAfterHook, runCheckoutBeforeHook, runCreateAfterHook, runCreateBeforeHook } from "../utils/hooks.js";
14
- import { n as autoPullEnvAfterPin } from "./env-BOt9AZ1j.js";
15
- import { a as applyPolicyOnCreate, f as envFlag, l as createBranchFromPolicyOnCheckout } from "./config-BjCm5cfr.js";
16
- import { i as handler$1 } from "./link-nAiuWKfg.js";
14
+ import { n as autoPullEnvAfterPin } from "./env-BtG4vH55.js";
15
+ import { a as applyPolicyOnCreate, f as envFlag, l as createBranchFromPolicyOnCheckout } from "./config-CgtJH8xE.js";
16
+ import { i as handler$1 } from "./link-CNO-HxHN.js";
17
17
  import chalk from "chalk";
18
18
  import prompts from "prompts";
19
19
  // src/commands/checkout.ts
@@ -12,7 +12,7 @@ import { projectConfigPath } from "../project.js";
12
12
  import { resolveEnvFilePath } from "../env_file.js";
13
13
  import { writer } from "../writer.js";
14
14
  import { noPassthrough } from "../utils/flags.js";
15
- import { c as pull } from "./env-BOt9AZ1j.js";
15
+ import { c as pull } from "./env-BtG4vH55.js";
16
16
  import { existsSync, readFileSync, unlinkSync, writeFileSync } from "node:fs";
17
17
  import open from "open";
18
18
  import prompts from "prompts";
@@ -26,7 +26,7 @@ import { readGitContext } from "../utils/git.js";
26
26
  import { resolveHookEnv, runDeployAfterHook, runDeployBeforeHook } from "../utils/hooks.js";
27
27
  import { pickServicesInteractively } from "../utils/service_picker.js";
28
28
  import { zipBundle } from "../utils/zip.js";
29
- import { n as autoPullEnvAfterPin } from "./env-BOt9AZ1j.js";
29
+ import { n as autoPullEnvAfterPin } from "./env-BtG4vH55.js";
30
30
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
31
31
  import { dirname, join, relative, resolve } from "node:path";
32
32
  import chalk from "chalk";
@@ -1,4 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BJohB4LM.js";
2
+ import { log } from "../log.js";
2
3
  import { retryOnLock } from "../api.js";
3
4
  import { writer } from "../writer.js";
4
5
  import { fillSingleProject, resolveBranchFromProps } from "../utils/enrichers.js";
@@ -75,9 +76,13 @@ const create = async (props) => {
75
76
  const deleteDb = async (props) => {
76
77
  const { branchId, branch } = await resolveBranchFromProps(props);
77
78
  const { data } = await retryOnLock(() => props.apiClient.deleteProjectBranchDatabase(props.projectId, branchId, props.database));
78
- if (data) writer(props).end(data.database, {
79
- fields: DATABASE_FIELDS,
80
- humanTitle: `Database deleted from ${branch?.name ?? branchId}`
81
- });
79
+ if (data) {
80
+ writer(props).end(data.database, {
81
+ fields: DATABASE_FIELDS,
82
+ humanTitle: `Database deleted from ${branch?.name ?? branchId}`
83
+ });
84
+ return;
85
+ }
86
+ log.info(`Database "${props.database}" not found on branch ${branch?.name ?? branchId}; nothing to delete.`);
82
87
  };
83
88
  export { create as a, describe as c, command as i, handler as l, aliases as n, databases_exports as o, builder as r, deleteDb as s, DATABASE_FIELDS as t, list as u };
@@ -1,6 +1,6 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BJohB4LM.js";
2
2
  import { fillSingleProject } from "../utils/enrichers.js";
3
- import { f as envFlag, i as applyFlags, p as envPullFlag, r as applyCmd } from "./config-BjCm5cfr.js";
3
+ import { f as envFlag, i as applyFlags, p as envPullFlag, r as applyCmd } from "./config-CgtJH8xE.js";
4
4
  import { DEPLOY_COMMANDS_EPILOGUE } from "../commands/deploy_help.js";
5
5
  // src/commands/deploy.ts
6
6
  var deploy_exports = /* @__PURE__ */ __exportAll({
@@ -4,12 +4,12 @@ import { isClaimableEnvTarget } from "../claimable/state.js";
4
4
  import { getCliName } from "../utils/cli_name.js";
5
5
  import { defaultDevEnvFiles, readEnvFile, resolveEnvFilePath } from "../env_file.js";
6
6
  import { l as functionBaseUrlKey } from "./env-JgoSsmyt.js";
7
+ import { branchIdResolve } from "../utils/enrichers.js";
8
+ import { bundleEntry } from "../utils/esbuild.js";
7
9
  import { a as resolveDevEnv } from "./env-CIFMBEon.js";
10
+ import { f as envFlag } from "./config-CgtJH8xE.js";
8
11
  import { findConfigFunctionBySource, resolveFunctionsFromConfig } from "../dev/functions.js";
9
12
  import { resolveWatchInputs } from "../dev/inputs.js";
10
- import { branchIdResolve } from "../utils/enrichers.js";
11
- import { bundleEntry } from "../utils/esbuild.js";
12
- import { f as envFlag } from "./config-BjCm5cfr.js";
13
13
  import { existsSync, mkdirSync, rmSync, statSync, writeFileSync } from "node:fs";
14
14
  import { basename, dirname, join, relative, resolve } from "node:path";
15
15
  import { fileURLToPath } from "node:url";
@@ -198,7 +198,7 @@ const builder = (argv) => argv.usage("$0 function <sub-command> [options]").opti
198
198
  describe: "Function slug",
199
199
  type: "string",
200
200
  demandOption: true
201
- }), (args) => deleteFn(args)).command(["domains", "domain"], "Manage custom domains on the branch (beta)", (yargs) => yargs.command("list", "List custom domains on the branch", (yargs) => yargs, (args) => listDomains(args)).command("register <domain>", "Point a domain you already own at a function on the branch", (yargs) => yargs.positional("domain", {
201
+ }), (args) => deleteFn(args)).command(["domains", "domain"], "Manage custom domains on the branch", (yargs) => yargs.command("list", "List custom domains on the branch", (yargs) => yargs, (args) => listDomains(args)).command("register <domain>", "Point a domain you already own at a function on the branch", (yargs) => yargs.positional("domain", {
202
202
  describe: "Domain you already own (for example docs.example.com)",
203
203
  type: "string",
204
204
  demandOption: true
@@ -5,8 +5,8 @@ import { CONTEXT_FILE, contextBranch, gitBranchMap, gitBranchMapping, isUnfollow
5
5
  import { writer } from "../writer.js";
6
6
  import { neonSafeBranchName } from "../utils/branch_name.js";
7
7
  import { currentGitBranch, gitPull, gitRepoRoot, hasUpstream, installPostCheckoutHook, isGitRepo, isManagedHook, localGitBranches, postCheckoutHookPath, readGitContext, removePostCheckoutHook } from "../utils/git.js";
8
- import { o as quoteFlagValue } from "./link-nAiuWKfg.js";
9
- import { o as handler$1 } from "./checkout-BpOcFaAi.js";
8
+ import { o as quoteFlagValue } from "./link-CNO-HxHN.js";
9
+ import { o as handler$1 } from "./checkout-CNBIS3gA.js";
10
10
  import { existsSync } from "node:fs";
11
11
  import { join } from "node:path";
12
12
  import chalk from "chalk";
@@ -13,8 +13,8 @@ import { writer } from "../writer.js";
13
13
  import { createBranch, pickBranchInteractively } from "../utils/branch_picker.js";
14
14
  import { looksLikeBranchId } from "../utils/formats.js";
15
15
  import { listAllProjectBranches } from "../utils/enrichers.js";
16
- import { n as autoPullEnvAfterPin } from "./env-BOt9AZ1j.js";
17
- import { h as initCmd } from "./config-BjCm5cfr.js";
16
+ import { n as autoPullEnvAfterPin } from "./env-BtG4vH55.js";
17
+ import { h as initCmd } from "./config-CgtJH8xE.js";
18
18
  import { formatLinkSummary } from "../commands/link_output.js";
19
19
  import { r as REGIONS } from "./projects-a3X4OFEJ.js";
20
20
  import prompts from "prompts";
@@ -4,11 +4,11 @@ import { readContextFile } from "../context.js";
4
4
  import { recordCommandSuccessExtras } from "../analytics.js";
5
5
  import { getCliName } from "../utils/cli_name.js";
6
6
  import { helpCsv, helpEpilogue } from "../utils/help_text.js";
7
- import { NEON_MCP_CATEGORIES, NEON_MCP_URL, existingNeonApiKey, installNeonMcpServer, neonMcpUrl, parseMcpCategories, trackedProjectMcpConfig } from "../mcp/install.js";
8
- import { mcpInstallableAgents, resolveInstallTargets } from "../mcp/targets.js";
9
7
  import { writer } from "../writer.js";
10
8
  import { noPassthrough, single } from "../utils/flags.js";
11
9
  import { AGENT_MCP_SKIP_MESSAGE } from "../init/copy.js";
10
+ import { NEON_MCP_CATEGORIES, NEON_MCP_URL, existingNeonApiKey, installNeonMcpServer, mcpInstallOrder, neonMcpUrl, parseMcpCategories, trackedProjectMcpConfig } from "../mcp/install.js";
11
+ import { mcpInstallableAgents, resolveInstallTargets } from "../mcp/targets.js";
12
12
  import { mintMcpApiKey, mintedKeyRevokeCommand, withdrawMintedKey } from "../mcp/mint.js";
13
13
  import { canPickAgentsInteractively, skippableAgentPicker } from "../utils/agent_picker.js";
14
14
  import { resolveMcpPlan } from "../mcp/plan.js";
@@ -119,7 +119,8 @@ const setupNeonMcp = async (options) => {
119
119
  });
120
120
  const { install, skipped } = resolveInstallTargets({
121
121
  agents: plan.agents,
122
- scope: plan.scope
122
+ scope: plan.scope,
123
+ auth: plan.auth
123
124
  });
124
125
  const url = neonMcpUrl({
125
126
  readOnly: plan.readOnly,
@@ -167,7 +168,7 @@ const setupNeonMcp = async (options) => {
167
168
  const rows = [];
168
169
  let successes = 0;
169
170
  const failedAgents = [];
170
- for (const agent of install) {
171
+ for (const agent of mcpInstallOrder(install)) {
171
172
  const result = installNeonMcpServer({
172
173
  agent,
173
174
  scope: plan.scope,
@@ -182,6 +183,7 @@ const setupNeonMcp = async (options) => {
182
183
  status: "installed"
183
184
  });
184
185
  log.info("Wrote %s", result.path);
186
+ if (agent === "pi") log.warning("Pi reads MCP servers through pi-mcp-adapter. Install it with `pi install npm:pi-mcp-adapter`, then run /reload in Pi.");
185
187
  } else {
186
188
  rows.push({
187
189
  agent,
@@ -1,4 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BJohB4LM.js";
2
+ import { log } from "../log.js";
2
3
  import { retryOnLock } from "../api.js";
3
4
  import { writer } from "../writer.js";
4
5
  import { fillSingleProject, resolveBranchFromProps } from "../utils/enrichers.js";
@@ -70,9 +71,13 @@ const create = async (props) => {
70
71
  const deleteRole = async (props) => {
71
72
  const { branchId, branch } = await resolveBranchFromProps(props);
72
73
  const { data } = await retryOnLock(() => props.apiClient.deleteProjectBranchRole(props.projectId, branchId, props.role));
73
- if (data) writer(props).end(data.role, {
74
- fields: ROLES_FIELDS,
75
- humanTitle: `Role deleted from ${branch?.name ?? branchId}`
76
- });
74
+ if (data) {
75
+ writer(props).end(data.role, {
76
+ fields: ROLES_FIELDS,
77
+ humanTitle: `Role deleted from ${branch?.name ?? branchId}`
78
+ });
79
+ return;
80
+ }
81
+ log.info(`Role "${props.role}" not found on branch ${branch?.name ?? branchId}; nothing to delete.`);
77
82
  };
78
83
  export { deleteRole as a, list as c, create as i, roles_exports as l, builder as n, describe as o, command as r, handler as s, aliases as t };
@@ -1,6 +1,6 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BJohB4LM.js";
2
2
  import { fillSingleProject } from "../utils/enrichers.js";
3
- import { y as status } from "./config-BjCm5cfr.js";
3
+ import { y as status } from "./config-CgtJH8xE.js";
4
4
  // src/commands/status.ts
5
5
  var status_exports = /* @__PURE__ */ __exportAll({
6
6
  builder: () => builder,
@@ -1 +1 @@
1
- export { n as builder, r as command, i as describe, a as handler } from "../_chunks/bootstrap-BDkvsAVJ.js";
1
+ export { n as builder, r as command, i as describe, a as handler } from "../_chunks/bootstrap-vAtWRZXa.js";
@@ -1 +1 @@
1
- export { t as builder, r as command, i as describe, a as formatCheckoutPolicyFailure, o as handler } from "../_chunks/checkout-BpOcFaAi.js";
1
+ export { t as builder, r as command, i as describe, a as formatCheckoutPolicyFailure, o as handler } from "../_chunks/checkout-CNBIS3gA.js";
@@ -1 +1 @@
1
- export { t as CLAIM_CREATE_FIELDS, n as CLAIM_LIST_FIELDS, r as aliases, i as builder, a as claimCreateFields, s as claimableCapabilities, c as command, l as create, u as describe, d as handler } from "../_chunks/claim-DlLZmcq0.js";
1
+ export { t as CLAIM_CREATE_FIELDS, n as CLAIM_LIST_FIELDS, r as aliases, i as builder, a as claimCreateFields, s as claimableCapabilities, c as command, l as create, u as describe, d as handler } from "../_chunks/claim-m5sIJdm5.js";
@@ -1 +1 @@
1
- export { t as ConfigInstallFailed, n as addCmd, r as applyCmd, i as applyFlags, a as applyPolicyOnCreate, o as builder, s as command, l as createBranchFromPolicyOnCheckout, u as describe, d as ensureConfigPackages, f as envFlag, p as envPullFlag, m as handler, h as initCmd, g as installCommandFrom, _ as missingDependencies, v as planCmd, y as status } from "../_chunks/config-BjCm5cfr.js";
1
+ export { t as ConfigInstallFailed, n as addCmd, r as applyCmd, i as applyFlags, a as applyPolicyOnCreate, o as builder, s as command, l as createBranchFromPolicyOnCheckout, u as describe, d as ensureConfigPackages, f as envFlag, p as envPullFlag, m as handler, h as initCmd, g as installCommandFrom, _ as missingDependencies, v as planCmd, y as status } from "../_chunks/config-CgtJH8xE.js";
@@ -1 +1 @@
1
- export { t as DATABASE_FIELDS, n as aliases, r as builder, i as command, a as create, s as deleteDb, c as describe, l as handler, u as list } from "../_chunks/databases-DC2h6IW2.js";
1
+ export { t as DATABASE_FIELDS, n as aliases, r as builder, i as command, a as create, s as deleteDb, c as describe, l as handler, u as list } from "../_chunks/databases-B2Yapqme.js";
@@ -1 +1 @@
1
- export { t as builder, n as command, i as describe, a as handler } from "../_chunks/deploy-DmEEhux0.js";
1
+ export { t as builder, n as command, i as describe, a as handler } from "../_chunks/deploy-Bs5gmi4Q.js";
@@ -1 +1 @@
1
- export { t as builder, n as captureShellEnv, r as command, i as describe, a as devBundleDir, o as devEnvContext, c as diffUnits, l as formatEnvFiles, u as formatEnvSummary, d as handler, f as loadDevEnvFiles, p as localFunctionUrlEnv, m as planFunctionsToUnits, h as reportDevCredential, g as sourceFunctionUrlOverlay } from "../_chunks/dev-DlUJFzRs.js";
1
+ export { t as builder, n as captureShellEnv, r as command, i as describe, a as devBundleDir, o as devEnvContext, c as diffUnits, l as formatEnvFiles, u as formatEnvSummary, d as handler, f as loadDevEnvFiles, p as localFunctionUrlEnv, m as planFunctionsToUnits, h as reportDevCredential, g as sourceFunctionUrlOverlay } from "../_chunks/dev-DxiIp4c9.js";
@@ -1 +1 @@
1
- export { t as ENV_PULL_SKIPPED_HINT, n as autoPullEnvAfterPin, r as builder, i as command, a as describe, s as handler, c as pull } from "../_chunks/env-BOt9AZ1j.js";
1
+ export { t as ENV_PULL_SKIPPED_HINT, n as autoPullEnvAfterPin, r as builder, i as command, a as describe, s as handler, c as pull } from "../_chunks/env-BtG4vH55.js";
@@ -1 +1 @@
1
- export { t as aliases, n as builder, r as command, i as deploymentPollDelay, a as describe, s as handler } from "../_chunks/functions-3ypiRwZK.js";
1
+ export { t as aliases, n as builder, r as command, i as deploymentPollDelay, a as describe, s as handler } from "../_chunks/functions-PHaU-kRb.js";
@@ -8,7 +8,7 @@ import { writer } from "../writer.js";
8
8
  import { formatInitDone, printInitDone } from "../init/chrome.js";
9
9
  import { FUNCTION_SLUG_PATTERN, deriveFunctionSlug } from "../utils/function_slug.js";
10
10
  import { displayPath } from "./env_output.js";
11
- import { _ as missingDependencies, d as ensureConfigPackages, g as installCommandFrom } from "../_chunks/config-BjCm5cfr.js";
11
+ import { _ as missingDependencies, d as ensureConfigPackages, g as installCommandFrom } from "../_chunks/config-CgtJH8xE.js";
12
12
  import { recommendedOperations } from "../functions/registry.js";
13
13
  import { collidingFiles, operationsFromFlags, planConfigRegistration, planEnvExample, planScaffold, writeScaffold } from "../functions/scaffold.js";
14
14
  import { describeRegistrySource, openRegistry } from "../functions/source.js";
@@ -1 +1 @@
1
- export { t as aliases, n as builder, r as cleanup, i as command, a as describe, s as handler, c as install, l as partitionBranchesToPrune, u as status, d as sync, f as uninstall } from "../_chunks/git-j6xSVo3e.js";
1
+ export { t as aliases, n as builder, r as cleanup, i as command, a as describe, s as handler, c as install, l as partitionBranchesToPrune, u as status, d as sync, f as uninstall } from "../_chunks/git-DRUZBCmZ.js";
@@ -2,29 +2,29 @@ import { r as auth_exports } from "../_chunks/auth-rup6nemJ.js";
2
2
  import { t as api_exports } from "../_chunks/api-1MKsfpY3.js";
3
3
  import { n as api_keys_exports } from "../_chunks/api_keys-6Xnxl7a8.js";
4
4
  import { n as ask_exports } from "../_chunks/ask-Xlek1Pxh.js";
5
- import { o as env_exports } from "../_chunks/env-BOt9AZ1j.js";
6
- import { c as config_exports } from "../_chunks/config-BjCm5cfr.js";
5
+ import { o as env_exports } from "../_chunks/env-BtG4vH55.js";
6
+ import { c as config_exports } from "../_chunks/config-CgtJH8xE.js";
7
7
  import { u as projects_exports } from "../_chunks/projects-a3X4OFEJ.js";
8
- import { a as link_exports } from "../_chunks/link-nAiuWKfg.js";
9
- import { o as mcp_exports } from "../_chunks/mcp-BznTRK3w.js";
10
- import { c as plugins_exports } from "../_chunks/plugins-B2Gym8Lw.js";
11
- import { l as skills_exports } from "../_chunks/skills-DKgafm65.js";
12
- import { t as bootstrap_exports } from "../_chunks/bootstrap-BDkvsAVJ.js";
8
+ import { a as link_exports } from "../_chunks/link-CNO-HxHN.js";
9
+ import { o as mcp_exports } from "../_chunks/mcp-SvqWzHnT.js";
10
+ import { c as plugins_exports } from "../_chunks/plugins-7cxVcgay.js";
11
+ import { l as skills_exports } from "../_chunks/skills-Bv8oKKwE.js";
12
+ import { t as bootstrap_exports } from "../_chunks/bootstrap-vAtWRZXa.js";
13
13
  import { r as branches_exports } from "../_chunks/branches-Bp-5z1lM.js";
14
14
  import { n as bucket_exports } from "../_chunks/bucket-D06bvDSa.js";
15
- import { n as checkout_exports } from "../_chunks/checkout-BpOcFaAi.js";
16
- import { o as claim_exports } from "../_chunks/claim-DlLZmcq0.js";
15
+ import { n as checkout_exports } from "../_chunks/checkout-CNBIS3gA.js";
16
+ import { o as claim_exports } from "../_chunks/claim-m5sIJdm5.js";
17
17
  import { a as connection_string_exports } from "../_chunks/connection_string-C9e7N4xk.js";
18
18
  import { a as credentials_exports } from "../_chunks/credentials-BMBNmW0t.js";
19
19
  import { r as data_api_exports } from "../_chunks/data_api-CHDwvMTG.js";
20
- import { o as databases_exports } from "../_chunks/databases-DC2h6IW2.js";
21
- import { r as deploy_exports } from "../_chunks/deploy-DmEEhux0.js";
22
- import { s as dev_exports } from "../_chunks/dev-DlUJFzRs.js";
20
+ import { o as databases_exports } from "../_chunks/databases-B2Yapqme.js";
21
+ import { r as deploy_exports } from "../_chunks/deploy-Bs5gmi4Q.js";
22
+ import { s as dev_exports } from "../_chunks/dev-DxiIp4c9.js";
23
23
  import { i as diff_exports } from "../_chunks/diff-dnxneH0u.js";
24
24
  import { c as docs_exports } from "../_chunks/docs-BpLiSTmm.js";
25
25
  import { o as feedback_exports } from "../_chunks/feedback-mQmdTRFn.js";
26
- import { o as functions_exports } from "../_chunks/functions-3ypiRwZK.js";
27
- import { o as git_exports } from "../_chunks/git-j6xSVo3e.js";
26
+ import { o as functions_exports } from "../_chunks/functions-PHaU-kRb.js";
27
+ import { o as git_exports } from "../_chunks/git-DRUZBCmZ.js";
28
28
  import { a as init_exports } from "../_chunks/init-CcVJb492.js";
29
29
  import { o as inspect_exports } from "../_chunks/inspect-yFAb61qo.js";
30
30
  import { a as ip_allow_exports } from "../_chunks/ip_allow-DBdxNEUa.js";
@@ -36,10 +36,10 @@ import { o as orgs_exports } from "../_chunks/orgs-Dpbr-K0A.js";
36
36
  import { o as profile_exports } from "../_chunks/profile-BAlM625e.js";
37
37
  import { a as psql_exports } from "../_chunks/psql-Bce4X0NG.js";
38
38
  import { s as realtime_exports } from "../_chunks/realtime-BwtzYf5a.js";
39
- import { l as roles_exports } from "../_chunks/roles-xRuu0462.js";
39
+ import { l as roles_exports } from "../_chunks/roles-BVc69rjG.js";
40
40
  import { a as set_context_exports } from "../_chunks/set_context-ompB6d2D.js";
41
41
  import { s as snapshots_exports } from "../_chunks/snapshots-DxNhjcco.js";
42
- import { a as status_exports } from "../_chunks/status-BC4XXuuE.js";
42
+ import { a as status_exports } from "../_chunks/status-BlrzeKyA.js";
43
43
  import { d as triggers_exports } from "../_chunks/triggers-BfvyeJUC.js";
44
44
  import { s as user_exports } from "../_chunks/user-D9mC430O.js";
45
45
  import { i as vpc_endpoints_exports } from "../_chunks/vpc_endpoints-C-Y4WK2M.js";
@@ -1 +1 @@
1
- export { t as builder, n as command, r as describe, i as handler, o as quoteFlagValue, s as runLink, c as shouldOfferConfigInit } from "../_chunks/link-nAiuWKfg.js";
1
+ export { t as builder, n as command, r as describe, i as handler, o as quoteFlagValue, s as runLink, c as shouldOfferConfigInit } from "../_chunks/link-CNO-HxHN.js";
@@ -1 +1 @@
1
- export { t as builder, n as command, r as describe, i as handler, a as mcpInstallError, s as reportMcpInstall, c as setupNeonMcp } from "../_chunks/mcp-BznTRK3w.js";
1
+ export { t as builder, n as command, r as describe, i as handler, a as mcpInstallError, s as reportMcpInstall, c as setupNeonMcp } from "../_chunks/mcp-SvqWzHnT.js";
@@ -1 +1 @@
1
- export { t as aliases, n as builder, r as command, i as describe, a as handler, o as installPlugins, s as pluginsInstallError, l as reportPluginsInstall } from "../_chunks/plugins-B2Gym8Lw.js";
1
+ export { t as aliases, n as builder, r as command, i as describe, a as handler, o as installPlugins, s as pluginsInstallError, l as reportPluginsInstall } from "../_chunks/plugins-7cxVcgay.js";
@@ -1 +1 @@
1
- export { t as aliases, n as builder, r as command, i as create, a as deleteRole, o as describe, s as handler, c as list } from "../_chunks/roles-xRuu0462.js";
1
+ export { t as aliases, n as builder, r as command, i as create, a as deleteRole, o as describe, s as handler, c as list } from "../_chunks/roles-BVc69rjG.js";
@@ -1 +1 @@
1
- export { t as aliases, n as builder, r as command, i as describe, a as handler, o as installSkills, s as reportSkillsInstall, c as skillsInstallError } from "../_chunks/skills-DKgafm65.js";
1
+ export { t as aliases, n as builder, r as command, i as describe, a as handler, o as installSkills, s as reportSkillsInstall, c as skillsInstallError } from "../_chunks/skills-Bv8oKKwE.js";
@@ -1 +1 @@
1
- export { t as builder, n as command, r as describe, i as handler } from "../_chunks/status-BC4XXuuE.js";
1
+ export { t as builder, n as command, r as describe, i as handler } from "../_chunks/status-BlrzeKyA.js";
@@ -1,6 +1,6 @@
1
1
  import { writer } from "../writer.js";
2
- import { o as resolveNeonEnvVars } from "../_chunks/env-CIFMBEon.js";
3
2
  import { branchIdFromProps } from "../utils/enrichers.js";
3
+ import { o as resolveNeonEnvVars } from "../_chunks/env-CIFMBEon.js";
4
4
  import YAML from "yaml";
5
5
  // src/commands/subscribe.ts
6
6
  const builder = (argv) => argv.usage("$0 realtime subscribe \"<query>\" [options]").positional("query", {
package/dist/index.js CHANGED
@@ -13,7 +13,7 @@ import { c as ensureAuth } from "./_chunks/auth-rup6nemJ.js";
13
13
  import { recoverFrom401 } from "./auth_recovery.js";
14
14
  import { UsageError, failOnUsageError, isBareParentCommand, showHelp, showUsageErrorHelp } from "./help.js";
15
15
  import { lazyCommands, preloadCommand } from "./commands/manifest.js";
16
- import { rewriteUnknownAgentArg } from "./init/plan.js";
16
+ import { rewriteUnknownAgentArg } from "./init/unknown_agent_arg.js";
17
17
  import { recoverFromSSO } from "./sso_recovery.js";
18
18
  import { notifyIfUpdateAvailable, shouldRunSkillsNotifier } from "./update_notifier.js";
19
19
  import { fillInArgs, resolveApiKeyFromEnv } from "./utils/middlewares.js";
@@ -1,4 +1,4 @@
1
- import { agentSupportsHttpMcp, agentSupportsProjectMcp, detectInstalledAgents, getAgentDisplayName, listMcpAgentIds, resolveAddMcpAgentId, tryResolveAddMcpAgentId, uniqueAgentIds } from "../mcp/agents.js";
1
+ import { agentSupportsHttpMcp, agentSupportsProjectMcp, detectInstalledAgents, detectProjectAgents, getAgentDisplayName, listMcpAgentIds, resolveAddMcpAgentId, tryResolveAddMcpAgentId, uniqueAgentIds } from "../mcp/agents.js";
2
2
  import { agents } from "add-mcp";
3
3
  // src/init/agents.ts
4
4
  const SKILLS_AGENT_BY_TYPE = {
@@ -16,7 +16,15 @@ const SKILLS_AGENT_BY_TYPE = {
16
16
  "github-copilot-cli": "github-copilot",
17
17
  windsurf: "windsurf",
18
18
  zed: "zed",
19
- "grok-build": "grok"
19
+ "grok-build": "grok",
20
+ "factory-droid": "droid",
21
+ fx: "fx",
22
+ hermes: "hermes-agent",
23
+ junie: "junie",
24
+ "kilo-code": "kilo",
25
+ "kimi-code": "kimi-code-cli",
26
+ "kiro-cli": "kiro-cli",
27
+ pi: "pi"
20
28
  };
21
29
  function getSkillsAgentName(agent) {
22
30
  if (Object.prototype.hasOwnProperty.call(SKILLS_AGENT_BY_TYPE, agent)) return SKILLS_AGENT_BY_TYPE[agent];
@@ -47,4 +55,4 @@ function skillsPickerOptions() {
47
55
  hint: "agent skills"
48
56
  }));
49
57
  }
50
- export { agentPickerHint, agentSupportsHttpMcp, agentSupportsProjectMcp, detectInstalledAgents, getAgentDisplayName, getSkillsAgentName, listMcpAgentIds, mcpPickerOptions, resolveAddMcpAgentId, skillsPickerOptions, supportsSkills, tryResolveAddMcpAgentId, uniqueAgentIds };
58
+ export { agentPickerHint, agentSupportsHttpMcp, agentSupportsProjectMcp, detectInstalledAgents, detectProjectAgents, getAgentDisplayName, getSkillsAgentName, listMcpAgentIds, mcpPickerOptions, resolveAddMcpAgentId, skillsPickerOptions, supportsSkills, tryResolveAddMcpAgentId, uniqueAgentIds };
package/dist/init/auth.js CHANGED
@@ -4,8 +4,8 @@ import "../config.js";
4
4
  import "../auth.js";
5
5
  import { c as ensureAuth, l as existingApiClient } from "../_chunks/auth-rup6nemJ.js";
6
6
  import { recoverFrom401 } from "../auth_recovery.js";
7
- import { c as pull } from "../_chunks/env-BOt9AZ1j.js";
8
- import { c as setupNeonMcp } from "../_chunks/mcp-BznTRK3w.js";
7
+ import { c as pull } from "../_chunks/env-BtG4vH55.js";
8
+ import { c as setupNeonMcp } from "../_chunks/mcp-SvqWzHnT.js";
9
9
  // src/init/auth.ts
10
10
  const isUnauthorized = (error) => isNeonApiError(error) && error.status === 401;
11
11
  const authenticationFailed = () => /* @__PURE__ */ new Error("Authentication failed.");
@@ -2,13 +2,12 @@ import { t as storeFor } from "../_chunks/credential_io-DbeSh3Pl.js";
2
2
  import { isCi } from "../env.js";
3
3
  import { h as resolveProfile, u as locationOf } from "../_chunks/profiles-DTazQtjK.js";
4
4
  import { i as selectCredential, t as credentialInputs } from "../_chunks/auth_selection-CwGLN9Qz.js";
5
- import { detectInstalledAgents, uniqueAgentIds } from "../mcp/agents.js";
5
+ import { detectInstalledAgents, detectProjectAgents, uniqueAgentIds } from "../mcp/agents.js";
6
6
  import "./agents.js";
7
7
  import { directoryIsEmpty } from "./plan.js";
8
8
  import { detectAgent } from "./detect_host.js";
9
9
  import { canPickAgentsInteractively } from "../utils/agent_picker.js";
10
10
  import { existsSync, readdirSync } from "node:fs";
11
- import { detectProjectAgents } from "add-mcp";
12
11
  // src/init/detect.ts
13
12
  const listingHasCredentials = (configDir, profile) => {
14
13
  try {
package/dist/init/link.js CHANGED
@@ -4,7 +4,7 @@ import "../config.js";
4
4
  import "../auth.js";
5
5
  import { c as ensureAuth } from "../_chunks/auth-rup6nemJ.js";
6
6
  import { recoverFrom401 } from "../auth_recovery.js";
7
- import { s as runLink } from "../_chunks/link-nAiuWKfg.js";
7
+ import { s as runLink } from "../_chunks/link-CNO-HxHN.js";
8
8
  // src/init/link.ts
9
9
  const isUnauthorized = (error) => isNeonApiError(error) && error.status === 401;
10
10
  const authenticationFailed = () => /* @__PURE__ */ new Error("Authentication failed.");
package/dist/init/plan.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { getCliName } from "../utils/cli_name.js";
2
2
  import { tryResolveAddMcpAgentId, uniqueAgentIds } from "../mcp/agents.js";
3
- import { mcpInstallableAgents } from "../mcp/targets.js";
4
3
  import { supportsSkills } from "./agents.js";
5
4
  import { pluginsInstallableAgents } from "../plugins/targets.js";
5
+ import { mcpInstallableAgents } from "../mcp/targets.js";
6
6
  import { skillsInstallableAgents } from "../skills/targets.js";
7
7
  import { agentArgv } from "../utils/agent_flag.js";
8
8
  import { isAbsolute, join, relative, resolve } from "node:path";
@@ -92,67 +92,6 @@ const noDetectedAgentsMessage = (input) => {
92
92
  return `${lead} ${hint} Supported agents: ${input.supported.join(", ")}`;
93
93
  };
94
94
  const INIT_NEEDS_YES_OR_TERMINAL = "No interactive terminal. Pass -y to use defaults, or run this command in a terminal to pick.";
95
- const UNKNOWN_AGENT_COMMANDS = ["link"];
96
- 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.`;
97
- const BOOLEAN_FLAGS = /* @__PURE__ */ new Set([
98
- "-y",
99
- "--yes",
100
- "--default",
101
- "--force",
102
- "-h",
103
- "--help",
104
- "-v",
105
- "--version",
106
- "--color",
107
- "--no-color",
108
- "--analytics",
109
- "--no-analytics",
110
- "--oauth",
111
- "--project",
112
- "--global",
113
- "--read-only",
114
- "--readonly",
115
- "--clear",
116
- "--checks",
117
- "--no-checks",
118
- "--env-pull",
119
- "--no-env-pull",
120
- "--no-agent-setup",
121
- "--no-link",
122
- "--no-config",
123
- "--claimable",
124
- "--config",
125
- "--list",
126
- "--list-templates",
127
- "--force-auth",
128
- "--no-force-auth"
129
- ]);
130
- const isUnknownAgentCommand = (token) => {
131
- for (const command of UNKNOWN_AGENT_COMMANDS) if (command === token) return true;
132
- return false;
133
- };
134
- const commandFromArgv = (argv) => {
135
- let skipValue = false;
136
- for (const token of argv) {
137
- if (skipValue) {
138
- skipValue = false;
139
- continue;
140
- }
141
- if (token === "--") break;
142
- if (token.startsWith("-")) {
143
- const flag = token.split("=")[0];
144
- if (flag !== void 0 && !token.includes("=") && !BOOLEAN_FLAGS.has(flag)) skipValue = true;
145
- continue;
146
- }
147
- if (isUnknownAgentCommand(token)) return token;
148
- }
149
- };
150
- const rewriteUnknownAgentArg = (input) => {
151
- if (input.message !== "Unknown argument: agent" && input.message !== "Unknown argument: a") return;
152
- const command = commandFromArgv(input.argv);
153
- if (command === void 0) return;
154
- return unknownAgentArgHint(command, input.cliName);
155
- };
156
95
  const initYesSupportedAgents = () => uniqueAgentIds([
157
96
  ...pluginsInstallableAgents("project"),
158
97
  ...skillsInstallableAgents(),
@@ -385,4 +324,4 @@ const resolveInitAgentSetup = async (input) => {
385
324
  if (input.interactive) return input.pick();
386
325
  throw new Error(INIT_NEEDS_YES_OR_TERMINAL);
387
326
  };
388
- export { FALLBACK_SKILLS_AGENTS, INIT_NEEDS_YES_OR_TERMINAL, NAMED_AGENTS_MIXED, NAMED_AGENTS_UNSUPPORTED, assertNamedAgentTooling, bootstrapInitStep, chooseYesAgentTooling, collectYesAgents, directoryIsEmpty, funnelAgentSetup, initPluginAgents, initSkillsMcpAgents, initYesSupportedAgents, linkInputArgv, namedAgentsMixedMessage, namedAgentsNeedSplit, noDetectedAgentsMessage, planAgentSteps, planConfigInitStep, planInitToolingSteps, planLinkStep, planToolingSteps, planYesAgentSteps, postScaffoldActions, projectContextFile, recommendedTooling, resolveInitAgentSetup, resolveNamedAgents, resolveYesAgentList, rewriteUnknownAgentArg, splitInitTooling };
327
+ export { FALLBACK_SKILLS_AGENTS, INIT_NEEDS_YES_OR_TERMINAL, NAMED_AGENTS_MIXED, NAMED_AGENTS_UNSUPPORTED, assertNamedAgentTooling, bootstrapInitStep, chooseYesAgentTooling, collectYesAgents, directoryIsEmpty, funnelAgentSetup, initPluginAgents, initSkillsMcpAgents, initYesSupportedAgents, linkInputArgv, namedAgentsMixedMessage, namedAgentsNeedSplit, noDetectedAgentsMessage, planAgentSteps, planConfigInitStep, planInitToolingSteps, planLinkStep, planToolingSteps, planYesAgentSteps, postScaffoldActions, projectContextFile, recommendedTooling, resolveInitAgentSetup, resolveNamedAgents, resolveYesAgentList, splitInitTooling };
package/dist/init/run.js CHANGED
@@ -9,23 +9,23 @@ import { getCliName } from "../utils/cli_name.js";
9
9
  import { servicesFlagValue } from "../neon_services.js";
10
10
  import { CONFIG_INIT_SERVICES, parseConfigInitServices } from "../config_template.js";
11
11
  import { hasNeonConfigFile, neonConfigFilename } from "../project.js";
12
+ import { inferPackageManager, resolvePackageManager } from "../utils/package_manager.js";
12
13
  import { getAgentDisplayName } from "../mcp/agents.js";
13
- import { mcpInstallableAgents } from "../mcp/targets.js";
14
14
  import { missingPluginsCommands, pluginsCommandProblemText, pluginsInstallableAgents, unusablePluginsCommands } from "../plugins/targets.js";
15
- import { skillsInstallableAgents } from "../skills/targets.js";
16
- import { FALLBACK_SKILLS_AGENTS, assertNamedAgentTooling, funnelAgentSetup, planInitToolingSteps, recommendedTooling, resolveNamedAgents, splitInitTooling } from "./plan.js";
17
- import { inferPackageManager, resolvePackageManager } from "../utils/package_manager.js";
18
15
  import { AGENTS_NOT_INSTALLED, CANCELLED_BODY, CLAIMABLE_ACCOUNT_FLAGS, CLAIMABLE_ALREADY_LINKED, CLAIMABLE_MCP_API_KEY, CLAIMABLE_NO_LINK, MCP_API_KEY_NEEDS_AUTH, MCP_SCOPED_NEEDS_PROJECT, NON_TTY_LINK_NEEDS_AUTH, NO_AGENTS_FALLBACK_STATUS, PROGRESS, PROJECT_PINNED_OFFLINE, claimableNext, claimableThenServicesNext, configInitNext, envPullFailedNext, existingConfigNext, installFailedNext, mcpAfterLinkNext, mcpConfigLocationSkipped, mcpConfigLocationUnavailable, mcpKeyFailedNext, namedAgentsUnavailable, newConfigNext, offlinePinNext, skippedLinkNext, toolingFailedNext, unattendedUnauthedNext } from "./copy.js";
19
16
  import { agentsRowValue, configRowValue, formatInitDone, headingForKind, printInitBanner, printInitDone, printInitProgress, projectRowValue, shouldPrintInitBanner } from "./chrome.js";
20
- import { h as initCmd, t as ConfigInstallFailed } from "../_chunks/config-BjCm5cfr.js";
21
- import { o as quoteFlagValue, s as runLink } from "../_chunks/link-nAiuWKfg.js";
17
+ import { h as initCmd, t as ConfigInstallFailed } from "../_chunks/config-CgtJH8xE.js";
18
+ import { o as quoteFlagValue, s as runLink } from "../_chunks/link-CNO-HxHN.js";
22
19
  import { runAuthenticatedLink } from "./link.js";
20
+ import { mcpInstallableAgents } from "../mcp/targets.js";
21
+ import { skillsInstallableAgents } from "../skills/targets.js";
22
+ import { FALLBACK_SKILLS_AGENTS, assertNamedAgentTooling, funnelAgentSetup, planInitToolingSteps, recommendedTooling, resolveNamedAgents, splitInitTooling } from "./plan.js";
23
23
  import { CannotMintApiKeyError } from "../mcp/mint.js";
24
24
  import { pullInitEnv, resolveInitConfigApi } from "./auth.js";
25
25
  import { InitCancelled, raceSigint, restoreCursor } from "./cancelled.js";
26
26
  import { pickAgentSetupInteractively, pickInitAgentsInteractively, pickInitConfigInteractively, pickInitMcpAuthInteractively, pickInitMcpConfigLocationInteractively, pickInitModeInteractively, pickInitPackageManagerInteractively, pickInitProjectSetupInteractively, pickInitServicesInteractively, pickInitSkillsInteractively } from "./wizard.js";
27
27
  import { runToolingSteps, toolingStepCommandText } from "./tooling.js";
28
- import { l as create } from "../_chunks/claim-DlLZmcq0.js";
28
+ import { l as create } from "../_chunks/claim-m5sIJdm5.js";
29
29
  import { INIT_CONFIG_SERVICES_CONFLICT, configPlanFromResolution, initEnvPullAfterConfig, resolveInitConfigChoice } from "./choices.js";
30
30
  import { detectInitEnvironment } from "./detect.js";
31
31
  import { createInitFunnel, emitInitStart, finishInitFunnel, initStartProperties, recordInitError, recordInitExit } from "./funnel.js";
@@ -1,17 +1,17 @@
1
1
  import { log } from "../log.js";
2
2
  import { getCliName } from "../utils/cli_name.js";
3
- import { assertNamedAgentTooling, chooseYesAgentTooling, collectYesAgents, initYesSupportedAgents, noDetectedAgentsMessage, planAgentSteps, planToolingSteps, planYesAgentSteps, resolveInitAgentSetup } from "./plan.js";
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-BznTRK3w.js";
9
- import { l as reportPluginsInstall, o as installPlugins, s as pluginsInstallError } from "../_chunks/plugins-B2Gym8Lw.js";
10
- import { c as skillsInstallError, o as installSkills, s as reportSkillsInstall } from "../_chunks/skills-DKgafm65.js";
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 };
@@ -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";
@@ -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 };
@@ -1,7 +1,9 @@
1
- import { chmodSync, existsSync, readFileSync, writeFileSync } from "node:fs";
2
- import { basename, dirname, join } from "node:path";
3
- import { agents, upsertServer } from "add-mcp";
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
- try {
81
- return bearerFromNeonMcpConfig(neonServers(nestedValue(JSON.parse(raw), configKey)));
82
- } catch {
83
- const neonBlock = raw.match(/\[mcp_servers\.Neon\][\s\S]*?(?=\n\[|$)/)?.[0];
84
- if (!neonBlock) return;
85
- const url = neonBlock.match(/^url\s*=\s*"([^"]*)"/m)?.[1];
86
- if (!url || !isNeonMcpUrl(url)) return;
87
- return BEARER_RE.exec(neonBlock)?.[1];
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
- function configPathFor(agent, scope, cwd) {
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
- if (scope === "project") {
93
- if (!spec.localConfigPath) return;
94
- return join(cwd, spec.localConfigPath);
95
- }
96
- return spec.configPath;
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
- function configKeyFor(agent, scope) {
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 (scope === "project" && spec.localConfigKey) return spec.localConfigKey;
101
- return spec.configKey;
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 key = neonApiKeyFromFile(path, configKeyFor(agent, options.scope));
108
- if (key) return key;
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 relativePath = agents[agent].localConfigPath;
133
- if (!relativePath) continue;
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: options.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 };
@@ -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
@@ -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) => {
@@ -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) => {
@@ -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: `AI Gateway is in public beta and not every model is enabled for your account yet, so some models are missing from the catalog. Request access to more models here: ${moreModelsUrl}`
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.15.1",
3
+ "version": "8.16.0",
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.0.0",
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.10.0",
76
+ "@neon/config-runtime": "1.11.0",
76
77
  "@neon/realtime": "0.1.2",
77
- "@neon/sdk": "7.7.0",
78
- "@neon/config-runtime": "1.11.0"
78
+ "@neon/config": "1.10.0",
79
+ "@neon/sdk": "7.7.0"
79
80
  },
80
81
  "optionalDependencies": {
81
82
  "@napi-rs/keyring": "1.3.0",
@@ -113,8 +114,8 @@
113
114
  "vitest": "^3.0.9",
114
115
  "@neon-internals/cli-core": "0.0.0",
115
116
  "@neon-internals/env-core": "0.0.38",
116
- "@neon/env": "1.6.8",
117
117
  "@neon/e2e-harness": "0.0.0",
118
+ "@neon/env": "1.6.8",
118
119
  "@neon/functions": "0.11.0"
119
120
  },
120
121
  "publishConfig": {
@@ -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";