"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.shouldRecordHostedDemoSessionAction = void 0;
const ACTION_METHODS = new Set(['POST', 'PUT', 'PATCH']);
/**
 * Returns true when the request should advance hosted demo session idle tracking.
 * Counts only mutating work: POST/PUT/PATCH to `/code/*`, `/search-components`, or `/design/*`.
 * Read-only traffic (config, health, tokens, etc.) does not extend the idle window.
 */
const shouldRecordHostedDemoSessionAction = (req) => {
    if (!ACTION_METHODS.has(req.method.toUpperCase())) {
        return false;
    }
    const requestPath = req.path;
    if (requestPath.startsWith('/code/')) {
        return true;
    }
    if (requestPath === '/search-components') {
        return true;
    }
    if (requestPath.startsWith('/design/')) {
        return true;
    }
    return false;
};
exports.shouldRecordHostedDemoSessionAction = shouldRecordHostedDemoSessionAction;
//# sourceMappingURL=shouldRecordHostedDemoSessionAction.js.map