neon 8.23.1 → 8.23.3

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 (40) hide show
  1. package/README.md +5 -8
  2. package/dist/_chunks/{bootstrap-Dh7-KDmw.js → bootstrap-B73qVB39.js} +3 -2
  3. package/dist/_chunks/{checkout-CNBIS3gA.js → checkout-Bsfl-B0h.js} +3 -3
  4. package/dist/_chunks/{claim-DhV0f_5o.js → claim-B3tMeMuo.js} +1 -1
  5. package/dist/_chunks/{config-CgtJH8xE.js → config-DZ3cDaOS.js} +11 -9
  6. package/dist/_chunks/{deploy-Bs5gmi4Q.js → deploy-CF4PxuNX.js} +1 -1
  7. package/dist/_chunks/{dev-DxiIp4c9.js → dev-BnHQENZM.js} +3 -3
  8. package/dist/_chunks/{git-DRUZBCmZ.js → git-CRYW7ku0.js} +2 -2
  9. package/dist/_chunks/{link-CNO-HxHN.js → link-VYCSKqU-.js} +2 -2
  10. package/dist/_chunks/{plugins-7cxVcgay.js → plugins-BwUZQ6Ic.js} +10 -24
  11. package/dist/_chunks/{status-BlrzeKyA.js → status-rt-0bUaQ.js} +1 -1
  12. package/dist/commands/bootstrap.js +1 -1
  13. package/dist/commands/checkout.js +1 -1
  14. package/dist/commands/claim.js +1 -1
  15. package/dist/commands/config.js +1 -1
  16. package/dist/commands/deploy.js +1 -1
  17. package/dist/commands/dev.js +1 -1
  18. package/dist/commands/env.js +1 -1
  19. package/dist/commands/functions_new.js +3 -3
  20. package/dist/commands/git.js +1 -1
  21. package/dist/commands/index.js +11 -11
  22. package/dist/commands/link.js +1 -1
  23. package/dist/commands/plugins.js +1 -1
  24. package/dist/commands/status.js +1 -1
  25. package/dist/commands/subscribe.js +1 -1
  26. package/dist/errors.js +18 -2
  27. package/dist/init/auth.js +1 -1
  28. package/dist/init/copy.js +2 -2
  29. package/dist/init/deploy.js +1 -1
  30. package/dist/init/funnel.js +2 -1
  31. package/dist/init/link.js +1 -1
  32. package/dist/init/plan.js +20 -13
  33. package/dist/init/run.js +9 -21
  34. package/dist/init/tooling.js +1 -2
  35. package/dist/plugins/plan.js +19 -34
  36. package/dist/plugins/run.js +8 -5
  37. package/dist/plugins/targets.js +13 -20
  38. package/dist/utils/package_manager.js +126 -7
  39. package/package.json +5 -5
  40. package/dist/_chunks/{env-BtG4vH55.js → env-BOt9AZ1j.js} +1 -1
package/README.md CHANGED
@@ -1047,27 +1047,24 @@ neon docs search "pg_dump" --limit 5 --output json
1047
1047
 
1048
1048
  ## Install the Neon plugin (`plugins`)
1049
1049
 
1050
- `neon plugins` installs the Neon agent plugin (`neon-postgres`) by running `npx plugins add`. It does not call the Neon API.
1050
+ `neon plugins` installs the Neon agent plugin (`neon-postgres`) by running a pinned version of the plugins CLI (`npx plugins@<version> add ... -s user`). It does not call the Neon API.
1051
1051
 
1052
1052
  ```bash
1053
1053
  # Interactive: pick agents, then install.
1054
1054
  $ neon plugins
1055
1055
 
1056
- # Skip prompts. Detected agents (project folders, else the host CLI agent).
1056
+ # Skip prompts. Detected agents (project folders, else the host CLI agent, else installed apps).
1057
1057
  $ neon plugins -y
1058
1058
 
1059
1059
  # Named agents.
1060
1060
  $ neon plugins --agent cursor --agent claude-code
1061
-
1062
- # User-level install.
1063
- $ neon plugins --global
1064
1061
  ```
1065
1062
 
1066
- On a TTY the command asks which agents, then installs. Detected agents start selected from project-folder markers such as `.cursor`. There is one plugin (`neon-postgres`); there is no plugin picker and no `update` subcommand.
1063
+ On a TTY the command asks which agents, then installs. Detected agents start selected from project-folder markers such as `.cursor`, else from installed apps. There is one plugin (`neon-postgres`); there is no plugin picker and no `update` subcommand.
1067
1064
 
1068
- `-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.
1065
+ `-y` skips those questions and installs into detected agents: project-folder markers such as `.cursor`, else the agent driving the CLI, else installed apps. `--agent` / `-a` names coding agents and skips the agent picker. 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.
1069
1066
 
1070
- 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.
1067
+ The plugin always installs user-level, so it applies to every project for that agent. On macOS and Linux, Cursor and Claude Code store the plugin cache under `~/.claude/plugins`; on Windows, Cursor installs into Cursor extensions. `--global` is still accepted for existing scripts, does the same as the default, and is no longer listed in `--help`.
1071
1068
 
1072
1069
  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.
1073
1070
 
@@ -8,10 +8,11 @@ import { resolveEnvFilePath } from "../env_file.js";
8
8
  import { formatInstallCommand, inferPackageManager, installArgs, installedPackageManagers, resolvePackageManager, runCommand } from "../utils/package_manager.js";
9
9
  import { writer } from "../writer.js";
10
10
  import { BootstrapInputError, FALLBACK_TEMPLATES, ensureTargetUsable, fetchTemplates, findTemplate, scaffoldTemplate, templateIds } from "../init/bootstrap.js";
11
+ import { bootstrapPluginAgents } from "../plugins/targets.js";
11
12
  import { agentSetupDoneLabel, formatInitDone, printInitBanner, printInitDone, shouldPrintInitBanner } from "../init/chrome.js";
12
13
  import { runAuthenticatedLink } from "../init/link.js";
13
14
  import { coerceAgentFlag } from "../utils/agent_flag.js";
14
- import { assertNamedAgentTooling, chooseYesAgentTooling, initPluginAgents, initSkillsMcpAgents, postScaffoldActions, projectContextFile, resolveNamedAgents } from "../init/plan.js";
15
+ import { assertNamedAgentTooling, bootstrapSkillsMcpAgents, chooseYesAgentTooling, postScaffoldActions, projectContextFile, resolveNamedAgents } from "../init/plan.js";
15
16
  import { formatTemplateTitle } from "../init/template_title.js";
16
17
  import { pickAgentSetupInteractively, pickInitLinkInteractively } from "../init/wizard.js";
17
18
  import { runAgentTooling } from "../init/tooling.js";
@@ -84,7 +85,7 @@ const builder = (argv) => argv.usage("$0 bootstrap [directory] [options]").posit
84
85
  type: "boolean",
85
86
  default: false
86
87
  }
87
- }).example("$0 bootstrap my-app", "Create ./my-app from an interactively chosen template").example("$0 bootstrap . --template hono", "Scaffold the Hono template into the current directory").example("$0 bootstrap my-app --default", "Skip the pickers; if several orgs or projects exist, link prints IDs and exits").example("$0 bootstrap my-app --template hono --default --deploy", "Scaffold, install, link, and deploy without prompting").example("$0 bootstrap --list-templates --output json", "Print the template catalog as JSON").example("$0 bootstrap my-app --agent cursor --agent claude-code", "Skip agent selection; install the plugin for those agents").epilogue(helpEpilogue("--agent / -a is forwarded to plugins, or to skills and mcp, not both. It skips agent selection, including with --default.", helpCsv("Plugin agents", initPluginAgents()), helpCsv("Skills and MCP agents", initSkillsMcpAgents()))).strict();
88
+ }).example("$0 bootstrap my-app", "Create ./my-app from an interactively chosen template").example("$0 bootstrap . --template hono", "Scaffold the Hono template into the current directory").example("$0 bootstrap my-app --default", "Skip the pickers; if several orgs or projects exist, link prints IDs and exits").example("$0 bootstrap my-app --template hono --default --deploy", "Scaffold, install, link, and deploy without prompting").example("$0 bootstrap --list-templates --output json", "Print the template catalog as JSON").example("$0 bootstrap my-app --agent cursor --agent claude-code", "Skip agent selection; install the plugin for those agents").epilogue(helpEpilogue("--agent / -a is forwarded to plugins, or to skills and mcp, not both. It skips agent selection, including with --default.", helpCsv("Plugin agents", bootstrapPluginAgents()), helpCsv("Skills and MCP agents", bootstrapSkillsMcpAgents()))).strict();
88
89
  const handler = async (props) => {
89
90
  if (props.listTemplates) {
90
91
  const templates = await fetchTemplates();
@@ -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-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";
14
+ import { n as autoPullEnvAfterPin } from "./env-BOt9AZ1j.js";
15
+ import { a as applyPolicyOnCreate, f as envFlag, l as createBranchFromPolicyOnCheckout } from "./config-DZ3cDaOS.js";
16
+ import { i as handler$1 } from "./link-VYCSKqU-.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-BtG4vH55.js";
15
+ import { c as pull } from "./env-BOt9AZ1j.js";
16
16
  import { existsSync, readFileSync, unlinkSync, writeFileSync } from "node:fs";
17
17
  import open from "open";
18
18
  import prompts from "prompts";
@@ -5,6 +5,7 @@ import { getApiClient } from "../api.js";
5
5
  import { r as defaultDir } from "./paths-B55ZfOg1.js";
6
6
  import "../config.js";
7
7
  import { contextBranch, ensureDirectoryGitignored, readContextFile } from "../context.js";
8
+ import { DetailedError } from "../errors.js";
8
9
  import { getCliName } from "../utils/cli_name.js";
9
10
  import { l as existingApiClient } from "./auth-rup6nemJ.js";
10
11
  import { NEON_SERVICES, NEON_SERVICE_LABELS, deprecatedServiceMessage, servicesFlagValue, servicesOption } from "../neon_services.js";
@@ -14,7 +15,7 @@ import { toNeonConfigView } from "../config_format.js";
14
15
  import { declaredNeonServices } from "../config_services.js";
15
16
  import { loadProjectConfig, neonConfigFilename, projectConfigPath, projectDir } from "../project.js";
16
17
  import { loadEnvFileIntoProcess } from "../env_file.js";
17
- import { formatInstallCommand, installArgs, resolvePackageManager, runCommand } from "../utils/package_manager.js";
18
+ import { formatInstallCommand, installArgs, resolvePackageManager, runCommandWithDetail } from "../utils/package_manager.js";
18
19
  import { writer } from "../writer.js";
19
20
  import { fillSingleProject, resolveBranchRef } from "../utils/enrichers.js";
20
21
  import { assertAiGatewayProvisionable, warnAiGateway } from "../utils/ai_gateway_notice.js";
@@ -26,7 +27,7 @@ import { readGitContext } from "../utils/git.js";
26
27
  import { resolveHookEnv, runDeployAfterHook, runDeployBeforeHook } from "../utils/hooks.js";
27
28
  import { pickServicesInteractively } from "../utils/service_picker.js";
28
29
  import { zipBundle } from "../utils/zip.js";
29
- import { n as autoPullEnvAfterPin } from "./env-BtG4vH55.js";
30
+ import { n as autoPullEnvAfterPin } from "./env-BOt9AZ1j.js";
30
31
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
31
32
  import { dirname, join, relative, resolve } from "node:path";
32
33
  import chalk from "chalk";
@@ -128,9 +129,9 @@ const DEPENDENCY_FIELDS = [
128
129
  "peerDependencies",
129
130
  "optionalDependencies"
130
131
  ];
131
- var ConfigInstallFailed = class extends Error {
132
- constructor(command) {
133
- super("Could not install the Neon dependencies.");
132
+ var ConfigInstallFailed = class extends DetailedError {
133
+ constructor(command, pm, detail) {
134
+ super(`Could not install the Neon dependencies with ${pm} (${detail}).`, detail);
134
135
  this.name = "ConfigInstallFailed";
135
136
  this.command = command;
136
137
  }
@@ -268,7 +269,7 @@ const installCommandFrom = (dir, pm, missing, options) => {
268
269
  };
269
270
  /** Install the config packages the project is missing, or say how to. */
270
271
  const ensureConfigPackages = async (cwd, props) => {
271
- const run = props.run ?? runCommand;
272
+ const run = props.run ?? runCommandWithDetail;
272
273
  const missing = missingDependencies(cwd);
273
274
  if (missing.length === 0) {
274
275
  if (!props.silent) log.info("%s are already installed.", REQUIRED_PACKAGES.join(" and "));
@@ -288,9 +289,10 @@ const ensureConfigPackages = async (cwd, props) => {
288
289
  }
289
290
  ensureDirectoryGitignored(join(cwd, "node_modules"));
290
291
  if (!props.silent) log.info("Installing %s with %s…", missing.join(", "), pm);
291
- if (!await run(pm, args, cwd)) {
292
- if (props.requireInstall) throw new ConfigInstallFailed(installHint);
293
- log.warning("Could not install the config packages automatically. Run by hand: %s", installHint);
292
+ const result = await run(pm, args, cwd);
293
+ if (!result.ok) {
294
+ if (props.requireInstall) throw new ConfigInstallFailed(installHint, pm, result.detail);
295
+ log.warning("Could not install the config packages automatically with %s (%s). Run by hand: %s", pm, result.detail, installHint);
294
296
  }
295
297
  };
296
298
  /**
@@ -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-CgtJH8xE.js";
3
+ import { f as envFlag, i as applyFlags, p as envPullFlag, r as applyCmd } from "./config-DZ3cDaOS.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";
9
7
  import { a as resolveDevEnv } from "./env-CIFMBEon.js";
10
- import { f as envFlag } from "./config-CgtJH8xE.js";
11
8
  import { findConfigFunctionBySource, resolveFunctionsFromConfig } from "../dev/functions.js";
12
9
  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-DZ3cDaOS.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";
@@ -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-CNO-HxHN.js";
9
- import { o as handler$1 } from "./checkout-CNBIS3gA.js";
8
+ import { o as quoteFlagValue } from "./link-VYCSKqU-.js";
9
+ import { o as handler$1 } from "./checkout-Bsfl-B0h.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-BtG4vH55.js";
17
- import { h as initCmd } from "./config-CgtJH8xE.js";
16
+ import { n as autoPullEnvAfterPin } from "./env-BOt9AZ1j.js";
17
+ import { h as initCmd } from "./config-DZ3cDaOS.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";
@@ -32,23 +32,20 @@ const coerceAgents = (value) => {
32
32
  return item;
33
33
  });
34
34
  };
35
- const scopeLabel = (scope) => scope === "project" ? "project" : "user";
36
35
  const command = "plugins";
37
36
  const aliases = ["plugin"];
38
37
  const describe = "Install the Neon plugin into coding agents";
39
- const pluginProjectAgents = pluginsInstallableAgents("project");
40
- const pluginGlobalOnlyAgents = pluginsInstallableAgents("global").filter((id) => !pluginProjectAgents.includes(id));
41
38
  const builder = (argv) => argv.usage("$0 plugins [options]").options({
42
39
  yes: {
43
40
  alias: "y",
44
41
  type: "boolean",
45
42
  default: false,
46
- describe: "Skip prompts. Detected agents (project folders, else the host CLI agent). --global uses installed apps, else the host CLI agent"
43
+ describe: "Skip prompts. Detected agents (project folders, else the host CLI agent, else installed apps)"
47
44
  },
48
45
  global: {
49
46
  type: "boolean",
50
47
  default: false,
51
- describe: "Install user-level. Default is project"
48
+ hidden: true
52
49
  },
53
50
  agent: {
54
51
  alias: "a",
@@ -57,7 +54,7 @@ const builder = (argv) => argv.usage("$0 plugins [options]").options({
57
54
  describe: "Coding agent to install into (repeatable). Skips the agent picker. Values listed below",
58
55
  coerce: coerceAgents
59
56
  }
60
- }).example("$0 plugins", "Interactive: pick agents, then install").example("$0 plugins -y", "Detected agents (project folders, else the host CLI agent), skip prompts").example("$0 plugins --agent cursor --agent claude-code", "Install into specific agents").example("$0 plugins --global", "Install user-level").epilogue(helpEpilogue(helpCsv("Supported agents at project scope", pluginProjectAgents), helpCsv("Also with --global", pluginGlobalOnlyAgents), `Currently one plugin: ${NEON_PLUGIN_NAME} from ${PLUGIN_SOURCE}.`, `It includes the Neon MCP server (${NEON_MCP_URL})`, helpCsv("and these skills", PLUGIN_SKILLS))).strict().check(noPassthrough("plugins"));
57
+ }).example("$0 plugins", "Interactive: pick agents, then install").example("$0 plugins -y", "Detected agents (project folders, else the host CLI agent, else installed apps), skip prompts").example("$0 plugins --agent cursor --agent claude-code", "Install into specific agents").epilogue(helpEpilogue(helpCsv("Supported agents", pluginsInstallableAgents()), "The plugin installs user-level, so it applies to every project.", `Currently one plugin: ${NEON_PLUGIN_NAME} from ${PLUGIN_SOURCE}.`, `It includes the Neon MCP server (${NEON_MCP_URL})`, helpCsv("and these skills", PLUGIN_SKILLS))).strict().check(noPassthrough("plugins"));
61
58
  /**
62
59
  * Plans and runs the plugin install for every resolved target. No CLI-only concerns here
63
60
  * (no `writer` table, no `recordCommandSuccessExtras`): a caller that only wants the
@@ -68,7 +65,6 @@ const installPlugins = async (options) => {
68
65
  const yes = options.yes === true;
69
66
  const interactive = canPickAgentsInteractively() && !yes;
70
67
  const plan = await resolvePluginsPlan({
71
- global: options.global === true,
72
68
  agents: options.agents ?? [],
73
69
  yes,
74
70
  cwd,
@@ -76,16 +72,11 @@ const installPlugins = async (options) => {
76
72
  pickAgents: skippableAgentPicker(options.allowAgentSkip, AGENT_PLUGIN_SKIP_MESSAGE)
77
73
  });
78
74
  for (const agent of plan.skipped) log.warning("Skipping %s: no plugins mapping.", getAgentDisplayName(agent));
79
- for (const agent of plan.userScopeSkipped) log.warning("Skipping %s: plugins are user-level. Pass --global.", getAgentDisplayName(agent));
80
75
  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
76
  const rows = [];
82
77
  const failed = [];
83
- const scope = scopeLabel(plan.scope);
84
78
  for (const [index, mapped] of plan.targets.entries()) {
85
- const args = pluginsAddArgs({
86
- target: mapped.target,
87
- global: plan.scope === "global"
88
- });
79
+ const args = pluginsAddArgs({ target: mapped.target });
89
80
  const agent = mapped.agents.join(", ");
90
81
  const displayNames = mapped.agents.map((id) => getAgentDisplayName(id)).join(", ");
91
82
  log.info("Installing the Neon plugin for %s (%d/%d)...", displayNames, index + 1, plan.targets.length);
@@ -95,7 +86,7 @@ const installPlugins = async (options) => {
95
86
  cwd
96
87
  });
97
88
  rows.push({
98
- scope,
89
+ scope: "user",
99
90
  plugin: NEON_PLUGIN_NAME,
100
91
  agent,
101
92
  status: "installed"
@@ -103,7 +94,7 @@ const installPlugins = async (options) => {
103
94
  } catch (error) {
104
95
  const message = error instanceof Error ? error.message : String(error);
105
96
  rows.push({
106
- scope,
97
+ scope: "user",
107
98
  plugin: NEON_PLUGIN_NAME,
108
99
  agent,
109
100
  status: "failed",
@@ -116,21 +107,17 @@ const installPlugins = async (options) => {
116
107
  }
117
108
  }
118
109
  return {
119
- scope: plan.scope,
120
110
  rows,
121
111
  failed
122
112
  };
123
113
  };
124
114
  /** The exact error `neon plugins` throws for a failed outcome, or `undefined` on success. */
125
115
  const pluginsInstallError = (outcome) => {
126
- const { failed, rows, scope } = outcome;
116
+ const { failed, rows } = outcome;
127
117
  if (failed.length === 0) return;
128
118
  const first = failed[0];
129
119
  if (first === void 0) return /* @__PURE__ */ new Error("Failed to install the Neon plugin.");
130
- const retry = neonPluginsRetryCommand({
131
- agents: failed.flatMap((row) => row.agents),
132
- global: scope === "global"
133
- });
120
+ const retry = neonPluginsRetryCommand({ agents: failed.flatMap((row) => row.agents) });
134
121
  if (first.message.includes("needs npx (Node.js)")) return new Error(first.message);
135
122
  const detail = [...new Set(failed.map((row) => row.message))].join("\n");
136
123
  if (failed.length === rows.length) return /* @__PURE__ */ new Error(`${detail}\nRetry with: ${retry}`);
@@ -151,18 +138,17 @@ const reportPluginsInstall = (props, outcome) => {
151
138
  });
152
139
  out.end();
153
140
  if (outcome.rows.length === 0) log.info("No Neon plugins installed.");
154
- else if (outcome.failed.length === 0) log.info(outcome.scope === "project" ? "Installed the Neon plugin (project)." : "Installed the Neon plugin (user).");
141
+ else if (outcome.failed.length === 0) log.info("Installed the Neon plugin (user).");
155
142
  };
156
143
  const handler = async (props) => {
157
144
  const outcome = await installPlugins({
158
145
  cwd: props.cwd,
159
146
  yes: props.yes,
160
- global: props.global,
161
147
  agents: props.agent
162
148
  });
163
149
  reportPluginsInstall(props, outcome);
164
150
  const error = pluginsInstallError(outcome);
165
151
  if (error) throw error;
166
- recordCommandSuccessExtras({ scope: outcome.scope });
152
+ recordCommandSuccessExtras({ scope: "global" });
167
153
  };
168
154
  export { handler as a, plugins_exports as c, describe as i, reportPluginsInstall as l, builder as n, installPlugins as o, command as r, pluginsInstallError 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-CgtJH8xE.js";
3
+ import { y as status } from "./config-DZ3cDaOS.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-Dh7-KDmw.js";
1
+ export { n as builder, r as command, i as describe, a as handler } from "../_chunks/bootstrap-B73qVB39.js";
@@ -1 +1 @@
1
- export { t as builder, r as command, i as describe, a as formatCheckoutPolicyFailure, o as handler } from "../_chunks/checkout-CNBIS3gA.js";
1
+ export { t as builder, r as command, i as describe, a as formatCheckoutPolicyFailure, o as handler } from "../_chunks/checkout-Bsfl-B0h.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-DhV0f_5o.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-B3tMeMuo.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-CgtJH8xE.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-DZ3cDaOS.js";
@@ -1 +1 @@
1
- export { t as builder, n as command, i as describe, a as handler } from "../_chunks/deploy-Bs5gmi4Q.js";
1
+ export { t as builder, n as command, i as describe, a as handler } from "../_chunks/deploy-CF4PxuNX.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-DxiIp4c9.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-BnHQENZM.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-BtG4vH55.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-BOt9AZ1j.js";
@@ -3,12 +3,12 @@ import { log } from "../log.js";
3
3
  import { getCliName } from "../utils/cli_name.js";
4
4
  import { projectConfigPath, projectDir } from "../project.js";
5
5
  import { resolveEnvFilePath } from "../env_file.js";
6
- import { installArgs, resolvePackageManager, runCommand } from "../utils/package_manager.js";
6
+ import { installArgs, resolvePackageManager, runCommandWithDetail } from "../utils/package_manager.js";
7
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-CgtJH8xE.js";
11
+ import { _ as missingDependencies, d as ensureConfigPackages, g as installCommandFrom } from "../_chunks/config-DZ3cDaOS.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";
@@ -143,7 +143,7 @@ const scaffoldFromTemplate = async (options) => {
143
143
  });
144
144
  let installed = false;
145
145
  if (install && dependencies.length > 0) {
146
- installed = await (options.run ?? runCommand)(pm, installArgs(pm, dependencies, { exact: true }), projectRoot);
146
+ installed = (await (options.run ?? runCommandWithDetail)(pm, installArgs(pm, dependencies, { exact: true }), projectRoot)).ok;
147
147
  if (!installed) log.warning("Could not install %s. Run by hand: `%s`", dependencies.join(", "), installHint(dependencies, true));
148
148
  }
149
149
  const cli = getCliName();
@@ -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-DRUZBCmZ.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-CRYW7ku0.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-CTFHd5m_.js";
4
4
  import { n as ask_exports } from "../_chunks/ask-Xlek1Pxh.js";
5
- import { o as env_exports } from "../_chunks/env-BtG4vH55.js";
6
- import { c as config_exports } from "../_chunks/config-CgtJH8xE.js";
5
+ import { o as env_exports } from "../_chunks/env-BOt9AZ1j.js";
6
+ import { c as config_exports } from "../_chunks/config-DZ3cDaOS.js";
7
7
  import { u as projects_exports } from "../_chunks/projects-a3X4OFEJ.js";
8
- import { a as link_exports } from "../_chunks/link-CNO-HxHN.js";
8
+ import { a as link_exports } from "../_chunks/link-VYCSKqU-.js";
9
9
  import { o as mcp_exports } from "../_chunks/mcp-SvqWzHnT.js";
10
- import { c as plugins_exports } from "../_chunks/plugins-7cxVcgay.js";
10
+ import { c as plugins_exports } from "../_chunks/plugins-BwUZQ6Ic.js";
11
11
  import { l as skills_exports } from "../_chunks/skills-Bv8oKKwE.js";
12
- import { t as bootstrap_exports } from "../_chunks/bootstrap-Dh7-KDmw.js";
12
+ import { t as bootstrap_exports } from "../_chunks/bootstrap-B73qVB39.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-CNBIS3gA.js";
16
- import { o as claim_exports } from "../_chunks/claim-DhV0f_5o.js";
15
+ import { n as checkout_exports } from "../_chunks/checkout-Bsfl-B0h.js";
16
+ import { o as claim_exports } from "../_chunks/claim-B3tMeMuo.js";
17
17
  import { o as connection_string_exports } from "../_chunks/connection_string-6WhV4WFx.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
20
  import { s as databases_exports } from "../_chunks/databases-B-qY303S.js";
21
- import { r as deploy_exports } from "../_chunks/deploy-Bs5gmi4Q.js";
22
- import { s as dev_exports } from "../_chunks/dev-DxiIp4c9.js";
21
+ import { r as deploy_exports } from "../_chunks/deploy-CF4PxuNX.js";
22
+ import { s as dev_exports } from "../_chunks/dev-BnHQENZM.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
26
  import { o as functions_exports } from "../_chunks/functions-PHaU-kRb.js";
27
- import { o as git_exports } from "../_chunks/git-DRUZBCmZ.js";
27
+ import { o as git_exports } from "../_chunks/git-CRYW7ku0.js";
28
28
  import { a as init_exports } from "../_chunks/init-D2fClHtC.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";
@@ -40,7 +40,7 @@ import { o as profile_exports } from "../_chunks/profile-CArcjyS4.js";
40
40
  import { s as realtime_exports } from "../_chunks/realtime-BwtzYf5a.js";
41
41
  import { a as set_context_exports } from "../_chunks/set_context-ompB6d2D.js";
42
42
  import { s as snapshots_exports } from "../_chunks/snapshots-DxNhjcco.js";
43
- import { a as status_exports } from "../_chunks/status-BlrzeKyA.js";
43
+ import { a as status_exports } from "../_chunks/status-rt-0bUaQ.js";
44
44
  import { d as triggers_exports } from "../_chunks/triggers-BfvyeJUC.js";
45
45
  import { s as user_exports } from "../_chunks/user-D9mC430O.js";
46
46
  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-CNO-HxHN.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-VYCSKqU-.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-7cxVcgay.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-BwUZQ6Ic.js";
@@ -1 +1 @@
1
- export { t as builder, n as command, r as describe, i as handler } from "../_chunks/status-BlrzeKyA.js";
1
+ export { t as builder, n as command, r as describe, i as handler } from "../_chunks/status-rt-0bUaQ.js";
@@ -1,6 +1,6 @@
1
1
  import { writer } from "../writer.js";
2
- import { branchIdFromProps } from "../utils/enrichers.js";
3
2
  import { o as resolveNeonEnvVars } from "../_chunks/env-CIFMBEon.js";
3
+ import { branchIdFromProps } from "../utils/enrichers.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/errors.js CHANGED
@@ -1,9 +1,25 @@
1
1
  // src/errors.ts
2
+ /** An error whose cause is known as a bounded code (`ERESOLVE`, `ENOENT`, `exit code 1`). */
3
+ var DetailedError = class extends Error {
4
+ constructor(message, detail) {
5
+ super(message);
6
+ this.detail = detail;
7
+ }
8
+ };
2
9
  const ERROR_MATCHERS = [
3
10
  [/^Unknown command: (.*)$/, "UNKNOWN_COMMAND"],
4
11
  [/^Missing required argument: (.*)$/, "MISSING_ARGUMENT"],
5
12
  [/^Failed to open web browser. (.*)$/, "AUTH_BROWSER_FAILED"],
6
- [/^Setup did not finish\.$/, "NEON_INIT_FAILED"]
13
+ [/^Setup did not finish\.$/, "NEON_INIT_FAILED"],
14
+ [/^No interactive terminal\./, "NON_INTERACTIVE"],
15
+ [/^Authentication timed out after /, "AUTH_TIMEOUT"],
16
+ [/^neon skills needs Node\.js /, "NODE_VERSION_UNSUPPORTED"],
17
+ [/needs npx \(Node\.js\)/, "NPX_NOT_FOUND"],
18
+ [/spawn git ENOENT/, "GIT_NOT_FOUND"],
19
+ [/^(Failed to install Neon agent skills|skills CLI failed)/, "SKILLS_CLI_FAILED"],
20
+ [/^Cannot install the Neon plugin for /, "AGENT_COMMAND_UNAVAILABLE"],
21
+ [/^(Failed to install the Neon plugin for: |plugins CLI (failed|timed out))/, "PLUGINS_CLI_FAILED"],
22
+ [/^Could not install the Neon dependencies/, "DEPENDENCY_INSTALL_FAILED"]
7
23
  ];
8
24
  const matchErrorCode = (message) => {
9
25
  if (!message) return "UNKNOWN_ERROR";
@@ -72,4 +88,4 @@ const isNetworkError = (err) => {
72
88
  }
73
89
  return false;
74
90
  };
75
- export { NETWORK_ERROR_MESSAGE, isNetworkError, isUnexpectedError, matchErrorCode };
91
+ export { DetailedError, NETWORK_ERROR_MESSAGE, isNetworkError, isUnexpectedError, matchErrorCode };
package/dist/init/auth.js CHANGED
@@ -4,7 +4,7 @@ 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-BtG4vH55.js";
7
+ import { c as pull } from "../_chunks/env-BOt9AZ1j.js";
8
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;
package/dist/init/copy.js CHANGED
@@ -136,9 +136,9 @@ const claimableThenServicesNext = (expiresAt) => [
136
136
  "Refresh local environment variables:",
137
137
  `${getCliName()} env pull`
138
138
  ];
139
- const installFailedNext = (command, envPull) => ({
139
+ const installFailedNext = (command, envPull, reason) => ({
140
140
  heading: HEADING_FAILED,
141
- body: "Could not install the Neon dependencies.",
141
+ body: reason,
142
142
  next: [
143
143
  "Install the dependencies, then run neon init again:",
144
144
  command,
@@ -4,7 +4,7 @@ import { c as ensureAuth } from "../_chunks/auth-rup6nemJ.js";
4
4
  import { recoverFrom401 } from "../auth_recovery.js";
5
5
  import { loadProjectConfig } from "../project.js";
6
6
  import { loadEnvFileIntoProcess } from "../env_file.js";
7
- import { r as applyCmd } from "../_chunks/config-CgtJH8xE.js";
7
+ import { r as applyCmd } from "../_chunks/config-DZ3cDaOS.js";
8
8
  import { authContext } from "./auth.js";
9
9
  import { existsSync } from "node:fs";
10
10
  // src/init/deploy.ts
@@ -1,6 +1,6 @@
1
1
  import pkg_default from "../pkg.js";
2
2
  import { codeFromBody, isNeonApiError } from "../api.js";
3
- import { isNetworkError, matchErrorCode } from "../errors.js";
3
+ import { DetailedError, isNetworkError, matchErrorCode } from "../errors.js";
4
4
  import { redactCredentialTokenIds, trackEvent } from "../analytics.js";
5
5
  import { AuthRefreshError } from "../auth.js";
6
6
  import { randomUUID } from "node:crypto";
@@ -110,6 +110,7 @@ const initEndProperties = (input) => {
110
110
  error_step: reported?.step ?? null,
111
111
  error_code: reported === void 0 ? null : initErrorCode(reported.error),
112
112
  error_message: reported === void 0 ? null : initErrorMessage(reported.error),
113
+ error_detail: reported?.error instanceof DetailedError ? reported.error.detail : null,
113
114
  error_steps: [...new Set(input.errors.map((entry) => entry.step))]
114
115
  };
115
116
  };
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-CNO-HxHN.js";
7
+ import { s as runLink } from "../_chunks/link-VYCSKqU-.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.");