@kwirthmagnify/kwirth-common-ai 0.5.30 → 0.5.32

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 (2) hide show
  1. package/dist/front.js +11 -0
  2. package/package.json +1 -1
package/dist/front.js CHANGED
@@ -85,6 +85,13 @@ const AiConfigLlm = (props) => {
85
85
  const [key, setKey] = (0, react_1.useState)('');
86
86
  const [inputCostPerMillion, setInputCostPerMillion] = (0, react_1.useState)(0);
87
87
  const [outputCostPerMillion, setOutputCostPerMillion] = (0, react_1.useState)(0);
88
+ // Re-sincroniza el estado cuando llegan los modelos async (mismo fix de race que AiConfigProvider): al abrir,
89
+ // el padre monta el diálogo con props.llms vacío y los pide por WS; sin esto, la lista quedaba vacía hasta
90
+ // cerrar/reabrir.
91
+ (0, react_1.useEffect)(() => {
92
+ setLlms(JSON.parse(JSON.stringify(props.llms)));
93
+ setSelectedIndex(null);
94
+ }, [props.llms]);
88
95
  const onLlmSelected = (index) => {
89
96
  var _a, _b;
90
97
  const l = llms[index];
@@ -192,6 +199,10 @@ const AiConfigProvider = (props) => {
192
199
  const importProvRef = (0, react_1.useRef)(null);
193
200
  const [selectedIndex, setSelectedIndex] = (0, react_1.useState)(null);
194
201
  const [showPassword, setShowPassword] = (0, react_1.useState)(false);
202
+ (0, react_1.useEffect)(() => {
203
+ setProviders(JSON.parse(JSON.stringify(props.providers)));
204
+ setSelectedIndex(null);
205
+ }, [props.providers]);
195
206
  const [providerName, setProviderName] = (0, react_1.useState)('');
196
207
  const [providerKey, setProviderKey] = (0, react_1.useState)((_a = props.providersAvailable[0]) !== null && _a !== void 0 ? _a : '');
197
208
  const onProviderSelected = (p, index) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kwirthmagnify/kwirth-common-ai",
3
- "version": "0.5.30",
3
+ "version": "0.5.32",
4
4
  "description": "Shared AI/LLM types and utilities for Kwirth AI plugins",
5
5
  "scripts": {
6
6
  "build": "del .\\dist\\* /s /q 2>nul & tsc",