Skip to content

Add capability registry, pipeline-driven adapters, and expanded format matrix#1

Merged
gamerg21 merged 1 commit into
mainfrom
codex/plan-extensions-for-convertr-format-support
Feb 26, 2026
Merged

Add capability registry, pipeline-driven adapters, and expanded format matrix#1
gamerg21 merged 1 commit into
mainfrom
codex/plan-extensions-for-convertr-format-support

Conversation

@gamerg21

Copy link
Copy Markdown
Owner

Motivation

  • Introduce a capability-driven conversion substrate to make format support explicit and pipeline-aware for phased expansion beyond images.
  • Prepare for multiple external tool adapters (FFmpeg, LibreOffice, Pandoc, Calibre, archive tooling) while keeping current image conversions stable.
  • Expand the shared format matrix to cover audio, video, document, spreadsheet, presentation, ebook, and archive categories.

Description

  • Add a capability registry (packages/conversion-engine/src/capabilities.ts) that maps source/target pairs to a pipeline (sharp|ffmpeg|libreoffice|pandoc|calibre|archive) and export findCapability and capabilityRegistry.
  • Introduce ExternalToolAdapter (packages/conversion-engine/src/adapters/externalToolAdapter.ts) as a placeholder adapter that reports planned but unconfigured pipelines and displayNames for nicer errors.
  • Update BasicAdapter to consult the capability registry via findCapability, tighten Sharp output checks, surface an errorCode on failures, and standardize metadata/pipeline reporting.
  • Wire multiple adapters into the engine (packages/conversion-engine/src/index.ts), add findAdapter, and make executeConversion validate capabilities and return UNSUPPORTED_PAIR or TOOLING_UNAVAILABLE with contextual messages.
  • Expand and densify the shared formatMatrix (packages/shared/src/formats.ts) to include broad audio, video, document, spreadsheet, presentation, ebook, and archive formats and add getCategoryForInput.
  • Introduce typed error codes in types.ts and export new capabilities from the engine package, and add a new design doc docs/format-expansion-plan.md describing the roadmap and phases.

Testing

  • Ran node:test unit tests in packages/conversion-engine and packages/shared, including index.test.ts and formats.test.ts, which validate adapter discovery (findAdapter('png','jpg')), capability resolution (findCapability('mp4','mp3')), tooling-unavailable behavior for planned adapters, unsupported-pair rejection, and new format matrix assertions; all tests passed.
  • Adapter-level assertions confirm TOOLING_UNAVAILABLE is returned for planned non-image adapters and UNSUPPORTED_PAIR is returned when no capability exists.

Codex Task

@gamerg21 gamerg21 merged commit 9ab31e4 into main Feb 26, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant