neuroplex 0.2.0 → 0.4.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/dist/brain/build.d.ts +4 -0
- package/dist/brain/build.js +16 -4
- package/dist/brain/build.js.map +1 -1
- package/dist/brain/local.d.ts +2 -0
- package/dist/brain/local.js.map +1 -1
- package/dist/brain/obsidian.d.ts +26 -0
- package/dist/brain/obsidian.js +411 -0
- package/dist/brain/obsidian.js.map +1 -0
- package/dist/cli/index.js +144 -23
- package/dist/cli/index.js.map +1 -1
- package/dist/config/config.d.ts +21 -0
- package/dist/config/config.js +52 -1
- package/dist/config/config.js.map +1 -1
- package/dist/config/edit.d.ts +1 -1
- package/dist/config/edit.js +1 -0
- package/dist/config/edit.js.map +1 -1
- package/dist/enrich/index.js +7 -2
- package/dist/enrich/index.js.map +1 -1
- package/dist/enrich/tasks.d.ts +6 -0
- package/dist/enrich/tasks.js +7 -1
- package/dist/enrich/tasks.js.map +1 -1
- package/dist/graph/schema.d.ts +2 -1
- package/dist/graph/schema.js +1 -0
- package/dist/graph/schema.js.map +1 -1
- package/dist/mcp/http.d.ts +33 -0
- package/dist/mcp/http.js +171 -0
- package/dist/mcp/http.js.map +1 -0
- package/dist/mcp/server.d.ts +24 -3
- package/dist/mcp/server.js +47 -27
- package/dist/mcp/server.js.map +1 -1
- package/dist/query/cli.d.ts +19 -0
- package/dist/query/cli.js +119 -0
- package/dist/query/cli.js.map +1 -0
- package/dist/query/queries.js +3 -3
- package/dist/query/queries.js.map +1 -1
- package/dist/scan/assemble.d.ts +15 -0
- package/dist/scan/assemble.js +240 -15
- package/dist/scan/assemble.js.map +1 -1
- package/dist/scan/discover.js +8 -0
- package/dist/scan/discover.js.map +1 -1
- package/dist/scan/extract.js +8 -1
- package/dist/scan/extract.js.map +1 -1
- package/dist/scan/extractors/csharp.d.ts +4 -0
- package/dist/scan/extractors/csharp.js +565 -0
- package/dist/scan/extractors/csharp.js.map +1 -0
- package/dist/scan/extractors/python.js +170 -15
- package/dist/scan/extractors/python.js.map +1 -1
- package/dist/scan/extractors/typescript.js +405 -23
- package/dist/scan/extractors/typescript.js.map +1 -1
- package/dist/scan/parser.js +1 -0
- package/dist/scan/parser.js.map +1 -1
- package/dist/scan/repos.d.ts +38 -0
- package/dist/scan/repos.js +155 -0
- package/dist/scan/repos.js.map +1 -0
- package/dist/scan/scan.d.ts +15 -0
- package/dist/scan/scan.js +26 -16
- package/dist/scan/scan.js.map +1 -1
- package/dist/scan/types.d.ts +36 -1
- package/dist/scan/types.js +2 -1
- package/dist/scan/types.js.map +1 -1
- package/dist/sync/sync.js +37 -16
- package/dist/sync/sync.js.map +1 -1
- package/package.json +1 -1
- package/skills/neuroplex/SKILL.md +15 -2
package/dist/sync/sync.js
CHANGED
|
@@ -4,6 +4,7 @@ import { buildBrain } from '../brain/build.js';
|
|
|
4
4
|
import { LOCAL_DIR } from '../brain/local.js';
|
|
5
5
|
import { ConfigError, loadConfig } from '../config/config.js';
|
|
6
6
|
import { git } from '../scan/git.js';
|
|
7
|
+
import { scanRepos } from '../scan/repos.js';
|
|
7
8
|
import { scanProject } from '../scan/scan.js';
|
|
8
9
|
/**
|
|
9
10
|
* Auto-sync (docs/ARCHITECTURE.md §9): keeps a brain in step with the tracked
|
|
@@ -33,26 +34,46 @@ export class SyncBusyError extends SyncError {
|
|
|
33
34
|
export async function syncOnce(brainDir, log = () => { }) {
|
|
34
35
|
const dir = resolve(brainDir);
|
|
35
36
|
const config = await loadConfig(dir);
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
const cache = join(dir, CACHE_DIR);
|
|
38
|
+
// One target for a single-repo brain, one per repository otherwise (each with its own clone).
|
|
39
|
+
const targets = config.repos
|
|
40
|
+
? config.repos.map((r) => ({ name: r.name, remote: r.remote, branch: r.branch, subdir: r.subdir, from: r.indexedCommit, cache: join(cache, r.name) }))
|
|
41
|
+
: [{ name: '', remote: config.source.remote, branch: config.source.branch, subdir: config.source.subdir, from: config.source.indexedCommit, cache }];
|
|
42
|
+
for (const t of targets) {
|
|
43
|
+
if (!t.remote) {
|
|
44
|
+
throw new ConfigError(t.name
|
|
45
|
+
? `Auto-sync needs a remote for repository "${t.name}" (neuroplex repo add with a checkout that has an origin remote).`
|
|
46
|
+
: 'Auto-sync needs source.remote in neuroplex.json (neuroplex config set source.remote <url>)');
|
|
47
|
+
}
|
|
48
|
+
}
|
|
39
49
|
const release = await acquireLock(dir);
|
|
40
50
|
const state = { ...(await readSyncState(dir)), lastCheck: new Date().toISOString() };
|
|
41
51
|
try {
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
52
|
+
const heads = new Map();
|
|
53
|
+
for (const t of targets)
|
|
54
|
+
heads.set(t.name, await fetchBranch(t.cache, t.remote, t.branch));
|
|
55
|
+
const moved = targets.filter((t) => heads.get(t.name) !== t.from);
|
|
56
|
+
const label = (t) => (t.name ? `${t.name}@` : '') + heads.get(t.name).slice(0, 7);
|
|
57
|
+
const head = targets.map(label).join(', ');
|
|
58
|
+
if (!moved.length) {
|
|
46
59
|
delete state.lastError;
|
|
47
|
-
return { changed: false, to: head };
|
|
60
|
+
return { changed: false, to: config.repos ? head : heads.get('') };
|
|
61
|
+
}
|
|
62
|
+
for (const t of moved)
|
|
63
|
+
log(`syncing ${t.name ? `${t.name} ` : ''}${t.branch} ${t.from?.slice(0, 7) ?? '(none)'} -> ${heads.get(t.name).slice(0, 7)}`);
|
|
64
|
+
const dirs = {};
|
|
65
|
+
for (const t of targets) {
|
|
66
|
+
await mustGit(t.cache, 'checkout', '--force', '--detach', heads.get(t.name));
|
|
67
|
+
await mustGit(t.cache, 'clean', '-fdx');
|
|
68
|
+
dirs[t.name] = t.subdir ? join(t.cache, t.subdir) : t.cache;
|
|
48
69
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const projectDir = config.source.subdir ? join(cache, config.source.subdir) : cache;
|
|
53
|
-
const scan = await scanProject({ projectDir, brainDir: dir, recordSource: false });
|
|
70
|
+
const scan = config.repos
|
|
71
|
+
? await scanRepos({ brainDir: dir, dirs, recordSource: false })
|
|
72
|
+
: await scanProject({ projectDir: dirs[''], brainDir: dir, recordSource: false });
|
|
54
73
|
const build = await buildBrain({ brainDir: dir, git: config.sync.autoCommit });
|
|
55
|
-
const
|
|
74
|
+
const to = config.repos ? head : heads.get('');
|
|
75
|
+
const from = config.repos ? undefined : targets[0].from;
|
|
76
|
+
const result = { changed: true, to, stale: scan.semantic.stale };
|
|
56
77
|
if (from)
|
|
57
78
|
result.from = from;
|
|
58
79
|
if (build.commit)
|
|
@@ -66,9 +87,9 @@ export async function syncOnce(brainDir, log = () => { }) {
|
|
|
66
87
|
result.note = 'push failed (does the brain repository have an upstream remote?)';
|
|
67
88
|
}
|
|
68
89
|
state.lastChange = new Date().toISOString();
|
|
69
|
-
state.lastCommit =
|
|
90
|
+
state.lastCommit = to;
|
|
70
91
|
delete state.lastError;
|
|
71
|
-
log(`synced to ${head.slice(0, 7)}: ${scan.graph.nodeCount} nodes, ${scan.semantic.stale} stale`);
|
|
92
|
+
log(`synced to ${config.repos ? head : to.slice(0, 7)}: ${scan.graph.nodeCount} nodes, ${scan.semantic.stale} stale`);
|
|
72
93
|
return result;
|
|
73
94
|
}
|
|
74
95
|
catch (err) {
|
package/dist/sync/sync.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.js","sourceRoot":"","sources":["../../src/sync/sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,C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Y,CAAC,KAAK,CAAC,CAAC;QACjC,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -22,6 +22,16 @@ The version must be **0.1.0 or newer**. If it is `0.0.1` (the placeholder), stop
|
|
|
22
22
|
|
|
23
23
|
Default: a sibling folder named `<project-folder>-brain` (for example `../shop-brain`). If the user named a location, use it. If the folder already contains a `neuroplex.json`, this is an update: keep going, existing knowledge is preserved.
|
|
24
24
|
|
|
25
|
+
**Several repositories (backend + frontend + …)?** If the system the user cares about spans several repositories, or this folder holds mostly docs while the code lives elsewhere, offer a **multi-repo brain** so HTTP calls between them are linked. Ask which repositories to include and where they are checked out, then replace step 2 with:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
$NP repo add <path-to-backend> --name backend --brain <brain>
|
|
29
|
+
$NP repo add <path-to-frontend> --name frontend --brain <brain>
|
|
30
|
+
$NP scan --brain <brain>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Every other step stays the same.
|
|
34
|
+
|
|
25
35
|
## 2. Structural scan
|
|
26
36
|
|
|
27
37
|
```bash
|
|
@@ -38,7 +48,7 @@ Repeat until `phase` is `null`:
|
|
|
38
48
|
$NP tasks --brain <brain> --limit 3
|
|
39
49
|
```
|
|
40
50
|
|
|
41
|
-
The output is compact JSON: `phase`, `tasks`, `pending` (counts per phase), `sourcePath` (where the code lives) and `
|
|
51
|
+
The output is compact JSON: `phase`, `tasks`, `pending` (counts per phase), `sourcePath` (where the code lives), `resultFormat` and `writeIn` (the language to write in). (`--brief` prints just the task list if you want an overview first.) For **each task**:
|
|
42
52
|
|
|
43
53
|
1. Read `instructions`, `targets` and `context`.
|
|
44
54
|
2. **Read the actual source files** listed in the context (paths are relative to `sourcePath`). Never write summaries from names alone.
|
|
@@ -57,7 +67,7 @@ Phases run in order: **modules → project → concepts → flows**. A big modul
|
|
|
57
67
|
### Writing good knowledge
|
|
58
68
|
|
|
59
69
|
- **Every ID must be copied exactly** from the task (`symbol:src/auth/login.ts#login`, `module:src/auth`, `file:src/a.ts`).
|
|
60
|
-
- **Summaries** explain *what it does and why it exists*, plus anything non-obvious: side effects, important constraints, surprising behavior. Don't restate the name ("`parseConfig` parses the config" is useless). Length: symbols and files 1-2 sentences; modules 2-4 sentences; project 3-6 sentences. Write in
|
|
70
|
+
- **Summaries** explain *what it does and why it exists*, plus anything non-obvious: side effects, important constraints, surprising behavior. Don't restate the name ("`parseConfig` parses the config" is useless). Length: symbols and files 1-2 sentences; modules 2-4 sentences; project 3-6 sentences. Write in the language given by `writeIn`: by default the project's own language (a Portuguese codebase gets Portuguese summaries). If the user asks for another language, set it once with `$NP config set enrich.language "English" --brain <brain>`.
|
|
61
71
|
- **Notes** (markdown) are for modules and the project: responsibilities, how the parts fit together, key decisions, gotchas. Aim for 5-20 lines; skip boilerplate headings.
|
|
62
72
|
- **Tags**: optional, a few lowercase words that help search (`auth`, `persistence`, `cli`).
|
|
63
73
|
- **Concepts**: 5-15 *domain* ideas (what the software is about), not technical layers like "utils" or "tests". Members implement each concept, most important first, at most 15; they can be IDs, paths or unique symbol names.
|
|
@@ -90,6 +100,9 @@ Registering the MCP server changes the user's Claude Code configuration, so **as
|
|
|
90
100
|
Tell the user in a few lines:
|
|
91
101
|
|
|
92
102
|
- where the brain is and what it contains: `$NP status --brain <brain>`;
|
|
103
|
+
- that they can **see it in Obsidian**: open `<brain>/vault` as a vault and use the graph view;
|
|
104
|
+
- that they can query it from the terminal too: `$NP search …`, `$NP explain …`, `$NP impact …` (with `--brain <brain>`);
|
|
105
|
+
- that the whole team can share one brain over HTTP (`$NP serve --http`, see docs/DEPLOY.md in the Neuroplex repository);
|
|
93
106
|
- how to refresh it after code changes: run `/neuroplex-update`, or `$NP update` followed by the enrichment loop for stale nodes;
|
|
94
107
|
- that **auto-sync** can keep it current with `main` automatically while the MCP server runs (`$NP config set sync.autoSync true --brain <brain>`, off by default). Offer it, but don't turn it on without a yes;
|
|
95
108
|
- that pushing the brain to its own remote lets teammates use it too.
|