MCPcopy Create free account
hub / github.com/diillson/chatcli / showConfigMemory

Method showConfigMemory

cli/config_memory.go:22–65  ·  view source on GitHub ↗

showConfigMemory renders the /config memory section.

()

Source from the content-addressed store, hash-verified

20
21// showConfigMemory renders the /config memory section.
22func (cli *ChatCLI) showConfigMemory() {
23 sectionHeader("🧠", "cfg.section.memory.title", ColorBlue)
24 p := uiPrefix(ColorBlue)
25
26 subheader(p, "cfg.sub.memory.injection")
27 mode := loadMemoryMode()
28 desc := i18n.T("cfg.kv.memory.mode_" + mode)
29 // Tag the value as the runtime default when the env var is unset so the
30 // operator can tell a configured value from the fallback.
31 if os.Getenv("CHATCLI_MEMORY_MODE") == "" {
32 desc = defaultMarker + desc
33 }
34 kv(p, "CHATCLI_MEMORY_MODE", desc)
35 kv(p, "CHATCLI_MEMORY_ENABLED", envBool("CHATCLI_MEMORY_ENABLED"))
36
37 if cli.memoryStore != nil {
38 if idx := cli.memoryStore.GetMemoryIndex(0); idx != "" {
39 kv(p, i18n.T("cfg.kv.memory.index_size"), fmt.Sprintf("%d bytes", len(idx)))
40 }
41 if longTerm := cli.memoryStore.ReadLongTerm(); longTerm != "" {
42 kv(p, i18n.T("cfg.kv.long_term_size"), fmt.Sprintf("%d bytes", len(longTerm)))
43 }
44 } else {
45 kv(p, i18n.T("cfg.kv.memory_store"), i18n.T("cfg.val.not_initialized"))
46 }
47
48 // Self-evolution has its own section (/config selfevolve); a one-line
49 // pointer keeps it discoverable from here since it shares this worker.
50 kv(p, i18n.T("cfg.kv.selfevolve.see_section"), i18n.T("cfg.kv.selfevolve.see_section_val"))
51
52 // Knowledge graph: per-turn map-of-content injection (the @memory neighbors
53 // pull is always available regardless).
54 subheader(p, "cfg.sub.graph")
55 graphVal := i18n.T("cfg.val.disabled")
56 if graphIndexEnabled() {
57 graphVal = i18n.T("cfg.val.enabled")
58 }
59 if os.Getenv(config.GraphIndexEnv) == "" {
60 graphVal = defaultMarker + graphVal
61 }
62 kv(p, config.GraphIndexEnv, graphVal)
63
64 sectionEnd(ColorBlue)
65}

Callers 1

routeConfigCommandMethod · 0.95

Calls 11

TFunction · 0.92
sectionHeaderFunction · 0.85
uiPrefixFunction · 0.85
subheaderFunction · 0.85
loadMemoryModeFunction · 0.85
envBoolFunction · 0.85
graphIndexEnabledFunction · 0.85
sectionEndFunction · 0.85
kvStruct · 0.50
GetMemoryIndexMethod · 0.45
ReadLongTermMethod · 0.45

Tested by

no test coverage detected