cascade-ai 0.48.0 → 0.48.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/README.md +3 -3
- package/dist/cli.cjs +30 -7
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +30 -7
- package/dist/cli.js.map +1 -1
- package/dist/desktop-core.cjs +30 -7
- package/dist/index.cjs +30 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +30 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -193,7 +193,7 @@ var init_audit_logger = __esm({
|
|
|
193
193
|
});
|
|
194
194
|
|
|
195
195
|
// src/constants.ts
|
|
196
|
-
var CASCADE_VERSION = "0.48.
|
|
196
|
+
var CASCADE_VERSION = "0.48.1";
|
|
197
197
|
var CASCADE_CONFIG_DIR = ".cascade";
|
|
198
198
|
var CASCADE_MD_FILE = "CASCADE.md";
|
|
199
199
|
var CASCADE_IGNORE_FILE = ".cascadeignore";
|
|
@@ -15938,12 +15938,19 @@ var CloudClient = class _CloudClient {
|
|
|
15938
15938
|
);
|
|
15939
15939
|
await openUrl(authorizeUrl);
|
|
15940
15940
|
const code = await listener.waitForCode;
|
|
15941
|
-
|
|
15942
|
-
|
|
15943
|
-
|
|
15944
|
-
|
|
15945
|
-
|
|
15946
|
-
|
|
15941
|
+
let res;
|
|
15942
|
+
try {
|
|
15943
|
+
res = await fetch(this.url("/api/native/token"), {
|
|
15944
|
+
method: "POST",
|
|
15945
|
+
headers: { "Content-Type": "application/json" },
|
|
15946
|
+
body: JSON.stringify({ code, code_verifier: verifier })
|
|
15947
|
+
});
|
|
15948
|
+
} catch (err) {
|
|
15949
|
+
throw new Error(
|
|
15950
|
+
`Signed in, but could not reach Cascade at ${this.serverUrl} to finish. Check your connection and that the server URL is correct. (${err instanceof Error ? err.message : String(err)})`
|
|
15951
|
+
);
|
|
15952
|
+
}
|
|
15953
|
+
if (!res.ok) throw new Error(await loginFailureMessage(res, this.serverUrl));
|
|
15947
15954
|
const tokens = await res.json();
|
|
15948
15955
|
return await this.finishLogin(tokens);
|
|
15949
15956
|
} finally {
|
|
@@ -16117,6 +16124,22 @@ function sleep(ms, signal) {
|
|
|
16117
16124
|
}, { once: true });
|
|
16118
16125
|
});
|
|
16119
16126
|
}
|
|
16127
|
+
async function loginFailureMessage(res, serverUrl) {
|
|
16128
|
+
const body = await res.text().catch(() => "");
|
|
16129
|
+
let apiError = "";
|
|
16130
|
+
try {
|
|
16131
|
+
apiError = String(JSON.parse(body).error ?? "");
|
|
16132
|
+
} catch {
|
|
16133
|
+
}
|
|
16134
|
+
if (apiError === "invalid_grant") {
|
|
16135
|
+
return "Sign-in expired before it completed \u2014 the code is single-use and short-lived, and restarting the server during sign-in also invalidates it. Please try again.";
|
|
16136
|
+
}
|
|
16137
|
+
if (apiError) return `Sign-in failed: ${apiError} (HTTP ${res.status}).`;
|
|
16138
|
+
if (res.status === 404 || /<html/i.test(body)) {
|
|
16139
|
+
return `Signed in, but ${serverUrl} did not answer the Cascade API (HTTP ${res.status}). If this host was recently pointed at a new server, DNS may still be propagating.`;
|
|
16140
|
+
}
|
|
16141
|
+
return `Sign-in could not be completed (HTTP ${res.status}). Please try again.`;
|
|
16142
|
+
}
|
|
16120
16143
|
function base64url(buf) {
|
|
16121
16144
|
return buf.toString("base64").replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
16122
16145
|
}
|