neon 8.11.0 → 8.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/_chunks/api-GbEaBZJ5.js +388 -0
- package/dist/_chunks/api_keys-CNnnugbQ.js +281 -0
- package/dist/_chunks/ask-DVwy0eUL.js +155 -0
- package/dist/_chunks/auth-CIUtXByB.js +495 -0
- package/dist/_chunks/bootstrap-wPZWa1sT.js +499 -0
- package/dist/_chunks/branches-BNa1xX1L.js +460 -0
- package/dist/_chunks/bucket-BCdryTkD.js +409 -0
- package/dist/_chunks/checkout-CXIOydqZ.js +348 -0
- package/dist/_chunks/claim-DqAvAvDm.js +473 -0
- package/dist/_chunks/config-BH_qRHiG.js +1113 -0
- package/dist/_chunks/connection_string-DB4awPzZ.js +154 -0
- package/dist/_chunks/credentials-BSjE9fRR.js +146 -0
- package/dist/_chunks/data_api-Djxj5ZQD.js +263 -0
- package/dist/_chunks/databases-Dok4wru7.js +84 -0
- package/dist/_chunks/deploy-D7B0Xfjg.js +33 -0
- package/dist/_chunks/dev-CSvxAecE.js +945 -0
- package/dist/_chunks/diff-DhxxbdQE.js +178 -0
- package/dist/_chunks/docs-CrVybkTP.js +197 -0
- package/dist/_chunks/env-5HS5qQGd.js +284 -0
- package/dist/_chunks/feedback-CMayyTa8.js +88 -0
- package/dist/_chunks/functions-Q0zuvtnk.js +464 -0
- package/dist/_chunks/git-H32TNt6M.js +356 -0
- package/dist/_chunks/init-BkA6RilG.js +111 -0
- package/dist/_chunks/inspect-g0wekylj.js +90 -0
- package/dist/_chunks/ip_allow-5lLFvIuE.js +106 -0
- package/dist/_chunks/link-BgtkOBws.js +936 -0
- package/dist/_chunks/logs-DWkpjzIH.js +291 -0
- package/dist/_chunks/mcp-Bo-7TKc7.js +253 -0
- package/dist/_chunks/neon_auth-CBs1_3qu.js +822 -0
- package/dist/_chunks/open-CX3BT3Tp.js +33 -0
- package/dist/_chunks/operations-D4I-AxVs.js +37 -0
- package/dist/_chunks/orgs-xGfANwHQ.js +52 -0
- package/dist/_chunks/plugins-DqD7BDO1.js +169 -0
- package/dist/_chunks/profile-yXOiKk9R.js +672 -0
- package/dist/_chunks/projects-BwI2Uo0z.js +439 -0
- package/dist/_chunks/psql-BM-doe8e.js +64 -0
- package/dist/_chunks/realtime-BRqIyGR-.js +79 -0
- package/dist/_chunks/roles-B4w3YT_7.js +79 -0
- package/dist/_chunks/set_context-DbrwoImy.js +38 -0
- package/dist/_chunks/skills-DyiBXKS3.js +255 -0
- package/dist/_chunks/snapshots-RJBzW8GM.js +338 -0
- package/dist/_chunks/status-DV8Z2kw3.js +44 -0
- package/dist/_chunks/triggers-BrRo1z4b.js +302 -0
- package/dist/_chunks/user-dlOGXbX9.js +60 -0
- package/dist/_chunks/vpc_endpoints-CNb0YfMo.js +105 -0
- package/dist/auth_recovery.js +1 -1
- package/dist/commands/api.js +1 -388
- package/dist/commands/api_keys.js +1 -281
- package/dist/commands/ask.js +1 -155
- package/dist/commands/auth.js +1 -495
- package/dist/commands/bootstrap.js +1 -499
- package/dist/commands/branches.js +1 -460
- package/dist/commands/bucket.js +1 -409
- package/dist/commands/checkout.js +1 -348
- package/dist/commands/claim.js +1 -473
- package/dist/commands/config.js +1 -1113
- package/dist/commands/connection_string.js +1 -154
- package/dist/commands/credentials.js +1 -146
- package/dist/commands/data_api.js +1 -263
- package/dist/commands/databases.js +1 -84
- package/dist/commands/deploy.js +1 -33
- package/dist/commands/dev.js +1 -945
- package/dist/commands/diff.js +1 -178
- package/dist/commands/docs.js +1 -197
- package/dist/commands/env.js +1 -284
- package/dist/commands/feedback.js +1 -88
- package/dist/commands/functions.js +1 -464
- package/dist/commands/functions_new.js +6 -6
- package/dist/commands/git.js +1 -356
- package/dist/commands/index.js +45 -45
- package/dist/commands/init.js +1 -111
- package/dist/commands/inspect.js +1 -90
- package/dist/commands/ip_allow.js +1 -106
- package/dist/commands/link.js +1 -936
- package/dist/commands/logs.js +1 -291
- package/dist/commands/mcp.js +1 -253
- package/dist/commands/neon_auth.js +1 -822
- package/dist/commands/open.js +1 -33
- package/dist/commands/operations.js +1 -37
- package/dist/commands/orgs.js +1 -52
- package/dist/commands/plugins.js +1 -169
- package/dist/commands/profile.js +1 -672
- package/dist/commands/projects.js +1 -439
- package/dist/commands/psql.js +1 -64
- package/dist/commands/realtime.js +1 -79
- package/dist/commands/roles.js +1 -79
- package/dist/commands/set_context.js +1 -38
- package/dist/commands/skills.js +1 -255
- package/dist/commands/snapshots.js +1 -338
- package/dist/commands/status.js +1 -44
- package/dist/commands/subscribe.js +1 -1
- package/dist/commands/triggers.js +1 -302
- package/dist/commands/user.js +1 -60
- package/dist/commands/vpc_endpoints.js +1 -105
- package/dist/functions/registry.js +29 -151
- package/dist/functions/source.js +42 -2
- package/dist/index.js +1 -1
- package/dist/init/auth.js +3 -3
- package/dist/init/link.js +2 -2
- package/dist/init/run.js +3 -3
- package/dist/init/tooling.js +3 -3
- package/dist/mcp/mint.js +1 -1
- package/dist/test_utils/registry.js +1 -2
- package/dist/utils/package_manager.js +1 -0
- package/package.json +4 -2
|
@@ -1,174 +1,52 @@
|
|
|
1
|
-
import { FUNCTION_SLUG_PATTERN } from "../utils/function_slug.js";
|
|
2
1
|
//#region src/functions/registry.ts
|
|
3
2
|
const MAX_PATH_LENGTH = 255;
|
|
4
|
-
const MAX_INDEX_ENTRIES = 500;
|
|
5
|
-
const MAX_OPERATIONS = 40;
|
|
6
|
-
const MAX_LOGO_URL_LENGTH = 2048;
|
|
7
3
|
const MAX_FILE_BYTES = 262144;
|
|
8
4
|
const MAX_TOTAL_BYTES = 2097152;
|
|
9
5
|
const MAX_JSON_BYTES = 1048576;
|
|
10
|
-
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
11
|
-
const isText = (value) => typeof value === "string" && value.trim() !== "";
|
|
12
|
-
const matches = (value, pattern) => typeof value === "string" && pattern.test(value);
|
|
13
|
-
const isOptionalString = (value) => value === void 0 || typeof value === "string";
|
|
14
|
-
const TEMPLATE_ID = /^[a-z0-9][a-z0-9-]*$/;
|
|
15
|
-
const OPERATION_ID = /^[a-z0-9][a-z0-9-]*$/;
|
|
16
|
-
const OPERATION_SLUG = FUNCTION_SLUG_PATTERN;
|
|
17
|
-
const ENV_NAME = /^[A-Z_][A-Z0-9_]*$/;
|
|
18
|
-
const SINGLE_LINE = /^[^\r\n]*$/;
|
|
19
6
|
const WINDOWS_ABSOLUTE = /^[A-Za-z]:/;
|
|
20
|
-
const SOURCE_EXTENSION = /\.ts$/;
|
|
21
|
-
const ROUTE_PATTERN = /^\/[A-Za-z0-9\-._~/]*$/;
|
|
22
|
-
const EXACT_DEPENDENCY = /^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*@\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/;
|
|
23
|
-
const TEMPLATE_LAYOUTS = ["router", "separate"];
|
|
24
|
-
const REGISTRY_CONTRACT = {
|
|
25
|
-
layouts: TEMPLATE_LAYOUTS,
|
|
26
|
-
requiredTemplateFields: [
|
|
27
|
-
"id",
|
|
28
|
-
"title",
|
|
29
|
-
"description",
|
|
30
|
-
"layout"
|
|
31
|
-
],
|
|
32
|
-
requiredOperationFields: [
|
|
33
|
-
"id",
|
|
34
|
-
"title",
|
|
35
|
-
"description",
|
|
36
|
-
"source",
|
|
37
|
-
"recommended"
|
|
38
|
-
],
|
|
39
|
-
templateId: TEMPLATE_ID,
|
|
40
|
-
operationId: OPERATION_ID,
|
|
41
|
-
operationSlug: OPERATION_SLUG,
|
|
42
|
-
envName: ENV_NAME,
|
|
43
|
-
envDescription: SINGLE_LINE,
|
|
44
|
-
source: SOURCE_EXTENSION,
|
|
45
|
-
route: ROUTE_PATTERN,
|
|
46
|
-
dependency: EXACT_DEPENDENCY,
|
|
47
|
-
maxOperations: MAX_OPERATIONS,
|
|
48
|
-
maxIndexEntries: MAX_INDEX_ENTRIES,
|
|
49
|
-
maxFileBytes: MAX_FILE_BYTES,
|
|
50
|
-
maxJsonBytes: MAX_JSON_BYTES
|
|
51
|
-
};
|
|
52
7
|
const isContainedRelativePath = (value) => value !== "" && value.length <= MAX_PATH_LENGTH && !value.includes("\0") && !value.includes("\\") && !value.startsWith("/") && !WINDOWS_ABSOLUTE.test(value) && !value.split("/").some((part) => part === "" || part === "." || part === "..");
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
return new URL(value).protocol === "https:";
|
|
57
|
-
};
|
|
58
|
-
const stringList = (value) => {
|
|
59
|
-
if (!Array.isArray(value) || !value.every((item) => typeof item === "string")) return;
|
|
60
|
-
return value;
|
|
61
|
-
};
|
|
62
|
-
const parseEnvironment = (value) => {
|
|
63
|
-
if (!Array.isArray(value)) return void 0;
|
|
64
|
-
const result = [];
|
|
65
|
-
for (const item of value) {
|
|
66
|
-
if (!isRecord(item) || typeof item.name !== "string" || typeof item.description !== "string" || !ENV_NAME.test(item.name) || !SINGLE_LINE.test(item.description)) return;
|
|
67
|
-
result.push({
|
|
68
|
-
name: item.name,
|
|
69
|
-
description: item.description
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
return result;
|
|
73
|
-
};
|
|
74
|
-
const parseTemplateOperations = (value, layout) => {
|
|
75
|
-
if (!Array.isArray(value) || value.length === 0) return void 0;
|
|
76
|
-
if (value.length > MAX_OPERATIONS) return void 0;
|
|
77
|
-
const operations = [];
|
|
78
|
-
const ids = /* @__PURE__ */ new Set();
|
|
79
|
-
const routes = /* @__PURE__ */ new Set();
|
|
80
|
-
const slugs = /* @__PURE__ */ new Set();
|
|
81
|
-
const sources = /* @__PURE__ */ new Set();
|
|
82
|
-
let recommended = 0;
|
|
83
|
-
for (const item of value) {
|
|
84
|
-
if (!isRecord(item) || !matches(item.id, OPERATION_ID) || ids.has(item.id) || !isText(item.title) || !isText(item.description) || typeof item.source !== "string" || !isSafeSourcePath(item.source) || sources.has(item.source) || !isOptionalString(item.route) || typeof item.recommended !== "boolean") return;
|
|
85
|
-
const operation = {
|
|
86
|
-
id: item.id,
|
|
87
|
-
title: item.title,
|
|
88
|
-
description: item.description,
|
|
89
|
-
source: item.source,
|
|
90
|
-
recommended: item.recommended
|
|
91
|
-
};
|
|
92
|
-
if (layout === "separate") {
|
|
93
|
-
if (typeof item.slug !== "string" || !OPERATION_SLUG.test(item.slug) || slugs.has(item.slug)) return;
|
|
94
|
-
slugs.add(item.slug);
|
|
95
|
-
operation.slug = item.slug;
|
|
96
|
-
} else {
|
|
97
|
-
const route = item.route === void 0 ? `/${item.id}` : item.route;
|
|
98
|
-
if (!ROUTE_PATTERN.test(route) || routes.has(route)) return;
|
|
99
|
-
routes.add(route);
|
|
100
|
-
operation.route = route;
|
|
101
|
-
}
|
|
102
|
-
if (item.recommended) recommended++;
|
|
103
|
-
ids.add(item.id);
|
|
104
|
-
sources.add(item.source);
|
|
105
|
-
operations.push(operation);
|
|
106
|
-
}
|
|
107
|
-
if (recommended < 1) return void 0;
|
|
108
|
-
return operations;
|
|
109
|
-
};
|
|
8
|
+
function assertValid(validate, data, label) {
|
|
9
|
+
if (!validate.check(data)) throw new Error(`${label}: ${validate.errorsText()}`);
|
|
10
|
+
}
|
|
110
11
|
const recommendedOperations = (operations) => operations.filter((operation) => operation.recommended);
|
|
111
12
|
const resolveOperationById = (operations, id) => {
|
|
112
13
|
const operation = operations.find((candidate) => candidate.id === id);
|
|
113
14
|
if (!operation) throw new Error(`Unknown operation "${id}". Available operations: ${operations.map((candidate) => candidate.id).join(", ")}.`);
|
|
114
15
|
return operation;
|
|
115
16
|
};
|
|
116
|
-
const
|
|
17
|
+
const parseRegistryIndex = (text, validate) => {
|
|
117
18
|
const data = JSON.parse(text);
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
19
|
+
assertValid(validate, data, "Invalid function registry");
|
|
20
|
+
const seen = /* @__PURE__ */ new Set();
|
|
21
|
+
return data.templates.map((item, index) => {
|
|
22
|
+
const at = `templates[${index}] ("${item.id}")`;
|
|
23
|
+
if (seen.has(item.id)) throw new Error(`Invalid function registry: ${at} repeats an id.`);
|
|
24
|
+
if (!isContainedRelativePath(item.path)) throw new Error(`Invalid function registry: ${at} has a missing or unsafe path.`);
|
|
25
|
+
seen.add(item.id);
|
|
26
|
+
return item;
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
const parseTemplateItem = (text, validate, expectedId) => {
|
|
30
|
+
const data = JSON.parse(text);
|
|
31
|
+
assertValid(validate, data, "Invalid template.json");
|
|
32
|
+
if (expectedId !== void 0 && data.id !== expectedId) throw new Error("Invalid template.json: bad or mismatched id.");
|
|
33
|
+
const operations = data.operations?.map((operation) => {
|
|
34
|
+
if (!isContainedRelativePath(operation.source)) throw new Error(`Invalid template.json for "${data.id}": malformed operations.`);
|
|
35
|
+
return data.layout === "separate" ? operation : {
|
|
36
|
+
...operation,
|
|
37
|
+
route: operation.route ?? `/${operation.id}`
|
|
38
|
+
};
|
|
39
|
+
});
|
|
133
40
|
return {
|
|
134
41
|
id: data.id,
|
|
135
42
|
...data.provider ? { provider: data.provider } : {},
|
|
136
43
|
title: data.title,
|
|
137
44
|
description: data.description,
|
|
138
|
-
layout,
|
|
139
|
-
dependencies,
|
|
140
|
-
environment,
|
|
45
|
+
layout: data.layout,
|
|
46
|
+
dependencies: data.dependencies ?? [],
|
|
47
|
+
environment: data.environment ?? [],
|
|
141
48
|
...operations ? { operations } : {}
|
|
142
49
|
};
|
|
143
50
|
};
|
|
144
|
-
const parseRegistryIndex = (text) => {
|
|
145
|
-
const data = JSON.parse(text);
|
|
146
|
-
const items = isRecord(data) ? data.templates : void 0;
|
|
147
|
-
if (!Array.isArray(items)) throw new Error("Invalid function registry: missing \"templates\" array.");
|
|
148
|
-
if (items.length > MAX_INDEX_ENTRIES) throw new Error(`Invalid function registry: ${items.length} templates, more than the ${MAX_INDEX_ENTRIES} the CLI reads.`);
|
|
149
|
-
const entries = [];
|
|
150
|
-
const seen = /* @__PURE__ */ new Set();
|
|
151
|
-
for (const [index, item] of items.entries()) {
|
|
152
|
-
const at = `templates[${index}]${isRecord(item) && typeof item.id === "string" ? ` ("${item.id}")` : ""}`;
|
|
153
|
-
const invalid = (reason) => /* @__PURE__ */ new Error(`Invalid function registry: ${at} ${reason}.`);
|
|
154
|
-
if (!isRecord(item)) throw invalid("is not an object");
|
|
155
|
-
if (!matches(item.id, TEMPLATE_ID)) throw invalid("has a bad id");
|
|
156
|
-
if (seen.has(item.id)) throw invalid("repeats an id");
|
|
157
|
-
if (!isText(item.title) || !isText(item.description)) throw invalid("is missing a title or description");
|
|
158
|
-
if (!isOptionalString(item.provider)) throw invalid("has a provider that is not a string");
|
|
159
|
-
if (typeof item.path !== "string" || !isContainedRelativePath(item.path)) throw invalid("has a missing or unsafe path");
|
|
160
|
-
if (item.logo !== void 0 && (typeof item.logo !== "string" || !isDisplayLogoUrl(item.logo))) throw invalid("has a logo that is not an https:// URL");
|
|
161
|
-
seen.add(item.id);
|
|
162
|
-
entries.push({
|
|
163
|
-
id: item.id,
|
|
164
|
-
...item.provider ? { provider: item.provider } : {},
|
|
165
|
-
title: item.title,
|
|
166
|
-
description: item.description,
|
|
167
|
-
path: item.path,
|
|
168
|
-
...item.logo ? { logo: item.logo } : {}
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
return entries;
|
|
172
|
-
};
|
|
173
51
|
//#endregion
|
|
174
|
-
export { MAX_FILE_BYTES, MAX_JSON_BYTES, MAX_TOTAL_BYTES,
|
|
52
|
+
export { MAX_FILE_BYTES, MAX_JSON_BYTES, MAX_TOTAL_BYTES, isContainedRelativePath, parseRegistryIndex, parseTemplateItem, recommendedOperations, resolveOperationById };
|
package/dist/functions/source.js
CHANGED
|
@@ -78,6 +78,45 @@ const urlReader = (index) => {
|
|
|
78
78
|
};
|
|
79
79
|
const templateSourcePaths = (template) => template.operations?.map((operation) => operation.source) ?? ["functions/index.ts"];
|
|
80
80
|
const INDEX_FILE = "registry.json";
|
|
81
|
+
const REGISTRY_SCHEMA_FILE = "schemas/registry.schema.json";
|
|
82
|
+
const TEMPLATE_SCHEMA_FILE = "schemas/template.schema.json";
|
|
83
|
+
let publishedSchemas;
|
|
84
|
+
const compileSchemas = async (registrySchema, templateSchema) => {
|
|
85
|
+
const [{ default: Ajv2020 }, { default: addFormats }] = await Promise.all([import("ajv/dist/2020.js"), import("ajv-formats")]);
|
|
86
|
+
const ajv = new Ajv2020({
|
|
87
|
+
allErrors: true,
|
|
88
|
+
strict: false
|
|
89
|
+
});
|
|
90
|
+
addFormats(ajv);
|
|
91
|
+
const wrap = (schema) => {
|
|
92
|
+
const check = ajv.compile(schema);
|
|
93
|
+
return {
|
|
94
|
+
check: (data) => check(data),
|
|
95
|
+
errorsText: () => ajv.errorsText(check.errors)
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
return {
|
|
99
|
+
registry: wrap(registrySchema),
|
|
100
|
+
template: wrap(templateSchema)
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
const readPublishedSchemas = async (index) => {
|
|
104
|
+
const read = urlReader(new URL(index));
|
|
105
|
+
const registrySchema = JSON.parse(await read(REGISTRY_SCHEMA_FILE, MAX_JSON_BYTES));
|
|
106
|
+
const templateSchema = JSON.parse(await read(TEMPLATE_SCHEMA_FILE, MAX_JSON_BYTES));
|
|
107
|
+
if (typeof registrySchema !== "object" || registrySchema === null || typeof templateSchema !== "object" || templateSchema === null) throw new RegistryError("Published Function Registry schemas were not JSON objects.");
|
|
108
|
+
return compileSchemas(registrySchema, templateSchema);
|
|
109
|
+
};
|
|
110
|
+
const loadPublishedSchemas = () => {
|
|
111
|
+
publishedSchemas ??= readPublishedSchemas(DEFAULT_REGISTRY_URL).catch(async (error) => {
|
|
112
|
+
if (!(error instanceof RegistryError)) throw error;
|
|
113
|
+
return readPublishedSchemas(GITHUB_REGISTRY_URL);
|
|
114
|
+
}).catch((error) => {
|
|
115
|
+
publishedSchemas = void 0;
|
|
116
|
+
throw error;
|
|
117
|
+
});
|
|
118
|
+
return publishedSchemas;
|
|
119
|
+
};
|
|
81
120
|
const openRegistry = async (source, { primary = DEFAULT_REGISTRY_URL, fallback = GITHUB_REGISTRY_URL, env = process.env } = {}) => {
|
|
82
121
|
if (source) return openRegistryAt(source);
|
|
83
122
|
const resolved = resolveRegistrySource(env, process.cwd(), primary);
|
|
@@ -106,6 +145,7 @@ const openRegistryAt = async (source, files = source) => {
|
|
|
106
145
|
const read = readerFor(source);
|
|
107
146
|
const readFile = files === source ? read : withStaleIndexHint(readerFor(files), source, files);
|
|
108
147
|
const indexPath = source.kind === "dir" ? INDEX_FILE : posix.basename(source.url.pathname);
|
|
148
|
+
const schemas = await loadPublishedSchemas();
|
|
109
149
|
const parse = (path, text, fn) => {
|
|
110
150
|
try {
|
|
111
151
|
return fn(text);
|
|
@@ -113,10 +153,10 @@ const openRegistryAt = async (source, files = source) => {
|
|
|
113
153
|
throw new RegistryError(`Invalid registry file ${path}: ${error instanceof Error ? error.message : String(error)}`);
|
|
114
154
|
}
|
|
115
155
|
};
|
|
116
|
-
const entries = parse(indexPath, await read(indexPath, MAX_JSON_BYTES), parseRegistryIndex);
|
|
156
|
+
const entries = parse(indexPath, await read(indexPath, MAX_JSON_BYTES), (text) => parseRegistryIndex(text, schemas.registry));
|
|
117
157
|
const load = async (entry) => {
|
|
118
158
|
if (!entry.path || !isContainedRelativePath(entry.path)) throw new RegistryError(`Template "${entry.id}" has no valid path.`);
|
|
119
|
-
const template = parse(entry.path, await readFile(entry.path, MAX_JSON_BYTES), (text) => parseTemplateItem(text, entry.id));
|
|
159
|
+
const template = parse(entry.path, await readFile(entry.path, MAX_JSON_BYTES), (text) => parseTemplateItem(text, schemas.template, entry.id));
|
|
120
160
|
const dir = posix.dirname(entry.path);
|
|
121
161
|
const sources = /* @__PURE__ */ new Map();
|
|
122
162
|
let total = 0;
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { NETWORK_ERROR_MESSAGE, isNetworkError, matchErrorCode } from "./errors.
|
|
|
9
9
|
import { analyticsMiddleware, closeAnalytics, initAnalyticsClientMiddleware, sendError, takeCommandSuccessExtras, trackCommandSuccess } from "./analytics.js";
|
|
10
10
|
import { AuthRefreshError, defaultClientID } from "./auth.js";
|
|
11
11
|
import { getCliName } from "./utils/cli_name.js";
|
|
12
|
-
import { ensureAuth } from "./
|
|
12
|
+
import { c as ensureAuth } from "./_chunks/auth-CIUtXByB.js";
|
|
13
13
|
import { recoverFrom401 } from "./auth_recovery.js";
|
|
14
14
|
import { UsageError, failOnUsageError, isBareParentCommand, showHelp, showUsageErrorHelp } from "./help.js";
|
|
15
15
|
import { lazyCommands, preloadCommand } from "./commands/manifest.js";
|
package/dist/init/auth.js
CHANGED
|
@@ -2,10 +2,10 @@ import { isNeonApiError } from "../api.js";
|
|
|
2
2
|
import { r as defaultDir } from "../_chunks/paths-DMq0Lt7a.js";
|
|
3
3
|
import "../config.js";
|
|
4
4
|
import "../auth.js";
|
|
5
|
-
import { ensureAuth } from "../
|
|
5
|
+
import { c as ensureAuth } from "../_chunks/auth-CIUtXByB.js";
|
|
6
6
|
import { recoverFrom401 } from "../auth_recovery.js";
|
|
7
|
-
import { pull } from "../
|
|
8
|
-
import { setupNeonMcp } from "../
|
|
7
|
+
import { c as pull } from "../_chunks/env-5HS5qQGd.js";
|
|
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;
|
|
11
11
|
const authenticationFailed = () => /* @__PURE__ */ new Error("Authentication failed.");
|
package/dist/init/link.js
CHANGED
|
@@ -2,9 +2,9 @@ import { isNeonApiError } from "../api.js";
|
|
|
2
2
|
import { r as defaultDir } from "../_chunks/paths-DMq0Lt7a.js";
|
|
3
3
|
import "../config.js";
|
|
4
4
|
import "../auth.js";
|
|
5
|
-
import { ensureAuth } from "../
|
|
5
|
+
import { c as ensureAuth } from "../_chunks/auth-CIUtXByB.js";
|
|
6
6
|
import { recoverFrom401 } from "../auth_recovery.js";
|
|
7
|
-
import { runLink } from "../
|
|
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
|
@@ -17,15 +17,15 @@ import { FALLBACK_SKILLS_AGENTS, assertNamedAgentTooling, funnelAgentSetup, plan
|
|
|
17
17
|
import { inferPackageManager, resolvePackageManager } from "../utils/package_manager.js";
|
|
18
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";
|
|
19
19
|
import { agentsRowValue, configRowValue, formatInitDone, headingForKind, printInitBanner, printInitDone, printInitProgress, projectRowValue, shouldPrintInitBanner } from "./chrome.js";
|
|
20
|
-
import {
|
|
21
|
-
import { quoteFlagValue, runLink } from "../
|
|
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
27
|
import { runToolingSteps } from "./tooling.js";
|
|
28
|
-
import { create } from "../
|
|
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
31
|
import { createInitFunnel, emitInitStart, finishInitFunnel, initStartProperties } from "./funnel.js";
|
package/dist/init/tooling.js
CHANGED
|
@@ -5,9 +5,9 @@ import { MCP_OAUTH_FALLBACK, PROGRESS } from "./copy.js";
|
|
|
5
5
|
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
|
-
import { mcpInstallError, reportMcpInstall } from "../
|
|
9
|
-
import { installPlugins, pluginsInstallError
|
|
10
|
-
import { installSkills, reportSkillsInstall
|
|
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-DqD7BDO1.js";
|
|
10
|
+
import { c as skillsInstallError, o as installSkills, s as reportSkillsInstall } from "../_chunks/skills-DyiBXKS3.js";
|
|
11
11
|
import { runAuthenticatedMcp } from "./auth.js";
|
|
12
12
|
import { raceSigint } from "./cancelled.js";
|
|
13
13
|
import { pickAgentSetupInteractively } from "./wizard.js";
|
package/dist/mcp/mint.js
CHANGED
|
@@ -2,7 +2,7 @@ import { log } from "../log.js";
|
|
|
2
2
|
import { isNeonApiError } from "../api.js";
|
|
3
3
|
import { getCliName } from "../utils/cli_name.js";
|
|
4
4
|
import { mintedKeyName } from "../profile_keys.js";
|
|
5
|
-
import { orgIdForProject } from "../
|
|
5
|
+
import { s as orgIdForProject } from "../_chunks/api_keys-CNnnugbQ.js";
|
|
6
6
|
//#region src/mcp/mint.ts
|
|
7
7
|
var CannotMintApiKeyError = class extends Error {
|
|
8
8
|
constructor() {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { fileURLToPath } from "node:url";
|
|
2
2
|
//#region src/test_utils/registry.ts
|
|
3
|
-
const REGISTRY_SCHEMAS_DIR = fileURLToPath(new URL("../functions/schemas", import.meta.url));
|
|
4
3
|
const FIXTURE_REGISTRY_DIR = fileURLToPath(new URL("../../tests/function-registry", import.meta.url));
|
|
5
4
|
//#endregion
|
|
6
|
-
export { FIXTURE_REGISTRY_DIR
|
|
5
|
+
export { FIXTURE_REGISTRY_DIR };
|
|
@@ -189,6 +189,7 @@ const recommendedCliUpgradeCommand = (modulePath) => {
|
|
|
189
189
|
const installArgs = (pm, packages, options) => packages?.length ? [
|
|
190
190
|
pm === "npm" ? "install" : "add",
|
|
191
191
|
...options?.dev ? ["-D"] : [],
|
|
192
|
+
...options?.exact ? ["-E"] : [],
|
|
192
193
|
...packages
|
|
193
194
|
] : ["install"];
|
|
194
195
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "neon",
|
|
3
|
-
"version": "8.11.
|
|
3
|
+
"version": "8.11.2",
|
|
4
4
|
"description": "CLI tool for Neon, the cloud backend primitives built around Lakebase Postgres",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"neon",
|
|
@@ -47,6 +47,8 @@
|
|
|
47
47
|
"@hono/node-server": "2.0.4",
|
|
48
48
|
"@segment/analytics-node": "1.3.0",
|
|
49
49
|
"add-mcp": "2.0.0",
|
|
50
|
+
"ajv": "^8.20.0",
|
|
51
|
+
"ajv-formats": "^3.0.1",
|
|
50
52
|
"chalk": "5.3.0",
|
|
51
53
|
"chokidar": "5.0.0",
|
|
52
54
|
"cliui": "8.0.1",
|
|
@@ -71,8 +73,8 @@
|
|
|
71
73
|
"yargs": "17.7.2",
|
|
72
74
|
"yoctocolors": "^2.1.2",
|
|
73
75
|
"@neon/config-runtime": "1.10.2",
|
|
74
|
-
"@neon/realtime": "0.1.2",
|
|
75
76
|
"@neon/config": "1.9.3",
|
|
77
|
+
"@neon/realtime": "0.1.2",
|
|
76
78
|
"@neon/sdk": "7.4.0"
|
|
77
79
|
},
|
|
78
80
|
"optionalDependencies": {
|