Studio reads ModuleInfoResponse.accepts_mime through gRPC and uses it as the OS file-picker filter. Declaring the exact MIME list the module accepts (application/pdf, application/x-pdf, the long DOCX one) prevents the "unsupported MIME type" rejection the operator used to hit when picking a PNG by mistake. Same list the inline comment next to `inputs.document` already documented — now machine-readable. Signed-off-by: flemming-it <sf@flemming.it>
41 lines
1.3 KiB
YAML
41 lines
1.3 KiB
YAML
schema_version: 1
|
|
name: text-extract
|
|
version: 0.1.0
|
|
|
|
# Capability provided by this module.
|
|
provides:
|
|
- capability: text.extract
|
|
version: 0.1.0
|
|
|
|
# Inputs the invoke function accepts.
|
|
inputs:
|
|
# The document to extract text from. Supported MIME types:
|
|
# application/pdf
|
|
# application/x-pdf
|
|
# application/vnd.openxmlformats-officedocument.wordprocessingml.document
|
|
document: bytes
|
|
|
|
# Outputs produced.
|
|
outputs:
|
|
# JSON-encoded ExtractedDocument:
|
|
# { engine, engine_version, pages: [{number, text, confidence?, bbox?}] }
|
|
# confidence and bbox are reserved for a future service-mode variant
|
|
# (pdfium / mupdf via host services). v0.1.0 omits them.
|
|
extracted: json
|
|
|
|
# Permissions required.
|
|
#
|
|
# v0.1.0 runs entirely in-WASM with pure-Rust crates (pdf-extract,
|
|
# zip, quick-xml). No filesystem, no network. The empty list makes
|
|
# this explicit; the hub enforces it.
|
|
permissions: []
|
|
|
|
# MIME-type allow-list for the `document` input. Studio reads this
|
|
# through ModuleInfoResponse.accepts_mime and uses it as the OS
|
|
# file-picker filter so operators don't accidentally pick a `.png`
|
|
# for a PDF-extract step. Same list documented inline next to
|
|
# `inputs.document` above; kept synchronised by hand for now.
|
|
accepts_mime:
|
|
- application/pdf
|
|
- application/x-pdf
|
|
- application/vnd.openxmlformats-officedocument.wordprocessingml.document
|