total-recall-brain 3.28.2 → 3.30.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.
Files changed (134) hide show
  1. package/bin/total-recall.mjs +24 -1
  2. package/docs/ARCHITECTURE.md +26 -18
  3. package/extension/background.js +259 -84
  4. package/extension/content-script.css +7 -13
  5. package/extension/content-script.js +252 -477
  6. package/extension/icons/icon-128.png +0 -0
  7. package/extension/icons/icon-16.png +0 -0
  8. package/extension/icons/icon-32.png +0 -0
  9. package/extension/icons/icon-48.png +0 -0
  10. package/extension/icons/mark.svg +6 -0
  11. package/extension/lib/brain-client.js +160 -73
  12. package/extension/lib/tokens.css +187 -0
  13. package/extension/lib/ui-helpers.js +229 -0
  14. package/extension/lib/ui-helpers.spec.mjs +94 -0
  15. package/extension/manifest.json +20 -5
  16. package/extension/options/options.css +64 -218
  17. package/extension/options/options.html +91 -43
  18. package/extension/options/options.js +208 -85
  19. package/extension/sidepanel/sidepanel.css +268 -970
  20. package/extension/sidepanel/sidepanel.html +200 -166
  21. package/extension/sidepanel/sidepanel.js +788 -942
  22. package/frontend/dist/assets/index-DGMNZi_1.js +5742 -0
  23. package/frontend/dist/index.html +1 -1
  24. package/frontend/src/api/plugins.ts +124 -92
  25. package/frontend/src/components/ResearchAgendaTab.spec.tsx +11 -0
  26. package/frontend/src/components/ResearchAgendaTab.tsx +19 -14
  27. package/frontend/src/pages/PluginsPage.spec.tsx +87 -16
  28. package/frontend/src/pages/PluginsPage.tsx +454 -1218
  29. package/package.json +2 -1
  30. package/plugins/code-quality/README.md +25 -0
  31. package/plugins/code-quality/cli.mjs +25 -0
  32. package/plugins/code-quality/plugin.json +17 -0
  33. package/plugins/git-sentinel/README.md +27 -0
  34. package/{scaffold/.agent/plugins → plugins}/git-sentinel/cli.mjs +8 -5
  35. package/plugins/git-sentinel/plugin.json +18 -0
  36. package/plugins/system-monitor/README.md +26 -0
  37. package/{scaffold/.agent/plugins → plugins}/system-monitor/cli.mjs +5 -4
  38. package/{scaffold/.agent/plugins → plugins}/system-monitor/generator.mjs +4 -5
  39. package/plugins/system-monitor/plugin.json +29 -0
  40. package/scaffold/.agent/skills/meta-harness/SKILL.md +4 -4
  41. package/scaffold/.agent/skills/plugins/SKILL.md +53 -0
  42. package/scaffold/.agent/skills/total-recall/SKILL.md +22 -6
  43. package/scaffold/.agent/skills/total-recall/scripts/brain-state.json +1 -0
  44. package/src/cli/agent.mjs +1 -1
  45. package/src/cli/app/index.mjs +493 -0
  46. package/src/cli/brain.mjs +33 -3
  47. package/src/cli/command.mjs +80 -41
  48. package/src/cli/connect.mjs +10 -1
  49. package/src/cli/harness.mjs +1 -1
  50. package/src/cli/init.mjs +3 -1
  51. package/src/cli/mesh.mjs +118 -12
  52. package/src/cli/plugin/create.mjs +144 -25
  53. package/src/cli/plugin/index.mjs +83 -53
  54. package/src/cli/plugin/install.mjs +10 -127
  55. package/src/cli/plugin/list.mjs +44 -44
  56. package/src/cli/plugin/remove.mjs +23 -30
  57. package/src/cli/plugin/scaffold-cmd.mjs +30 -0
  58. package/src/cli/plugin/search.mjs +108 -23
  59. package/src/cli/rebuild.mjs +37 -1
  60. package/src/cli/recall.mjs +17 -2
  61. package/src/cli/research.mjs +4 -6
  62. package/src/cli/share.mjs +2 -0
  63. package/src/core/app-deploy/apply.mjs +386 -0
  64. package/src/core/app-deploy/design-tokens.mjs +217 -0
  65. package/src/core/app-deploy/plan.mjs +249 -0
  66. package/src/core/app-deploy/resolve.mjs +295 -0
  67. package/src/core/app-deploy/source.mjs +337 -0
  68. package/src/core/app-deploy/standalone.mjs +248 -0
  69. package/src/core/app-deploy/upgrade.mjs +256 -0
  70. package/src/core/app-deploy/verify.mjs +213 -0
  71. package/src/core/bound-hosts.mjs +1 -1
  72. package/src/core/brain-registry.mjs +146 -0
  73. package/src/core/brain-state.json +1 -0
  74. package/src/core/daemon-loop.mjs +30 -26
  75. package/src/core/dream.mjs +5 -17
  76. package/src/core/fact-seeker.mjs +53 -368
  77. package/src/core/lan-discovery.mjs +3 -3
  78. package/src/core/mesh-access-sync.mjs +134 -0
  79. package/src/core/mesh-access.mjs +18 -3
  80. package/src/core/mesh-discover.mjs +173 -0
  81. package/src/core/mesh.mjs +131 -32
  82. package/src/core/optimizer.mjs +4 -41
  83. package/src/core/plugin-bundle.mjs +167 -0
  84. package/src/core/plugin-context.mjs +8 -13
  85. package/src/core/plugin-loader.mjs +272 -68
  86. package/src/core/plugin-peers.mjs +163 -0
  87. package/src/core/plugin-public.mjs +85 -0
  88. package/src/core/plugin-runner-child.mjs +24 -0
  89. package/src/core/plugin-runner.mjs +102 -0
  90. package/src/core/plugin-store.mjs +384 -0
  91. package/src/core/plugin-tasks.mjs +212 -0
  92. package/src/core/post-mortem.mjs +40 -9
  93. package/src/core/research-gate.mjs +182 -0
  94. package/src/core/research-queue.mjs +47 -7
  95. package/src/core/research-surface.mjs +211 -0
  96. package/src/core/research.mjs +25 -32
  97. package/src/core/scheduler.mjs +67 -153
  98. package/src/core/schema.mjs +129 -0
  99. package/src/core/search.mjs +12 -1
  100. package/src/core/secret-integration-research.mjs +12 -8
  101. package/src/core/secrets-store.mjs +76 -2
  102. package/src/core/session-watcher.mjs +6 -0
  103. package/src/core/surface.mjs +64 -3
  104. package/src/core/task-executors.mjs +8 -45
  105. package/src/core/vault-cache.mjs +70 -4
  106. package/src/server/api.mjs +21 -0
  107. package/src/server/rest.mjs +2 -0
  108. package/src/server/route-manifest.json +21 -5
  109. package/src/server/routes/collab.mjs +38 -11
  110. package/src/server/routes/extension.mjs +3 -2
  111. package/src/server/routes/memory.mjs +24 -2
  112. package/src/server/routes/mesh.mjs +7 -7
  113. package/src/server/routes/plugins-mesh.mjs +49 -0
  114. package/src/server/routes/plugins.mjs +91 -426
  115. package/src/server/routes/research.mjs +5 -2
  116. package/src/server/routes/share.mjs +2 -0
  117. package/src/server/tools.mjs +29 -2
  118. package/extension/icons/README.md +0 -27
  119. package/extension/lib/preconfigured.js +0 -5
  120. package/extension/popup/popup.css +0 -227
  121. package/extension/popup/popup.html +0 -50
  122. package/extension/popup/popup.js +0 -175
  123. package/frontend/dist/assets/index-U7o-qU99.js +0 -5742
  124. package/scaffold/.agent/plugins/.gitkeep +0 -0
  125. package/scaffold/.agent/plugins/code-quality/README.md +0 -16
  126. package/scaffold/.agent/plugins/code-quality/cli.mjs +0 -15
  127. package/scaffold/.agent/plugins/code-quality/plugin.json +0 -34
  128. package/scaffold/.agent/plugins/git-sentinel/README.md +0 -16
  129. package/scaffold/.agent/plugins/git-sentinel/plugin.json +0 -34
  130. package/scaffold/.agent/plugins/meta-harness/README.md +0 -16
  131. package/scaffold/.agent/plugins/meta-harness/cli.mjs +0 -34
  132. package/scaffold/.agent/plugins/meta-harness/plugin.json +0 -34
  133. package/scaffold/.agent/plugins/system-monitor/README.md +0 -16
  134. package/scaffold/.agent/plugins/system-monitor/plugin.json +0 -38
