@andespindola/brainlink 1.6.11 → 1.6.12
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/CHANGELOG.md +4 -0
- package/dist/domain/markdown.js +15 -2
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.6.12
|
|
4
|
+
|
|
5
|
+
- **Wiki links keep a `#` that is part of the title.** A link target such as `[[note (PR #34)]]` was truncated at the `#` — the parser always treated `#` as the start of a heading anchor (`[[Note#Heading]]`) — so the link resolved to a non-existent `note (PR ` title and surfaced as a broken link. A `#` is now treated as a heading anchor only when it directly follows the note name with no whitespace before it; a `#` preceded by a space is kept as part of the title. Existing `[[Note#Heading]]` anchor links keep resolving to `Note`.
|
|
6
|
+
|
|
3
7
|
## 1.6.1
|
|
4
8
|
|
|
5
9
|
- **Fix the broken README logo on npm.** The logo was referenced via a `raw.githubusercontent.com` URL, which returns 404 for anonymous requests because the source repository is private — so it never rendered on the npm package page. Point it at the public npm CDN (`cdn.jsdelivr.net/npm/...`), which serves the published package's assets regardless of repository visibility, and refresh the brain-as-a-graph artwork.
|
package/dist/domain/markdown.js
CHANGED
|
@@ -3,7 +3,11 @@ import { resolveAgentIdFromPath, sanitizeAgentId } from './agents.js';
|
|
|
3
3
|
import { createStableId } from './ids.js';
|
|
4
4
|
import { estimateTokenCount } from './tokens.js';
|
|
5
5
|
const frontmatterPattern = /^---\n([\s\S]*?)\n---\n?/;
|
|
6
|
-
|
|
6
|
+
// Target captures everything up to an optional "|alias" or the closing "]]",
|
|
7
|
+
// INCLUDING "#" — the heading anchor is stripped later, and only when it is a
|
|
8
|
+
// real anchor (see stripHeadingAnchor). Keeping "#" here means a title such as
|
|
9
|
+
// "note (PR #34)" is not truncated at the "#".
|
|
10
|
+
const wikiLinkPattern = /\[\[([^\]|]+)(?:\|[^\]]+)?\]\]/g;
|
|
7
11
|
const tagPattern = /(^|\s)#([A-Za-z0-9][A-Za-z0-9_-]*)/g;
|
|
8
12
|
const headingPattern = /^#\s+(.+)$/m;
|
|
9
13
|
const contextLinksHeadingPattern = /^(#{1,6})\s+(?:context\s+links?|links?\s+de\s+contexto)\b/i;
|
|
@@ -30,7 +34,16 @@ const priorityPatterns = [
|
|
|
30
34
|
['low', /\b(?:priority|prioridade|importance|importancia|importância)\s*[:=]\s*(?:low|baixa|p3)\b/i],
|
|
31
35
|
['low', /#(?:low-priority|baixa-prioridade|p3)\b/i]
|
|
32
36
|
];
|
|
33
|
-
|
|
37
|
+
// A "#" starts a heading anchor ([[Note#Heading]]) only when it directly
|
|
38
|
+
// follows the note name with NO whitespace before it. A "#" preceded by a space
|
|
39
|
+
// (e.g. "note (PR #34)") is part of the title itself and must not be stripped,
|
|
40
|
+
// otherwise the link target is truncated and can never resolve.
|
|
41
|
+
const headingAnchorPattern = /(?<!\s)#[^\]|]*$/;
|
|
42
|
+
const stripHeadingAnchor = (title) => {
|
|
43
|
+
const stripped = title.replace(headingAnchorPattern, '');
|
|
44
|
+
return stripped.trim().length > 0 ? stripped : title;
|
|
45
|
+
};
|
|
46
|
+
const normalizeTitle = (title) => stripHeadingAnchor(title.trim()).trim().replace(/\.md$/i, '');
|
|
34
47
|
const unique = (values) => Array.from(new Set(values.map((value) => value.trim()).filter(Boolean)));
|
|
35
48
|
const maxPriority = (left, right) => priorityRanks[left] >= priorityRanks[right] ? left : right;
|
|
36
49
|
const parseFrontmatter = (content) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@andespindola/brainlink",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.12",
|
|
4
4
|
"description": "Local-first knowledge memory for agents with Markdown, backlinks, indexing and context retrieval.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -64,9 +64,10 @@
|
|
|
64
64
|
"zod": "^4.3.6"
|
|
65
65
|
},
|
|
66
66
|
"overrides": {
|
|
67
|
-
"hono": "4.12.
|
|
67
|
+
"hono": "4.12.28",
|
|
68
68
|
"qs": "6.15.2",
|
|
69
|
-
"fast-uri": "^4.1.0"
|
|
69
|
+
"fast-uri": "^4.1.0",
|
|
70
|
+
"body-parser": "2.3.0"
|
|
70
71
|
},
|
|
71
72
|
"devDependencies": {
|
|
72
73
|
"@types/node": "^24.9.2",
|