iobroker.assistant 1.9.0 → 1.9.1

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.
package/README.md CHANGED
@@ -237,6 +237,9 @@ train it twice.
237
237
  Placeholder for the next version (at the beginning of the line):
238
238
  ### **WORK IN PROGRESS**
239
239
  -->
240
+ ### 1.9.1 (2026-11-16)
241
+ * (@GermanBluefox) The adapter ai-parakeet was renamed to voice: the speech recognition, the instance selection and the button "Install ioBroker.voice" use `voice` now. A saved instance `ai-parakeet.<n>` switches to `voice.<n>` by itself as soon as that instance exists
242
+
240
243
  ### 1.9.0 (2026-11-13)
241
244
  * (@GermanBluefox) The table "Voice per answer language" has a column for the TTS model (OpenAI and OpenRouter): e.g. Russian answers with `elevenlabs/eleven-multilingual-v2`, the rest with the model set above. An OpenAI model change no longer serves cached audio of the old model. Voice and model of a row are offered in drop-downs, and ▶ at the end of a row speaks a test sentence with it
242
245
 
@@ -230,17 +230,17 @@
230
230
  "Check ffmpeg": "ffmpeg prüfen",
231
231
  "Download ffmpeg": "ffmpeg herunterladen",
232
232
  "Downloads a static ffmpeg (ffmpeg-static, 20-30 MB) into the data directory of the instance. It is used when no path is entered.": "Lädt ein statisches ffmpeg (ffmpeg-static, 20–30 MB) in das Datenverzeichnis der Instanz. Es wird genutzt, wenn kein Pfad eingetragen ist.",
233
- "ai-parakeet (local adapter)": "ai-parakeet (lokaler Adapter)",
234
- "ai-parakeet instance": "ai-parakeet-Instanz",
235
- "Install ai-parakeet": "ai-parakeet installieren",
233
+ "ioBroker.voice (local adapter)": "ioBroker.voice (lokaler Adapter)",
234
+ "ioBroker.voice instance": "ioBroker.voice-Instanz",
235
+ "Install ioBroker.voice": "ioBroker.voice installieren",
236
236
  "Install pi-agent": "pi-agent installieren",
237
237
  "This installs the adapter pi-agent on the host of this instance and creates an instance of it. It takes a few minutes. Afterwards choose its model in its settings, or use the system-wide AI settings of admin.": "Damit wird der Adapter pi-agent auf dem Host dieser Instanz installiert und eine Instanz davon angelegt. Das dauert ein paar Minuten. Danach in seinen Einstellungen das Modell wählen oder die systemweiten KI-Einstellungen von Admin nutzen.",
238
- "This installs the adapter ai-parakeet on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.": "Damit wird der Adapter ai-parakeet auf dem Host dieser Instanz installiert und eine Instanz davon angelegt. Das dauert ein paar Minuten. Beim ersten Start lädt er das Sprachmodell herunter (etwa 670 MB); danach braucht er etwa 1,1 GB Arbeitsspeicher.",
238
+ "This installs the adapter ioBroker.voice on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.": "Damit wird der Adapter ioBroker.voice auf dem Host dieser Instanz installiert und eine Instanz davon angelegt. Das dauert ein paar Minuten. Beim ersten Start lädt er das Sprachmodell herunter (etwa 670 MB); danach braucht er etwa 1,1 GB Arbeitsspeicher.",
239
239
  "Install": "Installieren",
240
240
  "Cancel": "Abbrechen",
241
241
  "%s was installed and selected. Save the settings to use it.": "%s wurde installiert und ausgewählt. Einstellungen speichern, um ihn zu nutzen.",
242
242
  "%s is already installed and is now selected. Save the settings to use it.": "%s ist schon installiert und jetzt ausgewählt. Einstellungen speichern, um ihn zu nutzen.",
243
- "The adapter ai-parakeet recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.": "Der Adapter ai-parakeet erkennt Sprache offline auf der CPU seines Hosts, in 25 europäischen Sprachen, die das Modell selbst erkennt. Das Audio geht über den ioBroker-Nachrichtenbus an ihn, die Instanz kann also auch auf einem anderen Host laufen.",
243
+ "The adapter ioBroker.voice recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.": "Der Adapter ioBroker.voice erkennt Sprache offline auf der CPU seines Hosts, in 25 europäischen Sprachen, die das Modell selbst erkennt. Das Audio geht über den ioBroker-Nachrichtenbus an ihn, die Instanz kann also auch auf einem anderen Host laufen.",
244
244
  "Local model URL (GGUF, old setting)": "URL des lokalen Modells (GGUF, alte Einstellung)",
245
245
  "Used only while no model is selected in the tab \"Local models\". Pick the model there instead.": "Wird nur genutzt, solange im Reiter „Lokale Modelle“ kein Modell gewählt ist. Wähle das Modell besser dort.",
246
246
  "Local models": "Lokale Modelle",
@@ -230,17 +230,17 @@
230
230
  "Check ffmpeg": "Check ffmpeg",
231
231
  "Download ffmpeg": "Download ffmpeg",
232
232
  "Downloads a static ffmpeg (ffmpeg-static, 20-30 MB) into the data directory of the instance. It is used when no path is entered.": "Downloads a static ffmpeg (ffmpeg-static, 20-30 MB) into the data directory of the instance. It is used when no path is entered.",
233
- "ai-parakeet (local adapter)": "ai-parakeet (local adapter)",
234
- "ai-parakeet instance": "ai-parakeet instance",
235
- "Install ai-parakeet": "Install ai-parakeet",
233
+ "ioBroker.voice (local adapter)": "ioBroker.voice (local adapter)",
234
+ "ioBroker.voice instance": "ioBroker.voice instance",
235
+ "Install ioBroker.voice": "Install ioBroker.voice",
236
236
  "Install pi-agent": "Install pi-agent",
237
237
  "This installs the adapter pi-agent on the host of this instance and creates an instance of it. It takes a few minutes. Afterwards choose its model in its settings, or use the system-wide AI settings of admin.": "This installs the adapter pi-agent on the host of this instance and creates an instance of it. It takes a few minutes. Afterwards choose its model in its settings, or use the system-wide AI settings of admin.",
238
- "This installs the adapter ai-parakeet on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.": "This installs the adapter ai-parakeet on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.",
238
+ "This installs the adapter ioBroker.voice on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.": "This installs the adapter ioBroker.voice on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.",
239
239
  "Install": "Install",
240
240
  "Cancel": "Cancel",
241
241
  "%s was installed and selected. Save the settings to use it.": "%s was installed and selected. Save the settings to use it.",
242
242
  "%s is already installed and is now selected. Save the settings to use it.": "%s is already installed and is now selected. Save the settings to use it.",
243
- "The adapter ai-parakeet recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.": "The adapter ai-parakeet recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.",
243
+ "The adapter ioBroker.voice recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.": "The adapter ioBroker.voice recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.",
244
244
  "Local model URL (GGUF, old setting)": "Local model URL (GGUF, old setting)",
245
245
  "Used only while no model is selected in the tab \"Local models\". Pick the model there instead.": "Used only while no model is selected in the tab \"Local models\". Pick the model there instead.",
246
246
  "Local models": "Local models",
@@ -230,17 +230,17 @@
230
230
  "Check ffmpeg": "Comprobar ffmpeg",
231
231
  "Download ffmpeg": "Descargar ffmpeg",
232
232
  "Downloads a static ffmpeg (ffmpeg-static, 20-30 MB) into the data directory of the instance. It is used when no path is entered.": "Descarga un ffmpeg estático (ffmpeg-static, 20-30 MB) en el directorio de datos de la instancia. Se usa cuando no se indica ninguna ruta.",
