@theronap/cortex-mcp 0.9.8 → 0.9.9
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/lib/ingest_folder.mjs +7 -8
- package/package.json +1 -1
package/lib/ingest_folder.mjs
CHANGED
|
@@ -88,12 +88,11 @@ function deriveTitle(frontmatter, body, filePath) {
|
|
|
88
88
|
return basename(filePath, extname(filePath))
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
// summary:
|
|
92
|
-
//
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
return [front, excerpt].filter(Boolean).join('\n\n')
|
|
91
|
+
// summary: first ~800 chars of the BODY (prose). Bounded so the raw full file never leaves the
|
|
92
|
+
// machine. Frontmatter is NOT prepended — it rides structured in payload, and the title is derived
|
|
93
|
+
// separately, so the summary reads as content (what the digest summarizes), not "key: value" noise.
|
|
94
|
+
function deriveSummary(body) {
|
|
95
|
+
return body.trim().slice(0, 800)
|
|
97
96
|
}
|
|
98
97
|
|
|
99
98
|
export async function runIngestFolder(argv) {
|
|
@@ -129,12 +128,12 @@ export async function runIngestFolder(argv) {
|
|
|
129
128
|
for (const file of files) {
|
|
130
129
|
try {
|
|
131
130
|
const content = readFileSync(file, 'utf8')
|
|
132
|
-
const { frontmatter,
|
|
131
|
+
const { frontmatter, bodyStart } = parseFrontmatter(content)
|
|
133
132
|
const body = content.slice(bodyStart)
|
|
134
133
|
|
|
135
134
|
const relpath = relative(path, file)
|
|
136
135
|
const title = deriveTitle(frontmatter, body, file)
|
|
137
|
-
const summary = deriveSummary(
|
|
136
|
+
const summary = deriveSummary(body)
|
|
138
137
|
const occurredAt = statSync(file).mtime.toISOString()
|
|
139
138
|
|
|
140
139
|
const res = await fetchCortex(`${base}/api/ingest`, {
|