* docs(plan): design-system unification plan (post-review revisions)
Plan covers consolidating two CSS files into one, introducing
canonical primitives (.btn family, .search-input, .filter-bar,
.page-header, .data-table, .empty-state, .toast, .stat-card,
.tab-strip), unifying the top-nav Admin trigger with sibling
links, and migrating 41 templates that today carry inline
<style> blocks.
Post-review revisions: nav fix moved to first commit (user
complaint lands first); sticky-header and dark-mode skeleton
tasks dropped (defer to follow-up PRs); contract test class
detection tokenizes class="..." attributes properly; baseline
screenshot loop added to Task 0; vendor-token grep widened.
* fix(nav): unify Admin trigger with sibling nav links
The top-nav Admin entry is a <button class="app-nav-link
app-nav-menu-trigger">, siblings are <a class="app-nav-link">.
.app-nav-menu-trigger used to override .app-nav-link with
"color: inherit; font: inherit", resetting font-size from 13px
back to body default and color from --text-secondary to body
color. Active state diverged too: .is-active on links used
--primary blue, [aria-expanded=true] on the button used
--border-light grey.
Fix: expand .app-nav-link so it covers <button>-element resets
(font-family: inherit, border: 0, background: transparent,
cursor: pointer, display: inline-flex for chevron alignment).
Add [aria-expanded="true"] as another active-state selector
so the dropdown's open state highlights identically to .is-active
on links. Delete the now-redundant .app-nav-menu-trigger rules
that stripped button chrome.
Extract the inline <script> from _app_header.html into a new
app/web/static/app.js (loaded by base.html only — base_login.html
has no nav). Sets up window.appUI.wireDropdown for both the user
menu and the Admin dropdown via DOMContentLoaded.
* style(css): consolidate style.css into style-custom.css + add cache-bust
One stylesheet for the whole web UI:
- style.css (1086 lines, legacy Google-inspired tokens + components)
absorbed into style-custom.css under a labeled block, placed after
the modern :root + body so style-custom's component rules continue
to override the legacy ones (preserves the original cascade order
that came from loading style.css first).
- style.css deleted; <link> dropped from base.html + base_login.html.
- static_url() now appends ?v=<mtime> to /static/<path>. Cheap
per-request os.stat — auto-invalidates browser + proxy caches on
redeploy without operator intervention. Mtime survives across
uvicorn restarts as long as the file content is unchanged.
Legacy classes (.btn, .card, .login-*, .badge, .code-block, .flash,
.form-group, .username-box, .btn-copy, .auth-tabs, .divider, etc.)
still render — they live in style-custom.css now. Login pages,
error page, password setup, and the dashboard's Claude Code Setup
card all kept working in browser smoke.
* test(design): contract test for design-system invariants
7 structural invariants enforced from this commit onwards:
- style.css must stay deleted
- no template links style.css via static_url
- exactly one bare :root block in style-custom.css
- canonical primitives declared (.btn, .btn-primary, .search-input,
.filter-bar, .page-header, .data-table, .empty-state, .toast, …)
- no deprecated class names in templates (.users-table, .gp-table,
.marketplaces-table, .audit-table, .users-search, .marketplaces-search,
.modal-btn, .btn-primary-v2, …)
- app.js loaded by base.html, NOT by base_login.html
- 3 helper-level unit tests for the class-attribute tokenizer
(multi-line attrs, Jinja-conditional fragments, false-positive prose)
Two of the assertions intentionally start FAILING after this commit
(missing primitives + legacy class refs in 7 admin templates) and
will turn green as Tasks 4–7 add primitives and Tasks 8–15 migrate
the templates.
* feat(css): canonical button family + legacy token aliases
Adds at top of :root: legacy token aliases (--bg, --card-bg, --text,
--text-light, --secondary, --radius) pointing at modern equivalents.
Absorbed style.css rules referenced these names; without aliases
they fell back to 'unset'. Aliases live until Task 16 alongside
their absorbed rules.
Appends canonical .btn variants at end of file (last cascade):
.btn-primary + .btn-primary-v2 + .modal-btn.primary (alias group)
.btn-secondary + .btn-secondary-v2 + .modal-btn:not(.primary):not(.danger)
.btn-ghost + .btn-ghost-v2
.btn-danger + .modal-btn.danger
.btn-lg
.btn:disabled + .btn:focus-visible (focus ring via --focus-ring)
Existing absorbed .btn, .btn-primary, .btn-secondary, .btn-sm rules
remain — the canonical block adds the missing variants + selector-list
aliases so .modal-btn and v2 markup keep rendering until migration
tasks swap them out.
Contract test: .btn-danger now declared (one less missing primitive).
Browser smoke: /admin/tokens hero + filter pills + empty state render
correctly with the absorbed style.css rules now backed by real tokens.
* feat(css): form-control primitives — .search-input + .filter-bar + .filter-pill + .form-input
Canonical filter bar shape: 36px-height inputs (matches button height
for vertical rhythm), 28px pills with .is-active state, consistent
focus ring via --focus-ring token.
Selector-list aliases for legacy per-page classes:
- .users-search / .marketplaces-search / .kb-search → .search-input
- .filters-card → .filter-bar
- .pill[aria-pressed="true"] also matches the .filter-pill active state
.form-input added as a sibling of .search-input for forms — same
baseline height + radius + focus treatment, with textarea.form-input
auto-sizing to min 96px and using the mono font (matches CSV/SQL
pasted-snippet patterns on /admin/agent-prompt + /admin/workspace-prompt).
Contract test: .search-input + .filter-bar + .filter-pill now declared.
* feat(css): .page-header primitive + variants + .tab-strip
Canonical page-header pattern with title (22px) + optional subtitle +
optional eyebrow + right-aligned actions slot. Two modifiers:
- .page-header--hero: gradient background (primary→primary-dark),
28px white title, semi-transparent subtitle/eyebrow. For
/marketplace, /store, /profile-style pages that already use this
layout via per-page inline <style>. Migration tasks delete the
duplicated rules.
- .page-header--compact: 18px title for dense admin index pages.
.tab-strip + .tab-strip__item — the secondary tab row pattern used by
/marketplace?tab=flea and similar. .is-active / [aria-selected=true]
both flip the active treatment (primary color + bottom border).
Contract test: .page-header / __title / __subtitle / __actions all
now declared (4 fewer missing primitives).
* feat(css+js): .data-table + .empty-state + .toast + .stat-card primitives
Last primitive batch. All 8 canonical-primitives invariants in
test_design_system_contract.py now green; only the template-migration
test fails (expected — Tasks 8–15).
.data-table (+ --compact modifier): selector-list aliases for legacy
per-page table classes (.users-table, .gp-table, .marketplaces-table,
.audit-table) so existing markup keeps rendering until migration.
Compact modifier shrinks padding + font for dense lists (audit log).
.empty-state with __icon / __title / __description / __actions —
replaces the ad-hoc 'no results' rendering scattered across pages
(corporate_memory, admin_users, admin_marketplaces, etc.).
.toast / .toast-container — paired with window.appToast({kind, msg,
timeout}) appended to app.js. Bottom-right stacked, click-to-dismiss,
auto-dismiss after 4s by default. Kind 'success' / 'warning' / 'error'
/ 'info' shows a 3px colored left border.
.stat-card (+ --accent variant) + .stat-row grid — for the dashboard
metric tile row.
* style(templates): migrate 8 templates off deprecated class names
Mechanical class-attribute rewrite via tokenizer (preserves Jinja
conditionals + multi-line attrs):
modal-btn primary -> btn btn-primary
modal-btn danger -> btn btn-danger
modal-btn -> btn btn-secondary
users-table -> data-table
gp-table -> data-table
marketplaces-table -> data-table
audit-table -> data-table
users-search -> search-input
marketplaces-search -> search-input
8 templates touched: admin_groups, admin_marketplaces, admin_tokens,
admin_users, admin_welcome, admin_workspace_prompt, my_tokens,
corporate_memory_admin. 43 lines updated total.
Inline <style> blocks in these templates still define rules for the
old class names — those rules no longer match anything and become
dead code, removed in Task 16's alias cleanup along with the
selector-list aliases in style-custom.css.
Contract test (tests/test_design_system_contract.py) now fully green:
9/9 invariants enforced from this commit onward.
* feat(css): extend .data-table selector list to 13 more bespoke -table classes
Visual unification of remaining tables across the codebase without
per-template edits. The .data-table baseline rules (uppercase header
tracking, 12px padding, hover state, border-radius) now apply to:
.ad-table / .ea-table / .md-table / .members-table /
.obs-table / .overview-stats-table / .registry-table /
.sample-table / .sched-table / .sess-table / .sub-table /
.subs-table / .ud-table
These class names live in 12 templates (activity_center, admin_access,
admin_group_detail, admin_scheduler_runs, admin_sessions,
admin_store_submissions, admin_tables, admin_usage, admin_user_detail,
catalog, me_debug, profile_sessions) that have their own per-page
<style> blocks. Per-page rules with higher specificity still win for
their custom needs (column widths, etc.) — this commit only sets a
shared baseline so every table renders with the same chrome.
Contract test stays green: 9/9 invariants enforced.
* style(css): remove now-unused legacy class aliases
Phase A renamed 8 templates off these names; no markup references
them any more, so the selector-list memberships are dead weight.
Removed from style-custom.css:
.btn-primary-v2 / .btn-secondary-v2 / .btn-ghost-v2
.modal-btn / .modal-btn.primary / .modal-btn.danger /
.modal-btn:not(.primary):not(.danger)
.users-search / .marketplaces-search / .kb-search
.users-table / .gp-table / .marketplaces-table / .audit-table
.filters-card
37 lines smaller. Contract test catches any reintroduction.
KEPT aliases (still in untouched template markup):
- .pill (marketplace_plugin_detail.html, marketplace.html — these
pages weren't part of Phase A's deprecated-class sweep; their
own .pill CSS rules still apply)
- All .data-table family extensions (.ad-table, .ea-table, .md-table,
.members-table, .obs-table, .overview-stats-table, .registry-table,
.sample-table, .sched-table, .sess-table, .sub-table, .subs-table,
.ud-table) — these still render data tables in 12 templates;
selector-list aliasing keeps them visually unified with .data-table
baseline.
- Legacy token aliases (--bg / --text / --text-light / --secondary /
--card-bg / --radius) — still resolve absorbed style.css rules.
Templates' inline <style> blocks still contain dead rules for the
renamed classes (.users-search, .modal-btn, etc.); harmless but
bloat. Optional follow-up: a separate sweep can drop those.
* docs(changelog): design-system unification under [Unreleased]
* feat(css): unify page-shell width — .container baseline 1280px + modifiers
Inventory found 30+ unique max-width values across templates (280px
login → 1600px admin/tables). The legacy .container default was 800px,
which made every admin page set its own wider inline override —
30+ ad-hoc widths drifted as a result.
Canonical: .container max-width = var(--width-app) (1280px). Pages
that need a different shape opt in via modifiers:
.container--narrow → var(--width-narrow) (800px) — long-form text,
setup wizards
.container--wide → var(--width-wide) (1400px) — admin lists,
marketplace grids
.container--full → max-width: none — hero / landing
Pages that already set a NARROWER inline max-width (setup, login flows
inside .login-card, etc.) still render at their narrower size — the
inline override beats the new canonical 1280px. The visible change
hits the ~20 admin pages currently rendering at 800px via the legacy
default, which jump to 1280px and pick up consistent breathing room.
Spacing also normalized: padding 24px 20px → var(--space-6) var(--space-5).
* fix(home+catalog): gut dashboard sections + remove confusing toggle + fix table count
Dashboard /home cleanup:
- Remove 'Your Data' card — Data Packages is already a top-nav entry,
so duplicating data sources on the landing page just adds noise.
- Remove 'Account' card — group memberships + scripts + last sync
belong on /profile, not on the welcome screen.
- Remove entire right-column (Corporate Memory + Activity Center
widgets) — both surfaces have dedicated admin pages reachable from
the Admin dropdown.
- Keep stats row (Tables/Columns/Rows/Data Size/Unstructured),
env-setup-CTA, and Notifications card.
/catalog cleanup:
- Strip the 'Always included' badge + the locked toggle-switch from
Core Business Data and Business Metrics cards. The toggle was
always 'checked disabled' — it visually looked like a switch but
could not be toggled, which was confusing. The 'Always included'
copy itself was redundant once the toggle was gone. Agnes Internal
already rendered without these, so the three cards are now visually
consistent.
Catalog data_stats fix:
- 'total_tables' was len(sync_state) — counted only tables that had
ever synced, so a 30-row table_registry with 0 ever synced rendered
as '0 tables'. Switched to len(tables) — the registered
business-data table list — so the count reflects what's actually
available, not what's been touched.
* fix(home): real stat numbers + drop unstructured tile + cleanup dead CSS
Dashboard stats were hardcoded zeros (columns: 0, size_display:
'0 MB', unstructured_display: '0 MB') and the table counter pulled
from sync_state (synced) instead of table_registry (registered).
On a fresh deployment with 30 registered tables and 0 ever synced,
the page rendered '0 / 0 / 0 / 0 MB / 0 MB' — useless.
Now:
- Tables: COUNT(*) FROM table_registry WHERE source_type != 'internal'.
Matches the /catalog Core Business Data counter.
- Columns: SUM(sync_state.columns). Zero only when nothing's synced yet.
- Rows: unchanged (SUM(sync_state.rows), already correct).
- Data Size: SUM(sync_state.file_size_bytes), human-formatted via
inline _fmt_bytes helper (KB/MB/GB).
- Unstructured: tile dropped — was always '0 MB' and had no source.
- last_updated: now derived from sync_state max(last_sync), wasn't set
before so the 'Synced …' tag never rendered.
Dashboard.html cleanup: ~725 lines of orphan inline <style> removed —
.section-title, .data-source*, .toggle-switch*, .catalog-cta*,
.memory-card / .memory-stat / .memory-description / .memory-footer
/ .btn-memory, .activity-card / .activity-stat / .activity-text
/ .btn-activity, .account-grid / .account-row / .account-scripts
/ .badge-role / .badge-group / .cron-line, .badge-included /
.badge-beta / .badge-demo. All matched markup deleted in the
previous commit; the CSS was dead code until now.
* ui(catalog): rename page heading 'Data Catalog' → 'Data Packages'
The top-nav entry says 'Data Packages' but the page itself said
'Data Catalog' — confusing two-name product. Aligns the heading and
<title> with the nav label. Subtitle trimmed too: 'manage your
subscriptions' was a vestige of the toggle UI that just got removed,
replaced with a one-liner describing what the page is for.
Two other 'Data Catalog' strings stay: they live inside the table-
profiler overlay JS and refer to an EXTERNAL catalog system (e.g.
OpenMetadata / Atlan) that an operator may link to per table — that
is a generic term for any external data-catalog product, not our
page name.
* fix(nav): dropdown clicks always work + mutual-exclusion close
Two bugs in the wireDropdown helper:
1. Clicking trigger B while trigger A's menu was open left both open.
e.stopPropagation() in trigger.click prevented the document-click
handler from firing, so trigger A's open menu had no way to learn
that something else was clicked. Net effect: state diverged across
the two dropdowns the more you clicked.
2. The target-vs-trigger equality check (e.target !== trigger) was
strict. Clicking the chevron <svg> inside the button reports the
svg or its <path> child as e.target — not the button — so removing
stopPropagation alone would trip the close branch in the same
click that just opened the panel.
Fix both at once: drop e.stopPropagation() AND switch the doc-handler
guard to trigger.contains(e.target). Now any click outside both the
trigger subtree and the panel subtree closes; any click on another
trigger closes via the OTHER dropdown's doc handler; clicks inside
the trigger (button OR svg child) are fully ignored by the doc
handler and only the trigger's own toggle handler fires.
* feat(ui): canonical blue-gradient hero on every admin page
The UI had a per-page hero pattern on ~10 onboarding/marketing pages
(admin_tokens / profile / install / setup_advanced / marketplace /
my_tokens / store_upload / home_*), each with its own ad-hoc CSS
(.tokens-hero, .profile-hero, .install-hero, .upload-hero, …). The
admin section's index + detail pages had plain H1/H2 with their own
.users-title / .gp-title / .obs-title / .cfg-title / … inline styling.
Net effect: half the app felt like a product, half felt like a
spreadsheet.
Now:
- .page-header--hero CSS upgraded to match the look analysts already
liked from admin_tokens: 28px/32px/24px padding, 14px radius, soft
primary-tinted box-shadow (0 4px 16px rgba(0,115,209,0.2)), 28px
semibold title, optional uppercase eyebrow + 13.5px subtitle.
Narrow-viewport breakpoint included.
- New _page_hero.html partial wraps the boilerplate. Usage:
{% set page_hero_eyebrow = "Users & Access" %}
{% set page_hero_title = "Users" %}
{% set page_hero_subtitle = "…" %}
{% include "_page_hero.html" %}
- 15 admin templates migrated to it: admin_users / admin_groups /
admin_marketplaces / admin_access / admin_sessions /
admin_session_detail / admin_store_submissions /
admin_scheduler_runs / admin_usage / admin_user_detail /
admin_welcome / admin_workspace_prompt / admin_server_config /
activity_center / admin/news_editor. Each gets a grouped eyebrow
(Users & Access / Data / Agent Experience / Activity Center /
Server) matching the Admin dropdown sections so the page identity
is unambiguous at a glance.
Legacy *-title H2/H1 + adjacent subtitle paragraphs deleted; their
per-page CSS rules are dead now (harmless, retire in a follow-up
sweep alongside other inline-style cleanup the reviewers flagged).
admin_tables.html intentionally NOT migrated — it's a standalone
HTML page that doesn't extend base.html; a separate refactor.
Test: test_admin_users_page_renders_for_admin assertion updated
from .users-title to .page-header__title + .page-header--hero (the
canonical pair). All other web/template tests stay green.
* refactor(ui): dedup _humanbytes, drop 267 lines of dead inline CSS
(1) _humanbytes consolidation:
- Add TB branch + optional precision param (default 2 preserves existing
Store detail callers; dashboard uses precision=1 for headline tiles).
- Delete inline _fmt_bytes from dashboard handler — was a copy of
_humanbytes with different rounding. One canonical helper now.
(2) Dead inline-CSS sweep across 17 migrated templates:
- Conservative regex: a CSS rule is deleted only when its primary class
matches one of the known-dead names AND that name is NOT referenced
from any class= attribute in the same file's markup.
- Per-file 'in-use' guard saved several false positives that the deny
list would have nuked (e.g. .users-toolbar, .gp-search, .obs-subtitle,
.marketplaces-toolbar are still in use; only .users-table, .users-search,
.users-title, .modal-btn, etc. that have NO markup left went away).
- Removed: -267 lines across admin_users (-42), admin_marketplaces (-45),
admin_groups (-31), my_tokens (-38), admin_tokens (-29), admin_access
(-9), admin_user_detail (-6), admin_welcome (-8), admin_workspace_prompt
(-8), admin_server_config (-2), admin_sessions (-1), admin_session_detail
(-1), admin_usage (-1), admin_store_submissions (-3), admin_scheduler_runs
(-3), activity_center (-4), corporate_memory_admin (-36).
Contract test stays green (9/9); all web/template/render/user_management
tests pass.
* feat(ui): canonical hero on /catalog (Data Packages)
Same .page-header--hero treatment as the admin pages — Data eyebrow,
Data Packages title, Browse-the-data-sources subtitle. Removes the
ad-hoc .page-title block (h1 / p / wrapper-div) and its CSS rules
(now dead, 3 rule blocks deleted).
* fix(nav): load app.js from _app_header.html — works on standalone pages
The previous nav-fix commit moved the inline dropdown script from
_app_header.html into app/web/static/app.js + added <script src=…>
to base.html. That broke EVERY page that includes _app_header.html
WITHOUT extending base.html (catalog, corporate_memory*,
admin_tables, install). They got the nav markup but no JS → both
Admin and AD dropdowns dead on those pages.
Fix: emit the <script src=app.js defer> directly inside the
_app_header.html partial. Any page that includes the header now
gets the script automatically — base.html-extenders AND standalone
HTML pages alike. base.html's duplicate <script> line removed.
Also fixes the wide-hero on /catalog: .page-header--hero now sets
its own max-width: var(--width-app) (1280px) so standalone pages
without a .container parent don't render the gradient edge-to-edge.
catalog's .source-cards bumped from 900px → 1280px to match the
hero, otherwise the page reads two-tier (wide blue band, narrow
content) which the user flagged.
Verified locally via agent-browser: Admin + AD dropdowns now click
through on /catalog, /admin/tables, /corporate-memory.
* docs(plan): standalone pages → base.html framework migration plan
Plan + Plan-agent review (8 must-fix items applied) for converting
the 5 templates that ship their own <html><head><body> scaffold
(catalog, install, corporate_memory, corporate_memory_admin,
admin_tables) to extend base.html. Root cause of yesterday's
'dropdown dead on /catalog' regression: shared infrastructure in
base.html doesn't propagate to standalones.
* feat(base): body_attrs block + migrate install.html to extend base
base.html: new {% block body_attrs %}{% endblock %} slot so pages
that need <body> attributes (admin_tables has data-source-type)
can carry them through extends.
install.html: convert from standalone <html><head><body> scaffold
to {% extends "base.html" %} with title / body_attrs / head_extra
/ layout / scripts blocks. Drops:
- <!DOCTYPE>, <html>, </html>, <head>, </head>
- <meta charset>, <meta viewport>
- Duplicate <link rel="stylesheet" href="...style-custom.css">
(base.html already provides one)
- <body> opening + closing tags
- Leading _app_header.html include + _version_badge.html include
(base.html handles both)
Preserves per-page CSS (in head_extra), per-page JS (in scripts),
the Inter font preconnect (kept inline; not hoisted to base in
this PR — separate decision).
Pilots the migration recipe before the 4 larger pages.
* refactor(memory): extend base.html
Same recipe as install.html. corporate_memory.html now inherits
<html>/<head>/<body> + nav + app.js script tag from base.html.
Page-specific CSS and JS preserved in head_extra + scripts blocks.
* refactor(memory-admin): extend base.html
Same recipe as install/corporate_memory. Curation page now in the
shared rendering pipeline.
* refactor(catalog): extend base.html
catalog.html had the most complexity: 7 head-level assets (chart.js,
Prism, prism-sql, metric_modal.css link + 2 preconnects + Inter
stylesheet), 5 body-level <script> blocks including a <script type=
"module"> for the metric modal, 2 duplicate style-custom.css links
in <head>. The migration script preserved all of them — head-level
externals hoisted to {% block head_extra %} in source order, body
scripts relocated to {% block scripts %} in source order (so chart.js
loads before the IIFE that builds Chart instances), duplicate
style-custom.css links dropped (base.html provides one).
* refactor(admin-tables): extend base.html + carry data-source-type
The biggest of the 5 standalones at 3563 lines. <body data-source-
type="{{ data_source_type }}"> attribute carried through via the
new {% block body_attrs %} slot (admin_tables JS reads
document.body.dataset.sourceType to switch between keboola and
bigquery rendering paths).
* release: 0.54.10 — UI design system unification + homepage status frame + initial workspace override + store guardrails
Co-Authored-By: zdenek.srotyr <zdenek.srotyr@keboola.com>
* refactor(web): migrate remaining templates to canonical design primitives
- admin_group_detail: .data-table, .btn family, appToast(), remove duplicate table/button/toast CSS
- admin_store_submission_detail: .data-table, .btn family, appToast(), remove duplicate btn/toast CSS
- profile_sessions: .data-table, _page_hero.html, remove duplicate table/title CSS
- me_debug: .data-table, .btn family, remove duplicate table/button CSS
- marketplace: .btn-primary/.btn-secondary, remove duplicate button CSS
- store_edit: remove duplicate .btn-primary/.btn-link CSS, canonical button classes
- store_upload: remove duplicate .btn-primary/.btn-secondary/.btn-link CSS
Co-Authored-By: zdenek.srotyr <zdenek.srotyr@keboola.com>
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1089 lines
42 KiB
HTML
1089 lines
42 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block title %}Setup local agent — {{ config.INSTANCE_NAME }}{% endblock %}
|
|
|
|
{% block head_extra %}
|
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
|
<style>
|
|
/* ── Header (shared visual style with dashboard.html) ── */
|
|
.header {
|
|
background: var(--surface);
|
|
border-bottom: 1px solid var(--border);
|
|
padding: 0 32px;
|
|
height: 72px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
position: sticky;
|
|
top: 0;
|
|
z-index: 100;
|
|
}
|
|
.header-left {
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: center;
|
|
gap: 2px;
|
|
}
|
|
.header-logo { display: inline-flex; align-items: center; text-decoration: none; color: inherit; }
|
|
.header-logo svg { display: block; }
|
|
a.header-logo:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
|
|
.header-subtitle {
|
|
font-size: 11px;
|
|
font-weight: 500;
|
|
color: var(--text-secondary);
|
|
letter-spacing: 0.4px;
|
|
text-transform: uppercase;
|
|
margin-top: 2px;
|
|
}
|
|
.header-right {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 16px;
|
|
}
|
|
.header-email {
|
|
font-size: 13px;
|
|
color: var(--text-secondary);
|
|
font-weight: 500;
|
|
}
|
|
.avatar {
|
|
width: 36px;
|
|
height: 36px;
|
|
border-radius: 50%;
|
|
background: var(--primary-light);
|
|
color: var(--primary);
|
|
font-size: 13px;
|
|
font-weight: 600;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
letter-spacing: 0.3px;
|
|
}
|
|
.avatar-img {
|
|
width: 36px;
|
|
height: 36px;
|
|
border-radius: 50%;
|
|
border: 2px solid var(--border);
|
|
}
|
|
.nav-link {
|
|
font-size: 13px;
|
|
font-weight: 500;
|
|
color: var(--text-secondary);
|
|
text-decoration: none;
|
|
transition: color 0.15s ease;
|
|
}
|
|
.nav-link:hover { color: var(--text-primary); }
|
|
.btn-logout {
|
|
font-family: var(--font-primary);
|
|
font-size: 13px;
|
|
font-weight: 500;
|
|
color: var(--text-secondary);
|
|
background: none;
|
|
border: 1px solid var(--border);
|
|
border-radius: 8px;
|
|
padding: 6px 14px;
|
|
cursor: pointer;
|
|
transition: all 0.15s ease;
|
|
text-decoration: none;
|
|
}
|
|
.btn-logout:hover {
|
|
color: var(--text-primary);
|
|
border-color: #D1D5DB;
|
|
background: var(--border-light);
|
|
}
|
|
|
|
/* ── Main Container ── */
|
|
.main {
|
|
max-width: 880px;
|
|
margin: 0 auto;
|
|
padding: 28px 32px 48px;
|
|
}
|
|
|
|
/* ── Hero ── */
|
|
.hero {
|
|
background: linear-gradient(135deg, #0073D1 0%, #0056A3 100%);
|
|
border-radius: 12px;
|
|
padding: 32px 36px;
|
|
margin-bottom: 24px;
|
|
box-shadow: 0 4px 16px rgba(0, 115, 209, 0.2);
|
|
color: white;
|
|
}
|
|
.hero-eyebrow {
|
|
font-size: 11px;
|
|
font-weight: 600;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.8px;
|
|
color: rgba(255, 255, 255, 0.75);
|
|
margin-bottom: 10px;
|
|
}
|
|
.hero h1 {
|
|
font-size: 30px;
|
|
font-weight: 700;
|
|
margin: 0 0 8px 0;
|
|
color: white;
|
|
letter-spacing: -0.4px;
|
|
}
|
|
.hero-sub {
|
|
font-size: 14px;
|
|
color: rgba(255, 255, 255, 0.85);
|
|
line-height: 1.6;
|
|
}
|
|
.hero-meta {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 8px;
|
|
margin-top: 16px;
|
|
}
|
|
.hero-pill {
|
|
background: rgba(255, 255, 255, 0.15);
|
|
padding: 6px 12px;
|
|
border-radius: 6px;
|
|
font-family: var(--font-mono);
|
|
font-size: 12px;
|
|
color: white;
|
|
}
|
|
|
|
/* ── Card Base ── */
|
|
.card {
|
|
background: var(--surface);
|
|
border: 1px solid var(--border);
|
|
border-radius: 12px;
|
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
|
|
overflow: hidden;
|
|
margin-bottom: 20px;
|
|
}
|
|
.card-header {
|
|
padding: 22px 24px 0;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 12px;
|
|
}
|
|
.card-body {
|
|
padding: 16px 24px 24px;
|
|
}
|
|
.step-num {
|
|
width: 26px;
|
|
height: 26px;
|
|
background: var(--primary);
|
|
color: white;
|
|
border-radius: 50%;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
font-size: 12px;
|
|
font-weight: 700;
|
|
flex-shrink: 0;
|
|
}
|
|
.card-title {
|
|
font-size: 16px;
|
|
font-weight: 600;
|
|
color: var(--text-primary);
|
|
}
|
|
.card-sub {
|
|
font-size: 13px;
|
|
color: var(--text-secondary);
|
|
line-height: 1.6;
|
|
margin: 0 0 14px;
|
|
}
|
|
.card-sub code {
|
|
background: var(--border-light);
|
|
padding: 1px 6px;
|
|
border-radius: 4px;
|
|
font-family: var(--font-mono);
|
|
font-size: 12px;
|
|
color: var(--text-primary);
|
|
}
|
|
|
|
/* ── Code blocks / terminal ── */
|
|
.code-block {
|
|
background: #1e1e2e;
|
|
border-radius: 8px;
|
|
padding: 14px 16px;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 12px;
|
|
font-family: var(--font-mono);
|
|
font-size: 13px;
|
|
color: #cdd6f4;
|
|
line-height: 1.5;
|
|
margin-bottom: 10px;
|
|
}
|
|
.code-block.primary {
|
|
padding: 18px 20px;
|
|
font-size: 14px;
|
|
}
|
|
.code-block .prompt {
|
|
color: #a6e3a1;
|
|
user-select: none;
|
|
flex-shrink: 0;
|
|
}
|
|
.code-block .cmd {
|
|
flex: 1;
|
|
overflow-x: auto;
|
|
white-space: nowrap;
|
|
-ms-overflow-style: none;
|
|
scrollbar-width: none;
|
|
}
|
|
.code-block .cmd::-webkit-scrollbar { display: none; }
|
|
.btn-copy {
|
|
padding: 6px 14px;
|
|
background: transparent;
|
|
border: 1px solid #45475a;
|
|
color: #cdd6f4;
|
|
cursor: pointer;
|
|
border-radius: 6px;
|
|
font-size: 12px;
|
|
font-weight: 500;
|
|
font-family: var(--font-primary);
|
|
transition: all 0.15s ease;
|
|
flex-shrink: 0;
|
|
}
|
|
.btn-copy:hover {
|
|
border-color: #89b4fa;
|
|
color: #89b4fa;
|
|
background: rgba(137, 180, 250, 0.08);
|
|
}
|
|
.btn-copy:focus-visible {
|
|
outline: 2px solid #89b4fa;
|
|
outline-offset: 2px;
|
|
}
|
|
.btn-copy.copied {
|
|
border-color: #a6e3a1;
|
|
color: #a6e3a1;
|
|
background: rgba(166, 227, 161, 0.08);
|
|
}
|
|
|
|
/* ── Anon sign-in banner (shown only when logged out) ── */
|
|
.auth-banner {
|
|
background: var(--background);
|
|
border: 1px solid var(--border);
|
|
border-left: 3px solid var(--primary);
|
|
border-radius: 8px;
|
|
padding: 12px 16px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: 12px;
|
|
margin-bottom: 16px;
|
|
font-size: 13px;
|
|
color: var(--text-primary);
|
|
}
|
|
.auth-banner-text { line-height: 1.5; }
|
|
.auth-banner a {
|
|
color: var(--primary);
|
|
text-decoration: none;
|
|
font-weight: 600;
|
|
white-space: nowrap;
|
|
}
|
|
.auth-banner a:hover { text-decoration: underline; }
|
|
|
|
/* ── Section label inside a card (separates subsections) ── */
|
|
.card-section-label {
|
|
font-size: 12px;
|
|
font-weight: 600;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.6px;
|
|
color: var(--text-secondary);
|
|
margin: 18px 0 10px;
|
|
}
|
|
|
|
/* ── One-click "Setup a new Claude Code" button ── */
|
|
.btn-oneclick {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
font-family: var(--font-primary);
|
|
font-size: 14px;
|
|
font-weight: 600;
|
|
color: #FFFFFF;
|
|
background: var(--primary);
|
|
border: none;
|
|
border-radius: 8px;
|
|
padding: 12px 22px;
|
|
cursor: pointer;
|
|
transition: all 0.15s ease;
|
|
margin-top: 4px;
|
|
}
|
|
.btn-oneclick:hover {
|
|
background: var(--primary-dark, #0056A3);
|
|
transform: translateY(-1px);
|
|
box-shadow: 0 4px 14px rgba(0, 115, 209, 0.25);
|
|
}
|
|
.btn-oneclick[disabled] {
|
|
opacity: 0.7;
|
|
cursor: wait;
|
|
transform: none;
|
|
}
|
|
.btn-oneclick.copied {
|
|
background: var(--success, #10B77F);
|
|
}
|
|
.btn-oneclick:focus-visible {
|
|
outline: 2px solid var(--primary);
|
|
outline-offset: 2px;
|
|
}
|
|
.oneclick-error {
|
|
margin-top: 10px;
|
|
padding: 10px 12px;
|
|
background: rgba(234, 88, 12, 0.08);
|
|
border-left: 3px solid var(--error, #EA580C);
|
|
border-radius: 6px;
|
|
color: var(--error, #EA580C);
|
|
font-size: 13px;
|
|
}
|
|
|
|
/* ── Setup instructions preview (read-only) ── */
|
|
.setup-preview-card {
|
|
margin-top: 18px;
|
|
background: var(--background, #f6f7f9);
|
|
border: 1px solid var(--border, #e1e4e8);
|
|
border-radius: 8px;
|
|
padding: 14px 16px;
|
|
}
|
|
.setup-preview-summary {
|
|
list-style: none;
|
|
cursor: pointer;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
user-select: none;
|
|
}
|
|
.setup-preview-summary::-webkit-details-marker { display: none; }
|
|
.setup-preview-chevron {
|
|
display: inline-block;
|
|
font-size: 11px;
|
|
color: var(--text-secondary);
|
|
transition: transform 0.15s ease;
|
|
}
|
|
details[open] > .setup-preview-summary .setup-preview-chevron { transform: rotate(90deg); }
|
|
.setup-preview-title {
|
|
font-size: 12px;
|
|
font-weight: 600;
|
|
letter-spacing: 0.5px;
|
|
text-transform: uppercase;
|
|
color: var(--text-primary);
|
|
margin: 0;
|
|
}
|
|
.setup-preview-sub {
|
|
font-size: 12px;
|
|
color: var(--text-secondary);
|
|
margin: 0 0 10px 0;
|
|
}
|
|
.setup-preview-pre {
|
|
background: #1e1e2e;
|
|
border-radius: 6px;
|
|
padding: 14px 16px;
|
|
margin: 0;
|
|
max-height: 400px;
|
|
overflow-y: auto;
|
|
font-family: var(--font-mono);
|
|
font-size: 12.5px;
|
|
line-height: 1.55;
|
|
color: #cdd6f4;
|
|
white-space: pre-wrap;
|
|
word-break: break-word;
|
|
}
|
|
.setup-preview-code { font-family: inherit; font-size: inherit; }
|
|
.setup-preview-pre .placeholder-token {
|
|
background: rgba(249, 226, 175, 0.12);
|
|
color: #f9e2af;
|
|
padding: 0 4px;
|
|
border-radius: 3px;
|
|
font-style: italic;
|
|
}
|
|
.manual-aside > summary {
|
|
cursor: pointer;
|
|
font-size: 13px;
|
|
color: var(--text-secondary);
|
|
padding: 8px 0;
|
|
user-select: none;
|
|
}
|
|
.manual-aside > summary:focus-visible {
|
|
outline: 2px solid var(--primary);
|
|
outline-offset: 2px;
|
|
border-radius: 4px;
|
|
}
|
|
|
|
/* Fallback modal (clipboard blocked) */
|
|
.setup-fallback-overlay {
|
|
position: fixed;
|
|
inset: 0;
|
|
background: rgba(0, 0, 0, 0.45);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
z-index: 1000;
|
|
}
|
|
.setup-fallback-modal {
|
|
background: var(--surface);
|
|
border-radius: 12px;
|
|
padding: 20px;
|
|
max-width: 720px;
|
|
width: calc(100% - 32px);
|
|
max-height: calc(100vh - 64px);
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 12px;
|
|
box-shadow: 0 20px 48px rgba(0, 0, 0, 0.3);
|
|
}
|
|
.setup-fallback-modal h4 {
|
|
margin: 0;
|
|
font-size: 15px;
|
|
color: var(--text-primary);
|
|
}
|
|
.setup-fallback-modal p {
|
|
margin: 0;
|
|
font-size: 13px;
|
|
color: var(--text-secondary);
|
|
}
|
|
.setup-fallback-modal textarea {
|
|
flex: 1;
|
|
min-height: 260px;
|
|
font-family: var(--font-mono);
|
|
font-size: 12px;
|
|
padding: 10px;
|
|
border: 1px solid var(--border);
|
|
border-radius: 8px;
|
|
background: var(--background);
|
|
color: var(--text-primary);
|
|
resize: vertical;
|
|
}
|
|
.setup-fallback-actions {
|
|
display: flex;
|
|
justify-content: flex-end;
|
|
gap: 8px;
|
|
}
|
|
.setup-fallback-actions button {
|
|
font-family: var(--font-primary);
|
|
font-size: 13px;
|
|
font-weight: 500;
|
|
padding: 8px 16px;
|
|
border-radius: 6px;
|
|
border: 1px solid var(--border);
|
|
background: var(--surface);
|
|
color: var(--text-primary);
|
|
cursor: pointer;
|
|
}
|
|
.setup-fallback-actions button.primary {
|
|
background: var(--primary);
|
|
color: #FFF;
|
|
border-color: var(--primary);
|
|
}
|
|
|
|
/* ── Inline CTA link (Open /tokens etc.) ── */
|
|
.btn-cta {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
font-family: var(--font-primary);
|
|
font-size: 13px;
|
|
font-weight: 600;
|
|
color: var(--primary);
|
|
background: var(--primary-light);
|
|
border: none;
|
|
border-radius: 8px;
|
|
padding: 8px 14px;
|
|
cursor: pointer;
|
|
transition: background 0.15s ease;
|
|
text-decoration: none;
|
|
margin-bottom: 14px;
|
|
}
|
|
.btn-cta:hover {
|
|
background: rgba(0, 115, 209, 0.18);
|
|
}
|
|
|
|
/* ── Collapsible manual install ── */
|
|
.manual-details {
|
|
background: var(--surface);
|
|
border: 1px solid var(--border);
|
|
border-radius: 12px;
|
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
|
|
overflow: hidden;
|
|
margin-bottom: 20px;
|
|
}
|
|
.manual-summary {
|
|
padding: 18px 24px;
|
|
cursor: pointer;
|
|
list-style: none;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: 12px;
|
|
user-select: none;
|
|
}
|
|
.manual-summary::-webkit-details-marker { display: none; }
|
|
.manual-summary:focus-visible {
|
|
outline: 2px solid var(--primary);
|
|
outline-offset: 2px;
|
|
}
|
|
.manual-summary-text {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 2px;
|
|
}
|
|
.manual-summary-title {
|
|
font-size: 14px;
|
|
font-weight: 600;
|
|
color: var(--text-primary);
|
|
}
|
|
.manual-summary-desc {
|
|
font-size: 12px;
|
|
color: var(--text-secondary);
|
|
}
|
|
.manual-chev {
|
|
color: var(--text-secondary);
|
|
transition: transform 0.2s ease;
|
|
flex-shrink: 0;
|
|
}
|
|
.manual-details[open] .manual-chev {
|
|
transform: rotate(180deg);
|
|
}
|
|
.manual-body {
|
|
padding: 0 24px 24px;
|
|
border-top: 1px solid var(--border-light);
|
|
padding-top: 20px;
|
|
}
|
|
.manual-body ol {
|
|
margin: 0;
|
|
padding-left: 22px;
|
|
}
|
|
.manual-body li {
|
|
margin-bottom: 18px;
|
|
font-size: 13px;
|
|
color: var(--text-primary);
|
|
line-height: 1.6;
|
|
}
|
|
.manual-body li:last-child { margin-bottom: 0; }
|
|
.manual-body a {
|
|
color: var(--primary);
|
|
text-decoration: none;
|
|
font-family: var(--font-mono);
|
|
font-size: 12px;
|
|
}
|
|
.manual-body a:hover { text-decoration: underline; }
|
|
|
|
/* ── Footer link ── */
|
|
.footer-link {
|
|
text-align: center;
|
|
padding: 24px 0 8px;
|
|
font-size: 13px;
|
|
color: var(--text-secondary);
|
|
}
|
|
.footer-link a {
|
|
color: var(--primary);
|
|
text-decoration: none;
|
|
font-weight: 500;
|
|
}
|
|
.footer-link a:hover { text-decoration: underline; }
|
|
|
|
.footer {
|
|
text-align: center;
|
|
padding: 32px;
|
|
font-size: 12px;
|
|
color: #9CA3AF;
|
|
}
|
|
|
|
/* ── Flash Messages ── */
|
|
.flash-messages {
|
|
max-width: 880px;
|
|
margin: 0 auto;
|
|
padding: 16px 32px 0;
|
|
}
|
|
.flash {
|
|
padding: 12px 16px;
|
|
border-radius: 8px;
|
|
margin-bottom: 12px;
|
|
font-size: 13px;
|
|
}
|
|
.flash-success {
|
|
background: rgba(16, 183, 127, 0.1);
|
|
color: var(--success, #10B77F);
|
|
border-left: 3px solid var(--success, #10B77F);
|
|
}
|
|
.flash-error {
|
|
background: rgba(234, 88, 12, 0.1);
|
|
color: var(--error, #EA580C);
|
|
border-left: 3px solid var(--error, #EA580C);
|
|
}
|
|
|
|
/* ── Mobile ── */
|
|
@media (max-width: 720px) {
|
|
.header { padding: 0 16px; }
|
|
.main { padding: 20px 16px 32px; }
|
|
.hero { padding: 24px 20px; }
|
|
.hero h1 { font-size: 22px; }
|
|
.card-header { padding: 18px 18px 0; }
|
|
.card-body { padding: 14px 18px 20px; }
|
|
.code-block {
|
|
flex-wrap: wrap;
|
|
align-items: stretch;
|
|
gap: 8px;
|
|
}
|
|
.code-block .cmd { width: 100%; white-space: pre-wrap; }
|
|
.btn-copy { align-self: flex-end; }
|
|
.manual-summary { padding: 14px 18px; }
|
|
.manual-body { padding: 16px 18px 18px; }
|
|
}
|
|
|
|
/* ── Admin-configured banner (above setup commands) ── */
|
|
.setup-banner {
|
|
background: var(--background, #f6f7f9);
|
|
border: 1px solid var(--border, #e1e4e8);
|
|
border-left: 3px solid var(--primary, #0073D1);
|
|
border-radius: 8px;
|
|
padding: 14px 18px;
|
|
margin-bottom: 20px;
|
|
font-size: 14px;
|
|
line-height: 1.6;
|
|
color: var(--text-primary);
|
|
}
|
|
.setup-banner > *:first-child { margin-top: 0; }
|
|
.setup-banner > *:last-child { margin-bottom: 0; }
|
|
</style>
|
|
{% endblock %}
|
|
|
|
{% block layout %}
|
|
{% with messages = get_flashed_messages(with_categories=true) %}
|
|
{% if messages %}
|
|
<div class="flash-messages">
|
|
{% for category, message in messages %}
|
|
<div class="flash flash-{{ category }}">{{ message }}</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
{% endwith %}
|
|
|
|
<main class="main">
|
|
|
|
<!-- ═══════════════ ADMIN BANNER (optional) ═══════════════ -->
|
|
{% if banner_html %}<div class="setup-banner">{{ banner_html | safe }}</div>{% endif %}
|
|
|
|
<!-- ═══════════════ HERO ═══════════════ -->
|
|
<section class="hero">
|
|
<div class="hero-eyebrow">Getting started</div>
|
|
<h1>Install the {{ instance_brand or "Agnes" }} CLI on this machine</h1>
|
|
<p class="hero-sub">
|
|
Connect your terminal and Claude Code to this server. Copy the
|
|
one-liner below — it downloads and installs the CLI wheel,
|
|
then seeds your local config.
|
|
</p>
|
|
<div class="hero-meta">
|
|
<span class="hero-pill">{{ server_url }}</span>
|
|
{% if agnes_version and agnes_version != "dev" %}
|
|
<span class="hero-pill">v{{ agnes_version }}</span>
|
|
{% endif %}
|
|
</div>
|
|
</section>
|
|
|
|
<!-- ═══════════════ STEP 1 — ONE-LINER ═══════════════ -->
|
|
<section class="card">
|
|
<div class="card-header">
|
|
<span class="step-num">1</span>
|
|
<span class="card-title">Quick install</span>
|
|
</div>
|
|
<div class="card-body">
|
|
{% if session.user %}
|
|
<p class="card-sub">
|
|
One click generates a personal access token, assembles a
|
|
complete setup script (install CLI, save token, verify),
|
|
and copies it to your clipboard. Paste the result into
|
|
Claude Code to finish.
|
|
</p>
|
|
<button type="button"
|
|
id="setupClaudeBtn"
|
|
class="btn-oneclick"
|
|
onclick="setupNewClaude(this)">
|
|
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
|
|
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
|
|
</svg>
|
|
Setup a new Claude Code
|
|
</button>
|
|
<p class="card-sub" style="margin-top: 6px; margin-bottom: 0;">
|
|
Valid 90 days · token stays in your clipboard only.
|
|
</p>
|
|
<div id="setupClaudeError" class="oneclick-error" role="alert" style="display:none;"></div>
|
|
|
|
<details class="setup-preview-card" aria-label="Preview of the clipboard payload">
|
|
<summary class="setup-preview-summary">
|
|
<span class="setup-preview-chevron" aria-hidden="true">▸</span>
|
|
<span class="setup-preview-title">What Claude Code will receive</span>
|
|
</summary>
|
|
<p class="setup-preview-sub">
|
|
Read-only preview. The real token is generated when you
|
|
click the button above and is placed directly in your
|
|
clipboard — it is never rendered on this page.
|
|
</p>
|
|
{% with preview_mode=True %}
|
|
{% include "_claude_setup_instructions.jinja" %}
|
|
{% endwith %}
|
|
</details>
|
|
|
|
<details class="manual-aside" style="margin-top: 18px;">
|
|
<summary>Or run manually on a restricted environment</summary>
|
|
<div class="code-block primary" style="margin-top: 10px;">
|
|
<span class="prompt">$</span>
|
|
<span class="cmd" id="cmd-oneliner">curl -fsSL {{ server_url }}/cli/install.sh | bash</span>
|
|
<button type="button"
|
|
class="btn-copy" aria-live="polite"
|
|
data-copy-target="cmd-oneliner"
|
|
aria-label="Copy install command to clipboard">Copy</button>
|
|
</div>
|
|
<p class="card-sub" style="margin-top: 10px; margin-bottom: 0;">
|
|
If <code>agnes</code> is not found in a new shell, add
|
|
<code>~/.local/bin</code> to your <code>PATH</code>:
|
|
</p>
|
|
<div class="code-block" style="margin-top: 6px;">
|
|
<span class="prompt">$</span>
|
|
<span class="cmd" id="cmd-path">export PATH="$HOME/.local/bin:$PATH"</span>
|
|
<button type="button"
|
|
class="btn-copy" aria-live="polite"
|
|
data-copy-target="cmd-path"
|
|
aria-label="Copy PATH export command to clipboard">Copy</button>
|
|
</div>
|
|
<p class="card-sub" style="margin-top: 6px; margin-bottom: 0;">
|
|
Add that line to your <code>~/.bashrc</code> or
|
|
<code>~/.zshrc</code> for persistence.
|
|
</p>
|
|
</details>
|
|
{% else %}
|
|
<p class="card-sub">
|
|
Run this in your terminal (Linux / macOS). The installer
|
|
downloads the wheel and seeds <code>~/.config/agnes/config.yaml</code>
|
|
with this server URL.
|
|
</p>
|
|
<p class="card-sub" style="font-weight: 500;">
|
|
Sign in to skip the manual steps — you'll get a one-click
|
|
setup with a pre-configured token.
|
|
</p>
|
|
<div class="code-block primary">
|
|
<span class="prompt">$</span>
|
|
<span class="cmd" id="cmd-oneliner">curl -fsSL {{ server_url }}/cli/install.sh | bash</span>
|
|
<button type="button"
|
|
class="btn-copy" aria-live="polite"
|
|
data-copy-target="cmd-oneliner"
|
|
aria-label="Copy install command to clipboard">Copy</button>
|
|
</div>
|
|
<p class="card-sub" style="margin-top: 14px; margin-bottom: 0;">
|
|
If <code>agnes</code> is not found in a new shell, add
|
|
<code>~/.local/bin</code> to your <code>PATH</code>:
|
|
</p>
|
|
<div class="code-block" style="margin-top: 6px;">
|
|
<span class="prompt">$</span>
|
|
<span class="cmd" id="cmd-path">export PATH="$HOME/.local/bin:$PATH"</span>
|
|
<button type="button"
|
|
class="btn-copy" aria-live="polite"
|
|
data-copy-target="cmd-path"
|
|
aria-label="Copy PATH export command to clipboard">Copy</button>
|
|
</div>
|
|
<p class="card-sub" style="margin-top: 6px; margin-bottom: 0;">
|
|
Add that line to your <code>~/.bashrc</code> or
|
|
<code>~/.zshrc</code> for persistence.
|
|
</p>
|
|
{% endif %}
|
|
</div>
|
|
</section>
|
|
|
|
<!-- ═══════════════ STEP 2 — TOKEN ═══════════════ -->
|
|
{% if not session.user %}
|
|
<div class="auth-banner">
|
|
<span class="auth-banner-text">
|
|
You'll need to sign in first to create a personal access token.
|
|
</span>
|
|
<a href="/login">Sign in →</a>
|
|
</div>
|
|
{% endif %}
|
|
<section class="card">
|
|
<div class="card-header">
|
|
<span class="step-num">2</span>
|
|
<span class="card-title">Create a personal access token</span>
|
|
</div>
|
|
<div class="card-body">
|
|
<p class="card-sub">
|
|
Tokens let the CLI, CI jobs, and Claude Code talk to the
|
|
server without a browser session.
|
|
</p>
|
|
<a href="/tokens" class="btn-cta">
|
|
Open /tokens
|
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M5 12h14M13 5l7 7-7 7"/>
|
|
</svg>
|
|
</a>
|
|
<div class="card-section-label">After generating your token</div>
|
|
<p class="card-sub">
|
|
Export it for the current shell and verify the connection:
|
|
</p>
|
|
<div class="code-block">
|
|
<span class="prompt">$</span>
|
|
<span class="cmd" id="cmd-export">export AGNES_TOKEN=<your-token></span>
|
|
<button type="button"
|
|
class="btn-copy" aria-live="polite"
|
|
data-copy-target="cmd-export"
|
|
aria-label="Copy export command to clipboard">Copy</button>
|
|
</div>
|
|
<div class="code-block">
|
|
<span class="prompt">$</span>
|
|
<span class="cmd" id="cmd-whoami">agnes auth whoami</span>
|
|
<button type="button"
|
|
class="btn-copy" aria-live="polite"
|
|
data-copy-target="cmd-whoami"
|
|
aria-label="Copy whoami command to clipboard">Copy</button>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- ═══════════════ MANUAL INSTALL (collapsed) ═══════════════ -->
|
|
<details class="manual-details">
|
|
<summary class="manual-summary">
|
|
<span class="manual-summary-text">
|
|
<span class="manual-summary-title">Manual install</span>
|
|
<span class="manual-summary-desc">
|
|
For restricted environments, offline machines, or
|
|
Windows — download the wheel yourself.
|
|
</span>
|
|
</span>
|
|
<svg class="manual-chev" aria-hidden="true" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<polyline points="6 9 12 15 18 9"/>
|
|
</svg>
|
|
</summary>
|
|
<div class="manual-body">
|
|
<ol>
|
|
<li>
|
|
Download the wheel from
|
|
<a href="/cli/download">{{ server_url }}/cli/download</a>.
|
|
</li>
|
|
<li>
|
|
Install it:
|
|
<div class="code-block" style="margin-top: 8px;">
|
|
<span class="prompt">$</span>
|
|
<span class="cmd" id="cmd-uv-install">uv tool install ./agnes_the_ai_analyst-*.whl</span>
|
|
<button type="button"
|
|
class="btn-copy" aria-live="polite"
|
|
data-copy-target="cmd-uv-install"
|
|
aria-label="Copy uv install command to clipboard">Copy</button>
|
|
</div>
|
|
<span class="card-sub" style="display:block; text-align:center; margin: 4px 0 8px;">— or —</span>
|
|
<div class="code-block">
|
|
<span class="prompt">$</span>
|
|
<span class="cmd" id="cmd-pip-install">python3 -m pip install --user ./agnes_the_ai_analyst-*.whl</span>
|
|
<button type="button"
|
|
class="btn-copy" aria-live="polite"
|
|
data-copy-target="cmd-pip-install"
|
|
aria-label="Copy pip install command to clipboard">Copy</button>
|
|
</div>
|
|
<p class="card-sub" style="margin-top: 8px; margin-bottom: 0;">
|
|
On macOS (Homebrew) or recent Debian/Ubuntu,
|
|
<code>pip install --user</code> is blocked by
|
|
<a href="https://peps.python.org/pep-0668/" target="_blank" rel="noopener">PEP 668</a> —
|
|
prefer <code>uv tool install</code> above. The
|
|
<code>pip</code> command is for users with an
|
|
activated virtualenv.
|
|
</p>
|
|
<p class="card-sub" style="margin-top: 10px; margin-bottom: 0;">
|
|
If <code>agnes</code> is not found after install, ensure
|
|
<code>~/.local/bin</code> is on your <code>PATH</code>:
|
|
</p>
|
|
<div class="code-block" style="margin-top: 6px;">
|
|
<span class="prompt">$</span>
|
|
<span class="cmd" id="cmd-path-manual">export PATH="$HOME/.local/bin:$PATH"</span>
|
|
<button type="button"
|
|
class="btn-copy" aria-live="polite"
|
|
data-copy-target="cmd-path-manual"
|
|
aria-label="Copy PATH export command to clipboard">Copy</button>
|
|
</div>
|
|
<p class="card-sub" style="margin-top: 6px; margin-bottom: 0;">
|
|
Add that line to your <code>~/.bashrc</code> or
|
|
<code>~/.zshrc</code> to make it persistent.
|
|
</p>
|
|
</li>
|
|
<li>
|
|
Seed the server URL:
|
|
<div class="code-block" style="margin-top: 8px;">
|
|
<span class="prompt">$</span>
|
|
<span class="cmd" id="cmd-seed-config">mkdir -p ~/.config/agnes && echo "server: {{ server_url }}" > ~/.config/agnes/config.yaml</span>
|
|
<button type="button"
|
|
class="btn-copy" aria-live="polite"
|
|
data-copy-target="cmd-seed-config"
|
|
aria-label="Copy seed config command to clipboard">Copy</button>
|
|
</div>
|
|
</li>
|
|
<li>
|
|
Continue with <strong>Step 2 — Create a personal
|
|
access token</strong> above.
|
|
</li>
|
|
</ol>
|
|
</div>
|
|
</details>
|
|
|
|
<!-- ═══════════════ FOOTER LINK ═══════════════ -->
|
|
<div class="footer-link">
|
|
Running in CI or a headless environment?
|
|
<a href="https://github.com/keboola/agnes-the-ai-analyst/blob/main/docs/HEADLESS_USAGE.md" target="_blank" rel="noopener">Read the headless usage guide →</a>
|
|
</div>
|
|
|
|
</main>
|
|
|
|
<footer class="footer">
|
|
<p>© {{ now().year if now is defined else 2024 }} {{ config.INSTANCE_COPYRIGHT or 'AI Data Analyst' }}</p>
|
|
</footer>
|
|
{% endblock %}
|
|
|
|
{% block scripts %}
|
|
<script>
|
|
(function() {
|
|
function copyToClipboard(text) {
|
|
if (navigator.clipboard && window.isSecureContext) {
|
|
return navigator.clipboard.writeText(text);
|
|
}
|
|
var ta = document.createElement('textarea');
|
|
ta.value = text;
|
|
ta.style.position = 'fixed';
|
|
ta.style.left = '-9999px';
|
|
ta.style.top = '-9999px';
|
|
document.body.appendChild(ta);
|
|
ta.focus();
|
|
ta.select();
|
|
return new Promise(function(resolve, reject) {
|
|
try {
|
|
document.execCommand('copy') ? resolve() : reject();
|
|
} finally {
|
|
document.body.removeChild(ta);
|
|
}
|
|
});
|
|
}
|
|
|
|
function flashCopied(button) {
|
|
var original = button.textContent;
|
|
button.textContent = 'Copied!';
|
|
button.classList.add('copied');
|
|
setTimeout(function() {
|
|
button.textContent = original;
|
|
button.classList.remove('copied');
|
|
}, 1500);
|
|
}
|
|
|
|
document.querySelectorAll('.btn-copy[data-copy-target]').forEach(function(btn) {
|
|
btn.addEventListener('click', function() {
|
|
var target = document.getElementById(btn.getAttribute('data-copy-target'));
|
|
if (!target) return;
|
|
var text = target.textContent.trim();
|
|
copyToClipboard(text).then(function() {
|
|
flashCopied(btn);
|
|
}).catch(function() {
|
|
// Fallback: select the text so the user can copy manually.
|
|
var range = document.createRange();
|
|
range.selectNodeContents(target);
|
|
var sel = window.getSelection();
|
|
sel.removeAllRanges();
|
|
sel.addRange(range);
|
|
});
|
|
});
|
|
});
|
|
|
|
// ══════════════════════════════════════════════════════════════════
|
|
// "Setup a new Claude Code" one-click flow
|
|
// ══════════════════════════════════════════════════════════════════
|
|
// Template + renderer included from _claude_setup_instructions.jinja
|
|
// so dashboard.html and install.html always render the same payload.
|
|
{% include "_claude_setup_instructions.jinja" %}
|
|
|
|
function defaultTokenName() {
|
|
var stamp = new Date().toISOString().slice(0, 16).replace("T", " ");
|
|
return "Claude Code — " + stamp;
|
|
}
|
|
|
|
function showSetupFallback(instructions) {
|
|
var overlay = document.createElement('div');
|
|
overlay.className = 'setup-fallback-overlay';
|
|
overlay.innerHTML =
|
|
'<div class="setup-fallback-modal" role="dialog" aria-modal="true" aria-labelledby="setupFallbackTitle">' +
|
|
'<h4 id="setupFallbackTitle">Copy these setup instructions</h4>' +
|
|
'<p>Your browser blocked automatic clipboard access. Select all, copy, then paste into Claude Code.</p>' +
|
|
'<textarea readonly></textarea>' +
|
|
'<div class="setup-fallback-actions">' +
|
|
'<button type="button" data-action="close">Close</button>' +
|
|
'<button type="button" class="primary" data-action="select">Select all</button>' +
|
|
'</div>' +
|
|
'</div>';
|
|
document.body.appendChild(overlay);
|
|
var ta = overlay.querySelector('textarea');
|
|
ta.value = instructions;
|
|
ta.focus();
|
|
ta.select();
|
|
overlay.addEventListener('click', function(ev) {
|
|
if (ev.target === overlay) { document.body.removeChild(overlay); }
|
|
});
|
|
overlay.querySelector('[data-action="close"]').addEventListener('click', function() {
|
|
document.body.removeChild(overlay);
|
|
});
|
|
overlay.querySelector('[data-action="select"]').addEventListener('click', function() {
|
|
ta.focus();
|
|
ta.select();
|
|
});
|
|
}
|
|
|
|
window.setupNewClaude = async function setupNewClaude(btn) {
|
|
var errEl = document.getElementById('setupClaudeError');
|
|
if (errEl) { errEl.style.display = 'none'; errEl.textContent = ''; }
|
|
var origHTML = btn.innerHTML;
|
|
btn.disabled = true;
|
|
btn.textContent = 'Generating token…';
|
|
try {
|
|
// Uniform PAT mint for everyone: scope=general,
|
|
// expires_in_days=90. The same `/auth/tokens` endpoint
|
|
// a user can already hit from the /tokens UI — no
|
|
// role-locked endpoint, no per-role TTL clamp.
|
|
var tokenBody = { name: defaultTokenName(), expires_in_days: 90 };
|
|
var resp = await fetch('/auth/tokens', {
|
|
method: 'POST',
|
|
credentials: 'include',
|
|
headers: { 'Content-Type': 'application/json' },
|
|
body: JSON.stringify(tokenBody),
|
|
});
|
|
if (resp.status === 401) {
|
|
window.location.href = '/login?next=' + encodeURIComponent(window.location.pathname);
|
|
return;
|
|
}
|
|
if (!resp.ok) {
|
|
var detail = 'HTTP ' + resp.status;
|
|
try {
|
|
var body = await resp.json();
|
|
if (body && body.detail) { detail = body.detail; }
|
|
} catch (_) { /* non-JSON */ }
|
|
throw new Error(detail);
|
|
}
|
|
var data = await resp.json();
|
|
if (!data || !data.token) {
|
|
throw new Error('Server did not return a token.');
|
|
}
|
|
var serverUrl = window.location.origin;
|
|
var instructions = renderSetupInstructions(serverUrl, data.token);
|
|
|
|
try {
|
|
await copyToClipboard(instructions);
|
|
btn.textContent = 'Copied! Paste into Claude Code';
|
|
btn.classList.add('copied');
|
|
setTimeout(function() {
|
|
btn.innerHTML = origHTML;
|
|
btn.classList.remove('copied');
|
|
btn.disabled = false;
|
|
}, 3000);
|
|
} catch (clipErr) {
|
|
btn.innerHTML = origHTML;
|
|
btn.disabled = false;
|
|
showSetupFallback(instructions);
|
|
}
|
|
} catch (err) {
|
|
btn.innerHTML = origHTML;
|
|
btn.disabled = false;
|
|
if (errEl) {
|
|
errEl.textContent = 'Setup failed: ' + (err && err.message ? err.message : err);
|
|
errEl.style.display = 'block';
|
|
} else {
|
|
alert('Setup failed: ' + (err && err.message ? err.message : err));
|
|
}
|
|
}
|
|
};
|
|
})();
|
|
</script>
|
|
{% endblock %}
|