@@ -2,208 +2,242 @@
2
2
  <html lang="en">
3
3
  <head>
4
4
  <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
5
6
  <title>Total Recall</title>
7
+ <link rel="stylesheet" href="../lib/tokens.css">
6
8
  <link rel="stylesheet" href="sidepanel.css">
7
9
  </head>
8
10
  <body>
9
- <div class="panel">
10
- <!-- Header -->
11
- <header class="panel-header">
12
- <h1>🧠 Total Recall</h1>
13
- <div style="display: flex; align-items: center; gap: 8px;">
14
- <span id="active-brain-badge" class="badge">Global</span>
15
- <div id="connection-dot" class="dot"></div>
11
+ <!-- Icon sprite (lucide-style, 24px grid) -->
12
+ <svg width="0" height="0" style="position:absolute" aria-hidden="true">
13
+ <symbol id="i-search" viewBox="0 0 24 24"><circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/></symbol>
14
+ <symbol id="i-pin" viewBox="0 0 24 24"><path d="M12 17v5"/><path d="M9 10.76V6h6v4.76l1.8 2.4A1 1 0 0 1 16 15H8a1 1 0 0 1-.8-1.6z"/><path d="M8 3h8"/></symbol>
15
+ <symbol id="i-flask" viewBox="0 0 24 24"><path d="M9 3h6"/><path d="M10 3v6.5L4.6 18.2A1.8 1.8 0 0 0 6.1 21h11.8a1.8 1.8 0 0 0 1.5-2.8L14 9.5V3"/><path d="M7.5 15h9"/></symbol>
16
+ <symbol id="i-note" viewBox="0 0 24 24"><path d="M12 20h9"/><path d="M16.4 3.6a2 2 0 1 1 2.8 2.8L7 18.6 3 20l1.4-4z"/></symbol>
17
+ <symbol id="i-send" viewBox="0 0 24 24"><path d="M5 12h13"/><path d="m12 5 7 7-7 7"/></symbol>
18
+ <symbol id="i-settings" viewBox="0 0 24 24"><path d="M4 7h10M18 7h2M4 17h4M12 17h8"/><circle cx="16" cy="7" r="2"/><circle cx="10" cy="17" r="2"/></symbol>
19
+ <symbol id="i-close" viewBox="0 0 24 24"><path d="M18 6 6 18M6 6l12 12"/></symbol>
20
+ <symbol id="i-check" viewBox="0 0 24 24"><path d="m5 12.5 4.5 4.5L19 7.5"/></symbol>
21
+ <symbol id="i-external" viewBox="0 0 24 24"><path d="M14 4h6v6"/><path d="M20 4 11 13"/><path d="M19 14v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h4"/></symbol>
22
+ <symbol id="i-refresh" viewBox="0 0 24 24"><path d="M20 11a8 8 0 0 0-14.3-4.9L4 8"/><path d="M4 4v4h4"/><path d="M4 13a8 8 0 0 0 14.3 4.9L20 16"/><path d="M20 20v-4h-4"/></symbol>
23
+ <symbol id="i-trash" viewBox="0 0 24 24"><path d="M4 7h16"/><path d="M10 11v6M14 11v6"/><path d="M6 7l1 12a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-12"/><path d="M9 7V4h6v3"/></symbol>
24
+ <symbol id="i-globe" viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="M3 12h18"/><path d="M12 3a14 14 0 0 1 0 18 14 14 0 0 1 0-18z"/></symbol>
25
+ <symbol id="i-sparkle" viewBox="0 0 24 24"><path d="M12 3v4M12 17v4M3 12h4M17 12h4"/><path d="m6.3 6.3 2.1 2.1M15.6 15.6l2.1 2.1M6.3 17.7l2.1-2.1M15.6 8.4l2.1-2.1"/></symbol>
26
+ <symbol id="i-plug" viewBox="0 0 24 24"><path d="M9 3v5M15 3v5"/><path d="M6 8h12v3a6 6 0 0 1-12 0z"/><path d="M12 17v4"/></symbol>
27
+ <symbol id="i-layers" viewBox="0 0 24 24"><path d="m12 3 9 5-9 5-9-5z"/><path d="m3 13 9 5 9-5"/></symbol>
28
+ <symbol id="i-ban" viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="m5.6 5.6 12.8 12.8"/></symbol>
29
+ <symbol id="i-keyboard" viewBox="0 0 24 24"><rect x="2.5" y="6" width="19" height="12" rx="2"/><path d="M6.5 10h.01M10 10h.01M14 10h.01M17.5 10h.01M7 14h10"/></symbol>
30
+ <symbol id="i-bolt" viewBox="0 0 24 24"><path d="M13 3 5 13.5h6L10 21l8-10.5h-6z"/></symbol>
31
+ <symbol id="i-chat" viewBox="0 0 24 24"><path d="M20 12a8 8 0 0 1-11.6 7.1L4 20l1-4.2A8 8 0 1 1 20 12z"/></symbol>
32
+ <symbol id="i-brain" viewBox="0 0 24 24"><path d="M6 20V11a6 6 0 0 1 12 0v9"/><path d="M9.5 20v-8.5a2.5 2.5 0 0 1 5 0V20"/><path d="M4 20h16"/></symbol>
33
+ <symbol id="i-clock" viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/></symbol>
34
+ </svg>
35
+
36
+ <div class="app" id="app">
37
+ <header class="topbar">
38
+ <div class="brand">
39
+ <img src="../icons/mark.svg" alt="" class="brand-mark" width="22" height="22">
40
+ <span class="brand-name">Total Recall</span>
16
41
  </div>
42
+ <button class="brain-chip" id="brain-chip" type="button" title="Active brain — change in settings">
43
+ <span class="status-dot" id="status-dot" aria-hidden="true"></span>
44
+ <span id="brain-chip-label">Global</span>
45
+ </button>
46
+ <button class="icon-btn" id="btn-open-settings" type="button" aria-label="Settings" title="Settings">
47
+ <svg class="icon"><use href="#i-settings"/></svg>
48
+ </button>
17
49
  </header>
18
50
 
19
- <!-- Tab Navigation Bar -->
20
- <nav class="tab-bar">
21
- <button class="tab-btn active" data-tab="memories">🧠 Memories</button>
22
- <button class="tab-btn" data-tab="chat">💬 Chat</button>
23
- <button class="tab-btn" data-tab="research">🔬 Research</button>
24
- <button class="tab-btn" data-tab="settings">⚙️ Settings</button>
25
- <button class="tab-btn" data-tab="collab">👥 Collab</button>
51
+ <nav class="tabs" role="tablist" aria-label="Sections">
52
+ <button class="tab is-active" role="tab" id="tab-btn-recall" aria-controls="tab-recall" aria-selected="true" data-tab="recall">
53
+ <svg class="icon sm"><use href="#i-brain"/></svg>Recall
54
+ </button>
55
+ <button class="tab" role="tab" id="tab-btn-chat" aria-controls="tab-chat" aria-selected="false" data-tab="chat" tabindex="-1">
56
+ <svg class="icon sm"><use href="#i-chat"/></svg>Chat
57
+ </button>
58
+ <button class="tab" role="tab" id="tab-btn-research" aria-controls="tab-research" aria-selected="false" data-tab="research" tabindex="-1">
59
+ <svg class="icon sm"><use href="#i-flask"/></svg>Research
60
+ <span class="tab-count" id="research-active-count" hidden></span>
61
+ </button>
62
+ <span class="tab-indicator" aria-hidden="true"></span>
26
63
  </nav>
