['Free', '#f3f4f6', '#374151'],
'plus' => ['Plus', '#ddd6fe', '#5b21b6'],
'pro' => ['Pro Familie', '#bfdbfe', '#1e40af'],
'caveau' => ['CaveauAI', '#d1fae5', '#065f46'],
];
$tierLabel = $tierLabels[$dashTier] ?? $tierLabels['free'];
$showSurveyCta = $dashIsSso && empty($dashDetail['survey_completed_at']);
// User display name
$dashAuthUser = dbnToolsAuthenticatedUser();
$dashEmail = '';
if ($dashAuthUser !== null) {
$e = (string)($dashAuthUser['email'] ?? '');
$dashEmail = strstr($e, '@', true) ?: $e;
}
$dashProfile = $dashIsSso ? dbnToolsMainUserProfile($dashUserId) : null;
$dashProfileNeedsPrompt = dbnToolsProfileNeedsPrompt($dashProfile);
$dashProfileValue = static function (string $key) use ($dashProfile): string {
return (string)($dashProfile[$key] ?? '');
};
$dashSeatLimit = match ($dashTier) {
'pro' => 3,
default => 1,
};
$dashTeamLabel = $dashSeatLimit > 1 ? '1 / ' . $dashSeatLimit . ' seats in use' : 'Single-user workspace';
// Next refill / billing date
$dashNextBilling = '';
$dashNextBillingKey = 'next_refill';
if ($dashIsSso && $dashDetail) {
if (!empty($dashDetail['subscription_period_end'])) {
$ts = strtotime((string)$dashDetail['subscription_period_end']);
$dashNextBilling = $ts ? date('j M Y', $ts) : '';
$dashNextBillingKey = 'next_billing';
} else {
$m = (int)date('m'); $y = (int)date('Y');
if ($m === 12) { $m = 1; $y++; } else { $m++; }
$dashNextBilling = date('j M Y', mktime(0, 0, 0, $m, 1, $y));
}
}
// Tool emoji icons
$toolEmoji = [
'transcribe' => '🎙️',
'timeline' => '📅',
'redact' => '🔒',
'summarize' => '📝',
'legal-analysis'=> '🏛️',
'korrespond' => '✉️',
'barnevernet' => '🔍',
'advocate' => '⚖️',
'deep-research' => '🔬',
'discrepancy' => '🔎',
'corpus' => '📚',
'citations' => '🔗',
'translate' => '🌐',
];
// Tool → MCP slug
$toolMcpSlugs = [
'transcribe' => 'dbn.transcribe_audio',
'timeline' => 'dbn.timeline',
'redact' => 'dbn.redact',
'korrespond' => 'dbn.korrespond',
'barnevernet' => 'dbn.barnevernet_analyze',
'advocate' => 'dbn.advocate_brief',
'deep-research' => 'dbn.deep_research',
'discrepancy' => 'dbn.discrepancy_find',
'corpus' => 'dbn.list_documents',
'citations' => 'dbn.citation_graph',
];
// Tool → [about, guide, tech] doc page links
$toolDocLinks = [
'advocate' => ['/advocate-about.php', '/advocate-guide.php', '/advocate-tech.php'],
'timeline' => ['/timeline-about.php', '/timeline-guide.php', '/timeline-tech.php'],
'korrespond' => ['/korrespond-about.php', '/korrespond-guide.php', '/korrespond-tech.php'],
];
// Localized strings for new sections
$dashL = [
'en' => [
'acct_header' => 'Account',
'signed_in_as' => 'Signed in as',
'manage_plan' => 'Manage plan',
'upgrade_plan' => 'Upgrade plan',
'top_up' => 'Top up credits',
'next_refill' => 'Credits refill',
'next_billing' => 'Next billing',
'monthly_quota' => 'monthly quota',
'trial_badge' => 'Trial — %d days left',
'about_link' => 'About',
'mcp_copy_slug' => 'Copy MCP slug',
'mcp_section' => 'Developers & MCP',
'mcp_desc' => 'Connect Claude Desktop, Claude Code, Cursor, or any MCP-compatible client to the full tool suite.',
'mcp_token_lbl' => 'API token',
'mcp_no_token' => 'No active token',
'mcp_copy' => 'Copy',
'mcp_not_avail' => 'MCP tokens require Plus or Pro — upgrade to connect AI clients.',
'mcp_stdio_lbl' => 'Claude Desktop / Claude Code (stdio)',
'mcp_remote_lbl' => 'Remote HTTP — Cursor, Zed, Windsurf',
'mcp_full_docs' => 'Full setup guide & token management →',
'tool_ref_title' => 'Tool reference',
'tool_ref_sub' => 'Deep-dive docs for the three flagship tools.',
'guide_link' => 'Guide',
'tech_link' => 'Technical',
'open_tool' => 'Open tool',
'tool_info' => 'Tool info',
],
'no' => [
'acct_header' => 'Konto',
'signed_in_as' => 'Innlogget som',
'manage_plan' => 'Administrer plan',
'upgrade_plan' => 'Oppgrader plan',
'top_up' => 'Kjøp kreditter',
'next_refill' => 'Kreditter fornyes',
'next_billing' => 'Neste fakturering',
'monthly_quota' => 'månedlig kvote',
'trial_badge' => 'Prøveperiode — %d dager igjen',
'about_link' => 'Om',
'mcp_copy_slug' => 'Kopier MCP-slug',
'mcp_section' => 'Utviklere & MCP',
'mcp_desc' => 'Koble Claude Desktop, Claude Code, Cursor eller annen MCP-klient til hele verktøysuiten.',
'mcp_token_lbl' => 'API-token',
'mcp_no_token' => 'Ingen aktiv token',
'mcp_copy' => 'Kopier',
'mcp_not_avail' => 'MCP-tokens krever Plus eller Pro — oppgrader for å koble til AI-klienter.',
'mcp_stdio_lbl' => 'Claude Desktop / Claude Code (stdio)',
'mcp_remote_lbl' => 'Ekstern HTTP — Cursor, Zed, Windsurf',
'mcp_full_docs' => 'Full oppsettsguide & token-administrasjon →',
'tool_ref_title' => 'Verktøyreferanse',
'tool_ref_sub' => 'Dybdedokumentasjon for de tre flaggskipverktøyene.',
'guide_link' => 'Guide',
'tech_link' => 'Teknisk',
'open_tool' => 'Åpne verktøy',
'tool_info' => 'Verktøyinfo',
],
'uk' => [
'acct_header' => 'Обліковий запис',
'signed_in_as' => 'Ввійшли як',
'manage_plan' => 'Управляти планом',
'upgrade_plan' => 'Покращити план',
'top_up' => 'Поповнити кредити',
'next_refill' => 'Кредити поновлюються',
'next_billing' => 'Наступне списання',
'monthly_quota' => 'місячна квота',
'trial_badge' => 'Пробний — %d дн. залишилось',
'about_link' => 'Про',
'mcp_copy_slug' => 'Копіювати MCP-ідентифікатор',
'mcp_section' => 'Розробники & MCP',
'mcp_desc' => 'Підключайте Claude Desktop, Claude Code, Cursor або будь-який MCP-клієнт до повного набору інструментів.',
'mcp_token_lbl' => 'API-токен',
'mcp_no_token' => 'Немає активного токена',
'mcp_copy' => 'Копіювати',
'mcp_not_avail' => 'MCP-токени потребують Plus або Pro — оновіться для підключення AI-клієнтів.',
'mcp_stdio_lbl' => 'Claude Desktop / Claude Code (stdio)',
'mcp_remote_lbl' => 'Віддалений HTTP — Cursor, Zed, Windsurf',
'mcp_full_docs' => 'Повна документація та управління токенами →',
'tool_ref_title' => 'Довідник інструментів',
'tool_ref_sub' => 'Детальна документація трьох флагманських інструментів.',
'guide_link' => 'Посібник',
'tech_link' => 'Технічний',
'open_tool' => 'Відкрити',
'tool_info' => 'Про інструмент',
],
'pl' => [
'acct_header' => 'Konto',
'signed_in_as' => 'Zalogowany jako',
'manage_plan' => 'Zarządzaj planem',
'upgrade_plan' => 'Ulepsz plan',
'top_up' => 'Doładuj kredyty',
'next_refill' => 'Kredyty odnawiają się',
'next_billing' => 'Następne rozliczenie',
'monthly_quota' => 'miesięczny limit',
'trial_badge' => 'Próba — %d dni pozostało',
'about_link' => 'O narzędziu',
'mcp_copy_slug' => 'Kopiuj identyfikator MCP',
'mcp_section' => 'Deweloperzy & MCP',
'mcp_desc' => 'Podłącz Claude Desktop, Claude Code, Cursor lub dowolnego klienta MCP do pełnego zestawu narzędzi.',
'mcp_token_lbl' => 'Token API',
'mcp_no_token' => 'Brak aktywnego tokenu',
'mcp_copy' => 'Kopiuj',
'mcp_not_avail' => 'Tokeny MCP wymagają Plus lub Pro — zaktualizuj, aby połączyć klientów AI.',
'mcp_stdio_lbl' => 'Claude Desktop / Claude Code (stdio)',
'mcp_remote_lbl' => 'Zdalny HTTP — Cursor, Zed, Windsurf',
'mcp_full_docs' => 'Pełna dokumentacja i zarządzanie tokenami →',
'tool_ref_title' => 'Dokumentacja narzędzi',
'tool_ref_sub' => 'Szczegółowa dokumentacja trzech flagowych narzędzi.',
'guide_link' => 'Poradnik',
'tech_link' => 'Techniczny',
'open_tool' => 'Otwórz',
'tool_info' => 'Info',
],
];
$dl = $dashL[$uiLang] ?? $dashL['en'];
require_once __DIR__ . '/includes/tool-svgs.php';
$langSuffix = $uiLang !== 'en' ? '?lang=' . urlencode($uiLang) : '';
?>
= htmlspecialchars(dbnToolsT('dashboard_title', $uiLang)) ?> — Do Better Norge
= htmlspecialchars($tierLabel[0]) ?>
= htmlspecialchars(sprintf($dl['trial_badge'], (int)$dashDetail['trial_days_remaining'])) ?>
= number_format($eff) ?> = $uiLang === 'no' ? 'kred.' : 'credits' ?>
= (int)$dashDetail['balance'] ?> = $uiLang === 'no' ? 'månedlige' : 'monthly' ?> · = (int)$dashDetail['bonus_balance'] ?> = $uiLang === 'no' ? 'forhåndsbetalt' : 'prepaid' ?>
= htmlspecialchars($dl[$dashNextBillingKey]) ?>: = htmlspecialchars($dashNextBilling) ?>
·
= htmlspecialchars($dl['signed_in_as']) ?>: = htmlspecialchars($dashEmail) ?>
= htmlspecialchars(dbnToolsT('credits_available', $uiLang)) ?>
= number_format($eff, 0, ',', ' ') ?>
= (int)$dashDetail['balance'] ?> = htmlspecialchars(dbnToolsT('credits_monthly', $uiLang)) ?> · = (int)$dashDetail['bonus_balance'] ?> = $uiLang === 'no' ? 'forhåndsbetalte' : 'prepaid' ?> · = htmlspecialchars(dbnToolsT('details_link', $uiLang)) ?>
= htmlspecialchars(dbnToolsT('my_case', $uiLang)) ?>
= htmlspecialchars(dbnToolsT('build_your_case', $uiLang)) ?> →
0 ? round($used / 1048576, 1) : 0;
$quotaMb = $quota > 0 ? round($quota / 1048576, 0) : 0;
?>
= $usedMb ?> MB / = $quotaMb ?> MB
= htmlspecialchars(dbnToolsT('build_your_case', $uiLang)) ?>
= htmlspecialchars(dbnToolsT('upload_documents', $uiLang)) ?> →
= htmlspecialchars(dbnToolsT('upgrade_from_plus', $uiLang)) ?>
= htmlspecialchars(dbnToolsT('my_corpus', $uiLang)) ?>
—
= htmlspecialchars(dbnToolsT('open_corpus', $uiLang)) ?> →
= htmlspecialchars(dbnToolsT('earn_credits_eyebrow', $uiLang)) ?>
= htmlspecialchars(dbnToolsT('survey_btn', $uiLang)) ?> →
= htmlspecialchars(dbnToolsT('survey_cta_text', $uiLang)) ?>
= htmlspecialchars(dbnToolsT('disclaimer', $uiLang)) ?>
⚙️
= htmlspecialchars($dl['mcp_section']) ?>
— = htmlspecialchars($dl['mcp_desc']) ?>
▼
= htmlspecialchars($dl['mcp_stdio_lbl']) ?>
claude mcp add dobetternorge -- npx -y @bluenotelogic/mcp dobetternorge-mcp --stdio
# Set token (add to ~/.bashrc or ~/.zshrc to persist):
export DBN_MCP_TOKEN=dbn_user_mcp_…
= htmlspecialchars($dl['mcp_copy']) ?>
= htmlspecialchars($dl['mcp_remote_lbl']) ?>
URL: https://mcp.dobetternorge.no/mcp
Authorization: Bearer dbn_user_mcp_…
= htmlspecialchars($dl['mcp_copy']) ?>
= htmlspecialchars($dl['mcp_full_docs']) ?>
💡
Start with the Case Workbench — frame your situation first, then use the tools below with context already loaded.
Optional profile
Add contact details for your tools account
These details help support and billing conversations. They are optional and never block tool access.