iobroker.assistant 1.4.15 → 1.5.0

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.5.0 (2026-11-09)
241
+ * (@GermanBluefox) Added an assistant chat and a live view of the voice satellites for Aura and other dashboards
242
+
240
243
  ### 1.4.15 (2026-11-08)
241
244
  * (@GermanBluefox) OpenAI: use `max_completion_tokens` so newer (reasoning) models like gpt-5-mini work (#21)
242
245
 
@@ -0,0 +1,321 @@
1
+ import{createRoot as e,useLayoutEffect as t,useRef as n,useState as r,Fragment as i,jsx as a,jsxs as o}from"../../../lib/esm/react-19.js";var s=`iob-dialog-close`;function c(e){return!!e.form}var l=[`header`,`staticText`,`divider`];function u(e,t){return e==null?``:typeof e==`object`?e[t]||e.en||Object.values(e).find(e=>!!e)||``:String(e)}function d(e){let t={};for(let[n,r]of Object.entries(e.items||{}))r&&!l.includes(r.type)&&(t[n]=r.type);return t}function f(e){return typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?e.toString():JSON.stringify(e)}function p(e,t){if(t!=null)switch(e){case`number`:case`slider`:{if(typeof t==`number`)return Number.isFinite(t)?t:void 0;let e=f(t).trim().replace(`,`,`.`);if(!e)return;let n=Number(e);return Number.isFinite(n)?n:void 0}case`checkbox`:return t===!0||t===`true`||t===1||t===`1`;default:return f(t)}}function m(e,t){let n={};for(let[r,i]of Object.entries(e)){let e=p(i,t[r]);e!==void 0&&(n[r]=e)}return n}var h=`"Roboto", "Helvetica", "Arial", sans-serif`,g=Object.freeze({type:`light`,primary:`#3399CC`,primaryContrast:`#FFFFFF`,secondary:`#164477`,secondaryContrast:`#FFFFFF`,background:`#FFFFFF`,paper:`#FFFFFF`,text:`rgba(0, 0, 0, 0.87)`,textSecondary:`rgba(0, 0, 0, 0.6)`,divider:`rgba(0, 0, 0, 0.12)`,error:`#D32F2F`,warning:`#ED6C02`,info:`#0288D1`,success:`#2E7D32`,fontFamily:h,fontSize:14,borderRadius:4}),_=Object.freeze({type:`dark`,primary:`#4DABF5`,primaryContrast:`rgba(0, 0, 0, 0.87)`,secondary:`#436A93`,secondaryContrast:`#FFFFFF`,background:`#121212`,paper:`#121212`,text:`#FFFFFF`,textSecondary:`rgba(255, 255, 255, 0.7)`,divider:`rgba(255, 255, 255, 0.12)`,error:`#F44336`,warning:`#FFA726`,info:`#29B6F6`,success:`#66BB6A`,fontFamily:h,fontSize:14,borderRadius:4}),v=[`primary`,`primaryContrast`,`secondary`,`secondaryContrast`,`background`,`paper`,`text`,`textSecondary`,`divider`,`error`,`warning`,`info`,`success`,`fontFamily`],y=[`fontSize`,`borderRadius`];function b(e){return{...e===`dark`?_:g}}function x(e){if(!e||typeof e!=`object`)return b(typeof e==`string`?e:`light`);let t=e,n=b(typeof t.type==`string`?t.type:`light`);for(let e of v){let r=t[e];typeof r==`string`&&r.trim()&&(n[e]=r.trim())}for(let e of y){let r=t[e],i=typeof r==`string`?parseFloat(r):r;typeof i==`number`&&Number.isFinite(i)&&i>=0&&(n[e]=i)}return n}function S(e,t){return e.type===t.type&&v.every(n=>e[n]===t[n])&&y.every(n=>e[n]===t[n])}function C(e){return`--iob-${e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}`}function w(e){let t={};for(let n of v)t[C(n)]=e[n];for(let n of y)t[C(n)]=`${e[n]}px`;return t[`color-scheme`]=e.type,t}var T={ok:{en:`OK`,"zh-cn":`确定`},cancel:{en:`Cancel`,de:`Abbrechen`,ru:`Отмена`,pt:`Cancelar`,nl:`Annuleren`,fr:`Annuler`,it:`Annulla`,es:`Cancelar`,pl:`Anuluj`,uk:`Скасувати`,"zh-cn":`取消`},close:{en:`Close`,de:`Schließen`,ru:`Закрыть`,pt:`Fechar`,nl:`Sluiten`,fr:`Fermer`,it:`Chiudi`,es:`Cerrar`,pl:`Zamknij`,uk:`Закрити`,"zh-cn":`关闭`}},E=`
2
+ dialog {
3
+ box-sizing: border-box;
4
+ width: 480px;
5
+ max-width: calc(100vw - 32px);
6
+ max-height: calc(100vh - 32px);
7
+ padding: 0;
8
+ border: 0;
9
+ border-radius: calc(var(--iob-border-radius) * 2);
10
+ background: var(--iob-paper);
11
+ color: var(--iob-text);
12
+ font-family: var(--iob-font-family);
13
+ font-size: var(--iob-font-size);
14
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
15
+ }
16
+ /* as the dialogs of MUI: a dark paper gets lighter the higher it lies */
17
+ dialog.dark { background-image: linear-gradient(rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.16)); }
18
+ dialog::backdrop { background: rgba(0, 0, 0, 0.5); }
19
+ dialog:focus { outline: none; }
20
+ form { display: flex; flex-direction: column; height: 100%; max-height: inherit; margin: 0; }
21
+ header { display: flex; align-items: center; gap: 8px; padding: 12px 8px 12px 16px; font-size: 1.15em; font-weight: 500; }
22
+ header span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
23
+ .body { flex: 1; min-height: 0; padding: 0 16px 16px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
24
+ footer { display: flex; justify-content: flex-end; gap: 8px; padding: 0 16px 16px; }
25
+ button { font: inherit; padding: 6px 16px; border-radius: var(--iob-border-radius); border: 1px solid var(--iob-primary); background: transparent; color: var(--iob-primary); cursor: pointer; }
26
+ button.primary { background: var(--iob-primary); color: var(--iob-primary-contrast); }
27
+ button.close { border: 0; padding: 2px 8px; font-size: 1.4em; line-height: 1; color: var(--iob-text-secondary); }
28
+ label { display: flex; flex-direction: column; gap: 4px; }
29
+ label.check { flex-direction: row; align-items: center; gap: 8px; }
30
+ input, select, textarea { font: inherit; accent-color: var(--iob-primary); }
31
+ .help { color: var(--iob-text-secondary); font-size: 0.85em; }
32
+ h3 { margin: 4px 0 0; font-size: 1em; }
33
+ p { margin: 0; }
34
+ hr { width: 100%; border: 0; border-top: 1px solid var(--iob-divider); margin: 0; }
35
+ [hidden] { display: none !important; }
36
+ `;function D(e){if(!e)return null;try{let t=Function(`data`,`return (${e});`);return e=>{try{return!!t(e)}catch{return!1}}}catch{return null}}function O(e){return typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):``}function k(e){let{input:t,setting:n}=e;if(t)return t instanceof HTMLInputElement&&t.type===`checkbox`?t.checked:t instanceof HTMLSelectElement?n.options?.[t.selectedIndex]?.value:t.value}function ee(e,t,n,r,i){let a={name:t,setting:n,box:e.createElement(`div`),hidden:D(n.hidden),disabled:D(n.disabled)},o=u(n.label,i);switch(n.type){case`header`:return a.box=e.createElement(`h3`),a.box.textContent=u(n.text,i)||o,a;case`staticText`:return a.box=e.createElement(`p`),a.box.textContent=u(n.text,i)||o,a;case`divider`:return a.box=e.createElement(`hr`),a}let s=e.createElement(`label`);a.box=s;let c=e.createElement(`span`);if(c.textContent=o||t,n.type===`checkbox`){let t=e.createElement(`input`);t.type=`checkbox`,t.checked=r===!0||r===`true`,s.className=`check`,s.append(t,c),a.input=t}else if(n.type===`select`){let t=e.createElement(`select`);for(let r of n.options||[]){let n=e.createElement(`option`);n.textContent=u(r.label,i),t.append(n)}let o=(n.options||[]).findIndex(e=>String(e.value)===O(r));t.selectedIndex=o===-1?0:o,s.append(c,t),a.input=t}else if(n.type===`text`&&(n.minRows||1)>1){let t=e.createElement(`textarea`);t.rows=n.minRows||2,t.value=O(r),s.append(c,t),a.input=t}else{let t=e.createElement(`input`),i=O(r);switch(n.type){case`number`:case`slider`:t.type=n.type===`slider`?`range`:`number`,n.min!==void 0&&(t.min=String(n.min)),n.max!==void 0&&(t.max=String(n.max)),t.step=n.step===void 0?`any`:String(n.step);break;case`password`:t.type=`password`;break;case`color`:t.type=!i||/^#[0-9a-f]{6}$/i.test(i)?`color`:`text`;break;default:t.type=`text`}if(t.value=i,t.type===`range`){let n=e.createElement(`output`);n.textContent=t.value,t.addEventListener(`input`,()=>n.textContent=t.value),c.append(`: `,n)}s.append(c,t),a.input=t}if(n.help){let t=e.createElement(`span`);t.className=`help`,t.textContent=u(n.help,i),s.append(t)}return a}function te(e,t={}){let n=t.lang||`en`,r=document,i=e=>T[e][n]||T[e].en||e,a=r.createElement(`div`);a.setAttribute(`data-iob-dialog`,``);let o=a.attachShadow({mode:`open`}),l=r.createElement(`style`);l.textContent=E;let f=r.createElement(`dialog`),p=x(t.theme);f.className=p.type===`dark`?`dark`:``;for(let[e,t]of Object.entries(w(p)))f.style.setProperty(e,t);e.width&&(f.style.width=`${e.width}px`),e.height&&(f.style.height=`${e.height}px`);let h=r.createElement(`form`),g=r.createElement(`header`),_=r.createElement(`span`);_.textContent=u(e.title,n);let v=r.createElement(`button`);v.type=`button`,v.className=`close`,v.title=i(`close`),v.setAttribute(`aria-label`,i(`close`)),v.textContent=`×`,g.append(_,v);let y=r.createElement(`div`);return y.className=`body`,h.append(g,y),f.append(h),o.append(l,f),new Promise(t=>{let l=!1,p=e=>{l||(l=!0,f.open&&f.close(),a.remove(),t(e))};if(v.addEventListener(`click`,()=>p(null)),f.addEventListener(`close`,()=>p(null)),h.addEventListener(`submit`,e=>e.preventDefault()),c(e)){let t={},a=[];for(let[t,i]of Object.entries(e.form.items||{})){let o=e.data?.[t]??i.default,s=ee(r,t,i,o,n);a.push(s),y.append(s.box)}let o=()=>{for(let e of a)e.input&&(t[e.name]=k(e));return t},s=()=>{let e=o();for(let t of a)t.box.hidden=t.hidden?t.hidden(e):!1,t.input&&(t.input.disabled=t.disabled?t.disabled(e):!1)};h.addEventListener(`input`,s),h.addEventListener(`change`,s),s();let c=a.find(e=>e.input&&!e.box.hidden&&!e.input.disabled);c?.input&&(c.input.autofocus=!0);let l=r.createElement(`footer`),f=r.createElement(`button`);f.type=`button`,f.textContent=u(e.cancel,n)||i(`cancel`),f.addEventListener(`click`,()=>p(null));let g=r.createElement(`button`);g.type=`submit`,g.className=`primary`,g.textContent=u(e.ok,n)||i(`ok`),l.append(f,g),h.append(l),h.addEventListener(`submit`,()=>p(m(d(e.form),o())))}else y.append(e.element),f.addEventListener(s,e=>p(e.detail??null));r.body.append(a),f.showModal(),o.activeElement&&o.activeElement!==v||(f.tabIndex=-1,f.focus())})}function A(e){return[...new Set(e.filter(e=>typeof e==`string`&&!!e))]}var j=[`socket`,`dialogs`,`theme`,`editMode`,`settings`,`value`],M=class extends HTMLElement{states={};objects={};#e=null;#t={};#n=x(`light`);#r=!1;#i=null;#a=void 0;#o=null;#s=!1;#c=(e,t)=>{this.#o?.states.includes(e)&&(this.states[e]=t||null,this.#_())};#l=(e,t)=>{this.#o?.objects.includes(e)&&(this.objects[e]=t||null,this.#d())};get socket(){return this.#e}set socket(e){this.#e=e||null,this.#d()}get settings(){return this.#t}set settings(e){this.#t=e||{},this.#d()}get theme(){return this.#n}set theme(e){let t=x(e);S(t,this.#n)||(this.#n=t,this.#u(),this.#_())}get editMode(){return this.#r}set editMode(e){let t=!!e;t!==this.#r&&(this.#r=t,this.#_())}get dialogs(){return this.#i}set dialogs(e){this.#i=e||null}get value(){return this.#a}set value(e){e!==this.#a&&(this.#a=e,this.#_())}connectedCallback(){for(let e of j)if(Object.prototype.hasOwnProperty.call(this,e)){let t=this[e];delete this[e],this[e]=t}this.#u(),this.#d()}disconnectedCallback(){this.#g()}getStateIds(e){return[]}getObjectIds(e){return[]}get systemLang(){return this.#e?.systemLang||`en`}text(e){return u(e,this.systemLang)}setState(e,t){return this.#e&&!this.#r?this.#e.setState(e,t):Promise.resolve()}changeValue(e){return this.#r||this.emit(`iob-change`,e)?!1:(this.value=e,!0)}emit(e,t){return this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0,cancelable:!0}))}async openDialog(e){if(this.#r)return null;let t=this.#i?await this.#i.open(e):await te(e,{lang:this.systemLang,theme:this.#n});return c(e)?t&&typeof t==`object`?m(d(e.form),t):null:t??null}#u(){for(let[e,t]of Object.entries(w(this.#n)))this.style.setProperty(e,t)}#d(){if(!this.isConnected)return;let e=this.#e,t=e?A(this.getStateIds(this.#t)):[],n=e?A(this.getObjectIds(this.#t)):[];this.#o&&this.#o.socket!==e&&this.#g();let r=this.#o?.states||[],i=this.#o?.objects||[],a=r.filter(e=>!t.includes(e)),o=i.filter(e=>!n.includes(e)),s=t.filter(e=>!r.includes(e)),c=n.filter(e=>!i.includes(e));e&&a.length&&e.unsubscribeState(a,this.#c),e&&o.length&&this.#h(e,o);for(let e of a)delete this.states[e];for(let e of[...a,...o])!t.includes(e)&&!n.includes(e)&&delete this.objects[e];this.#o=e&&(t.length||n.length)?{socket:e,states:t,objects:n}:null,e&&s.length&&this.#p(e,s),e&&c.length&&this.#m(e,c),this.#_()}#f(e,t,n){return this.#o?.socket===e&&this.#o[t].includes(n)}#p(e,t){e.subscribeState(t,this.#c).catch(e=>console.warn(`<${this.localName}>: cannot subscribe ${t.join(`, `)}: ${e}`));for(let n of t)e.getState(n).then(t=>{this.#f(e,`states`,n)&&this.states[n]===void 0&&(this.states[n]=t||null,this.#_())}).catch(()=>{}),e.getObject(n).then(t=>{this.#f(e,`states`,n)&&!this.#f(e,`objects`,n)&&(this.objects[n]=t||null,this.#_())}).catch(()=>{})}#m(e,t){e.subscribeObject(t,this.#l).catch(e=>console.warn(`<${this.localName}>: cannot subscribe the objects ${t.join(`, `)}: ${e}`));for(let n of t)e.getObject(n).then(t=>{this.#f(e,`objects`,n)&&(this.objects[n]=t||null,this.#d())}).catch(()=>{})}#h(e,t){e.unsubscribeObject(t,this.#l).catch(()=>{})}#g(){if(this.#o){let{socket:e,states:t,objects:n}=this.#o;t.length&&e.unsubscribeState(t,this.#c),n.length&&this.#h(e,n),this.#o=null}this.states={},this.objects={}}#_(){this.#s||(this.#s=!0,queueMicrotask(()=>{this.#s=!1,this.isConnected&&this.render()}))}};function N(e,t){let n=typeof e==`string`?e:e.tag;customElements.get(n)||customElements.define(n,t)}var P=16e3,F=30,I=P*F/1e3,ne=.02,re=400,ie={minStartLevel:400,minEndLevel:240,startFactor:3.5,endFactor:2,silenceMs:1e3,longSilenceMs:1600,longAfterMs:2500,minSpeechMs:250,speechGapMs:300,maxMs:3e4,preRollMs:400,tailMs:300,warmupMs:150};function ae(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n]*e[n];return Math.sqrt(t/e.length)}var oe=class{opts;pending=/* @__PURE__ */ new Int16Array;floor=null;seenMs=0;history=[];frames=null;speech=!1;voicedMs=0;quietMs=0;spokenMs=0;level=0;constructor(e={}){this.opts={...ie,...e}}get startLevel(){return Math.max(this.opts.minStartLevel,(this.floor??0)*this.opts.startFactor)}get endLevel(){return Math.min(this.startLevel,Math.max(this.opts.minEndLevel,(this.floor??0)*this.opts.endFactor))}get hearing(){return this.frames!==null}reset(){this.pending=/* @__PURE__ */ new Int16Array,this.history=[],this.frames=null,this.speech=!1,this.voicedMs=0,this.quietMs=0,this.spokenMs=0,this.level=0}push(e){let t=e;this.pending.length&&(t=new Int16Array(this.pending.length+e.length),t.set(this.pending),t.set(e,this.pending.length));let n=0,r=null;for(;t.length-n>=I;){let e=t.slice(n,n+I);n+=I,r=this.frame(e)||r}return this.pending=t.slice(n),r}frame(e){let t=this.opts,n=ae(e);if(this.level=n,this.seenMs+=F,this.floor=this.floor===null?0:n<this.floor?n:this.frames?this.floor:this.floor+(n-this.floor)*ne,!this.frames)return this.history.push(e),this.history.length>Math.ceil(t.preRollMs/F)+1&&this.history.shift(),this.seenMs>=t.warmupMs&&n>=this.startLevel&&(this.frames=this.history,this.history=[],this.voicedMs=F,this.quietMs=0),null;this.frames.push(e);let r=n>=this.endLevel;if(!this.speech){if(r)this.voicedMs+=F,this.quietMs=0;else if(this.quietMs+=F,this.quietMs>=t.speechGapMs)return this.history=this.frames.slice(-(Math.ceil(t.preRollMs/F)+1)),this.frames=null,null;return this.voicedMs>=t.minSpeechMs&&(this.speech=!0,this.spokenMs=this.voicedMs+this.quietMs),null}this.spokenMs+=F,r?this.quietMs=0:this.quietMs+=F;let i=this.spokenMs-this.quietMs,a=t.longAfterMs&&i>=t.longAfterMs?t.longSilenceMs:t.silenceMs;if(this.quietMs>=a||this.spokenMs>=t.maxMs){let e=Math.max(0,Math.floor((this.quietMs-t.tailMs)/F)),n=this.frames.slice(0,this.frames.length-e);return this.reset(),se(n)}return null}};function se(e){let t=new Int16Array(e.reduce((e,t)=>e+t.length,0)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t}var ce=class{pos=0;last=0;ratio;constructor(e){this.ratio=e/P}process(e){let t=new Int16Array(Math.ceil((e.length+1)/this.ratio)+1),n=0;for(;this.pos<e.length-1;){let r=Math.floor(this.pos),i=r<0?this.last:e[r],a=i+(e[r+1]-i)*(this.pos-r);t[n++]=Math.round(Math.max(-1,Math.min(1,a))*32767),this.pos+=this.ratio}return this.pos-=e.length,this.last=e.length?e[e.length-1]:this.last,t.subarray(0,n)}};function L(e){let t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),n=``;for(let e=0;e<t.length;e+=32768)n+=String.fromCharCode(...t.subarray(e,e+32768));return btoa(n)}var R=class{handlers;context=null;stream=null;node=null;resampler=null;detector=new oe;busy=!1;resumeAt=0;stopped=!1;constructor(e){this.handlers=e}static get supported(){return typeof window<`u`&&window.isSecureContext&&!!navigator.mediaDevices?.getUserMedia}async start(){let e=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0,channelCount:1}});if(this.stopped){e.getTracks().forEach(e=>e.stop());return}let t=new AudioContext;t.state===`suspended`&&await t.resume();let n=t.createMediaStreamSource(e),r=t.createScriptProcessor(2048,1,1);this.resampler=new ce(t.sampleRate),r.onaudioprocess=e=>this.onAudio(e.inputBuffer.getChannelData(0)),n.connect(r),r.connect(t.destination),this.context=t,this.stream=e,this.node=r}stop(){this.stopped=!0,this.node&&(this.node.onaudioprocess=null,this.node.disconnect()),this.stream?.getTracks().forEach(e=>e.stop()),this.context?.close().catch(()=>{}),this.node=null,this.stream=null,this.context=null}onAudio(e){if(this.stopped||!this.resampler)return;let t=this.resampler.process(e);if(this.busy||Date.now()<this.resumeAt)return;let n=this.detector.push(t);this.handlers.onLevel?.(Math.min(1,this.detector.level/this.detector.startLevel),this.detector.hearing),n&&(this.busy=!0,this.handlers.onLevel?.(0,!1),this.handlers.onUtterance(n).catch(()=>{}).finally(()=>{this.busy=!1,this.resumeAt=Date.now()+re,this.detector.reset()}))}},z={stop:`custom_assistant_Stop word`,askReply:`custom_assistant_Reply to a question`,routine:`custom_assistant_Routine`,nlu:`custom_assistant_Rule-based NLU`,localLlm:`custom_assistant_Local LLM`,cloud:`custom_assistant_Cloud LLM`,none:`custom_assistant_Not understood`},B={stop:`#78909c`,askReply:`#78909c`,routine:`#00897b`,nlu:`#43a047`,localLlm:`#8e24aa`,cloud:`#1e88e5`,none:`#e53935`};({...z}),{...B};function V(e){return typeof e==`string`?`"${e}"`:JSON.stringify(e)}function H(e){return e===void 0?``:Math.abs(e)<1e3?`${Math.round(e)} ms`:`${(e/1e3).toFixed(1)} s`}var U={chat:`M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2M6 9h12v2H6zm8 5H6v-2h8zm4-6H6V6h12z`,speaker:`M17 2H7c-1.1 0-2 .9-2 2v16c0 1.1.9 1.99 2 1.99L17 22c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-5 2c1.1 0 2 .9 2 2s-.9 2-2 2c-1.11 0-2-.9-2-2s.89-2 2-2m0 16c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3`,send:`M2.01 21 23 12 2.01 3 2 10l15 2-15 2z`,mic:`M12 14c1.66 0 2.99-1.34 2.99-3L15 5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3m5.3-3c0 3-2.54 5.1-5.3 5.1S6.7 14 6.7 11H5c0 3.41 2.72 6.23 6 6.72V21h2v-3.28c3.28-.48 6-3.3 6-6.72z`,dialog:`M9 13c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4m6.08-7.95c.84 1.18.84 2.71 0 3.89l1.68 1.69c2.02-2.02 2.02-5.07 0-7.27zM20.07 2l-1.63 1.63c2.77 3.02 2.77 7.56 0 10.74L20.07 16c3.9-3.89 3.91-9.95 0-14`,volumeOn:`M3 9v6h4l5 5V4L7 9zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02M14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77`,volumeOff:`M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63m2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71M4.27 3 3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9zM12 4 9.91 6.09 12 8.18z`,announce:`M18 11v2h4v-2zm-2 6.61c.96.71 2.21 1.65 3.2 2.39.4-.53.8-1.07 1.2-1.6-.99-.74-2.24-1.68-3.2-2.4-.4.54-.8 1.08-1.2 1.61M20.4 5.6c-.4-.53-.8-1.07-1.2-1.6-.99.74-2.24 1.68-3.2 2.4.4.53.8 1.07 1.2 1.6.96-.72 2.21-1.65 3.2-2.4M4 9c-1.1 0-2 .9-2 2v2c0 1.1.9 2 2 2h1v4h2v-4h1l5 3V6L8 9zm11.5 3c0-1.33-.58-2.53-1.5-3.35v6.69c.92-.81 1.5-2.01 1.5-3.34`};function W({path:e}){return/* @__PURE__ */ a(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:/* @__PURE__ */ a(`path`,{d:e})})}function le({text:e,icon:t,editMode:n}){return/* @__PURE__ */ o(`div`,{className:`hint${n?` edit`:``}`,children:[/* @__PURE__ */ a(W,{path:t}),/* @__PURE__ */ a(`span`,{children:e})]})}var ue={chat:`transport_chat`,script:`transport_script`,state:`transport_state`},de={chat:`Chat`,script:`Script`,state:`State`,telegram:`Telegram`,esphome:`ESPHome`,udp:`UDP`,native:`ioBroker`,wyoming:`Wyoming`};function fe(e,t){try{return new Date(e).toLocaleTimeString(t,{hour:`2-digit`,minute:`2-digit`})}catch{return new Date(e).toLocaleTimeString()}}function G({role:e,ts:t,locale:n,header:r,children:i}){return/* @__PURE__ */ a(`div`,{className:`row ${e}`,children:/* @__PURE__ */ o(`div`,{className:`bubble`,children:[r,/* @__PURE__ */ a(`div`,{children:i}),/* @__PURE__ */ a(`div`,{className:`time`,children:fe(t,n)})]})})}function pe({entry:e,allRequests:t,details:n,word:r}){let i=[];if(t){let t=ue[e.transport];i.push(t?r(t):de[e.transport]||e.transport);let n=e.satellite||(e.transport===`chat`||e.transport===`state`?``:e.source);n&&i.push(n),e.room&&e.room!==n&&i.push(e.room)}return n&&e.wakeWord!==void 0&&i.push(`🎙 ${e.wakeWord||r(`followUp`)}`),n&&e.sttMs!==void 0&&i.push(`STT ${H(e.sttMs)}`),i.length?/* @__PURE__ */ a(`div`,{className:`chips`,children:i.map((e,t)=>/* @__PURE__ */ a(`span`,{className:`chip`,children:e},t))}):null}function me({entry:e,word:t}){return e.done?/* @__PURE__ */ o(`div`,{className:`details`,children:[/* @__PURE__ */ o(`div`,{className:`line`,children:[e.tier?/* @__PURE__ */ a(`span`,{className:`chip tier`,style:{"--tier":B[e.tier]},children:t(`tier_${e.tier}`)}):null,e.detail?/* @__PURE__ */ a(`span`,{className:`mono`,children:e.detail}):null,e.ms===void 0?null:/* @__PURE__ */ a(`span`,{children:H(e.ms)}),e.ttsMs===void 0?null:/* @__PURE__ */ o(`span`,{children:[`TTS `,H(e.ttsMs)]}),e.followUp?/* @__PURE__ */ a(`span`,{children:t(`waitsForReply`)}):null]}),e.written.map((e,n)=>/* @__PURE__ */ o(`div`,{className:`mono`,title:t(`States written`),children:[`✏️ `,e.id,` = `,V(e.value)]},n))]}):null}function K({word:e}){return/* @__PURE__ */ o(`div`,{className:`thinking`,children:[/* @__PURE__ */ a(`span`,{className:`spinner`}),/* @__PURE__ */ a(`span`,{children:e(`Thinking…`)})]})}function he({entry:e,allRequests:t,details:n,locale:r,word:s}){let c;return c=e.done?e.error?/* @__PURE__ */ a(G,{role:`error`,ts:e.ts+(e.ms||0),locale:r,children:e.error}):/* @__PURE__ */ a(G,{role:`assistant`,ts:e.ts+(e.ms||0),locale:r,children:e.answer||/* @__PURE__ */ a(`span`,{className:`silent`,children:s(`noSpokenAnswer`)})}):/* @__PURE__ */ a(K,{word:s}),/* @__PURE__ */ o(i,{children:[/* @__PURE__ */ a(G,{role:`user`,ts:e.ts,locale:r,header:/* @__PURE__ */ a(pe,{entry:e,allRequests:t,details:n,word:s}),children:e.question}),c,n?/* @__PURE__ */ a(me,{entry:e,word:s}):null]})}function ge(e,t){switch(e){case`listening`:return`Dialog: listening…`;case`hearing`:return`Dialog: hearing you…`;case`thinking`:return`Dialog: thinking…`;case`speaking`:return`Dialog: speaking…`;default:return t?`Listening…`:`Type a message…`}}function _e(e){let{items:i,ready:s,sending:c,dialog:l,listening:u,editMode:d,word:f,locale:p}=e,[m,h]=r(``),g=n(null),_=n(!0);t(()=>{let e=g.current;e&&_.current&&(e.scrollTop=e.scrollHeight)});let v=s&&!d&&!l,y=()=>{let t=m.trim();t&&v&&!c&&(e.onSend(t),h(``),_.current=!0)},b=e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),y())},x=`Dialog: everything you say becomes a question`;l?x=`End the dialog`:e.voiceEnabled||(x=`voiceOff`);let S=l===`hearing`?`hearing`:l===`speaking`?`speaking busy`:`busy`;return/* @__PURE__ */ o(`div`,{className:`chat${d?` edit`:``}`,children:[s?null:/* @__PURE__ */ a(`div`,{className:`banner`,children:f(`Start the assistant instance to chat.`)}),/* @__PURE__ */ o(`div`,{ref:g,className:`list`,onScroll:()=>{let e=g.current;_.current=!e||e.scrollHeight-e.scrollTop-e.clientHeight<60},children:[i.length?i.map(t=>t.entry?/* @__PURE__ */ a(he,{entry:t.entry,allRequests:e.allRequests,details:e.details,locale:p,word:f},t.key):/* @__PURE__ */ a(G,{role:t.message.role,ts:t.message.ts,locale:p,children:t.message.text},t.key)):/* @__PURE__ */ a(`div`,{className:`empty`,children:f(`No messages yet. Type a question below.`)}),e.thinking?/* @__PURE__ */ a(K,{word:f}):null]}),l?/* @__PURE__ */ a(`div`,{className:`level ${l===`listening`?``:S}`,children:/* @__PURE__ */ a(`span`,{style:l===`listening`||l===`hearing`?{width:`${Math.round(e.dialogLevel*100)}%`}:void 0})}):null,/* @__PURE__ */ o(`div`,{className:`composer`,children:[e.dialogSupported?/* @__PURE__ */ a(`button`,{type:`button`,className:`icon-btn ${l?`on`:`primary`}`,title:f(x),"aria-label":f(x),disabled:d||!l&&(!s||c||!e.voiceEnabled),onClick:e.onDialog,children:/* @__PURE__ */ a(W,{path:U.dialog})}):null,e.micSupported&&!l?/* @__PURE__ */ a(`button`,{type:`button`,className:`icon-btn ${u?`on`:`primary`}`,title:f(u?`Stop listening`:`Speak`),"aria-label":f(u?`Stop listening`:`Speak`),disabled:!s||c||d,onClick:e.onMic,children:/* @__PURE__ */ a(W,{path:U.mic})}):null,/* @__PURE__ */ a(`textarea`,{className:`field`,rows:1,value:m,placeholder:f(ge(l,u)),disabled:!v||c,onChange:e=>h(e.target.value),onKeyDown:b}),e.speakSupported?/* @__PURE__ */ a(`button`,{type:`button`,className:`icon-btn${e.speak?` primary`:``}`,title:f(e.speak?`Stop reading answers aloud`:`Read answers aloud`),"aria-label":f(e.speak?`Stop reading answers aloud`:`Read answers aloud`),"aria-pressed":e.speak,disabled:d,onClick:e.onSpeak,children:/* @__PURE__ */ a(W,{path:e.speak?U.volumeOn:U.volumeOff})}):null,/* @__PURE__ */ a(`button`,{type:`button`,className:`icon-btn filled`,title:f(`send`),"aria-label":f(`send`),disabled:!v||c||!m.trim(),onClick:y,children:/* @__PURE__ */ a(W,{path:U.send})})]})]})}var ve=`iob-assistant-chat`;function q(e){let t=(e||``).trim().replace(/^system\.adapter\./,``);return/^assistant\.\d+$/.test(t)?t:``}var J=[`Type a message…`,`Listening…`,`Thinking…`,`Speak`,`Stop listening`,`Read answers aloud`,`Stop reading answers aloud`,`No messages yet. Type a question below.`,`Start the assistant instance to chat.`,`States written`,`Dialog: listening…`,`Dialog: hearing you…`,`Dialog: thinking…`,`Dialog: speaking…`,`End the dialog`,`Dialog: everything you say becomes a question`,`The microphone could not be opened:`],Y={en:{"Type a message…":`Type a message…`,"Listening…":`Listening…`,"Thinking…":`Thinking…`,Speak:`Speak`,"Stop listening":`Stop listening`,"Read answers aloud":`Read answers aloud`,"Stop reading answers aloud":`Stop reading answers aloud`,"No messages yet. Type a question below.":`No messages yet. Type a question below.`,"Start the assistant instance to chat.":`Start the assistant instance to chat.`,"States written":`States written`,"Dialog: listening…":`Dialog: listening …`,"Dialog: hearing you…":`Dialog: hearing you …`,"Dialog: thinking…":`Dialog: thinking …`,"Dialog: speaking…":`Dialog: speaking …`,"End the dialog":`End the dialog`,"Dialog: everything you say becomes a question":`Dialog: everything you say becomes a question — until you end it`,"The microphone could not be opened:":`The microphone could not be opened:`},de:{"Type a message…":`Nachricht eingeben …`,"Listening…":`Höre zu …`,"Thinking…":`Denkt nach …`,Speak:`Sprechen`,"Stop listening":`Zuhören beenden`,"Read answers aloud":`Antworten vorlesen`,"Stop reading answers aloud":`Vorlesen beenden`,"No messages yet. Type a question below.":`Noch keine Nachrichten. Geben Sie unten eine Frage ein.`,"Start the assistant instance to chat.":`Starten Sie die Assistenteninstanz, um zu chatten.`,"States written":`Geschriebene States`,"Dialog: listening…":`Dialog: höre zu …`,"Dialog: hearing you…":`Dialog: höre dich …`,"Dialog: thinking…":`Dialog: denke nach …`,"Dialog: speaking…":`Dialog: spreche …`,"End the dialog":`Dialog beenden`,"Dialog: everything you say becomes a question":`Dialog: Alles, was du sagst, wird zur Frage – bis du ihn beendest`,"The microphone could not be opened:":`Das Mikrofon ließ sich nicht öffnen:`},ru:{"Type a message…":`Введите сообщение…`,"Listening…":`Слушаю…`,"Thinking…":`Размышления…`,Speak:`Говорить`,"Stop listening":`Прекратите слушать`,"Read answers aloud":`Прочитайте ответы вслух.`,"Stop reading answers aloud":`Прекратите зачитывать ответы вслух.`,"No messages yet. Type a question below.":`Сообщений пока нет. Задайте вопрос ниже.`,"Start the assistant instance to chat.":`Запустите экземпляр ассистента для начала чата.`,"States written":`Записанные состояния`,"Dialog: listening…":`Диалог: слушаю …`,"Dialog: hearing you…":`Диалог: слышу вас …`,"Dialog: thinking…":`Диалог: думаю …`,"Dialog: speaking…":`Диалог: говорю …`,"End the dialog":`Завершить диалог`,"Dialog: everything you say becomes a question":`Диалог: всё, что вы скажете, станет вопросом — пока вы его не завершите`,"The microphone could not be opened:":`Не удалось открыть микрофон:`},pt:{"Type a message…":`Digite uma mensagem…`,"Listening…":`Audição…`,"Thinking…":`Pensamento…`,Speak:`Falar`,"Stop listening":`Pare de ouvir`,"Read answers aloud":`Leia as respostas em voz alta.`,"Stop reading answers aloud":`Pare de ler as respostas em voz alta.`,"No messages yet. Type a question below.":`Ainda não há mensagens. Digite sua pergunta abaixo.`,"Start the assistant instance to chat.":`Inicie a instância do assistente para conversar.`,"States written":`Estados escritos`,"Dialog: listening…":`Diálogo: a ouvir …`,"Dialog: hearing you…":`Diálogo: estou a ouvir-te …`,"Dialog: thinking…":`Diálogo: a pensar …`,"Dialog: speaking…":`Diálogo: a falar …`,"End the dialog":`Terminar o diálogo`,"Dialog: everything you say becomes a question":`Diálogo: tudo o que disseres torna-se uma pergunta, até o terminares`,"The microphone could not be opened:":`Não foi possível abrir o microfone:`},nl:{"Type a message…":`Typ een bericht…`,"Listening…":`Luisteren…`,"Thinking…":`Aan het nadenken…`,Speak:`Spreken`,"Stop listening":`Stop met luisteren`,"Read answers aloud":`Lees de antwoorden hardop voor.`,"Stop reading answers aloud":`Stop met het hardop voorlezen van antwoorden.`,"No messages yet. Type a question below.":`Nog geen berichten. Typ hieronder een vraag.`,"Start the assistant instance to chat.":`Start de assistent-instantie om te chatten.`,"States written":`Geschreven states`,"Dialog: listening…":`Dialoog: luistert …`,"Dialog: hearing you…":`Dialoog: hoort je …`,"Dialog: thinking…":`Dialoog: denkt na …`,"Dialog: speaking…":`Dialoog: spreekt …`,"End the dialog":`Dialoog beëindigen`,"Dialog: everything you say becomes a question":`Dialoog: alles wat je zegt wordt een vraag, totdat je hem beëindigt`,"The microphone could not be opened:":`De microfoon kon niet worden geopend:`},fr:{"Type a message…":`Saisissez un message…`,"Listening…":`Écoute…`,"Thinking…":`Pensée…`,Speak:`Parler`,"Stop listening":`Arrêtez d'écouter`,"Read answers aloud":`Lisez les réponses à voix haute`,"Stop reading answers aloud":`Arrêtez de lire les réponses à voix haute`,"No messages yet. Type a question below.":`Aucun message pour l'instant. Posez votre question ci-dessous.`,"Start the assistant instance to chat.":`Démarrez l'instance de l'assistant pour discuter.`,"States written":`États écrits`,"Dialog: listening…":`Dialogue : à l’écoute …`,"Dialog: hearing you…":`Dialogue : je t’entends …`,"Dialog: thinking…":`Dialogue : réflexion …`,"Dialog: speaking…":`Dialogue : je parle …`,"End the dialog":`Terminer le dialogue`,"Dialog: everything you say becomes a question":`Dialogue : tout ce que tu dis devient une question, jusqu’à ce que tu y mettes fin`,"The microphone could not be opened:":`Impossible d’ouvrir le microphone :`},it:{"Type a message…":`Digita un messaggio…`,"Listening…":`Ascolto…`,"Thinking…":`Pensiero…`,Speak:`Parlare`,"Stop listening":`Smetti di ascoltare`,"Read answers aloud":`Leggi le risposte ad alta voce`,"Stop reading answers aloud":`Smetti di leggere le risposte ad alta voce`,"No messages yet. Type a question below.":`Nessun messaggio ancora. Scrivi una domanda qui sotto.`,"Start the assistant instance to chat.":`Avvia l'assistente per chattare.`,"States written":`Stati scritti`,"Dialog: listening…":`Dialogo: in ascolto …`,"Dialog: hearing you…":`Dialogo: ti sento …`,"Dialog: thinking…":`Dialogo: sto pensando …`,"Dialog: speaking…":`Dialogo: sto parlando …`,"End the dialog":`Termina il dialogo`,"Dialog: everything you say becomes a question":`Dialogo: tutto ciò che dici diventa una domanda, finché non lo termini`,"The microphone could not be opened:":`Impossibile aprire il microfono:`},es:{"Type a message…":`Escribe un mensaje…`,"Listening…":`Escuchando…`,"Thinking…":`Pensamiento…`,Speak:`Hablar`,"Stop listening":`Deja de escuchar`,"Read answers aloud":`Lee las respuestas en voz alta.`,"Stop reading answers aloud":`Deja de leer las respuestas en voz alta.`,"No messages yet. Type a question below.":`Aún no hay mensajes. Escribe tu pregunta a continuación.`,"Start the assistant instance to chat.":`Inicia la instancia del asistente para chatear.`,"States written":`Estados escritos`,"Dialog: listening…":`Diálogo: escuchando …`,"Dialog: hearing you…":`Diálogo: te oigo …`,"Dialog: thinking…":`Diálogo: pensando …`,"Dialog: speaking…":`Diálogo: hablando …`,"End the dialog":`Terminar el diálogo`,"Dialog: everything you say becomes a question":`Diálogo: todo lo que digas se convierte en una pregunta, hasta que lo termines`,"The microphone could not be opened:":`No se pudo abrir el micrófono:`},pl:{"Type a message…":`Wpisz wiadomość…`,"Listening…":`Słuchający…`,"Thinking…":`Myślący…`,Speak:`Mówić`,"Stop listening":`Przestań słuchać`,"Read answers aloud":`Przeczytaj odpowiedzi na głos`,"Stop reading answers aloud":`Przestań czytać odpowiedzi na głos`,"No messages yet. Type a question below.":`Brak wiadomości. Wpisz pytanie poniżej.`,"Start the assistant instance to chat.":`Uruchom asystenta, aby rozpocząć rozmowę.`,"States written":`Zapisane stany`,"Dialog: listening…":`Dialog: słucham …`,"Dialog: hearing you…":`Dialog: słyszę cię …`,"Dialog: thinking…":`Dialog: myślę …`,"Dialog: speaking…":`Dialog: mówię …`,"End the dialog":`Zakończ dialog`,"Dialog: everything you say becomes a question":`Dialog: wszystko, co powiesz, staje się pytaniem — dopóki go nie zakończysz`,"The microphone could not be opened:":`Nie udało się otworzyć mikrofonu:`},uk:{"Type a message…":`Введіть повідомлення…`,"Listening…":`Слухання…`,"Thinking…":`Мислення…`,Speak:`Говоріть`,"Stop listening":`Перестань слухати`,"Read answers aloud":`Прочитайте відповіді вголос`,"Stop reading answers aloud":`Перестаньте читати відповіді вголос`,"No messages yet. Type a question below.":`Поки що немає повідомлень. Введіть запитання нижче.`,"Start the assistant instance to chat.":`Запустіть екземпляр помічника для спілкування в чаті.`,"States written":`Записані стани`,"Dialog: listening…":`Діалог: слухаю …`,"Dialog: hearing you…":`Діалог: чую вас …`,"Dialog: thinking…":`Діалог: думаю …`,"Dialog: speaking…":`Діалог: говорю …`,"End the dialog":`Завершити діалог`,"Dialog: everything you say becomes a question":`Діалог: усе, що ви скажете, стане запитанням — доки ви його не завершите`,"The microphone could not be opened:":`Не вдалося відкрити мікрофон:`},"zh-cn":{"Type a message…":`输入消息…`,"Listening…":`正在听……`,"Thinking…":`思维…`,Speak:`说话`,"Stop listening":`别听了`,"Read answers aloud":`大声朗读答案`,"Stop reading answers aloud":`停止大声朗读答案`,"No messages yet. Type a question below.":`暂无消息。请在下方输入问题。`,"Start the assistant instance to chat.":`启动助手实例进行聊天。`,"States written":`写入的状态`,"Dialog: listening…":`对话:正在聆听 …`,"Dialog: hearing you…":`对话:正在听你说 …`,"Dialog: thinking…":`对话:正在思考 …`,"Dialog: speaking…":`对话:正在说话 …`,"End the dialog":`结束对话`,"Dialog: everything you say becomes a question":`对话:你说的每句话都会成为一个问题,直到你结束对话`,"The microphone could not be opened:":`无法打开麦克风:`}},X={en:{chooseInstance:`Choose an instance of the assistant in the settings`},de:{chooseInstance:`Instanz des Assistenten in den Einstellungen wählen`},ru:{chooseInstance:`Выберите экземпляр ассистента в настройках`},pt:{chooseInstance:`Escolha uma instância do assistente nas configurações`},nl:{chooseInstance:`Kies een instantie van de assistent in de instellingen`},fr:{chooseInstance:`Choisissez une instance de l'assistant dans les paramètres`},it:{chooseInstance:`Scegli un'istanza dell'assistente nelle impostazioni`},es:{chooseInstance:`Elija una instancia del asistente en la configuración`},pl:{chooseInstance:`Wybierz instancję asystenta w ustawieniach`},uk:{chooseInstance:`Виберіть екземпляр асистента в налаштуваннях`},"zh-cn":{chooseInstance:`请在设置中选择助手实例`}};function ye(e,t){return n=>r=>r in e.en?e[n]?.[r]||e.en[r]:r===`chooseInstance`?X[n]?.chooseInstance||X.en.chooseInstance:t.includes(r)&&(Y[n]?.[r]||Y.en?.[r])||r}function Z(e){return{de:`de-DE`,en:`en-US`,ru:`ru-RU`,pt:`pt-PT`,nl:`nl-NL`,fr:`fr-FR`,it:`it-IT`,es:`es-ES`,pl:`pl-PL`,uk:`uk-UA`,"zh-cn":`zh-CN`}[e]||e||`en-US`}var be=ye({en:{send:`Send`,noSpokenAnswer:`(no spoken answer)`,noAnswer:`No answer from the assistant`,voiceOff:`Dialog mode needs speech recognition: switch on voice in the instance settings of the assistant`,waitsForReply:`waits for a reply`,followUp:`follow-up`,tier_stop:`Stop word`,tier_askReply:`Reply to a question`,tier_routine:`Routine`,tier_nlu:`Rule-based NLU`,tier_localLlm:`Local LLM`,tier_cloud:`Cloud LLM`,tier_none:`Not understood`,transport_chat:`Chat`,transport_script:`Script`,transport_state:`State`},de:{send:`Senden`,noSpokenAnswer:`(keine gesprochene Antwort)`,noAnswer:`Keine Antwort vom Assistenten`,voiceOff:`Der Dialogmodus braucht Spracherkennung: Sprache in den Instanzeinstellungen des Assistenten einschalten`,waitsForReply:`wartet auf Antwort`,followUp:`Nachfrage`,tier_stop:`Stoppwort`,tier_askReply:`Antwort auf Rückfrage`,tier_routine:`Routine`,tier_nlu:`Regel-NLU`,tier_localLlm:`Lokales LLM`,tier_cloud:`Cloud-LLM`,tier_none:`Nicht verstanden`,transport_chat:`Chat`,transport_script:`Skript`,transport_state:`Datenpunkt`},ru:{send:`Отправить`,noSpokenAnswer:`(без голосового ответа)`,noAnswer:`Нет ответа от ассистента`,voiceOff:`Для режима диалога нужно распознавание речи: включите голос в настройках экземпляра ассистента`,waitsForReply:`ждёт ответа`,followUp:`продолжение`,tier_stop:`Стоп-слово`,tier_askReply:`Ответ на вопрос`,tier_routine:`Сценарий`,tier_nlu:`NLU по правилам`,tier_localLlm:`Локальная LLM`,tier_cloud:`Облачная LLM`,tier_none:`Не понято`,transport_chat:`Чат`,transport_script:`Скрипт`,transport_state:`Состояние`},pt:{send:`Enviar`,noSpokenAnswer:`(sem resposta falada)`,noAnswer:`Sem resposta do assistente`,voiceOff:`O modo de diálogo precisa de reconhecimento de voz: ative a voz nas configurações da instância do assistente`,waitsForReply:`aguarda resposta`,followUp:`seguimento`,tier_stop:`Palavra de paragem`,tier_askReply:`Resposta a uma pergunta`,tier_routine:`Rotina`,tier_nlu:`NLU por regras`,tier_localLlm:`LLM local`,tier_cloud:`LLM na nuvem`,tier_none:`Não entendido`,transport_chat:`Chat`,transport_script:`Script`,transport_state:`Estado`},nl:{send:`Verzenden`,noSpokenAnswer:`(geen gesproken antwoord)`,noAnswer:`Geen antwoord van de assistent`,voiceOff:`De dialoogmodus heeft spraakherkenning nodig: schakel spraak in bij de instantie-instellingen van de assistent`,waitsForReply:`wacht op antwoord`,followUp:`vervolgvraag`,tier_stop:`Stopwoord`,tier_askReply:`Antwoord op een vraag`,tier_routine:`Routine`,tier_nlu:`Regelgebaseerde NLU`,tier_localLlm:`Lokaal LLM`,tier_cloud:`Cloud-LLM`,tier_none:`Niet begrepen`,transport_chat:`Chat`,transport_script:`Script`,transport_state:`Datapunt`},fr:{send:`Envoyer`,noSpokenAnswer:`(pas de réponse orale)`,noAnswer:`Pas de réponse de l'assistant`,voiceOff:`Le mode dialogue nécessite la reconnaissance vocale : activez la voix dans les paramètres de l'instance de l'assistant`,waitsForReply:`attend une réponse`,followUp:`suite`,tier_stop:`Mot d'arrêt`,tier_askReply:`Réponse à une question`,tier_routine:`Routine`,tier_nlu:`NLU à règles`,tier_localLlm:`LLM local`,tier_cloud:`LLM cloud`,tier_none:`Non compris`,transport_chat:`Chat`,transport_script:`Script`,transport_state:`État`},it:{send:`Invia`,noSpokenAnswer:`(nessuna risposta parlata)`,noAnswer:`Nessuna risposta dall'assistente`,voiceOff:`La modalità dialogo richiede il riconoscimento vocale: attiva la voce nelle impostazioni dell'istanza dell'assistente`,waitsForReply:`attende una risposta`,followUp:`seguito`,tier_stop:`Parola di stop`,tier_askReply:`Risposta a una domanda`,tier_routine:`Routine`,tier_nlu:`NLU a regole`,tier_localLlm:`LLM locale`,tier_cloud:`LLM cloud`,tier_none:`Non capito`,transport_chat:`Chat`,transport_script:`Script`,transport_state:`Stato`},es:{send:`Enviar`,noSpokenAnswer:`(sin respuesta hablada)`,noAnswer:`Sin respuesta del asistente`,voiceOff:`El modo diálogo necesita reconocimiento de voz: active la voz en la configuración de la instancia del asistente`,waitsForReply:`espera respuesta`,followUp:`seguimiento`,tier_stop:`Palabra de parada`,tier_askReply:`Respuesta a una pregunta`,tier_routine:`Rutina`,tier_nlu:`NLU por reglas`,tier_localLlm:`LLM local`,tier_cloud:`LLM en la nube`,tier_none:`No entendido`,transport_chat:`Chat`,transport_script:`Script`,transport_state:`Estado`},pl:{send:`Wyślij`,noSpokenAnswer:`(brak odpowiedzi głosowej)`,noAnswer:`Brak odpowiedzi od asystenta`,voiceOff:`Tryb dialogu wymaga rozpoznawania mowy: włącz głos w ustawieniach instancji asystenta`,waitsForReply:`czeka na odpowiedź`,followUp:`kontynuacja`,tier_stop:`Słowo stop`,tier_askReply:`Odpowiedź na pytanie`,tier_routine:`Rutyna`,tier_nlu:`NLU oparte na regułach`,tier_localLlm:`Lokalny LLM`,tier_cloud:`LLM w chmurze`,tier_none:`Nie zrozumiano`,transport_chat:`Czat`,transport_script:`Skrypt`,transport_state:`Stan`},uk:{send:`Надіслати`,noSpokenAnswer:`(без голосової відповіді)`,noAnswer:`Немає відповіді від асистента`,voiceOff:`Для режиму діалогу потрібне розпізнавання мовлення: увімкніть голос у налаштуваннях екземпляра асистента`,waitsForReply:`чекає на відповідь`,followUp:`продовження`,tier_stop:`Стоп-слово`,tier_askReply:`Відповідь на запитання`,tier_routine:`Сценарій`,tier_nlu:`NLU за правилами`,tier_localLlm:`Локальна LLM`,tier_cloud:`Хмарна LLM`,tier_none:`Не зрозуміло`,transport_chat:`Чат`,transport_script:`Скрипт`,transport_state:`Стан`},"zh-cn":{send:`发送`,noSpokenAnswer:`(无语音回答)`,noAnswer:`助手没有回答`,voiceOff:`对话模式需要语音识别:请在助手实例设置中开启语音`,waitsForReply:`等待回复`,followUp:`追问`,tier_stop:`停止词`,tier_askReply:`回复提问`,tier_routine:`例程`,tier_nlu:`基于规则的 NLU`,tier_localLlm:`本地 LLM`,tier_cloud:`云端 LLM`,tier_none:`未理解`,transport_chat:`聊天`,transport_script:`脚本`,transport_state:`状态`}},J);function Q(){if(typeof window>`u`||!window.isSecureContext)return null;let e=window;return e.SpeechRecognition||e.webkitSpeechRecognition||null}function $(){return typeof window<`u`&&`speechSynthesis`in window&&!!window.speechSynthesis}function xe(){$()&&window.speechSynthesis.cancel()}var Se=`
37
+ :host {
38
+ display: block;
39
+ width: 100%;
40
+ height: 100%;
41
+ }
42
+ .mount {
43
+ width: 100%;
44
+ height: 100%;
45
+ /* the size of the box does not depend on what is in it */
46
+ container-type: size;
47
+ }
48
+ .edit {
49
+ pointer-events: none;
50
+ }
51
+ .hint {
52
+ box-sizing: border-box;
53
+ width: 100%;
54
+ height: 100%;
55
+ padding: 8px;
56
+ display: flex;
57
+ flex-direction: column;
58
+ align-items: center;
59
+ justify-content: center;
60
+ gap: clamp(2px, 3cqmin, 8px);
61
+ overflow: hidden;
62
+ text-align: center;
63
+ color: var(--iob-text-secondary);
64
+ font-size: clamp(10px, 6cqmin, 15px);
65
+ }
66
+ .hint svg {
67
+ width: clamp(16px, 14cqmin, 36px);
68
+ height: clamp(16px, 14cqmin, 36px);
69
+ fill: currentColor;
70
+ flex: none;
71
+ }
72
+ .icon-btn {
73
+ flex: none;
74
+ box-sizing: border-box;
75
+ width: 36px;
76
+ height: 36px;
77
+ padding: 0;
78
+ border: none;
79
+ border-radius: 50%;
80
+ background: transparent;
81
+ color: inherit;
82
+ display: inline-flex;
83
+ align-items: center;
84
+ justify-content: center;
85
+ cursor: pointer;
86
+ -webkit-tap-highlight-color: transparent;
87
+ }
88
+ .icon-btn svg {
89
+ width: 22px;
90
+ height: 22px;
91
+ fill: currentColor;
92
+ }
93
+ .icon-btn:hover:not(:disabled) {
94
+ background: color-mix(in srgb, currentColor 10%, transparent);
95
+ }
96
+ .icon-btn:focus-visible {
97
+ outline: 2px solid var(--iob-primary);
98
+ outline-offset: -2px;
99
+ }
100
+ .icon-btn:disabled {
101
+ opacity: 0.38;
102
+ cursor: default;
103
+ }
104
+ .icon-btn.primary {
105
+ color: var(--iob-primary);
106
+ }
107
+ .icon-btn.on {
108
+ color: var(--iob-error);
109
+ }
110
+ .icon-btn.filled {
111
+ background: var(--iob-primary);
112
+ color: var(--iob-primary-contrast);
113
+ }
114
+ .icon-btn.filled:hover:not(:disabled) {
115
+ background: color-mix(in srgb, var(--iob-primary) 85%, currentColor);
116
+ }
117
+ .field {
118
+ flex: 1;
119
+ min-width: 0;
120
+ box-sizing: border-box;
121
+ margin: 0;
122
+ padding: 7px 12px;
123
+ font: inherit;
124
+ line-height: 1.4;
125
+ color: inherit;
126
+ background: transparent;
127
+ border: 1px solid var(--iob-divider);
128
+ border-radius: 18px;
129
+ outline: none;
130
+ resize: none;
131
+ field-sizing: content;
132
+ min-height: 36px;
133
+ max-height: 7em;
134
+ }
135
+ .field:focus {
136
+ border-color: var(--iob-primary);
137
+ }
138
+ .field:disabled {
139
+ opacity: 0.6;
140
+ }
141
+ .field::placeholder {
142
+ color: var(--iob-text-secondary);
143
+ }
144
+ .spinner {
145
+ flex: none;
146
+ width: 12px;
147
+ height: 12px;
148
+ border: 2px solid currentColor;
149
+ border-right-color: transparent;
150
+ border-radius: 50%;
151
+ animation: spin 0.8s linear infinite;
152
+ }
153
+ @keyframes spin {
154
+ to {
155
+ transform: rotate(360deg);
156
+ }
157
+ }
158
+
159
+ .chat {
160
+ box-sizing: border-box;
161
+ width: 100%;
162
+ height: 100%;
163
+ padding: 6px;
164
+ display: flex;
165
+ flex-direction: column;
166
+ gap: 6px;
167
+ overflow: hidden;
168
+ }
169
+ .banner {
170
+ flex: none;
171
+ padding: 2px 6px;
172
+ color: var(--iob-warning);
173
+ font-size: 0.85em;
174
+ }
175
+ .list {
176
+ flex: 1;
177
+ min-height: 0;
178
+ overflow-y: auto;
179
+ overscroll-behavior: contain;
180
+ display: flex;
181
+ flex-direction: column;
182
+ gap: 4px;
183
+ padding: 2px;
184
+ }
185
+ .empty {
186
+ margin: auto;
187
+ padding: 16px;
188
+ text-align: center;
189
+ color: var(--iob-text-secondary);
190
+ }
191
+ .row {
192
+ display: flex;
193
+ justify-content: flex-start;
194
+ }
195
+ .row.user {
196
+ justify-content: flex-end;
197
+ }
198
+ .bubble {
199
+ max-width: 82%;
200
+ box-sizing: border-box;
201
+ padding: 6px 10px;
202
+ border-radius: 14px;
203
+ border-bottom-left-radius: 4px;
204
+ background: color-mix(in srgb, currentColor 9%, transparent);
205
+ white-space: pre-wrap;
206
+ overflow-wrap: anywhere;
207
+ line-height: 1.4;
208
+ }
209
+ .user .bubble {
210
+ border-radius: 14px;
211
+ border-bottom-right-radius: 4px;
212
+ background: var(--iob-primary);
213
+ color: var(--iob-primary-contrast);
214
+ }
215
+ .error .bubble {
216
+ background: color-mix(in srgb, var(--iob-error) 14%, transparent);
217
+ color: var(--iob-error);
218
+ }
219
+ .silent {
220
+ font-style: italic;
221
+ opacity: 0.7;
222
+ }
223
+ .time {
224
+ margin-top: 2px;
225
+ text-align: right;
226
+ font-size: 0.7em;
227
+ opacity: 0.65;
228
+ }
229
+ .chips {
230
+ display: flex;
231
+ flex-wrap: wrap;
232
+ gap: 4px;
233
+ margin-bottom: 3px;
234
+ }
235
+ .chip {
236
+ padding: 0 7px;
237
+ border-radius: 999px;
238
+ background: color-mix(in srgb, currentColor 20%, transparent);
239
+ font-size: 0.72em;
240
+ line-height: 1.6;
241
+ white-space: nowrap;
242
+ }
243
+ .chip.tier {
244
+ background: var(--tier);
245
+ color: #fff;
246
+ }
247
+ .details {
248
+ margin: 0 0 4px 8px;
249
+ padding-left: 8px;
250
+ border-left: 2px solid var(--iob-divider);
251
+ display: flex;
252
+ flex-direction: column;
253
+ gap: 2px;
254
+ color: var(--iob-text-secondary);
255
+ font-size: 0.78em;
256
+ }
257
+ .details .line {
258
+ display: flex;
259
+ flex-wrap: wrap;
260
+ align-items: center;
261
+ gap: 6px;
262
+ }
263
+ .mono {
264
+ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
265
+ overflow-wrap: anywhere;
266
+ }
267
+ .thinking {
268
+ display: flex;
269
+ align-items: center;
270
+ gap: 8px;
271
+ padding: 6px 10px;
272
+ color: var(--iob-text-secondary);
273
+ }
274
+ .level {
275
+ flex: none;
276
+ height: 3px;
277
+ border-radius: 2px;
278
+ overflow: hidden;
279
+ background: color-mix(in srgb, var(--iob-primary) 22%, transparent);
280
+ }
281
+ .level span {
282
+ display: block;
283
+ height: 100%;
284
+ background: var(--iob-primary);
285
+ transition: width 0.1s linear;
286
+ }
287
+ .level.hearing span {
288
+ background: var(--iob-error);
289
+ }
290
+ .level.busy span {
291
+ width: 35%;
292
+ animation: slide 1.2s ease-in-out infinite;
293
+ }
294
+ .level.speaking span {
295
+ background: var(--iob-secondary);
296
+ }
297
+ @keyframes slide {
298
+ from {
299
+ transform: translateX(-100%);
300
+ }
301
+ to {
302
+ transform: translateX(300%);
303
+ }
304
+ }
305
+ .composer {
306
+ flex: none;
307
+ display: flex;
308
+ align-items: flex-end;
309
+ gap: 4px;
310
+ }
311
+ @container (max-height: 180px) {
312
+ .time {
313
+ display: none;
314
+ }
315
+ }
316
+ @container (max-width: 260px) {
317
+ .bubble {
318
+ max-width: 92%;
319
+ }
320
+ }
321
+ `;N(ve,class extends M{#e;#t=``;#n=/* @__PURE__ */ new Map;#r=[];#i=0;#a=null;#o=null;#s=null;#c=!1;#l=!1;#u=null;#d=null;#f=null;#p=``;#m=0;#h=0;#g=null;constructor(){super();let t=this.attachShadow({mode:`open`}),n=document.createElement(`style`);n.textContent=Se;let r=document.createElement(`div`);r.className=`mount`,t.append(n,r),this.#e=e(r)}disconnectedCallback(){super.disconnectedCallback(),this.#N(),this.#s=null}getStateIds(e){let t=q(e.instance);return t?[`system.adapter.${t}.alive`,`${t}.journal.last`]:[]}getObjectIds(e){let t=q(e.instance);return t?[`system.adapter.${t}`]:[]}get#_(){return!!this.#t&&!!this.states[`system.adapter.${this.#t}.alive`]?.val}get#v(){return this.objects[`system.adapter.${this.#t}`]?.native||{}}get#y(){return Z(this.#v.voiceLanguage||this.systemLang)}get#b(){return this.#u??!!this.settings.speak}get#x(){return be(this.systemLang)}render(){let e=q(this.settings.instance);if(e!==this.#t&&this.#S(e),!e){this.#e.render(/* @__PURE__ */ a(le,{text:this.#x(`chooseInstance`),icon:U.chat,editMode:this.editMode}));return}this.#C();let t=this.socket;(!this.#_||this.editMode)&&this.#N(),this.#_?t&&this.#s!==t&&(this.#s=t,this.#w(e,t)):this.#s=null,this.#D()}#S(e){this.#N(),this.#t=e,this.#n.clear(),this.#r=[],this.#a=null,this.#o=null,this.#s=null,this.#c=!1,this.#l=!1,this.#u=null}#C(){let e=this.states[`${this.#t}.journal.last`];if(e&&e!==this.#o&&(this.#o=e,this.#a!==!1&&typeof e.val==`string`&&e.val))try{let t=JSON.parse(e.val);t?.id&&this.#n.set(t.id,t)}catch{}}async#w(e,t){let[n,r]=await Promise.all([t.sendTo(e,`getJournal`,{}).catch(()=>void 0),t.sendTo(e,`ttsAvailable`,{}).catch(()=>void 0)]);if(e===this.#t&&t===this.socket){if(this.#c=!!r?.available,this.#a=n?.enabled!==void 0&&n.enabled,this.#a)for(let e of n?.entries||[])e?.id&&!this.#n.has(e.id)&&this.#n.set(e.id,e);else this.#n.clear();this.#D()}}#T(e,t,n=Date.now()){this.#r.push({key:`m${++this.#i}`,ts:n,message:{role:e,text:t,ts:n}})}#E(){let e=!!this.settings.allRequests,t=[...this.#r];for(let n of this.#n.values())(e||n.source===`chat`)&&t.push({key:n.id,ts:n.ts,entry:n});return t.sort((e,t)=>e.ts-t.ts),t.slice(-200)}#D(){if(!this.#t)return;let e=this.#v;this.#e.render(/* @__PURE__ */ a(_e,{items:this.#E(),allRequests:!!this.settings.allRequests,details:!!this.settings.details,ready:this.#_,thinking:this.#l&&!this.#a&&!this.#p,sending:this.#l,micSupported:!!Q(),listening:!!this.#d,dialogSupported:R.supported,voiceEnabled:!!e.voiceEnabled,dialog:this.#p,dialogLevel:this.#m,speakSupported:$()||this.#c,speak:this.#b,editMode:this.editMode,locale:Z(this.systemLang),word:this.#x,onSend:e=>void this.#O(e),onMic:()=>this.#A(),onDialog:()=>void this.#j(),onSpeak:()=>this.#k()}))}async#O(e){let t=this.#t,n=this.socket;if(!t||!n||this.editMode||this.#l||!this.#_)return;let r=!!this.#a,i=Date.now();this.#l=!0,r||this.#T(`user`,e,i),this.#D();try{let a=await n.sendTo(t,`ask`,{text:e});if(t!==this.#t)return;r&&!a?.journaled&&this.#T(`user`,e,i),a?a.error===void 0?a.journaled||this.#T(`assistant`,a.answer??``):a.journaled||this.#T(`error`,a.error):this.#T(`error`,this.#x(`noAnswer`)),a?.answer&&this.#b&&this.#I(a.answer)}catch(e){t===this.#t&&this.#T(`error`,String(e?.message||e))}finally{t===this.#t&&(this.#l=!1,this.#D())}}#k(){if(this.editMode)return;let e=!this.#b;e||this.#g?.(),this.#u=e,this.#D()}#A(){if(this.#d){this.#d.stop();return}let e=Q();if(!e||this.editMode||!this.#_)return;let t=new e;t.lang=this.#y,t.interimResults=!1,t.continuous=!1,t.onresult=e=>{let t=e.results?.[0]?.[0]?.transcript||``;t&&this.#O(t)};let n=()=>{this.#d===t&&(this.#d=null,this.#D())};t.onerror=n,t.onend=n,this.#d=t,this.#D();try{t.start()}catch{n()}}async#j(){if(this.#f){this.#M(),this.#D();return}if(this.editMode||!this.#_||!this.#v.voiceEnabled)return;this.#d?.stop(),this.#g?.();let e=new R({onUtterance:e=>this.#F(e),onLevel:(e,t)=>this.#P(e,t)});this.#f=e,this.#p=`listening`,this.#m=0,this.#D();try{await e.start()}catch(t){this.#f===e&&this.#M(),this.#T(`error`,`${this.#x(`The microphone could not be opened:`)} ${t.message}`),this.#D()}}#M(){this.#f?.stop(),this.#f=null,this.#g?.(),this.#p=``,this.#m=0}#N(){if(this.#d){let e=this.#d;this.#d=null;try{e.stop()}catch{}}this.#f&&this.#M(),this.#g?.()}#P(e,t){if(this.#p!==`listening`&&this.#p!==`hearing`)return;let n=Date.now();n-this.#h<100&&t===(this.#p===`hearing`)||(this.#h=n,this.#m=e,this.#p=t?`hearing`:`listening`,this.#D())}async#F(e){let t=this.#f,n=this.#t,r=this.socket;if(!t||!r||!this.#_)return;let i=!!this.#a;this.#p=`thinking`,this.#m=0,this.#l=!0,this.#D();try{let a=await r.sendTo(n,`ask`,{audio:L(e),format:`pcm`,sampleRate:P,spoken:!0});if(this.#f!==t)return;if(!a){this.#T(`error`,this.#x(`noAnswer`));return}if(a.heard===``)return;i&&a.journaled||(a.heard&&this.#T(`user`,a.heard),a.error===void 0?this.#T(`assistant`,a.answer??``):this.#T(`error`,a.error)),a.answer&&(this.#p=`speaking`,this.#D(),await this.#I(a.answer))}catch(e){n===this.#t&&this.#T(`error`,String(e?.message||e))}finally{n===this.#t&&(this.#l=!1,this.#f===t&&(this.#p=`listening`,this.#m=0),this.#D())}}#I(e){this.#g?.();let t=this.#t,n=this.socket,r=this.#y;return new Promise(i=>{let a=!1,o=null,s,c=null,l=()=>{a||(a=!0,clearTimeout(s),this.#g===c&&(this.#g=null),i())};c=()=>{o?.pause(),xe(),l()},this.#g=c,s=setTimeout(l,15e3+e.length*120);let u=()=>{if(a||!$()){l();return}let t=new SpeechSynthesisUtterance(e);t.lang=r,t.onend=l,t.onerror=l,window.speechSynthesis.cancel(),window.speechSynthesis.speak(t)};!this.#c||!n?u():(async()=>{try{let r=await n.sendTo(t,`tts`,{text:e});if(a)return;if(r?.audio){o=new Audio(`data:${r.mime||`audio/wav`};base64,${r.audio}`),o.onended=l,o.onerror=l,await o.play();return}}catch{}u()})()})}});
@@ -0,0 +1,150 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/ioBroker/web-components/main/schemas/manifest.json",
3
+ "manifestVersion": 1,
4
+ "tag": "iob-assistant-chat",
5
+ "name": {
6
+ "en": "Assistant chat",
7
+ "de": "Assistent-Chat",
8
+ "ru": "Чат ассистента",
9
+ "pt": "Chat do assistente",
10
+ "nl": "Assistent-chat",
11
+ "fr": "Chat de l'assistant",
12
+ "it": "Chat dell'assistente",
13
+ "es": "Chat del asistente",
14
+ "pl": "Czat asystenta",
15
+ "uk": "Чат асистента",
16
+ "zh-cn": "助手聊天"
17
+ },
18
+ "description": {
19
+ "en": "Talk to the assistant from a dashboard: type a question or speak it, with the answers live",
20
+ "de": "Mit dem Assistenten vom Dashboard aus sprechen: Frage tippen oder sagen, die Antworten live",
21
+ "ru": "Общайтесь с ассистентом с панели: напечатайте или произнесите вопрос, ответы в реальном времени",
22
+ "pt": "Fale com o assistente a partir de um painel: escreva ou diga uma pergunta, com as respostas ao vivo",
23
+ "nl": "Praat vanaf een dashboard met de assistent: typ of spreek een vraag in, met de antwoorden live",
24
+ "fr": "Parlez à l'assistant depuis un tableau de bord : tapez ou dites une question, avec les réponses en direct",
25
+ "it": "Parla con l'assistente da una dashboard: scrivi o pronuncia una domanda, con le risposte in tempo reale",
26
+ "es": "Hable con el asistente desde un panel: escriba o diga una pregunta, con las respuestas en directo",
27
+ "pl": "Rozmawiaj z asystentem z pulpitu: wpisz lub wypowiedz pytanie, odpowiedzi na żywo",
28
+ "uk": "Спілкуйтеся з асистентом з панелі: надрукуйте або промовте запитання, відповіді в реальному часі",
29
+ "zh-cn": "在仪表板上与助手对话:输入或说出问题,实时显示回答"
30
+ },
31
+ "icon": "../assistant.svg",
32
+ "module": "assistant-chat.js",
33
+ "size": {
34
+ "width": 400,
35
+ "height": 500
36
+ },
37
+ "settings": {
38
+ "type": "panel",
39
+ "items": {
40
+ "instance": {
41
+ "type": "instance",
42
+ "adapter": "assistant",
43
+ "default": "assistant.0",
44
+ "label": {
45
+ "en": "Instance",
46
+ "de": "Instanz",
47
+ "ru": "Экземпляр",
48
+ "pt": "Instância",
49
+ "nl": "Instantie",
50
+ "fr": "Instance",
51
+ "it": "Istanza",
52
+ "es": "Instancia",
53
+ "pl": "Instancja",
54
+ "uk": "Екземпляр",
55
+ "zh-cn": "实例"
56
+ }
57
+ },
58
+ "allRequests": {
59
+ "type": "checkbox",
60
+ "default": false,
61
+ "label": {
62
+ "en": "Show all requests",
63
+ "de": "Alle Anfragen zeigen",
64
+ "ru": "Показывать все запросы",
65
+ "pt": "Mostrar todos os pedidos",
66
+ "nl": "Alle verzoeken tonen",
67
+ "fr": "Afficher toutes les requêtes",
68
+ "it": "Mostra tutte le richieste",
69
+ "es": "Mostrar todas las solicitudes",
70
+ "pl": "Pokaż wszystkie zapytania",
71
+ "uk": "Показувати всі запити",
72
+ "zh-cn": "显示所有请求"
73
+ },
74
+ "help": {
75
+ "en": "Also the requests of the satellites, Telegram and scripts - not only those of the chat",
76
+ "de": "Auch die Anfragen der Satelliten, von Telegram und Skripten - nicht nur die des Chats",
77
+ "ru": "Также запросы сателлитов, Telegram и скриптов, а не только чата",
78
+ "pt": "Também os pedidos dos satélites, do Telegram e de scripts - não só os do chat",
79
+ "nl": "Ook de verzoeken van de satellieten, Telegram en scripts - niet alleen die van de chat",
80
+ "fr": "Aussi les requêtes des satellites, de Telegram et des scripts - pas seulement celles du chat",
81
+ "it": "Anche le richieste dei satelliti, di Telegram e degli script - non solo quelle della chat",
82
+ "es": "También las solicitudes de los satélites, Telegram y scripts, no solo las del chat",
83
+ "pl": "Także zapytania satelitów, Telegrama i skryptów - nie tylko czatu",
84
+ "uk": "Також запити сателітів, Telegram і скриптів, а не лише чату",
85
+ "zh-cn": "也包括卫星、Telegram 和脚本的请求,而不仅是聊天的请求"
86
+ }
87
+ },
88
+ "details": {
89
+ "type": "checkbox",
90
+ "default": false,
91
+ "label": {
92
+ "en": "Show processing details",
93
+ "de": "Verarbeitungsdetails anzeigen",
94
+ "ru": "Показывать детали обработки",
95
+ "pt": "Mostrar detalhes do processamento",
96
+ "nl": "Verwerkingsdetails tonen",
97
+ "fr": "Afficher les détails du traitement",
98
+ "it": "Mostra i dettagli di elaborazione",
99
+ "es": "Mostrar detalles del procesamiento",
100
+ "pl": "Pokaż szczegóły przetwarzania",
101
+ "uk": "Показувати деталі обробки",
102
+ "zh-cn": "显示处理详情"
103
+ },
104
+ "help": {
105
+ "en": "Who answered (rule-based NLU, local or cloud model), how long it took and which states it wrote",
106
+ "de": "Wer geantwortet hat (Regel-NLU, lokales oder Cloud-Modell), wie lange es dauerte und welche Datenpunkte geschrieben wurden",
107
+ "ru": "Кто ответил (NLU по правилам, локальная или облачная модель), сколько это заняло и какие состояния были записаны",
108
+ "pt": "Quem respondeu (NLU por regras, modelo local ou na nuvem), quanto tempo demorou e que estados escreveu",
109
+ "nl": "Wie antwoordde (regelgebaseerde NLU, lokaal of cloudmodel), hoe lang het duurde en welke datapunten werden geschreven",
110
+ "fr": "Qui a répondu (NLU à règles, modèle local ou cloud), combien de temps cela a pris et quels états ont été écrits",
111
+ "it": "Chi ha risposto (NLU a regole, modello locale o cloud), quanto tempo ha impiegato e quali stati ha scritto",
112
+ "es": "Quién respondió (NLU por reglas, modelo local o en la nube), cuánto tardó y qué estados escribió",
113
+ "pl": "Kto odpowiedział (NLU oparte na regułach, model lokalny lub w chmurze), ile to trwało i jakie stany zapisano",
114
+ "uk": "Хто відповів (NLU за правилами, локальна чи хмарна модель), скільки це тривало і які стани записано",
115
+ "zh-cn": "由谁回答(基于规则的 NLU、本地或云端模型)、耗时多久以及写入了哪些状态"
116
+ }
117
+ },
118
+ "speak": {
119
+ "type": "checkbox",
120
+ "default": false,
121
+ "label": {
122
+ "en": "Read answers aloud",
123
+ "de": "Antworten vorlesen",
124
+ "ru": "Читать ответы вслух",
125
+ "pt": "Ler as respostas em voz alta",
126
+ "nl": "Antwoorden voorlezen",
127
+ "fr": "Lire les réponses à voix haute",
128
+ "it": "Leggere le risposte ad alta voce",
129
+ "es": "Leer las respuestas en voz alta",
130
+ "pl": "Czytaj odpowiedzi na głos",
131
+ "uk": "Читати відповіді вголос",
132
+ "zh-cn": "朗读回答"
133
+ },
134
+ "help": {
135
+ "en": "With the voice of the satellites if one is configured, else with the voice of the browser",
136
+ "de": "Mit der Stimme der Satelliten, wenn eine eingerichtet ist, sonst mit der des Browsers",
137
+ "ru": "Голосом сателлитов, если он настроен, иначе голосом браузера",
138
+ "pt": "Com a voz dos satélites, se estiver configurada, senão com a voz do navegador",
139
+ "nl": "Met de stem van de satellieten als die is ingesteld, anders met die van de browser",
140
+ "fr": "Avec la voix des satellites si elle est configurée, sinon avec celle du navigateur",
141
+ "it": "Con la voce dei satelliti se configurata, altrimenti con quella del browser",
142
+ "es": "Con la voz de los satélites si está configurada, si no con la del navegador",
143
+ "pl": "Głosem satelitów, jeśli jest skonfigurowany, w przeciwnym razie głosem przeglądarki",
144
+ "uk": "Голосом сателітів, якщо його налаштовано, інакше голосом браузера",
145
+ "zh-cn": "若已配置则使用卫星的语音,否则使用浏览器的语音"
146
+ }
147
+ }
148
+ }
149
+ }
150
+ }
@@ -0,0 +1,273 @@
1
+ import{useState as e,createRoot as t,jsx as n,jsxs as r}from"../../../lib/esm/react-19.js";var i=`iob-dialog-close`;function a(e){return!!e.form}var o=[`header`,`staticText`,`divider`];function s(e,t){return e==null?``:typeof e==`object`?e[t]||e.en||Object.values(e).find(e=>!!e)||``:String(e)}function c(e){let t={};for(let[n,r]of Object.entries(e.items||{}))r&&!o.includes(r.type)&&(t[n]=r.type);return t}function l(e){return typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?e.toString():JSON.stringify(e)}function u(e,t){if(t!=null)switch(e){case`number`:case`slider`:{if(typeof t==`number`)return Number.isFinite(t)?t:void 0;let e=l(t).trim().replace(`,`,`.`);if(!e)return;let n=Number(e);return Number.isFinite(n)?n:void 0}case`checkbox`:return t===!0||t===`true`||t===1||t===`1`;default:return l(t)}}function d(e,t){let n={};for(let[r,i]of Object.entries(e)){let e=u(i,t[r]);e!==void 0&&(n[r]=e)}return n}var f=`"Roboto", "Helvetica", "Arial", sans-serif`,p=Object.freeze({type:`light`,primary:`#3399CC`,primaryContrast:`#FFFFFF`,secondary:`#164477`,secondaryContrast:`#FFFFFF`,background:`#FFFFFF`,paper:`#FFFFFF`,text:`rgba(0, 0, 0, 0.87)`,textSecondary:`rgba(0, 0, 0, 0.6)`,divider:`rgba(0, 0, 0, 0.12)`,error:`#D32F2F`,warning:`#ED6C02`,info:`#0288D1`,success:`#2E7D32`,fontFamily:f,fontSize:14,borderRadius:4}),m=Object.freeze({type:`dark`,primary:`#4DABF5`,primaryContrast:`rgba(0, 0, 0, 0.87)`,secondary:`#436A93`,secondaryContrast:`#FFFFFF`,background:`#121212`,paper:`#121212`,text:`#FFFFFF`,textSecondary:`rgba(255, 255, 255, 0.7)`,divider:`rgba(255, 255, 255, 0.12)`,error:`#F44336`,warning:`#FFA726`,info:`#29B6F6`,success:`#66BB6A`,fontFamily:f,fontSize:14,borderRadius:4}),h=[`primary`,`primaryContrast`,`secondary`,`secondaryContrast`,`background`,`paper`,`text`,`textSecondary`,`divider`,`error`,`warning`,`info`,`success`,`fontFamily`],g=[`fontSize`,`borderRadius`];function _(e){return{...e===`dark`?m:p}}function v(e){if(!e||typeof e!=`object`)return _(typeof e==`string`?e:`light`);let t=e,n=_(typeof t.type==`string`?t.type:`light`);for(let e of h){let r=t[e];typeof r==`string`&&r.trim()&&(n[e]=r.trim())}for(let e of g){let r=t[e],i=typeof r==`string`?parseFloat(r):r;typeof i==`number`&&Number.isFinite(i)&&i>=0&&(n[e]=i)}return n}function y(e,t){return e.type===t.type&&h.every(n=>e[n]===t[n])&&g.every(n=>e[n]===t[n])}function b(e){return`--iob-${e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}`}function x(e){let t={};for(let n of h)t[b(n)]=e[n];for(let n of g)t[b(n)]=`${e[n]}px`;return t[`color-scheme`]=e.type,t}var S={ok:{en:`OK`,"zh-cn":`确定`},cancel:{en:`Cancel`,de:`Abbrechen`,ru:`Отмена`,pt:`Cancelar`,nl:`Annuleren`,fr:`Annuler`,it:`Annulla`,es:`Cancelar`,pl:`Anuluj`,uk:`Скасувати`,"zh-cn":`取消`},close:{en:`Close`,de:`Schließen`,ru:`Закрыть`,pt:`Fechar`,nl:`Sluiten`,fr:`Fermer`,it:`Chiudi`,es:`Cerrar`,pl:`Zamknij`,uk:`Закрити`,"zh-cn":`关闭`}},C=`
2
+ dialog {
3
+ box-sizing: border-box;
4
+ width: 480px;
5
+ max-width: calc(100vw - 32px);
6
+ max-height: calc(100vh - 32px);
7
+ padding: 0;
8
+ border: 0;
9
+ border-radius: calc(var(--iob-border-radius) * 2);
10
+ background: var(--iob-paper);
11
+ color: var(--iob-text);
12
+ font-family: var(--iob-font-family);
13
+ font-size: var(--iob-font-size);
14
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
15
+ }
16
+ /* as the dialogs of MUI: a dark paper gets lighter the higher it lies */
17
+ dialog.dark { background-image: linear-gradient(rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.16)); }
18
+ dialog::backdrop { background: rgba(0, 0, 0, 0.5); }
19
+ dialog:focus { outline: none; }
20
+ form { display: flex; flex-direction: column; height: 100%; max-height: inherit; margin: 0; }
21
+ header { display: flex; align-items: center; gap: 8px; padding: 12px 8px 12px 16px; font-size: 1.15em; font-weight: 500; }
22
+ header span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
23
+ .body { flex: 1; min-height: 0; padding: 0 16px 16px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
24
+ footer { display: flex; justify-content: flex-end; gap: 8px; padding: 0 16px 16px; }
25
+ button { font: inherit; padding: 6px 16px; border-radius: var(--iob-border-radius); border: 1px solid var(--iob-primary); background: transparent; color: var(--iob-primary); cursor: pointer; }
26
+ button.primary { background: var(--iob-primary); color: var(--iob-primary-contrast); }
27
+ button.close { border: 0; padding: 2px 8px; font-size: 1.4em; line-height: 1; color: var(--iob-text-secondary); }
28
+ label { display: flex; flex-direction: column; gap: 4px; }
29
+ label.check { flex-direction: row; align-items: center; gap: 8px; }
30
+ input, select, textarea { font: inherit; accent-color: var(--iob-primary); }
31
+ .help { color: var(--iob-text-secondary); font-size: 0.85em; }
32
+ h3 { margin: 4px 0 0; font-size: 1em; }
33
+ p { margin: 0; }
34
+ hr { width: 100%; border: 0; border-top: 1px solid var(--iob-divider); margin: 0; }
35
+ [hidden] { display: none !important; }
36
+ `;function w(e){if(!e)return null;try{let t=Function(`data`,`return (${e});`);return e=>{try{return!!t(e)}catch{return!1}}}catch{return null}}function T(e){return typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):``}function E(e){let{input:t,setting:n}=e;if(t)return t instanceof HTMLInputElement&&t.type===`checkbox`?t.checked:t instanceof HTMLSelectElement?n.options?.[t.selectedIndex]?.value:t.value}function D(e,t,n,r,i){let a={name:t,setting:n,box:e.createElement(`div`),hidden:w(n.hidden),disabled:w(n.disabled)},o=s(n.label,i);switch(n.type){case`header`:return a.box=e.createElement(`h3`),a.box.textContent=s(n.text,i)||o,a;case`staticText`:return a.box=e.createElement(`p`),a.box.textContent=s(n.text,i)||o,a;case`divider`:return a.box=e.createElement(`hr`),a}let c=e.createElement(`label`);a.box=c;let l=e.createElement(`span`);if(l.textContent=o||t,n.type===`checkbox`){let t=e.createElement(`input`);t.type=`checkbox`,t.checked=r===!0||r===`true`,c.className=`check`,c.append(t,l),a.input=t}else if(n.type===`select`){let t=e.createElement(`select`);for(let r of n.options||[]){let n=e.createElement(`option`);n.textContent=s(r.label,i),t.append(n)}let o=(n.options||[]).findIndex(e=>String(e.value)===T(r));t.selectedIndex=o===-1?0:o,c.append(l,t),a.input=t}else if(n.type===`text`&&(n.minRows||1)>1){let t=e.createElement(`textarea`);t.rows=n.minRows||2,t.value=T(r),c.append(l,t),a.input=t}else{let t=e.createElement(`input`),i=T(r);switch(n.type){case`number`:case`slider`:t.type=n.type===`slider`?`range`:`number`,n.min!==void 0&&(t.min=String(n.min)),n.max!==void 0&&(t.max=String(n.max)),t.step=n.step===void 0?`any`:String(n.step);break;case`password`:t.type=`password`;break;case`color`:t.type=!i||/^#[0-9a-f]{6}$/i.test(i)?`color`:`text`;break;default:t.type=`text`}if(t.value=i,t.type===`range`){let n=e.createElement(`output`);n.textContent=t.value,t.addEventListener(`input`,()=>n.textContent=t.value),l.append(`: `,n)}c.append(l,t),a.input=t}if(n.help){let t=e.createElement(`span`);t.className=`help`,t.textContent=s(n.help,i),c.append(t)}return a}function O(e,t={}){let n=t.lang||`en`,r=document,o=e=>S[e][n]||S[e].en||e,l=r.createElement(`div`);l.setAttribute(`data-iob-dialog`,``);let u=l.attachShadow({mode:`open`}),f=r.createElement(`style`);f.textContent=C;let p=r.createElement(`dialog`),m=v(t.theme);p.className=m.type===`dark`?`dark`:``;for(let[e,t]of Object.entries(x(m)))p.style.setProperty(e,t);e.width&&(p.style.width=`${e.width}px`),e.height&&(p.style.height=`${e.height}px`);let h=r.createElement(`form`),g=r.createElement(`header`),_=r.createElement(`span`);_.textContent=s(e.title,n);let y=r.createElement(`button`);y.type=`button`,y.className=`close`,y.title=o(`close`),y.setAttribute(`aria-label`,o(`close`)),y.textContent=`×`,g.append(_,y);let b=r.createElement(`div`);return b.className=`body`,h.append(g,b),p.append(h),u.append(f,p),new Promise(t=>{let f=!1,m=e=>{f||(f=!0,p.open&&p.close(),l.remove(),t(e))};if(y.addEventListener(`click`,()=>m(null)),p.addEventListener(`close`,()=>m(null)),h.addEventListener(`submit`,e=>e.preventDefault()),a(e)){let t={},i=[];for(let[t,a]of Object.entries(e.form.items||{})){let o=e.data?.[t]??a.default,s=D(r,t,a,o,n);i.push(s),b.append(s.box)}let a=()=>{for(let e of i)e.input&&(t[e.name]=E(e));return t},l=()=>{let e=a();for(let t of i)t.box.hidden=t.hidden?t.hidden(e):!1,t.input&&(t.input.disabled=t.disabled?t.disabled(e):!1)};h.addEventListener(`input`,l),h.addEventListener(`change`,l),l();let u=i.find(e=>e.input&&!e.box.hidden&&!e.input.disabled);u?.input&&(u.input.autofocus=!0);let f=r.createElement(`footer`),p=r.createElement(`button`);p.type=`button`,p.textContent=s(e.cancel,n)||o(`cancel`),p.addEventListener(`click`,()=>m(null));let g=r.createElement(`button`);g.type=`submit`,g.className=`primary`,g.textContent=s(e.ok,n)||o(`ok`),f.append(p,g),h.append(f),h.addEventListener(`submit`,()=>m(d(c(e.form),a())))}else b.append(e.element),p.addEventListener(i,e=>m(e.detail??null));r.body.append(l),p.showModal(),u.activeElement&&u.activeElement!==y||(p.tabIndex=-1,p.focus())})}function k(e){return[...new Set(e.filter(e=>typeof e==`string`&&!!e))]}var A=[`socket`,`dialogs`,`theme`,`editMode`,`settings`,`value`],j=class extends HTMLElement{states={};objects={};#e=null;#t={};#n=v(`light`);#r=!1;#i=null;#a=void 0;#o=null;#s=!1;#c=(e,t)=>{this.#o?.states.includes(e)&&(this.states[e]=t||null,this.#_())};#l=(e,t)=>{this.#o?.objects.includes(e)&&(this.objects[e]=t||null,this.#d())};get socket(){return this.#e}set socket(e){this.#e=e||null,this.#d()}get settings(){return this.#t}set settings(e){this.#t=e||{},this.#d()}get theme(){return this.#n}set theme(e){let t=v(e);y(t,this.#n)||(this.#n=t,this.#u(),this.#_())}get editMode(){return this.#r}set editMode(e){let t=!!e;t!==this.#r&&(this.#r=t,this.#_())}get dialogs(){return this.#i}set dialogs(e){this.#i=e||null}get value(){return this.#a}set value(e){e!==this.#a&&(this.#a=e,this.#_())}connectedCallback(){for(let e of A)if(Object.prototype.hasOwnProperty.call(this,e)){let t=this[e];delete this[e],this[e]=t}this.#u(),this.#d()}disconnectedCallback(){this.#g()}getStateIds(e){return[]}getObjectIds(e){return[]}get systemLang(){return this.#e?.systemLang||`en`}text(e){return s(e,this.systemLang)}setState(e,t){return this.#e&&!this.#r?this.#e.setState(e,t):Promise.resolve()}changeValue(e){return this.#r||this.emit(`iob-change`,e)?!1:(this.value=e,!0)}emit(e,t){return this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0,cancelable:!0}))}async openDialog(e){if(this.#r)return null;let t=this.#i?await this.#i.open(e):await O(e,{lang:this.systemLang,theme:this.#n});return a(e)?t&&typeof t==`object`?d(c(e.form),t):null:t??null}#u(){for(let[e,t]of Object.entries(x(this.#n)))this.style.setProperty(e,t)}#d(){if(!this.isConnected)return;let e=this.#e,t=e?k(this.getStateIds(this.#t)):[],n=e?k(this.getObjectIds(this.#t)):[];this.#o&&this.#o.socket!==e&&this.#g();let r=this.#o?.states||[],i=this.#o?.objects||[],a=r.filter(e=>!t.includes(e)),o=i.filter(e=>!n.includes(e)),s=t.filter(e=>!r.includes(e)),c=n.filter(e=>!i.includes(e));e&&a.length&&e.unsubscribeState(a,this.#c),e&&o.length&&this.#h(e,o);for(let e of a)delete this.states[e];for(let e of[...a,...o])!t.includes(e)&&!n.includes(e)&&delete this.objects[e];this.#o=e&&(t.length||n.length)?{socket:e,states:t,objects:n}:null,e&&s.length&&this.#p(e,s),e&&c.length&&this.#m(e,c),this.#_()}#f(e,t,n){return this.#o?.socket===e&&this.#o[t].includes(n)}#p(e,t){e.subscribeState(t,this.#c).catch(e=>console.warn(`<${this.localName}>: cannot subscribe ${t.join(`, `)}: ${e}`));for(let n of t)e.getState(n).then(t=>{this.#f(e,`states`,n)&&this.states[n]===void 0&&(this.states[n]=t||null,this.#_())}).catch(()=>{}),e.getObject(n).then(t=>{this.#f(e,`states`,n)&&!this.#f(e,`objects`,n)&&(this.objects[n]=t||null,this.#_())}).catch(()=>{})}#m(e,t){e.subscribeObject(t,this.#l).catch(e=>console.warn(`<${this.localName}>: cannot subscribe the objects ${t.join(`, `)}: ${e}`));for(let n of t)e.getObject(n).then(t=>{this.#f(e,`objects`,n)&&(this.objects[n]=t||null,this.#d())}).catch(()=>{})}#h(e,t){e.unsubscribeObject(t,this.#l).catch(()=>{})}#g(){if(this.#o){let{socket:e,states:t,objects:n}=this.#o;t.length&&e.unsubscribeState(t,this.#c),n.length&&this.#h(e,n),this.#o=null}this.states={},this.objects={}}#_(){this.#s||(this.#s=!0,queueMicrotask(()=>{this.#s=!1,this.isConnected&&this.render()}))}};function M(e,t){let n=typeof e==`string`?e:e.tag;customElements.get(n)||customElements.define(n,t)}var N=`iob-assistant-satellites`;function P(e){let t=(e||``).trim().replace(/^system\.adapter\./,``);return/^assistant\.\d+$/.test(t)?t:``}var F={en:{"Last seen":`Last seen`,Announcement:`Announcement`,"Send announcement":`Send announcement`,"Speak on all satellites":`Speak on all satellites`,"No satellites registered yet.":`No satellites registered yet.`},de:{"Last seen":`Zuletzt gesehen`,Announcement:`Ansage`,"Send announcement":`Ansage senden`,"Speak on all satellites":`Auf allen Satelliten ansagen`,"No satellites registered yet.":`Noch keine Satelliten registriert.`},ru:{"Last seen":`Последний раз видели`,Announcement:`Объявление`,"Send announcement":`Отправить объявление`,"Speak on all satellites":`Выступить на всех спутниках`,"No satellites registered yet.":`Спутники пока не зарегистрированы.`},pt:{"Last seen":`Última vez visto`,Announcement:`Anúncio`,"Send announcement":`Enviar anúncio`,"Speak on all satellites":`Fale em todos os satélites`,"No satellites registered yet.":`Nenhum satélite registrado ainda.`},nl:{"Last seen":`Laatst gezien`,Announcement:`Aankondiging`,"Send announcement":`Aankondiging verzenden`,"Speak on all satellites":`Communiceer via alle satellieten`,"No satellites registered yet.":`Er zijn nog geen satellieten geregistreerd.`},fr:{"Last seen":`Dernière observation`,Announcement:`Annonce`,"Send announcement":`Envoyer l'annonce`,"Speak on all satellites":`Parlez sur tous les satellites`,"No satellites registered yet.":`Aucun satellite enregistré pour le moment.`},it:{"Last seen":`Ultimo avvistamento`,Announcement:`Annuncio`,"Send announcement":`Invia annuncio`,"Speak on all satellites":`Comunicare su tutti i satelliti`,"No satellites registered yet.":`Nessun satellite ancora registrato.`},es:{"Last seen":`Última vez visto`,Announcement:`Anuncio`,"Send announcement":`Enviar anuncio`,"Speak on all satellites":`Hablar por todos los satélites`,"No satellites registered yet.":`Aún no se han registrado satélites.`},pl:{"Last seen":`Ostatnio widziany`,Announcement:`Ogłoszenie`,"Send announcement":`Wyślij ogłoszenie`,"Speak on all satellites":`Mów na wszystkich satelitach`,"No satellites registered yet.":`Nie zarejestrowano jeszcze żadnych satelitów.`},uk:{"Last seen":`Бачили востаннє`,Announcement:`Оголошення`,"Send announcement":`Надіслати оголошення`,"Speak on all satellites":`Розмовляйте на всіх супутниках`,"No satellites registered yet.":`Поки що не зареєстровано жодного супутника.`},"zh-cn":{"Last seen":`最后一次出现`,Announcement:`公告`,"Send announcement":`发送公告`,"Speak on all satellites":`在所有卫星上通话`,"No satellites registered yet.":`目前尚未注册任何卫星。`}},I={en:{chooseInstance:`Choose an instance of the assistant in the settings`},de:{chooseInstance:`Instanz des Assistenten in den Einstellungen wählen`},ru:{chooseInstance:`Выберите экземпляр ассистента в настройках`},pt:{chooseInstance:`Escolha uma instância do assistente nas configurações`},nl:{chooseInstance:`Kies een instantie van de assistent in de instellingen`},fr:{chooseInstance:`Choisissez une instance de l'assistant dans les paramètres`},it:{chooseInstance:`Scegli un'istanza dell'assistente nelle impostazioni`},es:{chooseInstance:`Elija una instancia del asistente en la configuración`},pl:{chooseInstance:`Wybierz instancję asystenta w ustawieniach`},uk:{chooseInstance:`Виберіть екземпляр асистента в налаштуваннях`},"zh-cn":{chooseInstance:`请在设置中选择助手实例`}};function L(e,t){return n=>r=>r in e.en?e[n]?.[r]||e.en[r]:r===`chooseInstance`?I[n]?.chooseInstance||I.en.chooseInstance:t.includes(r)&&(F[n]?.[r]||F.en?.[r])||r}function R(e){return{de:`de-DE`,en:`en-US`,ru:`ru-RU`,pt:`pt-PT`,nl:`nl-NL`,fr:`fr-FR`,it:`it-IT`,es:`es-ES`,pl:`pl-PL`,uk:`uk-UA`,"zh-cn":`zh-CN`}[e]||e||`en-US`}var z=L({en:{online:`online`,offline:`offline`,status_idle:`idle`,status_listening:`listening`,status_processing:`processing`,status_speaking:`speaking`,whatToSay:`What to say`},de:{online:`online`,offline:`offline`,status_idle:`bereit`,status_listening:`hört zu`,status_processing:`verarbeitet`,status_speaking:`spricht`,whatToSay:`Was gesagt werden soll`},ru:{online:`в сети`,offline:`не в сети`,status_idle:`ожидание`,status_listening:`слушает`,status_processing:`обработка`,status_speaking:`говорит`,whatToSay:`Что сказать`},pt:{online:`online`,offline:`offline`,status_idle:`em espera`,status_listening:`a ouvir`,status_processing:`a processar`,status_speaking:`a falar`,whatToSay:`O que dizer`},nl:{online:`online`,offline:`offline`,status_idle:`inactief`,status_listening:`luistert`,status_processing:`verwerkt`,status_speaking:`spreekt`,whatToSay:`Wat er gezegd moet worden`},fr:{online:`en ligne`,offline:`hors ligne`,status_idle:`en attente`,status_listening:`écoute`,status_processing:`traitement`,status_speaking:`parle`,whatToSay:`Ce qu’il faut dire`},it:{online:`online`,offline:`offline`,status_idle:`inattivo`,status_listening:`in ascolto`,status_processing:`elaborazione`,status_speaking:`parla`,whatToSay:`Cosa dire`},es:{online:`en línea`,offline:`sin conexión`,status_idle:`en espera`,status_listening:`escuchando`,status_processing:`procesando`,status_speaking:`hablando`,whatToSay:`Qué decir`},pl:{online:`online`,offline:`offline`,status_idle:`bezczynny`,status_listening:`słucha`,status_processing:`przetwarza`,status_speaking:`mówi`,whatToSay:`Co powiedzieć`},uk:{online:`у мережі`,offline:`не в мережі`,status_idle:`очікування`,status_listening:`слухає`,status_processing:`обробка`,status_speaking:`говорить`,whatToSay:`Що сказати`},"zh-cn":{online:`在线`,offline:`离线`,status_idle:`空闲`,status_listening:`聆听中`,status_processing:`处理中`,status_speaking:`播报中`,whatToSay:`播报内容`}},[`Last seen`,`Announcement`,`Send announcement`,`Speak on all satellites`,`No satellites registered yet.`]),B={chat:`M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2M6 9h12v2H6zm8 5H6v-2h8zm4-6H6V6h12z`,speaker:`M17 2H7c-1.1 0-2 .9-2 2v16c0 1.1.9 1.99 2 1.99L17 22c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-5 2c1.1 0 2 .9 2 2s-.9 2-2 2c-1.11 0-2-.9-2-2s.89-2 2-2m0 16c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3`,send:`M2.01 21 23 12 2.01 3 2 10l15 2-15 2z`,mic:`M12 14c1.66 0 2.99-1.34 2.99-3L15 5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3m5.3-3c0 3-2.54 5.1-5.3 5.1S6.7 14 6.7 11H5c0 3.41 2.72 6.23 6 6.72V21h2v-3.28c3.28-.48 6-3.3 6-6.72z`,dialog:`M9 13c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4m6.08-7.95c.84 1.18.84 2.71 0 3.89l1.68 1.69c2.02-2.02 2.02-5.07 0-7.27zM20.07 2l-1.63 1.63c2.77 3.02 2.77 7.56 0 10.74L20.07 16c3.9-3.89 3.91-9.95 0-14`,volumeOn:`M3 9v6h4l5 5V4L7 9zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02M14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77`,volumeOff:`M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63m2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71M4.27 3 3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9zM12 4 9.91 6.09 12 8.18z`,announce:`M18 11v2h4v-2zm-2 6.61c.96.71 2.21 1.65 3.2 2.39.4-.53.8-1.07 1.2-1.6-.99-.74-2.24-1.68-3.2-2.4-.4.54-.8 1.08-1.2 1.61M20.4 5.6c-.4-.53-.8-1.07-1.2-1.6-.99.74-2.24 1.68-3.2 2.4.4.53.8 1.07 1.2 1.6.96-.72 2.21-1.65 3.2-2.4M4 9c-1.1 0-2 .9-2 2v2c0 1.1.9 2 2 2h1v4h2v-4h1l5 3V6L8 9zm11.5 3c0-1.33-.58-2.53-1.5-3.35v6.69c.92-.81 1.5-2.01 1.5-3.34`};function V({path:e}){return/* @__PURE__ */ n(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:/* @__PURE__ */ n(`path`,{d:e})})}function H({text:e,icon:t,editMode:i}){return/* @__PURE__ */ r(`div`,{className:`hint${i?` edit`:``}`,children:[/* @__PURE__ */ n(V,{path:t}),/* @__PURE__ */ n(`span`,{children:e})]})}var U=`
37
+ :host {
38
+ display: block;
39
+ width: 100%;
40
+ height: 100%;
41
+ }
42
+ .mount {
43
+ width: 100%;
44
+ height: 100%;
45
+ /* the size of the box does not depend on what is in it */
46
+ container-type: size;
47
+ }
48
+ .edit {
49
+ pointer-events: none;
50
+ }
51
+ .hint {
52
+ box-sizing: border-box;
53
+ width: 100%;
54
+ height: 100%;
55
+ padding: 8px;
56
+ display: flex;
57
+ flex-direction: column;
58
+ align-items: center;
59
+ justify-content: center;
60
+ gap: clamp(2px, 3cqmin, 8px);
61
+ overflow: hidden;
62
+ text-align: center;
63
+ color: var(--iob-text-secondary);
64
+ font-size: clamp(10px, 6cqmin, 15px);
65
+ }
66
+ .hint svg {
67
+ width: clamp(16px, 14cqmin, 36px);
68
+ height: clamp(16px, 14cqmin, 36px);
69
+ fill: currentColor;
70
+ flex: none;
71
+ }
72
+ .icon-btn {
73
+ flex: none;
74
+ box-sizing: border-box;
75
+ width: 36px;
76
+ height: 36px;
77
+ padding: 0;
78
+ border: none;
79
+ border-radius: 50%;
80
+ background: transparent;
81
+ color: inherit;
82
+ display: inline-flex;
83
+ align-items: center;
84
+ justify-content: center;
85
+ cursor: pointer;
86
+ -webkit-tap-highlight-color: transparent;
87
+ }
88
+ .icon-btn svg {
89
+ width: 22px;
90
+ height: 22px;
91
+ fill: currentColor;
92
+ }
93
+ .icon-btn:hover:not(:disabled) {
94
+ background: color-mix(in srgb, currentColor 10%, transparent);
95
+ }
96
+ .icon-btn:focus-visible {
97
+ outline: 2px solid var(--iob-primary);
98
+ outline-offset: -2px;
99
+ }
100
+ .icon-btn:disabled {
101
+ opacity: 0.38;
102
+ cursor: default;
103
+ }
104
+ .icon-btn.primary {
105
+ color: var(--iob-primary);
106
+ }
107
+ .icon-btn.on {
108
+ color: var(--iob-error);
109
+ }
110
+ .icon-btn.filled {
111
+ background: var(--iob-primary);
112
+ color: var(--iob-primary-contrast);
113
+ }
114
+ .icon-btn.filled:hover:not(:disabled) {
115
+ background: color-mix(in srgb, var(--iob-primary) 85%, currentColor);
116
+ }
117
+ .field {
118
+ flex: 1;
119
+ min-width: 0;
120
+ box-sizing: border-box;
121
+ margin: 0;
122
+ padding: 7px 12px;
123
+ font: inherit;
124
+ line-height: 1.4;
125
+ color: inherit;
126
+ background: transparent;
127
+ border: 1px solid var(--iob-divider);
128
+ border-radius: 18px;
129
+ outline: none;
130
+ resize: none;
131
+ field-sizing: content;
132
+ min-height: 36px;
133
+ max-height: 7em;
134
+ }
135
+ .field:focus {
136
+ border-color: var(--iob-primary);
137
+ }
138
+ .field:disabled {
139
+ opacity: 0.6;
140
+ }
141
+ .field::placeholder {
142
+ color: var(--iob-text-secondary);
143
+ }
144
+ .spinner {
145
+ flex: none;
146
+ width: 12px;
147
+ height: 12px;
148
+ border: 2px solid currentColor;
149
+ border-right-color: transparent;
150
+ border-radius: 50%;
151
+ animation: spin 0.8s linear infinite;
152
+ }
153
+ @keyframes spin {
154
+ to {
155
+ transform: rotate(360deg);
156
+ }
157
+ }
158
+
159
+ .satellites {
160
+ box-sizing: border-box;
161
+ width: 100%;
162
+ height: 100%;
163
+ padding: 6px;
164
+ display: flex;
165
+ flex-direction: column;
166
+ gap: 6px;
167
+ overflow: hidden;
168
+ }
169
+ .list {
170
+ flex: 1;
171
+ min-height: 0;
172
+ overflow-y: auto;
173
+ overscroll-behavior: contain;
174
+ display: flex;
175
+ flex-direction: column;
176
+ }
177
+ .empty {
178
+ margin: auto;
179
+ padding: 16px;
180
+ text-align: center;
181
+ color: var(--iob-text-secondary);
182
+ }
183
+ .sat {
184
+ display: flex;
185
+ align-items: center;
186
+ gap: 10px;
187
+ min-height: 44px;
188
+ padding: 4px 4px 4px 8px;
189
+ border-bottom: 1px solid var(--iob-divider);
190
+ }
191
+ .sat:last-child {
192
+ border-bottom: none;
193
+ }
194
+ .dot {
195
+ flex: none;
196
+ width: 10px;
197
+ height: 10px;
198
+ border-radius: 50%;
199
+ background: var(--iob-error);
200
+ }
201
+ .dot.alive {
202
+ background: var(--iob-success);
203
+ }
204
+ .info {
205
+ flex: 1;
206
+ min-width: 0;
207
+ display: flex;
208
+ flex-direction: column;
209
+ }
210
+ .name {
211
+ font-weight: 600;
212
+ white-space: nowrap;
213
+ overflow: hidden;
214
+ text-overflow: ellipsis;
215
+ }
216
+ .sub {
217
+ font-size: 0.8em;
218
+ color: var(--iob-text-secondary);
219
+ white-space: nowrap;
220
+ overflow: hidden;
221
+ text-overflow: ellipsis;
222
+ }
223
+ .status {
224
+ --state: var(--iob-text-secondary);
225
+ flex: none;
226
+ padding: 1px 9px;
227
+ border: 1px solid var(--state);
228
+ border-radius: 999px;
229
+ color: var(--state);
230
+ font-size: 0.78em;
231
+ line-height: 1.5;
232
+ white-space: nowrap;
233
+ }
234
+ .status.listening {
235
+ --state: var(--iob-info);
236
+ }
237
+ .status.processing {
238
+ --state: var(--iob-warning);
239
+ }
240
+ .status.speaking {
241
+ --state: var(--iob-success);
242
+ }
243
+ .status.offline {
244
+ --state: var(--iob-error);
245
+ }
246
+ .seen {
247
+ flex: none;
248
+ width: 6.5em;
249
+ text-align: right;
250
+ font-size: 0.8em;
251
+ color: var(--iob-text-secondary);
252
+ white-space: nowrap;
253
+ overflow: hidden;
254
+ text-overflow: ellipsis;
255
+ }
256
+ .composer {
257
+ flex: none;
258
+ display: flex;
259
+ align-items: center;
260
+ gap: 4px;
261
+ }
262
+ @container (max-width: 340px) {
263
+ .seen {
264
+ display: none;
265
+ }
266
+ }
267
+ @container (max-width: 240px) {
268
+ .status {
269
+ display: none;
270
+ }
271
+ }
272
+ `,W=[`status`,`room`,`host`,`alive`,`lastSeen`],G=3e4,K=10,q={idle:`status_idle`,listening:`status_listening`,processing:`status_processing`,speaking:`status_speaking`,offline:`offline`};function J(e){return[...new Set(e)].sort().join(`
273
+ `)}function Y(e,t,n){if(!e)return`—`;let r=Math.round((e-t)/1e3),i=Math.abs(r),a=r,o=`second`;i>=86400?(a=Math.round(r/86400),o=`day`):i>=3600?(a=Math.round(r/3600),o=`hour`):i>=60&&(a=Math.round(r/60),o=`minute`);try{return new Intl.RelativeTimeFormat(n,{numeric:`auto`,style:`short`}).format(a,o)}catch{return new Date(e).toLocaleString()}}function X(t){let{satellites:i,word:a,editMode:o}=t,[s,c]=e(``),l=()=>{let e=s.trim();e&&!o&&(t.onAnnounceAll(e),c(``))};return/* @__PURE__ */ r(`div`,{className:`satellites${o?` edit`:``}`,children:[/* @__PURE__ */ n(`div`,{className:`list`,children:i===null?null:i.length?i.map(e=>{let i=[e.room&&e.room!==e.name?e.room:``,t.showHost?e.host:``].filter(Boolean).join(` · `),s=q[e.status];return/* @__PURE__ */ r(`div`,{className:`sat`,children:[/* @__PURE__ */ n(`span`,{className:`dot${e.alive?` alive`:``}`,title:a(e.alive?`online`:`offline`)}),/* @__PURE__ */ r(`div`,{className:`info`,children:[/* @__PURE__ */ n(`span`,{className:`name`,title:e.id,children:e.name}),i?/* @__PURE__ */ n(`span`,{className:`sub`,children:i}):null]}),/* @__PURE__ */ n(`span`,{className:`status ${e.status}`,children:s?a(s):e.status}),/* @__PURE__ */ n(`span`,{className:`seen`,title:e.lastSeen?`${a(`Last seen`)}: ${new Date(e.lastSeen).toLocaleString(t.locale)}`:a(`Last seen`),children:Y(e.lastSeen,t.now,t.locale)}),t.announce?/* @__PURE__ */ n(`button`,{type:`button`,className:`icon-btn primary`,title:a(`Send announcement`),"aria-label":a(`Send announcement`),disabled:o,onClick:()=>t.onAnnounce(e),children:/* @__PURE__ */ n(V,{path:B.announce})}):null]},e.id)}):/* @__PURE__ */ n(`div`,{className:`empty`,children:a(`No satellites registered yet.`)})}),t.announce&&i?.length?/* @__PURE__ */ r(`div`,{className:`composer`,children:[/* @__PURE__ */ n(`input`,{className:`field`,type:`text`,value:s,placeholder:a(`Speak on all satellites`),disabled:o,onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),l())}}),/* @__PURE__ */ n(`button`,{type:`button`,className:`icon-btn filled`,title:a(`Speak on all satellites`),"aria-label":a(`Speak on all satellites`),disabled:o||!s.trim(),onClick:l,children:/* @__PURE__ */ n(V,{path:B.announce})})]}):null]})}M(N,class extends j{#e;#t=null;#n=``;#r=null;#i=``;#a=null;#o=0;constructor(){super();let e=this.attachShadow({mode:`open`}),n=document.createElement(`style`);n.textContent=U;let r=document.createElement(`div`);r.className=`mount`,e.append(n,r),this.#e=t(r)}connectedCallback(){super.connectedCallback(),this.#a||=setInterval(()=>this.#c(),G)}disconnectedCallback(){super.disconnectedCallback(),this.#a&&=(clearInterval(this.#a),null)}getStateIds(e){let t=this.#s(e);return this.#i=J(t),t}#s(e){let t=P(e.instance);return!t||t!==this.#n||!this.#t?[]:[...this.#t.keys()].flatMap(e=>W.map(n=>`${t}.satellites.${e}.${n}`))}#c(){++this.#o%K===0&&(this.#r=null),this.isConnected&&this.render()}#l(e){let t=this.socket;if(!t||e===this.#n&&t===this.#r)return;e!==this.#n&&(this.#t=null),this.#n=e,this.#r=t;let n=`${e}.satellites.`;t.getObjectViewSystem(`device`,n,`${n}香`).then(e=>{let t=this.systemLang,r=/* @__PURE__ */ new Map;for(let[i,a]of Object.entries(e||{})){let e=i.slice(n.length);if(!e||e.includes(`.`))continue;let o=a?.common?.name,s=typeof o==`string`?o:o&&(o[t]||o.en)||``;r.set(e,s||e)}return r}).catch(t=>(console.warn(`<${this.localName}>: cannot read the satellites of ${e}: ${String(t)}`),this.#t||/* @__PURE__ */ new Map)).then(n=>{e===this.#n&&t===this.#r&&(this.#t=n,this.#u())}).catch(()=>void 0)}#u(){let e=this.settings;this.settings=e}#d(e){if(!this.#t||e!==this.#n)return null;let t=(t,n)=>this.states[`${e}.satellites.${t}.${n}`]?.val;return[...this.#t.entries()].map(([e,n])=>({id:e,name:n,status:String(t(e,`status`)??`idle`),room:String(t(e,`room`)??``),host:String(t(e,`host`)??``),alive:!!t(e,`alive`),lastSeen:Number(t(e,`lastSeen`))||0})).sort((e,t)=>e.name.localeCompare(t.name,void 0,{numeric:!0})||e.id.localeCompare(t.id))}async#f(e,t,n){if(this.editMode)return;let r=await this.openDialog({title:`${n(`Announcement`)} · ${t.name}`,form:{type:`panel`,items:{text:{type:`text`,label:n(`whatToSay`)}}},data:{text:``},ok:n(`Send announcement`)}),i=typeof r?.text==`string`?r.text.trim():``;i&&await this.setState(`${e}.satellites.${t.id}.tts`,i).catch(()=>void 0)}render(){let e=P(this.settings.instance),t=this.systemLang,r=z(t);e?(this.#l(e),this.socket&&J(this.#s(this.settings))!==this.#i?this.#u():this.#e.render(/* @__PURE__ */ n(X,{satellites:this.#d(e),announce:this.settings.announce!==!1,showHost:!!this.settings.showHost,editMode:this.editMode,now:Date.now(),locale:R(t),word:r,onAnnounce:t=>void this.#f(e,t,r),onAnnounceAll:t=>void this.setState(`${e}.tts.text`,t).catch(()=>void 0)}))):this.#e.render(/* @__PURE__ */ n(H,{text:r(`chooseInstance`),icon:B.speaker,editMode:this.editMode}))}});
@@ -0,0 +1,120 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/ioBroker/web-components/main/schemas/manifest.json",
3
+ "manifestVersion": 1,
4
+ "tag": "iob-assistant-satellites",
5
+ "name": {
6
+ "en": "Voice satellites",
7
+ "de": "Sprach-Satelliten",
8
+ "ru": "Голосовые сателлиты",
9
+ "pt": "Satélites de voz",
10
+ "nl": "Spraaksatellieten",
11
+ "fr": "Satellites vocaux",
12
+ "it": "Satelliti vocali",
13
+ "es": "Satélites de voz",
14
+ "pl": "Satelity głosowe",
15
+ "uk": "Голосові сателіти",
16
+ "zh-cn": "语音卫星"
17
+ },
18
+ "description": {
19
+ "en": "The voice satellites of the assistant live - status, room, last seen - with announcements on one or all of them",
20
+ "de": "Die Sprach-Satelliten des Assistenten live - Status, Raum, zuletzt gesehen - mit Ansagen auf einem oder allen",
21
+ "ru": "Голосовые сателлиты ассистента в реальном времени — статус, комната, последняя активность — с объявлениями на одном или на всех",
22
+ "pt": "Os satélites de voz do assistente ao vivo - estado, divisão, última vez visto - com anúncios num ou em todos",
23
+ "nl": "De spraaksatellieten van de assistent live - status, kamer, laatst gezien - met aankondigingen op één of alle",
24
+ "fr": "Les satellites vocaux de l'assistant en direct - état, pièce, dernière activité - avec des annonces sur un ou tous",
25
+ "it": "I satelliti vocali dell'assistente in tempo reale - stato, stanza, ultimo contatto - con annunci su uno o su tutti",
26
+ "es": "Los satélites de voz del asistente en directo - estado, habitación, última conexión - con anuncios en uno o en todos",
27
+ "pl": "Satelity głosowe asystenta na żywo - stan, pokój, ostatnio widziany - z ogłoszeniami na jednym lub wszystkich",
28
+ "uk": "Голосові сателіти асистента в реальному часі — стан, кімната, остання активність — з оголошеннями на одному або на всіх",
29
+ "zh-cn": "实时显示助手的语音卫星——状态、房间、最后在线——可向单个或全部卫星播报"
30
+ },
31
+ "icon": "../assistant.svg",
32
+ "module": "assistant-satellites.js",
33
+ "size": {
34
+ "width": 440,
35
+ "height": 300
36
+ },
37
+ "settings": {
38
+ "type": "panel",
39
+ "items": {
40
+ "instance": {
41
+ "type": "instance",
42
+ "adapter": "assistant",
43
+ "default": "assistant.0",
44
+ "label": {
45
+ "en": "Instance",
46
+ "de": "Instanz",
47
+ "ru": "Экземпляр",
48
+ "pt": "Instância",
49
+ "nl": "Instantie",
50
+ "fr": "Instance",
51
+ "it": "Istanza",
52
+ "es": "Instancia",
53
+ "pl": "Instancja",
54
+ "uk": "Екземпляр",
55
+ "zh-cn": "实例"
56
+ }
57
+ },
58
+ "announce": {
59
+ "type": "checkbox",
60
+ "default": true,
61
+ "label": {
62
+ "en": "Announcement",
63
+ "de": "Ansage",
64
+ "ru": "Объявление",
65
+ "pt": "Anúncio",
66
+ "nl": "Aankondiging",
67
+ "fr": "Annonce",
68
+ "it": "Annuncio",
69
+ "es": "Anuncio",
70
+ "pl": "Ogłoszenie",
71
+ "uk": "Оголошення",
72
+ "zh-cn": "公告"
73
+ },
74
+ "help": {
75
+ "en": "Speak a text on one satellite or on all of them",
76
+ "de": "Einen Text auf einem Satelliten oder auf allen ansagen",
77
+ "ru": "Произнести текст на одном или на всех сателлитах",
78
+ "pt": "Dizer um texto num satélite ou em todos",
79
+ "nl": "Een tekst uitspreken op één satelliet of op alle",
80
+ "fr": "Prononcer un texte sur un satellite ou sur tous",
81
+ "it": "Pronunciare un testo su un satellite o su tutti",
82
+ "es": "Decir un texto en un satélite o en todos",
83
+ "pl": "Wypowiedz tekst na jednym satelicie lub na wszystkich",
84
+ "uk": "Промовити текст на одному або на всіх сателітах",
85
+ "zh-cn": "在一个或全部卫星上播报一段文字"
86
+ }
87
+ },
88
+ "showHost": {
89
+ "type": "checkbox",
90
+ "default": false,
91
+ "label": {
92
+ "en": "Show host",
93
+ "de": "Host anzeigen",
94
+ "ru": "Показывать хост",
95
+ "pt": "Mostrar host",
96
+ "nl": "Host tonen",
97
+ "fr": "Afficher l'hôte",
98
+ "it": "Mostra host",
99
+ "es": "Mostrar host",
100
+ "pl": "Pokaż host",
101
+ "uk": "Показувати хост",
102
+ "zh-cn": "显示主机"
103
+ },
104
+ "help": {
105
+ "en": "The address the satellite runs on",
106
+ "de": "Die Adresse, unter der der Satellit läuft",
107
+ "ru": "Адрес, на котором работает сателлит",
108
+ "pt": "O endereço em que o satélite funciona",
109
+ "nl": "Het adres waarop de satelliet draait",
110
+ "fr": "L'adresse sur laquelle tourne le satellite",
111
+ "it": "L'indirizzo su cui funziona il satellite",
112
+ "es": "La dirección en la que funciona el satélite",
113
+ "pl": "Adres, pod którym działa satelita",
114
+ "uk": "Адреса, на якій працює сателіт",
115
+ "zh-cn": "卫星运行所在的地址"
116
+ }
117
+ }
118
+ }
119
+ }
120
+ }
package/io-package.json CHANGED
@@ -1,8 +1,21 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "assistant",
4
- "version": "1.4.15",
4
+ "version": "1.5.0",
5
5
  "news": {
6
+ "1.5.0": {
7
+ "en": "Added an assistant chat and a live view of the voice satellites for Aura and other dashboards",
8
+ "de": "Assistenten-Chat und Live-TV der Sprachsatelliten für Aura und andere Dashboards hinzugefügt",
9
+ "ru": "Добавлен чат помощника и просмотр голосовых спутников в реальном времени для Aura и других информационных панелей",
10
+ "pt": "Adicionou um chat e uma visão ao vivo dos satélites de voz do Aura e outros painéis",
11
+ "nl": "Assistent-chat toegevoegd en een liveweergave van de stemsatellieten voor Aura en andere dashboards",
12
+ "fr": "Ajout d'un assistant et d'une vue en direct des satellites vocaux pour Aura et d'autres tableaux de bord",
13
+ "it": "Aggiunta una chat e una vista live dei satelliti vocali per Aura e altri dashboard",
14
+ "es": "Ha añadido un asistente de chat y una vista en directo de los satélites de voz para Aura y otros paneles",
15
+ "pl": "Dodano czat asystenta i widok na żywo satelitów głosowych dla Aura i innych pulpitów nawigacyjnych",
16
+ "uk": "Додано чат помічника та живий перегляд голосових супутників для Aura та інших інформаційних панелей",
17
+ "zh-cn": "为 Aura 和其他仪表板添加了助手聊天和语音卫星的实时视图"
18
+ },
6
19
  "1.4.15": {
7
20
  "en": "OpenAI: use `max_completion_tokens` so newer (reasoning) models like gpt-5-mini work (#21)",
8
21
  "de": "OpenAI: Benutze Max_Completion_Tokens, also neuere Modelle wie GPT-5-Mini Work (#21)",
@@ -80,19 +93,6 @@
80
93
  "pl": "Satelity ESPhome: radio internetowe i muzyka z adresu URL - `kontrolki. <media player>.url odtwarza go jako media (odpowiedzi i ogłoszenia tylko go dotyczą, play/pauze/stop/volume działają na nim), puste lub „stop” zatrzymuje się. Listy odtwarzania (.pls/.m3u) są rozwiązywane; strumień, którego urządzenie nie może zdekodować (AAC, HLS,...), przechodzi przez ffmpeg i jest podawany do niego jako FLAC; `transcode` wymusza to",
81
94
  "uk": "Супутники ESPHome: інтернет-радіо та музика з URL-адреси - `управління. <media player>.url` відтворює його як медіа (відповіді та оголошення лише закривають його, відтворють/пауза/зупинити/гучність діють на ньому), порожній або `stop` зупиняє його. Плейлисти (.pls/.m3u) вирішені; потік, який пристрій не може розшифрувати (AAC, HLS,...), проходить через ffmpeg і подається йому як FLAC; ``транскодування «змушує це",
82
95
  "zh-cn": "espHome 卫星:网络广播和来自 URL 的音乐—— “控件”。<media player>.url`将其作为媒体播放(回复和公告仅对其进行掩盖,播放/暂停/停止/音量对其起作用),清空或 “停止” 停止。播放列表(.pls/.m3u)已解析;设备无法解码的直播(AAC、HLS 等)通过 ffmpeg 运行,以 FLAC 的形式提供给它;`transcode` 强制这样做"
83
- },
84
- "1.4.9": {
85
- "en": "ESPHome satellites with a screen: the yes/no button did not answer pi-agent's question — the follow-up microphone carries the last wake word (ESPHome never clears it) and was taken for a new request. A follow-up is now recognised by the open question (until the next answered request, at most 30 s after the reply), and a stop the firmware sends right after the press no longer drops the answer\npi-agent: a request from a satellite also carries `satellite` (its id under `satellites.*`) and `tts` (its `tts` state), so pi-agent can speak there later (reminders, background tasks)\nTimers of a satellite: `setTimer` takes `satellite`, `seconds`, `name` and `announce` (said word for word when it fires); `listTimers`/`cancelTimer` take `satellite`. An ESPHome satellite shows and rings such a timer like one set there by voice",
86
- "de": "ESPHome-Satelliten mit Bildschirm: Die Ja/Nein-Taste beantwortete Pi-Agents Frage nicht — das Folgemikrofon zeigt das letzte Weckwort (ESPhome löscht es nie) und wurde für eine neue Anfrage verwendet. Ein Follow-up wird nun an der offenen Frage erkannt (bis zur nächsten Antwort, maximal 30 s nach der Antwort) und ein Stopp, den die Firmware sendet, wenn die Antwort nicht mehr gedrückt wird\nPi-Agent: Eine Anfrage von einem Satelliten enthält auch „Satellit“ (ID unter „Satelliten“) und „TTS“, sodass Pi-Agent dort später sprechen kann (Erinnerungen, Hintergrundaufgaben)\nSatelliten-Timer: `setTimer` nimmt `Satelite`, `Seconds`, `Name` und `Announce` (wird Wort für Wort ausgelöst); `listTimers`/`CancelTimer` nimmt `Satelliten`. Ein ESPHome-Satellit zeigt und klingelt so einen Timer per Spracheingabe",
87
- "ru": "Спутники eSphome с экраном: кнопка «да/нет» не ответила на вопрос pi-agent — на следующем микрофоне записано последнее слово для пробуждения (EspHome никогда его не удаляет), и его ответили на новый запрос. Теперь ответ на ответ распознается по открытому вопросу (до получения ответа на следующий запрос, максимум через 30 секунд после ответа), а сообщение об остановке, которое микропрограмма отправляет сразу после нажатия кнопки, больше не отбрасывает ответ\npi-agent: в запросе со спутника также указываются «спутник» (его идентификатор в поле «satellites.*`») и «tts» (состояние «tts»), поэтому pi-agent может говорить об этом позже (напоминания, фоновые задания)\nТаймеры спутника: `setTimer` отнимает время «спутник», «секунды», «имя» и «анонс» (слово в слово произносится при срабатывании); «Listtimers»/«Cancelltimer» принимает значение «спутник». Спутник EspHome показывает и звонит голосом такой же таймер, как и таймер, установленный там",
88
- "pt": "Satélites ESPHome com tela: o botão sim/não respondeu à pergunta do pi-agent — o microfone de acompanhamento carrega a última palavra de alerta (o ESPHome nunca a limpa) e foi usado para um novo pedido. A resposta agora é reconhecida pela pergunta aberta (até a próxima resposta, no máximo 30 s após a resposta), e uma parada que o firmware envia logo após a prensa não dar mais a resposta\npi-agent: um pedido de um satélite também carrega `satellite` (seu id em `satélites.*`) e `tts` (seu estado `tts`), então pi-agent pode falar lá mais tarde (lembretes, tarefas em segundo plano)\nTemporizadores de um satélite: `setTimer` usa `satélite`, `segundos`, `nome` e `anuncio` (dito palavra por palavra); `listTimers`/`cancelTimer` pega `satélite`. Um satélite ESPHome mostra e toca um timer, como o definido por voz.",
89
- "nl": "ESPhomesatellieten met een scherm: de ja/nee-knop was geen antwoord op de vraag van de pi-agent — op de vervolgmicrofoon stond het laatste wake-word (ESPhome wordt nooit gewist) en werd gebruikt voor een nieuw verzoek. Een vervolgvraag wordt nu herkend aan de hand van de open vraag (tot het volgende beantwoorde verzoek, maximaal 30 seconden na het antwoord), en een stop die de firmware verstuurt direct nadat de druk op de knop is gedrukt, het antwoord niet meer laat vallen\npi-agent: een verzoek van een satelliet bevat ook `satelliet` (het id onder `satellieten.*`) en `tts` (de status van `tts`), zodat pi-agent daar later kan spreken (herinneringen, achtergrondtaken)\nTimers van een satelliet: voor `SetTimer` zijn `satelliet`, `seconden`, `naam` en `aankondiging` nodig (woord voor woord gezegd wanneer het afgaat); voor `ListTimers`/`CancelTimer` is `satelliet`. Een satelliet van EspHome toont en rinkelt zo'n timer, zoals een timer die daar met je stem is ingesteld.",
90
- "fr": "Satellites ESPhome avec écran : le bouton oui/non n'a pas répondu à la question de Pi-Agent. Le micro de suivi émet le dernier mot (ESPhome ne l'efface jamais) et a été enregistré pour une nouvelle demande. Un suivi est désormais reconnu par la question ouverte (jusqu'à la réponse suivante, au plus 30 s après la réponse), et un arrêt envoyé par le firmware juste après avoir appuyé\npi-agent : une demande émanant d'un satellite contient également « satellite » (son identifiant sous « satellites* ») et « tts » (son état « tts »), afin que pi-agent puisse y parler plus tard (rappels, tâches de fond)\nChronomètres d'un satellite : « SetTimer » prend « satellite », « secondes », « nom » et « annonce » (dit mot pour mot quand il se déclenche) ; « ListTimers`/`CancelTimer` prend « satellite ». Un satellite EspHome émet et sonne, comme s'il s'agissait d'un minuteur vocal",
91
- "it": "Satelliti ESPHome con schermo: il pulsante sì/no non ha risposto alla domanda di pi-agent: il microfono di follow-up ha l'ultima parola attiva (ESPhome non la cancella mai). Un follow-up è ora riconosciuto dalla domanda aperta (fino alla risposta successiva, al massimo 30 s dopo la risposta) e un arresto del firmware subito dopo la stampa non fa più cadere la risposta\npi-agent: una richiesta da un satellite contiene anche `satellite` (il suo id è `satellites.*`) e `tts` (stato `tts`), così pi-agent può parlarne più tardi (promemoria, attività in background)\nTimer di un satellite: `setTimer` utilizza `satellite`, `second`, `name` e `annunce` (detto parola per parola); `listTimers`/`cancelTimer` Un satellite ESPhome mostra e suona un timer impostato a voce",
92
- "es": "Satélites ESPhome con pantalla: el botón sí/no no responde a la pregunta del agente. El micrófono de seguimiento lleva la última palabra de activación (ESPhome nunca la borra) y se usó para una nueva solicitud. Ahora la pregunta abierta reconoce un seguimiento (hasta la siguiente solicitud de respuesta, como máximo 30 segundos después de la respuesta) y una parada que envía el firmware justo después de pulsar ya no deja caer la respuesta\npi-agent: una solicitud de un satélite también incluye «satélite» (su identificador en «satélites.*») y «tts» (su estado en «tts»), por lo que pi-agent puede hablar allí más tarde (recordatorios, tareas en segundo plano)\nTemporizadores de un satélite: `setTimer` toma `satélite`, `segundo`, `nombre` y `anunciar` (se dice palabra por palabra cuando se dispara); `ListTimers`/`CancelTimer` toma «satélite». Un satélite ESPhome muestra y suena un temporizador como el que pone allí por voz",
93
- "pl": "Satelity eSphome z ekranem: przycisk tak/nie nie odpowiedział na pytanie pi-agenta - mikrofon uzupełniający nosi ostatnie słowo budzenia (ESPHome nigdy go nie usuwa) i został przyjęty na nowe żądanie. Kontynuacja jest teraz rozpoznawana przez otwarte pytanie (do następnego żądania udzielenia odpowiedzi, najwyżej 30 s po odpowiedzi) i zatrzymanie, które oprogramowanie układowe wysyła zaraz po tym, jak prasa przestaje usuwać odpowiedzi\npi-agent: żądanie satelity zawiera również `satelitę` (jego identyfikator pod `satelitami.*`) i `tts` (jego stan `tts`), więc pi-agent może tam mówić później (przypomnienia, zadania w tle)\nTimery satelity: „setTimer” przyjmuje „satelita”, „sekundy”, „imię” i „ogłoszenie” (wypowiadane słowo w słowo, gdy wystrzeliwuje); „Listtimers” /„ Canceltimer” przyjmują „satelitę”. Satelita eSphome pokazuje i dzwoni taki timer, jak ten ustawiony tam głosem",
94
- "uk": "Супутники ESPHome з екраном: кнопка так/ні не відповіла на запитання pi-агента - наступний мікрофон несе останнє слово пробудження (ESPHome ніколи не очищає його) і був прийнятий для нового запиту. Подальший запит тепер розпізнається за відкритим питанням (до наступного відповідного запиту, максимум через 30 с після відповіді), а зупинка мікропрограми надсилає відразу після того, як натискання більше не відкидає відповідь\npi-agent: запит із супутника також несе `satellite` (його ідентифікатор у `satellit.*`) та `tts` (його стан `tts`), тому pi-агент може говорити там пізніше (нагадування, фонові завдання)\nТаймери супутника: `setTimer` приймає `супутники`, `секунди`, `ім'я` та `оголошення` (сказано слово в слово, коли він спрацьовує); `ListTimer` /`cancelTimer` приймають `супутники`. Супутник ESPHome показує і дзвонить такий таймер, як встановлений там голосом",
95
- "zh-cn": "带有屏幕的 espHome 卫星:是/否按钮没有回答 pi-agent 的问题——后续麦克风带有最后的唤醒词(espHome 从来没有将其清除),因此被要求接受新的请求。现在,悬而未决的问题(直到下一个已回答的请求,在回复后至多 30 秒)可以识别后续操作,并且在按下不再丢弃答案后,固件会立即停止响应\npi-agent:来自卫星的请求还带有 “卫星”(它在 “卫星” 下的 ID)和 “tts”(其 “tts” 状态),因此 pi-agent 稍后可以在那里说话(提醒、后台任务)\n卫星的计时器:`setTimer` 采用 “卫星”、“秒”、“名称” 和 “通知”(发射时逐字逐句说);`listTimers`/`cancelTimers`采用 “卫星”。一颗 ESPHome 卫星显示和响起这样的计时器,就像在那里用语音设定的计时器一样"
96
96
  }
97
97
  },
98
98
  "titleLang": {
@@ -151,6 +151,10 @@
151
151
  "adminUI": {
152
152
  "config": "json"
153
153
  },
154
+ "webComponents": [
155
+ "webcomponents/assistant-chat.json",
156
+ "webcomponents/assistant-satellites.json"
157
+ ],
154
158
  "dependencies": [
155
159
  {
156
160
  "js-controller": ">=6.0.11"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.assistant",
3
- "version": "1.4.15",
3
+ "version": "1.5.0",
4
4
  "description": "LLM assistant for ioBroker — ask about and control any state via an LLM with tool-calling",
5
5
  "author": "ioBroker",
6
6
  "license": "MIT",
@@ -40,17 +40,20 @@
40
40
  "test:integration": "tsc -p tsconfig.build.json && node --test \"test/integration/*.test.js\"",
41
41
  "test:package": "mocha test/testPackageFiles.ts --exit",
42
42
  "test": "npm run test:integration",
43
- "build": "npm run build:backend && npm run build:gui",
43
+ "build": "npm run build:backend && npm run build:gui && npm run build:wc",
44
44
  "build:backend": "tsc -p tsconfig.build.json",
45
45
  "build:gui": "cd src-admin && npm install && npm run build",
46
+ "build:wc": "cd src-webcomponents && npm install && npm run build",
46
47
  "lint": "eslint -c eslint.config.mjs",
47
- "npm": "npm i && cd src-admin && npm i",
48
+ "lint:wc": "cd src-webcomponents && npm run lint",
49
+ "check:wc": "cd src-webcomponents && npm run check-ts",
50
+ "npm": "npm i && cd src-admin && npm i && cd ../src-webcomponents && npm i",
48
51
  "prepublishOnly": "npm run build",
49
52
  "release-patch": "release-script patch --yes",
50
53
  "release-minor": "release-script minor --yes",
51
54
  "release-major": "release-script major --yes",
52
55
  "release": "release-script",
53
- "update-packages": "npx -y npm-check-updates --upgrade && cd src-admin && npx -y npm-check-updates --upgrade"
56
+ "update-packages": "npx -y npm-check-updates --upgrade && cd src-admin && npx -y npm-check-updates --upgrade && cd ../src-webcomponents && npx -y npm-check-updates --upgrade"
54
57
  },
55
58
  "bugs": {
56
59
  "url": "https://github.com/ioBroker/ioBroker.assistant/issues"