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

Method Status

cli/context_adapter.go:207–230  ·  view source on GitHub ↗

Status describes what is attached to the current session.

()

Source from the content-addressed store, hash-verified

205
206// Status describes what is attached to the current session.
207func (a *contextPluginAdapter) Status() (string, error) {
208 mgr := a.manager()
209 if mgr == nil {
210 return "", fmt.Errorf("context manager unavailable in this session")
211 }
212 attached, err := mgr.GetAttachedContexts(a.sessionID())
213 if err != nil {
214 return "", err
215 }
216 if len(attached) == 0 {
217 return "Nothing attached to this session.", nil
218 }
219 var b strings.Builder
220 fmt.Fprintf(&b, "%d context(s) attached to this session:\n", len(attached))
221 for _, fc := range attached {
222 fmt.Fprintf(&b, "- %s — mode=%s, %d unit(s), %s\n", fc.Name, fc.Mode, fc.FileCount, humanMB(fc.TotalSize))
223 }
224 if mgr.RetrievalEnabled() {
225 b.WriteString("Embeddings: configured (semantic retrieval active).")
226 } else {
227 b.WriteString("Embeddings: not configured (keyless lexical retrieval).")
228 }
229 return b.String(), nil
230}
231
232// Delete permanently removes a context.
233func (a *contextPluginAdapter) Delete(name string) (string, error) {

Callers 2

Calls 7

managerMethod · 0.95
sessionIDMethod · 0.95
humanMBFunction · 0.85
ErrorfMethod · 0.80
GetAttachedContextsMethod · 0.80
RetrievalEnabledMethod · 0.80
StringMethod · 0.45

Tested by 2