chat-js 1.0.0-alpha.5 → 1.0.0-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +3 -3
  2. package/dist/index.js +21864 -21965
  3. package/package.json +1 -2
  4. package/templates/chat-app/app/(chat)/layout.tsx +8 -20
  5. package/templates/chat-app/chatjs/core/gateway/defaults.ts +43 -0
  6. package/templates/chat-app/chatjs/core/gateway/gateway-provider.ts +23 -0
  7. package/templates/chat-app/chatjs/core/gateway/models.test.ts +39 -0
  8. package/templates/chat-app/chatjs/core/gateway/models.ts +67 -0
  9. package/templates/chat-app/chatjs/core/gateway/provider-types.ts +11 -0
  10. package/templates/chat-app/chatjs/core/gateway/runtime.test.ts +30 -0
  11. package/templates/chat-app/chatjs/core/gateway/runtime.ts +62 -0
  12. package/templates/chat-app/chatjs/plugins/guest-chat/guest-policy.ts +1 -0
  13. package/templates/chat-app/chatjs/plugins/guest-chat/signed-out.tsx +14 -2
  14. package/templates/chat-app/chatjs/plugins/mcp/routes/oauth-callback.ts +27 -26
  15. package/templates/chat-app/chatjs/plugins/model-preferences/settings-link.tsx +1 -2
  16. package/templates/chat-app/chatjs/providers/gateway-defaults.ts +1 -1
  17. package/templates/chat-app/chatjs/providers/gateway.ts +47 -26
  18. package/templates/chat-app/chatjs/tools/attach-workspace-file/schemas.ts +13 -2
  19. package/templates/chat-app/components/eve/eve-model-picker.tsx +3 -0
  20. package/templates/chat-app/components/model-selector-view.tsx +8 -15
  21. package/templates/chat-app/components/model-selector.tsx +1 -0
  22. package/templates/chat-app/integrations/chat/model-options.ts +75 -0
  23. package/templates/chat-app/integrations/chat/models.ts +3 -8
  24. package/templates/chat-app/lib/ai/app-models.test.ts +41 -46
  25. package/templates/chat-app/lib/ai/app-models.ts +4 -154
  26. package/templates/chat-app/lib/ai/gateways/fallback-models.ts +1 -1
  27. package/templates/chat-app/lib/ai/gateways/registry.ts +2 -2
  28. package/templates/chat-app/lib/ai/models.generated.ts +1 -1
  29. package/templates/chat-app/lib/ai/models.ts +1 -1
  30. package/templates/chat-app/lib/ai/to-model-data.test.ts +1 -1
  31. package/templates/chat-app/lib/ai/to-model-data.ts +1 -1
  32. package/templates/chat-app/lib/ai/web-chat-models.ts +70 -0
  33. package/templates/chat-app/lib/config-schema.ts +1 -1
  34. package/templates/chat-app/lib/eve/application-model.ts +17 -5
  35. package/templates/chat-app/lib/eve/model-selection.test.ts +6 -0
  36. package/templates/chat-app/lib/eve/model-selection.ts +41 -7
  37. package/templates/chat-app/lib/eve/tool-cost.ts +1 -1
  38. package/templates/chat-app/next.config.ts +0 -1
  39. package/templates/chat-app/package.json +1 -2
  40. package/templates/chat-app/providers/chat-models-provider.tsx +1 -2
  41. package/templates/chat-app/scripts/fetch-models.ts +1 -1
  42. package/templates/electron/src/config.ts +7 -23
  43. package/templates/electron/src/lib/auth-client.ts +3 -4
  44. package/templates/electron/src/startup-config.test.ts +133 -0
package/README.md CHANGED
@@ -26,7 +26,7 @@ chat-js create my-chat --gateway https://example.com/r/acme-gateway.json
26
26
  chat-js create my-chat --gateway ./acme-gateway.json
