@javierfrancoleal/dsh-supervisor 1.0.53 β†’ 1.0.55

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
@@ -262,6 +262,7 @@ body.wall pre{max-height:40vh}
262
262
  <span class="who" id="who"></span>
263
263
  <span class="chip" id="idChip" style="display:none"></span>
264
264
  <button class="btn small gray" id="darkBtn">πŸŒ™</button>
265
+ <button class="btn small gray" id="notifBell" title="Notifications" style="position:relative">πŸ””<span id="notifBadge" class="hidden" style="position:absolute;top:-7px;right:-7px;background:#ef4444;color:#fff;border-radius:999px;min-width:19px;height:19px;font-size:11px;font-weight:800;display:flex;align-items:center;justify-content:center;padding:0 4px;box-shadow:0 2px 6px rgba(239,68,68,.5)">0</span></button>
265
266
  <button class="btn small gray" id="soundBtn">πŸ”Š</button>
266
267
  <button class="btn small gray" id="logoutBtn" style="display:none">Log out</button>
267
268
  </header>
@@ -571,7 +572,7 @@ function noticePoll(){
571
572
  const n=(l.notices||[]).slice(-1)[0];
572
573
  if(n&&n.ts!==lastNoticeTs){lastNoticeTs=n.ts;toast("πŸ“’ "+n.text);}
573
574
  }
