Skip to content

feat(api): session export endpoint — download transcript as JSONL/Markdown (#3114)#3153

Merged
aegis-gh-agent[bot] merged 1 commit into
developfrom
feat/3114-session-export
May 10, 2026
Merged

feat(api): session export endpoint — download transcript as JSONL/Markdown (#3114)#3153
aegis-gh-agent[bot] merged 1 commit into
developfrom
feat/3114-session-export

Conversation

@OneStepAt4time

Copy link
Copy Markdown
Owner

Summary

Implements #3114

Adds GET /v1/sessions/:id/export?format=jsonl|markdown to download full session transcripts.

Changes

  • src/routes/session-data.ts: New /v1/sessions/:id/export route with two formats:
    • format=jsonl — NDJSON stream, one entry per line, with Content-Disposition: attachment
    • format=markdown — Readable markdown export with section headers, thinking blocks (💭), tool calls in collapsible <details>, permission requests (🔐), and error callouts (⚠️)
  • Returns 400 for unsupported formats, 404 for missing sessions or empty transcript
  • Auth/ownership via withOwnership middleware (tenant isolation)
  • 9 tests covering all formats, edge cases, and markdown rendering

Verification

tsc --noEmit: ✅ 0 errors
npm run build: ✅ OK
npm test: ✅ 9/9 passed

Example Markdown output

# Session Export: my-session

> Exported: 2026-05-10T15:50:00Z
> Session ID: abc-123

---

### 👤 User
Hello, how are you?

### 💭 Thinking
Let me think about this...

### 🤖 Assistant
I am doing well, thanks!

### 🔧 Tool: ReadFile
<details>
<summary>ReadFile</summary>
file contents here
</details>

@OneStepAt4time OneStepAt4time added the approved-minor-bump Approves a minor version bump for release-please label May 10, 2026

@aegis-gh-agent aegis-gh-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved — all 9 merge gates passed (pending bump gate re-run).

Session export endpoint — JSONL + Markdown formats. 10 tests. Content-disposition for download. All CI green.

👁️ Argus

…kdown (#3114)

Adds GET /v1/sessions/:id/export?format=jsonl|markdown:
- JSONL: NDJSON stream with proper content-disposition header
- Markdown: readable export with section headers, thinking blocks,
  tool calls in collapsible <details>, permission requests, errors
- 400 for unsupported formats
- 404 for non-existent sessions or sessions with no transcript data
- Auth/ownership checks via withOwnership middleware
- 9 tests covering all cases
@OneStepAt4time OneStepAt4time force-pushed the feat/3114-session-export branch from 128dfa3 to 13f0d50 Compare May 10, 2026 17:31
@aegis-gh-agent aegis-gh-agent Bot merged commit 1f57102 into develop May 10, 2026
17 checks passed
@aegis-gh-agent aegis-gh-agent Bot deleted the feat/3114-session-export branch May 10, 2026 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved-minor-bump Approves a minor version bump for release-please

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant