mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-22 08:57:16 +00:00
Add an optional 'data' field ({name, content}) to the create_file agent tool
so agents can create files without a local file (e.g. when bash is not
available). The existing 'path' upload mode is preserved; exactly one of
'path' or 'data' must be provided.
Extract mime detection helpers (getFileMimeType, readFileMimeType) into a
new file-mime module, keeping utils/mime.ts free of fs/path imports so it
stays compatible with the Temporal workflow bundle (agent-autofill imports
getProxyType from it). Refactor create_version to reuse the extracted
helpers.
Content uploads reuse s3Service.putObject; mime type is derived from the
filename extension with a text/plain fallback, and the name is sanitized
for the S3 key.