233
- "ai-parakeet (local adapter)": "ai-parakeet (adaptador local)",
234
- "ai-parakeet instance": "Instancia de ai-parakeet",
235
- "Install ai-parakeet": "Instalar ai-parakeet",
233
+ "ioBroker.voice (local adapter)": "ioBroker.voice (adaptador local)",
234
+ "ioBroker.voice instance": "Instancia de ioBroker.voice",
235
+ "Install ioBroker.voice": "Instalar ioBroker.voice",
236
236
  "Install pi-agent": "Instalar pi-agent",
237
237
  "This installs the adapter pi-agent on the host of this instance and creates an instance of it. It takes a few minutes. Afterwards choose its model in its settings, or use the system-wide AI settings of admin.": "Esto instala el adaptador pi-agent en el host de esta instancia y crea una instancia de él. Tarda unos minutos. Después elija su modelo en su configuración o use la configuración de IA de todo el sistema de admin.",
238
- "This installs the adapter ai-parakeet on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.": "Esto instala el adaptador ai-parakeet en el host de esta instancia y crea una instancia de él. Tarda unos minutos. En su primer inicio descarga el modelo de voz (unos 670 MB); después necesita unos 1,1 GB de memoria.",
238
+ "This installs the adapter ioBroker.voice on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.": "Esto instala el adaptador ioBroker.voice en el host de esta instancia y crea una instancia de él. Tarda unos minutos. En su primer inicio descarga el modelo de voz (unos 670 MB); después necesita unos 1,1 GB de memoria.",
239
239
  "Install": "Instalar",
240
240
  "Cancel": "Cancelar",
241
241
  "%s was installed and selected. Save the settings to use it.": "%s se instaló y se seleccionó. Guarde la configuración para usarlo.",
242
242
  "%s is already installed and is now selected. Save the settings to use it.": "%s ya está instalado y ahora está seleccionado. Guarde la configuración para usarlo.",
243
- "The adapter ai-parakeet recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.": "El adaptador ai-parakeet reconoce la voz sin conexión en la CPU de su host, en 25 idiomas europeos que el modelo detecta por sí mismo. El audio le llega por el bus de mensajes de ioBroker, así que la instancia también puede ejecutarse en otro host.",
243
+ "The adapter ioBroker.voice recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.": "El adaptador ioBroker.voice reconoce la voz sin conexión en la CPU de su host, en 25 idiomas europeos que el modelo detecta por sí mismo. El audio le llega por el bus de mensajes de ioBroker, así que la instancia también puede ejecutarse en otro host.",
244
244
  "Local model URL (GGUF, old setting)": "URL del modelo local (GGUF, ajuste antiguo)",
245
245
  "Used only while no model is selected in the tab \"Local models\". Pick the model there instead.": "Solo se usa mientras no haya un modelo elegido en la pestaña \"Modelos locales\". Elige el modelo allí.",
246
246
  "Local models": "Modelos locales",
@@ -230,17 +230,17 @@
230
230
  "Check ffmpeg": "Vérifier ffmpeg",
231
231
  "Download ffmpeg": "Télécharger ffmpeg",
232
232
  "Downloads a static ffmpeg (ffmpeg-static, 20-30 MB) into the data directory of the instance. It is used when no path is entered.": "Télécharge un ffmpeg statique (ffmpeg-static, 20 à 30 Mo) dans le répertoire de données de l'instance. Il est utilisé quand aucun chemin n'est indiqué.",
233
- "ai-parakeet (local adapter)": "ai-parakeet (adaptateur local)",
234
- "ai-parakeet instance": "Instance ai-parakeet",
235
- "Install ai-parakeet": "Installer ai-parakeet",
233
+ "ioBroker.voice (local adapter)": "ioBroker.voice (adaptateur local)",
234
+ "ioBroker.voice instance": "Instance ioBroker.voice",
235
+ "Install ioBroker.voice": "Installer ioBroker.voice",
236
236
  "Install pi-agent": "Installer pi-agent",
237
237
  "This installs the adapter pi-agent on the host of this instance and creates an instance of it. It takes a few minutes. Afterwards choose its model in its settings, or use the system-wide AI settings of admin.": "Ceci installe l'adaptateur pi-agent sur l'hôte de cette instance et en crée une instance. Cela prend quelques minutes. Choisissez ensuite son modèle dans ses paramètres, ou utilisez les paramètres d'IA de tout le système dans admin.",
238
- "This installs the adapter ai-parakeet on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.": "Ceci installe l'adaptateur ai-parakeet sur l'hôte de cette instance et en crée une instance. Cela prend quelques minutes. À son premier démarrage, il télécharge le modèle vocal (environ 670 Mo) ; il lui faut ensuite environ 1,1 Go de mémoire.",
238
+ "This installs the adapter ioBroker.voice on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.": "Ceci installe l'adaptateur ioBroker.voice sur l'hôte de cette instance et en crée une instance. Cela prend quelques minutes. À son premier démarrage, il télécharge le modèle vocal (environ 670 Mo) ; il lui faut ensuite environ 1,1 Go de mémoire.",
239
239
  "Install": "Installer",
240
240
  "Cancel": "Annuler",
241
241
  "%s was installed and selected. Save the settings to use it.": "%s a été installé et sélectionné. Enregistrez les paramètres pour l'utiliser.",
242
242
  "%s is already installed and is now selected. Save the settings to use it.": "%s est déjà installé et maintenant sélectionné. Enregistrez les paramètres pour l'utiliser.",
243
- "The adapter ai-parakeet recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.": "L'adaptateur ai-parakeet reconnaît la parole hors ligne sur le processeur de son hôte, dans 25 langues européennes que le modèle détecte lui-même. L'audio lui parvient par le bus de messages d'ioBroker, l'instance peut donc aussi tourner sur un autre hôte.",
243
+ "The adapter ioBroker.voice recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.": "L'adaptateur ioBroker.voice reconnaît la parole hors ligne sur le processeur de son hôte, dans 25 langues européennes que le modèle détecte lui-même. L'audio lui parvient par le bus de messages d'ioBroker, l'instance peut donc aussi tourner sur un autre hôte.",
244
244
  "Local model URL (GGUF, old setting)": "URL du modèle local (GGUF, ancien réglage)",
245
245
  "Used only while no model is selected in the tab \"Local models\". Pick the model there instead.": "Utilisé seulement tant qu'aucun modèle n'est choisi dans l'onglet « Modèles locaux ». Choisissez plutôt le modèle là-bas.",
246
246
  "Local models": "Modèles locaux",
@@ -230,17 +230,17 @@
230
230
  "Check ffmpeg": "Verifica ffmpeg",
231
231
  "Download ffmpeg": "Scarica ffmpeg",
232
232
  "Downloads a static ffmpeg (ffmpeg-static, 20-30 MB) into the data directory of the instance. It is used when no path is entered.": "Scarica un ffmpeg statico (ffmpeg-static, 20-30 MB) nella directory dei dati dell'istanza. Viene usato quando non è indicato alcun percorso.",
233
- "ai-parakeet (local adapter)": "ai-parakeet (adattatore locale)",
234
- "ai-parakeet instance": "Istanza di ai-parakeet",
235
- "Install ai-parakeet": "Installa ai-parakeet",
233
+ "ioBroker.voice (local adapter)": "ioBroker.voice (adattatore locale)",
234
+ "ioBroker.voice instance": "Istanza di ioBroker.voice",
235
+ "Install ioBroker.voice": "Installa ioBroker.voice",
236
236
  "Install pi-agent": "Installa pi-agent",
