total-recall-brain 3.1.2 → 3.2.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/extension/background.js +99 -0
- package/extension/content-script.css +16 -0
- package/extension/content-script.js +134 -0
- package/extension/icons/README.md +27 -0
- package/extension/icons/icon-128.png +0 -0
- package/extension/icons/icon-16.png +0 -0
- package/extension/icons/icon-48.png +0 -0
- package/extension/lib/brain-client.js +47 -0
- package/extension/manifest.json +39 -0
- package/extension/options/options.css +218 -0
- package/extension/options/options.html +72 -0
- package/extension/options/options.js +99 -0
- package/extension/popup/popup.css +221 -0
- package/extension/popup/popup.html +44 -0
- package/extension/popup/popup.js +107 -0
- package/extension/sidepanel/sidepanel.css +340 -0
- package/extension/sidepanel/sidepanel.html +38 -0
- package/extension/sidepanel/sidepanel.js +229 -0
- package/frontend/README.md +73 -0
- package/frontend/index.html +17 -0
- package/frontend/package.json +31 -0
- package/frontend/src/App.css +2 -0
- package/frontend/src/App.tsx +390 -0
- package/frontend/src/api.ts +688 -0
- package/frontend/src/assets/hero.png +0 -0
- package/frontend/src/assets/react.svg +1 -0
- package/frontend/src/assets/vite.svg +1 -0
- package/frontend/src/components/BrainSelector.tsx +272 -0
- package/frontend/src/components/DaemonLogsTab.tsx +54 -0
- package/frontend/src/components/Graph3D.tsx +850 -0
- package/frontend/src/components/MarkdownUtils.tsx +99 -0
- package/frontend/src/components/ResearchAgendaTab.tsx +707 -0
- package/frontend/src/components/TaskQueueTab.tsx +185 -0
- package/frontend/src/index.css +1589 -0
- package/frontend/src/main.tsx +10 -0
- package/frontend/src/pages/ApiKeysPage.tsx +288 -0
- package/frontend/src/pages/AutomationsPage.tsx +354 -0
- package/frontend/src/pages/ChatPage.tsx +806 -0
- package/frontend/src/pages/DeploymentsPage.tsx +275 -0
- package/frontend/src/pages/FilesPage.tsx +384 -0
- package/frontend/src/pages/HealthPage.tsx +91 -0
- package/frontend/src/pages/IntegrationsPage.tsx +382 -0
- package/frontend/src/pages/LoginPage.tsx +237 -0
- package/frontend/src/pages/MemoryPage.tsx +1192 -0
- package/frontend/src/pages/SandboxPage.tsx +113 -0
- package/frontend/src/pages/SettingsPage.tsx +662 -0
- package/frontend/src/pages/SkillsPage.tsx +618 -0
- package/frontend/src/pages/TasksPage.tsx +392 -0
- package/frontend/src/pages/UsagePage.tsx +260 -0
- package/frontend/src/types.ts +163 -0
- package/frontend/tsconfig.app.json +25 -0
- package/frontend/tsconfig.json +7 -0
- package/frontend/tsconfig.node.json +24 -0
- package/frontend/vite.config.ts +24 -0
- package/package.json +8 -1
- package/scaffold/.agent/skills/total-recall/memory-vault/concepts/cli-help-reference.md +35 -8
- package/scaffold/.agent/skills/total-recall/memory-vault/invariants/operating-instructions.md +13 -8
- package/scaffold/.agent/skills/total-recall/memory-vault/preferences/always-websearch-gap.md +28 -1
- package/scaffold/.agent/skills/total-recall/memory-vault/preferences/topic-research-sop.md +28 -1
- package/scaffold/.agent/skills/total-recall/skills/ssss/references/ssss-spec.md +830 -81
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// ─── Shared markdown rendering utilities for the Cognitive Dashboard ─────────
|
|
2
|
+
import { Link } from 'react-router-dom';
|
|
3
|
+
|
|
4
|
+
export function extractSources(body?: string) {
|
|
5
|
+
if (!body) return [];
|
|
6
|
+
const regex = /\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g;
|
|
7
|
+
const sources: { text: string; url: string }[] = [];
|
|
8
|
+
const urls = new Set<string>();
|
|
9
|
+
let match;
|
|
10
|
+
while ((match = regex.exec(body)) !== null) {
|
|
11
|
+
const text = match[1];
|
|
12
|
+
const url = match[2];
|
|
13
|
+
if (!urls.has(url)) {
|
|
14
|
+
urls.add(url);
|
|
15
|
+
sources.push({ text, url });
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return sources;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function parseInlineStyles(text: string) {
|
|
22
|
+
const regex = /(\*\*.*?\*\*|`.*?`|\[\[.*?\]\])/g;
|
|
23
|
+
const matches = text.split(regex);
|
|
24
|
+
|
|
25
|
+
return matches.map((part, index) => {
|
|
26
|
+
if (part.startsWith('**') && part.endsWith('**')) {
|
|
27
|
+
return <strong key={index} style={{ color: 'var(--text-primary)', fontWeight: 600 }}>{part.slice(2, -2)}</strong>;
|
|
28
|
+
}
|
|
29
|
+
if (part.startsWith('`') && part.endsWith('`')) {
|
|
30
|
+
return <code key={index} style={{ background: 'var(--bg-elevated)', padding: '2px 5px', borderRadius: 4, fontFamily: 'var(--font-mono)', fontSize: '11.5px', color: '#ff79c6', border: '1px solid var(--border)' }}>{part.slice(1, -1)}</code>;
|
|
31
|
+
}
|
|
32
|
+
if (part.startsWith('[[') && part.endsWith(']]')) {
|
|
33
|
+
const inner = part.slice(2, -2);
|
|
34
|
+
const pipeIdx = inner.indexOf('|');
|
|
35
|
+
const slug = pipeIdx !== -1 ? inner.slice(0, pipeIdx).trim() : inner.trim();
|
|
36
|
+
const display = pipeIdx !== -1 ? inner.slice(pipeIdx + 1).trim() : slug;
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<Link
|
|
40
|
+
key={index}
|
|
41
|
+
to={`/memory?slug=${encodeURIComponent(slug)}`}
|
|
42
|
+
style={{
|
|
43
|
+
color: 'var(--accent)',
|
|
44
|
+
textDecoration: 'none',
|
|
45
|
+
fontWeight: 500,
|
|
46
|
+
borderBottom: '1px dashed var(--accent)',
|
|
47
|
+
cursor: 'pointer'
|
|
48
|
+
}}
|
|
49
|
+
>
|
|
50
|
+
{display}
|
|
51
|
+
</Link>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
return part;
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function renderMarkdown(text: string) {
|
|
59
|
+
if (!text) return null;
|
|
60
|
+
const lines = text.split('\n');
|
|
61
|
+
return lines.map((line, idx) => {
|
|
62
|
+
const trimmed = line.trim();
|
|
63
|
+
|
|
64
|
+
if (trimmed.startsWith('### ')) {
|
|
65
|
+
return <h5 key={idx} style={{ margin: '14px 0 6px 0', color: 'var(--success)', fontSize: 13, textTransform: 'uppercase', letterSpacing: '0.05em', fontWeight: 600 }}>{trimmed.slice(4)}</h5>;
|
|
66
|
+
}
|
|
67
|
+
if (trimmed.startsWith('## ')) {
|
|
68
|
+
return <h4 key={idx} style={{ margin: '18px 0 8px 0', color: 'var(--accent)', fontSize: 14, fontWeight: 600 }}>{trimmed.slice(3)}</h4>;
|
|
69
|
+
}
|
|
70
|
+
if (trimmed.startsWith('# ')) {
|
|
71
|
+
return <h3 key={idx} style={{ margin: '22px 0 10px 0', color: '#fff', fontSize: 16, fontWeight: 700 }}>{trimmed.slice(2)}</h3>;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (trimmed.startsWith('- ') || trimmed.startsWith('* ')) {
|
|
75
|
+
return (
|
|
76
|
+
<div key={idx} style={{ display: 'flex', gap: 8, margin: '4px 0 4px 12px', fontSize: 13, color: 'var(--text-secondary)' }}>
|
|
77
|
+
<span style={{ color: 'var(--accent)', userSelect: 'none' }}>•</span>
|
|
78
|
+
<span>{parseInlineStyles(trimmed.slice(2))}</span>
|
|
79
|
+
</div>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const numMatch = trimmed.match(/^(\d+)\.\s+(.*)$/);
|
|
84
|
+
if (numMatch) {
|
|
85
|
+
return (
|
|
86
|
+
<div key={idx} style={{ display: 'flex', gap: 8, margin: '4px 0 4px 12px', fontSize: 13, color: 'var(--text-secondary)' }}>
|
|
87
|
+
<span style={{ color: 'var(--accent)', fontWeight: 600 }}>{numMatch[1]}.</span>
|
|
88
|
+
<span>{parseInlineStyles(numMatch[2])}</span>
|
|
89
|
+
</div>
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (!trimmed) {
|
|
94
|
+
return <div key={idx} style={{ height: 8 }} />;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return <p key={idx} style={{ margin: '6px 0', fontSize: 13, color: 'var(--text-secondary)', lineHeight: '1.6' }}>{parseInlineStyles(line)}</p>;
|
|
98
|
+
});
|
|
99
|
+
}
|