@anmol-srv/sigil 0.14.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anmol-srv/sigil",
3
- "version": "0.14.0",
3
+ "version": "0.16.0",
4
4
  "type": "module",
5
5
  "description": "Local-first memory infrastructure for AI coding agents. One brain shared across Claude Code, Codex CLI, Cursor, Kiro, Continue, Cline, Windsurf, or any MCP client. Organized in pluggable pods, stored in your own Postgres. No cloud, no telemetry. Auto-captured from Claude Code via hooks; surfaced everywhere else as a 9-tool MCP server.",
6
6
  "bin": {
@@ -28,6 +28,7 @@
28
28
  "dist/",
29
29
  "prompts/",
30
30
  "src/db/migrations/",
31
+ "src/db/drivers/",
31
32
  "src/gui/web/",
32
33
  "integrations/",
33
34
  "knexfile.js",
@@ -83,14 +84,14 @@
83
84
  "dependencies": {
84
85
  "@iarna/toml": "^2.2.5",
85
86
  "@modelcontextprotocol/sdk": "^1.27.1",
86
- "@number0/iroh": "^0.35.0",
87
87
  "dotenv": "^17.3.1",
88
88
  "knex": "^3.1.0",
89
89
  "pg": "^8.20.0",
90
90
  "ws": "^8.21.0"
91
91
  },
92
92
  "optionalDependencies": {
93
- "@anthropic-ai/sdk": "^0.30.0"
93
+ "@anthropic-ai/sdk": "^0.30.0",
94
+ "@number0/iroh": "^0.35.0"
94
95
  },
95
96
  "devDependencies": {
96
97
  "@clack/prompts": "^1.2.0",
@@ -0,0 +1,41 @@
1
+ /**
2
+ * DB driver selection.
3
+ *
4
+ * - If SIGIL_DATABASE_URL or DATABASE_URL is set, use the URL driver
5
+ * (Neon, Supabase, RDS, Render, Railway, self-hosted, etc.).
6
+ * - Otherwise, use the local-postgres driver (back-compat with the
7
+ * SIGIL_DB_HOST / PORT / NAME / USER / PASSWORD env vars).
8
+ *
9
+ * Returns a pg-shape connection object suitable for passing to knex's
10
+ * `connection` field. Pool config and post-processing are applied by
11
+ * the caller (cortex.js).
12
+ */
13
+ import { buildLocalConnection, buildLocalConnectionFromFields } from './local-postgres.js';
14
+ import { buildUrlConnection, classifyProvider } from './url.js';
15
+
16
+ export function selectDriver(config) {
17
+ const url = config.db.url;
18
+ if (url) {
19
+ return {
20
+ kind: 'url',
21
+ provider: classifyProvider(url),
22
+ connection: normalizeConnection(buildUrlConnection(url)),
23
+ };
24
+ }
25
+ return {
26
+ kind: 'local',
27
+ provider: 'local',
28
+ connection: normalizeConnection(buildLocalConnection(config)),
29
+ };
30
+ }
31
+
32
+ // pg throws "SASL: client password must be a string" if password is null/
33
+ // undefined. Coerce credentials to strings so a missing value degrades to a
34
+ // clear auth error (or a no-password connect) instead of a cryptic SASL crash.
35
+ function normalizeConnection(conn) {
36
+ if (conn.password == null) conn.password = '';
37
+ if (conn.user == null) delete conn.user;
38
+ return conn;
39
+ }
40
+
41
+ export { buildLocalConnection, buildLocalConnectionFromFields, buildUrlConnection, classifyProvider };
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Local-Postgres driver: builds a pg connection from the discrete
3
+ * SIGIL_DB_HOST / PORT / NAME / USER / PASSWORD env vars. This is the
4
+ * original Sigil behavior and remains the default when no URL is set.
5
+ */
6
+ export function buildLocalConnection(config) {
7
+ return {
8
+ host: config.db.host,
9
+ port: config.db.port,
10
+ database: config.db.database,
11
+ user: config.db.user,
12
+ password: config.db.password,
13
+ };
14
+ }
15
+
16
+ /**
17
+ * Build a pg connection from discrete fields (with sigil defaults). Used by
18
+ * setup steps that have host/port/db/user/password directly rather than a
19
+ * `config`-shaped object.
20
+ */
21
+ export function buildLocalConnectionFromFields({ host = 'localhost', port = 5432, database = 'sigil', user = 'sigil_app', password = '' } = {}) {
22
+ return { host, port: Number(port) || 5432, database, user, password };
23
+ }
@@ -0,0 +1,155 @@
1
+ /**
2
+ * URL driver: turns a Postgres connection URL into pg-shape config.
3
+ *
4
+ * Provider hints:
5
+ * - Neon (*.neon.tech) → SSL required, root CA trust default
6
+ * - Supabase (*.supabase.co | pooler) → SSL required
7
+ * - AWS RDS (*.rds.amazonaws.com) → SSL required (AWS root)
8
+ * - Render (*.render.com) → SSL required
9
+ * - Railway (*.railway.app) → SSL required
10
+ * - localhost / 127.0.0.1 / *.local → no SSL by default
11
+ *
12
+ * Explicit sslmode in the URL query string wins:
13
+ * sslmode=disable → no SSL
14
+ * sslmode=require → SSL, rejectUnauthorized=true
15
+ * sslmode=no-verify → SSL, rejectUnauthorized=false (compatibility for self-signed)
16
+ * sslmode=verify-full → SSL, rejectUnauthorized=true
17
+ *
18
+ * Falls back to provider heuristics if sslmode is absent.
19
+ */
20
+
21
+ const REQUIRE_SSL_HOSTS = [
22
+ /\.neon\.tech$/i,
23
+ /\.supabase\.co$/i,
24
+ /\.supabase\.com$/i,
25
+ /\.pooler\.supabase\.com$/i,
26
+ /\.rds\.amazonaws\.com$/i,
27
+ /\.render\.com$/i,
28
+ /\.railway\.app$/i,
29
+ /\.cockroachlabs\.cloud$/i,
30
+ ];
31
+
32
+ const NO_SSL_HOSTS = [
33
+ /^localhost$/i,
34
+ /^127\.0\.0\.1$/,
35
+ /^::1$/,
36
+ /\.local$/i,
37
+ ];
38
+
39
+ export function buildUrlConnection(url) {
40
+ if (!url) {
41
+ throw new Error('url driver: SIGIL_DATABASE_URL is empty');
42
+ }
43
+
44
+ let parsed;
45
+ try {
46
+ parsed = new URL(url);
47
+ } catch (err) {
48
+ throw new Error(`url driver: invalid URL — ${err.message}`);
49
+ }
50
+
51
+ if (!/^postgres(ql)?:$/i.test(parsed.protocol)) {
52
+ throw new Error(`url driver: expected postgres:// or postgresql:// scheme, got ${parsed.protocol}`);
53
+ }
54
+
55
+ const sslmode = parsed.searchParams.get('sslmode');
56
+ const ssl = resolveSsl(parsed.hostname, sslmode);
57
+
58
+ // pg accepts a connectionString directly, but we expand into discrete
59
+ // fields so knex can inject pool/post-process config alongside it.
60
+ const conn = {
61
+ host: parsed.hostname,
62
+ port: parsed.port ? Number(parsed.port) : 5432,
63
+ database: parsed.pathname.replace(/^\//, '') || 'postgres',
64
+ user: decodeURIComponent(parsed.username),
65
+ password: decodeURIComponent(parsed.password),
66
+ };
67
+ if (ssl !== undefined) conn.ssl = ssl;
68
+
69
+ // Application name surfaces in Postgres logs / pg_stat_activity — useful
70
+ // for ops to identify Sigil connections vs other clients on a shared DB.
71
+ if (!parsed.searchParams.get('application_name')) {
72
+ conn.application_name = 'sigil';
73
+ }
74
+
75
+ return conn;
76
+ }
77
+
78
+ function resolveSsl(hostname, sslmode) {
79
+ if (sslmode === 'disable') return false;
80
+ if (sslmode === 'require' || sslmode === 'verify-full' || sslmode === 'verify-ca') {
81
+ return { rejectUnauthorized: true };
82
+ }
83
+ if (sslmode === 'no-verify' || sslmode === 'prefer') {
84
+ return { rejectUnauthorized: false };
85
+ }
86
+ // Heuristics (no explicit sslmode set)
87
+ if (NO_SSL_HOSTS.some((re) => re.test(hostname))) return undefined;
88
+ if (REQUIRE_SSL_HOSTS.some((re) => re.test(hostname))) return { rejectUnauthorized: true };
89
+ // Unknown remote host: be safe — require SSL, allow self-signed.
90
+ return { rejectUnauthorized: false };
91
+ }
92
+
93
+ /**
94
+ * Pooled-connection detection + direct-host rewrite for migrations.
95
+ *
96
+ * Connection poolers (PgBouncer in transaction mode — Neon's `-pooler`
97
+ * endpoint, Supabase's pooler host) reject the advisory locks and prepared
98
+ * statements knex migrations rely on. Migrations must run against the DIRECT
99
+ * endpoint; only runtime traffic should use the pooled URL.
100
+ *
101
+ * isPooledUrl(url) → true if the host looks like a pooler
102
+ * directMigrationUrl(url) → a URL safe to migrate against, or null if we
103
+ * can't safely derive one (caller must then ask
104
+ * the user for a direct connection string)
105
+ *
106
+ * Neon is the only provider whose direct host is a deterministic transform
107
+ * of the pooled host (drop "-pooler"). Supabase's direct host is a different
108
+ * shape (db.<ref>.supabase.co) we can't reconstruct from the pooled URL, so
109
+ * we return null rather than fabricate a wrong host.
110
+ */
111
+ export function isPooledUrl(url) {
112
+ try {
113
+ const host = new URL(url).hostname;
114
+ return /-pooler\./i.test(host) || /\.pooler\.supabase\.com$/i.test(host);
115
+ } catch {
116
+ return false;
117
+ }
118
+ }
119
+
120
+ export function directMigrationUrl(url) {
121
+ let parsed;
122
+ try {
123
+ parsed = new URL(url);
124
+ } catch {
125
+ return null;
126
+ }
127
+ const host = parsed.hostname;
128
+ // Neon: ep-xxx-pooler.region.aws.neon.tech → ep-xxx.region.aws.neon.tech
129
+ if (/\.neon\.tech$/i.test(host) && /-pooler\./i.test(host)) {
130
+ parsed.hostname = host.replace('-pooler.', '.');
131
+ return parsed.toString();
132
+ }
133
+ // Already-direct Neon host (or any non-pooled host) needs no rewrite.
134
+ if (!isPooledUrl(url)) return url;
135
+ // Pooled, but not a shape we can safely rewrite (e.g. Supabase pooler).
136
+ return null;
137
+ }
138
+
139
+ /** Identify the most-likely provider for diagnostics / hints. */
140
+ export function classifyProvider(url) {
141
+ try {
142
+ const host = new URL(url).hostname;
143
+ if (/\.neon\.tech$/i.test(host)) return 'neon';
144
+ if (/\.pooler\.supabase\.com$/i.test(host)) return 'supabase-pooler';
145
+ if (/\.supabase\.co$/i.test(host) || /\.supabase\.com$/i.test(host)) return 'supabase';
146
+ if (/\.rds\.amazonaws\.com$/i.test(host)) return 'aws-rds';
147
+ if (/\.render\.com$/i.test(host)) return 'render';
148
+ if (/\.railway\.app$/i.test(host)) return 'railway';
149
+ if (/\.cockroachlabs\.cloud$/i.test(host)) return 'cockroachdb';
150
+ if (NO_SSL_HOSTS.some((re) => re.test(host))) return 'local';
151
+ return 'unknown';
152
+ } catch {
153
+ return 'unknown';
154
+ }
155
+ }
@@ -0,0 +1,94 @@
1
+ import { describe, it, expect } from 'vitest';
2
+
3
+ import { buildUrlConnection, classifyProvider } from './url.js';
4
+
5
+ describe('url driver', () => {
6
+ it('parses basic postgres:// URL', () => {
7
+ const c = buildUrlConnection('postgres://user:pass@host.example.com:5432/db');
8
+ expect(c.host).toBe('host.example.com');
9
+ expect(c.port).toBe(5432);
10
+ expect(c.database).toBe('db');
11
+ expect(c.user).toBe('user');
12
+ expect(c.password).toBe('pass');
13
+ });
14
+
15
+ it('decodes URI-encoded passwords (special chars)', () => {
16
+ const c = buildUrlConnection('postgres://u:p%40ss%3Aword@h.example.com/db');
17
+ expect(c.password).toBe('p@ss:word');
18
+ });
19
+
20
+ it('defaults port to 5432 when omitted', () => {
21
+ const c = buildUrlConnection('postgresql://u:p@h.example.com/db');
22
+ expect(c.port).toBe(5432);
23
+ });
24
+
25
+ it('accepts both postgres:// and postgresql:// schemes', () => {
26
+ expect(buildUrlConnection('postgres://u:p@h.example.com/db').host).toBe('h.example.com');
27
+ expect(buildUrlConnection('postgresql://u:p@h.example.com/db').host).toBe('h.example.com');
28
+ });
29
+
30
+ it('rejects non-postgres schemes', () => {
31
+ expect(() => buildUrlConnection('mysql://u:p@h.example.com/db')).toThrow(/scheme/);
32
+ });
33
+
34
+ it('does not enable SSL for localhost', () => {
35
+ expect(buildUrlConnection('postgres://u:p@localhost:5432/db').ssl).toBeUndefined();
36
+ expect(buildUrlConnection('postgres://u:p@127.0.0.1/db').ssl).toBeUndefined();
37
+ });
38
+
39
+ it('enables strict SSL for Neon URLs', () => {
40
+ const c = buildUrlConnection('postgres://u:p@ep-foo-123.us-east-2.aws.neon.tech/db');
41
+ expect(c.ssl).toEqual({ rejectUnauthorized: true });
42
+ });
43
+
44
+ it('enables strict SSL for Supabase pooler URLs', () => {
45
+ const c = buildUrlConnection('postgres://u:p@aws-0-us-east-1.pooler.supabase.com:6543/db');
46
+ expect(c.ssl).toEqual({ rejectUnauthorized: true });
47
+ });
48
+
49
+ it('enables strict SSL for AWS RDS URLs', () => {
50
+ const c = buildUrlConnection('postgres://u:p@my-instance.abc123.us-east-1.rds.amazonaws.com/db');
51
+ expect(c.ssl).toEqual({ rejectUnauthorized: true });
52
+ });
53
+
54
+ it('explicit sslmode=disable wins over heuristics', () => {
55
+ const c = buildUrlConnection('postgres://u:p@host.neon.tech/db?sslmode=disable');
56
+ expect(c.ssl).toBe(false);
57
+ });
58
+
59
+ it('explicit sslmode=no-verify produces relaxed SSL', () => {
60
+ const c = buildUrlConnection('postgres://u:p@host.example.com/db?sslmode=no-verify');
61
+ expect(c.ssl).toEqual({ rejectUnauthorized: false });
62
+ });
63
+
64
+ it('unknown remote host defaults to permissive SSL', () => {
65
+ const c = buildUrlConnection('postgres://u:p@unknown-host.example.com/db');
66
+ expect(c.ssl).toEqual({ rejectUnauthorized: false });
67
+ });
68
+
69
+ it('sets application_name=sigil by default', () => {
70
+ const c = buildUrlConnection('postgres://u:p@h.example.com/db');
71
+ expect(c.application_name).toBe('sigil');
72
+ });
73
+
74
+ it('rejects empty input', () => {
75
+ expect(() => buildUrlConnection('')).toThrow(/empty/);
76
+ });
77
+
78
+ it('rejects malformed URLs', () => {
79
+ expect(() => buildUrlConnection('not a url')).toThrow(/invalid URL/);
80
+ });
81
+ });
82
+
83
+ describe('classifyProvider', () => {
84
+ it('identifies common providers', () => {
85
+ expect(classifyProvider('postgres://u:p@ep-x.neon.tech/db')).toBe('neon');
86
+ expect(classifyProvider('postgres://u:p@x.supabase.co/db')).toBe('supabase');
87
+ expect(classifyProvider('postgres://u:p@x.pooler.supabase.com/db')).toBe('supabase-pooler');
88
+ expect(classifyProvider('postgres://u:p@x.rds.amazonaws.com/db')).toBe('aws-rds');
89
+ expect(classifyProvider('postgres://u:p@x.render.com/db')).toBe('render');
90
+ expect(classifyProvider('postgres://u:p@x.railway.app/db')).toBe('railway');
91
+ expect(classifyProvider('postgres://u:p@localhost/db')).toBe('local');
92
+ expect(classifyProvider('postgres://u:p@some-host.example.com/db')).toBe('unknown');
93
+ });
94
+ });
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Trigram index for entity name search.
3
+ *
4
+ * entities/store.js searchByName() runs `WHERE LOWER(name) LIKE '%q%'` on
5
+ * every search for short queries. A leading-wildcard LIKE can't use a normal
6
+ * B-tree index, so this was a sequential scan of the entity table that grew
7
+ * linearly with memory size. A GIN trigram index on LOWER(name) turns it into
8
+ * an index scan.
9
+ *
10
+ * The index expression must match the query expression exactly (LOWER(name)),
11
+ * otherwise the planner won't use it.
12
+ */
13
+ exports.up = async (knex) => {
14
+ await knex.raw('CREATE EXTENSION IF NOT EXISTS pg_trgm');
15
+ await knex.raw(`
16
+ CREATE INDEX IF NOT EXISTS entity_name_trgm_idx
17
+ ON entity USING GIN (LOWER(name) gin_trgm_ops)
18
+ `);
19
+ };
20
+
21
+ exports.down = async (knex) => {
22
+ await knex.raw('DROP INDEX IF EXISTS entity_name_trgm_idx');
23
+ // Leave the pg_trgm extension installed — other indexes or queries may rely
24
+ // on it, and dropping a shared extension on rollback is surprising.
25
+ };
@@ -245,7 +245,7 @@ h3.section-sub {
245
245
  font-size: var(--t-base);
246
246
  font-weight: 500;
247
247
  cursor: pointer;
248
- transition: background 80ms ease, border-color 80ms ease;
248
+ transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
249
249
  white-space: nowrap;
250
250
  }
251
251
  .btn:hover { background: var(--bg-surface-2); border-color: var(--border-strong); }
@@ -343,7 +343,7 @@ h3.section-sub {
343
343
  .table-wrap {
344
344
  background: var(--bg-surface);
345
345
  border: 1px solid var(--border);
346
- overflow: hidden;
346
+ overflow-x: auto;
347
347
  }
348
348
  table { width: 100%; border-collapse: collapse; }
349
349
  th, td {
@@ -362,7 +362,7 @@ thead th {
362
362
  letter-spacing: 0.06em;
363
363
  padding: var(--s-2) var(--s-4);
364
364
  }
365
- tbody tr { transition: background 80ms ease; }
365
+ tbody tr { transition: background var(--dur-1) var(--ease); }
366
366
  tbody tr:hover { background: var(--bg-surface-2); }
367
367
  tbody tr:last-child td { border-bottom: none; }
368
368
  td.mono { font-family: var(--font-mono); font-size: var(--t-sm); }
@@ -420,7 +420,7 @@ form textarea,
420
420
  background: var(--bg-canvas);
421
421
  color: var(--fg);
422
422
  font: var(--t-base) var(--font-mono);
423
- transition: border-color 80ms ease;
423
+ transition: border-color var(--dur-1) var(--ease);
424
424
  }
425
425
  form textarea { padding: var(--s-2) var(--s-3); height: auto; min-height: 80px; resize: vertical; }
426
426
  form select,
@@ -428,6 +428,7 @@ form select,
428
428
  form input:focus, form select:focus, form textarea:focus,
429
429
  .onboarding-content input:focus, .onboarding-content select:focus,
430
430
  .input:focus { outline: none; border-color: var(--accent); }
431
+ ::placeholder { color: var(--fg-3); opacity: 1; }
431
432
 
432
433
  form .row-2col,
433
434
  .onboarding-content .row-2col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
@@ -442,19 +443,22 @@ form .actions { display: flex; gap: var(--s-2); margin-top: var(--s-2); }
442
443
  .onboarding-content #ob-llm-fields,
443
444
  .onboarding-content #ob-emb-fields { max-width: 560px; }
444
445
 
445
- pre.result {
446
+ /* Shared box treatment for both pre (code output) and div (confirm prompts) */
447
+ .result {
446
448
  background: var(--bg-canvas);
447
449
  border: 1px solid var(--border);
448
450
  padding: var(--s-3) var(--s-4);
451
+ margin: var(--s-4) 0 0;
452
+ }
453
+ pre.result {
449
454
  font: var(--t-sm) var(--font-mono);
450
455
  white-space: pre-wrap;
451
456
  word-break: break-word;
452
457
  max-height: 320px;
453
458
  overflow: auto;
454
- margin: var(--s-4) 0 0;
455
459
  }
456
- pre.result.ok { border-color: rgba(78,196,108,0.30); }
457
- pre.result.err { border-color: rgba(226,100,100,0.30); }
460
+ .result.ok { border-color: rgba(78,196,108,0.30); }
461
+ .result.err { border-color: rgba(226,100,100,0.30); }
458
462
 
459
463
  /* ════════════════════════════════════════════════════════════════════════
460
464
  Badges + status pills
@@ -549,7 +553,7 @@ pre.result.err { border-color: rgba(226,100,100,0.30); }
549
553
  .trace-block-h { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-3); font-weight: 600; margin-bottom: var(--s-2); }
550
554
  .kvline { display: inline-block; margin-right: var(--s-4); font-size: var(--t-sm); }
551
555
  .kvline .muted { margin-right: 4px; }
552
- .synth { background: var(--bg-surface); border: 1px solid var(--border); border-left: 2px solid var(--accent); padding: var(--s-3) var(--s-4); font-size: var(--t-base); line-height: 1.55; }
556
+ .synth { background: var(--brand-tint); border: 1px solid rgba(0, 132, 255, 0.30); padding: var(--s-3) var(--s-4); font-size: var(--t-base); line-height: 1.55; }
553
557
  .trace-json { background: var(--bg-surface); border: 1px solid var(--border); padding: var(--s-3); font: var(--t-xs) var(--font-mono); white-space: pre-wrap; word-break: break-word; max-height: 360px; overflow: auto; margin: var(--s-2) 0 0; }
554
558
 
555
559
  .trace-table-wrap { border: 1px solid var(--border); overflow-x: auto; }
@@ -698,7 +702,7 @@ table.trace-table td.audm-cell { font-size: var(--t-xs); color: var(--fg-2); whi
698
702
  background: var(--bg-canvas);
699
703
  border: 1px solid var(--border-2);
700
704
  cursor: pointer;
701
- transition: border-color 80ms ease;
705
+ transition: border-color var(--dur-1) var(--ease);
702
706
  }
703
707
  .radio-card:hover { border-color: var(--accent); }
704
708
  .radio-card input { width: auto; height: auto; margin-top: 3px; accent-color: var(--accent); }
@@ -831,7 +835,7 @@ table.trace-table td.audm-cell { font-size: var(--t-xs); color: var(--fg-2); whi
831
835
  background: var(--bg-surface);
832
836
  border: 1px solid var(--border);
833
837
  cursor: pointer;
834
- transition: border-color 80ms ease, background 80ms ease;
838
+ transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
835
839
  }
836
840
  .provider-card:hover { border-color: var(--border-strong); }
837
841
  .provider-card.selected {
@@ -952,7 +956,7 @@ footer .footer-inner {
952
956
  .setup-progress { margin-top: var(--s-4); }
953
957
  .setup-progress-bar {
954
958
  height: 8px;
955
- border-radius: 999px;
959
+ border-radius: var(--radius-1);
956
960
  background: var(--surface-2);
957
961
  border: 1px solid var(--border);
958
962
  overflow: hidden;
@@ -962,8 +966,8 @@ footer .footer-inner {
962
966
  height: 100%;
963
967
  width: 0;
964
968
  background: var(--accent);
965
- border-radius: 999px;
966
- transition: width .35s ease;
969
+ border-radius: var(--radius-1);
970
+ transition: width .35s var(--ease);
967
971
  }
968
972
  .setup-progress-label {
969
973
  margin-top: var(--s-2);
@@ -986,8 +990,8 @@ footer .footer-inner {
986
990
  list-style: none;
987
991
  background: var(--bg-surface-2, var(--surface-2));
988
992
  border: 1px solid var(--border-strong, var(--border));
989
- border-radius: 10px;
990
- box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
993
+ border-radius: var(--radius-2);
994
+ box-shadow: var(--shadow-pop);
991
995
  }
992
996
  .combo-list li {
993
997
  display: flex;
@@ -995,7 +999,7 @@ footer .footer-inner {
995
999
  justify-content: space-between;
996
1000
  gap: 16px;
997
1001
  padding: 7px 10px;
998
- border-radius: 6px;
1002
+ border-radius: var(--radius-1);
999
1003
  cursor: pointer;
1000
1004
  }
1001
1005
  .combo-list li:hover { background: var(--accent); color: var(--accent-fg); }
@@ -1012,7 +1016,7 @@ footer .footer-inner {
1012
1016
  display: flex;
1013
1017
  align-items: center;
1014
1018
  justify-content: center;
1015
- background: var(--bg-0, #0a0a0c);
1019
+ background: var(--bg-0, #08090b);
1016
1020
  opacity: 1;
1017
1021
  transition: opacity 0.5s ease;
1018
1022
  }
@@ -1047,3 +1051,141 @@ footer .footer-inner {
1047
1051
  0%, 100% { transform: scale(1); opacity: 0.9; }
1048
1052
  50% { transform: scale(1.06); opacity: 1; }
1049
1053
  }
1054
+
1055
+ /* ════════════════════════════════════════════════════════════════════════
1056
+ RESPONSIVE ADAPTATIONS
1057
+ Breakpoints: 768px (tablet / narrow laptop), 480px (small phone).
1058
+ Touch targets: pointer:coarse handles touch independently of screen size.
1059
+ Desktop layout is unchanged; all rules below layer on top.
1060
+ ════════════════════════════════════════════════════════════════════════ */
1061
+
1062
+ /* ── Touch target uplift — applies at any screen size with a coarse pointer ── */
1063
+ @media (pointer: coarse) {
1064
+ .btn { min-height: 40px; }
1065
+ .btn.small { min-height: 36px; }
1066
+ .btn.large { min-height: 48px; }
1067
+ .chip { min-height: 40px; }
1068
+ nav a { min-height: 44px; }
1069
+ .copy-btn { min-height: 32px; min-width: 32px; }
1070
+ .modal-close { min-height: 44px; min-width: 44px; }
1071
+ .trace-head { min-height: 44px; }
1072
+ }
1073
+
1074
+ /* ── ≤ 768px — tablet / landscape phone ───────────────────────────────────── */
1075
+ @media (max-width: 768px) {
1076
+
1077
+ /* Nav: scroll horizontally instead of wrapping to a second line */
1078
+ nav {
1079
+ overflow-x: auto;
1080
+ -webkit-overflow-scrolling: touch;
1081
+ scrollbar-width: none;
1082
+ flex-shrink: 1;
1083
+ min-width: 0;
1084
+ }
1085
+ nav::-webkit-scrollbar { display: none; }
1086
+ nav a { white-space: nowrap; flex-shrink: 0; }
1087
+
1088
+ /* Reduce page horizontal padding */
1089
+ main { padding: var(--s-5) var(--s-4) var(--s-7); }
1090
+
1091
+ /* Section heads: stack title above action buttons */
1092
+ .section-head {
1093
+ flex-direction: column;
1094
+ align-items: flex-start;
1095
+ gap: var(--s-3);
1096
+ padding-bottom: var(--s-4);
1097
+ margin-bottom: var(--s-4);
1098
+ }
1099
+ .section-head .actions { align-self: flex-start; }
1100
+
1101
+ /* KV rows: stack key above value for long monospace values */
1102
+ .kv .row {
1103
+ grid-template-columns: 1fr;
1104
+ gap: 2px;
1105
+ padding: var(--s-3) var(--s-4);
1106
+ }
1107
+ .kv .row .k {
1108
+ font-size: var(--t-xs);
1109
+ text-transform: uppercase;
1110
+ letter-spacing: 0.04em;
1111
+ color: var(--fg-4);
1112
+ }
1113
+ .kv .row .v { font-size: var(--t-sm); }
1114
+
1115
+ /* Two-column form rows collapse to single column */
1116
+ form .row-2col,
1117
+ .onboarding-content .row-2col { grid-template-columns: 1fr; }
1118
+
1119
+ /* Forms: allow full width (remove 560px cap) */
1120
+ .view form.panel,
1121
+ .onboarding-content .wizard-step .field,
1122
+ .onboarding-content #ob-db-url,
1123
+ .onboarding-content #ob-db-fields,
1124
+ .onboarding-content #ob-llm-fields,
1125
+ .onboarding-content #ob-emb-fields { max-width: 100%; }
1126
+
1127
+ /* Modal: full width with viewport margin */
1128
+ .modal { padding: var(--s-7) var(--s-3) var(--s-3); }
1129
+ .modal-body { max-width: 100%; }
1130
+
1131
+ /* Onboarding: collapse sidebar — progress bar + h1 orient the user */
1132
+ .onboarding { grid-template-columns: 1fr; }
1133
+ .onboarding-sidebar { display: none; }
1134
+ .onboarding-content {
1135
+ padding: var(--s-5) var(--s-5) var(--s-7);
1136
+ max-width: 100%;
1137
+ }
1138
+ .onboarding-content h1 { font-size: var(--t-2xl); }
1139
+
1140
+ /* Provider cards: allow wrapping to fewer columns on narrower screens */
1141
+ .provider-card-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
1142
+
1143
+ /* Stat grid: tighter minimum so 2 stats can sit side-by-side at 768px */
1144
+ .stat-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
1145
+ }
1146
+
1147
+ /* ── ≤ 480px — small phone ─────────────────────────────────────────────────── */
1148
+ @media (max-width: 480px) {
1149
+
1150
+ /* Header: tighter padding, hide version badge to free nav space */
1151
+ .header-inner { padding: 0 var(--s-3); }
1152
+ .brand { padding-right: var(--s-3); margin-right: var(--s-3); }
1153
+ .brand-badge { display: none; }
1154
+
1155
+ /* Reduce page padding further */
1156
+ main { padding: var(--s-4) var(--s-3) var(--s-6); }
1157
+ .onboarding-content { padding: var(--s-4) var(--s-3) var(--s-5); }
1158
+
1159
+ /* Stat grid: single column */
1160
+ .stat-grid { grid-template-columns: 1fr; }
1161
+
1162
+ /* Activity list: hide namespace and duration to give summary more room */
1163
+ .trace-ns { display: none; }
1164
+ .trace-dur { display: none; }
1165
+
1166
+ /* Wizard actions: stack Continue above Back, both full-width */
1167
+ .wizard-actions {
1168
+ flex-direction: column-reverse;
1169
+ gap: var(--s-2);
1170
+ }
1171
+ .wizard-actions .spacer { display: none; }
1172
+ #setup-back,
1173
+ #setup-run { width: 100%; justify-content: center; }
1174
+ }
1175
+
1176
+ /* ════════════════════════════════════════════════════════════════════════
1177
+ REDUCED MOTION
1178
+ Kill all animation and transition durations when the OS requests it.
1179
+ 0.01ms keeps JS animationend/transitionend listeners firing correctly
1180
+ while making motion imperceptible.
1181
+ ════════════════════════════════════════════════════════════════════════ */
1182
+ @media (prefers-reduced-motion: reduce) {
1183
+ *,
1184
+ *::before,
1185
+ *::after {
1186
+ animation-duration: 0.01ms !important;
1187
+ animation-iteration-count: 1 !important;
1188
+ transition-duration: 0.01ms !important;
1189
+ scroll-behavior: auto !important;
1190
+ }
1191
+ }