237
237
  "This installs the adapter pi-agent on the host of this instance and creates an instance of it. It takes a few minutes. Afterwards choose its model in its settings, or use the system-wide AI settings of admin.": "Installa l'adattatore pi-agent sull'host di questa istanza e ne crea un'istanza. Richiede alcuni minuti. Poi scegli il suo modello nelle sue impostazioni oppure usa le impostazioni IA di sistema di admin.",
238
- "This installs the adapter ai-parakeet on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.": "Installa l'adattatore ai-parakeet sull'host di questa istanza e ne crea un'istanza. Richiede alcuni minuti. Al primo avvio scarica il modello vocale (circa 670 MB); poi gli servono circa 1,1 GB di memoria.",
238
+ "This installs the adapter ioBroker.voice on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.": "Installa l'adattatore ioBroker.voice sull'host di questa istanza e ne crea un'istanza. Richiede alcuni minuti. Al primo avvio scarica il modello vocale (circa 670 MB); poi gli servono circa 1,1 GB di memoria.",
239
239
  "Install": "Installa",
240
240
  "Cancel": "Annulla",
241
241
  "%s was installed and selected. Save the settings to use it.": "%s è stato installato e selezionato. Salva le impostazioni per usarlo.",
242
242
  "%s is already installed and is now selected. Save the settings to use it.": "%s è già installato e ora è selezionato. Salva le impostazioni per usarlo.",
243
- "The adapter ai-parakeet recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.": "L'adattatore ai-parakeet riconosce la voce offline sulla CPU del suo host, in 25 lingue europee che il modello rileva da solo. L'audio gli arriva tramite il bus dei messaggi di ioBroker, quindi l'istanza può anche girare su un altro host.",
243
+ "The adapter ioBroker.voice recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.": "L'adattatore ioBroker.voice riconosce la voce offline sulla CPU del suo host, in 25 lingue europee che il modello rileva da solo. L'audio gli arriva tramite il bus dei messaggi di ioBroker, quindi l'istanza può anche girare su un altro host.",
244
244
  "Local model URL (GGUF, old setting)": "URL del modello locale (GGUF, vecchia impostazione)",
245
245
  "Used only while no model is selected in the tab \"Local models\". Pick the model there instead.": "Usato solo finché nella scheda \"Modelli locali\" non è scelto un modello. Scegli il modello lì.",
246
246
  "Local models": "Modelli locali",
@@ -230,17 +230,17 @@
230
230
  "Check ffmpeg": "ffmpeg controleren",
231
231
  "Download ffmpeg": "ffmpeg downloaden",
232
232
  "Downloads a static ffmpeg (ffmpeg-static, 20-30 MB) into the data directory of the instance. It is used when no path is entered.": "Downloadt een statische ffmpeg (ffmpeg-static, 20-30 MB) naar de gegevensmap van de instantie. Die wordt gebruikt als er geen pad is ingevuld.",
233
- "ai-parakeet (local adapter)": "ai-parakeet (lokale adapter)",
234
- "ai-parakeet instance": "ai-parakeet-instantie",
235
- "Install ai-parakeet": "ai-parakeet installeren",
233
+ "ioBroker.voice (local adapter)": "ioBroker.voice (lokale adapter)",
234
+ "ioBroker.voice instance": "ioBroker.voice-instantie",
235
+ "Install ioBroker.voice": "ioBroker.voice installeren",
236
236
  "Install pi-agent": "pi-agent installeren",
237
237
  "This installs the adapter pi-agent on the host of this instance and creates an instance of it. It takes a few minutes. Afterwards choose its model in its settings, or use the system-wide AI settings of admin.": "Dit installeert de adapter pi-agent op de host van deze instantie en maakt er een instantie van aan. Dat duurt een paar minuten. Kies daarna het model in de instellingen ervan, of gebruik de systeembrede AI-instellingen van admin.",
238
- "This installs the adapter ai-parakeet on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.": "Dit installeert de adapter ai-parakeet op de host van deze instantie en maakt er een instantie van aan. Dat duurt een paar minuten. Bij de eerste start downloadt hij het spraakmodel (ongeveer 670 MB); daarna heeft hij ongeveer 1,1 GB geheugen nodig.",
238
+ "This installs the adapter ioBroker.voice on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.": "Dit installeert de adapter ioBroker.voice op de host van deze instantie en maakt er een instantie van aan. Dat duurt een paar minuten. Bij de eerste start downloadt hij het spraakmodel (ongeveer 670 MB); daarna heeft hij ongeveer 1,1 GB geheugen nodig.",
239
239
  "Install": "Installeren",
240
240
  "Cancel": "Annuleren",
241
241
  "%s was installed and selected. Save the settings to use it.": "%s is geïnstalleerd en geselecteerd. Sla de instellingen op om hem te gebruiken.",
242
242
  "%s is already installed and is now selected. Save the settings to use it.": "%s is al geïnstalleerd en nu geselecteerd. Sla de instellingen op om hem te gebruiken.",
243
- "The adapter ai-parakeet recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.": "De adapter ai-parakeet herkent spraak offline op de CPU van zijn host, in 25 Europese talen die het model zelf herkent. Het geluid gaat via de berichtenbus van ioBroker naar hem toe, dus de instantie kan ook op een andere host draaien.",
243
+ "The adapter ioBroker.voice recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.": "De adapter ioBroker.voice herkent spraak offline op de CPU van zijn host, in 25 Europese talen die het model zelf herkent. Het geluid gaat via de berichtenbus van ioBroker naar hem toe, dus de instantie kan ook op een andere host draaien.",
244
244
  "Local model URL (GGUF, old setting)": "URL van het lokale model (GGUF, oude instelling)",
245
245
  "Used only while no model is selected in the tab \"Local models\". Pick the model there instead.": "Alleen gebruikt zolang er op het tabblad \"Lokale modellen\" geen model is gekozen. Kies het model daar.",
246
246
  "Local models": "Lokale modellen",
@@ -230,17 +230,17 @@
230
230
  "Check ffmpeg": "Sprawdź ffmpeg",
231
231
  "Download ffmpeg": "Pobierz ffmpeg",
232
232
  "Downloads a static ffmpeg (ffmpeg-static, 20-30 MB) into the data directory of the instance. It is used when no path is entered.": "Pobiera statyczny ffmpeg (ffmpeg-static, 20–30 MB) do katalogu danych instancji. Jest używany, gdy nie podano ścieżki.",
233
- "ai-parakeet (local adapter)": "ai-parakeet (lokalny adapter)",
234
- "ai-parakeet instance": "Instancja ai-parakeet",
235
- "Install ai-parakeet": "Zainstaluj ai-parakeet",
233
+ "ioBroker.voice (local adapter)": "ioBroker.voice (lokalny adapter)",
234
+ "ioBroker.voice instance": "Instancja ioBroker.voice",
235
+ "Install ioBroker.voice": "Zainstaluj ioBroker.voice",
236
236
  "Install pi-agent": "Zainstaluj pi-agent",
237
237
  "This installs the adapter pi-agent on the host of this instance and creates an instance of it. It takes a few minutes. Afterwards choose its model in its settings, or use the system-wide AI settings of admin.": "Instaluje adapter pi-agent na hoście tej instancji i tworzy jego instancję. Trwa to kilka minut. Następnie wybierz model w jego ustawieniach albo użyj ogólnosystemowych ustawień AI w admin.",
238
- "This installs the adapter ai-parakeet on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.": "Instaluje adapter ai-parakeet na hoście tej instancji i tworzy jego instancję. Trwa to kilka minut. Przy pierwszym uruchomieniu pobiera model mowy (około 670 MB); potem potrzebuje około 1,1 GB pamięci.",
238
+ "This installs the adapter ioBroker.voice on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.": "Instaluje adapter ioBroker.voice na hoście tej instancji i tworzy jego instancję. Trwa to kilka minut. Przy pierwszym uruchomieniu pobiera model mowy (około 670 MB); potem potrzebuje około 1,1 GB pamięci.",
239
239
  "Install": "Zainstaluj",
