/**
 * Per-tenant audit file paths under ~/.mcp-guardian/tenants/{tenantId}/
 */
import { existsSync, mkdirSync } from 'fs';
import { homedir } from 'os';
import { join } from 'path';
import { validateTenantId, DEFAULT_TENANT_ID } from '../tenant/resolve-tenant.js';
export function guardianHomeDir() {
    return process.env['MCP_GUARDIAN_HOME'] || join(homedir(), '.mcp-guardian');
}
export function resolveTenantAuditDir(tenantId) {
    const tid = validateTenantId(tenantId || process.env['GUARDIAN_TENANT_ID'] || DEFAULT_TENANT_ID);
    return join(guardianHomeDir(), 'tenants', tid);
}
export function ensureTenantAuditDir(tenantId) {
    const dir = resolveTenantAuditDir(tenantId);
    if (!existsSync(dir))
        mkdirSync(dir, { recursive: true });
    return dir;
}
export function resolveTenantPolicyAuditJsonl(tenantId) {
    return join(ensureTenantAuditDir(tenantId), 'policy-audit.jsonl');
}
export function resolveTenantAccessLogJsonl(tenantId) {
    return join(ensureTenantAuditDir(tenantId), 'dashboard-access.jsonl');
}
export function resolveTenantSessionAuditJsonl(tenantId) {
    return join(ensureTenantAuditDir(tenantId), 'session-audit.jsonl');
}
//# sourceMappingURL=tenant-audit-paths.js.map