Enha: ctrl+s to show filepath

This commit is contained in:
Grail Finder
2025-11-21 11:48:46 +03:00
parent 866a74e459
commit c2ecef69b4
3 changed files with 21 additions and 11 deletions

2
bot.go
View File

@@ -569,7 +569,7 @@ func init() {
} }
// load cards // load cards
basicCard.Role = cfg.AssistantRole basicCard.Role = cfg.AssistantRole
toolCard.Role = cfg.AssistantRole // toolCard.Role = cfg.AssistantRole
// //
logLevel.Set(slog.LevelInfo) logLevel.Set(slog.LevelInfo)
logger = slog.New(slog.NewTextHandler(logfile, &slog.HandlerOptions{Level: logLevel})) logger = slog.New(slog.NewTextHandler(logfile, &slog.HandlerOptions{Level: logLevel}))

View File

@@ -326,7 +326,7 @@ func makeRAGTable(fileList []string) *tview.Flex {
// } // }
func makeAgentTable(agentList []string) *tview.Table { func makeAgentTable(agentList []string) *tview.Table {
actions := []string{"load"} actions := []string{"filepath", "load"}
rows, cols := len(agentList), len(actions)+1 rows, cols := len(agentList), len(actions)+1
chatActTable := tview.NewTable(). chatActTable := tview.NewTable().
SetBorders(true) SetBorders(true)
@@ -339,6 +339,17 @@ func makeAgentTable(agentList []string) *tview.Table {
SetTextColor(color). SetTextColor(color).
SetAlign(tview.AlignCenter)) SetAlign(tview.AlignCenter))
} else { } else {
if actions[c-1] == "filepath" {
cc, ok := sysMap[agentList[r]]
if !ok {
continue
}
chatActTable.SetCell(r, c,
tview.NewTableCell(cc.FilePath).
SetTextColor(color).
SetAlign(tview.AlignCenter))
continue
}
chatActTable.SetCell(r, c, chatActTable.SetCell(r, c,
tview.NewTableCell(actions[c-1]). tview.NewTableCell(actions[c-1]).
SetTextColor(color). SetTextColor(color).
@@ -694,7 +705,6 @@ func makeFilePicker() *tview.Flex {
// Initialize the file list // Initialize the file list
refreshList(startDir) refreshList(startDir)
// Set up keyboard navigation // Set up keyboard navigation
flex.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey { flex.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey {
switch event.Key() { switch event.Key() {

View File

@@ -70,15 +70,15 @@ After that you are free to respond to the user.
Role: "", Role: "",
FilePath: "", FilePath: "",
} }
toolCard = &models.CharCard{ // toolCard = &models.CharCard{
SysPrompt: toolSysMsg, // SysPrompt: toolSysMsg,
FirstMsg: defaultFirstMsg, // FirstMsg: defaultFirstMsg,
Role: "", // Role: "",
FilePath: "", // FilePath: "",
} // }
// sysMap = map[string]string{"basic_sys": basicSysMsg, "tool_sys": toolSysMsg} // sysMap = map[string]string{"basic_sys": basicSysMsg, "tool_sys": toolSysMsg}
sysMap = map[string]*models.CharCard{"basic_sys": basicCard, "tool_sys": toolCard} sysMap = map[string]*models.CharCard{"basic_sys": basicCard}
sysLabels = []string{"basic_sys", "tool_sys"} sysLabels = []string{"basic_sys"}
) )
// web search (depends on extra server) // web search (depends on extra server)