neon 9.7.1 → 9.7.2

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 +2 -2
  2. package/dist/_chunks/{auth-B1AqRN6z.js → auth-DY5Bm7Ym.js} +1 -1
  3. package/dist/_chunks/{checkout-C5RXRmRy.js → checkout-B_hB_ELY.js} +2 -2
  4. package/dist/_chunks/{config-ClvDw0Xs.js → config-DFj1Btk-.js} +1 -1
  5. package/dist/_chunks/{deploy-D1T3_cYZ.js → deploy-CVJIahZE.js} +1 -1
  6. package/dist/_chunks/{dev-hNDBX-5l.js → dev-CtIzg7vq.js} +1 -1
  7. package/dist/_chunks/{git-DbJwG1SU.js → git-CIBowi6T.js} +2 -2
  8. package/dist/_chunks/{init-D2fClHtC.js → init-AKhj0lHa.js} +1 -1
  9. package/dist/_chunks/{link-CHscI_10.js → link-mdFXf8dW.js} +1 -1
  10. package/dist/_chunks/{profile-Bf5qqUN1.js → profile-Qoyql0AR.js} +1 -1
  11. package/dist/_chunks/{status-DdagkQp2.js → status-DRWS1u6H.js} +1 -1
  12. package/dist/_chunks/{user-D9mC430O.js → user-C1pTJS9O.js} +34 -2
  13. package/dist/auth.js +5 -5
  14. package/dist/auth_recovery.js +1 -1
  15. package/dist/commands/auth.js +1 -1
  16. package/dist/commands/checkout.js +1 -1
  17. package/dist/commands/config.js +1 -1
  18. package/dist/commands/deploy.js +1 -1
  19. package/dist/commands/dev.js +1 -1
  20. package/dist/commands/functions_new.js +1 -1
  21. package/dist/commands/git.js +1 -1
  22. package/dist/commands/index.js +11 -11
  23. package/dist/commands/init.js +1 -1
  24. package/dist/commands/link.js +1 -1
  25. package/dist/commands/manifest.js +1 -1
  26. package/dist/commands/profile.js +1 -1
  27. package/dist/commands/status.js +1 -1
  28. package/dist/commands/user.js +1 -1
  29. package/dist/index.js +1 -1
  30. package/dist/init/auth.js +1 -1
  31. package/dist/init/deploy.js +2 -2
  32. package/dist/init/link.js +2 -2
  33. package/dist/init/run.js +3 -3
  34. package/package.json +3 -3
package/README.md CHANGED
@@ -83,7 +83,7 @@ neon projects list --api-key <neon_api_key>
83
83
 
