Verentis

File types & MIME

File types & the MIME registry

How Verentis determines a file's type, and how your manifest extends the registry with new extensions and custom content types.

Resolution — which app opens a file, which engine runs it — depends entirely on a file's type. Verentis determines type through a manifest-driven registry, and your extension can extend it.

Why type matters

  • Apps resolve by MIME type (image/png, application/json, text/*).
  • Engines resolve by file type / extension (.py, .csv, .echo).

If a file's type is wrong or unknown, the right extension won't be offered. Declaring types accurately in your manifest is therefore part of the contract.

The registry is extensible, not hardcoded

Verentis does not rely on a fixed, built-in switch of extensions. A generic helper covers common, intrinsic types, but the authoritative, extensible source is the manifest registry:

Engine manifests declare extensions → MIME

An engine's spec.file-types maps extensions to a MIME type, e.g. .pytext/x-python. This is how the registry learns to identify files an engine cares about.

App manifests declare content → custom MIME

An app's spec.mime-types (and spec.entry-points[].mime-types) declare which content types it handles, and can pair a pattern with a JSON Schema to recognise structured/custom vendor content types.

So engine, app and even vendor-specific content types all become first-class once they're declared in a manifest — no platform change required.

Declaring extensions (engines)

spec:
  file-types:
    - pattern: text/x-python      # the MIME type assigned to matching files
      extensions: [".py"]         # each with a leading dot
      priority: 100               # higher wins when rules overlap
patternstring

The MIME type assigned to files matching one of extensions.

extensionsstring[]

The file extensions this rule matches, each including the leading dot (e.g. .py).

priorityint

When several rules match the same extension, the highest priority wins.

Declaring content types (apps)

spec:
  mime-types:
    - pattern: application/json   # exact match, higher priority
      mode: edit
      priority: 200
    - pattern: "text/*"           # wildcard, lower priority
      mode: edit
      priority: 100

Use exact patterns at higher priority and wildcards at lower priority so the most specific app wins. For custom/vendor content, attach a json-schema to the mime-type so the registry can recognise the shape of the content, not just its extension — see the app manifest reference.

Priority & precedence

When several extensions could match the same file, Verentis picks the highest priority rule. Keep your priorities sensible:

  • Reserve high priorities (e.g. 200+) for exact, specific matches you're confident about.
  • Use lower priorities (e.g. 100) for broad wildcards.

Think of it as "most specific wins": an app that exactly claims application/json should outrank one that broadly claims text/*.

Next

Building apps

See how MIME and content-type registration works end to end for an app.