Releases: dreamor/cloakbrowser-cli
Releases · dreamor/cloakbrowser-cli
v0.4.1
Security
- SafePath path validation — New
SafePathmodule prevents directory traversal attacks on file read/write operations. All file operations validate that resolved paths stay within allowed base directories. (S1) - Socket/permission hardening — Unix domain socket set to
0600and session directory to0700to prevent local privilege escalation. (S2) - Path validation enforcement — File read/write operations now enforce SafePath traversal checks before any I/O. (S3)
- Dialog timeout —
dialog.handle_nextadds a configurable timeout (default 30s) to prevent resource leaks from abandoned dialogs. (S4) - Parameterized evaluate —
oneShotScrapeand daemonevalmethod use parameterizedevaluateinstead of string concatenation, preventing JS injection via dynamic expressions. (S5)
CI
- NPM_TOKEN —
release.ymlnow usessecrets.NPM_TOKENfor npm publish authentication. - E2E build — E2E CI job now runs
npm run buildbefore tests (jobs don't share workspace). - Node 22 compatibility — Fixed JSON import in
cli.tsto usecreateRequirefor Node 22 ESM compatibility.
v0.4.0
Added
- Snapshot filters —
--compact(strips bbox/selector),--limit <n>(max elements),--viewport-only(elements in viewport),--filter <expr>(by role/tag/name),--uid <uid>(single element). All available on thecloak snapshotcommand. (O2) - Snapshot iframe support —
--framesflag includes elements from same-origin iframes in the snapshot result, with anoriginfield for disambiguation. (O4) cloak batchcommand — Execute multiple daemon RPCs from stdin JSON lines. Supports--session <sid>(default session) and--abort-on-error. Guards:CLOAK_BATCH_MAX_BYTES(1MB) andCLOAK_BATCH_MAX_LINES(200). (O1)wait --stable— New wait condition using MutationObserver to detect DOM stability. Configurable quiet period via--quiet-ms(default 500ms). Returns{ stable, mutations }. (O5)- Shared
SNAPSHOT_TAGGER_SCRIPT— In-page element tagger extracted toparams.ts, shared betweenpage.snapshotandmaybeSnapshotto eliminate code duplication. (R2)
Fixed
- Missing
stablein wait error message — Error prompt now listsstableas a valid wait condition. (O5 cleanup)
Changed
- Default RPC timeout —
DaemonClient.call()now defaults to 30s timeout instead of no timeout. Can be overridden per-call. (O3) - Code deduplication — Removed duplicate
optStr/reqStrdefinitions fromeval.tsandnetwork.ts; all daemon methods now import fromparams.ts. (R1)
v0.3.0
Added
- UID auto-resolution — Interaction commands (
click,fill,hover, etc.) now accept bare cloak UIDs (u7,u123). They are automatically resolved to[data-cloak-uid="..."]selectors, eliminating the need for manual selector concatenation. (F1) --outfor text and one-shot commands — The global--out <path>flag now works for all text outputs (content,text,html,markdown) and one-shot commands (fetch,scrape). When set, JSON is written to the specified file and a metadata envelope{path, size, sha256}is returned. (F2, F3)- Named sessions —
session new --name loginsaves the returned session ID under an alias. All daemon commands now accept@name(alias) or-(last-used session) instead of a raw session ID.session alias list/set/removecommands added for alias management. (P1-P7, P1-P8) - After-action snapshots — Navigation and interaction commands accept
--snapshotflag to return a compact DOM snapshot alongside the operation result, saving a round-trip. (P1-P9) - Shared parameter helpers —
src/daemon/methods/params.tsprovides sharedoptStr,reqStr,optNum,optBool, andresolveUidfunctions, replacing 8+ redundant copies across daemon method files. (F12)
Fixed
oneShotFetchnavigation failures — Whenpage.goto()throws (timeout, DNS failure, etc.), the function now returns a partial result withstatus: 'navigation-failed'instead of crashing with an unhandled exception. (F5)--versionfrompackage.json— CLI version is now read dynamically frompackage.jsoninstead of the hardcoded'0.1.1'insrc/cli.ts, preventing drift. (F4)
Changed
- Docs updated — SKILL.md and README.md updated with uid auto-resolution docs and
--outcoverage details.
v0.2.2
Fixed
- README docs staleness — Fixed Node.js version requirement (18.17+ → 20.0+) and RPC method count (62 → 56) in README. (Starting this release, npm shows the corrected README.)
- CONTRIBUTING.md docs staleness — Fixed Node.js version requirement (18.17+ → 20.0+) and error code count (18 → 19).
- SKILL.md docs staleness — Fixed RPC method count (60+ → 56), added
UNSUPPORTED_OPERATIONto error codes list, expandedcloak testreference.
Changed
- CI: softprops/action-gh-release — Updated from
v2(Node 20) tov3(Node 24) to avoid deprecation warning as of 2026-06-16.
v0.2.1
Fixed
- README docs staleness — Updated Node.js version requirement (18.17+ → 20.0+) and RPC method count (62 → 56) to match source code.
v0.2.0
Added
- Type shims for cloakbrowser v0.3.29+ —
buildLaunchOptions(),buildContextOptions(), andhumanizeBrowser()added to theCloakModuletype definition insrc/browser.ts. All three are optional for backward compatibility with older cloakbrowser versions.
Changed
- Proxy comment — Added documentation note in
src/options.tsconfirming that proxy credential routing (URL-encoded passwords, inline--proxy-serverbypass) is handled transparently by cloakbrowser >= 0.3.31.
v0.1.1
Fixed
- a11y crash —
cloak a11y <sid>threwCannot read properties of undefined (reading 'snapshot')whenpage.accessibilitywas unavailable. Now returns a clearUNSUPPORTED_OPERATIONerror with a hint to usecloak snapshotinstead. - page.new crash —
cloak page new <sid>threwPlease use browser.newContext()for sessions created without context-level options.getPageOrCreate()now always creates an explicitBrowserContextbefore creating pages, instead of falling through to the implicit default context viabrowser.newPage(). - --out flag ignored — The global
--out <path>flag was parsed but never forwarded to screenshot/pdf output handling.screenshotandpdfcommands now use--outas a fallback when--pathis not specified. - fingerprint subcommand —
cloak fingerprintdumped the full help text because no subcommand was registered. Added afingerprintcommand that lists all fingerprint options and usage examples.
Changed
- test command defaults —
cloak testnow usesdomcontentloaded(instead ofnetworkidle) as the default navigation wait strategy, and adds--wait-untiland--timeoutoptions. This avoids 30s timeouts on sites with persistent WebSocket connections. - New error code — Added
UNSUPPORTED_OPERATIONto the error code set for API features unavailable in the current browser/context.