27
64
 
28
- <!-- Tab Panels Container -->
29
- <div class="tab-content-container">
30
-
31
- <!-- Panel 1: Memories -->
32
- <section id="tab-memories" class="tab-panel active">
33
- <div class="search-box">
34
- <input type="text" id="search-input" placeholder="Search your brain..." />
35
- </div>
36
- <div id="memories-list" class="memories-list"></div>
37
- <div class="quick-actions">
38
- <button id="btn-remember" class="action-btn">📌 Remember Page</button>
39
- <button id="btn-research" class="action-btn">🔬 Research Page</button>
40
- <button id="btn-note" class="action-btn">📝 Quick Note</button>
41
- </div>
42
- <div id="note-area" class="note-area hidden">
43
- <textarea id="note-input" placeholder="Type your note..."></textarea>
44
- <div class="note-actions">
45
- <button id="btn-save-note" class="action-btn accent">Save Note</button>
46
- <button id="btn-cancel-note" class="action-btn">Cancel</button>
65
+ <!-- Connection gate: replaces all panes while the brain is unreachable/unauthorized -->
66
+ <section class="gate" id="gate" hidden>
67
+ <div class="gate-icon"><svg class="icon lg"><use href="#i-plug"/></svg></div>
68
+ <h2 id="gate-title">Connect your brain</h2>
69
+ <p id="gate-message">Total Recall runs on your machine. Point the extension at it and add an access token.</p>
70
+ <div class="gate-actions">
71
+ <button class="btn primary" id="gate-settings" type="button">Open connection settings</button>
72
+ <button class="btn ghost" id="gate-retry" type="button"><svg class="icon sm"><use href="#i-refresh"/></svg>Retry</button>
73
+ </div>
74
+ <p class="gate-hint">Create a token in the dashboard under <strong>Integrations</strong>.</p>
75
+ </section>
76
+
77
+ <main class="panes" id="panes">
78
+ <!-- ============ RECALL ============ -->
79
+ <section class="pane is-active" id="tab-recall" role="tabpanel" aria-labelledby="tab-btn-recall">
80
+ <article class="page-card" id="page-card">
81
+ <div class="page-row">
82
+ <div class="favicon" id="page-favicon"><svg class="icon sm"><use href="#i-globe"/></svg></div>
83
+ <div class="page-meta">
84
+ <div class="page-title" id="page-title">—</div>
85
+ <div class="page-host">
86
+ <span id="page-host"></span>
87
+ <span class="chip success" id="page-saved" hidden><svg class="icon sm"><use href="#i-check"/></svg><span id="page-saved-label">Saved</span></span>
88
+ </div>
89
+ </div>
47
90
  </div>
