@arbidocs/blocks 0.5.191 → 0.5.192

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 (140) hide show
  1. package/bin/arbidocs-mix-take.mjs +34 -0
  2. package/bin/arbidocs-record-take.mjs +77 -11
  3. package/bin/arbidocs-voice-take.mjs +32 -0
  4. package/dist/{ConnectedCallDock-PVBDNOTA.cjs → ConnectedCallDock-7GGYYQNK.cjs} +23 -23
  5. package/dist/{ConnectedCallDock-PVBDNOTA.cjs.map → ConnectedCallDock-7GGYYQNK.cjs.map} +1 -1
  6. package/dist/{ConnectedCallRoom-H2OWGUEN.cjs → ConnectedCallRoom-ZZ7RBGGY.cjs} +16 -16
  7. package/dist/{ConnectedCallRoom-H2OWGUEN.cjs.map → ConnectedCallRoom-ZZ7RBGGY.cjs.map} +1 -1
  8. package/dist/{ConnectedNativeDocxComparison-NKVGPLSK.cjs → ConnectedNativeDocxComparison-PPVXDQY3.cjs} +20 -20
  9. package/dist/{ConnectedNativeDocxComparison-NKVGPLSK.cjs.map → ConnectedNativeDocxComparison-PPVXDQY3.cjs.map} +1 -1
  10. package/dist/{ConnectedPresentation-N6HNSYRH.cjs → ConnectedPresentation-LNDESKYE.cjs} +19 -19
  11. package/dist/{ConnectedPresentation-N6HNSYRH.cjs.map → ConnectedPresentation-LNDESKYE.cjs.map} +1 -1
  12. package/dist/{ConnectedProductionSetDialog-KT6BPSRE.cjs → ConnectedProductionSetDialog-SHDI7KP6.cjs} +6 -6
  13. package/dist/{ConnectedProductionSetDialog-KT6BPSRE.cjs.map → ConnectedProductionSetDialog-SHDI7KP6.cjs.map} +1 -1
  14. package/dist/{ConnectedSlidesTab-J7OPUXI4.cjs → ConnectedSlidesTab-SYDDGJWM.cjs} +16 -16
  15. package/dist/{ConnectedSlidesTab-J7OPUXI4.cjs.map → ConnectedSlidesTab-SYDDGJWM.cjs.map} +1 -1
  16. package/dist/{ConnectedStreamedWordArtifact-BLSAP7NY.cjs → ConnectedStreamedWordArtifact-GAACBGTY.cjs} +20 -20
  17. package/dist/{ConnectedStreamedWordArtifact-BLSAP7NY.cjs.map → ConnectedStreamedWordArtifact-GAACBGTY.cjs.map} +1 -1
  18. package/dist/{DocumentReviewCard-C2ZXJ2ZL.cjs → DocumentReviewCard-Q3NKJLSM.cjs} +19 -19
  19. package/dist/{DocumentReviewCard-C2ZXJ2ZL.cjs.map → DocumentReviewCard-Q3NKJLSM.cjs.map} +1 -1
  20. package/dist/{FilesViewerDialog-NUPMAEIC.cjs → FilesViewerDialog-4JWDTDO7.cjs} +53 -53
  21. package/dist/{FilesViewerDialog-NUPMAEIC.cjs.map → FilesViewerDialog-4JWDTDO7.cjs.map} +1 -1
  22. package/dist/{WorkspaceTableView-CSOPEZFT.cjs → WorkspaceTableView-QT63XYII.cjs} +10 -10
  23. package/dist/{WorkspaceTableView-CSOPEZFT.cjs.map → WorkspaceTableView-QT63XYII.cjs.map} +1 -1
  24. package/dist/agents/index.cjs +287 -287
  25. package/dist/{ai-2B4BMS6O.cjs → ai-A5YTWIEC.cjs} +25 -25
  26. package/dist/ai-A5YTWIEC.cjs.map +1 -0
  27. package/dist/auth/index.cjs +12 -12
  28. package/dist/calls/index.cjs +125 -125
  29. package/dist/chat/index.cjs +23 -23
  30. package/dist/{chunk-VNUBBRJM.cjs → chunk-2K5DLB7B.cjs} +3 -3
  31. package/dist/{chunk-VNUBBRJM.cjs.map → chunk-2K5DLB7B.cjs.map} +1 -1
  32. package/dist/{chunk-GOLLGCGK.cjs → chunk-33236Q7Y.cjs} +70 -70
  33. package/dist/{chunk-GOLLGCGK.cjs.map → chunk-33236Q7Y.cjs.map} +1 -1
  34. package/dist/{chunk-NTXII2XQ.cjs → chunk-3EIO4ZH5.cjs} +6 -6
  35. package/dist/{chunk-NTXII2XQ.cjs.map → chunk-3EIO4ZH5.cjs.map} +1 -1
  36. package/dist/{chunk-B5AOYT4U.cjs → chunk-5FSULBPE.cjs} +3 -3
  37. package/dist/{chunk-B5AOYT4U.cjs.map → chunk-5FSULBPE.cjs.map} +1 -1
  38. package/dist/{chunk-3P6KGC46.cjs → chunk-5OD6DRG7.cjs} +3 -3
  39. package/dist/{chunk-3P6KGC46.cjs.map → chunk-5OD6DRG7.cjs.map} +1 -1
  40. package/dist/{chunk-R37KPMUZ.cjs → chunk-5RUY5THD.cjs} +7 -7
  41. package/dist/{chunk-R37KPMUZ.cjs.map → chunk-5RUY5THD.cjs.map} +1 -1
  42. package/dist/{chunk-GEVBY536.cjs → chunk-633ZCYVN.cjs} +37 -37
  43. package/dist/{chunk-GEVBY536.cjs.map → chunk-633ZCYVN.cjs.map} +1 -1
  44. package/dist/{chunk-E62542RM.cjs → chunk-65NQW4RR.cjs} +18 -18
  45. package/dist/{chunk-E62542RM.cjs.map → chunk-65NQW4RR.cjs.map} +1 -1
  46. package/dist/{chunk-DFQWX2XY.cjs → chunk-7GVKG3G4.cjs} +13 -13
  47. package/dist/{chunk-DFQWX2XY.cjs.map → chunk-7GVKG3G4.cjs.map} +1 -1
  48. package/dist/{chunk-SOJYSRO4.cjs → chunk-A7MGQMOV.cjs} +10 -10
  49. package/dist/{chunk-SOJYSRO4.cjs.map → chunk-A7MGQMOV.cjs.map} +1 -1
  50. package/dist/{chunk-KJ5M72M2.cjs → chunk-AWQEN6WW.cjs} +7 -7
  51. package/dist/{chunk-KJ5M72M2.cjs.map → chunk-AWQEN6WW.cjs.map} +1 -1
  52. package/dist/{chunk-3U6XE7SF.cjs → chunk-AZUPMHZI.cjs} +4 -4
  53. package/dist/{chunk-3U6XE7SF.cjs.map → chunk-AZUPMHZI.cjs.map} +1 -1
  54. package/dist/{chunk-CUYELFKB.cjs → chunk-EAH7LFJN.cjs} +4 -4
  55. package/dist/{chunk-CUYELFKB.cjs.map → chunk-EAH7LFJN.cjs.map} +1 -1
  56. package/dist/{chunk-GY4T4JSC.cjs → chunk-EFV52SZ6.cjs} +4 -4
  57. package/dist/{chunk-GY4T4JSC.cjs.map → chunk-EFV52SZ6.cjs.map} +1 -1
  58. package/dist/{chunk-SLVWSTFY.cjs → chunk-ELN3YOXF.cjs} +28 -28
  59. package/dist/{chunk-SLVWSTFY.cjs.map → chunk-ELN3YOXF.cjs.map} +1 -1
  60. package/dist/{chunk-YNFETLNZ.cjs → chunk-ER2MRSLT.cjs} +3 -3
  61. package/dist/{chunk-YNFETLNZ.cjs.map → chunk-ER2MRSLT.cjs.map} +1 -1
  62. package/dist/{chunk-5UNZO4FA.cjs → chunk-GLNL5AL5.cjs} +50 -50
  63. package/dist/{chunk-5UNZO4FA.cjs.map → chunk-GLNL5AL5.cjs.map} +1 -1
  64. package/dist/{chunk-YK3GUFZX.cjs → chunk-GZPNBSRE.cjs} +15 -15
  65. package/dist/{chunk-YK3GUFZX.cjs.map → chunk-GZPNBSRE.cjs.map} +1 -1
  66. package/dist/{chunk-H3CYXI46.cjs → chunk-HH5MKRBL.cjs} +7 -7
  67. package/dist/{chunk-H3CYXI46.cjs.map → chunk-HH5MKRBL.cjs.map} +1 -1
  68. package/dist/{chunk-4GMPS6VX.cjs → chunk-IRDL2EC6.cjs} +49 -49
  69. package/dist/{chunk-4GMPS6VX.cjs.map → chunk-IRDL2EC6.cjs.map} +1 -1
  70. package/dist/{chunk-VJFU2KKF.cjs → chunk-J46Y2L26.cjs} +4 -4
  71. package/dist/{chunk-VJFU2KKF.cjs.map → chunk-J46Y2L26.cjs.map} +1 -1
  72. package/dist/{chunk-PVT4EZUR.cjs → chunk-KD37PODE.cjs} +5 -5
  73. package/dist/{chunk-PVT4EZUR.cjs.map → chunk-KD37PODE.cjs.map} +1 -1
  74. package/dist/{chunk-JGU6YLIA.cjs → chunk-KQJUY2OE.cjs} +11 -11
  75. package/dist/{chunk-JGU6YLIA.cjs.map → chunk-KQJUY2OE.cjs.map} +1 -1
  76. package/dist/{chunk-MXM4BTXY.cjs → chunk-KZH6HMJL.cjs} +4 -4
  77. package/dist/{chunk-MXM4BTXY.cjs.map → chunk-KZH6HMJL.cjs.map} +1 -1
  78. package/dist/{chunk-XKQKHXRU.cjs → chunk-L3MYUPSH.cjs} +5 -5
  79. package/dist/{chunk-XKQKHXRU.cjs.map → chunk-L3MYUPSH.cjs.map} +1 -1
  80. package/dist/{chunk-SNYCK354.cjs → chunk-LYDSETR7.cjs} +5 -5
  81. package/dist/{chunk-SNYCK354.cjs.map → chunk-LYDSETR7.cjs.map} +1 -1
  82. package/dist/{chunk-X6TSOKEP.cjs → chunk-LYJFE37D.cjs} +3 -3
  83. package/dist/{chunk-X6TSOKEP.cjs.map → chunk-LYJFE37D.cjs.map} +1 -1
  84. package/dist/{chunk-NBW67JUB.cjs → chunk-OHWYQI3B.cjs} +12 -12
  85. package/dist/{chunk-NBW67JUB.cjs.map → chunk-OHWYQI3B.cjs.map} +1 -1
  86. package/dist/{chunk-CM2LUZ7K.cjs → chunk-QDIIOZBP.cjs} +30 -30
  87. package/dist/{chunk-CM2LUZ7K.cjs.map → chunk-QDIIOZBP.cjs.map} +1 -1
  88. package/dist/{chunk-WXRAU2FF.cjs → chunk-QSY2VW7V.cjs} +6 -6
  89. package/dist/{chunk-WXRAU2FF.cjs.map → chunk-QSY2VW7V.cjs.map} +1 -1
  90. package/dist/{chunk-ZLOPSDVW.cjs → chunk-RNQ3MDTR.cjs} +4 -4
  91. package/dist/{chunk-ZLOPSDVW.cjs.map → chunk-RNQ3MDTR.cjs.map} +1 -1
  92. package/dist/{chunk-QOTDPA62.cjs → chunk-SXC4ZIN4.cjs} +10 -10
  93. package/dist/{chunk-QOTDPA62.cjs.map → chunk-SXC4ZIN4.cjs.map} +1 -1
  94. package/dist/{chunk-W7TSEN3J.cjs → chunk-TLIZD6DV.cjs} +6 -6
  95. package/dist/{chunk-W7TSEN3J.cjs.map → chunk-TLIZD6DV.cjs.map} +1 -1
  96. package/dist/{chunk-NS7PWOL7.cjs → chunk-VD3HI5RF.cjs} +3 -3
  97. package/dist/{chunk-NS7PWOL7.cjs.map → chunk-VD3HI5RF.cjs.map} +1 -1
  98. package/dist/{chunk-6N7QT2DH.cjs → chunk-VDHBLDQC.cjs} +3 -3
  99. package/dist/{chunk-6N7QT2DH.cjs.map → chunk-VDHBLDQC.cjs.map} +1 -1
  100. package/dist/{chunk-6ZJBUMNK.cjs → chunk-VDT7TEAH.cjs} +3 -3
  101. package/dist/{chunk-6ZJBUMNK.cjs.map → chunk-VDT7TEAH.cjs.map} +1 -1
  102. package/dist/{chunk-SKIQ54TG.cjs → chunk-VJHDCYKE.cjs} +13 -13
  103. package/dist/{chunk-SKIQ54TG.cjs.map → chunk-VJHDCYKE.cjs.map} +1 -1
  104. package/dist/{chunk-MWJPCTBV.cjs → chunk-XKXKEVHH.cjs} +6 -6
  105. package/dist/{chunk-MWJPCTBV.cjs.map → chunk-XKXKEVHH.cjs.map} +1 -1
  106. package/dist/{chunk-DJ7LSKBJ.cjs → chunk-XQPJWPWE.cjs} +3 -3
  107. package/dist/{chunk-DJ7LSKBJ.cjs.map → chunk-XQPJWPWE.cjs.map} +1 -1
  108. package/dist/{chunk-XYMM6ZPS.cjs → chunk-Z6M2CI63.cjs} +65 -65
  109. package/dist/{chunk-XYMM6ZPS.cjs.map → chunk-Z6M2CI63.cjs.map} +1 -1
  110. package/dist/collaboration/index.cjs +13 -13
  111. package/dist/connect/docx.cjs +23 -23
  112. package/dist/connect/index.cjs +1204 -1204
  113. package/dist/connect/viewer.cjs +41 -41
  114. package/dist/dashboards/index.cjs +1 -1
  115. package/dist/embed/index.cjs +48 -48
  116. package/dist/facts/index.cjs +39 -39
  117. package/dist/files/index.cjs +221 -221
  118. package/dist/home/index.cjs +9 -9
  119. package/dist/index.cjs +1797 -1797
  120. package/dist/pages/index.cjs +31 -31
  121. package/dist/record/band.d.ts +95 -0
  122. package/dist/record/index.cjs +414 -13
  123. package/dist/record/index.cjs.map +1 -1
  124. package/dist/record/index.d.ts +35 -2
  125. package/dist/record/index.js +402 -15
  126. package/dist/record/index.js.map +1 -1
  127. package/dist/record/narration.d.ts +71 -0
  128. package/dist/settings/index.cjs +139 -139
  129. package/dist/shell/index.cjs +81 -81
  130. package/dist/studio/index.cjs +29 -29
  131. package/dist/styles.css +1 -1
  132. package/dist/workflow-canvas/index.cjs +64 -64
  133. package/dist/workspaces/index.cjs +5 -5
  134. package/node_modules/@arbidocs/coedit/package.json +1 -1
  135. package/package.json +11 -6
  136. package/record/SKILL.md +178 -26
  137. package/record/mix-take.py +320 -0
  138. package/record/recap-slide.mjs +118 -0
  139. package/record/voice-take.py +129 -0
  140. package/dist/ai-2B4BMS6O.cjs.map +0 -1
