@lovelybunch/api 1.0.70 → 1.0.71-alpha.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/dist/lib/storage/file-storage.d.ts +1 -0
- package/dist/lib/storage/file-storage.js +16 -1
- package/dist/routes/api/v1/ai/index.js +2 -0
- package/dist/routes/api/v1/ai/route.js +474 -171
- package/dist/routes/api/v1/ai/tools.d.ts +17 -0
- package/dist/routes/api/v1/ai/tools.js +931 -0
- package/dist/routes/api/v1/context/knowledge/[filename]/route.js +5 -2
- package/dist/routes/api/v1/context/knowledge/route.js +5 -2
- package/dist/routes/api/v1/mcp/index.js +416 -185
- package/dist/routes/api/v1/resources/generate/route.d.ts +1 -1
- package/dist/routes/api/v1/resources/generate/route.js +66 -16
- package/package.json +4 -4
- package/static/assets/index-Bo1l13x2.css +33 -0
- package/static/assets/index-DgZp291y.js +973 -0
- package/static/index.html +2 -2
- package/static/assets/index-BmLW21zG.js +0 -969
- package/static/assets/index-CfRmV6nM.css +0 -33
|
@@ -57,7 +57,10 @@ app.get('/:filename', async (c) => {
|
|
|
57
57
|
const knowledgePath = getKnowledgePath();
|
|
58
58
|
const actualFilename = filename.endsWith('.md') ? filename : `${filename}.md`;
|
|
59
59
|
const filePath = path.join(knowledgePath, actualFilename);
|
|
60
|
-
const fileContent = await
|
|
60
|
+
const [fileContent, stats] = await Promise.all([
|
|
61
|
+
fs.readFile(filePath, 'utf-8'),
|
|
62
|
+
fs.stat(filePath)
|
|
63
|
+
]);
|
|
61
64
|
const { data, content } = matter(fileContent);
|
|
62
65
|
// Extract title from metadata, first heading, or use filename
|
|
63
66
|
const title = data.title ||
|
|
@@ -68,7 +71,7 @@ app.get('/:filename', async (c) => {
|
|
|
68
71
|
metadata: {
|
|
69
72
|
...data,
|
|
70
73
|
title, // Include title in metadata
|
|
71
|
-
updated:
|
|
74
|
+
updated: stats.mtime.toISOString(),
|
|
72
75
|
tags: data.tags || [],
|
|
73
76
|
sources: data.sources || []
|
|
74
77
|
},
|
|
@@ -62,7 +62,10 @@ app.get('/', async (c) => {
|
|
|
62
62
|
.filter(file => file.endsWith('.md'))
|
|
63
63
|
.map(async (file) => {
|
|
64
64
|
const filePath = path.join(knowledgePath, file);
|
|
65
|
-
const fileContent = await
|
|
65
|
+
const [fileContent, stats] = await Promise.all([
|
|
66
|
+
fs.readFile(filePath, 'utf-8'),
|
|
67
|
+
fs.stat(filePath)
|
|
68
|
+
]);
|
|
66
69
|
const { data, content } = matter(fileContent);
|
|
67
70
|
// Extract title from metadata, first heading, or use filename
|
|
68
71
|
const title = data.title ||
|
|
@@ -73,7 +76,7 @@ app.get('/', async (c) => {
|
|
|
73
76
|
metadata: {
|
|
74
77
|
...data,
|
|
75
78
|
title, // Include title in metadata
|
|
76
|
-
updated:
|
|
79
|
+
updated: stats.mtime.toISOString(),
|
|
77
80
|
tags: data.tags || [],
|
|
78
81
|
sources: data.sources || []
|
|
79
82
|
},
|