@javierfrancoleal/dsh-supervisor 1.0.44 → 1.0.46

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/dashboard.html CHANGED
@@ -418,6 +418,8 @@ $("soundBtn").onclick=()=>{soundOn=!soundOn;try{localStorage.setItem("dsh-sound"
418
418
  try{darkOn=localStorage.getItem("dsh-dark")==="1";soundOn=localStorage.getItem("dsh-sound")!=="0";}catch(e){}
419
419
  applyToggles();
420
420
  document.body.classList.add("loginpage");
421
+ // ?reset clears the local memory and reloads — instant first-run for testing
422
+ if(/[?&]reset/.test(location.search)){try{["dsh-lang","dsh-theme","dsh-sup-token","dsh-sup-me"].forEach(k=>localStorage.removeItem(k));}catch(e){}}
421
423
  const firstRun=(()=>{try{return !localStorage.getItem("dsh-lang");}catch(e){return true;}})();
422
424
  if(firstRun){
423
425
  $("splash").style.display="none";
@@ -555,7 +557,7 @@ function buildLangMenu(){
555
557
  const r=document.createElement("div");
556
558
  r.className="orow"+(l==="en"?" center":"");
557
559
  r.innerHTML='<span>'+LANGNAMES[l]+'</span><span class="sub">'+l.toUpperCase()+'</span>';
558
- r.onclick=()=>{cur=l;try{localStorage.setItem("dsh-lang",cur);}catch(e){}applyLang();$("langOverlay").style.display="none";markReel();$("langStep").style.display="none";const sp=$("splash");sp.classList.remove("done");const p=sp.querySelector("svg path");if(p){p.style.animation="none";void p.offsetWidth;p.style.animation="";}const tag=$("splashTag");if(tag){tag.textContent=t("tagline");}setTimeout(()=>{$("loginView").style.display="";document.body.classList.remove("firstboot");},2100);setTimeout(()=>{sp.classList.add("done");},2600);};
560
+ r.onclick=()=>{cur=l;try{localStorage.setItem("dsh-lang",cur);}catch(e){}applyLang();$("langOverlay").style.display="none";markReel();$("langStep").style.display="none";bootFlash(2600,()=>{$("loginView").style.display="";document.body.classList.remove("firstboot");});};
559
561
  rows.appendChild(r);
560
562
  }
561
563
  }
@@ -585,6 +587,15 @@ $("langStepReel").onclick=()=>{$("langOverlay").style.display="flex";const en=do
585
587
  $("closeOverlay").onclick=()=>{$("langOverlay").style.display="none";};
586
588
  // The Apple flow: after the splash, the language menu opens once (until chosen).
587
589
 
590
+ function bootFlash(ms,then){
591
+ const sp=$("splash");
592
+ sp.style.display="flex";
593
+ sp.classList.remove("done");
594
+ const p=sp.querySelector("svg path");
595
+ if(p){p.style.animation="none";void p.offsetWidth;p.style.animation="";}
596
+ const tag=$("splashTag");if(tag){tag.textContent=t("tagline");}
597
+ setTimeout(()=>{sp.classList.add("done");if(then)then();},ms);
598
+ }
588
599
  function pill(l){for(const host of ["footLangs"]){const el=$(host);if(!el)continue;const b=document.createElement("button");b.className="pill";b.dataset.l=l;b.textContent=LANG[l];b.onclick=()=>{cur=l;try{localStorage.setItem("dsh-lang",cur);}catch(e){}applyLang();};$(host).appendChild(b);}}
589
600
  for(const l of Object.keys(LANG))pill(l);
590
601
  try{const q=new URLSearchParams(location.search);const ql=q.get("lang");if(ql&&S[ql])cur=ql;}catch(e){}
@@ -700,7 +711,7 @@ $("setupBtn").onclick=async()=>{
700
711
  if(r.error){$("setupBtn").disabled=false;$("setupBtn").textContent=t("setupBtn");toast(String(r.error).indexOf("already")>=0?t("loginFailed"):r.error);return;}
701
712
  token=r.token;me={name:r.name,role:r.role,label:r.label||r.name};
702
713
  sessionStorage.setItem("dsh-sup-token",token);sessionStorage.setItem("dsh-sup-me",JSON.stringify(me));
703
- enter();
714
+ bootFlash(1400,()=>enter());
704
715
  };
705
716
  $("loginBtn").onclick=async()=>{
706
717
  const err=$("loginError");
@@ -714,9 +725,9 @@ $("loginBtn").onclick=async()=>{
714
725
  err.classList.add("hidden");
715
726
  token=r.token;me={name:r.name,role:r.role,label:r.label||r.name};
716
727
  sessionStorage.setItem("dsh-sup-token",token);sessionStorage.setItem("dsh-sup-me",JSON.stringify(me));
717
- $("loginPass").value="";enter();
728
+ $("loginPass").value="";bootFlash(1400,()=>enter());
718
729
  };
719
- function logout(){api("/api/logout",{});token=null;me=null;sessionStorage.clear();if(livePoll)clearInterval(livePoll);if(kitchenPoll)clearInterval(kitchenPoll);setWho();show("loginView");}
730
+ function logout(){api("/api/logout",{});token=null;me=null;sessionStorage.clear();if(livePoll)clearInterval(livePoll);if(kitchenPoll)clearInterval(kitchenPoll);setWho();bootFlash(1200,()=>show("loginView"));}
720
731
  $("logoutBtn").onclick=logout;
721
732
  const sb=$("switchBtn");if(sb)sb.onclick=logout;
722
733
  async function loadUsers(){const tb=$("usersTable").querySelector("tbody");tb.innerHTML='<tr><td colspan="2">'+skel(2)+'</td></tr>';const r=await api("/api/users");tb.innerHTML="";(r.users||[]).forEach(u=>{const tr=document.createElement("tr");tr.innerHTML="<td>"+esc(u.name)+"</td><td>"+esc(u.label||u.name)+" · "+t(LVL[u.role]||"lvlEmployee")+"</td>";tb.appendChild(tr);});}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@javierfrancoleal/dsh-supervisor",
3
- "version": "1.0.44",
3
+ "version": "1.0.46",
4
4
  "description": "The Veilleux central control plane of the J.Franco agentic workflow suite: user accounts, the live conversation flow (listen → per-person summary → confirm → orders), telemetry, and the universal sector dashboard with 10 languages. Created by J.Franco.",
5
5
  "author": "J.Franco",
6
6
  "license": "MIT",
package/server.js CHANGED
@@ -44,7 +44,7 @@ const LIVE_FILE = path.join(DATA_DIR, "live.json");
44
44
  const SECTOR_FILE = path.join(DATA_DIR, "sector.json");
45
45
  const REG_FILE = path.join(DATA_DIR, "register.json");
46
46
  const PRICE_PER_MILLION = Number(process.env.DSH_PRICE_PER_MILLION || 0.28);
47
- const VERSION = "1.0.40";
47
+ const VERSION = "1.0.46";
48
48
  // Homeostasis: the daily token budget (metabolic limit). The brain rests
49
49
  // when the budget is spent — no runaway costs.
50
50
  const DAILY_BUDGET_USD = Number(process.env.DSH_DAILY_BUDGET_USD || 0); // 0 = unlimited: consumption is the business