feat(tui): implement session export/import (JSON + Markdown) #1269

Closed
freemo wants to merge 1 commits from feature/m8-tui-session-export into master

1 Commits

Author SHA1 Message Date
freemo 9aa73cec03 feat(tui): implement session export/import (JSON + Markdown)
CI / security (pull_request) Failing after 2s
CI / quality (pull_request) Failing after 2s
CI / unit_tests (pull_request) Failing after 2s
CI / integration_tests (pull_request) Failing after 2s
CI / e2e_tests (pull_request) Failing after 2s
CI / build (pull_request) Failing after 2s
CI / helm (pull_request) Failing after 2s
CI / lint (pull_request) Successful in 3m20s
CI / typecheck (pull_request) Successful in 6m28s
CI / docker (pull_request) Has been skipped
CI / coverage (pull_request) Successful in 12m38s
CI / status-check (pull_request) Failing after 7s
CI / benchmark-publish (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Successful in 55m19s
Add Markdown export format to the session export/import system.

- Add Session.as_markdown_export() domain method that renders a
  human-readable Markdown document (metadata table, messages, token
  usage, linked plans)
- Extract render_session_markdown() and build_session_from_export_dict()
  into a dedicated session_markdown module to keep file sizes manageable
- Extend 'agents session export' CLI command with --format/-f option
  accepting 'json' (default, re-importable) or 'markdown' (human-readable)
- Add Behave BDD tests covering: Markdown export to stdout/file, --force
  overwrite, invalid format rejection, domain method structure, and
  JSON round-trip (export then import preserves actor, messages, namespace)

JSON export/import round-trip fidelity is unchanged; Markdown format is
intentionally read-only (not re-importable).

ISSUES CLOSED: #1004
2026-04-02 07:51:09 +00:00