Loading workspace insights... Statistics interval
7 days30 daysLatest CI Pipeline Executions
6c29fef3 feat: Introduce fal.ai adapter for image and video generation (#237)
* feat: Introduce fal.ai adapter for image and video generation
Add @tanstack/ai-fal package with:
- Image adapter supporting 600+ fal.ai models with full type inference
- Video adapter (experimental) for MiniMax, Luma, Kling, Hunyuan, etc.
- Type-safe modelOptions using fal's EndpointTypeMap for autocomplete
- FalModel, FalModelInput, FalModelOutput utility types
- FalImageProviderOptions/FalVideoProviderOptions that exclude fields
TanStack AI handles (prompt, size, etc.)
- Size preset mapping utilities for fal.ai format
- Comprehensive test coverage for both adapters
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Remove settings.local.json from commits. Only settings.json should be commited
* Use the api key from the config in preference to env
* Moved @tanstack/ai just to peerDependencies.
* Corrected package version, typescript types
* ci: apply automated fixes
* fix up the PR
* Add fetch fal models and compare scripts to show what is out of sync. Also logged a ticket with fal
* Corrected comments and linting issues
* feat(ai-fal): implement fal.ai adapter with OpenAPI schema generation
- Add OpenAPI TypeScript generation for fal.ai models
- Implement tree-shakeable image and video adapters
- Generate type-safe schemas for multiple model categories (text-to-image, image-to-video, etc.)
- Add scripts to sync OpenAPI schemas from fal.ai API
- Configure ESLint and TypeScript for generated code
- Move fal model sync scripts to package-specific directory
- Update model metadata with comprehensive fal.ai model support
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* Updated scripts to use heyapi
* Correct lint issues
* Updated script to use heyapi to generate types and zod schema
* Refactor fal.ai scripts and update package.json
- Removed deprecated OpenAPI generation script and updated the `generate:fal` script to fetch models before generating types and maps.
- Deleted unused `fal-endpoint-mapping.json` and `fal.models.json` files to streamline the project.
- Introduced new endpoint map files for various model categories, ensuring type safety and consistency in schema generation.
- Enhanced the `generate-fal-endpoint-maps.ts` script to improve category processing and output structure.
* fix(ai-fal): simplify endpoint map generation by deriving output types from input types
Changed the endpoint map generation script to derive output types directly from input types (replacing "Input" suffix with "Output") instead of parsing complex GET response type definitions with regex. This eliminates all warnings caused by inconsistent formatting in generated type files.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* fix(ai-fal): improve generated endpoint maps with proper types and formatting
- Fix ESLint import/no-duplicates error by combining imports from './index'
- Add Zod schema type annotations to all SchemaMap constants
- Use specific union types (FalImageModel, FalTextModel, etc.) instead of string in combined schema maps
- Add Prettier formatting to all generated files
- Reorder Model type definition before SchemaMap (since SchemaMap references it)
- Remove unused postTypeName variable
All generated files now pass ESLint and TypeScript checks with proper type safety.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* Updated image and video to use the new types
* refactor(ai-fal): update file paths and improve directory handling in scripts
- Refactored file path handling in compare-fal-models.ts and fetch-fal-models.ts to use __dirname for better compatibility with module types.
- Ensured the scripts directory is created if it doesn't exist.
- Cleaned up import statements in various files for consistency and clarity.
- Enhanced type imports in generated index.ts to reflect the new structure of endpoint maps.
These changes improve the maintainability and reliability of the scripts.
* refactor(ai-fal): consolidate categories and add file upload type transforms
- Consolidate input/output categories (e.g., text-to-image + image-to-image → image)
- Add x-fal-file-input extension to mark URL fields for Blob/File uploads
- Add TypeScript typeTransformer to generate string | Blob | File unions
- Add Zod resolver for file input fields and format:binary output fields
- Update endpoint map generation for new category structure
- Remove deprecated fetch/compare scripts from root package.json
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* refactor(ai-fal): update file data types to string across schemas
- Changed file_data type from Blob | File to string in various schema definitions for consistency.
- Updated Zod schemas to reflect the new string type for file_data.
- Adjusted input and output schemas across multiple categories to ensure type uniformity.
These changes enhance type safety and simplify handling of file data in the application.
* Removed openapi stuff
* Corrected image generation and simplified to make use of image size types
* Corrected and simplified video adapter
* Updated image gen options
* Add fal example app
* Uses model options to remain type safe
* Corrected some model options
* Resolved code rabbit suggestions
* Remove json flles we no longer use
* Reformatted openrouter file I shouldn't have modifed
* Removed files we no longer use from gitignore
* Updated lock
* Updated to fal 1.9
* Corrected tests and packages
* Figured out how to do the template strings for sizes
* Thread size type through ImageGenerationOptions to adapters
Add TSize generic to ImageGenerationOptions so model-specific size
narrowing flows from generateImage() through to the adapter interface.
The adapter computes TSize from its TModelSizeByName generic via a
SizeForModel helper, and uses method syntax for bivariance so concrete
adapters remain compatible without signature changes.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Refactor fal adapter API to use core generateImage/generateVideo functions
Rename createFalImage/createFalVideo to falImage/falVideo for consistency with other adapters. Update example and tests to call the core generateImage() and generateVideo() functions instead of adapter methods directly. Thread size types through adapter generics, implement mapSizeToFalFormat for aspect_ratio/resolution parsing, simplify adapter type hierarchy by removing SizeForModel indirection, and add TModelProviderOptionsByName generic to VideoAdapter for per-model type safety. Move API key validation into configureFalClient for consistent initialization.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Add modelSizeByName to VideoAdapter alongside modelProviderOptionsByName
Thread TSize generic through VideoGenerationOptions and VideoAdapter to
enable type-safe size parameters per model. Add FalModelVideoSize type
extraction and mapVideoSizeToFalFormat helper for converting combined
"aspect_ratio_resolution" strings to fal.ai input format. Update OpenAI
video adapter to pass both provider options and size maps.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Corrected test issues
* Uploading lock
* ci: apply automated fixes
* Remove declarationMap as source not included
* Corrected formatting
* Created docs
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Alem Tuzlak <t.zlak@hotmail.com> 6c29fef3 feat: Introduce fal.ai adapter for image and video generation (#237)
* feat: Introduce fal.ai adapter for image and video generation
Add @tanstack/ai-fal package with:
- Image adapter supporting 600+ fal.ai models with full type inference
- Video adapter (experimental) for MiniMax, Luma, Kling, Hunyuan, etc.
- Type-safe modelOptions using fal's EndpointTypeMap for autocomplete
- FalModel, FalModelInput, FalModelOutput utility types
- FalImageProviderOptions/FalVideoProviderOptions that exclude fields
TanStack AI handles (prompt, size, etc.)
- Size preset mapping utilities for fal.ai format
- Comprehensive test coverage for both adapters
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Remove settings.local.json from commits. Only settings.json should be commited
* Use the api key from the config in preference to env
* Moved @tanstack/ai just to peerDependencies.
* Corrected package version, typescript types
* ci: apply automated fixes
* fix up the PR
* Add fetch fal models and compare scripts to show what is out of sync. Also logged a ticket with fal
* Corrected comments and linting issues
* feat(ai-fal): implement fal.ai adapter with OpenAPI schema generation
- Add OpenAPI TypeScript generation for fal.ai models
- Implement tree-shakeable image and video adapters
- Generate type-safe schemas for multiple model categories (text-to-image, image-to-video, etc.)
- Add scripts to sync OpenAPI schemas from fal.ai API
- Configure ESLint and TypeScript for generated code
- Move fal model sync scripts to package-specific directory
- Update model metadata with comprehensive fal.ai model support
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* Updated scripts to use heyapi
* Correct lint issues
* Updated script to use heyapi to generate types and zod schema
* Refactor fal.ai scripts and update package.json
- Removed deprecated OpenAPI generation script and updated the `generate:fal` script to fetch models before generating types and maps.
- Deleted unused `fal-endpoint-mapping.json` and `fal.models.json` files to streamline the project.
- Introduced new endpoint map files for various model categories, ensuring type safety and consistency in schema generation.
- Enhanced the `generate-fal-endpoint-maps.ts` script to improve category processing and output structure.
* fix(ai-fal): simplify endpoint map generation by deriving output types from input types
Changed the endpoint map generation script to derive output types directly from input types (replacing "Input" suffix with "Output") instead of parsing complex GET response type definitions with regex. This eliminates all warnings caused by inconsistent formatting in generated type files.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* fix(ai-fal): improve generated endpoint maps with proper types and formatting
- Fix ESLint import/no-duplicates error by combining imports from './index'
- Add Zod schema type annotations to all SchemaMap constants
- Use specific union types (FalImageModel, FalTextModel, etc.) instead of string in combined schema maps
- Add Prettier formatting to all generated files
- Reorder Model type definition before SchemaMap (since SchemaMap references it)
- Remove unused postTypeName variable
All generated files now pass ESLint and TypeScript checks with proper type safety.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* Updated image and video to use the new types
* refactor(ai-fal): update file paths and improve directory handling in scripts
- Refactored file path handling in compare-fal-models.ts and fetch-fal-models.ts to use __dirname for better compatibility with module types.
- Ensured the scripts directory is created if it doesn't exist.
- Cleaned up import statements in various files for consistency and clarity.
- Enhanced type imports in generated index.ts to reflect the new structure of endpoint maps.
These changes improve the maintainability and reliability of the scripts.
* refactor(ai-fal): consolidate categories and add file upload type transforms
- Consolidate input/output categories (e.g., text-to-image + image-to-image → image)
- Add x-fal-file-input extension to mark URL fields for Blob/File uploads
- Add TypeScript typeTransformer to generate string | Blob | File unions
- Add Zod resolver for file input fields and format:binary output fields
- Update endpoint map generation for new category structure
- Remove deprecated fetch/compare scripts from root package.json
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* refactor(ai-fal): update file data types to string across schemas
- Changed file_data type from Blob | File to string in various schema definitions for consistency.
- Updated Zod schemas to reflect the new string type for file_data.
- Adjusted input and output schemas across multiple categories to ensure type uniformity.
These changes enhance type safety and simplify handling of file data in the application.
* Removed openapi stuff
* Corrected image generation and simplified to make use of image size types
* Corrected and simplified video adapter
* Updated image gen options
* Add fal example app
* Uses model options to remain type safe
* Corrected some model options
* Resolved code rabbit suggestions
* Remove json flles we no longer use
* Reformatted openrouter file I shouldn't have modifed
* Removed files we no longer use from gitignore
* Updated lock
* Updated to fal 1.9
* Corrected tests and packages
* Figured out how to do the template strings for sizes
* Thread size type through ImageGenerationOptions to adapters
Add TSize generic to ImageGenerationOptions so model-specific size
narrowing flows from generateImage() through to the adapter interface.
The adapter computes TSize from its TModelSizeByName generic via a
SizeForModel helper, and uses method syntax for bivariance so concrete
adapters remain compatible without signature changes.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Refactor fal adapter API to use core generateImage/generateVideo functions
Rename createFalImage/createFalVideo to falImage/falVideo for consistency with other adapters. Update example and tests to call the core generateImage() and generateVideo() functions instead of adapter methods directly. Thread size types through adapter generics, implement mapSizeToFalFormat for aspect_ratio/resolution parsing, simplify adapter type hierarchy by removing SizeForModel indirection, and add TModelProviderOptionsByName generic to VideoAdapter for per-model type safety. Move API key validation into configureFalClient for consistent initialization.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Add modelSizeByName to VideoAdapter alongside modelProviderOptionsByName
Thread TSize generic through VideoGenerationOptions and VideoAdapter to
enable type-safe size parameters per model. Add FalModelVideoSize type
extraction and mapVideoSizeToFalFormat helper for converting combined
"aspect_ratio_resolution" strings to fal.ai input format. Update OpenAI
video adapter to pass both provider options and size maps.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Corrected test issues
* Uploading lock
* ci: apply automated fixes
* Remove declarationMap as source not included
* Corrected formatting
* Created docs
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Alem Tuzlak <t.zlak@hotmail.com> 6c29fef3 feat: Introduce fal.ai adapter for image and video generation (#237)
* feat: Introduce fal.ai adapter for image and video generation
Add @tanstack/ai-fal package with:
- Image adapter supporting 600+ fal.ai models with full type inference
- Video adapter (experimental) for MiniMax, Luma, Kling, Hunyuan, etc.
- Type-safe modelOptions using fal's EndpointTypeMap for autocomplete
- FalModel, FalModelInput, FalModelOutput utility types
- FalImageProviderOptions/FalVideoProviderOptions that exclude fields
TanStack AI handles (prompt, size, etc.)
- Size preset mapping utilities for fal.ai format
- Comprehensive test coverage for both adapters
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Remove settings.local.json from commits. Only settings.json should be commited
* Use the api key from the config in preference to env
* Moved @tanstack/ai just to peerDependencies.
* Corrected package version, typescript types
* ci: apply automated fixes
* fix up the PR
* Add fetch fal models and compare scripts to show what is out of sync. Also logged a ticket with fal
* Corrected comments and linting issues
* feat(ai-fal): implement fal.ai adapter with OpenAPI schema generation
- Add OpenAPI TypeScript generation for fal.ai models
- Implement tree-shakeable image and video adapters
- Generate type-safe schemas for multiple model categories (text-to-image, image-to-video, etc.)
- Add scripts to sync OpenAPI schemas from fal.ai API
- Configure ESLint and TypeScript for generated code
- Move fal model sync scripts to package-specific directory
- Update model metadata with comprehensive fal.ai model support
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* Updated scripts to use heyapi
* Correct lint issues
* Updated script to use heyapi to generate types and zod schema
* Refactor fal.ai scripts and update package.json
- Removed deprecated OpenAPI generation script and updated the `generate:fal` script to fetch models before generating types and maps.
- Deleted unused `fal-endpoint-mapping.json` and `fal.models.json` files to streamline the project.
- Introduced new endpoint map files for various model categories, ensuring type safety and consistency in schema generation.
- Enhanced the `generate-fal-endpoint-maps.ts` script to improve category processing and output structure.
* fix(ai-fal): simplify endpoint map generation by deriving output types from input types
Changed the endpoint map generation script to derive output types directly from input types (replacing "Input" suffix with "Output") instead of parsing complex GET response type definitions with regex. This eliminates all warnings caused by inconsistent formatting in generated type files.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* fix(ai-fal): improve generated endpoint maps with proper types and formatting
- Fix ESLint import/no-duplicates error by combining imports from './index'
- Add Zod schema type annotations to all SchemaMap constants
- Use specific union types (FalImageModel, FalTextModel, etc.) instead of string in combined schema maps
- Add Prettier formatting to all generated files
- Reorder Model type definition before SchemaMap (since SchemaMap references it)
- Remove unused postTypeName variable
All generated files now pass ESLint and TypeScript checks with proper type safety.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* Updated image and video to use the new types
* refactor(ai-fal): update file paths and improve directory handling in scripts
- Refactored file path handling in compare-fal-models.ts and fetch-fal-models.ts to use __dirname for better compatibility with module types.
- Ensured the scripts directory is created if it doesn't exist.
- Cleaned up import statements in various files for consistency and clarity.
- Enhanced type imports in generated index.ts to reflect the new structure of endpoint maps.
These changes improve the maintainability and reliability of the scripts.
* refactor(ai-fal): consolidate categories and add file upload type transforms
- Consolidate input/output categories (e.g., text-to-image + image-to-image → image)
- Add x-fal-file-input extension to mark URL fields for Blob/File uploads
- Add TypeScript typeTransformer to generate string | Blob | File unions
- Add Zod resolver for file input fields and format:binary output fields
- Update endpoint map generation for new category structure
- Remove deprecated fetch/compare scripts from root package.json
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* refactor(ai-fal): update file data types to string across schemas
- Changed file_data type from Blob | File to string in various schema definitions for consistency.
- Updated Zod schemas to reflect the new string type for file_data.
- Adjusted input and output schemas across multiple categories to ensure type uniformity.
These changes enhance type safety and simplify handling of file data in the application.
* Removed openapi stuff
* Corrected image generation and simplified to make use of image size types
* Corrected and simplified video adapter
* Updated image gen options
* Add fal example app
* Uses model options to remain type safe
* Corrected some model options
* Resolved code rabbit suggestions
* Remove json flles we no longer use
* Reformatted openrouter file I shouldn't have modifed
* Removed files we no longer use from gitignore
* Updated lock
* Updated to fal 1.9
* Corrected tests and packages
* Figured out how to do the template strings for sizes
* Thread size type through ImageGenerationOptions to adapters
Add TSize generic to ImageGenerationOptions so model-specific size
narrowing flows from generateImage() through to the adapter interface.
The adapter computes TSize from its TModelSizeByName generic via a
SizeForModel helper, and uses method syntax for bivariance so concrete
adapters remain compatible without signature changes.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Refactor fal adapter API to use core generateImage/generateVideo functions
Rename createFalImage/createFalVideo to falImage/falVideo for consistency with other adapters. Update example and tests to call the core generateImage() and generateVideo() functions instead of adapter methods directly. Thread size types through adapter generics, implement mapSizeToFalFormat for aspect_ratio/resolution parsing, simplify adapter type hierarchy by removing SizeForModel indirection, and add TModelProviderOptionsByName generic to VideoAdapter for per-model type safety. Move API key validation into configureFalClient for consistent initialization.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Add modelSizeByName to VideoAdapter alongside modelProviderOptionsByName
Thread TSize generic through VideoGenerationOptions and VideoAdapter to
enable type-safe size parameters per model. Add FalModelVideoSize type
extraction and mapVideoSizeToFalFormat helper for converting combined
"aspect_ratio_resolution" strings to fal.ai input format. Update OpenAI
video adapter to pass both provider options and size maps.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Corrected test issues
* Uploading lock
* ci: apply automated fixes
* Remove declarationMap as source not included
* Corrected formatting
* Created docs
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Alem Tuzlak <t.zlak@hotmail.com>