wicked-brain 0.4.5 → 0.4.6
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
package/server/package.json
CHANGED
|
@@ -43,6 +43,71 @@ whether the language server process is running and review its stderr logs.
|
|
|
43
43
|
Read `_meta/config.json` for brain path and server port.
|
|
44
44
|
If it doesn't exist, trigger wicked-brain:init.
|
|
45
45
|
|
|
46
|
+
## Prerequisites — Source Path
|
|
47
|
+
|
|
48
|
+
**LSP operates on the source project, not the brain directory.** The server must know where the ingested project lives to initialize language servers correctly. Without this, LSP calls will fail with "No Project" errors or return empty results.
|
|
49
|
+
|
|
50
|
+
### Check if source_path is configured
|
|
51
|
+
|
|
52
|
+
Read `{brain_path}/_meta/config.json`. Look for a `source_path` key:
|
|
53
|
+
|
|
54
|
+
```json
|
|
55
|
+
{
|
|
56
|
+
"brain_path": "/Users/me/.wicked-brain",
|
|
57
|
+
"server_port": 4243,
|
|
58
|
+
"source_path": "/Users/me/Projects/my-project"
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
If `source_path` is **present** — LSP is configured. Proceed with calls.
|
|
63
|
+
|
|
64
|
+
If `source_path` is **missing** — LSP will fail. Fix it before continuing.
|
|
65
|
+
|
|
66
|
+
### Fix: set source_path
|
|
67
|
+
|
|
68
|
+
**Option A** — Re-ingest the project directory (recommended, sets source_path automatically):
|
|
69
|
+
```
|
|
70
|
+
wicked-brain:ingest source=/path/to/project
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**Option B** — Write it manually to `_meta/config.json`, then restart the server:
|
|
74
|
+
```bash
|
|
75
|
+
# Read current config, add source_path, write back
|
|
76
|
+
python3 -c "
|
|
77
|
+
import json
|
|
78
|
+
path = '{brain_path}/_meta/config.json'
|
|
79
|
+
with open(path) as f: cfg = json.load(f)
|
|
80
|
+
cfg['source_path'] = '/absolute/path/to/project'
|
|
81
|
+
with open(path, 'w') as f: json.dump(cfg, f, indent=2)
|
|
82
|
+
print('source_path set')
|
|
83
|
+
" 2>/dev/null || python -c "
|
|
84
|
+
import json
|
|
85
|
+
path = '{brain_path}/_meta/config.json'
|
|
86
|
+
with open(path) as f: cfg = json.load(f)
|
|
87
|
+
cfg['source_path'] = '/absolute/path/to/project'
|
|
88
|
+
with open(path, 'w') as f: json.dump(cfg, f, indent=2)
|
|
89
|
+
print('source_path set')
|
|
90
|
+
"
|
|
91
|
+
# Then restart the server with --source:
|
|
92
|
+
npx wicked-brain-server --brain {brain_path} --port {port} --source /absolute/path/to/project &
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**Option C** — Restart server with `--source` flag (does not persist to config):
|
|
96
|
+
```bash
|
|
97
|
+
npx wicked-brain-server --brain {brain_path} --port {port} --source /absolute/path/to/project &
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Wait 2 seconds after restarting, then verify with `lsp-health`.
|
|
101
|
+
|
|
102
|
+
### Diagnosing "No Project" / empty results
|
|
103
|
+
|
|
104
|
+
Symptoms that indicate missing or wrong `source_path`:
|
|
105
|
+
- `lsp-workspace-symbols` returns `{"symbols":[]}` for any query
|
|
106
|
+
- `lsp-health` shows `{"typescript":{"status":"error","message":"No Project"}}` or similar
|
|
107
|
+
- Any LSP call returns an error about workspace or project not found
|
|
108
|
+
|
|
109
|
+
Check `source_path` in config. If it points at the brain directory (e.g., `~/.wicked-brain/...`) instead of the source project, that is wrong — the brain dir has no `tsconfig.json` or language config. Set it to the project root and restart.
|
|
110
|
+
|
|
46
111
|
## When to Use
|
|
47
112
|
|
|
48
113
|
| You want to... | Action | Example |
|
|
@@ -130,7 +195,7 @@ If installation fails, report to the user:
|
|
|
130
195
|
| `language_server_crashed` | The server crashed 3 times. Report to user, suggest checking the language server logs. |
|
|
131
196
|
| `unsupported_language` | No known language server for this file extension. |
|
|
132
197
|
| `lsp_timeout` | The language server took too long. May be initializing a large project. Retry once. |
|
|
133
|
-
| `file_outside_workspace` | The file isn't
|
|
198
|
+
| `file_outside_workspace` | The file isn't under `source_path`. Check `_meta/config.json` — `source_path` must be the project root that contains the file. Set it and restart the server with `--source`. |
|
|
134
199
|
|
|
135
200
|
### Step 5: Use results
|
|
136
201
|
|