240
240
  "Cancel": "Anuluj",
241
241
  "%s was installed and selected. Save the settings to use it.": "%s został zainstalowany i wybrany. Zapisz ustawienia, aby go używać.",
242
242
  "%s is already installed and is now selected. Save the settings to use it.": "%s jest już zainstalowany i teraz wybrany. Zapisz ustawienia, aby go używać.",
243
- "The adapter ai-parakeet recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.": "Adapter ai-parakeet rozpoznaje mowę offline na procesorze swojego hosta, w 25 językach europejskich, które model rozpoznaje sam. Dźwięk trafia do niego przez magistralę wiadomości ioBroker, więc instancja może też działać na innym hoście.",
243
+ "The adapter ioBroker.voice recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.": "Adapter ioBroker.voice rozpoznaje mowę offline na procesorze swojego hosta, w 25 językach europejskich, które model rozpoznaje sam. Dźwięk trafia do niego przez magistralę wiadomości ioBroker, więc instancja może też działać na innym hoście.",
244
244
  "Local model URL (GGUF, old setting)": "URL modelu lokalnego (GGUF, stare ustawienie)",
245
245
  "Used only while no model is selected in the tab \"Local models\". Pick the model there instead.": "Używane tylko, dopóki na karcie „Modele lokalne” nie wybrano modelu. Wybierz model tam.",
246
246
  "Local models": "Modele lokalne",
@@ -230,17 +230,17 @@
230
230
  "Check ffmpeg": "Verificar ffmpeg",
231
231
  "Download ffmpeg": "Transferir ffmpeg",
232
232
  "Downloads a static ffmpeg (ffmpeg-static, 20-30 MB) into the data directory of the instance. It is used when no path is entered.": "Transfere um ffmpeg estático (ffmpeg-static, 20-30 MB) para o diretório de dados da instância. É usado quando nenhum caminho é indicado.",
233
- "ai-parakeet (local adapter)": "ai-parakeet (adaptador local)",
234
- "ai-parakeet instance": "Instância do ai-parakeet",
235
- "Install ai-parakeet": "Instalar ai-parakeet",
233
+ "ioBroker.voice (local adapter)": "ioBroker.voice (adaptador local)",
234
+ "ioBroker.voice instance": "Instância do ioBroker.voice",
235
+ "Install ioBroker.voice": "Instalar ioBroker.voice",
236
236
  "Install pi-agent": "Instalar pi-agent",
237
237
  "This installs the adapter pi-agent on the host of this instance and creates an instance of it. It takes a few minutes. Afterwards choose its model in its settings, or use the system-wide AI settings of admin.": "Isto instala o adaptador pi-agent no host desta instância e cria uma instância dele. Demora alguns minutos. Depois escolha o modelo nas configurações dele ou use as configurações de IA de todo o sistema do admin.",
238
- "This installs the adapter ai-parakeet on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.": "Isto instala o adaptador ai-parakeet no host desta instância e cria uma instância dele. Demora alguns minutos. No primeiro arranque transfere o modelo de voz (cerca de 670 MB); depois precisa de cerca de 1,1 GB de memória.",
238
+ "This installs the adapter ioBroker.voice on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.": "Isto instala o adaptador ioBroker.voice no host desta instância e cria uma instância dele. Demora alguns minutos. No primeiro arranque transfere o modelo de voz (cerca de 670 MB); depois precisa de cerca de 1,1 GB de memória.",
239
239
  "Install": "Instalar",
240
240
  "Cancel": "Cancelar",
241
241
  "%s was installed and selected. Save the settings to use it.": "%s foi instalado e selecionado. Guarde as configurações para o usar.",
242
242
  "%s is already installed and is now selected. Save the settings to use it.": "%s já está instalado e agora está selecionado. Guarde as configurações para o usar.",
243
- "The adapter ai-parakeet recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.": "O adaptador ai-parakeet reconhece a fala offline no CPU do seu host, em 25 línguas europeias que o modelo deteta sozinho. O áudio chega-lhe pelo barramento de mensagens do ioBroker, por isso a instância também pode correr noutro host.",
243
+ "The adapter ioBroker.voice recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.": "O adaptador ioBroker.voice reconhece a fala offline no CPU do seu host, em 25 línguas europeias que o modelo deteta sozinho. O áudio chega-lhe pelo barramento de mensagens do ioBroker, por isso a instância também pode correr noutro host.",
244
244
  "Local model URL (GGUF, old setting)": "URL do modelo local (GGUF, configuração antiga)",
245
245
  "Used only while no model is selected in the tab \"Local models\". Pick the model there instead.": "Usado apenas enquanto nenhum modelo estiver escolhido na aba \"Modelos locais\". Escolha o modelo lá.",
246
246
  "Local models": "Modelos locais",
@@ -230,17 +230,17 @@
230
230
  "Check ffmpeg": "Проверить ffmpeg",
231
231
  "Download ffmpeg": "Загрузить ffmpeg",
232
232
  "Downloads a static ffmpeg (ffmpeg-static, 20-30 MB) into the data directory of the instance. It is used when no path is entered.": "Загружает статический ffmpeg (ffmpeg-static, 20–30 МБ) в каталог данных экземпляра. Используется, если путь не указан.",
233
- "ai-parakeet (local adapter)": "ai-parakeet (локальный адаптер)",
234
- "ai-parakeet instance": "Экземпляр ai-parakeet",
235
- "Install ai-parakeet": "Установить ai-parakeet",
233
+ "ioBroker.voice (local adapter)": "ioBroker.voice (локальный адаптер)",
234
+ "ioBroker.voice instance": "Экземпляр ioBroker.voice",
235
+ "Install ioBroker.voice": "Установить ioBroker.voice",
236
236
  "Install pi-agent": "Установить pi-agent",
237
237
  "This installs the adapter pi-agent on the host of this instance and creates an instance of it. It takes a few minutes. Afterwards choose its model in its settings, or use the system-wide AI settings of admin.": "Адаптер pi-agent будет установлен на хост этого экземпляра, и будет создан его экземпляр. Это займёт несколько минут. Затем выберите модель в его настройках или используйте общесистемные настройки ИИ в admin.",
238
- "This installs the adapter ai-parakeet on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.": "Адаптер ai-parakeet будет установлен на хост этого экземпляра, и будет создан его экземпляр. Это займёт несколько минут. При первом запуске он скачает речевую модель (около 670 МБ); затем ему нужно около 1,1 ГБ памяти.",
238
+ "This installs the adapter ioBroker.voice on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.": "Адаптер ioBroker.voice будет установлен на хост этого экземпляра, и будет создан его экземпляр. Это займёт несколько минут. При первом запуске он скачает речевую модель (около 670 МБ); затем ему нужно около 1,1 ГБ памяти.",
239
239
  "Install": "Установить",
240
240
  "Cancel": "Отмена",
241
241
  "%s was installed and selected. Save the settings to use it.": "%s установлен и выбран. Сохраните настройки, чтобы им пользоваться.",
242
242
  "%s is already installed and is now selected. Save the settings to use it.": "%s уже установлен и теперь выбран. Сохраните настройки, чтобы им пользоваться.",
243
- "The adapter ai-parakeet recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.": "Адаптер ai-parakeet распознаёт речь офлайн на процессоре своего хоста, на 25 европейских языках, которые модель определяет сама. Аудио идёт к нему через шину сообщений ioBroker, поэтому экземпляр может работать и на другом хосте.",
243
+ "The adapter ioBroker.voice recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.": "Адаптер ioBroker.voice распознаёт речь офлайн на процессоре своего хоста, на 25 европейских языках, которые модель определяет сама. Аудио идёт к нему через шину сообщений ioBroker, поэтому экземпляр может работать и на другом хосте.",
244
244
  "Local model URL (GGUF, old setting)": "URL локальной модели (GGUF, старая настройка)",
