feat(chat): persona decides to buy/walk — auto-finish + tolerance (temper) + resume
The conversation now ENDS when the persona makes a decision (option C), not when the
trainee clicks a button:
- persona_id replies carry {reply, decision(none/buy/walk), mood}; when decision is
buy/walk the session auto-finishes (won/lost) with a debrief that reveals latent
details + per-turn 'turning points'.
- personas have a tolerance (1-5, 'temper'): impatient personas walk away fast after
poor answers (fed via internal.misses on mood<=-1); tough 'wrong text' cases can
still be won by a strong, gentle response (judge realism).
- trainee 'Finish' button removed; if they leave mid-chat an active session is resumed
via /chat/resume (continue, not restart). One-shot lock still enforced once decided.
- mock/tests updated: persona deciding buy -> send auto-finishes won.
Rebuilt dist.
This commit is contained in:
6
frontend/dist/assets/MyBoard-DnLYF8gv.js
vendored
Normal file
6
frontend/dist/assets/MyBoard-DnLYF8gv.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import{k as x,_ as f,l as k,s as p,c as r,a as t,m as b,u as e,j as B,t as s,i as a,e as v,w as N,y as D,F as S,q as T,r as h,z as c,o as i,A as V}from"./index-Dv9XjhnS.js";/**
|
||||
* @license lucide-vue-next v1.0.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const z=x("layout-dashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]),L={style:{margin:"0"}},M={key:0,class:"row stat-row"},j={class:"card stat"},C={class:"card stat won"},F={class:"card stat lost"},I={class:"card stat"},q={key:1,class:"card"},A={key:2,class:"card empty-state"},E={class:"card",style:{"margin-top":"20px"}},G={style:{"margin-top":"0"}},H={__name:"MyBoard",setup(J){const o=h([]),u=h([]),y=h(!0),m=c(()=>o.value.length),_=c(()=>o.value.filter(n=>n.my_outcome==="won").length),g=c(()=>o.value.filter(n=>n.my_outcome==="lost").length),w=c(()=>o.value.filter(n=>n.my_outcome==="not_tried").length);return k(async()=>{try{o.value=(await p.myBoard()).board||[],u.value=(await p.mySessions()).sessions||[]}finally{y.value=!1}}),(n,l)=>(i(),r("div",null,[t("div",null,[t("h2",L,[b(e(z),{size:22,"stroke-width":1.8,style:{"vertical-align":"-4px"}}),B(" "+s(e(a).t("myDashboard")),1)]),l[0]||(l[0]=t("div",{class:"muted",style:{"margin-top":"4px","margin-bottom":"16px"}},"สรุปผลการฝึกของตัวคุณเอง — ดูว่าปิดการขายได้กี่ครั้ง ยังฝึกกับใครบ้าง",-1))]),y.value?v("",!0):(i(),r("div",M,[t("div",j,[t("span",null,s(e(a).t("total")),1),t("strong",null,s(m.value),1)]),t("div",C,[t("span",null,s(e(a).t("won")),1),t("strong",null,s(_.value),1)]),t("div",F,[t("span",null,s(e(a).t("lost")),1),t("strong",null,s(g.value),1)]),t("div",I,[t("span",null,s(e(a).t("notTried")),1),t("strong",null,s(w.value),1)])])),y.value?(i(),r("div",q,[...l[1]||(l[1]=[t("div",{class:"skeleton",style:{height:"50px"}},null,-1)])])):o.value.length===0?(i(),r("div",A,[...l[2]||(l[2]=[t("strong",null,"No practice yet",-1),t("span",null,"Go to Training and try closing a sale with a persona.",-1)])])):v("",!0),N(t("div",E,[t("h3",G,s(e(a).t("mySessions")),1),(i(!0),r(S,null,T(u.value,d=>(i(),r("div",{key:d.id,style:{display:"flex","justify-content":"space-between",padding:"8px 0","border-bottom":"1px solid var(--border)"}},[t("span",null,s(d.persona_name),1),t("span",{class:V(["badge",d.outcome])},s(d.outcome==="won"?e(a).t("won"):e(a).t("lost")),3)]))),128))],512),[[D,u.value.length]])]))}},O=f(H,[["__scopeId","data-v-6767b6b8"]]);export{O as default};
|
||||
Reference in New Issue
Block a user