Files
ss-tools/frontend/tailwind.config.js
busya ff60865183 feat(agent-chat): 035-agent-chat-context — контекст, guardrails, tools, database discovery
== User stories ==
US1: Контекст с дашборда/датасета → /agent с URL params
US2: Guardrails card — env badge, 7 risk tones, countdown, permission_denied
US3: Tools optimization — retry, timeout, summarise, RBAC + context affinity

== Backend ==
- _context.py (NEW): UIContext validation (7 checks)
- _tool_filter.py (NEW): RBAC + context affinity pipeline
- _confirmation.py: build_confirmation_contract_v2, permission_denied_payload
- tools.py: superset_list_databases, retry/summarise/timeout wrappers
- app.py: _inject_uicontext, _inject_env_id_into_tools, database
  prefetch в runtime context
- _persistence.py: prefetch_databases()
- agent_superset_explore.py: GET /databases endpoint
- _llm_async_http.py, _persistence.py: fix double /v1 в LLM URL
  (LM Studio Unexpected endpoint)

== Frontend ==
- AgentChatModel.svelte.ts: 5 atoms, 3 actions, countdown, context
- AgentChat.svelte: production banner, process steps, debug panel
- ConfirmationCard.svelte: 7 risk tones, permission_denied, countdown
- ToolCallCard.svelte: retrying/timeout/cancelled states
- StreamProcessor.svelte.ts: tool_retry, timeout, permission_denied
- TopNavbar: sparkles icon + Ассистент
- sidebarNavigation: AI section
- DashboardHeader, datasets/+page: contextual AI buttons
- Icon: sparkles, brain, cpu icons
- tailwind: assistant category colors
- i18n: en/ru nav keys

== Tests ==
- 159 backend agent tests (+16 US3: retry, timeout, summarise, contracts)
- 2544 frontend tests (+11 model + component tests)
- 15 JSON fixtures (10 API + 5 model)

== Specs ==
- specs/035-agent-chat-context/: spec, UX, plan, tasks, research,
  data-model, contracts, quickstart, traceability, fixtures, checklists

Closes #035
2026-07-04 22:47:17 +03:00

125 lines
5.2 KiB
JavaScript
Executable File

/** @type {import('tailwindcss').Config} */
export default {
content: [
"./index.html",
"./src/**/*.{svelte,js,ts,jsx,tsx}",
],
theme: {
extend: {
colors: {
// ── Semantic action palette (light surfaces) ──────────────
primary: {
DEFAULT: '#2563eb', // blue-600
hover: '#1d4ed8', // blue-700
ring: '#3b82f6', // blue-500
light: '#eff6ff', // blue-50
},
secondary: {
DEFAULT: '#f3f4f6', // gray-100
hover: '#e5e7eb', // gray-200
text: '#111827', // gray-900
ring: '#6b7280', // gray-500
},
destructive: {
DEFAULT: '#dc2626', // red-600
hover: '#b91c1c', // red-700
ring: '#ef4444', // red-500
light: '#fef2f2', // red-50
},
success: {
DEFAULT: '#22c55e', // green-500
hover: '#16a34a', // green-600
ring: '#4ade80', // green-400
light: '#f0fdf4', // green-50
},
warning: {
DEFAULT: '#f59e0b', // amber-500
hover: '#d97706', // amber-600
ring: '#fbbf24', // amber-400
light: '#fffbeb', // amber-50
},
info: {
DEFAULT: '#0ea5e9', // sky-500
hover: '#0284c7', // sky-600
ring: '#38bdf8', // sky-400
light: '#f0f9ff', // sky-50
},
ghost: {
hover: '#f3f4f6', // gray-100
text: '#374151', // gray-700
ring: '#6b7280', // gray-500
},
// ── Surface hierarchy ─────────────────────────────────────
surface: {
page: '#f8fafc', // slate-50
card: '#ffffff', // white
muted: '#f1f5f9', // slate-100
overlay: 'rgba(15, 23, 42, 0.5)', // slate-900/50 — modal backdrop
},
// ── Border hierarchy ──────────────────────────────────────
border: {
DEFAULT: '#e2e8f0', // slate-200
strong: '#cbd5e1', // slate-300
},
// ── Text hierarchy ────────────────────────────────────────
text: {
DEFAULT: '#0f172a', // slate-900
muted: '#64748b', // slate-500
subtle: '#94a3b8', // slate-400
inverse: '#ffffff', // white
},
// ── Dark terminal palette (log viewer, task drawer) ───────
terminal: {
bg: '#0f172a', // slate-900
surface: '#1e293b', // slate-800
border: '#334155', // slate-700
text: {
DEFAULT: '#cbd5e1', // slate-300
muted: '#475569', // slate-600
subtle: '#64748b', // slate-500
bright: '#e2e8f0', // slate-200
heading: '#f1f5f9', // slate-100
},
accent: '#22d3ee', // cyan-400
},
// ── Log level palette ─────────────────────────────────────
log: {
debug: '#64748b',
info: '#38bdf8',
warning: '#fbbf24',
error: '#f87171',
},
// ── Log source palette ────────────────────────────────────
source: {
plugin: '#4ade80',
api: '#c084fc',
git: '#fb923c',
system: '#38bdf8',
},
// ── Category gradient tokens (sidebar/breadcrumb icons) ──
category: {
dashboards: { from: '#e0f2fe', to: '#bae6fd', text: '#0369a1', ring: '#7dd3fc' }, // sky
datasets: { from: '#dcfce7', to: '#bbf7d0', text: '#15803d', ring: '#86efac' }, // emerald→success
migration: { from: '#ffedd5', to: '#fed7aa', text: '#c2410c', ring: '#fdba74' }, // orange→warning
git: { from: '#f3e8ff', to: '#e9d5ff', text: '#7e22ce', ring: '#d8b4fe' }, // purple
translation: { from: '#cffafe', to: '#99f6e4', text: '#0f766e', ring: '#5eead4' }, // cyan/teal→info
validation: { from: '#fef3c7', to: '#fde68a', text: '#a16207', ring: '#fcd34d' }, // amber
reports: { from: '#ede9fe', to: '#ddd6fe', text: '#6d28d9', ring: '#c4b5fd' }, // violet
tools: { from: '#f1f5f9', to: '#e2e8f0', text: '#334155', ring: '#94a3b8' }, // slate→surface
admin: { from: '#ffe4e6', to: '#fecdd3', text: '#be123c', ring: '#fda4af' }, // rose→destructive
maintenance: { from: '#ffedd5', to: '#fed7aa', text: '#c2410c', ring: '#fdba74' }, // orange→warning
assistant: { from: '#f3e8ff', to: '#e9d5ff', text: '#6b21a8', ring: '#d8b4fe' }, // violet→purple
},
},
width: {
sidebar: '240px',
'sidebar-collapsed': '64px',
},
fontFamily: {
mono: ['"JetBrains Mono"', '"Fira Code"', 'monospace'],
},
},
},
plugins: [],
}