245
245
  "Used only while no model is selected in the tab \"Local models\". Pick the model there instead.": "Используется, только пока на вкладке «Локальные модели» не выбрана модель. Лучше выберите модель там.",
246
246
  "Local models": "Локальные модели",
@@ -230,17 +230,17 @@
230
230
  "Check ffmpeg": "Перевірити ffmpeg",
231
231
  "Download ffmpeg": "Завантажити ffmpeg",
232
232
  "Downloads a static ffmpeg (ffmpeg-static, 20-30 MB) into the data directory of the instance. It is used when no path is entered.": "Завантажує статичний ffmpeg (ffmpeg-static, 20–30 МБ) до каталогу даних екземпляра. Використовується, якщо шлях не вказано.",
233
- "ai-parakeet (local adapter)": "ai-parakeet (локальний адаптер)",
234
- "ai-parakeet instance": "Екземпляр ai-parakeet",
235
- "Install ai-parakeet": "Встановити ai-parakeet",
233
+ "ioBroker.voice (local adapter)": "ioBroker.voice (локальний адаптер)",
234
+ "ioBroker.voice instance": "Екземпляр ioBroker.voice",
235
+ "Install ioBroker.voice": "Встановити ioBroker.voice",
236
236
  "Install pi-agent": "Встановити pi-agent",
237
237
  "This installs the adapter pi-agent on the host of this instance and creates an instance of it. It takes a few minutes. Afterwards choose its model in its settings, or use the system-wide AI settings of admin.": "Адаптер pi-agent буде встановлено на хост цього екземпляра, і буде створено його екземпляр. Це займе кілька хвилин. Потім виберіть модель у його налаштуваннях або використайте загальносистемні налаштування ШІ в admin.",
238
- "This installs the adapter ai-parakeet on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.": "Адаптер ai-parakeet буде встановлено на хост цього екземпляра, і буде створено його екземпляр. Це займе кілька хвилин. Під час першого запуску він завантажить мовну модель (близько 670 МБ); потім йому потрібно близько 1,1 ГБ пам'яті.",
238
+ "This installs the adapter ioBroker.voice on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.": "Адаптер ioBroker.voice буде встановлено на хост цього екземпляра, і буде створено його екземпляр. Це займе кілька хвилин. Під час першого запуску він завантажить мовну модель (близько 670 МБ); потім йому потрібно близько 1,1 ГБ пам'яті.",
239
239
  "Install": "Встановити",
240
240
  "Cancel": "Скасувати",
241
241
  "%s was installed and selected. Save the settings to use it.": "%s встановлено та вибрано. Збережіть налаштування, щоб ним користуватися.",
242
242
  "%s is already installed and is now selected. Save the settings to use it.": "%s вже встановлено, і тепер його вибрано. Збережіть налаштування, щоб ним користуватися.",
243
- "The adapter ai-parakeet recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.": "Адаптер ai-parakeet розпізнає мовлення офлайн на процесорі свого хоста, 25 європейськими мовами, які модель визначає сама. Аудіо йде до нього через шину повідомлень ioBroker, тож екземпляр може працювати й на іншому хості.",
243
+ "The adapter ioBroker.voice recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.": "Адаптер ioBroker.voice розпізнає мовлення офлайн на процесорі свого хоста, 25 європейськими мовами, які модель визначає сама. Аудіо йде до нього через шину повідомлень ioBroker, тож екземпляр може працювати й на іншому хості.",
244
244
  "Local model URL (GGUF, old setting)": "URL локальної моделі (GGUF, старе налаштування)",
245
245
  "Used only while no model is selected in the tab \"Local models\". Pick the model there instead.": "Використовується, лише поки на вкладці «Локальні моделі» не вибрано модель. Краще виберіть модель там.",
246
246
  "Local models": "Локальні моделі",
@@ -230,17 +230,17 @@
230
230
  "Check ffmpeg": "检查 ffmpeg",
231
231
  "Download ffmpeg": "下载 ffmpeg",
232
232
  "Downloads a static ffmpeg (ffmpeg-static, 20-30 MB) into the data directory of the instance. It is used when no path is entered.": "将静态 ffmpeg(ffmpeg-static,20–30 MB)下载到实例的数据目录。未填写路径时使用它。",
233
- "ai-parakeet (local adapter)": "ai-parakeet(本地适配器)",
234
- "ai-parakeet instance": "ai-parakeet 实例",
235
- "Install ai-parakeet": "安装 ai-parakeet",
233
+ "ioBroker.voice (local adapter)": "ioBroker.voice(本地适配器)",
234
+ "ioBroker.voice instance": "ioBroker.voice 实例",
235
+ "Install ioBroker.voice": "安装 ioBroker.voice",
236
236
  "Install pi-agent": "安装 pi-agent",
237
237
  "This installs the adapter pi-agent on the host of this instance and creates an instance of it. It takes a few minutes. Afterwards choose its model in its settings, or use the system-wide AI settings of admin.": "这会在本实例所在的主机上安装适配器 pi-agent 并创建一个实例。需要几分钟。之后请在其设置中选择模型,或使用 admin 的系统级 AI 设置。",
238
- "This installs the adapter ai-parakeet on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.": "这会在本实例所在的主机上安装适配器 ai-parakeet 并创建一个实例。需要几分钟。首次启动时它会下载语音模型(约 670 MB),之后需要约 1.1 GB 内存。",
238
+ "This installs the adapter ioBroker.voice on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.": "这会在本实例所在的主机上安装适配器 ioBroker.voice 并创建一个实例。需要几分钟。首次启动时它会下载语音模型(约 670 MB),之后需要约 1.1 GB 内存。",
239
239
  "Install": "安装",
240
240
  "Cancel": "取消",
241
241
  "%s was installed and selected. Save the settings to use it.": "%s 已安装并选中。保存设置后即可使用。",
242
242
  "%s is already installed and is now selected. Save the settings to use it.": "%s 已经安装,现已选中。保存设置后即可使用。",
243
- "The adapter ai-parakeet recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.": "适配器 ai-parakeet 在其主机的 CPU 上离线识别语音,支持 25 种欧洲语言,语言由模型自动识别。音频通过 ioBroker 消息总线发送给它,因此该实例也可以运行在另一台主机上。",
243
+ "The adapter ioBroker.voice recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.": "适配器 ioBroker.voice 在其主机的 CPU 上离线识别语音,支持 25 种欧洲语言,语言由模型自动识别。音频通过 ioBroker 消息总线发送给它,因此该实例也可以运行在另一台主机上。",
244
244
  "Local model URL (GGUF, old setting)": "本地模型 URL(GGUF,旧设置)",
245
245
  "Used only while no model is selected in the tab \"Local models\". Pick the model there instead.": "仅在“本地模型”选项卡中未选择模型时使用。请在那里选择模型。",
246
246
  "Local models": "本地模型",
@@ -963,7 +963,7 @@
963
963
  { "label": "Azure Speech", "value": "azure" },
964
964
  { "label": "AWS Transcribe", "value": "aws" },
965
965
  { "label": "Vosk (local)", "value": "vosk" },
966
- { "label": "ai-parakeet (local adapter)", "value": "parakeet" }
966
+ { "label": "ioBroker.voice (local adapter)", "value": "parakeet" }
967
967
  ],
968
968
  "default": "openai",
969
969
  "hidden": "!data.voiceEnabled",
