tessl install tessl/npm-store@2.0.0A localStorage wrapper for all browsers without using cookies or flash, providing persistent client-side storage with automatic fallback and plugin architecture
Agent Success
Agent success rate when using this tile
75%
Improvement
Agent success rate improvement when using this tile compared to baseline
0.96x
Baseline
Agent success rate without this tile
78%
Build a shopping cart system that tracks and logs all changes to cart items using browser storage. The system should automatically monitor when items are added, updated, or removed from the cart and maintain a history of these changes.
Implement basic cart operations:
Implement automatic change tracking for all cart items:
Implement the following functions:
/**
* Adds or updates an item in the cart
* @param {string} itemId - Unique identifier for the item
* @param {Object} itemData - Item details including quantity
*/
function addToCart(itemId, itemData) {}
/**
* Removes an item from the cart
* @param {string} itemId - Unique identifier for the item
*/
function removeFromCart(itemId) {}
/**
* Clears all items from the cart
*/
function clearCart() {}
/**
* Gets the change history for cart items
* @returns {Array} Array of change records
*/
function getChangeHistory() {}@generates
Provides cross-browser local storage with change tracking capabilities.