@@ -1,8 +1,354 @@
1
- import { mkdirSync, writeFileSync } from 'fs';
1
+ import { readFileSync, existsSync, writeFileSync, mkdirSync } from 'fs';
2
2
  import path from 'path';
3
3
 
4
4
  // src/record/index.ts
5
5
 
6
+ // src/record/band.ts
7
+ var BAND_HEIGHT = 64;
8
+ var PLAYER_STRIP = 84;
9
+ var CHUNK_MS = 100;
10
+ var BAND_LABEL_WIDTH = 360;
11
+ var BAND_BOX = {
12
+ x: BAND_LABEL_WIDTH,
13
+ y: 0,
14
+ width: 1600 - BAND_LABEL_WIDTH,
15
+ height: BAND_HEIGHT
16
+ };
17
+ var BAND_FRAME = "__BAND_FRAME__";
18
+ var DEFAULT_FONT = "'Space Grotesk', 'Trebuchet MS', system-ui, sans-serif";
19
+ var DEFAULT_FONT_URL = "https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&display=swap";
20
+ var DEFAULT_GROUND = "#07090c";
21
+ var DEFAULT_TEXT = "#f6f0e2";
22
+ function captionChunks(text) {
23
+ const chunks = [];
24
+ let run = [];
25
+ for (const word of text.split(/\s+/).filter(Boolean)) {
26
+ run.push(word);
27
+ if (run.length === 3 || /[,.;:?!…]$/.test(word)) {
28
+ chunks.push(run.join(" "));
29
+ run = [];
30
+ }
31
+ }
32
+ if (run.length) chunks.push(run.join(" "));
33
+ return chunks;
34
+ }
35
+ function readingMs(text) {
36
+ return Math.min(4200, 900 + text.length * 45);
37
+ }
38
+ async function installBand(page, skin, options = {}) {
39
+ const frame = `calc(100dvh - ${BAND_HEIGHT + PLAYER_STRIP}px)`;
40
+ await page.addInitScript(
41
+ ({ H, B, L, ink, accent, sans, ground, text, root, extra, fontUrl }) => {
42
+ const boot = () => {
43
+ if (document.getElementById("__band")) return;
44
+ const w = window;
45
+ const style = document.createElement("style");
46
+ style.textContent = `
47
+ html, body { background: ${ink} !important; }
48
+ /* The app sits between the band and the player's strip. Its transform keeps the app's own
49
+ * fixed parts (the toasts) inside it; the dialogs and menus, portalled to the body, open
50
+ * at the viewport's centre, which is the app's. */
51
+ ${root} {
52
+ position: fixed !important; top: ${H}px; bottom: ${B}px; left: 0; right: 0; height: auto !important;
53
+ overflow: hidden; transform: translateZ(0); background: var(--color-background, #fff);
54
+ }
55
+ .h-dvh, .h-screen, .h-svh, .h-lvh { height: calc(100dvh - ${H + B}px) !important; }
56
+ .min-h-dvh, .min-h-screen, .min-h-svh, .min-h-lvh { min-height: calc(100dvh - ${H + B}px) !important; }
57
+ .max-h-dvh, .max-h-screen { max-height: calc(100dvh - ${H + B}px) !important; }
58
+ ${extra}
59
+ /* The stage's floating caption stays hidden: captions are painted in the band. */
60
+ #__cine_cap { display: none !important; }
61
+ #__band_cap span { opacity: 0; transition: opacity .18s ease-out; }
62
+ #__band_cap span.on { opacity: 1; }
63
+ /* A click: at full strength for a moment, then the ring spreads out and fades. */
64
+ @keyframes __band_ring {
65
+ 0% { width: 18px; height: 18px; margin: -9px 0 0 -9px; opacity: 1; }
66
+ 45% { opacity: 1; }
67
+ 100% { width: 72px; height: 72px; margin: -36px 0 0 -36px; opacity: 0; border-width: 2px; }
68
+ }
69
+ @keyframes __band_dot { 0% { transform: scale(.4); opacity: 1; } 45% { transform: scale(1); opacity: .9; } 100% { transform: scale(1.1); opacity: 0; } }
70
+ `;
71
+ document.head.appendChild(style);
72
+ if (fontUrl) {
73
+ const font = document.createElement("link");
74
+ font.rel = "stylesheet";
75
+ font.href = fontUrl;
76
+ document.head.appendChild(font);
77
+ }
78
+ const bar = (edge, height) => {
79
+ const el = document.createElement("div");
80
+ el.style.cssText = `position:fixed;left:0;right:0;${edge}:0;height:${height}px;z-index:2147483645;background:${ground};display:flex;box-shadow:inset 0 ${edge === "top" ? -3 : 3}px 0 ${accent};align-items:center;pointer-events:none;font-family:${sans};`;
81
+ document.body.appendChild(el);
82
+ return el;
83
+ };
84
+ const band = bar("top", H);
85
+ band.id = "__band";
86
+ bar("bottom", B).id = "__band_strip";
87
+ const label = document.createElement("div");
88
+ label.style.cssText = `width:${L}px;flex:none;padding:0 24px;display:flex;flex-direction:column;justify-content:center;gap:4px;`;
89
+ const kicker = document.createElement("div");
90
+ kicker.id = "__band_kicker";
91
+ kicker.style.cssText = `font:600 12px/1 ${sans};letter-spacing:.12em;text-transform:uppercase;color:${accent};`;
92
+ const name = document.createElement("div");
93
+ name.id = "__band_feature";
94
+ name.style.cssText = `font:700 20px/1.2 ${sans};color:${text};white-space:nowrap;overflow:hidden;text-overflow:ellipsis;`;
95
+ label.append(kicker, name);
96
+ const cap = document.createElement("div");
97
+ cap.id = "__band_cap";
98
+ cap.style.cssText = `flex:1;min-width:0;height:100%;display:flex;align-items:center;padding:0 28px 0 24px;border-left:2px solid ${accent}66;font:500 19px/1.3 ${sans};color:${text};letter-spacing:.01em;`;
99
+ const words = document.createElement("div");
100
+ words.style.cssText = "display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;";
101
+ cap.appendChild(words);
102
+ band.append(label, cap);
103
+ const show = (k, n) => {
104
+ kicker.textContent = k;
105
+ name.textContent = n;
106
+ };
107
+ w.__band_feature = (k, n) => {
108
+ sessionStorage.setItem("__band_feature", JSON.stringify([k, n]));
109
+ show(k, n);
110
+ };
111
+ let timers = [];
112
+ let clearer = 0;
113
+ const paint = (line, chunks, chunkMs) => {
114
+ timers.forEach(clearTimeout);
115
+ timers = [];
116
+ words.textContent = "";
117
+ words.dataset.text = line;
118
+ chunks.forEach((chunk, i) => {
119
+ const span = document.createElement("span");
120
+ span.textContent = chunk;
121
+ words.append(span, i < chunks.length - 1 ? " " : "");
122
+ if (chunkMs <= 0) span.classList.add("on");
123
+ else timers.push(window.setTimeout(() => span.classList.add("on"), i * chunkMs));
124
+ });
125
+ return chunkMs > 0 ? chunks.length * chunkMs : 0;
126
+ };
127
+ w.__band_say = (line, chunks, chunkMs = 100, clearMs = 0) => {
128
+ window.clearTimeout(clearer);
129
+ sessionStorage.setItem(
130
+ "__band_cap",
131
+ JSON.stringify([line, clearMs > 0 ? Date.now() + clearMs : 0])
132
+ );
133
+ if (clearMs > 0) clearer = window.setTimeout(() => w.__band_say?.("", []), clearMs);
134
+ if (line && words.dataset.text === line) return 0;
135
+ return paint(line, chunks, chunkMs);
136
+ };
137
+ window.__cine_cap = (t) => void w.__band_say?.(t, t ? [t] : [], 0);
138
+ const pulse = (x, y) => {
139
+ const dot = document.createElement("div");
140
+ dot.style.cssText = `position:fixed;left:${x}px;top:${y}px;z-index:2147483646;width:34px;height:34px;margin:-17px 0 0 -17px;border-radius:50%;pointer-events:none;background:${accent}99;box-shadow:0 0 0 2px rgba(255,255,255,.8);animation:__band_dot .6s ease-out forwards;`;
141
+ const ring = document.createElement("div");
142
+ ring.style.cssText = `position:fixed;left:${x}px;top:${y}px;z-index:2147483646;width:18px;height:18px;margin:-9px 0 0 -9px;border-radius:50%;pointer-events:none;border:4px solid ${accent};box-shadow:0 0 0 2px #fff,0 0 0 3.5px ${ink}55,0 0 18px ${accent}aa;animation:__band_ring .75s cubic-bezier(.3,.6,.4,1) forwards;`;
143
+ document.body.append(dot, ring);
144
+ window.setTimeout(() => {
145
+ dot.remove();
146
+ ring.remove();
147
+ }, 800);
148
+ };
149
+ w.__band_pulse = pulse;
150
+ const press = (down) => {
151
+ const cursor = document.getElementById("__cine_cursor");
152
+ if (!cursor) return;
153
+ const moved = cursor.style.transform.replace(/\s*scale\([^)]*\)/, "");
154
+ cursor.style.transform = down ? `${moved} scale(.72)` : moved;
155
+ };
156
+ window.addEventListener(
157
+ "pointerdown",
158
+ (e) => {
159
+ pulse(e.clientX, e.clientY);
160
+ press(true);
161
+ },
162
+ true
163
+ );
164
+ window.addEventListener("pointerup", () => press(false), true);
165
+ try {
166
+ const saved = JSON.parse(sessionStorage.getItem("__band_feature") || "null");
167
+ if (saved) show(saved[0], saved[1]);
168
+ const [line, until] = JSON.parse(sessionStorage.getItem("__band_cap") || '["",0]');
169
+ if (line && (!until || until > Date.now())) {
170
+ paint(line, [line], 0);
171
+ if (until) clearer = window.setTimeout(() => w.__band_say?.("", []), until - Date.now());
172
+ }
173
+ } catch {
174
+ }
175
+ };
176
+ if (document.body) boot();
177
+ else document.addEventListener("DOMContentLoaded", boot);
178
+ },
179
+ {
180
+ H: BAND_HEIGHT,
181
+ B: PLAYER_STRIP,
182
+ L: BAND_LABEL_WIDTH,
183
+ ink: skin.ink,
184
+ accent: skin.accent,
185
+ sans: options.font ?? DEFAULT_FONT,
186
+ ground: options.ground ?? DEFAULT_GROUND,
187
+ text: options.text ?? DEFAULT_TEXT,
188
+ root: options.root ?? "#root",
189
+ extra: (options.css ?? "").split(BAND_FRAME).join(frame),
190
+ fontUrl: options.fontUrl === void 0 ? DEFAULT_FONT_URL : options.fontUrl
191
+ }
192
+ );
193
+ }
194
+ async function feature(page, kicker, name) {
195
+ await page.evaluate(
196
+ ([k, n]) => window.__band_feature?.(k, n),
197
+ [kicker, name]
198
+ );
199
+ }
200
+ async function bandSay(page, text, holdMs, clearMs = 0) {
201
+ const reveal = await page.evaluate(
202
+ ([t, chunks, ms, clear]) => window.__band_say?.(t, chunks, ms, clear) ?? 0,
203
+ [text, captionChunks(text), CHUNK_MS, clearMs]
204
+ ) ?? 0;
205
+ if (holdMs === 0 || !text) return;
206
+ await page.waitForTimeout(Math.max(holdMs ?? readingMs(text), reveal + 1500));
207
+ }
208
+ async function pulseAt(page, box) {
209
+ if (!box) return;
210
+ await page.evaluate(
211
+ ([x, y]) => window.__band_pulse?.(x, y),
212
+ [box.x + box.width / 2, box.y + box.height / 2]
213
+ );
214
+ }
215
+ async function interlude(page, skin, card, holdMs) {
216
+ const FADE = 350;
217
+ await page.evaluate(
218
+ ({ card: card2, ink, accent, sans, FADE: FADE2, H, B }) => {
219
+ document.getElementById("__interlude")?.remove();
220
+ const veil = document.createElement("div");
221
+ veil.id = "__interlude";
222
+ veil.style.cssText = `position:fixed;left:0;right:0;top:${H}px;bottom:${B}px;z-index:2147483644;display:flex;align-items:center;justify-content:center;pointer-events:none;background:rgba(8,14,24,.38);opacity:0;transition:opacity ${FADE2}ms ease;font-family:${sans};`;
223
+ const box = document.createElement("div");
224
+ box.style.cssText = `width:760px;max-width:80%;padding:34px 44px 38px;border-radius:18px;color:#fff;background:linear-gradient(135deg, ${ink} 0%, ${ink} 55%, ${accent}66 140%);box-shadow:0 24px 70px rgba(0,0,0,.45), inset 0 0 0 1px ${accent}55;transform:translateY(10px) scale(.98);transition:transform ${FADE2}ms ease;`;
225
+ const k = document.createElement("div");
226
+ k.textContent = card2.kicker;
227
+ k.style.cssText = `font-size:14px;letter-spacing:.14em;text-transform:uppercase;color:${accent};font-weight:600;margin-bottom:12px;`;
228
+ const t = document.createElement("div");
229
+ t.textContent = card2.title;
230
+ t.style.cssText = "font-size:38px;line-height:1.15;font-weight:700;margin-bottom:12px;";
231
+ const s = document.createElement("div");
232
+ s.textContent = card2.subtitle ?? "";
233
+ s.style.cssText = "font-size:18px;line-height:1.45;color:#c8d3dd;";
234
+ box.append(k, t, s);
235
+ veil.append(box);
236
+ document.body.append(veil);
237
+ requestAnimationFrame(
238
+ () => requestAnimationFrame(() => {
239
+ veil.style.opacity = "1";
240
+ box.style.transform = "none";
241
+ })
242
+ );
243
+ },
244
+ {
245
+ card,
246
+ ink: skin.ink,
247
+ accent: skin.accent,
248
+ sans: skin.sansFont,
249
+ FADE,
250
+ H: BAND_HEIGHT,
251
+ B: PLAYER_STRIP
252
+ }
253
+ );
254
+ await page.waitForTimeout(FADE + holdMs);
255
+ await page.evaluate((fade) => {
256
+ const veil = document.getElementById("__interlude");
257
+ if (!veil) return;
258
+ veil.style.opacity = "0";
259
+ window.setTimeout(() => veil.remove(), fade + 50);
260
+ }, FADE);
261
+ await page.waitForTimeout(FADE + 50);
262
+ }
263
+ var NARRATION_GAP_MS = 520;
264
+ var NARRATION_LINGER_MS = 700;
265
+ function readingSeconds(text) {
266
+ return 1 + text.split(/\s+/).filter(Boolean).length / 2.9;
267
+ }
268
+ var Narrator = class {
269
+ constructor(take, story, options = {}) {
270
+ this.take = take;
271
+ const scriptFile = path.resolve(options.scriptDir ?? "e2e/record", `${story}.narration.json`);
272
+ const script = JSON.parse(readFileSync(scriptFile, "utf8"));
273
+ const clips = path.resolve(options.clipsDir ?? "e2e/videos/narration", story);
274
+ const manifest = path.join(clips, "manifest.json");
275
+ const spoken = existsSync(manifest) ? JSON.parse(readFileSync(manifest, "utf8")).lines : {};
276
+ this.voiced = Object.keys(spoken).length > 0;
277
+ for (const { id, text } of script.lines) {
278
+ const clip = spoken[id];
279
+ this.lines.set(
280
+ id,
281
+ clip && clip.text === text ? { text, duration: clip.duration, file: path.join(clips, clip.file) } : { text, duration: readingSeconds(text) }
282
+ );
283
+ }
284
+ this.stale = [...this.lines].filter(([, l]) => !l.file).map(([id]) => id);
285
+ if (this.voiced && this.stale.length)
286
+ console.warn(`[narration] not spoken yet (run arbidocs-voice-take): ${this.stale.join(", ")}`);
287
+ this.logFile = take.focusFile.replace(/\.focus\.json$/, ".narration.json");
288
+ this.save();
289
+ }
290
+ take;
291
+ lines = /* @__PURE__ */ new Map();
292
+ said = [];
293
+ logFile;
294
+ until = 0;
295
+ /** Whether any line has a clip (else the take is a silent rehearsal, paced by reading time). */
296
+ voiced;
297
+ /** The lines whose clip is missing or was spoken from other words. */
298
+ stale;
299
+ /** The line `id` of the script. */
300
+ line(id) {
301
+ const line = this.lines.get(id);
302
+ if (!line) throw new Error(`no line "${id}" in the narration`);
303
+ return line;
304
+ }
305
+ /**
306
+ * Say the line `id`, captioned in the band: once the line before it has ended, and held until
307
+ * it has been said, and `afterMs` more. `over`: return at once, the line said over what the
308
+ * story does next (start a line as the screen begins to change, so the speech covers the change
309
+ * instead of waiting for it). `caption: false` for a line said over a card, which covers the
310
+ * band: the frame stays still as the card fades in.
311
+ */
312
+ async say(id, { over = false, afterMs = 0, caption = true } = {}) {
313
+ const line = this.line(id);
314
+ await this.hush();
315
+ let start = this.take.now();
316
+ if (caption) {
317
+ await bandSay(this.take.page, line.text, 0, line.duration * 1e3 + NARRATION_LINGER_MS);
318
+ start = this.take.now();
319
+ }
320
+ this.until = start + line.duration;
321
+ this.take.record({
322
+ kind: "read",
323
+ mode: "none",
324
+ label: `narration: ${id}`,
325
+ start,
326
+ end: this.until,
327
+ box: BAND_BOX
328
+ });
329
+ this.said.push({
330
+ id,
331
+ start: Math.round(start * 1e3) / 1e3,
332
+ duration: line.duration,
333
+ file: line.file,
334
+ caption
335
+ });
336
+ this.save();
337
+ if (!over) await this.hush(afterMs);
338
+ }
339
+ /**
340
+ * Wait for the line being said to end, a narrator's breath after it (and `extraMs`). Call it
341
+ * before any logged wait and before a card: speech cannot be cut.
342
+ */
343
+ async hush(extraMs = 0) {
344
+ const left = (this.until - this.take.now()) * 1e3 + NARRATION_GAP_MS + extraMs;
345
+ if (left > 0) await this.take.page.waitForTimeout(left);
346
+ }
347
+ save() {
348
+ writeFileSync(this.logFile, JSON.stringify({ lines: this.said }, null, 1));
349
+ }
350
+ };
351
+
6
352
  // src/record/runs.ts
