neonctl 2.33.1 → 2.33.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.
@@ -10,8 +10,8 @@ import { log } from "../log.js";
10
10
  * - **Free plan** — credentials provision, but the gateway does not *serve* model requests.
11
11
  * The account needs to upgrade to a paid plan.
12
12
  * - **Reduced model set** — on a paid plan, an account still ramping up on the beta gets a
13
- * trimmed model catalog (flagship models are missing from `/v1/models`). They can request
14
- * access to more models.
13
+ * trimmed model catalog (flagship models are listed but `enabled: false` on `/v1/models`).
14
+ * They can request access to more models.
15
15
  *
16
16
  * This is deliberately phrased for the user: it never mentions account "verification" or any
17
17
  * other internal gating mechanism.
@@ -39,11 +39,11 @@ export const aiGatewayModelsUrl = (projectId, branchId) => `https://console.neon
39
39
  export const isFreePlan = (subscriptionType) => subscriptionType !== undefined &&
40
40
  FREE_SUBSCRIPTION_TYPES.has(subscriptionType);
41
41
  /**
42
- * Whether a model catalog includes at least one flagship model. Flagship models (Anthropic
43
- * Opus, OpenAI Codex / `*-pro`) are the first to be held back for an account still ramping
44
- * up on the beta, so their total absence from a non-empty catalog is the signal that the
45
- * account has a reduced model set. Matched by id substring so it survives model version
46
- * bumps (e.g. `claude-opus-4-8`).
42
+ * Whether the model catalog includes at least one flagship model enabled. Flagship models
43
+ * (Anthropic Opus, OpenAI Codex / `*-pro`) are the first to be held back for an account still
44
+ * ramping up on the beta, so their total absence from a non-empty enabled set is the signal
45
+ * that the account has a reduced model set. Matched by id substring so it survives model
46
+ * version bumps (e.g. `claude-opus-4-8`).
47
47
  */
48
48
  export const hasFlagshipModels = (modelIds) => modelIds.some((id) => id.includes("opus") || id.includes("codex") || id.endsWith("-pro"));
49
49
  /**
@@ -86,20 +86,27 @@ export const buildAiGatewayNotice = ({ subscriptionType, modelIds, upgradeUrl, m
86
86
  return null;
87
87
  };
88
88
  const isRecord = (value) => typeof value === "object" && value !== null;
89
- /** Pull the string `id`s out of an OpenAI-compatible `{ object: "list", data: [...] }` body. */
90
- const extractModelIds = (body) => {
89
+ /**
90
+ * Pull the `id`s of enabled models out of an OpenAI-compatible
91
+ * `{ object: "list", data: [{ id, enabled, ... }] }` body. The gateway lists every model in
92
+ * the catalog but marks ones the account can't serve yet with `enabled: false`; only the
93
+ * enabled set is used to detect a reduced catalog.
94
+ */
95
+ export const extractEnabledModelIds = (body) => {
91
96
  if (!isRecord(body) || !Array.isArray(body.data))
92
97
  return null;
93
98
  const ids = [];
94
99
  for (const entry of body.data) {
95
- if (isRecord(entry) && typeof entry.id === "string") {
100
+ if (isRecord(entry) &&
101
+ typeof entry.id === "string" &&
102
+ entry.enabled === true) {
96
103
  ids.push(entry.id);
97
104
  }
98
105
  }
99
106
  return ids;
100
107
  };
101
108
  /**
102
- * `GET {baseUrl}/v1/models` → the served model ids, or `null` if the catalog can't be read
109
+ * `GET {baseUrl}/v1/models` → the enabled model ids, or `null` if the catalog can't be read
103
110
  * (network / HTTP / parse failure). Returning `null` keeps the notice silent rather than
104
111
  * risking a false "reduced models" warning. `/v1/models` is served only on the unified
105
112
  * dialect (the `/openai/v1` Responses dialect returns 404).
@@ -111,7 +118,7 @@ export const fetchGatewayModelIds = async (baseUrl, token) => {
111
118
  });
112
119
  if (!res.ok)
113
120
  return null;
114
- return extractModelIds(await res.json());
121
+ return extractEnabledModelIds(await res.json());
115
122
  }
116
123
  catch {
117
124
  return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neonctl",
3
- "version": "2.33.1",
3
+ "version": "2.33.2",
4
4
  "description": "CLI tool for Neon Serverless Postgres",
5
5
  "keywords": [
6
6
  "neon",
@@ -51,10 +51,10 @@
51
51
  "which": "3.0.1",
52
52
  "yaml": "^2.9.0",
53
53
  "yargs": "17.7.2",
54
- "@neon/sdk": "1.1.1",
55
- "@neon/config-runtime": "0.9.4",
54
+ "@neon/config": "0.9.4",
56
55
  "@neon/env": "0.11.3",
57
- "@neon/config": "0.9.4"
56
+ "@neon/config-runtime": "0.9.4",
57
+ "@neon/sdk": "1.1.1"
58
58
  },
59
59
  "optionalDependencies": {
60
60
  "esbuild": "0.28.1"