Delete permanently removes a context.
(name string)
| 231 | |
| 232 | // Delete permanently removes a context. |
| 233 | func (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). |