Extract authenticated coulomb.social design language via designlang
Session probe lands on /vw_pages (Research). Use main designlang extract with --cookie-file — pack ignores auth. 39 artifacts under docs/design-extract; tolerate designlang late summary crash when cores exist.
This commit is contained in:
parent
319dd00465
commit
6fe263444a
71 changed files with 4939 additions and 797 deletions
|
|
@ -142,39 +142,33 @@ async function main() {
|
|||
const lsKeys = (state.origins || []).flatMap((o) =>
|
||||
(o.localStorage || []).map((e) => e.name),
|
||||
);
|
||||
// Bubble always sets coulomb_* session cookies for anonymous visitors.
|
||||
// A real login usually adds more localStorage keys and/or more cookies.
|
||||
const onlyDefaultBubbleCookies =
|
||||
cookieCount <= 3 &&
|
||||
(state.cookies || []).every((c) =>
|
||||
String(c.name || "").startsWith("coulomb_"),
|
||||
);
|
||||
const thinLocalStorage =
|
||||
lsKeys.length === 0 ||
|
||||
(lsKeys.length === 1 && lsKeys[0] === "algoliasearch-client-js");
|
||||
|
||||
if (onlyDefaultBubbleCookies && thinLocalStorage) {
|
||||
// Bubble often keeps the same coulomb_* cookie *names* for guests and
|
||||
// members — names alone are not a login signal. Probe the live page:
|
||||
// authenticated app usually leaves the bare landing path.
|
||||
let probeUrl = page.url();
|
||||
let probeTitle = await page.title().catch(() => "");
|
||||
const path = (() => {
|
||||
try {
|
||||
return new URL(probeUrl).pathname;
|
||||
} catch {
|
||||
return "";
|
||||
}
|
||||
})();
|
||||
const looksLikeLanding = path === "/" || path === "";
|
||||
|
||||
if (looksLikeLanding && !fromPasswordFiles) {
|
||||
console.error("");
|
||||
console.error(
|
||||
"WARNING: This looks like an anonymous Bubble session, not a logged-in user.",
|
||||
"WARNING: Still on the site root after capture — login may not have completed.",
|
||||
);
|
||||
console.error(` url: ${probeUrl}`);
|
||||
console.error(` title: ${probeTitle}`);
|
||||
console.error(
|
||||
` cookies=${cookieCount} (only default coulomb_* names)`,
|
||||
"Log in fully, open an app page (e.g. Research / Pages), then press Enter.",
|
||||
);
|
||||
console.error(` localStorage keys: ${lsKeys.join(", ") || "(none)"}`);
|
||||
console.error("");
|
||||
console.error("Do not use this for authenticated design extract.");
|
||||
console.error("Re-run, fully log in, wait until the app UI is loaded,");
|
||||
console.error("then press Enter. If login uses a popup, complete it first.");
|
||||
process.exitCode = 2;
|
||||
// Still write so you can inspect, but mark filename
|
||||
const weakPath = STATE_PATH.replace(/\.json$/, ".anonymous.json");
|
||||
writeFileSync(weakPath, JSON.stringify(state, null, 2) + "\n", {
|
||||
mode: 0o600,
|
||||
});
|
||||
chmodSync(weakPath, 0o600);
|
||||
console.error(`Wrote weak session for inspection only: ${weakPath}`);
|
||||
return;
|
||||
// Continue to save anyway — Bubble guest+member share cookie names; user
|
||||
// may still have a valid session that only reveals itself after navigation.
|
||||
}
|
||||
|
||||
writeFileSync(STATE_PATH, JSON.stringify(state, null, 2) + "\n", {
|
||||
|
|
@ -186,6 +180,7 @@ async function main() {
|
|||
console.log(
|
||||
`Saved storageState (${cookieCount} cookies, ${originCount} origins, localStorage keys: ${lsKeys.length}).`,
|
||||
);
|
||||
console.log(` page at save: ${probeUrl} — ${probeTitle}`);
|
||||
console.log(`File: ${STATE_PATH}`);
|
||||
console.log("Next: ./scripts/run-design-extract.sh");
|
||||
} finally {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue