@cleocode/brain 2026.11.17 → 2026.11.18
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
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* @task T11622 (Signaldock → Agent Registry rename; folds T11578 AC2)
|
|
22
22
|
* @task T14583 (read the global cleo.db)
|
|
23
23
|
*/
|
|
24
|
-
import type {
|
|
24
|
+
import type { BrainQueryOptions, BrainSubstrateResult } from '../types.js';
|
|
25
25
|
/**
|
|
26
26
|
* Returns all BrainNodes and BrainEdges sourced from the Agent Registry.
|
|
27
27
|
*
|
|
@@ -31,8 +31,5 @@ import type { BrainEdge, BrainNode, BrainQueryOptions } from '../types.js';
|
|
|
31
31
|
* @param options - Query options (limit).
|
|
32
32
|
* @returns Nodes (and no edges) from the AGENT-REGISTRY substrate.
|
|
33
33
|
*/
|
|
34
|
-
export declare function getAgentRegistrySubstrate(options?: BrainQueryOptions):
|
|
35
|
-
nodes: BrainNode[];
|
|
36
|
-
edges: BrainEdge[];
|
|
37
|
-
};
|
|
34
|
+
export declare function getAgentRegistrySubstrate(options?: BrainQueryOptions): BrainSubstrateResult;
|
|
38
35
|
//# sourceMappingURL=agent-registry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-registry.d.ts","sourceRoot":"","sources":["../../../src/adapters/agent-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"agent-registry.d.ts","sourceRoot":"","sources":["../../../src/adapters/agent-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,KAAK,EAAwB,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAWjG;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,GAAE,iBAAsB,GAAG,oBAAoB,CA8C/F"}
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* @task T11622 (Signaldock → Agent Registry rename; folds T11578 AC2)
|
|
22
22
|
* @task T14583 (read the global cleo.db)
|
|
23
23
|
*/
|
|
24
|
-
import { allTyped, readGlobalStore } from '../db-connections.js';
|
|
24
|
+
import { allTyped, readGlobalStore, substrateResult, tryQuery } from '../db-connections.js';
|
|
25
25
|
/**
|
|
26
26
|
* Returns all BrainNodes and BrainEdges sourced from the Agent Registry.
|
|
27
27
|
*
|
|
@@ -35,10 +35,10 @@ export function getAgentRegistrySubstrate(options = {}) {
|
|
|
35
35
|
const perSubstrateLimit = Math.ceil((options.limit ?? 500) / 5);
|
|
36
36
|
const nodes = [];
|
|
37
37
|
const edges = [];
|
|
38
|
+
const errors = [];
|
|
38
39
|
readGlobalStore((db) => {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const agentRows = allTyped(db.prepare(`SELECT agent_id, name, status,
|
|
40
|
+
// created_at is ISO text; a legacy epoch-seconds integer is converted too.
|
|
41
|
+
const agentRows = tryQuery(errors, 'agent_registry_agents', () => allTyped(db.prepare(`SELECT agent_id, name, status,
|
|
42
42
|
CASE WHEN typeof(created_at) = 'integer'
|
|
43
43
|
THEN strftime('%Y-%m-%dT%H:%M:%S', created_at, 'unixepoch')
|
|
44
44
|
ELSE strftime('%Y-%m-%dT%H:%M:%S', created_at)
|
|
@@ -46,26 +46,22 @@ export function getAgentRegistrySubstrate(options = {}) {
|
|
|
46
46
|
FROM main.agent_registry_agents
|
|
47
47
|
WHERE is_active = 1
|
|
48
48
|
ORDER BY created_at DESC
|
|
49
|
-
LIMIT ?`), perSubstrateLimit);
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
49
|
+
LIMIT ?`), perSubstrateLimit));
|
|
50
|
+
for (const row of agentRows) {
|
|
51
|
+
nodes.push({
|
|
52
|
+
id: `agent-registry:${row.agent_id}`,
|
|
53
|
+
kind: 'agent',
|
|
54
|
+
substrate: 'agent-registry',
|
|
55
|
+
label: row.name,
|
|
56
|
+
weight: row.status === 'online' ? 1.0 : 0.5,
|
|
57
|
+
createdAt: row.created_at,
|
|
58
|
+
meta: {
|
|
59
|
+
status: row.status,
|
|
60
|
+
created_at: row.created_at,
|
|
61
|
+
},
|
|
62
|
+
});
|
|
64
63
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
return { nodes, edges };
|
|
64
|
+
}, (message) => errors.push(message));
|
|
65
|
+
return substrateResult(nodes, edges, errors);
|
|
70
66
|
}
|
|
71
67
|
//# sourceMappingURL=agent-registry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-registry.js","sourceRoot":"","sources":["../../../src/adapters/agent-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"agent-registry.js","sourceRoot":"","sources":["../../../src/adapters/agent-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAY5F;;;;;;;;GAQG;AACH,MAAM,UAAU,yBAAyB,CAAC,UAA6B,EAAE;IACvE,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,eAAe,CACb,CAAC,EAAE,EAAE,EAAE;QACL,2EAA2E;QAC3E,MAAM,SAAS,GAAG,QAAQ,CAAC,MAAM,EAAE,uBAAuB,EAAE,GAAG,EAAE,CAC/D,QAAQ,CACN,EAAE,CAAC,OAAO,CACR;;;;;;;;mBAQO,CACR,EACD,iBAAiB,CAClB,CACF,CAAC;QAEF,KAAK,MAAM,GAAG,IAAI,SAAS,EAAE,CAAC;YAC5B,KAAK,CAAC,IAAI,CAAC;gBACT,EAAE,EAAE,kBAAkB,GAAG,CAAC,QAAQ,EAAE;gBACpC,IAAI,EAAE,OAAO;gBACb,SAAS,EAAE,gBAAgB;gBAC3B,KAAK,EAAE,GAAG,CAAC,IAAI;gBACf,MAAM,EAAE,GAAG,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG;gBAC3C,SAAS,EAAE,GAAG,CAAC,UAAU;gBACzB,IAAI,EAAE;oBACJ,MAAM,EAAE,GAAG,CAAC,MAAM;oBAClB,UAAU,EAAE,GAAG,CAAC,UAAU;iBAC3B;aACF,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"}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*
|
|
15
15
|
* Node IDs are prefixed with "brain:" to prevent collisions.
|
|
16
16
|
*/
|
|
17
|
-
import type {
|
|
17
|
+
import type { BrainQueryOptions, BrainSubstrateResult } from '../types.js';
|
|
18
18
|
/**
|
|
19
19
|
* Returns all BrainNodes and BrainEdges sourced from the project `cleo.db`.
|
|
20
20
|
*
|
|
@@ -29,8 +29,5 @@ import type { BrainEdge, BrainNode, BrainQueryOptions } from '../types.js';
|
|
|
29
29
|
* @param options - Query options (limit, minWeight).
|
|
30
30
|
* @returns Nodes and edges from the BRAIN substrate.
|
|
31
31
|
*/
|
|
32
|
-
export declare function getBrainSubstrate(options?: BrainQueryOptions):
|
|
33
|
-
nodes: BrainNode[];
|
|
34
|
-
edges: BrainEdge[];
|
|
35
|
-
};
|
|
32
|
+
export declare function getBrainSubstrate(options?: BrainQueryOptions): BrainSubstrateResult;
|
|
36
33
|
//# sourceMappingURL=brain.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brain.d.ts","sourceRoot":"","sources":["../../../src/adapters/brain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"brain.d.ts","sourceRoot":"","sources":["../../../src/adapters/brain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,KAAK,EAAwB,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAyHjG;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,iBAAsB,GAAG,oBAAoB,CAoQvF"}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*
|
|
15
15
|
* Node IDs are prefixed with "brain:" to prevent collisions.
|
|
16
16
|
*/
|
|
17
|
-
import { allTyped, readProjectStore } from '../db-connections.js';
|
|
17
|
+
import { allTyped, readProjectStore, substrateResult, tryQuery } from '../db-connections.js';
|
|
18
18
|
import { resolveDefaultProjectContext } from '../project-context.js';
|
|
19
19
|
/**
|
|
20
20
|
* Converts a brain_page_edges type-prefixed ID (e.g. "observation:O-abc")
|
|
@@ -96,208 +96,204 @@ export function getBrainSubstrate(options = {}) {
|
|
|
96
96
|
const perSubstrateLimit = Math.ceil((options.limit ?? 500) / 5);
|
|
97
97
|
const nodes = [];
|
|
98
98
|
const edges = [];
|
|
99
|
+
const errors = [];
|
|
99
100
|
readProjectStore(ctx, (db) => {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
const obsRows = allTyped(db.prepare(`SELECT id, title, quality_score, memory_tier,
|
|
101
|
+
// Observations — normalise created_at to ISO-8601 with 'T' separator via strftime
|
|
102
|
+
const obsRows = tryQuery(errors, 'brain_observations', () => allTyped(db.prepare(`SELECT id, title, quality_score, memory_tier,
|
|
103
103
|
strftime('%Y-%m-%dT%H:%M:%S', created_at) AS created_at,
|
|
104
104
|
source_session_id, files_modified_json
|
|
105
105
|
FROM main.brain_observations
|
|
106
106
|
WHERE (quality_score IS NULL OR quality_score >= ?)
|
|
107
107
|
ORDER BY quality_score DESC, created_at DESC
|
|
108
|
-
LIMIT ?`), minWeight, Math.ceil(perSubstrateLimit * 0.4));
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
108
|
+
LIMIT ?`), minWeight, Math.ceil(perSubstrateLimit * 0.4)));
|
|
109
|
+
for (const row of obsRows) {
|
|
110
|
+
nodes.push({
|
|
111
|
+
id: `brain:${row.id}`,
|
|
112
|
+
kind: 'observation',
|
|
113
|
+
substrate: 'brain',
|
|
114
|
+
label: row.title,
|
|
115
|
+
weight: row.quality_score ?? undefined,
|
|
116
|
+
createdAt: row.created_at,
|
|
117
|
+
meta: {
|
|
118
|
+
memory_tier: row.memory_tier,
|
|
119
|
+
created_at: row.created_at,
|
|
120
|
+
source_session_id: row.source_session_id,
|
|
121
|
+
},
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
// Decisions — normalise created_at to ISO-8601 with 'T' separator via strftime
|
|
125
|
+
const decRows = tryQuery(errors, 'brain_decisions', () => allTyped(db.prepare(`SELECT id, decision, quality_score, context_task_id,
|
|
126
126
|
strftime('%Y-%m-%dT%H:%M:%S', created_at) AS created_at
|
|
127
127
|
FROM main.brain_decisions
|
|
128
128
|
WHERE (quality_score IS NULL OR quality_score >= ?)
|
|
129
129
|
ORDER BY quality_score DESC, created_at DESC
|
|
130
|
-
LIMIT ?`), minWeight, Math.ceil(perSubstrateLimit * 0.25));
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
130
|
+
LIMIT ?`), minWeight, Math.ceil(perSubstrateLimit * 0.25)));
|
|
131
|
+
for (const row of decRows) {
|
|
132
|
+
nodes.push({
|
|
133
|
+
id: `brain:${row.id}`,
|
|
134
|
+
kind: 'decision',
|
|
135
|
+
substrate: 'brain',
|
|
136
|
+
label: row.decision.slice(0, 100),
|
|
137
|
+
weight: row.quality_score ?? undefined,
|
|
138
|
+
createdAt: row.created_at,
|
|
139
|
+
meta: {
|
|
140
|
+
context_task_id: row.context_task_id,
|
|
141
|
+
created_at: row.created_at,
|
|
142
|
+
},
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
// Patterns — uses 'pattern' text column (not 'title') and 'extracted_at' (not 'created_at').
|
|
146
|
+
// SQLite strftime is used to normalise the timestamp to ISO-8601 with 'T' separator.
|
|
147
|
+
const patRows = tryQuery(errors, 'brain_patterns', () => allTyped(db.prepare(`SELECT id, pattern, type, quality_score,
|
|
148
148
|
strftime('%Y-%m-%dT%H:%M:%S', extracted_at) AS extracted_at
|
|
149
149
|
FROM main.brain_patterns
|
|
150
150
|
WHERE (quality_score IS NULL OR quality_score >= ?)
|
|
151
151
|
ORDER BY quality_score DESC, extracted_at DESC
|
|
152
|
-
LIMIT ?`), minWeight, Math.ceil(perSubstrateLimit * 0.2));
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
152
|
+
LIMIT ?`), minWeight, Math.ceil(perSubstrateLimit * 0.2)));
|
|
153
|
+
for (const row of patRows) {
|
|
154
|
+
nodes.push({
|
|
155
|
+
id: `brain:${row.id}`,
|
|
156
|
+
kind: 'pattern',
|
|
157
|
+
substrate: 'brain',
|
|
158
|
+
label: row.pattern.slice(0, 100),
|
|
159
|
+
weight: row.quality_score ?? undefined,
|
|
160
|
+
createdAt: row.extracted_at,
|
|
161
|
+
meta: { pattern_type: row.type, created_at: row.extracted_at },
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
// Learnings — uses 'insight' text column (not 'title').
|
|
165
|
+
// Normalise created_at to ISO-8601 with 'T' separator via strftime.
|
|
166
|
+
const learnRows = tryQuery(errors, 'brain_learnings', () => allTyped(db.prepare(`SELECT id, insight, quality_score,
|
|
167
167
|
strftime('%Y-%m-%dT%H:%M:%S', created_at) AS created_at
|
|
168
168
|
FROM main.brain_learnings
|
|
169
169
|
WHERE (quality_score IS NULL OR quality_score >= ?)
|
|
170
170
|
ORDER BY quality_score DESC, created_at DESC
|
|
171
|
-
LIMIT ?`), minWeight, Math.ceil(perSubstrateLimit * 0.15));
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
171
|
+
LIMIT ?`), minWeight, Math.ceil(perSubstrateLimit * 0.15)));
|
|
172
|
+
for (const row of learnRows) {
|
|
173
|
+
nodes.push({
|
|
174
|
+
id: `brain:${row.id}`,
|
|
175
|
+
kind: 'learning',
|
|
176
|
+
substrate: 'brain',
|
|
177
|
+
label: row.insight.slice(0, 100),
|
|
178
|
+
weight: row.quality_score ?? undefined,
|
|
179
|
+
createdAt: row.created_at,
|
|
180
|
+
meta: { created_at: row.created_at },
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
// Build lookup: type-prefixed ID (e.g. "observation:O-abc") → BrainNode ID
|
|
184
|
+
// (e.g. "brain:O-abc"). This is needed because brain_page_edges stores
|
|
185
|
+
// IDs in type-prefixed format while BrainNode IDs use the "brain:" prefix.
|
|
186
|
+
const typeIdToBrainNodeId = new Map();
|
|
187
|
+
for (const n of nodes) {
|
|
188
|
+
const rawId = n.id.slice('brain:'.length);
|
|
189
|
+
// Determine which type prefix this node would have in brain_page_edges
|
|
190
|
+
let typePrefix;
|
|
191
|
+
if (n.kind === 'observation')
|
|
192
|
+
typePrefix = 'observation';
|
|
193
|
+
else if (n.kind === 'decision')
|
|
194
|
+
typePrefix = 'decision';
|
|
195
|
+
else if (n.kind === 'pattern')
|
|
196
|
+
typePrefix = 'pattern';
|
|
197
|
+
else
|
|
198
|
+
typePrefix = 'learning';
|
|
199
|
+
typeIdToBrainNodeId.set(`${typePrefix}:${rawId}`, n.id);
|
|
200
|
+
}
|
|
201
|
+
// brain_page_edges: query all and classify each edge
|
|
202
|
+
const pageEdgeRows = tryQuery(errors, 'brain_page_edges', () => allTyped(db.prepare(`SELECT from_id, to_id, edge_type, weight FROM main.brain_page_edges`)));
|
|
203
|
+
for (const row of pageEdgeRows) {
|
|
204
|
+
const sourceBrainNodeId = typeIdToBrainNodeId.get(row.from_id) ?? brainTypeIdToBrainNodeId(row.from_id);
|
|
205
|
+
if (!sourceBrainNodeId)
|
|
206
|
+
continue; // source not a recognised brain node
|
|
207
|
+
if (isTaskId(row.to_id)) {
|
|
208
|
+
// Cross-substrate: brain → tasks
|
|
209
|
+
edges.push({
|
|
210
|
+
source: sourceBrainNodeId,
|
|
211
|
+
target: taskRefToBrainNodeId(row.to_id),
|
|
212
|
+
type: row.edge_type,
|
|
213
|
+
weight: row.weight ?? 0.5,
|
|
214
|
+
substrate: 'cross',
|
|
181
215
|
});
|
|
182
216
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
typePrefix = 'observation';
|
|
193
|
-
else if (n.kind === 'decision')
|
|
194
|
-
typePrefix = 'decision';
|
|
195
|
-
else if (n.kind === 'pattern')
|
|
196
|
-
typePrefix = 'pattern';
|
|
197
|
-
else
|
|
198
|
-
typePrefix = 'learning';
|
|
199
|
-
typeIdToBrainNodeId.set(`${typePrefix}:${rawId}`, n.id);
|
|
217
|
+
else if (isNexusStyleId(row.to_id)) {
|
|
218
|
+
// Cross-substrate: brain → nexus (code_reference, etc.)
|
|
219
|
+
edges.push({
|
|
220
|
+
source: sourceBrainNodeId,
|
|
221
|
+
target: `nexus:${row.to_id}`,
|
|
222
|
+
type: row.edge_type,
|
|
223
|
+
weight: row.weight ?? 0.5,
|
|
224
|
+
substrate: 'cross',
|
|
225
|
+
});
|
|
200
226
|
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
if (!sourceBrainNodeId)
|
|
206
|
-
continue; // source not a recognised brain node
|
|
207
|
-
if (isTaskId(row.to_id)) {
|
|
208
|
-
// Cross-substrate: brain → tasks
|
|
209
|
-
edges.push({
|
|
210
|
-
source: sourceBrainNodeId,
|
|
211
|
-
target: taskRefToBrainNodeId(row.to_id),
|
|
212
|
-
type: row.edge_type,
|
|
213
|
-
weight: row.weight ?? 0.5,
|
|
214
|
-
substrate: 'cross',
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
else if (isNexusStyleId(row.to_id)) {
|
|
218
|
-
// Cross-substrate: brain → nexus (code_reference, etc.)
|
|
227
|
+
else {
|
|
228
|
+
// Intra-brain: both IDs should be brain nodes
|
|
229
|
+
const targetBrainNodeId = typeIdToBrainNodeId.get(row.to_id) ?? brainTypeIdToBrainNodeId(row.to_id);
|
|
230
|
+
if (targetBrainNodeId) {
|
|
219
231
|
edges.push({
|
|
220
232
|
source: sourceBrainNodeId,
|
|
221
|
-
target:
|
|
233
|
+
target: targetBrainNodeId,
|
|
222
234
|
type: row.edge_type,
|
|
223
235
|
weight: row.weight ?? 0.5,
|
|
224
|
-
substrate: '
|
|
236
|
+
substrate: 'brain',
|
|
225
237
|
});
|
|
226
238
|
}
|
|
227
|
-
else {
|
|
228
|
-
// Intra-brain: both IDs should be brain nodes
|
|
229
|
-
const targetBrainNodeId = typeIdToBrainNodeId.get(row.to_id) ?? brainTypeIdToBrainNodeId(row.to_id);
|
|
230
|
-
if (targetBrainNodeId) {
|
|
231
|
-
edges.push({
|
|
232
|
-
source: sourceBrainNodeId,
|
|
233
|
-
target: targetBrainNodeId,
|
|
234
|
-
type: row.edge_type,
|
|
235
|
-
weight: row.weight ?? 0.5,
|
|
236
|
-
substrate: 'brain',
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
239
|
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
240
|
+
}
|
|
241
|
+
// brain_memory_links: cross-substrate edges from typed memory nodes to tasks
|
|
242
|
+
const memLinkRows = tryQuery(errors, 'brain_memory_links', () => allTyped(db.prepare(`SELECT memory_type, memory_id, task_id, link_type
|
|
243
|
+
FROM main.brain_memory_links`)));
|
|
244
|
+
for (const row of memLinkRows) {
|
|
245
|
+
const sourceTypeId = `${row.memory_type}:${row.memory_id}`;
|
|
246
|
+
const sourceBrainNodeId = typeIdToBrainNodeId.get(sourceTypeId) ?? brainTypeIdToBrainNodeId(sourceTypeId);
|
|
247
|
+
if (!sourceBrainNodeId)
|
|
248
|
+
continue; // source node not in loaded set
|
|
249
|
+
edges.push({
|
|
250
|
+
source: sourceBrainNodeId,
|
|
251
|
+
target: `tasks:${row.task_id}`,
|
|
252
|
+
type: row.link_type,
|
|
253
|
+
weight: 0.7,
|
|
254
|
+
substrate: 'cross',
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
// brain_observations.files_modified_json: cross-substrate observation → nexus file
|
|
258
|
+
for (const row of obsRows) {
|
|
259
|
+
if (!row.files_modified_json)
|
|
260
|
+
continue;
|
|
261
|
+
let filePaths;
|
|
262
|
+
try {
|
|
263
|
+
filePaths = JSON.parse(row.files_modified_json);
|
|
264
|
+
}
|
|
265
|
+
catch {
|
|
266
|
+
continue;
|
|
267
|
+
}
|
|
268
|
+
if (!Array.isArray(filePaths))
|
|
269
|
+
continue;
|
|
270
|
+
const sourceBrainNodeId = `brain:${row.id}`;
|
|
271
|
+
for (const rawPath of filePaths) {
|
|
272
|
+
if (typeof rawPath !== 'string' || rawPath.length === 0)
|
|
273
|
+
continue;
|
|
249
274
|
edges.push({
|
|
250
275
|
source: sourceBrainNodeId,
|
|
251
|
-
target: `
|
|
252
|
-
type:
|
|
253
|
-
weight: 0.
|
|
276
|
+
target: `nexus:${rawPath}`,
|
|
277
|
+
type: 'modified_by',
|
|
278
|
+
weight: 0.6,
|
|
254
279
|
substrate: 'cross',
|
|
255
280
|
});
|
|
256
281
|
}
|
|
257
|
-
// brain_observations.files_modified_json: cross-substrate observation → nexus file
|
|
258
|
-
for (const row of obsRows) {
|
|
259
|
-
if (!row.files_modified_json)
|
|
260
|
-
continue;
|
|
261
|
-
let filePaths;
|
|
262
|
-
try {
|
|
263
|
-
filePaths = JSON.parse(row.files_modified_json);
|
|
264
|
-
}
|
|
265
|
-
catch {
|
|
266
|
-
continue;
|
|
267
|
-
}
|
|
268
|
-
if (!Array.isArray(filePaths))
|
|
269
|
-
continue;
|
|
270
|
-
const sourceBrainNodeId = `brain:${row.id}`;
|
|
271
|
-
for (const rawPath of filePaths) {
|
|
272
|
-
if (typeof rawPath !== 'string' || rawPath.length === 0)
|
|
273
|
-
continue;
|
|
274
|
-
edges.push({
|
|
275
|
-
source: sourceBrainNodeId,
|
|
276
|
-
target: `nexus:${rawPath}`,
|
|
277
|
-
type: 'modified_by',
|
|
278
|
-
weight: 0.6,
|
|
279
|
-
substrate: 'cross',
|
|
280
|
-
});
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
// Soft FK: brain_decisions.context_task_id → tasks (direct, not via page_edges)
|
|
284
|
-
// This handles decisions whose context_task_id may not yet appear in brain_page_edges.
|
|
285
|
-
for (const dec of decRows) {
|
|
286
|
-
if (dec.context_task_id) {
|
|
287
|
-
edges.push({
|
|
288
|
-
source: `brain:${dec.id}`,
|
|
289
|
-
target: `tasks:${dec.context_task_id}`,
|
|
290
|
-
type: 'applies_to',
|
|
291
|
-
weight: 0.8,
|
|
292
|
-
substrate: 'cross',
|
|
293
|
-
});
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
282
|
}
|
|
297
|
-
|
|
298
|
-
|
|
283
|
+
// Soft FK: brain_decisions.context_task_id → tasks (direct, not via page_edges)
|
|
284
|
+
// This handles decisions whose context_task_id may not yet appear in brain_page_edges.
|
|
285
|
+
for (const dec of decRows) {
|
|
286
|
+
if (dec.context_task_id) {
|
|
287
|
+
edges.push({
|
|
288
|
+
source: `brain:${dec.id}`,
|
|
289
|
+
target: `tasks:${dec.context_task_id}`,
|
|
290
|
+
type: 'applies_to',
|
|
291
|
+
weight: 0.8,
|
|
292
|
+
substrate: 'cross',
|
|
293
|
+
});
|
|
294
|
+
}
|
|
299
295
|
}
|
|
300
|
-
});
|
|
301
|
-
return
|
|
296
|
+
}, (message) => errors.push(message));
|
|
297
|
+
return substrateResult(nodes, edges, errors);
|
|
302
298
|
}
|
|
303
299
|
//# sourceMappingURL=brain.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brain.js","sourceRoot":"","sources":["../../../src/adapters/brain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"brain.js","sourceRoot":"","sources":["../../../src/adapters/brain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC7F,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AA2DrE;;;;;;;;GAQG;AACH,SAAS,wBAAwB,CAAC,MAAc;IAC9C,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CA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,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;gBAAE,SAAS;YACxC,MAAM,iBAAiB,GAAG,SAAS,GAAG,CAAC,EAAE,EAAE,CAAC;YAC5C,KAAK,MAAM,OAAO,IAAI,SAAS,EAAE,CAAC;gBAChC,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;oBAAE,SAAS;gBAClE,KAAK,CAAC,IAAI,CAAC;oBACT,MAAM,EAAE,iBAAiB;oBACzB,MAAM,EAAE,SAAS,OAAO,EAAE;oBAC1B,IAAI,EAAE,aAAa;oBACnB,MAAM,EAAE,GAAG;oBACX,SAAS,EAAE,OAAO;iBACnB,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAED,gFAAgF;QAChF,uFAAuF;QACvF,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;YAC1B,IAAI,GAAG,CAAC,eAAe,EAAE,CAAC;gBACxB,KAAK,CAAC,IAAI,CAAC;oBACT,MAAM,EAAE,SAAS,GAAG,CAAC,EAAE,EAAE;oBACzB,MAAM,EAAE,SAAS,GAAG,CAAC,eAAe,EAAE;oBACtC,IAAI,EAAE,YAAY;oBAClB,MAAM,EAAE,GAAG;oBACX,SAAS,EAAE,OAAO;iBACnB,CAAC,CAAC;YACL,CAAC;QACH,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 "conduit:" 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 `conduit_messages`.
|
|
14
14
|
*
|
|
@@ -19,8 +19,5 @@ import type { BrainEdge, BrainNode, BrainQueryOptions } from '../types.js';
|
|
|
19
19
|
* @param options - Query options (limit).
|
|
20
20
|
* @returns Nodes and edges from the CONDUIT substrate.
|
|
21
21
|
*/
|
|
22
|
-
export declare function getConduitSubstrate(options?: BrainQueryOptions):
|
|
23
|
-
nodes: BrainNode[];
|
|
24
|
-
edges: BrainEdge[];
|
|
25
|
-
};
|
|
22
|
+
export declare function getConduitSubstrate(options?: BrainQueryOptions): BrainSubstrateResult;
|
|
26
23
|
//# sourceMappingURL=conduit.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conduit.d.ts","sourceRoot":"","sources":["../../../src/adapters/conduit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"conduit.d.ts","sourceRoot":"","sources":["../../../src/adapters/conduit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAwB,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAajG;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,iBAAsB,GAAG,oBAAoB,CAwEzF"}
|