Spaces:
Running
Running
deploy(hf): sync szl-holdings/a11oy@613921b8dab028c54b5f9d4417aceba6f4c71da1 derived COPY set
Browse filesReusable Dockerfile-COPY-derived deploy from szl-holdings/a11oy 613921b8dab028c54b5f9d4417aceba6f4c71da1.
Files: 1182 Pruned: 0
Derived from Dockerfile COPY sources (NO hand-maintained allowlist).
Signed-off-by: SZL Holdings <noreply@szlholdings.ai>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- serve.py +2 -2
- static-vendor/a11oy-operator-widget.js +92 -10
serve.py
CHANGED
|
@@ -11220,7 +11220,7 @@ try:
|
|
| 11220 |
from starlette.responses import Response as _OPW_Response
|
| 11221 |
|
| 11222 |
_OPW_TAG = (
|
| 11223 |
-
b'<script src="/vendor/a11oy-operator-widget.js" '
|
| 11224 |
b'data-surface="a11oy" defer></script>'
|
| 11225 |
)
|
| 11226 |
_OPW_MARKER = b'a11oy-operator-widget.js'
|
|
@@ -11299,7 +11299,7 @@ async def spa_root():
|
|
| 11299 |
emits http.response.body bytes that every middleware handles correctly. Idempotent
|
| 11300 |
+ try/except guarded; FileResponse fallback only if no file is readable."""
|
| 11301 |
from starlette.responses import Response as _SPA_Resp
|
| 11302 |
-
_SPA_TAG = (b'<script src="/vendor/a11oy-operator-widget.js" '
|
| 11303 |
b'data-surface="a11oy" defer></script>')
|
| 11304 |
# Front door order: the holographic landing first (governed-inference field,
|
| 11305 |
# vendored Three.js r160, live receipt/mesh weave-ins + in-browser WebCrypto
|
|
|
|
| 11220 |
from starlette.responses import Response as _OPW_Response
|
| 11221 |
|
| 11222 |
_OPW_TAG = (
|
| 11223 |
+
b'<script src="/vendor/a11oy-operator-widget.js?v=a9d3ed961a7b3606d5721de4d56f478fbef85b6d1dd04447e26500068708ba0c" '
|
| 11224 |
b'data-surface="a11oy" defer></script>'
|
| 11225 |
)
|
| 11226 |
_OPW_MARKER = b'a11oy-operator-widget.js'
|
|
|
|
| 11299 |
emits http.response.body bytes that every middleware handles correctly. Idempotent
|
| 11300 |
+ try/except guarded; FileResponse fallback only if no file is readable."""
|
| 11301 |
from starlette.responses import Response as _SPA_Resp
|
| 11302 |
+
_SPA_TAG = (b'<script src="/vendor/a11oy-operator-widget.js?v=a9d3ed961a7b3606d5721de4d56f478fbef85b6d1dd04447e26500068708ba0c" '
|
| 11303 |
b'data-surface="a11oy" defer></script>')
|
| 11304 |
# Front door order: the holographic landing first (governed-inference field,
|
| 11305 |
# vendored Three.js r160, live receipt/mesh weave-ins + in-browser WebCrypto
|
static-vendor/a11oy-operator-widget.js
CHANGED
|
@@ -125,7 +125,9 @@
|
|
| 125 |
|
| 126 |
// ---- CSS (neutral governed palette: deep navy + signed gold + emerald) ----
|
| 127 |
var css = [
|
| 128 |
-
'.aow-root{
|
|
|
|
|
|
|
| 129 |
'.aow-fab{width:56px;height:56px;border-radius:50%;border:1px solid rgba(201,183,135,0.45);cursor:pointer;',
|
| 130 |
'background:linear-gradient(135deg,#16203a 0%,#0a0f1e 100%);',
|
| 131 |
'box-shadow:0 4px 20px rgba(0,0,0,0.5);display:flex;align-items:center;justify-content:center;',
|
|
@@ -138,11 +140,23 @@
|
|
| 138 |
'border-radius:9px;background:#c8415d;color:#fff;font-size:11px;font-weight:700;',
|
| 139 |
'display:none;align-items:center;justify-content:center;padding:0 4px;border:2px solid #0a0f1e;}',
|
| 140 |
'[data-unread="true"] .aow-badge{display:flex;}',
|
| 141 |
-
'.aow-panel{position:fixed;bottom:92px;right:
|
| 142 |
-
'height:540px;max-height:calc(100vh - 120px);background:#0c1322;',
|
| 143 |
'border:1px solid rgba(201,183,135,0.22);border-radius:16px;display:none;flex-direction:column;',
|
| 144 |
'box-shadow:0 8px 40px rgba(0,0,0,0.65);overflow:hidden;}',
|
| 145 |
'[data-open="true"] .aow-panel{display:flex;}',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 146 |
'.aow-head{display:flex;align-items:center;gap:10px;padding:12px 14px;',
|
| 147 |
'border-bottom:1px solid rgba(201,183,135,0.16);background:rgba(22,32,58,0.6);}',
|
| 148 |
'.aow-head-avatar{width:34px;height:34px;border-radius:50%;object-fit:cover;flex-shrink:0;}',
|
|
@@ -192,9 +206,11 @@
|
|
| 192 |
'font-weight:700;font-size:16px;width:36px;height:36px;cursor:pointer;flex-shrink:0;',
|
| 193 |
'display:flex;align-items:center;justify-content:center;transition:background .15s;}',
|
| 194 |
'.aow-send:hover{background:#dccca0;}',
|
| 195 |
-
'.aow-toasts{position:fixed;bottom:92px;right:
|
| 196 |
-
'z-index:2147483646;pointer-events:none;width:330px;max-width:calc(100vw -
|
| 197 |
-
'.aow-root[data-
|
|
|
|
|
|
|
| 198 |
'.aow-toast{display:flex;align-items:flex-start;gap:10px;background:#0c1322;',
|
| 199 |
'border:1px solid rgba(201,183,135,0.22);border-radius:12px;padding:10px 12px;',
|
| 200 |
'box-shadow:0 4px 16px rgba(0,0,0,0.55);pointer-events:all;animation:aow-toast-in .2s ease-out;}',
|
|
@@ -219,7 +235,11 @@
|
|
| 219 |
(document.head || document.documentElement).appendChild(style);
|
| 220 |
|
| 221 |
// ---- Build the DOM ----
|
| 222 |
-
var root = el('div', {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 223 |
root.setAttribute('data-a11oy-operator', 'widget');
|
| 224 |
|
| 225 |
var fabImg = el('img', { src: PORTRAIT, alt: '', 'aria-hidden': 'true' });
|
|
@@ -290,9 +310,30 @@
|
|
| 290 |
root.appendChild(panel);
|
| 291 |
root.appendChild(fab);
|
| 292 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 293 |
function mount() {
|
| 294 |
if (!document.body) { document.addEventListener('DOMContentLoaded', mount); return; }
|
| 295 |
document.body.appendChild(root);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 296 |
renderThread();
|
| 297 |
refreshBadge();
|
| 298 |
checkStatus();
|
|
@@ -301,26 +342,67 @@
|
|
| 301 |
|
| 302 |
// ---- Open / close ----
|
| 303 |
var isOpen = false;
|
|
|
|
| 304 |
function open() {
|
| 305 |
isOpen = true;
|
|
|
|
| 306 |
root.setAttribute('data-open', 'true');
|
| 307 |
fab.setAttribute('aria-expanded', 'true');
|
| 308 |
state.unread = 0; persist(); refreshBadge();
|
| 309 |
if (!thread.length) renderThread();
|
| 310 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 311 |
scrollThread();
|
| 312 |
}
|
| 313 |
-
function close() {
|
| 314 |
isOpen = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 315 |
root.setAttribute('data-open', 'false');
|
| 316 |
fab.setAttribute('aria-expanded', 'false');
|
| 317 |
-
fab.focus();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 318 |
}
|
| 319 |
function toggle() { isOpen ? close() : open(); }
|
| 320 |
|
| 321 |
fab.addEventListener('click', toggle);
|
| 322 |
closeBtn.addEventListener('click', close);
|
| 323 |
document.addEventListener('keydown', function (e) { if (e.key === 'Escape' && isOpen) close(); });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 324 |
|
| 325 |
// ---- Thread rendering ----
|
| 326 |
function refreshBadge() {
|
|
|
|
| 125 |
|
| 126 |
// ---- CSS (neutral governed palette: deep navy + signed gold + emerald) ----
|
| 127 |
var css = [
|
| 128 |
+
'.aow-root{--aow-dock-bottom:24px;position:fixed;bottom:calc(env(safe-area-inset-bottom,0px) + var(--aow-dock-bottom));',
|
| 129 |
+
'right:calc(env(safe-area-inset-right,0px) + 16px);z-index:2147483647;font-family:"Inter",system-ui,sans-serif;font-size:14px;line-height:1.5;}',
|
| 130 |
+
'.aow-root[data-dock-has-cop="true"]{--aow-dock-bottom:72px;}',
|
| 131 |
'.aow-fab{width:56px;height:56px;border-radius:50%;border:1px solid rgba(201,183,135,0.45);cursor:pointer;',
|
| 132 |
'background:linear-gradient(135deg,#16203a 0%,#0a0f1e 100%);',
|
| 133 |
'box-shadow:0 4px 20px rgba(0,0,0,0.5);display:flex;align-items:center;justify-content:center;',
|
|
|
|
| 140 |
'border-radius:9px;background:#c8415d;color:#fff;font-size:11px;font-weight:700;',
|
| 141 |
'display:none;align-items:center;justify-content:center;padding:0 4px;border:2px solid #0a0f1e;}',
|
| 142 |
'[data-unread="true"] .aow-badge{display:flex;}',
|
| 143 |
+
'.aow-panel{position:fixed;bottom:calc(env(safe-area-inset-bottom,0px) + 92px);right:calc(env(safe-area-inset-right,0px) + 16px);width:370px;max-width:calc(100vw - 32px);',
|
| 144 |
+
'height:540px;max-height:calc(100vh - 120px - env(safe-area-inset-bottom,0px));background:#0c1322;',
|
| 145 |
'border:1px solid rgba(201,183,135,0.22);border-radius:16px;display:none;flex-direction:column;',
|
| 146 |
'box-shadow:0 8px 40px rgba(0,0,0,0.65);overflow:hidden;}',
|
| 147 |
'[data-open="true"] .aow-panel{display:flex;}',
|
| 148 |
+
'.aow-root[data-dock-has-cop="true"] .aow-panel{bottom:calc(env(safe-area-inset-bottom,0px) + 140px);max-height:calc(100vh - 168px - env(safe-area-inset-bottom,0px));}',
|
| 149 |
+
'.aow-root[data-dock-has-investor="true"] .aow-panel{bottom:calc(env(safe-area-inset-bottom,0px) + 200px);max-height:calc(100vh - 228px - env(safe-area-inset-bottom,0px));}',
|
| 150 |
+
'@media (max-height:480px) and (min-width:600px){.aow-root[data-dock-has-investor="true"] .aow-panel{top:calc(env(safe-area-inset-top,0px) + 8px);bottom:calc(env(safe-area-inset-bottom,0px) + 8px);right:calc(env(safe-area-inset-right,0px) + 176px);height:auto;max-height:none;max-width:calc(100vw - 192px);}}',
|
| 151 |
+
'@media (max-height:480px) and (max-width:599px){',
|
| 152 |
+
'.aow-root[data-open="true"][data-dock-has-investor="true"]{--aow-dock-bottom:8px;right:calc(env(safe-area-inset-right,0px) + 80px);}',
|
| 153 |
+
'.aow-root[data-dock-has-investor="true"] .aow-panel{top:calc(env(safe-area-inset-top,0px) + 8px);bottom:calc(env(safe-area-inset-bottom,0px) + 72px);left:calc(env(safe-area-inset-left,0px) + 8px);right:calc(env(safe-area-inset-right,0px) + 8px);width:auto;height:auto;max-height:none;max-width:none;}',
|
| 154 |
+
'html[data-aow-panel-open="true"] [data-szl-dock-control="cop"]{bottom:calc(env(safe-area-inset-bottom,0px) + 8px)!important;right:calc(env(safe-area-inset-right,0px) + 16px)!important;width:56px!important;min-width:56px!important;max-width:56px!important;min-height:56px!important;padding:0!important;justify-content:center!important;font-size:0!important;}',
|
| 155 |
+
'html[data-aow-panel-open="true"] [data-szl-dock-control="investor"]{bottom:calc(env(safe-area-inset-bottom,0px) + 8px)!important;right:calc(env(safe-area-inset-right,0px) + 144px)!important;width:56px!important;min-width:56px!important;max-width:56px!important;min-height:56px!important;padding:0!important;justify-content:center!important;gap:0!important;font-size:0!important;}',
|
| 156 |
+
'html[data-aow-panel-open="true"] [data-szl-dock-control="investor"]>*{display:none!important;}',
|
| 157 |
+
'html[data-aow-panel-open="true"] [data-szl-dock-control="cop"]::after{content:"COP";font:700 10px/1 ui-monospace,"JetBrains Mono",monospace;letter-spacing:.08em;}',
|
| 158 |
+
'html[data-aow-panel-open="true"] [data-szl-dock-control="investor"]::after{content:"INV";font:700 10px/1 ui-monospace,"JetBrains Mono",monospace;letter-spacing:.08em;}',
|
| 159 |
+
'}',
|
| 160 |
'.aow-head{display:flex;align-items:center;gap:10px;padding:12px 14px;',
|
| 161 |
'border-bottom:1px solid rgba(201,183,135,0.16);background:rgba(22,32,58,0.6);}',
|
| 162 |
'.aow-head-avatar{width:34px;height:34px;border-radius:50%;object-fit:cover;flex-shrink:0;}',
|
|
|
|
| 206 |
'font-weight:700;font-size:16px;width:36px;height:36px;cursor:pointer;flex-shrink:0;',
|
| 207 |
'display:flex;align-items:center;justify-content:center;transition:background .15s;}',
|
| 208 |
'.aow-send:hover{background:#dccca0;}',
|
| 209 |
+
'.aow-toasts{position:fixed;bottom:calc(env(safe-area-inset-bottom,0px) + 92px);right:calc(env(safe-area-inset-right,0px) + 16px);display:flex;flex-direction:column;gap:8px;',
|
| 210 |
+
'z-index:2147483646;pointer-events:none;width:330px;max-width:calc(100vw - 32px);}',
|
| 211 |
+
'.aow-root[data-dock-has-cop="true"] .aow-toasts{bottom:calc(env(safe-area-inset-bottom,0px) + 140px);}',
|
| 212 |
+
'.aow-root[data-dock-has-investor="true"] .aow-toasts{bottom:calc(env(safe-area-inset-bottom,0px) + 200px);}',
|
| 213 |
+
'.aow-root[data-open="true"] .aow-toasts{display:none;}',
|
| 214 |
'.aow-toast{display:flex;align-items:flex-start;gap:10px;background:#0c1322;',
|
| 215 |
'border:1px solid rgba(201,183,135,0.22);border-radius:12px;padding:10px 12px;',
|
| 216 |
'box-shadow:0 4px 16px rgba(0,0,0,0.55);pointer-events:all;animation:aow-toast-in .2s ease-out;}',
|
|
|
|
| 235 |
(document.head || document.documentElement).appendChild(style);
|
| 236 |
|
| 237 |
// ---- Build the DOM ----
|
| 238 |
+
var root = el('div', {
|
| 239 |
+
class: 'aow-root', 'data-open': 'false', 'data-unread': 'false',
|
| 240 |
+
'data-dock-has-cop': 'false', 'data-dock-has-investor': 'false',
|
| 241 |
+
'data-szl-dock-control': 'operator'
|
| 242 |
+
});
|
| 243 |
root.setAttribute('data-a11oy-operator', 'widget');
|
| 244 |
|
| 245 |
var fabImg = el('img', { src: PORTRAIT, alt: '', 'aria-hidden': 'true' });
|
|
|
|
| 310 |
root.appendChild(panel);
|
| 311 |
root.appendChild(fab);
|
| 312 |
|
| 313 |
+
function syncDockPosition() {
|
| 314 |
+
var hasInvestor = Boolean(document.querySelector('[data-szl-dock-control="investor"]'));
|
| 315 |
+
root.setAttribute(
|
| 316 |
+
'data-dock-has-cop',
|
| 317 |
+
document.querySelector('[data-szl-dock-control="cop"]') ? 'true' : 'false'
|
| 318 |
+
);
|
| 319 |
+
root.setAttribute(
|
| 320 |
+
'data-dock-has-investor',
|
| 321 |
+
hasInvestor ? 'true' : 'false'
|
| 322 |
+
);
|
| 323 |
+
if (isOpen && hasInvestor) document.documentElement.setAttribute('data-aow-panel-open', 'true');
|
| 324 |
+
else document.documentElement.removeAttribute('data-aow-panel-open');
|
| 325 |
+
}
|
| 326 |
+
|
| 327 |
function mount() {
|
| 328 |
if (!document.body) { document.addEventListener('DOMContentLoaded', mount); return; }
|
| 329 |
document.body.appendChild(root);
|
| 330 |
+
syncDockPosition();
|
| 331 |
+
setTimeout(syncDockPosition, 0);
|
| 332 |
+
window.addEventListener('load', syncDockPosition, { once: true });
|
| 333 |
+
if (typeof window.MutationObserver === 'function') {
|
| 334 |
+
var dockObserver = new window.MutationObserver(syncDockPosition);
|
| 335 |
+
dockObserver.observe(document.body, { childList: true, subtree: true });
|
| 336 |
+
}
|
| 337 |
renderThread();
|
| 338 |
refreshBadge();
|
| 339 |
checkStatus();
|
|
|
|
| 342 |
|
| 343 |
// ---- Open / close ----
|
| 344 |
var isOpen = false;
|
| 345 |
+
var inputFocusTimer = null;
|
| 346 |
function open() {
|
| 347 |
isOpen = true;
|
| 348 |
+
syncDockPosition();
|
| 349 |
root.setAttribute('data-open', 'true');
|
| 350 |
fab.setAttribute('aria-expanded', 'true');
|
| 351 |
state.unread = 0; persist(); refreshBadge();
|
| 352 |
if (!thread.length) renderThread();
|
| 353 |
+
if (inputFocusTimer !== null) clearTimeout(inputFocusTimer);
|
| 354 |
+
inputFocusTimer = setTimeout(function () {
|
| 355 |
+
inputFocusTimer = null;
|
| 356 |
+
if (isOpen) input.focus();
|
| 357 |
+
}, 60);
|
| 358 |
scrollThread();
|
| 359 |
}
|
| 360 |
+
function close(restoreFocus) {
|
| 361 |
isOpen = false;
|
| 362 |
+
if (inputFocusTimer !== null) {
|
| 363 |
+
clearTimeout(inputFocusTimer);
|
| 364 |
+
inputFocusTimer = null;
|
| 365 |
+
}
|
| 366 |
+
document.documentElement.removeAttribute('data-aow-panel-open');
|
| 367 |
root.setAttribute('data-open', 'false');
|
| 368 |
fab.setAttribute('aria-expanded', 'false');
|
| 369 |
+
if (restoreFocus !== false) fab.focus();
|
| 370 |
+
}
|
| 371 |
+
function focusControlledDialog(control) {
|
| 372 |
+
setTimeout(function () {
|
| 373 |
+
if (!control || typeof control.getAttribute !== 'function') return;
|
| 374 |
+
var dialogId = control.getAttribute('aria-controls');
|
| 375 |
+
var dialog = dialogId && document.getElementById(dialogId);
|
| 376 |
+
if (
|
| 377 |
+
!dialog ||
|
| 378 |
+
control.getAttribute('aria-expanded') !== 'true' ||
|
| 379 |
+
dialog.getAttribute('aria-modal') !== 'true'
|
| 380 |
+
) return;
|
| 381 |
+
var focusTarget = dialog.querySelector(
|
| 382 |
+
'[autofocus], [data-szl-initial-focus], button:not([disabled]), ' +
|
| 383 |
+
'[href], input:not([disabled]), select:not([disabled]), ' +
|
| 384 |
+
'textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'
|
| 385 |
+
);
|
| 386 |
+
if (!focusTarget) {
|
| 387 |
+
if (!dialog.hasAttribute('tabindex')) dialog.setAttribute('tabindex', '-1');
|
| 388 |
+
focusTarget = dialog;
|
| 389 |
+
}
|
| 390 |
+
if (typeof focusTarget.focus === 'function') focusTarget.focus();
|
| 391 |
+
}, 0);
|
| 392 |
}
|
| 393 |
function toggle() { isOpen ? close() : open(); }
|
| 394 |
|
| 395 |
fab.addEventListener('click', toggle);
|
| 396 |
closeBtn.addEventListener('click', close);
|
| 397 |
document.addEventListener('keydown', function (e) { if (e.key === 'Escape' && isOpen) close(); });
|
| 398 |
+
document.addEventListener('click', function (e) {
|
| 399 |
+
var target = e.target;
|
| 400 |
+
if (!isOpen || !target || typeof target.closest !== 'function') return;
|
| 401 |
+
var investorControl = target.closest('[data-szl-dock-control="investor"]');
|
| 402 |
+
if (!investorControl) return;
|
| 403 |
+
close(false);
|
| 404 |
+
focusControlledDialog(investorControl);
|
| 405 |
+
}, true);
|
| 406 |
|
| 407 |
// ---- Thread rendering ----
|
| 408 |
function refreshBadge() {
|