@anmol-srv/sigil 0.11.0 → 0.12.1

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.11.0",
3
+ "version": "0.12.1",
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": {
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Central RPC client — the one door from the GUI to the daemon. Mirrors the
3
+ * cohort-live-web axios-wrapper convention: a single place that adds context
4
+ * and turns a structured daemon error ({code,message,hint}) into a toast.
5
+ *
6
+ * Pass { quiet: true } to suppress the auto-toast (e.g. when a caller renders
7
+ * the error inline). The thrown Error carries .code/.hint for callers.
8
+ */
9
+ import { toast } from './toast.js';
10
+
11
+ export async function rpc(method, params = {}, { quiet = false } = {}) {
12
+ let body;
13
+ try {
14
+ const res = await fetch('/api/v1/rpc', {
15
+ method: 'POST',
16
+ headers: { 'Content-Type': 'application/json' },
17
+ credentials: 'same-origin',
18
+ body: JSON.stringify({ method, params }),
19
+ });
20
+ body = await res.json();
21
+ } catch {
22
+ const e = {
23
+ code: 'NETWORK',
24
+ message: 'Could not reach the Sigil daemon.',
25
+ hint: 'Is it running? Try `sigil daemon status`.',
26
+ };
27
+ if (!quiet) toast({ variant: 'error', message: e.message, hint: e.hint, code: e.code });
28
+ throw Object.assign(new Error(e.message), e);
29
+ }
30
+
31
+ if (!body || body.ok !== true) {
32
+ const e = body?.error || { code: 'UNKNOWN', message: 'request failed' };
33
+ if (!quiet) toast({ variant: 'error', message: e.message, hint: e.hint, code: e.code });
34
+ throw Object.assign(new Error(e.message || 'request failed'), e);
35
+ }
36
+ return body.data;
37
+ }
@@ -5,45 +5,45 @@
5
5
  ════════════════════════════════════════════════════════════════════════ */
6
6
 
7
7
  :root {
8
- /* ── Color tokens (OKLCH-style flat dark) ──────────────────────────── */
9
- --bg-canvas: #07080a; /* page background */
10
- --bg-surface: #0f1115; /* card / panel */
11
- --bg-surface-2: #161920; /* nested panel / hover */
12
- --bg-surface-3: #1d2129; /* tertiary */
13
- --bg-overlay: rgba(7,8,10,0.78);
14
-
15
- --fg: #e8eaee;
16
- --fg-2: #b6bcc7;
17
- --fg-3: #828893;
18
- --fg-4: #565b66;
19
-
20
- --border: #1f2229;
21
- --border-2: #2c3038;
22
- --border-strong: #3a3f49;
23
-
24
- --accent: #5e8cff;
25
- --accent-2: #466ce0;
26
- --accent-fg: #ffffff;
27
-
28
- --ok: #4ec46c;
29
- --ok-bg: rgba(78,196,108,0.10);
30
- --warn: #e8a94a;
31
- --warn-bg: rgba(232,169,74,0.10);
32
- --err: #e26464;
33
- --err-bg: rgba(226,100,100,0.10);
34
- --info-bg: rgba(94,140,255,0.10);
35
-
36
- /* ── Spacing scale (multiples of 4px) ──────────────────────────────── */
37
- --s-1: 4px;
38
- --s-2: 8px;
39
- --s-3: 12px;
40
- --s-4: 16px;
41
- --s-5: 24px;
42
- --s-6: 32px;
43
- --s-7: 48px;
44
- --s-8: 64px;
45
-
46
- /* ── Type scale ────────────────────────────────────────────────────── */
8
+ /* ── Re-skinned onto the Sigil design system ───────────────────────────
9
+ design/colors_and_type.css (linked BEFORE this file) owns the brand:
10
+ palette, Geist/Geist Mono type, 4px spacing, sharp geometry. Here we
11
+ re-point this dashboard's local token names at those design tokens, so
12
+ every existing rule adopts the brand with no markup churn.
13
+
14
+ Names that ALSO exist in the design tokens (--fg-2/3/4, --border-2,
15
+ --border-strong, --ok, --warn, --font-mono, --focus-ring) are deliberately
16
+ NOT redefined here — the design values flow through unchanged. */
17
+
18
+ /* surfaces (app-local aliases → design surfaces) */
19
+ --bg-canvas: var(--bg-1);
20
+ --bg-surface: var(--surface-1);
21
+ --bg-surface-2: var(--surface-2);
22
+ --bg-surface-3: var(--surface-3);
23
+ --bg-overlay: rgba(8, 9, 11, 0.78);
24
+
25
+ /* text + borders */
26
+ --fg: var(--fg-1);
27
+ --border: var(--border-1);
28
+
29
+ /* brand / accent — the only chromatic UI color is brand blue */
30
+ --accent: var(--brand);
31
+ --accent-2: var(--brand-deep);
32
+ --accent-fg: #ffffff;
33
+
34
+ /* status: foreground --ok/--warn come from design tokens; backgrounds map
35
+ to the design's restrained tints (used only as small dot/row washes) */
36
+ --ok-bg: var(--ok-tint);
37
+ --warn-bg: var(--warn-tint);
38
+ --err: var(--danger);
39
+ --err-bg: var(--danger-tint);
40
+ --info-bg: var(--brand-tint);
41
+
42
+ /* spacing → design 4px grid */
43
+ --s-1: var(--sp-1); --s-2: var(--sp-2); --s-3: var(--sp-3); --s-4: var(--sp-4);
44
+ --s-5: var(--sp-5); --s-6: var(--sp-6); --s-7: var(--sp-7); --s-8: var(--sp-8);
45
+
46
+ /* type scale (px; hierarchy preserved) */
47
47
  --t-xs: 11px;
48
48
  --t-sm: 12px;
49
49
  --t-base: 13px;
@@ -55,21 +55,19 @@
55
55
  --lh: 1.5;
56
56
  --lh-tight: 1.25;
57
57
 
58
- /* ── Fonts ─────────────────────────────────────────────────────────── */
59
- --font-ui: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text",
60
- system-ui, "Segoe UI", Roboto, sans-serif;
61
- --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Roboto Mono", monospace;
58
+ /* fonts Geist (UI) / Geist Mono (data). --font-mono flows from design. */
59
+ --font-ui: var(--font-sans);
62
60
 
63
- /* ── Layout ────────────────────────────────────────────────────────── */
64
- --container: 1200px;
65
- --sidebar: 232px;
66
- --header-h: 52px;
67
-
68
- /* ── Misc ──────────────────────────────────────────────────────────── */
69
- --focus-ring: 0 0 0 2px var(--accent);
61
+ /* layout header height matches the design's 64px top bar */
62
+ --container: 1200px;
63
+ --sidebar: 232px;
64
+ --header-h: var(--nav-h);
70
65
  }
71
66
 
72
67
  * { box-sizing: border-box; }
68
+ /* `hidden` must win over component display rules (e.g. .provider-card flex),
69
+ so JS-toggled cards/panes (Docker mode when unavailable) actually hide. */
70
+ [hidden] { display: none !important; }
73
71
  html, body { margin: 0; height: 100%; }
