@integrity-labs/agt-cli 0.28.521 → 0.28.523

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 CHANGED
@@ -40,7 +40,7 @@ import {
40
40
  success,
41
41
  table,
42
42
  warn
43
- } from "../chunk-UAHIRLPO.js";
43
+ } from "../chunk-HERASX7X.js";
44
44
  import {
45
45
  AnchorSessionClient,
46
46
  CHANNEL_REGISTRY,
@@ -71,7 +71,7 @@ import {
71
71
  requiredMcpWildcard,
72
72
  resolveChannels,
73
73
  serializeManifestForSlackCli
74
- } from "../chunk-STNEJC5S.js";
74
+ } from "../chunk-LBSV575W.js";
75
75
  import "../chunk-XWVM4KPK.js";
76
76
 
77
77
  // src/bin/agt.ts
@@ -4834,7 +4834,7 @@ import { execFileSync, execSync } from "child_process";
4834
4834
  import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
4835
4835
  import chalk18 from "chalk";
4836
4836
  import ora16 from "ora";
4837
- var cliVersion = true ? "0.28.521" : "dev";
4837
+ var cliVersion = true ? "0.28.523" : "dev";
4838
4838
  async function fetchLatestVersion() {
4839
4839
  const host2 = getHost();
4840
4840
  if (!host2) return null;
@@ -6006,7 +6006,7 @@ function handleError(err) {
6006
6006
  }
6007
6007
 
6008
6008
  // src/bin/agt.ts
6009
- var cliVersion2 = true ? "0.28.521" : "dev";
6009
+ var cliVersion2 = true ? "0.28.523" : "dev";
6010
6010
  var program = new Command();
6011
6011
  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");
6012
6012
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -42,7 +42,7 @@ import {
42
42
  resolveConnectivityProbe,
43
43
  worseConnectivityOutcome,
44
44
  wrapScheduledTaskPrompt
45
- } from "./chunk-STNEJC5S.js";
45
+ } from "./chunk-LBSV575W.js";
46
46
  import {
47
47
  parsePsRows
48
48
  } from "./chunk-XWVM4KPK.js";
@@ -5317,7 +5317,7 @@ function exchangeFailureKind(err) {
5317
5317
  }
5318
5318
 
5319
5319
  // src/lib/api-client.ts
5320
- var agtCliVersion = true ? "0.28.521" : "dev";
5320
+ var agtCliVersion = true ? "0.28.523" : "dev";
5321
5321
  var lastConfigHash = null;
