matthewwong525/WongStack / .agents/plugins/browser
browser
VerifiedThe person's own browser, for errands.
| File | Kind | Size |
|---|---|---|
| README.md | markdown | 4.4 KB |
| SKILL.md | skill md | 3.6 KB |
| VERSION | other | 6 B |
| addon/background.js | script | 1.1 KB |
| addon/check.svg | other | 591 B |
| addon/manifest.json | config | 462 B |
| references/browser-proxy.md | markdown | 5.2 KB |
| references/browser-window.md | markdown | 6.4 KB |
| references/browsing.md | markdown | 18.6 KB |
| references/login-codes.md | markdown | 5.6 KB |
| references/password-manager.md | markdown | 8.3 KB |
| references/setup.md | markdown | 6.4 KB |
| scripts/addons.mjs | script | 26.3 KB |
| scripts/browse.mjs | script | 53.5 KB |
| scripts/browser-server.mjs | script | 50.8 KB |
| scripts/connect-browser.mjs | script | 17.3 KB |
| scripts/forwarder.mjs | script | 14.5 KB |
| scripts/launch-config.py | script | 7.4 KB |
| scripts/lib/cli.mjs | script | 1.2 KB |
| scripts/lib/env.mjs | script | 614 B |
| scripts/lib/primary-root.mjsexecutable | script | 1.9 KB |
| scripts/lib/profile.mjs | script | 1.4 KB |
| scripts/login-move.mjs | script | 4.0 KB |
| scripts/mask-keys.mjs | script | 2.9 KB |
| scripts/proxy-lines.mjs | script | 4.7 KB |
| scripts/refs.mjs | script | 5.4 KB |
scripts/mask-keys.mjs
View on GitHub// Hides keys in a page reading before the chat sees it: wiki/stack/connect-your-tools.md
// Over-masking is safe; a key that slips through lands in memory, so the rules lean wide.
/** Runs that start the way a service's keys start. */
const PREFIX = /^(?:[srp]k_(?:live|test)_|[srp]k_|sk-|ntn_|secret_|figd_|gh[pousr]_|github_pat_|xox[abposr]-|glpat-|shpat_|shpss_|AKIA|ya29\.|re_)/;
/** A run of key characters long enough to be one. */
const RUN = /[A-Za-z0-9][A-Za-z0-9_.-]{19,}/g;
/** A snapshot line for a text box and the value typed or shown in it. */
const BOX = /^(\s*- (?:textbox|searchbox|combobox)\b.*?): (.+)$/gm;
/** A page whose address, title or headings are about keys. */
const KEY_PAGE = /key|token|secret|api|developer|integration/i;
const HEADING = /^\s*- heading "([^"]*)"/gm;
/** On a key page, a long hex run or a UUID, which a mix of cases can not tell from an id. */
const PLAIN_KEY = /(?<![A-Za-z0-9])(?:[0-9a-f]{32,}|[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12})(?![A-Za-z0-9])/gi;
/** Shannon entropy in bits per character. */
function entropy(text) {
const counts = new Map();
for (const char of text) counts.set(char, (counts.get(char) ?? 0) + 1);
return [...counts.values()].reduce((sum, count) => sum - (count / text.length) * Math.log2(count / text.length), 0);
}
/** A run that reads as a key: a known prefix, or upper case, lower case and digits mixed at random. */
export const looksLikeKey = (run) => PREFIX.test(run) ||
(/[A-Z]/.test(run) && /[a-z]/.test(run) && /\d/.test(run) && entropy(run) >= 3.5);
/** A run that starts the way a service's secret keys start; a publishable `pk_` key shows in full and is never one. */
export const knownKey = (run) => PREFIX.test(run) && !run.startsWith('pk_');
export const masked = (value) => `[key …${value.slice(-4)}]`;
/** Whether the page's address, title or a heading is about keys. */
const keyPage = (text, url, title) => KEY_PAGE.test([url, title, ...[...text.matchAll(HEADING)].map(([, heading]) => heading)].join(' '));
/** Every key the text shows, longest first. On a key page, every text box value over 20 characters, and every long
* hex run or UUID anywhere, counts too. */
export function findKeys(text, { url = '', title = '' } = {}) {
const keys = new Set((text.match(RUN) ?? []).filter(looksLikeKey));
if (keyPage(text, url, title)) {
for (const [, , value] of text.matchAll(BOX)) if (value.trim().length > 20) keys.add(value.trim());
for (const [value] of text.matchAll(PLAIN_KEY)) keys.add(value);
}
// Longest first, so a key inside a longer one is not half-replaced.
return [...keys].sort((a, b) => b.length - a.length);
}
/** The page text with every key hidden as `[key …abcd]`, and how many different keys it hid. */
export function maskKeys(text, page = {}) {
const keys = findKeys(text, page);
return { text: keys.reduce((out, key) => out.split(key).join(masked(key)), text), found: keys.length };
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |