neon 9.9.5 → 9.9.7

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 (34) hide show
  1. package/README.md +5 -1
  2. package/dist/_chunks/{api-1MKsfpY3.js → api-BZh2r_lx.js} +12 -4
  3. package/dist/_chunks/{bootstrap-B73qVB39.js → bootstrap-yotTpFtF.js} +2 -1
  4. package/dist/_chunks/{checkout-CLHGCpZx.js → checkout-CczPpuT9.js} +2 -1
  5. package/dist/_chunks/{functions-PHaU-kRb.js → functions-v9z7zjWD.js} +2 -1
  6. package/dist/_chunks/{git-CIXLNUoh.js → git-BZY1WeAw.js} +1 -1
  7. package/dist/_chunks/{neon_auth-mfyjde2x.js → neon_auth-DE6X6FFV.js} +3 -2
  8. package/dist/_chunks/{plugins-BwUZQ6Ic.js → plugins-CEylQlgK.js} +6 -2
  9. package/dist/_chunks/{snapshots-DxNhjcco.js → snapshots-BolN3uBz.js} +2 -1
  10. package/dist/commands/api.js +1 -1
  11. package/dist/commands/bootstrap.js +1 -1
  12. package/dist/commands/checkout.js +1 -1
  13. package/dist/commands/functions.js +1 -1
  14. package/dist/commands/functions_new.js +5 -1
  15. package/dist/commands/git.js +1 -1
  16. package/dist/commands/index.js +8 -8
  17. package/dist/commands/neon_auth.js +1 -1
  18. package/dist/commands/plugins.js +1 -1
  19. package/dist/commands/snapshots.js +1 -1
  20. package/dist/env_services.js +4 -18
  21. package/dist/errors.js +29 -1
  22. package/dist/functions/registry.js +5 -1
  23. package/dist/help.js +9 -1
  24. package/dist/init/plan.js +2 -1
  25. package/dist/init/tooling.js +1 -1
  26. package/dist/mcp/agents.js +2 -1
  27. package/dist/mcp/install.js +2 -1
  28. package/dist/mcp/plan.js +2 -1
  29. package/dist/neon_services.js +6 -4
  30. package/dist/plugins/plan.js +9 -2
  31. package/dist/plugins/targets.js +48 -25
  32. package/dist/skills/catalog.js +2 -1
  33. package/dist/skills/plan.js +2 -1
  34. package/package.json +1 -1
package/README.md CHANGED
@@ -507,7 +507,7 @@ The branch argument is **optional**: run `neon checkout` with no branch in an in
507
507
  Branch **id vs name** is detected automatically (a `br-…` value is treated as an id):
508
508
 
509
509
  - **id** — matched strictly by id. A non-existent id is a hard "not found" error (ids are server-assigned, so checkout never creates one, including with `--create`).
510
- - **name** — matched by name. If the name doesn't exist, pass `--create` to create it (equivalent to `neon branch create --name <name>`: branched from the project's default branch with a read-write compute, or from `neon.ts` when that file is present), then check it out. `--create` is a no-op when the name already exists. Without `--create`, an interactive terminal offers to create the branch; in CI or with no TTY the error names `--create`.
510
+ - **name** — matched by name. If the name doesn't exist, pass `--create` to create it (equivalent to `neon branch create --name <name>`: branched from the project's default branch with a read-write compute, or from `neon.ts` when that file is present), then check it out. When the name already exists, `--create` checks out that branch unchanged and prints a `WARNING:` line saying nothing was created; the exit code stays 0. Without `--create`, an interactive terminal offers to create the branch; in CI or with no TTY the error names `--create`.
511
511
 
512
512
  The project is resolved through the standard neon chain, each entry winning over the next:
513
513
 
@@ -527,6 +527,10 @@ $ neon checkout dev --create --project-id polished-snowflake-12345678
527
527
  Created branch dev (br-dev-branch-12345678).
528
528
  Checked out branch br-dev-branch-12345678 on project polished-snowflake-12345678. Updated /path/to/cwd/.neon.
529
529
 
530
+ $ neon checkout dev --create --project-id polished-snowflake-12345678
531
+ WARNING: Branch dev (br-dev-branch-12345678) already exists, so --create did not create a new one; checking out the existing branch unchanged. Pass a new name for a fresh branch.
532
+ Checked out branch br-dev-branch-12345678 on project polished-snowflake-12345678. Updated /path/to/cwd/.neon.
533
+
530
534
  $ cat .neon
