@integrity-labs/agt-cli 0.28.149 → 0.28.151
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/agt.js +4 -4
- package/dist/{chunk-SVF454L3.js → chunk-HYW5ZAGY.js} +2 -3
- package/dist/{chunk-5AIF4FOP.js → chunk-SKANUWSB.js} +247 -5
- package/dist/chunk-SKANUWSB.js.map +1 -0
- package/dist/{chunk-A4S52T2C.js → chunk-SZX4F3O5.js} +55 -11
- package/dist/chunk-SZX4F3O5.js.map +1 -0
- package/dist/{claude-pair-runtime-OU4ROYH4.js → claude-pair-runtime-ZSBUAMO3.js} +2 -2
- package/dist/lib/manager-worker.js +101 -281
- package/dist/lib/manager-worker.js.map +1 -1
- package/dist/mcp/remote-oauth-proxy.js +168 -0
- package/dist/{persistent-session-IMMJEVRD.js → persistent-session-S2674LBO.js} +3 -3
- package/dist/{responsiveness-probe-Z2GD24QE.js → responsiveness-probe-NHQYDMHJ.js} +3 -3
- package/package.json +2 -2
- package/dist/chunk-5AIF4FOP.js.map +0 -1
- package/dist/chunk-A4S52T2C.js.map +0 -1
- /package/dist/{chunk-SVF454L3.js.map → chunk-HYW5ZAGY.js.map} +0 -0
- /package/dist/{claude-pair-runtime-OU4ROYH4.js.map → claude-pair-runtime-ZSBUAMO3.js.map} +0 -0
- /package/dist/{persistent-session-IMMJEVRD.js.map → persistent-session-S2674LBO.js.map} +0 -0
- /package/dist/{responsiveness-probe-Z2GD24QE.js.map → responsiveness-probe-NHQYDMHJ.js.map} +0 -0
package/dist/bin/agt.js
CHANGED
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
success,
|
|
38
38
|
table,
|
|
39
39
|
warn
|
|
40
|
-
} from "../chunk-
|
|
40
|
+
} from "../chunk-SZX4F3O5.js";
|
|
41
41
|
import {
|
|
42
42
|
CHANNEL_REGISTRY,
|
|
43
43
|
DEPLOYMENT_TEMPLATES,
|
|
@@ -64,7 +64,7 @@ import {
|
|
|
64
64
|
renderTemplate,
|
|
65
65
|
resolveChannels,
|
|
66
66
|
serializeManifestForSlackCli
|
|
67
|
-
} from "../chunk-
|
|
67
|
+
} from "../chunk-SKANUWSB.js";
|
|
68
68
|
|
|
69
69
|
// src/bin/agt.ts
|
|
70
70
|
import { join as join22 } from "path";
|
|
@@ -4777,7 +4777,7 @@ import { execFileSync, execSync } from "child_process";
|
|
|
4777
4777
|
import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
|
|
4778
4778
|
import chalk18 from "chalk";
|
|
4779
4779
|
import ora16 from "ora";
|
|
4780
|
-
var cliVersion = true ? "0.28.
|
|
4780
|
+
var cliVersion = true ? "0.28.151" : "dev";
|
|
4781
4781
|
async function fetchLatestVersion() {
|
|
4782
4782
|
const host2 = getHost();
|
|
4783
4783
|
if (!host2) return null;
|
|
@@ -5791,7 +5791,7 @@ function handleError(err) {
|
|
|
5791
5791
|
}
|
|
5792
5792
|
|
|
5793
5793
|
// src/bin/agt.ts
|
|
5794
|
-
var cliVersion2 = true ? "0.28.
|
|
5794
|
+
var cliVersion2 = true ? "0.28.151" : "dev";
|
|
5795
5795
|
var program = new Command();
|
|
5796
5796
|
program.name("agt").description("Augmented CLI \u2014 agent provisioning and management").version(cliVersion2).option("--json", "Emit machine-readable JSON output (suppress spinners and colors)").option("--skip-update-check", "Skip the automatic update check on startup");
|
|
5797
5797
|
program.hook("preAction", async (thisCommand, actionCommand) => {
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
formatMissingVar,
|
|
4
4
|
isClaudeFastMode,
|
|
5
5
|
probeMcpEnvSubstitution
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-SKANUWSB.js";
|
|
7
7
|
import {
|
|
8
8
|
reapOrphanChannelMcps
|
|
9
9
|
} from "./chunk-XWVM4KPK.js";
|
|
@@ -1543,7 +1543,6 @@ function getProjectDir(codeName) {
|
|
|
1543
1543
|
}
|
|
1544
1544
|
|
|
1545
1545
|
export {
|
|
1546
|
-
sanitizeMcpJson,
|
|
1547
1546
|
buildAllowedTools,
|
|
1548
1547
|
sessionTranscriptDir,
|
|
1549
1548
|
transcriptActivityAgeSeconds,
|
|
@@ -1590,4 +1589,4 @@ export {
|
|
|
1590
1589
|
stopAllSessionsAndWait,
|
|
1591
1590
|
getProjectDir
|
|
1592
1591
|
};
|
|
1593
|
-
//# sourceMappingURL=chunk-
|
|
1592
|
+
//# sourceMappingURL=chunk-HYW5ZAGY.js.map
|
|
@@ -3799,6 +3799,7 @@ var compiledMetaSchema = ajv2.compile(context_meta_schema_default);
|
|
|
3799
3799
|
|
|
3800
3800
|
// ../../packages/core/dist/integrations/augmented-live/markup.js
|
|
3801
3801
|
var MARKUP_MARKER = "__augmentedLiveMarkup";
|
|
3802
|
+
var MARKUP_CONTROL_MARKER = "__augmentedLiveMarkupControl";
|
|
3802
3803
|
var MARKUP_BRIDGE_SCRIPT = `<script>(function(){
|
|
3803
3804
|
function post(m){ try { parent.postMessage(Object.assign({${MARKUP_MARKER}:true}, m), '*'); } catch(e){} }
|
|
3804
3805
|
// Nearest ancestor carrying a stable anchor, as a CSS selector. Prefer
|
|
@@ -3806,10 +3807,9 @@ var MARKUP_BRIDGE_SCRIPT = `<script>(function(){
|
|
|
3806
3807
|
// Values are run through CSS.escape so a value with quotes/colons/brackets
|
|
3807
3808
|
// can't produce a broken or injected selector.
|
|
3808
3809
|
function esc(v){ try { return (self.CSS && self.CSS.escape) ? self.CSS.escape(v) : v; } catch(e){ return v; } }
|
|
3809
|
-
|
|
3810
|
+
// Nearest anchored ancestor of an element, as a CSS selector ('' if none).
|
|
3811
|
+
function anchorOf(el){
|
|
3810
3812
|
try {
|
|
3811
|
-
var node = range.commonAncestorContainer;
|
|
3812
|
-
var el = (node && node.nodeType === 1) ? node : (node ? node.parentElement : null);
|
|
3813
3813
|
var hit = (el && el.closest) ? el.closest('[data-al-id],[id]') : null;
|
|
3814
3814
|
if(!hit) return '';
|
|
3815
3815
|
var dal = hit.getAttribute('data-al-id');
|
|
@@ -3817,7 +3817,218 @@ var MARKUP_BRIDGE_SCRIPT = `<script>(function(){
|
|
|
3817
3817
|
return hit.id ? ('#' + esc(hit.id)) : '';
|
|
3818
3818
|
} catch(e){ return ''; }
|
|
3819
3819
|
}
|
|
3820
|
+
function anchorFor(range){
|
|
3821
|
+
try {
|
|
3822
|
+
var node = range.commonAncestorContainer;
|
|
3823
|
+
var el = (node && node.nodeType === 1) ? node : (node ? node.parentElement : null);
|
|
3824
|
+
return anchorOf(el);
|
|
3825
|
+
} catch(e){ return ''; }
|
|
3826
|
+
}
|
|
3827
|
+
// Human-readable reference to a right-clicked element, kept to one line so it
|
|
3828
|
+
// reads cleanly as the quoted context in the comment prompt. Names images by
|
|
3829
|
+
// alt/filename, background-image elements by filename, otherwise tag + a short
|
|
3830
|
+
// text snippet so the agent knows exactly what was clicked (ENG-6847).
|
|
3831
|
+
function basename(u){ try { return (u||'').split('?')[0].split('#')[0].split('/').pop() || (u||''); } catch(e){ return u||''; } }
|
|
3832
|
+
function describeEl(el){
|
|
3833
|
+
try {
|
|
3834
|
+
var tag=(el.tagName||'').toLowerCase();
|
|
3835
|
+
if(tag==='img'){
|
|
3836
|
+
var alt=(el.getAttribute('alt')||'').trim();
|
|
3837
|
+
if(alt) return 'image: ' + alt;
|
|
3838
|
+
var src=el.getAttribute('src')||el.currentSrc||'';
|
|
3839
|
+
var n=basename(src);
|
|
3840
|
+
return n ? ('image (' + n + ')') : 'image';
|
|
3841
|
+
}
|
|
3842
|
+
var bg='';
|
|
3843
|
+
try { bg=(self.getComputedStyle ? self.getComputedStyle(el).backgroundImage : '') || ''; } catch(e){}
|
|
3844
|
+
if(bg && bg.indexOf('url(')!==-1){
|
|
3845
|
+
var m=bg.match(/url\\(\\s*["']?([^"')]+)["']?\\s*\\)/);
|
|
3846
|
+
var bn=(m && m[1]) ? basename(m[1]) : '';
|
|
3847
|
+
return bn ? ('background image (' + bn + ')') : 'background image';
|
|
3848
|
+
}
|
|
3849
|
+
var txt=(el.textContent||'').replace(/\\s+/g,' ').trim();
|
|
3850
|
+
if(tag==='svg' || (!txt && el.querySelector && el.querySelector('svg'))) return 'icon (<' + (tag||'svg') + '>)';
|
|
3851
|
+
if(txt) return '<' + (tag||'element') + '> ' + (txt.length>60 ? txt.slice(0,57)+'\u2026' : txt);
|
|
3852
|
+
return '<' + (tag||'element') + '> element';
|
|
3853
|
+
} catch(e){ return 'element'; }
|
|
3854
|
+
}
|
|
3855
|
+
|
|
3856
|
+
// ===== ENG-6821: inline click-to-edit =====
|
|
3857
|
+
var editEnabled = false; // armed only after the shell confirms the viewer may edit
|
|
3858
|
+
var commentEnabled = false; // armed when the viewer may comment (ENG-6847 right-click)
|
|
3859
|
+
var editing = null; // the element currently in edit mode
|
|
3860
|
+
var bar = null; // the Save/Cancel toolbar
|
|
3861
|
+
|
|
3862
|
+
// Element-child indices from <body> down to el. Counts ELEMENT children only
|
|
3863
|
+
// (children, not childNodes), matching how the server walks source_html; our
|
|
3864
|
+
// injected style/script sit at the end of <body>, so the authored content's
|
|
3865
|
+
// elements keep their indices.
|
|
3866
|
+
function pathTo(el){
|
|
3867
|
+
var path=[], n=el;
|
|
3868
|
+
while(n && n!==document.body && n.parentElement){
|
|
3869
|
+
path.unshift(Array.prototype.indexOf.call(n.parentElement.children, n));
|
|
3870
|
+
n=n.parentElement;
|
|
3871
|
+
}
|
|
3872
|
+
return path;
|
|
3873
|
+
}
|
|
3874
|
+
// Only LEAF text elements are editable. An element with element children is a
|
|
3875
|
+
// container - editing it would send the container's path + a flattened
|
|
3876
|
+
// textContent, replacing the whole subtree and destroying nested markup. Saving
|
|
3877
|
+
// is text-of-one-leaf only, preserving byte-fidelity everywhere else.
|
|
3878
|
+
function editable(el){
|
|
3879
|
+
if(!el || el.nodeType!==1) return false;
|
|
3880
|
+
if(el===document.body || el===document.documentElement) return false;
|
|
3881
|
+
if(el.children && el.children.length>0) return false;
|
|
3882
|
+
var tag=el.tagName;
|
|
3883
|
+
if(tag==='SCRIPT'||tag==='STYLE'||tag==='A'||tag==='BUTTON'||tag==='INPUT'||tag==='TEXTAREA'||tag==='IMG') return false;
|
|
3884
|
+
if(el.closest && el.closest('[data-al-noedit]')) return false;
|
|
3885
|
+
return ((el.textContent||'').trim().length>0);
|
|
3886
|
+
}
|
|
3887
|
+
function removeBar(){ if(bar){ try{bar.remove();}catch(e){} bar=null; } }
|
|
3888
|
+
// ENG-6856: inline-formatting tags whose presence inside a container still lets
|
|
3889
|
+
// us edit that container's bare text nodes per-node - the nested markup survives
|
|
3890
|
+
// because we replace only the targeted TEXT node, never the whole subtree.
|
|
3891
|
+
var INLINE_OK={SPAN:1,STRONG:1,EM:1,B:1,I:1,U:1,SMALL:1,MARK:1,SUB:1,SUP:1,CODE:1,BR:1,ABBR:1,WBR:1,Q:1,CITE:1,TIME:1};
|
|
3892
|
+
// A container is per-text-node editable when EVERY element child is an inline
|
|
3893
|
+
// formatting tag (so it is not a leaf, but has no block / link / control child
|
|
3894
|
+
// an in-place text edit could strand). <a> is deliberately absent from INLINE_OK:
|
|
3895
|
+
// a link child blocks editing so an edit can never clobber an href.
|
|
3896
|
+
function inlineOnlyEditable(el){
|
|
3897
|
+
if(!el || el.nodeType!==1) return false;
|
|
3898
|
+
if(el===document.body || el===document.documentElement) return false;
|
|
3899
|
+
var tag=el.tagName;
|
|
3900
|
+
if(tag==='SCRIPT'||tag==='STYLE'||tag==='A'||tag==='BUTTON'||tag==='INPUT'||tag==='TEXTAREA'||tag==='IMG') return false;
|
|
3901
|
+
if(el.closest && el.closest('[data-al-noedit]')) return false;
|
|
3902
|
+
var kids=el.children; if(!kids || kids.length===0) return false; // leaves use editable()
|
|
3903
|
+
for(var i=0;i<kids.length;i++){ if(!INLINE_OK[kids[i].tagName]) return false; }
|
|
3904
|
+
return ((el.textContent||'').trim().length>0);
|
|
3905
|
+
}
|
|
3906
|
+
// The text node under the pointer, so a click on bare text inside an inline-only
|
|
3907
|
+
// container targets exactly that run (not its inline siblings).
|
|
3908
|
+
function textNodeAtPoint(x,y){
|
|
3909
|
+
try{
|
|
3910
|
+
if(document.caretRangeFromPoint){ var r=document.caretRangeFromPoint(x,y); return (r && r.startContainer && r.startContainer.nodeType===3) ? r.startContainer : null; }
|
|
3911
|
+
if(document.caretPositionFromPoint){ var p=document.caretPositionFromPoint(x,y); return (p && p.offsetNode && p.offsetNode.nodeType===3) ? p.offsetNode : null; }
|
|
3912
|
+
return null;
|
|
3913
|
+
}catch(e){ return null; }
|
|
3914
|
+
}
|
|
3915
|
+
// Index of a text node among its parent's child TEXT nodes, in order - the same
|
|
3916
|
+
// counting the server uses to re-locate it in source_html (ENG-6856).
|
|
3917
|
+
function textIndexOf(container, tn){
|
|
3918
|
+
var i=-1, ns=container.childNodes;
|
|
3919
|
+
for(var k=0;k<ns.length;k++){ if(ns[k].nodeType===3){ i++; if(ns[k]===tn) return i; } }
|
|
3920
|
+
return -1;
|
|
3921
|
+
}
|
|
3922
|
+
function placeCaretEnd(el){ try{ var r=document.createRange(); r.selectNodeContents(el); r.collapse(false); var s=document.getSelection(); s.removeAllRanges(); s.addRange(r); }catch(e){} }
|
|
3923
|
+
// The Save/Cancel toolbar anchored above el. Shared by whole-element edits
|
|
3924
|
+
// (startEdit) and per-text-node edits (startEditTextNode).
|
|
3925
|
+
function showBar(el){
|
|
3926
|
+
bar=document.createElement('div');
|
|
3927
|
+
bar.setAttribute('data-al-noedit','1');
|
|
3928
|
+
bar.style.cssText='position:fixed;z-index:2147483647;display:flex;gap:6px;font:600 13px system-ui,-apple-system,sans-serif';
|
|
3929
|
+
var r=el.getBoundingClientRect();
|
|
3930
|
+
bar.style.top=Math.max(8,r.top-40)+'px'; bar.style.left=Math.max(8,r.left)+'px';
|
|
3931
|
+
function mk(label,bg,fn){ var b=document.createElement('button'); b.type='button'; b.textContent=label;
|
|
3932
|
+
b.style.cssText='border:0;border-radius:6px;padding:6px 12px;cursor:pointer;color:#fff;box-shadow:0 2px 8px rgba(0,0,0,.3);background:'+bg;
|
|
3933
|
+
b.addEventListener('mousedown', function(e){ e.preventDefault(); }); // keep focus/text
|
|
3934
|
+
b.addEventListener('click', function(e){ e.preventDefault(); fn(); }); return b; }
|
|
3935
|
+
bar.appendChild(mk('Save','#0b7a4b',function(){ endEdit(true); }));
|
|
3936
|
+
bar.appendChild(mk('Cancel','#475569',function(){ endEdit(false); }));
|
|
3937
|
+
document.body.appendChild(bar);
|
|
3938
|
+
}
|
|
3939
|
+
function endEdit(save){
|
|
3940
|
+
if(!editing) return;
|
|
3941
|
+
var el=editing; editing=null;
|
|
3942
|
+
removeBar();
|
|
3943
|
+
// Compare on normalized text (matches the server's whitespace-tolerant guard),
|
|
3944
|
+
// but send the RAW edit so intentional spacing survives and clearing a block
|
|
3945
|
+
// (newText '') is a real delete. The server re-scans before publishing.
|
|
3946
|
+
var rawNewText=el.textContent||'';
|
|
3947
|
+
var normNewText=rawNewText.replace(/\\s+/g,' ').trim();
|
|
3948
|
+
if(el.__alTextIndex!==undefined){
|
|
3949
|
+
// ENG-6856 per-text-node edit: el is our temporary editable wrapper span.
|
|
3950
|
+
// Unwrap back to a plain text node either way (a successful save's republish
|
|
3951
|
+
// hot-swap reloads the canonical version); on save also post the text-node
|
|
3952
|
+
// edit, carrying textIndex so the server replaces only that run in place.
|
|
3953
|
+
try{ el.parentNode.replaceChild(document.createTextNode(save?rawNewText:el.__alOldRaw), el); }catch(e){}
|
|
3954
|
+
if(save && normNewText!==el.__alOld){
|
|
3955
|
+
post({type:'edit', path:el.__alPath, textIndex:el.__alTextIndex, oldText:el.__alOld, newText:rawNewText});
|
|
3956
|
+
}
|
|
3957
|
+
return;
|
|
3958
|
+
}
|
|
3959
|
+
// Legacy whole-leaf-element edit.
|
|
3960
|
+
try{ el.removeAttribute('contenteditable'); el.style.outline=el.__alOut||''; }catch(e){}
|
|
3961
|
+
if(save && normNewText!==el.__alOld){
|
|
3962
|
+
post({type:'edit', path:el.__alPath, oldText:el.__alOld, newText:rawNewText});
|
|
3963
|
+
} else if(!save){
|
|
3964
|
+
try{ el.textContent=el.__alOldRaw; }catch(e){}
|
|
3965
|
+
}
|
|
3966
|
+
}
|
|
3967
|
+
function startEdit(el){
|
|
3968
|
+
if(editing) endEdit(false);
|
|
3969
|
+
editing=el;
|
|
3970
|
+
el.__alOldRaw=el.textContent;
|
|
3971
|
+
el.__alOld=(el.textContent||'').replace(/\\s+/g,' ').trim();
|
|
3972
|
+
el.__alPath=pathTo(el);
|
|
3973
|
+
el.__alOut=el.style.outline;
|
|
3974
|
+
el.style.outline='2px solid #6ee7b7';
|
|
3975
|
+
el.setAttribute('contenteditable','true');
|
|
3976
|
+
try{ el.focus(); }catch(e){}
|
|
3977
|
+
showBar(el);
|
|
3978
|
+
}
|
|
3979
|
+
// ENG-6856: edit one bare text node inside an inline-only container. We swap the
|
|
3980
|
+
// text node for a contenteditable wrapper span (so only this run is editable and
|
|
3981
|
+
// the inline siblings stay put) and record the container path + the text node's
|
|
3982
|
+
// index for the server to replace it in place. Index is computed BEFORE the swap
|
|
3983
|
+
// so it matches source_html's untouched text-node order.
|
|
3984
|
+
function startEditTextNode(tn, container){
|
|
3985
|
+
if(editing) endEdit(false);
|
|
3986
|
+
var idx=textIndexOf(container, tn);
|
|
3987
|
+
if(idx<0) return; // couldn't locate the node - bail, no edit
|
|
3988
|
+
var span=document.createElement('span');
|
|
3989
|
+
span.setAttribute('data-al-noedit','1');
|
|
3990
|
+
span.setAttribute('contenteditable','true');
|
|
3991
|
+
span.textContent=tn.nodeValue||'';
|
|
3992
|
+
span.style.outline='2px solid #6ee7b7';
|
|
3993
|
+
span.__alOldRaw=tn.nodeValue||'';
|
|
3994
|
+
span.__alOld=(tn.nodeValue||'').replace(/\\s+/g,' ').trim();
|
|
3995
|
+
span.__alPath=pathTo(container);
|
|
3996
|
+
span.__alTextIndex=idx;
|
|
3997
|
+
try{ tn.parentNode.replaceChild(span, tn); }catch(e){ return; }
|
|
3998
|
+
editing=span;
|
|
3999
|
+
try{ span.focus(); placeCaretEnd(span); }catch(e){}
|
|
4000
|
+
showBar(span);
|
|
4001
|
+
}
|
|
4002
|
+
// Hover affordance (only when armed and not mid-edit). Highlight leaves AND
|
|
4003
|
+
// inline-only containers (their bare text is per-node editable, ENG-6856).
|
|
4004
|
+
document.addEventListener('mouseover', function(e){
|
|
4005
|
+
if(!editEnabled||editing) return; var el=e.target;
|
|
4006
|
+
if(editable(el)||inlineOnlyEditable(el)){ el.style.cursor='text'; el.style.outline=el.style.outline||'1px dashed rgba(110,231,183,.6)'; el.__alHover=1; }
|
|
4007
|
+
});
|
|
4008
|
+
document.addEventListener('mouseout', function(e){
|
|
4009
|
+
var el=e.target; if(el&&el.__alHover&&el!==editing){ el.style.outline=''; el.__alHover=0; }
|
|
4010
|
+
});
|
|
4011
|
+
document.addEventListener('click', function(e){
|
|
4012
|
+
if(!editEnabled||editing) return;
|
|
4013
|
+
var sel=document.getSelection(); if(sel && String(sel).trim()) return; // a selection => comment flow
|
|
4014
|
+
var el=e.target;
|
|
4015
|
+
if(editable(el)){ e.preventDefault(); e.stopPropagation(); startEdit(el); return; }
|
|
4016
|
+
// ENG-6856: a click on bare text inside an inline-only container edits that
|
|
4017
|
+
// specific run. The clicked text node's parent must be the editable element
|
|
4018
|
+
// (a click landing inside an inline child is handled by editable() above).
|
|
4019
|
+
var tn=textNodeAtPoint(e.clientX, e.clientY);
|
|
4020
|
+
if(tn && tn.parentElement===el && inlineOnlyEditable(el) && (tn.nodeValue||'').trim()){
|
|
4021
|
+
e.preventDefault(); e.stopPropagation(); startEditTextNode(tn, el);
|
|
4022
|
+
}
|
|
4023
|
+
}, true);
|
|
4024
|
+
document.addEventListener('keydown', function(e){
|
|
4025
|
+
if(!editing) return;
|
|
4026
|
+
if(e.key==='Escape'){ e.preventDefault(); endEdit(false); }
|
|
4027
|
+
else if(e.key==='Enter' && !e.shiftKey){ e.preventDefault(); endEdit(true); }
|
|
4028
|
+
});
|
|
4029
|
+
|
|
3820
4030
|
document.addEventListener('mouseup', function(){
|
|
4031
|
+
if(editing) return; // a selection inside the editor is for the cursor, not a comment
|
|
3821
4032
|
var sel = document.getSelection();
|
|
3822
4033
|
var text = sel ? String(sel).trim() : '';
|
|
3823
4034
|
if(!text || sel.rangeCount === 0){ post({type:'clear'}); return; }
|
|
@@ -3825,7 +4036,38 @@ var MARKUP_BRIDGE_SCRIPT = `<script>(function(){
|
|
|
3825
4036
|
var r = range.getBoundingClientRect();
|
|
3826
4037
|
post({type:'selection', text:text, target:anchorFor(range), rect:{top:r.top,left:r.left,bottom:r.bottom,right:r.right,width:r.width,height:r.height}});
|
|
3827
4038
|
});
|
|
3828
|
-
document.addEventListener('scroll', function(){ post({type:'clear'}); }, true);
|
|
4039
|
+
document.addEventListener('scroll', function(){ if(!editing) post({type:'clear'}); }, true);
|
|
4040
|
+
|
|
4041
|
+
// ENG-6847: right-click any element to comment on it. Only fires once the shell
|
|
4042
|
+
// (or console preview) arms commenting - so the browser's native menu is left
|
|
4043
|
+
// intact for anon public viewers. Skip when text is selected (that's the
|
|
4044
|
+
// selection-comment flow) and skip our own injected UI (data-al-noedit). On a
|
|
4045
|
+
// hit we suppress the native menu and post the element reference + anchor + rect.
|
|
4046
|
+
document.addEventListener('contextmenu', function(e){
|
|
4047
|
+
if(!commentEnabled || editing) return;
|
|
4048
|
+
var sel=document.getSelection(); if(sel && String(sel).trim()) return; // selection => comment via mouseup
|
|
4049
|
+
var el=e.target;
|
|
4050
|
+
if(!el || el.nodeType!==1 || el===document.body || el===document.documentElement) return;
|
|
4051
|
+
if(el.closest && el.closest('[data-al-noedit]')) return; // our toolbar/prompt, not content
|
|
4052
|
+
e.preventDefault();
|
|
4053
|
+
var r=el.getBoundingClientRect();
|
|
4054
|
+
post({type:'element', label:describeEl(el), target:anchorOf(el), rect:{top:r.top,left:r.left,bottom:r.bottom,right:r.right,width:r.width,height:r.height}});
|
|
4055
|
+
});
|
|
4056
|
+
|
|
4057
|
+
// Control channel from the shell (arm editing/commenting; relay save result).
|
|
4058
|
+
// Only the shell (window.parent) may arm - a nested iframe the artifact embeds
|
|
4059
|
+
// must not be able to spoof enable-edit/enable-comment (server auth still gates
|
|
4060
|
+
// the mutation, but keep the client gate unspoofable too).
|
|
4061
|
+
window.addEventListener('message', function(e){
|
|
4062
|
+
if(e.source!==window.parent) return;
|
|
4063
|
+
var d=e.data; if(!d || d['${MARKUP_CONTROL_MARKER}']!==true) return;
|
|
4064
|
+
if(d.type==='enable-edit'){ editEnabled=true; }
|
|
4065
|
+
else if(d.type==='enable-comment'){ commentEnabled=true; }
|
|
4066
|
+
else if(d.type==='edit-result'){
|
|
4067
|
+
if(d.ok){ /* republish hot-swaps the iframe; nothing to do */ }
|
|
4068
|
+
else { /* leave the (now non-editable) text; the published version is the source of truth */ }
|
|
4069
|
+
}
|
|
4070
|
+
});
|
|
3829
4071
|
})();</script>`;
|
|
3830
4072
|
|
|
3831
4073
|
// ../../packages/core/dist/integrations/augmented-live/asset.js
|
|
@@ -6114,4 +6356,4 @@ export {
|
|
|
6114
6356
|
parseEnvIntegrations,
|
|
6115
6357
|
probeMcpEnvSubstitution
|
|
6116
6358
|
};
|
|
6117
|
-
//# sourceMappingURL=chunk-
|
|
6359
|
+
//# sourceMappingURL=chunk-SKANUWSB.js.map
|