total-recall-brain 3.1.2 → 3.2.2
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 +831 -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
- package/src/cli/backup.mjs +172 -1
- package/src/cli/setup.mjs +24 -0
- package/src/server/rest.mjs +56 -7
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react'
|
|
2
|
+
import { runSandbox, fetchConfig, saveConfig } from '../api'
|
|
3
|
+
|
|
4
|
+
const DEFAULT_CODE = `// Total Recall Sandbox — JavaScript
|
|
5
|
+
// Code runs in an isolated Node.js process.
|
|
6
|
+
|
|
7
|
+
const result = Array.from({ length: 5 }, (_, i) => ({
|
|
8
|
+
index: i,
|
|
9
|
+
fibonacci: fib(i),
|
|
10
|
+
}));
|
|
11
|
+
|
|
12
|
+
function fib(n) {
|
|
13
|
+
if (n <= 1) return n;
|
|
14
|
+
return fib(n - 1) + fib(n - 2);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
console.log(JSON.stringify(result, null, 2));
|
|
18
|
+
`
|
|
19
|
+
|
|
20
|
+
export default function SandboxPage() {
|
|
21
|
+
const [fileMode, setFileMode] = useState<'script.mjs' | 'DESIGN.md'>('script.mjs')
|
|
22
|
+
const [code, setCode] = useState(DEFAULT_CODE)
|
|
23
|
+
const [designCode, setDesignCode] = useState('# Design System\n\nPreview your markdown here.')
|
|
24
|
+
const [output, setOutput] = useState('')
|
|
25
|
+
const [isError, setIsError] = useState(false)
|
|
26
|
+
const [running, setRunning] = useState(false)
|
|
27
|
+
const [isFullscreen, setIsFullscreen] = useState(false)
|
|
28
|
+
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
fetchConfig('DESIGN.md').then(setDesignCode).catch(() => {})
|
|
31
|
+
}, [])
|
|
32
|
+
|
|
33
|
+
const handleRun = async () => {
|
|
34
|
+
if (fileMode === 'DESIGN.md') {
|
|
35
|
+
try {
|
|
36
|
+
await saveConfig('DESIGN.md', designCode)
|
|
37
|
+
setOutput('DESIGN.md saved successfully.')
|
|
38
|
+
setIsError(false)
|
|
39
|
+
} catch (e) {
|
|
40
|
+
setOutput((e as Error).message)
|
|
41
|
+
setIsError(true)
|
|
42
|
+
}
|
|
43
|
+
return
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
setRunning(true)
|
|
47
|
+
setOutput('')
|
|
48
|
+
try {
|
|
49
|
+
const result = await runSandbox(code)
|
|
50
|
+
setOutput(result.output)
|
|
51
|
+
setIsError(!result.success)
|
|
52
|
+
} catch (e) {
|
|
53
|
+
setOutput((e as Error).message)
|
|
54
|
+
setIsError(true)
|
|
55
|
+
} finally {
|
|
56
|
+
setRunning(false)
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const toggleChat = () => {
|
|
61
|
+
window.dispatchEvent(new CustomEvent('toggle-floating-chat'))
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const containerStyle: React.CSSProperties = isFullscreen ? {
|
|
65
|
+
position: 'fixed', top: 0, left: 0, right: 0, bottom: 0, zIndex: 9000, background: 'var(--bg-primary)'
|
|
66
|
+
} : {}
|
|
67
|
+
|
|
68
|
+
return (
|
|
69
|
+
<div className="page" style={containerStyle}>
|
|
70
|
+
<div className="page-header" style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
|
|
71
|
+
<div>
|
|
72
|
+
<h1>Code Sandbox & Design</h1>
|
|
73
|
+
<p>Execute JavaScript or edit Design System</p>
|
|
74
|
+
</div>
|
|
75
|
+
<div style={{ display: 'flex', gap: 8 }}>
|
|
76
|
+
<button className="btn btn-ghost btn-sm" onClick={toggleChat}>💬 Float Agent</button>
|
|
77
|
+
<button className="btn btn-ghost btn-sm" onClick={() => setIsFullscreen(!isFullscreen)}>
|
|
78
|
+
{isFullscreen ? 'Exit Fullscreen' : 'Fullscreen'}
|
|
79
|
+
</button>
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
<div className="sandbox-layout">
|
|
83
|
+
<div className="sandbox-editor">
|
|
84
|
+
<div className="sandbox-editor-header" style={{ display: 'flex', justifyContent: 'space-between' }}>
|
|
85
|
+
<select
|
|
86
|
+
value={fileMode}
|
|
87
|
+
onChange={e => setFileMode(e.target.value as 'script.mjs' | 'DESIGN.md')}
|
|
88
|
+
style={{ background: 'transparent', color: 'white', border: 'none', outline: 'none', fontWeight: 600 }}
|
|
89
|
+
>
|
|
90
|
+
<option value="script.mjs">script.mjs</option>
|
|
91
|
+
<option value="DESIGN.md">DESIGN.md</option>
|
|
92
|
+
</select>
|
|
93
|
+
<span style={{ fontFamily: 'var(--font-mono)' }}>{fileMode === 'DESIGN.md' ? 'Markdown' : 'JavaScript'}</span>
|
|
94
|
+
</div>
|
|
95
|
+
<textarea
|
|
96
|
+
id="sandbox-editor"
|
|
97
|
+
value={fileMode === 'DESIGN.md' ? designCode : code}
|
|
98
|
+
onChange={e => fileMode === 'DESIGN.md' ? setDesignCode(e.target.value) : setCode(e.target.value)}
|
|
99
|
+
spellCheck={false}
|
|
100
|
+
/>
|
|
101
|
+
</div>
|
|
102
|
+
<div className="sandbox-toolbar">
|
|
103
|
+
<button className="btn btn-primary" onClick={handleRun} disabled={running} id="sandbox-run">
|
|
104
|
+
{fileMode === 'DESIGN.md' ? '💾 Save Design' : (running ? '⏳ Running…' : '▶ Run Code')}
|
|
105
|
+
</button>
|
|
106
|
+
</div>
|
|
107
|
+
<div className={`sandbox-output ${isError ? 'error' : ''}`} id="sandbox-output">
|
|
108
|
+
{output || (fileMode === 'DESIGN.md' ? '// Output saved to ~/.agent/config/DESIGN.md' : '// Output will appear here after execution')}
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
)
|
|
113
|
+
}
|