[Feature] Implement Session Mode UI for "Fund Once, Ask Many" interactions #67
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem Description
Currently, each interaction with the Timmy Tower Workshop may require individual payment or a complex payment flow, leading to friction for users who wish to engage in multiple interactions. To enhance user experience and streamline the interaction process, a "Session Mode" is proposed.
Session Mode will allow users to fund a session once and then engage in multiple interactions without repeated payment prompts, embodying a "Fund Once, Ask Many" pattern.
Reproduction Steps (Current Behavior)
Expected Behavior
Users should be able to:
Technical Details
replit/timmy-towerthe-matrix/js/session.js: This frontend file contains the existing implementation for Session Mode, includinginitSessionPanel(),isSessionActive(), andsessionSendHandler(text). It handles panel buttons, amount presets, deposit/topup invoice creation, polling for session activation/topup, session restore from localStorage, and HUD/input-bar state updates.artifacts/api-server/src/routes/sessions.ts: This backend file provides the REST API for session-funded Workshop interactions, including endpoints for creating sessions, fetching session state, executing requests against funded sessions, and topping up. It handles invoice creation, session authentication, pre-gating with free-tier service, and balance reconciliation.Proposed Solution
Implement and integrate the Session Mode UI elements and logic in the frontend (
the-matrix/js/session.js) to provide a seamless user experience for funding and managing interaction sessions. This includes:sessionSendHandlerto route input-bar sends toPOST /api/sessions/:id/requestwhen a session is active.Labels
feature,frontend,backend,ux,payment,session