node-red-contrib-knx-ultimate 7.1.4 → 8.0.2
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/CHANGELOG.md +20 -10
- package/MIGRATION.md +40 -0
- package/README.md +32 -6
- package/docs/README.md +34 -0
- package/docs/assets/brand/made-in-italy.svg +12 -0
- package/examples/Alerter - Device Alert Aggregation.json +5 -2
- package/examples/Auto Responder - Read Request Defaults.json +5 -2
- package/examples/Garage - Door Controller.json +5 -2
- package/examples/Global Context - Expose KNX Values.json +5 -2
- package/examples/KNX DateTime - Set Date and Time to Bus.json +111 -89
- package/examples/Load Control - Manual Shedding Mode.json +5 -2
- package/examples/Logger ETS File and Telegram Count.json +10 -2
- package/examples/Scene Controller Recall and Save.json +33 -6
- package/examples/Staircase - Timer, Override and Block.json +5 -2
- package/examples/WatchDog Connect Disconnect.json +98 -70
- package/nodes/commonFunctions.js +0 -587
- package/nodes/knxUltimate-config.html +0 -14
- package/nodes/knxUltimate-config.js +1 -18
- package/nodes/knxUltimate.html +1 -6
- package/nodes/knxUltimateIoTBridge.html +0 -14
- package/nodes/knxUltimateLegacyMigration.js +75 -0
- package/nodes/knxUltimateMultiRouting.html +1 -7
- package/nodes/knxUltimateRouterFilter.html +1 -7
- package/nodes/knxUltimateUtility.html +0 -6
- package/nodes/knxUltimateViewer.html +0 -6
- package/nodes/locales/de/knxUltimate-config.html +0 -8
- package/nodes/locales/de/knxUltimate.html +0 -8
- package/nodes/locales/de/knxUltimateIoTBridge.html +0 -8
- package/nodes/locales/de/knxUltimateMultiRouting.html +0 -8
- package/nodes/locales/de/knxUltimateRouterFilter.html +0 -8
- package/nodes/locales/de/knxUltimateUtility.html +0 -8
- package/nodes/locales/de/knxUltimateUtility.json +16 -1
- package/nodes/locales/de/knxUltimateViewer.html +0 -8
- package/nodes/locales/en/knxUltimate-config.html +0 -8
- package/nodes/locales/en/knxUltimate.html +0 -8
- package/nodes/locales/en/knxUltimateIoTBridge.html +0 -8
- package/nodes/locales/en/knxUltimateMultiRouting.html +0 -8
- package/nodes/locales/en/knxUltimateRouterFilter.html +0 -8
- package/nodes/locales/en/knxUltimateUtility.html +0 -8
- package/nodes/locales/en/knxUltimateUtility.json +16 -1
- package/nodes/locales/en/knxUltimateViewer.html +0 -8
- package/nodes/locales/es/knxUltimate-config.html +0 -8
- package/nodes/locales/es/knxUltimate.html +0 -8
- package/nodes/locales/es/knxUltimateIoTBridge.html +0 -8
- package/nodes/locales/es/knxUltimateMultiRouting.html +0 -8
- package/nodes/locales/es/knxUltimateRouterFilter.html +0 -8
- package/nodes/locales/es/knxUltimateUtility.html +0 -8
- package/nodes/locales/es/knxUltimateUtility.json +17 -2
- package/nodes/locales/es/knxUltimateViewer.html +0 -8
- package/nodes/locales/fr/knxUltimate-config.html +0 -8
- package/nodes/locales/fr/knxUltimate.html +0 -8
- package/nodes/locales/fr/knxUltimateIoTBridge.html +0 -8
- package/nodes/locales/fr/knxUltimateMultiRouting.html +0 -8
- package/nodes/locales/fr/knxUltimateRouterFilter.html +0 -8
- package/nodes/locales/fr/knxUltimateUtility.html +0 -8
- package/nodes/locales/fr/knxUltimateUtility.json +16 -1
- package/nodes/locales/fr/knxUltimateViewer.html +0 -8
- package/nodes/locales/it/knxUltimate-config.html +0 -8
- package/nodes/locales/it/knxUltimate.html +0 -8
- package/nodes/locales/it/knxUltimateIoTBridge.html +0 -8
- package/nodes/locales/it/knxUltimateMultiRouting.html +0 -8
- package/nodes/locales/it/knxUltimateRouterFilter.html +0 -8
- package/nodes/locales/it/knxUltimateUtility.html +0 -8
- package/nodes/locales/it/knxUltimateUtility.json +16 -1
- package/nodes/locales/it/knxUltimateViewer.html +0 -8
- package/nodes/locales/zh-CN/knxUltimate-config.html +0 -8
- package/nodes/locales/zh-CN/knxUltimate.html +0 -8
- package/nodes/locales/zh-CN/knxUltimateIoTBridge.html +0 -8
- package/nodes/locales/zh-CN/knxUltimateMultiRouting.html +0 -8
- package/nodes/locales/zh-CN/knxUltimateRouterFilter.html +0 -8
- package/nodes/locales/zh-CN/knxUltimateUtility.html +0 -8
- package/nodes/locales/zh-CN/knxUltimateUtility.json +16 -1
- package/nodes/locales/zh-CN/knxUltimateViewer.html +0 -8
- package/nodes/plugins/knxUltimate-v8-migration-recovery-plugin.html +140 -0
- package/package.json +22 -69
- package/resources/11f26b4500.js +2 -2
- package/resources/KNXAIChatAdapterMappings.js +2 -416
- package/resources/configNodeEditorSelection.js +2 -32
- package/resources/hueControllerEditorSelection.js +2 -32
- package/resources/hueControllerMigrationDialog.js +2 -254
- package/resources/hueControllerProfiles.js +2 -9319
- package/resources/knxUtilityProfiles.js +2041 -2082
- package/resources/legacyMigrationNotice.js +23 -111
- package/resources/matterQrScanner.js +2 -98
- package/resources/upgradeToV8.js +94 -26
- package/scripts/check-legacy-flows.js +142 -0
- package/examples/Hue Area Motion - Zone Presence.json +0 -77
- package/examples/Hue Battery - Level Status.json +0 -77
- package/examples/Hue Button - Short and Dim Commands.json +0 -83
- package/examples/Hue Camera Motion - Presence.json +0 -77
- package/examples/Hue Config - Bridge Template.json +0 -27
- package/examples/Hue Contact Sensor - Open Closed.json +0 -75
- package/examples/Hue Device Software Update - Availability.json +0 -77
- package/examples/Hue Humidity Sensor - Relative Humidity.json +0 -77
- package/examples/Hue Light - Switch and Brightness.json +0 -67
- package/examples/Hue Light Sensor - Lux to KNX.json +0 -77
- package/examples/Hue Motion - Presence Sensor.json +0 -76
- package/examples/Hue Plug - Switch and State.json +0 -63
- package/examples/Hue Scene - Recall from KNX.json +0 -63
- package/examples/Hue Tap Dial - Relative Dimming.json +0 -76
- package/examples/Hue Temperature Sensor - Celsius to KNX.json +0 -77
- package/examples/Hue Zigbee Connectivity - Online Status.json +0 -77
- package/examples/Matter Controller - Semantic Flow Input.json +0 -248
- package/nodes/hue-config.html +0 -378
- package/nodes/hue-config.js +0 -846
- package/nodes/icons/node-alerter-icon.png +0 -0
- package/nodes/icons/node-homekit-icon.png +0 -0
- package/nodes/icons/node-homekit-icon.svg +0 -10
- package/nodes/icons/node-hue-icon.svg +0 -10
- package/nodes/icons/node-knx-icon.png +0 -0
- package/nodes/icons/node-logger-icon.png +0 -0
- package/nodes/icons/node-logger2-icon.png +0 -0
- package/nodes/icons/node-logger2-icon.svg +0 -32
- package/nodes/icons/node-matter-bridge-icon.svg +0 -6
- package/nodes/icons/node-matter-controller-icon.svg +0 -6
- package/nodes/icons/node-matter-icon.svg +0 -12
- package/nodes/icons/node-scene-icon.png +0 -0
- package/nodes/icons/node-watchdog-icon.png +0 -0
- package/nodes/knxUltimateAI.html +0 -1826
- package/nodes/knxUltimateAI.js +0 -16797
- package/nodes/knxUltimateAIHomeAssistant.html +0 -54
- package/nodes/knxUltimateAIHomeAssistant.js +0 -152
- package/nodes/knxUltimateAlerter.html +0 -267
- package/nodes/knxUltimateAlerter.js +0 -300
- package/nodes/knxUltimateAutoResponder.html +0 -128
- package/nodes/knxUltimateAutoResponder.js +0 -264
- package/nodes/knxUltimateDateTime.html +0 -579
- package/nodes/knxUltimateDateTime.js +0 -282
- package/nodes/knxUltimateGarage.html +0 -337
- package/nodes/knxUltimateGarage.js +0 -504
- package/nodes/knxUltimateGlobalContext.html +0 -145
- package/nodes/knxUltimateGlobalContext.js +0 -208
- package/nodes/knxUltimateHATranslator.html +0 -85
- package/nodes/knxUltimateHATranslator.js +0 -83
- package/nodes/knxUltimateHueAreaMotion.html +0 -670
- package/nodes/knxUltimateHueAreaMotion.js +0 -218
- package/nodes/knxUltimateHueBattery.html +0 -646
- package/nodes/knxUltimateHueBattery.js +0 -182
- package/nodes/knxUltimateHueButton.html +0 -804
- package/nodes/knxUltimateHueButton.js +0 -292
- package/nodes/knxUltimateHueCameraMotion.html +0 -671
- package/nodes/knxUltimateHueCameraMotion.js +0 -218
- package/nodes/knxUltimateHueContactSensor.html +0 -609
- package/nodes/knxUltimateHueContactSensor.js +0 -188
- package/nodes/knxUltimateHueController.html +0 -1765
- package/nodes/knxUltimateHueController.js +0 -28
- package/nodes/knxUltimateHueHumiditySensor.html +0 -641
- package/nodes/knxUltimateHueHumiditySensor.js +0 -201
- package/nodes/knxUltimateHueLight.html +0 -2516
- package/nodes/knxUltimateHueLight.js +0 -1582
- package/nodes/knxUltimateHueLightSensor.html +0 -636
- package/nodes/knxUltimateHueLightSensor.js +0 -177
- package/nodes/knxUltimateHueMotion.html +0 -634
- package/nodes/knxUltimateHueMotion.js +0 -182
- package/nodes/knxUltimateHuePlug.html +0 -576
- package/nodes/knxUltimateHuePlug.js +0 -341
- package/nodes/knxUltimateHueScene.html +0 -967
- package/nodes/knxUltimateHueScene.js +0 -349
- package/nodes/knxUltimateHueTapDial.html +0 -640
- package/nodes/knxUltimateHueTapDial.js +0 -268
- package/nodes/knxUltimateHueTemperatureSensor.html +0 -639
- package/nodes/knxUltimateHueTemperatureSensor.js +0 -184
- package/nodes/knxUltimateHueZigbeeConnectivity.html +0 -648
- package/nodes/knxUltimateHueZigbeeConnectivity.js +0 -182
- package/nodes/knxUltimateHuedevice_software_update.html +0 -650
- package/nodes/knxUltimateHuedevice_software_update.js +0 -182
- package/nodes/knxUltimateLoadControl.html +0 -425
- package/nodes/knxUltimateLoadControl.js +0 -443
- package/nodes/knxUltimateLogger.html +0 -197
- package/nodes/knxUltimateLogger.js +0 -224
- package/nodes/knxUltimateMatterBridge.html +0 -689
- package/nodes/knxUltimateMatterBridge.js +0 -464
- package/nodes/knxUltimateMatterControllerDevice.html +0 -2851
- package/nodes/knxUltimateMatterControllerDevice.js +0 -1747
- package/nodes/knxUltimateSceneController.html +0 -529
- package/nodes/knxUltimateSceneController.js +0 -437
- package/nodes/knxUltimateStaircase.html +0 -346
- package/nodes/knxUltimateStaircase.js +0 -463
- package/nodes/knxUltimateWatchDog.html +0 -241
- package/nodes/knxUltimateWatchDog.js +0 -230
- package/nodes/locales/de/hue-config.html +0 -33
- package/nodes/locales/de/hue-config.json +0 -21
- package/nodes/locales/de/knxUltimateAI.html +0 -13
- package/nodes/locales/de/knxUltimateAI.json +0 -231
- package/nodes/locales/de/knxUltimateAIHomeAssistant.html +0 -11
- package/nodes/locales/de/knxUltimateAlerter.html +0 -159
- package/nodes/locales/de/knxUltimateAlerter.json +0 -27
- package/nodes/locales/de/knxUltimateAutoResponder.html +0 -96
- package/nodes/locales/de/knxUltimateAutoResponder.json +0 -8
- package/nodes/locales/de/knxUltimateDateTime.html +0 -45
- package/nodes/locales/de/knxUltimateDateTime.json +0 -32
- package/nodes/locales/de/knxUltimateGarage.html +0 -79
- package/nodes/locales/de/knxUltimateGarage.json +0 -51
- package/nodes/locales/de/knxUltimateGlobalContext.html +0 -76
- package/nodes/locales/de/knxUltimateGlobalContext.json +0 -24
- package/nodes/locales/de/knxUltimateHATranslator.html +0 -25
- package/nodes/locales/de/knxUltimateHATranslator.json +0 -8
- package/nodes/locales/de/knxUltimateHueAreaMotion.html +0 -44
- package/nodes/locales/de/knxUltimateHueAreaMotion.json +0 -31
- package/nodes/locales/de/knxUltimateHueBattery.html +0 -37
- package/nodes/locales/de/knxUltimateHueBattery.json +0 -30
- package/nodes/locales/de/knxUltimateHueButton.html +0 -52
- package/nodes/locales/de/knxUltimateHueButton.json +0 -34
- package/nodes/locales/de/knxUltimateHueCameraMotion.html +0 -38
- package/nodes/locales/de/knxUltimateHueCameraMotion.json +0 -30
- package/nodes/locales/de/knxUltimateHueContactSensor.html +0 -35
- package/nodes/locales/de/knxUltimateHueContactSensor.json +0 -26
- package/nodes/locales/de/knxUltimateHueController.html +0 -690
- package/nodes/locales/de/knxUltimateHueController.json +0 -64
- package/nodes/locales/de/knxUltimateHueHumiditySensor.html +0 -38
- package/nodes/locales/de/knxUltimateHueHumiditySensor.json +0 -30
- package/nodes/locales/de/knxUltimateHueLight.html +0 -121
- package/nodes/locales/de/knxUltimateHueLight.json +0 -94
- package/nodes/locales/de/knxUltimateHueLightSensor.html +0 -38
- package/nodes/locales/de/knxUltimateHueLightSensor.json +0 -19
- package/nodes/locales/de/knxUltimateHueMotion.html +0 -41
- package/nodes/locales/de/knxUltimateHueMotion.json +0 -27
- package/nodes/locales/de/knxUltimateHuePlug.html +0 -50
- package/nodes/locales/de/knxUltimateHuePlug.json +0 -33
- package/nodes/locales/de/knxUltimateHueScene.html +0 -45
- package/nodes/locales/de/knxUltimateHueScene.json +0 -41
- package/nodes/locales/de/knxUltimateHueTapDial.html +0 -40
- package/nodes/locales/de/knxUltimateHueTapDial.json +0 -28
- package/nodes/locales/de/knxUltimateHueTemperatureSensor.html +0 -38
- package/nodes/locales/de/knxUltimateHueTemperatureSensor.json +0 -30
- package/nodes/locales/de/knxUltimateHueZigbeeConnectivity.html +0 -39
- package/nodes/locales/de/knxUltimateHueZigbeeConnectivity.json +0 -30
- package/nodes/locales/de/knxUltimateHuedevice_software_update.html +0 -36
- package/nodes/locales/de/knxUltimateHuedevice_software_update.json +0 -30
- package/nodes/locales/de/knxUltimateLoadControl.html +0 -69
- package/nodes/locales/de/knxUltimateLoadControl.json +0 -28
- package/nodes/locales/de/knxUltimateLogger.html +0 -126
- package/nodes/locales/de/knxUltimateLogger.json +0 -31
- package/nodes/locales/de/knxUltimateMatterBridge.html +0 -65
- package/nodes/locales/de/knxUltimateMatterBridge.json +0 -123
- package/nodes/locales/de/knxUltimateMatterControllerDevice.html +0 -57
- package/nodes/locales/de/knxUltimateMatterControllerDevice.json +0 -146
- package/nodes/locales/de/knxUltimateSceneController.html +0 -98
- package/nodes/locales/de/knxUltimateSceneController.json +0 -32
- package/nodes/locales/de/knxUltimateStaircase.html +0 -77
- package/nodes/locales/de/knxUltimateStaircase.json +0 -62
- package/nodes/locales/de/knxUltimateWatchDog.html +0 -178
- package/nodes/locales/de/knxUltimateWatchDog.json +0 -27
- package/nodes/locales/de/matter-config.html +0 -47
- package/nodes/locales/de/matter-config.json +0 -47
- package/nodes/locales/de/matterbridge-config.html +0 -45
- package/nodes/locales/de/matterbridge-config.json +0 -25
- package/nodes/locales/en/hue-config.html +0 -31
- package/nodes/locales/en/hue-config.json +0 -21
- package/nodes/locales/en/knxUltimateAI.html +0 -13
- package/nodes/locales/en/knxUltimateAI.json +0 -234
- package/nodes/locales/en/knxUltimateAIHomeAssistant.html +0 -11
- package/nodes/locales/en/knxUltimateAlerter.html +0 -164
- package/nodes/locales/en/knxUltimateAlerter.json +0 -27
- package/nodes/locales/en/knxUltimateAutoResponder.html +0 -94
- package/nodes/locales/en/knxUltimateAutoResponder.json +0 -8
- package/nodes/locales/en/knxUltimateDateTime.html +0 -67
- package/nodes/locales/en/knxUltimateDateTime.json +0 -32
- package/nodes/locales/en/knxUltimateGarage.html +0 -79
- package/nodes/locales/en/knxUltimateGarage.json +0 -51
- package/nodes/locales/en/knxUltimateGlobalContext.html +0 -124
- package/nodes/locales/en/knxUltimateGlobalContext.json +0 -24
- package/nodes/locales/en/knxUltimateHATranslator.html +0 -25
- package/nodes/locales/en/knxUltimateHATranslator.json +0 -8
- package/nodes/locales/en/knxUltimateHueAreaMotion.html +0 -44
- package/nodes/locales/en/knxUltimateHueAreaMotion.json +0 -31
- package/nodes/locales/en/knxUltimateHueBattery.html +0 -37
- package/nodes/locales/en/knxUltimateHueBattery.json +0 -30
- package/nodes/locales/en/knxUltimateHueButton.html +0 -52
- package/nodes/locales/en/knxUltimateHueButton.json +0 -34
- package/nodes/locales/en/knxUltimateHueCameraMotion.html +0 -38
- package/nodes/locales/en/knxUltimateHueCameraMotion.json +0 -30
- package/nodes/locales/en/knxUltimateHueContactSensor.html +0 -35
- package/nodes/locales/en/knxUltimateHueContactSensor.json +0 -26
- package/nodes/locales/en/knxUltimateHueController.html +0 -691
- package/nodes/locales/en/knxUltimateHueController.json +0 -64
- package/nodes/locales/en/knxUltimateHueHumiditySensor.html +0 -38
- package/nodes/locales/en/knxUltimateHueHumiditySensor.json +0 -30
- package/nodes/locales/en/knxUltimateHueLight.html +0 -124
- package/nodes/locales/en/knxUltimateHueLight.json +0 -94
- package/nodes/locales/en/knxUltimateHueLightSensor.html +0 -38
- package/nodes/locales/en/knxUltimateHueLightSensor.json +0 -19
- package/nodes/locales/en/knxUltimateHueMotion.html +0 -41
- package/nodes/locales/en/knxUltimateHueMotion.json +0 -27
- package/nodes/locales/en/knxUltimateHuePlug.html +0 -50
- package/nodes/locales/en/knxUltimateHuePlug.json +0 -33
- package/nodes/locales/en/knxUltimateHueScene.html +0 -45
- package/nodes/locales/en/knxUltimateHueScene.json +0 -41
- package/nodes/locales/en/knxUltimateHueTapDial.html +0 -40
- package/nodes/locales/en/knxUltimateHueTapDial.json +0 -28
- package/nodes/locales/en/knxUltimateHueTemperatureSensor.html +0 -38
- package/nodes/locales/en/knxUltimateHueTemperatureSensor.json +0 -30
- package/nodes/locales/en/knxUltimateHueZigbeeConnectivity.html +0 -39
- package/nodes/locales/en/knxUltimateHueZigbeeConnectivity.json +0 -30
- package/nodes/locales/en/knxUltimateHuedevice_software_update.html +0 -36
- package/nodes/locales/en/knxUltimateHuedevice_software_update.json +0 -30
- package/nodes/locales/en/knxUltimateLoadControl.html +0 -76
- package/nodes/locales/en/knxUltimateLoadControl.json +0 -28
- package/nodes/locales/en/knxUltimateLogger.html +0 -161
- package/nodes/locales/en/knxUltimateLogger.json +0 -31
- package/nodes/locales/en/knxUltimateMatterBridge.html +0 -65
- package/nodes/locales/en/knxUltimateMatterBridge.json +0 -123
- package/nodes/locales/en/knxUltimateMatterControllerDevice.html +0 -57
- package/nodes/locales/en/knxUltimateMatterControllerDevice.json +0 -146
- package/nodes/locales/en/knxUltimateSceneController.html +0 -117
- package/nodes/locales/en/knxUltimateSceneController.json +0 -32
- package/nodes/locales/en/knxUltimateStaircase.html +0 -77
- package/nodes/locales/en/knxUltimateStaircase.json +0 -62
- package/nodes/locales/en/knxUltimateWatchDog.html +0 -244
- package/nodes/locales/en/knxUltimateWatchDog.json +0 -27
- package/nodes/locales/en/matter-config.html +0 -47
- package/nodes/locales/en/matter-config.json +0 -48
- package/nodes/locales/en/matterbridge-config.html +0 -45
- package/nodes/locales/en/matterbridge-config.json +0 -25
- package/nodes/locales/es/hue-config.html +0 -31
- package/nodes/locales/es/hue-config.json +0 -21
- package/nodes/locales/es/knxUltimateAI.html +0 -13
- package/nodes/locales/es/knxUltimateAI.json +0 -231
- package/nodes/locales/es/knxUltimateAIHomeAssistant.html +0 -11
- package/nodes/locales/es/knxUltimateAlerter.html +0 -164
- package/nodes/locales/es/knxUltimateAlerter.json +0 -27
- package/nodes/locales/es/knxUltimateAutoResponder.html +0 -81
- package/nodes/locales/es/knxUltimateAutoResponder.json +0 -8
- package/nodes/locales/es/knxUltimateDateTime.html +0 -45
- package/nodes/locales/es/knxUltimateDateTime.json +0 -32
- package/nodes/locales/es/knxUltimateGarage.html +0 -79
- package/nodes/locales/es/knxUltimateGarage.json +0 -51
- package/nodes/locales/es/knxUltimateGlobalContext.html +0 -128
- package/nodes/locales/es/knxUltimateGlobalContext.json +0 -24
- package/nodes/locales/es/knxUltimateHATranslator.html +0 -25
- package/nodes/locales/es/knxUltimateHATranslator.json +0 -8
- package/nodes/locales/es/knxUltimateHueAreaMotion.html +0 -44
- package/nodes/locales/es/knxUltimateHueAreaMotion.json +0 -31
- package/nodes/locales/es/knxUltimateHueBattery.html +0 -37
- package/nodes/locales/es/knxUltimateHueBattery.json +0 -30
- package/nodes/locales/es/knxUltimateHueButton.html +0 -52
- package/nodes/locales/es/knxUltimateHueButton.json +0 -34
- package/nodes/locales/es/knxUltimateHueCameraMotion.html +0 -38
- package/nodes/locales/es/knxUltimateHueCameraMotion.json +0 -30
- package/nodes/locales/es/knxUltimateHueContactSensor.html +0 -35
- package/nodes/locales/es/knxUltimateHueContactSensor.json +0 -26
- package/nodes/locales/es/knxUltimateHueController.html +0 -691
- package/nodes/locales/es/knxUltimateHueController.json +0 -64
- package/nodes/locales/es/knxUltimateHueHumiditySensor.html +0 -38
- package/nodes/locales/es/knxUltimateHueHumiditySensor.json +0 -30
- package/nodes/locales/es/knxUltimateHueLight.html +0 -124
- package/nodes/locales/es/knxUltimateHueLight.json +0 -94
- package/nodes/locales/es/knxUltimateHueLightSensor.html +0 -38
- package/nodes/locales/es/knxUltimateHueLightSensor.json +0 -19
- package/nodes/locales/es/knxUltimateHueMotion.html +0 -41
- package/nodes/locales/es/knxUltimateHueMotion.json +0 -27
- package/nodes/locales/es/knxUltimateHuePlug.html +0 -50
- package/nodes/locales/es/knxUltimateHuePlug.json +0 -33
- package/nodes/locales/es/knxUltimateHueScene.html +0 -45
- package/nodes/locales/es/knxUltimateHueScene.json +0 -41
- package/nodes/locales/es/knxUltimateHueTapDial.html +0 -40
- package/nodes/locales/es/knxUltimateHueTapDial.json +0 -28
- package/nodes/locales/es/knxUltimateHueTemperatureSensor.html +0 -38
- package/nodes/locales/es/knxUltimateHueTemperatureSensor.json +0 -30
- package/nodes/locales/es/knxUltimateHueZigbeeConnectivity.html +0 -39
- package/nodes/locales/es/knxUltimateHueZigbeeConnectivity.json +0 -30
- package/nodes/locales/es/knxUltimateHuedevice_software_update.html +0 -36
- package/nodes/locales/es/knxUltimateHuedevice_software_update.json +0 -30
- package/nodes/locales/es/knxUltimateLoadControl.html +0 -76
- package/nodes/locales/es/knxUltimateLoadControl.json +0 -28
- package/nodes/locales/es/knxUltimateLogger.html +0 -162
- package/nodes/locales/es/knxUltimateLogger.json +0 -31
- package/nodes/locales/es/knxUltimateMatterBridge.html +0 -65
- package/nodes/locales/es/knxUltimateMatterBridge.json +0 -123
- package/nodes/locales/es/knxUltimateMatterControllerDevice.html +0 -57
- package/nodes/locales/es/knxUltimateMatterControllerDevice.json +0 -146
- package/nodes/locales/es/knxUltimateSceneController.html +0 -115
- package/nodes/locales/es/knxUltimateSceneController.json +0 -32
- package/nodes/locales/es/knxUltimateStaircase.html +0 -77
- package/nodes/locales/es/knxUltimateStaircase.json +0 -62
- package/nodes/locales/es/knxUltimateWatchDog.html +0 -230
- package/nodes/locales/es/knxUltimateWatchDog.json +0 -27
- package/nodes/locales/es/matter-config.html +0 -47
- package/nodes/locales/es/matter-config.json +0 -47
- package/nodes/locales/es/matterbridge-config.html +0 -45
- package/nodes/locales/es/matterbridge-config.json +0 -25
- package/nodes/locales/fr/hue-config.html +0 -31
- package/nodes/locales/fr/hue-config.json +0 -21
- package/nodes/locales/fr/knxUltimateAI.html +0 -13
- package/nodes/locales/fr/knxUltimateAI.json +0 -231
- package/nodes/locales/fr/knxUltimateAIHomeAssistant.html +0 -11
- package/nodes/locales/fr/knxUltimateAlerter.html +0 -164
- package/nodes/locales/fr/knxUltimateAlerter.json +0 -27
- package/nodes/locales/fr/knxUltimateAutoResponder.html +0 -92
- package/nodes/locales/fr/knxUltimateAutoResponder.json +0 -8
- package/nodes/locales/fr/knxUltimateDateTime.html +0 -45
- package/nodes/locales/fr/knxUltimateDateTime.json +0 -32
- package/nodes/locales/fr/knxUltimateGarage.html +0 -79
- package/nodes/locales/fr/knxUltimateGarage.json +0 -51
- package/nodes/locales/fr/knxUltimateGlobalContext.html +0 -122
- package/nodes/locales/fr/knxUltimateGlobalContext.json +0 -24
- package/nodes/locales/fr/knxUltimateHATranslator.html +0 -25
- package/nodes/locales/fr/knxUltimateHATranslator.json +0 -8
- package/nodes/locales/fr/knxUltimateHueAreaMotion.html +0 -44
- package/nodes/locales/fr/knxUltimateHueAreaMotion.json +0 -31
- package/nodes/locales/fr/knxUltimateHueBattery.html +0 -37
- package/nodes/locales/fr/knxUltimateHueBattery.json +0 -30
- package/nodes/locales/fr/knxUltimateHueButton.html +0 -52
- package/nodes/locales/fr/knxUltimateHueButton.json +0 -34
- package/nodes/locales/fr/knxUltimateHueCameraMotion.html +0 -38
- package/nodes/locales/fr/knxUltimateHueCameraMotion.json +0 -30
- package/nodes/locales/fr/knxUltimateHueContactSensor.html +0 -35
- package/nodes/locales/fr/knxUltimateHueContactSensor.json +0 -26
- package/nodes/locales/fr/knxUltimateHueController.html +0 -691
- package/nodes/locales/fr/knxUltimateHueController.json +0 -64
- package/nodes/locales/fr/knxUltimateHueHumiditySensor.html +0 -38
- package/nodes/locales/fr/knxUltimateHueHumiditySensor.json +0 -30
- package/nodes/locales/fr/knxUltimateHueLight.html +0 -124
- package/nodes/locales/fr/knxUltimateHueLight.json +0 -86
- package/nodes/locales/fr/knxUltimateHueLightSensor.html +0 -38
- package/nodes/locales/fr/knxUltimateHueLightSensor.json +0 -19
- package/nodes/locales/fr/knxUltimateHueMotion.html +0 -41
- package/nodes/locales/fr/knxUltimateHueMotion.json +0 -27
- package/nodes/locales/fr/knxUltimateHuePlug.html +0 -50
- package/nodes/locales/fr/knxUltimateHuePlug.json +0 -33
- package/nodes/locales/fr/knxUltimateHueScene.html +0 -45
- package/nodes/locales/fr/knxUltimateHueScene.json +0 -41
- package/nodes/locales/fr/knxUltimateHueTapDial.html +0 -40
- package/nodes/locales/fr/knxUltimateHueTapDial.json +0 -28
- package/nodes/locales/fr/knxUltimateHueTemperatureSensor.html +0 -38
- package/nodes/locales/fr/knxUltimateHueTemperatureSensor.json +0 -30
- package/nodes/locales/fr/knxUltimateHueZigbeeConnectivity.html +0 -39
- package/nodes/locales/fr/knxUltimateHueZigbeeConnectivity.json +0 -30
- package/nodes/locales/fr/knxUltimateHuedevice_software_update.html +0 -36
- package/nodes/locales/fr/knxUltimateHuedevice_software_update.json +0 -30
- package/nodes/locales/fr/knxUltimateLoadControl.html +0 -76
- package/nodes/locales/fr/knxUltimateLoadControl.json +0 -28
- package/nodes/locales/fr/knxUltimateLogger.html +0 -160
- package/nodes/locales/fr/knxUltimateLogger.json +0 -31
- package/nodes/locales/fr/knxUltimateMatterBridge.html +0 -65
- package/nodes/locales/fr/knxUltimateMatterBridge.json +0 -123
- package/nodes/locales/fr/knxUltimateMatterControllerDevice.html +0 -57
- package/nodes/locales/fr/knxUltimateMatterControllerDevice.json +0 -146
- package/nodes/locales/fr/knxUltimateSceneController.html +0 -117
- package/nodes/locales/fr/knxUltimateSceneController.json +0 -32
- package/nodes/locales/fr/knxUltimateStaircase.html +0 -77
- package/nodes/locales/fr/knxUltimateStaircase.json +0 -62
- package/nodes/locales/fr/knxUltimateWatchDog.html +0 -228
- package/nodes/locales/fr/knxUltimateWatchDog.json +0 -27
- package/nodes/locales/fr/matter-config.html +0 -47
- package/nodes/locales/fr/matter-config.json +0 -47
- package/nodes/locales/fr/matterbridge-config.html +0 -45
- package/nodes/locales/fr/matterbridge-config.json +0 -25
- package/nodes/locales/it/hue-config.html +0 -33
- package/nodes/locales/it/hue-config.json +0 -21
- package/nodes/locales/it/knxUltimateAI.html +0 -13
- package/nodes/locales/it/knxUltimateAI.json +0 -234
- package/nodes/locales/it/knxUltimateAIHomeAssistant.html +0 -11
- package/nodes/locales/it/knxUltimateAlerter.html +0 -159
- package/nodes/locales/it/knxUltimateAlerter.json +0 -27
- package/nodes/locales/it/knxUltimateAutoResponder.html +0 -96
- package/nodes/locales/it/knxUltimateAutoResponder.json +0 -8
- package/nodes/locales/it/knxUltimateDateTime.html +0 -67
- package/nodes/locales/it/knxUltimateDateTime.json +0 -32
- package/nodes/locales/it/knxUltimateGarage.html +0 -79
- package/nodes/locales/it/knxUltimateGarage.json +0 -51
- package/nodes/locales/it/knxUltimateGlobalContext.html +0 -81
- package/nodes/locales/it/knxUltimateGlobalContext.json +0 -24
- package/nodes/locales/it/knxUltimateHATranslator.html +0 -24
- package/nodes/locales/it/knxUltimateHATranslator.json +0 -8
- package/nodes/locales/it/knxUltimateHueAreaMotion.html +0 -44
- package/nodes/locales/it/knxUltimateHueAreaMotion.json +0 -31
- package/nodes/locales/it/knxUltimateHueBattery.html +0 -37
- package/nodes/locales/it/knxUltimateHueBattery.json +0 -30
- package/nodes/locales/it/knxUltimateHueButton.html +0 -52
- package/nodes/locales/it/knxUltimateHueButton.json +0 -34
- package/nodes/locales/it/knxUltimateHueCameraMotion.html +0 -38
- package/nodes/locales/it/knxUltimateHueCameraMotion.json +0 -30
- package/nodes/locales/it/knxUltimateHueContactSensor.html +0 -35
- package/nodes/locales/it/knxUltimateHueContactSensor.json +0 -26
- package/nodes/locales/it/knxUltimateHueController.html +0 -690
- package/nodes/locales/it/knxUltimateHueController.json +0 -64
- package/nodes/locales/it/knxUltimateHueHumiditySensor 2.html +0 -11
- package/nodes/locales/it/knxUltimateHueHumiditySensor.html +0 -38
- package/nodes/locales/it/knxUltimateHueHumiditySensor.json +0 -30
- package/nodes/locales/it/knxUltimateHueLight.html +0 -124
- package/nodes/locales/it/knxUltimateHueLight.json +0 -94
- package/nodes/locales/it/knxUltimateHueLightSensor.html +0 -38
- package/nodes/locales/it/knxUltimateHueLightSensor.json +0 -19
- package/nodes/locales/it/knxUltimateHueMotion.html +0 -41
- package/nodes/locales/it/knxUltimateHueMotion.json +0 -27
- package/nodes/locales/it/knxUltimateHuePlug.html +0 -50
- package/nodes/locales/it/knxUltimateHuePlug.json +0 -33
- package/nodes/locales/it/knxUltimateHueScene.html +0 -45
- package/nodes/locales/it/knxUltimateHueScene.json +0 -41
- package/nodes/locales/it/knxUltimateHueTapDial.html +0 -40
- package/nodes/locales/it/knxUltimateHueTapDial.json +0 -28
- package/nodes/locales/it/knxUltimateHueTemperatureSensor.html +0 -38
- package/nodes/locales/it/knxUltimateHueTemperatureSensor.json +0 -30
- package/nodes/locales/it/knxUltimateHueZigbeeConnectivity.html +0 -39
- package/nodes/locales/it/knxUltimateHueZigbeeConnectivity.json +0 -30
- package/nodes/locales/it/knxUltimateHuedevice_software_update.html +0 -35
- package/nodes/locales/it/knxUltimateHuedevice_software_update.json +0 -30
- package/nodes/locales/it/knxUltimateLoadControl.html +0 -76
- package/nodes/locales/it/knxUltimateLoadControl.json +0 -28
- package/nodes/locales/it/knxUltimateLogger.html +0 -132
- package/nodes/locales/it/knxUltimateLogger.json +0 -31
- package/nodes/locales/it/knxUltimateMatterBridge.html +0 -65
- package/nodes/locales/it/knxUltimateMatterBridge.json +0 -123
- package/nodes/locales/it/knxUltimateMatterControllerDevice.html +0 -57
- package/nodes/locales/it/knxUltimateMatterControllerDevice.json +0 -146
- package/nodes/locales/it/knxUltimateSceneController.html +0 -101
- package/nodes/locales/it/knxUltimateSceneController.json +0 -32
- package/nodes/locales/it/knxUltimateStaircase.html +0 -77
- package/nodes/locales/it/knxUltimateStaircase.json +0 -62
- package/nodes/locales/it/knxUltimateWatchDog.html +0 -194
- package/nodes/locales/it/knxUltimateWatchDog.json +0 -27
- package/nodes/locales/it/matter-config.html +0 -47
- package/nodes/locales/it/matter-config.json +0 -48
- package/nodes/locales/it/matterbridge-config.html +0 -45
- package/nodes/locales/it/matterbridge-config.json +0 -25
- package/nodes/locales/zh-CN/hue-config.html +0 -33
- package/nodes/locales/zh-CN/hue-config.json +0 -21
- package/nodes/locales/zh-CN/knxUltimateAI.html +0 -13
- package/nodes/locales/zh-CN/knxUltimateAI.json +0 -231
- package/nodes/locales/zh-CN/knxUltimateAIHomeAssistant.html +0 -11
- package/nodes/locales/zh-CN/knxUltimateAlerter.html +0 -159
- package/nodes/locales/zh-CN/knxUltimateAlerter.json +0 -27
- package/nodes/locales/zh-CN/knxUltimateAutoResponder.html +0 -94
- package/nodes/locales/zh-CN/knxUltimateAutoResponder.json +0 -8
- package/nodes/locales/zh-CN/knxUltimateDateTime.html +0 -45
- package/nodes/locales/zh-CN/knxUltimateDateTime.json +0 -32
- package/nodes/locales/zh-CN/knxUltimateGarage.html +0 -79
- package/nodes/locales/zh-CN/knxUltimateGarage.json +0 -51
- package/nodes/locales/zh-CN/knxUltimateGlobalContext.html +0 -77
- package/nodes/locales/zh-CN/knxUltimateGlobalContext.json +0 -24
- package/nodes/locales/zh-CN/knxUltimateHATranslator.html +0 -25
- package/nodes/locales/zh-CN/knxUltimateHATranslator.json +0 -8
- package/nodes/locales/zh-CN/knxUltimateHueAreaMotion.html +0 -44
- package/nodes/locales/zh-CN/knxUltimateHueAreaMotion.json +0 -31
- package/nodes/locales/zh-CN/knxUltimateHueBattery.html +0 -37
- package/nodes/locales/zh-CN/knxUltimateHueBattery.json +0 -30
- package/nodes/locales/zh-CN/knxUltimateHueButton.html +0 -52
- package/nodes/locales/zh-CN/knxUltimateHueButton.json +0 -34
- package/nodes/locales/zh-CN/knxUltimateHueCameraMotion.html +0 -38
- package/nodes/locales/zh-CN/knxUltimateHueCameraMotion.json +0 -30
- package/nodes/locales/zh-CN/knxUltimateHueContactSensor.html +0 -35
- package/nodes/locales/zh-CN/knxUltimateHueContactSensor.json +0 -26
- package/nodes/locales/zh-CN/knxUltimateHueController.html +0 -693
- package/nodes/locales/zh-CN/knxUltimateHueController.json +0 -64
- package/nodes/locales/zh-CN/knxUltimateHueHumiditySensor.html +0 -38
- package/nodes/locales/zh-CN/knxUltimateHueHumiditySensor.json +0 -30
- package/nodes/locales/zh-CN/knxUltimateHueLight.html +0 -126
- package/nodes/locales/zh-CN/knxUltimateHueLight.json +0 -86
- package/nodes/locales/zh-CN/knxUltimateHueLightSensor.html +0 -38
- package/nodes/locales/zh-CN/knxUltimateHueLightSensor.json +0 -9
- package/nodes/locales/zh-CN/knxUltimateHueMotion.html +0 -41
- package/nodes/locales/zh-CN/knxUltimateHueMotion.json +0 -27
- package/nodes/locales/zh-CN/knxUltimateHuePlug.html +0 -50
- package/nodes/locales/zh-CN/knxUltimateHuePlug.json +0 -33
- package/nodes/locales/zh-CN/knxUltimateHueScene.html +0 -45
- package/nodes/locales/zh-CN/knxUltimateHueScene.json +0 -41
- package/nodes/locales/zh-CN/knxUltimateHueTapDial.html +0 -40
- package/nodes/locales/zh-CN/knxUltimateHueTapDial.json +0 -28
- package/nodes/locales/zh-CN/knxUltimateHueTemperatureSensor.html +0 -38
- package/nodes/locales/zh-CN/knxUltimateHueTemperatureSensor.json +0 -30
- package/nodes/locales/zh-CN/knxUltimateHueZigbeeConnectivity.html +0 -39
- package/nodes/locales/zh-CN/knxUltimateHueZigbeeConnectivity.json +0 -30
- package/nodes/locales/zh-CN/knxUltimateHuedevice_software_update.html +0 -36
- package/nodes/locales/zh-CN/knxUltimateHuedevice_software_update.json +0 -30
- package/nodes/locales/zh-CN/knxUltimateLoadControl.html +0 -76
- package/nodes/locales/zh-CN/knxUltimateLoadControl.json +0 -28
- package/nodes/locales/zh-CN/knxUltimateLogger.html +0 -126
- package/nodes/locales/zh-CN/knxUltimateLogger.json +0 -31
- package/nodes/locales/zh-CN/knxUltimateMatterBridge.html +0 -65
- package/nodes/locales/zh-CN/knxUltimateMatterBridge.json +0 -123
- package/nodes/locales/zh-CN/knxUltimateMatterControllerDevice.html +0 -57
- package/nodes/locales/zh-CN/knxUltimateMatterControllerDevice.json +0 -146
- package/nodes/locales/zh-CN/knxUltimateSceneController.html +0 -98
- package/nodes/locales/zh-CN/knxUltimateSceneController.json +0 -32
- package/nodes/locales/zh-CN/knxUltimateStaircase.html +0 -77
- package/nodes/locales/zh-CN/knxUltimateStaircase.json +0 -62
- package/nodes/locales/zh-CN/knxUltimateWatchDog.html +0 -178
- package/nodes/locales/zh-CN/knxUltimateWatchDog.json +0 -27
- package/nodes/locales/zh-CN/matter-config.html +0 -47
- package/nodes/locales/zh-CN/matter-config.json +0 -47
- package/nodes/locales/zh-CN/matterbridge-config.html +0 -45
- package/nodes/locales/zh-CN/matterbridge-config.json +0 -25
- package/nodes/matter-config.html +0 -578
- package/nodes/matter-config.js +0 -387
- package/nodes/matterbridge-config.html +0 -198
- package/nodes/matterbridge-config.js +0 -261
- package/nodes/plugins/knxUltimate-cerebrum-runtime-plugin.js +0 -79
- package/nodes/plugins/knxUltimate-migration-notice-plugin.html +0 -44
- package/nodes/plugins/knxUltimateAI-vue/assets/app.css +0 -1
- package/nodes/plugins/knxUltimateAI-vue/assets/app.js +0 -13
- package/nodes/plugins/knxUltimateAI-vue/assets/chunk-html2canvas.esm.js +0 -5
- package/nodes/plugins/knxUltimateAI-vue/assets/chunk-index.es.js +0 -5
- package/nodes/plugins/knxUltimateAI-vue/assets/chunk-jspdf.es.min.js +0 -79
- package/nodes/plugins/knxUltimateAI-vue/assets/chunk-purify.es.js +0 -3
- package/nodes/plugins/knxUltimateAI-vue/index.html +0 -13
- package/nodes/utils/HueEventStream.mjs +0 -176
- package/nodes/utils/colorManipulators/XYFromRGB_Supergiovane.js +0 -113
- package/nodes/utils/colorManipulators/hueColorConverter.js +0 -521
- package/nodes/utils/http.js +0 -291
- package/nodes/utils/hueControllerProfileAdapter.js +0 -104
- package/nodes/utils/hueControllerProfiles/runtime/area_motion.js +0 -221
- package/nodes/utils/hueControllerProfiles/runtime/button.js +0 -295
- package/nodes/utils/hueControllerProfiles/runtime/camera_motion.js +0 -221
- package/nodes/utils/hueControllerProfiles/runtime/contact.js +0 -191
- package/nodes/utils/hueControllerProfiles/runtime/device_power.js +0 -185
- package/nodes/utils/hueControllerProfiles/runtime/device_software_update.js +0 -185
- package/nodes/utils/hueControllerProfiles/runtime/humidity.js +0 -204
- package/nodes/utils/hueControllerProfiles/runtime/light.js +0 -1585
- package/nodes/utils/hueControllerProfiles/runtime/light_level.js +0 -180
- package/nodes/utils/hueControllerProfiles/runtime/motion.js +0 -185
- package/nodes/utils/hueControllerProfiles/runtime/plug.js +0 -344
- package/nodes/utils/hueControllerProfiles/runtime/relative_rotary.js +0 -271
- package/nodes/utils/hueControllerProfiles/runtime/scene.js +0 -352
- package/nodes/utils/hueControllerProfiles/runtime/temperature.js +0 -187
- package/nodes/utils/hueControllerProfiles/runtime/zigbee_connectivity.js +0 -185
- package/nodes/utils/hueControllerResourceCatalog.js +0 -71
- package/nodes/utils/hueEngine.mjs +0 -469
- package/nodes/utils/knxAiCamera.js +0 -302
- package/nodes/utils/knxAiCatalogRetrieval.js +0 -349
- package/nodes/utils/knxAiCerebrum.js +0 -406
- package/nodes/utils/knxAiChatContext.js +0 -496
- package/nodes/utils/knxAiEventHistory.js +0 -521
- package/nodes/utils/knxAiHomeMemory.js +0 -1021
- package/nodes/utils/knxAiScheduler.js +0 -445
- package/nodes/utils/knxAiSemanticContext.js +0 -662
- package/nodes/utils/knxAiTelegramVoice.js +0 -545
- package/nodes/utils/knxAiWebAccess.js +0 -631
- package/nodes/utils/lightEngines/canonicalLight.js +0 -75
- package/nodes/utils/lightEngines/hueLightEngine.js +0 -51
- package/nodes/utils/lightEngines/index.js +0 -25
- package/nodes/utils/lightEngines/knxLightCommand.js +0 -79
- package/nodes/utils/lightEngines/lightEngine.js +0 -46
- package/nodes/utils/lightEngines/matterHueShim.js +0 -59
- package/nodes/utils/lightEngines/matterLightEngine.js +0 -117
- package/nodes/utils/matterBridgeDeviceFactory.mjs +0 -780
- package/nodes/utils/matterBridgeEngine.mjs +0 -297
- package/nodes/utils/matterControllerCommandGate.js +0 -47
- package/nodes/utils/matterControllerProfiles/doorLock.js +0 -258
- package/nodes/utils/matterControllerProfiles/fan.js +0 -19
- package/nodes/utils/matterControllerProfiles/index.js +0 -34
- package/nodes/utils/matterControllerProfiles/mappedEndpoint.js +0 -217
- package/nodes/utils/matterControllerProfiles/switch.js +0 -13
- package/nodes/utils/matterControllerProfiles/thermostat.js +0 -19
- package/nodes/utils/matterControllerProfiles/universal.js +0 -462
- package/nodes/utils/matterControllerProfiles/windowCovering.js +0 -19
- package/nodes/utils/matterControllerSemanticInput.js +0 -212
- package/nodes/utils/matterEngine.mjs +0 -894
- package/nodes/utils/matterEnvironmentLock.mjs +0 -32
- package/nodes/utils/matterKnxConverter.js +0 -204
- package/nodes/utils/matterStorageBackup.js +0 -100
- package/resources/HA-icon.png +0 -0
- package/resources/dim.png +0 -0
- package/resources/rgb.png +0 -0
- package/resources/tunablewhite.png +0 -0
- package/resources/zxing-browser-0.2.0.min.js +0 -1
- package/resources/zxing-browser-LICENSE.txt +0 -21
|
@@ -1,445 +0,0 @@
|
|
|
1
|
-
const KNX_AI_SCHEDULE_STORE_VERSION = 1
|
|
2
|
-
const KNX_AI_SCHEDULE_MAX_ACTIVE_TASKS = 32
|
|
3
|
-
const KNX_AI_SCHEDULE_MAX_STORED_TASKS = 64
|
|
4
|
-
const KNX_AI_SCHEDULE_MAX_ACTIONS = 8
|
|
5
|
-
const KNX_AI_SCHEDULE_MIN_INTERVAL_MINUTES = 5
|
|
6
|
-
const KNX_AI_SCHEDULE_MAX_INTERVAL_MINUTES = 365 * 24 * 60
|
|
7
|
-
const KNX_AI_SCHEDULE_MAX_INSTRUCTION_CHARS = 4000
|
|
8
|
-
const KNX_AI_SCHEDULE_ONE_TIME_LEASE_MS = 60 * 1000
|
|
9
|
-
|
|
10
|
-
const clonePlain = (value, fallback) => {
|
|
11
|
-
try {
|
|
12
|
-
return JSON.parse(JSON.stringify(value))
|
|
13
|
-
} catch (error) {
|
|
14
|
-
return fallback
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const clampText = (value, maxChars) => {
|
|
19
|
-
const text = String(value === undefined || value === null ? '' : value).trim()
|
|
20
|
-
return text.length > maxChars ? text.slice(0, maxChars) : text
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const toIso = (value) => {
|
|
24
|
-
const timestamp = value instanceof Date ? value.getTime() : Date.parse(String(value || ''))
|
|
25
|
-
return Number.isFinite(timestamp) ? new Date(timestamp).toISOString() : ''
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const toAbsoluteIso = (value) => {
|
|
29
|
-
const text = String(value === undefined || value === null ? '' : value).trim()
|
|
30
|
-
if (!/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/i.test(text)) return ''
|
|
31
|
-
return toIso(text)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const normalizeIntervalMinutes = (value) => {
|
|
35
|
-
const numeric = Number(value)
|
|
36
|
-
if (!Number.isFinite(numeric) || numeric <= 0) return 0
|
|
37
|
-
return Math.max(
|
|
38
|
-
KNX_AI_SCHEDULE_MIN_INTERVAL_MINUTES,
|
|
39
|
-
Math.min(KNX_AI_SCHEDULE_MAX_INTERVAL_MINUTES, Math.round(numeric))
|
|
40
|
-
)
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const createEmptyKnxAiScheduleStore = () => ({
|
|
44
|
-
version: KNX_AI_SCHEDULE_STORE_VERSION,
|
|
45
|
-
createdAt: new Date().toISOString(),
|
|
46
|
-
updatedAt: new Date().toISOString(),
|
|
47
|
-
tasks: []
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
const normalizeKnxAiScheduleTask = (value, { now = Date.now() } = {}) => {
|
|
51
|
-
const source = value && typeof value === 'object' && !Array.isArray(value) ? value : {}
|
|
52
|
-
const id = clampText(source.id, 96).replace(/[^A-Za-z0-9_.-]/g, '')
|
|
53
|
-
const instruction = clampText(source.instruction, KNX_AI_SCHEDULE_MAX_INSTRUCTION_CHARS)
|
|
54
|
-
const startAt = toIso(source.startAt || source.createdAt)
|
|
55
|
-
let nextRunAt = toIso(source.nextRunAt || startAt)
|
|
56
|
-
const expiresAt = toIso(source.expiresAt)
|
|
57
|
-
const intervalMinutes = normalizeIntervalMinutes(source.intervalMinutes)
|
|
58
|
-
const kind = ['monitor', 'reminder', 'command'].includes(String(source.kind || '').trim().toLowerCase())
|
|
59
|
-
? String(source.kind).trim().toLowerCase()
|
|
60
|
-
: 'reminder'
|
|
61
|
-
const runCount = Math.max(0, Math.floor(Number(source.runCount) || 0))
|
|
62
|
-
const allowedStatuses = new Set(['active', 'running', 'completed', 'cancelled', 'expired'])
|
|
63
|
-
let status = allowedStatuses.has(String(source.status || '').trim().toLowerCase())
|
|
64
|
-
? String(source.status).trim().toLowerCase()
|
|
65
|
-
: 'active'
|
|
66
|
-
const expiresAtMs = expiresAt ? Date.parse(expiresAt) : 0
|
|
67
|
-
if (status === 'running') status = intervalMinutes > 0 || kind !== 'command' ? 'active' : 'completed'
|
|
68
|
-
if (status === 'active' && expiresAtMs > 0 && expiresAtMs <= Number(now)) {
|
|
69
|
-
status = 'expired'
|
|
70
|
-
nextRunAt = ''
|
|
71
|
-
}
|
|
72
|
-
if (status === 'active' && !nextRunAt) nextRunAt = startAt || new Date(Number(now)).toISOString()
|
|
73
|
-
if (status !== 'active') nextRunAt = ''
|
|
74
|
-
return {
|
|
75
|
-
id,
|
|
76
|
-
kind,
|
|
77
|
-
title: clampText(source.title || instruction, 200),
|
|
78
|
-
instruction,
|
|
79
|
-
sourceRequest: clampText(source.sourceRequest, KNX_AI_SCHEDULE_MAX_INSTRUCTION_CHARS),
|
|
80
|
-
sessionId: clampText(source.sessionId || 'default', 160) || 'default',
|
|
81
|
-
language: clampText(source.language || 'en', 16) || 'en',
|
|
82
|
-
createdAt: toIso(source.createdAt) || new Date(Number(now)).toISOString(),
|
|
83
|
-
startAt: startAt || new Date(Number(now)).toISOString(),
|
|
84
|
-
nextRunAt,
|
|
85
|
-
intervalMinutes,
|
|
86
|
-
expiresAt,
|
|
87
|
-
status,
|
|
88
|
-
runCount,
|
|
89
|
-
lastRunAt: toIso(source.lastRunAt),
|
|
90
|
-
lastStatus: clampText(source.lastStatus, 32),
|
|
91
|
-
lastError: clampText(source.lastError, 1000),
|
|
92
|
-
lastNotificationAt: toIso(source.lastNotificationAt),
|
|
93
|
-
lastNotificationFingerprint: clampText(source.lastNotificationFingerprint, 128),
|
|
94
|
-
reason: clampText(source.reason, 1000)
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
const normalizeKnxAiScheduleStore = (value, { now = Date.now() } = {}) => {
|
|
99
|
-
const source = value && typeof value === 'object' && !Array.isArray(value) ? value : {}
|
|
100
|
-
const seen = new Set()
|
|
101
|
-
const tasks = (Array.isArray(source.tasks) ? source.tasks : [])
|
|
102
|
-
.map(task => normalizeKnxAiScheduleTask(task, { now }))
|
|
103
|
-
.filter(task => {
|
|
104
|
-
if (!task.id || !task.instruction || seen.has(task.id)) return false
|
|
105
|
-
seen.add(task.id)
|
|
106
|
-
return true
|
|
107
|
-
})
|
|
108
|
-
const active = tasks.filter(task => task.status === 'active')
|
|
109
|
-
const inactive = tasks
|
|
110
|
-
.filter(task => task.status !== 'active')
|
|
111
|
-
.sort((left, right) => String(right.lastRunAt || right.createdAt).localeCompare(String(left.lastRunAt || left.createdAt)))
|
|
112
|
-
const bounded = active.concat(inactive.slice(0, Math.max(0, KNX_AI_SCHEDULE_MAX_STORED_TASKS - active.length)))
|
|
113
|
-
.slice(0, KNX_AI_SCHEDULE_MAX_STORED_TASKS)
|
|
114
|
-
return {
|
|
115
|
-
version: KNX_AI_SCHEDULE_STORE_VERSION,
|
|
116
|
-
createdAt: toIso(source.createdAt) || new Date(Number(now)).toISOString(),
|
|
117
|
-
updatedAt: toIso(source.updatedAt) || new Date(Number(now)).toISOString(),
|
|
118
|
-
tasks: bounded
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
const normalizeKnxAiScheduleActions = (value, { now = Date.now() } = {}) => {
|
|
123
|
-
const accepted = []
|
|
124
|
-
const rejected = []
|
|
125
|
-
;(Array.isArray(value) ? value : []).slice(0, KNX_AI_SCHEDULE_MAX_ACTIONS).forEach((candidate, index) => {
|
|
126
|
-
const source = candidate && typeof candidate === 'object' && !Array.isArray(candidate) ? candidate : {}
|
|
127
|
-
const operation = String(source.operation || '').trim().toLowerCase()
|
|
128
|
-
if (!['create', 'cancel', 'list'].includes(operation)) {
|
|
129
|
-
rejected.push({ sourceIndex: index, reason: 'unsupported schedule operation' })
|
|
130
|
-
return
|
|
131
|
-
}
|
|
132
|
-
if (operation === 'list') {
|
|
133
|
-
accepted.push({
|
|
134
|
-
operation,
|
|
135
|
-
taskId: '',
|
|
136
|
-
all: false,
|
|
137
|
-
kind: 'reminder',
|
|
138
|
-
title: '',
|
|
139
|
-
instruction: '',
|
|
140
|
-
startAt: '',
|
|
141
|
-
intervalMinutes: 0,
|
|
142
|
-
expiresAt: '',
|
|
143
|
-
reason: clampText(source.reason, 1000)
|
|
144
|
-
})
|
|
145
|
-
return
|
|
146
|
-
}
|
|
147
|
-
if (operation === 'cancel') {
|
|
148
|
-
const taskId = clampText(source.taskId || source.id, 96).replace(/[^A-Za-z0-9_.-]/g, '')
|
|
149
|
-
const all = source.all === true
|
|
150
|
-
if (!taskId && !all) {
|
|
151
|
-
rejected.push({ sourceIndex: index, reason: 'schedule cancellation needs an exact task id or all=true' })
|
|
152
|
-
return
|
|
153
|
-
}
|
|
154
|
-
accepted.push({
|
|
155
|
-
operation,
|
|
156
|
-
taskId,
|
|
157
|
-
all,
|
|
158
|
-
kind: 'reminder',
|
|
159
|
-
title: '',
|
|
160
|
-
instruction: '',
|
|
161
|
-
startAt: '',
|
|
162
|
-
intervalMinutes: 0,
|
|
163
|
-
expiresAt: '',
|
|
164
|
-
reason: clampText(source.reason, 1000)
|
|
165
|
-
})
|
|
166
|
-
return
|
|
167
|
-
}
|
|
168
|
-
const title = clampText(source.title, 200)
|
|
169
|
-
const kind = String(source.kind || '').trim().toLowerCase()
|
|
170
|
-
const instruction = clampText(source.instruction || source.task || source.text, KNX_AI_SCHEDULE_MAX_INSTRUCTION_CHARS)
|
|
171
|
-
const requestedStartAt = toAbsoluteIso(source.startAt || source.runAt)
|
|
172
|
-
const rawIntervalMinutes = source.intervalMinutes !== undefined ? source.intervalMinutes : source.repeatEveryMinutes
|
|
173
|
-
const intervalText = String(rawIntervalMinutes === undefined || rawIntervalMinutes === null ? '' : rawIntervalMinutes).trim()
|
|
174
|
-
const numericIntervalMinutes = intervalText === '' ? 0 : Number(rawIntervalMinutes)
|
|
175
|
-
const intervalMinutes = normalizeIntervalMinutes(numericIntervalMinutes)
|
|
176
|
-
const rawExpiresAt = source.expiresAt !== undefined ? source.expiresAt : source.endAt
|
|
177
|
-
const expiresAt = String(rawExpiresAt === undefined || rawExpiresAt === null ? '' : rawExpiresAt).trim()
|
|
178
|
-
? toAbsoluteIso(rawExpiresAt)
|
|
179
|
-
: ''
|
|
180
|
-
if (!title) {
|
|
181
|
-
rejected.push({ sourceIndex: index, reason: 'schedule title is empty' })
|
|
182
|
-
return
|
|
183
|
-
}
|
|
184
|
-
if (!['monitor', 'reminder', 'command'].includes(kind)) {
|
|
185
|
-
rejected.push({ sourceIndex: index, reason: 'schedule kind must be monitor, reminder, or command' })
|
|
186
|
-
return
|
|
187
|
-
}
|
|
188
|
-
if (!instruction) {
|
|
189
|
-
rejected.push({ sourceIndex: index, reason: 'schedule instruction is empty' })
|
|
190
|
-
return
|
|
191
|
-
}
|
|
192
|
-
if (!requestedStartAt) {
|
|
193
|
-
rejected.push({ sourceIndex: index, reason: 'schedule startAt is not a valid absolute date and time' })
|
|
194
|
-
return
|
|
195
|
-
}
|
|
196
|
-
if (!Number.isFinite(numericIntervalMinutes) || numericIntervalMinutes < 0) {
|
|
197
|
-
rejected.push({ sourceIndex: index, reason: 'schedule intervalMinutes must be zero or a positive number' })
|
|
198
|
-
return
|
|
199
|
-
}
|
|
200
|
-
if (String(rawExpiresAt === undefined || rawExpiresAt === null ? '' : rawExpiresAt).trim() && !expiresAt) {
|
|
201
|
-
rejected.push({ sourceIndex: index, reason: 'schedule expiresAt is not a valid absolute date and time' })
|
|
202
|
-
return
|
|
203
|
-
}
|
|
204
|
-
const startAtMs = Math.max(Number(now), Date.parse(requestedStartAt))
|
|
205
|
-
const normalizedStartAt = new Date(startAtMs).toISOString()
|
|
206
|
-
const expiresAtMs = expiresAt ? Date.parse(expiresAt) : 0
|
|
207
|
-
if (expiresAt && expiresAtMs <= startAtMs) {
|
|
208
|
-
rejected.push({ sourceIndex: index, reason: 'schedule expiresAt must be later than startAt' })
|
|
209
|
-
return
|
|
210
|
-
}
|
|
211
|
-
accepted.push({
|
|
212
|
-
operation,
|
|
213
|
-
taskId: '',
|
|
214
|
-
all: false,
|
|
215
|
-
kind,
|
|
216
|
-
title,
|
|
217
|
-
instruction,
|
|
218
|
-
startAt: normalizedStartAt,
|
|
219
|
-
intervalMinutes,
|
|
220
|
-
expiresAt,
|
|
221
|
-
reason: clampText(source.reason, 1000)
|
|
222
|
-
})
|
|
223
|
-
})
|
|
224
|
-
return { accepted, rejected }
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
const createScheduleId = ({ now, idFactory, existingIds }) => {
|
|
228
|
-
for (let attempt = 0; attempt < 20; attempt += 1) {
|
|
229
|
-
const generated = typeof idFactory === 'function'
|
|
230
|
-
? String(idFactory())
|
|
231
|
-
: `${Number(now).toString(36)}-${Math.random().toString(36).slice(2, 8)}`
|
|
232
|
-
const candidate = `schedule-${generated}`.replace(/[^A-Za-z0-9_.-]/g, '').slice(0, 96)
|
|
233
|
-
if (candidate && !existingIds.has(candidate)) return candidate
|
|
234
|
-
}
|
|
235
|
-
throw new Error('unable to allocate a unique schedule id')
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
const applyKnxAiScheduleActions = ({ store, actions, sessionId = 'default', language = 'en', sourceRequest = '', now = Date.now(), idFactory } = {}) => {
|
|
239
|
-
const target = normalizeKnxAiScheduleStore(store, { now })
|
|
240
|
-
const normalized = normalizeKnxAiScheduleActions(actions, { now })
|
|
241
|
-
const results = normalized.rejected.map(item => ({ operation: 'invalid', ok: false, error: item.reason, sourceIndex: item.sourceIndex }))
|
|
242
|
-
const ownerSessionId = clampText(sessionId || 'default', 160) || 'default'
|
|
243
|
-
const ownerLanguage = clampText(language || 'en', 16) || 'en'
|
|
244
|
-
const existingIds = new Set(target.tasks.map(task => task.id))
|
|
245
|
-
normalized.accepted.forEach(action => {
|
|
246
|
-
if (action.operation === 'list') {
|
|
247
|
-
results.push({
|
|
248
|
-
operation: 'list',
|
|
249
|
-
ok: true,
|
|
250
|
-
tasks: target.tasks
|
|
251
|
-
.filter(task => task.sessionId === ownerSessionId && task.status === 'active')
|
|
252
|
-
.map(task => clonePlain(task, {}))
|
|
253
|
-
})
|
|
254
|
-
return
|
|
255
|
-
}
|
|
256
|
-
if (action.operation === 'cancel') {
|
|
257
|
-
const matches = target.tasks.filter(task => {
|
|
258
|
-
if (task.sessionId !== ownerSessionId || (task.status !== 'active' && task.lastStatus !== 'running')) return false
|
|
259
|
-
return action.all === true || task.id === action.taskId
|
|
260
|
-
})
|
|
261
|
-
matches.forEach(task => {
|
|
262
|
-
task.status = 'cancelled'
|
|
263
|
-
task.nextRunAt = ''
|
|
264
|
-
task.lastStatus = 'cancelled'
|
|
265
|
-
task.lastError = ''
|
|
266
|
-
})
|
|
267
|
-
results.push({
|
|
268
|
-
operation: 'cancel',
|
|
269
|
-
ok: matches.length > 0,
|
|
270
|
-
taskId: action.taskId,
|
|
271
|
-
all: action.all === true,
|
|
272
|
-
count: matches.length,
|
|
273
|
-
error: matches.length ? '' : 'no matching active schedule was found for this chat'
|
|
274
|
-
})
|
|
275
|
-
return
|
|
276
|
-
}
|
|
277
|
-
const activeCount = target.tasks.filter(task => task.status === 'active').length
|
|
278
|
-
if (activeCount >= KNX_AI_SCHEDULE_MAX_ACTIVE_TASKS) {
|
|
279
|
-
results.push({ operation: 'create', ok: false, error: `the active schedule limit (${KNX_AI_SCHEDULE_MAX_ACTIVE_TASKS}) has been reached` })
|
|
280
|
-
return
|
|
281
|
-
}
|
|
282
|
-
let id
|
|
283
|
-
try {
|
|
284
|
-
id = createScheduleId({ now, idFactory, existingIds })
|
|
285
|
-
} catch (error) {
|
|
286
|
-
results.push({ operation: 'create', ok: false, error: error.message || String(error) })
|
|
287
|
-
return
|
|
288
|
-
}
|
|
289
|
-
existingIds.add(id)
|
|
290
|
-
const task = normalizeKnxAiScheduleTask({
|
|
291
|
-
id,
|
|
292
|
-
kind: action.kind,
|
|
293
|
-
title: action.title,
|
|
294
|
-
instruction: action.instruction,
|
|
295
|
-
sourceRequest: clampText(sourceRequest, KNX_AI_SCHEDULE_MAX_INSTRUCTION_CHARS),
|
|
296
|
-
sessionId: ownerSessionId,
|
|
297
|
-
language: ownerLanguage,
|
|
298
|
-
createdAt: new Date(Number(now)).toISOString(),
|
|
299
|
-
startAt: action.startAt,
|
|
300
|
-
nextRunAt: action.startAt,
|
|
301
|
-
intervalMinutes: action.intervalMinutes,
|
|
302
|
-
expiresAt: action.expiresAt,
|
|
303
|
-
status: 'active',
|
|
304
|
-
reason: action.reason
|
|
305
|
-
}, { now })
|
|
306
|
-
target.tasks.push(task)
|
|
307
|
-
results.push({ operation: 'create', ok: true, task: clonePlain(task, {}) })
|
|
308
|
-
})
|
|
309
|
-
target.updatedAt = new Date(Number(now)).toISOString()
|
|
310
|
-
return {
|
|
311
|
-
store: normalizeKnxAiScheduleStore(target, { now }),
|
|
312
|
-
results,
|
|
313
|
-
accepted: normalized.accepted,
|
|
314
|
-
rejected: normalized.rejected
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
const claimDueKnxAiSchedules = ({ store, now = Date.now(), limit = 1 } = {}) => {
|
|
319
|
-
const target = normalizeKnxAiScheduleStore(store, { now })
|
|
320
|
-
const due = target.tasks
|
|
321
|
-
.filter(task => task.status === 'active' && task.nextRunAt && Date.parse(task.nextRunAt) <= Number(now))
|
|
322
|
-
.sort((left, right) => String(left.nextRunAt).localeCompare(String(right.nextRunAt)))
|
|
323
|
-
.slice(0, Math.max(1, Math.floor(Number(limit) || 1)))
|
|
324
|
-
const claimed = []
|
|
325
|
-
due.forEach(task => {
|
|
326
|
-
const scheduledForMs = Date.parse(task.nextRunAt)
|
|
327
|
-
const intervalMs = task.intervalMinutes > 0 ? task.intervalMinutes * 60 * 1000 : 0
|
|
328
|
-
task.lastRunAt = new Date(Number(now)).toISOString()
|
|
329
|
-
task.lastStatus = 'running'
|
|
330
|
-
task.lastError = ''
|
|
331
|
-
task.runCount += 1
|
|
332
|
-
if (intervalMs > 0) {
|
|
333
|
-
const elapsedIntervals = Math.max(1, Math.floor((Number(now) - scheduledForMs) / intervalMs) + 1)
|
|
334
|
-
const nextRunMs = scheduledForMs + (elapsedIntervals * intervalMs)
|
|
335
|
-
const expiresAtMs = task.expiresAt ? Date.parse(task.expiresAt) : 0
|
|
336
|
-
if (expiresAtMs > 0 && nextRunMs >= expiresAtMs) {
|
|
337
|
-
task.status = 'expired'
|
|
338
|
-
task.nextRunAt = ''
|
|
339
|
-
} else {
|
|
340
|
-
task.nextRunAt = new Date(nextRunMs).toISOString()
|
|
341
|
-
}
|
|
342
|
-
} else {
|
|
343
|
-
task.status = task.kind === 'command' ? 'completed' : 'running'
|
|
344
|
-
task.nextRunAt = task.kind === 'command'
|
|
345
|
-
? ''
|
|
346
|
-
: new Date(Number(now) + KNX_AI_SCHEDULE_ONE_TIME_LEASE_MS).toISOString()
|
|
347
|
-
}
|
|
348
|
-
claimed.push(clonePlain(task, {}))
|
|
349
|
-
})
|
|
350
|
-
target.updatedAt = new Date(Number(now)).toISOString()
|
|
351
|
-
return { store: normalizeKnxAiScheduleStore(target, { now }), claimed }
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
const completeKnxAiScheduleRun = ({ store, taskId, ok = true, error = '', notified = false, notificationFingerprint = '', now = Date.now() } = {}) => {
|
|
355
|
-
const target = normalizeKnxAiScheduleStore(store, { now })
|
|
356
|
-
const task = target.tasks.find(item => item.id === String(taskId || ''))
|
|
357
|
-
if (!task) return { store: target, task: null }
|
|
358
|
-
if (task.status !== 'cancelled') {
|
|
359
|
-
if (task.intervalMinutes <= 0) {
|
|
360
|
-
task.status = 'completed'
|
|
361
|
-
task.nextRunAt = ''
|
|
362
|
-
}
|
|
363
|
-
task.lastStatus = ok ? 'completed' : 'error'
|
|
364
|
-
task.lastError = ok ? '' : clampText(error, 1000)
|
|
365
|
-
if (notified) {
|
|
366
|
-
task.lastNotificationAt = new Date(Number(now)).toISOString()
|
|
367
|
-
task.lastNotificationFingerprint = clampText(notificationFingerprint, 128)
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
target.updatedAt = new Date(Number(now)).toISOString()
|
|
371
|
-
return { store: normalizeKnxAiScheduleStore(target, { now }), task: clonePlain(task, {}) }
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
const listActiveKnxAiSchedules = (store, { sessionId, now = Date.now() } = {}) => {
|
|
375
|
-
const owner = sessionId === undefined ? null : String(sessionId || 'default')
|
|
376
|
-
return normalizeKnxAiScheduleStore(store, { now }).tasks
|
|
377
|
-
.filter(task => task.status === 'active' && (owner === null || task.sessionId === owner))
|
|
378
|
-
.sort((left, right) => String(left.nextRunAt).localeCompare(String(right.nextRunAt)))
|
|
379
|
-
.map(task => clonePlain(task, {}))
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
const buildKnxAiSchedulePromptContext = (store, { sessionId, maxChars = 12000, now = Date.now() } = {}) => {
|
|
383
|
-
const tasks = listActiveKnxAiSchedules(store, { sessionId, now })
|
|
384
|
-
if (!tasks.length) return '(no active schedules for this chat)'
|
|
385
|
-
const lines = tasks.map(task => {
|
|
386
|
-
return `${task.id} | kind ${task.kind} | ${task.title} | instruction ${JSON.stringify(task.instruction)} | next ${task.nextRunAt || '-'} | every ${task.intervalMinutes || 0} minute(s) | expires ${task.expiresAt || 'never'}`
|
|
387
|
-
})
|
|
388
|
-
const rendered = lines.join('\n')
|
|
389
|
-
return Number(maxChars) > 0
|
|
390
|
-
? clampText(rendered, Math.max(200, Number(maxChars)))
|
|
391
|
-
: rendered
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
const buildKnxAiScheduleMarkdown = (store, { now = Date.now() } = {}) => {
|
|
395
|
-
const target = normalizeKnxAiScheduleStore(store, { now })
|
|
396
|
-
const lines = [
|
|
397
|
-
'# Cerebrum Ultimate Plans and Reminders',
|
|
398
|
-
'',
|
|
399
|
-
'This file is generated by Cerebrum Ultimate. Manage these tasks in natural-language chat; the JSON file is the authoritative runtime state.',
|
|
400
|
-
'',
|
|
401
|
-
`Updated: ${target.updatedAt}`,
|
|
402
|
-
''
|
|
403
|
-
]
|
|
404
|
-
if (!target.tasks.length) lines.push('_No plans or reminders have been stored._', '')
|
|
405
|
-
target.tasks.forEach(task => {
|
|
406
|
-
const instruction = String(task.instruction || '').replace(/\s+/g, ' ').trim()
|
|
407
|
-
lines.push(`## ${task.title || task.id}`)
|
|
408
|
-
lines.push('')
|
|
409
|
-
lines.push(`- ID: \`${task.id}\``)
|
|
410
|
-
lines.push(`- Status: ${task.status}`)
|
|
411
|
-
lines.push(`- Kind: ${task.kind}`)
|
|
412
|
-
lines.push(`- Instruction: ${instruction}`)
|
|
413
|
-
if (task.sourceRequest) lines.push(`- Original user request: ${String(task.sourceRequest).replace(/\s+/g, ' ').trim()}`)
|
|
414
|
-
lines.push(`- First run: ${task.startAt || '-'}`)
|
|
415
|
-
lines.push(`- Next run: ${task.nextRunAt || '-'}`)
|
|
416
|
-
lines.push(`- Repeat every: ${task.intervalMinutes > 0 ? `${task.intervalMinutes} minutes` : 'one time'}`)
|
|
417
|
-
lines.push(`- Expires: ${task.expiresAt || 'never'}`)
|
|
418
|
-
lines.push(`- Last result: ${task.lastStatus || 'not run yet'}${task.lastError ? ` — ${task.lastError}` : ''}`)
|
|
419
|
-
if (task.lastNotificationAt) lines.push(`- Last notification: ${task.lastNotificationAt}${task.lastNotificationFingerprint ? ` (fingerprint ${task.lastNotificationFingerprint})` : ''}`)
|
|
420
|
-
lines.push('')
|
|
421
|
-
})
|
|
422
|
-
return lines.join('\n')
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
module.exports = {
|
|
426
|
-
KNX_AI_SCHEDULE_MAX_ACTIONS,
|
|
427
|
-
KNX_AI_SCHEDULE_MAX_ACTIVE_TASKS,
|
|
428
|
-
KNX_AI_SCHEDULE_MAX_INSTRUCTION_CHARS,
|
|
429
|
-
KNX_AI_SCHEDULE_MAX_INTERVAL_MINUTES,
|
|
430
|
-
KNX_AI_SCHEDULE_MAX_STORED_TASKS,
|
|
431
|
-
KNX_AI_SCHEDULE_MIN_INTERVAL_MINUTES,
|
|
432
|
-
KNX_AI_SCHEDULE_ONE_TIME_LEASE_MS,
|
|
433
|
-
KNX_AI_SCHEDULE_STORE_VERSION,
|
|
434
|
-
applyKnxAiScheduleActions,
|
|
435
|
-
buildKnxAiScheduleMarkdown,
|
|
436
|
-
buildKnxAiSchedulePromptContext,
|
|
437
|
-
claimDueKnxAiSchedules,
|
|
438
|
-
completeKnxAiScheduleRun,
|
|
439
|
-
createEmptyKnxAiScheduleStore,
|
|
440
|
-
listActiveKnxAiSchedules,
|
|
441
|
-
normalizeIntervalMinutes,
|
|
442
|
-
normalizeKnxAiScheduleActions,
|
|
443
|
-
normalizeKnxAiScheduleStore,
|
|
444
|
-
normalizeKnxAiScheduleTask
|
|
445
|
-
}
|