iobroker.javascript 10.1.4 → 10.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -48
- package/admin/assets/AiChatPanel-CsDFom-L.js +27 -0
- package/admin/assets/AiChatService-k72w0sOt.js +216 -0
- package/admin/assets/AiDiffView-DAleMXcP.js +1 -0
- package/admin/assets/AiInlineProvider-C5EJApDe.js +5 -0
- package/admin/assets/Debugger-B6_1wqlh.js +15 -0
- package/admin/assets/Error-DBiAAbCC.js +1 -0
- package/admin/assets/Import-Dm-2zYlI.js +1 -0
- package/admin/assets/RulesEditor-BML5AwgM.js +1 -0
- package/admin/assets/RulesEditor-CybrKL-9.css +1 -0
- package/admin/assets/ScriptEditor-BxwJbR3_.js +2 -0
- package/admin/assets/ScriptEditorVanillaMonaco-C3AgkXsv.js +3 -0
- package/admin/assets/_virtual_mf-localSharedImportMap___mfe_internal__iobroker_javascript__mf_owner__1-CQpJXcpz.js +1 -0
- package/admin/assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__113183188387379__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-Drq9CkPs.js +1217 -0
- package/admin/assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__113183188387379__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-B8K8J9cp.js +9 -0
- package/admin/assets/aiPromptBuilder-CuCGSQIi.js +1 -0
- package/admin/assets/{blockly-DBw-ytY1.js → blockly-Fp-1_Ye3.js} +1 -1
- package/admin/assets/{blocks_action-Dflw8PyN.js → blocks_action-CPgrbjAf.js} +1 -1
- package/admin/assets/{blocks_convert-XTqMxB04.js → blocks_convert-2eEzarQy.js} +1 -1
- package/admin/assets/{blocks_logic-JaZOQj6_.js → blocks_logic-DMEjFKWc.js} +1 -1
- package/admin/assets/{blocks_number-TU4dV-Ia.js → blocks_number-Bsx0zQT_.js} +1 -1
- package/admin/assets/{blocks_object-V6ojF22C.js → blocks_object-Q1nKLN6t.js} +1 -1
- package/admin/assets/{blocks_procedures-Cu8VeJhw.js → blocks_procedures-CHMjZQbf.js} +1 -1
- package/admin/assets/{blocks_sendto-BnDWzP0n.js → blocks_sendto-DsDq_Gu7.js} +1 -1
- package/admin/assets/{blocks_switch-DKUc060E.js → blocks_switch-Yog8S2MC.js} +1 -1
- package/admin/assets/{blocks_system-BW_UpMW-.js → blocks_system-2D8iX32Y.js} +1 -1
- package/admin/assets/{blocks_text-BIU2kf_V.js → blocks_text-C5-csrVL.js} +1 -1
- package/admin/assets/{blocks_time-2vgvS4_j.js → blocks_time-LB5i9yMW.js} +1 -1
- package/admin/assets/{blocks_timeout-BPzmWif8.js → blocks_timeout-CHGW670q.js} +1 -1
- package/admin/assets/{blocks_trigger-BSFZEWEO.js → blocks_trigger-D-2z_OfF.js} +1 -1
- package/admin/assets/cronHoverProvider-DYMf8M44.js +2 -0
- package/admin/assets/{dist-BF-PlO2i.js → dist-D4uJqRBO.js} +1 -1
- package/admin/assets/field_cron-B-SF-uZM.js +1 -0
- package/admin/assets/field_oid-fYE12Bhj.js +1 -0
- package/admin/assets/field_script-aZs3j-vG.js +1 -0
- package/admin/assets/{helpers-BFQD9R82.js → helpers-CalO_DDQ.js} +1 -1
- package/admin/assets/{hostInit-B_aW3Wuw.js → hostInit-CzvCZFy5.js} +1 -1
- package/admin/assets/index-CqFiN-25.js +871 -0
- package/admin/assets/inlineChatWidget-n7ufGLov.js +2 -0
- package/admin/assets/{inlineDiffController-DGl5rDYU.js → inlineDiffController-5u3tIcIH.js} +1 -1
- package/admin/assets/{mf-entry-bootstrap-0-ec2e487a.js → mf-entry-bootstrap-0-db6d825d.js} +14 -2
- package/admin/assets/pendingShares-C6DqQuMX.js +1 -0
- package/admin/assets/stateHoverProvider-C0OUV2Nh.js +9 -0
- package/admin/assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__iobroker_javascript__remoteEntry_js-BvxK85AS.js +1 -0
- package/admin/assets/{vite-preload-helper-B7qeedMF.js → vite-preload-helper-CaC3yEL3.js} +1 -1
- package/admin/custom/assets/Components-qR8oYG5T.js +1 -0
- package/admin/custom/assets/_virtual_mf-localSharedImportMap___mfe_internal__ConfigCustomJavascriptSet__mf_owner__1-CB5V_0nT.js +1 -0
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__32150414352696__loadShare___mf_0_emotion_mf_1_react__loadShare__.js-Cc7MmJgr.js +1 -0
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__32150414352696__loadShare___mf_0_emotion_mf_1_styled__loadShare__.js-CFSZkPFK.js +1 -0
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__32150414352696__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-o8Mkax3s.js +1217 -0
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__32150414352696__loadShare___mf_0_iobroker_mf_1_json_mf_2_config__loadShare__.js-DLa2mE8b.js +1 -0
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__32150414352696__loadShare___mf_0_mui_mf_1_x_mf_2_date_mf_2_pickers__loadShare__.js-CZc6K9E9.js +1 -0
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__32150414352696__loadShare__date_mf_2_fns__loadShare__.js-Bx5h7ISf.js +1 -0
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__32150414352696__loadShare__leaflet__loadShare__.js-im3edKNs.js +1 -0
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__32150414352696__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-Ca3AhTHn.js +1 -0
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__32150414352696__prebuild___mf_0_iobroker_mf_1_json_mf_2_config__prebuild__-bDecxMAs.js +124 -0
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__32150414352696__prebuild__leaflet__prebuild__-CAKlcuIS.js +1 -0
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__32150414352696__prebuild__react_mf_1_jsx_mf_2_runtime__prebuild__-Byvr2uOb.js +1 -0
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__32150414352696__prebuild__react_mf_2_dom_mf_1_client__prebuild__-Thbi9Vo9.js +9 -0
- package/admin/custom/assets/dist-D4uJqRBO.js +4 -0
- package/admin/custom/assets/{hostInit-CkdLQZaZ.js → hostInit-B0Qa8jfJ.js} +1 -1
- package/admin/custom/assets/index-DADYLUN0.js +1 -0
- package/admin/custom/assets/{lib-D9tipKpE.js → lib-BDVPOOMD.js} +2 -2
- package/admin/custom/assets/{mf-entry-bootstrap-0-ff278fef.js → mf-entry-bootstrap-0-b41e47ad.js} +14 -2
- package/admin/custom/assets/pendingShares-Gn0OX49v.js +1 -0
- package/admin/custom/assets/virtualExposes-DjwWqUOb.js +1 -0
- package/admin/custom/assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__ConfigCustomJavascriptSet__customComponents_js-CHOLf9xJ.js +1 -0
- package/admin/custom/assets/{virtual_mf-exposes___mfe_internal__ConfigCustomJavascriptSet__customComponents_js-C1DpedFv.js → virtual_mf-exposes___mfe_internal__ConfigCustomJavascriptSet__customComponents_js-C0XlV8T_.js} +2 -2
- package/admin/custom/assets/{vite-preload-helper-B7qeedMF.js → vite-preload-helper-CaC3yEL3.js} +1 -1
- package/admin/custom/customComponents.js +2 -2
- package/admin/i18n/de.json +8 -2
- package/admin/i18n/en.json +8 -2
- package/admin/i18n/es.json +8 -2
- package/admin/i18n/fr.json +8 -2
- package/admin/i18n/it.json +8 -2
- package/admin/i18n/nl.json +8 -2
- package/admin/i18n/pl.json +8 -2
- package/admin/i18n/pt.json +8 -2
- package/admin/i18n/ru.json +8 -2
- package/admin/i18n/uk.json +8 -2
- package/admin/i18n/zh-cn.json +8 -2
- package/admin/jsonConfig.json +53 -0
- package/admin/mf-manifest.json +1 -1
- package/admin/mf-stats.json +1 -1
- package/admin/remoteEntry.js +2 -2
- package/admin/tab.html +5 -5
- package/build/lib/aiProviderResolver.js +22 -1
- package/build/lib/aiProviderResolver.js.map +1 -1
- package/build/lib/lazyTsServer.js +177 -0
- package/build/lib/lazyTsServer.js.map +1 -0
- package/build/main.js +176 -24
- package/build/main.js.map +1 -1
- package/build/types.d.ts +13 -0
- package/io-package.json +31 -28
- package/package.json +7 -8
- package/admin/assets/AiChatPanel-D93BBufl.js +0 -242
- package/admin/assets/AiDiffView-D5QZDwuC.js +0 -1
- package/admin/assets/AiInlineProvider-CRU2J938.js +0 -5
- package/admin/assets/Debugger-BLzsRkue.js +0 -15
- package/admin/assets/Error-BWXtkB6H.js +0 -1
- package/admin/assets/Import-D_RBSmNU.js +0 -1
- package/admin/assets/RulesEditor-DpKr8byp.js +0 -1
- package/admin/assets/RulesEditor-QNWIRnqB.css +0 -1
- package/admin/assets/ScriptEditor-DK6nNmcp.js +0 -2
- package/admin/assets/ScriptEditorVanillaMonaco-BVIwadsl.js +0 -3
- package/admin/assets/_virtual_mf-localSharedImportMap___mfe_internal__iobroker_javascript__mf_owner__1-v3-PYsgp.js +0 -1
- package/admin/assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-GB0oxSwG.js +0 -1217
- package/admin/assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-SF46owzN.js +0 -9
- package/admin/assets/aiPromptBuilder-CtijdvYL.js +0 -1
- package/admin/assets/cronHoverProvider-BMVsvVuG.js +0 -2
- package/admin/assets/field_cron-Br4hxeLb.js +0 -1
- package/admin/assets/field_oid-ojNnLVGL.js +0 -1
- package/admin/assets/field_script-Bs925umq.js +0 -1
- package/admin/assets/index-BnLv569U.js +0 -871
- package/admin/assets/inlineChatWidget-BcLIwfEH.js +0 -2
- package/admin/assets/stateHoverProvider-XKm8a_93.js +0 -9
- package/admin/assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__iobroker_javascript__remoteEntry_js-IRf47UYM.js +0 -1
- package/admin/custom/assets/Components-BpxzAzc7.js +0 -1
- package/admin/custom/assets/_virtual_mf-localSharedImportMap___mfe_internal__ConfigCustomJavascriptSet__mf_owner__1-wwYTJNxa.js +0 -1
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__1__loadShare___mf_0_emotion_mf_1_react__loadShare__.js-DzaRKfE_.js +0 -1
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__1__loadShare___mf_0_emotion_mf_1_styled__loadShare__.js-B9fjpXOq.js +0 -1
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-QxUxIFgP.js +0 -1217
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__1__loadShare___mf_0_iobroker_mf_1_json_mf_2_config__loadShare__.js-BUk3WHjQ.js +0 -1494
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__1__loadShare__leaflet__loadShare__.js-n2zIPi0L.js +0 -1
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-DqjU6PXX.js +0 -9
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__1__prebuild__date_mf_2_fns__prebuild__-CXAEcWml.js +0 -1
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__1__prebuild__leaflet__prebuild__-BeF0jEWM.js +0 -1
- package/admin/custom/assets/index-D2qJNee0.js +0 -1
- package/admin/custom/assets/setYear-DXk_Jooa.js +0 -1
- package/admin/custom/assets/virtualExposes-vH26J8jF.js +0 -1
- package/admin/custom/assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__ConfigCustomJavascriptSet__customComponents_js-qdaLIbFV.js +0 -1
package/admin/i18n/ru.json
CHANGED
|
@@ -107,5 +107,11 @@
|
|
|
107
107
|
"useUnknownInCatchVariables help": "Типизировать переменную ошибки в блоках \"catch\" как \"unknown\" вместо \"any\".",
|
|
108
108
|
"www.typescriptlang.org/tsconfig": "www.typescriptlang.org/tsconfig",
|
|
109
109
|
"mirrorPath forbidden": "Этот путь нельзя использовать для зеркалирования. Измените его.",
|
|
110
|
-
"mirrorPath help": "Отдельный пустой каталог вне установки ioBroker, доступный для записи пользователю iobroker. Если папка там исчезнет, скрипты из неё будут удалены из базы данных."
|
|
111
|
-
|
|
110
|
+
"mirrorPath help": "Отдельный пустой каталог вне установки ioBroker, доступный для записи пользователю iobroker. Если папка там исчезнет, скрипты из неё будут удалены из базы данных.",
|
|
111
|
+
"Show AI helpers in the script editor": "Показывать ИИ-помощники в Skript-Editor",
|
|
112
|
+
"Code actions above functions, tooltips for object IDs and CRON expressions, and inline code suggestions": "Действия над функциями, подсказки для ID объектов и CRON-выражений, а также встроенные предложения кода",
|
|
113
|
+
"API keys": "API-ключи",
|
|
114
|
+
"Type definitions": "Определения типов",
|
|
115
|
+
"Load type definitions": "Загружать определения типов",
|
|
116
|
+
"loadTypings help": "Определения типов Node.js, ioBroker и настроенных библиотек. Они читаются только тогда, когда действительно нужны - для компиляции TypeScript-скрипта или для встроенного редактора, - поскольку добавляют компилятору около 90 МБ. Если выключить, они не будут прочитаны никогда: редактор потеряет автодополнение, а TypeScript-скрипты перестанут компилироваться. Чистый JavaScript, включая декларации глобальных JavaScript, не затрагивается."
|
|
117
|
+
}
|
package/admin/i18n/uk.json
CHANGED
|
@@ -107,5 +107,11 @@
|
|
|
107
107
|
"useUnknownInCatchVariables help": "Типізувати змінну помилки в блоках \"catch\" як \"unknown\" замість \"any\".",
|
|
108
108
|
"www.typescriptlang.org/tsconfig": "www.typescriptlang.org/tsconfig",
|
|
109
109
|
"mirrorPath forbidden": "Цей шлях не можна використовувати для дзеркалювання. Змініть його.",
|
|
110
|
-
"mirrorPath help": "Окремий порожній каталог поза встановленням ioBroker, доступний для запису користувачу iobroker. Якщо там зникне тека, скрипти в ній буде видалено з бази даних."
|
|
111
|
-
|
|
110
|
+
"mirrorPath help": "Окремий порожній каталог поза встановленням ioBroker, доступний для запису користувачу iobroker. Якщо там зникне тека, скрипти в ній буде видалено з бази даних.",
|
|
111
|
+
"Show AI helpers in the script editor": "Показувати ШІ-помічники в редакторі скриптів",
|
|
112
|
+
"Code actions above functions, tooltips for object IDs and CRON expressions, and inline code suggestions": "Дії з кодом над функціями, підказки для ID об’єктів і CRON-виразів та вбудовані пропозиції коду",
|
|
113
|
+
"API keys": "API-ключі",
|
|
114
|
+
"Type definitions": "Визначення типів",
|
|
115
|
+
"Load type definitions": "Завантажувати визначення типів",
|
|
116
|
+
"loadTypings help": "Визначення типів Node.js, ioBroker і налаштованих бібліотек. Вони читаються лише тоді, коли справді потрібні - для компіляції TypeScript-скрипта або для вбудованого редактора, - бо додають компілятору близько 90 МБ. Вимкнені, вони не читаються ніколи: редактор втрачає автодоповнення, а TypeScript-скрипти більше не компілюються. Чистий JavaScript, зокрема декларації глобальних JavaScript, не зачіпається."
|
|
117
|
+
}
|
package/admin/i18n/zh-cn.json
CHANGED
|
@@ -107,5 +107,11 @@
|
|
|
107
107
|
"useUnknownInCatchVariables help": "将 \"catch\" 块中的错误变量类型设为 \"unknown\" 而不是 \"any\"。",
|
|
108
108
|
"www.typescriptlang.org/tsconfig": "www.typescriptlang.org/tsconfig",
|
|
109
109
|
"mirrorPath forbidden": "此路径不允许用于镜像。请更改。",
|
|
110
|
-
"mirrorPath help": "一个位于 ioBroker 安装目录之外的专用空目录,iobroker 用户需有写入权限。如果其中的文件夹消失,其中的脚本将从数据库中删除。"
|
|
111
|
-
|
|
110
|
+
"mirrorPath help": "一个位于 ioBroker 安装目录之外的专用空目录,iobroker 用户需有写入权限。如果其中的文件夹消失,其中的脚本将从数据库中删除。",
|
|
111
|
+
"Show AI helpers in the script editor": "在脚本编辑器中显示 AI 助手",
|
|
112
|
+
"Code actions above functions, tooltips for object IDs and CRON expressions, and inline code suggestions": "函数上方的代码操作、对象 ID 和 CRON 表达式的提示,以及内联代码建议",
|
|
113
|
+
"API keys": "API 密钥",
|
|
114
|
+
"Type definitions": "类型定义",
|
|
115
|
+
"Load type definitions": "加载类型定义",
|
|
116
|
+
"loadTypings help": "Node.js、ioBroker 和已配置库的类型定义。它们只在真正需要时才读取——编译 TypeScript 脚本或响应内置编辑器——因为它们会让编译器多占用约 90 MB。关闭后将永远不会读取:编辑器失去自动补全,TypeScript 脚本无法再编译。纯 JavaScript(包括全局 JavaScript 的声明)不受影响。"
|
|
117
|
+
}
|
package/admin/jsonConfig.json
CHANGED
|
@@ -183,6 +183,24 @@
|
|
|
183
183
|
"marginBottom": 16
|
|
184
184
|
}
|
|
185
185
|
},
|
|
186
|
+
"_tsHeaderTypings": {
|
|
187
|
+
"newLine": true,
|
|
188
|
+
"type": "header",
|
|
189
|
+
"text": "Type definitions",
|
|
190
|
+
"size": 5,
|
|
191
|
+
"xs": 12,
|
|
192
|
+
"sm": 12
|
|
193
|
+
},
|
|
194
|
+
"loadTypings": {
|
|
195
|
+
"newLine": true,
|
|
196
|
+
"type": "checkbox",
|
|
197
|
+
"label": "Load type definitions",
|
|
198
|
+
"help": "loadTypings help",
|
|
199
|
+
"default": true,
|
|
200
|
+
"xs": 12,
|
|
201
|
+
"sm": 12,
|
|
202
|
+
"md": 12
|
|
203
|
+
},
|
|
186
204
|
"_tsHeaderLanguage": {
|
|
187
205
|
"newLine": true,
|
|
188
206
|
"type": "header",
|
|
@@ -542,6 +560,25 @@
|
|
|
542
560
|
"marginBottom": 16
|
|
543
561
|
}
|
|
544
562
|
},
|
|
563
|
+
"aiEditorHelpers": {
|
|
564
|
+
"newLine": true,
|
|
565
|
+
"type": "checkbox",
|
|
566
|
+
"label": "Show AI helpers in the script editor",
|
|
567
|
+
"help": "Code actions above functions, tooltips for object IDs and CRON expressions, and inline code suggestions",
|
|
568
|
+
"default": true,
|
|
569
|
+
"xs": 12,
|
|
570
|
+
"sm": 12,
|
|
571
|
+
"md": 12
|
|
572
|
+
},
|
|
573
|
+
"_aiProvidersHeader": {
|
|
574
|
+
"newLine": true,
|
|
575
|
+
"type": "header",
|
|
576
|
+
"text": "API keys",
|
|
577
|
+
"size": 5,
|
|
578
|
+
"xs": 12,
|
|
579
|
+
"sm": 12,
|
|
580
|
+
"md": 12
|
|
581
|
+
},
|
|
545
582
|
"credentialType": {
|
|
546
583
|
"newLine": true,
|
|
547
584
|
"type": "select",
|
|
@@ -715,6 +752,22 @@
|
|
|
715
752
|
"xs": 12,
|
|
716
753
|
"sm": 3,
|
|
717
754
|
"showProcess": true
|
|
755
|
+
},
|
|
756
|
+
"aiReasoningEffort": {
|
|
757
|
+
"newLine": true,
|
|
758
|
+
"type": "select",
|
|
759
|
+
"label": "Reasoning effort",
|
|
760
|
+
"help": "Only for OpenAI-compatible endpoints. Leave on \"Endpoint default\" unless the endpoint needs to be told.",
|
|
761
|
+
"options": [
|
|
762
|
+
{ "value": "", "label": "Endpoint default" },
|
|
763
|
+
{ "value": "none", "label": "Off (local models)" },
|
|
764
|
+
{ "value": "minimal", "label": "Minimal" },
|
|
765
|
+
{ "value": "low", "label": "Low" },
|
|
766
|
+
{ "value": "medium", "label": "Medium" },
|
|
767
|
+
{ "value": "high", "label": "High" }
|
|
768
|
+
],
|
|
769
|
+
"xs": 12,
|
|
770
|
+
"sm": 5
|
|
718
771
|
}
|
|
719
772
|
}
|
|
720
773
|
}
|
package/admin/mf-manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"iobroker_javascript","name":"iobroker_javascript","metaData":{"name":"iobroker_javascript","type":"app","buildInfo":{"buildVersion":"1.0.0","buildName":"iobroker_javascript"},"remoteEntry":{"name":"remoteEntry.js","path":"","type":"module"},"ssrRemoteEntry":{"name":"remoteEntry.ssr.js","path":"","type":"module"},"types":{"path":"","name":"","zip":"@mf-types.zip","api":"@mf-types.d.ts"},"globalName":"iobroker_javascript","pluginVersion":"0.2.5","publicPath":"auto"},"shared":[{"id":"iobroker_javascript:react","name":"react","version":"19.
|
|
1
|
+
{"id":"iobroker_javascript","name":"iobroker_javascript","metaData":{"name":"iobroker_javascript","type":"app","buildInfo":{"buildVersion":"1.0.0","buildName":"iobroker_javascript"},"remoteEntry":{"name":"remoteEntry.js","path":"","type":"module"},"ssrRemoteEntry":{"name":"remoteEntry.ssr.js","path":"","type":"module"},"types":{"path":"","name":"","zip":"@mf-types.zip","api":"@mf-types.d.ts"},"globalName":"iobroker_javascript","pluginVersion":"0.2.5","publicPath":"auto"},"shared":[{"id":"iobroker_javascript:react","name":"react","version":"19.3.0","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__113183188387379__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-Drq9CkPs.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:react-dom","name":"react-dom","version":"19.3.0","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__113183188387379__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-Drq9CkPs.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:@mui/material","name":"@mui/material","version":"9.4.0","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__113183188387379__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-Drq9CkPs.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:prop-types","name":"prop-types","version":"15.8.1","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__113183188387379__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-Drq9CkPs.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:@iobroker/gui-components","name":"@iobroker/gui-components","version":"10.2.3","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__113183188387379__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-Drq9CkPs.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:react/jsx-runtime","name":"react/jsx-runtime","version":"19.3.0","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__113183188387379__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-Drq9CkPs.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:react-dom/client","name":"react-dom/client","version":"19.3.0","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__113183188387379__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-B8K8J9cp.js"]},"css":{"async":[],"sync":[]}}}],"remotes":[],"exposes":[]}
|
package/admin/mf-stats.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"iobroker_javascript","name":"iobroker_javascript","metaData":{"name":"iobroker_javascript","type":"app","buildInfo":{"buildVersion":"1.0.0","buildName":"iobroker_javascript"},"remoteEntry":{"name":"remoteEntry.js","path":"","type":"module"},"ssrRemoteEntry":{"name":"remoteEntry.ssr.js","path":"","type":"module"},"types":{"path":"","name":"","zip":"@mf-types.zip","api":"@mf-types.d.ts"},"globalName":"iobroker_javascript","pluginVersion":"0.2.5","publicPath":"auto"},"shared":[{"id":"iobroker_javascript:react","name":"react","version":"19.2.8","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-GB0oxSwG.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:react-dom","name":"react-dom","version":"19.2.8","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-GB0oxSwG.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:@mui/material","name":"@mui/material","version":"9.4.0","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-GB0oxSwG.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:prop-types","name":"prop-types","version":"15.8.1","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-GB0oxSwG.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:@iobroker/gui-components","name":"@iobroker/gui-components","version":"10.2.1","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-GB0oxSwG.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:react/jsx-runtime","name":"react/jsx-runtime","version":"19.2.8","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-GB0oxSwG.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:react-dom/client","name":"react-dom/client","version":"19.2.8","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-SF46owzN.js"]},"css":{"async":[],"sync":[]}}}],"remotes":[],"exposes":[],"buildOutput":[{"fileName":"assets/hostInit-B_aW3Wuw.js","type":"chunk","isEntry":false,"size":2534},{"fileName":"assets/index-BnLv569U.js","type":"chunk","isEntry":true,"size":1072106},{"fileName":"assets/virtualExposes-DgGB-18P.js","type":"chunk","isEntry":false,"size":126},{"fileName":"remoteEntry.js","type":"chunk","isEntry":false,"size":957},{"fileName":"assets/AiChatPanel-D93BBufl.js","type":"chunk","isEntry":false,"size":68457},{"fileName":"assets/AiDatapointProvider-DzFpUKkT.js","type":"chunk","isEntry":false,"size":2429},{"fileName":"assets/AiDiffView-D5QZDwuC.js","type":"chunk","isEntry":false,"size":1503},{"fileName":"assets/AiInlineProvider-CRU2J938.js","type":"chunk","isEntry":false,"size":2382},{"fileName":"assets/Debugger-BLzsRkue.js","type":"chunk","isEntry":false,"size":146850},{"fileName":"assets/Error-BWXtkB6H.js","type":"chunk","isEntry":false,"size":1018},{"fileName":"assets/Import-D_RBSmNU.js","type":"chunk","isEntry":false,"size":6256},{"fileName":"assets/RulesEditor-DpKr8byp.js","type":"chunk","isEntry":false,"size":26875},{"fileName":"assets/ScriptEditor-DK6nNmcp.js","type":"chunk","isEntry":false,"size":2192},{"fileName":"assets/ScriptEditorVanillaMonaco-BVIwadsl.js","type":"chunk","isEntry":false,"size":25070},{"fileName":"assets/_virtual_mf-localSharedImportMap___mfe_internal__iobroker_javascript__mf_owner__1-v3-PYsgp.js","type":"chunk","isEntry":false,"size":4746},{"fileName":"assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-GB0oxSwG.js","type":"chunk","isEntry":false,"size":2349560},{"fileName":"assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-SF46owzN.js","type":"chunk","isEntry":false,"size":181305},{"fileName":"assets/aiPromptBuilder-CtijdvYL.js","type":"chunk","isEntry":false,"size":77},{"fileName":"assets/applyCodeEdit-D3nb7erO.js","type":"chunk","isEntry":false,"size":633},{"fileName":"assets/blockly-DBw-ytY1.js","type":"chunk","isEntry":false,"size":632009},{"fileName":"assets/blocks_action-Dflw8PyN.js","type":"chunk","isEntry":false,"size":11542},{"fileName":"assets/blocks_convert-XTqMxB04.js","type":"chunk","isEntry":false,"size":8703},{"fileName":"assets/blocks_logic-JaZOQj6_.js","type":"chunk","isEntry":false,"size":3949},{"fileName":"assets/blocks_number-TU4dV-Ia.js","type":"chunk","isEntry":false,"size":700},{"fileName":"assets/blocks_object-V6ojF22C.js","type":"chunk","isEntry":false,"size":6451},{"fileName":"assets/blocks_procedures-Cu8VeJhw.js","type":"chunk","isEntry":false,"size":9305},{"fileName":"assets/blocks_sendto-BnDWzP0n.js","type":"chunk","isEntry":false,"size":10968},{"fileName":"assets/blocks_switch-DKUc060E.js","type":"chunk","isEntry":false,"size":4639},{"fileName":"assets/blocks_system-BW_UpMW-.js","type":"chunk","isEntry":false,"size":22796},{"fileName":"assets/blocks_text-BIU2kf_V.js","type":"chunk","isEntry":false,"size":1736},{"fileName":"assets/blocks_time-2vgvS4_j.js","type":"chunk","isEntry":false,"size":12608},{"fileName":"assets/blocks_timeout-BPzmWif8.js","type":"chunk","isEntry":false,"size":5345},{"fileName":"assets/blocks_trigger-BSFZEWEO.js","type":"chunk","isEntry":false,"size":22883},{"fileName":"assets/blocks_words-bpwd7Ia0.js","type":"chunk","isEntry":false,"size":138581},{"fileName":"assets/cronHoverProvider-BMVsvVuG.js","type":"chunk","isEntry":false,"size":1950},{"fileName":"assets/dist-BF-PlO2i.js","type":"chunk","isEntry":false,"size":66971},{"fileName":"assets/docs-compact-D7rpMc7r.js","type":"chunk","isEntry":false,"size":13791},{"fileName":"assets/field_cron-Br4hxeLb.js","type":"chunk","isEntry":false,"size":697},{"fileName":"assets/field_oid-ojNnLVGL.js","type":"chunk","isEntry":false,"size":9049},{"fileName":"assets/field_script-Bs925umq.js","type":"chunk","isEntry":false,"size":1594},{"fileName":"assets/helpers-BFQD9R82.js","type":"chunk","isEntry":false,"size":3099},{"fileName":"assets/inlineChatWidget-BcLIwfEH.js","type":"chunk","isEntry":false,"size":6857},{"fileName":"assets/inlineDiffController-DGl5rDYU.js","type":"chunk","isEntry":false,"size":7288},{"fileName":"assets/rolldown-runtime-C0FnF6B9.js","type":"chunk","isEntry":false,"size":1291},{"fileName":"assets/stateHoverProvider-XKm8a_93.js","type":"chunk","isEntry":false,"size":144294},{"fileName":"assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__iobroker_javascript__remoteEntry_js-IRf47UYM.js","type":"chunk","isEntry":false,"size":17872},{"fileName":"assets/virtual_mf-exposes___mfe_internal__iobroker_javascript__remoteEntry_js-ChiJXsfH.js","type":"chunk","isEntry":false,"size":24},{"fileName":"assets/vite-preload-helper-B7qeedMF.js","type":"chunk","isEntry":false,"size":1243},{"fileName":"assets/RulesEditor-QNWIRnqB.css","type":"asset","isEntry":false,"size":14069},{"fileName":"assets/blockly2js-B3Jxf2e-.svg","type":"asset","isEntry":false,"size":8421},{"fileName":"assets/hysteresis-CLhhemcG.png","type":"asset","isEntry":false,"size":12163},{"fileName":"assets/index-Z8Hkv58g.css","type":"asset","isEntry":false,"size":7849},{"fileName":"assets/rules2js-DnYyR8mI.svg","type":"asset","isEntry":false,"size":6950},{"fileName":"assets/tileBlockly-BMpdinN3.png","type":"asset","isEntry":false,"size":12893},{"fileName":"assets/tileJS-C48gYbHw.png","type":"asset","isEntry":false,"size":17266},{"fileName":"assets/tileRules-BkbaFIhs.png","type":"asset","isEntry":false,"size":83463},{"fileName":"assets/tileTS-CsXmgy4B.png","type":"asset","isEntry":false,"size":13415},{"fileName":"index.html","type":"asset","isEntry":false,"size":21986},{"fileName":"assets/mf-entry-bootstrap-0-ec2e487a.js","type":"asset","isEntry":false,"size":1566}],"assetAnalysis":{"react":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-GB0oxSwG.js"],"async":[]},"css":{"sync":[],"async":[]}},"react-dom":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-GB0oxSwG.js"],"async":[]},"css":{"sync":[],"async":[]}},"react/jsx-runtime":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-GB0oxSwG.js"],"async":[]},"css":{"sync":[],"async":[]}},"prop-types":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-GB0oxSwG.js"],"async":[]},"css":{"sync":[],"async":[]}},"@mui/material":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-GB0oxSwG.js"],"async":[]},"css":{"sync":[],"async":[]}},"@iobroker/gui-components":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-GB0oxSwG.js"],"async":[]},"css":{"sync":[],"async":[]}},"react-dom/client":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-SF46owzN.js"],"async":[]},"css":{"sync":[],"async":[]}}}}
|
|
1
|
+
{"id":"iobroker_javascript","name":"iobroker_javascript","metaData":{"name":"iobroker_javascript","type":"app","buildInfo":{"buildVersion":"1.0.0","buildName":"iobroker_javascript"},"remoteEntry":{"name":"remoteEntry.js","path":"","type":"module"},"ssrRemoteEntry":{"name":"remoteEntry.ssr.js","path":"","type":"module"},"types":{"path":"","name":"","zip":"@mf-types.zip","api":"@mf-types.d.ts"},"globalName":"iobroker_javascript","pluginVersion":"0.2.5","publicPath":"auto"},"shared":[{"id":"iobroker_javascript:react","name":"react","version":"19.3.0","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__113183188387379__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-Drq9CkPs.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:react-dom","name":"react-dom","version":"19.3.0","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__113183188387379__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-Drq9CkPs.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:@mui/material","name":"@mui/material","version":"9.4.0","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__113183188387379__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-Drq9CkPs.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:prop-types","name":"prop-types","version":"15.8.1","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__113183188387379__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-Drq9CkPs.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:@iobroker/gui-components","name":"@iobroker/gui-components","version":"10.2.3","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__113183188387379__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-Drq9CkPs.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:react/jsx-runtime","name":"react/jsx-runtime","version":"19.3.0","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__113183188387379__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-Drq9CkPs.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:react-dom/client","name":"react-dom/client","version":"19.3.0","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__113183188387379__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-B8K8J9cp.js"]},"css":{"async":[],"sync":[]}}}],"remotes":[],"exposes":[],"buildOutput":[{"fileName":"assets/hostInit-CzvCZFy5.js","type":"chunk","isEntry":false,"size":2819},{"fileName":"assets/index-CqFiN-25.js","type":"chunk","isEntry":true,"size":1075643},{"fileName":"assets/pendingShares-C6DqQuMX.js","type":"chunk","isEntry":false,"size":2601},{"fileName":"assets/virtualExposes-DgGB-18P.js","type":"chunk","isEntry":false,"size":126},{"fileName":"remoteEntry.js","type":"chunk","isEntry":false,"size":957},{"fileName":"assets/AiChatPanel-CsDFom-L.js","type":"chunk","isEntry":false,"size":53803},{"fileName":"assets/AiChatService-k72w0sOt.js","type":"chunk","isEntry":false,"size":15373},{"fileName":"assets/AiDatapointProvider-DzFpUKkT.js","type":"chunk","isEntry":false,"size":2429},{"fileName":"assets/AiDiffView-DAleMXcP.js","type":"chunk","isEntry":false,"size":1517},{"fileName":"assets/AiInlineProvider-C5EJApDe.js","type":"chunk","isEntry":false,"size":2322},{"fileName":"assets/Debugger-B6_1wqlh.js","type":"chunk","isEntry":false,"size":146863},{"fileName":"assets/Error-DBiAAbCC.js","type":"chunk","isEntry":false,"size":1032},{"fileName":"assets/Import-Dm-2zYlI.js","type":"chunk","isEntry":false,"size":6275},{"fileName":"assets/RulesEditor-BML5AwgM.js","type":"chunk","isEntry":false,"size":27565},{"fileName":"assets/ScriptEditor-BxwJbR3_.js","type":"chunk","isEntry":false,"size":2206},{"fileName":"assets/ScriptEditorVanillaMonaco-C3AgkXsv.js","type":"chunk","isEntry":false,"size":26021},{"fileName":"assets/_virtual_mf-localSharedImportMap___mfe_internal__iobroker_javascript__mf_owner__1-CQpJXcpz.js","type":"chunk","isEntry":false,"size":5097},{"fileName":"assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__113183188387379__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-Drq9CkPs.js","type":"chunk","isEntry":false,"size":2371923},{"fileName":"assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__113183188387379__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-B8K8J9cp.js","type":"chunk","isEntry":false,"size":209898},{"fileName":"assets/aiPromptBuilder-CuCGSQIi.js","type":"chunk","isEntry":false,"size":77},{"fileName":"assets/applyCodeEdit-D3nb7erO.js","type":"chunk","isEntry":false,"size":633},{"fileName":"assets/blockly-Fp-1_Ye3.js","type":"chunk","isEntry":false,"size":632005},{"fileName":"assets/blocks_action-CPgrbjAf.js","type":"chunk","isEntry":false,"size":11542},{"fileName":"assets/blocks_convert-2eEzarQy.js","type":"chunk","isEntry":false,"size":8703},{"fileName":"assets/blocks_logic-DMEjFKWc.js","type":"chunk","isEntry":false,"size":3949},{"fileName":"assets/blocks_number-Bsx0zQT_.js","type":"chunk","isEntry":false,"size":700},{"fileName":"assets/blocks_object-Q1nKLN6t.js","type":"chunk","isEntry":false,"size":6451},{"fileName":"assets/blocks_procedures-CHMjZQbf.js","type":"chunk","isEntry":false,"size":9305},{"fileName":"assets/blocks_sendto-DsDq_Gu7.js","type":"chunk","isEntry":false,"size":10968},{"fileName":"assets/blocks_switch-Yog8S2MC.js","type":"chunk","isEntry":false,"size":4639},{"fileName":"assets/blocks_system-2D8iX32Y.js","type":"chunk","isEntry":false,"size":22796},{"fileName":"assets/blocks_text-C5-csrVL.js","type":"chunk","isEntry":false,"size":1736},{"fileName":"assets/blocks_time-LB5i9yMW.js","type":"chunk","isEntry":false,"size":12608},{"fileName":"assets/blocks_timeout-CHGW670q.js","type":"chunk","isEntry":false,"size":5345},{"fileName":"assets/blocks_trigger-D-2z_OfF.js","type":"chunk","isEntry":false,"size":22882},{"fileName":"assets/blocks_words-bpwd7Ia0.js","type":"chunk","isEntry":false,"size":138581},{"fileName":"assets/cronHoverProvider-DYMf8M44.js","type":"chunk","isEntry":false,"size":1964},{"fileName":"assets/dist-D4uJqRBO.js","type":"chunk","isEntry":false,"size":66971},{"fileName":"assets/docs-compact-D7rpMc7r.js","type":"chunk","isEntry":false,"size":13791},{"fileName":"assets/field_cron-B-SF-uZM.js","type":"chunk","isEntry":false,"size":711},{"fileName":"assets/field_oid-fYE12Bhj.js","type":"chunk","isEntry":false,"size":9058},{"fileName":"assets/field_script-aZs3j-vG.js","type":"chunk","isEntry":false,"size":1608},{"fileName":"assets/helpers-CalO_DDQ.js","type":"chunk","isEntry":false,"size":3099},{"fileName":"assets/inlineChatWidget-n7ufGLov.js","type":"chunk","isEntry":false,"size":6871},{"fileName":"assets/inlineDiffController-5u3tIcIH.js","type":"chunk","isEntry":false,"size":7302},{"fileName":"assets/rolldown-runtime-C0FnF6B9.js","type":"chunk","isEntry":false,"size":1291},{"fileName":"assets/stateHoverProvider-C0OUV2Nh.js","type":"chunk","isEntry":false,"size":144252},{"fileName":"assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__iobroker_javascript__remoteEntry_js-BvxK85AS.js","type":"chunk","isEntry":false,"size":18937},{"fileName":"assets/virtual_mf-exposes___mfe_internal__iobroker_javascript__remoteEntry_js-ChiJXsfH.js","type":"chunk","isEntry":false,"size":24},{"fileName":"assets/vite-preload-helper-CaC3yEL3.js","type":"chunk","isEntry":false,"size":1265},{"fileName":"assets/RulesEditor-CybrKL-9.css","type":"asset","isEntry":false,"size":14929},{"fileName":"assets/blockly2js-B3Jxf2e-.svg","type":"asset","isEntry":false,"size":8421},{"fileName":"assets/hysteresis-CLhhemcG.png","type":"asset","isEntry":false,"size":12163},{"fileName":"assets/index-Z8Hkv58g.css","type":"asset","isEntry":false,"size":7849},{"fileName":"assets/rules2js-DnYyR8mI.svg","type":"asset","isEntry":false,"size":6950},{"fileName":"assets/tileBlockly-BMpdinN3.png","type":"asset","isEntry":false,"size":12893},{"fileName":"assets/tileJS-C48gYbHw.png","type":"asset","isEntry":false,"size":17266},{"fileName":"assets/tileRules-BkbaFIhs.png","type":"asset","isEntry":false,"size":83463},{"fileName":"assets/tileTS-CsXmgy4B.png","type":"asset","isEntry":false,"size":13415},{"fileName":"index.html","type":"asset","isEntry":false,"size":22014},{"fileName":"assets/mf-entry-bootstrap-0-db6d825d.js","type":"asset","isEntry":false,"size":2162}],"assetAnalysis":{"react":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__113183188387379__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-Drq9CkPs.js"],"async":[]},"css":{"sync":[],"async":[]}},"react/jsx-runtime":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__113183188387379__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-Drq9CkPs.js"],"async":[]},"css":{"sync":[],"async":[]}},"prop-types":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__113183188387379__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-Drq9CkPs.js"],"async":[]},"css":{"sync":[],"async":[]}},"react-dom":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__113183188387379__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-Drq9CkPs.js"],"async":[]},"css":{"sync":[],"async":[]}},"@mui/material":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__113183188387379__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-Drq9CkPs.js"],"async":[]},"css":{"sync":[],"async":[]}},"@iobroker/gui-components":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__113183188387379__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-Drq9CkPs.js"],"async":[]},"css":{"sync":[],"async":[]}},"react-dom/client":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__113183188387379__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-B8K8J9cp.js"],"async":[]},"css":{"sync":[],"async":[]}}}}
|
package/admin/remoteEntry.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{n as e,t}from"./assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__iobroker_javascript__remoteEntry_js-
|
|
1
|
+
import{n as e,t}from"./assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__iobroker_javascript__remoteEntry_js-BvxK85AS.js";export{t as get,e as init};
|
|
2
2
|
if (typeof document !== 'undefined' && document.head) {
|
|
3
3
|
try {
|
|
4
|
-
for (const __mfWarmupPath of ["assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__iobroker_javascript__remoteEntry_js-
|
|
4
|
+
for (const __mfWarmupPath of ["assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__iobroker_javascript__remoteEntry_js-BvxK85AS.js","assets/virtualExposes-DgGB-18P.js","assets/virtual_mf-exposes___mfe_internal__iobroker_javascript__remoteEntry_js-ChiJXsfH.js","assets/_virtual_mf-localSharedImportMap___mfe_internal__iobroker_javascript__mf_owner__1-CQpJXcpz.js","assets/dist-D4uJqRBO.js","assets/vite-preload-helper-CaC3yEL3.js"]) {
|
|
5
5
|
const __mfWarmupLink = document.createElement('link');
|
|
6
6
|
__mfWarmupLink.rel = 'modulepreload';
|
|
7
7
|
__mfWarmupLink.crossOrigin = '';
|
package/admin/tab.html
CHANGED
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
|
|
28
28
|
<script type="text/javascript" onerror="setTimeout(function(){window.location.reload()}, 5000)" src="./../../lib/js/socket.io.js"></script>
|
|
29
29
|
<title>Scripts</title>
|
|
30
|
-
<script type="module" crossorigin src="./assets/mf-entry-bootstrap-0-
|
|
31
|
-
<link rel="modulepreload" crossorigin href="./assets/Import-
|
|
32
|
-
<link rel="modulepreload" crossorigin href="./assets/Error-
|
|
33
|
-
<link rel="modulepreload" crossorigin href="./assets/blockly-
|
|
30
|
+
<script type="module" crossorigin src="./assets/mf-entry-bootstrap-0-db6d825d.js"></script>
|
|
31
|
+
<link rel="modulepreload" crossorigin href="./assets/Import-Dm-2zYlI.js">
|
|
32
|
+
<link rel="modulepreload" crossorigin href="./assets/Error-DBiAAbCC.js">
|
|
33
|
+
<link rel="modulepreload" crossorigin href="./assets/blockly-Fp-1_Ye3.js">
|
|
34
34
|
<link rel="stylesheet" crossorigin href="./assets/index-Z8Hkv58g.css">
|
|
35
|
-
<link rel="modulepreload" crossorigin href="./assets/hostInit-
|
|
35
|
+
<link rel="modulepreload" crossorigin href="./assets/hostInit-CzvCZFy5.js"><link rel="modulepreload" crossorigin href="./assets/index-CqFiN-25.js"><link rel="modulepreload" crossorigin href="./assets/virtualExposes-DgGB-18P.js"><link rel="modulepreload" crossorigin href="./remoteEntry.js"><link rel="modulepreload" crossorigin href="./assets/_virtual_mf-localSharedImportMap___mfe_internal__iobroker_javascript__mf_owner__1-CQpJXcpz.js"><link rel="modulepreload" crossorigin href="./assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__113183188387379__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-Drq9CkPs.js"><link rel="modulepreload" crossorigin href="./assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__113183188387379__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-B8K8J9cp.js"><link rel="modulepreload" crossorigin href="./assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__iobroker_javascript__remoteEntry_js-BvxK85AS.js"><link rel="modulepreload" crossorigin href="./assets/virtual_mf-exposes___mfe_internal__iobroker_javascript__remoteEntry_js-ChiJXsfH.js"><link rel="modulepreload" crossorigin href="./assets/vite-preload-helper-CaC3yEL3.js"><link rel="modulepreload" crossorigin href="./assets/rolldown-runtime-C0FnF6B9.js"><link rel="modulepreload" crossorigin href="./assets/dist-D4uJqRBO.js"></head>
|
|
36
36
|
<body>
|
|
37
37
|
<noscript> You need to enable JavaScript to run this app. </noscript>
|
|
38
38
|
<script>
|
|
@@ -10,9 +10,10 @@
|
|
|
10
10
|
* These functions are extracted so they can be unit-tested in isolation.
|
|
11
11
|
*/
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.PROVIDER_CREDENTIAL_ID_FIELD = exports.PROVIDER_KEY_FIELD = void 0;
|
|
13
|
+
exports.MAX_AI_REQUEST_TIMEOUT_MS = exports.PROVIDER_CREDENTIAL_ID_FIELD = exports.PROVIDER_KEY_FIELD = void 0;
|
|
14
14
|
exports.getProviderCredentialId = getProviderCredentialId;
|
|
15
15
|
exports.resolveProviderCredentials = resolveProviderCredentials;
|
|
16
|
+
exports.resolveRequestTimeout = resolveRequestTimeout;
|
|
16
17
|
exports.resolveTestCredentials = resolveTestCredentials;
|
|
17
18
|
exports.listAvailableProviders = listAvailableProviders;
|
|
18
19
|
/** Maps each provider to the adapter-config field holding its API key. */
|
|
@@ -73,6 +74,26 @@ function resolveProviderCredentials(config, provider, messageBaseUrl) {
|
|
|
73
74
|
}
|
|
74
75
|
return { apiKey, baseUrl };
|
|
75
76
|
}
|
|
77
|
+
/** Ceiling for an AI request, and the budget when the caller names none */
|
|
78
|
+
exports.MAX_AI_REQUEST_TIMEOUT_MS = 600_000;
|
|
79
|
+
/**
|
|
80
|
+
* How long to wait for an AI endpoint, from the `timeout` the caller put in the message.
|
|
81
|
+
*
|
|
82
|
+
* The inline completion asks for a short budget because it must not sit on the editor, the chat
|
|
83
|
+
* panel for a long one because a reasoning model takes its time. The field was sent all along but
|
|
84
|
+
* never read, so both of them waited out the full ten minutes.
|
|
85
|
+
*
|
|
86
|
+
* @param messageTimeout the value from the sendTo message, in milliseconds
|
|
87
|
+
*/
|
|
88
|
+
function resolveRequestTimeout(messageTimeout) {
|
|
89
|
+
const requested = parseInt(messageTimeout, 10);
|
|
90
|
+
// Nothing usable, or a zero - which is how Node itself spells "no timeout" - gets the ceiling
|
|
91
|
+
if (isNaN(requested) || requested <= 0) {
|
|
92
|
+
return exports.MAX_AI_REQUEST_TIMEOUT_MS;
|
|
93
|
+
}
|
|
94
|
+
// A second is the floor: below that not even a local model gets a chance to answer
|
|
95
|
+
return Math.min(Math.max(requested, 1000), exports.MAX_AI_REQUEST_TIMEOUT_MS);
|
|
96
|
+
}
|
|
76
97
|
/**
|
|
77
98
|
* For the testApiConnection sendTo command: if the caller supplied an apiKey
|
|
78
99
|
* (settings-dialog form value), use it; otherwise fall back to the stored key.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aiProviderResolver.js","sourceRoot":"","sources":["../../src/lib/aiProviderResolver.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AAmDH,0DAIC;AAQD,gEA0BC;AAMD,wDAYC;AAOD,wDA4BC;AApHD,0EAA0E;AAC7D,QAAA,kBAAkB,GAA4C;IACvE,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,WAAW;IACtB,MAAM,EAAE,WAAW;IACnB,QAAQ,EAAE,aAAa;IACvB,MAAM,EAAE,eAAe;CAC1B,CAAC;AAEF;;;GAGG;AACU,QAAA,4BAA4B,GAA4C;IACjF,MAAM,EAA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GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;QAC/B,SAAS,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC3C,CAAC;IACD,IAAI,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;QACnC,SAAS,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,CAAC;IAC7C,CAAC;IACD,4FAA4F;IAC5F,kFAAkF;IAClF,IAAI,CAAC,GAAG,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;QAChC,SAAS,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC;IACpE,CAAC;IACD,OAAO,SAAS,CAAC;AACrB,CAAC","sourcesContent":["/**\n * Helpers for resolving AI provider credentials in sendTo handlers.\n *\n * Keys are stored as `encryptedNative` + `protectedNative` in io-package.json —\n * they are never sent from the frontend. The backend looks them up in `this.config`\n * based on the `provider` name sent along with each `chatCompletion` or\n * `testApiConnection` request.\n *\n * These functions are extracted so they can be unit-tested in isolation.\n */\n\n/** Configuration subset that carries AI credentials. */\nexport interface AiConfigSlice {\n gptKey?: string;\n gptBaseUrl?: string;\n gptBaseUrlKey?: string;\n claudeKey?: string;\n geminiKey?: string;\n deepseekKey?: string;\n /**\n * Where the API keys come from:\n * - `manual`: keys are stored directly in the adapter config (encryptedNative)\n * - `manager`: the config only stores the ID of a credential in the central\n * ioBroker credential store (`system.credentials.*`), resolved at runtime\n */\n credentialType?: 'manual' | 'manager';\n credentialIdGptKey?: string;\n credentialIdClaudeKey?: string;\n credentialIdGeminiKey?: string;\n credentialIdDeepseekKey?: string;\n credentialIdGptBaseUrlKey?: string;\n}\n\nexport type AiProvider = 'openai' | 'anthropic' | 'gemini' | 'deepseek' | 'custom';\n\n/** Maps each provider to the adapter-config field holding its API key. */\nexport const PROVIDER_KEY_FIELD: Record<AiProvider, keyof AiConfigSlice> = {\n openai: 'gptKey',\n anthropic: 'claudeKey',\n gemini: 'geminiKey',\n deepseek: 'deepseekKey',\n custom: 'gptBaseUrlKey',\n};\n\n/**\n * Maps each provider to the adapter-config field holding the ID of its credential\n * in the central credential store (used in `manager` mode).\n */\nexport const PROVIDER_CREDENTIAL_ID_FIELD: Record<AiProvider, keyof AiConfigSlice> = {\n openai: 'credentialIdGptKey',\n anthropic: 'credentialIdClaudeKey',\n gemini: 'credentialIdGeminiKey',\n deepseek: 'credentialIdDeepseekKey',\n custom: 'credentialIdGptBaseUrlKey',\n};\n\n/**\n * Returns the configured credential ID (e.g. `system.credentials.anthropic`) for a provider\n * in `manager` mode, or an empty string if none/unknown provider.\n */\nexport function getProviderCredentialId(config: AiConfigSlice | undefined | null, provider: string): string {\n const cfg = config || {};\n const field = PROVIDER_CREDENTIAL_ID_FIELD[provider as AiProvider];\n return field ? (cfg[field] || '').toString().trim() : '';\n}\n\n/**\n * Resolve API key and base URL for a provider from adapter config.\n * Optional `messageBaseUrl` takes precedence over the stored `gptBaseUrl`\n * (used by the settings-dialog Test button where the user's form value\n * should win over the persisted value).\n */\nexport function resolveProviderCredentials(\n config: AiConfigSlice | undefined | null,\n provider: string,\n messageBaseUrl?: string,\n): { apiKey: string; baseUrl: string } {\n const cfg = config || {};\n const keyField = PROVIDER_KEY_FIELD[provider as AiProvider];\n const apiKey = keyField ? (cfg[keyField] || '').toString().trim() : '';\n /*\n * The stored `gptBaseUrl` belongs to the `custom` provider and to no other. `openai` used to\n * inherit it, which sent every request meant for api.openai.com - and the OpenAI key with it -\n * to whatever host the custom endpoint pointed at, with no way to opt out: an empty\n * `messageBaseUrl` counts as \"not provided\" and fell back to the stored value again (#2369).\n *\n * `openai` still honours an *explicit* `messageBaseUrl`, which is the escape hatch for a proxy\n * in front of OpenAI, but it no longer inherits the custom endpoint of another provider.\n */\n let baseUrl = '';\n if (provider === 'custom') {\n // An empty/whitespace messageBaseUrl counts as \"not provided\" and falls back to the stored\n // value, so the frontend can safely send `baseUrl: ''` without losing the configured URL.\n baseUrl = (messageBaseUrl || cfg.gptBaseUrl || '').toString().trim();\n } else if (provider === 'openai') {\n baseUrl = (messageBaseUrl || '').toString().trim();\n }\n return { apiKey, baseUrl };\n}\n\n/**\n * For the testApiConnection sendTo command: if the caller supplied an apiKey\n * (settings-dialog form value), use it; otherwise fall back to the stored key.\n */\nexport function resolveTestCredentials(\n config: AiConfigSlice | undefined | null,\n provider: string,\n messageApiKey?: string,\n messageBaseUrl?: string,\n): { apiKey: string; baseUrl: string } {\n const fallback = resolveProviderCredentials(config, provider, messageBaseUrl);\n const explicitKey = (messageApiKey || '').toString().trim();\n return {\n apiKey: explicitKey || fallback.apiKey,\n baseUrl: fallback.baseUrl,\n };\n}\n\n/**\n * List of providers that have credentials configured in this.config.\n * Used by the `getAvailableAiProviders` sendTo command so the frontend\n * knows which provider icons/models to show without ever seeing a key.\n */\nexport function listAvailableProviders(\n config: AiConfigSlice | undefined | null,\n): { provider: AiProvider; baseUrl?: string }[] {\n const cfg = config || {};\n const providers: { provider: AiProvider; baseUrl?: string }[] = [];\n const manager = cfg.credentialType === 'manager';\n // A key-based provider is \"available\" if it has a stored key (manual mode)\n // or a selected credential ID (manager mode).\n const has = (provider: AiProvider, key: string | undefined | null): boolean =>\n manager ? !!getProviderCredentialId(cfg, provider) : !!(key || '').trim();\n if (has('openai', cfg.gptKey)) {\n providers.push({ provider: 'openai' });\n }\n if (has('anthropic', cfg.claudeKey)) {\n providers.push({ provider: 'anthropic' });\n }\n if (has('gemini', cfg.geminiKey)) {\n providers.push({ provider: 'gemini' });\n }\n if (has('deepseek', cfg.deepseekKey)) {\n providers.push({ provider: 'deepseek' });\n }\n // The custom/OpenAI-compatible endpoint is identified by its base URL (the key is optional,\n // e.g. local Ollama), so its availability does not depend on the credential mode.\n if ((cfg.gptBaseUrl || '').trim()) {\n providers.push({ provider: 'custom', baseUrl: cfg.gptBaseUrl });\n }\n return providers;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"aiProviderResolver.js","sourceRoot":"","sources":["../../src/lib/aiProviderResolver.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AAmDH,0DAIC;AAQD,gEA0BC;AAcD,sDAQC;AAMD,wDAYC;AAOD,wDA4BC;AA1ID,0EAA0E;AAC7D,QAAA,kBAAkB,GAA4C;IACvE,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,WAAW;IACtB,MAAM,EAAE,WAAW;IACnB,QAAQ,EAAE,aAAa;IACvB,MAAM,EAAE,eAAe;CAC1B,CAAC;AAEF;;;GAGG;AACU,QAAA,4BAA4B,GAA4C;IACjF,MAAM,EAAE,oBAAoB;IAC5B,SAAS,EAAE,uBAAuB;IAClC,MAAM,EAAE,uBAAuB;IAC/B,QAAQ,EAAE,yBAAyB;IACnC,MAAM,EAAE,2BAA2B;CACtC,CAAC;AAEF;;;GAGG;AACH,SAAgB,uBAAuB,CAAC,MAAwC,EAAE,QAAgB;IAC9F,MAAM,GAAG,GAAG,MAAM,IAAI,EAAE,CAAC;IACzB,MAAM,KAAK,GAAG,oCAA4B,CAAC,QAAsB,CAAC,CAAC;IACnE,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AAC7D,CAAC;AAED;;;;;GAKG;AACH,SAAgB,0BAA0B,CACtC,MAAwC,EACxC,QAAgB,EAChB,cAAuB;IAEvB,MAAM,GAAG,GAAG,MAAM,IAAI,EAAE,CAAC;IACzB,MAAM,QAAQ,GAAG,0BAAkB,CAAC,QAAsB,CAAC,CAAC;IAC5D,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,C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ACD,4FAA4F;IAC5F,kFAAkF;IAClF,IAAI,CAAC,GAAG,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;QAChC,SAAS,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC;IACpE,CAAC;IACD,OAAO,SAAS,CAAC;AACrB,CAAC","sourcesContent":["/**\n * Helpers for resolving AI provider credentials in sendTo handlers.\n *\n * Keys are stored as `encryptedNative` + `protectedNative` in io-package.json —\n * they are never sent from the frontend. The backend looks them up in `this.config`\n * based on the `provider` name sent along with each `chatCompletion` or\n * `testApiConnection` request.\n *\n * These functions are extracted so they can be unit-tested in isolation.\n */\n\n/** Configuration subset that carries AI credentials. */\nexport interface AiConfigSlice {\n gptKey?: string;\n gptBaseUrl?: string;\n gptBaseUrlKey?: string;\n claudeKey?: string;\n geminiKey?: string;\n deepseekKey?: string;\n /**\n * Where the API keys come from:\n * - `manual`: keys are stored directly in the adapter config (encryptedNative)\n * - `manager`: the config only stores the ID of a credential in the central\n * ioBroker credential store (`system.credentials.*`), resolved at runtime\n */\n credentialType?: 'manual' | 'manager';\n credentialIdGptKey?: string;\n credentialIdClaudeKey?: string;\n credentialIdGeminiKey?: string;\n credentialIdDeepseekKey?: string;\n credentialIdGptBaseUrlKey?: string;\n}\n\nexport type AiProvider = 'openai' | 'anthropic' | 'gemini' | 'deepseek' | 'custom';\n\n/** Maps each provider to the adapter-config field holding its API key. */\nexport const PROVIDER_KEY_FIELD: Record<AiProvider, keyof AiConfigSlice> = {\n openai: 'gptKey',\n anthropic: 'claudeKey',\n gemini: 'geminiKey',\n deepseek: 'deepseekKey',\n custom: 'gptBaseUrlKey',\n};\n\n/**\n * Maps each provider to the adapter-config field holding the ID of its credential\n * in the central credential store (used in `manager` mode).\n */\nexport const PROVIDER_CREDENTIAL_ID_FIELD: Record<AiProvider, keyof AiConfigSlice> = {\n openai: 'credentialIdGptKey',\n anthropic: 'credentialIdClaudeKey',\n gemini: 'credentialIdGeminiKey',\n deepseek: 'credentialIdDeepseekKey',\n custom: 'credentialIdGptBaseUrlKey',\n};\n\n/**\n * Returns the configured credential ID (e.g. `system.credentials.anthropic`) for a provider\n * in `manager` mode, or an empty string if none/unknown provider.\n */\nexport function getProviderCredentialId(config: AiConfigSlice | undefined | null, provider: string): string {\n const cfg = config || {};\n const field = PROVIDER_CREDENTIAL_ID_FIELD[provider as AiProvider];\n return field ? (cfg[field] || '').toString().trim() : '';\n}\n\n/**\n * Resolve API key and base URL for a provider from adapter config.\n * Optional `messageBaseUrl` takes precedence over the stored `gptBaseUrl`\n * (used by the settings-dialog Test button where the user's form value\n * should win over the persisted value).\n */\nexport function resolveProviderCredentials(\n config: AiConfigSlice | undefined | null,\n provider: string,\n messageBaseUrl?: string,\n): { apiKey: string; baseUrl: string } {\n const cfg = config || {};\n const keyField = PROVIDER_KEY_FIELD[provider as AiProvider];\n const apiKey = keyField ? (cfg[keyField] || '').toString().trim() : '';\n /*\n * The stored `gptBaseUrl` belongs to the `custom` provider and to no other. `openai` used to\n * inherit it, which sent every request meant for api.openai.com - and the OpenAI key with it -\n * to whatever host the custom endpoint pointed at, with no way to opt out: an empty\n * `messageBaseUrl` counts as \"not provided\" and fell back to the stored value again (#2369).\n *\n * `openai` still honours an *explicit* `messageBaseUrl`, which is the escape hatch for a proxy\n * in front of OpenAI, but it no longer inherits the custom endpoint of another provider.\n */\n let baseUrl = '';\n if (provider === 'custom') {\n // An empty/whitespace messageBaseUrl counts as \"not provided\" and falls back to the stored\n // value, so the frontend can safely send `baseUrl: ''` without losing the configured URL.\n baseUrl = (messageBaseUrl || cfg.gptBaseUrl || '').toString().trim();\n } else if (provider === 'openai') {\n baseUrl = (messageBaseUrl || '').toString().trim();\n }\n return { apiKey, baseUrl };\n}\n\n/** Ceiling for an AI request, and the budget when the caller names none */\nexport const MAX_AI_REQUEST_TIMEOUT_MS = 600_000;\n\n/**\n * How long to wait for an AI endpoint, from the `timeout` the caller put in the message.\n *\n * The inline completion asks for a short budget because it must not sit on the editor, the chat\n * panel for a long one because a reasoning model takes its time. The field was sent all along but\n * never read, so both of them waited out the full ten minutes.\n *\n * @param messageTimeout the value from the sendTo message, in milliseconds\n */\nexport function resolveRequestTimeout(messageTimeout?: unknown): number {\n const requested = parseInt(messageTimeout as string, 10);\n // Nothing usable, or a zero - which is how Node itself spells \"no timeout\" - gets the ceiling\n if (isNaN(requested) || requested <= 0) {\n return MAX_AI_REQUEST_TIMEOUT_MS;\n }\n // A second is the floor: below that not even a local model gets a chance to answer\n return Math.min(Math.max(requested, 1000), MAX_AI_REQUEST_TIMEOUT_MS);\n}\n\n/**\n * For the testApiConnection sendTo command: if the caller supplied an apiKey\n * (settings-dialog form value), use it; otherwise fall back to the stored key.\n */\nexport function resolveTestCredentials(\n config: AiConfigSlice | undefined | null,\n provider: string,\n messageApiKey?: string,\n messageBaseUrl?: string,\n): { apiKey: string; baseUrl: string } {\n const fallback = resolveProviderCredentials(config, provider, messageBaseUrl);\n const explicitKey = (messageApiKey || '').toString().trim();\n return {\n apiKey: explicitKey || fallback.apiKey,\n baseUrl: fallback.baseUrl,\n };\n}\n\n/**\n * List of providers that have credentials configured in this.config.\n * Used by the `getAvailableAiProviders` sendTo command so the frontend\n * knows which provider icons/models to show without ever seeing a key.\n */\nexport function listAvailableProviders(\n config: AiConfigSlice | undefined | null,\n): { provider: AiProvider; baseUrl?: string }[] {\n const cfg = config || {};\n const providers: { provider: AiProvider; baseUrl?: string }[] = [];\n const manager = cfg.credentialType === 'manager';\n // A key-based provider is \"available\" if it has a stored key (manual mode)\n // or a selected credential ID (manager mode).\n const has = (provider: AiProvider, key: string | undefined | null): boolean =>\n manager ? !!getProviderCredentialId(cfg, provider) : !!(key || '').trim();\n if (has('openai', cfg.gptKey)) {\n providers.push({ provider: 'openai' });\n }\n if (has('anthropic', cfg.claudeKey)) {\n providers.push({ provider: 'anthropic' });\n }\n if (has('gemini', cfg.geminiKey)) {\n providers.push({ provider: 'gemini' });\n }\n if (has('deepseek', cfg.deepseekKey)) {\n providers.push({ provider: 'deepseek' });\n }\n // The custom/OpenAI-compatible endpoint is identified by its base URL (the key is optional,\n // e.g. local Ollama), so its availability does not depend on the credential mode.\n if ((cfg.gptBaseUrl || '').trim()) {\n providers.push({ provider: 'custom', baseUrl: cfg.gptBaseUrl });\n }\n return providers;\n}\n"]}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LazyTsServer = void 0;
|
|
4
|
+
const virtual_tsc_1 = require("virtual-tsc");
|
|
5
|
+
/**
|
|
6
|
+
* A `virtual-tsc` `Server` that is only built when something is actually compiled.
|
|
7
|
+
*
|
|
8
|
+
* Creating one is far from free: its constructor reads every `lib*.d.ts` of the bundled
|
|
9
|
+
* TypeScript into a virtual file system, and the first `compile()` makes the language service
|
|
10
|
+
* build a program out of them plus `@types/node`, `@iobroker/types` and the user libraries.
|
|
11
|
+
* Measured on Node 22 / TypeScript 6: ~10 MB for the constructor and ~95 MB for the first
|
|
12
|
+
* compilation - per server, and the adapter has two of them.
|
|
13
|
+
*
|
|
14
|
+
* An instance that runs plain JavaScript only never needs any of it, and an instance whose
|
|
15
|
+
* global scripts are all cached needs it only when a script is edited. So the server is
|
|
16
|
+
* created on the first `compile()` and the ambient declarations handed to it in the meantime
|
|
17
|
+
* are remembered and replayed at that point.
|
|
18
|
+
*
|
|
19
|
+
* `releaseMemory()` drops the language service's program and type checker again. That is what
|
|
20
|
+
* holds the ~95 MB; the server stays usable and rebuilds them on the next compilation
|
|
21
|
+
* (~1 s extra). See https://github.com/ioBroker/ioBroker.javascript/issues/2373.
|
|
22
|
+
*/
|
|
23
|
+
class LazyTsServer {
|
|
24
|
+
server = null;
|
|
25
|
+
options;
|
|
26
|
+
logger;
|
|
27
|
+
releaseAfterMs;
|
|
28
|
+
releaseTimer = null;
|
|
29
|
+
keepAlive = null;
|
|
30
|
+
/**
|
|
31
|
+
* Every ambient declaration the adapter has provided so far, so a server that is created
|
|
32
|
+
* later - or re-created after `setOptions()` - sees exactly the same files. These are
|
|
33
|
+
* references to strings the adapter holds anyway, so the map itself costs next to nothing.
|
|
34
|
+
*/
|
|
35
|
+
declarations = {};
|
|
36
|
+
/**
|
|
37
|
+
* @param options Compiler options for the server
|
|
38
|
+
* @param logger Log function of `virtual-tsc`, or `false` to silence it
|
|
39
|
+
* @param releaseAfterMs How long to wait after the last compilation before the program and the
|
|
40
|
+
* type checker are released again. 0 keeps them forever.
|
|
41
|
+
*/
|
|
42
|
+
constructor(options, logger, releaseAfterMs = 0) {
|
|
43
|
+
this.options = options;
|
|
44
|
+
this.logger = logger;
|
|
45
|
+
this.releaseAfterMs = releaseAfterMs;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* While this returns true, nothing is released. The adapter uses it to keep the compiler hot
|
|
49
|
+
* as long as a script editor is open, so saving a script stays fast.
|
|
50
|
+
*
|
|
51
|
+
* @param keepAlive Predicate that is asked every time the release is due
|
|
52
|
+
*/
|
|
53
|
+
setKeepAlive(keepAlive) {
|
|
54
|
+
this.keepAlive = keepAlive;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Replaces the compiler options. A server that already exists is thrown away, so the next
|
|
58
|
+
* compilation runs with the new options. Used once the instance configuration is known.
|
|
59
|
+
*
|
|
60
|
+
* @param options The new compiler options
|
|
61
|
+
*/
|
|
62
|
+
setOptions(options) {
|
|
63
|
+
this.options = options;
|
|
64
|
+
// The options are baked into the language service, so it cannot be re-used
|
|
65
|
+
this.server = null;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Makes the given declaration files known to the compiler. Only remembered while no
|
|
69
|
+
* server exists - they are handed over as soon as one is built.
|
|
70
|
+
*
|
|
71
|
+
* @param declarations The declaration files, keyed by file name
|
|
72
|
+
*/
|
|
73
|
+
provideAmbientDeclarations(declarations) {
|
|
74
|
+
Object.assign(this.declarations, declarations);
|
|
75
|
+
this.server?.provideAmbientDeclarations(declarations);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Compiles a script, building the language service if this is the first compilation.
|
|
79
|
+
*
|
|
80
|
+
* @param filename Name the script gets in the virtual file system
|
|
81
|
+
* @param scriptContent The source code
|
|
82
|
+
*/
|
|
83
|
+
compile(filename, scriptContent) {
|
|
84
|
+
try {
|
|
85
|
+
return this.get().compile(filename, scriptContent);
|
|
86
|
+
}
|
|
87
|
+
finally {
|
|
88
|
+
this.scheduleRelease();
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/** Whether the underlying server exists, i.e. whether anything was compiled yet */
|
|
92
|
+
isCreated() {
|
|
93
|
+
return !!this.server;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Releases the program and the type checker the language service is holding on to.
|
|
97
|
+
* Everything else - the virtual file system with the declarations, the compiled scripts -
|
|
98
|
+
* stays, so the next compilation only has to build the program again.
|
|
99
|
+
*/
|
|
100
|
+
releaseMemory() {
|
|
101
|
+
if (this.releaseTimer) {
|
|
102
|
+
clearTimeout(this.releaseTimer);
|
|
103
|
+
this.releaseTimer = null;
|
|
104
|
+
}
|
|
105
|
+
if (!this.server) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
// `service` is not part of the public typings of virtual-tsc
|
|
109
|
+
const service = this.server.service;
|
|
110
|
+
service?.cleanupSemanticCache?.();
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Forgets the given declaration files. They are gone from the virtual file system with the next
|
|
114
|
+
* `unload()`, which is what actually frees them - this only makes sure they are not handed to a
|
|
115
|
+
* server that is built later.
|
|
116
|
+
*
|
|
117
|
+
* @param fileNames The declaration files to forget
|
|
118
|
+
*/
|
|
119
|
+
forgetDeclarations(fileNames) {
|
|
120
|
+
for (const fileName of fileNames) {
|
|
121
|
+
delete this.declarations[fileName];
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Throws the whole server away, not just its program: the virtual file system with all
|
|
126
|
+
* `lib*.d.ts` of the bundled TypeScript goes with it. The next compilation builds a new one
|
|
127
|
+
* from the declarations that are still remembered, which takes about a second longer than
|
|
128
|
+
* after `releaseMemory()`.
|
|
129
|
+
*/
|
|
130
|
+
unload() {
|
|
131
|
+
if (this.releaseTimer) {
|
|
132
|
+
clearTimeout(this.releaseTimer);
|
|
133
|
+
this.releaseTimer = null;
|
|
134
|
+
}
|
|
135
|
+
this.server = null;
|
|
136
|
+
}
|
|
137
|
+
/** Stops the pending release. To be called when the adapter shuts down. */
|
|
138
|
+
destroy() {
|
|
139
|
+
if (this.releaseTimer) {
|
|
140
|
+
clearTimeout(this.releaseTimer);
|
|
141
|
+
this.releaseTimer = null;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Restarts the countdown after which the memory is released. Scripts are compiled in bursts -
|
|
146
|
+
* at startup and when the user saves one - so the release should only happen once the burst
|
|
147
|
+
* is over.
|
|
148
|
+
*/
|
|
149
|
+
scheduleRelease() {
|
|
150
|
+
if (!this.releaseAfterMs) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
if (this.releaseTimer) {
|
|
154
|
+
clearTimeout(this.releaseTimer);
|
|
155
|
+
}
|
|
156
|
+
this.releaseTimer = setTimeout(() => {
|
|
157
|
+
this.releaseTimer = null;
|
|
158
|
+
if (this.keepAlive?.()) {
|
|
159
|
+
// An editor is open - stay hot and ask again later
|
|
160
|
+
this.scheduleRelease();
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
this.releaseMemory();
|
|
164
|
+
}, this.releaseAfterMs);
|
|
165
|
+
// This must never be a reason for the process to stay alive
|
|
166
|
+
this.releaseTimer.unref();
|
|
167
|
+
}
|
|
168
|
+
get() {
|
|
169
|
+
if (!this.server) {
|
|
170
|
+
this.server = new virtual_tsc_1.Server(this.options, this.logger);
|
|
171
|
+
this.server.provideAmbientDeclarations(this.declarations);
|
|
172
|
+
}
|
|
173
|
+
return this.server;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
exports.LazyTsServer = LazyTsServer;
|
|
177
|
+
//# sourceMappingURL=lazyTsServer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lazyTsServer.js","sourceRoot":"","sources":["../../src/lib/lazyTsServer.ts"],"names":[],"mappings":";;;AAAA,6CAAqC;AAKrC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAa,YAAY;IACb,MAAM,GAAkB,IAAI,CAAC;IAC7B,OAAO,CAAkB;IAChB,MAAM,CAAqC;IAC3C,cAAc,CAAS;IAChC,YAAY,GAA0B,IAAI,CAAC;IAC3C,SAAS,GAA2B,IAAI,CAAC;IACjD;;;;OAIG;IACc,YAAY,GAA2B,EAAE,CAAC;IAE3D;;;;;OAKG;IACH,YAAY,OAAwB,EAAE,MAA+B,EAAE,cAAc,GAAG,CAAC;QACrF,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;IACzC,CAAC;IAED;;;;;OAKG;IACH,YAAY,CAAC,SAAwB;QACjC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC/B,CAAC;IAED;;;;;OAKG;IACH,UAAU,CAAC,OAAwB;QAC/B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,2EAA2E;QAC3E,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACvB,CAAC;IAED;;;;;OAKG;IACH,0BAA0B,CAAC,YAAoC;QAC3D,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;QAC/C,IAAI,CAAC,MAAM,EAAE,0BAA0B,CAAC,YAAY,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;OAKG;IAC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AC7B,CAAC;IACL,CAAC;IAED;;;;OAIG;IACK,eAAe;QACnB,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;YACvB,OAAO;QACX,CAAC;QACD,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACpB,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACpC,CAAC;QACD,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC,GAAG,EAAE;YAChC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;YACzB,IAAI,IAAI,CAAC,SAAS,EAAE,EAAE,EAAE,CAAC;gBACrB,mDAAmD;gBACnD,IAAI,CAAC,eAAe,EAAE,CAAC;gBACvB,OAAO;YACX,CAAC;YACD,IAAI,CAAC,aAAa,EAAE,CAAC;QACzB,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QACxB,4DAA4D;QAC5D,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC;IAC9B,CAAC;IAEO,GAAG;QACP,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,GAAG,IAAI,oBAAM,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YACpD,IAAI,CAAC,MAAM,CAAC,0BAA0B,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC9D,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;CACJ;AAnKD,oCAmKC","sourcesContent":["import { Server } from 'virtual-tsc';\nimport type { CompilerOptions } from 'typescript';\nimport type { CompileResult } from 'virtual-tsc/build/util';\nimport type { LoggerFunction } from 'virtual-tsc/build/logger';\n\n/**\n * A `virtual-tsc` `Server` that is only built when something is actually compiled.\n *\n * Creating one is far from free: its constructor reads every `lib*.d.ts` of the bundled\n * TypeScript into a virtual file system, and the first `compile()` makes the language service\n * build a program out of them plus `@types/node`, `@iobroker/types` and the user libraries.\n * Measured on Node 22 / TypeScript 6: ~10 MB for the constructor and ~95 MB for the first\n * compilation - per server, and the adapter has two of them.\n *\n * An instance that runs plain JavaScript only never needs any of it, and an instance whose\n * global scripts are all cached needs it only when a script is edited. So the server is\n * created on the first `compile()` and the ambient declarations handed to it in the meantime\n * are remembered and replayed at that point.\n *\n * `releaseMemory()` drops the language service's program and type checker again. That is what\n * holds the ~95 MB; the server stays usable and rebuilds them on the next compilation\n * (~1 s extra). See https://github.com/ioBroker/ioBroker.javascript/issues/2373.\n */\nexport class LazyTsServer {\n private server: Server | null = null;\n private options: CompilerOptions;\n private readonly logger: LoggerFunction | false | undefined;\n private readonly releaseAfterMs: number;\n private releaseTimer: NodeJS.Timeout | null = null;\n private keepAlive: (() => boolean) | null = null;\n /**\n * Every ambient declaration the adapter has provided so far, so a server that is created\n * later - or re-created after `setOptions()` - sees exactly the same files. These are\n * references to strings the adapter holds anyway, so the map itself costs next to nothing.\n */\n private readonly declarations: Record<string, string> = {};\n\n /**\n * @param options Compiler options for the server\n * @param logger Log function of `virtual-tsc`, or `false` to silence it\n * @param releaseAfterMs How long to wait after the last compilation before the program and the\n * type checker are released again. 0 keeps them forever.\n */\n constructor(options: CompilerOptions, logger?: LoggerFunction | false, releaseAfterMs = 0) {\n this.options = options;\n this.logger = logger;\n this.releaseAfterMs = releaseAfterMs;\n }\n\n /**\n * While this returns true, nothing is released. The adapter uses it to keep the compiler hot\n * as long as a script editor is open, so saving a script stays fast.\n *\n * @param keepAlive Predicate that is asked every time the release is due\n */\n setKeepAlive(keepAlive: () => boolean): void {\n this.keepAlive = keepAlive;\n }\n\n /**\n * Replaces the compiler options. A server that already exists is thrown away, so the next\n * compilation runs with the new options. Used once the instance configuration is known.\n *\n * @param options The new compiler options\n */\n setOptions(options: CompilerOptions): void {\n this.options = options;\n // The options are baked into the language service, so it cannot be re-used\n this.server = null;\n }\n\n /**\n * Makes the given declaration files known to the compiler. Only remembered while no\n * server exists - they are handed over as soon as one is built.\n *\n * @param declarations The declaration files, keyed by file name\n */\n provideAmbientDeclarations(declarations: Record<string, string>): void {\n Object.assign(this.declarations, declarations);\n this.server?.provideAmbientDeclarations(declarations);\n }\n\n /**\n * Compiles a script, building the language service if this is the first compilation.\n *\n * @param filename Name the script gets in the virtual file system\n * @param scriptContent The source code\n */\n compile(filename: string, scriptContent: string): CompileResult {\n try {\n return this.get().compile(filename, scriptContent);\n } finally {\n this.scheduleRelease();\n }\n }\n\n /** Whether the underlying server exists, i.e. whether anything was compiled yet */\n isCreated(): boolean {\n return !!this.server;\n }\n\n /**\n * Releases the program and the type checker the language service is holding on to.\n * Everything else - the virtual file system with the declarations, the compiled scripts -\n * stays, so the next compilation only has to build the program again.\n */\n releaseMemory(): void {\n if (this.releaseTimer) {\n clearTimeout(this.releaseTimer);\n this.releaseTimer = null;\n }\n if (!this.server) {\n return;\n }\n // `service` is not part of the public typings of virtual-tsc\n const service = (this.server as unknown as { service?: { cleanupSemanticCache?: () => void } }).service;\n service?.cleanupSemanticCache?.();\n }\n\n /**\n * Forgets the given declaration files. They are gone from the virtual file system with the next\n * `unload()`, which is what actually frees them - this only makes sure they are not handed to a\n * server that is built later.\n *\n * @param fileNames The declaration files to forget\n */\n forgetDeclarations(fileNames: string[]): void {\n for (const fileName of fileNames) {\n delete this.declarations[fileName];\n }\n }\n\n /**\n * Throws the whole server away, not just its program: the virtual file system with all\n * `lib*.d.ts` of the bundled TypeScript goes with it. The next compilation builds a new one\n * from the declarations that are still remembered, which takes about a second longer than\n * after `releaseMemory()`.\n */\n unload(): void {\n if (this.releaseTimer) {\n clearTimeout(this.releaseTimer);\n this.releaseTimer = null;\n }\n this.server = null;\n }\n\n /** Stops the pending release. To be called when the adapter shuts down. */\n destroy(): void {\n if (this.releaseTimer) {\n clearTimeout(this.releaseTimer);\n this.releaseTimer = null;\n }\n }\n\n /**\n * Restarts the countdown after which the memory is released. Scripts are compiled in bursts -\n * at startup and when the user saves one - so the release should only happen once the burst\n * is over.\n */\n private scheduleRelease(): void {\n if (!this.releaseAfterMs) {\n return;\n }\n if (this.releaseTimer) {\n clearTimeout(this.releaseTimer);\n }\n this.releaseTimer = setTimeout(() => {\n this.releaseTimer = null;\n if (this.keepAlive?.()) {\n // An editor is open - stay hot and ask again later\n this.scheduleRelease();\n return;\n }\n this.releaseMemory();\n }, this.releaseAfterMs);\n // This must never be a reason for the process to stay alive\n this.releaseTimer.unref();\n }\n\n private get(): Server {\n if (!this.server) {\n this.server = new Server(this.options, this.logger);\n this.server.provideAmbientDeclarations(this.declarations);\n }\n return this.server;\n }\n}\n"]}
|