From e3d5e57281e0d7ad73bb3a99dfce2235b80eadad Mon Sep 17 00:00:00 2001 From: abose Date: Mon, 6 Oct 2025 21:15:08 +0530 Subject: [PATCH 1/2] chore: ai wire in from live preview for disabled dialogs --- src/LiveDevelopment/LivePreviewEdit.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/LiveDevelopment/LivePreviewEdit.js b/src/LiveDevelopment/LivePreviewEdit.js index ddddb8c465..8ca9f2e4d5 100644 --- a/src/LiveDevelopment/LivePreviewEdit.js +++ b/src/LiveDevelopment/LivePreviewEdit.js @@ -31,6 +31,13 @@ define(function (require, exports, module) { const ProjectManager = require("project/ProjectManager"); const FileSystem = require("filesystem/FileSystem"); const PathUtils = require("thirdparty/path-utils/path-utils"); + const ProDialogs = require("services/pro-dialogs"); + + const KernalModeTrust = window.KernalModeTrust; + if(!KernalModeTrust){ + // integrated extensions will have access to kernal mode, but not external extensions + throw new Error("profile menu should have access to KernalModeTrust. Cannot boot without trust ring"); + } /** * This function syncs text content changes between the original source code @@ -591,9 +598,17 @@ define(function (require, exports, module) { return AIData; } - function _editWithAI(message) { + async function _editWithAI(message) { const AIData = _getRequiredDataForAI(message); - // write the AI implementation here...@abose + const aiEntitlement = await KernalModeTrust.EntitlementsManager.getAIEntitlement(); + if (!aiEntitlement.activated) { + // Ai is not activated for user(not logged in/no ai plan/disabled by system admin) + // the showAIUpsellDialog will show an appropriate message for each case. + ProDialogs.showAIUpsellDialog(aiEntitlement); + return; + } + // todo @abose ai wire in + console.log(AIData); } /** From 57f35177543815105cda7ac09732e7943ac0f404 Mon Sep 17 00:00:00 2001 From: abose Date: Mon, 6 Oct 2025 21:16:51 +0530 Subject: [PATCH 2/2] fix: typo --- src/LiveDevelopment/LivePreviewEdit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/LiveDevelopment/LivePreviewEdit.js b/src/LiveDevelopment/LivePreviewEdit.js index 8ca9f2e4d5..7b71ef105b 100644 --- a/src/LiveDevelopment/LivePreviewEdit.js +++ b/src/LiveDevelopment/LivePreviewEdit.js @@ -36,7 +36,7 @@ define(function (require, exports, module) { const KernalModeTrust = window.KernalModeTrust; if(!KernalModeTrust){ // integrated extensions will have access to kernal mode, but not external extensions - throw new Error("profile menu should have access to KernalModeTrust. Cannot boot without trust ring"); + throw new Error("LivePreviewEdit.js should have access to KernalModeTrust. Cannot boot without trust ring"); } /**