-
Notifications
You must be signed in to change notification settings - Fork 55
feat: add Export Chat (Markdown / PDF) to session kebab menu #625
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Gkrumbach07
merged 7 commits into
ambient-code:main
from
jeremyeder:feature/export-chat
Feb 16, 2026
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c5f4d0d
feat: add Export Chat (Markdown / PDF) to session kebab menu
jeremyeder 026b7d2
fix: address code review feedback on export chat
jeremyeder 74c7a1c
feat: improve export chat with visual formatting, Google Drive, and t…
jeremyeder 60d881b
fix: address remaining code review feedback on export chat
jeremyeder bd475a0
fix: resolve remaining critical review feedback on export chat
jeremyeder 449407d
fix: address priority 1 code review issues
6c3977a
fix: use authenticated user email for Google Drive export
jeremyeder File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
...s/frontend/src/app/api/projects/[name]/agentic-sessions/[sessionName]/mcp/invoke/route.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| /** | ||
| * MCP Invoke API Route | ||
| * POST /api/projects/:name/agentic-sessions/:sessionName/mcp/invoke | ||
| * Proxies to backend which proxies to runner to invoke an MCP tool | ||
| */ | ||
|
|
||
| import { BACKEND_URL } from '@/lib/config' | ||
| import { buildForwardHeadersAsync } from '@/lib/auth' | ||
|
|
||
| export const dynamic = 'force-dynamic' | ||
|
|
||
| export async function POST( | ||
| request: Request, | ||
| { params }: { params: Promise<{ name: string; sessionName: string }> }, | ||
| ) { | ||
| const { name, sessionName } = await params | ||
|
|
||
| const headers = await buildForwardHeadersAsync(request, { | ||
| 'Content-Type': 'application/json', | ||
| }) | ||
|
|
||
| const body = await request.text() | ||
|
|
||
| const backendUrl = `${BACKEND_URL}/projects/${encodeURIComponent(name)}/agentic-sessions/${encodeURIComponent(sessionName)}/mcp/invoke` | ||
|
|
||
| try { | ||
| const response = await fetch(backendUrl, { | ||
| method: 'POST', | ||
| headers, | ||
| body, | ||
| }) | ||
|
|
||
| if (!response.ok) { | ||
| const errorText = await response.text() | ||
| // Preserve structured JSON errors from backend; wrap plain text | ||
| let errorBody: string | ||
| try { | ||
| const parsed = JSON.parse(errorText) | ||
| errorBody = JSON.stringify(parsed) | ||
| } catch { | ||
| errorBody = JSON.stringify({ error: errorText || `HTTP ${response.status}` }) | ||
| } | ||
| return new Response(errorBody, { | ||
| status: response.status, | ||
| headers: { 'Content-Type': 'application/json' }, | ||
| }) | ||
| } | ||
|
|
||
| const data = await response.json() | ||
| return Response.json(data) | ||
| } catch (error) { | ||
| console.error('MCP invoke proxy error:', error) | ||
| return new Response( | ||
| JSON.stringify({ | ||
| error: error instanceof Error ? error.message : 'Failed to invoke MCP tool', | ||
| }), | ||
| { status: 500, headers: { 'Content-Type': 'application/json' } } | ||
| ) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix pls