neon 8.15.0 → 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 (62) hide show
  1. package/README.md +9 -5
  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/{docs-CClmgj_Z.js → docs-BpLiSTmm.js} +1 -1
  9. package/dist/_chunks/{functions-3ypiRwZK.js → functions-PHaU-kRb.js} +1 -1
  10. package/dist/_chunks/{git-j6xSVo3e.js → git-DRUZBCmZ.js} +2 -2
  11. package/dist/_chunks/{link-nAiuWKfg.js → link-CNO-HxHN.js} +2 -2
  12. package/dist/_chunks/{mcp-BznTRK3w.js → mcp-SvqWzHnT.js} +6 -4
  13. package/dist/_chunks/{plugins-CKOcBuuP.js → plugins-7cxVcgay.js} +5 -5
  14. package/dist/_chunks/{roles-xRuu0462.js → roles-BVc69rjG.js} +9 -4
  15. package/dist/_chunks/{status-BC4XXuuE.js → status-BlrzeKyA.js} +1 -1
  16. package/dist/analytics.js +4 -2
  17. package/dist/commands/bootstrap.js +1 -1
  18. package/dist/commands/checkout.js +1 -1
  19. package/dist/commands/claim.js +1 -1
  20. package/dist/commands/config.js +1 -1
  21. package/dist/commands/databases.js +1 -1
  22. package/dist/commands/deploy.js +1 -1
  23. package/dist/commands/dev.js +1 -1
  24. package/dist/commands/docs.js +1 -1
  25. package/dist/commands/env.js +1 -1
  26. package/dist/commands/functions.js +1 -1
  27. package/dist/commands/functions_new.js +3 -4
  28. package/dist/commands/git.js +1 -1
  29. package/dist/commands/index.js +17 -17
  30. package/dist/commands/link.js +1 -1
  31. package/dist/commands/mcp.js +1 -1
  32. package/dist/commands/plugins.js +1 -1
  33. package/dist/commands/roles.js +1 -1
  34. package/dist/commands/skills.js +1 -1
  35. package/dist/commands/status.js +1 -1
  36. package/dist/commands/subscribe.js +1 -1
  37. package/dist/env.js +19 -4
  38. package/dist/index.js +1 -1
  39. package/dist/init/agents.js +11 -3
  40. package/dist/init/auth.js +2 -2
  41. package/dist/init/copy.js +3 -2
  42. package/dist/init/detect.js +1 -2
  43. package/dist/init/link.js +1 -1
  44. package/dist/init/plan.js +2 -63
  45. package/dist/init/run.js +29 -20
  46. package/dist/init/tooling.js +5 -5
  47. package/dist/init/unknown_agent_arg.js +63 -0
  48. package/dist/init/wizard.js +6 -6
  49. package/dist/mcp/agents.js +25 -5
  50. package/dist/mcp/install.js +95 -30
  51. package/dist/mcp/targets.js +2 -3
  52. package/dist/plugins/child_env.js +10 -0
  53. package/dist/plugins/plan.js +14 -14
  54. package/dist/plugins/run.js +2 -8
  55. package/dist/plugins/targets.js +134 -15
  56. package/dist/skills/targets.js +1 -2
  57. package/dist/update_notifier.js +8 -5
  58. package/dist/utils/ai_gateway_notice.js +1 -1
  59. package/package.json +6 -5
  60. package/dist/_chunks/{bootstrap-BDkvsAVJ.js → bootstrap-vAtWRZXa.js} +2 -2
  61. package/dist/_chunks/{env-BOt9AZ1j.js → env-BtG4vH55.js} +1 -1
  62. 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,9 +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.
1060
+
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.
1058
1062
 
1059
- 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.
1060
1064
 
1061
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`.
1062
1066
 
@@ -1122,7 +1126,7 @@ Without a template, a terminal asks which one to use; anything else exits with t
1122
1126
 
1123
1127
  A template's `layout` decides what you get. `router` writes one module per operation plus a generated `index.ts` that dispatches on the URL path, and declares one function. `separate` declares each operation as its own function under the slug the template gives it. Without `--operation` or `--all-operations`, a TTY asks which operations to include and anything else uses the template's recommended ones.
1124
1128
 
1125
- Variables a template needs are declared on each function in `neon.ts` (`env: { API_KEY: process.env.API_KEY! }`) and added, without values, to `.env.example` next to it. Values are never written to `.env` or `.env.local` for you: a blank placeholder there would deploy as an empty string and delete the live value. Put the real value in the file `env pull` uses and deploy with `neon config apply --env .env.local`. `neon dev` reads function env from your shell, so export it there as well.
1129
+ Variables a template needs are declared on each function in `neon.ts` (`env: { API_KEY: process.env.API_KEY! }`) and added, without values, to `.env.example` next to it. Values are never written to `.env` or `.env.local` for you: a blank placeholder there would deploy as an empty string and delete the live value. Put the real value in the file `env pull` uses and deploy with `neon config apply --env .env.local`. `neon dev` loads it automatically.
1126
1130
 
1127
1131
  Nothing is written until every check passes: a file that already exists with different contents needs `--force`, and a slug `neon.ts` already declares needs `--slug`, `--force`, or `--no-add-to-config`. A `separate` template sets its own slugs, so `--slug` only changes its directory; remove the existing declarations from `neon.ts`, or use `--force` or `--no-add-to-config`.
1128
1132
 
@@ -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";
@@ -128,7 +128,7 @@ function siteSearchHeaders(opts) {
128
128
  "Content-Type": "application/json",
129
129
  "User-Agent": `neon/${opts.version}`,
130
130
  "x-caller-source": "cli",
131
- ...opts.agent ? { "x-caller-client": encodeURIComponent(opts.agent) } : {},
131
+ ...opts.analytics && opts.agent ? { "x-caller-client": encodeURIComponent(opts.agent) } : {},
132
132
  ...opts.analytics ? {} : { "x-caller-analytics": "off" }
133
133
  };
134
134
  }
@@ -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,
@@ -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 { getAgentDisplayName } from "../mcp/agents.js";
6
- import { NEON_MCP_URL } from "../mcp/install.js";
7
- import "../init/agents.js";
8
- import { pluginsInstallableAgents } from "../plugins/targets.js";
9
5
  import { writer } from "../writer.js";
10
6
  import { noPassthrough } from "../utils/flags.js";
7
+ import { getAgentDisplayName } from "../mcp/agents.js";
8
+ import "../init/agents.js";
9
+ import { pluginsCommandProblemText, pluginsInstallableAgents } from "../plugins/targets.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";
@@ -77,7 +77,7 @@ const installPlugins = async (options) => {
77
77
  });
78
78
  for (const agent of plan.skipped) log.warning("Skipping %s: no plugins mapping.", getAgentDisplayName(agent));
79
79
  for (const agent of plan.userScopeSkipped) log.warning("Skipping %s: plugins are user-level. Pass --global.", getAgentDisplayName(agent));
80
- for (const { agent, command } of plan.missingCommands) log.warning("Skipping %s: the plugin installs through \"%s\", which was not found on PATH.", getAgentDisplayName(agent), command);
80
+ for (const row of plan.unusableCommands) log.warning("Skipping %s: the plugin installs through \"%s\", which %s.", getAgentDisplayName(row.agent), row.command.name, pluginsCommandProblemText(row));
81
81
  const rows = [];
82
82
  const failed = [];
83
83
  const scope = scopeLabel(plan.scope);
@@ -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,
package/dist/analytics.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { a as OAUTH, t as storeFor } from "./_chunks/credential_io-DbeSh3Pl.js";
2
- import { getCliAgent, getGithubEnvVars, isCi } from "./env.js";
2
+ import { getCliAgent, getGithubEnvVars, getTty, isCi } from "./env.js";
3
3
  import { log } from "./log.js";
4
4
  import { getOrCreateAnonymousId } from "./anonymous_id.js";
5
5
  import pkg_default from "./pkg.js";
@@ -248,7 +248,8 @@ const settleErrorReports = async (deadline) => {
248
248
  const getErrorAnalyticsEventContext = (_args) => ({
249
249
  version: pkg_default.version,
250
250
  ci: isCi(),
251
- agent: getCliAgent(process.env)
251
+ agent: getCliAgent(process.env),
252
+ tty: getTty()
252
253
  });
253
254
  const CREDENTIAL_TOKEN_ID = /\bnak_live_[0-9a-f]+\b/gi;
254
255
  const redactCredentialTokenIds = (text) => text.replace(CREDENTIAL_TOKEN_ID, "nak_live_<redacted>");
@@ -353,6 +354,7 @@ const getAnalyticsEventProperties = (args) => ({
353
354
  flags: { output: args.output },
354
355
  ci: isCi(),
355
356
  agent: getCliAgent(process.env),
357
+ tty: getTty(),
356
358
  githubEnvVars: getGithubEnvVars(process.env)
357
359
  });
358
360
  export { analyticsIdentity, analyticsMiddleware, closeAnalytics, commandSuccessProperties, getAnalyticsEventProperties, getErrorAnalyticsEventProperties, initAnalyticsClientMiddleware, isAnalyticsActive, recordCommandSuccessExtras, recordScaffoldedTemplate, redactCredentialTokenIds, sendError, storedCredentialAttribution, takeCommandSuccessExtras, telemetryCredential, trackCommandSuccess, trackEvent, useAnalyticsClientForTests };
@@ -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 DEFAULT_SITE_SEARCH_URL, n as MAX_LIMIT, r as MAX_QUERY_LENGTH, i as SITE_SEARCH_CATEGORIES, a as builder, o as command, s as describe, l as formatSearchResults, u as parseSearchHits, d as resolveSiteSearchUrl, f as siteSearchHeaders } from "../_chunks/docs-CClmgj_Z.js";
1
+ export { t as DEFAULT_SITE_SEARCH_URL, n as MAX_LIMIT, r as MAX_QUERY_LENGTH, i as SITE_SEARCH_CATEGORIES, a as builder, o as command, s as describe, l as formatSearchResults, u as parseSearchHits, d as resolveSiteSearchUrl, f as siteSearchHeaders } from "../_chunks/docs-BpLiSTmm.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";
@@ -169,9 +169,8 @@ const scaffoldFromTemplate = async (options) => {
169
169
  const envFile = displayPath(resolveEnvFilePath(location), cwd);
170
170
  const names = environment.join(", ");
171
171
  if (variables && register) {
172
- const them = environment.length === 1 ? "it" : "them";
173
- nextSteps.push(`Set ${variables} in ${envFile}. \`${cli} dev\` reads ${them} from your shell, so export ${them} there too.`);
174
- next.push(`Set ${names} in ${envFile}, and export ${them} for ${cli} dev`);
172
+ nextSteps.push(`Set ${variables} in ${envFile} (\`${cli} dev\` loads it automatically).`);
173
+ next.push(`Set ${names} in ${envFile} (${cli} dev loads it automatically)`);
175
174
  } else if (variables) {
176
175
  nextSteps.push(`Set ${variables} in your shell.`);
177
176
  next.push(`Set ${names} in your shell`);
@@ -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-CKOcBuuP.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
- import { c as docs_exports } from "../_chunks/docs-CClmgj_Z.js";
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-CKOcBuuP.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/env.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { isatty } from "node:tty";
1
2
  // src/env.ts
2
3
  const isCi = () => {
3
4
  return process.env.CI !== "false" && Boolean(process.env.CI);
@@ -6,16 +7,30 @@ const isInteractiveTerminal = () => !isCi() && Boolean(process.stdin.isTTY) && B
6
7
  const isDebug = () => {
7
8
  return Boolean(process.env.DEBUG);
8
9
  };
10
+ const getTty = () => ({
11
+ stdin: isatty(0),
12
+ stdout: isatty(1)
13
+ });
14
+ const AI_AGENT_NAME = /^[a-z0-9][a-z0-9._-]{0,63}$/;
15
+ const isNonEmpty = (value) => Boolean(value?.trim());
9
16
  const getCliAgent = (env) => {
10
17
  const active = [
11
18
  ["claude-code", env.CLAUDE_CODE_CHILD_SESSION === "1"],
12
19
  ["codex", env.CODEX_CI === "1" && (Boolean(env.CODEX_THREAD_ID?.trim()) || Boolean(env.CODEX_SESSION_ID?.trim()))],
13
20
  ["cursor", env.CURSOR_AGENT === "1"],
14
- ["opencode", env.OPENCODE === "1"],
21
+ ["opencode", env.OPENCODE === "1" && env.KILO !== "1"],
22
+ ["kilo", env.KILO === "1"],
15
23
  ["gemini-cli", env.GEMINI_CLI === "1"],
16
- ["github-copilot-cli", env.COPILOT_CLI === "1"]
24
+ ["qwen-code", env.QWEN_CODE === "1"],
25
+ ["github-copilot-cli", env.COPILOT_CLI === "1"],
26
+ ["antigravity", isNonEmpty(env.ANTIGRAVITY_AGENT)],
27
+ ["amp", isNonEmpty(env.AMP_CURRENT_THREAD_ID)],
28
+ ["cline", env.CLINE_ACTIVE === "true"],
29
+ ["openclaw", env.OPENCLAW_SHELL === "exec"]
17
30
  ].filter(([, present]) => present);
18
- return active.length === 1 ? active[0][0] : void 0;
31
+ if (active.length > 0) return active.length === 1 ? active[0][0] : void 0;
32
+ const declared = env.AI_AGENT?.trim().toLowerCase();
33
+ return declared && AI_AGENT_NAME.test(declared) ? declared : void 0;
19
34
  };
20
35
  const getGithubEnvVars = (env) => {
21
36
  const vars = [
@@ -38,4 +53,4 @@ const getGithubEnvVars = (env) => {
38
53
  });
39
54
  return Object.fromEntries(map);
40
55
  };
41
- export { getCliAgent, getGithubEnvVars, isCi, isDebug, isInteractiveTerminal };
56
+ export { getCliAgent, getGithubEnvVars, getTty, isCi, isDebug, isInteractiveTerminal };
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.");