Skip to content

@chat-js/cli@0.3.0

Latest

Choose a tag to compare

@github-actions github-actions released this 01 Mar 21:47
· 6 commits to main since this release
9765686

Minor Changes

  • #94 2a8a7cc Thanks @FranciscoMoretti! - ## Config defaults & defineConfig helper

    New features

    • defineConfig() helper — new type-safe wrapper for chat.config.ts. The gateway type is inferred from ai.gateway, so autocomplete and type errors are scoped to the model IDs available in the chosen gateway. Replace satisfies ConfigInput with defineConfig({...}).
    • Gateway-specific defaults — all AI config fields (models, tools, workflows) are now optional. Omitted fields are automatically filled from per-gateway defaults at runtime via applyDefaults(). Only ai.gateway is required.
    • chatjs config CLI command — new command that prints the fully-resolved configuration for the current project, applying all defaults. Useful for debugging and verifying your setup.
    • Separate defaults per gatewayvercel, openrouter, openai, and openai-compatible each have their own typed defaults (ModelDefaultsFor<G>), ensuring model IDs are validated against the correct gateway's model registry.
    • Stricter image/video tool schemastools.image and tools.video now use a discriminated union: enabled: true requires a default model, while enabled: false makes it optional.

    Breaking changes

    None — existing configs using satisfies ConfigInput continue to work. Migrating to defineConfig() is recommended for better DX but not required.