Ship Assistent 0.11.3: variants grid, EN Krea prep, and stream fence fix.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -16,6 +16,7 @@ window.SA = window.SA || {};
|
||||
'clear_prompt_images', 'slot_to_prompt_image', 'pack',
|
||||
'memories', 'memory_query', 'memory_kind', 'tag_query', 'user_prefs',
|
||||
'controls', 'persona_clone', 'persona_shelves', 'persona', 'notes',
|
||||
'variants',
|
||||
];
|
||||
|
||||
const FENCE_RE = /```(?:json)?\s*([\s\S]*?)```/gi;
|
||||
@@ -92,10 +93,53 @@ window.SA = window.SA || {};
|
||||
return { prose, patch: lastPatch };
|
||||
}
|
||||
|
||||
/**
|
||||
* Closed fence worth freezing the stream / stopping Ollama early.
|
||||
* Weak fences (pack / creativity / empty) must NOT stop — model often continues with the real patch.
|
||||
*/
|
||||
function isTerminalStreamPatch(obj) {
|
||||
if (!obj || typeof obj !== 'object') {
|
||||
return false;
|
||||
}
|
||||
if (isCardObject(obj)) {
|
||||
return true;
|
||||
}
|
||||
if (Array.isArray(obj.variants) && obj.variants.length) {
|
||||
return true;
|
||||
}
|
||||
if (obj.look_at != null || obj.vision_from != null || obj.vision_slots != null) {
|
||||
return true;
|
||||
}
|
||||
if (obj.search_query != null || obj.civitai_query != null
|
||||
|| obj.memory_query != null || obj.tag_query != null || obj.inventory_query != null) {
|
||||
return true;
|
||||
}
|
||||
const acts = Array.isArray(obj.actions) ? obj.actions.map(String) : [];
|
||||
const hopOrGen = [
|
||||
'skill_load', 'persona_read', 'memory_get', 'memory_search', 'lookup_tags',
|
||||
'list_inventory', 'search_civitai', 'interrupt', 'generate',
|
||||
'memory_upsert', 'user_pref_upsert',
|
||||
];
|
||||
if (acts.some((a) => hopOrGen.includes(a))) {
|
||||
return true;
|
||||
}
|
||||
if (String(obj.prompt || '').trim().length >= 48) {
|
||||
return true;
|
||||
}
|
||||
if (obj.loras != null || obj.aspect != null || obj.steps != null
|
||||
|| obj.width != null || obj.height != null || obj.cfg != null
|
||||
|| obj.seed != null || obj.controls != null
|
||||
|| obj.memories != null || obj.user_prefs != null) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
SA.PATCH_KEYS = PATCH_KEYS;
|
||||
SA.isCardObject = isCardObject;
|
||||
SA.isPatchObject = isPatchObject;
|
||||
SA.isTerminalStreamPatch = isTerminalStreamPatch;
|
||||
SA.normalizePatch = normalizePatch;
|
||||
SA.extractPatch = extractPatch;
|
||||
})();
|
||||
␍
|
||||
|
||||
|
||||
Reference in New Issue
Block a user