7
353
  async function spaGo(page, url) {
8
354
  await page.evaluate((to) => {
@@ -11,12 +357,12 @@ async function spaGo(page, url) {
11
357
  }, url);
12
358
  }
13
359
  async function openWordById(take, documentId, {
14
- path: path2 = "/app/documents",
360
+ path: path3 = "/app/documents",
15
361
  lowerThird,
16
362
  timeoutMs = 12e4
17
363
  } = {}) {
18
364
  const { page } = take;
19
- await spaGo(page, `${path2}?doc=${encodeURIComponent(documentId)}`);
365
+ await spaGo(page, `${path3}?doc=${encodeURIComponent(documentId)}`);
20
366
  const editor = page.getByTestId("native-docx-editor");
21
367
  await take.wait(
22
368
  "word: editor opens",
@@ -177,12 +523,12 @@ function createRunKit(cine, config = {}) {
177
523
  );
178
524
  }
179
525
  async function resumeRun(page, { env = "E2E_RESUME_RUN", readyTestId } = {}) {
180
- const path2 = process.env[env];
181
- if (!path2) return null;
182
- await spaGo(page, path2);
526
+ const path3 = process.env[env];
527
+ if (!path3) return null;
528
+ await spaGo(page, path3);
183
529
  const ready = readyTestId ? page.getByTestId(readyTestId) : page.locator(`[data-testid^="${prefix}-step-"], [data-testid^="workflow-thread-step-"]`);
184
530
  await ready.first().waitFor({ state: "visible", timeout: 6e4 });
185
- return path2;
531
+ return path3;
186
532
  }
187
533
  return { stepChip, currentStep, whileWorking, driveRun, approveStep, pickTile, resumeRun };
188
534
  }
@@ -364,6 +710,8 @@ function createCinematic(config) {
364
710
  logout: config.testIds?.logout ?? "app-logout"
365
711
  };
366
712
  const toastSelector = config.toastSelector ?? "[data-sonner-toast]";
713
+ const style = config.style ?? "band";
714
+ const band = style === "band";
367
715
  const resolve = (page, t) => typeof t === "string" ? page.getByTestId(t) : t;
368
716
  async function boxOf(page, loc) {
369
717
  const box = await loc.boundingBox().catch(() => null);
@@ -387,7 +735,7 @@ function createCinematic(config) {
387
735
  return { loc, box };
388
736
  }
389
737
  async function take(page, options) {
390
- return new Take(page, options, b);
738
+ return new Take(page, band ? { zoom: false, pip: false, ...options } : options, b);
391
739
  }
392
740
  async function installStage(page) {
393
741
  await page.addInitScript(
@@ -420,9 +768,9 @@ function createCinematic(config) {
420
768
  cap.id = "__cine_cap";
421
769
  cap.style.cssText = `position:fixed;left:50%;bottom:34px;transform:translateX(-50%) translateY(8px);z-index:2147483646;max-width:72%;padding:13px 24px;border-radius:13px;font:500 17px/1.45 ${s.sansFont};color:#fff;letter-spacing:.01em;background:${s.ink}e0;backdrop-filter:blur(7px);box-shadow:0 10px 34px rgba(0,0,0,.4);text-align:center;opacity:0;transition:opacity .35s,transform .35s;`;
422
770
  document.body.appendChild(cap);
423
- const style = document.createElement("style");
424
- style.textContent = "@keyframes __cine_ripple{to{width:46px;height:46px;margin:-23px 0 0 -23px;opacity:0}}";
425
- document.head.appendChild(style);
771
+ const style2 = document.createElement("style");
772
+ style2.textContent = "@keyframes __cine_ripple{to{width:46px;height:46px;margin:-23px 0 0 -23px;opacity:0}}";
773
+ document.head.appendChild(style2);
426
774
  window.__cine_cap = (t) => {
427
775
  cap.textContent = t;
428
776
  cap.style.opacity = t ? "1" : "0";
@@ -453,6 +801,27 @@ function createCinematic(config) {
453
801
  },
454
802
  { s: skin, t0: Take.on(page)?.t0 ?? null, TC: TIMECODE_CELL }
455
803
  );
804
+ if (band) await installBand(page, skin, config.band);
805
+ }
806
+ async function feature2(page, kicker, name) {
807
+ if (band) await feature(page, kicker, name);
808
+ }
809
+ async function pulseAt2(page, box) {
810
+ if (band) await pulseAt(page, box);
811
+ }
812
+ async function interlude2(page, card, holdMs = 2200) {
813
+ if (!band) throw new Error("interlude is the band style's card: use chapter() in 'overlay'");
814
+ await interlude(page, skin, card, holdMs);
815
+ }
816
+ async function still(page) {
817
+ const toasts = page.locator(toastSelector);
818
+ const until = Date.now() + 8e3;
819
+ while (await toasts.count() && Date.now() < until) await page.waitForTimeout(200);
820
+ await page.waitForTimeout(500);
821
+ }
822
+ function narrator(take2, story, options) {
823
+ if (!band) throw new Error("a narrated take is captioned in the band: not in 'overlay'");
824
+ return new Narrator(take2, story, options);
456
825
  }
457
826
  async function cover(page, { kicker, title, subtitle }, holdMs = 2600) {
458
827
  const running = Take.on(page);
@@ -495,18 +864,30 @@ function createCinematic(config) {
495
864
  }
496
865
  async function caption(page, text, holdMs) {
497
866
  const running = Take.on(page);
498
- if (running) running.captionStart(text);
867
+ const hold = holdMs ?? readingMs(text);
868
+ if (band) {
869
+ const start = running?.now() ?? 0;
870
+ await bandSay(page, text, 0);
871
+ running?.record({
872
+ kind: "read",
873
+ mode: "none",
874
+ label: "caption",
875
+ start,
876
+ end: start + hold / 1e3,
877
+ box: BAND_BOX
878
+ });
879
+ } else if (running) running.captionStart(text);
499
880
  else
500
881
  await page.evaluate(
501
882
  (t) => window.__cine_cap?.(t),
502
883
  text
503
884
  );
504
- const hold = holdMs ?? Math.min(4200, 900 + text.length * 45);
505
885
  await page.waitForTimeout(hold);
506
886
  }
507
887
  async function clearCaption(page) {
508
888
  const running = Take.on(page);
509
- if (running) running.captionEnd();
889
+ if (band) await bandSay(page, "", 0);
890
+ else if (running) running.captionEnd();
510
891
  else
511
892
  await page.evaluate(
512
893
  () => window.__cine_cap?.("")
@@ -610,8 +991,14 @@ function createCinematic(config) {
610
991
  await page.getByTestId(ids.userMenu).waitFor({ state: "visible", timeout: 6e4 });
611
992
  }
612
993
  return {
994
+ style,
613
995
  take,
614
996
  installStage,
997
+ feature: feature2,
998
+ pulseAt: pulseAt2,
999
+ interlude: interlude2,
1000
+ still,
1001
+ narrator,
615
1002
  cover,
616
1003
  chapter,
617
1004
  uncover,
@@ -630,6 +1017,6 @@ function createCinematic(config) {
630
1017
  };
631
1018
  }
632
1019
 
633
- export { TIMECODE_CELL, Take, cinematicSkin, createCinematic, createRunKit, fillSecret, openWordById, spaGo };
1020
+ export { BAND_BOX, BAND_FRAME, BAND_HEIGHT, BAND_LABEL_WIDTH, CHUNK_MS, NARRATION_GAP_MS, NARRATION_LINGER_MS, Narrator, PLAYER_STRIP, TIMECODE_CELL, Take, bandSay, captionChunks, cinematicSkin, createCinematic, createRunKit, fillSecret, installBand, openWordById, readingMs, readingSeconds, spaGo };
634
1021
  //# sourceMappingURL=index.js.map
635
1022
  //# sourceMappingURL=index.js.map