5322
5322
  function setConfigHash(hash) {
5323
5323
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -8629,4 +8629,4 @@ export {
8629
8629
  managerInstallSystemUnitCommand,
8630
8630
  managerUninstallSystemUnitCommand
8631
8631
  };
8632
- //# sourceMappingURL=chunk-UAHIRLPO.js.map
8632
+ //# sourceMappingURL=chunk-HERASX7X.js.map
@@ -4400,6 +4400,11 @@ var MARKUP_BRIDGE_SCRIPT = `<script>(function(){
4400
4400
  var commentEnabled = false; // armed when the viewer may comment (ENG-6847 right-click)
4401
4401
  var editing = null; // the element currently in edit mode
4402
4402
  var bar = null; // the Save/Cancel toolbar
4403
+ // ENG-8477: the viewer has explicitly turned editing ON from the shell. Only
4404
+ // then does the bridge look underneath the artefact's own overlays. See the
4405
+ // long note on the window-capture click handler for why this is a mode and
4406
+ // not just always-on.
4407
+ var editMode = false;
4403
4408
 
4404
4409
  // Element-child indices from <body> down to el. Counts ELEMENT children only
4405
4410
  // (children, not childNodes), matching how the server walks source_html; our
@@ -4454,6 +4459,55 @@ var MARKUP_BRIDGE_SCRIPT = `<script>(function(){
4454
4459
  return null;
4455
4460
  }catch(e){ return null; }
4456
4461
  }
4462
+ // ENG-8477: the topmost element under the pointer that we could actually edit,
4463
+ // looking THROUGH anything the artefact has laid over its own content.
4464
+ //
4465
+ // elementsFromPoint returns the full hit stack, front to back. We walk it from
4466
+ // the front and take the first genuinely editable element, skipping our own
4467
+ // injected UI. An artefact overlay is skipped for free: it is an empty div, so
4468
+ // editable() rejects it on the text check and we keep walking.
4469
+ //
4470
+ // Returns null when there is nothing editable under the pointer at all, which
4471
+ // is the signal to leave the click completely alone.
4472
+ function editableAtPoint(x,y){
4473
+ var stack;
4474
+ try{ stack=document.elementsFromPoint(x,y)||[]; }catch(e){ return null; }
4475
+ for(var i=0;i<stack.length;i++){
4476
+ var el=stack[i];
4477
+ if(!el || el.nodeType!==1) continue;
4478
+ if(el.closest && el.closest('[data-al-noedit]')) continue; // our toolbar, not content
4479
+ if(editable(el)||inlineOnlyEditable(el)) return el;
4480
+ }
4481
+ return null;
4482
+ }
4483
+ // The caret probe (caretRangeFromPoint) reports on the TOPMOST element at the
4484
+ // point, so an overlay swallows it exactly as it swallows the click - it hands
4485
+ // back the overlay div, not the text underneath. Neutralise everything stacked
4486
+ // above the target for the length of the probe, then put it back. The restore
4487
+ // is in a finally and runs before the browser can paint, so nothing flickers
4488
+ // and no artefact state is left modified.
4489
+ // This re-queries elementsFromPoint rather than reusing the caller's stack, so
4490
+ // target is NOT guaranteed to still be in it. Find target's index first and
4491
+ // mute only the prefix in front of it: a not-found target must fall back to the
4492
+ // plain probe, because muting the whole stack would neutralise target and its
4493
+ // ancestors too - a wider style mutation than intended, for a probe whose
4494
+ // result the caller then rejects anyway.
4495
+ function textNodeAtPointThrough(x,y,target){
4496
+ var stack;
4497
+ try{ stack=document.elementsFromPoint(x,y)||[]; }catch(e){ return textNodeAtPoint(x,y); }
4498
+ var cut=-1, i;
4499
+ for(i=0;i<stack.length;i++){ if(stack[i]===target){ cut=i; break; } }
4500
+ if(cut<0) return textNodeAtPoint(x,y);
4501
+ var muted=[];
4502
+ for(i=0;i<cut;i++){
4503
+ muted.push([stack[i], stack[i].style ? stack[i].style.pointerEvents : '']);
4504
+ try{ stack[i].style.pointerEvents='none'; }catch(e){}
4505
+ }
4506
+ try{ return textNodeAtPoint(x,y); }
4507
+ finally{
4508
+ for(i=0;i<muted.length;i++){ try{ muted[i][0].style.pointerEvents=muted[i][1]||''; }catch(e){} }
4509
+ }
4510
+ }
4457
4511
  // Index of a text node among its parent's child TEXT nodes, in order - the same
4458
4512
  // counting the server uses to re-locate it in source_html (ENG-6856).
4459
4513
  function textIndexOf(container, tn){
@@ -4563,6 +4617,105 @@ var MARKUP_BRIDGE_SCRIPT = `<script>(function(){
4563
4617
  e.preventDefault(); e.stopPropagation(); startEditTextNode(tn, el);
4564
4618
  }
4565
4619
  }, true);
4620
+ // ENG-8477: reach content the artefact covers with its OWN overlay.
4621
+ //
4622
+ // A deck built from the canonical template lays two full-viewport click zones
4623
+ // over its slides (.clickzone, position:fixed, z-index:40) to page forward and
4624
+ // back. The template's own comment says it plainly: "the click zones sit above
4625
+ // slide content by design, so any interactive element inside a slide needs
4626
+ // position:relative + a higher z-index to stay clickable". Slide TEXT is not an
4627
+ // interactive element and never gets one.
4628
+ //
4629
+ // So every click a viewer aimed at a paragraph landed on #zone-prev/#zone-next.
4630
+ // The handler above read e.target, got an empty div, editable() rejected it on
4631
+ // the text check, and no editor opened - while the zone's own handler paged the
4632
+ // deck. A single-page artefact has no zones and the identical bridge works
4633
+ // perfectly on it, which is precisely why editing "works in web page formats
4634
+ // but not decks". Verified on real published content, not just the template.
4635
+ //
4636
+ // Why a MODE rather than always-on. One press cannot mean both "page the deck"
4637
+ // and "edit this text". The zones are the deck's primary navigation, so
4638
+ // silently stealing clicks from them would trade one broken gesture for
4639
+ // another. The shell gives an armed viewer an explicit Edit-text toggle; until
4640
+ // they turn it on, every line below is inert and the artefact behaves exactly
4641
+ // as it does today. Anonymous viewers never arm at all.
4642
+ //
4643
+ // Why window + capture. Same phase argument as ENG-8500: the artefact's script
4644
+ // is appended before the bridge, so registration order cannot be won, but the
4645
+ // capture path runs window -> document -> ... -> target and therefore beats a
4646
+ // handler bound to the zone itself no matter when it was registered.
4647
+ // stopImmediatePropagation then keeps the deck from also paging.
4648
+ //
4649
+ // Deliberately general: nothing here knows about .clickzone or any class name.
4650
+ // It fixes any artefact that covers its own content.
4651
+ window.addEventListener('click', function(e){
4652
+ if(!editEnabled || !editMode || editing) return;
4653
+ var sel=document.getSelection(); if(sel && String(sel).trim()) return; // selection => comment flow
4654
+ var t=e.target;
4655
+ // Our own toolbar (Save/Cancel) must keep its clicks.
4656
+ if(t && t.closest && t.closest('[data-al-noedit]')) return;
4657
+ // Already directly on editable content: the document-level handler above
4658
+ // covers it, and duplicating the work here would start the edit twice.
4659
+ if(editable(t)||inlineOnlyEditable(t)) return;
4660
+ var el=editableAtPoint(e.clientX, e.clientY);
4661
+ // Nothing editable under the pointer - leave the click completely alone so
4662
+ // click-to-page still works while the viewer is moving between slides.
4663
+ if(!el) return;
4664
+ // Suppress ONLY once an edit is actually starting. Suppressing up front left
4665
+ // the inline-only fallback below as a dead click: no editor opened AND the
4666
+ // deck could not page, because the event was already stopped.
4667
+ if(editable(el)){ e.preventDefault(); e.stopImmediatePropagation(); startEdit(el); return; }
4668
+ var tn=textNodeAtPointThrough(e.clientX, e.clientY, el);
4669
+ if(tn && tn.parentElement===el && (tn.nodeValue||'').trim()){
4670
+ e.preventDefault(); e.stopImmediatePropagation(); startEditTextNode(tn, el); return;
4671
+ }
4672
+ // An inline-only container whose exact text run we could not resolve (no
4673
+ // caret API, or the point fell between runs). Editing the whole container
4674
+ // would flatten its nested markup, so leave the click to the artefact and
4675
+ // let it page as it normally would.
4676
+ }, true);
4677
+ // ENG-8477: the same deck template pulls focus back to the document on every
4678
+ // pointer press, to keep its arrow keys working when the iframe loses focus:
4679
+ //
4680
+ // function grabFocus(){ try{ window.focus(); document.body.focus(); }catch(e){} }
4681
+ // addEventListener('pointerdown', grabFocus);
4682
+ //
4683
+ // A bare addEventListener at artefact top level is window + bubble phase, so a
4684
+ // window CAPTURE listener still gets there first. Without this guard, clicking
4685
+ // into an open editor to place the caret hands focus straight to <body> and the
4686
+ // viewer cannot type - a second, independent breaker that would have survived
4687
+ // the overlay fix on its own.
4688
+ //
4689
+ // Scoped as tightly as it can be: only while an edit is open, and only for a
4690
+ // press that lands inside the editor. A press anywhere else is the viewer
4691
+ // leaving, and the artefact keeps it.
4692
+ window.addEventListener('pointerdown', function(e){
4693
+ if(!editing) return;
4694
+ var t=e.target;
4695
+ if(t!==editing && !(editing.contains && t && t.nodeType && editing.contains(t))) return;
4696
+ e.stopImmediatePropagation();
4697
+ }, true);
4698
+ // ENG-8477: the hover affordance has the same blind spot as the click did -
4699
+ // mouseover reports the overlay, so a viewer in edit mode would get no cue that
4700
+ // slide text can be edited at all. Probing the stack on every mousemove would
4701
+ // be wasteful, so this only runs in edit mode, only when the direct target is
4702
+ // not already editable (that case the mouseover handler above still covers),
4703
+ // and no more than once per ~80ms.
4704
+ var hoverProbeAt=0, hoverEl=null;
4705
+ function clearDeepHover(){
4706
+ if(hoverEl && hoverEl!==editing && hoverEl.__alHover){ try{ hoverEl.style.outline=''; }catch(e){} hoverEl.__alHover=0; }
4707
+ hoverEl=null;
4708
+ }
4709
+ document.addEventListener('mousemove', function(e){
4710
+ if(!editEnabled || !editMode || editing){ clearDeepHover(); return; }
4711
+ var t=e.target;
4712
+ if(editable(t)||inlineOnlyEditable(t)){ clearDeepHover(); return; }
4713
+ var now=Date.now(); if(now-hoverProbeAt<80) return; hoverProbeAt=now;
4714
+ var el=editableAtPoint(e.clientX, e.clientY);
4715
+ if(el===hoverEl) return;
4716
+ clearDeepHover();
4717
+ if(el){ try{ el.style.outline=el.style.outline||'1px dashed rgba(110,231,183,.6)'; }catch(e){} el.__alHover=1; hoverEl=el; }
4718
+ });
4566
4719
  // ENG-8500: while the inline editor is focused, the artefact's OWN keyboard
4567
4720
  // handlers must not see the keystroke.
4568
4721
  //
@@ -4654,6 +4807,13 @@ var MARKUP_BRIDGE_SCRIPT = `<script>(function(){
4654
4807
  var d=e.data; if(!d || d['${MARKUP_CONTROL_MARKER}']!==true) return;
4655
4808
  if(d.type==='enable-edit'){ editEnabled=true; }
4656
4809
  else if(d.type==='enable-comment'){ commentEnabled=true; }
4810
+ // ENG-8477: the viewer toggled Edit text in the shell. Turning it OFF must
4811
+ // also close anything open and drop the hover cue, or the artefact is left
4812
+ // wearing our outlines with no way to clear them.
4813
+ else if(d.type==='set-edit-mode'){
4814
+ editMode = !!d.on;
4815
+ if(!editMode){ if(editing) endEdit(false); clearDeepHover(); }
4816
+ }
4657
4817
  else if(d.type==='edit-result'){
4658
4818
  if(d.ok){ /* republish hot-swaps the iframe; nothing to do */ }
4659
4819
  else { /* leave the (now non-editable) text; the published version is the source of truth */ }
@@ -5060,6 +5220,27 @@ var OAUTH_PROVIDERS = {
5060
5220
  "themes",
5061
5221
  "contacts",
5062
5222
  "emails"
5223
+ ],
5224
+ // ENG-8512: `update_course.thumbnail` stores a RELATIVE path into Kajabi's
5225
+ // own storage — it is rendered as
5226
+ // https://kajabi-storefronts-production.kajabi-cdn.com/kajabi-storefronts-production/<value>
5227
+ // so an absolute http(s) URL is structurally not a valid value for it.
5228
+ // Kajabi accepts one anyway, returns 200, echoes it back, ingests nothing,
5229
+ // and the course shows a broken image. Reported from a live client site
5230
+ // (DTI) via CS-1548 after it produced a false "done" report and three
5231
+ // failed cards.
5232
+ //
5233
+ // Anchored at the start so only an ABSOLUTE URL is refused; every relative
5234
+ // path — the valid shape — passes untouched. This does not enable setting a
5235
+ // thumbnail from a URL (that needs an upload path, CS-1548 item 4). It stops
5236
+ // us reporting success for a write that did not happen.
5237
+ argRejects: [
5238
+ {
5239
+ tool: "update_course",
5240
+ field: "thumbnail",
5241
+ pattern: "^\\s*https?://",
5242
+ message: "thumbnail takes a relative path inside Kajabi storage, not an external URL. Kajabi accepts a URL here, returns 200 and never ingests it, so the image would silently stay broken. Upload the asset to Kajabi first and pass the storage path it returns."
5243
+ }
5063
5244
  ]
5064
5245
  },
5065
5246
  "notion-cli": {
@@ -6201,7 +6382,14 @@ var REMOTE_MCP_PROXY_ENV = {
6201
6382
  authHeader: "AGT_REMOTE_MCP_AUTH_HEADER",
6202
6383
  extraHeaders: "AGT_REMOTE_MCP_EXTRA_HEADERS",
6203
6384
  toolAllowlist: "AGT_REMOTE_MCP_TOOL_ALLOWLIST",
6204
- preEnableToolsets: "AGT_REMOTE_MCP_PREENABLE_TOOLSETS"
6385
+ preEnableToolsets: "AGT_REMOTE_MCP_PREENABLE_TOOLSETS",
6386
+ // ENG-8512: per-provider argument rules. A `tools/call` carrying a value we
6387
+ // KNOW the remote accepts and silently ignores is refused before it is
6388
+ // forwarded, rather than returning a 200 that every layer above records as
6389
+ // success. Deliberately NOT in REMOTE_MCP_AUTH_ENV_KEYS: it shapes which calls
6390
+ // we forward, not what an outbound request looks like, so the probe (which
6391
+ // never issues a tools/call) has nothing to reconstruct from it.
6392
+ argRejects: "AGT_REMOTE_MCP_ARG_REJECTS"
6205
6393
  };
6206
6394
  var REMOTE_MCP_AUTH_ENV_KEYS = [
6207
6395
  REMOTE_MCP_PROXY_ENV.tokenVar,
@@ -11368,6 +11556,12 @@ function buildOAuthRemoteMcpProxyEntry(definitionId, paths, connectionKey) {
11368
11556
  // CS-1446: toolsets to pre-activate at session start so gated tools are
11369
11557
  // advertised in the connect-time tools/list the harness freezes. Omitted
11370
11558
  // when the provider configures none (no pre-enable, the default).
11559
+ // ENG-8512: argument rules for calls the remote would accept and silently
11560
+ // ignore. JSON rather than a delimited list because a rule carries a regex
11561
+ // and a human-readable message, and both can contain any separator we
11562
+ // might have picked. Omitted when the provider declares none, leaving the
11563
+ // proxy's argument checking entirely off.
11564
+ ...provider.argRejects && provider.argRejects.length > 0 ? { AGT_REMOTE_MCP_ARG_REJECTS: JSON.stringify(provider.argRejects) } : {},
11371
11565
  ...provider.preEnableToolsets && provider.preEnableToolsets.length > 0 ? { AGT_REMOTE_MCP_PREENABLE_TOOLSETS: provider.preEnableToolsets.join(",") } : {}
11372
11566
  }
11373
11567
  };
@@ -15170,4 +15364,4 @@ export {
15170
15364
  stopAllSessionsAndWait,
15171
15365
  getProjectDir
15172
15366
  };
15173
- //# sourceMappingURL=chunk-STNEJC5S.js.map
15367
+ //# sourceMappingURL=chunk-LBSV575W.js.map