feat(storage): add sessionstorage-{list,get,set,delete,clear} commands#4
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sessionstorage-list,sessionstorage-get,sessionstorage-set,sessionstorage-delete,sessionstorage-clear— the same shape as the existinglocalstorage-*commands, but targetingsessionStorage.src/commands.tsparameterized by area name. The publiccmdLocalStorage*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— replacelsScript/cmdLocalStorage*withstorageScriptandstorage{List,Get,Set,Delete,Clear}helpers; addcmdSessionStorage*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,--jsonshapes, 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/bowserproduces a working binary../dist/bowser --helplists all ten storage commands../dist/bowser sessionstorage-getprintsusage: 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