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/cli.js
CHANGED
|
@@ -63,7 +63,7 @@ var __export = (target, all) => {
|
|
|
63
63
|
var CASCADE_VERSION, CASCADE_CONFIG_FILE, CASCADE_DB_FILE, CASCADE_DASHBOARD_SECRET_FILE, GLOBAL_CONFIG_DIR, GLOBAL_DB_FILE, GLOBAL_KEYSTORE_FILE, GLOBAL_CREDENTIALS_FILE, GLOBAL_RUNTIME_DB_FILE, DEFAULT_DASHBOARD_PORT, DEFAULT_CONTEXT_LIMIT, DEFAULT_AUTO_SUMMARIZE_AT, MODELS, T1_MODEL_PRIORITY, T2_MODEL_PRIORITY, T3_MODEL_PRIORITY, VISION_MODEL_PRIORITY, COMPLEXITY_T2_COUNT, THEME_NAMES, DEFAULT_THEME, OLLAMA_BASE_URL, LM_STUDIO_BASE_URL, AZURE_BASE_URL_TEMPLATE, TOOL_NAMES, DEFAULT_APPROVAL_REQUIRED;
|
|
64
64
|
var init_constants = __esm({
|
|
65
65
|
"src/constants.ts"() {
|
|
66
|
-
CASCADE_VERSION = "0.48.
|
|
66
|
+
CASCADE_VERSION = "0.48.1";
|
|
67
67
|
CASCADE_CONFIG_FILE = ".cascade/config.json";
|
|
68
68
|
CASCADE_DB_FILE = ".cascade/memory.db";
|
|
69
69
|
CASCADE_DASHBOARD_SECRET_FILE = ".cascade/dashboard-secret";
|
|
@@ -14616,12 +14616,19 @@ var CloudClient = class _CloudClient {
|
|
|
14616
14616
|
);
|
|
14617
14617
|
await openUrl(authorizeUrl);
|
|
14618
14618
|
const code = await listener.waitForCode;
|
|
14619
|
-
|
|
14620
|
-
|
|
14621
|
-
|
|
14622
|
-
|
|
14623
|
-
|
|
14624
|
-
|
|
14619
|
+
let res;
|
|
14620
|
+
try {
|
|
14621
|
+
res = await fetch(this.url("/api/native/token"), {
|
|
14622
|
+
method: "POST",
|
|
14623
|
+
headers: { "Content-Type": "application/json" },
|
|
14624
|
+
body: JSON.stringify({ code, code_verifier: verifier })
|
|
14625
|
+
});
|
|
14626
|
+
} catch (err) {
|
|
14627
|
+
throw new Error(
|
|
14628
|
+
`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)})`
|
|
14629
|
+
);
|
|
14630
|
+
}
|
|
14631
|
+
if (!res.ok) throw new Error(await loginFailureMessage(res, this.serverUrl));
|
|
14625
14632
|
const tokens = await res.json();
|
|
14626
14633
|
return await this.finishLogin(tokens);
|
|
14627
14634
|
} finally {
|
|
@@ -14795,6 +14802,22 @@ function sleep(ms, signal) {
|
|
|
14795
14802
|
}, { once: true });
|
|
14796
14803
|
});
|
|
14797
14804
|
}
|
|
14805
|
+
async function loginFailureMessage(res, serverUrl) {
|
|
14806
|
+
const body = await res.text().catch(() => "");
|
|
14807
|
+
let apiError = "";
|
|
14808
|
+
try {
|
|
14809
|
+
apiError = String(JSON.parse(body).error ?? "");
|
|
14810
|
+
} catch {
|
|
14811
|
+
}
|
|
14812
|
+
if (apiError === "invalid_grant") {
|
|
14813
|
+
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.";
|
|
14814
|
+
}
|
|
14815
|
+
if (apiError) return `Sign-in failed: ${apiError} (HTTP ${res.status}).`;
|
|
14816
|
+
if (res.status === 404 || /<html/i.test(body)) {
|
|
14817
|
+
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.`;
|
|
14818
|
+
}
|
|
14819
|
+
return `Sign-in could not be completed (HTTP ${res.status}). Please try again.`;
|
|
14820
|
+
}
|
|
14798
14821
|
function base64url(buf) {
|
|
14799
14822
|
return buf.toString("base64").replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
14800
14823
|
}
|