84
84
  For information about obtaining an Neon API key, see [Authentication](https://neon.com/docs/reference/api/get-started), in the _Neon API Reference_.
85
85
 
86
- To check which account and credential a command uses, run `neon me` with the same `--profile` or `--api-key` option and environment as that command. The `Authentication` row names the source, such as `OAuth (profile DEFAULT)`, `API key (profile work)`, `API key (--api-key)`, or `API key (NEON_API_KEY)`. When no credential is usable, `neon me` exits 1 with `Not signed in` and the `neon login` command to run; it never starts a sign-in itself.
86
+ To check which account and credential a command uses, run `neon me` with the same `--profile` or `--api-key` option and environment as that command. The `Authentication` row names the source, such as `OAuth (profile DEFAULT)`, `API key (profile work)`, `API key (--api-key)`, or `API key (NEON_API_KEY)`. An organization API key has no user, so `neon me` shows its `Organization` id instead, and `-o json` prints `{"account_id": "org-…", "auth_method": "api_key_org"}`; check `auth_method` to tell it apart from a user. When no credential is usable, `neon me` exits 1 with `Not signed in` and the `neon login` command to run; it never starts a sign-in itself.
87
87
 
88
88
  ## Create a project without an account
89
89
 
@@ -1610,7 +1610,7 @@ Every subcommand except `list` takes `--org-id`. Without it, the CLI uses the or
1610
1610
  | orgs (`org`) | `list`, `get`, `members`, `invitations`, `spending-limit` | Manage organizations |
1611
1611
  | [projects](https://neon.com/docs/reference/cli-projects) | `list`, `create`, `update`, `delete`, `get` | Manage projects |
1612
1612
  | [ip-allow](https://neon.com/docs/reference/cli-ip-allow) | `list`, `add`, `remove`, `reset` | Manage IP Allow |
1613
- | [me](https://neon.com/docs/reference/cli-me) | | Show current user |
1613
+ | [me](https://neon.com/docs/reference/cli-me) | | Show the current user or organization |
1614
1614
  | [branches](https://neon.com/docs/reference/cli-branches) | `list`, `create`, `rename`, `add-compute`, `set-default`, `set-expiration`, `delete`, `get` | Manage branches |
1615
1615
  | postgres (`pg`, `lakebase`) | `computes`, `databases`, `roles`, `connection-string`, `psql` | Manage Postgres and connect to it |
1616
1616
  | [databases](https://neon.com/docs/reference/cli-databases) | `list`, `create`, `delete` | Manage databases |
@@ -52,7 +52,7 @@ const describe = "Sign in with a browser. See --help for API keys and profiles";
52
52
  const wrapAuthHelp = (text) => wrapHelpText(text, helpWidth());
53
53
  const authHelpEpilogue = () => {
54
54
  const cli = getCliName();
55
- return helpEpilogue(wrapAuthHelp("Non-interactive (CI, scripts, agents):"), wrapAuthHelp("Use an existing API key or an API-key profile."), ` ${cli} projects list --profile agent`, wrapAuthHelp(`${cli} profile create <name> --mint needs a browser during setup, then stores an API key and drops the session. It cannot run in CI. Default key is account-wide; --org-id or --project-id (not both) restricts it.`), wrapAuthHelp(`A profile holds a browser session or an API key. Select it with --profile <name> or NEON_PROFILE. List profiles with ${cli} profile list.`), wrapAuthHelp("On commands that use a credential, --api-key or --profile overrides NEON_API_KEY and NEON_PROFILE. Pass either --api-key or --profile, not both. When neither flag is passed and both NEON_API_KEY and NEON_PROFILE are set, the key wins and stderr names the ignored profile. When no flag or environment variable selects a credential, DEFAULT is used."), wrapAuthHelp(`${cli} profile create <name> replaces an existing profile of that name and tries to revoke the credential it held. An imported key with no recorded id stays live. Pick a new name to keep the old profile.`), wrapAuthHelp(`See ${cli} profile --help and ${cli} profile create --help.`));
55
+ return helpEpilogue(wrapAuthHelp(`Browser sign-in prints its Auth Url to stderr and waits up to 10 minutes for it to finish. A coding agent can run ${cli} login in the background and pass the URL to the person signing in on this machine.`), wrapAuthHelp("Non-interactive (CI, scripts, agents):"), wrapAuthHelp("Use an existing API key or an API-key profile."), ` ${cli} projects list --profile agent`, wrapAuthHelp(`${cli} profile create <name> --mint needs a browser during setup, then stores an API key and drops the session. It cannot run in CI. Default key is account-wide; --org-id or --project-id (not both) restricts it.`), wrapAuthHelp(`A profile holds a browser session or an API key. Select it with --profile <name> or NEON_PROFILE. List profiles with ${cli} profile list.`), wrapAuthHelp("On commands that use a credential, --api-key or --profile overrides NEON_API_KEY and NEON_PROFILE. Pass either --api-key or --profile, not both. When neither flag is passed and both NEON_API_KEY and NEON_PROFILE are set, the key wins and stderr names the ignored profile. When no flag or environment variable selects a credential, DEFAULT is used."), wrapAuthHelp(`${cli} profile create <name> replaces an existing profile of that name and tries to revoke the credential it held. An imported key with no recorded id stays live. Pick a new name to keep the old profile.`), wrapAuthHelp(`See ${cli} profile --help and ${cli} profile create --help.`));
56
56
  };
57
57
  const builder = (yargs) => yargs.option("context-file", { hidden: true }).option("keyring", {
58
58
  describe: "Store the credential in the OS keyring. Per profile; a later login without the flag stays there. See `neon profile list`.",
@@ -12,8 +12,8 @@ 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
14
  import { n as autoPullEnvAfterPin } from "./env-DxcO3oJk.js";
15
- import { a as applyPolicyOnCreate, f as envFlag, l as createBranchFromPolicyOnCheckout } from "./config-ClvDw0Xs.js";
16
- import { i as handler$1 } from "./link-CHscI_10.js";
15
+ import { a as applyPolicyOnCreate, f as envFlag, l as createBranchFromPolicyOnCheckout } from "./config-DFj1Btk-.js";
16
+ import { i as handler$1 } from "./link-mdFXf8dW.js";
17
17
  import chalk from "chalk";
18
18
  import prompts from "prompts";
19
19
  // src/commands/checkout.ts
@@ -7,7 +7,7 @@ import "../config.js";
7
7
  import { contextBranch, ensureDirectoryGitignored, readContextFile } from "../context.js";
8
8
  import { DetailedError } from "../errors.js";
9
9
  import { getCliName } from "../utils/cli_name.js";
10
- import { l as existingApiClient } from "./auth-B1AqRN6z.js";
10
+ import { l as existingApiClient } from "./auth-DY5Bm7Ym.js";
11
11
  import { NEON_SERVICES, NEON_SERVICE_LABELS, deprecatedServiceMessage, servicesFlagValue, servicesOption } from "../neon_services.js";
12
12
  import { FUNCTION_FILENAME, FUNCTION_SLUG, FUNCTION_TEMPLATE, REQUIRED_PACKAGES, dataApiChoiceFromView, parseConfigInitServices, renderFunctionSource, renderNeonConfig, renderNeonConfigFromView } from "../config_template.js";
13
13
  import { TYPESCRIPT_EXTENSION, asRelativeModulePath, editNeonConfig } from "../config_edit.js";
@@ -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-ClvDw0Xs.js";
3
+ import { f as envFlag, i as applyFlags, p as envPullFlag, r as applyCmd } from "./config-DFj1Btk-.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({
@@ -7,7 +7,7 @@ import { t as NEON_DEV_FUNCTION_PORTS } from "./env-EJU-0InB.js";
7
7
  import { branchIdResolve } from "../utils/enrichers.js";
8
8
  import { bundleEntry } from "../utils/esbuild.js";
9
9
  import { a as resolveDevEnv } from "./env-CFBmcKyo.js";
10
- import { f as envFlag } from "./config-ClvDw0Xs.js";
10
+ import { f as envFlag } from "./config-DFj1Btk-.js";
11
11
  import { findConfigFunctionBySource, resolveFunctionsFromConfig } from "../dev/functions.js";
12
12
  import { resolveWatchInputs } from "../dev/inputs.js";
13
13
  import { existsSync, mkdirSync, rmSync, statSync, writeFileSync } from "node:fs";
@@ -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-CHscI_10.js";
9
- import { o as handler$1 } from "./checkout-C5RXRmRy.js";
8
+ import { o as quoteFlagValue } from "./link-mdFXf8dW.js";
9
+ import { o as handler$1 } from "./checkout-B_hB_ELY.js";
10
10
  import { existsSync } from "node:fs";
11
11
  import { join } from "node:path";
12
12
  import chalk from "chalk";
@@ -87,7 +87,7 @@ const builder = (yargs) => yargs.usage("$0 init [options]").option("context-file
87
87
  }).option("mcp-auth", {
88
88
  type: "string",
89
89
  choices: ["oauth", "api-key"],
90
- describe: "MCP authentication. Selects skills and MCP setup. oauth is neon mcp --oauth"
90
+ describe: "MCP authentication. Selects skills and MCP setup. oauth is neon mcp --oauth. api-key mints a key, which needs neon login or a personal API key: with an organization or project-scoped key and no Neon MCP key already configured, init skips MCP and exits 1. Omit it to fall back to oauth when no key can be minted"
91
91
  }).option("mcp-project-scoped", {
92
92
  type: "boolean",
93
93
  default: false,
@@ -14,7 +14,7 @@ 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
16
  import { n as autoPullEnvAfterPin } from "./env-DxcO3oJk.js";
17
- import { h as initCmd } from "./config-ClvDw0Xs.js";
17
+ import { h as initCmd } from "./config-DFj1Btk-.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";
@@ -10,7 +10,7 @@ import { _ as upsertProfile, a as canDropProfilesFile, c as listProfiles, d as n
10
10
  import { auth, revokeToken } from "../auth.js";
11
11
  import { t as credentialInputs } from "./auth_selection-CwGLN9Qz.js";
12
12
  import { readOutgoingCredential, retirePreviousCredential, revokeTokenSet, withdrawKey } from "../retire_credential.js";
13
- import { m as usableCredential, n as authFlow } from "./auth-B1AqRN6z.js";
13
+ import { m as usableCredential, n as authFlow } from "./auth-DY5Bm7Ym.js";
14
14
  import { identityFromAuthDetails, isApiKeyMethod, mintedKeyName, notAnApiKeyMessage } from "../profile_keys.js";
15
15
  import { writer } from "../writer.js";
16
16
  import { noPassthrough, single } from "../utils/flags.js";
@@ -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-ClvDw0Xs.js";
3
+ import { y as status } from "./config-DFj1Btk-.js";
4
4
  // src/commands/status.ts
5
5
  var status_exports = /* @__PURE__ */ __exportAll({
6
6
  builder: () => builder,
@@ -1,4 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BJohB4LM.js";
2
+ import { isNeonApiError } from "../api.js";
2
3
  import { getAuthContext } from "../auth_context.js";
3
4
  import { writer } from "../writer.js";
4
5
  // src/commands/user.ts
@@ -11,14 +12,22 @@ var user_exports = /* @__PURE__ */ __exportAll({
11
12
  userDetails: () => userDetails
12
13
  });
13
14
  const command = "me";
14
- const describe = "Show current user";
15
+ const describe = "Show the current user or organization";
15
16
  const builder = (yargs) => yargs.option("context-file", { hidden: true });
16
17
  const handler = async (args) => {
17
18
  await me(args);
18
19
  };
19
20
  const me = async (props) => {
20
21
  if (!props.apiClient) return;
21
- const { data } = await props.apiClient.getCurrentUserInfo();
22
+ const data = await currentUserOrOrgKey(props.apiClient);
23
+ if ("auth_method" in data) {
24
+ if (props.output === "json" || props.output === "yaml") {
25
+ writer(props).end(data, { fields: ["account_id", "auth_method"] });
26
+ return;
27
+ }
28
+ writer(props).end(orgKeyDetails(data, getAuthContext()), { fields: ["organization", "authentication"] });
29
+ return;
30
+ }
22
31
  if (props.output === "json" || props.output === "yaml") {
23
32
  writer(props).end(data, { fields: [
24
33
  "login",
@@ -36,6 +45,29 @@ const me = async (props) => {
36
45
  "authentication"
37
46
  ] });
38
47
  };
48
+ /**
49
+ * The user, or the organization when the credential is an organization API key, which
50
+ * `GET /users/me` refuses with 403 or 404. `GET /auth` is asked only after that refusal,
51
+ * so user keys and OAuth still cost one request. Any other outcome rethrows the original
52
+ * error object, which the top-level handler needs intact to recover from SSO step-up.
53
+ */
54
+ const currentUserOrOrgKey = async (apiClient) => {
55
+ try {
56
+ return (await apiClient.getCurrentUserInfo()).data;
57
+ } catch (err) {
58
+ if (!isNeonApiError(err) || err.status !== 403 && err.status !== 404) throw err;
59
+ const details = await apiClient.getAuthDetails().then(({ data }) => data, () => void 0);
60
+ if (details?.auth_method !== "api_key_org") throw err;
61
+ return {
62
+ account_id: details.account_id,
63
+ auth_method: details.auth_method
64
+ };
65
+ }
66
+ };
67
+ const orgKeyDetails = (identity, auth) => ({
68
+ organization: identity.account_id,
69
+ authentication: auth ? authenticationLabel(auth) : void 0
70
+ });
39
71
  /** Table-only view; the field names become the row labels. */
40
72
  const userDetails = (user, auth) => ({
41
73
  login: user.login,
package/dist/auth.js CHANGED
@@ -28,7 +28,7 @@ const NEONCTL_SCOPES = [
28
28
  "urn:neoncloud:orgs:delete",
29
29
  "urn:neoncloud:orgs:permission"
30
30
  ];
31
- const AUTH_TIMEOUT_SECONDS = 60;
31
+ const AUTH_TIMEOUT_MINUTES = 10;
32
32
  const defaultClientID = "neonctl";
33
33
  /** `terminal` is a dead grant. A network failure is not. */
34
34
  var AuthRefreshError = class extends Error {
@@ -169,8 +169,8 @@ const auth = async ({ oauthHost, clientId, allowUnsafeTls }) => {
169
169
  const codeChallenge = await client.calculatePKCECodeChallenge(codeVerifier);
170
170
  return new Promise((resolve, reject) => {
171
171
  const timer = setTimeout(() => {
172
- reject(/* @__PURE__ */ new Error(`Authentication timed out after ${AUTH_TIMEOUT_SECONDS} seconds`));
173
- }, AUTH_TIMEOUT_SECONDS * 1e3);
172
+ reject(/* @__PURE__ */ new Error(`Authentication timed out after 10 minutes`));
173
+ }, 6e5);
174
174
  const onRequest = async (request, response) => {
175
175
  if (!request.url?.startsWith("/callback")) {
176
176
  response.writeHead(404);
@@ -210,7 +210,7 @@ const auth = async ({ oauthHost, clientId, allowUnsafeTls }) => {
210
210
  code_challenge_method: "S256",
211
211
  redirect_uri: REDIRECT_URI(listen_port)
212
212
  });
213
- log.info("Awaiting authentication in web browser.");
213
+ log.info(`Awaiting authentication in web browser (up to 10 minutes).`);
214
214
  log.info(`Auth Url: ${authUrl}`);
215
215
  open(authUrl.href).catch((err) => {
216
216
  const msg = `Failed to open web browser. Please copy & paste auth url to authenticate in browser.`;
@@ -220,4 +220,4 @@ const auth = async ({ oauthHost, clientId, allowUnsafeTls }) => {
220
220
  });
221
221
  });
222
222
  };
223
- export { AuthRefreshError, NEONCTL_SCOPES, auth, classifyRefreshFailure, defaultClientID, refreshToken, revokeToken };
223
+ export { AUTH_TIMEOUT_MINUTES, AuthRefreshError, NEONCTL_SCOPES, auth, classifyRefreshFailure, defaultClientID, refreshToken, revokeToken };
@@ -2,7 +2,7 @@ import { t as storeFor } from "./_chunks/credential_io-DbeSh3Pl.js";
2
2
  import { log } from "./log.js";
3
3
  import { authFailureMessage, getAuthContext, locationFromContext } from "./auth_context.js";
4
4
  import { AuthRefreshError } from "./auth.js";
5
- import { d as isAccessTokenUsable, p as refreshStoredCredentials } from "./_chunks/auth-B1AqRN6z.js";
5
+ import { d as isAccessTokenUsable, p as refreshStoredCredentials } from "./_chunks/auth-DY5Bm7Ym.js";
6
6
  // src/auth_recovery.ts
7
7
  const supersededOnDisk = (rejectedToken) => {
8
8
  if (rejectedToken === void 0) return false;
@@ -1 +1 @@
1
- export { t as aliases, n as authFlow, i as builder, a as command, o as deleteCredentialsAt, s as describe, c as ensureAuth, l as existingApiClient, u as handler, d as isAccessTokenUsable, f as locationForAuth, p as refreshStoredCredentials, m as usableCredential } from "../_chunks/auth-B1AqRN6z.js";
1
+ export { t as aliases, n as authFlow, i as builder, a as command, o as deleteCredentialsAt, s as describe, c as ensureAuth, l as existingApiClient, u as handler, d as isAccessTokenUsable, f as locationForAuth, p as refreshStoredCredentials, m as usableCredential } from "../_chunks/auth-DY5Bm7Ym.js";
@@ -1 +1 @@
1
- export { t as builder, r as command, i as describe, a as formatCheckoutPolicyFailure, o as handler } from "../_chunks/checkout-C5RXRmRy.js";
1
+ export { t as builder, r as command, i as describe, a as formatCheckoutPolicyFailure, o as handler } from "../_chunks/checkout-B_hB_ELY.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-ClvDw0Xs.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-DFj1Btk-.js";
@@ -1 +1 @@
1
- export { t as builder, n as command, i as describe, a as handler } from "../_chunks/deploy-D1T3_cYZ.js";
1
+ export { t as builder, n as command, i as describe, a as handler } from "../_chunks/deploy-CVJIahZE.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 localFunctionPortsEnv, m as planFunctionsToUnits, h as reportDevCredential, g as sourceFunctionUrlOverlay } from "../_chunks/dev-hNDBX-5l.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 localFunctionPortsEnv, m as planFunctionsToUnits, h as reportDevCredential, g as sourceFunctionUrlOverlay } from "../_chunks/dev-CtIzg7vq.js";
@@ -9,7 +9,7 @@ import { writer } from "../writer.js";
9
9
  import { formatInitDone, printInitDone } from "../init/chrome.js";
10
10
  import { FUNCTION_SLUG_PATTERN, deriveFunctionSlug } from "../utils/function_slug.js";
11
11
  import { displayPath } from "./env_output.js";
12
- import { _ as missingDependencies, d as ensureConfigPackages, g as installCommandFrom } from "../_chunks/config-ClvDw0Xs.js";
12
+ import { _ as missingDependencies, d as ensureConfigPackages, g as installCommandFrom } from "../_chunks/config-DFj1Btk-.js";
13
13
  import { recommendedOperations } from "../functions/registry.js";
14
14
  import { collidingFiles, operationsFromFlags, planConfigRegistration, planEnvExample, planScaffold, writeScaffold } from "../functions/scaffold.js";
15
15
  import { describeRegistrySources, openRegistry } from "../functions/source.js";
@@ -1 +1 @@
1
- export { t as aliases, n as builder, r as cleanup, i as command, a as describe, s as handler, c as install, l as partitionBranchesToPrune, u as status, d as sync, f as uninstall } from "../_chunks/git-DbJwG1SU.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-CIBowi6T.js";
@@ -1,32 +1,32 @@
1
- import { r as auth_exports } from "../_chunks/auth-B1AqRN6z.js";
1
+ import { r as auth_exports } from "../_chunks/auth-DY5Bm7Ym.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
5
  import { o as env_exports } from "../_chunks/env-DxcO3oJk.js";
6
- import { c as config_exports } from "../_chunks/config-ClvDw0Xs.js";
6
+ import { c as config_exports } from "../_chunks/config-DFj1Btk-.js";
7
7
  import { u as projects_exports } from "../_chunks/projects-a3X4OFEJ.js";
8
- import { a as link_exports } from "../_chunks/link-CHscI_10.js";
8
+ import { a as link_exports } from "../_chunks/link-mdFXf8dW.js";
9
9
  import { o as mcp_exports } from "../_chunks/mcp-SvqWzHnT.js";
10
10
  import { c as plugins_exports } from "../_chunks/plugins-BwUZQ6Ic.js";
11
11
  import { l as skills_exports } from "../_chunks/skills-Bv8oKKwE.js";
12
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-C5RXRmRy.js";
15
+ import { n as checkout_exports } from "../_chunks/checkout-B_hB_ELY.js";
16
16
  import { o as claim_exports } from "../_chunks/claim-Dv5wARrN.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-D1T3_cYZ.js";
22
- import { s as dev_exports } from "../_chunks/dev-hNDBX-5l.js";
21
+ import { r as deploy_exports } from "../_chunks/deploy-CVJIahZE.js";
22
+ import { s as dev_exports } from "../_chunks/dev-CtIzg7vq.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
26
  import { o as functions_exports } from "../_chunks/functions-PHaU-kRb.js";
27
- import { o as git_exports } from "../_chunks/git-DbJwG1SU.js";
27
+ import { o as git_exports } from "../_chunks/git-CIBowi6T.js";
28
28
  import { o as incidents_exports } from "../_chunks/incidents-D6rDn1g2.js";
29
- import { a as init_exports } from "../_chunks/init-D2fClHtC.js";
29
+ import { a as init_exports } from "../_chunks/init-AKhj0lHa.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";
@@ -37,13 +37,13 @@ import { o as orgs_exports } from "../_chunks/orgs-BrvAWM8Z.js";
37
37
  import { o as psql_exports } from "../_chunks/psql-BcxiPR4W.js";
38
38
  import { f as roles_exports } from "../_chunks/roles-BELJqjTy.js";
39
39
  import { o as postgres_exports } from "../_chunks/postgres-BhR1vUFM.js";
40
- import { o as profile_exports } from "../_chunks/profile-Bf5qqUN1.js";
40
+ import { o as profile_exports } from "../_chunks/profile-Qoyql0AR.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
43
  import { s as snapshots_exports } from "../_chunks/snapshots-DxNhjcco.js";
44
- import { a as status_exports } from "../_chunks/status-DdagkQp2.js";
44
+ import { a as status_exports } from "../_chunks/status-DRWS1u6H.js";
45
45
  import { d as triggers_exports } from "../_chunks/triggers-m3IBjiph.js";
46
- import { s as user_exports } from "../_chunks/user-D9mC430O.js";
46
+ import { s as user_exports } from "../_chunks/user-C1pTJS9O.js";
47
47
  import { i as vpc_endpoints_exports } from "../_chunks/vpc_endpoints-C-Y4WK2M.js";
48
48
  // src/commands/index.ts
49
49
  var commands_default = [
@@ -1 +1 @@
1
- export { t as builder, n as command, r as describe, i as handler } from "../_chunks/init-D2fClHtC.js";
1
+ export { t as builder, n as command, r as describe, i as handler } from "../_chunks/init-AKhj0lHa.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-CHscI_10.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-mdFXf8dW.js";
@@ -35,7 +35,7 @@ const commandManifest = [
35
35
  },
36
36
  {
37
37
  command: "me",
38
- describe: "Show current user",
38
+ describe: "Show the current user or organization",
39
39
  load: () => import("./user.js")
40
40
  },
41
41
  {
@@ -1 +1 @@
1
- export { t as aliases, n as builder, r as command, i as describe, a as handler } from "../_chunks/profile-Bf5qqUN1.js";
1
+ export { t as aliases, n as builder, r as command, i as describe, a as handler } from "../_chunks/profile-Qoyql0AR.js";
@@ -1 +1 @@
1
- export { t as builder, n as command, r as describe, i as handler } from "../_chunks/status-DdagkQp2.js";
1
+ export { t as builder, n as command, r as describe, i as handler } from "../_chunks/status-DRWS1u6H.js";
@@ -1 +1 @@
1
- export { t as authenticationLabel, n as builder, r as command, i as describe, a as handler, o as userDetails } from "../_chunks/user-D9mC430O.js";
1
+ export { t as authenticationLabel, n as builder, r as command, i as describe, a as handler, o as userDetails } from "../_chunks/user-C1pTJS9O.js";
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ import { NETWORK_ERROR_MESSAGE, isNetworkError, matchErrorCode } from "./errors.
9
9
  import { analyticsMiddleware, closeAnalytics, initAnalyticsClientMiddleware, isAnalyticsActive, recordCommandSuccessExtras, sendError, takeCommandSuccessExtras, trackCommandSuccess } from "./analytics.js";
10
10
  import { AuthRefreshError, defaultClientID } from "./auth.js";
11
11
  import { getCliName } from "./utils/cli_name.js";
12
- import { c as ensureAuth } from "./_chunks/auth-B1AqRN6z.js";
12
+ import { c as ensureAuth } from "./_chunks/auth-DY5Bm7Ym.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";
package/dist/init/auth.js CHANGED
@@ -2,7 +2,7 @@ import { isNeonApiError } from "../api.js";
2
2
  import { r as defaultDir } from "../_chunks/paths-B55ZfOg1.js";
3
3
  import "../config.js";
4
4
  import "../auth.js";
5
- import { c as ensureAuth, l as existingApiClient } from "../_chunks/auth-B1AqRN6z.js";
5
+ import { c as ensureAuth, l as existingApiClient } from "../_chunks/auth-DY5Bm7Ym.js";
6
6
  import { recoverFrom401 } from "../auth_recovery.js";
7
7
  import { c as pull } from "../_chunks/env-DxcO3oJk.js";
8
8
  import { c as setupNeonMcp } from "../_chunks/mcp-SvqWzHnT.js";
@@ -1,10 +1,10 @@
1
1
  import { isNeonApiError } from "../api.js";
2
2
  import { contextBranch, readContextFile } from "../context.js";
3
- import { c as ensureAuth } from "../_chunks/auth-B1AqRN6z.js";
3
+ import { c as ensureAuth } from "../_chunks/auth-DY5Bm7Ym.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-ClvDw0Xs.js";
7
+ import { r as applyCmd } from "../_chunks/config-DFj1Btk-.js";
8
8
  import { authContext } from "./auth.js";
9
9
  import { existsSync } from "node:fs";
10
10
  import { missingFunctionEnv } from "@neon/config";
package/dist/init/link.js CHANGED
@@ -2,9 +2,9 @@ import { isNeonApiError } from "../api.js";
2
2
  import { r as defaultDir } from "../_chunks/paths-B55ZfOg1.js";
3
3
  import "../config.js";
4
4
  import "../auth.js";
5
- import { c as ensureAuth } from "../_chunks/auth-B1AqRN6z.js";
5
+ import { c as ensureAuth } from "../_chunks/auth-DY5Bm7Ym.js";
6
6
  import { recoverFrom401 } from "../auth_recovery.js";
7
- import { s as runLink } from "../_chunks/link-CHscI_10.js";
7
+ import { s as runLink } from "../_chunks/link-mdFXf8dW.js";
8
8
  // src/init/link.ts
9
9
  const isUnauthorized = (error) => isNeonApiError(error) && error.status === 401;
10
10
  const authenticationFailed = () => /* @__PURE__ */ new Error("Authentication failed.");
package/dist/init/run.js CHANGED
@@ -14,8 +14,8 @@ import { getAgentDisplayName } from "../mcp/agents.js";
14
14
  import { missingPluginsCommands, pluginsCommandProblemText, pluginsInstallableAgents, unusablePluginsCommands } from "../plugins/targets.js";
15
15
  import { AGENTS_NOT_INSTALLED, CANCELLED_BODY, CLAIMABLE_ACCOUNT_FLAGS, CLAIMABLE_ALREADY_LINKED, CLAIMABLE_MCP_API_KEY, CLAIMABLE_NO_LINK, MCP_API_KEY_NEEDS_AUTH, MCP_SCOPED_NEEDS_PROJECT, NON_TTY_LINK_NEEDS_AUTH, NO_AGENTS_FALLBACK_STATUS, PROGRESS, PROJECT_PINNED_OFFLINE, claimableNext, claimableThenServicesNext, configInitNext, envPullFailedNext, existingConfigNext, installFailedNext, mcpAfterLinkNext, mcpConfigLocationSkipped, mcpConfigLocationUnavailable, mcpKeyFailedNext, namedAgentsUnavailable, newConfigNext, offlinePinNext, skippedLinkNext, toolingFailedNext, unattendedUnauthedNext } from "./copy.js";
16
16
  import { agentsRowValue, configRowValue, formatInitDone, headingForKind, printInitBanner, printInitDone, printInitProgress, projectRowValue, shouldPrintInitBanner } from "./chrome.js";
17
- import { h as initCmd, t as ConfigInstallFailed } from "../_chunks/config-ClvDw0Xs.js";
18
- import { o as quoteFlagValue, s as runLink } from "../_chunks/link-CHscI_10.js";
17
+ import { h as initCmd, t as ConfigInstallFailed } from "../_chunks/config-DFj1Btk-.js";
18
+ import { o as quoteFlagValue, s as runLink } from "../_chunks/link-mdFXf8dW.js";
19
19
  import { runAuthenticatedLink } from "./link.js";
20
20
  import { mcpInstallableAgents } from "../mcp/targets.js";
21
21
  import { skillsInstallableAgents } from "../skills/targets.js";
@@ -657,7 +657,7 @@ const runInit = async (props) => {
657
657
  }
658
658
  }
659
659
  const pendingUnauthed = funnel.link === "skipped" && !noLink;
660
- const pendingServices = extraServices && linked;
660
+ const pendingServices = linked && declared.some((service) => service !== "ai-gateway" || envPullPlan.kind === "skip");
661
661
  const pendingClaimable = funnel.link === "claimable" && claimExpiresAt !== void 0;
662
662
  const pendingExisting = funnel.config === "existing" && linked && !wroteNewFile;
663
663
  const pending = pinnedOffline || pendingUnauthed || pendingServices || pendingClaimable && extraServices || pendingExisting;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neon",
3
- "version": "9.7.1",
3
+ "version": "9.7.2",
4
4
  "description": "CLI tool for Neon, the cloud backend primitives built around Lakebase Postgres",
5
5
  "keywords": [
6
6
  "neon",
@@ -115,8 +115,8 @@
115
115
  "@neon-internals/cli-core": "0.0.0",
116
116
  "@neon-internals/env-core": "0.0.55",
117
117
  "@neon/env": "2.1.7",
118
- "@neon/e2e-harness": "0.0.0",
119
- "@neon/functions": "0.11.0"
118
+ "@neon/functions": "0.11.0",
119
+ "@neon/e2e-harness": "0.0.0"
120
120
  },
121
121
  "publishConfig": {
122
122
  "access": "public",