@curviate/cli 0.31.0 → 0.31.1

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/CHANGELOG.md CHANGED
@@ -6,6 +6,28 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
6
6
  Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html):
7
7
  a new command or flag is a minor; a breaking command/flag/exit-code change is a major; a fix is a patch.
8
8
 
9
+ ## [0.31.1] - 2026-09-10
10
+
11
+ ### Fixed
12
+
13
+ - `doctor` reported an unreachable API as `api reachable: PASS` and blamed the
14
+ credential instead, at exit `1`. Reachability was decided from the SDK error's
15
+ **code**, on the premise that a transport failure carries no code; the transport
16
+ wraps every fetch rejection as `INTERNAL`, so the premise was false and the check
17
+ was wrong in both directions: a 503 that came back over a working connection was
18
+ reported unreachable.
19
+
20
+ Reachability now follows `httpStatus`, which is what records that a response came
21
+ back at all. **Exit codes move for these cases, in the direction the documented
22
+ contract always claimed:** an unreachable API now exits `7` rather than `1`, and a
23
+ request the client refuses to build before sending (an empty `--api-key`, a
24
+ malformed base URL) keeps its own exit code rather than being reported as a
25
+ network fault.
26
+
27
+ - `doctor` no longer reports `credential valid: rejected: INTERNAL` when no response
28
+ came back. Nothing asked the credential anything; it now says the check was not
29
+ made, and why.
30
+
9
31
  ## [0.31.0] - 2026-09-09
10
32
 
11
33
  Follows the SDK to `0.30.0` and catches the CLI up to the server-side tier
package/dist/cli.js CHANGED
@@ -348,7 +348,7 @@ var main = defineCommand({
348
348
  // the handler implementation is loaded lazily on first invocation.
349
349
  subCommands: {
350
350
  setup: () => import("./setup-YV5PVIU5.js").then((m) => m.setupCommand),
351
- doctor: () => import("./doctor-7TEE36NY.js").then((m) => m.doctorCommand),
351
+ doctor: () => import("./doctor-KSLZNAKH.js").then((m) => m.doctorCommand),
352
352
  login: () => import("./login-3OAUY7TG.js").then((m) => m.loginCommand),
353
353
  config: () => import("./config-FUHT23SX.js").then((m) => m.configCommand),
354
354
  // ---------------------------------------------------------------------------
@@ -104,18 +104,24 @@ async function runDoctor(args, io) {
104
104
  } catch (err) {
105
105
  const error = err;
106
106
  const code = typeof error.code === "string" ? error.code : void 0;
107
- reachable = code !== void 0 && code !== "PLATFORM_ERROR";
107
+ const responded = typeof error.httpStatus === "number";
108
+ const transportFault = !responded && error.retryLikelyToSucceed === true;
109
+ const codeExit = code ? getExitCode(code) : 3;
110
+ reachable = responded;
108
111
  checks.push({
109
112
  name: "api reachable",
110
113
  ok: reachable,
111
- detail: reachable ? effective.baseUrl : `could not reach ${effective.baseUrl}: ${error.message ?? "network error"}`,
112
- exit: 7
114
+ detail: reachable ? effective.baseUrl : transportFault ? `could not reach ${effective.baseUrl}: ${error.message ?? "network error"}` : "not checked: the request was refused before it was sent",
115
+ exit: transportFault ? 7 : codeExit
113
116
  });
114
117
  checks.push({
115
118
  name: "credential valid",
116
119
  ok: false,
117
- detail: code ? `rejected: ${code}` : error.message ?? "the call did not succeed",
118
- exit: code ? getExitCode(code) : 3
120
+ // Nothing asked the credential anything unless a response came back,
121
+ // so it was not "rejected". Saying it was is the half of this defect
122
+ // that actually misdirects: it names the one subsystem that is fine.
123
+ detail: responded ? code ? `rejected: ${code}` : error.message ?? "the call did not succeed" : transportFault ? `not checked: ${effective.baseUrl} could not be reached` : error.message ?? "the request was refused before it was sent",
124
+ exit: responded ? codeExit : transportFault ? 3 : codeExit
119
125
  });
120
126
  }
121
127
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curviate/cli",
3
- "version": "0.31.0",
3
+ "version": "0.31.1",
4
4
  "private": false,
5
5
  "description": "Official command-line interface for the Curviate API.",
6
6
  "license": "MIT",