neon 4.4.0 → 4.5.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.
- package/README.md +59 -5
- package/dist/_chunks/{auth_selection-Bx2NAgkk.js → auth_selection-ktL6uoEe.js} +1 -1
- package/dist/_chunks/{credential_io-D2vw1UOw.js → credential_io-B1JxWELN.js} +2 -1
- package/dist/_chunks/{profiles-CVXNvU2r.js → profiles-D95AeZ5v.js} +4 -39
- package/dist/_chunks/secure_file-BucZj4yQ.js +39 -0
- package/dist/analytics.js +1 -1
- package/dist/api.js +14 -0
- package/dist/auth_context.js +1 -0
- package/dist/claimable/api.js +242 -0
- package/dist/claimable/state.js +92 -0
- package/dist/commands/auth.js +42 -5
- package/dist/commands/bootstrap.js +1 -1
- package/dist/commands/claim.js +466 -0
- package/dist/commands/config.js +10 -18
- package/dist/commands/index.js +2 -0
- package/dist/commands/mcp.js +10 -6
- package/dist/commands/plugins.js +8 -3
- package/dist/commands/profile.js +4 -3
- package/dist/commands/skills.js +6 -4
- package/dist/config_services.js +18 -0
- package/dist/context.js +3 -1
- package/dist/credential_io.js +1 -1
- package/dist/init/auth.js +2 -2
- package/dist/init/profile_cli.js +2 -2
- package/dist/plugins/run.js +10 -1
- package/dist/retire_credential.js +1 -1
- package/dist/skills/catalog.js +8 -1
- package/dist/utils/help_text.js +29 -0
- package/dist/utils/middlewares.js +1 -1
- package/package.json +5 -5
package/dist/commands/mcp.js
CHANGED
|
@@ -4,12 +4,13 @@ import { readContextFile } from "../context.js";
|
|
|
4
4
|
import { getCliName } from "../utils/cli_name.js";
|
|
5
5
|
import { writer } from "../writer.js";
|
|
6
6
|
import { noPassthrough, single } from "../utils/flags.js";
|
|
7
|
-
import { existingNeonApiKey, installNeonMcpServer, neonMcpUrl, parseMcpCategories, trackedProjectMcpConfig } from "../mcp/install.js";
|
|
7
|
+
import { NEON_MCP_CATEGORIES, NEON_MCP_URL, existingNeonApiKey, installNeonMcpServer, neonMcpUrl, parseMcpCategories, trackedProjectMcpConfig } from "../mcp/install.js";
|
|
8
8
|
import { mintMcpApiKey, mintedKeyRevokeCommand, withdrawMintedKey } from "../mcp/mint.js";
|
|
9
9
|
import { canPickAgentsInteractively } from "../utils/agent_picker.js";
|
|
10
|
-
import { resolveInstallTargets } from "../mcp/targets.js";
|
|
10
|
+
import { mcpInstallableAgents, resolveInstallTargets } from "../mcp/targets.js";
|
|
11
11
|
import { confirmMcpInstall } from "../mcp/wizard.js";
|
|
12
12
|
import { resolveMcpPlan } from "../mcp/plan.js";
|
|
13
|
+
import { helpCsv, helpEpilogue } from "../utils/help_text.js";
|
|
13
14
|
//#region src/commands/mcp.ts
|
|
14
15
|
var mcp_exports = /* @__PURE__ */ __exportAll({
|
|
15
16
|
builder: () => builder,
|
|
@@ -19,6 +20,9 @@ var mcp_exports = /* @__PURE__ */ __exportAll({
|
|
|
19
20
|
});
|
|
20
21
|
const command = "mcp";
|
|
21
22
|
const describe = "Install the Neon MCP server into coding agents";
|
|
23
|
+
const mcpGlobalAgents = mcpInstallableAgents("global");
|
|
24
|
+
const mcpProjectAgents = mcpInstallableAgents("project");
|
|
25
|
+
const mcpProjectDroppedAgents = mcpGlobalAgents.filter((id) => !mcpProjectAgents.includes(id));
|
|
22
26
|
const builder = (argv) => argv.usage("$0 mcp [options]").options({
|
|
23
27
|
oauth: {
|
|
24
28
|
type: "boolean",
|
|
@@ -34,13 +38,13 @@ const builder = (argv) => argv.usage("$0 mcp [options]").options({
|
|
|
34
38
|
alias: "y",
|
|
35
39
|
type: "boolean",
|
|
36
40
|
default: false,
|
|
37
|
-
describe: "Skip prompts. Defaults
|
|
41
|
+
describe: "Skip prompts. Defaults listed below. --project, --oauth, --agent, --read-only, --project-id and --category still apply"
|
|
38
42
|
},
|
|
39
43
|
agent: {
|
|
40
44
|
alias: "a",
|
|
41
45
|
type: "array",
|
|
42
46
|
string: true,
|
|
43
|
-
describe: "Coding agent to install into (repeatable). Skips the agent picker",
|
|
47
|
+
describe: "Coding agent to install into (repeatable). Skips the agent picker. Values listed below",
|
|
44
48
|
coerce: (value) => {
|
|
45
49
|
if (value === void 0) return [];
|
|
46
50
|
const list = Array.isArray(value) ? value : [value];
|
|
@@ -65,7 +69,7 @@ const builder = (argv) => argv.usage("$0 mcp [options]").options({
|
|
|
65
69
|
category: {
|
|
66
70
|
type: "array",
|
|
67
71
|
string: true,
|
|
68
|
-
describe: "MCP tool category (repeatable or comma-separated). Default: all",
|
|
72
|
+
describe: "MCP tool category (repeatable or comma-separated). Default: all. Values listed below",
|
|
69
73
|
coerce: (value) => {
|
|
70
74
|
if (value === void 0) return [];
|
|
71
75
|
const list = Array.isArray(value) ? value : [value];
|
|
@@ -82,7 +86,7 @@ const builder = (argv) => argv.usage("$0 mcp [options]").options({
|
|
|
82
86
|
return parseMcpCategories(parts);
|
|
83
87
|
}
|
|
84
88
|
}
|
|
85
|
-
}).example("$0 mcp", "Interactive: config location, agents, auth, then confirm").example("$0 mcp -y", "Global config, detected agents,
|
|
89
|
+
}).example("$0 mcp", "Interactive: config location, agents, auth, then confirm").example("$0 mcp -y", "Global config, detected agents, reuse or mint an API key").example("$0 mcp --oauth", "Install with OAuth; the agent signs in on first use").example("$0 mcp --project", "Write project-level config").example("$0 mcp --agent cursor --agent claude-code", "Install into specific agents").example("$0 mcp --read-only", "Hide write tools via ?readonly=true").example("$0 mcp --project-id <id>", "Pin tools to one project via ?projectId=").example("$0 mcp --category querying --category schema", "Limit tools to those categories").epilogue(helpEpilogue(`Installs ${NEON_MCP_URL}`, helpCsv("Supported agents at global scope", mcpGlobalAgents), helpCsv("--project does not support", mcpProjectDroppedAgents), helpCsv("Supported categories", NEON_MCP_CATEGORIES), "neon mcp -y:", " global config", " every globally detected agent", " reuse an existing Neon MCP API key, else mint an account-wide key", " write tools on, all categories", " no project pin (including from .neon)")).strict().check(noPassthrough("mcp"));
|
|
86
90
|
const handler = async (props) => {
|
|
87
91
|
const cwd = process.cwd();
|
|
88
92
|
const interactive = canPickAgentsInteractively() && props.yes !== true;
|
package/dist/commands/plugins.js
CHANGED
|
@@ -2,11 +2,14 @@ import { t as __exportAll } from "../_chunks/rolldown-runtime-8H4AJuhK.js";
|
|
|
2
2
|
import { log } from "../log.js";
|
|
3
3
|
import { writer } from "../writer.js";
|
|
4
4
|
import { noPassthrough } from "../utils/flags.js";
|
|
5
|
+
import { NEON_MCP_URL } from "../mcp/install.js";
|
|
5
6
|
import { getAgentDisplayName } from "../mcp/agents.js";
|
|
6
7
|
import "../init/agents.js";
|
|
7
8
|
import { canPickAgentsInteractively } from "../utils/agent_picker.js";
|
|
9
|
+
import { helpCsv, helpEpilogue } from "../utils/help_text.js";
|
|
10
|
+
import { pluginsInstallableAgents } from "../plugins/targets.js";
|
|
8
11
|
import { resolvePluginsPlan } from "../plugins/plan.js";
|
|
9
|
-
import { NEON_PLUGIN_NAME, neonPluginsRetryCommand, pluginsAddArgs, runPluginsCli } from "../plugins/run.js";
|
|
12
|
+
import { NEON_PLUGIN_NAME, PLUGIN_SKILLS, PLUGIN_SOURCE, neonPluginsRetryCommand, pluginsAddArgs, runPluginsCli } from "../plugins/run.js";
|
|
10
13
|
import { confirmPluginsInstall } from "../plugins/wizard.js";
|
|
11
14
|
//#region src/commands/plugins.ts
|
|
12
15
|
var plugins_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -27,6 +30,8 @@ const coerceAgents = (value) => {
|
|
|
27
30
|
};
|
|
28
31
|
const command = "plugins";
|
|
29
32
|
const describe = "Install the Neon plugin into coding agents";
|
|
33
|
+
const pluginProjectAgents = pluginsInstallableAgents("project");
|
|
34
|
+
const pluginGlobalOnlyAgents = pluginsInstallableAgents("global").filter((id) => !pluginProjectAgents.includes(id));
|
|
30
35
|
const builder = (argv) => argv.usage("$0 plugins [options]").options({
|
|
31
36
|
yes: {
|
|
32
37
|
alias: "y",
|
|
@@ -43,10 +48,10 @@ const builder = (argv) => argv.usage("$0 plugins [options]").options({
|
|
|
43
48
|
alias: "a",
|
|
44
49
|
type: "array",
|
|
45
50
|
string: true,
|
|
46
|
-
describe: "Coding agent to install into (repeatable). Skips the agent picker",
|
|
51
|
+
describe: "Coding agent to install into (repeatable). Skips the agent picker. Values listed below",
|
|
47
52
|
coerce: coerceAgents
|
|
48
53
|
}
|
|
49
|
-
}).example("$0 plugins", "Interactive: agents, then confirm").example("$0 plugins -y", "Detected agents, skip prompts").example("$0 plugins --agent cursor --agent claude-code", "Install into specific agents").example("$0 plugins --global", "Install user-level").strict().check(noPassthrough("plugins"));
|
|
54
|
+
}).example("$0 plugins", "Interactive: agents, then confirm").example("$0 plugins -y", "Detected agents, 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"));
|
|
50
55
|
const handler = async (props) => {
|
|
51
56
|
const cwd = process.cwd();
|
|
52
57
|
const yes = props.yes === true;
|
package/dist/commands/profile.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { t as __exportAll } from "../_chunks/rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import {
|
|
3
|
-
import { c as describeScope, d as scopeOf, l as interpretCredentials, n as KEYRING_SERVICE, o as apiKeyCredentials, r as keyringAccount, s as credentialLabel, t as storeFor } from "../_chunks/credential_io-
|
|
2
|
+
import { t as writeSecretFile } from "../_chunks/secure_file-BucZj4yQ.js";
|
|
3
|
+
import { c as describeScope, d as scopeOf, l as interpretCredentials, n as KEYRING_SERVICE, o as apiKeyCredentials, r as keyringAccount, s as credentialLabel, t as storeFor } from "../_chunks/credential_io-B1JxWELN.js";
|
|
4
4
|
import { isCi } from "../env.js";
|
|
5
5
|
import { log } from "../log.js";
|
|
6
6
|
import { getApiClient, isNeonApiError } from "../api.js";
|
|
7
7
|
import { o as isOwnedCredentialPath, r as credentialsPath } from "../_chunks/paths-g3DRqJiD.js";
|
|
8
8
|
import { setAuthContext } from "../auth_context.js";
|
|
9
|
+
import { _ as upsertProfile, a as canDropProfilesFile, c as listProfiles, d as newProfileLocation, f as profilesFilePath, g as selectProfileName, h as resolveProfile, i as assertValidProfileName, l as locationForName, m as readProfiles, n as KEYRING_CREDENTIALS, o as credentialsDisplay, p as profilesUsingPath, r as assertProfilesUsable, s as isKeyringPointer, u as locationOf, v as CRED_STORAGE_FILE, y as CRED_STORAGE_KEYRING } from "../_chunks/profiles-D95AeZ5v.js";
|
|
9
10
|
import { auth, revokeToken } from "../auth.js";
|
|
10
|
-
import { t as credentialInputs } from "../_chunks/auth_selection-
|
|
11
|
+
import { t as credentialInputs } from "../_chunks/auth_selection-ktL6uoEe.js";
|
|
11
12
|
import { readOutgoingCredential, retirePreviousCredential, revokeTokenSet, withdrawKey } from "../retire_credential.js";
|
|
12
13
|
import { authFlow, usableCredential } from "./auth.js";
|
|
13
14
|
import { writer } from "../writer.js";
|
package/dist/commands/skills.js
CHANGED
|
@@ -5,7 +5,9 @@ import { noPassthrough } from "../utils/flags.js";
|
|
|
5
5
|
import { getAgentDisplayName } from "../mcp/agents.js";
|
|
6
6
|
import "../init/agents.js";
|
|
7
7
|
import { canPickAgentsInteractively } from "../utils/agent_picker.js";
|
|
8
|
-
import {
|
|
8
|
+
import { helpCsv, helpEpilogue } from "../utils/help_text.js";
|
|
9
|
+
import { skillsHelpValues, skillsYesHelp } from "../skills/catalog.js";
|
|
10
|
+
import { mappedSkillsAgentNames, skillsInstallableAgents } from "../skills/targets.js";
|
|
9
11
|
import { confirmSkillsInstall, confirmSkillsUpdate } from "../skills/wizard.js";
|
|
10
12
|
import { assertSkillsCanRun, resolveSkillsPlan } from "../skills/plan.js";
|
|
11
13
|
import { assertSkillsNode, neonSkillsRetryCommand, neonSkillsUpdateRetryCommand, runSkillsCli, skillsAddArgs, skillsMetadata, skillsUpdateArgs, skillsUpdateDetail, skillsUpdateHadNothing } from "../skills/run.js";
|
|
@@ -64,17 +66,17 @@ const builder = (argv) => argv.usage("$0 skills [command] [options]").command("u
|
|
|
64
66
|
alias: "a",
|
|
65
67
|
type: "array",
|
|
66
68
|
string: true,
|
|
67
|
-
describe: "Coding agent to install into (repeatable). Skips the agent picker",
|
|
69
|
+
describe: "Coding agent to install into (repeatable). Skips the agent picker. Values listed below",
|
|
68
70
|
coerce: coerceAgents
|
|
69
71
|
},
|
|
70
72
|
skill: {
|
|
71
73
|
alias: "s",
|
|
72
74
|
type: "array",
|
|
73
75
|
string: true,
|
|
74
|
-
describe: "Skill to install (repeatable). Skips the skill picker",
|
|
76
|
+
describe: "Skill to install (repeatable). Skips the skill picker. Values listed below",
|
|
75
77
|
coerce: coerceSkills
|
|
76
78
|
}
|
|
77
|
-
}).example("$0 skills", "Interactive: this directory, agents, skills, then confirm").example("$0 skills -y", "This directory, detected agents, the default skills").example("$0 skills -s neon -s neon-ai-gateway --agent cursor", "Install named skills into specific agents").example("$0 skills --global", "Install user-level skills").strict().check(noPassthrough("skills"));
|
|
79
|
+
}).example("$0 skills", "Interactive: this directory, agents, skills, then confirm").example("$0 skills -y", "This directory, detected agents, the default skills").example("$0 skills -s neon -s neon-ai-gateway --agent cursor", "Install named skills into specific agents").example("$0 skills --global", "Install user-level skills").epilogue(helpEpilogue(helpCsv("Supported agents", skillsInstallableAgents()), "Supported skills, by source repo:", skillsHelpValues(), skillsYesHelp())).strict().check(noPassthrough("skills"));
|
|
78
80
|
const handler = async (props) => {
|
|
79
81
|
assertSkillsNode();
|
|
80
82
|
const cwd = process.cwd();
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/config_services.ts
|
|
2
|
+
const isToggleEnabled = (toggle) => {
|
|
3
|
+
if (toggle === void 0) return false;
|
|
4
|
+
if (typeof toggle === "boolean") return toggle;
|
|
5
|
+
return toggle.enabled !== false;
|
|
6
|
+
};
|
|
7
|
+
/** Postgres is omitted because every project includes it. */
|
|
8
|
+
const declaredNeonServices = (config) => {
|
|
9
|
+
const services = [];
|
|
10
|
+
if (isToggleEnabled(config.auth)) services.push("auth");
|
|
11
|
+
if (isToggleEnabled(config.dataApi)) services.push("data-api");
|
|
12
|
+
if (Object.keys(config.preview?.buckets ?? {}).length > 0) services.push("object-storage");
|
|
13
|
+
if (Object.keys(config.preview?.functions ?? {}).length > 0) services.push("functions");
|
|
14
|
+
if (isToggleEnabled(config.preview?.aiGateway)) services.push("ai-gateway");
|
|
15
|
+
return services;
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
export { declaredNeonServices };
|
package/dist/context.js
CHANGED
|
@@ -45,6 +45,7 @@ const isConfigInit = (args) => args._[0] === "config" && args._[1] === "init" &&
|
|
|
45
45
|
* access has already lapsed is the main reason to remove one.
|
|
46
46
|
*/
|
|
47
47
|
const isProfileCommand = (args) => args._[0] === "profile" || args._[0] === "profiles";
|
|
48
|
+
const isClaimCommand = (args) => args._[0] === "claim" || args._[0] === "claimable";
|
|
48
49
|
/**
|
|
49
50
|
* `neon api-keys …`, under either spelling. Exempts the group from context enrichment: how
|
|
50
51
|
* far a credential reaches must come from an explicit flag, never from `.neon`.
|
|
@@ -133,6 +134,7 @@ const enrichFromContext = (args) => {
|
|
|
133
134
|
if (isProfileCommand(args)) return;
|
|
134
135
|
if (isMcpCommand(args)) return;
|
|
135
136
|
if (isSkillsCommand(args) || isPluginsCommand(args)) return;
|
|
137
|
+
if (isClaimCommand(args)) return;
|
|
136
138
|
const context = readContextFile(args.contextFile);
|
|
137
139
|
if (!args.orgId) args.orgId = context.orgId;
|
|
138
140
|
if (!args.projectId) args.projectId = context.projectId;
|
|
@@ -238,4 +240,4 @@ const globToRegExp = (pattern) => {
|
|
|
238
240
|
return new RegExp(`^${source}$`);
|
|
239
241
|
};
|
|
240
242
|
//#endregion
|
|
241
|
-
export { applyContext, contextBranch, currentContextFile, enrichFromContext, ensureGitignored, isApiKeysCommand, isConfigInit, isCurrentBranchProbe, isMcpCommand, isMcpOauth, isPluginsCommand, isProfileCommand, isSkillsCommand, readContextFile, setContext, updateContextFile, walkContextFile };
|
|
243
|
+
export { applyContext, contextBranch, currentContextFile, enrichFromContext, ensureGitignored, isApiKeysCommand, isClaimCommand, isConfigInit, isCurrentBranchProbe, isMcpCommand, isMcpOauth, isPluginsCommand, isProfileCommand, isSkillsCommand, readContextFile, setContext, updateContextFile, walkContextFile };
|
package/dist/credential_io.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as storeFor } from "./_chunks/credential_io-
|
|
1
|
+
import { t as storeFor } from "./_chunks/credential_io-B1JxWELN.js";
|
|
2
2
|
export { storeFor };
|
package/dist/init/auth.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as
|
|
2
|
-
import { l as
|
|
1
|
+
import { l as interpretCredentials, t as storeFor } from "../_chunks/credential_io-B1JxWELN.js";
|
|
2
|
+
import { l as locationForName } from "../_chunks/profiles-D95AeZ5v.js";
|
|
3
3
|
import { npxNeonArgs, selectedConfigDir, selectedProfileName } from "./profile_cli.js";
|
|
4
4
|
import { log } from "@clack/prompts";
|
|
5
5
|
import { execa } from "execa";
|
package/dist/init/profile_cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as DEFAULT_PROFILE } from "../_chunks/profiles-CVXNvU2r.js";
|
|
2
1
|
import { n as configDir } from "../_chunks/paths-g3DRqJiD.js";
|
|
3
|
-
import {
|
|
2
|
+
import { t as DEFAULT_PROFILE } from "../_chunks/profiles-D95AeZ5v.js";
|
|
3
|
+
import { i as selectCredential, t as credentialInputs } from "../_chunks/auth_selection-ktL6uoEe.js";
|
|
4
4
|
//#region src/init/profile_cli.ts
|
|
5
5
|
/**
|
|
6
6
|
* API-key selections fall back to DEFAULT because init authenticates from stored credentials.
|
package/dist/plugins/run.js
CHANGED
|
@@ -4,6 +4,15 @@ import { execa } from "execa";
|
|
|
4
4
|
const TELEMETRY_BLOCKERS = ["DISABLE_TELEMETRY", "DO_NOT_TRACK"];
|
|
5
5
|
const PLUGIN_SOURCE = "neondatabase/agent-skills";
|
|
6
6
|
const NEON_PLUGIN_NAME = "neon-postgres";
|
|
7
|
+
const PLUGIN_SKILLS = [
|
|
8
|
+
"neon",
|
|
9
|
+
"neon-ai-gateway",
|
|
10
|
+
"neon-functions",
|
|
11
|
+
"neon-object-storage",
|
|
12
|
+
"neon-postgres",
|
|
13
|
+
"neon-postgres-branches",
|
|
14
|
+
"neon-postgres-egress-optimizer"
|
|
15
|
+
];
|
|
7
16
|
const PLUGINS_CLI_TIMEOUT_MS = 12e4;
|
|
8
17
|
const pluginsChildEnv = (base = process.env) => {
|
|
9
18
|
const env = { ...base };
|
|
@@ -120,4 +129,4 @@ const killProcessTree = (pid) => {
|
|
|
120
129
|
const isCommandMissing = (error) => typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT";
|
|
121
130
|
const isExecaFailure = (error) => typeof error === "object" && error !== null && "shortMessage" in error && typeof error.shortMessage === "string";
|
|
122
131
|
//#endregion
|
|
123
|
-
export { NEON_PLUGIN_NAME, PLUGINS_CLI_TIMEOUT_MS, PLUGIN_SOURCE, neonPluginsRetryCommand, pluginsAddArgs, pluginsChildEnv, pluginsCliFailureMessage, pluginsScopeFlag, quoteNpxArg, runPluginsCli };
|
|
132
|
+
export { NEON_PLUGIN_NAME, PLUGINS_CLI_TIMEOUT_MS, PLUGIN_SKILLS, PLUGIN_SOURCE, neonPluginsRetryCommand, pluginsAddArgs, pluginsChildEnv, pluginsCliFailureMessage, pluginsScopeFlag, quoteNpxArg, runPluginsCli };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as OAUTH, d as scopeOf, i as API_KEY, l as interpretCredentials, t as storeFor, u as isSameCredential } from "./_chunks/credential_io-
|
|
1
|
+
import { a as OAUTH, d as scopeOf, i as API_KEY, l as interpretCredentials, t as storeFor, u as isSameCredential } from "./_chunks/credential_io-B1JxWELN.js";
|
|
2
2
|
import { log } from "./log.js";
|
|
3
3
|
import { getApiClient } from "./api.js";
|
|
4
4
|
import { revokeToken } from "./auth.js";
|
package/dist/skills/catalog.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { helpCsv } from "../utils/help_text.js";
|
|
1
2
|
//#region src/skills/catalog.ts
|
|
2
3
|
const AGENT_SKILLS_SOURCE = "neondatabase/agent-skills";
|
|
3
4
|
const PLATFORMS_SKILLS_SOURCE = "neondatabase/neon-for-agent-platforms";
|
|
@@ -97,5 +98,11 @@ const invocationsForSelection = (selected) => {
|
|
|
97
98
|
});
|
|
98
99
|
};
|
|
99
100
|
const yesInstallInvocations = () => invocationsForSelection(defaultSkillEntries());
|
|
101
|
+
const skillsHelpValues = () => invocationsForSelection(NEON_SKILL_CATALOG).map((group) => helpCsv(` ${group.source}`, group.skills)).join("\n");
|
|
102
|
+
const skillsYesHelp = () => {
|
|
103
|
+
const omitted = NEON_SKILL_CATALOG.filter((entry) => !entry.defaultSelected).map((entry) => entry.skill);
|
|
104
|
+
if (omitted.length === 0) return "neon skills -y installs every listed skill";
|
|
105
|
+
return `neon skills -y installs every listed skill except ${omitted.join(", ")}`;
|
|
106
|
+
};
|
|
100
107
|
//#endregion
|
|
101
|
-
export { AGENT_SKILLS_SOURCE, NEON_SKILL_CATALOG, PLATFORMS_SKILLS_SOURCE, defaultSkillEntries, invocationsForSelection, listSkillIds, resolveSkillId, uniqueSkillEntries, yesInstallInvocations };
|
|
108
|
+
export { AGENT_SKILLS_SOURCE, NEON_SKILL_CATALOG, PLATFORMS_SKILLS_SOURCE, defaultSkillEntries, invocationsForSelection, listSkillIds, resolveSkillId, skillsHelpValues, skillsYesHelp, uniqueSkillEntries, yesInstallInvocations };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//#region src/utils/help_text.ts
|
|
2
|
+
const HELP_WRAP = 78;
|
|
3
|
+
const WRAP_INDENT = " ";
|
|
4
|
+
const helpWidth = () => {
|
|
5
|
+
const columns = process.stderr.columns ?? process.stdout.columns;
|
|
6
|
+
if (typeof columns !== "number" || !Number.isFinite(columns) || columns < 1) return 78;
|
|
7
|
+
return Math.max(24, columns - 1);
|
|
8
|
+
};
|
|
9
|
+
const helpCsv = (label, items, width = helpWidth()) => {
|
|
10
|
+
if (items.length === 0) return "";
|
|
11
|
+
const prefix = `${label}:`;
|
|
12
|
+
const lines = [];
|
|
13
|
+
let line = prefix;
|
|
14
|
+
for (const item of items) {
|
|
15
|
+
const addition = line === prefix ? ` ${item}` : `, ${item}`;
|
|
16
|
+
if (line.length + addition.length <= width) {
|
|
17
|
+
line += addition;
|
|
18
|
+
continue;
|
|
19
|
+
}
|
|
20
|
+
if (line === prefix) lines.push(prefix);
|
|
21
|
+
else lines.push(`${line},`);
|
|
22
|
+
line = `${WRAP_INDENT}${item}`;
|
|
23
|
+
}
|
|
24
|
+
lines.push(line);
|
|
25
|
+
return lines.join("\n");
|
|
26
|
+
};
|
|
27
|
+
const helpEpilogue = (...blocks) => ["", ...blocks.filter((block) => block !== "")].join("\n");
|
|
28
|
+
//#endregion
|
|
29
|
+
export { HELP_WRAP, helpCsv, helpEpilogue, helpWidth };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as recordCredentialInputs } from "../_chunks/auth_selection-
|
|
1
|
+
import { r as recordCredentialInputs } from "../_chunks/auth_selection-ktL6uoEe.js";
|
|
2
2
|
//#region src/utils/middlewares.ts
|
|
3
3
|
/**
|
|
4
4
|
* Forwarding Yargs's default would turn ambient configuration into an explicit child override.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "neon",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.5.2",
|
|
4
4
|
"description": "CLI tool for Neon, the cloud backend primitives built around Lakebase Postgres",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"neon",
|
|
@@ -63,9 +63,9 @@
|
|
|
63
63
|
"yaml": "^2.9.0",
|
|
64
64
|
"yargs": "17.7.2",
|
|
65
65
|
"yoctocolors": "^2.1.2",
|
|
66
|
-
"@neon/config
|
|
67
|
-
"@neon/
|
|
68
|
-
"@neon/
|
|
66
|
+
"@neon/config": "1.0.4",
|
|
67
|
+
"@neon/config-runtime": "1.0.4",
|
|
68
|
+
"@neon/sdk": "2.3.0"
|
|
69
69
|
},
|
|
70
70
|
"optionalDependencies": {
|
|
71
71
|
"@napi-rs/keyring": "1.3.0",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"typescript": "^5.9.0",
|
|
98
98
|
"vitest": "^3.0.9",
|
|
99
99
|
"@neon-internals/cli-core": "0.0.0",
|
|
100
|
-
"@neon-internals/env-core": "0.0.
|
|
100
|
+
"@neon-internals/env-core": "0.0.4",
|
|
101
101
|
"@neon/e2e-harness": "0.0.0"
|
|
102
102
|
},
|
|
103
103
|
"publishConfig": {
|