clitrigger 0.2.64 → 0.2.66

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.
Files changed (54) hide show
  1. package/README.md +118 -184
  2. package/README_KR.md +114 -180
  3. package/dist/client/assets/{AnalyticsPanel-CsY7iVuP.js → AnalyticsPanel-ntVVoM9O.js} +1 -1
  4. package/dist/client/assets/CalendarGrid-8sSzdBes.js +16 -0
  5. package/dist/client/assets/DiscussionDetail-C8Jd-XNF.js +8 -0
  6. package/dist/client/assets/DiscussionForm-DaOo6Qn4.js +34 -0
  7. package/dist/client/assets/EmptyState-D4nAcalF.js +1 -0
  8. package/dist/client/assets/FloatingComposerController-5A3GJtK4-BKGtaowy.js +1 -0
  9. package/dist/client/assets/LogViewer-BC9BUbyo.js +6 -0
  10. package/dist/client/assets/MarkdownContent-CHKH6BNR.js +29 -0
  11. package/dist/client/assets/PersonalAgenda-SY8iVky-.js +7 -0
  12. package/dist/client/assets/{PlannerPageEditor-DhDgfAWR.js → PlannerPageEditor-BR1YXV1Y.js} +6 -6
  13. package/dist/client/assets/ProjectDetail-NmmSdopm.js +181 -0
  14. package/dist/client/assets/ProjectList-CcCAHjcA.js +6 -0
  15. package/dist/client/assets/ReviewQueue-DJKmru0O.js +11 -0
  16. package/dist/client/assets/TaskGraph-BeJAKmMa.js +2 -0
  17. package/dist/client/assets/{VaultLayout-DZV5ErhY.js → VaultLayout-B6EUh-n3.js} +20 -20
  18. package/dist/client/assets/folder-git-2-DTO9mjAn.js +6 -0
  19. package/dist/client/assets/index-B0DZbgpK.js +427 -0
  20. package/dist/client/assets/index-gug7OXWO.css +32 -0
  21. package/dist/client/assets/rotate-ccw-Ce-MeCWv.js +11 -0
  22. package/dist/client/assets/{style-B8R4Umuw.js → style-BGCiJv3W.js} +1 -1
  23. package/dist/client/assets/{with-selector-D-Bf0jbs.js → with-selector-DaFJ9d0-.js} +1 -1
  24. package/dist/client/index.html +2 -2
  25. package/dist/server/db/queries.d.ts +2 -0
  26. package/dist/server/db/queries.d.ts.map +1 -1
  27. package/dist/server/db/queries.js +5 -0
  28. package/dist/server/db/queries.js.map +1 -1
  29. package/dist/server/index.d.ts.map +1 -1
  30. package/dist/server/index.js +4 -1
  31. package/dist/server/index.js.map +1 -1
  32. package/dist/server/plugins/harness/adapters/claude.d.ts.map +1 -1
  33. package/dist/server/plugins/harness/adapters/claude.js +69 -6
  34. package/dist/server/plugins/harness/adapters/claude.js.map +1 -1
  35. package/dist/server/plugins/harness/router.d.ts.map +1 -1
  36. package/dist/server/plugins/harness/router.js +64 -1
  37. package/dist/server/plugins/harness/router.js.map +1 -1
  38. package/dist/server/plugins/harness/types.d.ts +4 -0
  39. package/dist/server/plugins/harness/types.d.ts.map +1 -1
  40. package/dist/server/routes/logs.d.ts.map +1 -1
  41. package/dist/server/routes/logs.js +4 -2
  42. package/dist/server/routes/logs.js.map +1 -1
  43. package/dist/server/services/claude-manager.d.ts +0 -4
  44. package/dist/server/services/claude-manager.d.ts.map +1 -1
  45. package/dist/server/services/claude-manager.js +2 -22
  46. package/dist/server/services/claude-manager.js.map +1 -1
  47. package/dist/server/services/log-streamer.d.ts.map +1 -1
  48. package/dist/server/services/log-streamer.js +2 -0
  49. package/dist/server/services/log-streamer.js.map +1 -1
  50. package/package.json +2 -2
  51. package/dist/client/assets/FloatingComposerController-5A3GJtK4-C8t_g5MQ.js +0 -1
  52. package/dist/client/assets/TaskGraph-OOtylb-P.js +0 -2
  53. package/dist/client/assets/index-C0pXRm5D.css +0 -32
  54. package/dist/client/assets/index-CSRpLtY-.js +0 -715
