@cleocode/brain 2026.11.17 → 2026.11.18-rc.ci.735
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/src/adapters/agent-registry.d.ts +2 -5
- package/dist/src/adapters/agent-registry.d.ts.map +1 -1
- package/dist/src/adapters/agent-registry.js +20 -24
- package/dist/src/adapters/agent-registry.js.map +1 -1
- package/dist/src/adapters/brain.d.ts +2 -5
- package/dist/src/adapters/brain.d.ts.map +1 -1
- package/dist/src/adapters/brain.js +165 -169
- package/dist/src/adapters/brain.js.map +1 -1
- package/dist/src/adapters/conduit.d.ts +2 -5
- package/dist/src/adapters/conduit.d.ts.map +1 -1
- package/dist/src/adapters/conduit.js +43 -47
- package/dist/src/adapters/conduit.js.map +1 -1
- package/dist/src/adapters/index.d.ts +4 -0
- package/dist/src/adapters/index.d.ts.map +1 -1
- package/dist/src/adapters/index.js +40 -28
- package/dist/src/adapters/index.js.map +1 -1
- package/dist/src/adapters/nexus.d.ts +2 -5
- package/dist/src/adapters/nexus.d.ts.map +1 -1
- package/dist/src/adapters/nexus.js +35 -39
- package/dist/src/adapters/nexus.js.map +1 -1
- package/dist/src/adapters/tasks.d.ts +2 -5
- package/dist/src/adapters/tasks.d.ts.map +1 -1
- package/dist/src/adapters/tasks.js +83 -87
- package/dist/src/adapters/tasks.js.map +1 -1
- package/dist/src/db-connections.d.ts +29 -2
- package/dist/src/db-connections.d.ts.map +1 -1
- package/dist/src/db-connections.js +53 -12
- package/dist/src/db-connections.js.map +1 -1
- package/dist/src/types.d.ts +1 -1
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +4 -4
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Node IDs are prefixed with "conduit:" to prevent collisions.
|
|
10
10
|
*/
|
|
11
|
-
import { allTyped, readProjectStore } from '../db-connections.js';
|
|
11
|
+
import { allTyped, readProjectStore, substrateResult, tryQuery } from '../db-connections.js';
|
|
12
12
|
import { resolveDefaultProjectContext } from '../project-context.js';
|
|
13
13
|
/**
|
|
14
14
|
* Returns all BrainNodes and BrainEdges sourced from `conduit_messages`.
|
|
@@ -25,59 +25,55 @@ export function getConduitSubstrate(options = {}) {
|
|
|
25
25
|
const perSubstrateLimit = Math.ceil((options.limit ?? 500) / 5);
|
|
26
26
|
const nodes = [];
|
|
27
27
|
const edges = [];
|
|
28
|
+
const errors = [];
|
|
28
29
|
readProjectStore(ctx, (db) => {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const msgRows = allTyped(db.prepare(`SELECT id, content, from_agent_id, to_agent_id,
|
|
30
|
+
// Most recent messages
|
|
31
|
+
const msgRows = tryQuery(errors, 'conduit_messages', () => allTyped(db.prepare(`SELECT id, content, from_agent_id, to_agent_id,
|
|
32
32
|
strftime('%Y-%m-%dT%H:%M:%S', created_at) AS created_at, conversation_id
|
|
33
33
|
FROM main.conduit_messages
|
|
34
34
|
ORDER BY created_at DESC
|
|
35
|
-
LIMIT ?`), perSubstrateLimit);
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
35
|
+
LIMIT ?`), perSubstrateLimit));
|
|
36
|
+
const agentPairs = new Map();
|
|
37
|
+
for (const row of msgRows) {
|
|
38
|
+
// Message node — truncate content for label
|
|
39
|
+
const label = row.content.length > 80 ? `${row.content.slice(0, 80)}…` : row.content;
|
|
40
|
+
nodes.push({
|
|
41
|
+
id: `conduit:${row.id}`,
|
|
42
|
+
kind: 'message',
|
|
43
|
+
substrate: 'conduit',
|
|
44
|
+
label,
|
|
45
|
+
createdAt: row.created_at,
|
|
46
|
+
meta: {
|
|
47
|
+
from_agent_id: row.from_agent_id,
|
|
48
|
+
to_agent_id: row.to_agent_id,
|
|
49
|
+
conversation_id: row.conversation_id,
|
|
50
|
+
created_at: row.created_at,
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
// Aggregate agent pairs for social-graph edges
|
|
54
|
+
if (row.from_agent_id && row.to_agent_id) {
|
|
55
|
+
const key = `${row.from_agent_id}→${row.to_agent_id}`;
|
|
56
|
+
const existing = agentPairs.get(key);
|
|
57
|
+
if (existing) {
|
|
58
|
+
existing.count++;
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
agentPairs.set(key, { count: 1, from: row.from_agent_id, to: row.to_agent_id });
|
|
63
62
|
}
|
|
64
|
-
}
|
|
65
|
-
// Cross-substrate: agent social graph edges pointing to agent-registry nodes
|
|
66
|
-
for (const [, pair] of agentPairs) {
|
|
67
|
-
const weight = Math.min(1.0, pair.count / 10);
|
|
68
|
-
edges.push({
|
|
69
|
-
source: `agent-registry:${pair.from}`,
|
|
70
|
-
target: `agent-registry:${pair.to}`,
|
|
71
|
-
type: 'messages',
|
|
72
|
-
weight,
|
|
73
|
-
substrate: 'cross',
|
|
74
|
-
});
|
|
75
63
|
}
|
|
76
64
|
}
|
|
77
|
-
|
|
78
|
-
|
|
65
|
+
// Cross-substrate: agent social graph edges pointing to agent-registry nodes
|
|
66
|
+
for (const [, pair] of agentPairs) {
|
|
67
|
+
const weight = Math.min(1.0, pair.count / 10);
|
|
68
|
+
edges.push({
|
|
69
|
+
source: `agent-registry:${pair.from}`,
|
|
70
|
+
target: `agent-registry:${pair.to}`,
|
|
71
|
+
type: 'messages',
|
|
72
|
+
weight,
|
|
73
|
+
substrate: 'cross',
|
|
74
|
+
});
|
|
79
75
|
}
|
|
80
|
-
});
|
|
81
|
-
return
|
|
76
|
+
}, (message) => errors.push(message));
|
|
77
|
+
return substrateResult(nodes, edges, errors);
|
|
82
78
|
}
|
|
83
79
|
//# sourceMappingURL=conduit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conduit.js","sourceRoot":"","sources":["../../../src/adapters/conduit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"conduit.js","sourceRoot":"","sources":["../../../src/adapters/conduit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC7F,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAcrE;;;;;;;;;GASG;AACH,MAAM,UAAU,mBAAmB,CAAC,UAA6B,EAAE;IACjE,MAAM,GAAG,GAAG,OAAO,CAAC,UAAU,IAAI,4BAA4B,EAAE,CAAC;IACjE,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IAEhE,MAAM,KAAK,GAAgB,EAAE,CAAC;IAC9B,MAAM,KAAK,GAAgB,EAAE,CAAC;IAC9B,MAAM,MAAM,GAAa,EAAE,CAAC;IAE5B,gBAAgB,CACd,GAAG,EACH,CAAC,EAAE,EAAE,EAAE;QACL,uBAAuB;QACvB,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,EAAE,kBAAkB,EAAE,GAAG,EAAE,CACxD,QAAQ,CACN,EAAE,CAAC,OAAO,CACR;;;;iBAIK,CACN,EACD,iBAAiB,CAClB,CACF,CAAC;QAEF,MAAM,UAAU,GAAG,IAAI,GAAG,EAAuD,CAAC;QAElF,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;YAC1B,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GAAG,EAAE,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC;YAC9C,KAAK,CAAC,IAAI,CAAC;gBACT,MAAM,EAAE,kBAAkB,IAAI,CAAC,IAAI,EAAE;gBACrC,MAAM,EAAE,kBAAkB,IAAI,CAAC,EAAE,EAAE;gBACnC,IAAI,EAAE,UAAU;gBAChB,MAAM;gBACN,SAAS,EAAE,OAAO;aACnB,CAAC,CAAC;QACL,CAAC;IACH,CAAC,EACD,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAClC,CAAC;IAEF,OAAO,eAAe,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -24,6 +24,10 @@ import type { BrainGraph, BrainQueryOptions } from '../types.js';
|
|
|
24
24
|
* that would otherwise be silently dropped.
|
|
25
25
|
*
|
|
26
26
|
* Stub nodes carry `meta.isStub: true` for optional UI differentiation.
|
|
27
|
+
* A substrate whose read failed is named in `errors` with the SQL error, so a
|
|
28
|
+
* broken query never passes for an empty substrate (T14647). Each query is
|
|
29
|
+
* caught on its own, so one failure never skips a substrate's other queries;
|
|
30
|
+
* an unopenable store and a failed nexus stub read are reported too (T14656).
|
|
27
31
|
*
|
|
28
32
|
* @param options - Query options forwarded to each substrate adapter.
|
|
29
33
|
* @returns Merged BrainGraph across all requested substrates, with stub nodes for unresolved edge targets.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAI/C,OAAO,KAAK,EAEV,UAAU,EAEV,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAI/C,OAAO,KAAK,EAEV,UAAU,EAEV,iBAAiB,EAGlB,MAAM,aAAa,CAAC;AAsIrB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,iBAAsB,GAAG,UAAU,CAsF5E"}
|
|
@@ -10,7 +10,7 @@ export { getBrainSubstrate } from './brain.js';
|
|
|
10
10
|
export { getConduitSubstrate } from './conduit.js';
|
|
11
11
|
export { getNexusSubstrate } from './nexus.js';
|
|
12
12
|
export { getTasksSubstrate } from './tasks.js';
|
|
13
|
-
import { allTyped, readProjectStore } from '../db-connections.js';
|
|
13
|
+
import { allTyped, readProjectStore, tryQuery } from '../db-connections.js';
|
|
14
14
|
import { resolveDefaultProjectContext } from '../project-context.js';
|
|
15
15
|
import { getAgentRegistrySubstrate } from './agent-registry.js';
|
|
16
16
|
import { getBrainSubstrate } from './brain.js';
|
|
@@ -39,9 +39,11 @@ const ADAPTER_MAP = {
|
|
|
39
39
|
* @param loadedNodeIds - Set of already-loaded node IDs (substrate-prefixed).
|
|
40
40
|
* @param edges - All edges collected from substrates (may reference unloaded targets).
|
|
41
41
|
* @param ctx - Project whose `cleo.db` code graph resolves nexus stubs.
|
|
42
|
+
* @param errors - Collects a failed nexus stub read, so the stubs it would
|
|
43
|
+
* have recovered are never dropped silently (T14656).
|
|
42
44
|
* @returns Array of stub BrainNode objects for missing targets.
|
|
43
45
|
*/
|
|
44
|
-
function loadStubNodesForEdgeTargets(loadedNodeIds, edges, ctx) {
|
|
46
|
+
function loadStubNodesForEdgeTargets(loadedNodeIds, edges, ctx, errors) {
|
|
45
47
|
// Collect all target IDs referenced by edges but not yet loaded
|
|
46
48
|
const missingTargetIds = new Set();
|
|
47
49
|
for (const edge of edges) {
|
|
@@ -72,32 +74,27 @@ function loadStubNodesForEdgeTargets(loadedNodeIds, edges, ctx) {
|
|
|
72
74
|
const nexusStubs = stubsBySubstrate.get('nexus');
|
|
73
75
|
if (nexusStubs && nexusStubs.length > 0) {
|
|
74
76
|
readProjectStore(ctx, (db) => {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const stubRows = allTyped(db.prepare(`SELECT id, kind, COALESCE(name, label) AS name
|
|
77
|
+
const rawNexusIds = nexusStubs.map((id) => id.replace(/^nexus:/, ''));
|
|
78
|
+
const placeholders = rawNexusIds.map(() => '?').join(',');
|
|
79
|
+
// Query minimal node data: id, kind, name
|
|
80
|
+
const stubRows = tryQuery(errors, 'nexus_nodes (stubs)', () => allTyped(db.prepare(`SELECT id, kind, COALESCE(name, label) AS name
|
|
80
81
|
FROM main.nexus_nodes
|
|
81
|
-
WHERE id IN (${placeholders})`), ...rawNexusIds);
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
82
|
+
WHERE id IN (${placeholders})`), ...rawNexusIds));
|
|
83
|
+
for (const row of stubRows) {
|
|
84
|
+
const kind = row.kind === 'file' || row.kind === 'folder' || row.kind === 'module'
|
|
85
|
+
? 'file'
|
|
86
|
+
: 'symbol';
|
|
87
|
+
stubs.push({
|
|
88
|
+
id: `nexus:${row.id}`,
|
|
89
|
+
kind,
|
|
90
|
+
substrate: 'nexus',
|
|
91
|
+
label: row.name,
|
|
92
|
+
weight: undefined,
|
|
93
|
+
createdAt: null,
|
|
94
|
+
meta: { nexus_kind: row.kind, isStub: true },
|
|
95
|
+
});
|
|
96
96
|
}
|
|
97
|
-
|
|
98
|
-
// Silently continue on error; stubs are supplemental
|
|
99
|
-
}
|
|
100
|
-
});
|
|
97
|
+
}, (message) => errors.push(message));
|
|
101
98
|
}
|
|
102
99
|
// For other substrates (tasks, brain, conduit, signaldock), create minimal stubs
|
|
103
100
|
// without DB queries — they are rare as cross-substrate edge targets.
|
|
@@ -132,6 +129,10 @@ function loadStubNodesForEdgeTargets(loadedNodeIds, edges, ctx) {
|
|
|
132
129
|
* that would otherwise be silently dropped.
|
|
133
130
|
*
|
|
134
131
|
* Stub nodes carry `meta.isStub: true` for optional UI differentiation.
|
|
132
|
+
* A substrate whose read failed is named in `errors` with the SQL error, so a
|
|
133
|
+
* broken query never passes for an empty substrate (T14647). Each query is
|
|
134
|
+
* caught on its own, so one failure never skips a substrate's other queries;
|
|
135
|
+
* an unopenable store and a failed nexus stub read are reported too (T14656).
|
|
135
136
|
*
|
|
136
137
|
* @param options - Query options forwarded to each substrate adapter.
|
|
137
138
|
* @returns Merged BrainGraph across all requested substrates, with stub nodes for unresolved edge targets.
|
|
@@ -143,11 +144,14 @@ export function getAllSubstrates(options = {}) {
|
|
|
143
144
|
const allEdges = [];
|
|
144
145
|
const nodeCounts = Object.fromEntries(ALL_SUBSTRATES.map((s) => [s, 0]));
|
|
145
146
|
const edgeCounts = Object.fromEntries([...ALL_SUBSTRATES, 'cross'].map((s) => [s, 0]));
|
|
147
|
+
const errors = {};
|
|
146
148
|
for (const substrate of substrates) {
|
|
147
149
|
const adapter = ADAPTER_MAP[substrate];
|
|
148
150
|
if (!adapter)
|
|
149
151
|
continue;
|
|
150
|
-
const { nodes, edges } = adapter({ ...options, limit });
|
|
152
|
+
const { nodes, edges, error } = adapter({ ...options, limit });
|
|
153
|
+
if (error !== undefined)
|
|
154
|
+
errors[substrate] = error;
|
|
151
155
|
allNodes.push(...nodes);
|
|
152
156
|
allEdges.push(...edges);
|
|
153
157
|
nodeCounts[substrate] = nodes.length;
|
|
@@ -173,7 +177,14 @@ export function getAllSubstrates(options = {}) {
|
|
|
173
177
|
// within the requested set — never inject nodes from excluded substrates, as that
|
|
174
178
|
// would violate the caller's filter contract.
|
|
175
179
|
const requestedSubstrateSet = options.substrates ? new Set(options.substrates) : null;
|
|
176
|
-
const
|
|
180
|
+
const stubErrors = [];
|
|
181
|
+
const stubNodes = loadStubNodesForEdgeTargets(seenIds, allEdges, options.projectCtx ?? resolveDefaultProjectContext(), stubErrors);
|
|
182
|
+
// A failed stub read is a nexus read failure; it joins any nexus adapter error.
|
|
183
|
+
for (const message of stubErrors) {
|
|
184
|
+
if (errors.nexus?.includes(message))
|
|
185
|
+
continue;
|
|
186
|
+
errors.nexus = errors.nexus === undefined ? message : `${errors.nexus}; ${message}`;
|
|
187
|
+
}
|
|
177
188
|
for (const stubNode of stubNodes) {
|
|
178
189
|
if (!seenIds.has(stubNode.id)) {
|
|
179
190
|
// Skip stubs from substrates not in the requested set
|
|
@@ -190,6 +201,7 @@ export function getAllSubstrates(options = {}) {
|
|
|
190
201
|
edges: allEdges,
|
|
191
202
|
counts: { nodes: nodeCounts, edges: edgeCounts },
|
|
192
203
|
truncated,
|
|
204
|
+
...(Object.keys(errors).length > 0 ? { errors } : {}),
|
|
193
205
|
};
|
|
194
206
|
}
|
|
195
207
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapters/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;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KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW;QAC5D,KAAK,EAAE,QAAQ;QACf,MAAM,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;QAChD,SAAS;QACT,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACtD,CAAC;AACJ,CAAC"}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*
|
|
10
10
|
* Node IDs are prefixed with "nexus:" to prevent collisions.
|
|
11
11
|
*/
|
|
12
|
-
import type {
|
|
12
|
+
import type { BrainQueryOptions, BrainSubstrateResult } from '../types.js';
|
|
13
13
|
/**
|
|
14
14
|
* Returns all BrainNodes and BrainEdges sourced from the project code graph.
|
|
15
15
|
*
|
|
@@ -19,8 +19,5 @@ import type { BrainEdge, BrainNode, BrainQueryOptions } from '../types.js';
|
|
|
19
19
|
* @param options - Query options (limit, projectCtx).
|
|
20
20
|
* @returns Nodes and edges from the NEXUS substrate.
|
|
21
21
|
*/
|
|
22
|
-
export declare function getNexusSubstrate(options?: BrainQueryOptions):
|
|
23
|
-
nodes: BrainNode[];
|
|
24
|
-
edges: BrainEdge[];
|
|
25
|
-
};
|
|
22
|
+
export declare function getNexusSubstrate(options?: BrainQueryOptions): BrainSubstrateResult;
|
|
26
23
|
//# sourceMappingURL=nexus.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nexus.d.ts","sourceRoot":"","sources":["../../../src/adapters/nexus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"nexus.d.ts","sourceRoot":"","sources":["../../../src/adapters/nexus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,KAAK,EAIV,iBAAiB,EACjB,oBAAoB,EACrB,MAAM,aAAa,CAAC;AAyBrB;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,iBAAsB,GAAG,oBAAoB,CA8EvF"}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*
|
|
10
10
|
* Node IDs are prefixed with "nexus:" to prevent collisions.
|
|
11
11
|
*/
|
|
12
|
-
import { allTyped, readProjectStore } from '../db-connections.js';
|
|
12
|
+
import { allTyped, readProjectStore, substrateResult, tryQuery } from '../db-connections.js';
|
|
13
13
|
import { resolveDefaultProjectContext } from '../project-context.js';
|
|
14
14
|
/** Maps nexus node kinds to BrainNodeKind. */
|
|
15
15
|
function mapKind(nexusKind) {
|
|
@@ -31,10 +31,10 @@ export function getNexusSubstrate(options = {}) {
|
|
|
31
31
|
const perSubstrateLimit = Math.ceil((options.limit ?? 500) / 5);
|
|
32
32
|
const nodes = [];
|
|
33
33
|
const edges = [];
|
|
34
|
+
const errors = [];
|
|
34
35
|
readProjectStore(ctx, (db) => {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const nodeRows = allTyped(db.prepare(`SELECT n.id, n.kind, COALESCE(n.name, n.label) AS name, n.indexed_at,
|
|
36
|
+
// Count in-degree for each node to use as weight
|
|
37
|
+
const nodeRows = tryQuery(errors, 'nexus_nodes', () => allTyped(db.prepare(`SELECT n.id, n.kind, COALESCE(n.name, n.label) AS name, n.indexed_at,
|
|
38
38
|
COUNT(r.target_id) AS in_degree
|
|
39
39
|
FROM main.nexus_nodes n
|
|
40
40
|
LEFT JOIN main.nexus_relations r ON r.target_id = n.id
|
|
@@ -44,43 +44,39 @@ export function getNexusSubstrate(options = {}) {
|
|
|
44
44
|
)
|
|
45
45
|
GROUP BY n.id
|
|
46
46
|
ORDER BY in_degree DESC
|
|
47
|
-
LIMIT ?`), perSubstrateLimit);
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
47
|
+
LIMIT ?`), perSubstrateLimit));
|
|
48
|
+
for (const row of nodeRows) {
|
|
49
|
+
nodes.push({
|
|
50
|
+
id: `nexus:${row.id}`,
|
|
51
|
+
kind: mapKind(row.kind),
|
|
52
|
+
substrate: 'nexus',
|
|
53
|
+
label: row.name,
|
|
54
|
+
weight: row.in_degree > 0 ? Math.min(1, row.in_degree / 50) : undefined,
|
|
55
|
+
createdAt: row.indexed_at ?? null,
|
|
56
|
+
meta: { nexus_kind: row.kind, in_degree: row.in_degree },
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
// Edges between loaded nodes only
|
|
60
|
+
const nodeIds = new Set(nodes.map((n) => n.id));
|
|
61
|
+
const rawIds = new Set([...nodeIds].map((id) => id.replace(/^nexus:/, '')));
|
|
62
|
+
// Fetch all relations touching these nodes (both directions)
|
|
63
|
+
const placeholders = [...rawIds].map(() => '?').join(',');
|
|
64
|
+
if (rawIds.size === 0)
|
|
65
|
+
return;
|
|
66
|
+
const relRows = tryQuery(errors, 'nexus_relations', () => allTyped(db.prepare(`SELECT source_id, target_id, type, confidence
|
|
67
67
|
FROM main.nexus_relations
|
|
68
68
|
WHERE source_id IN (${placeholders})
|
|
69
|
-
AND target_id IN (${placeholders})`), ...rawIds, ...rawIds);
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
catch {
|
|
81
|
-
// Return partial results on error
|
|
69
|
+
AND target_id IN (${placeholders})`), ...rawIds, ...rawIds));
|
|
70
|
+
for (const row of relRows) {
|
|
71
|
+
edges.push({
|
|
72
|
+
source: `nexus:${row.source_id}`,
|
|
73
|
+
target: `nexus:${row.target_id}`,
|
|
74
|
+
type: row.type,
|
|
75
|
+
weight: row.confidence ?? 0.5,
|
|
76
|
+
substrate: 'nexus',
|
|
77
|
+
});
|
|
82
78
|
}
|
|
83
|
-
});
|
|
84
|
-
return
|
|
79
|
+
}, (message) => errors.push(message));
|
|
80
|
+
return substrateResult(nodes, edges, errors);
|
|
85
81
|
}
|
|
86
82
|
//# sourceMappingURL=nexus.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nexus.js","sourceRoot":"","sources":["../../../src/adapters/nexus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"nexus.js","sourceRoot":"","sources":["../../../src/adapters/nexus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC7F,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AA0BrE,8CAA8C;AAC9C,SAAS,OAAO,CAAC,SAAiB;IAChC,IAAI,SAAS,KAAK,MAAM,IAAI,SAAS,KAAK,QAAQ,IAAI,SAAS,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC;IAC5F,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,iBAAiB,CAAC,UAA6B,EAAE;IAC/D,MAAM,GAAG,GAAG,OAAO,CAAC,UAAU,IAAI,4BAA4B,EAAE,CAAC;IACjE,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IAEhE,MAAM,KAAK,GAAgB,EAAE,CAAC;IAC9B,MAAM,KAAK,G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YAAY,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC1D,IAAI,MAAM,CAAC,IAAI,KAAK,CAAC;YAAE,OAAO;QAE9B,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,EAAE,iBAAiB,EAAE,GAAG,EAAE,CACvD,QAAQ,CACN,EAAE,CAAC,OAAO,CACR;;+BAEmB,YAAY;+BACZ,YAAY,GAAG,CACnC,EACD,GAAG,MAAM,EACT,GAAG,MAAM,CACV,CACF,CAAC;QAEF,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;YAC1B,KAAK,CAAC,IAAI,CAAC;gBACT,MAAM,EAAE,SAAS,GAAG,CAAC,SAAS,EAAE;gBAChC,MAAM,EAAE,SAAS,GAAG,CAAC,SAAS,EAAE;gBAChC,IAAI,EAAE,GAAG,CAAC,IAAI;gBACd,MAAM,EAAE,GAAG,CAAC,UAAU,IAAI,GAAG;gBAC7B,SAAS,EAAE,OAAO;aACnB,CAAC,CAAC;QACL,CAAC;IACH,CAAC,EACD,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAClC,CAAC;IAEF,OAAO,eAAe,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Node IDs are prefixed with "tasks:" to prevent collisions.
|
|
10
10
|
*/
|
|
11
|
-
import type {
|
|
11
|
+
import type { BrainQueryOptions, BrainSubstrateResult } from '../types.js';
|
|
12
12
|
/**
|
|
13
13
|
* Returns all BrainNodes and BrainEdges sourced from the project `cleo.db`.
|
|
14
14
|
*
|
|
@@ -18,8 +18,5 @@ import type { BrainEdge, BrainNode, BrainQueryOptions } from '../types.js';
|
|
|
18
18
|
* @param options - Query options (limit, minWeight).
|
|
19
19
|
* @returns Nodes and edges from the TASKS substrate.
|
|
20
20
|
*/
|
|
21
|
-
export declare function getTasksSubstrate(options?: BrainQueryOptions):
|
|
22
|
-
nodes: BrainNode[];
|
|
23
|
-
edges: BrainEdge[];
|
|
24
|
-
};
|
|
21
|
+
export declare function getTasksSubstrate(options?: BrainQueryOptions): BrainSubstrateResult;
|
|
25
22
|
//# sourceMappingURL=tasks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../../src/adapters/tasks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../../src/adapters/tasks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAwB,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AA6CjG;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,iBAAsB,GAAG,oBAAoB,CAuJvF"}
|