Auto-generate on clear create-photo user requests (0.15.16).
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -22,11 +22,26 @@
|
||||
if (!t || userAsksNoGenerate(t)) {
|
||||
return false;
|
||||
}
|
||||
if (/^как\s+(сгенерир|нарисов|сделать\s+(фото|кадр|изображ))/i.test(t)) {
|
||||
return false;
|
||||
}
|
||||
if (/\bhow\s+to\s+(generate|draw|make|create)\b/i.test(t)) {
|
||||
return false;
|
||||
}
|
||||
if (/\b(generat(e|ion)|draw|render|make\s+(an?\s+)?image|run\s+generate)\b/i.test(t)) {
|
||||
return true;
|
||||
}
|
||||
if (/\b(create|make)\s+(a\s+)?(photo|picture|image|shot|portrait)\b/i.test(t)) {
|
||||
return true;
|
||||
}
|
||||
if (/\blet['']?s\s+(make|create|generate|draw)\s+(an?\s+)?(image|photo|picture|shot)\b/i.test(t)) {
|
||||
return true;
|
||||
}
|
||||
if (/\bi\s+want\s+(an?\s+)?(image|photo|picture|shot)\b/i.test(t)) {
|
||||
return true;
|
||||
}
|
||||
return cyrTokenRe(
|
||||
"\u0441\u0433\u0435\u043D\u0435\u0440[\u0430-\u044F\u0451]*|\u043D\u0430\u0440\u0438\u0441\u0443\u0439|\u043D\u0430\u0440\u0438\u0441\u0443\u0439\u0442\u0435|\u043D\u0430\u0440\u0438\u0441\u0443\u0435\u043C|\u0437\u0430\u043F\u0443\u0441\u0442\u0438\\s+\u0433\u0435\u043D\u0435\u0440[\u0430-\u044F\u0451]*|\u0441\u0434\u0435\u043B\u0430(\u0439|\u0435\u043C|\u0439\u0442\u0435)\\s+(\u043A\u0430\u0434\u0440|\u043A\u0430\u0440\u0442\u0438\u043D\u043A[\u0430-\u044F\u0451]*|\u0438\u0437\u043E\u0431\u0440\u0430\u0436[\u0430-\u044F\u0451]*)"
|
||||
"\u0441\u0433\u0435\u043D\u0435\u0440[\u0430-\u044F\u0451]*|\u043D\u0430\u0440\u0438\u0441\u0443\u0439|\u043D\u0430\u0440\u0438\u0441\u0443\u0439\u0442\u0435|\u043D\u0430\u0440\u0438\u0441\u0443\u0435\u043C|\u0437\u0430\u043F\u0443\u0441\u0442\u0438\\s+\u0433\u0435\u043D\u0435\u0440[\u0430-\u044F\u0451]*|\u0441\u043E\u0437\u0434\u0430(\u0439|\u0439\u0442\u0435|\u0434\u0438\u043C|\u0434\u0438\u0442\u0435)\\s+(\u0444\u043E\u0442\u043E|\u0444\u043E\u0442\u043E\u0433\u0440\u0430\u0444[\u0430-\u044F\u0451]*|\u043A\u0430\u0440\u0442\u0438\u043D\u043A[\u0430-\u044F\u0451]*|\u0438\u0437\u043E\u0431\u0440\u0430\u0436[\u0430-\u044F\u0451]*|\u043A\u0430\u0434\u0440|\u043F\u043E\u0440\u0442\u0440\u0435\u0442|\u0441\u043D\u0438\u043C\u043E\u043A)|\u0441\u0434\u0435\u043B\u0430(\u0439|\u0439\u0442\u0435|\u0435\u043C|\u0439\u0442\u0435)\\s+(\u0444\u043E\u0442\u043E|\u0444\u043E\u0442\u043E\u0433\u0440\u0430\u0444[\u0430-\u044F\u0451]*|\u043A\u0430\u0434\u0440|\u043A\u0430\u0440\u0442\u0438\u043D\u043A[\u0430-\u044F\u0451]*|\u0438\u0437\u043E\u0431\u0440\u0430\u0436[\u0430-\u044F\u0451]*|\u043F\u043E\u0440\u0442\u0440\u0435\u0442|\u0441\u043D\u0438\u043C\u043E\u043A)|\u0434\u0430\u0432\u0430\u0439\\s+(\u0444\u043E\u0442\u043E|\u0444\u043E\u0442\u043E\u0433\u0440\u0430\u0444[\u0430-\u044F\u0451]*|\u043A\u0430\u0440\u0442\u0438\u043D\u043A[\u0430-\u044F\u0451]*|\u0438\u0437\u043E\u0431\u0440\u0430\u0436[\u0430-\u044F\u0451]*|\u043A\u0430\u0434\u0440|\u0441\u0433\u0435\u043D\u0435\u0440[\u0430-\u044F\u0451]*|\u043D\u0430\u0440\u0438\u0441\u0443[\u0430-\u044F\u0451]*)|\u0434\u0430\u0432\u0430\u0439\\s+\u0441\u0434\u0435\u043B\u0430\u0435\u043C\\s+(\u0444\u043E\u0442\u043E|\u0444\u043E\u0442\u043E\u0433\u0440\u0430\u0444[\u0430-\u044F\u0451]*|\u043A\u0430\u0440\u0442\u0438\u043D\u043A[\u0430-\u044F\u0451]*|\u0438\u0437\u043E\u0431\u0440\u0430\u0436[\u0430-\u044F\u0451]*|\u043A\u0430\u0434\u0440)|\u0445\u043E\u0447\u0443\\s+(\u0444\u043E\u0442\u043E|\u0444\u043E\u0442\u043E\u0433\u0440\u0430\u0444[\u0430-\u044F\u0451]*|\u043A\u0430\u0440\u0442\u0438\u043D\u043A[\u0430-\u044F\u0451]*|\u0438\u0437\u043E\u0431\u0440\u0430\u0436[\u0430-\u044F\u0451]*|\u043A\u0430\u0434\u0440)|\u043D\u0443\u0436\u043D[\u0430\u043E]?\\s+(\u0444\u043E\u0442\u043E|\u0444\u043E\u0442\u043E\u0433\u0440\u0430\u0444[\u0430-\u044F\u0451]*|\u043A\u0430\u0440\u0442\u0438\u043D\u043A[\u0430-\u044F\u0451]*|\u0438\u0437\u043E\u0431\u0440\u0430\u0436[\u0430-\u044F\u0451]*|\u043A\u0430\u0434\u0440)|\u0441\u0444\u043E\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u0440\u0443\u0439|\u043E\u0442\u0440\u0438\u0441\u0443\u0439|\u043F\u0440\u0438\u0434\u0443\u043C\u0430\u0439\\s+(\u0444\u043E\u0442\u043E|\u043A\u0430\u0434\u0440|\u043A\u0430\u0440\u0442\u0438\u043D\u043A[\u0430-\u044F\u0451]*|\u0441\u0446\u0435\u043D\u0443|\u0438\u0437\u043E\u0431\u0440\u0430\u0436[\u0430-\u044F\u0451]*)|\u0441\u0433\u0435\u043D\u0435\u0440\u0438(\u0440\u0443\u0439|\u0440\u0443\u0439\u0442\u0435)\\s+(\u043C\u043D\u0435\\s+)?(\u0444\u043E\u0442\u043E|\u043A\u0430\u0434\u0440|\u043A\u0430\u0440\u0442\u0438\u043D\u043A[\u0430-\u044F\u0451]*|\u0438\u0437\u043E\u0431\u0440\u0430\u0436[\u0430-\u044F\u0451]*)"
|
||||
).test(t);
|
||||
}
|
||||
function generateFlagOn(patch) {
|
||||
@@ -46,7 +61,7 @@
|
||||
const vetoed = !opts.machineTurn && userAsksNoGenerate(userText);
|
||||
const modelAsked = generateFlagOn(patch);
|
||||
const hasPrompt = !!(String(patch?.prompt || "").trim() || String(opts.sessionPrompt || "").trim());
|
||||
const userAsked = !opts.machineTurn && userAsksGenerate(userText) && (modelAsked || hasPrompt);
|
||||
const userAsked = !opts.machineTurn && userAsksGenerate(userText);
|
||||
const generate = !vetoed && !opts.fromAutoCritique && (userAsked || !!opts.userWantsGenerate);
|
||||
const hasLook = !!patch && (patch.look_at != null || patch.vision_from != null || patch.vision_slots != null);
|
||||
const look = !!(hasLook && !vetoed && !generate);
|
||||
@@ -774,8 +789,7 @@
|
||||
const delta = normalizeDelta(patch) || {};
|
||||
const vetoed = typeof vetoFn === "function" ? !!vetoFn(userText) : false;
|
||||
const modelAsked = patchWantsGenerate(delta);
|
||||
const hasPrompt = !!(String(delta.prompt || "").trim() || String(sessionPrompt || "").trim());
|
||||
const userAsked = typeof askGenerateFn === "function" && !!askGenerateFn(userText) && (modelAsked || hasPrompt);
|
||||
const userAsked = typeof askGenerateFn === "function" && !!askGenerateFn(userText);
|
||||
const generate = !vetoed && !fromAutoCritique && (userAsked || !!userWantsGenerate);
|
||||
const hasLook = delta.look_at != null || delta.vision_from != null || delta.vision_slots != null;
|
||||
const look = !!(hasLook && !generate && !vetoed);
|
||||
@@ -2468,8 +2482,7 @@ ${patch.prompt}`;
|
||||
}
|
||||
const vetoed = !isMachineTurn(opts) && userAsksNoGenerate2(userText);
|
||||
const modelAsked = !!(patch && (patch.generate === true || patch.generate === 1 || typeof patch.generate === "string" && /^(true|1|yes|on)$/i.test(patch.generate) || Array.isArray(patch.actions) && patch.actions.map(String).includes("generate")));
|
||||
const hasPrompt = !!(String(patch?.prompt || "").trim() || String(opts.sessionPrompt || "").trim());
|
||||
const userAsked = !isMachineTurn(opts) && userAsksGenerate2(userText) && (modelAsked || hasPrompt);
|
||||
const userAsked = !isMachineTurn(opts) && userAsksGenerate2(userText);
|
||||
const generate = !vetoed && !opts.fromAutoCritique && (userAsked || !!opts.userWantsGenerate);
|
||||
const hasLook = !!patch && (patch.look_at != null || patch.vision_from != null || patch.vision_slots != null);
|
||||
const look = !!(hasLook && !vetoed && !generate);
|
||||
|
||||
Reference in New Issue
Block a user