neon 8.11.1 → 8.11.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 (105) hide show
  1. package/README.md +1 -1
  2. package/dist/_chunks/api-GbEaBZJ5.js +388 -0
  3. package/dist/_chunks/api_keys-CNnnugbQ.js +281 -0
  4. package/dist/_chunks/ask-DVwy0eUL.js +155 -0
  5. package/dist/_chunks/auth-CIUtXByB.js +495 -0
  6. package/dist/_chunks/bootstrap-wPZWa1sT.js +499 -0
  7. package/dist/_chunks/branches-BNa1xX1L.js +460 -0
  8. package/dist/_chunks/bucket-BCdryTkD.js +409 -0
  9. package/dist/_chunks/checkout-CXIOydqZ.js +348 -0
  10. package/dist/_chunks/claim-DqAvAvDm.js +473 -0
  11. package/dist/_chunks/config-BH_qRHiG.js +1113 -0
  12. package/dist/_chunks/connection_string-DB4awPzZ.js +154 -0
  13. package/dist/_chunks/credentials-BSjE9fRR.js +146 -0
  14. package/dist/_chunks/data_api-Djxj5ZQD.js +263 -0
  15. package/dist/_chunks/databases-Dok4wru7.js +84 -0
  16. package/dist/_chunks/deploy-D7B0Xfjg.js +33 -0
  17. package/dist/_chunks/dev-CSvxAecE.js +945 -0
  18. package/dist/_chunks/diff-DhxxbdQE.js +178 -0
  19. package/dist/_chunks/docs-CrVybkTP.js +197 -0
  20. package/dist/_chunks/env-5HS5qQGd.js +284 -0
  21. package/dist/_chunks/feedback-CMayyTa8.js +88 -0
  22. package/dist/_chunks/functions-Q0zuvtnk.js +464 -0
  23. package/dist/_chunks/git-H32TNt6M.js +356 -0
  24. package/dist/_chunks/init-BkA6RilG.js +111 -0
  25. package/dist/_chunks/inspect-g0wekylj.js +90 -0
  26. package/dist/_chunks/ip_allow-5lLFvIuE.js +106 -0
  27. package/dist/_chunks/link-BgtkOBws.js +936 -0
  28. package/dist/_chunks/logs-DWkpjzIH.js +291 -0
  29. package/dist/_chunks/mcp-Bo-7TKc7.js +253 -0
  30. package/dist/_chunks/neon_auth-CBs1_3qu.js +822 -0
  31. package/dist/_chunks/open-CX3BT3Tp.js +33 -0
  32. package/dist/_chunks/operations-D4I-AxVs.js +37 -0
  33. package/dist/_chunks/orgs-xGfANwHQ.js +52 -0
  34. package/dist/_chunks/plugins-DqD7BDO1.js +169 -0
  35. package/dist/_chunks/profile-yXOiKk9R.js +672 -0
  36. package/dist/_chunks/projects-BwI2Uo0z.js +439 -0
  37. package/dist/_chunks/psql-BM-doe8e.js +64 -0
  38. package/dist/_chunks/realtime-BRqIyGR-.js +79 -0
  39. package/dist/_chunks/roles-B4w3YT_7.js +79 -0
  40. package/dist/_chunks/set_context-DbrwoImy.js +38 -0
  41. package/dist/_chunks/skills-DyiBXKS3.js +255 -0
  42. package/dist/_chunks/snapshots-RJBzW8GM.js +338 -0
  43. package/dist/_chunks/status-DV8Z2kw3.js +44 -0
  44. package/dist/_chunks/triggers-BrRo1z4b.js +302 -0
  45. package/dist/_chunks/user-dlOGXbX9.js +60 -0
  46. package/dist/_chunks/vpc_endpoints-CNb0YfMo.js +105 -0
  47. package/dist/auth_recovery.js +1 -1
  48. package/dist/commands/api.js +1 -388
  49. package/dist/commands/api_keys.js +1 -281
  50. package/dist/commands/ask.js +1 -155
  51. package/dist/commands/auth.js +1 -495
  52. package/dist/commands/bootstrap.js +1 -499
  53. package/dist/commands/branches.js +1 -460
  54. package/dist/commands/bucket.js +1 -409
  55. package/dist/commands/checkout.js +1 -348
  56. package/dist/commands/claim.js +1 -473
  57. package/dist/commands/config.js +1 -1113
  58. package/dist/commands/connection_string.js +1 -154
  59. package/dist/commands/credentials.js +1 -146
  60. package/dist/commands/data_api.js +1 -263
  61. package/dist/commands/databases.js +1 -84
  62. package/dist/commands/deploy.js +1 -33
  63. package/dist/commands/dev.js +1 -945
  64. package/dist/commands/diff.js +1 -178
  65. package/dist/commands/docs.js +1 -197
  66. package/dist/commands/env.js +1 -284
  67. package/dist/commands/feedback.js +1 -88
  68. package/dist/commands/functions.js +1 -464
  69. package/dist/commands/functions_new.js +1 -1
  70. package/dist/commands/git.js +1 -356
  71. package/dist/commands/index.js +45 -45
  72. package/dist/commands/init.js +1 -111
  73. package/dist/commands/inspect.js +1 -90
  74. package/dist/commands/ip_allow.js +1 -106
  75. package/dist/commands/link.js +1 -936
  76. package/dist/commands/logs.js +1 -291
  77. package/dist/commands/mcp.js +1 -253
  78. package/dist/commands/neon_auth.js +1 -822
  79. package/dist/commands/open.js +1 -33
  80. package/dist/commands/operations.js +1 -37
  81. package/dist/commands/orgs.js +1 -52
  82. package/dist/commands/plugins.js +1 -169
  83. package/dist/commands/profile.js +1 -672
  84. package/dist/commands/projects.js +1 -439
  85. package/dist/commands/psql.js +1 -64
  86. package/dist/commands/realtime.js +1 -79
  87. package/dist/commands/roles.js +1 -79
  88. package/dist/commands/set_context.js +1 -38
  89. package/dist/commands/skills.js +1 -255
  90. package/dist/commands/snapshots.js +1 -338
  91. package/dist/commands/status.js +1 -44
  92. package/dist/commands/subscribe.js +1 -1
  93. package/dist/commands/triggers.js +1 -302
  94. package/dist/commands/user.js +1 -60
  95. package/dist/commands/vpc_endpoints.js +1 -105
  96. package/dist/functions/registry.js +29 -151
  97. package/dist/functions/source.js +42 -2
  98. package/dist/index.js +1 -1
  99. package/dist/init/auth.js +3 -3
  100. package/dist/init/link.js +2 -2
  101. package/dist/init/run.js +3 -3
  102. package/dist/init/tooling.js +3 -3
  103. package/dist/mcp/mint.js +1 -1
  104. package/dist/test_utils/registry.js +1 -2
  105. package/package.json +8 -6
