feat: integrate AIAssist for script editing (#8220)

This commit is contained in:
naman-bruno
2026-06-10 16:33:44 +05:30
committed by GitHub
parent ed5f5c21cf
commit 6791e0a674
11 changed files with 989 additions and 125 deletions

View File

@@ -24,6 +24,23 @@ export const testAiProvider = ({ providerId }) =>
export const aiGenerateText = (params) =>
callIpc('renderer:ai-generate-text', params);
export const aiGenerateScript = (params) =>
callIpc('renderer:ai-generate-script', params);
export const buildRequestContextFromItem = (item) => {
if (!item) return null;
const req = item.draft ? item.draft.request : item.request;
if (!req) return null;
return {
url: req.url || '',
method: req.method || 'GET',
headers: Array.isArray(req.headers) ? req.headers : [],
params: Array.isArray(req.params) ? req.params : [],
body: req.body || null
};
};
/**
* Start a streaming generation. Subscribes to the corresponding `main:ai-stream-*`
* channels filtered by streamId. Returns a handle with `.stop()` and a promise