Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExportMarkdown ¶
ExportMarkdown serializes a Session into a human-readable markdown document — useful for sharing a working session in a PR description, an issue, or just archiving. We deliberately omit the system message (boilerplate plus injected memory, not interesting to a reader) and fence tool output for clarity.
Living in the session package (rather than internal/tui) lets the non-interactive cobra subcommands call it without dragging the bubbletea/lipgloss dependency tree into the CLI binary's non-interactive paths.
Types ¶
type Session ¶
type Session struct {
ID string `json:"id"`
Name string `json:"name,omitempty"`
Model string `json:"model"`
Created time.Time `json:"created"`
Cwd string `json:"cwd"`
Messages []adapter.Message `json:"messages"`
// contains filtered or unexported fields
}
Session is one resumable conversation persisted as JSON in ~/.yottacode/sessions/<id>.json.
Name is an optional human-readable label set via the /sessions picker's Rename action. It's a soft alias: Load will fall back to a Name match if the requested id doesn't resolve to a file.
func Load ¶
Load reads a stored session by id (filename match) or name (Name field match). The legacy "last" keyword shortcut was retired alongside the /resume slash command — the /sessions picker (and the `yottacode sessions resume <id|name>` cobra subcommand) is the canonical path for "load the most recent" now, with the picker defaulting the cursor to the newest entry.
type SessionInfo ¶
SessionInfo is a metadata-only view returned by List.
func List ¶
func List() ([]SessionInfo, error)
List returns every saved session's metadata, newest first. Doesn't load the full message log to keep this cheap for the /sessions slash command.