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

Method Delete

cli/context_adapter.go:233–248  ·  view source on GitHub ↗

Delete permanently removes a context.

(name string)

Source from the content-addressed store, hash-verified

231
232// Delete permanently removes a context.
233func (a *contextPluginAdapter) Delete(name string) (string, error) {
234 mgr := a.manager()
235 if mgr == nil {
236 return "", fmt.Errorf("context manager unavailable in this session")
237 }
238 fc, err := mgr.GetContextByName(name)
239 if err != nil {
240 return "", fmt.Errorf("context %q not found", name)
241 }
242 if err := mgr.DeleteContext(fc.ID); err != nil {
243 return "", err
244 }
245 var b strings.Builder
246 fmt.Fprintf(&b, "Deleted context %q permanently.", fc.Name)
247 return b.String(), nil
248}
249
250// Update re-ingests or modifies an existing context. Empty fields keep the
251// current value (mirrors /context update).

Callers 2

Calls 5

managerMethod · 0.95
ErrorfMethod · 0.80
GetContextByNameMethod · 0.80
DeleteContextMethod · 0.45
StringMethod · 0.45

Tested by 2