📅 feat: Support text/calendar (iCalendar) in Code Outputs (#12758)

Registers text/calendar across the MIME allowlists (fullMimeTypesList,
codeInterpreterMimeTypesList, textMimeTypes regex) and maps the .ics,
.ical, .ifb, .icalendar extensions in codeTypeMapping, so iCalendar
files produced by the code interpreter are accepted as valid output
and rendered as downloadable attachments.
This commit is contained in:
Ravi Kumar L 2026-04-22 17:19:10 +02:00 committed by GitHub
parent f5c4deac28
commit 24d32f28f0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -45,6 +45,7 @@ export const fullMimeTypesList = [
'text/x-tex',
'text/plain',
'text/css',
'text/calendar',
'text/vtt',
'image/jpeg',
'text/javascript',
@ -109,6 +110,7 @@ export const codeInterpreterMimeTypesList = [
'text/x-tex',
'text/plain',
'text/css',
'text/calendar',
'image/jpeg',
'text/javascript',
'image/gif',
@ -180,7 +182,7 @@ export const excelMimeTypes =
/^application\/(vnd\.ms-excel|msexcel|x-msexcel|x-ms-excel|x-excel|x-dos_ms_excel|xls|x-xls|vnd\.openxmlformats-officedocument\.spreadsheetml\.sheet)$/;
export const textMimeTypes =
/^(text\/(x-c|x-csharp|tab-separated-values|x-c\+\+|x-h|x-java|html|markdown|x-php|x-python|x-script\.python|x-ruby|x-tex|plain|css|vtt|javascript|csv|xml))$/;
/^(text\/(x-c|x-csharp|tab-separated-values|x-c\+\+|x-h|x-java|html|markdown|x-php|x-python|x-script\.python|x-ruby|x-tex|plain|css|vtt|javascript|csv|xml|calendar))$/;
export const applicationMimeTypes =
/^(application\/(epub\+zip|csv|json|msword|pdf|x-tar|x-sh|typescript|sql|yaml|x-parquet|vnd\.apache\.parquet|vnd\.coffeescript|vnd\.openxmlformats-officedocument\.(wordprocessingml\.document|presentationml\.presentation|spreadsheetml\.sheet)|vnd\.oasis\.opendocument\.(text|spreadsheet|presentation|graphics)|xml|zip))$/;
@ -351,6 +353,10 @@ export const codeTypeMapping: { [key: string]: string } = {
ods: 'application/vnd.oasis.opendocument.spreadsheet', // .ods - OpenDocument Spreadsheet
odp: 'application/vnd.oasis.opendocument.presentation', // .odp - OpenDocument Presentation
odg: 'application/vnd.oasis.opendocument.graphics', // .odg - OpenDocument Graphics
ics: 'text/calendar', // .ics - iCalendar
ical: 'text/calendar', // .ical - iCalendar
ifb: 'text/calendar', // .ifb - iCalendar free/busy
icalendar: 'text/calendar', // .icalendar - iCalendar
};
/** Maps image extensions to MIME types for formats browsers may not recognize */