mirror of
https://github.com/boxpositron/absolute-dotfiles.git
synced 2026-10-24 08:23:19 +00:00
chore(omo): vendor impeccable skill 4.6.0
Re-copy .opencode/skills/impeccable from upstream tag skill-v4.6.0 (8a0e198, engine 0.1.15), keep LICENSE, and re-apply the OmO path rewrite and the critique routing line. The documented rewrite missed the base-directory fallback in SKILL.md, which ends at scripts rather than scripts/impeccable, so the upgrade command now rewrites the scripts directory prefix. The skills README also notes that the engine binary is downloaded by scripts/VERSION rather than vendored.
This commit is contained in:
@@ -265,6 +265,7 @@
|
||||
let editBadgeEl = null;
|
||||
let editBadgeProxyRoot = null;
|
||||
let editBadgeProxyByTarget = new Map();
|
||||
let stopModalWatch = null;
|
||||
|
||||
//
|
||||
// Helpers
|
||||
@@ -291,10 +292,15 @@
|
||||
cssId,
|
||||
liveUiRoot,
|
||||
uiAppend,
|
||||
uiAppendToPage,
|
||||
topLayerHost,
|
||||
watchModalDialogs,
|
||||
cloneWithoutChrome,
|
||||
uiAppendStyle,
|
||||
uiGetById,
|
||||
activeElementDeep,
|
||||
defangOutsideHandlers,
|
||||
stopFocusOutIntoChrome,
|
||||
} = domHelpers;
|
||||
|
||||
window.__IMPECCABLE_LIVE_CHROME_CORE__ = {
|
||||
@@ -863,8 +869,15 @@
|
||||
setTimeout(() => input.focus(), 0);
|
||||
}
|
||||
|
||||
// The Enter that commits an IME candidate (Zhuyin, Pinyin, kana, Hangul) is
|
||||
// not a submit. Safari fires that keydown after compositionend, so
|
||||
// isComposing is already false there and keyCode 229 is the only signal.
|
||||
function isImeKeydown(e) {
|
||||
return e.isComposing || e.keyCode === 229;
|
||||
}
|
||||
|
||||
function onAnnotInputKey(e) {
|
||||
if (e.key === 'Enter') {
|
||||
if (e.key === 'Enter' && !isImeKeydown(e)) {
|
||||
e.preventDefault(); e.stopPropagation();
|
||||
finalizeEditingPin();
|
||||
} else if (e.key === 'Escape') {
|
||||
@@ -967,11 +980,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
function sanitizedContextOuterHTML(el, maxLength) {
|
||||
if (!el || !el.cloneNode) return '';
|
||||
const clone = el.cloneNode(true);
|
||||
// The element as the agent reads it, text and markup alike: no parked
|
||||
// chrome (a picked modal dialog contains it) and no edit runtime state.
|
||||
function sanitizedContextClone(el) {
|
||||
const clone = cloneWithoutChrome(el);
|
||||
stripManualEditRuntimeState(clone);
|
||||
return clone.outerHTML ? clone.outerHTML.slice(0, maxLength) : '';
|
||||
return clone;
|
||||
}
|
||||
|
||||
function extractContext(el) {
|
||||
@@ -1001,12 +1015,13 @@
|
||||
: (anchorClasses.length ? el.tagName.toLowerCase() + '.' + anchorClasses.join('.') : null);
|
||||
let anchorMatches = null;
|
||||
if (anchor) { try { anchorMatches = document.querySelectorAll(anchor).length; } catch { anchorMatches = null; } }
|
||||
const clone = sanitizedContextClone(el);
|
||||
return {
|
||||
tagName: el.tagName.toLowerCase(), id: el.id || null,
|
||||
classes: [...el.classList],
|
||||
anchor, anchorMatches,
|
||||
textContent: (el.textContent || '').slice(0, 500),
|
||||
outerHTML: sanitizedContextOuterHTML(el, 10000),
|
||||
textContent: (clone.textContent || '').slice(0, 500),
|
||||
outerHTML: (clone.outerHTML || '').slice(0, 10000),
|
||||
computedStyles: {
|
||||
'font-family': cs.fontFamily, 'font-size': cs.fontSize,
|
||||
'font-weight': cs.fontWeight, 'line-height': cs.lineHeight,
|
||||
@@ -2456,7 +2471,7 @@
|
||||
input.addEventListener('focus', () => syncConfigureInputChrome());
|
||||
input.addEventListener('blur', () => syncConfigureInputChrome());
|
||||
input.addEventListener('keydown', (e) => {
|
||||
if (e.key === 'Enter') { e.stopPropagation(); e.preventDefault(); handleGo(); return; }
|
||||
if (e.key === 'Enter' && !isImeKeydown(e)) { e.stopPropagation(); e.preventDefault(); handleGo(); return; }
|
||||
if (e.key === 'Escape') {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
@@ -2542,7 +2557,7 @@
|
||||
try { input.focus({ preventScroll: true }); } catch { input.focus(); }
|
||||
});
|
||||
input.addEventListener('keydown', (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
if (e.key === 'Enter' && !isImeKeydown(e)) {
|
||||
e.stopPropagation(); e.preventDefault();
|
||||
if (isInsertCreateEnabled()) handleInsertCreate();
|
||||
return;
|
||||
@@ -3710,6 +3725,7 @@
|
||||
|
||||
function copyEditLeafContext(el, originalText, newText) {
|
||||
if (!el) return null;
|
||||
const clone = sanitizedContextClone(el);
|
||||
return {
|
||||
ref: documentRefForElement(el),
|
||||
tagName: el.tagName ? el.tagName.toLowerCase() : null,
|
||||
@@ -3717,8 +3733,8 @@
|
||||
classes: el.classList ? [...el.classList].filter((cls) => cls.indexOf('impeccable-') !== 0) : [],
|
||||
originalText,
|
||||
newText,
|
||||
textContent: (el.textContent || '').slice(0, 500),
|
||||
outerHTML: sanitizedContextOuterHTML(el, 3000) || null,
|
||||
textContent: (clone.textContent || '').slice(0, 500),
|
||||
outerHTML: (clone.outerHTML || '').slice(0, 3000) || null,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -3744,13 +3760,14 @@
|
||||
|
||||
function copyEditContainerContext(el) {
|
||||
if (!el) return null;
|
||||
const clone = sanitizedContextClone(el);
|
||||
return {
|
||||
ref: documentRefForElement(el),
|
||||
tagName: el.tagName ? el.tagName.toLowerCase() : null,
|
||||
id: el.id || null,
|
||||
classes: el.classList ? [...el.classList].filter((cls) => cls.indexOf('impeccable-') !== 0) : [],
|
||||
textContent: (el.textContent || '').slice(0, 1000),
|
||||
outerHTML: sanitizedContextOuterHTML(el, 10000) || null,
|
||||
textContent: (clone.textContent || '').slice(0, 1000),
|
||||
outerHTML: (clone.outerHTML || '').slice(0, 10000) || null,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -4540,7 +4557,7 @@
|
||||
for (const [name, value] of Object.entries(styles)) {
|
||||
setImportantStyle(editBadgeProxyRoot, name.replace(/[A-Z]/g, (m) => '-' + m.toLowerCase()), value);
|
||||
}
|
||||
document.body.appendChild(editBadgeProxyRoot);
|
||||
uiAppendToPage(editBadgeProxyRoot);
|
||||
}
|
||||
|
||||
function styleEditBadgeProxy(proxy, target) {
|
||||
@@ -8032,8 +8049,8 @@
|
||||
let depth = 0;
|
||||
while (node && depth < 12) {
|
||||
// 1. Active dialog / modal
|
||||
if (node.getAttribute && node.getAttribute('role') === 'dialog'
|
||||
&& node.getAttribute('aria-modal') === 'true') {
|
||||
if (node.tagName === 'DIALOG' || (node.getAttribute && node.getAttribute('role') === 'dialog'
|
||||
&& node.getAttribute('aria-modal') === 'true')) {
|
||||
showToast('Heads up: this element lives inside a dialog. If state resets during generation, you may need to re-open it.', 6000);
|
||||
return;
|
||||
}
|
||||
@@ -8645,6 +8662,7 @@
|
||||
const opts = {
|
||||
scale: Math.min(window.devicePixelRatio || 1, 2),
|
||||
font: fontCssText ? { cssText: fontCssText } : undefined,
|
||||
filter: (node) => node !== topLayerHost,
|
||||
};
|
||||
if (shouldUseAncestorCropShaderProxy(el)) {
|
||||
try {
|
||||
@@ -11431,7 +11449,7 @@ void main() {
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (e.key === 'Enter') {
|
||||
if (e.key === 'Enter' && !isImeKeydown(e)) {
|
||||
e.preventDefault();
|
||||
submitSteerMessage();
|
||||
}
|
||||
@@ -12249,6 +12267,7 @@ void main() {
|
||||
pagePickSkipClick = false;
|
||||
cleanup();
|
||||
hideBar();
|
||||
if (stopModalWatch) { stopModalWatch(); stopModalWatch = null; }
|
||||
if (pendingDockResizeObserver) { pendingDockResizeObserver.disconnect(); pendingDockResizeObserver = null; }
|
||||
window.removeEventListener('resize', positionPendingDock);
|
||||
if (pendingIntroAnimation) { pendingIntroAnimation.cancel(); pendingIntroAnimation = null; }
|
||||
@@ -12286,6 +12305,7 @@ void main() {
|
||||
document.removeEventListener('mousemove', handleMouseMove, true);
|
||||
document.removeEventListener('click', handleClick, true);
|
||||
document.removeEventListener('keydown', handleKeyDown, true);
|
||||
document.removeEventListener('focusout', stopFocusOutIntoChrome, true);
|
||||
window.removeEventListener('message', onDetectMessage);
|
||||
// Remove detection overlays
|
||||
window.postMessage({ source: 'impeccable-command', action: 'remove' }, '*');
|
||||
@@ -13466,10 +13486,12 @@ void main() {
|
||||
attachSteerFocusDebug();
|
||||
attachSteerFocusGuard();
|
||||
initDesignPanel();
|
||||
stopModalWatch = watchModalDialogs();
|
||||
fetchPendingCount();
|
||||
document.addEventListener('mousemove', handleMouseMove, true);
|
||||
document.addEventListener('click', handleClick, true);
|
||||
document.addEventListener('keydown', handleKeyDown, true);
|
||||
document.addEventListener('focusout', stopFocusOutIntoChrome, true);
|
||||
connectSSE();
|
||||
|
||||
// Check for an active session to resume (variant wrapper already in DOM after HMR)
|
||||
|
||||
Reference in New Issue
Block a user