sdtk-brain-kit 0.2.0 → 0.2.1

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/README.md CHANGED
@@ -6,7 +6,7 @@ layer (`wiki/`) that you — and your AI agent — can search, lint, and browse
6
6
  a graph. The agent reading the vault (per its `CLAUDE.md` contract) is the
7
7
  knowledge engine; this CLI provides the deterministic rails only.
8
8
 
9
- Package version in this source snapshot: `0.2.0`
9
+ Package version in this source snapshot: `0.2.1`
10
10
  CLI command: `sdtk-brain`
11
11
 
12
12
  Standalone by design: not part of the `sdtk-kit` umbrella, installs no agent
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sdtk-brain-kit",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Standalone local-first second-brain vault CLI: immutable raw/ sources compiled into a markdown wiki/ knowledge layer, maintained by rails (ingest, compile, lint, search, graph viewer) while your agent is the knowledge engine.",
5
5
  "type": "commonjs",
6
6
  "bin": {
@@ -418,7 +418,16 @@ function lineOf(text, needle) {
418
418
  function boundedText(value, maxLength = 700) {
419
419
  const text = String(value || "").replace(/\s+/g, " ").trim();
420
420
  if (text.length <= maxLength) return text;
421
- return `${text.slice(0, maxLength - 1).trim()}...`;
421
+ // Never split a surrogate pair (BK-331): a lone high surrogate cannot
422
+ // round-trip through fs.writeFileSync (it lands on disk as U+FFFD), so the
423
+ // regenerated plan content differed from the written page forever and the
424
+ // page flapped as a permanent apply "conflict" on unchanged input.
425
+ let cut = text.slice(0, maxLength - 1);
426
+ const last = cut.charCodeAt(cut.length - 1);
427
+ if (last >= 0xd800 && last <= 0xdbff) {
428
+ cut = cut.slice(0, -1);
429
+ }
430
+ return `${cut.trim()}...`;
422
431
  }
423
432
 
424
433
  function asArray(value) {