@getlore/cli 0.2.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 +13 -0
- package/README.md +80 -0
- package/dist/cli/colors.d.ts +48 -0
- package/dist/cli/colors.js +48 -0
- package/dist/cli/commands/ask.d.ts +7 -0
- package/dist/cli/commands/ask.js +97 -0
- package/dist/cli/commands/auth.d.ts +10 -0
- package/dist/cli/commands/auth.js +484 -0
- package/dist/cli/commands/daemon.d.ts +22 -0
- package/dist/cli/commands/daemon.js +244 -0
- package/dist/cli/commands/docs.d.ts +7 -0
- package/dist/cli/commands/docs.js +188 -0
- package/dist/cli/commands/extensions.d.ts +7 -0
- package/dist/cli/commands/extensions.js +204 -0
- package/dist/cli/commands/misc.d.ts +7 -0
- package/dist/cli/commands/misc.js +172 -0
- package/dist/cli/commands/pending.d.ts +7 -0
- package/dist/cli/commands/pending.js +63 -0
- package/dist/cli/commands/projects.d.ts +7 -0
- package/dist/cli/commands/projects.js +136 -0
- package/dist/cli/commands/search.d.ts +7 -0
- package/dist/cli/commands/search.js +102 -0
- package/dist/cli/commands/skills.d.ts +24 -0
- package/dist/cli/commands/skills.js +447 -0
- package/dist/cli/commands/sources.d.ts +7 -0
- package/dist/cli/commands/sources.js +121 -0
- package/dist/cli/commands/sync.d.ts +31 -0
- package/dist/cli/commands/sync.js +768 -0
- package/dist/cli/helpers.d.ts +30 -0
- package/dist/cli/helpers.js +119 -0
- package/dist/core/auth.d.ts +62 -0
- package/dist/core/auth.js +330 -0
- package/dist/core/config.d.ts +41 -0
- package/dist/core/config.js +96 -0
- package/dist/core/data-repo.d.ts +31 -0
- package/dist/core/data-repo.js +146 -0
- package/dist/core/embedder.d.ts +22 -0
- package/dist/core/embedder.js +104 -0
- package/dist/core/git.d.ts +37 -0
- package/dist/core/git.js +140 -0
- package/dist/core/index.d.ts +4 -0
- package/dist/core/index.js +5 -0
- package/dist/core/insight-extractor.d.ts +26 -0
- package/dist/core/insight-extractor.js +114 -0
- package/dist/core/local-search.d.ts +43 -0
- package/dist/core/local-search.js +221 -0
- package/dist/core/themes.d.ts +15 -0
- package/dist/core/themes.js +77 -0
- package/dist/core/types.d.ts +177 -0
- package/dist/core/types.js +9 -0
- package/dist/core/user-settings.d.ts +15 -0
- package/dist/core/user-settings.js +42 -0
- package/dist/core/vector-store-lance.d.ts +98 -0
- package/dist/core/vector-store-lance.js +384 -0
- package/dist/core/vector-store-supabase.d.ts +89 -0
- package/dist/core/vector-store-supabase.js +295 -0
- package/dist/core/vector-store.d.ts +131 -0
- package/dist/core/vector-store.js +503 -0
- package/dist/daemon-runner.d.ts +8 -0
- package/dist/daemon-runner.js +246 -0
- package/dist/extensions/config.d.ts +22 -0
- package/dist/extensions/config.js +102 -0
- package/dist/extensions/proposals.d.ts +30 -0
- package/dist/extensions/proposals.js +178 -0
- package/dist/extensions/registry.d.ts +35 -0
- package/dist/extensions/registry.js +309 -0
- package/dist/extensions/sandbox.d.ts +16 -0
- package/dist/extensions/sandbox.js +17 -0
- package/dist/extensions/types.d.ts +114 -0
- package/dist/extensions/types.js +4 -0
- package/dist/extensions/worker.d.ts +1 -0
- package/dist/extensions/worker.js +49 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +105 -0
- package/dist/mcp/handlers/archive-project.d.ts +51 -0
- package/dist/mcp/handlers/archive-project.js +112 -0
- package/dist/mcp/handlers/get-quotes.d.ts +27 -0
- package/dist/mcp/handlers/get-quotes.js +61 -0
- package/dist/mcp/handlers/get-source.d.ts +9 -0
- package/dist/mcp/handlers/get-source.js +40 -0
- package/dist/mcp/handlers/ingest.d.ts +25 -0
- package/dist/mcp/handlers/ingest.js +305 -0
- package/dist/mcp/handlers/list-projects.d.ts +4 -0
- package/dist/mcp/handlers/list-projects.js +16 -0
- package/dist/mcp/handlers/list-sources.d.ts +11 -0
- package/dist/mcp/handlers/list-sources.js +20 -0
- package/dist/mcp/handlers/research-agent.d.ts +21 -0
- package/dist/mcp/handlers/research-agent.js +369 -0
- package/dist/mcp/handlers/research.d.ts +22 -0
- package/dist/mcp/handlers/research.js +225 -0
- package/dist/mcp/handlers/retain.d.ts +18 -0
- package/dist/mcp/handlers/retain.js +92 -0
- package/dist/mcp/handlers/search.d.ts +52 -0
- package/dist/mcp/handlers/search.js +145 -0
- package/dist/mcp/handlers/sync.d.ts +47 -0
- package/dist/mcp/handlers/sync.js +211 -0
- package/dist/mcp/server.d.ts +10 -0
- package/dist/mcp/server.js +268 -0
- package/dist/mcp/tools.d.ts +16 -0
- package/dist/mcp/tools.js +297 -0
- package/dist/sync/config.d.ts +26 -0
- package/dist/sync/config.js +140 -0
- package/dist/sync/discover.d.ts +51 -0
- package/dist/sync/discover.js +190 -0
- package/dist/sync/index.d.ts +11 -0
- package/dist/sync/index.js +11 -0
- package/dist/sync/process.d.ts +50 -0
- package/dist/sync/process.js +285 -0
- package/dist/sync/processors.d.ts +24 -0
- package/dist/sync/processors.js +351 -0
- package/dist/tui/browse-handlers-ask.d.ts +30 -0
- package/dist/tui/browse-handlers-ask.js +372 -0
- package/dist/tui/browse-handlers-autocomplete.d.ts +49 -0
- package/dist/tui/browse-handlers-autocomplete.js +270 -0
- package/dist/tui/browse-handlers-extensions.d.ts +18 -0
- package/dist/tui/browse-handlers-extensions.js +107 -0
- package/dist/tui/browse-handlers-pending.d.ts +22 -0
- package/dist/tui/browse-handlers-pending.js +100 -0
- package/dist/tui/browse-handlers-research.d.ts +32 -0
- package/dist/tui/browse-handlers-research.js +363 -0
- package/dist/tui/browse-handlers-tools.d.ts +42 -0
- package/dist/tui/browse-handlers-tools.js +289 -0
- package/dist/tui/browse-handlers.d.ts +239 -0
- package/dist/tui/browse-handlers.js +1944 -0
- package/dist/tui/browse-render-extensions.d.ts +14 -0
- package/dist/tui/browse-render-extensions.js +114 -0
- package/dist/tui/browse-render-tools.d.ts +18 -0
- package/dist/tui/browse-render-tools.js +259 -0
- package/dist/tui/browse-render.d.ts +51 -0
- package/dist/tui/browse-render.js +599 -0
- package/dist/tui/browse-types.d.ts +142 -0
- package/dist/tui/browse-types.js +70 -0
- package/dist/tui/browse-ui.d.ts +10 -0
- package/dist/tui/browse-ui.js +432 -0
- package/dist/tui/browse.d.ts +17 -0
- package/dist/tui/browse.js +625 -0
- package/dist/tui/markdown.d.ts +22 -0
- package/dist/tui/markdown.js +223 -0
- package/package.json +71 -0
- package/plugins/claude-code/.claude-plugin/plugin.json +10 -0
- package/plugins/claude-code/.mcp.json +6 -0
- package/plugins/claude-code/skills/lore/SKILL.md +63 -0
- package/plugins/codex/SKILL.md +36 -0
- package/plugins/codex/agents/openai.yaml +10 -0
- package/plugins/gemini/GEMINI.md +31 -0
- package/plugins/gemini/gemini-extension.json +11 -0
- package/skills/generic-agent.md +99 -0
- package/skills/openclaw.md +67 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types and interfaces for the Lore Document Browser TUI
|
|
3
|
+
*/
|
|
4
|
+
import type { SourceType, ContentType, Theme, Quote, SearchMode } from '../core/types.js';
|
|
5
|
+
import type { ExtensionPermissions } from '../extensions/types.js';
|
|
6
|
+
export interface SourceItem {
|
|
7
|
+
id: string;
|
|
8
|
+
title: string;
|
|
9
|
+
source_type: SourceType;
|
|
10
|
+
content_type: ContentType;
|
|
11
|
+
projects: string[];
|
|
12
|
+
created_at: string;
|
|
13
|
+
summary: string;
|
|
14
|
+
score?: number;
|
|
15
|
+
}
|
|
16
|
+
export interface SourceDetails extends SourceItem {
|
|
17
|
+
tags: string[];
|
|
18
|
+
themes: Theme[];
|
|
19
|
+
quotes: Quote[];
|
|
20
|
+
}
|
|
21
|
+
export interface BrowseOptions {
|
|
22
|
+
project?: string;
|
|
23
|
+
sourceType?: SourceType;
|
|
24
|
+
limit?: number;
|
|
25
|
+
dataDir: string;
|
|
26
|
+
}
|
|
27
|
+
export type Mode = 'list' | 'search' | 'regex-search' | 'fullview' | 'doc-search' | 'help' | 'project-picker' | 'extensions' | 'ask' | 'research' | 'delete-confirm' | 'move-picker' | 'edit-info' | 'type-picker' | 'content-type-filter';
|
|
28
|
+
export interface LoadedExtensionInfo {
|
|
29
|
+
name: string;
|
|
30
|
+
version: string;
|
|
31
|
+
packageName: string;
|
|
32
|
+
enabled: boolean;
|
|
33
|
+
hooks: string[];
|
|
34
|
+
middleware: string[];
|
|
35
|
+
commands: string[];
|
|
36
|
+
permissions?: ExtensionPermissions;
|
|
37
|
+
}
|
|
38
|
+
export interface ProjectInfo {
|
|
39
|
+
name: string;
|
|
40
|
+
count: number;
|
|
41
|
+
latestActivity: string;
|
|
42
|
+
}
|
|
43
|
+
export type ListItem = {
|
|
44
|
+
type: 'header';
|
|
45
|
+
projectName: string;
|
|
46
|
+
displayName: string;
|
|
47
|
+
documentCount: number;
|
|
48
|
+
expanded: boolean;
|
|
49
|
+
} | {
|
|
50
|
+
type: 'document';
|
|
51
|
+
source: SourceItem;
|
|
52
|
+
projectName: string;
|
|
53
|
+
};
|
|
54
|
+
export interface BrowserState {
|
|
55
|
+
sources: SourceItem[];
|
|
56
|
+
filtered: SourceItem[];
|
|
57
|
+
selectedIndex: number;
|
|
58
|
+
mode: Mode;
|
|
59
|
+
searchQuery: string;
|
|
60
|
+
searchMode: SearchMode;
|
|
61
|
+
scrollOffset: number;
|
|
62
|
+
fullContent: string;
|
|
63
|
+
fullContentLines: string[];
|
|
64
|
+
fullContentLinesRaw: string[];
|
|
65
|
+
gPressed: boolean;
|
|
66
|
+
docSearchPattern: string;
|
|
67
|
+
docSearchMatches: number[];
|
|
68
|
+
docSearchCurrentIdx: number;
|
|
69
|
+
projects: ProjectInfo[];
|
|
70
|
+
projectPickerIndex: number;
|
|
71
|
+
currentProject?: string;
|
|
72
|
+
extensionsList: LoadedExtensionInfo[];
|
|
73
|
+
selectedExtensionIndex: number;
|
|
74
|
+
askQuery: string;
|
|
75
|
+
askResponse: string;
|
|
76
|
+
askStreaming: boolean;
|
|
77
|
+
askHistory: Array<{
|
|
78
|
+
role: 'user' | 'assistant';
|
|
79
|
+
content: string;
|
|
80
|
+
}>;
|
|
81
|
+
researchQuery: string;
|
|
82
|
+
researchRunning: boolean;
|
|
83
|
+
researchResponse: string;
|
|
84
|
+
researchHistory: Array<{
|
|
85
|
+
query: string;
|
|
86
|
+
summary: string;
|
|
87
|
+
}>;
|
|
88
|
+
groupByProject: boolean;
|
|
89
|
+
expandedProjects: Set<string>;
|
|
90
|
+
listItems: ListItem[];
|
|
91
|
+
movePickerIndex: number;
|
|
92
|
+
movePickerProjects: ProjectInfo[];
|
|
93
|
+
moveTargetSource?: SourceItem;
|
|
94
|
+
editSource?: SourceItem;
|
|
95
|
+
editTitle: string;
|
|
96
|
+
editProjects: string[];
|
|
97
|
+
editFieldIndex: number;
|
|
98
|
+
typePickerIndex: number;
|
|
99
|
+
typePickerSource?: SourceItem;
|
|
100
|
+
contentTypeFilterIndex: number;
|
|
101
|
+
currentContentType?: string;
|
|
102
|
+
pickerReturnMode?: 'ask' | 'research';
|
|
103
|
+
autocompleteVisible: boolean;
|
|
104
|
+
autocompleteOptions: Array<{
|
|
105
|
+
value: string;
|
|
106
|
+
label: string;
|
|
107
|
+
description?: string;
|
|
108
|
+
}>;
|
|
109
|
+
autocompleteIndex: number;
|
|
110
|
+
autocompleteType: 'command' | 'project' | 'type' | null;
|
|
111
|
+
autocompleteJustSelected: boolean;
|
|
112
|
+
}
|
|
113
|
+
export interface UIComponents {
|
|
114
|
+
screen: any;
|
|
115
|
+
header: any;
|
|
116
|
+
statusBar: any;
|
|
117
|
+
listPane: any;
|
|
118
|
+
listTitle: any;
|
|
119
|
+
listContent: any;
|
|
120
|
+
previewPane: any;
|
|
121
|
+
previewTitle: any;
|
|
122
|
+
previewContent: any;
|
|
123
|
+
fullViewPane: any;
|
|
124
|
+
fullViewTitle: any;
|
|
125
|
+
fullViewContent: any;
|
|
126
|
+
fullViewScrollbar: any;
|
|
127
|
+
helpPane: any;
|
|
128
|
+
searchInput: any;
|
|
129
|
+
regexInput: any;
|
|
130
|
+
docSearchInput: any;
|
|
131
|
+
askInput: any;
|
|
132
|
+
askPane: any;
|
|
133
|
+
autocompleteDropdown: any;
|
|
134
|
+
footer: any;
|
|
135
|
+
projectPicker: any;
|
|
136
|
+
projectPickerContent: any;
|
|
137
|
+
deleteConfirm: any;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Emoji to ASCII replacements for common emojis
|
|
141
|
+
*/
|
|
142
|
+
export declare const emojiReplacements: Record<string, string>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types and interfaces for the Lore Document Browser TUI
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Emoji to ASCII replacements for common emojis
|
|
6
|
+
*/
|
|
7
|
+
export const emojiReplacements = {
|
|
8
|
+
// Speaker/conversation indicators (most common in transcripts)
|
|
9
|
+
'💻': '[user]', // Computer - often represents user in transcripts
|
|
10
|
+
'🎤': '[speaker]', // Microphone - speaker indicator
|
|
11
|
+
'💬': '[>]',
|
|
12
|
+
'🎙️': '[mic]',
|
|
13
|
+
'🎙': '[mic]',
|
|
14
|
+
'🗣️': '[>]',
|
|
15
|
+
'🗣': '[>]',
|
|
16
|
+
'👤': '[*]',
|
|
17
|
+
'👥': '[**]',
|
|
18
|
+
'🧑': '[*]',
|
|
19
|
+
'👨': '[*]',
|
|
20
|
+
'👩': '[*]',
|
|
21
|
+
'🦊': '[fox]',
|
|
22
|
+
// Common status/action emojis
|
|
23
|
+
'✅': '[ok]',
|
|
24
|
+
'✓': '[ok]',
|
|
25
|
+
'❌': '[x]',
|
|
26
|
+
'⚠️': '[!]',
|
|
27
|
+
'⚠': '[!]',
|
|
28
|
+
'❗': '[!]',
|
|
29
|
+
'❓': '[?]',
|
|
30
|
+
'💡': '[idea]',
|
|
31
|
+
'📝': '[note]',
|
|
32
|
+
'📌': '[pin]',
|
|
33
|
+
'🔗': '[link]',
|
|
34
|
+
'📎': '[clip]',
|
|
35
|
+
'📁': '[dir]',
|
|
36
|
+
'📄': '[doc]',
|
|
37
|
+
'📊': '[chart]',
|
|
38
|
+
'📈': '[up]',
|
|
39
|
+
'📉': '[down]',
|
|
40
|
+
'🎯': '[target]',
|
|
41
|
+
'🚀': '[launch]',
|
|
42
|
+
'⭐': '[*]',
|
|
43
|
+
'🌟': '[*]',
|
|
44
|
+
'💪': '[+]',
|
|
45
|
+
'👍': '[+1]',
|
|
46
|
+
'👎': '[-1]',
|
|
47
|
+
'🔥': '[!]',
|
|
48
|
+
'💰': '[$]',
|
|
49
|
+
'🕐': '[time]',
|
|
50
|
+
'🕑': '[time]',
|
|
51
|
+
'🕒': '[time]',
|
|
52
|
+
'⏰': '[time]',
|
|
53
|
+
'📅': '[date]',
|
|
54
|
+
'🔒': '[lock]',
|
|
55
|
+
'🔓': '[unlock]',
|
|
56
|
+
'➡️': '->',
|
|
57
|
+
'➡': '->',
|
|
58
|
+
'⬅️': '<-',
|
|
59
|
+
'⬅': '<-',
|
|
60
|
+
'⬆️': '^',
|
|
61
|
+
'⬇️': 'v',
|
|
62
|
+
'▶️': '>',
|
|
63
|
+
'◀️': '<',
|
|
64
|
+
'🔴': '[o]',
|
|
65
|
+
'🟢': '[o]',
|
|
66
|
+
'🟡': '[o]',
|
|
67
|
+
'🔵': '[o]',
|
|
68
|
+
'🟠': '[o]',
|
|
69
|
+
'🟣': '[o]',
|
|
70
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UI Components for the Lore Document Browser TUI
|
|
3
|
+
*
|
|
4
|
+
* Creates all blessed UI components and returns them in a structured object.
|
|
5
|
+
*/
|
|
6
|
+
import type { UIComponents } from './browse-types.js';
|
|
7
|
+
/**
|
|
8
|
+
* Create all UI components for the browser
|
|
9
|
+
*/
|
|
10
|
+
export declare function createUIComponents(): UIComponents;
|
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UI Components for the Lore Document Browser TUI
|
|
3
|
+
*
|
|
4
|
+
* Creates all blessed UI components and returns them in a structured object.
|
|
5
|
+
*/
|
|
6
|
+
import blessed from 'blessed';
|
|
7
|
+
/**
|
|
8
|
+
* Create all UI components for the browser
|
|
9
|
+
*/
|
|
10
|
+
export function createUIComponents() {
|
|
11
|
+
// Create screen
|
|
12
|
+
const screen = blessed.screen({
|
|
13
|
+
smartCSR: true,
|
|
14
|
+
title: 'Lore Browser',
|
|
15
|
+
fullUnicode: true,
|
|
16
|
+
mouse: true,
|
|
17
|
+
});
|
|
18
|
+
// Header
|
|
19
|
+
const header = blessed.box({
|
|
20
|
+
parent: screen,
|
|
21
|
+
top: 0,
|
|
22
|
+
left: 0,
|
|
23
|
+
width: '100%',
|
|
24
|
+
height: 1,
|
|
25
|
+
content: ' Lore Browser',
|
|
26
|
+
style: {
|
|
27
|
+
fg: 'black',
|
|
28
|
+
bg: 'cyan',
|
|
29
|
+
bold: true,
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
// Status bar (under header)
|
|
33
|
+
const statusBar = blessed.box({
|
|
34
|
+
parent: screen,
|
|
35
|
+
top: 1,
|
|
36
|
+
left: 0,
|
|
37
|
+
width: '100%',
|
|
38
|
+
height: 1,
|
|
39
|
+
content: ' Loading...',
|
|
40
|
+
tags: true,
|
|
41
|
+
style: {
|
|
42
|
+
fg: 'black',
|
|
43
|
+
bg: 'white',
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
// Left pane - document list (55%)
|
|
47
|
+
const listPane = blessed.box({
|
|
48
|
+
parent: screen,
|
|
49
|
+
top: 2,
|
|
50
|
+
left: 0,
|
|
51
|
+
width: '55%',
|
|
52
|
+
height: '100%-4',
|
|
53
|
+
border: {
|
|
54
|
+
type: 'line',
|
|
55
|
+
},
|
|
56
|
+
style: {
|
|
57
|
+
border: {
|
|
58
|
+
fg: 'blue',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
scrollable: true,
|
|
62
|
+
alwaysScroll: true,
|
|
63
|
+
scrollbar: {
|
|
64
|
+
ch: '│',
|
|
65
|
+
style: {
|
|
66
|
+
fg: 'blue',
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
const listTitle = blessed.box({
|
|
71
|
+
parent: listPane,
|
|
72
|
+
top: 0,
|
|
73
|
+
left: 1,
|
|
74
|
+
width: '100%-4',
|
|
75
|
+
height: 1,
|
|
76
|
+
content: ' Documents',
|
|
77
|
+
tags: true,
|
|
78
|
+
style: {
|
|
79
|
+
fg: 'white',
|
|
80
|
+
bold: true,
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
const listContent = blessed.box({
|
|
84
|
+
parent: listPane,
|
|
85
|
+
top: 2,
|
|
86
|
+
left: 1,
|
|
87
|
+
width: '100%-4',
|
|
88
|
+
height: '100%-4',
|
|
89
|
+
tags: true,
|
|
90
|
+
scrollable: true,
|
|
91
|
+
alwaysScroll: true,
|
|
92
|
+
keys: false,
|
|
93
|
+
mouse: false,
|
|
94
|
+
});
|
|
95
|
+
// Right pane - preview (45%)
|
|
96
|
+
const previewPane = blessed.box({
|
|
97
|
+
parent: screen,
|
|
98
|
+
top: 2,
|
|
99
|
+
left: '55%',
|
|
100
|
+
width: '45%',
|
|
101
|
+
height: '100%-4',
|
|
102
|
+
border: {
|
|
103
|
+
type: 'line',
|
|
104
|
+
},
|
|
105
|
+
style: {
|
|
106
|
+
border: {
|
|
107
|
+
fg: 'blue',
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
const previewTitle = blessed.box({
|
|
112
|
+
parent: previewPane,
|
|
113
|
+
top: 0,
|
|
114
|
+
left: 1,
|
|
115
|
+
width: '100%-4',
|
|
116
|
+
height: 1,
|
|
117
|
+
content: ' Preview',
|
|
118
|
+
tags: true,
|
|
119
|
+
style: {
|
|
120
|
+
fg: 'white',
|
|
121
|
+
bold: true,
|
|
122
|
+
},
|
|
123
|
+
});
|
|
124
|
+
const previewContent = blessed.box({
|
|
125
|
+
parent: previewPane,
|
|
126
|
+
top: 2,
|
|
127
|
+
left: 1,
|
|
128
|
+
width: '100%-4',
|
|
129
|
+
height: '100%-4',
|
|
130
|
+
tags: true,
|
|
131
|
+
scrollable: true,
|
|
132
|
+
alwaysScroll: true,
|
|
133
|
+
scrollbar: {
|
|
134
|
+
ch: '│',
|
|
135
|
+
style: {
|
|
136
|
+
bg: 'blue',
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
// Full view overlay (hidden initially)
|
|
141
|
+
const fullViewPane = blessed.box({
|
|
142
|
+
parent: screen,
|
|
143
|
+
top: 2,
|
|
144
|
+
left: 0,
|
|
145
|
+
width: '100%',
|
|
146
|
+
height: '100%-4',
|
|
147
|
+
border: {
|
|
148
|
+
type: 'line',
|
|
149
|
+
},
|
|
150
|
+
style: {
|
|
151
|
+
border: {
|
|
152
|
+
fg: 'blue',
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
hidden: true,
|
|
156
|
+
scrollable: true,
|
|
157
|
+
alwaysScroll: true,
|
|
158
|
+
scrollbar: {
|
|
159
|
+
ch: '│',
|
|
160
|
+
style: {
|
|
161
|
+
fg: 'blue',
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
});
|
|
165
|
+
const fullViewTitle = blessed.box({
|
|
166
|
+
parent: fullViewPane,
|
|
167
|
+
top: 0,
|
|
168
|
+
left: 1,
|
|
169
|
+
width: '100%-4',
|
|
170
|
+
height: 3,
|
|
171
|
+
tags: true,
|
|
172
|
+
style: {
|
|
173
|
+
fg: 'white',
|
|
174
|
+
},
|
|
175
|
+
});
|
|
176
|
+
const fullViewContent = blessed.box({
|
|
177
|
+
parent: fullViewPane,
|
|
178
|
+
top: 4,
|
|
179
|
+
left: 1,
|
|
180
|
+
width: '100%-6', // Leave room for scrollbar
|
|
181
|
+
height: '100%-6',
|
|
182
|
+
tags: true,
|
|
183
|
+
scrollable: true,
|
|
184
|
+
alwaysScroll: true,
|
|
185
|
+
keys: false,
|
|
186
|
+
mouse: false,
|
|
187
|
+
});
|
|
188
|
+
// Scrollbar track for full view (separate element on right edge)
|
|
189
|
+
const fullViewScrollbar = blessed.box({
|
|
190
|
+
parent: fullViewPane,
|
|
191
|
+
top: 4,
|
|
192
|
+
right: 2,
|
|
193
|
+
width: 1,
|
|
194
|
+
height: '100%-6',
|
|
195
|
+
tags: true,
|
|
196
|
+
style: {
|
|
197
|
+
fg: 'blue',
|
|
198
|
+
},
|
|
199
|
+
});
|
|
200
|
+
// Help overlay (hidden initially)
|
|
201
|
+
const helpPane = blessed.box({
|
|
202
|
+
parent: screen,
|
|
203
|
+
top: 'center',
|
|
204
|
+
left: 'center',
|
|
205
|
+
width: 50,
|
|
206
|
+
height: 29,
|
|
207
|
+
border: {
|
|
208
|
+
type: 'line',
|
|
209
|
+
},
|
|
210
|
+
style: {
|
|
211
|
+
border: {
|
|
212
|
+
fg: 'cyan',
|
|
213
|
+
},
|
|
214
|
+
bg: 'black',
|
|
215
|
+
},
|
|
216
|
+
hidden: true,
|
|
217
|
+
tags: true,
|
|
218
|
+
content: `
|
|
219
|
+
{bold}{cyan-fg}Lore Browser Help{/cyan-fg}{/bold}
|
|
220
|
+
|
|
221
|
+
{bold}List View:{/bold}
|
|
222
|
+
j/k ↑/↓ Navigate
|
|
223
|
+
Space/Enter Expand/collapse folder
|
|
224
|
+
h/l ←/→ Collapse/expand folder
|
|
225
|
+
Tab Toggle flat/grouped view
|
|
226
|
+
/ Hybrid search (semantic+keyword)
|
|
227
|
+
: Regex search (grep files)
|
|
228
|
+
a Ask a question (AI-powered)
|
|
229
|
+
R Research mode (agentic)
|
|
230
|
+
p Project picker
|
|
231
|
+
C-p Show all projects
|
|
232
|
+
c Content type filter
|
|
233
|
+
C-c Clear type filter
|
|
234
|
+
s Sync now (git pull + index)
|
|
235
|
+
m Move doc to different project
|
|
236
|
+
i Edit document title
|
|
237
|
+
t Change content type
|
|
238
|
+
Del Delete document or project
|
|
239
|
+
|
|
240
|
+
{bold}Document View:{/bold}
|
|
241
|
+
j/k Scroll up/down
|
|
242
|
+
/ Search in document (regex)
|
|
243
|
+
n / N Next/previous match
|
|
244
|
+
y Copy to clipboard
|
|
245
|
+
Esc Back to list
|
|
246
|
+
e Open in $EDITOR
|
|
247
|
+
|
|
248
|
+
{bold}Other:{/bold}
|
|
249
|
+
Esc Back / Quit (from list)
|
|
250
|
+
? Show this help
|
|
251
|
+
|
|
252
|
+
{blue-fg}Press any key to close{/blue-fg}
|
|
253
|
+
`,
|
|
254
|
+
});
|
|
255
|
+
// Delete confirmation dialog (hidden initially)
|
|
256
|
+
const deleteConfirm = blessed.box({
|
|
257
|
+
parent: screen,
|
|
258
|
+
top: 'center',
|
|
259
|
+
left: 'center',
|
|
260
|
+
width: 60,
|
|
261
|
+
height: 9,
|
|
262
|
+
border: {
|
|
263
|
+
type: 'line',
|
|
264
|
+
},
|
|
265
|
+
style: {
|
|
266
|
+
border: {
|
|
267
|
+
fg: 'red',
|
|
268
|
+
},
|
|
269
|
+
bg: 'black',
|
|
270
|
+
},
|
|
271
|
+
hidden: true,
|
|
272
|
+
tags: true,
|
|
273
|
+
});
|
|
274
|
+
// Project picker overlay (hidden initially)
|
|
275
|
+
const projectPicker = blessed.box({
|
|
276
|
+
parent: screen,
|
|
277
|
+
top: 'center',
|
|
278
|
+
left: 'center',
|
|
279
|
+
width: '70%', // Use percentage to accommodate long project names
|
|
280
|
+
height: 15,
|
|
281
|
+
border: {
|
|
282
|
+
type: 'line',
|
|
283
|
+
},
|
|
284
|
+
style: {
|
|
285
|
+
border: {
|
|
286
|
+
fg: 'yellow',
|
|
287
|
+
},
|
|
288
|
+
bg: 'black',
|
|
289
|
+
},
|
|
290
|
+
hidden: true,
|
|
291
|
+
tags: true,
|
|
292
|
+
});
|
|
293
|
+
const projectPickerContent = blessed.box({
|
|
294
|
+
parent: projectPicker,
|
|
295
|
+
top: 0,
|
|
296
|
+
left: 1,
|
|
297
|
+
width: '100%-4',
|
|
298
|
+
height: '100%-2',
|
|
299
|
+
tags: true,
|
|
300
|
+
scrollable: true,
|
|
301
|
+
alwaysScroll: true,
|
|
302
|
+
});
|
|
303
|
+
// Search input (hidden initially)
|
|
304
|
+
const searchInput = blessed.textbox({
|
|
305
|
+
parent: screen,
|
|
306
|
+
top: 1,
|
|
307
|
+
left: 0,
|
|
308
|
+
width: '100%',
|
|
309
|
+
height: 1,
|
|
310
|
+
style: {
|
|
311
|
+
fg: 'white',
|
|
312
|
+
bg: 'magenta',
|
|
313
|
+
},
|
|
314
|
+
hidden: true,
|
|
315
|
+
inputOnFocus: true,
|
|
316
|
+
});
|
|
317
|
+
// Regex search input (hidden initially)
|
|
318
|
+
const regexInput = blessed.textbox({
|
|
319
|
+
parent: screen,
|
|
320
|
+
top: 1,
|
|
321
|
+
left: 0,
|
|
322
|
+
width: '100%',
|
|
323
|
+
height: 1,
|
|
324
|
+
style: {
|
|
325
|
+
fg: 'white',
|
|
326
|
+
bg: 'cyan',
|
|
327
|
+
},
|
|
328
|
+
hidden: true,
|
|
329
|
+
inputOnFocus: true,
|
|
330
|
+
});
|
|
331
|
+
// Document search input (for fullview mode)
|
|
332
|
+
const docSearchInput = blessed.textbox({
|
|
333
|
+
parent: screen,
|
|
334
|
+
top: 1,
|
|
335
|
+
left: 0,
|
|
336
|
+
width: '100%',
|
|
337
|
+
height: 1,
|
|
338
|
+
style: {
|
|
339
|
+
fg: 'white',
|
|
340
|
+
bg: 'green',
|
|
341
|
+
},
|
|
342
|
+
hidden: true,
|
|
343
|
+
inputOnFocus: true,
|
|
344
|
+
});
|
|
345
|
+
// Ask input (hidden initially)
|
|
346
|
+
const askInput = blessed.textbox({
|
|
347
|
+
parent: screen,
|
|
348
|
+
top: 2,
|
|
349
|
+
left: 0,
|
|
350
|
+
width: '100%',
|
|
351
|
+
height: 3,
|
|
352
|
+
label: ' Ask Lore ',
|
|
353
|
+
border: { type: 'line' },
|
|
354
|
+
style: { border: { fg: 'cyan' }, focus: { border: { fg: 'green' } } },
|
|
355
|
+
hidden: true,
|
|
356
|
+
inputOnFocus: true,
|
|
357
|
+
});
|
|
358
|
+
// Ask response pane (hidden initially)
|
|
359
|
+
const askPane = blessed.box({
|
|
360
|
+
parent: screen,
|
|
361
|
+
top: 5,
|
|
362
|
+
left: 0,
|
|
363
|
+
width: '100%',
|
|
364
|
+
height: '100%-7',
|
|
365
|
+
label: ' Response ',
|
|
366
|
+
border: { type: 'line' },
|
|
367
|
+
style: { fg: 'white', border: { fg: 'cyan' } },
|
|
368
|
+
hidden: true,
|
|
369
|
+
tags: true,
|
|
370
|
+
scrollable: true,
|
|
371
|
+
alwaysScroll: true,
|
|
372
|
+
keys: true,
|
|
373
|
+
vi: true,
|
|
374
|
+
mouse: true,
|
|
375
|
+
});
|
|
376
|
+
// Autocomplete dropdown (hidden initially)
|
|
377
|
+
const autocompleteDropdown = blessed.box({
|
|
378
|
+
parent: screen,
|
|
379
|
+
top: 5,
|
|
380
|
+
left: 1,
|
|
381
|
+
width: '60%', // Use percentage to accommodate long project names
|
|
382
|
+
height: 10,
|
|
383
|
+
border: { type: 'line' },
|
|
384
|
+
style: {
|
|
385
|
+
fg: 'white',
|
|
386
|
+
bg: 'black',
|
|
387
|
+
border: { fg: 'yellow' },
|
|
388
|
+
},
|
|
389
|
+
hidden: true,
|
|
390
|
+
tags: true,
|
|
391
|
+
});
|
|
392
|
+
// Footer
|
|
393
|
+
const footer = blessed.box({
|
|
394
|
+
parent: screen,
|
|
395
|
+
bottom: 0,
|
|
396
|
+
left: 0,
|
|
397
|
+
width: '100%',
|
|
398
|
+
height: 1,
|
|
399
|
+
content: ' j/k Nav │ / Search │ a Ask │ R Research │ p Proj │ c Type │ m Move │ i Edit │ Esc Quit │ ? Help',
|
|
400
|
+
tags: true,
|
|
401
|
+
style: {
|
|
402
|
+
fg: 'white',
|
|
403
|
+
bg: 'black',
|
|
404
|
+
},
|
|
405
|
+
});
|
|
406
|
+
return {
|
|
407
|
+
screen,
|
|
408
|
+
header,
|
|
409
|
+
statusBar,
|
|
410
|
+
listPane,
|
|
411
|
+
listTitle,
|
|
412
|
+
listContent,
|
|
413
|
+
previewPane,
|
|
414
|
+
previewTitle,
|
|
415
|
+
previewContent,
|
|
416
|
+
fullViewPane,
|
|
417
|
+
fullViewTitle,
|
|
418
|
+
fullViewContent,
|
|
419
|
+
fullViewScrollbar,
|
|
420
|
+
helpPane,
|
|
421
|
+
searchInput,
|
|
422
|
+
regexInput,
|
|
423
|
+
docSearchInput,
|
|
424
|
+
askInput,
|
|
425
|
+
askPane,
|
|
426
|
+
autocompleteDropdown,
|
|
427
|
+
footer,
|
|
428
|
+
projectPicker,
|
|
429
|
+
projectPickerContent,
|
|
430
|
+
deleteConfirm,
|
|
431
|
+
};
|
|
432
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lore Document Browser TUI
|
|
3
|
+
*
|
|
4
|
+
* A Tig-like terminal UI for browsing the knowledge repository.
|
|
5
|
+
* Features:
|
|
6
|
+
* - Split-pane layout with document list and preview
|
|
7
|
+
* - Vim-style navigation (j/k, gg, G)
|
|
8
|
+
* - Full document view with scrolling
|
|
9
|
+
* - Editor integration
|
|
10
|
+
* - Search/filter (hybrid and regex)
|
|
11
|
+
*/
|
|
12
|
+
import type { BrowseOptions } from './browse-types.js';
|
|
13
|
+
/**
|
|
14
|
+
* Start the document browser TUI
|
|
15
|
+
*/
|
|
16
|
+
export declare function startBrowser(options: BrowseOptions): Promise<void>;
|
|
17
|
+
export type { BrowseOptions } from './browse-types.js';
|