Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions src/LiveDevelopment/LivePreviewEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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("LivePreviewEdit.js should have access to KernalModeTrust. Cannot boot without trust ring");
}

/**
* This function syncs text content changes between the original source code
Expand Down Expand Up @@ -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);
}

/**
Expand Down
Loading