531
535
  {
532
536
  "orgId": "org-abc123",
@@ -1,5 +1,6 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BJohB4LM.js";
2
2
  import { codeFromBody, isNeonApiError } from "../api.js";
3
+ import { REDACTED_INVALID_VALUE, didYouMean } from "../errors.js";
3
4
  import { writer } from "../writer.js";
4
5
  import { describeOperation, getEndpoints, loadSpec } from "../utils/openapi.js";
5
6
  import { readFileSync } from "node:fs";
@@ -47,7 +48,7 @@ function parseTypedValue(raw) {
47
48
  /** Split a `key=value` pair on the first `=`. */
48
49
  function parseKeyValue(input) {
49
50
  const eq = input.indexOf("=");
50
- if (eq === -1) throw new Error(`Invalid "key=value" pair: "${input}".`);
51
+ if (eq === -1) throw new Error(`Invalid "key=value" pair: ${REDACTED_INVALID_VALUE}.`);
51
52
  return {
52
53
  key: input.slice(0, eq),
53
54
  value: input.slice(eq + 1)
@@ -96,13 +97,20 @@ function parseHeaders(pairs) {
96
97
  const headers = {};
97
98
  for (const pair of pairs) {
98
99
  const idx = pair.indexOf(":");
99
- if (idx === -1) throw new Error(`Invalid header "${pair}". Expected "key:value".`);
100
- headers[pair.slice(0, idx).trim()] = pair.slice(idx + 1).trim();
100
+ if (idx === -1) throw new Error(`Invalid header ${REDACTED_INVALID_VALUE}. Expected "key:value".`);
101
+ const name = pair.slice(0, idx).trim();
102
+ const value = pair.slice(idx + 1).trim();
103
+ try {
104
+ new Headers().append(name, value);
105
+ } catch {
106
+ throw new Error(`Invalid header ${REDACTED_INVALID_VALUE}. Header names must be HTTP tokens and values cannot contain line breaks.`);
107
+ }
108
+ headers[name] = value;
101
109
  }
102
110
  return headers;
103
111
  }
104
112
  function assertMethod(method) {
105
- if (!HTTP_METHODS.includes(method)) throw new Error(`Unsupported method "${method}". Use one of: ${HTTP_METHODS.join(", ")}.`);
113
+ if (!HTTP_METHODS.includes(method)) throw new Error(`Unsupported method ${REDACTED_INVALID_VALUE}.${didYouMean([method], HTTP_METHODS)} Use one of: ${HTTP_METHODS.join(", ")}.`);
106
114
  }
107
115
  const JSON_TOKEN = /("(?:\\.|[^"\\])*")(\s*:)?|\b(true|false)\b|\bnull\b|-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g;
108
116
  /** Color the tokens of serialized JSON without changing a byte of the text itself. */
@@ -1,6 +1,7 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BJohB4LM.js";
2
2
  import { isCi } from "../env.js";
3
3
  import { log } from "../log.js";
4
+ import { REDACTED_INVALID_VALUE, didYouMean } from "../errors.js";
4
5
  import { recordCommandSuccessExtras, recordScaffoldedTemplate } from "../analytics.js";
5
6
  import { getCliName } from "../utils/cli_name.js";
6
7
  import { helpCsv, helpEpilogue } from "../utils/help_text.js";
@@ -137,7 +138,7 @@ const resolveTemplateList = async (props) => props.template && findTemplate(FALL
137
138
  const resolveSelectedTemplate = async (props, interactive, templates) => {
138
139
  if (props.template) {
139
140
  const template = findTemplate(templates, props.template);
140
- if (!template) throw new Error(`Unknown template "${props.template}". Available templates: ${templateIds(templates)}.`);
141
+ if (!template) throw new Error(`Unknown template ${REDACTED_INVALID_VALUE}.${didYouMean([props.template], templates.map((candidate) => candidate.id))} Available templates: ${templateIds(templates)}.`);
141
142
  return template;
142
143
  }
143
144
  if (props.default) {
@@ -50,7 +50,7 @@ const builder = (argv) => argv.usage("$0 checkout [id|name] [options]").position
50
50
  default: true
51
51
  },
52
52
  create: {
53
- describe: "Create the named branch if it does not exist, then check it out",
53
+ describe: "Create the named branch if it does not exist, then check it out. New branches start from the parent set in neon.ts, else the project's default branch. An existing branch is checked out unchanged.",
54
54
  type: "boolean",
55
55
  default: false
56
56
  },
@@ -106,6 +106,7 @@ const handler = async (props) => {
106
106
  cwd
107
107
  });
108
108
  const orgId = await (orgRead ?? resolveOrgId(props, projectId));
109
+ if (props.create && !created) log.warning("Branch %s (%s) already exists, so --create did not create a new one; checking out the existing branch unchanged. Pass a new name for a fresh branch.", branchName, branchId);
109
110
  applyContext(props.contextFile, {
110
111
  projectId,
111
112
  ...orgId ? { orgId } : {},
@@ -1,6 +1,7 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BJohB4LM.js";
2
2
  import { log } from "../log.js";
3
3
  import { isNeonApiError, retryOnLock } from "../api.js";
4
+ import { REDACTED_INVALID_VALUE } from "../errors.js";
4
5
  import { getCliName } from "../utils/cli_name.js";
5
6
  import { deleteCustomDomain, listCustomDomains, registerCustomDomain } from "../custom_domains_api.js";
6
7
  import { createDeployment, deleteFunction, getFunction, listFunctions } from "../functions_api.js";
@@ -219,7 +220,7 @@ const parseEnv = (entries) => {
219
220
  const map = {};
220
221
  for (const entry of entries) {
221
222
  const eq = entry.indexOf("=");
222
- if (eq <= 0) throw new Error(`Invalid --env value "${entry}". Expected KEY=VALUE.`);
223
+ if (eq <= 0) throw new Error(`Invalid --env value ${REDACTED_INVALID_VALUE}. Expected KEY=VALUE.`);
223
224
  map[entry.slice(0, eq)] = entry.slice(eq + 1);
224
225
  }
225
226
  return JSON.stringify(map);
@@ -6,7 +6,7 @@ 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
8
  import { o as quoteFlagValue } from "./link-BVa6Nfji.js";
9
- import { o as handler$1 } from "./checkout-CLHGCpZx.js";
9
+ import { o as handler$1 } from "./checkout-CczPpuT9.js";
10
10
  import { existsSync } from "node:fs";
11
11
  import { join } from "node:path";
12
12
  import chalk from "chalk";
@@ -1,6 +1,7 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BJohB4LM.js";
2
2
  import { log } from "../log.js";
3
3
  import { codeFromBody, isNeonApiError, retryOnLock } from "../api.js";
4
+ import { REDACTED_INVALID_VALUE, didYouMean } from "../errors.js";
4
5
  import { stripAnsi } from "../human_table.js";
5
6
  import { writer } from "../writer.js";
6
7
  import { noPassthrough, single } from "../utils/flags.js";
@@ -1356,8 +1357,8 @@ const pluginsGet = async (props) => {
1356
1357
  }));
1357
1358
  const plugin = data[props.pluginName];
1358
1359
  if (plugin === void 0) {
1359
- const available = Object.keys(data).join(", ");
1360
- throw new Error(`Unknown plugin "${props.pluginName}". Available plugins: ${available}`);
1360
+ const available = Object.keys(data);
1361
+ throw new Error(`Unknown plugin ${REDACTED_INVALID_VALUE}.${didYouMean([props.pluginName], available)} Available plugins: ${available.join(", ")}`);
1361
1362
  }
1362
1363
  if (props.output === "json" || props.output === "yaml") {
1363
1364
  const fields = typeof plugin === "object" && !Array.isArray(plugin) ? Object.keys(plugin) : [];
@@ -6,11 +6,11 @@ import { writer } from "../writer.js";
6
6
  import { noPassthrough } from "../utils/flags.js";
7
7
  import { getAgentDisplayName } from "../mcp/agents.js";
8
8
  import "../init/agents.js";
9
- import { pluginsCommandProblemText, pluginsInstallableAgents } from "../plugins/targets.js";
9
+ import { pluginsCommandProblemText, pluginsGitProblem, pluginsInstallableAgents } from "../plugins/targets.js";
10
10
  import { AGENT_PLUGIN_SKIP_MESSAGE } from "../init/copy.js";
11
11
  import { NEON_MCP_URL } from "../mcp/install.js";
12
12
  import { canPickAgentsInteractively, skippableAgentPicker } from "../utils/agent_picker.js";
13
- import { resolvePluginsPlan } from "../plugins/plan.js";
13
+ import { pluginsGitError, resolvePluginsPlan } from "../plugins/plan.js";
14
14
  import { NEON_PLUGIN_NAME, PLUGIN_SKILLS, PLUGIN_SOURCE, neonPluginsRetryCommand, pluginsAddArgs, runPluginsCli } from "../plugins/run.js";
15
15
  // src/commands/plugins.ts
16
16
  var plugins_exports = /* @__PURE__ */ __exportAll({
@@ -73,6 +73,10 @@ const installPlugins = async (options) => {
73
73
  });
74
74
  for (const agent of plan.skipped) log.warning("Skipping %s: no plugins mapping.", getAgentDisplayName(agent));
75
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));
76
+ if (plan.targets.length > 0) {
77
+ const git = pluginsGitProblem({ cwd });
78
+ if (git !== void 0) throw pluginsGitError(git);
79
+ }
76
80
  const rows = [];
77
81
  const failed = [];
78
82
  for (const [index, mapped] of plan.targets.entries()) {
@@ -1,6 +1,7 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BJohB4LM.js";
2
2
  import { log } from "../log.js";
3
3
  import { isNeonApiError, retryOnLock } from "../api.js";
4
+ import { REDACTED_INVALID_VALUE, didYouMean } from "../errors.js";
4
5
  import { writer } from "../writer.js";
5
6
  import { looksLikeBranchId, looksLikeLSN, looksLikeSnapshotId, looksLikeTimestamp, toIso } from "../utils/formats.js";
6
7
  import { branchIdResolve, fillSingleProject, resolveBranchRef } from "../utils/enrichers.js";
@@ -300,7 +301,7 @@ const parseScheduleJson = (raw) => {
300
301
  const record = entry;
301
302
  const frequency = record.frequency;
302
303
  if (typeof frequency !== "string") throw new Error(`--schedule entry ${index} is missing a string "frequency".`);
303
- if (!isSnapshotFrequency(frequency)) throw new Error(`--schedule entry ${index} has an unsupported "frequency": "${frequency}". Use one of: ${SNAPSHOT_FREQUENCIES.join(", ")}.`);
304
+ if (!isSnapshotFrequency(frequency)) throw new Error(`--schedule entry ${index} has an unsupported "frequency": ${REDACTED_INVALID_VALUE}.${didYouMean([frequency], SNAPSHOT_FREQUENCIES)} Use one of: ${SNAPSHOT_FREQUENCIES.join(", ")}.`);
304
305
  const item = { frequency };
305
306
  for (const key of [
306
307
  "hour",
@@ -1 +1 @@
1
- export { n as buildBody, r as buildQuery, i as builder, a as colorizeJson, o as command, s as describe, c as handler, l as parseHeaders, u as parseKeyValue, d as parseTypedValue, f as setDeep } from "../_chunks/api-1MKsfpY3.js";
1
+ export { n as buildBody, r as buildQuery, i as builder, a as colorizeJson, o as command, s as describe, c as handler, l as parseHeaders, u as parseKeyValue, d as parseTypedValue, f as setDeep } from "../_chunks/api-BZh2r_lx.js";
@@ -1 +1 @@
1
- export { n as builder, r as command, i as describe, a as handler } from "../_chunks/bootstrap-B73qVB39.js";
1
+ export { n as builder, r as command, i as describe, a as handler } from "../_chunks/bootstrap-yotTpFtF.js";
@@ -1 +1 @@
1
- export { t as builder, r as command, i as describe, a as formatCheckoutPolicyFailure, o as handler } from "../_chunks/checkout-CLHGCpZx.js";
1
+ export { t as builder, r as command, i as describe, a as formatCheckoutPolicyFailure, o as handler } from "../_chunks/checkout-CczPpuT9.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-PHaU-kRb.js";
1
+ export { t as aliases, n as builder, r as command, i as deploymentPollDelay, a as describe, s as handler } from "../_chunks/functions-v9z7zjWD.js";
@@ -1,5 +1,6 @@
1
1
  import { isInteractiveTerminal } from "../env.js";
2
2
  import { log } from "../log.js";
3
+ import { REDACTED_INVALID_VALUE, didYouMean } from "../errors.js";
3
4
  import { recordScaffoldedTemplate } from "../analytics.js";
4
5
  import { getCliName } from "../utils/cli_name.js";
5
6
  import { projectConfigPath, projectDir } from "../project.js";
@@ -51,7 +52,10 @@ const writeTemplates = (props, entries) => writer(props).end(entries.map((entry)
51
52
  const listTemplates = async (props) => {
52
53
  writeTemplates(props, (await openRegistry()).entries);
53
54
  };
54
- const unknownTemplate = (id, registry) => /* @__PURE__ */ new Error(`Unknown function template "${id}" in ${describeRegistrySources(registry.sources)}. Available templates: ${registry.entries.map((entry) => entry.id).join(", ")}.`);
55
+ const unknownTemplate = (id, registry) => {
56
+ const ids = registry.entries.map((entry) => entry.id);
57
+ return /* @__PURE__ */ new Error(`Unknown function template ${REDACTED_INVALID_VALUE} in ${describeRegistrySources(registry.sources)}.${didYouMean([id], ids)} Available templates: ${ids.join(", ")}.`);
58
+ };
55
59
  const pickOperations = async (operations, provider) => {
56
60
  const answer = await prompts({
57
61
  type: "multiselect",
@@ -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-CIXLNUoh.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-BZY1WeAw.js";
@@ -1,5 +1,5 @@
1
1
  import { r as auth_exports } from "../_chunks/auth-CFa969Ck.js";
2
- import { t as api_exports } from "../_chunks/api-1MKsfpY3.js";
2
+ import { t as api_exports } from "../_chunks/api-BZh2r_lx.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
5
  import { o as env_exports } from "../_chunks/env-C3HQJO8Z.js";
@@ -7,12 +7,12 @@ import { c as config_exports } from "../_chunks/config-C8BQIoM2.js";
7
7
  import { u as projects_exports } from "../_chunks/projects-a3X4OFEJ.js";
8
8
  import { a as link_exports } from "../_chunks/link-BVa6Nfji.js";
9
9
  import { o as mcp_exports } from "../_chunks/mcp-g8C-BZIb.js";
10
- import { c as plugins_exports } from "../_chunks/plugins-BwUZQ6Ic.js";
10
+ import { c as plugins_exports } from "../_chunks/plugins-CEylQlgK.js";
11
11
  import { l as skills_exports } from "../_chunks/skills-Bv8oKKwE.js";
12
- import { t as bootstrap_exports } from "../_chunks/bootstrap-B73qVB39.js";
12
+ import { t as bootstrap_exports } from "../_chunks/bootstrap-yotTpFtF.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-CLHGCpZx.js";
15
+ import { n as checkout_exports } from "../_chunks/checkout-CczPpuT9.js";
16
16
  import { o as claim_exports } from "../_chunks/claim-BoN9NPTy.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-KV1jlK-n.js";
@@ -23,14 +23,14 @@ import { s as dev_exports } from "../_chunks/dev-DVB7fGiG.js";
23
23
  import { i as diff_exports } from "../_chunks/diff-dnxneH0u.js";
24
24
  import { c as docs_exports } from "../_chunks/docs-DjYRHjGY.js";
25
25
  import { o as feedback_exports } from "../_chunks/feedback-mQmdTRFn.js";
26
- import { o as functions_exports } from "../_chunks/functions-PHaU-kRb.js";
27
- import { o as git_exports } from "../_chunks/git-CIXLNUoh.js";
26
+ import { o as functions_exports } from "../_chunks/functions-v9z7zjWD.js";
27
+ import { o as git_exports } from "../_chunks/git-BZY1WeAw.js";
28
28
  import { o as incidents_exports } from "../_chunks/incidents-BSFkUu1P.js";
29
29
  import { a as init_exports } from "../_chunks/init-BSwLzxjX.js";
30
30
  import { o as inspect_exports } from "../_chunks/inspect-yFAb61qo.js";
31
31
  import { a as ip_allow_exports } from "../_chunks/ip_allow-DBdxNEUa.js";
32
32
  import { l as logs_exports } from "../_chunks/logs-CcVpwdDs.js";
33
- import { a as neon_auth_exports } from "../_chunks/neon_auth-mfyjde2x.js";
33
+ import { a as neon_auth_exports } from "../_chunks/neon_auth-DE6X6FFV.js";
34
34
  import { a as open_exports } from "../_chunks/open-T2nI89Oh.js";
35
35
  import { c as operations_exports } from "../_chunks/operations-D7qGkKo3.js";
36
36
  import { o as orgs_exports } from "../_chunks/orgs-BrvAWM8Z.js";
@@ -40,7 +40,7 @@ import { o as postgres_exports } from "../_chunks/postgres-BbEt_7c9.js";
40
40
  import { o as profile_exports } from "../_chunks/profile-DWyfpl03.js";
41
41
  import { s as realtime_exports } from "../_chunks/realtime-cV7-c2-O.js";
42
42
  import { a as set_context_exports } from "../_chunks/set_context-ompB6d2D.js";
43
- import { s as snapshots_exports } from "../_chunks/snapshots-DxNhjcco.js";
43
+ import { s as snapshots_exports } from "../_chunks/snapshots-BolN3uBz.js";
44
44
  import { a as status_exports } from "../_chunks/status-BBnw48qR.js";
45
45
  import { d as triggers_exports } from "../_chunks/triggers-m3IBjiph.js";
46
46
  import { s as user_exports } from "../_chunks/user-iNYSe0KI.js";
@@ -1 +1 @@
1
- export { t as builder, n as command, r as describe, i as handler } from "../_chunks/neon_auth-mfyjde2x.js";
1
+ export { t as builder, n as command, r as describe, i as handler } from "../_chunks/neon_auth-DE6X6FFV.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-BwUZQ6Ic.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-CEylQlgK.js";
@@ -1 +1 @@
1
- export { t as SNAPSHOT_FIELDS, n as aliases, r as builder, i as command, a as describe, o as handler } from "../_chunks/snapshots-DxNhjcco.js";
1
+ export { t as SNAPSHOT_FIELDS, n as aliases, r as builder, i as command, a as describe, o as handler } from "../_chunks/snapshots-BolN3uBz.js";
@@ -1,3 +1,4 @@
1
+ import { REDACTED_INVALID_VALUE, didYouMean } from "./errors.js";
1
2
  import { NEON_SERVICES } from "./neon_services.js";
2
3
  import { n as NEON_ENV_VAR_KEYS } from "./_chunks/env-EJU-0InB.js";
3
4
  // src/env_services.ts
@@ -101,8 +102,7 @@ const parseEnvPullKeys = (raw, flag) => {
101
102
  const unknown = names.filter((name) => !ENV_PULL_KEYS.some((key) => key === name));
102
103
  if (unknown.length > 0) {
103
104
  const displayNames = unknown.map(redactUnknownEnvValue);
104
- const suggestions = [...new Set(unknown.map(suggestEnvPullKey).filter((key) => key !== null))];
105
- const suggestion = suggestions.length > 0 ? ` Did you mean ${suggestions.join(" or ")}?` : "";
105
+ const suggestion = didYouMean(unknown.filter((name) => !name.includes("=")), ENV_PULL_KEYS);
106
106
  throw new Error(`Unknown env variable${unknown.length === 1 ? "" : "s"} ${displayNames.join(", ")}.${suggestion} ${supported}`);
107
107
  }
108
108
  return ENV_PULL_KEYS.filter((key) => names.includes(key));
@@ -112,23 +112,9 @@ const redactUnknownEnvValue = (value) => {
112
112
  const separator = value.indexOf("=");
113
113
  if (separator !== -1) {
114
114
  const key = value.slice(0, separator);
115
- return isKnownEnvPullKey(key) ? `${key}=<redacted>` : "<redacted invalid value>";
115
+ return isKnownEnvPullKey(key) ? `${key}=<redacted>` : REDACTED_INVALID_VALUE;
116
116
  }
117
- return "<redacted invalid value>";
118
- };
119
- const suggestEnvPullKey = (value) => {
120
- if (value.includes("=")) return null;
121
- const closest = ENV_PULL_KEYS.map((key) => [key, editDistance(value, key)]).sort((a, b) => a[1] - b[1])[0];
122
- return closest && closest[1] <= 2 ? closest[0] : null;
123
- };
124
- const editDistance = (left, right) => {
125
- let previous = Array.from({ length: right.length + 1 }, (_, index) => index);
126
- for (let leftIndex = 1; leftIndex <= left.length; leftIndex += 1) {
127
- const current = [leftIndex];
128
- for (let rightIndex = 1; rightIndex <= right.length; rightIndex += 1) current[rightIndex] = Math.min((previous[rightIndex] ?? 0) + 1, (current[rightIndex - 1] ?? 0) + 1, (previous[rightIndex - 1] ?? 0) + (left[leftIndex - 1] === right[rightIndex - 1] ? 0 : 1));
129
- previous = current;
130
- }
131
- return previous[right.length] ?? right.length;
117
+ return REDACTED_INVALID_VALUE;
132
118
  };
133
119
  /** Narrow yargs' array option value without accepting any other runtime shape. */
134
120
  const envPullFlagValue = (value) => Array.isArray(value) ? value.map(String) : void 0;
package/dist/errors.js CHANGED
@@ -19,6 +19,7 @@ const ERROR_MATCHERS = [
19
19
  [/^neon skills needs Node\.js /, "NODE_VERSION_UNSUPPORTED"],
20
20
  [/needs npx \(Node\.js\)/, "NPX_NOT_FOUND"],
21
21
  [/spawn git ENOENT/, "GIT_NOT_FOUND"],
22
+ [/^Installing the Neon plugin needs Git, /, "GIT_NOT_FOUND"],
22
23
  [/^(Failed to install Neon agent skills|skills CLI failed)/, "SKILLS_CLI_FAILED"],
23
24
  [/^Cannot install the Neon plugin for /, "AGENT_COMMAND_UNAVAILABLE"],
24
25
  [/^(Failed to install the Neon plugin for: |plugins CLI (failed|timed out))/, "PLUGINS_CLI_FAILED"],
@@ -95,4 +96,31 @@ const isNetworkError = (err) => {
95
96
  }
96
97
  return false;
97
98
  };
98
- export { DetailedError, NETWORK_ERROR_MESSAGE, ProjectNotLinkedError, isNetworkError, isUnexpectedError, matchErrorCode };
99
+ /**
100
+ * Stands in for a flag value the CLI rejected. Error messages are sent as `CLI Error`
101
+ * telemetry, and a value typed into the wrong flag is sometimes a pasted secret, so an error
102
+ * names only values it can vouch for (a valid choice, a key it knows) and replaces the rest.
103
+ */
104
+ const REDACTED_INVALID_VALUE = "<redacted invalid value>";
105
+ /**
106
+ * ` Did you mean x?` for rejected values within two edits of a valid choice, else `""`. The
107
+ * error cannot show what was typed, so a near miss is named by the choice it was close to.
108
+ */
109
+ const didYouMean = (rejected, choices) => {
110
+ const suggestions = [...new Set(rejected.map((value) => closestChoice(value, choices)).filter((choice) => choice !== void 0))];
111
+ return suggestions.length > 0 ? ` Did you mean ${suggestions.join(" or ")}?` : "";
112
+ };
113
+ const closestChoice = (value, choices) => {
114
+ const closest = choices.map((choice) => [choice, editDistance(value, choice)]).sort((a, b) => a[1] - b[1])[0];
115
+ return closest && closest[1] <= 2 ? closest[0] : void 0;
116
+ };
117
+ const editDistance = (left, right) => {
118
+ let previous = Array.from({ length: right.length + 1 }, (_, index) => index);
119
+ for (let leftIndex = 1; leftIndex <= left.length; leftIndex += 1) {
120
+ const current = [leftIndex];
121
+ for (let rightIndex = 1; rightIndex <= right.length; rightIndex += 1) current[rightIndex] = Math.min((previous[rightIndex] ?? 0) + 1, (current[rightIndex - 1] ?? 0) + 1, (previous[rightIndex - 1] ?? 0) + (left[leftIndex - 1] === right[rightIndex - 1] ? 0 : 1));
122
+ previous = current;
123
+ }
124
+ return previous[right.length] ?? right.length;
125
+ };
126
+ export { DetailedError, NETWORK_ERROR_MESSAGE, ProjectNotLinkedError, REDACTED_INVALID_VALUE, didYouMean, isNetworkError, isUnexpectedError, matchErrorCode };
@@ -1,3 +1,4 @@
1
+ import { REDACTED_INVALID_VALUE, didYouMean } from "../errors.js";
1
2
  // src/functions/registry.ts
2
3
  const MAX_PATH_LENGTH = 255;
3
4
  const MAX_FILE_BYTES = 262144;
@@ -25,7 +26,10 @@ function assertValid(validate, data, label) {
25
26
  const recommendedOperations = (operations) => operations.filter((operation) => operation.recommended);
26
27
  const resolveOperationById = (operations, id) => {
27
28
  const operation = operations.find((candidate) => candidate.id === id);
28
- if (!operation) throw new Error(`Unknown operation "${id}". Available operations: ${operations.map((candidate) => candidate.id).join(", ")}.`);
29
+ if (!operation) {
30
+ const ids = operations.map((candidate) => candidate.id);
31
+ throw new Error(`Unknown operation ${REDACTED_INVALID_VALUE}.${didYouMean([id], ids)} Available operations: ${ids.join(", ")}.`);
32
+ }
29
33
  return operation;
30
34
  };
31
35
  const parseRegistryIndex = (text, validate) => {
package/dist/help.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { REDACTED_INVALID_VALUE } from "./errors.js";
1
2
  import { globalOptionsTrailer, helpWidth, wrapHelpText } from "./utils/help_text.js";
2
3
  import { consumeBlockIfMatches, consumeNextMatching, drawPointer, splitColumns } from "./utils/ui.js";
3
4
  import chalk from "chalk";
@@ -269,8 +270,15 @@ const failOnUsageError = (msg, err, usage) => {
269
270
  if (typeof usage !== "object" || usage === null || !("help" in usage) || typeof usage.help !== "function") throw new Error("yargs no longer passes its usage instance to .fail(); update failOnUsageError for the installed yargs");
270
271
  const help = usage.help();
271
272
  if (typeof help !== "string") throw new Error("yargs usage.help() did not return a string");
272
- throw new UsageError(msg ?? "Invalid usage", help);
273
+ throw new UsageError(redactRejectedChoices(msg ?? "Invalid usage"), help);
273
274
  };
275
+ /**
276
+ * yargs answers a value outside `choices` with `Argument: <key>, Given: <values>, Choices:
277
+ * <choices>`, one line per flag, in English because `index.ts` pins `.locale("en")`. Each
278
+ * given value is JSON-quoted, which leaves U+2028/U+2029 unescaped, hence `[^\n]` over `.`;
279
+ * the match runs to the last `, Choices: ` so a value containing that text is still covered.
280
+ */
281
+ const redactRejectedChoices = (msg) => msg.replace(/^(\s*Argument: [^,\n]+, Given: )[^\n]*(, Choices: )/gm, `$1${REDACTED_INVALID_VALUE}$2`);
274
282
  function assertYargsInternals(argv) {
275
283
  if (!("getInternalMethods" in argv) || typeof argv.getInternalMethods !== "function") throw new Error("yargs no longer exposes getInternalMethods(); update isBareParentCommand for the installed yargs");
276
284
  }
package/dist/init/plan.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { REDACTED_INVALID_VALUE, didYouMean } from "../errors.js";
1
2
  import { getCliName } from "../utils/cli_name.js";
2
3
  import { tryResolveAddMcpAgentId, uniqueAgentIds } from "../mcp/agents.js";
3
4
  import { supportsSkills } from "./agents.js";
@@ -293,7 +294,7 @@ const resolveNamedAgents = (raw) => {
293
294
  for (const item of raw) {
294
295
  if (item === "*") throw new Error("--agent * is not accepted. Pass --agent <name> for each coding agent, or omit --agent to detect or pick.");
295
296
  const id = tryResolveAddMcpAgentId(item);
296
- if (!id) throw new Error(`Unknown agent: "${item}". Supported agents: ${available.join(", ")}`);
297
+ if (!id) throw new Error(`Unknown agent: ${REDACTED_INVALID_VALUE}.${didYouMean([item], available)} Supported agents: ${available.join(", ")}`);
297
298
  resolved.push(id);
298
299
  }
299
300
  return uniqueAgentIds(resolved);
@@ -7,7 +7,7 @@ import { CannotMintApiKeyError } from "../mcp/mint.js";
7
7
  import { detectAgent } from "./detect_host.js";
8
8
  import { AgentSelectionSkipped, canPickAgentsInteractively } from "../utils/agent_picker.js";
9
9
  import { a as mcpInstallError, s as reportMcpInstall } from "../_chunks/mcp-g8C-BZIb.js";
10
- import { l as reportPluginsInstall, o as installPlugins, s as pluginsInstallError } from "../_chunks/plugins-BwUZQ6Ic.js";
10
+ import { l as reportPluginsInstall, o as installPlugins, s as pluginsInstallError } from "../_chunks/plugins-CEylQlgK.js";
11
11
  import { c as skillsInstallError, o as installSkills, s as reportSkillsInstall } from "../_chunks/skills-Bv8oKKwE.js";
12
12
  import { runAuthenticatedMcp } from "./auth.js";
13
13
  import { raceSigint } from "./cancelled.js";
@@ -1,3 +1,4 @@
1
+ import { REDACTED_INVALID_VALUE, didYouMean } from "../errors.js";
1
2
  import { agents, detectGlobalAgents, detectProjectAgents as detectProjectAgents$1, getAgentTypes } from "add-mcp";
2
3
  // src/mcp/agents.ts
3
4
  const UNSUPPORTED_AGENTS = /* @__PURE__ */ new Set(["mastracode"]);
@@ -61,7 +62,7 @@ function tryResolveAddMcpAgentId(rawAgent) {
61
62
  }
62
63
  function resolveAddMcpAgentId(rawAgent) {
63
64
  const resolved = tryResolveAddMcpAgentId(rawAgent);
64
- if (!resolved) throw new Error(`Unknown agent: "${rawAgent}". Supported agents: ${listMcpAgentIds().join(", ")}`);
65
+ if (!resolved) throw new Error(`Unknown agent: ${REDACTED_INVALID_VALUE}.${didYouMean([rawAgent], listMcpAgentIds())} Supported agents: ${listMcpAgentIds().join(", ")}`);
65
66
  return resolved;
66
67
  }
67
68
  async function detectInstalledAgents() {
@@ -1,3 +1,4 @@
1
+ import { REDACTED_INVALID_VALUE, didYouMean } from "../errors.js";
1
2
  import { getCliName } from "../utils/cli_name.js";
2
3
  import { chmodSync, existsSync, readFileSync, rmSync, writeFileSync } from "node:fs";
3
4
  import { basename, dirname, join, relative } from "node:path";
@@ -24,7 +25,7 @@ function isMcpCategory(value) {
24
25
  function parseMcpCategories(raw) {
25
26
  const out = [];
26
27
  for (const value of raw) {
27
- if (!isMcpCategory(value)) throw new Error(`Unknown MCP category: "${value}". Supported categories: ${NEON_MCP_CATEGORIES.join(", ")}`);
28
+ if (!isMcpCategory(value)) throw new Error(`Unknown MCP category: ${REDACTED_INVALID_VALUE}.${didYouMean([value], NEON_MCP_CATEGORIES)} Supported categories: ${NEON_MCP_CATEGORIES.join(", ")}`);
28
29
  out.push(value);
29
30
  }
30
31
  return out;
package/dist/mcp/plan.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { REDACTED_INVALID_VALUE, didYouMean } from "../errors.js";
1
2
  import { tryResolveAddMcpAgentId } from "./agents.js";
2
3
  import { detectMcpAgents, mcpInstallableAgents } from "./targets.js";
3
4
  import { collectYesAgents, noDetectedAgentsMessage } from "../init/plan.js";
@@ -32,7 +33,7 @@ async function resolveMcpPlan(options) {
32
33
  }),
33
34
  resolveSpecified: (raw) => {
34
35
  const id = tryResolveAddMcpAgentId(raw);
35
- if (!id) throw new Error(`Unknown agent: "${raw}". Supported agents: ${available.join(", ")}`);
36
+ if (!id) throw new Error(`Unknown agent: ${REDACTED_INVALID_VALUE}.${didYouMean([raw], available)} Supported agents: ${available.join(", ")}`);
36
37
  return id;
37
38
  },
38
39
  pick: prompt ? options.pickAgents ?? pickAgentsInteractively : void 0,
@@ -1,3 +1,4 @@
1
+ import { REDACTED_INVALID_VALUE, didYouMean } from "./errors.js";
1
2
  // src/neon_services.ts
2
3
  /**
3
4
  * Every Neon service a `--service` flag can name, spelled the way a user types it — one
@@ -76,19 +77,20 @@ const parseServices = (raw, options) => {
76
77
  return canonical;
77
78
  });
78
79
  const unsupported = resolved.filter((name) => !allowed.some((service) => service === name));
79
- if (unsupported.length > 0) throw new Error(`${unsupportedMessage(unsupported, flag)} ${supported}`);
80
+ if (unsupported.length > 0) throw new Error(`${unsupportedMessage(unsupported, allowed, flag)} ${supported}`);
80
81
  for (const [used, canonical] of deprecated) onDeprecated?.(used, canonical);
81
82
  return allowed.filter((service) => resolved.includes(service));
82
83
  };
83
84
  /**
84
85
  * The sentences explaining why a selection was refused. A real Neon service this command
85
86
  * cannot act on is a different mistake from a typo — different cause, different fix — so the
86
- * two are never answered with the same word.
87
+ * two are never answered with the same word. Only a real service is named; anything else is
88
+ * redacted, since it could be a secret pasted into the wrong flag.
87
89
  */
88
- const unsupportedMessage = (unsupported, flag) => {
90
+ const unsupportedMessage = (unsupported, allowed, flag) => {
89
91
  const known = unsupported.filter((name) => NEON_SERVICES.some((service) => service === name));
90
92
  const unknown = unsupported.filter((name) => !known.some((service) => service === name));
91
- return [unknown.length > 0 ? `Unknown service${unknown.length === 1 ? "" : "s"} ${unknown.join(", ")}.` : void 0, ...known.map((service) => `${service} is not something ${flag} can select.`)].filter((part) => part !== void 0).join(" ");
93
+ return [unknown.length > 0 ? `Unknown service${unknown.length === 1 ? "" : "s"} ${unknown.map(() => REDACTED_INVALID_VALUE).join(", ")}.${didYouMean(unknown, allowed)}` : void 0, ...known.map((service) => `${service} is not something ${flag} can select.`)].filter((part) => part !== void 0).join(" ");
92
94
  };
93
95
  /** Every spelling of the services flag, so a habit picked up on one command works on another. */
94
96
  const SERVICE_FLAG_NAMES = [
@@ -1,3 +1,4 @@
1
+ import { REDACTED_INVALID_VALUE, didYouMean } from "../errors.js";
1
2
  import { getAgentDisplayName, tryResolveAddMcpAgentId } from "../mcp/agents.js";
2
3
  import "../init/agents.js";
3
4
  import { detectInstalledPluginsAgents, detectProjectPluginsAgents, getPluginsTargetName, mappedPluginsTargets, missingPluginsCommands, pluginsCommandFix, pluginsCommandProblemText, pluginsInstallableAgents, unusablePluginsCommands } from "./targets.js";
@@ -6,6 +7,12 @@ import { detectAgent } from "../init/detect_host.js";
6
7
  import { agentChoicesFrom, pickAgentsInteractively, resolveAgentSelection } from "../utils/agent_picker.js";
7
8
  // src/plugins/plan.ts
8
9
  const unusablePluginsCommandsError = (unusable) => new Error(unusable.map((row) => `Cannot install the Neon plugin for ${getAgentDisplayName(row.agent)}: "${row.command.name}" ${pluginsCommandProblemText(row)}. ${pluginsCommandFix(row)}, then retry.`).join("\n"));
10
+ const gitErrorPrefix = "Installing the Neon plugin needs Git, and \"git\"";
11
+ const gitFix = (problem) => {
12
+ if (problem.kind === "missing") return "Install Git (https://git-scm.com/downloads) or add it to PATH";
13
+ return /^(xcrun|xcode-select):/.test(problem.detail) ? "Install the Command Line Tools (xcode-select --install) or install Git" : "Repair or reinstall Git";
14
+ };
15
+ const pluginsGitError = (problem) => /* @__PURE__ */ new Error(`${gitErrorPrefix} ${problem.kind === "missing" ? "was not found on PATH" : `did not run ("git --version" failed: ${problem.detail})`}. ${gitFix(problem)}, then retry.`);
9
16
  const assertPluginsCanRun = (options) => {
10
17
  if (options.yes || options.interactive || options.hasAgents) return;
11
18
  throw new Error("No interactive terminal. Pass -y to install into detected agents, or --agent <name> to name them.");
@@ -57,7 +64,7 @@ async function resolvePluginsPlan(options) {
57
64
  resolveSpecified: (raw) => {
58
65
  if (raw === "*") throw new Error("neon plugins does not accept --agent *. Pass --agent <name> for each coding agent, or omit --agent to use detected agents.");
59
66
  const id = tryResolveAddMcpAgentId(raw);
60
- if (!id) throw new Error(`Unknown agent: "${raw}". Supported agents: ${available.join(", ")}`);
67
+ if (!id) throw new Error(`Unknown agent: ${REDACTED_INVALID_VALUE}.${didYouMean([raw], available)} Supported agents: ${available.join(", ")}`);
61
68
  return id;
62
69
  },
63
70
  pick: prompt ? options.pickAgents ?? pickAgentsInteractively : void 0,
@@ -92,4 +99,4 @@ async function resolvePluginsPlan(options) {
92
99
  targets: mappedPluginsTargets(agents)
93
100
  };
94
101
  }
95
- export { assertPluginsCanRun, resolvePluginsPlan, unusablePluginsCommandsError };
102
+ export { assertPluginsCanRun, pluginsGitError, resolvePluginsPlan, unusablePluginsCommandsError };
@@ -87,28 +87,19 @@ const withPath = (env, path) => {
87
87
  [key ?? "PATH"]: path
88
88
  };
89
89
  };
90
- /**
91
- * Runs `<command> --version` the way the plugins CLI spawns the command (no shell, the npx
92
- * search PATH, its child env), so a command it could not run is caught before it runs.
93
- */
94
- const probePluginsCommand = (command, options) => {
95
- const resolved = which.sync(command.name, {
96
- nothrow: true,
97
- path: options.searchPath
98
- });
99
- if (resolved === null) return { kind: "missing" };
100
- const result = spawnSync(resolved, ["--version"], {
101
- cwd: options.cwd,
102
- env: withPath(pluginsChildEnv(), options.searchPath),
103
- encoding: "utf8",
104
- stdio: [
105
- "ignore",
106
- "pipe",
107
- "pipe"
108
- ],
109
- timeout: VERSION_TIMEOUT_MS,
110
- windowsHide: true
111
- });
90
+ const versionRunOptions = (options) => ({
91
+ cwd: options.cwd,
92
+ env: withPath(pluginsChildEnv(), options.searchPath),
93
+ encoding: "utf8",
94
+ stdio: [
95
+ "ignore",
96
+ "pipe",
97
+ "pipe"
98
+ ],
99
+ timeout: VERSION_TIMEOUT_MS,
100
+ windowsHide: true
101
+ });
102
+ const versionRunProblem = (result) => {
112
103
  if (result.error !== void 0) {
113
104
  const code = "code" in result.error && typeof result.error.code === "string" ? result.error.code : void 0;
114
105
  return {
@@ -116,7 +107,6 @@ const probePluginsCommand = (command, options) => {
116
107
  detail: code === "ETIMEDOUT" ? `timed out after ${VERSION_TIMEOUT_MS / 1e3} seconds` : code ?? result.error.message
117
108
  };
118
109
  }
119
- const output = `${result.stdout}\n${result.stderr}`;
120
110
  if (result.status !== 0) {
121
111
  const line = firstLine(result.stderr) || firstLine(result.stdout);
122
112
  return {
@@ -124,7 +114,40 @@ const probePluginsCommand = (command, options) => {
124
114
  detail: line.length > 0 ? line.slice(0, 160).replace(/\.$/, "") : result.signal !== null ? `killed by ${result.signal}` : `exit code ${result.status}`
125
115
  };
126
116
  }
127
- return pluginsCommandVersionProblem(command, output);
117
+ };
118
+ /**
119
+ * Runs `<command> --version` the way the plugins CLI spawns the command (no shell, the npx
120
+ * search PATH, its child env), so a command it could not run is caught before it runs.
121
+ */
122
+ const probePluginsCommand = (command, options) => {
123
+ const resolved = which.sync(command.name, {
124
+ nothrow: true,
125
+ path: options.searchPath
126
+ });
127
+ if (resolved === null) return { kind: "missing" };
128
+ const result = spawnSync(resolved, ["--version"], versionRunOptions(options));
129
+ return versionRunProblem(result) ?? pluginsCommandVersionProblem(command, `${result.stdout}\n${result.stderr}`);
130
+ };
131
+ /**
132
+ * The plugins CLI runs `git clone` through a shell, so this probe runs `git --version`
133
+ * through one too: without a shell, Node cannot run a Windows `git.cmd`. A slow git is
134
+ * left to the plugins CLI rather than blocking the install.
135
+ */
136
+ const pluginsGitProblem = (options) => {
137
+ const searchPath = pluginsCommandSearchPath(options.cwd, options.path ?? process.env.PATH ?? "");
138
+ if (which.sync("git", {
139
+ nothrow: true,
140
+ path: searchPath
141
+ }) === null) return { kind: "missing" };
142
+ const result = spawnSync("git --version", {
143
+ ...versionRunOptions({
144
+ cwd: options.cwd,
145
+ searchPath
146
+ }),
147
+ shell: true
148
+ });
149
+ if (result.error !== void 0 && "code" in result.error && result.error.code === "ETIMEDOUT") return;
150
+ return versionRunProblem(result);
128
151
  };
129
152
  const commandRows = (agents, options, check) => {
130
153
  const searchPath = pluginsCommandSearchPath(options.cwd, options.path ?? process.env.PATH ?? "");
@@ -216,4 +239,4 @@ const mappedPluginsTargets = (agents) => {
216
239
  if (mapped.length === 0) throw new Error(`None of the selected agents can install plugins. Supported agents: ${pluginsInstallableAgents().join(", ")}`);
217
240
  return mapped;
218
241
  };
219
- export { bootstrapPluginAgents, detectInstalledPluginsAgents, detectProjectPluginsAgents, getPluginsTargetName, mappedPluginsTargets, missingPluginsCommands, pluginsCommandFix, pluginsCommandProblemText, pluginsCommandVersionProblem, pluginsInstallableAgents, pluginsTargets, supportsPlugins, unusablePluginsCommands, versionAtLeast };
242
+ export { bootstrapPluginAgents, detectInstalledPluginsAgents, detectProjectPluginsAgents, getPluginsTargetName, mappedPluginsTargets, missingPluginsCommands, pluginsCommandFix, pluginsCommandProblemText, pluginsCommandVersionProblem, pluginsGitProblem, pluginsInstallableAgents, pluginsTargets, supportsPlugins, unusablePluginsCommands, versionAtLeast };
@@ -1,3 +1,4 @@
1
+ import { REDACTED_INVALID_VALUE, didYouMean } from "../errors.js";
1
2
  import { helpCsv } from "../utils/help_text.js";
2
3
  // src/skills/catalog.ts
3
4
  const AGENT_SKILLS_SOURCE = "neondatabase/agent-skills";
@@ -58,7 +59,7 @@ const defaultSkillEntries = () => NEON_SKILL_CATALOG.filter((entry) => entry.def
58
59
  function resolveSkillId(raw) {
59
60
  if (raw === "*") throw new Error("neon skills does not accept --skill *. Pass --skill <name> for each skill, or omit --skill to install the default skills with -y.");
60
61
  const entry = CATALOG_BY_SKILL.get(raw);
61
- if (entry === void 0) throw new Error(`Unknown skill: "${raw}". Supported skills: ${listSkillIds().join(", ")}`);
62
+ if (entry === void 0) throw new Error(`Unknown skill: ${REDACTED_INVALID_VALUE}.${didYouMean([raw], listSkillIds())} Supported skills: ${listSkillIds().join(", ")}`);
62
63
  return entry;
63
64
  }
64
65
  function uniqueSkillEntries(entries) {
@@ -1,3 +1,4 @@
1
+ import { REDACTED_INVALID_VALUE, didYouMean } from "../errors.js";
1
2
  import { tryResolveAddMcpAgentId } from "../mcp/agents.js";
2
3
  import "../init/agents.js";
3
4
  import { detectSkillsAgents, skillsInstallableAgents } from "./targets.js";
@@ -51,7 +52,7 @@ async function resolveSkillsPlan(options) {
51
52
  resolveSpecified: (raw) => {
52
53
  if (raw === "*") throw new Error("neon skills does not accept --agent *. Pass --agent <name> for each coding agent, or omit --agent to use detected agents.");
53
54
  const id = tryResolveAddMcpAgentId(raw);
54
- if (!id) throw new Error(`Unknown agent: "${raw}". Supported agents: ${available.join(", ")}`);
55
+ if (!id) throw new Error(`Unknown agent: ${REDACTED_INVALID_VALUE}.${didYouMean([raw], available)} Supported agents: ${available.join(", ")}`);
55
56
  return id;
56
57
  },
57
58
  pick: prompt ? options.pickAgents ?? pickAgentsInteractively : void 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neon",
3
- "version": "9.9.5",
3
+ "version": "9.9.7",
4
4
  "description": "CLI tool for Neon, the cloud backend primitives built around Lakebase Postgres",
5
5
  "keywords": [
6
6
  "neon",