@@ -0,0 +1,8 @@
1
+ import{c as Ms,aU as Is,u as Ds,a as Ls,aW as $s,r as l,j as s,i as x,L as ss,D as zs,O as Fs,U as Rs,v as Ps,M as z,J as Ts}from"./index-B0DZbgpK.js";import{h as j,g as Os,i as Us,s as Hs,e as Js,j as Vs,k as Gs,t as Ks,m as Ws,l as qs,n as Bs,o as Qs,p as Xs,P as Ys,G as Zs,C as se,D as ee}from"./DiscussionForm-DaOo6Qn4.js";import{M as te}from"./MarkdownContent-CHKH6BNR.js";import{C as ae,R as ne}from"./rotate-ccw-Ce-MeCWv.js";/**
2
+ * @license lucide-react v1.8.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const re=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],ie=Ms("code",re),ce={pending:"bg-warm-200 text-warm-600",running:"bg-status-success/10 text-status-success",paused:"bg-status-warning/10 text-status-warning",completed:"bg-accent/10 text-accent",failed:"bg-status-error/10 text-status-error",merged:"bg-accent/10 text-accent"};function le(p){try{const y=JSON.parse(p);return Array.isArray(y)?y:[]}catch{return[]}}function es(p){return p==="pending"||p==="failed"?{canEdit:!0,allowAdvancedFields:!0}:p==="paused"||p==="completed"?{canEdit:!0,allowAdvancedFields:!1}:{canEdit:!1,allowAdvancedFields:!1}}function xe({onEvent:p,connected:y}){const{id:f,discussionId:r}=Is(),F=Ds(),{t:n,lang:h}=Ls(),{sendNotification:R}=$s(),[t,u]=l.useState(null),[ts,as]=l.useState([]),[ns,rs]=l.useState(!0),[P,is]=l.useState(new Map),[b,T]=l.useState(""),[cs,v]=l.useState(!1),[ls,_]=l.useState(!1),[os,O]=l.useState(!1),[A,M]=l.useState(new Set),[U,m]=l.useState(""),[H,J]=l.useState([]),[ds,w]=l.useState(!1),[k,V]=l.useState(!1),[N,g]=l.useState([]),[C,G]=l.useState(!1),K=l.useRef(null),W=l.useCallback(e=>{M(a=>{const c=new Set(a);return c.has(e)?c.delete(e):c.add(e),c})},[]),ms=l.useCallback(()=>{if(!t)return;const e=new Set(t.messages.filter(a=>a.content&&a.status==="completed").map(a=>a.id));M(e)},[t]),us=l.useCallback(()=>{M(new Set)},[]),xs=e=>{const a=e.split(`
7
+ `).find(c=>c.trim())||"";return a.length>120?`${a.slice(0,120)}...`:a};l.useEffect(()=>{r&&j(r).then(u).catch(()=>{}).finally(()=>rs(!1))},[r]),l.useEffect(()=>{f&&Os(f).then(as).catch(()=>{})},[f]),l.useEffect(()=>p(e=>{r&&(e.type==="discussion:status-changed"&&e.discussionId===r&&((e.status==="completed"||e.status==="failed")&&R(e.status==="completed"?n("notification.discussionCompleted"):n("notification.discussionFailed"),(t==null?void 0:t.title)??""),u(a=>a&&{...a,status:e.status,current_round:e.currentRound??a.current_round,current_agent_id:e.currentAgentId??a.current_agent_id})),e.type==="discussion:message-changed"&&e.discussionId===r&&(u(a=>a&&{...a,messages:a.messages.map(c=>c.id===e.messageId?{...c,status:e.status}:c)}),(e.status==="completed"||e.status==="failed")&&j(r).then(u).catch(()=>{})),e.type==="discussion:log"&&e.discussionId===r&&e.messageId&&is(a=>{const c=new Map(a),i=e.messageId,o=c.get(i)||[];return c.set(i,[...o,e.message||""]),c}))}),[p,r,R,n,t==null?void 0:t.title]),l.useEffect(()=>{var e;(e=K.current)==null||e.scrollIntoView({behavior:"smooth"})},[t==null?void 0:t.messages,P]),l.useEffect(()=>{!r||!t||(t.status==="failed"?Us(r).then(e=>J(e.filter(a=>a.log_type==="error"))).catch(()=>{}):J([]))},[r,t==null?void 0:t.status]);const q=l.useCallback(async()=>{if(!r)return;const e=await Hs(r);u(e),m("")},[r]),ps=l.useCallback(async()=>{if(!r)return;await Js(r);const e=await j(r);u(e),m("")},[r]),B=l.useCallback(async()=>{if(!r||!b.trim())return;await Vs(r,b),T("");const e=await j(r);u(e),m("")},[r,b]),hs=l.useCallback(async()=>{if(!r)return;const e=await Gs(r);u(e),m("")},[r]),fs=l.useCallback(async e=>{if(!r)return;v(!1);const a=await Ks(r,e);u(a),m("")},[r]),gs=l.useCallback(async()=>{if(!r)return;await Ws(r);const e=await j(r);u(e),m("")},[r]),js=l.useCallback(async()=>{if(!r)return;await qs(r);const e=await j(r);u(e),m("")},[r]),bs=l.useCallback(async()=>{if(r){w(!0),V(!0),g([]);try{const{items:e}=await Bs(r);g(e.map(a=>({...a,selected:!0}))),m("")}catch(e){m(e instanceof Error?e.message:h==="ko"?"추출에 실패했습니다.":"Extraction failed."),w(!1)}finally{V(!1)}}},[r,h]),ws=l.useCallback(async()=>{if(!r||!f)return;const e=N.filter(a=>a.selected&&a.title.trim()).map(a=>({title:a.title.trim(),description:a.description,priority:a.priority}));if(e.length===0){m(h==="ko"?"항목을 하나 이상 선택해 주세요.":"Select at least one item.");return}G(!0);try{await Qs(r,e),w(!1),g([]),F(`/projects/${f}?tab=planner`)}catch(a){m(a instanceof Error?a.message:h==="ko"?"Planner 변환에 실패했습니다.":"Failed to create planner items.")}finally{G(!1)}},[r,f,N,h,F]),Ns=l.useCallback(async e=>{if(!(!r||!t)){O(!0);try{const{allowAdvancedFields:a}=es(t.status),c=a?{title:e.title,description:e.description,agent_ids:e.agent_ids,max_rounds:e.max_rounds,auto_implement:e.auto_implement,implement_agent_id:e.auto_implement?e.implement_agent_id:null}:{title:e.title,description:e.description};await Xs(r,c);const i=await j(r);u(i),_(!1),m("")}catch(a){m(a instanceof Error?a.message:h==="ko"?"토론 저장에 실패했습니다.":"Failed to save discussion.")}finally{O(!1)}}},[r,t,h]);if(ns)return s.jsxs("div",{className:"mx-auto max-w-4xl px-4 sm:px-6 py-6 sm:py-8 space-y-6",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(x,{className:"h-4 w-16"}),s.jsx(x,{className:"h-4 w-4"}),s.jsx(x,{className:"h-4 w-32"})]}),s.jsxs("div",{className:"card p-6 space-y-4",children:[s.jsx(x,{className:"h-7 w-1/3"}),s.jsx(x,{className:"h-4 w-full",count:2}),s.jsxs("div",{className:"flex gap-4 pt-2",children:[s.jsx(x,{className:"h-3 w-24"}),s.jsx(x,{className:"h-3 w-24"})]})]}),s.jsx("div",{className:"space-y-8",children:[...Array(3)].map((e,a)=>s.jsxs("div",{className:"flex gap-3",children:[s.jsx(x,{variant:"circular",width:32,height:32}),s.jsxs("div",{className:"flex-1 space-y-2",children:[s.jsx(x,{className:"h-4 w-24"}),s.jsxs("div",{className:"card p-4 space-y-2",children:[s.jsx(x,{className:"h-3 w-full"}),s.jsx(x,{className:"h-3 w-5/6"}),s.jsx(x,{className:"h-3 w-4/6"})]})]})]},a))})]});if(!t)return s.jsxs("div",{className:"mx-auto max-w-4xl px-4 py-8 text-center",children:[s.jsx("p",{className:"text-status-error",children:n("discussions.notFound")}),s.jsx(ss,{to:`/projects/${f}?tab=discussions`,className:"text-sm text-accent mt-2 inline-block",children:n("discussions.back")})]});const Q=new Map(t.agents.map(e=>[e.id,e])),ys=t.status==="pending"||t.status==="paused"||t.status==="failed",I=t.status==="running",vs=t.status==="completed"||t.status==="paused",_s=t.status==="completed",ks=t.status==="paused"||t.status==="running",Cs=!I&&!!t.branch_name,{canEdit:Ss,allowAdvancedFields:X}=es(t.status),Y=e=>{if(!e)return[];try{const a=JSON.parse(e);return Array.isArray(a)?a.filter(c=>typeof c=="string"):[]}catch{return[]}},Es={title:t.title,description:t.description,agent_ids:le(t.agent_ids),max_rounds:t.max_rounds,auto_implement:t.auto_implement===1,implement_agent_id:t.implement_agent_id||"",memory_inject_mode:t.memory_inject_mode||"none",memory_node_ids:Y(t.memory_node_ids),memory_raw_file_paths:Y(t.memory_raw_file_paths),use_worktree:t.use_worktree==null?!0:t.use_worktree===1},S=new Map;for(const e of t.messages){const a=S.get(e.round_number)||[];a.push(e),S.set(e.round_number,a)}const As=[...S.keys()].sort((e,a)=>e-a);return s.jsxs("div",{className:"mx-auto max-w-4xl px-4 sm:px-6 py-6 sm:py-8 flex flex-col",style:{height:"calc(100vh - 2rem)"},children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsxs(ss,{to:`/projects/${f}?tab=discussions`,className:"inline-flex items-center gap-1 text-sm text-warm-500 hover:text-accent transition-colors",children:[s.jsx(ae,{size:16}),n("discussions.back")]}),s.jsx("span",{className:"text-warm-300",children:"/"}),s.jsx("span",{className:"text-sm font-medium text-warm-700 truncate",children:t.title}),s.jsx("span",{className:`px-1.5 py-0.5 rounded-md text-2xs font-semibold uppercase ${ce[t.status]}`,children:n(`status.${t.status}`)||t.status}),t.status==="running"&&s.jsxs("span",{className:"text-2xs text-status-success animate-pulse",children:[n("discussions.round")," ",t.current_round,"/",t.max_rounds]}),y&&s.jsx("span",{className:"ml-auto inline-flex items-center gap-1 text-xs text-status-success",children:s.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-status-success animate-pulse"})})]}),s.jsxs("div",{className:"mb-4 rounded-xl border border-warm-150 bg-warm-50/80 p-4",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("h1",{className:"text-lg font-semibold text-warm-800",children:t.title}),s.jsx("p",{className:"mt-2 whitespace-pre-wrap text-sm leading-relaxed text-warm-500",children:t.description})]}),Ss&&s.jsx("button",{onClick:()=>_(!0),className:"btn-secondary text-xs py-2 flex-shrink-0",children:n("todo.edit")})]}),s.jsxs("div",{className:"mt-3 flex flex-wrap gap-3 text-[11px] text-warm-400",children:[s.jsxs("span",{children:[n("discussions.maxRounds"),": ",t.max_rounds]}),s.jsxs("span",{children:[n("discussions.agents"),": ",t.agents.map(e=>e.name).join(", ")||"-"]}),s.jsxs("span",{children:[n("discussions.autoImplement"),": ",t.auto_implement?h==="ko"?"사용":"Enabled":h==="ko"?"사용 안 함":"Disabled"]})]}),U&&s.jsx("p",{className:"mt-3 text-xs text-status-error",children:U})]}),t.status==="failed"&&(()=>{const e=t.messages.find(c=>c.status==="failed"),a=e?Q.get(e.agent_id):null;return s.jsxs("div",{className:"mb-4 rounded-xl bg-status-error/5 overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 bg-status-error/10",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(zs,{size:16,className:"text-status-error"}),s.jsx("h4",{className:"text-xs font-semibold text-status-error uppercase tracking-wider",children:n("discussions.failureTitle")}),a&&s.jsxs("span",{className:"inline-flex items-center gap-1 text-2xs font-mono px-1.5 py-0.5 rounded-md bg-status-error/15 text-status-error",children:[s.jsx("span",{className:"w-3 h-3 rounded-full inline-block",style:{backgroundColor:a.avatar_color||"#94a3b8"}}),a.name]}),e&&s.jsxs("span",{className:"text-2xs font-mono px-1.5 py-0.5 rounded-md bg-status-error/15 text-status-error",children:[n("discussions.round")," ",e.round_number]})]}),s.jsxs("button",{onClick:q,className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium bg-status-success/15 text-status-success hover:bg-status-success/25 border border-status-success/30 transition-colors",children:[s.jsx(ne,{size:14}),n("discussions.retry")]})]}),s.jsx("div",{className:"px-4 py-3 space-y-1.5 max-h-48 overflow-y-auto",children:H.length>0?H.map(c=>s.jsxs("div",{className:"flex items-start gap-2 text-xs",children:[s.jsx("span",{className:"text-warm-500 font-mono flex-shrink-0",children:new Date(c.created_at).toLocaleTimeString()}),s.jsx("span",{className:"text-status-error font-mono whitespace-pre-wrap break-all",children:c.message})]},c.id)):s.jsx("span",{className:"text-xs text-warm-400 italic",children:n("discussions.noErrorLogs")})})]})})(),s.jsxs("div",{className:"flex items-center gap-2 mb-4 flex-wrap",children:[ys&&s.jsxs("button",{onClick:q,className:"btn-primary text-sm",children:[s.jsx(Fs,{size:16}),t.status==="pending"?n("header.runAll"):n("discussions.resume")]}),I&&s.jsxs("button",{onClick:ps,className:"btn-danger text-sm",children:[s.jsx(Ys,{size:16}),n("discussions.pause")]}),I&&s.jsx("button",{onClick:hs,className:"btn btn-sm text-xs text-warm-500",children:n("discussions.skipTurn")}),vs&&s.jsxs("button",{onClick:()=>v(!0),className:"btn-primary text-sm",children:[s.jsx(ie,{size:16}),n("discussions.implement")]}),_s&&t.branch_name&&s.jsxs("button",{onClick:gs,className:"btn-primary text-sm",children:[s.jsx(Zs,{size:16}),n("todos.merge")]}),t.status==="completed"&&s.jsxs("button",{onClick:bs,className:"btn-primary text-sm",children:[s.jsx(se,{size:16}),n("discussions.toPlanner")]}),Cs&&s.jsxs("button",{onClick:js,className:"btn-danger text-sm",children:[s.jsx(Rs,{size:16}),n("todo.cleanup")]}),t.messages.some(e=>e.content&&e.status==="completed")&&s.jsx("button",{onClick:A.size>0?us:ms,className:"btn btn-sm text-xs text-warm-500",children:A.size>0?n("discussions.expandAll"):n("discussions.collapseAll")}),s.jsx("div",{className:"ml-auto flex items-center gap-1",children:t.agents.map(e=>s.jsx("div",{className:`w-7 h-7 rounded-full flex items-center justify-center text-white text-2xs font-bold transition-all ${t.current_agent_id===e.id?"ring-2 ring-status-success ring-offset-1 scale-110":"opacity-60"}`,style:{backgroundColor:e.avatar_color||"#6366f1"},title:`${e.name} (${e.role})`,children:e.name.charAt(0)},e.id))})]}),s.jsxs("div",{className:"flex-1 overflow-y-auto space-y-1 pb-4",children:[As.map(e=>{const a=S.get(e),c=e>t.max_rounds;return s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-3 my-4",children:[s.jsx("div",{className:"flex-1 h-px bg-warm-200"}),s.jsx("span",{className:"text-2xs font-semibold text-warm-400 uppercase tracking-wider",children:c?n("discussions.implementation"):`${n("discussions.round")} ${e}`}),s.jsx("div",{className:"flex-1 h-px bg-warm-200"})]}),a.map(i=>{const o=Q.get(i.agent_id),d=i.agent_id==="user",D=i.status==="running",L=P.get(i.id)||[],E=A.has(i.id),$=!!i.content&&i.status==="completed"&&!d;return s.jsxs("div",{className:`flex gap-3 py-3 ${d?"justify-end":""}`,children:[!d&&s.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center text-white text-xs font-bold flex-shrink-0 ${D?"ring-2 ring-status-success ring-offset-1 animate-pulse":""}`,style:{backgroundColor:(o==null?void 0:o.avatar_color)||"#94a3b8"},children:i.agent_name.charAt(0)}),s.jsxs("div",{className:`flex-1 min-w-0 ${d?"max-w-[80%]":""}`,children:[!d&&s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("span",{className:"text-xs font-semibold text-warm-700",children:i.agent_name}),s.jsx("span",{className:"text-2xs text-warm-400",children:n(`agents.roles.${i.role}`)||i.role}),i.status==="skipped"&&s.jsx("span",{className:"text-2xs text-warm-300 italic",children:n("status.skipped")}),$&&s.jsxs("button",{onClick:()=>W(i.id),className:"text-2xs text-warm-300 hover:text-accent transition-colors flex items-center gap-0.5",children:[s.jsx(Ps,{size:12,className:`transition-transform ${E?"":"rotate-90"}`}),n(E?"discussions.expand":"discussions.collapse")]})]}),s.jsxs("div",{className:`rounded-xl p-3 text-sm ${d?"bg-accent/10 text-warm-700 ml-auto":i.status==="failed"?"bg-status-error/5 border border-warm-150":"bg-warm-50 border border-warm-150"} ${$?"cursor-pointer":""}`,onClick:$?()=>{const Z=window.getSelection();Z&&Z.toString().length>0||W(i.id)}:void 0,children:[E&&i.content&&s.jsx("div",{className:"text-xs text-warm-400 italic truncate",children:xs(i.content)}),!E&&i.content&&s.jsx(te,{content:i.content}),D&&L.length>0&&s.jsx("div",{className:"text-xs text-warm-500 whitespace-pre-wrap leading-relaxed max-h-60 overflow-y-auto font-mono",children:L.slice(-50).join(`
8
+ `)}),D&&L.length===0&&s.jsxs("div",{className:"flex items-center gap-2 text-xs text-status-success",children:[s.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-status-success animate-pulse"}),n("discussions.speaking")]}),i.status==="pending"&&!i.content&&s.jsx("div",{className:"text-xs text-warm-300 italic",children:n("discussions.waiting")})]})]}),d&&s.jsx("div",{className:"w-8 h-8 rounded-full bg-warm-300 flex items-center justify-center text-white text-xs font-bold flex-shrink-0",children:"U"})]},i.id)})]},e)}),s.jsx("div",{ref:K})]}),ks&&s.jsxs("div",{className:"border-t border-warm-200 pt-3 flex gap-2",children:[s.jsx("input",{type:"text",value:b,onChange:e=>T(e.target.value),onKeyDown:e=>{e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),B())},placeholder:n("discussions.userMessage"),className:"input flex-1 text-sm"}),s.jsx("button",{onClick:B,disabled:!b.trim(),className:"btn btn-primary btn-sm text-xs",children:n("discussions.inject")})]}),ls&&s.jsx(z,{open:!0,onClose:()=>_(!1),size:"xl",children:s.jsx("div",{className:"max-h-[90vh] overflow-y-auto",children:s.jsx(ee,{agents:X?ts:t.agents,projectId:t.project_id,initialValues:Es,mode:"edit",allowAdvancedFields:X,submitting:os,onSubmit:Ns,onCancel:()=>_(!1)})})}),cs&&s.jsx(z,{open:!0,onClose:()=>v(!1),size:"sm",children:s.jsxs("div",{className:"bg-theme-card border border-theme-border rounded-2xl p-6 shadow-elevated space-y-4",children:[s.jsx("h3",{className:"text-sm font-semibold text-warm-700",children:n("discussions.selectAgent")}),s.jsx("p",{className:"text-xs text-warm-400",children:n("discussions.implementHint")}),s.jsx("div",{className:"space-y-2",children:t.agents.map(e=>s.jsxs("button",{onClick:()=>fs(e.id),className:"w-full flex items-center gap-3 p-3 rounded-lg border border-warm-200 hover:border-accent hover:bg-accent/5 transition-colors",children:[s.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center text-white text-xs font-bold",style:{backgroundColor:e.avatar_color||"#6366f1"},children:e.name.charAt(0)}),s.jsxs("div",{className:"text-left",children:[s.jsx("div",{className:"text-sm font-medium text-warm-700",children:e.name}),s.jsx("div",{className:"text-xs text-warm-400",children:n(`agents.roles.${e.role}`)||e.role})]})]},e.id))}),s.jsx("button",{onClick:()=>v(!1),className:"btn btn-sm text-xs text-warm-500 w-full",children:n("header.cancel")})]})}),ds&&s.jsx(z,{open:!0,onClose:()=>!C&&!k&&w(!1),size:"lg",children:s.jsxs("div",{className:"bg-theme-card border border-theme-border rounded-2xl p-6 shadow-elevated space-y-4 max-h-[85vh] flex flex-col",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-semibold text-warm-700",children:n("discussions.extractTitle")}),s.jsx("p",{className:"text-xs text-warm-400 mt-1",children:n("discussions.extractHint")})]}),k?s.jsxs("div",{className:"py-12 flex flex-col items-center justify-center gap-3 text-sm text-warm-400",children:[s.jsx(Ts,{size:32,className:"animate-spin text-accent"}),s.jsx("span",{children:n("discussions.extractLoading")}),s.jsx("span",{className:"text-xs text-warm-300",children:n("discussions.extractLoadingHint")})]}):N.length===0?s.jsx("div",{className:"py-12 text-center text-sm text-warm-400",children:n("discussions.extractEmpty")}):s.jsx("div",{className:"space-y-2 overflow-y-auto pr-1",children:N.map((e,a)=>s.jsxs("div",{className:"flex items-start gap-2 p-3 rounded-lg border border-warm-200",children:[s.jsx("input",{type:"checkbox",checked:e.selected,onChange:c=>g(i=>i.map((o,d)=>d===a?{...o,selected:c.target.checked}:o)),className:"mt-1.5 cursor-pointer"}),s.jsxs("div",{className:"flex-1 space-y-1.5",children:[s.jsx("input",{type:"text",value:e.title,onChange:c=>g(i=>i.map((o,d)=>d===a?{...o,title:c.target.value}:o)),className:"w-full text-sm font-medium bg-transparent border-b border-warm-200 focus:border-accent outline-none py-1",placeholder:n("plannerForm.titlePlaceholder")}),s.jsx("textarea",{value:e.description,onChange:c=>g(i=>i.map((o,d)=>d===a?{...o,description:c.target.value}:o)),rows:2,className:"w-full text-xs text-warm-500 bg-transparent border border-warm-200 rounded-md p-1.5 focus:border-accent outline-none min-h-[48px] max-h-[240px] resize-y [field-sizing:content]",placeholder:n("plannerForm.descPlaceholder")}),s.jsxs("select",{value:e.priority,onChange:c=>g(i=>i.map((o,d)=>d===a?{...o,priority:Number(c.target.value)}:o)),className:"text-xs bg-transparent border border-warm-200 rounded-md px-2 py-1",children:[s.jsx("option",{value:0,children:n("discussions.priorityLow")}),s.jsx("option",{value:1,children:n("discussions.priorityMedium")}),s.jsx("option",{value:2,children:n("discussions.priorityHigh")}),s.jsx("option",{value:3,children:n("discussions.priorityUrgent")})]})]})]},a))}),s.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2 border-t border-warm-200",children:[s.jsx("button",{onClick:()=>w(!1),disabled:C||k,className:"btn btn-sm text-xs text-warm-500 disabled:opacity-50 disabled:cursor-not-allowed",children:n("header.cancel")}),s.jsx("button",{onClick:ws,disabled:C||k||N.filter(e=>e.selected).length===0,className:"btn-primary text-sm",children:n(C?"discussions.extractSaving":"discussions.extractConfirm")})]})]})})]})}export{xe as default};
@@ -0,0 +1,34 @@
1
+ import{c as I,o as k,p as f,q as T,s as D,a as F,r as g,j as e,b4 as O,aD as V,G as A}from"./index-B0DZbgpK.js";/**
2
+ * @license lucide-react v1.8.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const B=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]],ie=I("clipboard-list",B);/**
7
+ * @license lucide-react v1.8.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const H=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],R=I("eye-off",H);/**
12
+ * @license lucide-react v1.8.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const q=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],G=I("eye",q);/**
17
+ * @license lucide-react v1.8.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const U=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],K=I("file-text",U);/**
22
+ * @license lucide-react v1.8.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */const W=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]],re=I("git-merge",W);/**
27
+ * @license lucide-react v1.8.0 - ISC
28
+ *
29
+ * This source code is licensed under the ISC license.
30
+ * See the LICENSE file in the root directory of this source tree.
31
+ */const J=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],ce=I("pause",J);function oe(t){return k(`/api/projects/${t}/agents`)}function le(t,a){return f(`/api/projects/${t}/agents`,a)}function de(t,a){return D(`/api/agents/${t}`,a)}function me(t){return T(`/api/agents/${t}`)}function ue(t){return k(`/api/projects/${t}/discussions`)}function xe(t,a){return f(`/api/projects/${t}/discussions`,a)}function pe(t){return k(`/api/discussions/${t}`)}function he(t,a){return D(`/api/discussions/${t}`,a)}function ge(t){return T(`/api/discussions/${t}`)}function fe(t){return f(`/api/discussions/${t}/start`)}function je(t){return f(`/api/discussions/${t}/stop`)}function we(t,a){return f(`/api/discussions/${t}/inject`,{content:a})}function be(t){return f(`/api/discussions/${t}/skip-turn`)}function ve(t,a){return f(`/api/discussions/${t}/implement`,{agent_id:a})}function _e(t,a){return k(`/api/discussions/${t}/logs`)}function ke(t){return f(`/api/discussions/${t}/merge`)}function ye(t){return f(`/api/discussions/${t}/cleanup`)}function Ne(t){return f(`/api/discussions/${t}/extract-planner-items`)}function $e(t,a){return f(`/api/discussions/${t}/convert-to-planner`,{items:a})}function Q(t){return k(`/api/projects/${t}/vault/files`)}function Ce(t){return k(`/api/projects/${t}/vault/graph`)}function Ie(t,a){return k(`/api/projects/${t}/vault/file?path=${encodeURIComponent(a)}`)}function Me(t,a,m){return D(`/api/projects/${t}/vault/file`,{path:a,content:m})}function X(t,a,m){return f(`/api/projects/${t}/vault/preview`,{mode:a,filePaths:m})}function Y(t){return k(`/api/projects/${t}/vault/ignore`)}function Z(t,a){return D(`/api/projects/${t}/vault/ignore`,{content:a})}async function Pe(t,a,m){const{content:p}=await Y(t),o="/"+a.replace(/^\/+/,"")+(m?"/":"");if(p.split(/\r?\n/).map(j=>j.trim()).includes(o))return;const x=p.length===0||p.endsWith(`
32
+ `)?"":`
33
+ `;await Z(t,p+x+o+`
34
+ `)}async function Se(t,a,m){await f(`/api/projects/${t}/vault/ignore/unhide`,{path:a,isDir:m})}function ee(t){return t<1024?`${t}B`:t<1024*1024?`${(t/1024).toFixed(1)}KB`:`${(t/1024/1024).toFixed(2)}MB`}function te(t){const a=new Map,m=new Map;for(const o of t){const l=o.stem.toLowerCase(),x=o.title.toLowerCase(),j=a.get(l)??[];j.push(o.relativePath),a.set(l,j);const b=m.get(x)??[];b.push(o.relativePath),m.set(x,b)}const p=new Map;for(const o of t){const l=o.relativePath.includes("/")?o.relativePath.slice(0,o.relativePath.lastIndexOf("/")+1):"",x=[];for(const j of o.wikilinks){const b=j.toLowerCase(),w=a.get(b)??m.get(b)??[];if(w.length===0)continue;const u=w.length===1?w[0]:w.find(d=>d.startsWith(l))??w[0];u&&u!==o.relativePath&&!x.includes(u)&&x.push(u)}p.set(o.relativePath,x)}return p}function se({projectId:t,mode:a,selectedPaths:m,includeLinked:p,onChange:o}){const{t:l}=F(),[x,j]=g.useState([]),[b,w]=g.useState(!1),[u,d]=g.useState(!1),[y,i]=g.useState(""),[v,L]=g.useState(!1),[M,N]=g.useState("");g.useEffect(()=>{let r=!1;return Q(t).then(s=>{r||(j(s.files),w(!0))}).catch(s=>{console.error("Load vault files failed",s),w(!0)}),()=>{r=!0}},[t]);const $=g.useMemo(()=>{const r=M.toLowerCase(),s=r?x.filter(c=>c.stem.toLowerCase().includes(r)||c.title.toLowerCase().includes(r)||c.relativePath.toLowerCase().includes(r)):x,n={};for(const c of s){const h=c.relativePath.includes("/")?c.relativePath.split("/").slice(0,-1).join("/"):".";n[h]||(n[h]=[]),n[h].push(c)}return n},[x,M]),_=g.useMemo(()=>te(x),[x]),E=r=>{const s=new Set(m);if(s.has(r))s.delete(r);else if(s.add(r),p){const n=_.get(r)??[];for(const c of n)s.add(c)}o("selected",Array.from(s),p)},z=async()=>{L(!0);try{const s=await X(t,a==="auto"?"all":a,m);i(s.block||l("vault.empty"))}catch(r){i(r instanceof Error?r.message:"Preview failed")}finally{L(!1)}},P=a!=="none"&&a!=="auto";return g.useEffect(()=>{u&&P&&z()},[u,a,m]),e.jsxs("div",{className:"rounded-lg border border-warm-200 bg-warm-50 p-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("div",{className:"text-sm font-medium text-warm-800",children:l("vaultInject.title")}),P&&e.jsxs("button",{type:"button",onClick:()=>d(r=>!r),className:"inline-flex items-center gap-1 text-xs text-warm-600 hover:text-warm-800",children:[u?e.jsx(R,{size:12}):e.jsx(G,{size:12}),l("vaultInject.previewToggle")]})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:["none","auto","all","selected"].map(r=>e.jsx("button",{type:"button",onClick:()=>o(r,r==="selected"?m:[],p),className:`px-3 py-1.5 rounded-md text-xs ${a===r?"bg-warm-700 text-warm-50":"bg-warm-100 text-warm-700 hover:bg-warm-200"}`,children:l(`vaultInject.mode${r.charAt(0).toUpperCase()+r.slice(1)}`)},r))}),a==="auto"&&e.jsx("div",{className:"text-xs text-warm-500 mt-1 leading-snug",children:l("vaultInject.autoHint").replace("{count}",String(x.length))}),a==="selected"&&e.jsx("div",{className:"mt-2",children:b?x.length===0?e.jsx("div",{className:"text-xs text-warm-500 italic",children:l("vaultInject.empty")}):e.jsxs(e.Fragment,{children:[e.jsxs("label",{className:"flex items-center gap-2 text-xs text-warm-600 mb-2 cursor-pointer select-none",children:[e.jsx("input",{type:"checkbox",checked:p,onChange:r=>o(a,m,r.target.checked)}),l("vaultInject.includeLinked")]}),e.jsx("input",{value:M,onChange:r=>N(r.target.value),placeholder:l("vaultInject.searchPlaceholder"),className:"w-full px-2 py-1.5 rounded-md border border-warm-200 bg-warm-0 text-sm focus:outline-none focus:ring-2 focus:ring-warm-400 mb-2"}),e.jsx("div",{className:"max-h-56 overflow-y-auto border border-warm-200 rounded-md",children:Object.keys($).length===0?e.jsx("div",{className:"text-xs text-warm-500 italic px-2 py-2",children:l("vaultInject.noResults")}):Object.entries($).sort(([r],[s])=>r.localeCompare(s)).map(([r,s])=>e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] uppercase tracking-wide text-warm-500 px-2 py-1 bg-warm-100 sticky top-0 font-mono",children:r}),e.jsx("div",{className:"divide-y divide-warm-100",children:s.map(n=>{const c=(_.get(n.relativePath)??[]).length;return e.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 hover:bg-warm-100 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:m.includes(n.relativePath),onChange:()=>E(n.relativePath)}),n.kind==="html"?e.jsx(O,{size:12,className:"text-warm-500 shrink-0"}):e.jsx(K,{size:12,className:"text-warm-500 shrink-0"}),e.jsx("span",{className:"text-sm text-warm-800 truncate flex-1",title:n.relativePath,children:n.title||n.stem}),p&&c>0&&e.jsx("span",{className:"text-[10px] text-warm-600 bg-warm-200 px-1.5 py-0.5 rounded-md shrink-0",title:n.wikilinks.join(", "),children:l("vaultInject.linkedAdded").replace("{n}",String(c))}),e.jsx("span",{className:"text-[10px] text-warm-500 font-mono shrink-0",children:ee(n.size)})]},n.relativePath)})})]},r))}),e.jsx("div",{className:"text-xs text-warm-500 mt-1.5",children:l("vaultInject.injectedCount").replace("{count}",String(m.length))})]}):e.jsx("div",{className:"text-xs text-warm-500",children:l("vaultInject.loading")})}),a==="all"&&x.length>0&&e.jsx("div",{className:"text-xs text-warm-500 mt-1",children:l("vaultInject.allCount").replace("{count}",String(x.length))}),u&&P&&e.jsxs("div",{className:"mt-3",children:[e.jsx("textarea",{readOnly:!0,value:v?"...":y,rows:8,className:"w-full px-2 py-1.5 rounded-md border border-warm-200 bg-warm-100 text-xs font-mono resize-y"}),!v&&y&&e.jsxs("div",{className:"mt-1 flex items-center justify-end gap-3 text-[10px] text-warm-500 font-mono",children:[e.jsx("span",{children:l("vaultInject.previewChars").replace("{n}",y.length.toLocaleString())}),e.jsx("span",{children:l("vaultInject.previewTokens").replace("{n}",Math.ceil(y.length/4).toLocaleString())})]})]})]})}const ne={title:"",description:"",agent_ids:[],max_rounds:3,auto_implement:!1,implement_agent_id:"",memory_inject_mode:"none",memory_node_ids:[],memory_raw_file_paths:[],use_worktree:!0};function Le({agents:t,projectId:a,initialValues:m,mode:p,allowAdvancedFields:o=!0,submitting:l=!1,isGitRepo:x=!1,projectUseWorktree:j=!0,onSubmit:b,onCancel:w}){const{t:u,lang:d}=F(),y=()=>({...ne,use_worktree:j,...m}),[i,v]=g.useState(y),[L,M]=g.useState(!1);g.useEffect(()=>{v(y())},[m,j]);const N=(s,n)=>{v(c=>({...c,[s]:n}))},$=s=>u(`agents.roles.${s.role}`)||s.role,_=i.agent_ids.map(s=>t.find(n=>n.id===s)).filter(s=>!!s),E=s=>{v(n=>{const c=n.agent_ids.includes(s)?n.agent_ids.filter(h=>h!==s):[...n.agent_ids,s];return{...n,agent_ids:c,implement_agent_id:n.implement_agent_id&&!c.includes(n.implement_agent_id)?"":n.implement_agent_id}})},z=(s,n)=>{v(c=>{const h=c.agent_ids.indexOf(s),C=h+n;if(h===-1||C<0||C>=c.agent_ids.length)return c;const S=[...c.agent_ids];return[S[h],S[C]]=[S[C],S[h]],{...c,agent_ids:S}})},P=async()=>{!i.title.trim()||!i.description.trim()||o&&i.agent_ids.length<2||o&&i.auto_implement&&!i.implement_agent_id||await b({title:i.title.trim(),description:i.description.trim(),agent_ids:i.agent_ids,max_rounds:i.max_rounds,auto_implement:o?i.auto_implement:!1,implement_agent_id:o&&i.auto_implement?i.implement_agent_id:void 0,memory_inject_mode:o?i.memory_inject_mode:"none",memory_node_ids:o&&i.memory_inject_mode==="selected"?i.memory_node_ids:[],memory_raw_file_paths:o?i.memory_raw_file_paths:[],...x?{use_worktree:i.use_worktree}:{}})},r=i.title.trim()&&i.description.trim()&&(!o||i.agent_ids.length>=2)&&(!o||!i.auto_implement||!!i.implement_agent_id);return e.jsxs("div",{className:"card p-5 space-y-5",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-warm-500 mb-2",children:d==="ko"?"제목":"Title"}),e.jsx("input",{type:"text",value:i.title,onChange:s=>N("title",s.target.value),className:"input-field",placeholder:d==="ko"?"토론 주제를 입력하세요":"Enter discussion topic"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-warm-500 mb-2",children:d==="ko"?"설명":"Description"}),e.jsx("textarea",{value:i.description,onChange:s=>N("description",s.target.value),rows:4,className:"input-field resize-y min-h-[80px]",placeholder:d==="ko"?"토론할 기능이나 의사결정 배경을 자세히 설명하세요":"Describe the feature to discuss in detail"})]}),o&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-xs font-medium text-warm-500 mb-1.5",children:[u("discussions.agents"),e.jsx("span",{className:"ml-2 text-warm-400 font-normal",children:d==="ko"?`(${i.agent_ids.length}명 선택됨 · 최소 2명)`:`(${i.agent_ids.length} selected · min 2)`})]}),e.jsx("p",{className:"text-[11px] text-warm-400",children:d==="ko"?"참여 에이전트를 고른 뒤, 아래 발언 순서에서 실제 토론 진행 순서를 조정합니다.":"Select participants first, then adjust the actual speaking order below."})]}),e.jsxs("div",{className:"rounded-2xl border border-accent/30 bg-accent/5 p-3 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-semibold text-warm-700",children:d==="ko"?"발언 순서":"Speaking Order"}),e.jsx("p",{className:"text-[11px] text-warm-500 mt-1",children:d==="ko"?"1라운드 기준이며, 이후 라운드에도 같은 순서로 반복됩니다.":"This order is used for round 1 and repeats in later rounds."})]}),_.length>=2&&e.jsx("div",{className:"text-2xs font-semibold text-accent-dark bg-white/70 border border-accent/30 rounded-full px-2.5 py-1",children:d==="ko"?"순서 조정 가능":"Reorder enabled"})]}),_.length===0?e.jsx("div",{className:"rounded-xl border border-dashed border-warm-200 bg-white/70 px-4 py-5 text-center text-xs text-warm-400",children:d==="ko"?"에이전트를 선택하면 여기서 발언 순서를 바로 조정할 수 있습니다.":"Select agents to adjust the speaking order here."}):e.jsx("div",{className:"space-y-2",children:_.map((s,n)=>{const c=n===0,h=n===_.length-1,C=c?d==="ko"?"첫 발언":"Opens the round":h?d==="ko"?"마지막 발언":"Closes the round":d==="ko"?`${n+1}번째 발언`:`Turn ${n+1}`;return e.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-warm-200 bg-white/85 px-3 py-3 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("div",{className:"inline-flex h-7 w-7 items-center justify-center rounded-full bg-accent text-[11px] font-bold text-white flex-shrink-0",children:n+1}),e.jsx("div",{className:"w-6 h-6 rounded-full flex-shrink-0 border border-white/80 shadow-sm",style:{backgroundColor:s.avatar_color||"#6366f1"}}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-semibold text-warm-700 truncate",children:s.name}),e.jsxs("div",{className:"text-[11px] text-warm-500",children:[$(s)," · ",C]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(V,{size:"sm",onClick:()=>z(s.id,-1),disabled:c,children:d==="ko"?"앞으로":"Earlier"}),e.jsx(V,{size:"sm",onClick:()=>z(s.id,1),disabled:h,children:d==="ko"?"뒤로":"Later"})]})]},s.id)})})]}),t.length===0?e.jsx("p",{className:"text-xs text-warm-400 py-3 px-4 bg-warm-50 rounded-xl border border-warm-150",children:u("agents.empty")}):e.jsx("div",{className:"grid gap-2 sm:grid-cols-2 xl:grid-cols-3",children:t.map(s=>{const n=i.agent_ids.includes(s.id),c=i.agent_ids.indexOf(s.id)+1;return e.jsxs("button",{type:"button",onClick:()=>E(s.id),className:`text-left rounded-2xl border px-3.5 py-3 transition-all ${n?"border-accent bg-accent/5 shadow-sm":"border-warm-200 bg-warm-50 hover:border-warm-300 hover:bg-warm-100"}`,children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("div",{className:"w-6 h-6 rounded-full flex-shrink-0 border border-white/80 shadow-sm",style:{backgroundColor:s.avatar_color||"#6366f1"}}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:`text-sm font-semibold truncate ${n?"text-warm-700":"text-warm-600"}`,children:s.name}),e.jsx("div",{className:"text-[11px] text-warm-400",children:$(s)})]})]}),n&&e.jsx("div",{className:"inline-flex items-center justify-center min-w-7 h-7 rounded-full bg-accent text-[11px] font-bold text-white flex-shrink-0",children:c})]}),e.jsx("div",{className:`mt-3 text-[11px] ${n?"text-accent-dark":"text-warm-400"}`,children:n?d==="ko"?`${c}번째 발언으로 참여 중`:`Included as turn ${c}`:d==="ko"?"클릭해서 참여 에이전트에 추가":"Click to add this participant"})]},s.id)})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-warm-500 mb-2",children:u("discussions.maxRounds")}),e.jsx("input",{type:"number",min:1,max:10,value:i.max_rounds,onChange:s=>N("max_rounds",Number(s.target.value)),className:"input-field w-24 text-center"}),e.jsx("p",{className:"text-2xs text-warm-400 mt-1.5",children:u("discussions.roundExplain")})]}),x&&e.jsxs("div",{children:[e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[e.jsx("input",{type:"checkbox",checked:i.use_worktree,onChange:s=>N("use_worktree",s.target.checked),className:"rounded-md border-warm-300 text-accent focus:ring-accent"}),e.jsx(A,{size:14,className:"text-warm-500"}),e.jsx("span",{className:"text-xs font-medium text-warm-500",children:d==="ko"?"워크트리에서 격리 실행":"Run in isolated worktree"})]}),e.jsx("p",{className:"text-2xs text-warm-400 mt-1 ml-6",children:d==="ko"?"체크하면 전용 브랜치/워크트리를 만들어 격리 실행합니다. 해제하면 프로젝트 원본 경로에서 바로 실행합니다.":"Checked: create a dedicated branch/worktree for isolation. Unchecked: run directly in the project root."})]}),a&&e.jsx("div",{children:e.jsx(se,{projectId:a,mode:i.memory_inject_mode,selectedPaths:i.memory_raw_file_paths,includeLinked:L,onChange:(s,n,c)=>{v(h=>({...h,memory_inject_mode:s,memory_node_ids:[],memory_raw_file_paths:n})),M(c)}})}),e.jsxs("div",{children:[e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:i.auto_implement,onChange:s=>{const n=s.target.checked;v(c=>({...c,auto_implement:n,implement_agent_id:n?c.implement_agent_id:""}))},className:"rounded-md border-warm-300 text-accent focus:ring-accent"}),e.jsx("span",{className:"text-xs font-medium text-warm-500",children:u("discussions.autoImplement")})]}),e.jsx("p",{className:"text-2xs text-warm-400 mt-1 ml-6",children:u("discussions.autoImplementHint")}),i.auto_implement&&e.jsxs("div",{className:"mt-2 ml-6",children:[e.jsx("label",{className:"block text-xs font-medium text-warm-500 mb-1",children:u("discussions.selectAgent")}),e.jsxs("select",{value:i.implement_agent_id,onChange:s=>N("implement_agent_id",s.target.value),className:"input-field text-xs w-56",children:[e.jsx("option",{value:"",children:d==="ko"?"-- 에이전트 선택 --":"-- Select agent --"}),_.map(s=>e.jsxs("option",{value:s.id,children:[s.name," (",$(s),")"]},s.id))]})]})]})]}),e.jsxs("div",{className:"flex justify-end gap-3 pt-2 border-t border-warm-100",children:[e.jsx("button",{type:"button",onClick:w,className:"btn-secondary text-xs py-2",children:u("header.cancel")}),e.jsx("button",{type:"button",onClick:P,disabled:!r||l,className:"btn-primary text-xs py-2",children:u(l?"header.saving":p==="create"?"discussions.add":"header.save")})]})]})}export{Ce as A,ie as C,Le as D,G as E,K as F,re as G,ce as P,se as V,xe as a,ue as b,le as c,me as d,je as e,ge as f,oe as g,pe as h,_e as i,we as j,be as k,ye as l,ke as m,Ne as n,$e as o,he as p,Pe as q,Se as r,fe as s,ve as t,de as u,R as v,Ie as w,Me as x,Y as y,Z as z};
@@ -0,0 +1 @@
1
+ import{j as e,b3 as n}from"./index-B0DZbgpK.js";const o={sm:{wrapper:"py-8",iconBox:"w-10 h-10 rounded-xl",iconSize:20,title:"text-sm",desc:"text-xs"},md:{wrapper:"py-12",iconBox:"w-14 h-14 rounded-2xl",iconSize:28,title:"text-sm",desc:"text-xs"},lg:{wrapper:"py-20",iconBox:"w-16 h-16 rounded-2xl",iconSize:32,title:"text-base",desc:"text-sm"}};function a({icon:i,title:c,description:x,action:t,size:r="md",className:l}){const s=o[r],m=t==null?void 0:t.icon;return e.jsxs("div",{className:n("text-center",s.wrapper,l),children:[i&&e.jsx("div",{className:n("inline-flex items-center justify-center mb-4 bg-theme-hover",s.iconBox),children:e.jsx(i,{size:s.iconSize,className:"text-theme-muted"})}),e.jsx("p",{className:n("font-medium text-theme-text-secondary",s.title),children:c}),x&&e.jsx("p",{className:n("mt-1 text-theme-muted",s.desc),children:x}),t&&e.jsxs("button",{onClick:t.onClick,className:"btn-primary btn-sm mt-4 inline-flex items-center gap-1.5",children:[m&&e.jsx(m,{size:14}),t.label]})]})}export{a as E};
@@ -0,0 +1 @@
1
+ import{t as b,M as d,N as u,v as c,z as x,B as g,K as C,Z as h,T as v,q as j,P as y,U as E,o as S,s as O,f as P,G as T,D as F}from"./PlannerPageEditor-BR1YXV1Y.js";import{r as l,j as a}from"./index-B0DZbgpK.js";import"./with-selector-DaFJ9d0-.js";import"./index-Vcq4gwWv.js";import"./clsx-B-dksMZM.js";import"./ProjectDetail-NmmSdopm.js";import"./CalendarGrid-8sSzdBes.js";import"./LogViewer-BC9BUbyo.js";import"./MarkdownContent-CHKH6BNR.js";import"./DiscussionForm-DaOo6Qn4.js";import"./rotate-ccw-Ce-MeCWv.js";import"./EmptyState-D4nAcalF.js";var I=l.memo(({isEmpty:t,onSave:o,Components:s,dict:e})=>a.jsx(s.Generic.Toolbar.Root,{className:F("bn-action-toolbar","bn-comment-actions"),variant:"action-toolbar",children:a.jsx(s.Generic.Toolbar.Button,{className:"bn-button",mainTooltip:e.comments.save_button_text,variant:"compact",isDisabled:t,onClick:o,children:e.comments.save_button_text})}));function U(){let t=d(),o=u(c),s=x(),e=g(),r=C({trailingBlock:!1,dictionary:{...e,placeholders:{emptyDocument:e.placeholders.new_comment}},schema:o.commentEditorSchema||h}),m=l.useCallback(async()=>{await o.createThread({initialComment:{body:r.document}}),o.stopPendingComment(),t.transact(i=>{i.setSelection(v.create(i.doc,i.selection.to))}),t.focus()},[o,r,t]);return a.jsx(s.Comments.Card,{className:"bn-thread",children:a.jsx(j,{autoFocus:!0,editable:!0,editor:r,actions:({isFocused:i,isEmpty:n})=>a.jsx(I,{isFocused:i,isEmpty:n,onSave:m,Components:s,dict:e})})})}var A=b({default:()=>_});function _(t){let o=d(),s=u(c),e=y(c,{editor:o,selector:n=>n.pendingComment}),r=E({editor:o,selector:({editor:n})=>e?{from:n.prosemirrorState.selection.from,to:n.prosemirrorState.selection.to}:void 0}),m=l.useMemo(()=>{var n,p;return{...t.floatingUIOptions,useFloatingOptions:{open:!!e,onOpenChange:f=>{f||(s.stopPendingComment(),o.focus())},placement:"bottom",middleware:[S(10),O(),P()],...(n=t.floatingUIOptions)==null?void 0:n.useFloatingOptions},focusManagerProps:{disabled:!1},elementProps:{style:{zIndex:60},...(p=t.floatingUIOptions)==null?void 0:p.elementProps}}},[s,o,e,t.floatingUIOptions]),i=t.floatingComposer||U;return a.jsx(T,{position:r,portalElement:t.portalElement,...m,children:a.jsx(i,{})})}export{A as n,U as r,_ as t};
@@ -0,0 +1,6 @@
1
+ import{o as h,p,q as E,s as W,r as l,a as O,j as o}from"./index-B0DZbgpK.js";import{M as U}from"./MarkdownContent-CHKH6BNR.js";function A(t){return h(`/api/projects/${t}/todos`)}function B(t){if(!t)return null;try{const s=JSON.parse(t);return s&&typeof s=="object"&&typeof s.maxRounds=="number"?s:null}catch{return null}}function G(t,s){return p(`/api/projects/${t}/todos`,s)}function H(t,s){return W(`/api/todos/${t}`,s)}function q(t){return E(`/api/todos/${t}`)}function K(t,s="headless"){return p(`/api/todos/${t}/start`,{mode:s})}function Q(t){return p(`/api/todos/${t}/stop`)}const X=2e3;function Y(t){return h(`/api/todos/${t}/logs`)}function Z(t){return h(`/api/todos/${t}/diff`)}function ee(t){return h(`/api/todos/${t}/result`)}function te(t){return p(`/api/todos/${t}/merge`)}function oe(t){return p(`/api/todos/${t}/merge-chain`)}function ne(t,s=!0){return p(`/api/todos/${t}/cleanup`,{delete_branch:s})}function se(t,s="headless"){return p(`/api/todos/${t}/retry`,{mode:s})}function re(t,s,a="headless"){return p(`/api/todos/${t}/continue`,{prompt:s,mode:a})}function ae(t,s){return p(`/api/todos/${t}/images`,{images:s})}function ie(t,s){return E(`/api/todos/${t}/images/${s}`)}function ce(t,s){return`/api/todos/${t}/images/${s}`}const u={bg:"#1e1e1e",border:"#3c3c3c",cursor:"#aeafad",timestamp:"#6a9955",prefix:{info:"#569cd6",error:"#f44747",output:"#9cdcfe",commit:"#4ec9b0",input:"#c586c0",prompt:"#c586c0",warning:"#dcdcaa",assistant:"#b392f0",tool_use:"#79c0ff",tool_result:"#56d364"},message:{info:"#9cdcfe",error:"#f1807e",output:"#d4d4d4",commit:"#a8c990",input:"#ce9178",prompt:"#c586c0",warning:"#dcdcaa",assistant:"#e6e6e6",tool_use:"#8b949e",tool_result:"#7ee787"}},z={info:"[INF]",error:"[ERR]",output:"[OUT]",commit:"[GIT]",input:"[>>>]",prompt:"[PRM]",warning:"[WRN]",assistant:"[CLU]",tool_use:"[USE]",tool_result:"[RES]"};function J(t,s){const a=[],x=/(\*\*(.+?)\*\*)|(`(.+?)`)|(\*(.+?)\*)/g;let d=0,i,f=0;for(;(i=x.exec(t))!==null;)i.index>d&&a.push(t.slice(d,i.index)),i[1]?a.push(o.jsx("strong",{style:{color:"#d7ba7d",fontWeight:700},children:i[2]},f++)):i[3]?a.push(o.jsx("code",{style:{color:"#ce9178",background:"rgba(255,255,255,0.07)",padding:"0 3px",borderRadius:3,fontSize:"0.7rem"},children:i[4]},f++)):i[5]&&a.push(o.jsx("em",{style:{color:s,opacity:.75,fontStyle:"italic"},children:i[6]},f++)),d=i.index+i[0].length;return d<t.length&&a.push(t.slice(d)),a.length>0?a:[t]}function v(t){try{const a=JSON.parse(t);if(a&&typeof a.tool=="string")return a}catch{}const s=t.match(/^\[Tool:\s*(\w+)\](.*)$/);return s?{tool:s[1],summary:s[2].trim()}:null}function le({logs:t,interactive:s,todoId:a,onSendInput:x,embedded:d,fillHeight:i}){const f=l.useRef(null),[b,_]=l.useState(""),[N,R]=l.useState(!1),[j,T]=l.useState(!1),k=l.useRef(0),[w,M]=l.useState(new Set),{t:m}=O(),C=l.useMemo(()=>t.some(e=>e.log_type==="assistant"||e.log_type==="tool_use"),[t]),[g,y]=l.useState("chat");l.useEffect(()=>{y(C?"chat":"raw")},[C]),l.useEffect(()=>{f.current&&(f.current.scrollTop=f.current.scrollHeight)},[t]),l.useEffect(()=>{if(!j||t.length===0)return;const e=Date.now()-k.current,n=t[t.length-1];if(n.log_type==="output"||n.log_type==="error"||n.log_type==="commit"||n.log_type==="assistant")if(e>=1e3)T(!1);else{const r=setTimeout(()=>T(!1),1e3-e);return()=>clearTimeout(r)}},[t,j]);const I=e=>{e.preventDefault(),!(!b.trim()||!a||!x)&&(x(a,b),_(""),T(!0),k.current=Date.now())},D=async()=>{const e=t.map(n=>{const r=new Date(n.created_at).toLocaleTimeString();if(g==="chat"){if(n.log_type==="assistant")return`${r} [Claude]
2
+ ${n.message}
3
+ `;if(n.log_type==="tool_use"){const c=v(n.message);return c?`${r} [Tool: ${c.tool}] ${c.summary}`:`${r} [USE] ${n.message}`}if(n.log_type==="tool_result")return`${r} [Result] ${n.message.slice(0,200)}`}return`${r} ${z[n.log_type]||"[???]"} ${n.message}`}).join(`
4
+ `);await navigator.clipboard.writeText(e),R(!0),setTimeout(()=>R(!1),2e3)},S=e=>{M(n=>{const r=new Set(n);return r.has(e)?r.delete(e):r.add(e),r})},$=e=>{const n=new Date(e.created_at).toLocaleTimeString(),r=u.prefix[e.log_type]||u.prefix.output,c=u.message[e.log_type]||u.message.output;return o.jsxs("div",{className:"mb-0.5 leading-relaxed",children:[o.jsx("span",{style:{color:u.timestamp},children:n})," ",o.jsx("span",{style:{color:r,fontWeight:700},children:z[e.log_type]||"[???]"})," ",o.jsx("span",{style:{color:c},children:J(e.message,c)})]},e.id)},F=e=>{if(e.log_type==="assistant")return o.jsx("div",{style:{borderLeft:"3px solid #b392f0",background:"rgba(179, 146, 240, 0.06)",borderRadius:8,padding:"8px 12px",margin:"6px 0"},children:o.jsx(U,{content:e.message,className:"markdown-content-dark"})},e.id);if(e.log_type==="tool_use"){const n=v(e.message),r=w.has(e.id);return n?o.jsxs("div",{style:{margin:"2px 0",fontSize:"0.7rem"},children:[o.jsxs("button",{onClick:()=>S(e.id),style:{background:"none",border:"none",cursor:"pointer",padding:"2px 4px",fontFamily:"monospace",fontSize:"0.7rem",display:"flex",alignItems:"center",gap:6,width:"100%",textAlign:"left",borderRadius:4,transition:"background 0.15s"},onMouseEnter:c=>c.currentTarget.style.background="rgba(255,255,255,0.05)",onMouseLeave:c=>c.currentTarget.style.background="none",children:[o.jsx("span",{style:{color:"#6a9955",fontSize:"0.6rem"},children:r?"▾":"▸"}),o.jsx("span",{style:{color:"#79c0ff",fontWeight:600},children:n.tool}),o.jsx("span",{style:{color:"#8b949e",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.summary})]}),r&&n.input&&o.jsx("pre",{style:{background:"rgba(0,0,0,0.25)",border:"1px solid #3c3c3c",borderRadius:6,padding:"6px 10px",margin:"2px 0 2px 18px",fontSize:"0.65rem",color:"#8b949e",overflow:"auto",maxHeight:200},children:JSON.stringify(n.input,null,2)})]},e.id):$(e)}if(e.log_type==="tool_result"){const n=w.has(e.id),r=e.message.split(`
5
+ `).slice(0,3).join(`
6
+ `);return o.jsxs("div",{style:{margin:"1px 0 1px 18px",fontSize:"0.65rem"},children:[o.jsx("button",{onClick:()=>S(e.id),style:{background:"none",border:"none",cursor:"pointer",padding:"1px 4px",fontFamily:"monospace",fontSize:"0.65rem",color:"#56d364",opacity:.5},children:n?"▾ Result":"▸ Result"}),n&&o.jsx("pre",{style:{background:"rgba(0,0,0,0.2)",border:"1px solid #3c3c3c",borderRadius:6,padding:"4px 8px",margin:"2px 0",fontSize:"0.6rem",color:"#7ee787",opacity:.6,overflow:"auto",maxHeight:300},children:e.message}),!n&&r!==e.message&&o.jsxs("span",{style:{color:"#56d364",opacity:.3,marginLeft:8},children:[r.slice(0,80),"..."]})]},e.id)}if(e.log_type==="output"){const n=v(e.message);if(n){const r=w.has(e.id);return o.jsxs("div",{style:{margin:"2px 0",fontSize:"0.7rem"},children:[o.jsxs("button",{onClick:()=>S(e.id),style:{background:"none",border:"none",cursor:"pointer",padding:"2px 4px",fontFamily:"monospace",fontSize:"0.7rem",display:"flex",alignItems:"center",gap:6},onMouseEnter:c=>c.currentTarget.style.background="rgba(255,255,255,0.05)",onMouseLeave:c=>c.currentTarget.style.background="none",children:[o.jsx("span",{style:{color:"#6a9955",fontSize:"0.6rem"},children:r?"▾":"▸"}),o.jsx("span",{style:{color:"#79c0ff",fontWeight:600},children:n.tool}),o.jsx("span",{style:{color:"#8b949e"},children:n.summary})]}),r&&n.input&&o.jsx("pre",{style:{background:"rgba(0,0,0,0.25)",border:"1px solid #3c3c3c",borderRadius:6,padding:"6px 10px",margin:"2px 0 2px 18px",fontSize:"0.65rem",color:"#8b949e",overflow:"auto",maxHeight:200},children:JSON.stringify(n.input,null,2)})]},e.id)}}return $(e)},L=e=>({padding:"1px 6px",fontSize:"9px",fontFamily:"monospace",borderRadius:3,background:e?"#3c3c3c":"transparent",color:e?"#d4d4d4":"#858585",border:"none",cursor:"pointer",transition:"all 0.15s"});return o.jsxs("div",{className:i?"flex flex-col h-full":"flex flex-col",children:[o.jsxs("div",{className:i?"relative flex-1 min-h-0":"relative",children:[t.length>0&&!d&&o.jsxs("div",{style:{position:"absolute",top:8,right:8,zIndex:10,display:"flex",alignItems:"center",gap:4},children:[o.jsxs("div",{style:{display:"flex",borderRadius:4,border:"1px solid #3c3c3c",overflow:"hidden"},children:[o.jsx("button",{onClick:()=>y("chat"),style:L(g==="chat"),children:m("log.viewChat")}),o.jsx("button",{onClick:()=>y("raw"),style:L(g==="raw"),children:m("log.viewRaw")})]}),o.jsx("button",{onClick:D,style:{padding:"2px 8px",fontSize:"10px",fontFamily:"monospace",borderRadius:4,background:"#2d2d2d",color:"#858585",border:"1px solid #3c3c3c",cursor:"pointer",transition:"color 0.15s"},onMouseEnter:e=>e.currentTarget.style.color="#d4d4d4",onMouseLeave:e=>e.currentTarget.style.color="#858585",children:m(N?"log.copied":"log.copy")})]}),o.jsxs("div",{ref:f,className:d?`${i?"h-full":"max-h-64"} overflow-y-auto overflow-x-auto font-mono text-xs`:"h-48 sm:h-64 overflow-y-auto overflow-x-auto rounded-xl p-3 sm:p-4 font-mono text-xs",style:d?void 0:{backgroundColor:u.bg,border:`1px solid ${u.border}`},children:[t.length===0?o.jsx("p",{style:{color:"#6a9955"},children:m("log.awaiting")}):t.map(e=>g==="chat"?F(e):$(e)),s&&j&&o.jsxs("div",{className:"mb-0.5 leading-relaxed",children:[o.jsxs("span",{className:"inline-flex gap-1",style:{color:"#569cd6"},children:[o.jsx("span",{className:"animate-pulse",style:{animationDelay:"0ms",animationDuration:"1.2s"},children:"●"}),o.jsx("span",{className:"animate-pulse",style:{animationDelay:"200ms",animationDuration:"1.2s"},children:"●"}),o.jsx("span",{className:"animate-pulse",style:{animationDelay:"400ms",animationDuration:"1.2s"},children:"●"})]}),o.jsx("span",{className:"ml-2",style:{color:"#6a9955",fontSize:"0.65rem"},children:m("log.waitingResponse")})]}),o.jsx("span",{style:{color:u.cursor},className:"animate-pulse",children:"_"})]})]}),s&&o.jsxs("form",{onSubmit:I,style:d?{display:"flex",alignItems:"center",gap:8,padding:"4px 0",marginTop:4}:{display:"flex",alignItems:"center",gap:8,backgroundColor:u.bg,border:`1px solid ${u.border}`,borderTop:"none",borderBottomLeftRadius:12,borderBottomRightRadius:12,padding:"6px 16px"},children:[o.jsx("span",{style:{color:"#569cd6",fontFamily:"monospace",fontWeight:700,fontSize:12},children:"$"}),o.jsx("input",{type:"text",value:b,onChange:e=>_(e.target.value),style:{flex:1,background:"transparent",border:"none",outline:"none",color:"#ce9178",fontFamily:"monospace",fontSize:12},placeholder:m("todo.sendPlaceholder"),autoFocus:!0}),o.jsx("button",{type:"submit",style:{color:"#569cd6",fontFamily:"monospace",fontWeight:700,fontSize:12,letterSpacing:"0.05em",background:"none",border:"none",cursor:"pointer"},onMouseEnter:e=>e.currentTarget.style.color="#9cdcfe",onMouseLeave:e=>e.currentTarget.style.color="#569cd6",children:"SEND"})]})]})}export{le as L,X as T,Y as a,ee as b,Z as c,ie as d,A as e,G as f,ce as g,Q as h,q as i,H as j,oe as k,ne as l,te as m,re as n,B as p,se as r,K as s,ae as u};