@shrkcrft/importer 0.1.0-alpha.21 → 0.1.0-alpha.23

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.
@@ -1 +1 @@
1
- {"version":3,"file":"parse-markdown-rules.d.ts","sourceRoot":"","sources":["../../src/parse/parse-markdown-rules.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAGjE;;;;;;;;GAQG;AACH,MAAM,WAAW,qBAAqB;IACpC,oDAAoD;IACpD,MAAM,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,QAAQ,EAAE,MAAM,CAAC;CAClB;AAkED,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,qBAAqB,GAC7B,cAAc,EAAE,CAoElB"}
1
+ {"version":3,"file":"parse-markdown-rules.d.ts","sourceRoot":"","sources":["../../src/parse/parse-markdown-rules.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAGjE;;;;;;;;GAQG;AACH,MAAM,WAAW,qBAAqB;IACpC,oDAAoD;IACpD,MAAM,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,QAAQ,EAAE,MAAM,CAAC;CAClB;AAkED,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,qBAAqB,GAC7B,cAAc,EAAE,CA8ElB"}
@@ -79,7 +79,15 @@ export function parseMarkdownRules(raw, options) {
79
79
  if (paragraph.length === 0)
80
80
  return;
81
81
  const block = paragraph.join('\n').trim();
82
- if (block.length > 0 && current) {
82
+ if (block.length > 0) {
83
+ // Lazily open an implicit preamble section so content before the first
84
+ // heading (intro prose, or a FLAT heading-less bullet list — the most
85
+ // common AGENTS.md shape) is not silently dropped. Empty heading →
86
+ // inferType('') = Rule, keywordTags('') = [], and the falsy heading
87
+ // suppresses the `section` field downstream, so preamble entries are
88
+ // well-formed.
89
+ if (!current)
90
+ current = { heading: '', level: 0, paragraphs: [] };
83
91
  current.paragraphs.push(block);
84
92
  }
85
93
  paragraph = [];
@@ -109,7 +117,10 @@ export function parseMarkdownRules(raw, options) {
109
117
  const title = extractTitle(unit);
110
118
  if (!title)
111
119
  continue;
112
- const slugBase = slugify(`${section.heading}-${title}`) || slugify(title);
120
+ // `slugify` strips non-ASCII to '', so a CJK/Cyrillic/emoji heading or
121
+ // title can collapse to an empty slug → id `claude.` which FAILS shrk's
122
+ // own isValidKnowledgeId. Fall back to a deterministic non-empty slug.
123
+ const slugBase = slugify(`${section.heading}-${title}`) || slugify(title) || 'entry';
113
124
  let id = `${options.idPrefix}.${slugBase}`;
114
125
  let counter = 2;
115
126
  while (seen.has(id)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shrkcrft/importer",
3
- "version": "0.1.0-alpha.21",
3
+ "version": "0.1.0-alpha.23",
4
4
  "description": "SharkCraft importer: parse AGENTS.md / CLAUDE.md / .cursor/rules into structured knowledge entries.",
5
5
  "license": "MIT",
6
6
  "author": "SharkCraft contributors",
@@ -44,8 +44,8 @@
44
44
  "typecheck": "tsc --noEmit -p tsconfig.json"
45
45
  },
46
46
  "dependencies": {
47
- "@shrkcrft/core": "^0.1.0-alpha.21",
48
- "@shrkcrft/knowledge": "^0.1.0-alpha.21"
47
+ "@shrkcrft/core": "^0.1.0-alpha.23",
48
+ "@shrkcrft/knowledge": "^0.1.0-alpha.23"
49
49
  },
50
50
  "publishConfig": {
51
51
  "access": "public"