Skip to content

feat: return Typst source files (.typ) from the sandbox - #415

Open
Odrec wants to merge 1 commit into
LibreChat-AI:mainfrom
Odrec:feat/typst-output-files
Open

Odrec wants to merge 1 commit into
LibreChat-AI:mainfrom
Odrec:feat/typst-output-files

Conversation

@Odrec

@Odrec Odrec commented Dec 3, 2026

Copy link
Copy Markdown

Summary

Typst is a common way to draw figures and typeset documents from code (typst-py compiles it inside the Python runtime), and its source files use the .typ extension. That extension is in neither output allowlist, so a .typ file a job writes is dropped without an error: it never reaches the caller and is not kept for the next call. An agent that edits its Typst source across calls finds the file gone each time.

This adds .typ to:

  • SUPPORTED_EXTENSIONS in api/src/job.ts
  • BRIDGE_ARTIFACT_EXTENSIONS in packages/code/src/protocol.ts
  • both MIME tables, as text/plain (like .ini and .conf), so it is not served as application/octet-stream

protocol.test.ts gets two asserts for the bridge policy and media type. The same change, applied as a patch to v1.10.13, returns .typ files through /v1/exec on a self-hosted KVM deployment.

#412 would make the allowlist configurable per deployment. This PR is independent of it: it only extends the built-in default.

🤖 Generated with Claude Code

Typst (typst.app, typst-py) is a common way to draw figures and typeset
documents from code, and its source files use the .typ extension. That
extension is in neither output allowlist, so a .typ file a job writes is
dropped silently: it never reaches the caller and is not kept for the next
call.

Add .typ to SUPPORTED_EXTENSIONS and BRIDGE_ARTIFACT_EXTENSIONS, and map it to
text/plain in both MIME tables (like .ini and .conf), so it is not served as
application/octet-stream.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant