@integrity-labs/agt-cli 0.28.1232 → 0.28.1233

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.
Files changed (29) hide show
  1. package/dist/bin/agt.js +6 -6
  2. package/dist/{chunk-BDXOVKWJ.js → chunk-4FLMCHQB.js} +2 -2
  3. package/dist/{chunk-QCBL7EBD.js → chunk-DQEUE2X2.js} +2 -2
  4. package/dist/{chunk-3CUCO6BU.js → chunk-HI4JD2K2.js} +3 -3
  5. package/dist/{chunk-LS27F6QF.js → chunk-VGEMWYW3.js} +5 -5
  6. package/dist/{chunk-XBADGTJP.js → chunk-XXIALNTU.js} +213 -1
  7. package/dist/chunk-XXIALNTU.js.map +1 -0
  8. package/dist/{claude-code-updater-R7QSZDGD.js → claude-code-updater-UTFTOX3B.js} +3 -3
  9. package/dist/{claude-pair-runtime-BH7XN36C.js → claude-pair-runtime-DI43DJ4P.js} +3 -3
  10. package/dist/lib/manager-worker.js +19 -19
  11. package/dist/mcp/direct-chat-channel.js +212 -0
  12. package/dist/mcp/index.js +212 -0
  13. package/dist/mcp/origami.js +212 -0
  14. package/dist/mcp/slack-channel.js +212 -0
  15. package/dist/mcp/telegram-channel.js +212 -0
  16. package/dist/{persistent-session-LQ4GJ264.js → persistent-session-S57KHU34.js} +4 -4
  17. package/dist/{responsiveness-probe-NN7XEPJM.js → responsiveness-probe-TFPKYDPB.js} +4 -4
  18. package/dist/{session-auth-dead-ESB735FG.js → session-auth-dead-EYJAWW46.js} +3 -3
  19. package/package.json +1 -1
  20. package/dist/chunk-XBADGTJP.js.map +0 -1
  21. /package/dist/{chunk-BDXOVKWJ.js.map → chunk-4FLMCHQB.js.map} +0 -0
  22. /package/dist/{chunk-QCBL7EBD.js.map → chunk-DQEUE2X2.js.map} +0 -0
  23. /package/dist/{chunk-3CUCO6BU.js.map → chunk-HI4JD2K2.js.map} +0 -0
  24. /package/dist/{chunk-LS27F6QF.js.map → chunk-VGEMWYW3.js.map} +0 -0
  25. /package/dist/{claude-code-updater-R7QSZDGD.js.map → claude-code-updater-UTFTOX3B.js.map} +0 -0
  26. /package/dist/{claude-pair-runtime-BH7XN36C.js.map → claude-pair-runtime-DI43DJ4P.js.map} +0 -0
  27. /package/dist/{persistent-session-LQ4GJ264.js.map → persistent-session-S57KHU34.js.map} +0 -0
  28. /package/dist/{responsiveness-probe-NN7XEPJM.js.map → responsiveness-probe-TFPKYDPB.js.map} +0 -0
  29. /package/dist/{session-auth-dead-ESB735FG.js.map → session-auth-dead-EYJAWW46.js.map} +0 -0
@@ -13,9 +13,9 @@ import {
13
13
  probeClaudeInstalls,
14
14
  readsAsNativeInstall,
15
15
  shouldRunClaudeCodeUpdater
16
- } from "./chunk-QCBL7EBD.js";
16
+ } from "./chunk-DQEUE2X2.js";
17
17
  import "./chunk-XWVM4KPK.js";
18
- import "./chunk-XBADGTJP.js";
18
+ import "./chunk-XXIALNTU.js";
19
19
  import "./chunk-AIUIMEUS.js";
20
20
  import "./chunk-DGUM43GV.js";
21
21
  export {
@@ -34,4 +34,4 @@ export {
34
34
  readsAsNativeInstall,
35
35
  shouldRunClaudeCodeUpdater
36
36
  };
37
- //# sourceMappingURL=claude-code-updater-R7QSZDGD.js.map
37
+ //# sourceMappingURL=claude-code-updater-UTFTOX3B.js.map
@@ -8,7 +8,7 @@ import {
8
8
  import {
9
9
  redactPaneFrame,
10
10
  sanitizeTerminalFrame
11
- } from "./chunk-XBADGTJP.js";
11
+ } from "./chunk-XXIALNTU.js";
12
12
  import {
13
13
  CLAUDE_CONFIG_DIR_ENV,
14
14
  claudeConfigDirFor,
@@ -321,7 +321,7 @@ async function spawnPairSession(session) {
321
321
  return { ok: true };
322
322
  } catch {
323
323
  }
324
- const { resolveClaudeBinary } = await import("./persistent-session-LQ4GJ264.js");
324
+ const { resolveClaudeBinary } = await import("./persistent-session-S57KHU34.js");
325
325
  const claudeBin = resolveClaudeBinary();
326
326
  const pairEnv = {
327
327
  ...process.env,
@@ -836,4 +836,4 @@ export {
836
836
  startClaudePair,
837
837
  submitClaudePairCode
838
838
  };
839
- //# sourceMappingURL=claude-pair-runtime-BH7XN36C.js.map
839
+ //# sourceMappingURL=claude-pair-runtime-DI43DJ4P.js.map
@@ -85,7 +85,7 @@ import {
85
85
  tripClass,
86
86
  writeEtcEnvironment,
87
87
  writeProfileDScript
88
- } from "../chunk-LS27F6QF.js";
88
+ } from "../chunk-VGEMWYW3.js";
89
89
  import {
90
90
  CLAUDE_CODE_SECURITY_FLOOR,
91
91
  SELF_UPDATE_TIMEOUTS,
@@ -99,7 +99,7 @@ import {
99
99
  runSafeCleanup,
100
100
  tightestDiskStat,
101
101
  withPackageCacheLock
102
- } from "../chunk-QCBL7EBD.js";
102
+ } from "../chunk-DQEUE2X2.js";
103
103
  import {
104
104
  rewriteSupervisorApiKey,
105
105
  supervisorChannelsRefusing
@@ -192,7 +192,7 @@ import {
192
192
  webFetchBaselineValue,
193
193
  webFetchRestartNeeded,
194
194
  writeEgressAllowlist
195
- } from "../chunk-3CUCO6BU.js";
195
+ } from "../chunk-HI4JD2K2.js";
196
196
  import {
197
197
  isAgentIdle,
198
198
  isStaleForToday,
@@ -203,7 +203,7 @@ import {
203
203
  subagentActivityAgeSeconds,
204
204
  subagentTranscriptDir,
205
205
  transcriptActivityAgeSeconds
206
- } from "../chunk-BDXOVKWJ.js";
206
+ } from "../chunk-4FLMCHQB.js";
207
207
  import {
208
208
  classifyUnanswerablePane,
209
209
  focusedConfirmDialogBlock,
@@ -334,7 +334,7 @@ import {
334
334
  stabiliseResetInstant,
335
335
  sumTranscriptUsageInWindow,
336
336
  summarizeTranscriptActivity
337
- } from "../chunk-XBADGTJP.js";
337
+ } from "../chunk-XXIALNTU.js";
338
338
  import {
339
339
  CLAUDE_CONFIG_DIR_ENV,
340
340
  claudeConfigDirFor,
@@ -15843,7 +15843,7 @@ var pendingDayRolloverReset = /* @__PURE__ */ new Set();
15843
15843
  var dayRolloverInboundHold = /* @__PURE__ */ new Map();
15844
15844
  var INBOUND_HOLD_EPISODE_GAP_MS = 12e4;
15845
15845
  async function channelInboundActivityAgeSecondsFor(codeName) {
15846
- const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-NN7XEPJM.js");
15846
+ const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-TFPKYDPB.js");
15847
15847
  const newest = newestPendingInboundActivityMtimeMs(dirname11(paneLogPath(codeName)));
15848
15848
  if (newest === null) return null;
15849
15849
  return Math.max(0, Math.floor((Date.now() - newest) / 1e3));
@@ -16649,7 +16649,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
16649
16649
  var lastVersionCheckAt = 0;
16650
16650
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
16651
16651
  var lastResponsivenessProbeAt = 0;
16652
- var agtCliVersion = true ? "0.28.1232" : "dev";
16652
+ var agtCliVersion = true ? "0.28.1233" : "dev";
16653
16653
  function resolveBrewPath(execFileSync3) {
16654
16654
  try {
16655
16655
  const out = execFileSync3("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -18646,7 +18646,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
18646
18646
  if (codeNames.length === 0) return;
18647
18647
  void (async () => {
18648
18648
  try {
18649
- const { collectDiagnostics } = await import("../persistent-session-LQ4GJ264.js");
18649
+ const { collectDiagnostics } = await import("../persistent-session-S57KHU34.js");
18650
18650
  await api.post("/host/heartbeat", {
18651
18651
  host_id: hostId,
18652
18652
  agent_diagnostics: collectDiagnostics(codeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor, sessionActivityFor)
@@ -18789,7 +18789,7 @@ async function pollCycleInner() {
18789
18789
  }
18790
18790
  try {
18791
18791
  const { detectHostSecurity } = await import("../host-security-KQYYZZVW.js");
18792
- const { collectDiagnostics } = await import("../persistent-session-LQ4GJ264.js");
18792
+ const { collectDiagnostics } = await import("../persistent-session-S57KHU34.js");
18793
18793
  const diagCodeNames = [...agentState.persistentSessionAgents];
18794
18794
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor, sessionActivityFor) : void 0;
18795
18795
  let tailscaleHostname;
@@ -19054,7 +19054,7 @@ async function pollCycleInner() {
19054
19054
  }
19055
19055
  try {
19056
19056
  const desiredClaudeCodeVersion = hbResp?.desired_claude_code_version?.trim();
19057
- const { maybeUpdateClaudeCode, shouldRunClaudeCodeUpdater } = await import("../claude-code-updater-R7QSZDGD.js");
19057
+ const { maybeUpdateClaudeCode, shouldRunClaudeCodeUpdater } = await import("../claude-code-updater-UTFTOX3B.js");
19058
19058
  const securityFloor = currentSecurityFloor();
19059
19059
  claudeUpdaterInFlight = true;
19060
19060
  if (desiredClaudeCodeVersion && (claudePairLoop.busy || claudePairingInProgress())) {
@@ -19089,7 +19089,7 @@ async function pollCycleInner() {
19089
19089
  collectPanelessActivityProbes,
19090
19090
  getResponsivenessIntervalMs,
19091
19091
  occupancyQualificationClassifications
19092
- } = await import("../responsiveness-probe-NN7XEPJM.js");
19092
+ } = await import("../responsiveness-probe-TFPKYDPB.js");
19093
19093
  const probeIntervalMs = getResponsivenessIntervalMs();
19094
19094
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
19095
19095
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -19206,7 +19206,7 @@ async function pollCycleInner() {
19206
19206
  collectResponsivenessProbes,
19207
19207
  livePendingInboundOldestAgeSeconds,
19208
19208
  parkPendingInbound
19209
- } = await import("../responsiveness-probe-NN7XEPJM.js");
19209
+ } = await import("../responsiveness-probe-TFPKYDPB.js");
19210
19210
  const { getProjectDir: wedgeProjectDir } = await import("../scheduler-engine-M6AFZWNU.js");
19211
19211
  const wedgeNow = /* @__PURE__ */ new Date();
19212
19212
  const liveAgents = agentState.persistentSessionAgents;
@@ -19492,7 +19492,7 @@ async function pollCycleInner() {
19492
19492
  }
19493
19493
  }
19494
19494
  );
19495
- const { parkPendingInbound } = await import("../responsiveness-probe-NN7XEPJM.js");
19495
+ const { parkPendingInbound } = await import("../responsiveness-probe-TFPKYDPB.js");
19496
19496
  const { parked, deadLettered } = parkPendingInbound(codeName, new Date(fatalNowMs));
19497
19497
  paneFatalStreak.delete(codeName);
19498
19498
  paneFatalRestarts.set(codeName, [...history, fatalNowMs]);
@@ -19523,7 +19523,7 @@ async function pollCycleInner() {
19523
19523
  TRANSCRIPT_MOUNT_ESCALATION_REFRESH_MS,
19524
19524
  bindSourceEscalations
19525
19525
  } = await import("../transcript-mount-health-OHE6IVJV.js");
19526
- const { transcriptBindSourcesFor, ensureTranscriptBindSources } = await import("../persistent-session-LQ4GJ264.js");
19526
+ const { transcriptBindSourcesFor, ensureTranscriptBindSources } = await import("../persistent-session-S57KHU34.js");
19527
19527
  const mountConfig = resolveTranscriptMountConfig();
19528
19528
  const liveAgents = agentState.persistentSessionAgents;
19529
19529
  for (const tracked of [
@@ -19688,7 +19688,7 @@ async function pollCycleInner() {
19688
19688
  }
19689
19689
  try {
19690
19690
  const { scrapeMcpFailedBannerCount } = await import("../pane-mcp-banner-scraper-VR5QGP3J.js");
19691
- const { probeSessionAuth } = await import("../session-auth-dead-ESB735FG.js");
19691
+ const { probeSessionAuth } = await import("../session-auth-dead-EYJAWW46.js");
19692
19692
  const observations = [];
19693
19693
  const pendingCacheCommits = [];
19694
19694
  const modelApiErrorReportingOn = hostFlagStore().getBoolean("model-api-error-reporting");
@@ -24438,7 +24438,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
24438
24438
  try {
24439
24439
  const freshId = rotateSessionForWedge(codeName);
24440
24440
  consecutiveWedgeCycles.delete(codeName);
24441
- const { parkPendingInbound: parkForRestart } = await import("../responsiveness-probe-NN7XEPJM.js");
24441
+ const { parkPendingInbound: parkForRestart } = await import("../responsiveness-probe-TFPKYDPB.js");
24442
24442
  const { parked, deadLettered } = parkForRestart(codeName, /* @__PURE__ */ new Date());
24443
24443
  const parkNote = parked > 0 ? `, ${parked} inbound parked` : "";
24444
24444
  const deadNote = deadLettered > 0 ? `, ${deadLettered} undeliverable dead-lettered` : "";
@@ -24481,7 +24481,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
24481
24481
  void api.post("/host/restart-ack", { host_id: hostId, agent_id: agentId, restart_requested_at: requestedAt }).catch((err) => log(`[restart-lane] ack failed for '${codeName}': ${err.message}`));
24482
24482
  void (async () => {
24483
24483
  try {
24484
- const { collectDiagnostics } = await import("../persistent-session-LQ4GJ264.js");
24484
+ const { collectDiagnostics } = await import("../persistent-session-S57KHU34.js");
24485
24485
  await api.post("/host/heartbeat", {
24486
24486
  host_id: hostId,
24487
24487
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor, sessionActivityFor)
@@ -24532,7 +24532,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
24532
24532
  }
24533
24533
  try {
24534
24534
  const hostId = await getHostId();
24535
- const { collectDiagnostics } = await import("../persistent-session-LQ4GJ264.js");
24535
+ const { collectDiagnostics } = await import("../persistent-session-S57KHU34.js");
24536
24536
  await api.post("/host/heartbeat", {
24537
24537
  host_id: hostId,
24538
24538
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor, sessionActivityFor)
@@ -25234,7 +25234,7 @@ async function processClaudePairSessions(agents) {
25234
25234
  snapshotPairConfig,
25235
25235
  // ENG-11659: result -> report body + the manager.log line that records it.
25236
25236
  planPairStartReport
25237
- } = await import("../claude-pair-runtime-BH7XN36C.js");
25237
+ } = await import("../claude-pair-runtime-DI43DJ4P.js");
25238
25238
  const { resetClaudeSignin, describeSigninResetForLog, describeSigninResetFailure } = await import("../claude-signin-reset-6IJMMVYG.js");
25239
25239
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
25240
25240
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
@@ -39208,6 +39208,216 @@ var MARKUP_BRIDGE_SCRIPT = `<script>(function(){
39208
39208
  });
39209
39209
  })();</script>`;
39210
39210
 
39211
+ // ../core/dist/integrations/augmented-live/deck-phone-fit.js
39212
+ var DECK_PHONE_FILL_MAX_HEIGHT_PX = 500;
39213
+ var DECK_PHONE_FILL_MIN_WIDTH_PX = 560;
39214
+ var FIXER = String.raw`(function () {
39215
+ // ENG-8819: phone fit for Ninja Canvas slide decks, injected by the viewer shell so it
39216
+ // reaches decks that are already published. Acts only on a deck (a #stage holding
39217
+ // .slide elements); every other page is left alone.
39218
+ var stage = document.getElementById('stage');
39219
+ if (!stage || !stage.querySelector('.slide')) return;
39220
+ var root = document.documentElement;
39221
+ var css = document.createElement('style');
39222
+ css.id = 'agt-deck-phone-fit';
39223
+ css.textContent =
39224
+ // The stage is a flex item in deck mode. Without this it shrinks to the viewport
39225
+ // width before it is scaled, so a phone in landscape got a narrow, clipped slide.
39226
+ 'html.deck-js #stage{flex-shrink:0}' +
39227
+ // Fill-width mode (short landscape screens): the slide is wider than tall enough
39228
+ // to fit, so let the page scroll vertically instead of letterboxing it.
39229
+ 'html.deck-js.agt-fill,html.deck-js.agt-fill body{height:auto;min-height:100%;overflow-x:hidden;overflow-y:auto}' +
39230
+ 'html.deck-js.agt-fill body{display:block}' +
39231
+ 'html.deck-js.agt-fill #stage{transform:none!important;transform-origin:0 0}' +
39232
+ // Room to scroll the end of the page clear of the viewer chrome fixed along the
39233
+ // bottom edge (the HUD row in landscape; Download and the badge in portrait).
39234
+ 'html.deck-js.agt-fill body{padding-bottom:76px}' +
39235
+ 'html:not(.deck-js) body{padding-bottom:124px}' +
39236
+ // Portrait reads as a scrolling page, so the rotate prompt is not needed (and sat on
39237
+ // top of the viewer Download button).
39238
+ 'html:not(.deck-js) #rotate-hint{display:none!important}';
39239
+ (document.head || root).appendChild(css);
39240
+
39241
+ // Shared with the shell's chrome CSS (deckPhoneChromeCss), so the slide only fills
39242
+ // the width where the shell has also moved Download and the badge out of its way.
39243
+ var PHONE_MAX_H = __AGT_MAX_H__, PHONE_MIN_W = __AGT_MIN_W__;
39244
+ var stageZoom0 = stage.style.zoom;
39245
+ var lastSlide = -1;
39246
+
39247
+ function activeIndex() {
39248
+ var s = stage.querySelectorAll('.slide');
39249
+ for (var i = 0; i < s.length; i++) if (s[i].classList.contains('is-active')) return i;
39250
+ return -1;
39251
+ }
39252
+
39253
+ function fitDeck() {
39254
+ var w = innerWidth, h = innerHeight;
39255
+ // The canvas is whatever the deck declares (1280x720 in the skeleton, but a deck
39256
+ // may set its own), read from layout: transform does not change offsetWidth.
39257
+ stage.style.zoom = stageZoom0;
39258
+ var cw = stage.offsetWidth || 1280, ch = stage.offsetHeight || 720;
39259
+ // Height binds when the window is wider than the canvas. On a phone in landscape
39260
+ // that left a third of the screen empty; fill the width and scroll instead.
39261
+ var fill = w / h > cw / ch && h <= PHONE_MAX_H && w >= PHONE_MIN_W;
39262
+ root.classList.toggle('agt-fill', fill);
39263
+ // Scale to the width the page actually lays out in. innerWidth includes a classic
39264
+ // (non-overlay) scrollbar, and fill mode always scrolls, so on a short desktop
39265
+ // window that would push the slide's right edge under overflow-x:hidden. Read after
39266
+ // the class is on, so the scrollbar it turns on is already taken out.
39267
+ if (fill) stage.style.zoom = (root.clientWidth || w) / cw;
39268
+ var a = activeIndex();
39269
+ if (fill && a !== lastSlide) scrollTo(0, 0);
39270
+ lastSlide = a;
39271
+ }
39272
+
39273
+ // Narrow (portrait) mode stacks the slides as a page, but a slide authored for
39274
+ // 1280px still carries blocks that do not fit 390px, and they were clipped at the
39275
+ // right edge. In order, least destructive first: a multi-column grid becomes one
39276
+ // column, unwrappable text wraps, and only what still overflows (a cover canvas,
39277
+ // a diagram drawn at a fixed size) is scaled down to fit.
39278
+ var MARK = 'data-agt-fit';
39279
+ // Every inline value the narrow pass overwrites is recorded first and put back on
39280
+ // undo. Clearing to '' instead would wipe a deck's own inline layout (a
39281
+ // style="grid-template-columns:..." slide) the first time the phone rotated.
39282
+ var touched = [];
39283
+ function put(el, prop, val, mark) {
39284
+ touched.push([el, prop, el.style[prop]]);
39285
+ el.style[prop] = val;
39286
+ // Never downgrade a 'zoom' mark (Obi Wan 9a6ba37489c2): a zoomed block that is also
39287
+ // a grid child getting 'col' would lose the closest('[data-agt-fit="zoom"]')
39288
+ // exclusion, and passes 3 and 4 could wrap or zoom inside it again (a double scale).
39289
+ if (el.getAttribute(MARK) !== 'zoom') el.setAttribute(MARK, mark);
39290
+ }
39291
+ function undoNarrow() {
39292
+ for (var i = touched.length - 1; i >= 0; i--) {
39293
+ touched[i][0].style[touched[i][1]] = touched[i][2];
39294
+ touched[i][0].removeAttribute(MARK);
39295
+ }
39296
+ touched = [];
39297
+ }
39298
+ function overflowing(el, limit) {
39299
+ var r = el.getBoundingClientRect();
39300
+ return r.width > 0 && r.right > limit + 1;
39301
+ }
39302
+ function fitNarrow() {
39303
+ undoNarrow();
39304
+ var slides = stage.querySelectorAll('.slide');
39305
+ for (var j = 0; j < slides.length; j++) {
39306
+ var sl = slides[j], limit = sl.getBoundingClientRect().right;
39307
+ var all = sl.querySelectorAll('*'), k, el, cs;
39308
+ var padR = parseFloat(getComputedStyle(sl).paddingRight) || 0;
39309
+ // A block drawn at a fixed width wider than the column (a cover canvas) is a
39310
+ // picture, not a layout: scale it whole first, and never reflow inside it.
39311
+ for (k = 0; k < all.length; k++) {
39312
+ el = all[k];
39313
+ if (el.closest('[' + MARK + '="zoom"]')) continue;
39314
+ cs = getComputedStyle(el);
39315
+ var fixedW = parseFloat(cs.width);
39316
+ var rr = el.getBoundingClientRect(), room = limit - padR - rr.left;
39317
+ if (/px$/.test(el.style.width || '') || (cs.display !== 'grid' && fixedW > room + 1 && room > 40 && el.children.length > 0 && overflowing(el, limit) && fixedW >= 600)) {
39318
+ if (!overflowing(el, limit) || room <= 40) continue;
39319
+ put(el, 'zoom', Math.max(0.2, room / rr.width), 'zoom');
39320
+ // The slide keeps its full-screen min-height; shrink it to the scaled
39321
+ // picture so there is no empty screen under it. Never below the picture.
39322
+ var sr = sl.getBoundingClientRect(), er = el.getBoundingClientRect();
39323
+ var need = Math.ceil(er.bottom - sr.top + (parseFloat(getComputedStyle(sl).paddingBottom) || 0));
39324
+ if (need > 80 && need < sr.height) put(sl, 'minHeight', need + 'px', 'slide');
39325
+ }
39326
+ }
39327
+ for (k = 0; k < all.length; k++) {
39328
+ el = all[k];
39329
+ if (el.closest('[' + MARK + '="zoom"]')) continue;
39330
+ cs = getComputedStyle(el);
39331
+ if ((cs.display === 'grid' || cs.display === 'inline-grid') && cs.gridTemplateColumns.split(' ').length > 1 &&
39332
+ (el.scrollWidth > el.clientWidth + 1 || overflowing(el, limit))) {
39333
+ // A cell whose content is absolutely positioned took its height from the
39334
+ // row it shared; keep that height, or its drawing collapses on itself.
39335
+ var keep = [];
39336
+ for (var q = 0; q < el.children.length; q++) {
39337
+ var ch = el.children[q], abs = false, ds = ch.querySelectorAll('*');
39338
+ for (var z = 0; z < ds.length && !abs; z++) abs = getComputedStyle(ds[z]).position === 'absolute';
39339
+ keep.push(abs ? ch.getBoundingClientRect().height : 0);
39340
+ }
39341
+ put(el, 'gridTemplateColumns', 'minmax(0,1fr)', 'reflow');
39342
+ for (q = 0; q < el.children.length; q++) {
39343
+ if (keep[q] > 0 && el.children[q].getBoundingClientRect().height < keep[q] - 1) {
39344
+ put(el.children[q], 'minHeight', Math.round(keep[q]) + 'px', 'keep');
39345
+ }
39346
+ }
39347
+ for (var c = 0; c < el.children.length; c++) {
39348
+ if (getComputedStyle(el.children[c]).gridColumnStart !== 'auto') put(el.children[c], 'gridColumn', 'auto', 'col');
39349
+ }
39350
+ } else if (cs.display.indexOf('flex') > -1 && cs.flexDirection.indexOf('row') === 0 && cs.flexWrap === 'nowrap' &&
39351
+ el.children.length > 1 && overflowing(el.lastElementChild || el, limit)) {
39352
+ put(el, 'flexWrap', 'wrap', 'wrap');
39353
+ }
39354
+ }
39355
+ for (k = 0; k < all.length; k++) {
39356
+ el = all[k];
39357
+ if (el.closest('[' + MARK + '="zoom"]')) continue;
39358
+ if (el.children.length === 0 && overflowing(el, limit) && getComputedStyle(el).whiteSpace.indexOf('nowrap') > -1) {
39359
+ put(el, 'whiteSpace', 'normal', 'text');
39360
+ }
39361
+ }
39362
+ for (k = 0; k < all.length; k++) {
39363
+ el = all[k];
39364
+ if (el.closest('[' + MARK + '="zoom"]')) continue;
39365
+ if (!overflowing(el, limit)) continue;
39366
+ var r = el.getBoundingClientRect(), avail = limit - padR - r.left;
39367
+ if (avail <= 40) continue;
39368
+ put(el, 'zoom', Math.max(0.2, avail / r.width), 'zoom');
39369
+ }
39370
+ }
39371
+ }
39372
+
39373
+ // Obi Wan 73a833f8f833: the narrow (stacked) layout depends on WIDTH only, but iOS
39374
+ // fires resize and visualViewport resize as its toolbars collapse during an ordinary
39375
+ // scroll, changing only the height. Re-running fitNarrow there would revert and
39376
+ // re-measure every slide mid-scroll and could make the page jump. So a narrow re-fit
39377
+ // runs only when the width changed, when leaving deck mode, or on load (content sizes).
39378
+ var narrowW = -1;
39379
+ function apply() {
39380
+ try {
39381
+ if (root.classList.contains('deck-js')) {
39382
+ narrowW = -1;
39383
+ undoNarrow();
39384
+ fitDeck();
39385
+ } else {
39386
+ root.classList.remove('agt-fill');
39387
+ stage.style.zoom = stageZoom0;
39388
+ var nw = root.clientWidth || innerWidth;
39389
+ if (nw === narrowW) return;
39390
+ fitNarrow();
39391
+ narrowW = nw;
39392
+ }
39393
+ } catch (e) {
39394
+ // Never break the deck over a fit problem, but leave a trace (and a hook for
39395
+ // tests) rather than swallowing it.
39396
+ window.__agtDeckFitError = String((e && e.message) || e);
39397
+ }
39398
+ }
39399
+
39400
+ var t = 0;
39401
+ function later() {
39402
+ apply();
39403
+ // iOS reports the new size a beat after resize/orientationchange fires.
39404
+ clearTimeout(t);
39405
+ t = setTimeout(apply, 250);
39406
+ if (window.requestAnimationFrame) requestAnimationFrame(apply);
39407
+ }
39408
+ addEventListener('resize', later);
39409
+ addEventListener('orientationchange', later);
39410
+ // Load can change content sizes (images) at the same width, so it always re-fits.
39411
+ addEventListener('load', function () { narrowW = -1; later(); });
39412
+ if (window.visualViewport) visualViewport.addEventListener('resize', later);
39413
+ // Slide changes: keep fill mode scrolled to the top of the new slide.
39414
+ try { new MutationObserver(function () { if (root.classList.contains('agt-fill')) fitDeck(); })
39415
+ .observe(stage, { subtree: true, attributes: true, attributeFilter: ['class'] }); } catch (e) {}
39416
+ later();
39417
+ })();`;
39418
+ var DECK_PHONE_FIT_SOURCE = FIXER.replace("__AGT_MAX_H__", String(DECK_PHONE_FILL_MAX_HEIGHT_PX)).replace("__AGT_MIN_W__", String(DECK_PHONE_FILL_MIN_WIDTH_PX));
39419
+ var DECK_PHONE_FIT_SCRIPT = '<script id="agt-deck-phone-fit-js">' + DECK_PHONE_FIT_SOURCE + "</script>";
39420
+
39211
39421
  // ../core/dist/integrations/augmented-live/live-hosts.js
39212
39422
  function linkOpenerScript(frameId) {
39213
39423
  return 'function alOpenBar(u){var o=document.getElementById("al-open");if(o)o.parentNode.removeChild(o);var b=document.createElement("div");b.id="al-open";b.setAttribute("role","status");b.appendChild(document.createTextNode("Open link to "));var a=document.createElement("a");a.href=u.href;a.target="_blank";a.rel="noopener noreferrer";a.textContent=u.host;a.addEventListener("click",function(){setTimeout(function(){if(b.parentNode)b.parentNode.removeChild(b);},0);});b.appendChild(a);var x=document.createElement("button");x.type="button";x.setAttribute("aria-label","Dismiss");x.textContent="\xD7";x.addEventListener("click",function(){if(b.parentNode)b.parentNode.removeChild(b);});b.appendChild(x);document.body.appendChild(b);}window.addEventListener("message",function(e){var f=document.getElementById(' + JSON.stringify(frameId) + ');if(!f||e.source!==f.contentWindow||e.origin!=="null")return;var d=e.data;if(!d||d.type!=="al-open"||typeof d.url!=="string")return;var u;try{u=new URL(d.url);}catch(x){return;}if(u.protocol!=="https:"||u.username||u.password)return;var w=window.open(u.href,"_blank");if(w){try{w.opener=null;}catch(x){}}else{alOpenBar(u);}});';
@@ -39285,6 +39495,8 @@ var DOWNLOAD_MOBILE_MIN_HEIGHT_PX = 44;
39285
39495
  var DECK_ATTRIBUTION_NARROW_BOTTOM_PX = DOWNLOAD_BOTTOM_PX + DOWNLOAD_MOBILE_MIN_HEIGHT_PX + DECK_CHROME_GAP_PX;
39286
39496
  var VISIBILITY_BOTTOM_PX = DOWNLOAD_BOTTOM_PX + DOWNLOAD_MOBILE_MIN_HEIGHT_PX + DECK_CHROME_GAP_PX;
39287
39497
  var DECK_ATTRIBUTION_NARROW_WITH_VISIBILITY_BOTTOM_PX = VISIBILITY_BOTTOM_PX + DOWNLOAD_MOBILE_MIN_HEIGHT_PX + DECK_CHROME_GAP_PX;
39498
+ var DECK_PRINT_BUTTON_W_PX = 72;
39499
+ var DECK_PHONE_DOWNLOAD_BESIDE_PRINT_LEFT_PX = 16 + DECK_PRINT_BUTTON_W_PX + DECK_CHROME_GAP_PX;
39288
39500
 
39289
39501
  // ../core/dist/integrations/augmented-live/codec.js
39290
39502
  var DEFAULT_CHUNK_BUDGET_BYTES = 180 * 1024;