48
- </div>
49
- </section>
50
-
51
- <!-- Panel 2: Chat -->
52
- <section id="tab-chat" class="tab-panel">
53
- <div id="chat-messages" class="chat-messages">
54
- <div class="chat-bubble assistant">
55
- Hello! Ask me anything about your memories or the current page!
91
+ <div class="page-actions">
92
+ <button class="btn primary" id="btn-remember" type="button"><svg class="icon sm"><use href="#i-pin"/></svg>Remember</button>
93
+ <button class="btn" id="btn-research-page" type="button"><svg class="icon sm"><use href="#i-flask"/></svg>Research</button>
94
+ <button class="btn icon-only" id="btn-note" type="button" aria-label="Add a note" aria-expanded="false" title="Add a note"><svg class="icon sm"><use href="#i-note"/></svg></button>
95
+ </div>
96
+ <div class="note-area" id="note-area" hidden>
97
+ <textarea class="textarea" id="note-input" rows="3" placeholder="Why does this matter? Saved with the page — or on its own if this isn't a web page."></textarea>
98
+ <div class="note-actions">
99
+ <span class="hint"><span class="kbd">⌘</span><span class="kbd">↵</span> to save</span>
100
+ <button class="btn ghost" id="btn-cancel-note" type="button">Cancel</button>
101
+ <button class="btn primary" id="btn-save-note" type="button">Save note</button>
102
+ </div>
56
103
  </div>
57
- </div>
58
-
59
- <!-- Suggestions row -->
60
- <div class="chat-suggestions">
61
- <button class="suggestion-btn" id="btn-suggest-summarize">💡 Summarize Page</button>
62
- <button class="suggestion-btn" id="btn-suggest-related">🔍 Find Related Notes</button>
63
- </div>
104
+ <p class="page-disabled" id="page-disabled" hidden>This page can't be captured. Notes still work.</p>
105
+ </article>
64
106
 
65
- <!-- Web grounding control -->
66
- <div class="chat-grounding-row">
67
- <label class="grounding-checkbox-label">
68
- <input type="checkbox" id="chat-grounding-toggle" checked />
69
- 🔌 Feed current webpage context
70
- </label>
71
- </div>
107
+ <label class="search" for="search-input">
108
+ <svg class="icon sm"><use href="#i-search"/></svg>
109
+ <input type="search" id="search-input" placeholder="Search your brain" autocomplete="off" spellcheck="false">
110
+ <span class="kbd" aria-hidden="true">/</span>
111
+ </label>
72
112
 
73
- <!-- Input row -->
74
- <div class="chat-input-bar">
75
- <textarea id="chat-input" placeholder="Ask your brain... (Shift+Enter for newline)"></textarea>
76
- <button id="btn-send-chat" class="chat-send-btn">
77
- <svg viewBox="0 0 24 24" fill="currentColor" width="16" height="16">
78
- <path d="M3.478 2.405a.75.75 0 00-.926.94l2.432 7.905H13.5a.75.75 0 010 1.5H4.984l-2.432 7.905a.75.75 0 00.926.94 60.519 60.519 0 0018.445-8.986.75.75 0 000-1.218A60.517 60.517 0 003.478 2.405z" />
79
- </svg>
80
- </button>
113
+ <div id="search-results" class="section" hidden>
114
+ <div class="section-head"><h3 id="search-heading">Results</h3></div>
115
+ <div class="list" id="search-list"></div>
81
116
  </div>
82
- </section>
83
117
 
