neon 8.15.0 → 8.16.0
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 +9 -5
- package/dist/_chunks/{checkout-BpOcFaAi.js → checkout-CNBIS3gA.js} +3 -3
- package/dist/_chunks/{claim-DlLZmcq0.js → claim-m5sIJdm5.js} +1 -1
- package/dist/_chunks/{config-BjCm5cfr.js → config-CgtJH8xE.js} +1 -1
- package/dist/_chunks/{databases-DC2h6IW2.js → databases-B2Yapqme.js} +9 -4
- package/dist/_chunks/{deploy-DmEEhux0.js → deploy-Bs5gmi4Q.js} +1 -1
- package/dist/_chunks/{dev-DlUJFzRs.js → dev-DxiIp4c9.js} +3 -3
- package/dist/_chunks/{docs-CClmgj_Z.js → docs-BpLiSTmm.js} +1 -1
- package/dist/_chunks/{functions-3ypiRwZK.js → functions-PHaU-kRb.js} +1 -1
- package/dist/_chunks/{git-j6xSVo3e.js → git-DRUZBCmZ.js} +2 -2
- package/dist/_chunks/{link-nAiuWKfg.js → link-CNO-HxHN.js} +2 -2
- package/dist/_chunks/{mcp-BznTRK3w.js → mcp-SvqWzHnT.js} +6 -4
- package/dist/_chunks/{plugins-CKOcBuuP.js → plugins-7cxVcgay.js} +5 -5
- package/dist/_chunks/{roles-xRuu0462.js → roles-BVc69rjG.js} +9 -4
- package/dist/_chunks/{status-BC4XXuuE.js → status-BlrzeKyA.js} +1 -1
- package/dist/analytics.js +4 -2
- package/dist/commands/bootstrap.js +1 -1
- package/dist/commands/checkout.js +1 -1
- package/dist/commands/claim.js +1 -1
- package/dist/commands/config.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/deploy.js +1 -1
- package/dist/commands/dev.js +1 -1
- package/dist/commands/docs.js +1 -1
- package/dist/commands/env.js +1 -1
- package/dist/commands/functions.js +1 -1
- package/dist/commands/functions_new.js +3 -4
- package/dist/commands/git.js +1 -1
- package/dist/commands/index.js +17 -17
- package/dist/commands/link.js +1 -1
- package/dist/commands/mcp.js +1 -1
- package/dist/commands/plugins.js +1 -1
- package/dist/commands/roles.js +1 -1
- package/dist/commands/skills.js +1 -1
- package/dist/commands/status.js +1 -1
- package/dist/commands/subscribe.js +1 -1
- package/dist/env.js +19 -4
- package/dist/index.js +1 -1
- package/dist/init/agents.js +11 -3
- package/dist/init/auth.js +2 -2
- package/dist/init/copy.js +3 -2
- package/dist/init/detect.js +1 -2
- package/dist/init/link.js +1 -1
- package/dist/init/plan.js +2 -63
- package/dist/init/run.js +29 -20
- package/dist/init/tooling.js +5 -5
- package/dist/init/unknown_agent_arg.js +63 -0
- package/dist/init/wizard.js +6 -6
- package/dist/mcp/agents.js +25 -5
- package/dist/mcp/install.js +95 -30
- package/dist/mcp/targets.js +2 -3
- package/dist/plugins/child_env.js +10 -0
- package/dist/plugins/plan.js +14 -14
- package/dist/plugins/run.js +2 -8
- package/dist/plugins/targets.js +134 -15
- package/dist/skills/targets.js +1 -2
- package/dist/update_notifier.js +8 -5
- package/dist/utils/ai_gateway_notice.js +1 -1
- package/package.json +6 -5
- package/dist/_chunks/{bootstrap-BDkvsAVJ.js → bootstrap-vAtWRZXa.js} +2 -2
- package/dist/_chunks/{env-BOt9AZ1j.js → env-BtG4vH55.js} +1 -1
- package/dist/_chunks/{skills-DKgafm65.js → skills-Bv8oKKwE.js} +3 -3
package/dist/plugins/plan.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { getAgentDisplayName, tryResolveAddMcpAgentId } from "../mcp/agents.js";
|
|
2
2
|
import "../init/agents.js";
|
|
3
|
-
import { detectPluginsAgents, getPluginsTargetName, isUserScopeOnlyPluginsTarget, mappedPluginsTargets, missingPluginsCommands, pluginsInstallableAgents } from "./targets.js";
|
|
3
|
+
import { detectPluginsAgents, getPluginsTargetName, isUserScopeOnlyPluginsTarget, mappedPluginsTargets, missingPluginsCommands, pluginsCommandFix, pluginsCommandProblemText, pluginsInstallableAgents, unusablePluginsCommands } from "./targets.js";
|
|
4
4
|
import { collectYesAgents, noDetectedAgentsMessage } from "../init/plan.js";
|
|
5
5
|
import { detectAgent } from "../init/detect_host.js";
|
|
6
6
|
import { agentChoicesFrom, pickAgentsInteractively, resolveAgentSelection } from "../utils/agent_picker.js";
|
|
7
7
|
// src/plugins/plan.ts
|
|
8
|
-
const
|
|
8
|
+
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"));
|
|
9
9
|
const assertPluginsCanRun = (options) => {
|
|
10
10
|
if (options.yes || options.interactive || options.hasAgents) return;
|
|
11
11
|
throw new Error("No interactive terminal. Pass -y to install into detected agents, or --agent <name> to name them.");
|
|
@@ -34,18 +34,18 @@ async function resolvePluginsPlan(options) {
|
|
|
34
34
|
detectAgent: options.detectAgent ?? detectAgent,
|
|
35
35
|
acceptHost: (id) => availableSet.has(id) || getPluginsTargetName(id) !== void 0
|
|
36
36
|
}) : scoped;
|
|
37
|
-
const
|
|
37
|
+
const unusableDetected = new Map((prompt && options.agents.length === 0 ? missingPluginsCommands(detected, commandLookup(options)) : []).map((row) => [row.agent, row]));
|
|
38
38
|
const choices = agentChoicesFrom(available, detected).map((choice) => {
|
|
39
|
-
const
|
|
40
|
-
return
|
|
39
|
+
const row = unusableDetected.get(choice.id);
|
|
40
|
+
return row === void 0 ? choice : {
|
|
41
41
|
...choice,
|
|
42
|
-
description: `detected, but "${command}"
|
|
42
|
+
description: `detected, but "${row.command.name}" ${pluginsCommandProblemText(row)}`
|
|
43
43
|
};
|
|
44
44
|
});
|
|
45
45
|
const selected = await resolveAgentSelection({
|
|
46
46
|
specified: options.agents,
|
|
47
47
|
choices,
|
|
48
|
-
detected: detected.filter((id) => !
|
|
48
|
+
detected: detected.filter((id) => !unusableDetected.has(id)),
|
|
49
49
|
message: "Which coding agents should get the Neon plugin? (space to toggle, enter to confirm)",
|
|
50
50
|
nonInteractiveMessage: noDetectedAgentsMessage({
|
|
51
51
|
scope,
|
|
@@ -77,17 +77,17 @@ async function resolvePluginsPlan(options) {
|
|
|
77
77
|
}
|
|
78
78
|
agents.push(id);
|
|
79
79
|
}
|
|
80
|
-
const
|
|
81
|
-
if (
|
|
82
|
-
if (!(options.agents.length === 0 && !prompt)) throw
|
|
83
|
-
const missingAgents = new Set(
|
|
80
|
+
const unusableCommands = unusablePluginsCommands(agents, commandLookup(options));
|
|
81
|
+
if (unusableCommands.length > 0) {
|
|
82
|
+
if (!(options.agents.length === 0 && !prompt)) throw unusablePluginsCommandsError(unusableCommands);
|
|
83
|
+
const missingAgents = new Set(unusableCommands.map((row) => row.agent));
|
|
84
84
|
const installable = agents.filter((id) => !missingAgents.has(id));
|
|
85
85
|
return {
|
|
86
86
|
scope,
|
|
87
87
|
agents: installable,
|
|
88
88
|
skipped,
|
|
89
89
|
userScopeSkipped,
|
|
90
|
-
|
|
90
|
+
unusableCommands,
|
|
91
91
|
targets: installable.length === 0 ? [] : mappedPluginsTargets(installable, scope)
|
|
92
92
|
};
|
|
93
93
|
}
|
|
@@ -103,8 +103,8 @@ async function resolvePluginsPlan(options) {
|
|
|
103
103
|
agents,
|
|
104
104
|
skipped,
|
|
105
105
|
userScopeSkipped,
|
|
106
|
-
|
|
106
|
+
unusableCommands,
|
|
107
107
|
targets: mappedPluginsTargets(agents, scope)
|
|
108
108
|
};
|
|
109
109
|
}
|
|
110
|
-
export { assertPluginsCanRun,
|
|
110
|
+
export { assertPluginsCanRun, resolvePluginsPlan, unusablePluginsCommandsError };
|
package/dist/plugins/run.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { pluginsChildEnv } from "./child_env.js";
|
|
1
2
|
import { spawnSync } from "node:child_process";
|
|
2
3
|
import { execa } from "execa";
|
|
3
4
|
// src/plugins/run.ts
|
|
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
7
|
const PLUGIN_SKILLS = [
|
|
@@ -16,12 +16,6 @@ const PLUGIN_SKILLS = [
|
|
|
16
16
|
"neon-realtime"
|
|
17
17
|
];
|
|
18
18
|
const PLUGINS_CLI_TIMEOUT_MS = 12e4;
|
|
19
|
-
const pluginsChildEnv = (base = process.env) => {
|
|
20
|
-
const env = { ...base };
|
|
21
|
-
for (const key of TELEMETRY_BLOCKERS) delete env[key];
|
|
22
|
-
for (const key of Object.keys(env)) if (key.toUpperCase() === "NEON_API_KEY") delete env[key];
|
|
23
|
-
return env;
|
|
24
|
-
};
|
|
25
19
|
const pluginsScopeFlag = (global) => global ? "user" : "project";
|
|
26
20
|
const pluginsAddArgs = (options) => {
|
|
27
21
|
if (options.target.length === 0) throw new Error("plugins add needs a -t target.");
|
|
@@ -130,4 +124,4 @@ const killProcessTree = (pid) => {
|
|
|
130
124
|
};
|
|
131
125
|
const isCommandMissing = (error) => typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT";
|
|
132
126
|
const isExecaFailure = (error) => typeof error === "object" && error !== null && "shortMessage" in error && typeof error.shortMessage === "string";
|
|
133
|
-
export { NEON_PLUGIN_NAME, PLUGINS_CLI_TIMEOUT_MS, PLUGIN_SKILLS, PLUGIN_SOURCE, neonPluginsRetryCommand, pluginsAddArgs,
|
|
127
|
+
export { NEON_PLUGIN_NAME, PLUGINS_CLI_TIMEOUT_MS, PLUGIN_SKILLS, PLUGIN_SOURCE, neonPluginsRetryCommand, pluginsAddArgs, pluginsCliFailureMessage, pluginsScopeFlag, quoteNpxArg, runPluginsCli };
|
package/dist/plugins/targets.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { detectInstalledAgents, listMcpAgentIds, tryResolveAddMcpAgentId, uniqueAgentIds } from "../mcp/agents.js";
|
|
1
|
+
import { detectInstalledAgents, detectProjectAgents, listMcpAgentIds, tryResolveAddMcpAgentId, uniqueAgentIds } from "../mcp/agents.js";
|
|
2
2
|
import "../init/agents.js";
|
|
3
|
+
import { pluginsChildEnv } from "./child_env.js";
|
|
3
4
|
import { delimiter, dirname, join, resolve } from "node:path";
|
|
4
|
-
import {
|
|
5
|
+
import { spawnSync } from "node:child_process";
|
|
5
6
|
import which from "which";
|
|
6
7
|
// src/plugins/targets.ts
|
|
7
8
|
const CLAUDE_CODE = { target: "claude-code" };
|
|
@@ -13,18 +14,29 @@ const PLUGINS_TARGET_BY_TYPE = {
|
|
|
13
14
|
codex: { target: "codex" },
|
|
14
15
|
"github-copilot-cli": {
|
|
15
16
|
target: "github-copilot",
|
|
16
|
-
command:
|
|
17
|
+
command: {
|
|
18
|
+
name: "copilot",
|
|
19
|
+
product: "GitHub Copilot CLI",
|
|
20
|
+
versionPrefix: "GitHub Copilot CLI",
|
|
21
|
+
minVersion: "0.0.400"
|
|
22
|
+
}
|
|
17
23
|
},
|
|
18
24
|
"grok-build": {
|
|
19
25
|
target: "grok",
|
|
20
|
-
command:
|
|
21
|
-
|
|
26
|
+
command: {
|
|
27
|
+
name: "grok",
|
|
28
|
+
product: "Grok Build",
|
|
29
|
+
versionPrefix: "grok"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"kimi-code": { target: "kimi" }
|
|
22
33
|
};
|
|
23
34
|
const pluginsTargets = () => [...new Set(Object.values(PLUGINS_TARGET_BY_TYPE))];
|
|
24
35
|
const USER_SCOPE_ONLY_TARGETS = /* @__PURE__ */ new Set([
|
|
25
36
|
"vscode",
|
|
26
37
|
"github-copilot",
|
|
27
|
-
"grok"
|
|
38
|
+
"grok",
|
|
39
|
+
"kimi"
|
|
28
40
|
]);
|
|
29
41
|
/** npx runs the plugins CLI with every `node_modules/.bin` from `cwd` up to the root ahead of PATH. */
|
|
30
42
|
const pluginsCommandSearchPath = (cwd, path) => {
|
|
@@ -38,20 +50,127 @@ const pluginsCommandSearchPath = (cwd, path) => {
|
|
|
38
50
|
}
|
|
39
51
|
return [...bins, path].join(delimiter);
|
|
40
52
|
};
|
|
41
|
-
const
|
|
53
|
+
const VERSION_TIMEOUT_MS = 1e4;
|
|
54
|
+
const versionParts = (version) => version.split(".").map((part) => Number.parseInt(part, 10));
|
|
55
|
+
/** Exported for tests. */
|
|
56
|
+
const versionAtLeast = (version, minimum) => {
|
|
57
|
+
const have = versionParts(version);
|
|
58
|
+
const need = versionParts(minimum);
|
|
59
|
+
for (let i = 0; i < 3; i++) {
|
|
60
|
+
const a = have[i] ?? 0;
|
|
61
|
+
const b = need[i] ?? 0;
|
|
62
|
+
if (a !== b) return a > b;
|
|
63
|
+
}
|
|
64
|
+
return true;
|
|
65
|
+
};
|
|
66
|
+
/** Exported for tests. */
|
|
67
|
+
const pluginsCommandVersionProblem = (command, output) => {
|
|
68
|
+
const label = `${command.versionPrefix} `;
|
|
69
|
+
const at = output.indexOf(label);
|
|
70
|
+
const version = at === -1 ? void 0 : output.slice(at + label.length).match(/^\d+\.\d+\.\d+/)?.[0];
|
|
71
|
+
if (version === void 0) return { kind: "unrecognized" };
|
|
72
|
+
if (command.minVersion !== void 0 && !versionAtLeast(version, command.minVersion)) return {
|
|
73
|
+
kind: "outdated",
|
|
74
|
+
version
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
const firstLine = (text) => text.split("\n").map((line) => line.trim()).find((line) => line.length > 0) ?? "";
|
|
78
|
+
/** The child sees the same PATH the command was resolved on, as under npx. */
|
|
79
|
+
const withPath = (env, path) => {
|
|
80
|
+
const key = Object.keys(env).find((name) => name.toUpperCase() === "PATH");
|
|
81
|
+
return {
|
|
82
|
+
...env,
|
|
83
|
+
[key ?? "PATH"]: path
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Runs `<command> --version` the way the plugins CLI spawns the command (no shell, the npx
|
|
88
|
+
* search PATH, its child env), so a command it could not run is caught before it runs.
|
|
89
|
+
*/
|
|
90
|
+
const probePluginsCommand = (command, options) => {
|
|
91
|
+
const resolved = which.sync(command.name, {
|
|
92
|
+
nothrow: true,
|
|
93
|
+
path: options.searchPath
|
|
94
|
+
});
|
|
95
|
+
if (resolved === null) return { kind: "missing" };
|
|
96
|
+
const result = spawnSync(resolved, ["--version"], {
|
|
97
|
+
cwd: options.cwd,
|
|
98
|
+
env: withPath(pluginsChildEnv(), options.searchPath),
|
|
99
|
+
encoding: "utf8",
|
|
100
|
+
stdio: [
|
|
101
|
+
"ignore",
|
|
102
|
+
"pipe",
|
|
103
|
+
"pipe"
|
|
104
|
+
],
|
|
105
|
+
timeout: VERSION_TIMEOUT_MS,
|
|
106
|
+
windowsHide: true
|
|
107
|
+
});
|
|
108
|
+
if (result.error !== void 0) {
|
|
109
|
+
const code = "code" in result.error && typeof result.error.code === "string" ? result.error.code : void 0;
|
|
110
|
+
return {
|
|
111
|
+
kind: "broken",
|
|
112
|
+
detail: code === "ETIMEDOUT" ? `timed out after ${VERSION_TIMEOUT_MS / 1e3} seconds` : code ?? result.error.message
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
const output = `${result.stdout}\n${result.stderr}`;
|
|
116
|
+
if (result.status !== 0) {
|
|
117
|
+
const line = firstLine(result.stderr) || firstLine(result.stdout);
|
|
118
|
+
return {
|
|
119
|
+
kind: "broken",
|
|
120
|
+
detail: line.length > 0 ? line.slice(0, 160).replace(/\.$/, "") : result.signal !== null ? `killed by ${result.signal}` : `exit code ${result.status}`
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
return pluginsCommandVersionProblem(command, output);
|
|
124
|
+
};
|
|
125
|
+
const commandRows = (agents, options, check) => {
|
|
42
126
|
const searchPath = pluginsCommandSearchPath(options.cwd, options.path ?? process.env.PATH ?? "");
|
|
43
|
-
const
|
|
127
|
+
const rows = [];
|
|
44
128
|
for (const agent of uniqueAgentIds(agents)) {
|
|
45
129
|
const command = getPluginsTarget(agent)?.command;
|
|
46
|
-
if (command
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}) === null) missing.push({
|
|
130
|
+
if (command === void 0) continue;
|
|
131
|
+
const problem = check(command, searchPath);
|
|
132
|
+
if (problem !== void 0) rows.push({
|
|
50
133
|
agent,
|
|
51
|
-
command
|
|
134
|
+
command,
|
|
135
|
+
problem
|
|
52
136
|
});
|
|
53
137
|
}
|
|
54
|
-
return
|
|
138
|
+
return rows;
|
|
139
|
+
};
|
|
140
|
+
/**
|
|
141
|
+
* Agents whose plugin command is not on the search PATH. Runs nothing, so it is safe for
|
|
142
|
+
* agents that were only detected and may not be installed.
|
|
143
|
+
*/
|
|
144
|
+
const missingPluginsCommands = (agents, options) => commandRows(agents, options, (command, searchPath) => which.sync(command.name, {
|
|
145
|
+
nothrow: true,
|
|
146
|
+
path: searchPath
|
|
147
|
+
}) === null ? { kind: "missing" } : void 0);
|
|
148
|
+
/**
|
|
149
|
+
* Agents whose plugin installs through a CLI that is missing, does not run, is not the
|
|
150
|
+
* expected product, or is too old. Runs `<command> --version`, so pass only agents the
|
|
151
|
+
* plugin is about to install into; file-based targets never spawn anything.
|
|
152
|
+
*/
|
|
153
|
+
const unusablePluginsCommands = (agents, options) => commandRows(agents, options, (command, searchPath) => probePluginsCommand(command, {
|
|
154
|
+
cwd: options.cwd,
|
|
155
|
+
searchPath
|
|
156
|
+
}));
|
|
157
|
+
/** Completes `"<command>" …` in a warning or error. */
|
|
158
|
+
const pluginsCommandProblemText = (row) => {
|
|
159
|
+
const { command, problem } = row;
|
|
160
|
+
const product = command.product;
|
|
161
|
+
switch (problem.kind) {
|
|
162
|
+
case "missing": return "was not found on PATH";
|
|
163
|
+
case "broken": return `did not run ("${command.name} --version" failed: ${problem.detail})`;
|
|
164
|
+
case "unrecognized": return `is not ${product} ("${command.name} --version" printed no ${product} version)`;
|
|
165
|
+
case "outdated": return `is ${product} ${problem.version}, older than the ${command.minVersion} its plugin needs`;
|
|
166
|
+
default: return problem;
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
/** What to do about the problem, as an imperative clause. */
|
|
170
|
+
const pluginsCommandFix = (row) => {
|
|
171
|
+
const { command, problem } = row;
|
|
172
|
+
if (problem.kind === "missing") return "Install it or add it to PATH";
|
|
173
|
+
return `Install or update ${command.product}`;
|
|
55
174
|
};
|
|
56
175
|
function getPluginsTarget(agent) {
|
|
57
176
|
if (Object.prototype.hasOwnProperty.call(PLUGINS_TARGET_BY_TYPE, agent)) return PLUGINS_TARGET_BY_TYPE[agent];
|
|
@@ -104,4 +223,4 @@ const mappedPluginsTargets = (agents, scope) => {
|
|
|
104
223
|
if (mapped.length === 0) throw new Error(`None of the selected agents can install plugins. Supported agents: ${pluginsInstallableAgents(scope).join(", ")}`);
|
|
105
224
|
return mapped;
|
|
106
225
|
};
|
|
107
|
-
export { detectInstallablePluginsAgents, detectPluginsAgents, getPluginsTargetName, isUserScopeOnlyPluginsTarget, mappedPluginsTargets, missingPluginsCommands, pluginsInstallableAgents, pluginsMappedAgents, pluginsTargets, supportsPlugins };
|
|
226
|
+
export { detectInstallablePluginsAgents, detectPluginsAgents, getPluginsTargetName, isUserScopeOnlyPluginsTarget, mappedPluginsTargets, missingPluginsCommands, pluginsCommandFix, pluginsCommandProblemText, pluginsCommandVersionProblem, pluginsInstallableAgents, pluginsMappedAgents, pluginsTargets, supportsPlugins, unusablePluginsCommands, versionAtLeast };
|
package/dist/skills/targets.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { detectInstalledAgents, listMcpAgentIds, uniqueAgentIds } from "../mcp/agents.js";
|
|
1
|
+
import { detectInstalledAgents, detectProjectAgents, listMcpAgentIds, uniqueAgentIds } from "../mcp/agents.js";
|
|
2
2
|
import { getSkillsAgentName, supportsSkills } from "../init/agents.js";
|
|
3
|
-
import { detectProjectAgents } from "add-mcp";
|
|
4
3
|
// src/skills/targets.ts
|
|
5
4
|
const skillsInstallableAgents = () => listMcpAgentIds().filter((id) => supportsSkills(id));
|
|
6
5
|
const detectSkillsAgents = async (options) => {
|
package/dist/update_notifier.js
CHANGED
|
@@ -7,8 +7,8 @@ import { existsSync, readFileSync, realpathSync } from "node:fs";
|
|
|
7
7
|
import { basename, dirname, join } from "node:path";
|
|
8
8
|
import { fileURLToPath } from "node:url";
|
|
9
9
|
import { spawn } from "node:child_process";
|
|
10
|
-
import which from "which";
|
|
11
10
|
import semver from "semver";
|
|
11
|
+
import which from "which";
|
|
12
12
|
// src/update_notifier.ts
|
|
13
13
|
const DAY_MS = 864e5;
|
|
14
14
|
const CHECK_INTERVAL_MS = DAY_MS;
|
|
@@ -141,10 +141,11 @@ const duplicateInstallNotice = () => {
|
|
|
141
141
|
}
|
|
142
142
|
};
|
|
143
143
|
const isPackagedExecutable = () => "pkg" in process;
|
|
144
|
-
const
|
|
144
|
+
const commandSucceeded = () => (process.exitCode ?? 0) === 0;
|
|
145
|
+
const shouldRunUpdateNotifier = ({ commandPath, currentBranch, disabled, isCi: runningInCi, isPackaged, output, stderrIsTty, stdoutIsTty, succeeded }) => !runningInCi && !disabled && !isPackaged && output === "table" && stdoutIsTty && stderrIsTty && commandPath.length > 0 && commandPath[0] !== "completion" && !isCurrentBranchProbe({
|
|
145
146
|
commandPath,
|
|
146
147
|
currentBranch
|
|
147
|
-
});
|
|
148
|
+
}) && succeeded;
|
|
148
149
|
/**
|
|
149
150
|
* The skills notice drops the terminal checks: coding agents run the CLI without a TTY,
|
|
150
151
|
* and they are the ones that act on it. `neon skills` itself reports skill state.
|
|
@@ -157,7 +158,8 @@ const shouldRunSkillsNotifier = ({ commandPath, currentBranch, output }) => comm
|
|
|
157
158
|
isPackaged: isPackagedExecutable(),
|
|
158
159
|
output,
|
|
159
160
|
stderrIsTty: true,
|
|
160
|
-
stdoutIsTty: true
|
|
161
|
+
stdoutIsTty: true,
|
|
162
|
+
succeeded: commandSucceeded()
|
|
161
163
|
});
|
|
162
164
|
const notifyIfUpdateAvailable = ({ commandPath, configDir, currentBranch, currentVersion, output }) => {
|
|
163
165
|
if (!shouldRunUpdateNotifier({
|
|
@@ -168,7 +170,8 @@ const notifyIfUpdateAvailable = ({ commandPath, configDir, currentBranch, curren
|
|
|
168
170
|
isPackaged: isPackagedExecutable(),
|
|
169
171
|
output,
|
|
170
172
|
stderrIsTty: process.stderr.isTTY === true,
|
|
171
|
-
stdoutIsTty: process.stdout.isTTY === true
|
|
173
|
+
stdoutIsTty: process.stdout.isTTY === true,
|
|
174
|
+
succeeded: commandSucceeded()
|
|
172
175
|
})) return;
|
|
173
176
|
const now = Date.now();
|
|
174
177
|
if (process.platform !== "win32") {
|
|
@@ -68,7 +68,7 @@ const buildAiGatewayNotice = ({ subscriptionType, modelIds, upgradeUrl, moreMode
|
|
|
68
68
|
};
|
|
69
69
|
if (modelIds !== void 0 && modelIds.length > 0 && !hasFlagshipModels(modelIds)) return {
|
|
70
70
|
level: "warning",
|
|
71
|
-
message: `
|
|
71
|
+
message: `Not every model is enabled for your account yet, so some models are missing from the catalog. Request access to more models here: ${moreModelsUrl}`
|
|
72
72
|
};
|
|
73
73
|
return null;
|
|
74
74
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "neon",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.16.0",
|
|
4
4
|
"description": "CLI tool for Neon, the cloud backend primitives built around Lakebase Postgres",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"neon",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@clack/prompts": "0.10.1",
|
|
47
47
|
"@hono/node-server": "2.0.4",
|
|
48
48
|
"@segment/analytics-node": "1.3.0",
|
|
49
|
-
"add-mcp": "2.
|
|
49
|
+
"add-mcp": "2.6.0",
|
|
50
50
|
"ajv": "^8.20.0",
|
|
51
51
|
"ajv-formats": "^3.0.1",
|
|
52
52
|
"chalk": "5.3.0",
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
"diff": "5.2.0",
|
|
56
56
|
"execa": "^9.5.2",
|
|
57
57
|
"fflate": "^0.8.3",
|
|
58
|
+
"jsonc-parser": "3.3.1",
|
|
58
59
|
"open": "^10.2.0",
|
|
59
60
|
"openid-client": "6.8.1",
|
|
60
61
|
"pg": "^8.20.0",
|
|
@@ -72,9 +73,9 @@
|
|
|
72
73
|
"yaml": "^2.9.0",
|
|
73
74
|
"yargs": "17.7.2",
|
|
74
75
|
"yoctocolors": "^2.1.2",
|
|
75
|
-
"@neon/config": "1.10.0",
|
|
76
76
|
"@neon/config-runtime": "1.11.0",
|
|
77
77
|
"@neon/realtime": "0.1.2",
|
|
78
|
+
"@neon/config": "1.10.0",
|
|
78
79
|
"@neon/sdk": "7.7.0"
|
|
79
80
|
},
|
|
80
81
|
"optionalDependencies": {
|
|
@@ -113,9 +114,9 @@
|
|
|
113
114
|
"vitest": "^3.0.9",
|
|
114
115
|
"@neon-internals/cli-core": "0.0.0",
|
|
115
116
|
"@neon-internals/env-core": "0.0.38",
|
|
117
|
+
"@neon/e2e-harness": "0.0.0",
|
|
116
118
|
"@neon/env": "1.6.8",
|
|
117
|
-
"@neon/functions": "0.11.0"
|
|
118
|
-
"@neon/e2e-harness": "0.0.0"
|
|
119
|
+
"@neon/functions": "0.11.0"
|
|
119
120
|
},
|
|
120
121
|
"publishConfig": {
|
|
121
122
|
"access": "public",
|
|
@@ -4,13 +4,13 @@ import { log } from "../log.js";
|
|
|
4
4
|
import { recordCommandSuccessExtras, recordScaffoldedTemplate } from "../analytics.js";
|
|
5
5
|
import { getCliName } from "../utils/cli_name.js";
|
|
6
6
|
import { helpCsv, helpEpilogue } from "../utils/help_text.js";
|
|
7
|
-
import { coerceAgentFlag } from "../utils/agent_flag.js";
|
|
8
|
-
import { assertNamedAgentTooling, chooseYesAgentTooling, initPluginAgents, initSkillsMcpAgents, postScaffoldActions, projectContextFile, resolveNamedAgents } from "../init/plan.js";
|
|
9
7
|
import { formatInstallCommand, inferPackageManager, installArgs, installedPackageManagers, resolvePackageManager, runCommand } from "../utils/package_manager.js";
|
|
10
8
|
import { writer } from "../writer.js";
|
|
11
9
|
import { FALLBACK_TEMPLATES, ensureTargetUsable, fetchTemplates, findTemplate, scaffoldTemplate, templateIds } from "../init/bootstrap.js";
|
|
12
10
|
import { agentSetupDoneLabel, formatInitDone, printInitBanner, printInitDone, shouldPrintInitBanner } from "../init/chrome.js";
|
|
13
11
|
import { runAuthenticatedLink } from "../init/link.js";
|
|
12
|
+
import { coerceAgentFlag } from "../utils/agent_flag.js";
|
|
13
|
+
import { assertNamedAgentTooling, chooseYesAgentTooling, initPluginAgents, initSkillsMcpAgents, postScaffoldActions, projectContextFile, resolveNamedAgents } from "../init/plan.js";
|
|
14
14
|
import { formatTemplateTitle } from "../init/template_title.js";
|
|
15
15
|
import { pickAgentSetupInteractively, pickInitLinkInteractively } from "../init/wizard.js";
|
|
16
16
|
import { runAgentTooling } from "../init/tooling.js";
|
|
@@ -7,9 +7,9 @@ import { deprecatedServiceMessage, parseServices, servicesFlagValue, servicesOpt
|
|
|
7
7
|
import { mergeEnvFile, readEnvFile, resolveEnvFilePath } from "../env_file.js";
|
|
8
8
|
import { t as NEON_ENV_VAR_KEYS, u as isFunctionBaseUrlKey } from "./env-JgoSsmyt.js";
|
|
9
9
|
import { ENV_PULL_KEY_HELP, ENV_PULL_SERVICES, envKeysForSelection, envPullFlagValue, ownedEnvServiceKeys, parseEnvPullKeys } from "../env_services.js";
|
|
10
|
-
import { i as dropClaimableUnsupported, o as resolveNeonEnvVars } from "./env-CIFMBEon.js";
|
|
11
10
|
import { fillSingleProject, resolveBranchRef } from "../utils/enrichers.js";
|
|
12
11
|
import { warnAiGateway } from "../utils/ai_gateway_notice.js";
|
|
12
|
+
import { i as dropClaimableUnsupported, o as resolveNeonEnvVars } from "./env-CIFMBEon.js";
|
|
13
13
|
import { formatPulledEnv, pulledBranch } from "../commands/env_output.js";
|
|
14
14
|
import { existsSync } from "node:fs";
|
|
15
15
|
import chalk from "chalk";
|
|
@@ -2,12 +2,12 @@ import { t as __exportAll } from "./rolldown-runtime-BJohB4LM.js";
|
|
|
2
2
|
import { log } from "../log.js";
|
|
3
3
|
import { recordCommandSuccessExtras } from "../analytics.js";
|
|
4
4
|
import { helpCsv, helpEpilogue } from "../utils/help_text.js";
|
|
5
|
-
import { getAgentDisplayName } from "../mcp/agents.js";
|
|
6
|
-
import "../init/agents.js";
|
|
7
|
-
import { mappedSkillsAgentNames, skillsInstallableAgents } from "../skills/targets.js";
|
|
8
5
|
import { writer } from "../writer.js";
|
|
9
6
|
import { noPassthrough } from "../utils/flags.js";
|
|
7
|
+
import { getAgentDisplayName } from "../mcp/agents.js";
|
|
8
|
+
import "../init/agents.js";
|
|
10
9
|
import { AGENT_SKILLS_SKIP_MESSAGE } from "../init/copy.js";
|
|
10
|
+
import { mappedSkillsAgentNames, skillsInstallableAgents } from "../skills/targets.js";
|
|
11
11
|
import { canPickAgentsInteractively, skippableAgentPicker } from "../utils/agent_picker.js";
|
|
12
12
|
import { skillsHelpValues, skillsYesHelp } from "../skills/catalog.js";
|
|
13
13
|
import { lockPath, neonSkillsUpdateCommand, readLockedSkills, refreshSkillsCheckCache, scopeLabel, skillsCheckCachePath, skillsStatusRows } from "../skills/freshness.js";
|