74
72
  body {
75
73
  background: var(--bg-canvas);
@@ -881,3 +879,69 @@ footer .footer-inner {
881
879
  .flex-row { display: flex; align-items: center; gap: var(--s-3); }
882
880
  .text-sm { font-size: var(--t-sm); }
883
881
  .text-xs { font-size: var(--t-xs); }
882
+
883
+ /* ════════════════════════════════════════════════════════════════════════
884
+ Design-system components (Phase 7/8) — toasts, connector cards, DB flow.
885
+ All sharp-edged, hairline-bordered, status as a 7px square + word.
886
+ ════════════════════════════════════════════════════════════════════════ */
887
+
888
+ /* ── Toasts ─────────────────────────────────────────────────────────────── */
889
+ .toast-stack {
890
+ position: fixed; top: var(--s-4); right: var(--s-4); z-index: 100;
891
+ display: flex; flex-direction: column; gap: var(--s-2); max-width: 400px;
892
+ }
893
+ .toast {
894
+ display: flex; gap: var(--s-3); align-items: flex-start;
895
+ background: var(--surface-1); border: 1px solid var(--border-2);
896
+ padding: var(--s-3) var(--s-4); box-shadow: var(--shadow-pop);
897
+ }
898
+ .toast-sq { width: 7px; height: 7px; margin-top: 6px; flex: none; background: var(--fg-3); }
899
+ .toast-error .toast-sq { background: var(--danger); }
900
+ .toast-success .toast-sq { background: var(--ok); }
901
+ .toast-info .toast-sq { background: var(--brand); }
902
+ .toast-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
903
+ .toast-msg { font-size: var(--t-base); color: var(--fg-1); line-height: 1.4; }
904
+ .toast-hint { font-size: var(--t-sm); color: var(--fg-3); line-height: 1.4; }
905
+ .toast-code {
906
+ align-self: flex-start; margin-top: 2px; font-family: var(--font-mono);
907
+ font-size: var(--t-xs); color: var(--fg-4); border: 1px solid var(--border-2);
908
+ padding: 1px 6px; border-radius: var(--radius-1);
909
+ }
910
+ .toast-x { background: none; border: none; color: var(--fg-4); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; }
911
+ .toast-x:hover { color: var(--fg-2); }
912
+
913
+ /* ── Connector cards (click-to-connect) ─────────────────────────────────── */
914
+ .connector-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s-3); margin-top: var(--s-4); }
915
+ .connector-card {
916
+ display: flex; flex-direction: column; gap: var(--s-2);
917
+ border: 1px solid var(--border-2); background: var(--surface-1);
918
+ padding: var(--s-4); border-radius: var(--radius-0);
919
+ }
920
+ .connector-card .cc-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
921
+ .connector-card .cc-name { font-size: var(--t-md); font-weight: var(--w-semibold); color: var(--fg-1); }
922
+ .connector-card .cc-hint { font-size: var(--t-sm); color: var(--fg-3); line-height: 1.45; }
923
+ .connector-card.unavailable { opacity: 0.55; }
924
+ .connector-card .cc-actions { margin-top: var(--s-2); }
925
+
926
+ /* status square + word (shared) */
927
+ .status-dot { display: inline-flex; align-items: center; gap: 7px; font-size: var(--t-sm); font-weight: 500; }
928
+ .status-dot .sq { width: 7px; height: 7px; flex: none; background: var(--fg-3); }
929
+ .status-dot.ok { color: var(--ok); } .status-dot.ok .sq { background: var(--ok); }
930
+ .status-dot.warn { color: var(--warn); } .status-dot.warn .sq { background: var(--warn); }
931
+ .status-dot.danger { color: var(--danger); } .status-dot.danger .sq { background: var(--danger); }
932
+ .status-dot.muted { color: var(--fg-3); } .status-dot.muted .sq { background: var(--fg-4); }
933
+
934
+ /* ── DB guided flow (linear status rows, replaces button-toggling) ──────── */
935
+ .db-flow { border: 1px solid var(--border-2); background: var(--surface-1); margin-top: var(--s-4); }
936
+ .db-flow-row {
937
+ display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: var(--s-3);
938
+ padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border-1);
939
+ }
940
+ .db-flow-row:last-child { border-bottom: none; }
941
+ .db-flow-row .step-sq { width: 8px; height: 8px; background: var(--fg-4); justify-self: center; }
942
+ .db-flow-row.active .step-sq { background: var(--brand); }
943
+ .db-flow-row.done .step-sq { background: var(--ok); }
944
+ .db-flow-row.error .step-sq { background: var(--danger); }
945
+ .db-flow-row .step-label { font-size: var(--t-base); color: var(--fg-2); }
946
+ .db-flow-row.done .step-label, .db-flow-row.active .step-label { color: var(--fg-1); }
947
+ .db-flow-row .step-detail { font-family: var(--font-mono); font-size: var(--t-sm); color: var(--fg-3); }