neon 8.13.0 → 8.13.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 +3 -1
- package/dist/_chunks/{checkout-BGvlLc43.js → checkout-CXIOydqZ.js} +3 -3
- package/dist/_chunks/{claim-DqzLXZMN.js → claim-DqAvAvDm.js} +1 -1
- package/dist/_chunks/{config-BnwcGpbq.js → config-BH_qRHiG.js} +1 -1
- package/dist/_chunks/{deploy-BCVcDR1O.js → deploy-D7B0Xfjg.js} +1 -1
- package/dist/_chunks/{dev-mrJKMt2R.js → dev-CSvxAecE.js} +3 -3
- package/dist/_chunks/{git-pN4kMH0d.js → git-H32TNt6M.js} +2 -2
- package/dist/_chunks/{link-DOM84hYj.js → link-BgtkOBws.js} +2 -2
- package/dist/_chunks/{plugins-DqD7BDO1.js → plugins-Dj0H6lDA.js} +1 -1
- package/dist/_chunks/{status-DoNjIbKf.js → status-DV8Z2kw3.js} +1 -1
- package/dist/analytics.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/deploy.js +1 -1
- package/dist/commands/dev.js +1 -1
- package/dist/commands/env.js +1 -1
- package/dist/commands/functions_new.js +1 -1
- package/dist/commands/git.js +1 -1
- package/dist/commands/index.js +10 -10
- package/dist/commands/link.js +1 -1
- package/dist/commands/plugins.js +1 -1
- package/dist/commands/status.js +1 -1
- package/dist/commands/subscribe.js +1 -1
- package/dist/init/auth.js +1 -1
- package/dist/init/copy.js +12 -1
- package/dist/init/funnel.js +62 -14
- package/dist/init/link.js +1 -1
- package/dist/init/run.js +150 -95
- package/dist/init/tooling.js +3 -3
- package/dist/skills/freshness.js +61 -11
- package/dist/skills/run.js +4 -2
- package/package.json +2 -2
- package/dist/_chunks/{env-uVRY4xah.js → env-5HS5qQGd.js} +1 -1
package/README.md
CHANGED
|
@@ -891,6 +891,8 @@ Unauthenticated `-y` skips linking and prints the next step: sign up at https://
|
|
|
891
891
|
|
|
892
892
|
When init picks MCP auth (no `--mcp-auth`) and the CLI credential is an organization or project-scoped API key, which cannot mint the MCP server's key, init configures MCP with OAuth instead and continues. With `--mcp-auth api-key`, init skips MCP, finishes linking and `neon.ts`, then reports `Neon setup failed.` with the `neon mcp` commands to retry and exits 1.
|
|
893
893
|
|
|
894
|
+
When the Neon plugin, skills, or MCP setup fails for an agent, init runs the remaining agent steps, links (or writes `.neon` offline), and writes `neon.ts` as it would have, then reports `Neon setup failed.` with the error and the `neon plugins`, `neon skills`, or `neon mcp` command to retry, and exits 1.
|
|
895
|
+
|
|
894
896
|
Custom asks how to add Neon to coding agents (plugin, skills and MCP separately, or skip), then how to get a project (sign in and link, or a claimable project when you are not signed in), then which services `neon.ts` should declare. Skills and MCP use separate agent pickers, and either can be skipped. Postgres is listed first as always included. The package manager is inferred from the directory; Custom asks only when none is detected. `--skill` selects skills (not the plugin) and skips that picker. MCP flags (`--mcp-config-location`, `--mcp-auth`, `--mcp-project-scoped`) select skills and MCP. `--mcp-config-location` is where the config is written: `global` maps to `neon mcp`, and `project` maps to `neon mcp --project`. With `-y`, the location defaults to `global`; interactive Custom asks. If some selected agents cannot write that location, init warns and skips MCP for those agents while continuing with the supported agents. It fails when none of the selected agents support the location. `--mcp-project-scoped` limits MCP tools to the linked Neon project by passing its ID to `neon mcp --project-id`. Omitted is false, including in Custom; there is no prompt. `--no-agent-setup` skips agent setup.
|
|
895
897
|
|
|
896
898
|
Empty directories are set up in place. `neon init` does not scaffold starter files.
|
|
@@ -955,7 +957,7 @@ The default mints an account-wide API key (or reuses the Bearer already configur
|
|
|
955
957
|
|
|
956
958
|
## Install Neon agent skills (`skills`)
|
|
957
959
|
|
|
958
|
-
`neon skills` installs Neon agent skills by running `npx skills add
|
|
960
|
+
`neon skills` installs Neon agent skills by running `npx skills@latest add`, so it always uses the latest skills CLI, even when an older one is installed globally. It does not call the Neon API. This command needs Node.js 22.20 or newer. The rest of the CLI supports Node.js 20.19 or newer.
|
|
959
961
|
|
|
960
962
|
```bash
|
|
961
963
|
# Interactive: this directory, then agents, then skills.
|
|
@@ -11,9 +11,9 @@ import { looksLikeBranchId } from "../utils/formats.js";
|
|
|
11
11
|
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
|
-
import { n as autoPullEnvAfterPin } from "./env-
|
|
15
|
-
import { a as applyPolicyOnCreate, f as envFlag, l as createBranchFromPolicyOnCheckout } from "./config-
|
|
16
|
-
import { i as handler$1 } from "./link-
|
|
14
|
+
import { n as autoPullEnvAfterPin } from "./env-5HS5qQGd.js";
|
|
15
|
+
import { a as applyPolicyOnCreate, f as envFlag, l as createBranchFromPolicyOnCheckout } from "./config-BH_qRHiG.js";
|
|
16
|
+
import { i as handler$1 } from "./link-BgtkOBws.js";
|
|
17
17
|
import chalk from "chalk";
|
|
18
18
|
import prompts from "prompts";
|
|
19
19
|
//#region src/commands/checkout.ts
|
|
@@ -12,7 +12,7 @@ import { projectConfigPath } from "../project.js";
|
|
|
12
12
|
import { resolveEnvFilePath } from "../env_file.js";
|
|
13
13
|
import { writer } from "../writer.js";
|
|
14
14
|
import { noPassthrough } from "../utils/flags.js";
|
|
15
|
-
import { c as pull } from "./env-
|
|
15
|
+
import { c as pull } from "./env-5HS5qQGd.js";
|
|
16
16
|
import { existsSync, readFileSync, unlinkSync, writeFileSync } from "node:fs";
|
|
17
17
|
import open from "open";
|
|
18
18
|
import prompts from "prompts";
|
|
@@ -23,7 +23,7 @@ import { readGitContext } from "../utils/git.js";
|
|
|
23
23
|
import { resolveHookEnv, runDeployAfterHook, runDeployBeforeHook } from "../utils/hooks.js";
|
|
24
24
|
import { pickServicesInteractively } from "../utils/service_picker.js";
|
|
25
25
|
import { zipBundle } from "../utils/zip.js";
|
|
26
|
-
import { n as autoPullEnvAfterPin } from "./env-
|
|
26
|
+
import { n as autoPullEnvAfterPin } from "./env-5HS5qQGd.js";
|
|
27
27
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
28
28
|
import { dirname, join, relative, resolve } from "node:path";
|
|
29
29
|
import chalk from "chalk";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.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-
|
|
3
|
+
import { f as envFlag, i as applyFlags, p as envPullFlag, r as applyCmd } from "./config-BH_qRHiG.js";
|
|
4
4
|
import { DEPLOY_COMMANDS_EPILOGUE } from "../commands/deploy_help.js";
|
|
5
5
|
//#region src/commands/deploy.ts
|
|
6
6
|
var deploy_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -4,12 +4,12 @@ import { isClaimableEnvTarget } from "../claimable/state.js";
|
|
|
4
4
|
import { getCliName } from "../utils/cli_name.js";
|
|
5
5
|
import { defaultDevEnvFiles, readEnvFile, resolveEnvFilePath } from "../env_file.js";
|
|
6
6
|
import { l as functionBaseUrlKey } from "./env-BpP3Dqpe.js";
|
|
7
|
+
import { branchIdResolve } from "../utils/enrichers.js";
|
|
8
|
+
import { bundleEntry } from "../utils/esbuild.js";
|
|
7
9
|
import { a as resolveDevEnv } from "./env-BNm69Qh8.js";
|
|
10
|
+
import { f as envFlag } from "./config-BH_qRHiG.js";
|
|
8
11
|
import { findConfigFunctionBySource, resolveFunctionsFromConfig } from "../dev/functions.js";
|
|
9
12
|
import { resolveWatchInputs } from "../dev/inputs.js";
|
|
10
|
-
import { branchIdResolve } from "../utils/enrichers.js";
|
|
11
|
-
import { bundleEntry } from "../utils/esbuild.js";
|
|
12
|
-
import { f as envFlag } from "./config-BnwcGpbq.js";
|
|
13
13
|
import { existsSync, mkdirSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
14
14
|
import { basename, dirname, join, relative, resolve } from "node:path";
|
|
15
15
|
import { fileURLToPath } from "node:url";
|
|
@@ -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-
|
|
9
|
-
import { o as handler$1 } from "./checkout-
|
|
8
|
+
import { o as quoteFlagValue } from "./link-BgtkOBws.js";
|
|
9
|
+
import { o as handler$1 } from "./checkout-CXIOydqZ.js";
|
|
10
10
|
import { existsSync } from "node:fs";
|
|
11
11
|
import { join } from "node:path";
|
|
12
12
|
import chalk from "chalk";
|
|
@@ -13,8 +13,8 @@ import { writer } from "../writer.js";
|
|
|
13
13
|
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
|
-
import { n as autoPullEnvAfterPin } from "./env-
|
|
17
|
-
import { h as initCmd } from "./config-
|
|
16
|
+
import { n as autoPullEnvAfterPin } from "./env-5HS5qQGd.js";
|
|
17
|
+
import { h as initCmd } from "./config-BH_qRHiG.js";
|
|
18
18
|
import { formatLinkSummary } from "../commands/link_output.js";
|
|
19
19
|
import { r as REGIONS } from "./projects-BwI2Uo0z.js";
|
|
20
20
|
import prompts from "prompts";
|
|
@@ -132,7 +132,7 @@ const pluginsInstallError = (outcome) => {
|
|
|
132
132
|
global: scope === "global"
|
|
133
133
|
});
|
|
134
134
|
if (first.message.includes("needs npx (Node.js)")) return new Error(first.message);
|
|
135
|
-
const detail = failed.map((row) => row.message).join("\n");
|
|
135
|
+
const detail = [...new Set(failed.map((row) => row.message))].join("\n");
|
|
136
136
|
if (failed.length === rows.length) return /* @__PURE__ */ new Error(`${detail}\nRetry with: ${retry}`);
|
|
137
137
|
return /* @__PURE__ */ new Error(`Failed to install the Neon plugin for: ${failed.flatMap((row) => row.agents).join(", ")}.\n${detail}\nRetry with: ${retry}`);
|
|
138
138
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
2
|
import { fillSingleProject } from "../utils/enrichers.js";
|
|
3
|
-
import { y as status } from "./config-
|
|
3
|
+
import { y as status } from "./config-BH_qRHiG.js";
|
|
4
4
|
//#region src/commands/status.ts
|
|
5
5
|
var status_exports = /* @__PURE__ */ __exportAll({
|
|
6
6
|
builder: () => builder,
|
package/dist/analytics.js
CHANGED
|
@@ -356,4 +356,4 @@ const getAnalyticsEventProperties = (args) => ({
|
|
|
356
356
|
githubEnvVars: getGithubEnvVars(process.env)
|
|
357
357
|
});
|
|
358
358
|
//#endregion
|
|
359
|
-
export { analyticsIdentity, analyticsMiddleware, closeAnalytics, commandSuccessProperties, getAnalyticsEventProperties, getErrorAnalyticsEventProperties, initAnalyticsClientMiddleware, isAnalyticsActive, recordCommandSuccessExtras, recordScaffoldedTemplate, sendError, storedCredentialAttribution, takeCommandSuccessExtras, telemetryCredential, trackCommandSuccess, trackEvent, useAnalyticsClientForTests };
|
|
359
|
+
export { analyticsIdentity, analyticsMiddleware, closeAnalytics, commandSuccessProperties, getAnalyticsEventProperties, getErrorAnalyticsEventProperties, initAnalyticsClientMiddleware, isAnalyticsActive, recordCommandSuccessExtras, recordScaffoldedTemplate, redactCredentialTokenIds, sendError, storedCredentialAttribution, takeCommandSuccessExtras, telemetryCredential, trackCommandSuccess, trackEvent, useAnalyticsClientForTests };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as builder, r as command, i as describe, a as formatCheckoutPolicyFailure, o as handler } from "../_chunks/checkout-
|
|
1
|
+
export { t as builder, r as command, i as describe, a as formatCheckoutPolicyFailure, o as handler } from "../_chunks/checkout-CXIOydqZ.js";
|
package/dist/commands/claim.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as CLAIM_CREATE_FIELDS, n as CLAIM_LIST_FIELDS, r as aliases, i as builder, a as claimCreateFields, s as claimableCapabilities, c as command, l as create, u as describe, d as handler } from "../_chunks/claim-
|
|
1
|
+
export { t as CLAIM_CREATE_FIELDS, n as CLAIM_LIST_FIELDS, r as aliases, i as builder, a as claimCreateFields, s as claimableCapabilities, c as command, l as create, u as describe, d as handler } from "../_chunks/claim-DqAvAvDm.js";
|
package/dist/commands/config.js
CHANGED
|
@@ -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-
|
|
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-BH_qRHiG.js";
|
package/dist/commands/deploy.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as builder, n as command, i as describe, a as handler } from "../_chunks/deploy-
|
|
1
|
+
export { t as builder, n as command, i as describe, a as handler } from "../_chunks/deploy-D7B0Xfjg.js";
|
package/dist/commands/dev.js
CHANGED
|
@@ -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 localFunctionUrlEnv, m as planFunctionsToUnits, h as reportDevCredential, g as sourceFunctionUrlOverlay } from "../_chunks/dev-
|
|
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 localFunctionUrlEnv, m as planFunctionsToUnits, h as reportDevCredential, g as sourceFunctionUrlOverlay } from "../_chunks/dev-CSvxAecE.js";
|
package/dist/commands/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as ENV_PULL_SKIPPED_HINT, n as autoPullEnvAfterPin, r as builder, i as command, a as describe, s as handler, c as pull } from "../_chunks/env-
|
|
1
|
+
export { t as ENV_PULL_SKIPPED_HINT, n as autoPullEnvAfterPin, r as builder, i as command, a as describe, s as handler, c as pull } from "../_chunks/env-5HS5qQGd.js";
|
|
@@ -8,7 +8,7 @@ import { writer } from "../writer.js";
|
|
|
8
8
|
import { formatInitDone, printInitDone } from "../init/chrome.js";
|
|
9
9
|
import { FUNCTION_SLUG_PATTERN, deriveFunctionSlug } from "../utils/function_slug.js";
|
|
10
10
|
import { displayPath } from "./env_output.js";
|
|
11
|
-
import { _ as missingDependencies, d as ensureConfigPackages, g as installCommandFrom } from "../_chunks/config-
|
|
11
|
+
import { _ as missingDependencies, d as ensureConfigPackages, g as installCommandFrom } from "../_chunks/config-BH_qRHiG.js";
|
|
12
12
|
import { recommendedOperations } from "../functions/registry.js";
|
|
13
13
|
import { collidingFiles, operationsFromFlags, planConfigRegistration, planEnvExample, planScaffold, writeScaffold } from "../functions/scaffold.js";
|
|
14
14
|
import { describeRegistrySource, openRegistry } from "../functions/source.js";
|
package/dist/commands/git.js
CHANGED
|
@@ -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-
|
|
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-H32TNt6M.js";
|
package/dist/commands/index.js
CHANGED
|
@@ -2,29 +2,29 @@ import { r as auth_exports } from "../_chunks/auth-CIUtXByB.js";
|
|
|
2
2
|
import { t as api_exports } from "../_chunks/api-GbEaBZJ5.js";
|
|
3
3
|
import { n as api_keys_exports } from "../_chunks/api_keys-CNnnugbQ.js";
|
|
4
4
|
import { n as ask_exports } from "../_chunks/ask-DVwy0eUL.js";
|
|
5
|
-
import { o as env_exports } from "../_chunks/env-
|
|
6
|
-
import { c as config_exports } from "../_chunks/config-
|
|
5
|
+
import { o as env_exports } from "../_chunks/env-5HS5qQGd.js";
|
|
6
|
+
import { c as config_exports } from "../_chunks/config-BH_qRHiG.js";
|
|
7
7
|
import { u as projects_exports } from "../_chunks/projects-BwI2Uo0z.js";
|
|
8
|
-
import { a as link_exports } from "../_chunks/link-
|
|
8
|
+
import { a as link_exports } from "../_chunks/link-BgtkOBws.js";
|
|
9
9
|
import { o as mcp_exports } from "../_chunks/mcp-Bo-7TKc7.js";
|
|
10
|
-
import { c as plugins_exports } from "../_chunks/plugins-
|
|
10
|
+
import { c as plugins_exports } from "../_chunks/plugins-Dj0H6lDA.js";
|
|
11
11
|
import { l as skills_exports } from "../_chunks/skills-BP6pIm7O.js";
|
|
12
12
|
import { t as bootstrap_exports } from "../_chunks/bootstrap-wPZWa1sT.js";
|
|
13
13
|
import { r as branches_exports } from "../_chunks/branches-BNa1xX1L.js";
|
|
14
14
|
import { n as bucket_exports } from "../_chunks/bucket-BCdryTkD.js";
|
|
15
|
-
import { n as checkout_exports } from "../_chunks/checkout-
|
|
16
|
-
import { o as claim_exports } from "../_chunks/claim-
|
|
15
|
+
import { n as checkout_exports } from "../_chunks/checkout-CXIOydqZ.js";
|
|
16
|
+
import { o as claim_exports } from "../_chunks/claim-DqAvAvDm.js";
|
|
17
17
|
import { a as connection_string_exports } from "../_chunks/connection_string-DB4awPzZ.js";
|
|
18
18
|
import { a as credentials_exports } from "../_chunks/credentials-BSjE9fRR.js";
|
|
19
19
|
import { r as data_api_exports } from "../_chunks/data_api-Djxj5ZQD.js";
|
|
20
20
|
import { o as databases_exports } from "../_chunks/databases-Dok4wru7.js";
|
|
21
|
-
import { r as deploy_exports } from "../_chunks/deploy-
|
|
22
|
-
import { s as dev_exports } from "../_chunks/dev-
|
|
21
|
+
import { r as deploy_exports } from "../_chunks/deploy-D7B0Xfjg.js";
|
|
22
|
+
import { s as dev_exports } from "../_chunks/dev-CSvxAecE.js";
|
|
23
23
|
import { i as diff_exports } from "../_chunks/diff-DhxxbdQE.js";
|
|
24
24
|
import { c as docs_exports } from "../_chunks/docs-CrVybkTP.js";
|
|
25
25
|
import { o as feedback_exports } from "../_chunks/feedback-CMayyTa8.js";
|
|
26
26
|
import { o as functions_exports } from "../_chunks/functions-Q0zuvtnk.js";
|
|
27
|
-
import { o as git_exports } from "../_chunks/git-
|
|
27
|
+
import { o as git_exports } from "../_chunks/git-H32TNt6M.js";
|
|
28
28
|
import { a as init_exports } from "../_chunks/init-BkA6RilG.js";
|
|
29
29
|
import { o as inspect_exports } from "../_chunks/inspect-g0wekylj.js";
|
|
30
30
|
import { a as ip_allow_exports } from "../_chunks/ip_allow-5lLFvIuE.js";
|
|
@@ -39,7 +39,7 @@ import { s as realtime_exports } from "../_chunks/realtime-BRqIyGR-.js";
|
|
|
39
39
|
import { l as roles_exports } from "../_chunks/roles-B4w3YT_7.js";
|
|
40
40
|
import { a as set_context_exports } from "../_chunks/set_context-DbrwoImy.js";
|
|
41
41
|
import { s as snapshots_exports } from "../_chunks/snapshots-RJBzW8GM.js";
|
|
42
|
-
import { a as status_exports } from "../_chunks/status-
|
|
42
|
+
import { a as status_exports } from "../_chunks/status-DV8Z2kw3.js";
|
|
43
43
|
import { d as triggers_exports } from "../_chunks/triggers-BrRo1z4b.js";
|
|
44
44
|
import { s as user_exports } from "../_chunks/user-dlOGXbX9.js";
|
|
45
45
|
import { i as vpc_endpoints_exports } from "../_chunks/vpc_endpoints-CNb0YfMo.js";
|
package/dist/commands/link.js
CHANGED
|
@@ -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-
|
|
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-BgtkOBws.js";
|
package/dist/commands/plugins.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as aliases, n as builder, r as command, i as describe, a as handler, o as installPlugins, s as pluginsInstallError, l as reportPluginsInstall } from "../_chunks/plugins-
|
|
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-Dj0H6lDA.js";
|
package/dist/commands/status.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as builder, n as command, r as describe, i as handler } from "../_chunks/status-
|
|
1
|
+
export { t as builder, n as command, r as describe, i as handler } from "../_chunks/status-DV8Z2kw3.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { writer } from "../writer.js";
|
|
2
|
-
import { o as resolveNeonEnvVars } from "../_chunks/env-BNm69Qh8.js";
|
|
3
2
|
import { branchIdFromProps } from "../utils/enrichers.js";
|
|
3
|
+
import { o as resolveNeonEnvVars } from "../_chunks/env-BNm69Qh8.js";
|
|
4
4
|
import YAML from "yaml";
|
|
5
5
|
//#region src/commands/subscribe.ts
|
|
6
6
|
const builder = (argv) => argv.usage("$0 realtime subscribe \"<query>\" [options]").positional("query", {
|
package/dist/init/auth.js
CHANGED
|
@@ -4,7 +4,7 @@ import "../config.js";
|
|
|
4
4
|
import "../auth.js";
|
|
5
5
|
import { c as ensureAuth } from "../_chunks/auth-CIUtXByB.js";
|
|
6
6
|
import { recoverFrom401 } from "../auth_recovery.js";
|
|
7
|
-
import { c as pull } from "../_chunks/env-
|
|
7
|
+
import { c as pull } from "../_chunks/env-5HS5qQGd.js";
|
|
8
8
|
import { c as setupNeonMcp } from "../_chunks/mcp-Bo-7TKc7.js";
|
|
9
9
|
//#region src/init/auth.ts
|
|
10
10
|
const isUnauthorized = (error) => isNeonApiError(error) && error.status === 401;
|
package/dist/init/copy.js
CHANGED
|
@@ -158,6 +158,17 @@ const mcpKeyFailedNext = (reason, mcp) => [
|
|
|
158
158
|
"Or with OAuth:",
|
|
159
159
|
`${mcp} --oauth`
|
|
160
160
|
];
|
|
161
|
+
const AGENTS_NOT_INSTALLED = "not installed";
|
|
162
|
+
const TOOLING_FAILED = {
|
|
163
|
+
plugins: "The Neon plugin was not installed. Retry with:",
|
|
164
|
+
skills: "Neon skills were not installed. Retry with:",
|
|
165
|
+
mcp: "The Neon MCP server was not configured. Retry with:"
|
|
166
|
+
};
|
|
167
|
+
const toolingFailedNext = (failures) => failures.flatMap((failure, index) => [
|
|
168
|
+
...index > 0 ? [""] : [],
|
|
169
|
+
TOOLING_FAILED[failure.kind],
|
|
170
|
+
failure.command
|
|
171
|
+
]);
|
|
161
172
|
const mcpAfterLinkNext = (mcp) => ["Then configure the Neon MCP server for that project:", mcp];
|
|
162
173
|
const envPullFailedNext = () => ({
|
|
163
174
|
heading: HEADING_FAILED,
|
|
@@ -174,4 +185,4 @@ const headingForOutcome = (outcome) => {
|
|
|
174
185
|
}
|
|
175
186
|
};
|
|
176
187
|
//#endregion
|
|
177
|
-
export { AGENT_DETECTED_DESCRIPTION, AGENT_MCP_PICKER_MESSAGE, AGENT_MCP_SKIP_MESSAGE, AGENT_OTHER_DESCRIPTION, AGENT_PICKER_MESSAGE, AGENT_PLUGIN_SKIP_MESSAGE, AGENT_SETUP_MESSAGE, AGENT_SETUP_PLUGIN_DESCRIPTION, AGENT_SETUP_PLUGIN_TITLE, AGENT_SETUP_SKILLS_DESCRIPTION, AGENT_SETUP_SKILLS_TITLE, AGENT_SETUP_SKIP_DESCRIPTION, AGENT_SETUP_SKIP_TITLE, AGENT_SKILLS_PICKER_MESSAGE, AGENT_SKILLS_SKIP_MESSAGE, CANCELLED_BODY, CLAIMABLE_ACCOUNT_FLAGS, CLAIMABLE_ALREADY_LINKED, CLAIMABLE_MCP_API_KEY, CLAIMABLE_NO_LINK, CONFIG_CONFIRM_HINT, CONFIG_CONFIRM_MESSAGE, HEADING_CANCELLED, HEADING_COMPLETE, HEADING_FAILED, HEADING_PENDING, INIT_NEEDS_YES, INIT_SUBTITLE, MCP_API_KEY_NEEDS_AUTH, MCP_AUTH_API_KEY_DESCRIPTION, MCP_AUTH_API_KEY_TITLE, MCP_AUTH_MESSAGE, MCP_AUTH_OAUTH_DESCRIPTION, MCP_AUTH_OAUTH_TITLE, MCP_OAUTH_FALLBACK, MCP_SCOPED_NEEDS_PROJECT, MCP_SCOPE_GLOBAL_DESCRIPTION, MCP_SCOPE_GLOBAL_TITLE, MCP_SCOPE_MESSAGE, MCP_SCOPE_PROJECT_DESCRIPTION, MCP_SCOPE_PROJECT_TITLE, MODE_CUSTOM_DESCRIPTION, MODE_CUSTOM_TITLE, MODE_MESSAGE, MODE_RECOMMENDED_DESCRIPTION, MODE_RECOMMENDED_TITLE, NON_TTY_AGENT_SETUP, NON_TTY_LINK_NEEDS_AUTH, NO_AGENTS_FALLBACK_STATUS, NO_AGENT_SETUP_CONFLICT, PACKAGE_MANAGER_MESSAGE, PROGRESS, PROJECT_PINNED_OFFLINE, PROJECT_SETUP_CLAIMABLE_DESCRIPTION, PROJECT_SETUP_CLAIMABLE_TITLE, PROJECT_SETUP_LINK_DESCRIPTION, PROJECT_SETUP_LINK_TITLE, PROJECT_SETUP_MESSAGE, SERVICES_HINT, SERVICES_MESSAGE, SKILLS_PICKER_MESSAGE, agentMissingCommandDescription, claimableNext, claimableThenServicesNext, configInitNext, envPullFailedNext, existingConfigNext, headingForOutcome, installFailedNext, mcpAfterLinkNext, mcpConfigLocationSkipped, mcpConfigLocationUnavailable, mcpKeyFailedNext, namedAgentsUnavailable, newConfigNext, offlinePinNext, skippedLinkNext, unattendedUnauthedNext };
|
|
188
|
+
export { AGENTS_NOT_INSTALLED, AGENT_DETECTED_DESCRIPTION, AGENT_MCP_PICKER_MESSAGE, AGENT_MCP_SKIP_MESSAGE, AGENT_OTHER_DESCRIPTION, AGENT_PICKER_MESSAGE, AGENT_PLUGIN_SKIP_MESSAGE, AGENT_SETUP_MESSAGE, AGENT_SETUP_PLUGIN_DESCRIPTION, AGENT_SETUP_PLUGIN_TITLE, AGENT_SETUP_SKILLS_DESCRIPTION, AGENT_SETUP_SKILLS_TITLE, AGENT_SETUP_SKIP_DESCRIPTION, AGENT_SETUP_SKIP_TITLE, AGENT_SKILLS_PICKER_MESSAGE, AGENT_SKILLS_SKIP_MESSAGE, CANCELLED_BODY, CLAIMABLE_ACCOUNT_FLAGS, CLAIMABLE_ALREADY_LINKED, CLAIMABLE_MCP_API_KEY, CLAIMABLE_NO_LINK, CONFIG_CONFIRM_HINT, CONFIG_CONFIRM_MESSAGE, HEADING_CANCELLED, HEADING_COMPLETE, HEADING_FAILED, HEADING_PENDING, INIT_NEEDS_YES, INIT_SUBTITLE, MCP_API_KEY_NEEDS_AUTH, MCP_AUTH_API_KEY_DESCRIPTION, MCP_AUTH_API_KEY_TITLE, MCP_AUTH_MESSAGE, MCP_AUTH_OAUTH_DESCRIPTION, MCP_AUTH_OAUTH_TITLE, MCP_OAUTH_FALLBACK, MCP_SCOPED_NEEDS_PROJECT, MCP_SCOPE_GLOBAL_DESCRIPTION, MCP_SCOPE_GLOBAL_TITLE, MCP_SCOPE_MESSAGE, MCP_SCOPE_PROJECT_DESCRIPTION, MCP_SCOPE_PROJECT_TITLE, MODE_CUSTOM_DESCRIPTION, MODE_CUSTOM_TITLE, MODE_MESSAGE, MODE_RECOMMENDED_DESCRIPTION, MODE_RECOMMENDED_TITLE, NON_TTY_AGENT_SETUP, NON_TTY_LINK_NEEDS_AUTH, NO_AGENTS_FALLBACK_STATUS, NO_AGENT_SETUP_CONFLICT, PACKAGE_MANAGER_MESSAGE, PROGRESS, PROJECT_PINNED_OFFLINE, PROJECT_SETUP_CLAIMABLE_DESCRIPTION, PROJECT_SETUP_CLAIMABLE_TITLE, PROJECT_SETUP_LINK_DESCRIPTION, PROJECT_SETUP_LINK_TITLE, PROJECT_SETUP_MESSAGE, SERVICES_HINT, SERVICES_MESSAGE, SKILLS_PICKER_MESSAGE, agentMissingCommandDescription, claimableNext, claimableThenServicesNext, configInitNext, envPullFailedNext, existingConfigNext, headingForOutcome, installFailedNext, mcpAfterLinkNext, mcpConfigLocationSkipped, mcpConfigLocationUnavailable, mcpKeyFailedNext, namedAgentsUnavailable, newConfigNext, offlinePinNext, skippedLinkNext, toolingFailedNext, unattendedUnauthedNext };
|
package/dist/init/funnel.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import pkg_default from "../pkg.js";
|
|
2
|
-
import {
|
|
2
|
+
import { codeFromBody, isNeonApiError } from "../api.js";
|
|
3
|
+
import { isNetworkError, matchErrorCode } from "../errors.js";
|
|
4
|
+
import { redactCredentialTokenIds, trackEvent } from "../analytics.js";
|
|
5
|
+
import { AuthRefreshError } from "../auth.js";
|
|
3
6
|
import { randomUUID } from "node:crypto";
|
|
7
|
+
import { stripVTControlCharacters } from "node:util";
|
|
4
8
|
//#region src/init/funnel.ts
|
|
5
9
|
const CLI_INIT_START = "cli_init_start";
|
|
6
10
|
const CLI_INIT_END = "cli_init_end";
|
|
@@ -70,17 +74,45 @@ const initStartProperties = (input) => ({
|
|
|
70
74
|
detected_agents: input.detection.detectedAgents,
|
|
71
75
|
ci: input.detection.ci
|
|
72
76
|
});
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
77
|
+
/** Longer messages are cut so one plugin CLI dump cannot dominate the event. */
|
|
78
|
+
const ERROR_MESSAGE_LIMIT = 2e3;
|
|
79
|
+
/**
|
|
80
|
+
* The `errCode` the top-level failure handler (`index.ts`) sends on `CLI Error` for the same
|
|
81
|
+
* error, so a run's `error_code` and its `CLI Error` event agree.
|
|
82
|
+
*/
|
|
83
|
+
const initErrorCode = (error) => {
|
|
84
|
+
if (error instanceof AuthRefreshError) return "AUTH_FAILED";
|
|
85
|
+
if (isNetworkError(error)) return "NETWORK_ERROR";
|
|
86
|
+
if (isNeonApiError(error)) {
|
|
87
|
+
if (error.code === "ECONNABORTED") return "REQUEST_TIMEOUT";
|
|
88
|
+
const bodyCode = codeFromBody(error.data);
|
|
89
|
+
if (error.status === 401 || bodyCode === "SSO_AUTHORIZATION_REQUIRED" || bodyCode === "SSO_ORG_CREDS_ONLY") return "AUTH_FAILED";
|
|
90
|
+
return "API_ERROR";
|
|
91
|
+
}
|
|
92
|
+
return matchErrorCode(error instanceof Error ? error.message : void 0);
|
|
93
|
+
};
|
|
94
|
+
const initErrorMessage = (error) => {
|
|
95
|
+
const raw = error instanceof Error ? error.message : String(error);
|
|
96
|
+
return redactCredentialTokenIds(stripVTControlCharacters(raw)).slice(0, ERROR_MESSAGE_LIMIT);
|
|
97
|
+
};
|
|
98
|
+
const initEndProperties = (input) => {
|
|
99
|
+
const reported = input.errors.find((entry) => entry.error === input.exitError) ?? input.errors[0];
|
|
100
|
+
return {
|
|
101
|
+
init_run_id: input.initRunId,
|
|
102
|
+
cli_version: pkg_default.version,
|
|
103
|
+
mode: input.mode,
|
|
104
|
+
agent_setup: input.agentSetup,
|
|
105
|
+
agents_installed: input.agentsInstalled,
|
|
106
|
+
link: input.link,
|
|
107
|
+
config: input.config,
|
|
108
|
+
services: input.services,
|
|
109
|
+
outcome: input.outcome,
|
|
110
|
+
error_step: reported?.step ?? null,
|
|
111
|
+
error_code: reported === void 0 ? null : initErrorCode(reported.error),
|
|
112
|
+
error_message: reported === void 0 ? null : initErrorMessage(reported.error),
|
|
113
|
+
error_steps: [...new Set(input.errors.map((entry) => entry.step))]
|
|
114
|
+
};
|
|
115
|
+
};
|
|
84
116
|
const emitInitStart = (properties) => {
|
|
85
117
|
trackEvent(CLI_INIT_START, properties);
|
|
86
118
|
};
|
|
@@ -95,8 +127,22 @@ const createInitFunnel = (initRunId = createInitRunId()) => ({
|
|
|
95
127
|
link: null,
|
|
96
128
|
config: null,
|
|
97
129
|
services: null,
|
|
130
|
+
errors: [],
|
|
131
|
+
exitError: void 0,
|
|
98
132
|
ended: false
|
|
99
133
|
});
|
|
134
|
+
/** Records a failure once: a deferred error rethrown at the end keeps the step it failed in. */
|
|
135
|
+
const recordInitError = (state, step, error) => {
|
|
136
|
+
if (state.errors.some((entry) => entry.error === error)) return;
|
|
137
|
+
state.errors.push({
|
|
138
|
+
step,
|
|
139
|
+
error
|
|
140
|
+
});
|
|
141
|
+
};
|
|
142
|
+
const recordInitExit = (state, step, error) => {
|
|
143
|
+
recordInitError(state, step, error);
|
|
144
|
+
state.exitError = error;
|
|
145
|
+
};
|
|
100
146
|
const finishInitFunnel = (state, outcome, analytics) => {
|
|
101
147
|
if (state.ended || !analytics) return;
|
|
102
148
|
state.ended = true;
|
|
@@ -108,8 +154,10 @@ const finishInitFunnel = (state, outcome, analytics) => {
|
|
|
108
154
|
link: state.link,
|
|
109
155
|
config: state.config,
|
|
110
156
|
services: state.services,
|
|
111
|
-
outcome
|
|
157
|
+
outcome,
|
|
158
|
+
errors: state.errors,
|
|
159
|
+
exitError: state.exitError
|
|
112
160
|
}));
|
|
113
161
|
};
|
|
114
162
|
//#endregion
|
|
115
|
-
export { CLI_INIT_END, CLI_INIT_START, createInitFunnel, createInitRunId, emitInitEnd, emitInitStart, finishInitFunnel, initEndProperties, initFlagsFromArgv, initStartProperties };
|
|
163
|
+
export { CLI_INIT_END, CLI_INIT_START, createInitFunnel, createInitRunId, emitInitEnd, emitInitStart, finishInitFunnel, initEndProperties, initErrorCode, initErrorMessage, initFlagsFromArgv, initStartProperties, recordInitError, recordInitExit };
|
package/dist/init/link.js
CHANGED
|
@@ -4,7 +4,7 @@ import "../config.js";
|
|
|
4
4
|
import "../auth.js";
|
|
5
5
|
import { c as ensureAuth } from "../_chunks/auth-CIUtXByB.js";
|
|
6
6
|
import { recoverFrom401 } from "../auth_recovery.js";
|
|
7
|
-
import { s as runLink } from "../_chunks/link-
|
|
7
|
+
import { s as runLink } from "../_chunks/link-BgtkOBws.js";
|
|
8
8
|
//#region 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
|
@@ -15,20 +15,20 @@ import { missingPluginsCommands, pluginsInstallableAgents } from "../plugins/tar
|
|
|
15
15
|
import { skillsInstallableAgents } from "../skills/targets.js";
|
|
16
16
|
import { FALLBACK_SKILLS_AGENTS, assertNamedAgentTooling, funnelAgentSetup, planInitToolingSteps, recommendedTooling, resolveNamedAgents, splitInitTooling } from "./plan.js";
|
|
17
17
|
import { inferPackageManager, resolvePackageManager } from "../utils/package_manager.js";
|
|
18
|
-
import { 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, unattendedUnauthedNext } from "./copy.js";
|
|
18
|
+
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";
|
|
19
19
|
import { agentsRowValue, configRowValue, formatInitDone, headingForKind, printInitBanner, printInitDone, printInitProgress, projectRowValue, shouldPrintInitBanner } from "./chrome.js";
|
|
20
|
-
import { h as initCmd, t as ConfigInstallFailed } from "../_chunks/config-
|
|
21
|
-
import { o as quoteFlagValue, s as runLink } from "../_chunks/link-
|
|
20
|
+
import { h as initCmd, t as ConfigInstallFailed } from "../_chunks/config-BH_qRHiG.js";
|
|
21
|
+
import { o as quoteFlagValue, s as runLink } from "../_chunks/link-BgtkOBws.js";
|
|
22
22
|
import { runAuthenticatedLink } from "./link.js";
|
|
23
23
|
import { CannotMintApiKeyError } from "../mcp/mint.js";
|
|
24
24
|
import { pullInitEnv } from "./auth.js";
|
|
25
25
|
import { InitCancelled, raceSigint, restoreCursor } from "./cancelled.js";
|
|
26
26
|
import { pickAgentSetupInteractively, pickInitAgentsInteractively, pickInitConfigInteractively, pickInitMcpAuthInteractively, pickInitMcpConfigLocationInteractively, pickInitModeInteractively, pickInitPackageManagerInteractively, pickInitProjectSetupInteractively, pickInitServicesInteractively, pickInitSkillsInteractively } from "./wizard.js";
|
|
27
|
-
import { runToolingSteps } from "./tooling.js";
|
|
28
|
-
import { l as create } from "../_chunks/claim-
|
|
27
|
+
import { runToolingSteps, toolingStepCommandText } from "./tooling.js";
|
|
28
|
+
import { l as create } from "../_chunks/claim-DqAvAvDm.js";
|
|
29
29
|
import { INIT_CONFIG_SERVICES_CONFLICT, configPlanFromResolution, initEnvPullAfterConfig, resolveInitConfigChoice } from "./choices.js";
|
|
30
30
|
import { detectInitEnvironment } from "./detect.js";
|
|
31
|
-
import { createInitFunnel, emitInitStart, finishInitFunnel, initStartProperties } from "./funnel.js";
|
|
31
|
+
import { createInitFunnel, emitInitStart, finishInitFunnel, initStartProperties, recordInitError, recordInitExit } from "./funnel.js";
|
|
32
32
|
import { assertAgentSetupFlags, hasInitMcpFlags, inferInitAgentSetup, resolveInitMode } from "./mode.js";
|
|
33
33
|
import { resolve } from "node:path";
|
|
34
34
|
//#region src/init/run.ts
|
|
@@ -197,6 +197,8 @@ const runInit = async (props) => {
|
|
|
197
197
|
const funnel = createInitFunnel();
|
|
198
198
|
let outcome = "error";
|
|
199
199
|
let printed = false;
|
|
200
|
+
let step = "setup";
|
|
201
|
+
let deferredFailureNext = () => [];
|
|
200
202
|
try {
|
|
201
203
|
const detectOpts = {
|
|
202
204
|
cwd,
|
|
@@ -332,7 +334,23 @@ const runInit = async (props) => {
|
|
|
332
334
|
const mcpOauth = mcpAuth === "oauth";
|
|
333
335
|
const earlyTooling = delayMcp ? withoutMcp(tooling) : tooling;
|
|
334
336
|
const mcpState = {};
|
|
335
|
-
const
|
|
337
|
+
const toolingFailures = [];
|
|
338
|
+
const reportedTooling = () => {
|
|
339
|
+
const dropped = new Set(toolingFailures.map((failure) => failure.kind));
|
|
340
|
+
if (mcpState.error !== void 0 || mcpState.deferredPin !== void 0) dropped.add("mcp");
|
|
341
|
+
return withoutKinds(tooling, dropped);
|
|
342
|
+
};
|
|
343
|
+
const agentsRow = () => {
|
|
344
|
+
const reported = reportedTooling();
|
|
345
|
+
return toolingFailures.length > 0 && reported.setup === "skip" ? AGENTS_NOT_INSTALLED : agentsRowValue({
|
|
346
|
+
tooling: reported,
|
|
347
|
+
installed: funnel.agentsInstalled
|
|
348
|
+
});
|
|
349
|
+
};
|
|
350
|
+
const toolingFailedNextLines = () => toolingFailedNext(toolingFailures.map((failure) => ({
|
|
351
|
+
kind: failure.kind,
|
|
352
|
+
command: failure.command
|
|
353
|
+
})));
|
|
336
354
|
const mcpCommand = (projectIdArg) => [
|
|
337
355
|
`${getCliName()} mcp -y`,
|
|
338
356
|
...mcpConfigLocation === "project" ? ["--project"] : [],
|
|
@@ -340,25 +358,35 @@ const runInit = async (props) => {
|
|
|
340
358
|
...("mcpAgents" in tooling ? tooling.mcpAgents : []).map((agent) => `--agent ${agent}`)
|
|
341
359
|
].join(" ");
|
|
342
360
|
const mcpFailedNext = () => mcpState.error === void 0 ? [] : mcpKeyFailedNext(mcpState.reason ?? "cannot-mint", mcpCommand(mcpState.pinId !== void 0 ? quoteFlagValue(mcpState.pinId) : void 0));
|
|
361
|
+
deferredFailureNext = () => joinNext(toolingFailedNextLines(), mcpFailedNext());
|
|
343
362
|
const mcpDeferredNext = () => mcpState.deferredPin === void 0 ? [] : mcpAfterLinkNext(`${mcpCommand(mcpState.deferredPin)}${mcpOauth ? " --oauth" : ""}`);
|
|
344
363
|
const runTooling = async (steps, plan) => {
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
364
|
+
for (const toolingStep of steps) {
|
|
365
|
+
let completed;
|
|
366
|
+
try {
|
|
367
|
+
completed = await runToolingSteps([toolingStep], {
|
|
368
|
+
cwd,
|
|
369
|
+
output: props.output,
|
|
370
|
+
auth,
|
|
371
|
+
operations: props.operations,
|
|
372
|
+
narrate: "human",
|
|
373
|
+
mcpOauthFallback: !mcpAuthChosen
|
|
374
|
+
});
|
|
375
|
+
} catch (error) {
|
|
376
|
+
if (error instanceof InitCancelled) throw error;
|
|
377
|
+
if (error instanceof CannotMintApiKeyError) {
|
|
378
|
+
mcpState.error = error;
|
|
379
|
+
mcpState.reason = "cannot-mint";
|
|
380
|
+
} else toolingFailures.push({
|
|
381
|
+
kind: toolingStep.kind,
|
|
382
|
+
command: `${getCliName()} ${toolingStepCommandText(toolingStep)}`,
|
|
383
|
+
error
|
|
384
|
+
});
|
|
385
|
+
recordInitError(funnel, toolingStep.kind, error);
|
|
386
|
+
continue;
|
|
387
|
+
}
|
|
388
|
+
if (completed.includes(toolingStep.kind)) funnel.agentsInstalled = uniqueAgents([...funnel.agentsInstalled, ...agentsForStep(plan, toolingStep.kind)]);
|
|
360
389
|
}
|
|
361
|
-
funnel.agentsInstalled = uniqueAgents([...funnel.agentsInstalled, ...agentsFromTooling(ran)]);
|
|
362
390
|
};
|
|
363
391
|
const toolingSteps = planInitToolingSteps({
|
|
364
392
|
tooling: earlyTooling,
|
|
@@ -370,6 +398,7 @@ const runInit = async (props) => {
|
|
|
370
398
|
...selectedSkills !== void 0 ? { skills: selectedSkills } : {}
|
|
371
399
|
});
|
|
372
400
|
if (toolingSteps.length > 0) await runTooling(toolingSteps, earlyTooling);
|
|
401
|
+
step = "link";
|
|
373
402
|
let projectSetup = "skip";
|
|
374
403
|
let claimExpiresAt;
|
|
375
404
|
const noLink = props.link === false;
|
|
@@ -419,6 +448,7 @@ const runInit = async (props) => {
|
|
|
419
448
|
};
|
|
420
449
|
if (usesMcp && mcpAuth === "api-key" && (projectSetup === "claimable" || props.claimable === true)) throw new Error(CLAIMABLE_MCP_API_KEY);
|
|
421
450
|
if (projectSetup === "claimable") {
|
|
451
|
+
step = "claimable";
|
|
422
452
|
printInitProgress(PROGRESS.claim);
|
|
423
453
|
await (props.createClaimable ?? defaultCreateClaimable)({
|
|
424
454
|
cwd,
|
|
@@ -432,12 +462,14 @@ const runInit = async (props) => {
|
|
|
432
462
|
funnel.link = "claimable";
|
|
433
463
|
claimExpiresAt = readLinkedClaimableCredentials(configDir, readContextFile(contextFile))?.expiresAt;
|
|
434
464
|
} else if (projectSetup === "link") {
|
|
465
|
+
step = "link";
|
|
435
466
|
printInitProgress(detection.authenticated ? PROGRESS.link : PROGRESS.auth);
|
|
436
467
|
await (props.linkProject ?? runAuthenticatedLink)(linkProps);
|
|
437
468
|
funnel.link = "linked";
|
|
438
469
|
}
|
|
439
470
|
const pinnedOffline = funnel.link === "skipped" && !noLink && linkInputs.orgId !== void 0 && linkInputs.projectId !== void 0 && linkInputs.branch !== void 0 && linkInputs.projectName === void 0 && linkInputs.regionId === void 0;
|
|
440
471
|
if (pinnedOffline) {
|
|
472
|
+
step = "link";
|
|
441
473
|
await runLink({
|
|
442
474
|
...linkProps,
|
|
443
475
|
checks: false,
|
|
@@ -449,9 +481,11 @@ const runInit = async (props) => {
|
|
|
449
481
|
else if (delayMcp && tooling.setup !== "skip" && mcpAuth === "api-key" && yes && !detection.authenticated) {
|
|
450
482
|
mcpState.error = new Error(MCP_API_KEY_NEEDS_AUTH);
|
|
451
483
|
mcpState.reason = "signed-out";
|
|
484
|
+
recordInitError(funnel, "mcp", mcpState.error);
|
|
452
485
|
const linkedId = readContextFile(contextFile).projectId;
|
|
453
486
|
if (props.mcpProjectScoped === true && typeof linkedId === "string") mcpState.pinId = linkedId;
|
|
454
487
|
} else if (delayMcp && tooling.setup !== "skip") {
|
|
488
|
+
step = "mcp";
|
|
455
489
|
const linkedId = readContextFile(contextFile).projectId;
|
|
456
490
|
let pinId;
|
|
457
491
|
if (props.mcpProjectScoped === true) {
|
|
@@ -479,6 +513,7 @@ const runInit = async (props) => {
|
|
|
479
513
|
mcpState.pinId = pinId;
|
|
480
514
|
if (mcpSteps.length > 0) await runTooling(mcpSteps, mcpOnly);
|
|
481
515
|
}
|
|
516
|
+
step = "config";
|
|
482
517
|
const canAskConfig = props.pickConfig !== void 0 || detection.interactive;
|
|
483
518
|
const configResolution = resolveInitConfigChoice({
|
|
484
519
|
flag: recommended ? props.config ?? true : props.config,
|
|
@@ -536,7 +571,7 @@ const runInit = async (props) => {
|
|
|
536
571
|
heading: failed.heading,
|
|
537
572
|
body: failed.body,
|
|
538
573
|
rows: [],
|
|
539
|
-
next: joinNext(failed.next, mcpFailedNext())
|
|
574
|
+
next: joinNext(failed.next, joinNext(toolingFailedNextLines(), mcpFailedNext()))
|
|
540
575
|
}));
|
|
541
576
|
printed = true;
|
|
542
577
|
outcome = "error";
|
|
@@ -557,48 +592,48 @@ const runInit = async (props) => {
|
|
|
557
592
|
...typeof context.projectId === "string" ? { projectId: context.projectId } : {},
|
|
558
593
|
...branch !== void 0 ? { branch } : {}
|
|
559
594
|
});
|
|
560
|
-
if (envPullPlan.kind !== "skip")
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
595
|
+
if (envPullPlan.kind !== "skip") {
|
|
596
|
+
step = "env_pull";
|
|
597
|
+
try {
|
|
598
|
+
if (typeof context.projectId !== "string" || typeof branch !== "string") throw new Error("Env pull requires a linked project and branch.");
|
|
599
|
+
printInitProgress(PROGRESS.env);
|
|
600
|
+
await raceSigint((props.envPull ?? pullInitEnv)({
|
|
601
|
+
...auth,
|
|
602
|
+
output: props.output,
|
|
603
|
+
cwd,
|
|
604
|
+
projectId: context.projectId,
|
|
605
|
+
branch,
|
|
606
|
+
...envPullPlan.kind === "services" ? {
|
|
607
|
+
services: envPullPlan.services,
|
|
608
|
+
envKeys: envPullPlan.envKeys
|
|
609
|
+
} : {}
|
|
610
|
+
}));
|
|
611
|
+
} catch (error) {
|
|
612
|
+
if (error instanceof InitCancelled) throw error;
|
|
613
|
+
const failed = envPullFailedNext();
|
|
614
|
+
printInitDone(formatInitDone({
|
|
615
|
+
heading: failed.heading,
|
|
616
|
+
body: failed.body,
|
|
617
|
+
rows: [
|
|
618
|
+
{
|
|
619
|
+
label: "Agents",
|
|
620
|
+
value: agentsRow()
|
|
621
|
+
},
|
|
622
|
+
{
|
|
623
|
+
label: "Project",
|
|
624
|
+
value: projectRowValue(funnel.link)
|
|
625
|
+
},
|
|
626
|
+
{
|
|
627
|
+
label: "Config",
|
|
628
|
+
value: configRowValue(funnel.config, existingFilename)
|
|
629
|
+
}
|
|
630
|
+
],
|
|
631
|
+
next: joinNext(failed.next, joinNext(toolingFailedNextLines(), mcpFailedNext()))
|
|
632
|
+
}));
|
|
633
|
+
printed = true;
|
|
634
|
+
outcome = "error";
|
|
635
|
+
throw error;
|
|
636
|
+
}
|
|
602
637
|
}
|
|
603
638
|
const pendingUnauthed = funnel.link === "skipped" && !noLink;
|
|
604
639
|
const pendingServices = extraServices && linked;
|
|
@@ -640,16 +675,14 @@ const runInit = async (props) => {
|
|
|
640
675
|
outcome = pending && !pendingUnauthed && noLink ? "success" : pending ? "pending" : "success";
|
|
641
676
|
if (pendingUnauthed) outcome = "pending";
|
|
642
677
|
if (noLink && !pendingUnauthed && !pendingServices && !pendingExisting) outcome = "success";
|
|
643
|
-
|
|
678
|
+
const deferredError = toolingFailures[0]?.error ?? mcpState.error;
|
|
679
|
+
if (deferredError !== void 0) outcome = "error";
|
|
644
680
|
printInitDone(formatInitDone({
|
|
645
681
|
heading: headingForKind(outcome),
|
|
646
682
|
rows: [
|
|
647
683
|
{
|
|
648
684
|
label: "Agents",
|
|
649
|
-
value:
|
|
650
|
-
tooling: reportedTooling(),
|
|
651
|
-
installed: funnel.agentsInstalled
|
|
652
|
-
})
|
|
685
|
+
value: agentsRow()
|
|
653
686
|
},
|
|
654
687
|
{
|
|
655
688
|
label: "Project",
|
|
@@ -660,10 +693,10 @@ const runInit = async (props) => {
|
|
|
660
693
|
value: configRowValue(funnel.config, existingFilename)
|
|
661
694
|
}
|
|
662
695
|
],
|
|
663
|
-
next: joinNext(mcpFailedNext(), next)
|
|
696
|
+
next: joinNext(joinNext(toolingFailedNextLines(), mcpFailedNext()), next)
|
|
664
697
|
}));
|
|
665
698
|
printed = true;
|
|
666
|
-
if (
|
|
699
|
+
if (deferredError !== void 0) throw deferredError;
|
|
667
700
|
takeCommandSuccessExtras();
|
|
668
701
|
recordCommandSuccessExtras({
|
|
669
702
|
init_kind: detection.emptyDirectory ? "empty-skip" : "existing",
|
|
@@ -682,6 +715,13 @@ const runInit = async (props) => {
|
|
|
682
715
|
throw error;
|
|
683
716
|
}
|
|
684
717
|
outcome = "error";
|
|
718
|
+
recordInitExit(funnel, step, error);
|
|
719
|
+
const deferred = deferredFailureNext();
|
|
720
|
+
if (!printed && deferred.length > 0) printInitDone(formatInitDone({
|
|
721
|
+
heading: headingForKind("error"),
|
|
722
|
+
rows: [],
|
|
723
|
+
next: deferred
|
|
724
|
+
}));
|
|
685
725
|
throw error;
|
|
686
726
|
} finally {
|
|
687
727
|
finishInitFunnel(funnel, outcome, analytics);
|
|
@@ -702,31 +742,46 @@ const joinNext = (first, second) => first.length === 0 || second.length === 0 ?
|
|
|
702
742
|
"",
|
|
703
743
|
...second
|
|
704
744
|
];
|
|
705
|
-
const
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
745
|
+
const withoutKinds = (tooling, kinds) => {
|
|
746
|
+
switch (tooling.setup) {
|
|
747
|
+
case "skip": return tooling;
|
|
748
|
+
case "plugin": return kinds.has("plugins") ? { setup: "skip" } : tooling;
|
|
749
|
+
case "skills": return kinds.has("skills") ? { setup: "skip" } : tooling;
|
|
750
|
+
case "skills-mcp": {
|
|
751
|
+
const skillsAgents = kinds.has("skills") ? [] : tooling.skillsAgents;
|
|
752
|
+
const mcpAgents = kinds.has("mcp") ? [] : tooling.mcpAgents;
|
|
753
|
+
return skillsAgents.length === 0 && mcpAgents.length === 0 ? { setup: "skip" } : {
|
|
754
|
+
...tooling,
|
|
755
|
+
skillsAgents,
|
|
756
|
+
mcpAgents
|
|
757
|
+
};
|
|
758
|
+
}
|
|
759
|
+
case "mixed": {
|
|
760
|
+
const skillsAgents = kinds.has("skills") ? [] : tooling.skillsAgents;
|
|
761
|
+
const mcpAgents = kinds.has("mcp") ? [] : tooling.mcpAgents;
|
|
762
|
+
if (!kinds.has("plugins")) return {
|
|
763
|
+
...tooling,
|
|
764
|
+
skillsAgents,
|
|
765
|
+
mcpAgents
|
|
766
|
+
};
|
|
767
|
+
return skillsAgents.length === 0 && mcpAgents.length === 0 ? { setup: "skip" } : {
|
|
768
|
+
setup: "skills-mcp",
|
|
769
|
+
skillsAgents,
|
|
770
|
+
mcpAgents
|
|
771
|
+
};
|
|
772
|
+
}
|
|
773
|
+
default: return tooling;
|
|
774
|
+
}
|
|
715
775
|
};
|
|
776
|
+
const withoutMcp = (tooling) => withoutKinds(tooling, /* @__PURE__ */ new Set(["mcp"]));
|
|
716
777
|
/** The Neon plugin bundles the skills. */
|
|
717
778
|
const installsSkills = (tooling) => tooling.setup === "skills-mcp" ? tooling.skillsAgents.length > 0 : tooling.setup !== "skip";
|
|
718
|
-
const
|
|
719
|
-
switch (
|
|
720
|
-
case "
|
|
721
|
-
case "
|
|
722
|
-
case "
|
|
723
|
-
|
|
724
|
-
case "mixed": return uniqueAgents([
|
|
725
|
-
...tooling.pluginAgents,
|
|
726
|
-
...tooling.skillsAgents,
|
|
727
|
-
...tooling.mcpAgents
|
|
728
|
-
]);
|
|
729
|
-
default: return tooling;
|
|
779
|
+
const agentsForStep = (tooling, kind) => {
|
|
780
|
+
switch (kind) {
|
|
781
|
+
case "plugins": return tooling.setup === "plugin" ? [...tooling.agents] : tooling.setup === "mixed" ? [...tooling.pluginAgents] : [];
|
|
782
|
+
case "skills": return tooling.setup === "skills" ? [...tooling.agents] : tooling.setup === "skills-mcp" || tooling.setup === "mixed" ? [...tooling.skillsAgents] : [];
|
|
783
|
+
case "mcp": return tooling.setup === "skills-mcp" || tooling.setup === "mixed" ? [...tooling.mcpAgents] : [];
|
|
784
|
+
default: return kind;
|
|
730
785
|
}
|
|
731
786
|
};
|
|
732
787
|
//#endregion
|
package/dist/init/tooling.js
CHANGED
|
@@ -6,7 +6,7 @@ import { CannotMintApiKeyError } from "../mcp/mint.js";
|
|
|
6
6
|
import { detectAgent } from "./detect_host.js";
|
|
7
7
|
import { AgentSelectionSkipped, canPickAgentsInteractively } from "../utils/agent_picker.js";
|
|
8
8
|
import { a as mcpInstallError, s as reportMcpInstall } from "../_chunks/mcp-Bo-7TKc7.js";
|
|
9
|
-
import { l as reportPluginsInstall, o as installPlugins, s as pluginsInstallError } from "../_chunks/plugins-
|
|
9
|
+
import { l as reportPluginsInstall, o as installPlugins, s as pluginsInstallError } from "../_chunks/plugins-Dj0H6lDA.js";
|
|
10
10
|
import { c as skillsInstallError, o as installSkills, s as reportSkillsInstall } from "../_chunks/skills-BP6pIm7O.js";
|
|
11
11
|
import { runAuthenticatedMcp } from "./auth.js";
|
|
12
12
|
import { raceSigint } from "./cancelled.js";
|
|
@@ -19,7 +19,7 @@ const TOOLING_STEP_LABELS = {
|
|
|
19
19
|
skills: PROGRESS.skills,
|
|
20
20
|
mcp: PROGRESS.mcp
|
|
21
21
|
};
|
|
22
|
-
/**
|
|
22
|
+
/** The `<command> <flags>` a user can run to repeat this step on its own. Never executed here. */
|
|
23
23
|
const toolingStepCommandText = (step) => {
|
|
24
24
|
const flags = [];
|
|
25
25
|
switch (step.kind) {
|
|
@@ -185,4 +185,4 @@ const runAgentTooling = async (options) => {
|
|
|
185
185
|
}));
|
|
186
186
|
};
|
|
187
187
|
//#endregion
|
|
188
|
-
export { runAgentTooling, runToolingSteps };
|
|
188
|
+
export { runAgentTooling, runToolingSteps, toolingStepCommandText };
|
package/dist/skills/freshness.js
CHANGED
|
@@ -83,17 +83,23 @@ const folderKey = ({ source, folder }) => `${source}:${folder}`;
|
|
|
83
83
|
/** `undefined` when the remote side has not been fetched yet. */
|
|
84
84
|
const skillStatus = (skill, remote) => {
|
|
85
85
|
if (remote?.missing === true) return "not found upstream";
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
if (skill.hashKind === "tree") {
|
|
87
|
+
if (remote?.tree === void 0) return void 0;
|
|
88
|
+
return remote.tree === skill.hash ? "up to date" : "outdated";
|
|
89
|
+
}
|
|
90
|
+
if (remote?.content === void 0) return void 0;
|
|
91
|
+
if (skill.hash === remote.content) return "up to date";
|
|
92
|
+
if (remote.contentCrlf === void 0) return void 0;
|
|
93
|
+
return skill.hash === remote.contentCrlf ? "up to date" : "outdated";
|
|
89
94
|
};
|
|
90
95
|
const parseRemoteFolder = (value) => {
|
|
91
96
|
if (!isRecord(value)) return void 0;
|
|
92
|
-
const { tree, content, missing, pending } = value;
|
|
93
|
-
if (tree !== void 0 && typeof tree !== "string" || content !== void 0 && typeof content !== "string" || missing !== void 0 && missing !== true || pending !== void 0 && pending !== true) return;
|
|
97
|
+
const { tree, content, contentCrlf, missing, pending } = value;
|
|
98
|
+
if (tree !== void 0 && typeof tree !== "string" || content !== void 0 && typeof content !== "string" || contentCrlf !== void 0 && typeof contentCrlf !== "string" || missing !== void 0 && missing !== true || pending !== void 0 && pending !== true) return;
|
|
94
99
|
return {
|
|
95
100
|
...tree === void 0 ? {} : { tree },
|
|
96
101
|
...content === void 0 ? {} : { content },
|
|
102
|
+
...contentCrlf === void 0 ? {} : { contentCrlf },
|
|
97
103
|
...missing === void 0 ? {} : { missing },
|
|
98
104
|
...pending === void 0 ? {} : { pending }
|
|
99
105
|
};
|
|
@@ -137,6 +143,41 @@ const skillContentHash = (files) => {
|
|
|
137
143
|
}
|
|
138
144
|
return hash.digest("hex");
|
|
139
145
|
};
|
|
146
|
+
const LF = 10;
|
|
147
|
+
const CR = 13;
|
|
148
|
+
/** Control bytes Git counts as printable text: backspace, tab, form feed, escape. */
|
|
149
|
+
const PRINTABLE_CONTROLS = /* @__PURE__ */ new Set([
|
|
150
|
+
8,
|
|
151
|
+
9,
|
|
152
|
+
12,
|
|
153
|
+
27
|
|
154
|
+
]);
|
|
155
|
+
/**
|
|
156
|
+
* The bytes Git writes for a blob when `core.autocrlf=true`, the Git for Windows default. The
|
|
157
|
+
* skills CLI hashes that checkout, so a Windows install records a hash of these bytes. Mirrors
|
|
158
|
+
* Git's `convert.c`: a blob that has any CR, a NUL, or mostly non-printable bytes is written
|
|
159
|
+
* unchanged, and every LF in any other blob becomes CRLF.
|
|
160
|
+
*/
|
|
161
|
+
const autocrlfCheckout = (bytes) => {
|
|
162
|
+
let lf = 0;
|
|
163
|
+
let printable = 0;
|
|
164
|
+
let nonprintable = 0;
|
|
165
|
+
for (const byte of bytes) {
|
|
166
|
+
if (byte === CR || byte === 0) return bytes;
|
|
167
|
+
if (byte === LF) lf += 1;
|
|
168
|
+
else if (byte === 127 || byte < 32 && !PRINTABLE_CONTROLS.has(byte)) nonprintable += 1;
|
|
169
|
+
else printable += 1;
|
|
170
|
+
}
|
|
171
|
+
if (bytes[bytes.length - 1] === 26) nonprintable -= 1;
|
|
172
|
+
if (lf === 0 || printable >> 7 < nonprintable) return bytes;
|
|
173
|
+
const out = new Uint8Array(bytes.length + lf);
|
|
174
|
+
let at = 0;
|
|
175
|
+
for (const byte of bytes) {
|
|
176
|
+
if (byte === LF) out[at++] = CR;
|
|
177
|
+
out[at++] = byte;
|
|
178
|
+
}
|
|
179
|
+
return out;
|
|
180
|
+
};
|
|
140
181
|
const gitBlobSha = (bytes) => createHash("sha1").update(`blob ${bytes.byteLength}\0`).update(bytes).digest("hex");
|
|
141
182
|
const isTreeEntry = (value) => isRecord(value) && typeof value.path === "string" && typeof value.mode === "string" && typeof value.type === "string" && typeof value.sha === "string";
|
|
142
183
|
const githubHeaders = (env) => {
|
|
@@ -168,7 +209,7 @@ const folderFiles = (tree, folder) => tree.filter((entry) => {
|
|
|
168
209
|
const dirs = entry.path.slice(folder.length + 1).split("/").slice(0, -1);
|
|
169
210
|
return !dirs.includes(".git") && !dirs.includes("node_modules");
|
|
170
211
|
});
|
|
171
|
-
const
|
|
212
|
+
const fetchContentHashes = async (source, folder, tree) => {
|
|
172
213
|
const files = await Promise.all(folderFiles(tree, folder).map(async (entry) => {
|
|
173
214
|
const path = entry.path.split("/").map(encodeURIComponent).join("/");
|
|
174
215
|
const response = await fetch(`https://raw.githubusercontent.com/${source}/HEAD/${path}`, { signal: AbortSignal.timeout(FETCH_TIMEOUT_MS) });
|
|
@@ -180,7 +221,13 @@ const fetchContentHash = async (source, folder, tree) => {
|
|
|
180
221
|
bytes
|
|
181
222
|
};
|
|
182
223
|
}));
|
|
183
|
-
return
|
|
224
|
+
return {
|
|
225
|
+
content: skillContentHash(files),
|
|
226
|
+
contentCrlf: skillContentHash(files.map((file) => ({
|
|
227
|
+
...file,
|
|
228
|
+
bytes: autocrlfCheckout(file.bytes)
|
|
229
|
+
})))
|
|
230
|
+
};
|
|
184
231
|
};
|
|
185
232
|
/**
|
|
186
233
|
* The folders to fetch: the given skills, plus every folder already in the cache so
|
|
@@ -232,11 +279,14 @@ const refreshSkillsCheckCache = async ({ cachePath, skills, env = process.env, n
|
|
|
232
279
|
continue;
|
|
233
280
|
}
|
|
234
281
|
const prior = previous[key];
|
|
235
|
-
let
|
|
236
|
-
|
|
282
|
+
let hashes = prior?.tree === node.sha && prior.content !== void 0 && prior.contentCrlf !== void 0 ? {
|
|
283
|
+
content: prior.content,
|
|
284
|
+
contentCrlf: prior.contentCrlf
|
|
285
|
+
} : void 0;
|
|
286
|
+
if (request.content && hashes === void 0) hashes = await fetchContentHashes(source, request.folder, tree);
|
|
237
287
|
folders[key] = {
|
|
238
288
|
tree: node.sha,
|
|
239
|
-
...
|
|
289
|
+
...hashes
|
|
240
290
|
};
|
|
241
291
|
}
|
|
242
292
|
}
|
|
@@ -394,4 +444,4 @@ const notifyIfSkillsOutdated = ({ configDir, cwd, now = Date.now() }) => {
|
|
|
394
444
|
}, "skills check cache")) spawnSkillsCheckWorker(cachePath, cwd);
|
|
395
445
|
};
|
|
396
446
|
//#endregion
|
|
397
|
-
export { formatSkillsNotice, globalLockPath, lockPath, neonSkillsUpdateCommand, notifyIfSkillsOutdated, parseSkillsCheckCache, parseSkillsLock, planSkillsCheck, projectLockPath, readLockedSkills, readSkillsTelemetry, refreshSkillsCheckCache, scopeLabel, skillContentHash, skillStatus, skillsCheckCachePath, skillsStatusRows, skillsTelemetry };
|
|
447
|
+
export { autocrlfCheckout, formatSkillsNotice, globalLockPath, lockPath, neonSkillsUpdateCommand, notifyIfSkillsOutdated, parseSkillsCheckCache, parseSkillsLock, planSkillsCheck, projectLockPath, readLockedSkills, readSkillsTelemetry, refreshSkillsCheckCache, scopeLabel, skillContentHash, skillStatus, skillsCheckCachePath, skillsStatusRows, skillsTelemetry };
|
package/dist/skills/run.js
CHANGED
|
@@ -37,11 +37,13 @@ const assertSkillsNode = (version = process.version) => {
|
|
|
37
37
|
if (nodeMeetsMinimum(version, "22.20.0")) return;
|
|
38
38
|
throw new Error(`neon skills needs Node.js ${SKILLS_MIN_NODE} or newer to run the skills CLI. This process is Node.js ${version.replace(/^v/, "")}. Upgrade Node.js, then retry.`);
|
|
39
39
|
};
|
|
40
|
+
/** A bare `skills` makes npx run any copy already installed globally or cached, however old. */
|
|
41
|
+
const SKILLS_PACKAGE = "skills@latest";
|
|
40
42
|
const skillsAddArgs = (options) => {
|
|
41
43
|
if (options.skills.length === 0) throw new Error("skills add needs at least one --skill.");
|
|
42
44
|
const args = [
|
|
43
45
|
"-y",
|
|
44
|
-
|
|
46
|
+
SKILLS_PACKAGE,
|
|
45
47
|
"add",
|
|
46
48
|
options.source
|
|
47
49
|
];
|
|
@@ -83,7 +85,7 @@ const skillsUpdateDetail = (output) => {
|
|
|
83
85
|
};
|
|
84
86
|
const skillsUpdateArgs = (options) => [
|
|
85
87
|
"-y",
|
|
86
|
-
|
|
88
|
+
SKILLS_PACKAGE,
|
|
87
89
|
"update",
|
|
88
90
|
options.global ? "-g" : "-p",
|
|
89
91
|
"-y"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "neon",
|
|
3
|
-
"version": "8.13.
|
|
3
|
+
"version": "8.13.2",
|
|
4
4
|
"description": "CLI tool for Neon, the cloud backend primitives built around Lakebase Postgres",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"neon",
|
|
@@ -72,9 +72,9 @@
|
|
|
72
72
|
"yaml": "^2.9.0",
|
|
73
73
|
"yargs": "17.7.2",
|
|
74
74
|
"yoctocolors": "^2.1.2",
|
|
75
|
+
"@neon/config": "1.9.5",
|
|
75
76
|
"@neon/config-runtime": "1.10.4",
|
|
76
77
|
"@neon/realtime": "0.1.2",
|
|
77
|
-
"@neon/config": "1.9.5",
|
|
78
78
|
"@neon/sdk": "7.6.0"
|
|
79
79
|
},
|
|
80
80
|
"optionalDependencies": {
|
|
@@ -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-BpP3Dqpe.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-BNm69Qh8.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-BNm69Qh8.js";
|
|
13
13
|
import { formatPulledEnv, pulledBranch } from "../commands/env_output.js";
|
|
14
14
|
import { existsSync } from "node:fs";
|
|
15
15
|
import chalk from "chalk";
|