dwkim 2.0.0 → 2.0.1
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/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -378,7 +378,7 @@ ${In.chat} \uB2E8\uCD95\uD0A4
|
|
|
378
378
|
|
|
379
379
|
${In.chat} \uC608\uC2DC \uC9C8\uBB38
|
|
380
380
|
\uC5B4\uB5A4 \uAE30\uC220\uC744 \uC0AC\uC6A9\uD558\uB098\uC694?
|
|
381
|
-
\uACBD\uB825\uC5D0 \uB300\uD574 \uC54C\uB824\uC8FC\uC138\uC694`}]);break;case"status":try{let nt=await c.getStatus();_(Ot=>[...Ot,{id:kt(),role:"system",content:`${In.check} ${nt.status} \u2022 \uBB38\uC11C ${nt.rag_engine?.total_documents||0}\uAC1C`}])}catch{_(nt=>[...nt,{id:kt(),role:"system",content:`${In.error} \uC0C1\uD0DC \uC870\uD68C \uC2E4\uD328`}])}break;case"clear":Se(void 0),_([{id:kt(),role:"system",content:`${In.check} \uCD08\uAE30\uD654 \uC644\uB8CC`}]);break;case"exit":case"quit":case"bye":At>0?jt(!0):n();break;default:_(nt=>[...nt,{id:kt(),role:"system",content:`${In.error} /${He} \u2014 /help \uCC38\uACE0`}])}},[c,At,n,kt]),ua=(0,Ga.useCallback)(async Le=>{let He=Le.trim();if(!(!He||C!=="idle")){if(g(""),He.startsWith("/")){await sa(He);return}if(Dt&&ka(He)){_(Ot=>[...Ot,{id:kt(),role:"user",content:He}]);let nt=await c.submitCorrection(Dt.query,Dt.response,He,se);_(Ot=>[...Ot,{id:kt(),role:"system",content:nt.success?`${In.check} ${nt.message}`:`${In.error} ${nt.message}`}]);return}_(nt=>[...nt,{id:kt(),role:"user",content:He}]),y("loading"),N({icon:"\u23F3",message:"\uCC98\uB9AC \uC911...",toolCalls:[]}),O("");try{let nt=[],Ot="",Zt=0,Va=!1;for await(let Rt of c.chatStream(He,se))switch(Rt.type){case"session":Se(Rt.sessionId);break;case"status":N(_n=>({icon:Rt.icon,message:Rt.message,toolCalls:_n?.toolCalls||[]}));break;case"tool_call":N(_n=>{let Ma=[..._n?.toolCalls||[]],La=Ma.findIndex(bn=>bn.tool===Rt.tool),gn={tool:Rt.tool,displayName:Rt.displayName,icon:Rt.icon,phase:Rt.phase,query:Rt.metadata?.query,resultCount:Rt.metadata?.resultCount};return La>=0?Ma[La]=gn:Ma.push(gn),{icon:_n?.icon||"\u{1F527}",message:_n?.message||Rt.displayName,toolCalls:Ma}});break;case"sources":nt=Rt.sources;break;case"progress":Ne(Rt.items);break;case"clarification":gt(Rt.suggestedQuestions),ve(0);break;case"escalation":Xt(Rt.reason);break;case"followup":gt(Rt.suggestedQuestions),ve(0);break;case"content":Ot+=Rt.content,O(Ot),Ne([]);break;case"done":Zt=Rt.metadata.processingTime,Va=Rt.metadata.shouldSuggestContact??!1,Ne([]);break;case"error":throw new Ro(Rt.error)}_(Rt=>[...Rt,{id:kt(),role:"assistant",content:Ot,sources:nt,processingTime:Zt,shouldSuggestContact:Va}]),O(""),N(null),y("idle"),wt({query:He,response:Ot});let Mn=At+1;mt(Mn),Mn%3===0&&!Va&&!ot&&at(!0),Va&&!et&&Y(!0),ot&&!et&&(qe(!0),Y(!0))}catch(nt){let Ot=nt instanceof Ro?nt.message:"\uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4.";_(Zt=>[...Zt,{id:kt(),role:"system",content:`${In.error} ${Ot}`}]),O(""),N(null),y("idle")}}},[c,C,se,sa,At,ot,et,ka,Dt,kt]),we=(0,Ga.useCallback)(async Le=>{let He=Le.trim();if(!He){Y(!1),$("");return}if(!ie){if(!He.includes("@")||!He.includes(".")){_(nt=>[...nt,{id:kt(),role:"system",content:`${In.error} \uC62C\uBC14\uB978 \uC774\uBA54\uC77C \uC8FC\uC18C\uB97C \uC785\uB825\uD574\uC8FC\uC138\uC694.`}]);return}Ee(!0);try{let Ot=await(await fetch(`${e}/api/v1/contact`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:He,sessionId:se})})).json();if(Ot.success)_(Zt=>[...Zt,{id:kt(),role:"system",content:`${In.check} ${Ot.message}`}]),Y(!1),qe(!1),Xt(""),$("");else throw new Error(Ot.error||"\uC774\uBA54\uC77C \uC804\uC1A1 \uC2E4\uD328")}catch{_(Ot=>[...Ot,{id:kt(),role:"system",content:`${In.error} \uC774\uBA54\uC77C \uC804\uC1A1\uC5D0 \uC2E4\uD328\uD588\uC5B4\uC694. \uB2E4\uC2DC \uC2DC\uB3C4\uD574\uC8FC\uC138\uC694.`}])}finally{Ee(!1)}}},[e,ie,se,kt]);return Ht?(0,Ze.jsx)(Ft,{flexDirection:"column",paddingX:1,paddingY:1,children:(0,Ze.jsxs)(Ft,{borderStyle:"round",borderColor:We.lavender,paddingX:2,paddingY:1,flexDirection:"column",children:[(0,Ze.jsxs)($e,{color:We.lavender,bold:!0,children:[In.chat," \uB5A0\uB098\uC2DC\uAE30 \uC804\uC5D0..."]}),(0,Ze.jsx)(Ft,{marginTop:1,children:(0,Ze.jsx)($e,{color:We.subtext,children:"\uC624\uB298 \uB300\uD654\uAC00 \uB3C4\uC6C0\uC774 \uB410\uB098\uC694?"})}),(0,Ze.jsxs)(Ft,{marginTop:1,children:[(0,Ze.jsx)($e,{color:We.success,children:"[1]"}),(0,Ze.jsx)($e,{color:We.subtext,children:" \uB9E4\uC6B0 \uB3C4\uC6C0\uB428 "}),(0,Ze.jsx)($e,{color:We.warning,children:"[2]"}),(0,Ze.jsx)($e,{color:We.subtext,children:" \uC870\uAE08 \uB3C4\uC6C0\uB428 "}),(0,Ze.jsx)($e,{color:We.error,children:"[3]"}),(0,Ze.jsx)($e,{color:We.subtext,children:" \uBCC4\uB85C... "}),(0,Ze.jsx)($e,{color:We.muted,children:"[d]"}),(0,Ze.jsx)($e,{color:We.subtext,children:" \uC2A4\uD0B5"})]})]})}):(0,Ze.jsxs)(Ft,{flexDirection:"column",paddingX:1,children:[(0,Ze.jsx)(v1,{items:d,children:Le=>(0,Ze.jsx)(uP,{message:Le},Le.id)}),p&&(0,Ze.jsx)(Ft,{marginTop:1,marginLeft:2,children:(0,Ze.jsx)(OI,{color:We.text,children:p})}),me.length>0&&!p&&(0,Ze.jsx)(Ft,{flexDirection:"column",marginY:1,marginLeft:2,children:me.map(Le=>(0,Ze.jsx)(Ft,{children:Le.status==="in_progress"?(0,Ze.jsxs)($e,{color:We.lavender,children:[(0,Ze.jsx)(w1,{type:"dots"})," ",Le.label,Le.detail&&(0,Ze.jsxs)($e,{color:We.muted,children:[" \u2014 ",Le.detail]})]}):(0,Ze.jsxs)($e,{color:Le.status==="completed"?We.success:We.muted,dimColor:Le.status==="pending",children:[Le.status==="completed"?"\u2713":"\u25CB"," ",Le.label,Le.status==="completed"&&Le.detail&&(0,Ze.jsxs)($e,{color:We.muted,children:[" \u2014 ",Le.detail]})]})},Le.id))}),C!=="idle"&&C!=="error"&&!me.length&&(0,Ze.jsxs)(Ft,{flexDirection:"column",marginY:1,children:[(0,Ze.jsxs)(Ft,{children:[C==="loading"&&(0,Ze.jsx)($e,{color:We.lavender,children:(0,Ze.jsx)(w1,{type:"dots"})}),C==="connecting"&&(0,Ze.jsx)($e,{color:We.info,children:(0,Ze.jsx)(w1,{type:"dots"})}),(0,Ze.jsxs)($e,{color:We.info,children:[" ",C==="connecting"?"\uC5F0\uACB0 \uC911...":v?.message||"\uCC98\uB9AC \uC911..."]})]}),v?.toolCalls&&v.toolCalls.length>0&&(0,Ze.jsx)(Ft,{flexDirection:"column",marginLeft:2,marginTop:0,children:v.toolCalls.map(Le=>(0,Ze.jsx)(Ft,{children:(0,Ze.jsxs)($e,{color:Le.phase==="completed"?We.success:We.muted,children:[Le.phase==="completed"?"\u2713":Le.phase==="error"?"\u2717":"\u25CB"," ",Le.displayName,Le.query&&(0,Ze.jsxs)($e,{dimColor:!0,children:[' "',Le.query,'"']}),Le.resultCount!==void 0&&(0,Ze.jsxs)($e,{dimColor:!0,children:[" \u2192 ",Le.resultCount,"\uAC74"]})]})},Le.tool))})]}),k&&(0,Ze.jsx)(Ft,{marginBottom:1,children:(0,Ze.jsxs)($e,{color:We.error,children:[In.error," ",k]})}),ut.length>0&&C==="idle"&&!U&&!Ae&&(0,Ze.jsxs)(Ft,{flexDirection:"column",marginTop:1,marginLeft:2,children:[(0,Ze.jsx)($e,{color:We.muted,dimColor:!0,children:"? \uB354 \uAD6C\uCCB4\uC801\uC73C\uB85C \uBB3C\uC5B4\uBCF4\uC2DC\uACA0\uC5B4\uC694?"}),ut.map((Le,He)=>(0,Ze.jsx)(Ft,{marginLeft:2,children:(0,Ze.jsxs)($e,{color:He===ye?We.lavender:We.muted,bold:He===ye,children:[He===ye?"\u203A ":" ","[",He+1,"] ",Le]})},He)),(0,Ze.jsxs)($e,{color:We.muted,dimColor:!0,children:[" ","\u2191\u2193 \uC120\uD0DD \xB7 Enter \uC9C8\uBB38 \xB7 ESC \uB2EB\uAE30"]})]}),Ae&&C==="idle"&&!U&&(0,Ze.jsx)(cO,{}),U&&C==="idle"&&(0,Ze.jsx)(Ft,{flexDirection:"column",marginTop:1,paddingX:1,children:(0,Ze.jsxs)(Ft,{borderStyle:"round",borderColor:Qe?We.peach:We.lavender,paddingX:2,paddingY:1,flexDirection:"column",children:[(0,Ze.jsxs)($e,{color:Qe?We.peach:We.lavender,children:[Qe?"\u{1F914} ":"\u{1F4E7} ",Qe?ot||"\uC774 \uC9C8\uBB38\uC740 \uC815\uD655\uD55C \uB2F5\uBCC0\uC744 \uC704\uD574 \uC9C1\uC811 \uC5F0\uB77D\uB4DC\uB9AC\uACE0 \uC2F6\uC5B4\uC694.":"\uB354 \uAE4A\uC740 \uC774\uC57C\uAE30\uAC00 \uD544\uC694\uD558\uC2E0 \uAC83 \uAC19\uC544\uC694!"]}),(0,Ze.jsx)($e,{color:We.muted,dimColor:!0,children:"\uC774\uBA54\uC77C \uB0A8\uACA8\uC8FC\uC2DC\uBA74 \uB3D9\uC6B1\uC774 \uC9C1\uC811 \uC5F0\uB77D\uB4DC\uB9B4\uAC8C\uC694."}),(0,Ze.jsxs)(Ft,{marginTop:1,children:[(0,Ze.jsx)($e,{color:We.primary,children:"\uC774\uBA54\uC77C: "}),(0,Ze.jsx)(LC,{value:ae,onChange:$,onSubmit:we,placeholder:"your@email.com"})]}),(0,Ze.jsx)(Ft,{marginTop:1,children:(0,Ze.jsx)($e,{color:We.muted,dimColor:!0,children:"Enter: \uC804\uC1A1 \u2022 \uBE48\uAC12 Enter: \uB118\uC5B4\uAC00\uAE30 \u2022 ESC: \uB2E4\uC2DC\uBCF4\uC9C0\uC54A\uAE30"})})]})}),C!=="connecting"&&C!=="error"&&!U&&(0,Ze.jsxs)(Ft,{flexDirection:"column",marginTop:1,children:[(0,Ze.jsx)($e,{color:We.surface,children:"\u2500".repeat(l-2)}),(0,Ze.jsxs)(Ft,{paddingX:1,children:[(0,Ze.jsxs)($e,{color:We.primary,children:[In.arrow," "]}),(0,Ze.jsx)(LC,{value:f,onChange:g,onSubmit:ua,placeholder:"\uC9C8\uBB38\uC744 \uC785\uB825\uD558\uC138\uC694..."})]}),(0,Ze.jsx)($e,{color:We.surface,children:"\u2500".repeat(l-2)})]})]})}var uP=Ga.default.memo(function({message:n}){if(n.role==="banner")return(0,Ze.jsxs)(Ft,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,Ze.jsxs)(Ft,{children:[(0,Ze.jsx)($e,{bold:!0,color:We.lavender,children:oo.name}),(0,Ze.jsx)($e,{color:We.muted,children:" \xB7 "}),(0,Ze.jsx)($e,{color:We.subtext,children:oo.title})]}),(0,Ze.jsx)(Ft,{children:(0,Ze.jsx)($e,{color:We.muted,children:oo.bio})}),(0,Ze.jsx)(Ft,{marginTop:1,children:(0,Ze.jsx)($e,{italic:!0,color:We.success,children:oo.quote})})]});let o=n.role==="user",l=n.role==="system";return(0,Ze.jsxs)(Ft,{flexDirection:"column",marginTop:1,children:[(0,Ze.jsxs)(Ft,{marginLeft:o?0:2,children:[o&&(0,Ze.jsxs)($e,{color:We.lavender,children:[In.arrow," "]}),n.role==="assistant"?(0,Ze.jsx)(OI,{color:We.text,children:n.content}):(0,Ze.jsx)($e,{color:o?We.lavender:We.muted,dimColor:l,children:n.content})]}),n.sources&&n.sources.length>0&&(0,Ze.jsx)(Ft,{marginLeft:4,marginTop:0,children:(0,Ze.jsxs)($e,{color:We.muted,dimColor:!0,children:[In.book," ",n.sources.length,"\uAC1C \uBB38\uC11C \uCC38\uC870"]})}),n.processingTime&&(0,Ze.jsx)(Ft,{marginLeft:4,children:(0,Ze.jsxs)($e,{color:We.muted,dimColor:!0,children:[In.clock," ",n.processingTime,"ms"]})})]})});var Nr=Pt(No(),1);function e5(){return(0,Nr.jsxs)(Ft,{flexDirection:"column",borderStyle:"round",borderColor:We.primary,paddingX:2,paddingY:1,children:[(0,Nr.jsxs)(Ft,{children:[(0,Nr.jsx)($e,{bold:!0,color:We.lavender,children:oo.name}),(0,Nr.jsxs)($e,{color:We.subtext,children:[" ",oo.title]})]}),(0,Nr.jsx)(Ft,{marginTop:1,children:(0,Nr.jsx)($e,{color:We.text,children:oo.bio})}),(0,Nr.jsx)(Ft,{marginY:1,children:(0,Nr.jsx)($e,{color:We.surface,children:"\u2500".repeat(52)})}),(0,Nr.jsxs)(Ft,{flexDirection:"column",gap:0,children:[(0,Nr.jsx)(oh,{icon:In.email,label:"Email",value:oo.email}),(0,Nr.jsx)(oh,{icon:In.github,label:"GitHub",value:oo.github}),(0,Nr.jsx)(oh,{icon:In.web,label:"Website",value:oo.website}),(0,Nr.jsx)(oh,{icon:In.project,label:"Project",value:oo.project})]}),(0,Nr.jsx)(Ft,{marginY:1,children:(0,Nr.jsx)($e,{color:We.surface,children:"\u2500".repeat(52)})}),(0,Nr.jsx)($e,{italic:!0,color:We.muted,children:oo.quote})]})}function oh({icon:e,label:n,value:o}){return(0,Nr.jsxs)(Ft,{children:[(0,Nr.jsxs)($e,{color:We.primary,children:[e," ",n.padEnd(8)]}),(0,Nr.jsx)($e,{color:We.text,children:o})]})}var BI=Pt(No(),1),AP="https://persona-api.fly.dev",dP=process.env.DWKIM_API_URL||AP;function t5({mode:e}){return e==="profile"?(0,BI.jsx)(e5,{}):(0,BI.jsx)($M,{apiUrl:dP})}var a5=Pt(No(),1),_P=process.argv[2];function gP(){console.log(`
|
|
381
|
+
\uACBD\uB825\uC5D0 \uB300\uD574 \uC54C\uB824\uC8FC\uC138\uC694`}]);break;case"status":try{let nt=await c.getStatus();_(Ot=>[...Ot,{id:kt(),role:"system",content:`${In.check} ${nt.status} \u2022 \uBB38\uC11C ${nt.rag_engine?.total_documents||0}\uAC1C`}])}catch{_(nt=>[...nt,{id:kt(),role:"system",content:`${In.error} \uC0C1\uD0DC \uC870\uD68C \uC2E4\uD328`}])}break;case"clear":Se(void 0),_([{id:kt(),role:"system",content:`${In.check} \uCD08\uAE30\uD654 \uC644\uB8CC`}]);break;case"exit":case"quit":case"bye":At>0?jt(!0):n();break;default:_(nt=>[...nt,{id:kt(),role:"system",content:`${In.error} /${He} \u2014 /help \uCC38\uACE0`}])}},[c,At,n,kt]),ua=(0,Ga.useCallback)(async Le=>{let He=Le.trim();if(!(!He||C!=="idle")){if(g(""),He.startsWith("/")){await sa(He);return}if(Dt&&ka(He)){_(Ot=>[...Ot,{id:kt(),role:"user",content:He}]);let nt=await c.submitCorrection(Dt.query,Dt.response,He,se);_(Ot=>[...Ot,{id:kt(),role:"system",content:nt.success?`${In.check} ${nt.message}`:`${In.error} ${nt.message}`}]);return}_(nt=>[...nt,{id:kt(),role:"user",content:He}]),y("loading"),N({icon:"\u23F3",message:"\uCC98\uB9AC \uC911...",toolCalls:[]}),O("");try{let nt=[],Ot="",Zt=0,Va=!1;for await(let Rt of c.chatStream(He,se))switch(Rt.type){case"session":Se(Rt.sessionId);break;case"status":N(_n=>({icon:Rt.icon,message:Rt.message,toolCalls:_n?.toolCalls||[]}));break;case"tool_call":N(_n=>{let Ma=[..._n?.toolCalls||[]],La=Ma.findIndex(bn=>bn.tool===Rt.tool),gn={tool:Rt.tool,displayName:Rt.displayName,icon:Rt.icon,phase:Rt.phase,query:Rt.metadata?.query,resultCount:Rt.metadata?.resultCount};return La>=0?Ma[La]=gn:Ma.push(gn),{icon:_n?.icon||"\u{1F527}",message:_n?.message||Rt.displayName,toolCalls:Ma}});break;case"sources":nt=Rt.sources;break;case"progress":Ne(Rt.items);break;case"clarification":gt(Rt.suggestedQuestions),ve(0);break;case"escalation":Xt(Rt.reason);break;case"followup":gt(Rt.suggestedQuestions),ve(0);break;case"content":Ot+=Rt.content,O(Ot),Ne([]);break;case"done":Zt=Rt.metadata.processingTime,Va=Rt.metadata.shouldSuggestContact??!1,Ne([]);break;case"error":throw new Ro(Rt.error)}_(Rt=>[...Rt,{id:kt(),role:"assistant",content:Ot,sources:nt,processingTime:Zt,shouldSuggestContact:Va}]),O(""),N(null),y("idle"),wt({query:He,response:Ot});let Mn=At+1;mt(Mn),Mn%3===0&&!Va&&!ot&&at(!0),Va&&!et&&Y(!0),ot&&!et&&(qe(!0),Y(!0))}catch(nt){let Ot=nt instanceof Ro?nt.message:"\uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4.";_(Zt=>[...Zt,{id:kt(),role:"system",content:`${In.error} ${Ot}`}]),O(""),N(null),y("idle")}}},[c,C,se,sa,At,ot,et,ka,Dt,kt]),we=(0,Ga.useCallback)(async Le=>{let He=Le.trim();if(!He){Y(!1),$("");return}if(!ie){if(!He.includes("@")||!He.includes(".")){_(nt=>[...nt,{id:kt(),role:"system",content:`${In.error} \uC62C\uBC14\uB978 \uC774\uBA54\uC77C \uC8FC\uC18C\uB97C \uC785\uB825\uD574\uC8FC\uC138\uC694.`}]);return}Ee(!0);try{let Ot=await(await fetch(`${e}/api/v1/contact`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:He,sessionId:se})})).json();if(Ot.success)_(Zt=>[...Zt,{id:kt(),role:"system",content:`${In.check} ${Ot.message}`}]),Y(!1),qe(!1),Xt(""),$("");else throw new Error(Ot.error||"\uC774\uBA54\uC77C \uC804\uC1A1 \uC2E4\uD328")}catch{_(Ot=>[...Ot,{id:kt(),role:"system",content:`${In.error} \uC774\uBA54\uC77C \uC804\uC1A1\uC5D0 \uC2E4\uD328\uD588\uC5B4\uC694. \uB2E4\uC2DC \uC2DC\uB3C4\uD574\uC8FC\uC138\uC694.`}])}finally{Ee(!1)}}},[e,ie,se,kt]);return Ht?(0,Ze.jsx)(Ft,{flexDirection:"column",paddingX:1,paddingY:1,children:(0,Ze.jsxs)(Ft,{borderStyle:"round",borderColor:We.lavender,paddingX:2,paddingY:1,flexDirection:"column",children:[(0,Ze.jsxs)($e,{color:We.lavender,bold:!0,children:[In.chat," \uB5A0\uB098\uC2DC\uAE30 \uC804\uC5D0..."]}),(0,Ze.jsx)(Ft,{marginTop:1,children:(0,Ze.jsx)($e,{color:We.subtext,children:"\uC624\uB298 \uB300\uD654\uAC00 \uB3C4\uC6C0\uC774 \uB410\uB098\uC694?"})}),(0,Ze.jsxs)(Ft,{marginTop:1,children:[(0,Ze.jsx)($e,{color:We.success,children:"[1]"}),(0,Ze.jsx)($e,{color:We.subtext,children:" \uB9E4\uC6B0 \uB3C4\uC6C0\uB428 "}),(0,Ze.jsx)($e,{color:We.warning,children:"[2]"}),(0,Ze.jsx)($e,{color:We.subtext,children:" \uC870\uAE08 \uB3C4\uC6C0\uB428 "}),(0,Ze.jsx)($e,{color:We.error,children:"[3]"}),(0,Ze.jsx)($e,{color:We.subtext,children:" \uBCC4\uB85C... "}),(0,Ze.jsx)($e,{color:We.muted,children:"[d]"}),(0,Ze.jsx)($e,{color:We.subtext,children:" \uC2A4\uD0B5"})]})]})}):(0,Ze.jsxs)(Ft,{flexDirection:"column",paddingX:1,children:[(0,Ze.jsx)(v1,{items:d,children:Le=>(0,Ze.jsx)(uP,{message:Le},Le.id)}),p.length>0&&(0,Ze.jsx)(Ft,{marginTop:1,marginLeft:2,children:(0,Ze.jsx)(OI,{color:We.text,children:p})}),me.length>0&&!p&&(0,Ze.jsx)(Ft,{flexDirection:"column",marginY:1,marginLeft:2,children:me.map(Le=>(0,Ze.jsx)(Ft,{children:Le.status==="in_progress"?(0,Ze.jsxs)($e,{color:We.lavender,children:[(0,Ze.jsx)(w1,{type:"dots"})," ",Le.label,Le.detail?(0,Ze.jsxs)($e,{color:We.muted,children:[" \u2014 ",Le.detail]}):null]}):(0,Ze.jsxs)($e,{color:Le.status==="completed"?We.success:We.muted,dimColor:Le.status==="pending",children:[Le.status==="completed"?"\u2713":"\u25CB"," ",Le.label,Le.status==="completed"&&Le.detail?(0,Ze.jsxs)($e,{color:We.muted,children:[" \u2014 ",Le.detail]}):null]})},Le.id))}),C!=="idle"&&C!=="error"&&!me.length&&(0,Ze.jsxs)(Ft,{flexDirection:"column",marginY:1,children:[(0,Ze.jsxs)(Ft,{children:[C==="loading"&&(0,Ze.jsx)($e,{color:We.lavender,children:(0,Ze.jsx)(w1,{type:"dots"})}),C==="connecting"&&(0,Ze.jsx)($e,{color:We.info,children:(0,Ze.jsx)(w1,{type:"dots"})}),(0,Ze.jsxs)($e,{color:We.info,children:[" ",C==="connecting"?"\uC5F0\uACB0 \uC911...":v?.message||"\uCC98\uB9AC \uC911..."]})]}),v?.toolCalls&&v.toolCalls.length>0&&(0,Ze.jsx)(Ft,{flexDirection:"column",marginLeft:2,marginTop:0,children:v.toolCalls.map(Le=>(0,Ze.jsx)(Ft,{children:(0,Ze.jsxs)($e,{color:Le.phase==="completed"?We.success:We.muted,children:[Le.phase==="completed"?"\u2713":Le.phase==="error"?"\u2717":"\u25CB"," ",Le.displayName,Le.query?(0,Ze.jsxs)($e,{dimColor:!0,children:[' "',Le.query,'"']}):null,Le.resultCount!==void 0?(0,Ze.jsxs)($e,{dimColor:!0,children:[" \u2192 ",Le.resultCount,"\uAC74"]}):null]})},Le.tool))})]}),k!==null&&(0,Ze.jsx)(Ft,{marginBottom:1,children:(0,Ze.jsxs)($e,{color:We.error,children:[In.error," ",k]})}),ut.length>0&&C==="idle"&&!U&&!Ae&&(0,Ze.jsxs)(Ft,{flexDirection:"column",marginTop:1,marginLeft:2,children:[(0,Ze.jsx)($e,{color:We.muted,dimColor:!0,children:"? \uB354 \uAD6C\uCCB4\uC801\uC73C\uB85C \uBB3C\uC5B4\uBCF4\uC2DC\uACA0\uC5B4\uC694?"}),ut.map((Le,He)=>(0,Ze.jsx)(Ft,{marginLeft:2,children:(0,Ze.jsxs)($e,{color:He===ye?We.lavender:We.muted,bold:He===ye,children:[He===ye?"\u203A ":" ","[",He+1,"] ",Le]})},He)),(0,Ze.jsxs)($e,{color:We.muted,dimColor:!0,children:[" ","\u2191\u2193 \uC120\uD0DD \xB7 Enter \uC9C8\uBB38 \xB7 ESC \uB2EB\uAE30"]})]}),Ae&&C==="idle"&&!U&&(0,Ze.jsx)(cO,{}),U&&C==="idle"&&(0,Ze.jsx)(Ft,{flexDirection:"column",marginTop:1,paddingX:1,children:(0,Ze.jsxs)(Ft,{borderStyle:"round",borderColor:Qe?We.peach:We.lavender,paddingX:2,paddingY:1,flexDirection:"column",children:[(0,Ze.jsxs)($e,{color:Qe?We.peach:We.lavender,children:[Qe?"\u{1F914} ":"\u{1F4E7} ",Qe?ot||"\uC774 \uC9C8\uBB38\uC740 \uC815\uD655\uD55C \uB2F5\uBCC0\uC744 \uC704\uD574 \uC9C1\uC811 \uC5F0\uB77D\uB4DC\uB9AC\uACE0 \uC2F6\uC5B4\uC694.":"\uB354 \uAE4A\uC740 \uC774\uC57C\uAE30\uAC00 \uD544\uC694\uD558\uC2E0 \uAC83 \uAC19\uC544\uC694!"]}),(0,Ze.jsx)($e,{color:We.muted,dimColor:!0,children:"\uC774\uBA54\uC77C \uB0A8\uACA8\uC8FC\uC2DC\uBA74 \uB3D9\uC6B1\uC774 \uC9C1\uC811 \uC5F0\uB77D\uB4DC\uB9B4\uAC8C\uC694."}),(0,Ze.jsxs)(Ft,{marginTop:1,children:[(0,Ze.jsx)($e,{color:We.primary,children:"\uC774\uBA54\uC77C: "}),(0,Ze.jsx)(LC,{value:ae,onChange:$,onSubmit:we,placeholder:"your@email.com"})]}),(0,Ze.jsx)(Ft,{marginTop:1,children:(0,Ze.jsx)($e,{color:We.muted,dimColor:!0,children:"Enter: \uC804\uC1A1 \u2022 \uBE48\uAC12 Enter: \uB118\uC5B4\uAC00\uAE30 \u2022 ESC: \uB2E4\uC2DC\uBCF4\uC9C0\uC54A\uAE30"})})]})}),C!=="connecting"&&C!=="error"&&!U&&(0,Ze.jsxs)(Ft,{flexDirection:"column",marginTop:1,children:[(0,Ze.jsx)($e,{color:We.surface,children:"\u2500".repeat(l-2)}),(0,Ze.jsxs)(Ft,{paddingX:1,children:[(0,Ze.jsxs)($e,{color:We.primary,children:[In.arrow," "]}),(0,Ze.jsx)(LC,{value:f,onChange:g,onSubmit:ua,placeholder:"\uC9C8\uBB38\uC744 \uC785\uB825\uD558\uC138\uC694..."})]}),(0,Ze.jsx)($e,{color:We.surface,children:"\u2500".repeat(l-2)})]})]})}var uP=Ga.default.memo(function({message:n}){if(n.role==="banner")return(0,Ze.jsxs)(Ft,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,Ze.jsxs)(Ft,{children:[(0,Ze.jsx)($e,{bold:!0,color:We.lavender,children:oo.name}),(0,Ze.jsx)($e,{color:We.muted,children:" \xB7 "}),(0,Ze.jsx)($e,{color:We.subtext,children:oo.title})]}),(0,Ze.jsx)(Ft,{children:(0,Ze.jsx)($e,{color:We.muted,children:oo.bio})}),(0,Ze.jsx)(Ft,{marginTop:1,children:(0,Ze.jsx)($e,{italic:!0,color:We.success,children:oo.quote})})]});let o=n.role==="user",l=n.role==="system";return(0,Ze.jsxs)(Ft,{flexDirection:"column",marginTop:1,children:[(0,Ze.jsxs)(Ft,{marginLeft:o?0:2,children:[o&&(0,Ze.jsxs)($e,{color:We.lavender,children:[In.arrow," "]}),n.role==="assistant"?(0,Ze.jsx)(OI,{color:We.text,children:n.content}):(0,Ze.jsx)($e,{color:o?We.lavender:We.muted,dimColor:l,children:n.content})]}),n.sources&&n.sources.length>0&&(0,Ze.jsx)(Ft,{marginLeft:4,marginTop:0,children:(0,Ze.jsxs)($e,{color:We.muted,dimColor:!0,children:[In.book," ",n.sources.length,"\uAC1C \uBB38\uC11C \uCC38\uC870"]})}),n.processingTime!==void 0&&n.processingTime>0&&(0,Ze.jsx)(Ft,{marginLeft:4,children:(0,Ze.jsxs)($e,{color:We.muted,dimColor:!0,children:[In.clock," ",n.processingTime,"ms"]})})]})});var Nr=Pt(No(),1);function e5(){return(0,Nr.jsxs)(Ft,{flexDirection:"column",borderStyle:"round",borderColor:We.primary,paddingX:2,paddingY:1,children:[(0,Nr.jsxs)(Ft,{children:[(0,Nr.jsx)($e,{bold:!0,color:We.lavender,children:oo.name}),(0,Nr.jsxs)($e,{color:We.subtext,children:[" ",oo.title]})]}),(0,Nr.jsx)(Ft,{marginTop:1,children:(0,Nr.jsx)($e,{color:We.text,children:oo.bio})}),(0,Nr.jsx)(Ft,{marginY:1,children:(0,Nr.jsx)($e,{color:We.surface,children:"\u2500".repeat(52)})}),(0,Nr.jsxs)(Ft,{flexDirection:"column",gap:0,children:[(0,Nr.jsx)(oh,{icon:In.email,label:"Email",value:oo.email}),(0,Nr.jsx)(oh,{icon:In.github,label:"GitHub",value:oo.github}),(0,Nr.jsx)(oh,{icon:In.web,label:"Website",value:oo.website}),(0,Nr.jsx)(oh,{icon:In.project,label:"Project",value:oo.project})]}),(0,Nr.jsx)(Ft,{marginY:1,children:(0,Nr.jsx)($e,{color:We.surface,children:"\u2500".repeat(52)})}),(0,Nr.jsx)($e,{italic:!0,color:We.muted,children:oo.quote})]})}function oh({icon:e,label:n,value:o}){return(0,Nr.jsxs)(Ft,{children:[(0,Nr.jsxs)($e,{color:We.primary,children:[e," ",n.padEnd(8)]}),(0,Nr.jsx)($e,{color:We.text,children:o})]})}var BI=Pt(No(),1),AP="https://persona-api.fly.dev",dP=process.env.DWKIM_API_URL||AP;function t5({mode:e}){return e==="profile"?(0,BI.jsx)(e5,{}):(0,BI.jsx)($M,{apiUrl:dP})}var a5=Pt(No(),1),_P=process.argv[2];function gP(){console.log(`
|
|
382
382
|
\u{1F4DA} dwkim CLI
|
|
383
383
|
|
|
384
384
|
\uC0AC\uC6A9\uBC95: dwkim [\uBA85\uB839\uC5B4]
|