@getlore/cli 0.5.2 → 0.7.0
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/LICENSE +12 -4
- package/README.md +66 -5
- package/dist/cli/commands/sync.js +4 -1
- package/dist/core/git.js +36 -4
- package/dist/core/vector-store.d.ts +13 -0
- package/dist/core/vector-store.js +28 -3
- package/dist/mcp/handlers/research-agent.d.ts +2 -1
- package/dist/mcp/handlers/research-agent.js +37 -7
- package/dist/mcp/handlers/research.d.ts +19 -0
- package/dist/mcp/handlers/research.js +144 -3
- package/dist/mcp/handlers/sync.d.ts +2 -0
- package/dist/mcp/handlers/sync.js +70 -3
- package/dist/mcp/server.js +28 -5
- package/dist/mcp/tools.js +16 -2
- package/dist/sync/process.d.ts +8 -0
- package/dist/sync/process.js +77 -17
- package/dist/sync/processors.d.ts +7 -0
- package/dist/sync/processors.js +95 -1
- package/dist/tui/browse-handlers.js +71 -32
- package/dist/tui/browse-render.js +28 -12
- package/dist/tui/browse-types.d.ts +1 -0
- package/package.json +3 -2
|
@@ -289,7 +289,7 @@ export function getSelectedSource(state) {
|
|
|
289
289
|
*/
|
|
290
290
|
export function renderList(ui, state) {
|
|
291
291
|
const width = ui.listContent.width - 2;
|
|
292
|
-
const height = ui.listContent.height
|
|
292
|
+
const height = ui.listContent.height;
|
|
293
293
|
const lines = [];
|
|
294
294
|
if (state.filtered.length === 0) {
|
|
295
295
|
lines.push('');
|
|
@@ -328,8 +328,12 @@ function renderFlatList(ui, state, width, height, lines) {
|
|
|
328
328
|
if (state.selectedIndex >= itemsVisible) {
|
|
329
329
|
visibleStart = state.selectedIndex - itemsVisible + 1;
|
|
330
330
|
}
|
|
331
|
-
|
|
332
|
-
|
|
331
|
+
// Render items until we fill the viewport
|
|
332
|
+
let linesUsed = 0;
|
|
333
|
+
for (let i = visibleStart; i < state.filtered.length; i++) {
|
|
334
|
+
if (linesUsed + linesPerItem > height)
|
|
335
|
+
break;
|
|
336
|
+
linesUsed += linesPerItem;
|
|
333
337
|
const source = state.filtered[i];
|
|
334
338
|
const isSelected = i === state.selectedIndex;
|
|
335
339
|
renderDocumentItem(source, isSelected, width, lines, true);
|
|
@@ -339,15 +343,27 @@ function renderFlatList(ui, state, width, height, lines) {
|
|
|
339
343
|
* Render grouped list with collapsible project folders
|
|
340
344
|
*/
|
|
341
345
|
function renderGroupedList(ui, state, width, height, lines) {
|
|
342
|
-
// Calculate
|
|
343
|
-
const
|
|
344
|
-
|
|
346
|
+
// Calculate line height for each item type
|
|
347
|
+
const itemLineHeight = (i) => state.listItems[i]?.type === 'header' ? 2 : 3;
|
|
348
|
+
// Find visibleStart: scroll so selectedIndex is visible
|
|
345
349
|
let visibleStart = 0;
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
350
|
+
// Count lines from visibleStart to selectedIndex (inclusive)
|
|
351
|
+
let linesFromStartToSelected = 0;
|
|
352
|
+
for (let i = 0; i <= state.selectedIndex; i++) {
|
|
353
|
+
linesFromStartToSelected += itemLineHeight(i);
|
|
354
|
+
}
|
|
355
|
+
// If selectedIndex doesn't fit, scroll forward
|
|
356
|
+
while (linesFromStartToSelected > height && visibleStart < state.selectedIndex) {
|
|
357
|
+
linesFromStartToSelected -= itemLineHeight(visibleStart);
|
|
358
|
+
visibleStart++;
|
|
359
|
+
}
|
|
360
|
+
// Render items until we fill the viewport
|
|
361
|
+
let linesUsed = 0;
|
|
362
|
+
for (let i = visibleStart; i < state.listItems.length; i++) {
|
|
363
|
+
const h = itemLineHeight(i);
|
|
364
|
+
if (linesUsed + h > height)
|
|
365
|
+
break;
|
|
366
|
+
linesUsed += h;
|
|
351
367
|
const item = state.listItems[i];
|
|
352
368
|
const isSelected = i === state.selectedIndex;
|
|
353
369
|
if (item.type === 'header') {
|
|
@@ -377,7 +393,7 @@ function renderProjectHeader(item, isSelected, width, lines) {
|
|
|
377
393
|
* Render a document item row
|
|
378
394
|
*/
|
|
379
395
|
function renderDocumentItem(source, isSelected, width, lines, showProject) {
|
|
380
|
-
const date = formatDate(source.created_at);
|
|
396
|
+
const date = formatDate(source.indexed_at || source.created_at);
|
|
381
397
|
const contentType = source.content_type || 'document';
|
|
382
398
|
const project = source.projects[0] || '';
|
|
383
399
|
// Format content type as a tag
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getlore/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Research knowledge repository with semantic search, citations, and project lineage tracking",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"bugs": {
|
|
45
45
|
"url": "https://github.com/getlore-ai/lore/issues"
|
|
46
46
|
},
|
|
47
|
-
"license": "
|
|
47
|
+
"license": "MIT",
|
|
48
48
|
"engines": {
|
|
49
49
|
"node": ">=18"
|
|
50
50
|
},
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
"chokidar": "^5.0.0",
|
|
59
59
|
"commander": "^12.1.0",
|
|
60
60
|
"dotenv": "^17.2.3",
|
|
61
|
+
"exifr": "^7.1.3",
|
|
61
62
|
"openai": "^4.77.0",
|
|
62
63
|
"pdf-parse": "^2.4.5",
|
|
63
64
|
"zod": "^3.24.0"
|