@@ -1,33 +1 @@
1
- import { t as __exportAll } from "../_chunks/rolldown-runtime-8H4AJuhK.js";
2
- import { log } from "../log.js";
3
- import { getCliName } from "../utils/cli_name.js";
4
- import open from "open";
5
- //#region src/commands/open.ts
6
- var open_exports = /* @__PURE__ */ __exportAll({
7
- builder: () => builder,
8
- command: () => command,
9
- describe: () => describe,
10
- handler: () => handler,
11
- projectConsoleUrl: () => projectConsoleUrl
12
- });
13
- const command = "open";
14
- const describe = "Open the linked project in the Neon Console";
15
- const builder = (argv) => argv.usage("$0 open [options]").option("project-id", {
16
- describe: "Project ID (defaults to the project linked in .neon)",
17
- type: "string"
18
- }).example("$0 open", describe);
19
- const projectConsoleUrl = (projectId) => `https://console.neon.tech/app/projects/${encodeURIComponent(projectId)}`;
20
- const handler = async (props) => {
21
- if (!props.projectId) throw new Error(`No Neon project linked. Run \`${getCliName()} link\` to link this directory to a project.`);
22
- const url = projectConsoleUrl(props.projectId);
23
- log.info("Opening %s in your browser.", url);
24
- const subprocess = await open(url);
25
- await new Promise((resolve, reject) => {
26
- subprocess.once("spawn", resolve);
27
- subprocess.once("error", (error) => {
28
- reject(/* @__PURE__ */ new Error(`Failed to open the Neon Console in your browser. Open ${url} manually. ${error.message}`));
29
- });
30
- });
31
- };
32
- //#endregion
33
- export { builder, command, describe, handler, projectConsoleUrl, open_exports as t };
1
+ export { t as builder, n as command, r as describe, i as handler, o as projectConsoleUrl } from "../_chunks/open-CX3BT3Tp.js";
@@ -1,37 +1 @@
1
- import { t as __exportAll } from "../_chunks/rolldown-runtime-8H4AJuhK.js";
2
- import { writer } from "../writer.js";
3
- import { fillSingleProject } from "../utils/enrichers.js";
4
- //#region src/commands/operations.ts
5
- var operations_exports = /* @__PURE__ */ __exportAll({
6
- aliases: () => aliases,
7
- builder: () => builder,
8
- command: () => command,
9
- describe: () => describe,
10
- handler: () => handler,
11
- list: () => list
12
- });
13
- const OPERATIONS_FIELDS = [
14
- "id",
15
- "action",
16
- "status",
17
- "created_at"
18
- ];
19
- const command = "operations";
20
- const describe = "Manage operations";
21
- const aliases = ["operation"];
22
- const builder = (argv) => argv.usage("$0 operations <sub-command> [options]").options({ "project-id": {
23
- describe: "Project ID",
24
- type: "string"
25
- } }).middleware(fillSingleProject).command("list", "List operations", (yargs) => yargs, (args) => list(args));
26
- const handler = (args) => {
27
- return args;
28
- };
29
- const list = async (props) => {
30
- const { data } = await props.apiClient.listProjectOperations({
31
- projectId: props.projectId,
32
- limit: props.limit
33
- });
34
- writer(props).end(data.operations, { fields: OPERATIONS_FIELDS });
35
- };
36
- //#endregion
37
- export { aliases, builder, command, describe, handler, list, operations_exports as t };
1
+ export { t as aliases, n as builder, r as command, i as describe, a as handler, o as list } from "../_chunks/operations-D4I-AxVs.js";
@@ -1,52 +1 @@
1
- import { t as __exportAll } from "../_chunks/rolldown-runtime-8H4AJuhK.js";
2
- import { readContextFile } from "../context.js";
3
- import { writer } from "../writer.js";
4
- import chalk from "chalk";
5
- //#region src/commands/orgs.ts
6
- var orgs_exports = /* @__PURE__ */ __exportAll({
7
- aliases: () => aliases,
8
- builder: () => builder,
9
- command: () => command,
10
- describe: () => describe,
11
- handler: () => handler,
12
- planName: () => planName
13
- });
14
- const ORG_FIELDS = [
15
- "id",
16
- "name",
17
- "plan"
18
- ];
19
- const command = "orgs";
20
- const describe = "Manage organizations";
21
- const aliases = ["org"];
22
- const builder = (argv) => {
23
- return argv.usage("$0 orgs <sub-command> [options]").command("list", "List organizations", (yargs) => yargs, async (args) => {
24
- await list(args);
25
- });
26
- };
27
- const handler = (args) => {
28
- return args;
29
- };
30
- const list = async (props) => {
31
- const out = writer(props);
32
- const { data: { organizations } } = await props.apiClient.getCurrentUserOrganizations();
33
- const current = readContextFile(props.contextFile).orgId;
34
- out.write(organizations, {
35
- fields: ORG_FIELDS,
36
- title: "Organizations",
37
- emptyMessage: "You are not a member of any organization.",
38
- renderColumns: {
39
- plan: (org) => planName(org.plan),
40
- name: (org) => org.id === current ? `${chalk.green("[current]")} ${org.name}` : org.name
41
- }
42
- });
43
- out.end();
44
- };
45
- const ACRONYMS = {
46
- aws: "AWS",
47
- pg: "PG"
48
- };
49
- /** `free_v3` -> `Free`, `aws_marketplace` -> `AWS Marketplace`; JSON/YAML keep the API id. */
50
- const planName = (plan) => (plan ?? "").replace(/_v\d+$/, "").split("_").filter(Boolean).map((word) => ACRONYMS[word] ?? word[0].toUpperCase() + word.slice(1)).join(" ");
51
- //#endregion
52
- export { aliases, builder, command, describe, handler, planName, orgs_exports as t };
1
+ export { t as aliases, n as builder, r as command, i as describe, a as handler, s as planName } from "../_chunks/orgs-xGfANwHQ.js";
@@ -1,169 +1 @@
1
- import { t as __exportAll } from "../_chunks/rolldown-runtime-8H4AJuhK.js";
2
- import { log } from "../log.js";
3
- import { recordCommandSuccessExtras } from "../analytics.js";
4
- import { helpCsv, helpEpilogue } from "../utils/help_text.js";
5
- import { getAgentDisplayName } from "../mcp/agents.js";
6
- import { NEON_MCP_URL } from "../mcp/install.js";
7
- import "../init/agents.js";
8
- import { pluginsInstallableAgents } from "../plugins/targets.js";
9
- import { writer } from "../writer.js";
10
- import { noPassthrough } from "../utils/flags.js";
11
- import { AGENT_PLUGIN_SKIP_MESSAGE } from "../init/copy.js";
12
- import { canPickAgentsInteractively, skippableAgentPicker } from "../utils/agent_picker.js";
13
- import { resolvePluginsPlan } from "../plugins/plan.js";
14
- import { NEON_PLUGIN_NAME, PLUGIN_SKILLS, PLUGIN_SOURCE, neonPluginsRetryCommand, pluginsAddArgs, runPluginsCli } from "../plugins/run.js";
15
- //#region src/commands/plugins.ts
16
- var plugins_exports = /* @__PURE__ */ __exportAll({
17
- aliases: () => aliases,
18
- builder: () => builder,
19
- command: () => command,
20
- describe: () => describe,
21
- handler: () => handler,
22
- installPlugins: () => installPlugins,
23
- pluginsInstallError: () => pluginsInstallError,
24
- reportPluginsInstall: () => reportPluginsInstall
25
- });
26
- const coerceAgents = (value) => {
27
- if (value === void 0) return [];
28
- const list = Array.isArray(value) ? value : [value];
29
- if (list.length === 0) throw new Error("--agent needs a value. Pass one, or omit the flag entirely.");
30
- return list.map((item) => {
31
- if (typeof item !== "string" || item.trim() === "") throw new Error("--agent needs a value. Pass one, or omit the flag entirely.");
32
- return item;
33
- });
34
- };
35
- const scopeLabel = (scope) => scope === "project" ? "project" : "user";
36
- const command = "plugins";
37
- const aliases = ["plugin"];
38
- 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
- const builder = (argv) => argv.usage("$0 plugins [options]").options({
42
- yes: {
43
- alias: "y",
44
- type: "boolean",
45
- default: false,
46
- describe: "Skip prompts. Detected agents (project folders, else the host CLI agent). --global uses installed apps, else the host CLI agent"
47
- },
48
- global: {
49
- type: "boolean",
50
- default: false,
51
- describe: "Install user-level. Default is project"
52
- },
53
- agent: {
54
- alias: "a",
55
- type: "array",
56
- string: true,
57
- describe: "Coding agent to install into (repeatable). Skips the agent picker. Values listed below",
58
- coerce: coerceAgents
59
- }
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"));
61
- /**
62
- * Plans and runs the plugin install for every resolved target. No CLI-only concerns here
63
- * (no `writer` table, no `recordCommandSuccessExtras`): a caller that only wants the
64
- * outcome — `neon init` / `neon bootstrap` — gets it without rendering a result table.
65
- */
66
- const installPlugins = async (options) => {
67
- const cwd = options.cwd ?? process.cwd();
68
- const yes = options.yes === true;
69
- const interactive = canPickAgentsInteractively() && !yes;
70
- const plan = await resolvePluginsPlan({
71
- global: options.global === true,
72
- agents: options.agents ?? [],
73
- yes,
74
- cwd,
75
- interactive,
76
- pickAgents: skippableAgentPicker(options.allowAgentSkip, AGENT_PLUGIN_SKIP_MESSAGE)
77
- });
78
- 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
- for (const { agent, command } of plan.missingCommands) log.warning("Skipping %s: the plugin installs through \"%s\", which was not found on PATH.", getAgentDisplayName(agent), command);
81
- const rows = [];
82
- const failed = [];
83
- const scope = scopeLabel(plan.scope);
84
- for (const [index, mapped] of plan.targets.entries()) {
85
- const args = pluginsAddArgs({
86
- target: mapped.target,
87
- global: plan.scope === "global"
88
- });
89
- const agent = mapped.agents.join(", ");
90
- const displayNames = mapped.agents.map((id) => getAgentDisplayName(id)).join(", ");
91
- log.info("Installing the Neon plugin for %s (%d/%d)...", displayNames, index + 1, plan.targets.length);
92
- try {
93
- await runPluginsCli({
94
- args,
95
- cwd
96
- });
97
- rows.push({
98
- scope,
99
- plugin: NEON_PLUGIN_NAME,
100
- agent,
101
- status: "installed"
102
- });
103
- } catch (error) {
104
- const message = error instanceof Error ? error.message : String(error);
105
- rows.push({
106
- scope,
107
- plugin: NEON_PLUGIN_NAME,
108
- agent,
109
- status: "failed",
110
- error: "plugins CLI failed"
111
- });
112
- failed.push({
113
- agents: mapped.agents,
114
- message
115
- });
116
- }
117
- }
118
- return {
119
- scope: plan.scope,
120
- rows,
121
- failed
122
- };
123
- };
124
- /** The exact error `neon plugins` throws for a failed outcome, or `undefined` on success. */
125
- const pluginsInstallError = (outcome) => {
126
- const { failed, rows, scope } = outcome;
127
- if (failed.length === 0) return;
128
- const first = failed[0];
129
- 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
- });
134
- if (first.message.includes("needs npx (Node.js)")) return new Error(first.message);
135
- const detail = failed.map((row) => row.message).join("\n");
136
- if (failed.length === rows.length) return /* @__PURE__ */ new Error(`${detail}\nRetry with: ${retry}`);
137
- return /* @__PURE__ */ new Error(`Failed to install the Neon plugin for: ${failed.flatMap((row) => row.agents).join(", ")}.\n${detail}\nRetry with: ${retry}`);
138
- };
139
- /** Writes the results table and, on success, the "Installed the Neon plugin" line. Shared by `neon plugins` and any in-process caller that wants the same human output. */
140
- const reportPluginsInstall = (props, outcome) => {
141
- const out = writer(props);
142
- out.write(outcome.rows, {
143
- fields: [
144
- "scope",
145
- "plugin",
146
- "agent",
147
- "status",
148
- "error"
149
- ],
150
- title: "Plugins"
151
- });
152
- out.end();
153
- 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).");
155
- };
156
- const handler = async (props) => {
157
- const outcome = await installPlugins({
158
- cwd: props.cwd,
159
- yes: props.yes,
160
- global: props.global,
161
- agents: props.agent
162
- });
163
- reportPluginsInstall(props, outcome);
164
- const error = pluginsInstallError(outcome);
165
- if (error) throw error;
166
- recordCommandSuccessExtras({ scope: outcome.scope });
167
- };
168
- //#endregion
169
- export { aliases, builder, command, describe, handler, installPlugins, pluginsInstallError, reportPluginsInstall, plugins_exports as t };
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-DqD7BDO1.js";