Skip to content

feat(storage): add sessionstorage-{list,get,set,delete,clear} commands#4

Merged
drakulavich merged 1 commit into
mainfrom
feat/sessionstorage
May 14, 2026
Merged

feat(storage): add sessionstorage-{list,get,set,delete,clear} commands#4
drakulavich merged 1 commit into
mainfrom
feat/sessionstorage

Conversation

@drakulavich
Copy link
Copy Markdown
Owner

Summary

  • Adds sessionstorage-list, sessionstorage-get, sessionstorage-set, sessionstorage-delete, sessionstorage-clear — the same shape as the existing localstorage-* commands, but targeting sessionStorage.
  • Refactors the two areas to share a single storage helper in src/commands.ts parameterized by area name. The public cmdLocalStorage* exports are preserved as thin wrappers, so no other call site or test changes.

This picks up the topmost remaining roadmap subitem under "Storage commands" (next after #3).

Changes

  • src/commands.ts — replace lsScript/cmdLocalStorage* with storageScript and storage{List,Get,Set,Delete,Clear} helpers; add cmdSessionStorage* wrappers. Error-wrapping now reports 'sessionStorage: ...' for that area (matches existing 'localStorage: ...' for the other).
  • src/cli.ts, src/cli/schemas.ts — register the five new commands; help text updated.
  • tests/commands.test.ts — 12 new sessionstorage tests mirroring the localstorage cases (k=v rendering, --json shapes, JSON-escaping of injected key/value, usage errors).
  • tests/compat.test.ts — 5 new parse-table rows.
  • README.md, CHANGELOG.md, skills/bowser/SKILL.md — document the new commands; roadmap entry checked off.

Test plan

  • bun test — 111 pass, 0 fail (was 94 before this PR; +17 new tests).
  • bun build src/cli.ts --compile --outfile dist/bowser produces a working binary.
  • ./dist/bowser --help lists all ten storage commands.
  • ./dist/bowser sessionstorage-get prints usage: bowser sessionstorage-get <key> and exits 1.
  • BOWSER_E2E=1 bun test — not required for this change; no e2e tests touched, but worth running in CI.

Roadmap after this

  • cookie-* (needs CDP for HttpOnly cookies)
  • state-save / state-load (storage state JSON dump/restore)

🤖 Generated with Claude Code

Mirror the localstorage-* surface against sessionStorage. Internally,
the two areas now share a single storage helper in src/commands.ts
parameterized by the area name; the existing cmdLocalStorage* exports
remain as thin wrappers so the public API and test signatures are
unchanged.

- src/commands.ts: replace lsScript/cmdLocalStorage* with storageScript
  and storage{List,Get,Set,Delete,Clear} helpers; add cmdSessionStorage*
  wrappers.
- src/cli.ts, src/cli/schemas.ts: register sessionstorage-* commands.
- tests/commands.test.ts: 12 new sessionstorage tests mirroring the
  localstorage cases (key=value rendering, --json shapes, JSON-escaping
  of injected key/value, usage errors).
- tests/compat.test.ts: 5 new parse-table rows.
- README, CHANGELOG, skills/bowser/SKILL.md: document the new commands;
  mark sessionstorage-* checked in the roadmap.

Verified: bun test (111 pass, +17 from the previous 94 baseline),
bun build --compile produces a working binary, and ./dist/bowser
--help lists all ten storage commands.
@drakulavich drakulavich merged commit add8278 into main May 14, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant