@andespindola/brainlink 0.1.0-beta.15 → 0.1.0-beta.150
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/AGENTS.md +3 -0
- package/CHANGELOG.md +24 -0
- package/COPYRIGHT.md +5 -0
- package/README.md +135 -7
- package/dist/application/auto-migrate-configured-vault.js +37 -0
- package/dist/application/build-context.js +64 -3
- package/dist/application/dedupe-notes.js +226 -0
- package/dist/application/frontend/client-css.js +111 -47
- package/dist/application/frontend/client-html.js +42 -26
- package/dist/application/frontend/client-js.js +788 -554
- package/dist/application/frontend/client-render-worker-js.js +569 -0
- package/dist/application/frontend/client-worker-js.js +66 -0
- package/dist/application/get-graph-layout.js +38 -5
- package/dist/application/get-graph-stream-chunk.js +289 -0
- package/dist/application/get-graph-view.js +243 -0
- package/dist/application/import-legacy-sqlite.js +296 -0
- package/dist/application/index-vault.js +249 -21
- package/dist/application/offline-pack-backup.js +44 -0
- package/dist/application/server/routes.js +187 -5
- package/dist/application/start-server.js +75 -4
- package/dist/application/watch-vault.js +23 -2
- package/dist/cli/commands/agent-commands.js +7 -0
- package/dist/cli/commands/write-commands.js +842 -8
- package/dist/cli/runtime.js +10 -2
- package/dist/domain/context.js +54 -11
- package/dist/domain/graph-layout.js +275 -3
- package/dist/domain/markdown.js +29 -9
- package/dist/domain/middle-out.js +18 -0
- package/dist/infrastructure/config.js +117 -4
- package/dist/infrastructure/file-index.js +70 -3
- package/dist/infrastructure/file-system-vault.js +15 -0
- package/dist/infrastructure/index-state.js +58 -0
- package/dist/infrastructure/private-pack-codec.js +71 -10
- package/dist/infrastructure/search-packs.js +286 -15
- package/dist/infrastructure/vault-migration-state.js +69 -0
- package/dist/infrastructure/volatile-memory.js +100 -0
- package/dist/mcp/runtime.js +20 -0
- package/dist/mcp/server.js +28 -10
- package/dist/mcp/tools.js +110 -0
- package/docs/AGENT_USAGE.md +87 -3
- package/docs/ARCHITECTURE.md +6 -0
- package/docs/QUICKSTART.md +7 -0
- package/package.json +7 -2
|
@@ -25,6 +25,13 @@ body {
|
|
|
25
25
|
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
body {
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
min-height: 100vh;
|
|
32
|
+
min-height: 100dvh;
|
|
33
|
+
}
|
|
34
|
+
|
|
28
35
|
button,
|
|
29
36
|
input,
|
|
30
37
|
select {
|
|
@@ -32,50 +39,68 @@ select {
|
|
|
32
39
|
}
|
|
33
40
|
|
|
34
41
|
.shell {
|
|
42
|
+
flex: 1 1 auto;
|
|
35
43
|
width: 100%;
|
|
36
|
-
height:
|
|
44
|
+
min-height: 0;
|
|
37
45
|
overflow: hidden;
|
|
38
46
|
}
|
|
39
47
|
|
|
40
48
|
.workspace {
|
|
49
|
+
display: grid;
|
|
50
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
41
51
|
position: relative;
|
|
52
|
+
width: 100%;
|
|
53
|
+
height: 100%;
|
|
42
54
|
min-width: 0;
|
|
43
55
|
min-height: 0;
|
|
44
56
|
}
|
|
45
57
|
|
|
46
|
-
|
|
47
|
-
|
|
58
|
+
.graph-header {
|
|
59
|
+
z-index: 5;
|
|
60
|
+
display: flex;
|
|
61
|
+
align-items: center;
|
|
62
|
+
gap: 12px;
|
|
63
|
+
min-height: 72px;
|
|
64
|
+
padding: 10px 16px;
|
|
65
|
+
border-bottom: 1px solid var(--line);
|
|
66
|
+
background: linear-gradient(180deg, rgba(17, 21, 27, 0.96) 0%, rgba(17, 21, 27, 0.86) 100%);
|
|
67
|
+
backdrop-filter: blur(8px);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.brand-block {
|
|
71
|
+
display: grid;
|
|
72
|
+
gap: 2px;
|
|
73
|
+
min-width: max-content;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.brand-block strong {
|
|
77
|
+
font-size: 18px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.graph-stage {
|
|
81
|
+
position: relative;
|
|
48
82
|
width: 100%;
|
|
49
83
|
height: 100%;
|
|
50
84
|
background:
|
|
51
85
|
radial-gradient(circle at 18% 20%, rgba(53, 208, 162, 0.12), transparent 28rem),
|
|
52
86
|
linear-gradient(135deg, #0d0f12 0%, #12161c 55%, #0a0d10 100%);
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
#graph:active {
|
|
57
|
-
cursor: grabbing;
|
|
87
|
+
overflow: hidden;
|
|
58
88
|
}
|
|
59
89
|
|
|
60
|
-
|
|
90
|
+
#graph {
|
|
91
|
+
display: block;
|
|
61
92
|
position: absolute;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
display: flex;
|
|
66
|
-
align-items: center;
|
|
67
|
-
justify-content: space-between;
|
|
68
|
-
gap: 18px;
|
|
69
|
-
pointer-events: none;
|
|
93
|
+
inset: 0;
|
|
94
|
+
width: 100%;
|
|
95
|
+
height: 100%;
|
|
70
96
|
}
|
|
71
97
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
align-items: center;
|
|
98
|
+
#graph {
|
|
99
|
+
cursor: grab;
|
|
75
100
|
}
|
|
76
101
|
|
|
77
|
-
|
|
78
|
-
|
|
102
|
+
#graph:active {
|
|
103
|
+
cursor: grabbing;
|
|
79
104
|
}
|
|
80
105
|
|
|
81
106
|
.eyebrow {
|
|
@@ -84,13 +109,19 @@ select {
|
|
|
84
109
|
}
|
|
85
110
|
|
|
86
111
|
.search {
|
|
87
|
-
|
|
88
|
-
|
|
112
|
+
flex: 1 1 320px;
|
|
113
|
+
min-width: 220px;
|
|
89
114
|
}
|
|
90
115
|
|
|
91
116
|
.agent-filter {
|
|
92
117
|
width: min(220px, 28vw);
|
|
93
|
-
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.header-actions {
|
|
121
|
+
display: flex;
|
|
122
|
+
align-items: center;
|
|
123
|
+
gap: 10px;
|
|
124
|
+
margin-left: auto;
|
|
94
125
|
}
|
|
95
126
|
|
|
96
127
|
.search input,
|
|
@@ -111,9 +142,6 @@ select {
|
|
|
111
142
|
}
|
|
112
143
|
|
|
113
144
|
.toolbar {
|
|
114
|
-
position: absolute;
|
|
115
|
-
left: 18px;
|
|
116
|
-
bottom: 18px;
|
|
117
145
|
display: flex;
|
|
118
146
|
gap: 8px;
|
|
119
147
|
}
|
|
@@ -134,12 +162,9 @@ select {
|
|
|
134
162
|
}
|
|
135
163
|
|
|
136
164
|
.floating-metrics {
|
|
137
|
-
position: absolute;
|
|
138
|
-
top: 66px;
|
|
139
|
-
left: 18px;
|
|
140
165
|
display: flex;
|
|
141
166
|
gap: 10px;
|
|
142
|
-
|
|
167
|
+
flex-wrap: wrap;
|
|
143
168
|
}
|
|
144
169
|
|
|
145
170
|
.metric-chip {
|
|
@@ -232,14 +257,20 @@ li small {
|
|
|
232
257
|
}
|
|
233
258
|
|
|
234
259
|
.content-dialog {
|
|
235
|
-
|
|
236
|
-
|
|
260
|
+
position: fixed;
|
|
261
|
+
top: 74px;
|
|
262
|
+
right: 16px;
|
|
263
|
+
margin: 0;
|
|
264
|
+
width: min(760px, calc(100vw - 32px));
|
|
265
|
+
height: min(calc(100svh - 96px), 920px);
|
|
266
|
+
max-height: calc(100svh - 96px);
|
|
237
267
|
padding: 0;
|
|
238
268
|
border: 1px solid var(--line);
|
|
239
269
|
border-radius: 8px;
|
|
240
270
|
background: var(--panel);
|
|
241
271
|
color: var(--text);
|
|
242
272
|
box-shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
|
|
273
|
+
overflow: hidden;
|
|
243
274
|
}
|
|
244
275
|
|
|
245
276
|
.content-dialog::backdrop {
|
|
@@ -250,7 +281,8 @@ li small {
|
|
|
250
281
|
.content-dialog article {
|
|
251
282
|
display: grid;
|
|
252
283
|
grid-template-rows: auto auto minmax(0, 1fr);
|
|
253
|
-
|
|
284
|
+
height: 100%;
|
|
285
|
+
max-height: 100%;
|
|
254
286
|
}
|
|
255
287
|
|
|
256
288
|
.content-dialog header {
|
|
@@ -269,7 +301,7 @@ li small {
|
|
|
269
301
|
|
|
270
302
|
.content-dialog h2 {
|
|
271
303
|
margin-top: 6px;
|
|
272
|
-
font-size:
|
|
304
|
+
font-size: 19px;
|
|
273
305
|
line-height: 1.15;
|
|
274
306
|
overflow-wrap: anywhere;
|
|
275
307
|
}
|
|
@@ -299,7 +331,7 @@ li small {
|
|
|
299
331
|
|
|
300
332
|
.content-meta {
|
|
301
333
|
display: grid;
|
|
302
|
-
grid-template-columns: repeat(
|
|
334
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
303
335
|
gap: 10px;
|
|
304
336
|
padding: 14px 22px;
|
|
305
337
|
border-bottom: 1px solid var(--line);
|
|
@@ -326,45 +358,77 @@ li small {
|
|
|
326
358
|
|
|
327
359
|
.content-meta-section ul,
|
|
328
360
|
.content-meta-section .tags {
|
|
329
|
-
max-height:
|
|
361
|
+
max-height: 280px;
|
|
330
362
|
overflow: auto;
|
|
331
363
|
align-content: flex-start;
|
|
332
364
|
padding-right: 4px;
|
|
333
365
|
}
|
|
334
366
|
|
|
367
|
+
.content-meta-section:last-child {
|
|
368
|
+
grid-column: span 2;
|
|
369
|
+
}
|
|
370
|
+
|
|
335
371
|
.content-dialog .note-content {
|
|
336
372
|
max-height: none;
|
|
337
373
|
min-height: 0;
|
|
338
374
|
border: 0;
|
|
339
375
|
border-radius: 0;
|
|
340
|
-
padding:
|
|
376
|
+
padding: 14px;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.app-footer {
|
|
380
|
+
flex: 0 0 28px;
|
|
381
|
+
height: 28px;
|
|
382
|
+
display: flex;
|
|
383
|
+
align-items: center;
|
|
384
|
+
justify-content: center;
|
|
385
|
+
background: transparent;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.app-footer small {
|
|
389
|
+
color: var(--muted);
|
|
390
|
+
font-size: 11px;
|
|
391
|
+
letter-spacing: 0.02em;
|
|
341
392
|
}
|
|
342
393
|
|
|
343
394
|
@media (max-width: 860px) {
|
|
344
|
-
.
|
|
395
|
+
.graph-header {
|
|
345
396
|
align-items: stretch;
|
|
346
|
-
flex-
|
|
397
|
+
flex-wrap: wrap;
|
|
398
|
+
padding: 10px 12px;
|
|
399
|
+
min-height: 0;
|
|
347
400
|
}
|
|
348
401
|
|
|
349
402
|
.search {
|
|
350
403
|
width: 100%;
|
|
404
|
+
flex-basis: 100%;
|
|
405
|
+
order: 3;
|
|
351
406
|
}
|
|
352
407
|
|
|
353
408
|
.agent-filter {
|
|
354
409
|
width: 100%;
|
|
355
410
|
}
|
|
356
411
|
|
|
412
|
+
.header-actions {
|
|
413
|
+
width: 100%;
|
|
414
|
+
margin-left: 0;
|
|
415
|
+
justify-content: space-between;
|
|
416
|
+
order: 4;
|
|
417
|
+
}
|
|
418
|
+
|
|
357
419
|
.content-dialog header {
|
|
358
420
|
align-items: stretch;
|
|
359
421
|
flex-direction: column;
|
|
360
422
|
}
|
|
361
423
|
|
|
362
|
-
.
|
|
363
|
-
top:
|
|
364
|
-
right:
|
|
365
|
-
left:
|
|
366
|
-
|
|
367
|
-
|
|
424
|
+
.content-dialog {
|
|
425
|
+
top: auto;
|
|
426
|
+
right: 12px;
|
|
427
|
+
left: 12px;
|
|
428
|
+
bottom: 28px;
|
|
429
|
+
width: auto;
|
|
430
|
+
height: min(calc(100svh - 150px), 760px);
|
|
431
|
+
max-height: calc(100svh - 150px);
|
|
368
432
|
}
|
|
369
433
|
|
|
370
434
|
.metric-chip {
|
|
@@ -9,51 +9,67 @@ export const createClientHtml = () => `<!doctype html>
|
|
|
9
9
|
<body>
|
|
10
10
|
<main class="shell">
|
|
11
11
|
<section class="workspace" aria-label="Knowledge graph">
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
<div>
|
|
12
|
+
<header class="graph-header" aria-label="Graph actions">
|
|
13
|
+
<div class="brand-block">
|
|
15
14
|
<strong>Brainlink</strong>
|
|
15
|
+
<span class="eyebrow">Knowledge Graph</span>
|
|
16
|
+
</div>
|
|
17
|
+
<div class="floating-metrics" aria-label="Graph totals">
|
|
18
|
+
<div class="metric-chip">
|
|
19
|
+
<strong id="nodeCount">0</strong>
|
|
20
|
+
<small>Notes</small>
|
|
21
|
+
</div>
|
|
22
|
+
<div class="metric-chip">
|
|
23
|
+
<strong id="edgeCount">0</strong>
|
|
24
|
+
<small>Links</small>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="metric-chip">
|
|
27
|
+
<strong id="tagCount">0</strong>
|
|
28
|
+
<small>Tags</small>
|
|
29
|
+
</div>
|
|
16
30
|
</div>
|
|
17
31
|
<label class="search">
|
|
18
32
|
<input id="search" type="search" placeholder="Filter notes, tags or paths" autocomplete="off" />
|
|
19
33
|
</label>
|
|
20
|
-
<
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
<strong id="edgeCount">0</strong>
|
|
31
|
-
<small>Links</small>
|
|
32
|
-
</div>
|
|
33
|
-
<div class="metric-chip">
|
|
34
|
-
<strong id="tagCount">0</strong>
|
|
35
|
-
<small>Tags</small>
|
|
34
|
+
<div class="header-actions">
|
|
35
|
+
<label class="agent-filter">
|
|
36
|
+
<select id="agent"></select>
|
|
37
|
+
</label>
|
|
38
|
+
<div class="toolbar" aria-label="Graph controls">
|
|
39
|
+
<button id="zoomIn" type="button" title="Zoom in">+</button>
|
|
40
|
+
<button id="zoomOut" type="button" title="Zoom out">-</button>
|
|
41
|
+
<button id="fit" type="button" title="Focus central hub">◎</button>
|
|
42
|
+
<button id="reset" type="button" title="Reset view">⌂</button>
|
|
43
|
+
</div>
|
|
36
44
|
</div>
|
|
37
|
-
</
|
|
38
|
-
<div class="
|
|
39
|
-
<
|
|
40
|
-
<button id="zoomOut" type="button" title="Zoom out">-</button>
|
|
41
|
-
<button id="fit" type="button" title="Fit visible nodes">◎</button>
|
|
42
|
-
<button id="reset" type="button" title="Reset view">⌂</button>
|
|
45
|
+
</header>
|
|
46
|
+
<div class="graph-stage">
|
|
47
|
+
<canvas id="graph" aria-label="Brainlink knowledge graph"></canvas>
|
|
43
48
|
</div>
|
|
44
49
|
</section>
|
|
45
50
|
</main>
|
|
51
|
+
<footer class="app-footer" aria-label="Copyright notice">
|
|
52
|
+
<small>Copyright © 2026 Substructa</small>
|
|
53
|
+
</footer>
|
|
46
54
|
<dialog id="contentDialog" class="content-dialog" aria-labelledby="contentTitle">
|
|
47
55
|
<article>
|
|
48
56
|
<header>
|
|
49
57
|
<div>
|
|
50
|
-
<span class="eyebrow">
|
|
58
|
+
<span class="eyebrow">Node details</span>
|
|
51
59
|
<h2 id="contentTitle">Selected note</h2>
|
|
52
60
|
<p id="contentPath"></p>
|
|
53
61
|
</div>
|
|
54
62
|
<button id="contentClose" type="button">Close</button>
|
|
55
63
|
</header>
|
|
56
64
|
<div class="content-meta">
|
|
65
|
+
<section class="content-meta-section">
|
|
66
|
+
<h3>Facts</h3>
|
|
67
|
+
<ul id="contentFacts"></ul>
|
|
68
|
+
</section>
|
|
69
|
+
<section class="content-meta-section">
|
|
70
|
+
<h3>Context Links</h3>
|
|
71
|
+
<ul id="contentContextLinks"></ul>
|
|
72
|
+
</section>
|
|
57
73
|
<section class="content-meta-section">
|
|
58
74
|
<h3>Tags</h3>
|
|
59
75
|
<div id="contentTags" class="tags"></div>
|