get-claudia 1.4.0 → 1.5.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/bin/index.js
CHANGED
|
@@ -5,10 +5,18 @@ import { join, dirname } from 'path';
|
|
|
5
5
|
import { fileURLToPath } from 'url';
|
|
6
6
|
import { execSync, spawn } from 'child_process';
|
|
7
7
|
import { createInterface } from 'readline';
|
|
8
|
+
import { homedir } from 'os';
|
|
8
9
|
|
|
9
10
|
const __filename = fileURLToPath(import.meta.url);
|
|
10
11
|
const __dirname = dirname(__filename);
|
|
11
12
|
|
|
13
|
+
const isWindows = process.platform === 'win32';
|
|
14
|
+
|
|
15
|
+
// Resolve full PowerShell path on Windows (not always on PATH, e.g. Git Bash)
|
|
16
|
+
const powershellPath = isWindows
|
|
17
|
+
? join(process.env.SystemRoot || 'C:\\Windows', 'System32', 'WindowsPowerShell', 'v1.0', 'powershell.exe')
|
|
18
|
+
: null;
|
|
19
|
+
|
|
12
20
|
// ANSI color codes
|
|
13
21
|
const colors = {
|
|
14
22
|
reset: '\x1b[0m',
|
|
@@ -127,14 +135,19 @@ async function main() {
|
|
|
127
135
|
if (setupMemory) {
|
|
128
136
|
console.log(`\n${colors.cyan}Setting up enhanced memory system...${colors.reset}`);
|
|
129
137
|
|
|
130
|
-
const memoryDaemonPath =
|
|
138
|
+
const memoryDaemonPath = isWindows
|
|
139
|
+
? join(__dirname, '..', 'memory-daemon', 'scripts', 'install.ps1')
|
|
140
|
+
: join(__dirname, '..', 'memory-daemon', 'scripts', 'install.sh');
|
|
131
141
|
|
|
132
142
|
if (existsSync(memoryDaemonPath)) {
|
|
133
143
|
try {
|
|
134
144
|
// Run the install script, passing project path for upgrades
|
|
135
|
-
const
|
|
145
|
+
const spawnCmd = isWindows ? powershellPath : 'bash';
|
|
146
|
+
const spawnArgs = isWindows
|
|
147
|
+
? ['-ExecutionPolicy', 'Bypass', '-File', memoryDaemonPath]
|
|
148
|
+
: [memoryDaemonPath];
|
|
149
|
+
const result = spawn(spawnCmd, spawnArgs, {
|
|
136
150
|
stdio: 'inherit',
|
|
137
|
-
shell: true,
|
|
138
151
|
env: {
|
|
139
152
|
...process.env,
|
|
140
153
|
CLAUDIA_PROJECT_PATH: isUpgrade ? targetPath : ''
|
|
@@ -153,8 +166,14 @@ async function main() {
|
|
|
153
166
|
// Read example and add memory server
|
|
154
167
|
let mcpConfig = JSON.parse(readFileSync(mcpExamplePath, 'utf8'));
|
|
155
168
|
mcpConfig.mcpServers = mcpConfig.mcpServers || {};
|
|
169
|
+
|
|
170
|
+
const home = homedir();
|
|
171
|
+
const pythonCmd = isWindows
|
|
172
|
+
? join(home, '.claudia', 'daemon', 'venv', 'Scripts', 'python.exe')
|
|
173
|
+
: `${process.env.HOME}/.claudia/daemon/venv/bin/python`;
|
|
174
|
+
|
|
156
175
|
mcpConfig.mcpServers['claudia-memory'] = {
|
|
157
|
-
command:
|
|
176
|
+
command: pythonCmd,
|
|
158
177
|
args: ['-m', 'claudia_memory.mcp.server'],
|
|
159
178
|
_description: 'Claudia memory system with vector search'
|
|
160
179
|
};
|
|
@@ -164,7 +183,11 @@ async function main() {
|
|
|
164
183
|
showNextSteps(true); // Memory installed - emphasize restart
|
|
165
184
|
} else {
|
|
166
185
|
console.log(`${colors.yellow}!${colors.reset} Memory setup had issues. You can run it later with:`);
|
|
167
|
-
|
|
186
|
+
if (isWindows) {
|
|
187
|
+
console.log(` ${colors.cyan}powershell.exe -ExecutionPolicy Bypass -File "${memoryDaemonPath}"${colors.reset}`);
|
|
188
|
+
} else {
|
|
189
|
+
console.log(` ${colors.cyan}bash ${memoryDaemonPath}${colors.reset}`);
|
|
190
|
+
}
|
|
168
191
|
showNextSteps(false);
|
|
169
192
|
}
|
|
170
193
|
});
|
|
@@ -193,7 +216,7 @@ ${cdStep} ${colors.cyan}claude${colors.reset}
|
|
|
193
216
|
${colors.dim}Memory system ready!${colors.reset}
|
|
194
217
|
|
|
195
218
|
${colors.dim}If Claude was already running elsewhere, restart it to activate memory tools.${colors.reset}
|
|
196
|
-
${colors.dim}Troubleshooting: ~/.claudia/diagnose.sh${colors.reset}
|
|
219
|
+
${colors.dim}Troubleshooting: ${isWindows ? '%USERPROFILE%\\.claudia\\diagnose.ps1' : '~/.claudia/diagnose.sh'}${colors.reset}
|
|
197
220
|
`);
|
|
198
221
|
} else {
|
|
199
222
|
// No memory - standard message
|
|
@@ -34,9 +34,9 @@ try:
|
|
|
34
34
|
return _nlp
|
|
35
35
|
|
|
36
36
|
SPACY_AVAILABLE = True
|
|
37
|
-
except ImportError:
|
|
37
|
+
except (ImportError, Exception) as e:
|
|
38
38
|
SPACY_AVAILABLE = False
|
|
39
|
-
logger.warning("spaCy not
|
|
39
|
+
logger.warning(f"spaCy not available ({type(e).__name__}: {e}). Entity extraction will use regex only.")
|
|
40
40
|
|
|
41
41
|
def _get_nlp():
|
|
42
42
|
return None
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
# Claudia Memory Diagnostic Tool (Windows)
|
|
2
|
+
# Run this to check all components of the memory system
|
|
3
|
+
|
|
4
|
+
$ESC = [char]27
|
|
5
|
+
$RED = "$ESC[0;31m"
|
|
6
|
+
$GREEN = "$ESC[0;32m"
|
|
7
|
+
$YELLOW = "$ESC[1;33m"
|
|
8
|
+
$CYAN = "$ESC[0;36m"
|
|
9
|
+
$BOLD = "$ESC[1m"
|
|
10
|
+
$DIM = "$ESC[2m"
|
|
11
|
+
$NC = "$ESC[0m"
|
|
12
|
+
|
|
13
|
+
$CLAUDIA_DIR = Join-Path $env:USERPROFILE ".claudia"
|
|
14
|
+
$VENV_PYTHON = Join-Path (Join-Path (Join-Path (Join-Path $CLAUDIA_DIR "daemon") "venv") "Scripts") "python.exe"
|
|
15
|
+
|
|
16
|
+
Write-Host ""
|
|
17
|
+
Write-Host "${BOLD}Claudia Memory System Diagnostics${NC}"
|
|
18
|
+
Write-Host "${DIM}===================================${NC}"
|
|
19
|
+
Write-Host ""
|
|
20
|
+
|
|
21
|
+
$ISSUES_FOUND = 0
|
|
22
|
+
|
|
23
|
+
# Check 1: Daemon health
|
|
24
|
+
Write-Host -NoNewline "1. Daemon health check... "
|
|
25
|
+
try {
|
|
26
|
+
$health = Invoke-WebRequest -Uri "http://localhost:3848/health" -UseBasicParsing -TimeoutSec 3 -ErrorAction Stop
|
|
27
|
+
if ($health.Content -match "healthy") {
|
|
28
|
+
Write-Host "${GREEN}✓ Running${NC}"
|
|
29
|
+
} else {
|
|
30
|
+
throw "unhealthy"
|
|
31
|
+
}
|
|
32
|
+
} catch {
|
|
33
|
+
Write-Host "${RED}✗ Not running${NC}"
|
|
34
|
+
Write-Host " ${DIM}Fix: Start-ScheduledTask -TaskName ClaudiaMemoryDaemon${NC}"
|
|
35
|
+
Write-Host " ${DIM}Or: $VENV_PYTHON -m claudia_memory --standalone${NC}"
|
|
36
|
+
$ISSUES_FOUND++
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
# Check 2: Virtual environment exists
|
|
40
|
+
Write-Host -NoNewline "2. Virtual environment... "
|
|
41
|
+
$venvDir = Join-Path (Join-Path $CLAUDIA_DIR "daemon") "venv"
|
|
42
|
+
if (Test-Path $venvDir) {
|
|
43
|
+
Write-Host "${GREEN}✓ OK${NC}"
|
|
44
|
+
} else {
|
|
45
|
+
Write-Host "${RED}✗ Missing${NC}"
|
|
46
|
+
Write-Host " ${DIM}Fix: Re-run the memory installer${NC}"
|
|
47
|
+
$ISSUES_FOUND++
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
# Check 3: Python module
|
|
51
|
+
Write-Host -NoNewline "3. Python module installed... "
|
|
52
|
+
if ((Test-Path $VENV_PYTHON)) {
|
|
53
|
+
try {
|
|
54
|
+
& $VENV_PYTHON -c "import claudia_memory" 2>&1 | Out-Null
|
|
55
|
+
Write-Host "${GREEN}✓ OK${NC}"
|
|
56
|
+
} catch {
|
|
57
|
+
Write-Host "${RED}✗ Missing${NC}"
|
|
58
|
+
$pipPath = Join-Path (Join-Path (Join-Path (Join-Path $CLAUDIA_DIR "daemon") "venv") "Scripts") "pip.exe"
|
|
59
|
+
$daemonDir = Join-Path $CLAUDIA_DIR "daemon"
|
|
60
|
+
Write-Host " ${DIM}Fix: $pipPath install -e $daemonDir${NC}"
|
|
61
|
+
$ISSUES_FOUND++
|
|
62
|
+
}
|
|
63
|
+
} else {
|
|
64
|
+
Write-Host "${RED}✗ Virtual environment missing${NC}"
|
|
65
|
+
$ISSUES_FOUND++
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
# Check 4: MCP server module
|
|
69
|
+
Write-Host -NoNewline "4. MCP server module... "
|
|
70
|
+
if ((Test-Path $VENV_PYTHON)) {
|
|
71
|
+
try {
|
|
72
|
+
& $VENV_PYTHON -c "from claudia_memory.mcp import server" 2>&1 | Out-Null
|
|
73
|
+
Write-Host "${GREEN}✓ OK${NC}"
|
|
74
|
+
} catch {
|
|
75
|
+
Write-Host "${RED}✗ Failed to import${NC}"
|
|
76
|
+
$logPath = Join-Path $CLAUDIA_DIR "daemon-stderr.log"
|
|
77
|
+
Write-Host " ${DIM}Check: $logPath for errors${NC}"
|
|
78
|
+
$ISSUES_FOUND++
|
|
79
|
+
}
|
|
80
|
+
} else {
|
|
81
|
+
Write-Host "${RED}✗ Virtual environment missing${NC}"
|
|
82
|
+
$ISSUES_FOUND++
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
# Check 5: .mcp.json configured
|
|
86
|
+
Write-Host -NoNewline "5. .mcp.json configured... "
|
|
87
|
+
$MCP_FOUND = $false
|
|
88
|
+
$MCP_LOCATION = ""
|
|
89
|
+
|
|
90
|
+
if ((Test-Path ".mcp.json") -and (Get-Content ".mcp.json" -Raw | Select-String "claudia-memory" -Quiet)) {
|
|
91
|
+
$MCP_FOUND = $true
|
|
92
|
+
$MCP_LOCATION = "current directory"
|
|
93
|
+
} elseif ((Test-Path (Join-Path $CLAUDIA_DIR ".mcp.json")) -and (Get-Content (Join-Path $CLAUDIA_DIR ".mcp.json") -Raw | Select-String "claudia-memory" -Quiet)) {
|
|
94
|
+
$MCP_FOUND = $true
|
|
95
|
+
$MCP_LOCATION = "$CLAUDIA_DIR"
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if ($MCP_FOUND) {
|
|
99
|
+
Write-Host "${GREEN}✓ Found in ${MCP_LOCATION}${NC}"
|
|
100
|
+
} else {
|
|
101
|
+
Write-Host "${YELLOW}○ Not found${NC}"
|
|
102
|
+
Write-Host " ${DIM}The npx installer should have created this automatically.${NC}"
|
|
103
|
+
Write-Host " ${DIM}Add claudia-memory to your project's .mcp.json if needed.${NC}"
|
|
104
|
+
$ISSUES_FOUND++
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
# Check 6: Database exists
|
|
108
|
+
Write-Host -NoNewline "6. Database file... "
|
|
109
|
+
$dbPath = Join-Path (Join-Path $CLAUDIA_DIR "memory") "claudia.db"
|
|
110
|
+
if (Test-Path $dbPath) {
|
|
111
|
+
$dbSize = (Get-Item $dbPath).Length
|
|
112
|
+
$dbSizeKB = [math]::Round($dbSize / 1KB, 1)
|
|
113
|
+
Write-Host "${GREEN}✓ OK${NC} ${DIM}(${dbSizeKB}KB)${NC}"
|
|
114
|
+
} else {
|
|
115
|
+
Write-Host "${YELLOW}○ Not created yet${NC}"
|
|
116
|
+
Write-Host " ${DIM}Database will be created on first use.${NC}"
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
# Check 7: Ollama installed
|
|
120
|
+
Write-Host -NoNewline "7. Ollama installed... "
|
|
121
|
+
try {
|
|
122
|
+
$null = & ollama --version 2>&1
|
|
123
|
+
Write-Host "${GREEN}✓ OK${NC}"
|
|
124
|
+
} catch {
|
|
125
|
+
Write-Host "${YELLOW}○ Not installed (keyword search will be used)${NC}"
|
|
126
|
+
Write-Host " ${DIM}Optional: Install from https://ollama.com/download/windows${NC}"
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
# Check 8: Ollama running
|
|
130
|
+
Write-Host -NoNewline "8. Ollama running... "
|
|
131
|
+
try {
|
|
132
|
+
$null = Invoke-WebRequest -Uri "http://localhost:11434/api/tags" -UseBasicParsing -TimeoutSec 3 -ErrorAction Stop
|
|
133
|
+
Write-Host "${GREEN}✓ Running${NC}"
|
|
134
|
+
} catch {
|
|
135
|
+
Write-Host "${YELLOW}○ Not running${NC}"
|
|
136
|
+
Write-Host " ${DIM}Start with: ollama serve${NC}"
|
|
137
|
+
$ISSUES_FOUND++
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
# Check 9: Task Scheduler auto-start
|
|
141
|
+
Write-Host -NoNewline "9. Auto-start (Task Scheduler)... "
|
|
142
|
+
$task = Get-ScheduledTask -TaskName "ClaudiaMemoryDaemon" -ErrorAction SilentlyContinue
|
|
143
|
+
if ($task) {
|
|
144
|
+
Write-Host "${GREEN}✓ Task configured ($($task.State))${NC}"
|
|
145
|
+
} else {
|
|
146
|
+
Write-Host "${YELLOW}○ No scheduled task${NC}"
|
|
147
|
+
Write-Host " ${DIM}Re-run memory installer to configure auto-start.${NC}"
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
# Check 10: Embedding model
|
|
151
|
+
Write-Host -NoNewline "10. Embedding model... "
|
|
152
|
+
try {
|
|
153
|
+
$modelList = & ollama list 2>&1
|
|
154
|
+
if ($modelList -match "minilm") {
|
|
155
|
+
Write-Host "${GREEN}✓ all-minilm model available${NC}"
|
|
156
|
+
} else {
|
|
157
|
+
Write-Host "${YELLOW}○ No embedding model${NC}"
|
|
158
|
+
Write-Host " ${DIM}Run: ollama pull all-minilm:l6-v2${NC}"
|
|
159
|
+
$ISSUES_FOUND++
|
|
160
|
+
}
|
|
161
|
+
} catch {
|
|
162
|
+
Write-Host "${DIM}○ Skipped (Ollama not installed)${NC}"
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
# Check 11: sqlite-vec
|
|
166
|
+
Write-Host -NoNewline "11. Vector search (sqlite-vec)... "
|
|
167
|
+
if (Test-Path $VENV_PYTHON) {
|
|
168
|
+
try {
|
|
169
|
+
$result = & $VENV_PYTHON -c "import sqlite_vec; print('ok')" 2>&1
|
|
170
|
+
if ($result -match "ok") {
|
|
171
|
+
Write-Host "${GREEN}✓ sqlite-vec available${NC}"
|
|
172
|
+
} else {
|
|
173
|
+
throw "not available"
|
|
174
|
+
}
|
|
175
|
+
} catch {
|
|
176
|
+
Write-Host "${YELLOW}○ sqlite-vec not working${NC}"
|
|
177
|
+
$pipPath = Join-Path (Join-Path (Join-Path (Join-Path $CLAUDIA_DIR "daemon") "venv") "Scripts") "pip.exe"
|
|
178
|
+
Write-Host " ${DIM}Fix: $pipPath install sqlite-vec${NC}"
|
|
179
|
+
$ISSUES_FOUND++
|
|
180
|
+
}
|
|
181
|
+
} else {
|
|
182
|
+
Write-Host "${RED}✗ Virtual environment missing${NC}"
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
# Summary
|
|
186
|
+
Write-Host ""
|
|
187
|
+
Write-Host "${DIM}-----------------------------------${NC}"
|
|
188
|
+
Write-Host ""
|
|
189
|
+
|
|
190
|
+
if ($ISSUES_FOUND -eq 0) {
|
|
191
|
+
Write-Host "${GREEN}${BOLD}All checks passed!${NC}"
|
|
192
|
+
Write-Host ""
|
|
193
|
+
Write-Host "If memory.* tools still don't appear in Claude Code:"
|
|
194
|
+
Write-Host ""
|
|
195
|
+
Write-Host " ${YELLOW}${BOLD}→ Close this terminal and run 'claude' in a NEW terminal${NC}"
|
|
196
|
+
Write-Host ""
|
|
197
|
+
Write-Host " ${DIM}Claude Code only reads .mcp.json at startup.${NC}"
|
|
198
|
+
Write-Host " ${DIM}A restart is required to pick up new MCP servers.${NC}"
|
|
199
|
+
} else {
|
|
200
|
+
Write-Host "${YELLOW}${BOLD}Found $ISSUES_FOUND issue(s) above.${NC}"
|
|
201
|
+
Write-Host ""
|
|
202
|
+
Write-Host "Fix the issues and run this diagnostic again."
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
Write-Host ""
|
|
@@ -0,0 +1,436 @@
|
|
|
1
|
+
# Claudia Memory System Installer (Windows)
|
|
2
|
+
# Sets up the memory daemon with all dependencies
|
|
3
|
+
|
|
4
|
+
$ErrorActionPreference = "Continue"
|
|
5
|
+
|
|
6
|
+
# Colors via ANSI escape sequences (Windows Terminal / PowerShell 7+ support)
|
|
7
|
+
$ESC = [char]27
|
|
8
|
+
$RED = "$ESC[0;31m"
|
|
9
|
+
$GREEN = "$ESC[0;32m"
|
|
10
|
+
$YELLOW = "$ESC[1;33m"
|
|
11
|
+
$CYAN = "$ESC[0;36m"
|
|
12
|
+
$MAGENTA = "$ESC[0;35m"
|
|
13
|
+
$BOLD = "$ESC[1m"
|
|
14
|
+
$DIM = "$ESC[2m"
|
|
15
|
+
$NC = "$ESC[0m"
|
|
16
|
+
|
|
17
|
+
# Paths
|
|
18
|
+
$CLAUDIA_DIR = Join-Path $env:USERPROFILE ".claudia"
|
|
19
|
+
$DAEMON_DIR = Join-Path $CLAUDIA_DIR "daemon"
|
|
20
|
+
$VENV_DIR = Join-Path $DAEMON_DIR "venv"
|
|
21
|
+
$MEMORY_DIR = Join-Path $CLAUDIA_DIR "memory"
|
|
22
|
+
$VENV_SCRIPTS = Join-Path $VENV_DIR "Scripts"
|
|
23
|
+
$VENV_PYTHON = Join-Path $VENV_SCRIPTS "python.exe"
|
|
24
|
+
$VENV_PIP = Join-Path $VENV_SCRIPTS "pip.exe"
|
|
25
|
+
|
|
26
|
+
# Banner
|
|
27
|
+
Clear-Host
|
|
28
|
+
Write-Host ""
|
|
29
|
+
Write-Host "${CYAN}████${NC} ${CYAN}██${NC} ${CYAN}██${NC} ${CYAN}██${NC} ${CYAN}██${NC} ${CYAN}████${NC} ${CYAN}██${NC} ${CYAN}██${NC}"
|
|
30
|
+
Write-Host "${CYAN}██${NC} ${CYAN}██${NC} ${CYAN}██${NC} ${CYAN}██${NC} ${CYAN}██${NC} ${CYAN}██${NC} ${CYAN}██${NC} ${CYAN}██${NC} ${CYAN}██${NC} ${CYAN}██${NC} ${CYAN}██${NC}"
|
|
31
|
+
Write-Host "${CYAN}████${NC} ${CYAN}████${NC} ${CYAN}██${NC} ${CYAN}██${NC} ${CYAN}██${NC} ${CYAN}████${NC} ${CYAN}██${NC} ${CYAN}██${NC} ${CYAN}██${NC}"
|
|
32
|
+
Write-Host ""
|
|
33
|
+
Write-Host "${DIM}Memory System Installer (Windows)${NC}"
|
|
34
|
+
Write-Host "${DIM}Teaching Claudia to never forget${NC}"
|
|
35
|
+
Write-Host ""
|
|
36
|
+
Write-Host "${DIM}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
37
|
+
Write-Host ""
|
|
38
|
+
|
|
39
|
+
# Fun messages
|
|
40
|
+
$MESSAGES = @(
|
|
41
|
+
"Brewing neural pathways..."
|
|
42
|
+
"Calibrating memory banks..."
|
|
43
|
+
"Teaching Claudia to remember..."
|
|
44
|
+
"Installing elephant-grade memory..."
|
|
45
|
+
"Wiring up the hippocampus..."
|
|
46
|
+
"Defragmenting thought patterns..."
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
function Get-RandomMessage {
|
|
50
|
+
$MESSAGES | Get-Random
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
# ============================================================
|
|
54
|
+
# Step 1: Environment Check
|
|
55
|
+
# ============================================================
|
|
56
|
+
Write-Host "${BOLD}Step 1/8: Environment Check${NC}"
|
|
57
|
+
Write-Host ""
|
|
58
|
+
|
|
59
|
+
$PYTHON = $null
|
|
60
|
+
|
|
61
|
+
# Try common Python locations on Windows
|
|
62
|
+
$pythonCandidates = @(
|
|
63
|
+
"python",
|
|
64
|
+
"python3",
|
|
65
|
+
"py"
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
foreach ($candidate in $pythonCandidates) {
|
|
69
|
+
try {
|
|
70
|
+
$version = & $candidate --version 2>&1
|
|
71
|
+
if ($version -match "Python (\d+)\.(\d+)") {
|
|
72
|
+
$major = [int]$Matches[1]
|
|
73
|
+
$minor = [int]$Matches[2]
|
|
74
|
+
if ($major -ge 3 -and $minor -ge 10) {
|
|
75
|
+
$PYTHON = $candidate
|
|
76
|
+
Write-Host " ${GREEN}✓${NC} $version ($candidate)"
|
|
77
|
+
break
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
} catch {
|
|
81
|
+
# Not found, try next
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (-not $PYTHON) {
|
|
86
|
+
Write-Host " ${RED}✗${NC} Python 3.10+ not found"
|
|
87
|
+
Write-Host " Please install Python 3.10 or later from https://www.python.org/downloads/"
|
|
88
|
+
Write-Host " Make sure to check 'Add Python to PATH' during installation."
|
|
89
|
+
exit 1
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
# Check Ollama
|
|
93
|
+
$OLLAMA_AVAILABLE = $false
|
|
94
|
+
try {
|
|
95
|
+
$null = & ollama --version 2>&1
|
|
96
|
+
Write-Host " ${GREEN}✓${NC} Ollama installed"
|
|
97
|
+
$OLLAMA_AVAILABLE = $true
|
|
98
|
+
} catch {
|
|
99
|
+
Write-Host " ${YELLOW}○${NC} Ollama not found (optional)"
|
|
100
|
+
Write-Host ""
|
|
101
|
+
Write-Host " ${DIM}Ollama enables semantic vector search.${NC}"
|
|
102
|
+
Write-Host " ${DIM}Without it, Claudia falls back to keyword search.${NC}"
|
|
103
|
+
Write-Host " ${DIM}Install from: https://ollama.com/download/windows${NC}"
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
Write-Host ""
|
|
107
|
+
Write-Host "${DIM}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
108
|
+
Write-Host ""
|
|
109
|
+
|
|
110
|
+
# ============================================================
|
|
111
|
+
# Step 2: AI Models
|
|
112
|
+
# ============================================================
|
|
113
|
+
Write-Host "${BOLD}Step 2/8: AI Models${NC}"
|
|
114
|
+
Write-Host ""
|
|
115
|
+
|
|
116
|
+
if ($OLLAMA_AVAILABLE) {
|
|
117
|
+
# Check if Ollama is running
|
|
118
|
+
$ollamaRunning = $false
|
|
119
|
+
try {
|
|
120
|
+
$response = Invoke-WebRequest -Uri "http://localhost:11434/api/tags" -UseBasicParsing -TimeoutSec 3 -ErrorAction SilentlyContinue
|
|
121
|
+
$ollamaRunning = $true
|
|
122
|
+
Write-Host " ${GREEN}✓${NC} Ollama server already running"
|
|
123
|
+
} catch {
|
|
124
|
+
Write-Host " ${CYAN}◐${NC} Starting Ollama server..."
|
|
125
|
+
Start-Process "ollama" -ArgumentList "serve" -WindowStyle Hidden
|
|
126
|
+
Start-Sleep -Seconds 5
|
|
127
|
+
try {
|
|
128
|
+
$response = Invoke-WebRequest -Uri "http://localhost:11434/api/tags" -UseBasicParsing -TimeoutSec 3 -ErrorAction SilentlyContinue
|
|
129
|
+
$ollamaRunning = $true
|
|
130
|
+
Write-Host " ${GREEN}✓${NC} Ollama server running"
|
|
131
|
+
} catch {
|
|
132
|
+
Write-Host " ${YELLOW}!${NC} Could not start Ollama (will retry on boot)"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
# Pull embedding model
|
|
137
|
+
$modelList = & ollama list 2>&1
|
|
138
|
+
if ($modelList -match "all-minilm") {
|
|
139
|
+
Write-Host " ${GREEN}✓${NC} Embedding model ready"
|
|
140
|
+
} else {
|
|
141
|
+
Write-Host " ${CYAN}◐${NC} Downloading embedding model (45MB)..."
|
|
142
|
+
Write-Host " ${DIM}This gives Claudia semantic understanding${NC}"
|
|
143
|
+
Write-Host ""
|
|
144
|
+
try {
|
|
145
|
+
& ollama pull "all-minilm:l6-v2" 2>&1 | Out-Null
|
|
146
|
+
Write-Host " ${GREEN}✓${NC} Model downloaded"
|
|
147
|
+
} catch {
|
|
148
|
+
Write-Host " ${YELLOW}!${NC} Model pull failed (will retry when Ollama runs)"
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
} else {
|
|
152
|
+
Write-Host " ${YELLOW}○${NC} Skipping (Ollama not available)"
|
|
153
|
+
Write-Host " ${DIM}Claudia will use keyword search instead${NC}"
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
Write-Host ""
|
|
157
|
+
Write-Host "${DIM}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
158
|
+
Write-Host ""
|
|
159
|
+
|
|
160
|
+
# ============================================================
|
|
161
|
+
# Step 3: Creating Home
|
|
162
|
+
# ============================================================
|
|
163
|
+
Write-Host "${BOLD}Step 3/8: Creating Home${NC}"
|
|
164
|
+
Write-Host ""
|
|
165
|
+
|
|
166
|
+
New-Item -ItemType Directory -Force -Path $DAEMON_DIR | Out-Null
|
|
167
|
+
New-Item -ItemType Directory -Force -Path $MEMORY_DIR | Out-Null
|
|
168
|
+
Write-Host " ${GREEN}✓${NC} Created $CLAUDIA_DIR"
|
|
169
|
+
Write-Host " ${DIM}├── daemon\ (brain)${NC}"
|
|
170
|
+
Write-Host " ${DIM}└── memory\ (memories)${NC}"
|
|
171
|
+
|
|
172
|
+
Write-Host ""
|
|
173
|
+
Write-Host "${DIM}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
174
|
+
Write-Host ""
|
|
175
|
+
|
|
176
|
+
# ============================================================
|
|
177
|
+
# Step 4: Installing Core
|
|
178
|
+
# ============================================================
|
|
179
|
+
Write-Host "${BOLD}Step 4/8: Installing Core${NC}"
|
|
180
|
+
Write-Host ""
|
|
181
|
+
|
|
182
|
+
$SCRIPT_DIR = Split-Path -Parent $MyInvocation.MyCommand.Path
|
|
183
|
+
$SOURCE_DIR = Split-Path -Parent $SCRIPT_DIR
|
|
184
|
+
|
|
185
|
+
Write-Host " ${CYAN}◐${NC} Copying memory system files..."
|
|
186
|
+
$srcMemory = Join-Path $SOURCE_DIR "claudia_memory"
|
|
187
|
+
$srcScripts = Join-Path $SOURCE_DIR "scripts"
|
|
188
|
+
$srcPyproject = Join-Path $SOURCE_DIR "pyproject.toml"
|
|
189
|
+
$srcRequirements = Join-Path $SOURCE_DIR "requirements.txt"
|
|
190
|
+
Copy-Item -Recurse -Force $srcMemory $DAEMON_DIR
|
|
191
|
+
Copy-Item -Recurse -Force $srcScripts $DAEMON_DIR
|
|
192
|
+
Copy-Item -Force $srcPyproject $DAEMON_DIR
|
|
193
|
+
Copy-Item -Force $srcRequirements $DAEMON_DIR
|
|
194
|
+
Write-Host " ${GREEN}✓${NC} Core files installed"
|
|
195
|
+
|
|
196
|
+
# Copy diagnostic script
|
|
197
|
+
$srcDiagnose = Join-Path (Join-Path $SOURCE_DIR "scripts") "diagnose.ps1"
|
|
198
|
+
Copy-Item -Force $srcDiagnose $CLAUDIA_DIR
|
|
199
|
+
Write-Host " ${GREEN}✓${NC} Diagnostic script installed"
|
|
200
|
+
|
|
201
|
+
Write-Host ""
|
|
202
|
+
Write-Host "${DIM}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
203
|
+
Write-Host ""
|
|
204
|
+
|
|
205
|
+
# ============================================================
|
|
206
|
+
# Step 5: Python Environment
|
|
207
|
+
# ============================================================
|
|
208
|
+
Write-Host "${BOLD}Step 5/8: Python Environment${NC}"
|
|
209
|
+
Write-Host ""
|
|
210
|
+
|
|
211
|
+
Write-Host " ${CYAN}◐${NC} Creating isolated environment..."
|
|
212
|
+
& $PYTHON -m venv $VENV_DIR
|
|
213
|
+
Write-Host " ${GREEN}✓${NC} Virtual environment created"
|
|
214
|
+
|
|
215
|
+
Write-Host " ${CYAN}◐${NC} Installing dependencies..."
|
|
216
|
+
$msg = Get-RandomMessage
|
|
217
|
+
Write-Host " ${DIM}$msg${NC}"
|
|
218
|
+
$reqFile = Join-Path $DAEMON_DIR "requirements.txt"
|
|
219
|
+
$ErrorActionPreference = "SilentlyContinue"
|
|
220
|
+
& $VENV_PIP install --upgrade pip 2>&1 | Out-Null
|
|
221
|
+
& $VENV_PIP install -r $reqFile 2>&1 | Out-Null
|
|
222
|
+
& $VENV_PIP install -e $DAEMON_DIR 2>&1 | Out-Null
|
|
223
|
+
$ErrorActionPreference = "Continue"
|
|
224
|
+
Write-Host " ${GREEN}✓${NC} Dependencies installed"
|
|
225
|
+
|
|
226
|
+
# Install spaCy
|
|
227
|
+
Write-Host " ${CYAN}◐${NC} Installing NLP engine..."
|
|
228
|
+
$msg = Get-RandomMessage
|
|
229
|
+
Write-Host " ${DIM}$msg${NC}"
|
|
230
|
+
$ErrorActionPreference = "SilentlyContinue"
|
|
231
|
+
& $VENV_PIP install spacy 2>&1 | Out-Null
|
|
232
|
+
& $VENV_PYTHON -m spacy download en_core_web_sm 2>&1 | Out-Null
|
|
233
|
+
$ErrorActionPreference = "Continue"
|
|
234
|
+
Write-Host " ${GREEN}✓${NC} NLP ready"
|
|
235
|
+
|
|
236
|
+
Write-Host ""
|
|
237
|
+
Write-Host "${DIM}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
238
|
+
Write-Host ""
|
|
239
|
+
|
|
240
|
+
# ============================================================
|
|
241
|
+
# Step 6: Auto-Start Setup (Windows Task Scheduler)
|
|
242
|
+
# ============================================================
|
|
243
|
+
Write-Host "${BOLD}Step 6/8: Auto-Start Setup${NC}"
|
|
244
|
+
Write-Host ""
|
|
245
|
+
|
|
246
|
+
$taskName = "ClaudiaMemoryDaemon"
|
|
247
|
+
|
|
248
|
+
try {
|
|
249
|
+
# Remove existing task if present
|
|
250
|
+
$existingTask = Get-ScheduledTask -TaskName $taskName -ErrorAction SilentlyContinue
|
|
251
|
+
if ($existingTask) {
|
|
252
|
+
Unregister-ScheduledTask -TaskName $taskName -Confirm:$false -ErrorAction SilentlyContinue
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
# Create the scheduled task action
|
|
256
|
+
$action = New-ScheduledTaskAction `
|
|
257
|
+
-Execute $VENV_PYTHON `
|
|
258
|
+
-Argument "-m claudia_memory --standalone" `
|
|
259
|
+
-WorkingDirectory $DAEMON_DIR
|
|
260
|
+
|
|
261
|
+
# Trigger: at logon for current user
|
|
262
|
+
$trigger = New-ScheduledTaskTrigger -AtLogOn -User $env:USERNAME
|
|
263
|
+
|
|
264
|
+
# Settings: restart on failure, don't stop on idle, run indefinitely
|
|
265
|
+
$settings = New-ScheduledTaskSettingsSet `
|
|
266
|
+
-AllowStartIfOnBatteries `
|
|
267
|
+
-DontStopIfGoingOnBatteries `
|
|
268
|
+
-RestartCount 3 `
|
|
269
|
+
-RestartInterval (New-TimeSpan -Minutes 1) `
|
|
270
|
+
-ExecutionTimeLimit (New-TimeSpan -Days 0) `
|
|
271
|
+
-StartWhenAvailable
|
|
272
|
+
|
|
273
|
+
# Register the task (runs as current user, no elevation needed)
|
|
274
|
+
Register-ScheduledTask `
|
|
275
|
+
-TaskName $taskName `
|
|
276
|
+
-Description "Claudia Memory Daemon - persistent memory system" `
|
|
277
|
+
-Action $action `
|
|
278
|
+
-Trigger $trigger `
|
|
279
|
+
-Settings $settings `
|
|
280
|
+
-RunLevel Limited `
|
|
281
|
+
-Force | Out-Null
|
|
282
|
+
|
|
283
|
+
Write-Host " ${GREEN}✓${NC} Configured Windows Task Scheduler"
|
|
284
|
+
Write-Host " ${DIM}Will start on login${NC}"
|
|
285
|
+
|
|
286
|
+
# Start the task now
|
|
287
|
+
Start-ScheduledTask -TaskName $taskName -ErrorAction SilentlyContinue
|
|
288
|
+
Write-Host " ${GREEN}✓${NC} Daemon launched"
|
|
289
|
+
} catch {
|
|
290
|
+
Write-Host " ${YELLOW}!${NC} Could not configure auto-start: $_"
|
|
291
|
+
Write-Host " ${DIM}You can start the daemon manually:${NC}"
|
|
292
|
+
Write-Host " ${DIM}$VENV_PYTHON -m claudia_memory --standalone${NC}"
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
Write-Host ""
|
|
296
|
+
Write-Host "${DIM}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
297
|
+
Write-Host ""
|
|
298
|
+
|
|
299
|
+
# ============================================================
|
|
300
|
+
# Step 7: Memory Migration
|
|
301
|
+
# ============================================================
|
|
302
|
+
Write-Host "${BOLD}Step 7/8: Memory Migration${NC}"
|
|
303
|
+
Write-Host ""
|
|
304
|
+
|
|
305
|
+
$projectPath = $env:CLAUDIA_PROJECT_PATH
|
|
306
|
+
|
|
307
|
+
if ($projectPath -and (Test-Path (Join-Path $projectPath "context") -ErrorAction SilentlyContinue)) {
|
|
308
|
+
Write-Host " ${CYAN}◐${NC} Found existing memories to migrate..."
|
|
309
|
+
Start-Sleep -Seconds 2
|
|
310
|
+
|
|
311
|
+
try {
|
|
312
|
+
$migrationScript = Join-Path (Join-Path $DAEMON_DIR "scripts") "migrate_markdown.py"
|
|
313
|
+
& $VENV_PYTHON $migrationScript --quiet $projectPath
|
|
314
|
+
Write-Host " ${GREEN}✓${NC} Memories migrated to database"
|
|
315
|
+
} catch {
|
|
316
|
+
Write-Host " ${YELLOW}!${NC} Migration had issues (memories still in markdown)"
|
|
317
|
+
Write-Host " ${DIM}You can retry manually: $VENV_PYTHON -m claudia_memory.scripts.migrate_markdown $projectPath${NC}"
|
|
318
|
+
}
|
|
319
|
+
} elseif ($projectPath -and (Test-Path (Join-Path $projectPath "people") -ErrorAction SilentlyContinue)) {
|
|
320
|
+
Write-Host " ${CYAN}◐${NC} Found existing memories to migrate..."
|
|
321
|
+
Start-Sleep -Seconds 2
|
|
322
|
+
|
|
323
|
+
try {
|
|
324
|
+
$migrationScript = Join-Path (Join-Path $DAEMON_DIR "scripts") "migrate_markdown.py"
|
|
325
|
+
& $VENV_PYTHON $migrationScript --quiet $projectPath
|
|
326
|
+
Write-Host " ${GREEN}✓${NC} Memories migrated to database"
|
|
327
|
+
} catch {
|
|
328
|
+
Write-Host " ${YELLOW}!${NC} Migration had issues (memories still in markdown)"
|
|
329
|
+
}
|
|
330
|
+
} else {
|
|
331
|
+
Write-Host " ${DIM}Fresh install - no migration needed${NC}"
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
Write-Host ""
|
|
335
|
+
Write-Host "${DIM}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
336
|
+
Write-Host ""
|
|
337
|
+
|
|
338
|
+
# ============================================================
|
|
339
|
+
# Step 8: Verification
|
|
340
|
+
# ============================================================
|
|
341
|
+
Write-Host "${BOLD}Step 8/8: Verification${NC}"
|
|
342
|
+
Write-Host ""
|
|
343
|
+
Write-Host " ${CYAN}◐${NC} Checking all services..."
|
|
344
|
+
Start-Sleep -Seconds 3
|
|
345
|
+
|
|
346
|
+
# Check 1: Ollama running
|
|
347
|
+
try {
|
|
348
|
+
$null = Invoke-WebRequest -Uri "http://localhost:11434/api/tags" -UseBasicParsing -TimeoutSec 3 -ErrorAction Stop
|
|
349
|
+
Write-Host " ${GREEN}✓${NC} Ollama running"
|
|
350
|
+
} catch {
|
|
351
|
+
Write-Host " ${YELLOW}○${NC} Ollama not running (will start on next boot)"
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
# Check 2: Embedding model
|
|
355
|
+
if ($OLLAMA_AVAILABLE) {
|
|
356
|
+
$modelList = & ollama list 2>&1
|
|
357
|
+
if ($modelList -match "minilm") {
|
|
358
|
+
Write-Host " ${GREEN}✓${NC} Embedding model ready"
|
|
359
|
+
} else {
|
|
360
|
+
Write-Host " ${YELLOW}○${NC} Embedding model pending"
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
# Check 3: sqlite-vec
|
|
365
|
+
try {
|
|
366
|
+
& $VENV_PYTHON -c "import sqlite_vec" 2>&1 | Out-Null
|
|
367
|
+
Write-Host " ${GREEN}✓${NC} Vector search available (sqlite-vec)"
|
|
368
|
+
} catch {
|
|
369
|
+
Write-Host " ${YELLOW}○${NC} Vector search unavailable (keyword search only)"
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
# Check 4: Memory daemon health
|
|
373
|
+
try {
|
|
374
|
+
$health = Invoke-WebRequest -Uri "http://localhost:3848/health" -UseBasicParsing -TimeoutSec 3 -ErrorAction Stop
|
|
375
|
+
if ($health.Content -match "healthy") {
|
|
376
|
+
Write-Host " ${GREEN}✓${NC} Memory daemon running"
|
|
377
|
+
} else {
|
|
378
|
+
Write-Host " ${YELLOW}○${NC} Memory daemon starting..."
|
|
379
|
+
}
|
|
380
|
+
} catch {
|
|
381
|
+
Write-Host " ${YELLOW}○${NC} Memory daemon starting..."
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
# Check 5: Task Scheduler
|
|
385
|
+
$task = Get-ScheduledTask -TaskName $taskName -ErrorAction SilentlyContinue
|
|
386
|
+
if ($task) {
|
|
387
|
+
Write-Host " ${GREEN}✓${NC} Auto-start configured (Task Scheduler)"
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
Write-Host ""
|
|
391
|
+
Write-Host "${DIM}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
392
|
+
Write-Host ""
|
|
393
|
+
|
|
394
|
+
# Success banner
|
|
395
|
+
Write-Host "${GREEN}"
|
|
396
|
+
Write-Host " ╔═══════════════════════════════════════════════════════════╗"
|
|
397
|
+
Write-Host " ║ ║"
|
|
398
|
+
Write-Host " ║ ✨ Memory system installed successfully! ✨ ║"
|
|
399
|
+
Write-Host " ║ ║"
|
|
400
|
+
Write-Host " ╚═══════════════════════════════════════════════════════════╝"
|
|
401
|
+
Write-Host "${NC}"
|
|
402
|
+
|
|
403
|
+
Write-Host "${CYAN}${BOLD}"
|
|
404
|
+
Write-Host " ┌─────────────────────────────────────────────────────────────┐"
|
|
405
|
+
Write-Host " │ │"
|
|
406
|
+
Write-Host " │ Ready! Run 'claude' in a new terminal to start. │"
|
|
407
|
+
Write-Host " │ │"
|
|
408
|
+
Write-Host " │ If Claude was already running, restart it to activate │"
|
|
409
|
+
Write-Host " │ the memory tools. │"
|
|
410
|
+
Write-Host " │ │"
|
|
411
|
+
Write-Host " └─────────────────────────────────────────────────────────────┘"
|
|
412
|
+
Write-Host "${NC}"
|
|
413
|
+
|
|
414
|
+
# Summary
|
|
415
|
+
Write-Host "${BOLD}What's installed:${NC}"
|
|
416
|
+
Write-Host ""
|
|
417
|
+
Write-Host " ${CYAN}◆${NC} Memory daemon ${DIM}$DAEMON_DIR${NC}"
|
|
418
|
+
Write-Host " ${CYAN}◆${NC} SQLite database ${DIM}$MEMORY_DIR\claudia.db${NC}"
|
|
419
|
+
Write-Host " ${CYAN}◆${NC} Health endpoint ${DIM}http://localhost:3848${NC}"
|
|
420
|
+
if ($OLLAMA_AVAILABLE) {
|
|
421
|
+
Write-Host " ${CYAN}◆${NC} Vector search ${DIM}Enabled (Ollama)${NC}"
|
|
422
|
+
} else {
|
|
423
|
+
Write-Host " ${YELLOW}○${NC} Vector search ${DIM}Disabled (install Ollama to enable)${NC}"
|
|
424
|
+
}
|
|
425
|
+
Write-Host ""
|
|
426
|
+
|
|
427
|
+
Write-Host "${BOLD}Troubleshooting:${NC}"
|
|
428
|
+
Write-Host ""
|
|
429
|
+
Write-Host " ${DIM}Run diagnostics:${NC} powershell -File $CLAUDIA_DIR\diagnose.ps1"
|
|
430
|
+
Write-Host " ${DIM}Check health:${NC} Invoke-WebRequest http://localhost:3848/health"
|
|
431
|
+
Write-Host " ${DIM}View task:${NC} Get-ScheduledTask -TaskName ClaudiaMemoryDaemon"
|
|
432
|
+
Write-Host ""
|
|
433
|
+
|
|
434
|
+
# Claudia says goodbye
|
|
435
|
+
Write-Host "${MAGENTA}${DIM}$([char]34)I learn how you work. Let's get started.$([char]34) -- Claudia${NC}"
|
|
436
|
+
Write-Host ""
|