84
- <!-- Panel 3: Research -->
85
- <section id="tab-research" class="tab-panel">
86
- <div class="research-feed">
87
- <div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;">
88
- <h3>Active Background Research</h3>
89
- <button id="btn-refresh-research" class="refresh-btn">🔄 Refresh</button>
90
- </div>
91
- <div id="research-list"></div>
92
- </div>
93
- </section>
94
-
95
- <!-- Panel 4: Settings -->
96
- <section id="tab-settings" class="tab-panel">
97
- <div class="settings-panel">
98
- <h3>Sovereign Configuration</h3>
99
-
100
- <div class="settings-group">
101
- <label for="settings-brain-selector">Active Brain Layer</label>
102
- <select id="settings-brain-selector" class="settings-select">
103
- <option value="global">Global Brain</option>
104
- </select>
105
- <span class="settings-help">Project brain layers override global rules dynamically</span>
106
- </div>
107
-
108
- <div class="settings-group">
109
- <label>Passive Tracking</label>
110
- <div style="display: flex; justify-content: space-between; align-items: center; background: #1e1e2e; padding: 10px 12px; border-radius: 10px; border: 1px solid #313244;">
111
- <span style="font-size: 13px; color: #a6adc8;">Capture page logs in background</span>
112
- <label class="switch">
113
- <input type="checkbox" id="settings-tracking-toggle" />
114
- <span class="slider"></span>
115
- </label>
118
+ <div id="browse" class="browse">
119
+ <div class="section" id="related-section" hidden>
120
+ <div class="section-head">
121
+ <h3>Related to this page</h3>
116
122
  </div>
123
+ <div class="list" id="related-list"></div>
117
124
  </div>
118
125
 
119
- <div class="settings-group">
120
- <label>Current Domain Actions</label>
121
- <button id="btn-block-domain" class="action-btn error" style="width: 100%; margin-bottom: 8px;">🚫 Block Current Domain</button>
122
- <span class="settings-help">Prevents passive capturing on this domain</span>
123
- </div>
124
-
125
- <div class="settings-group" style="margin-top: auto; padding-top: 16px; border-top: 1px solid #313244;">
126
- <button id="btn-recompile-brain" class="action-btn accent" style="width: 100%;">⚡ Recompile Brain Indexes</button>
127
- <span class="settings-help" style="text-align: center; display: block; margin-top: 4px;">Forcibly rebuilds vector embeddings and rules shims</span>
126
+ <div class="section">
127
+ <div class="section-head">
128
+ <h3>Recent</h3>
129
+ <button class="icon-btn small" id="btn-refresh-recent" type="button" aria-label="Refresh recent" title="Refresh"><svg class="icon sm"><use href="#i-refresh"/></svg></button>
130
+ </div>
131
+ <div class="list" id="recent-list"></div>
128
132
  </div>
129
133
  </div>
130
134
  </section>
131
135
 
132
- <!-- Panel 5: Collaboration -->
133
- <section id="tab-collab" class="tab-panel">
134
- <!-- Auth View -->
135
- <div id="collab-auth-view" class="collab-section">
136
- <h3>👥 Join Collab Network</h3>
137
- <p class="collab-subtext">Register or log in to sync annotations and chat on websites live.</p>
138
- <div class="collab-form">
139
- <input type="text" id="collab-username" placeholder="Username" />
140
- <input type="password" id="collab-password" placeholder="Password" />
141
- <div style="display: flex; gap: 8px; margin-top: 8px;">
142
- <button id="btn-collab-login" class="action-btn accent" style="flex: 1;">Login</button>
143
- <button id="btn-collab-register" class="action-btn" style="flex: 1;">Register</button>
136
+ <!-- ============ CHAT ============ -->
137
+ <section class="pane" id="tab-chat" role="tabpanel" aria-labelledby="tab-btn-chat" hidden>
138
+ <div class="chat-scroll" id="chat-scroll">
139
+ <div class="chat-empty" id="chat-empty">
140
+ <div class="chat-empty-mark"><svg class="icon lg"><use href="#i-sparkle"/></svg></div>
141
+ <h2>Ask your brain</h2>
142
+ <p>Answers draw on your memories and, when enabled, the page you're on.</p>
143
+ <div class="suggestions">
144
+ <button class="suggestion" type="button" data-prompt="Summarize this page and pull out the key takeaways.">Summarize this page</button>
145
+ <button class="suggestion" type="button" data-prompt="What do I already know that relates to this page? Point out anything that conflicts with it.">What do I already know about this?</button>
146
+ <button class="suggestion" type="button" data-prompt="Which rules or decisions in my brain apply to what this page describes?">Which of my rules apply here?</button>
144
147
  </div>
145
148
  </div>
149
+ <div class="messages" id="chat-messages" aria-live="polite"></div>
146
150
  </div>
147
-
148
- <!-- Main Collaboration View -->
149
- <div id="collab-main-view" class="collab-section hidden" style="display: flex; flex-direction: column; height: 100%;">
150
- <div class="collab-user-bar">
151
- <span>👤 <strong id="collab-user-display"></strong></span>
152
- <button id="btn-collab-logout" class="collab-logout-btn">Logout</button>
153
- </div>
154
-
155
- <div class="collab-control-group">
156
- <label for="collab-group-select">Workspace Group</label>
157
- <select id="collab-group-select" class="settings-select"></select>
158
- </div>
159
-
160
- <div class="collab-action-grid" style="display: flex; gap: 8px; margin-bottom: 8px; margin-top: 4px;">
161
- <button id="btn-collab-show-join" class="action-btn" style="padding: 6px; font-size: 11px;">Join Group</button>
162
- <button id="btn-collab-show-create" class="action-btn" style="padding: 6px; font-size: 11px;">Create Group</button>
151
+ <div class="composer">
152
+ <div class="composer-box">
153
+ <textarea id="chat-input" rows="1" placeholder="Ask anything…" aria-label="Message"></textarea>
154
+ <button class="send" id="btn-send-chat" type="button" aria-label="Send" disabled><svg class="icon sm"><use href="#i-send"/></svg></button>
155
+ </div>
156
+ <div class="composer-foot">
157
+ <label class="context-toggle" title="Include the current page's text with your question">
158
+ <input type="checkbox" id="chat-grounding" checked>
159
+ <svg class="icon sm"><use href="#i-globe"/></svg>
160
+ <span>Use this page</span>
161
+ </label>
162
+ <button class="btn ghost small" id="btn-clear-chat" type="button" hidden><svg class="icon sm"><use href="#i-trash"/></svg>Clear</button>
163
163
  </div>
164
+ </div>
165
+ </section>
164
166
 
165
- <div id="collab-join-group-row" class="collab-action-row hidden" style="display: flex; gap: 6px; margin-bottom: 8px;">
166
- <input type="text" id="collab-join-code" placeholder="Invite Code" style="flex: 1; padding: 6px; font-size: 12px; background: #1e1e2e; border: 1px solid #313244; color: #cdd6f4; border-radius: 6px;" />
167
- <button id="btn-collab-submit-join" class="action-btn accent" style="flex-shrink: 0; padding: 6px 12px; font-size: 11px; height: 28px;">Join</button>
168
- </div>
167
+ <!-- ============ RESEARCH ============ -->
168
+ <section class="pane" id="tab-research" role="tabpanel" aria-labelledby="tab-btn-research" hidden>
169
+ <form class="research-form" id="research-form">
170
+ <input class="input" id="research-input" type="text" placeholder="Research a topic in the background…" autocomplete="off">
171
+ <button class="btn primary" type="submit" id="btn-queue-research">Queue</button>
172
+ </form>
173
+ <div class="research-counts" id="research-counts"></div>
174
+ <div class="section" id="research-active-section">
175
+ <div class="section-head"><h3>In progress</h3>
176
+ <button class="icon-btn small" id="btn-refresh-research" type="button" aria-label="Refresh research" title="Refresh"><svg class="icon sm"><use href="#i-refresh"/></svg></button>
177
+ </div>
178
+ <div class="list" id="research-active"></div>
179
+ </div>
180
+ <div class="section">
181
+ <div class="section-head"><h3>Finished</h3></div>
182
+ <div class="list" id="research-done"></div>
183
+ </div>
184
+ </section>
185
+ </main>
186
+
187
+ <!-- ============ SETTINGS SHEET ============ -->
188
+ <div class="scrim" id="scrim" hidden></div>
189
+ <aside class="sheet" id="sheet" aria-label="Settings" aria-hidden="true" inert>
190
+ <header class="sheet-head">
191
+ <h2>Settings</h2>
192
+ <button class="icon-btn" id="btn-close-settings" type="button" aria-label="Close settings"><svg class="icon"><use href="#i-close"/></svg></button>
193
+ </header>
194
+ <div class="sheet-body">
195
+ <div class="field">
196
+ <label class="field-label" for="brain-select"><svg class="icon sm"><use href="#i-layers"/></svg>Active brain</label>
197
+ <select class="select" id="brain-select"><option value="global">Global brain</option></select>
198
+ <p class="field-help">Search, capture and chat all use this brain.</p>
199
+ </div>
169
200
 