@@ -1003,7 +1003,7 @@
1003
1003
  { "label": "Azure Speech", "value": "azure" },
1004
1004
  { "label": "AWS Transcribe", "value": "aws" },
1005
1005
  { "label": "Vosk (local)", "value": "vosk" },
1006
- { "label": "ai-parakeet (local adapter)", "value": "parakeet" }
1006
+ { "label": "ioBroker.voice (local adapter)", "value": "parakeet" }
1007
1007
  ],
1008
1008
  "default": "",
1009
1009
  "hidden": "!data.voiceEnabled",
@@ -1050,8 +1050,8 @@
1050
1050
  "parakeetInstance": {
1051
1051
  "newLine": true,
1052
1052
  "type": "instance",
1053
- "adapter": "ai-parakeet",
1054
- "label": "ai-parakeet instance",
1053
+ "adapter": "voice",
1054
+ "label": "ioBroker.voice instance",
1055
1055
  "hidden": "!data.voiceEnabled || (data.sttProvider !== 'parakeet' && data.sttFallback !== 'parakeet')",
1056
1056
  "xs": 12,
1057
1057
  "sm": 6,
@@ -1061,15 +1061,15 @@
1061
1061
  },
1062
1062
  "_installParakeet": {
1063
1063
  "type": "sendTo",
1064
- "label": "Install ai-parakeet",
1064
+ "label": "Install ioBroker.voice",
1065
1065
  "command": "installAdapter",
1066
- "jsonData": "{\"adapter\":\"ai-parakeet\"}",
1066
+ "jsonData": "{\"adapter\":\"voice\"}",
1067
1067
  "useNative": true,
1068
1068
  "showProcess": true,
1069
1069
  "variant": "outlined",
1070
1070
  "confirm": {
1071
- "title": "Install ai-parakeet",
1072
- "text": "This installs the adapter ai-parakeet on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.",
1071
+ "title": "Install ioBroker.voice",
1072
+ "text": "This installs the adapter ioBroker.voice on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.",
1073
1073
  "ok": "Install",
1074
1074
  "cancel": "Cancel"
1075
1075
  },
@@ -1087,7 +1087,7 @@
1087
1087
  "_parakeetInfo": {
1088
1088
  "newLine": true,
1089
1089
  "type": "staticText",
1090
- "text": "The adapter ai-parakeet recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.",
1090
+ "text": "The adapter ioBroker.voice recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.",
1091
1091
  "hidden": "!data.voiceEnabled || (data.sttProvider !== 'parakeet' && data.sttFallback !== 'parakeet')",
1092
1092
  "xs": 12,
1093
1093
  "sm": 12,
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Installs a helper adapter (pi-agent, ai-parakeet) and creates an instance of it, from a button in the settings.
3
+ * Installs a helper adapter (pi-agent, voice) and creates an instance of it, from a button in the settings.
4
4
  *
5
5
  * The host does it, as for the admin: `sendToHost(host, 'cmdExec', { id, data: 'add pi-agent' })` runs
6
6
  * `iobroker add pi-agent` there and reports back to this instance with the messages `cmdStdout`, `cmdStderr` and
@@ -1 +1 @@
1
- {"version":3,"file":"installer.js","sourceRoot":"","sources":["../../src/lib/installer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AA0BH,sGAAsG;AACzF,QAAA,kBAAkB,GAAG,EAAE,GAAG,MAAM,CAAC;AAC9C,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,MAAM,OAAO,GAAG,sBAAsB,CAAC;AAEvC,MAAa,gBAAgB;IAMJ;IAEA;IACA;IARJ,OAAO,GAAG,IAAI,GAAG,EAAmB,CAAC;IAC9C,IAAI,GAAG,EAAE,CAAC;IACV,GAAG,GAAG,CAAC,CAAC;IAEhB,YACqB,OAAyB;IAC1C,oDAAoD;IACnC,IAAY,EACZ,YAAY,0BAAkB;QAH9B,YAAO,GAAP,OAAO,CAAkB;QAEzB,SAAI,GAAJ,IAAI,CAAQ;QACZ,cAAS,GAAT,SAAS,CAAqB;IAChD,CAAC;IAEJ,8FAA8F;IAC9F,aAAa,CAAC,OAAe,EAAE,OAAgB;QAC3C,IAAI,OAAO,KAAK,WAAW,IAAI,OAAO,KAAK,WAAW,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC9E,OAAO,KAAK,CAAC;QACjB,CAAC;QACD,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,OAAO,IAAI,EAAE,CAAqC,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G,MAAM,CAAC,MAAM,CAAC;IAC5B,MAAM,KAAK,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,wCAAwC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACrG,MAAM,IAAI,GAAG,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IACpD,OAAO,aAAa,MAAM,CAAC,IAAI,IAAI,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;AACrF,CAAC","sourcesContent":["/**\n * Installs a helper adapter (pi-agent, ai-parakeet) and creates an instance of it, from a button in the settings.\n *\n * The host does it, as for the admin: `sendToHost(host, 'cmdExec', { id, data: 'add pi-agent' })` runs\n * `iobroker add pi-agent` there and reports back to this instance with the messages `cmdStdout`, `cmdStderr` and\n * `cmdExit` (the last one twice, because it gets lost sometimes) — {@link AdapterInstaller.handleMessage} takes them.\n *\n * `add` installs from the repository the system uses and creates an instance. An adapter that is not in that\n * repository (pi-agent is only in \"latest\") comes from npm with `url iobroker.<name>`, then `add` once more.\n */\n\nexport interface InstallerAdapter {\n sendToHost(host: string, command: string, message: ioBroker.MessagePayload): void;\n getForeignObjectAsync(id: string): Promise<ioBroker.Object | null | undefined>;\n getObjectViewAsync(\n design: 'system',\n search: 'instance',\n params: { startkey: string; endkey: string },\n ): Promise<{ rows: { id: string; value: ioBroker.Object }[] }>;\n log: ioBroker.Logger;\n}\n\nexport interface CommandResult {\n /** Exit code of the command, null when it was killed. */\n code: number | null;\n /** Its last output lines. */\n output: string[];\n}\n\ninterface Running {\n resolve: (result: CommandResult) => void;\n output: string[];\n timer: NodeJS.Timeout;\n}\n\n/** An npm install on a Raspberry Pi takes a while; a command that runs longer goes on on the host. */\nexport const COMMAND_TIMEOUT_MS = 15 * 60_000;\nconst KEEP_LINES = 30;\nconst NAME_RE = /^[a-z0-9][a-z0-9-]*$/;\n\nexport class AdapterInstaller {\n private readonly running = new Map<string, Running>();\n private busy = '';\n private seq = 0;\n\n constructor(\n private readonly adapter: InstallerAdapter,\n /** Host to install on: the one of this instance. */\n private readonly host: string,\n private readonly timeoutMs = COMMAND_TIMEOUT_MS,\n ) {}\n\n /** A `cmdStdout`/`cmdStderr`/`cmdExit` message of the host; false when it is none of ours. */\n handleMessage(command: string, message: unknown): boolean {\n if (command !== 'cmdStdout' && command !== 'cmdStderr' && command !== 'cmdExit') {\n return false;\n }\n const { id, data } = (message || {}) as { id?: unknown; data?: unknown };\n const run = typeof id === 'string' ? this.running.get(id) : undefined;\n if (!run) {\n return true; // the second cmdExit, or a command of an earlier run\n }\n if (command === 'cmdExit') {\n this.running.delete(id as string);\n clearTimeout(run.timer);\n run.resolve({ code: typeof data === 'number' ? data : null, output: run.output });\n return true;\n }\n const text = typeof data === 'string' ? data : data === undefined || data === null ? '' : JSON.stringify(data);\n for (const line of text.split(/\\r?\\n/)) {\n if (line.trim()) {\n run.output.push(line.trim());\n this.adapter.log.debug(`${this.host}: ${line.trim()}`);\n }\n }\n run.output.splice(0, Math.max(0, run.output.length - KEEP_LINES));\n return true;\n }\n\n /** Run `iobroker <cmd>` on the host. */\n run(cmd: string): Promise<CommandResult> {\n const id = `assistant-${Date.now()}-${++this.seq}`;\n this.adapter.log.info(`${this.host}: iobroker ${cmd}`);\n return new Promise(resolve => {\n const timer = setTimeout(() => {\n this.running.delete(id);\n resolve({\n code: null,\n output: [\n `iobroker ${cmd} still runs on ${this.host} after ${Math.ceil(this.timeoutMs / 60_000)} min — see the log of the host`,\n ],\n });\n }, this.timeoutMs);\n this.running.set(id, { resolve, output: [], timer });\n this.adapter.sendToHost(this.host, 'cmdExec', { id, data: cmd });\n });\n }\n\n /** An instance of the adapter: an enabled one first, on this host first. `pi-agent.0`, or null. */\n async findInstance(name: string): Promise<string | null> {\n const prefix = `system.adapter.${name}.`;\n const view = await this.adapter.getObjectViewAsync('system', 'instance', {\n startkey: prefix,\n endkey: `${prefix}香`,\n });\n const rank = (obj: ioBroker.Object): number =>\n (obj.common?.enabled ? 0 : 2) + ((obj.common as { host?: string })?.host === this.host ? 0 : 1);\n const rows = (view?.rows || [])\n .filter(row => row.value && /^\\d+$/.test(row.id.slice(prefix.length)))\n .sort((a, b) => rank(a.value) - rank(b.value) || a.id.localeCompare(b.id, undefined, { numeric: true }));\n return rows.length ? rows[0].id.slice('system.adapter.'.length) : null;\n }\n\n /** Install the adapter if needed and create an instance if there is none. */\n async ensure(name: string): Promise<{ instance: string; installed: boolean }> {\n if (!NAME_RE.test(name)) {\n throw new Error(`Invalid adapter name \"${name}\"`);\n }\n const existing = await this.findInstance(name);\n if (existing) {\n return { instance: existing, installed: false };\n }\n if (this.busy) {\n throw new Error(`${this.busy} is being installed right now`);\n }\n this.busy = name;\n try {\n const installed = async (): Promise<boolean> =>\n !!(await this.adapter.getForeignObjectAsync(`system.adapter.${name}`));\n let add = await this.runToEnd(`add ${name}`);\n if (!(await this.findInstance(name))) {\n if (!(await installed())) {\n // not in the repository the system uses: the newest version from npm\n const npm = await this.runToEnd(`url iobroker.${name}`);\n if (!(await installed())) {\n throw new Error(\n `${name} could not be installed — neither from the repository (${lastError(add)}) nor from npm (${lastError(npm)})`,\n );\n }\n }\n add = await this.runToEnd(`add ${name}`);\n }\n const instance = await this.findInstance(name);\n if (!instance) {\n throw new Error(`${name} is installed, but no instance was created: ${lastError(add)}`);\n }\n this.adapter.log.info(`${instance} installed on ${this.host}`);\n return { instance, installed: true };\n } finally {\n this.busy = '';\n }\n }\n\n /** {@link run}, but a command that did not end (timeout, adapter stops) ends the installation: it still runs. */\n private async runToEnd(cmd: string): Promise<CommandResult> {\n const result = await this.run(cmd);\n if (result.code === null) {\n throw new Error(result.output[result.output.length - 1] || `iobroker ${cmd} did not end`);\n }\n return result;\n }\n\n /** Ends waiting commands (the adapter stops); they go on on the host. */\n stop(): void {\n for (const [id, run] of this.running) {\n clearTimeout(run.timer);\n run.resolve({ code: null, output: ['the adapter stopped'] });\n this.running.delete(id);\n }\n }\n}\n\n/** The line that says why a command failed: an error line, else the last one. */\nfunction lastError(result: CommandResult): string {\n const lines = result.output;\n const error = [...lines].reverse().find(line => /error|unknown|not found|cannot|failed/i.test(line));\n const line = error || lines[lines.length - 1] || '';\n return `exit code ${result.code ?? '–'}${line ? `: ${line.slice(0, 300)}` : ''}`;\n}\n"]}
1
+ {"version":3,"file":"installer.js","sourceRoot":"","sources":["../../src/lib/installer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AA0BH,sGAAsG;AACzF,QAAA,kBAAkB,GAAG,EAAE,GAAG,MAAM,CAAC;AAC9C,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,MAAM,OAAO,GAAG,sBAAsB,CAAC;AAEvC,MAAa,gBAAgB;IAMJ;IAEA;IACA;IARJ,OAAO,GAAG,IAAI,GAAG,EAAmB,CAAC;IAC9C,IAAI,GAAG,EAAE,CAAC;IACV,GAAG,GAAG,CAAC,CAAC;IAEhB,YACqB,OAAyB;IAC1C,oDAAoD;IACnC,IAAY,EACZ,YAAY,0BAAkB;QAH9B,YAAO,GAAP,OAAO,CAAkB;QAEzB,SAAI,GAAJ,IAAI,CAAQ;QACZ,cAAS,GAAT,SAAS,CAAqB;IAChD,CAAC;IAEJ,8FAA8F;IAC9F,aAAa,CAAC,OAAe,EAAE,OAAgB;QAC3C,IAAI,OAAO,KAAK,WAAW,IAAI,OAAO,KAAK,WAAW,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC9E,OAAO,KAAK,CAAC;QACjB,CAAC;QACD,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,OAAO,IAAI,EAAE,CAAqC,CAAC;QACzE,MAAM,GAAG,GAAG,OAAO,EAAE,KAAK,QAAQ,CAAC,CAAC,CAAC,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C,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,wCAAwC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACrG,MAAM,IAAI,GAAG,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IACpD,OAAO,aAAa,MAAM,CAAC,IAAI,IAAI,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;AACrF,CAAC","sourcesContent":["/**\n * Installs a helper adapter (pi-agent, voice) and creates an instance of it, from a button in the settings.\n *\n * The host does it, as for the admin: `sendToHost(host, 'cmdExec', { id, data: 'add pi-agent' })` runs\n * `iobroker add pi-agent` there and reports back to this instance with the messages `cmdStdout`, `cmdStderr` and\n * `cmdExit` (the last one twice, because it gets lost sometimes) — {@link AdapterInstaller.handleMessage} takes them.\n *\n * `add` installs from the repository the system uses and creates an instance. An adapter that is not in that\n * repository (pi-agent is only in \"latest\") comes from npm with `url iobroker.<name>`, then `add` once more.\n */\n\nexport interface InstallerAdapter {\n sendToHost(host: string, command: string, message: ioBroker.MessagePayload): void;\n getForeignObjectAsync(id: string): Promise<ioBroker.Object | null | undefined>;\n getObjectViewAsync(\n design: 'system',\n search: 'instance',\n params: { startkey: string; endkey: string },\n ): Promise<{ rows: { id: string; value: ioBroker.Object }[] }>;\n log: ioBroker.Logger;\n}\n\nexport interface CommandResult {\n /** Exit code of the command, null when it was killed. */\n code: number | null;\n /** Its last output lines. */\n output: string[];\n}\n\ninterface Running {\n resolve: (result: CommandResult) => void;\n output: string[];\n timer: NodeJS.Timeout;\n}\n\n/** An npm install on a Raspberry Pi takes a while; a command that runs longer goes on on the host. */\nexport const COMMAND_TIMEOUT_MS = 15 * 60_000;\nconst KEEP_LINES = 30;\nconst NAME_RE = /^[a-z0-9][a-z0-9-]*$/;\n\nexport class AdapterInstaller {\n private readonly running = new Map<string, Running>();\n private busy = '';\n private seq = 0;\n\n constructor(\n private readonly adapter: InstallerAdapter,\n /** Host to install on: the one of this instance. */\n private readonly host: string,\n private readonly timeoutMs = COMMAND_TIMEOUT_MS,\n ) {}\n\n /** A `cmdStdout`/`cmdStderr`/`cmdExit` message of the host; false when it is none of ours. */\n handleMessage(command: string, message: unknown): boolean {\n if (command !== 'cmdStdout' && command !== 'cmdStderr' && command !== 'cmdExit') {\n return false;\n }\n const { id, data } = (message || {}) as { id?: unknown; data?: unknown };\n const run = typeof id === 'string' ? this.running.get(id) : undefined;\n if (!run) {\n return true; // the second cmdExit, or a command of an earlier run\n }\n if (command === 'cmdExit') {\n this.running.delete(id as string);\n clearTimeout(run.timer);\n run.resolve({ code: typeof data === 'number' ? data : null, output: run.output });\n return true;\n }\n const text = typeof data === 'string' ? data : data === undefined || data === null ? '' : JSON.stringify(data);\n for (const line of text.split(/\\r?\\n/)) {\n if (line.trim()) {\n run.output.push(line.trim());\n this.adapter.log.debug(`${this.host}: ${line.trim()}`);\n }\n }\n run.output.splice(0, Math.max(0, run.output.length - KEEP_LINES));\n return true;\n }\n\n /** Run `iobroker <cmd>` on the host. */\n run(cmd: string): Promise<CommandResult> {\n const id = `assistant-${Date.now()}-${++this.seq}`;\n this.adapter.log.info(`${this.host}: iobroker ${cmd}`);\n return new Promise(resolve => {\n const timer = setTimeout(() => {\n this.running.delete(id);\n resolve({\n code: null,\n output: [\n `iobroker ${cmd} still runs on ${this.host} after ${Math.ceil(this.timeoutMs / 60_000)} min — see the log of the host`,\n ],\n });\n }, this.timeoutMs);\n this.running.set(id, { resolve, output: [], timer });\n this.adapter.sendToHost(this.host, 'cmdExec', { id, data: cmd });\n });\n }\n\n /** An instance of the adapter: an enabled one first, on this host first. `pi-agent.0`, or null. */\n async findInstance(name: string): Promise<string | null> {\n const prefix = `system.adapter.${name}.`;\n const view = await this.adapter.getObjectViewAsync('system', 'instance', {\n startkey: prefix,\n endkey: `${prefix}香`,\n });\n const rank = (obj: ioBroker.Object): number =>\n (obj.common?.enabled ? 0 : 2) + ((obj.common as { host?: string })?.host === this.host ? 0 : 1);\n const rows = (view?.rows || [])\n .filter(row => row.value && /^\\d+$/.test(row.id.slice(prefix.length)))\n .sort((a, b) => rank(a.value) - rank(b.value) || a.id.localeCompare(b.id, undefined, { numeric: true }));\n return rows.length ? rows[0].id.slice('system.adapter.'.length) : null;\n }\n\n /** Install the adapter if needed and create an instance if there is none. */\n async ensure(name: string): Promise<{ instance: string; installed: boolean }> {\n if (!NAME_RE.test(name)) {\n throw new Error(`Invalid adapter name \"${name}\"`);\n }\n const existing = await this.findInstance(name);\n if (existing) {\n return { instance: existing, installed: false };\n }\n if (this.busy) {\n throw new Error(`${this.busy} is being installed right now`);\n }\n this.busy = name;\n try {\n const installed = async (): Promise<boolean> =>\n !!(await this.adapter.getForeignObjectAsync(`system.adapter.${name}`));\n let add = await this.runToEnd(`add ${name}`);\n if (!(await this.findInstance(name))) {\n if (!(await installed())) {\n // not in the repository the system uses: the newest version from npm\n const npm = await this.runToEnd(`url iobroker.${name}`);\n if (!(await installed())) {\n throw new Error(\n `${name} could not be installed — neither from the repository (${lastError(add)}) nor from npm (${lastError(npm)})`,\n );\n }\n }\n add = await this.runToEnd(`add ${name}`);\n }\n const instance = await this.findInstance(name);\n if (!instance) {\n throw new Error(`${name} is installed, but no instance was created: ${lastError(add)}`);\n }\n this.adapter.log.info(`${instance} installed on ${this.host}`);\n return { instance, installed: true };\n } finally {\n this.busy = '';\n }\n }\n\n /** {@link run}, but a command that did not end (timeout, adapter stops) ends the installation: it still runs. */\n private async runToEnd(cmd: string): Promise<CommandResult> {\n const result = await this.run(cmd);\n if (result.code === null) {\n throw new Error(result.output[result.output.length - 1] || `iobroker ${cmd} did not end`);\n }\n return result;\n }\n\n /** Ends waiting commands (the adapter stops); they go on on the host. */\n stop(): void {\n for (const [id, run] of this.running) {\n clearTimeout(run.timer);\n run.resolve({ code: null, output: ['the adapter stopped'] });\n this.running.delete(id);\n }\n }\n}\n\n/** The line that says why a command failed: an error line, else the last one. */\nfunction lastError(result: CommandResult): string {\n const lines = result.output;\n const error = [...lines].reverse().find(line => /error|unknown|not found|cannot|failed/i.test(line));\n const line = error || lines[lines.length - 1] || '';\n return `exit code ${result.code ?? '–'}${line ? `: ${line.slice(0, 300)}` : ''}`;\n}\n"]}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ /**
3
+ * Messages that reach `onMessage` but are no request.
4
+ *
5
+ * js-controller hands a reply (`callback.ack`) to the callback that waits for it; when that callback is gone, the reply
6
+ * arrives as a message of its own. That happens when the adapter restarted while another adapter was still answering
7
+ * it: a pi-agent answer that comes after an update of the assistant. Answering such a reply sends it back with the same
8
+ * `callback`, and a caller that does the same keeps both adapters in a loop (field report 2026-11-13: about 25 empty
9
+ * `ask` a second between assistant.0 and pi-agent.0 after an update of the assistant).
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.isLateReply = isLateReply;
13
+ /** Whether the message is a late reply to a request of ours rather than a request. */
14
+ function isLateReply(obj) {
15
+ return !!obj?.callback?.ack;
16
+ }
17
+ //# sourceMappingURL=messages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/lib/messages.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;AAGH,kCAEC;AAHD,sFAAsF;AACtF,SAAgB,WAAW,CAAC,GAA+D;IACvF,OAAO,CAAC,CAAC,GAAG,EAAE,QAAQ,EAAE,GAAG,CAAC;AAChC,CAAC","sourcesContent":["/**\n * Messages that reach `onMessage` but are no request.\n *\n * js-controller hands a reply (`callback.ack`) to the callback that waits for it; when that callback is gone, the reply\n * arrives as a message of its own. That happens when the adapter restarted while another adapter was still answering\n * it: a pi-agent answer that comes after an update of the assistant. Answering such a reply sends it back with the same\n * `callback`, and a caller that does the same keeps both adapters in a loop (field report 2026-11-13: about 25 empty\n * `ask` a second between assistant.0 and pi-agent.0 after an update of the assistant).\n */\n\n/** Whether the message is a late reply to a request of ours rather than a request. */\nexport function isLateReply(obj: { callback?: { ack?: boolean } | null } | null | undefined): boolean {\n return !!obj?.callback?.ack;\n}\n"]}