27
27
  ```
28
28
 
29
- The CLI installs only that item's adapter files and declared dependencies. `@chat-js/gateways` supplies shared contracts and utilities, with no gateway implementations. Third-party items declare their own ID, defaults, capabilities, and credentials; the CLI has no fixed gateway enum. See [gateway authoring](https://github.com/FranciscoMoretti/chat-js/blob/main/packages/registry/src/gateways/README.md) for the version 1 contract.
29
+ The CLI installs only that item's adapter files and declared dependencies. Generated apps include the shared gateway contracts and utilities in `chatjs/core/gateway/`. Third-party items declare their own ID, defaults, capabilities, and credentials; the CLI has no fixed gateway enum. See [gateway authoring](https://github.com/FranciscoMoretti/chat-js/blob/main/packages/registry/src/gateways/README.md) for the version 1 contract.
30
30
 
31
31
  Run `bun --filter chat-js test:gateways` from the repository root to verify independent installs of all built-ins and an external registry gateway.
32
32
 
@@ -34,7 +34,7 @@ After publication, run `bun --filter chat-js test:published` to create an app us
34
34
 
35
35
  ## Installation and migration
36
36
 
37
- The `1.0.0-alpha.5` release continues the ChatJS 1.0 alpha series under the `chat-js` package name. Apps are usable, but APIs and generated source may change substantially before 1.0. Use `npx chat-js@alpha` for the examples below. This CLI supports Base UI and Radix with registry `0.2.0-beta.6`.
37
+ The `1.0.0-alpha.7` release continues the ChatJS 1.0 alpha series under the `chat-js` package name. Apps are usable, but APIs and generated source may change substantially before 1.0. Use `npx chat-js@alpha` for the examples below. This CLI supports Base UI and Radix with registry `0.2.0-beta.8`.
38
38
 
39
39
  Pass native shadcn visual options after `--`:
40
40
 
@@ -75,7 +75,7 @@ Existing ChatJS applications need a source migration; upgrading the CLI does not
75
75
 
76
76
  Migrate callers together with primitives. Base UI menu actions use `onClick` and custom triggers use `render`; Radix uses `onSelect` and `asChild`. Passing Radix `onSelect` to a Base UI menu may compile without running the action. Use each library's native composition and ordinary links styled with `buttonVariants` for navigation. Preserve EVE message IDs, scroll anchoring, draft/IME behavior, approval dispatch before specialized renderers, and document revision actions. Verify these flows in your app before removing the old wrappers. Markdown still uses Streamdown; tool-specific renderers remain installed source.
77
77
 
78
- This CLI candidate pins new apps to `@chat-js/registry@0.2.0-beta.6`. Matching registry builds preserve the root Base namespace and add complete `/base/{name}.json` and `/radix/{name}.json` namespaces. Fresh Radix generation selects `/radix/`; item IDs and installation targets remain the same. Subsequent `add` and `sync` retain the configured namespace and check the host's native `base-*` or `radix-*` style before writing source or registrations.
78
+ This CLI candidate pins new apps to `@chat-js/registry@0.2.0-beta.8`. Matching registry builds preserve the root Base namespace and add complete `/base/{name}.json` and `/radix/{name}.json` namespaces. Fresh Radix generation selects `/radix/`; item IDs and installation targets remain the same. Subsequent `add` and `sync` retain the configured namespace and check the host's native `base-*` or `radix-*` style before writing source or registrations.
79
79
 
80
80
  UI-specific plugins and tools declare descriptor `contractVersion: 2` with matching `uiBase: "base"` or `uiBase: "radix"`. A mismatch stops installation; v2 descriptor versions do not prescribe npm major versions. Legacy v1 descriptors remain supported. Existing applications are not automatically migrated between libraries: changing `components.json` or a registry URL alone is insufficient. Keep the compatible registry namespace until migrating primitives and callers together. Publish the matching registry candidate under `beta` before publishing the CLI under `alpha`. The CLI’s `latest` tag also points to the explicitly approved `1.0.0-alpha.2` as an explicit default-install policy; the version remains an alpha until the stable 1.0 launch.
81
81