170
- <div id="collab-create-group-row" class="collab-action-row hidden" style="display: flex; gap: 6px; margin-bottom: 8px;">
171
- <input type="text" id="collab-create-name" placeholder="Group Name" style="flex: 1; padding: 6px; font-size: 12px; background: #1e1e2e; border: 1px solid #313244; color: #cdd6f4; border-radius: 6px;" />
172
- <button id="btn-collab-submit-create" class="action-btn accent" style="flex-shrink: 0; padding: 6px 12px; font-size: 11px; height: 28px;">Create</button>
201
+ <div class="setting-row">
202
+ <div>
203
+ <div class="setting-title">Related memories on pages</div>
204
+ <p class="field-help">Check each page you visit against your brain and badge the toolbar icon when you already know something about it. Page titles are sent to your brain only.</p>
173
205
  </div>
174
-
175
- <!-- Pinned Annotations -->
176
- <div class="collab-panel-header">
177
- <h4>📌 Notes on Page</h4>
206
+ <label class="switch"><input type="checkbox" id="toggle-page-recall"><span class="track"></span></label>
207
+ </div>
208
+ <div class="setting-row sub">
209
+ <div>
210
+ <div class="setting-title">Floating card on the page</div>
211
+ <p class="field-help">Also show a small “Related” pill in the corner.</p>
178
212
  </div>
179
- <div id="collab-annotations-list" class="collab-list"></div>
213
+ <label class="switch"><input type="checkbox" id="toggle-pill"><span class="track"></span></label>
214
+ </div>
180
215
 
181
- <!-- Add Annotation Form -->
182
- <div class="collab-annotation-form">
183
- <textarea id="collab-note-input" placeholder="Pin a note to this page..."></textarea>
184
- <button id="btn-collab-save-note" class="action-btn accent" style="width: 100%; margin-top: 4px; padding: 6px; font-size: 12px;">Pin Note</button>
185
- </div>
216
+ <div class="field">
217
+ <div class="field-label"><svg class="icon sm"><use href="#i-ban"/></svg>This site</div>
218
+ <button class="btn block" id="btn-block-site" type="button">Never check this site</button>
219
+ </div>
186
220
 
187
- <!-- Real-time Site Chat -->
188
- <div class="collab-panel-header" style="margin-top: 8px;">
189
- <h4>💬 Site Chat Room</h4>
190
- <div style="display: flex; align-items: center; gap: 4px;">
191
- <span class="pulse" style="width: 6px; height: 6px; background: #a6e3a1; box-shadow: 0 0 4px #a6e3a1; border-radius: 50%;"></span>
192
- <span id="collab-presence-count" style="font-size: 10px; color: #a6e3a1;">1 online</span>
193
- </div>
194
- </div>
195
- <div id="collab-chat-messages" class="chat-messages collab-chat-box"></div>
196
- <div class="chat-input-bar collab-input-bar">
197
- <textarea id="collab-chat-input" placeholder="Send a message to team..."></textarea>
198
- <button id="btn-collab-send-chat" class="chat-send-btn">Send</button>
199
- </div>
221
+ <div class="field">
222
+ <div class="field-label"><svg class="icon sm"><use href="#i-bolt"/></svg>Maintenance</div>
223
+ <button class="btn block" id="btn-recompile" type="button">Rebuild search index</button>
224
+ <p class="field-help">Re-embeds new memories so search and recall find them. Runs on the brain; takes a minute.</p>
200
225
  </div>
201
- </section>
202
226
 
203
- </div>
227
+ <nav class="link-list">
228
+ <button type="button" class="link-row" id="link-options"><svg class="icon sm"><use href="#i-plug"/></svg>Connection &amp; privacy<svg class="icon sm trail"><use href="#i-external"/></svg></button>
229
+ <button type="button" class="link-row" id="link-shortcuts"><svg class="icon sm"><use href="#i-keyboard"/></svg>Keyboard shortcuts<span class="trail-text" id="shortcut-summary"></span></button>
230
+ <button type="button" class="link-row" id="link-dashboard"><svg class="icon sm"><use href="#i-brain"/></svg>Open dashboard<svg class="icon sm trail"><use href="#i-external"/></svg></button>
231
+ </nav>
232
+ </div>
233
+ <footer class="sheet-foot" id="sheet-foot"></footer>
234
+ </aside>
235
+
236
+ <div class="toast" id="toast" role="status" aria-live="polite" hidden></div>
204
237
  </div>
205
- <script src="../lib/preconfigured.js"></script>
238
+
206
239
  <script src="../lib/brain-client.js"></script>
240
+ <script src="../lib/ui-helpers.js"></script>
207
241
  <script src="sidepanel.js"></script>
208
242
  </body>
209
243
  </html>