574
- const STUDIO_TYPES={social:"Social publication",email:"Email reply",quote:"Quote / bid",job:"Job posting",agenda:"Agenda & follow-ups",other:"Other"};
575
+ const STUDIO_TYPES={social:"Social publication",email:"Email reply",quote:"Quote / bid",job:"Job posting",agenda:"Agenda & follow-ups",invoice:"Invoice filing",meeting:"Meeting summary",translation:"Translation",review:"Customer review",report:"Daily report",other:"Other"};
575
576
  function renderInbox(items){
576
577
  const pend=items.filter(x=>x.status==="done");
577
578
  $("inboxList").innerHTML=pend.length?pend.map(x=>{
@@ -604,10 +605,22 @@ async function decideInbox(id,decision){
604
605
  $("inboxList").classList.remove("hidden");
605
606
  loadStudio();
606
607
  }
608
+ async function refreshNotifBadge(){
609
+ try{
610
+ const r=await api("/api/studio");
611
+ if(!r||r.error)return;
612
+ const n=(r.tasks||[]).filter(x=>x.status==="done").length;
613
+ const b=$("notifBadge");
614
+ if(n>0){b.textContent=n;b.classList.remove("hidden");}else b.classList.add("hidden");
615
+ }catch(e){}
616
+ }
617
+ $("notifBell").onclick=()=>{$("inboxView").style.display="flex";loadStudio();};
618
+ setInterval(refreshNotifBadge,30000);
607
619
  async function loadStudio(){
608
620
  const r=await api("/api/studio");
609
621
  if(!r||r.error)return;
610
622
  renderInbox(r.tasks||[]);
623
+ refreshNotifBadge();
611
624
  }
612
625
  $("inboxClose").onclick=()=>{$("inboxView").style.display="none";};
613
626
  // (tasks arrive from the kitchen β€” the inbox shows them for decision)
@@ -773,7 +786,7 @@ function applyPack(){if(!PACK)return;$("tableInput").placeholder=(PACK.tableLabe
773
786
  const api=async(p,body)=>{try{const r=await fetch(p,{method:body?"POST":"GET",headers:{"Content-Type":"application/json",...(token?{Authorization:"Bearer "+token}:{})},body:body?JSON.stringify(body):undefined});return r.json();}catch(e){return {error:"network"};}};
774
787
  function show(view){["loginView","ownerView","leadView","employeeView","wallView"].forEach(v=>$(v).classList.add("hidden"));const el=$(view);el.classList.remove("hidden");el.classList.remove("anim");void el.offsetWidth;el.classList.add("anim");document.body.classList.toggle("loginpage",view==="loginView");}
775
788
  const LVL={employee:"lvlEmployee",lead:"lvlLead",owner:"lvlOwner"};
776
- function setWho(){const w=$("who");w.textContent=me?(me.label||me.name):"";const c=$("idChip");if(me){c.style.display="inline-block";c.textContent=me.name.slice(0,1).toUpperCase()+" Β· "+(me.label||me.name)+" Β· "+t(LVL[me.role]||"lvlEmployee");}else{c.style.display="none";}$("logoutBtn").style.display=me?"inline-block":"none";}
789
+ function setWho(){const w=$("who");w.textContent=me?(me.label||me.name):"";const c=$("idChip");if(me){c.style.display="inline-block";c.textContent=me.name.slice(0,1).toUpperCase()+" Β· "+(me.label||me.name)+" Β· "+t(LVL[me.role]||"lvlEmployee");}else{c.style.display="none";}$("logoutBtn").style.display=me?"inline-block":"none";$("notifBell").style.display=(me&&(me.role==="owner"||me.role==="lead"))?"inline-block":"none";}
777
790
  function toast(m){const el=$("toast");el.textContent=m;el.classList.add("show");clearTimeout(el.__t);el.__t=setTimeout(()=>el.classList.remove("show"),2200);}
778
791
  function skel(n){let out="";for(let i=0;i<n;i++)out+='<div class="skel" style="height:38px;margin:8px 0"></div>';return out;}
779
792
  const esc=(s)=>String(s==null?"":s).replace(/[&<>"']/g,(c)=>({"&":"&amp;","<":"&lt;",">":"&gt;","\"":"&quot;","'":"&#39;"}[c]));
@@ -865,7 +878,7 @@ $("toHomeBtn").onclick=async()=>{await api("/api/live/close",{});workerFlow();};
865
878
  async function enter(){
866
879
  if(!PACK){PACK=await api("/api/sector");applyPack();}
867
880
  setWho();
868
- if(me.role==="owner"){show("ownerView");try{if(!localStorage.getItem("lv-welcome"))$("welcomeCard").style.display="block";}catch(e){}loadShift();pollAlerts();loadStudio().then(()=>{api("/api/studio").then(r=>{if(r&&(r.tasks||[]).some(x=>x.status==="done"))$("inboxView").style.display="flex";});});loadRegister();loadMetrics($("ownerMetrics"));loadUsers();loadField();loadRules();loadUsage();renderOrders();loadPresets();}
881
+ if(me.role==="owner"){show("ownerView");try{if(!localStorage.getItem("lv-welcome"))$("welcomeCard").style.display="block";}catch(e){}loadShift();pollAlerts();loadStudio().then(()=>{refreshNotifBadge();api("/api/studio").then(r=>{if(r&&(r.tasks||[]).some(x=>x.status==="done"))$("inboxView").style.display="flex";});});loadRegister();loadMetrics($("ownerMetrics"));loadUsers();loadField();loadRules();loadUsage();renderOrders();loadPresets();}
869
882
  else if(me.role==="lead"){show("leadView");loadMetrics($("leadMetrics"));loadLead();renderOrders();if(kitchenPoll)clearInterval(kitchenPoll);kitchenPoll=setInterval(kitchenWatch,4000);}
870
883
  else{show("employeeView");$("workerHi").textContent=t("hi")+(me.label||me.name);loadRegister();workerFlow();if(livePoll)clearInterval(livePoll);livePoll=setInterval(()=>{if(me&&me.role==="employee")workerFlow();},3000);}
871
884
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@javierfrancoleal/dsh-supervisor",
3
- "version": "1.0.53",
3
+ "version": "1.0.55",
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
@@ -59,7 +59,7 @@ const SECTOR_CLOSE = [
59
59
  { id: "close_clean", label: "Nettoyage et rangement des postes" },
60
60
  { id: "close_lights", label: "LumiΓ¨res, chauffage et alarme" }
61
61
  ];
62
- const VERSION = "1.0.53";
62
+ const VERSION = "1.0.55";
63
63
  // Homeostasis: the daily token budget (metabolic limit). The brain rests
64
64
  // when the budget is spent β€” no runaway costs.
65
65
  const DAILY_BUDGET_USD = Number(process.env.DSH_DAILY_BUDGET_USD || 0); // 0 = unlimited: consumption is the business