@frumu/tandem-panel 0.5.4 → 0.5.6

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 (56) hide show
  1. package/bin/setup.js +1 -0
  2. package/dist/assets/AutomationsPage-BGqpmilp.js +946 -0
  3. package/dist/assets/BugMonitorPage-BVzdj9y-.js +4 -0
  4. package/dist/assets/ChannelsPage-B-InJ4Yh.js +1 -0
  5. package/dist/assets/ChatInterfacePanel-BrMo4cXg.js +1 -0
  6. package/dist/assets/ChatPage-Bc-BfOG1.js +1 -0
  7. package/dist/assets/CodingWorkflowsPage-xgfwLRlt.js +8 -0
  8. package/dist/assets/ControlPanelDialogs-yFfCht3Y.js +1 -0
  9. package/dist/assets/DashboardPage-CrA1itFc.js +1 -0
  10. package/dist/assets/ExperimentsPage-Bkg1_6rw.js +84 -0
  11. package/dist/assets/FilesPage-DChyHlO_.js +1 -0
  12. package/dist/assets/IntentPlannerPage-Dti1h8Tm.js +5 -0
  13. package/dist/assets/LazyJson-vfWw7G9F.js +1 -0
  14. package/dist/assets/MarketplacePage-90fAVNGg.js +1 -0
  15. package/dist/assets/McpToolAllowlistEditor-BzQ64HrZ.js +1 -0
  16. package/dist/assets/MemoryImportDialog-DSpS1JF5.js +1 -0
  17. package/dist/assets/MemoryPage-DRRLgoc0.js +1 -0
  18. package/dist/assets/OrchestratorPage-CYU-ESPI.js +3 -0
  19. package/dist/assets/PacksPage-dRmjjdKD.js +3 -0
  20. package/dist/assets/PlannerDiagnosticsPanel-C1uIuRIx.js +1 -0
  21. package/dist/assets/ProviderModelSelector-BdtOpkJR.js +1 -0
  22. package/dist/assets/RunsPage-DEy8vbRT.js +1 -0
  23. package/dist/assets/SettingsPage-CwH_FzOs.js +5 -0
  24. package/dist/assets/TaskBoard-CCY_Qy5S.js +1 -0
  25. package/dist/assets/TeamsPage-Dn81V0EB.js +4472 -0
  26. package/dist/assets/TimezoneField-B5i---lF.js +1 -0
  27. package/dist/assets/WorkflowStudioPage-yFhlA4KV.js +1854 -0
  28. package/dist/assets/WorkflowsPage-vmaKHFox.js +2 -0
  29. package/dist/assets/chatPageHelpers-Dmb4waDk.js +1 -0
  30. package/dist/assets/explorerHandoff-BPKxMR82.js +1 -0
  31. package/dist/assets/format-DyX5imzJ.js +1 -0
  32. package/dist/assets/fullcalendar-Bn75j0xM.js +1 -0
  33. package/dist/assets/index-C8Bjo7hU.css +1 -0
  34. package/dist/assets/index-TvymvGva.js +3 -0
  35. package/dist/assets/messages-uD0aB_MZ.js +3 -0
  36. package/dist/assets/motion-B3ZE8SGR.js +9 -0
  37. package/dist/assets/plannerShared-Dx7-Sxpc.js +1 -0
  38. package/dist/assets/preact-vendor-DaCG_P2o.js +1 -0
  39. package/dist/assets/react-query-BIbNygEJ.js +1 -0
  40. package/dist/assets/sse-B4A2m-Nk.js +2 -0
  41. package/dist/assets/useEngineStream-Diqri33l.js +1 -0
  42. package/dist/assets/vendor-DSaYtO9f.js +156 -0
  43. package/dist/assets/workflowStability-C8USyGOY.js +2 -0
  44. package/dist/index.html +8 -7
  45. package/lib/automations/workflow-list.js +147 -0
  46. package/lib/setup/control-panel-preferences.js +4 -0
  47. package/package.json +3 -3
  48. package/server/routes/capabilities.js +1 -0
  49. package/server/routes/knowledgebase.js +7 -1
  50. package/dist/assets/index-BL-9rGEh.css +0 -1
  51. package/dist/assets/index-DhoScTZK.js +0 -7379
  52. package/dist/assets/motion-CBnf8hfk.js +0 -9
  53. package/dist/assets/preact-vendor-B239Onrg.js +0 -1
  54. package/dist/assets/react-query-_hsOQSt5.js +0 -1
  55. package/dist/assets/vendor-DZYPF2Pz.js +0 -156
  56. /package/dist/assets/{markdown-Dd89TVib.js → markdown-Dwwtq3bu.js} +0 -0
@@ -0,0 +1,3 @@
1
+ import{C as e,E as t,b as n,g as r,h as i,v as a,x as o}from"./fullcalendar-Bn75j0xM.js";import{a as s,n as c,t as l}from"./react-query-BIbNygEJ.js";import{i as u,n as d,r as ee,t as te}from"./motion-B3ZE8SGR.js";import{a as ne,s as f,u as re}from"./index-TvymvGva.js";import{n as ie,t as ae}from"./TaskBoard-CCY_Qy5S.js";import{n as oe}from"./LazyJson-vfWw7G9F.js";import{t as p}from"./sse-B4A2m-Nk.js";import{t as se}from"./useEngineStream-Diqri33l.js";import{t as ce}from"./messages-uD0aB_MZ.js";function le(e){return e>=1?`bg-rose-500`:e>=.8?`bg-amber-500`:`bg-emerald-500`}function m(e,t){return!t||t<=0?0:Math.min(e/t,1)}function h({label:e,used:t,max:n,unit:r,advisory:i=!1}){let a=m(t,n),o=i?a>=.8?`bg-sky-400`:`bg-cyan-500`:le(a);return u(`div`,{className:`grid gap-1`,children:[u(`div`,{className:`flex items-center justify-between text-xs`,children:[u(`span`,{className:`tcp-subtle`,children:e}),u(`span`,{className:`font-mono text-[11px] text-slate-200`,children:[t.toLocaleString(),r||``,` / `,n.toLocaleString(),r||``]})]}),u(`div`,{className:`h-1.5 overflow-hidden rounded-full bg-slate-800/80`,children:u(`div`,{className:`h-full ${o}`,style:{width:`${a*100}%`}})})]})}function ue({budget:e}){let[t,n]=a(!1),r=e.limits_enforced===!1,i=Math.max(m(e.iterations_used,e.max_iterations),m(e.tokens_used,e.max_tokens),m(e.wall_time_secs,e.max_wall_time_secs),m(e.subagent_runs_used,e.max_subagent_runs));return u(`div`,{className:`rounded-xl border border-slate-700/60 bg-slate-900/25 p-3`,children:[u(`button`,{className:`flex w-full items-center justify-between`,onClick:()=>n(e=>!e),children:[u(`div`,{className:`text-sm font-medium`,children:`Budget + Tokens`}),u(`div`,{className:`flex items-center gap-2`,children:[u(`div`,{className:`h-2 w-24 overflow-hidden rounded-full bg-slate-800/80`,children:u(`div`,{className:`h-full ${r?i>=.8?`bg-sky-400`:`bg-cyan-500`:le(i)}`,style:{width:`${i*100}%`}})}),u(`span`,{className:`tcp-subtle text-xs`,children:[Math.round(i*100),`%`]})]})]}),t?u(`div`,{className:`mt-3 grid gap-3 border-t border-slate-700/60 pt-3`,children:[u(h,{label:`Iterations`,used:e.iterations_used,max:e.max_iterations,advisory:r}),u(h,{label:`Tokens`,used:e.tokens_used,max:e.max_tokens,advisory:r}),u(h,{label:`Wall time`,used:e.wall_time_secs,max:e.max_wall_time_secs,unit:`s`,advisory:r}),u(h,{label:`Agent calls`,used:e.subagent_runs_used,max:e.max_subagent_runs,advisory:r}),r?u(`div`,{className:`rounded border border-cyan-500/30 bg-cyan-950/20 p-2 text-xs text-cyan-100`,children:`Advisory usage only. This run does not expose explicit enforced budget caps, so these limits are relaxed defaults for visibility.`}):null,e.exceeded&&e.exceeded_reason?u(`div`,{className:`rounded border border-rose-500/40 bg-rose-950/30 p-2 text-xs text-rose-200`,children:e.exceeded_reason}):null]}):null]})}function g(e,t=0){return String(e?.run_id||e?.runId||`run-${t}`).trim()}function de(e){let t=Number(e?.updated_at_ms||e?.updatedAtMs||0),n=Number(e?.created_at_ms||e?.createdAtMs||0),r=Number.isFinite(t)&&t>0?t:n;return Number.isFinite(r)&&r>0?r:0}function _(e,t=``){let n=String(t||``).trim(),r=[...Array.isArray(e)?e:[]].sort((e,t)=>de(t)-de(e));if(n){let e=r.find((e,t)=>g(e,t)===n);if(e){let t=String(e?.status||``).trim().toLowerCase();if(![`completed`,`failed`,`cancelled`].includes(t))return n}}let i=r.find(e=>{let t=String(e?.status||``).trim().toLowerCase();return![`completed`,`failed`,`cancelled`].includes(t)})||r[0];return i?g(i):``}function v(e,t){if(t.type===`sync_runs`){let n={},r=[];for(let e=0;e<t.runs.length;e+=1){let i=t.runs[e],a=g(i,e);a&&(n[a]=i,r.push(a))}let i=e.selectedRunId;return i||=_(t.runs,t.preferredRunId),{runsById:n,orderedRunIds:r,selectedRunId:i,cursorsByRunId:e.cursorsByRunId}}if(t.type===`select_run`)return{...e,selectedRunId:String(t.runId||``).trim()};if(t.type===`clear_selection`)return{...e,selectedRunId:``};if(t.type===`advance_cursor`){let n=String(t.runId||``).trim();if(!n)return e;let r=Number(t.seq||0);if(!Number.isFinite(r)||r<=0)return e;let i=String(t.kind||``).trim().toLowerCase(),a=e.cursorsByRunId[n]||{eventSeq:0,patchSeq:0},o={eventSeq:i===`context_run_event`?Math.max(a.eventSeq,r):a.eventSeq,patchSeq:i===`blackboard_patch`?Math.max(a.patchSeq,r):a.patchSeq};return o.eventSeq===a.eventSeq&&o.patchSeq===a.patchSeq?e:{...e,cursorsByRunId:{...e.cursorsByRunId,[n]:o}}}return e}function fe(t,i=``){let[a,o]=n(v,{runsById:{},orderedRunIds:[],selectedRunId:``,cursorsByRunId:{}});e(()=>{o({type:`sync_runs`,runs:Array.isArray(t)?t:[],preferredRunId:i})},[t,i]);let s=r(()=>a.orderedRunIds.map(e=>a.runsById[e]).filter(Boolean),[a.orderedRunIds,a.runsById]);return{runsById:a.runsById,orderedRunIds:a.orderedRunIds,orderedRuns:s,selectedRunId:a.selectedRunId,cursorsByRunId:a.cursorsByRunId,setSelectedRunId:e=>o({type:`select_run`,runId:e}),clearSelectedRunId:()=>o({type:`clear_selection`}),advanceCursor:(e,t,n)=>o({type:`advance_cursor`,runId:e,kind:t,seq:n})}}function pe(e){let t={},n={};for(let[r,i]of Object.entries(e||{})){let e=Number(i?.eventSeq||0),a=Number(i?.patchSeq||0);e>0&&(t[r]=e),a>0&&(n[r]=a)}let r=JSON.stringify({events:t,patches:n});return!r||r===`{"events":{},"patches":{}}`?``:btoa(r).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/g,``)}function me({workspace:t,runIds:n,cursorToken:i,onEnvelope:a,onError:o}){let s=r(()=>[...new Set((n||[]).map(e=>String(e||``).trim()).filter(Boolean))],[n]),c=r(()=>{let e=String(t||``).trim();if(!e||!s.length)return``;let n=new URLSearchParams;return n.set(`workspace`,e),n.set(`runIds`,s.join(`,`)),i&&n.set(`cursor`,i),`/api/orchestrator/events?${n.toString()}`},[i,s,t]);e(()=>{if(!c)return;let e=p(c,e=>{let t=null;try{t=JSON.parse(String(e?.data||`{}`))}catch{return}!t||typeof t!=`object`||a(t)},{onError:e=>{o&&o(e)}});return()=>e()},[a,o,c])}var he={max_iterations:500,iterations_used:0,max_tokens:4e5,tokens_used:0,max_wall_time_secs:10080*60,wall_time_secs:0,max_subagent_runs:2e3,subagent_runs_used:0,exceeded:!1,exceeded_reason:``,limits_enforced:!1,source:`derived`};function y(e){let t=String(e||``).trim().toLowerCase();return t===`done`||t===`completed`||t===`active`?`tcp-badge-ok`:t===`failed`||t===`error`||t===`cancelled`||t===`canceled`?`tcp-badge-err`:t===`running`||t===`in_progress`||t===`runnable`?`tcp-badge-warn`:`tcp-badge-info`}function ge(e){let t=String(e||``).trim().toLowerCase();return{created:`Created`,pending:`Pending`,runnable:`Ready`,assigned:`Assigned`,in_progress:`In Progress`,blocked:`Blocked`,done:`Done`,failed:`Failed`,validated:`Validated`}[t]||t||`Unknown`}function _e(e){let t=Number(e||0);return!Number.isFinite(t)||t<=0?`Run`:`Run ${new Date(t).toLocaleTimeString()}`}function ve(e){return Number(e?.updated_at_ms||e?.created_at_ms||0)}function b(e){let t=Number(e||0);return!Number.isFinite(t)||t<=0?`--:--:--`:new Date(t).toLocaleTimeString()}function ye(e){let t=Number(e||0);return!Number.isFinite(t)||t<=0?`0 B`:t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function be(e){let t=String(e||``).trim(),n=t.lastIndexOf(`.`);return n<0?``:t.slice(n+1).toLowerCase()}function x(e){let t=String(e||``).trim().replace(/\\/g,`/`);return t?t.startsWith(`/`)?t.replace(/\/{2,}/g,`/`):t:``}function xe(e,t){let n=x(e).replace(/\/+$/,``),r=x(t).replace(/^\/+/,``);return n?r?`${n}/${r}`:n:r}function Se(e,t){let n=x(e).replace(/\/+$/,``),r=x(t);return!n||!r?!1:r===n?!0:r.startsWith(`${n}/`)}function Ce(e){let t=[e?.workspace?.canonical_path,e?.workspace?.path,e?.workspace?.root,e?.workspace_root,e?.workspacePath,e?.cwd,e?.path];for(let e of t){let t=x(String(e||``));if(t.startsWith(`/`))return t}return``}function we(e){let t={};for(let n of e){let e=String(n?.type||``).trim().toLowerCase();if(![`task_started`,`step_started`,`task_completed`,`step_completed`].includes(e))continue;let r=String(n?.step_id||``).trim();if(!r)continue;let i=Number(n?.seq||0);!Number.isFinite(i)||i<=0||(t[r]=Math.max(Number(t[r]||0),i))}return t}function Te(e){return String(e?.event_type||e?.type||e?.event||`workflow.event`).trim().toLowerCase()}function Ee(e){let t=[`type: ${String(e.type||``).trim()||`unknown`}`,`task: ${String(e.taskId||``).trim()||`n/a`}`,`title: ${String(e.title||``).trim()||`n/a`}`,`mode: ${String(e.mode||``).trim()||`strict`}`,`at: ${b(e.at)}`,``,`reason:`,String(e.reason||``).trim()||`No verification detail.`],n=e.verification?.execution_trace;return n&&typeof n==`object`&&t.push(``,`execution_trace:`,`session: ${String(n.session_id||`n/a`)}`,`model: ${[String(n?.model?.provider||``).trim(),String(n?.model?.model_id||``).trim()].filter(Boolean).join(` / `)||`unknown`}`,`source: ${String(n?.model?.source||`n/a`)}`),t.push(``,`verification_json:`,JSON.stringify(e.verification||{},null,2)),t.join(`
2
+ `)}function S(e){let t=String(e?.task_id||e?.taskID||``).trim();if(t)return t;let n=e?.source_event_id||e?.sourceEventID,r=String(n||``).trim();if(!r)return``;let i=r.lastIndexOf(`:`);return i<0?``:r.slice(i+1).trim()}function De({api:n,toast:p,navigate:le}){let m=s(),h=!!te(),g=i(null),[de,_]=a(!0),[v,x]=a(!1),[De,Oe]=a(``),[C,ke]=a(``),[Ae,w]=a(!1),[je,Me]=a(``),[Ne,T]=a(``),[Pe,Fe]=a(!1),[Ie,Le]=a(`4`),[Re,ze]=a(`3`),[Be,Ve]=a(`swarm.blackboard.default`),[He,Ue]=a(``),[E,We]=a(``),[D,Ge]=a(``),[O,Ke]=a(``),[qe,Je]=a([]),[k,A]=a(``),[Ye,j]=a(``),[Xe,Ze]=a(``),[M,Qe]=a(!1);e(()=>{_(!0),nt()},[]);let N=c({queryKey:[`swarm`,`status`],queryFn:()=>n(`/api/orchestrator/status`),refetchInterval:5e3}),$e=c({queryKey:[`swarm`,`runs`,C],queryFn:()=>n(`/api/orchestrator/runs?workspace=${encodeURIComponent(C||``)}`),refetchInterval:6e3,enabled:!!N.data}),P=fe(Array.isArray($e.data?.runs)?$e.data.runs:[],String(N.data?.runId||``).trim()),et=P.selectedRunId,tt=P.setSelectedRunId,nt=P.clearSelectedRunId,rt=P.advanceCursor,F=de?``:String(et||``).trim(),I=P.orderedRuns,it=r(()=>{if(!F)return null;for(let e of I)if(String(e?.run_id||e?.runId||``).trim()===F)return e;return null},[I,F]),at=r(()=>pe(P.cursorsByRunId),[P.cursorsByRunId]),ot=String(C||N.data?.workspaceRoot||``).trim(),st=r(()=>{let e=String(F||``).trim();return e?[e]:[]},[F]),ct=i(0);me({workspace:ot,runIds:st,cursorToken:at,onEnvelope:o(e=>{let t=String(e?.kind||``).trim().toLowerCase(),n=String(e?.run_id||e?.runId||``).trim();if(F&&n&&n!==F)return;let r=Number(e?.seq||0);n&&r>0&&(t===`context_run_event`||t===`blackboard_patch`)&&rt(n,t,r);let i=Date.now();i-ct.current<900||(ct.current=i,m.invalidateQueries({queryKey:[`swarm`,`runs`]}),F&&m.invalidateQueries({queryKey:[`swarm`,`run`,F]}))},[rt,m,F])});let L=c({queryKey:[`swarm`,`run`,F],queryFn:()=>n(`/api/orchestrator/run/${encodeURIComponent(F)}`),refetchInterval:4e3,enabled:!!F}),lt=c({queryKey:[`swarm`,`workspace-browser`,je],enabled:Ae&&!!je,queryFn:()=>n(`/api/orchestrator/workspaces/list?dir=${encodeURIComponent(je)}`)}),R=String(L.data?.runStatus||L.data?.run?.status||N.data?.status||`idle`).trim().toLowerCase(),ut=r(()=>ie(L.data),[L.data]),z=ut.tasks,dt=r(()=>({...he,...L.data?.budget||{}}),[L.data?.budget]),B=String(Ce(L.data?.run)||Ce(it)||(F?``:String(N.data?.workspaceRoot||C||``))).trim();e(()=>{B&&(We(e=>!e||!Se(B,e)?B:e),Ge(e=>Se(B,e)?e:``))},[B]);let ft=Array.isArray(lt.data?.directories)?lt.data.directories:[],V=String(Ne||``).trim().toLowerCase(),pt=r(()=>V?ft.filter(e=>String(e?.name||e?.path||``).trim().toLowerCase().includes(V)):ft,[ft,V]),H=String(lt.data?.parent||``).trim(),U=String(lt.data?.dir||je||``).trim(),W=c({queryKey:[`swarm`,`workspace-files`,B,E],enabled:!!B&&!!E,queryFn:async()=>{let e=await n(`/api/orchestrator/workspaces/files?workspaceRoot=${encodeURIComponent(B)}&dir=${encodeURIComponent(E)}`).catch(()=>({directories:[],files:[],parent:null,dir:E})),t=Array.isArray(e?.directories)?e.directories:[],r=(Array.isArray(e?.files)?e.files:[]).map(e=>{let t=String(e?.path||``).trim();return{...e,name:String(e?.name||t||`file`),path:t||xe(B,String(e?.name||``))}});return{ok:!0,dir:String(e?.dir||E),parent:e?.parent||null,directories:t,files:r,fileAccessAllowed:!0}},refetchInterval:1e4}),mt=c({queryKey:[`swarm`,`workspace-file`,B,D],enabled:!!B&&!!D,queryFn:async()=>n(`/api/orchestrator/workspaces/read?workspaceRoot=${encodeURIComponent(B)}&path=${encodeURIComponent(D)}`)}),ht=Array.isArray(W.data?.directories)?W.data.directories:[],gt=Array.isArray(W.data?.files)?W.data.files:[],_t=String(W.data?.parent||``).trim(),vt=W.data?.fileAccessAllowed!==!1,G=String(mt.data?.text||``),yt=be(D),bt=[`md`,`markdown`,`mdx`].includes(yt),K=[`html`,`htm`].includes(yt);e(()=>{M&&!K&&Qe(!1)},[K,M]);let xt=r(()=>z.map(e=>`${e.id}:${e.state}:${e.error_message||``}`).join(`|`),[z]),q=r(()=>z.find(e=>e.id===Ye)||null,[Ye,z]),St=r(()=>{let e=Array.isArray(L.data?.events)?L.data.events:[],t=null,n=0;for(let r of e){let e=String(r?.type||``).trim().toLowerCase();if(![`step_completed`,`task_completed`].includes(e))continue;let i=r?.payload&&typeof r.payload==`object`?r.payload:{},a=String(i?.session_id||``).trim();if(!a)continue;let o=Number(r?.ts_ms||0);(!t||o>=n)&&(t={sessionId:a,event:r},n=o)}return t},[L.data?.events]),Ct=r(()=>{let e=Array.isArray(L.data?.events)?L.data.events:[];for(let t=e.length-1;t>=0;--t){let n=e[t],r=String(n?.type||``).trim().toLowerCase();if(![`task_started`,`step_started`,`task_completed`,`step_completed`].includes(r))continue;let i=n?.payload&&typeof n.payload==`object`?n.payload:{},a=String(i?.session_id||``).trim();if(a)return a}return String(St?.sessionId||``).trim()},[St?.sessionId,L.data?.events]),wt=r(()=>{let e=Array.isArray(L.data?.events)?L.data.events:[],t=we(e),n=[];for(let r=e.length-1;r>=0;--r){let i=e[r],a=String(i?.type||``).trim().toLowerCase();if(![`task_started`,`task_completed`,`task_failed`,`step_started`,`step_completed`,`step_failed`,`run_resumed`,`run_paused`,`run_completed`,`run_failed`].includes(a))continue;let o=i?.payload&&typeof i.payload==`object`?i.payload:{},s=String(i?.step_id||``).trim(),c=Number(i?.seq||0);if((a===`task_failed`||a===`step_failed`)&&s&&Number.isFinite(c)&&c>0&&Number(t[s]||0)>c)continue;let l=String(o?.step_title||i?.step_id||a).trim(),u=String(o?.why_next_step||o?.error||``).trim();if(n.push({id:`${String(i?.seq||r)}-${a}`,type:a,title:l||a,detail:u,at:Number(i?.ts_ms||0)}),n.length>=12)break}return n},[L.data?.events]),Tt=r(()=>{let e=Array.isArray(L.data?.events)?L.data.events:[];for(let t=e.length-1;t>=0;--t){let n=e[t],r=String(n?.type||``).trim().toLowerCase();if(r===`plan_seeded_llm`)return`llm`;if(r===`plan_seeded_local`)return`fallback_local`;if(r===`plan_failed_llm_required`)return`llm_failed`}return`unknown`},[L.data?.events]),J=c({queryKey:[`swarm`,`run-output-session`,String(Ct||``)],queryFn:()=>n(`/api/engine/session/${encodeURIComponent(String(Ct||``))}`),refetchInterval:6e3,enabled:!!Ct}),Et=r(()=>{let e=ce(J.data,`Assistant`);for(let t=e.length-1;t>=0;--t)if(e[t]?.role===`assistant`&&String(e[t]?.text||``).trim())return String(e[t]?.text||``).trim();return``},[J.data]),Dt=r(()=>{let e=Array.isArray(J.data)?J.data:Array.isArray(J.data?.messages)?J.data.messages:[],t=[];for(let n=e.length-1;n>=0;--n){let r=e[n],i=Array.isArray(r?.parts)?r.parts:[];for(let e=i.length-1;e>=0;--e){let n=i[e];if(!String(n?.type||n?.part_type||``).trim().toLowerCase().includes(`tool`))continue;let r=String(n?.tool||n?.name||``).trim(),a=String(n?.state||n?.status||``).trim(),o=String(n?.error||``).trim(),s=[r||`tool`,a||null,o?`err=${o}`:null].filter(Boolean).join(` · `);if(t.push(s),t.length>=10)return t}}return t},[J.data]),Ot=r(()=>{let e=Array.isArray(L.data?.events)?L.data.events:[],t=we(e),n=[];for(let r=e.length-1;r>=0;--r){let i=e[r],a=String(i?.type||``).trim().toLowerCase();if(![`task_failed`,`step_failed`,`task_completed`,`step_completed`].includes(a))continue;let o=i?.payload&&typeof i.payload==`object`?i.payload:{},s=String(i?.step_id||``).trim(),c=Number(i?.seq||0);if((a===`task_failed`||a===`step_failed`)&&s&&Number.isFinite(c)&&c>0&&Number(t[s]||0)>c)continue;let l=o?.verification&&typeof o.verification==`object`?o.verification:{},u=String(l?.reason||o?.error||``).trim(),d=String(l?.mode||`strict`).trim()||`strict`;if(n.push({id:`${String(i?.seq||r)}-${a}`,taskId:s,title:String(o?.step_title||i?.step_id||a),type:a,reason:u,mode:d,at:Number(i?.ts_ms||0),verification:l}),n.length>=8)break}return n},[L.data?.events]),Y=r(()=>Ot.find(e=>e.id===Xe)||null,[Xe,Ot]);e(()=>{if(!Y&&!q&&!M||typeof document>`u`)return;let e=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=e}},[Y,q,M]);let X=String(L.data?.run?.workflowId||L.data?.run?.workflow_id||it?.workflowId||it?.workflow_id||Be||``).trim(),kt=c({queryKey:[`workflow`,`detail`,X],enabled:!!X,queryFn:()=>n(`/api/engine/workflows/${encodeURIComponent(X)}`),refetchInterval:15e3}),At=c({queryKey:[`workflow`,`runs`,X],enabled:!!X,queryFn:()=>n(`/api/engine/workflows/runs?workflow_id=${encodeURIComponent(X)}&limit=12`).catch(()=>({runs:[]})),refetchInterval:5e3}),jt=Array.isArray(At.data?.runs)?At.data.runs:[],Mt=r(()=>{let e={};for(let t of jt){let n=S(t);if(!n)continue;let r=e[n]||{runs:0,failed:0};r.runs+=1,String(t?.status||``).trim().toLowerCase()===`failed`&&(r.failed+=1),e[n]=r}return e},[jt]),Z=r(()=>k?jt.filter(e=>S(e)===k):jt,[k,jt]),Nt=r(()=>{let e=[];for(let t of Z){let n=String(t?.run_id||``).trim(),r=S(t);for(let i of Array.isArray(t?.actions)?t.actions:[])e.push({id:`${n}:${String(i?.action_id||i?.action||e.length)}`,runId:n,action:String(i?.action||`unknown action`),status:String(i?.status||`unknown`),detail:String(i?.detail||``),output:i?.output,updatedAt:Number(i?.updated_at_ms||t?.updated_at_ms||0),taskId:String(i?.task_id||r||``).trim()})}return e.sort((e,t)=>t.updatedAt-e.updatedAt),e},[Z]);e(()=>{let e=Z;if(!e.length){Ke(``);return}e.some(e=>{let t=String(e?.run_id||``).trim();return t&&t===O})||Ke(String(e[0]?.run_id||``).trim())},[Z,O]);let Q=c({queryKey:[`workflow`,`run`,O],enabled:!!O,queryFn:()=>n(`/api/engine/workflows/runs/${encodeURIComponent(O)}`),refetchInterval:5e3}).data?.run||null;e(()=>{let e=S(Q);e&&A(e)},[Q?.run_id,Q?.source_event_id]),e(()=>{Je([])},[X]),se(`/api/engine/workflows/events${X?`?workflow_id=${encodeURIComponent(X)}`:``}`,e=>{try{let t=JSON.parse(e.data);if(t?.status===`ready`)return;Je(e=>[...e.slice(-79),{at:Date.now(),data:t}])}catch{}},{enabled:!!X});let Pt=l({mutationFn:()=>{let e=String(De||``).trim(),t=String(C||``).trim();if(!e)throw Error(`Enter a prompt first.`);if(!t)throw Error(`Set workspace path first.`);return n(`/api/orchestrator/start`,{method:`POST`,body:JSON.stringify({objective:e,workspaceRoot:t,maxTasks:Number(Ie||4),maxAgents:Number(Re||3),workflowId:String(Be||`swarm.blackboard.default`).trim(),requireLlmPlan:!0,allowLocalPlannerFallback:!1,verificationMode:`strict`})})},onSuccess:async e=>{let t=String(e?.runId||``).trim();t&&tt(t),_(!1),p(`ok`,`Planning started.`),await m.invalidateQueries({queryKey:[`swarm`]})},onError:e=>p(`err`,e instanceof Error?e.message:String(e))}),$=l({mutationFn:({path:e,body:t})=>n(e,{method:`POST`,body:JSON.stringify(t)}),onSuccess:async(e,t)=>{if(t.path===`/api/orchestrator/request_revision`){let t=String(e?.runId||``).trim();t&&(tt(t),Ue(``)),p(`ok`,`Reworked plan created.`)}t.path===`/api/orchestrator/approve`&&p(`ok`,`Execution started.`),await m.invalidateQueries({queryKey:[`swarm`]})},onError:e=>p(`err`,e instanceof Error?e.message:String(e))}),Ft=l({mutationFn:async e=>{let t=String(e||``).trim();if(!t)throw Error(`Missing run id.`);return await n(`/api/orchestrator/cancel`,{method:`POST`,body:JSON.stringify({runId:t})}).catch(()=>null),await n(`/api/orchestrator/runs/hide`,{method:`POST`,body:JSON.stringify({runIds:[t]})}).catch(()=>null),t},onSuccess:async()=>{nt(),_(!0),Ue(``),Oe(``),p(`ok`,`Discarded pending plan. You can start a new prompt now.`),await m.invalidateQueries({queryKey:[`swarm`]})},onError:e=>p(`err`,e instanceof Error?e.message:String(e))}),It=o(()=>{_(!0),nt(),x(!1),Ue(``)},[nt]);e(()=>{let e=g.current;e&&ne(e)},[de,v,I,F,R,E,ht.length,gt.length,D,G,Ye,Xe,M,xt]);let Lt=!F,Rt=R===`planning`||R===`queued`,zt=R===`awaiting_approval`,Bt=[`completed`,`failed`,`cancelled`].includes(R),Vt=R===`running`,Ht=R===`paused`,Ut=R===`failed`||R===`blocked`,Wt=[`queued`,`planning`,`awaiting_approval`,`running`,`paused`,`blocked`].includes(R),Gt=u(t,{children:[u(d.aside,{className:`chat-sessions-panel ${v?`open`:``}`,initial:!1,animate:h?{x:v?0:`-104%`}:{x:v?0:`-104%`,transition:{duration:.18,ease:`easeOut`}},children:[u(`div`,{className:`chat-sessions-header`,children:[u(`h3`,{className:`chat-sessions-title`,children:[u(`i`,{"data-lucide":`history`}),`History`]}),u(`div`,{className:`flex items-center gap-1`,children:u(`button`,{type:`button`,className:`tcp-btn h-8 px-2.5 text-xs`,onClick:()=>{m.invalidateQueries({queryKey:[`swarm`,`runs`]})},children:u(`i`,{"data-lucide":`refresh-cw`})})})]}),u(`div`,{className:`chat-session-list`,children:[u(ee,{children:I.map((e,t)=>{let n=String(e?.run_id||e?.runId||`run-${t}`),r=n===F;return u(d.div,{className:`chat-session-row`,initial:h?!1:{opacity:0,y:6},animate:h?void 0:{opacity:1,y:0},exit:h?void 0:{opacity:0,y:-6},children:u(`button`,{type:`button`,className:`chat-session-btn ${r?`active`:``}`,onClick:()=>{_(!1),tt(n),x(!1)},children:[u(`span`,{className:`mb-0.5 inline-flex items-center gap-1 text-xs font-medium`,children:[u(`i`,{"data-lucide":`history`}),u(`span`,{children:_e(ve(e))})]}),u(`span`,{className:`tcp-subtle line-clamp-2 block text-[11px]`,children:String(e?.objective||``).trim()||`No objective`})]})},n)})}),I.length?null:u(`p`,{className:`chat-rail-empty px-1 py-2`,children:`No runs yet.`})]})]}),u(ee,{children:v?u(d.button,{type:`button`,className:`chat-scrim open`,"aria-label":`Close history`,initial:h?!1:{opacity:0},animate:h?void 0:{opacity:1},exit:h?void 0:{opacity:0},onClick:()=>x(!1)}):null})]});if(Lt){let e=String(De||``).trim().length>0&&String(C||``).trim().length>0;return u(t,{children:[u(`div`,{ref:g,className:`chat-layout min-w-0 min-h-0 h-full w-full flex-1`,children:[Gt,u(`div`,{className:`min-h-0 min-w-0 w-full`,children:u(`div`,{className:`flex h-full min-h-0 w-full flex-col gap-4 p-4 md:p-5`,children:[u(`div`,{className:`mb-3`,children:[u(`div`,{className:`inline-flex items-center gap-2 text-sm font-semibold`,children:[u(`button`,{type:`button`,className:`chat-icon-btn h-8 w-8`,title:`History`,onClick:()=>x(e=>!e),children:u(`i`,{"data-lucide":`history`})}),u(`span`,{children:`Task Board`})]}),u(`div`,{className:`tcp-subtle mt-1 text-sm`,children:`Describe the goal. The planner will build a task board.`})]}),u(`div`,{className:`grid min-h-0 flex-1 w-full content-start gap-3`,children:[u(`textarea`,{className:`tcp-input min-h-[360px] md:min-h-[52vh]`,placeholder:`What do you want the agents to build?`,value:De,onInput:e=>Oe(e.target.value)}),u(`div`,{className:`grid gap-2 md:grid-cols-[auto_1fr]`,children:[u(`button`,{className:`tcp-btn`,onClick:()=>{Me(String(C||N.data?.workspaceRoot||`/`).trim()||`/`),T(``),w(!0)},children:[u(`i`,{"data-lucide":`folder-open`}),`Browse`]}),u(`input`,{className:`tcp-input`,readOnly:!0,placeholder:`No workspace selected. Use Browse.`,value:C})]}),u(`div`,{className:`tcp-subtle text-xs`,children:[`Selected folder: `,C||`none`]}),C?null:u(`div`,{className:`rounded-lg border border-amber-400/40 bg-amber-950/20 p-2 text-xs text-amber-200`,children:`Select a workspace folder before sending.`}),u(`div`,{className:`grid gap-2 md:grid-cols-2`,children:[u(`button`,{className:`tcp-btn-primary`,onClick:()=>Pt.mutate(),disabled:Pt.isPending||!e,children:[u(`i`,{"data-lucide":`send`}),`Send`]}),u(`button`,{className:`tcp-btn`,type:`button`,onClick:()=>Fe(e=>!e),children:[u(`i`,{"data-lucide":`sliders-horizontal`}),Pe?`Hide Advanced`:`Show Advanced`]})]}),Pe?u(`div`,{className:`grid gap-2 rounded-lg border border-slate-700/60 bg-slate-900/20 p-2 md:grid-cols-3`,children:[u(`input`,{className:`tcp-input`,type:`number`,min:`1`,value:Ie,onInput:e=>Le(e.target.value),title:`max tasks`}),u(`input`,{className:`tcp-input`,type:`number`,min:`1`,max:`16`,value:Re,onInput:e=>ze(e.target.value),title:`max agents`}),u(`input`,{className:`tcp-input`,value:Be,onInput:e=>Ve(e.target.value),title:`workflow id`}),u(`div`,{className:`tcp-subtle md:col-span-3 text-xs`,children:`Workflow id controls task routing template. Keep default unless you have a custom workflow.`})]}):null]})]})})]}),Ae?u(`div`,{className:`tcp-confirm-overlay`,children:u(`div`,{className:`tcp-confirm-dialog max-w-2xl`,children:[u(`h3`,{className:`tcp-confirm-title`,children:`Select Workspace Folder`}),u(`p`,{className:`tcp-confirm-message`,children:[`Current: `,U||`n/a`]}),u(`div`,{className:`mb-2 flex flex-wrap gap-2`,children:[u(`button`,{className:`tcp-btn`,onClick:()=>{H&&Me(H)},disabled:!H,children:[u(`i`,{"data-lucide":`arrow-up-circle`}),`Up`]}),u(`button`,{className:`tcp-btn-primary`,onClick:()=>{U&&(ke(U),w(!1),T(``),p(`ok`,`Workspace selected: ${U}`))},children:[u(`i`,{"data-lucide":`badge-check`}),`Select This Folder`]}),u(`button`,{className:`tcp-btn`,onClick:()=>{w(!1),T(``)},children:[u(`i`,{"data-lucide":`x`}),`Close`]})]}),u(`div`,{className:`mb-2`,children:u(`input`,{className:`tcp-input`,placeholder:`Type to filter folders...`,value:Ne,onInput:e=>T(e.target.value)})}),u(`div`,{className:`max-h-[360px] overflow-auto rounded-lg border border-slate-700/60 bg-slate-900/20 p-2`,children:pt.length?pt.map(e=>u(`button`,{className:`tcp-list-item mb-1 w-full text-left`,onClick:()=>Me(String(e?.path||``)),children:[u(`i`,{"data-lucide":`folder-open`}),String(e?.name||e?.path||``)]},String(e?.path||e?.name))):u(f,{text:V?`No folders match your search.`:`No subdirectories in this folder.`})})]})}):null]})}return u(t,{children:[u(`div`,{ref:g,className:`chat-layout min-w-0 min-h-0 h-full w-full flex-1`,children:[Gt,u(`div`,{className:`min-h-0 min-w-0 w-full`,children:u(`div`,{className:`grid h-full min-h-[calc(100vh-240px)] min-w-0 w-full gap-5 p-4 md:p-5 xl:grid-cols-[1.05fr_1fr]`,children:[u(`div`,{className:`flex h-full min-h-0 w-full flex-col gap-3`,children:[u(`div`,{className:`mb-3`,children:[u(`div`,{className:`inline-flex items-center gap-2 text-sm font-semibold`,children:[u(`button`,{type:`button`,className:`chat-icon-btn h-8 w-8`,title:`History`,onClick:()=>x(e=>!e),children:u(`i`,{"data-lucide":`history`})}),u(`button`,{type:`button`,className:`chat-icon-btn h-8 w-8`,title:`Back to start`,onClick:It,children:u(`i`,{"data-lucide":`arrow-left-to-line`})}),u(`span`,{children:`Task Board Run`})]}),u(`div`,{className:`tcp-subtle mt-1 text-sm`,children:`Plan review and execution`})]}),u(`div`,{className:`mb-3 flex flex-wrap items-center gap-2 text-xs`,children:[u(`span`,{className:y(R),children:R||`unknown`}),u(`span`,{className:`inline-flex items-center gap-1 tcp-subtle`,children:[u(`i`,{"data-lucide":`history`}),u(`span`,{children:_e(L.data?.run?.updated_at_ms||L.data?.run?.created_at_ms)})]}),u(`span`,{className:`tcp-subtle`,children:[`id: `,F]}),u(`span`,{className:`tcp-subtle`,children:[`plan: `,Tt]})]}),Rt?u(`div`,{className:`mb-3 rounded-xl border border-slate-700/60 bg-slate-900/25 p-3`,children:[u(`div`,{className:`mb-1 text-sm font-medium`,children:`Planner is formulating a plan...`}),u(`div`,{className:`tcp-subtle text-xs`,children:`Waiting for tasks to be generated.`})]}):null,zt?u(`div`,{className:`mb-3 rounded-xl border border-amber-500/40 bg-amber-950/20 p-3`,children:[u(`div`,{className:`mb-2 text-sm font-medium text-amber-200`,children:`Plan Ready`}),u(`div`,{className:`mb-2 text-xs text-amber-100/90`,children:`Review the kanban. Request a rework or execute.`}),u(`textarea`,{className:`tcp-input mb-2 min-h-[80px]`,placeholder:`Feedback to rework the plan...`,value:He,onInput:e=>Ue(e.target.value)}),u(`div`,{className:`flex flex-wrap gap-2`,children:[u(`button`,{className:`tcp-btn`,disabled:!He.trim(),onClick:()=>$.mutate({path:`/api/orchestrator/request_revision`,body:{runId:F,feedback:He,maxTasks:Number(Ie||4),maxAgents:Number(Re||3),workflowId:Be}}),children:[u(`i`,{"data-lucide":`pencil`}),`Rework Plan`]}),u(`button`,{className:`tcp-btn-primary`,onClick:()=>$.mutate({path:`/api/orchestrator/approve`,body:{runId:F}}),children:[u(`i`,{"data-lucide":`play`}),`Execute Plan`]}),u(`button`,{className:`tcp-btn-danger`,disabled:Ft.isPending,onClick:()=>Ft.mutate(F),children:[u(`i`,{"data-lucide":`trash-2`}),`Discard Plan`]})]})]}):null,!Rt&&!zt?u(`div`,{className:`mb-3 flex flex-wrap gap-2`,children:[Vt?u(`button`,{className:`tcp-btn`,onClick:()=>$.mutate({path:`/api/orchestrator/pause`,body:{runId:F}}),children:[u(`i`,{"data-lucide":`square`}),`Pause`]}):null,Ht?u(`button`,{className:`tcp-btn`,onClick:()=>$.mutate({path:`/api/orchestrator/resume`,body:{runId:F}}),children:[u(`i`,{"data-lucide":`play`}),`Resume`]}):null,Ut?u(`button`,{className:`tcp-btn`,onClick:()=>$.mutate({path:`/api/orchestrator/continue`,body:{runId:F}}),children:[u(`i`,{"data-lucide":`rotate-cw`}),`Continue Run`]}):null,Wt?u(`button`,{className:`tcp-btn-danger`,onClick:()=>$.mutate({path:`/api/orchestrator/cancel`,body:{runId:F}}),children:[u(`i`,{"data-lucide":`x`}),`Cancel`]}):null,u(`button`,{className:`tcp-btn`,onClick:It,children:[u(`i`,{"data-lucide":`plus`}),`New Prompt`]})]}):null,Bt?u(`div`,{className:`mb-3 rounded-lg border border-slate-700/60 bg-slate-900/25 p-2 text-xs tcp-subtle`,children:R===`failed`?`This run is failed. Continue the run or retry a failed task.`:`This run is ${R}. Start a new prompt to continue.`}):null,u(`div`,{className:`mt-3 rounded-xl border border-slate-700/60 bg-slate-900/30 p-3`,children:[u(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[u(`div`,{className:`font-medium`,children:`Workspace Files`}),u(`button`,{type:`button`,className:`chat-icon-btn h-7 w-7`,title:`Refresh`,"aria-label":`Refresh`,onClick:()=>void W.refetch(),disabled:!B,children:u(`i`,{"data-lucide":`refresh-cw`})})]}),u(`div`,{className:`mb-2 flex flex-wrap gap-2`,children:[u(`button`,{type:`button`,className:`chat-icon-btn h-7 w-7`,title:`Up`,"aria-label":`Up`,disabled:!_t,onClick:()=>{_t&&We(_t)},children:u(`i`,{"data-lucide":`arrow-up-circle`})}),u(`button`,{type:`button`,className:`chat-icon-btn h-7 w-7`,title:`Root`,"aria-label":`Root`,disabled:!B,onClick:()=>{B&&We(B)},children:u(`i`,{"data-lucide":`home`})})]}),u(`div`,{className:`mb-2 tcp-subtle text-[11px]`,style:{overflowWrap:`anywhere`},children:E||B||`No workspace`}),vt?null:u(`div`,{className:`mb-2 rounded-lg border border-amber-400/40 bg-amber-950/20 p-2 text-xs text-amber-200`,children:`File listing for this workspace is not exposed by the current server scope. Directory navigation still works.`}),u(`div`,{className:`grid max-h-[220px] min-h-0 gap-1 overflow-auto`,children:[ht.map(e=>{let t=String(e?.path||``);return u(`button`,{className:`tcp-list-item text-left`,onClick:()=>We(t),children:u(`span`,{className:`inline-flex items-center gap-2`,children:[u(`i`,{"data-lucide":`folder-open`}),u(`span`,{children:String(e?.name||t)})]})},`dir-${t}`)}),gt.map(e=>{let t=String(e?.path||``);return u(`button`,{className:`tcp-list-item text-left ${t===D?`border-amber-400/70`:``}`,onClick:()=>Ge(t),children:u(`div`,{className:`flex items-center justify-between gap-2`,children:[u(`span`,{className:`inline-flex min-w-0 items-center gap-2`,children:[u(`i`,{"data-lucide":`file-up`}),u(`span`,{className:`truncate`,children:String(e?.name||t)})]}),u(`span`,{className:`tcp-subtle shrink-0 text-[11px]`,children:ye(e?.size)})]})},`file-${t}`)}),!ht.length&&!gt.length?u(f,{text:`No files or folders in this workspace location.`}):null]})]}),D?u(`div`,{className:`mt-3 rounded-xl border border-slate-700/60 bg-slate-900/30 p-3`,children:[u(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[u(`div`,{className:`font-medium`,children:`File Preview`}),u(`div`,{className:`flex items-center gap-2`,children:[K?u(`button`,{type:`button`,className:`tcp-btn h-7 px-2 text-xs`,onClick:()=>Qe(!0),children:[u(`i`,{"data-lucide":`fullscreen`}),`Fullscreen`]}):null,u(`span`,{className:`tcp-subtle text-[11px]`,style:{overflowWrap:`anywhere`},children:D})]})]}),mt.isLoading?u(`div`,{className:`tcp-subtle text-xs`,children:`Loading file...`}):K?u(`div`,{className:`max-h-[420px] overflow-auto rounded-lg border border-slate-700/60 bg-black`,children:u(`iframe`,{className:`h-[420px] w-full bg-black`,sandbox:`allow-scripts allow-forms allow-pointer-lock allow-modals allow-downloads`,allow:`fullscreen; autoplay; clipboard-write`,allowFullScreen:!0,srcDoc:G,title:D,scrolling:`yes`})}):bt?u(`div`,{className:`tcp-markdown tcp-markdown-ai max-h-[260px] overflow-auto rounded-lg border border-slate-700/60 bg-slate-950/40 p-3`,dangerouslySetInnerHTML:{__html:re(G)}}):u(`pre`,{className:`tcp-code max-h-[260px] overflow-auto whitespace-pre-wrap break-words`,children:G||`No text content.`})]}):null,u(`div`,{className:`mt-3 rounded-xl border border-slate-700/60 bg-slate-900/30 p-3`,children:[u(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:u(`div`,{className:`font-medium`,children:`Executor Verification`})}),Ot.length?u(`div`,{className:`grid max-h-44 gap-2 overflow-auto`,children:Ot.map(e=>u(`div`,{className:`rounded border border-slate-700/60 p-2 text-xs`,children:[u(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:[u(`span`,{className:y(e.type.includes(`failed`)?`failed`:`running`),children:e.type}),u(`span`,{className:`tcp-subtle`,children:[`mode: `,e.mode]})]}),u(`div`,{className:`font-medium`,children:e.title}),u(`div`,{className:`tcp-subtle whitespace-pre-wrap break-words`,children:e.reason||`No verification detail.`}),u(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:[u(`button`,{type:`button`,className:`tcp-btn h-7 px-2 text-xs`,onClick:()=>Ze(e.id),children:[u(`i`,{"data-lucide":`search`}),`View details`]}),u(`button`,{type:`button`,className:`tcp-btn h-7 px-2 text-xs`,onClick:async()=>{try{await navigator.clipboard.writeText(Ee(e)),p(`ok`,`Copied verification feedback.`)}catch(e){p(`err`,e instanceof Error?e.message:`Copy failed.`)}},children:[u(`i`,{"data-lucide":`copy-plus`}),`Copy feedback`]})]}),e.verification?.execution_trace?u(`div`,{className:`mt-2 rounded border border-slate-700/50 bg-slate-950/40 p-2 tcp-subtle`,children:[u(`div`,{children:[`session:`,` `,String(e.verification?.execution_trace?.session_id||`n/a`)]}),u(`div`,{children:[`model:`,` `,[String(e.verification?.execution_trace?.model?.provider||``).trim(),String(e.verification?.execution_trace?.model?.model_id||``).trim()].filter(Boolean).join(` / `)||`unknown`]}),u(`div`,{children:[`source:`,` `,String(e.verification?.execution_trace?.model?.source||`n/a`)]})]}):null]},e.id))}):u(`div`,{className:`tcp-subtle text-xs`,children:`No verification telemetry yet.`})]}),u(`div`,{className:`mt-3 grid gap-3 xl:grid-cols-2`,children:[u(`div`,{className:`rounded-xl border border-slate-700/60 bg-slate-900/30 p-3`,children:[u(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:[u(`div`,{className:`font-medium`,children:`Live Activity`}),u(`span`,{className:`tcp-subtle text-xs`,children:b(Date.now())})]}),wt.length?u(`div`,{className:`grid max-h-40 gap-2 overflow-auto`,children:wt.map(e=>u(`div`,{className:`rounded border border-slate-700/60 p-2 text-xs`,children:[u(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:[u(`span`,{className:y(e.type.includes(`failed`)?`failed`:`running`),children:e.type}),u(`span`,{className:`tcp-subtle`,children:b(e.at)})]}),u(`div`,{className:`font-medium`,children:e.title}),u(`div`,{className:`tcp-subtle`,children:e.detail||`No additional detail.`})]},e.id))}):u(`div`,{className:`tcp-subtle text-xs`,children:`No activity events yet.`})]}),u(`div`,{className:`rounded-xl border border-slate-700/60 bg-slate-900/30 p-3`,children:[u(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:u(`div`,{className:`font-medium`,children:`Latest Output`})}),Ct?u(t,{children:[u(`div`,{className:`tcp-code max-h-28 overflow-auto whitespace-pre-wrap break-words`,children:Et||`No assistant output text yet.`}),u(`div`,{className:`mt-2 tcp-subtle text-xs`,children:`Recent tool calls`}),u(`div`,{className:`tcp-code mt-1 max-h-24 overflow-auto whitespace-pre-wrap break-words`,children:Dt.length?Dt.join(`
3
+ `):`No tool call records found in current session yet.`})]}):u(`div`,{className:`tcp-subtle text-xs`,children:`No completed step output session yet.`})]})]})]}),u(`div`,{className:`flex h-full min-h-0 w-full flex-col gap-3`,children:[u(`div`,{className:`mb-3`,children:[u(`div`,{className:`text-sm font-semibold`,children:`Kanban + Budget`}),u(`div`,{className:`tcp-subtle mt-1 text-sm`,children:`Tasks activate after execute`})]}),u(`div`,{className:`mb-3`,children:u(ue,{budget:dt})}),u(ae,{tasks:z,currentTaskId:ut.currentTaskId,selectedTaskId:k,workflowSummaryByTaskId:Mt,onTaskSelect:e=>{A(k===e.id?``:e.id),j(e.id)},onRetryTask:e=>$.mutate({path:`/api/orchestrator/retry`,body:{runId:F,stepId:e.id}})}),k?u(`div`,{className:`mt-3 rounded-xl border border-cyan-700/50 bg-cyan-950/20 p-3`,children:[u(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:[u(`div`,{className:`font-medium`,children:`Selected Task Workflow Link`}),u(`button`,{className:`tcp-btn h-7 px-2 text-xs`,onClick:()=>A(``),children:`Clear task focus`})]}),u(`div`,{className:`tcp-subtle text-xs`,children:[`Task `,u(`strong`,{children:k}),` is filtering workflow runs and event stream.`]})]}):null,k?u(`div`,{className:`mt-3 rounded-xl border border-slate-700/60 bg-slate-900/30 p-3`,children:[u(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[u(`div`,{className:`font-medium`,children:`Task Workflow Artifacts`}),u(`span`,{className:`tcp-subtle text-xs`,children:[Nt.length,` actions`]})]}),Nt.length?u(`div`,{className:`grid max-h-56 gap-2 overflow-auto`,children:Nt.map(e=>u(`div`,{className:`rounded border border-slate-700/60 p-2 text-xs`,children:[u(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:[u(`span`,{className:`font-medium`,children:e.action}),u(`span`,{className:y(e.status),children:e.status})]}),u(`div`,{className:`tcp-subtle`,children:[`run: `,e.runId]}),u(`div`,{className:`tcp-subtle`,children:[`updated: `,b(e.updatedAt)]}),e.detail?u(`div`,{className:`mt-1 text-rose-200`,children:e.detail}):null,e.output?u(oe,{value:e.output,label:`Show output`,preClassName:`tcp-code mt-2 max-h-28 overflow-auto whitespace-pre-wrap break-words`}):null]},e.id))}):u(`div`,{className:`tcp-subtle text-xs`,children:`No workflow action artifacts are linked to this task yet.`})]}):null,u(`div`,{className:`mt-3 rounded-xl border border-slate-700/60 bg-slate-900/30 p-3`,children:[u(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[u(`div`,{className:`font-medium`,children:`Workflow Automation`}),u(`button`,{className:`tcp-btn h-7 px-2 text-xs`,onClick:()=>le(`packs-detail`),children:`Open Workflow Lab`})]}),u(`div`,{className:`mb-2 flex flex-wrap items-center gap-2 text-xs`,children:[u(`span`,{className:`tcp-badge-info`,children:X||`no workflow id`}),u(`span`,{className:`tcp-subtle`,children:Array.isArray(kt.data?.workflow?.steps)?`${kt.data.workflow.steps.length} steps`:`workflow metadata pending`}),u(`span`,{className:`tcp-subtle`,children:Array.isArray(kt.data?.hooks)?`${kt.data.hooks.length} hooks`:``})]}),u(`div`,{className:`grid gap-3 xl:grid-cols-[0.85fr_1.15fr]`,children:[u(`div`,{className:`grid gap-2`,children:[u(`div`,{className:`tcp-subtle text-xs uppercase tracking-[0.24em]`,children:`Workflow Runs`}),u(`div`,{className:`grid max-h-48 gap-2 overflow-auto`,children:Z.length?Z.map((e,t)=>{let n=String(e?.run_id||`workflow-run-${t}`).trim(),r=n===O,i=String(e?.status||`unknown`).trim(),a=S(e);return u(`button`,{type:`button`,className:`tcp-list-item text-left ${r?`border-amber-400/70`:``}`,onClick:()=>Ke(n),children:[u(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:[u(`strong`,{children:n}),u(`span`,{className:y(i),children:i})]}),u(`div`,{className:`tcp-subtle text-xs`,children:[`trigger:`,` `,String(e?.trigger_event||`manual`).trim()||`manual`]}),u(`div`,{className:`tcp-subtle text-xs`,children:[`task: `,a||`n/a`]}),u(`div`,{className:`tcp-subtle text-xs`,children:[`actions:`,` `,Array.isArray(e?.actions)?e.actions.length:0]})]},n)}):u(f,{text:k?`No workflow runs are linked to the selected task yet.`:`No workflow runs recorded for this orchestration workflow yet.`})})]}),u(`div`,{className:`grid gap-2`,children:[u(`div`,{className:`tcp-subtle text-xs uppercase tracking-[0.24em]`,children:`Workflow Run Drilldown`}),Q?u(`div`,{className:`rounded-xl border border-slate-700/60 bg-slate-950/30 p-3`,children:[u(`div`,{className:`mb-2 flex flex-wrap items-center gap-2 text-xs`,children:[u(`span`,{className:y(String(Q?.status||`unknown`)),children:String(Q?.status||`unknown`)}),u(`span`,{className:`tcp-subtle`,children:[`trigger: `,String(Q?.trigger_event||`manual`)]}),u(`span`,{className:`tcp-subtle`,children:[`source: `,String(Q?.source_event_id||`n/a`)]})]}),u(`div`,{className:`grid max-h-48 gap-2 overflow-auto`,children:Array.isArray(Q?.actions)&&Q.actions.length?Q.actions.map((e,t)=>u(`div`,{className:`rounded border border-slate-700/60 p-2 text-xs`,children:[u(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:[u(`span`,{className:`font-medium`,children:String(e?.action||`unknown action`)}),u(`span`,{className:y(String(e?.status||`unknown`)),children:String(e?.status||`unknown`)})]}),u(`div`,{className:`mb-1 flex flex-wrap items-center gap-2`,children:[u(`span`,{className:`tcp-subtle`,children:[`task:`,` `,String(e?.task_id||Q?.task_id||`n/a`)]}),String(e?.task_id||Q?.task_id||``).trim()?u(`button`,{className:`tcp-btn h-7 px-2 text-xs`,onClick:()=>A(String(e?.task_id||Q?.task_id||``).trim()),children:`Focus task`}):null]}),u(`div`,{className:`tcp-subtle`,children:[`started: `,b(e?.started_at_ms)]}),u(`div`,{className:`tcp-subtle`,children:[`finished: `,b(e?.finished_at_ms)]}),String(e?.error||``).trim()?u(`div`,{className:`mt-1 text-rose-200`,children:String(e.error)}):null]},`${String(e?.action||`action`)}-${t}`)):u(`div`,{className:`tcp-subtle text-xs`,children:`No recorded workflow actions for this run.`})})]}):u(f,{text:`Select a workflow run to inspect its action timeline.`})]})]})]}),u(`div`,{className:`mt-3 rounded-xl border border-slate-700/60 bg-slate-900/30 p-3`,children:[u(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:[u(`div`,{className:`font-medium`,children:`Workflow Event Stream`}),u(`button`,{type:`button`,className:`chat-icon-btn h-7 w-7`,title:`Clear workflow events`,"aria-label":`Clear workflow events`,onClick:()=>Je([]),children:u(`i`,{"data-lucide":`trash-2`})})]}),qe.length?u(`div`,{className:`grid max-h-48 gap-2 overflow-auto`,children:[...qe].filter(e=>{let t=S(e.data?.properties||{});if(k&&t&&t!==k)return!1;if(!O)return!0;let n=String(e.data?.properties?.runID||``).trim();return!n||n===O}).reverse().map((e,t)=>{let n=Te(e.data);return u(`div`,{className:`rounded border border-slate-700/60 p-2 text-xs`,children:[u(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:[u(`span`,{className:y(n.endsWith(`.failed`)?`failed`:n.endsWith(`.completed`)?`completed`:`running`),children:n}),u(`span`,{className:`tcp-subtle`,children:b(e.at)})]}),u(`div`,{className:`tcp-subtle`,children:[`run: `,String(e.data?.properties?.runID||`n/a`)]}),u(`div`,{className:`tcp-subtle`,children:[`action:`,` `,String(e.data?.properties?.action||e.data?.properties?.actionID||`-`)]})]},`${e.at}-${t}`)})}):u(`div`,{className:`tcp-subtle text-xs`,children:`No workflow events streamed for this run yet.`})]}),u(ee,{children:[q?u(d.div,{className:`tcp-confirm-overlay`,initial:h?!1:{opacity:0},animate:h?void 0:{opacity:1},exit:h?void 0:{opacity:0},children:[u(`button`,{type:`button`,className:`tcp-confirm-backdrop`,"aria-label":`Close task details`,onClick:()=>j(``)}),u(d.div,{className:`tcp-confirm-dialog tcp-verification-modal`,initial:h?!1:{opacity:0,y:8,scale:.98},animate:h?void 0:{opacity:1,y:0,scale:1},exit:h?void 0:{opacity:0,y:6,scale:.98},children:[u(`div`,{className:`mb-3 flex items-start justify-between gap-3`,children:[u(`div`,{children:[u(`h3`,{className:`tcp-confirm-title`,children:`Kanban Task Details`}),u(`p`,{className:`tcp-confirm-message`,children:`Full task brief, dependencies, and runtime context for this kanban item.`})]}),u(`button`,{type:`button`,className:`tcp-btn h-8 px-2`,onClick:()=>j(``),children:u(`i`,{"data-lucide":`x`})})]}),u(`div`,{className:`mb-3 flex flex-wrap items-center gap-2 text-xs`,children:[u(`span`,{className:y(q.state),children:ge(q.state)}),u(`span`,{className:`tcp-badge-info`,children:q.id}),q.assigned_role?u(`span`,{className:`tcp-subtle`,children:[`role: `,q.assigned_role]}):null,q.gate?u(`span`,{className:`tcp-subtle`,children:[`gate: `,q.gate]}):null,q.workflow_id?u(`span`,{className:`tcp-subtle`,children:[`workflow: `,q.workflow_id]}):null,q.session_id?u(`span`,{className:`tcp-subtle`,children:[`session: `,q.session_id]}):null]}),u(`div`,{className:`tcp-verification-content grid gap-3`,children:[u(`div`,{className:`rounded-xl border border-slate-700/60 bg-slate-950/30 p-3`,children:[u(`div`,{className:`mb-2 font-medium`,children:`Title`}),u(`div`,{className:`rounded-lg border border-slate-800/80 bg-slate-950/70 px-3 py-2 text-sm text-slate-100`,children:q.title||`Untitled task`})]}),q.description?u(`div`,{className:`rounded-xl border border-slate-700/60 bg-slate-950/30 p-3`,children:[u(`div`,{className:`mb-2 font-medium`,children:`Description`}),u(`pre`,{className:`tcp-code tcp-verification-feedback whitespace-pre-wrap break-words`,children:q.description})]}):null,u(`div`,{className:`grid gap-3 lg:grid-cols-2`,children:[u(`div`,{className:`rounded-xl border border-slate-700/60 bg-slate-950/30 p-3`,children:[u(`div`,{className:`mb-2 font-medium`,children:`Dependencies`}),q.dependencies.length?u(`div`,{className:`flex flex-wrap gap-2`,children:q.dependencies.map(e=>u(`span`,{className:`rounded border border-slate-700/60 px-2 py-1 text-xs text-slate-200`,children:[`<-`,` `,e]},`${q.id}-${e}`))}):u(`div`,{className:`tcp-subtle text-sm`,children:`No blocking dependencies.`})]}),u(`div`,{className:`rounded-xl border border-slate-700/60 bg-slate-950/30 p-3`,children:[u(`div`,{className:`mb-2 font-medium`,children:`Runtime Context`}),u(`div`,{className:`grid gap-2 text-sm`,children:[u(`div`,{className:`tcp-subtle`,children:[`runtime status: `,q.runtime_status||`n/a`]}),u(`div`,{className:`tcp-subtle`,children:[`retry count: `,Number(q.retry_count||0)]}),Mt?.[q.id]?u(`div`,{className:`tcp-subtle`,children:[`workflow runs:`,` `,Mt[q.id].runs,Mt[q.id].failed?`, failed ${Mt[q.id].failed}`:``]}):null,q.runtime_detail?u(`div`,{className:`tcp-subtle whitespace-pre-wrap break-words`,children:[`detail: `,q.runtime_detail]}):null]})]})]}),String(q.error_message||``).trim()?u(`div`,{className:`rounded-xl border border-slate-700/60 bg-slate-950/30 p-3`,children:[u(`div`,{className:`mb-2 font-medium`,children:`Error`}),u(`pre`,{className:`tcp-code tcp-verification-feedback whitespace-pre-wrap break-words text-rose-100`,children:String(q.error_message||``).trim()})]}):null]}),u(`div`,{className:`tcp-confirm-actions mt-4`,children:[u(`button`,{className:`tcp-btn`,onClick:()=>{A(q.id),j(``)},children:`Focus task`}),u(`button`,{className:`tcp-btn`,onClick:()=>j(``),children:`Close`})]})]})]}):null,Y?u(d.div,{className:`tcp-confirm-overlay`,initial:h?!1:{opacity:0},animate:h?void 0:{opacity:1},exit:h?void 0:{opacity:0},children:[u(`button`,{type:`button`,className:`tcp-confirm-backdrop`,"aria-label":`Close verification details`,onClick:()=>Ze(``)}),u(d.div,{className:`tcp-confirm-dialog tcp-verification-modal`,initial:h?!1:{opacity:0,y:8,scale:.98},animate:h?void 0:{opacity:1,y:0,scale:1},exit:h?void 0:{opacity:0,y:6,scale:.98},children:[u(`div`,{className:`mb-3 flex items-start justify-between gap-3`,children:[u(`div`,{children:[u(`h3`,{className:`tcp-confirm-title`,children:`Executor Verification Details`}),u(`p`,{className:`tcp-confirm-message`,children:`Raw verification and execution trace for debugging task feedback.`})]}),u(`button`,{type:`button`,className:`tcp-btn h-8 px-2`,onClick:()=>Ze(``),children:u(`i`,{"data-lucide":`x`})})]}),u(`div`,{className:`mb-3 flex flex-wrap items-center gap-2 text-xs`,children:[u(`span`,{className:y(Y.type.includes(`failed`)?`failed`:`running`),children:Y.type}),u(`span`,{className:`tcp-badge-info`,children:Y.title}),u(`span`,{className:`tcp-subtle`,children:[`task: `,Y.taskId||`n/a`]}),u(`span`,{className:`tcp-subtle`,children:[`mode: `,Y.mode]}),u(`span`,{className:`tcp-subtle`,children:[`time: `,b(Y.at)]})]}),u(`div`,{className:`tcp-verification-content grid gap-3`,children:[u(`div`,{className:`rounded-xl border border-slate-700/60 bg-slate-950/30 p-3`,children:[u(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[u(`div`,{className:`font-medium`,children:`Feedback`}),u(`button`,{type:`button`,className:`tcp-btn h-7 px-2 text-xs`,onClick:async()=>{try{await navigator.clipboard.writeText(Ee(Y)),p(`ok`,`Copied verification feedback.`)}catch(e){p(`err`,e instanceof Error?e.message:`Copy failed.`)}},children:[u(`i`,{"data-lucide":`copy-plus`}),`Copy feedback`]})]}),u(`pre`,{className:`tcp-code tcp-verification-feedback whitespace-pre-wrap break-words`,children:Y.reason||`No verification detail.`})]}),u(`div`,{className:`rounded-xl border border-slate-700/60 bg-slate-950/30 p-3`,children:[u(`div`,{className:`mb-2 font-medium`,children:`Verification JSON`}),u(`pre`,{className:`tcp-code tcp-verification-code whitespace-pre-wrap break-words`,children:JSON.stringify(Y.verification||{},null,2)})]})]}),u(`div`,{className:`tcp-confirm-actions mt-4`,children:u(`button`,{className:`tcp-btn`,onClick:()=>Ze(``),children:`Close`})})]})]}):null]})]})]})})]}),u(ee,{children:M&&D&&K?u(d.div,{className:`tcp-confirm-overlay`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>Qe(!1),children:u(d.div,{className:`relative h-[calc(100dvh-1rem)] w-[calc(100vw-1rem)] overflow-hidden rounded-[1.4rem] border border-slate-700/70 bg-slate-950 shadow-[0_28px_64px_rgba(0,0,0,0.55)]`,initial:{opacity:0,y:8,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:6,scale:.98},onClick:e=>e.stopPropagation(),children:[u(`div`,{className:`flex items-center justify-between gap-3 border-b border-slate-800/80 px-5 py-4`,children:[u(`div`,{className:`min-w-0`,children:[u(`div`,{className:`text-lg font-semibold text-slate-100`,children:`Fullscreen Preview`}),u(`div`,{className:`tcp-subtle mt-1 text-xs`,style:{overflowWrap:`anywhere`},children:D})]}),u(`div`,{className:`flex items-center gap-2`,children:[u(`button`,{type:`button`,className:`tcp-btn h-8 px-3 text-xs`,onClick:()=>void mt.refetch(),children:[u(`i`,{"data-lucide":`refresh-cw`}),`Refresh`]}),u(`button`,{type:`button`,className:`chat-icon-btn h-8 w-8`,"aria-label":`Close preview`,title:`Close preview`,onClick:()=>Qe(!1),children:u(`i`,{"data-lucide":`x`})})]})]}),u(`div`,{className:`h-[calc(100%-4.5rem)] p-3`,children:u(`div`,{className:`h-full overflow-auto rounded-xl border border-slate-700/60 bg-black`,children:u(`iframe`,{className:`h-full w-full bg-black`,sandbox:`allow-scripts allow-forms allow-pointer-lock allow-modals allow-downloads`,allow:`fullscreen; autoplay; clipboard-write`,allowFullScreen:!0,srcDoc:G,title:`${D} fullscreen preview`,scrolling:`yes`})})})]})}):null}),Ae?u(`div`,{className:`tcp-confirm-overlay`,children:u(`div`,{className:`tcp-confirm-dialog max-w-2xl`,children:[u(`h3`,{className:`tcp-confirm-title`,children:`Select Workspace Folder`}),u(`p`,{className:`tcp-confirm-message`,children:[`Current: `,U||`n/a`]}),u(`div`,{className:`mb-2 flex flex-wrap gap-2`,children:[u(`button`,{className:`tcp-btn`,onClick:()=>{H&&Me(H)},disabled:!H,children:[u(`i`,{"data-lucide":`arrow-up-circle`}),`Up`]}),u(`button`,{className:`tcp-btn-primary`,onClick:()=>{U&&(ke(U),w(!1),T(``),p(`ok`,`Workspace selected: ${U}`))},children:[u(`i`,{"data-lucide":`badge-check`}),`Select This Folder`]}),u(`button`,{className:`tcp-btn`,onClick:()=>{w(!1),T(``)},children:[u(`i`,{"data-lucide":`x`}),`Close`]})]}),u(`div`,{className:`mb-2`,children:u(`input`,{className:`tcp-input`,placeholder:`Type to filter folders...`,value:Ne,onInput:e=>T(e.target.value)})}),u(`div`,{className:`max-h-[360px] overflow-auto rounded-lg border border-slate-700/60 bg-slate-900/20 p-2`,children:pt.length?pt.map(e=>u(`button`,{className:`tcp-list-item mb-1 w-full text-left`,onClick:()=>Me(String(e?.path||``)),children:[u(`i`,{"data-lucide":`folder-open`}),String(e?.name||e?.path||``)]},String(e?.path||e?.name))):u(f,{text:V?`No folders match your search.`:`No subdirectories in this folder.`})})]})}):null]})}export{De as OrchestratorPage};
@@ -0,0 +1,3 @@
1
+ import{E as e,g as t,v as n}from"./fullcalendar-Bn75j0xM.js";import{a as r,n as i,t as a}from"./react-query-BIbNygEJ.js";import{i as o}from"./motion-B3ZE8SGR.js";import{S as s,b as ee,h as c,m as te,s as l,u,x as d}from"./index-TvymvGva.js";import{n as f}from"./LazyJson-vfWw7G9F.js";import{t as p}from"./useEngineStream-Diqri33l.js";function m(e,t){return Array.isArray(e)?e:Array.isArray(e?.[t])?e[t]:[]}function h(e){return String(e||``).trim()}function ne(e){return e?`ok`:`ghost`}function g(e){return h(e?.event_type||e?.type||e?.event||`workflow.event`)}function _(e,t){return`/api/engine/packs/${encodeURIComponent(h(e))}/files/${encodeURI(h(t))}`}function v({api:v,toast:y}){let b=r(),[x,S]=n(``),[C,re]=n(``),[w,ie]=n(``),[T,E]=n(`context.task.created`),[D,ae]=n(`{
2
+ "event_id": "demo-task-1"
3
+ }`),[O,k]=n([]),A=i({queryKey:[`packs`,`list`],queryFn:()=>v(`/api/engine/packs`,{method:`GET`}).catch(()=>({packs:[]})),refetchInterval:15e3}),j=i({queryKey:[`workflows`,`list`],queryFn:()=>v(`/api/engine/workflows`,{method:`GET`}).catch(()=>({workflows:[]})),refetchInterval:15e3}),M=i({queryKey:[`workflows`,`hooks`],queryFn:()=>v(`/api/engine/workflow-hooks`,{method:`GET`}).catch(()=>({hooks:[]})),refetchInterval:15e3}),N=m(A.data,`packs`),P=m(j.data,`workflows`),oe=m(M.data,`hooks`),F=t(()=>C||h(N[0]?.pack_id||N[0]?.name),[N,C]),I=t(()=>w||h(P[0]?.workflow_id),[w,P]),L=m(i({queryKey:[`workflows`,`runs`,I],queryFn:()=>v(`/api/engine/workflows/runs${I?`?workflow_id=${encodeURIComponent(I)}&limit=20`:`?limit=20`}`,{method:`GET`}).catch(()=>({runs:[]})),refetchInterval:6e3}).data,`runs`),se=i({queryKey:[`packs`,`detail`,F],enabled:!!F,queryFn:()=>v(`/api/engine/packs/${encodeURIComponent(F)}`,{method:`GET`})}),R=i({queryKey:[`workflows`,`detail`,I],enabled:!!I,queryFn:()=>v(`/api/engine/workflows/${encodeURIComponent(I)}`,{method:`GET`})}),z=a({mutationFn:()=>v(`/api/engine/packs/install`,{method:`POST`,body:JSON.stringify({path:x,source:{kind:`control-panel`}})}),onSuccess:async()=>{y(`ok`,`Pack installed.`),S(``),await Promise.all([b.invalidateQueries({queryKey:[`packs`]}),b.invalidateQueries({queryKey:[`workflows`]})])},onError:e=>y(`err`,e instanceof Error?e.message:String(e))}),B=a({mutationFn:e=>v(`/api/engine/workflows/${encodeURIComponent(e)}/run`,{method:`POST`}),onSuccess:async e=>{y(`ok`,`Workflow ${h(e?.run?.workflow_id||I)} started.`),await Promise.all([b.invalidateQueries({queryKey:[`workflows`]}),b.invalidateQueries({queryKey:[`workflows`,`runs`]})])},onError:e=>y(`err`,e instanceof Error?e.message:String(e))}),V=a({mutationFn:async()=>{let e={},t=h(D);return t&&(e=JSON.parse(t)),v(`/api/engine/workflows/simulate`,{method:`POST`,body:JSON.stringify({event_type:T,properties:e})})},onError:e=>y(`err`,e instanceof Error?e.message:String(e))}),H=a({mutationFn:({bindingId:e,enabled:t})=>v(`/api/engine/workflow-hooks/${encodeURIComponent(e)}`,{method:`PATCH`,body:JSON.stringify({enabled:t})}),onSuccess:async()=>{await Promise.all([b.invalidateQueries({queryKey:[`workflows`,`hooks`]}),b.invalidateQueries({queryKey:[`workflows`,`detail`]})])},onError:e=>y(`err`,e instanceof Error?e.message:String(e))}),U=se.data?.pack||null,W=R.data?.workflow||null,G=m(R.data,`hooks`),K=V.data?.simulation||null,q=U?.manifest?.marketplace||null,J=q?.publisher||null,Y=q?.listing||null,X=h(Y?.icon||``),Z=h(i({queryKey:[`packs`,`readme`,F],enabled:!!F,queryFn:async()=>{let e=await fetch(_(F,`README.md`),{credentials:`include`});return e.ok?e.text():``}}).data||``),Q=X?_(F,X):``,$=m(Y,`screenshots`).map(e=>h(e));return p(`/api/engine/workflows/events${I?`?workflow_id=${encodeURIComponent(I)}`:``}`,e=>{try{let t=JSON.parse(e.data);if(t?.status===`ready`)return;k(e=>[...e.slice(-59),{at:Date.now(),data:t}])}catch{}},{enabled:!0}),o(te,{className:`grid gap-4`,children:[o(ee,{eyebrow:`Operations`,title:`Pack library and workflow lab`,subtitle:`Inspect installed packs, see workflow extensions, toggle hooks, simulate lifecycle events, and run workflow definitions without leaving the control panel.`,badges:o(e,{children:[o(c,{tone:`info`,children:[N.length,` installed packs`]}),o(c,{tone:`warn`,children:[P.length,` workflows`]}),o(c,{tone:`ghost`,children:[oe.length,` hooks`]})]})}),o(s,{main:o(`div`,{className:`grid gap-4`,children:[o(d,{title:`Installed packs`,subtitle:`Select a pack to inspect its manifest, declared workflow contents, and hook contributions.`,children:o(`div`,{className:`grid gap-2`,children:N.length?N.map((e,t)=>{let n=h(e?.pack_id||e?.name||t);return o(`button`,{type:`button`,className:`tcp-list-item text-left ${n===F?`border-amber-400/70`:``}`,onClick:()=>re(n),children:[o(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:[o(`strong`,{children:h(e?.name||n)}),o(`span`,{className:`tcp-badge-info`,children:h(e?.version||`-`)})]}),o(`div`,{className:`flex flex-wrap gap-2 text-xs`,children:[o(`span`,{className:`tcp-subtle`,children:h(e?.pack_type||`pack`)}),o(`span`,{className:`tcp-subtle`,children:h(e?.install_path||``)})]})]},n)}):o(l,{text:`No packs are installed yet.`})})}),o(d,{title:`Workflow registry`,subtitle:`This is the live workflow registry resolved from built-ins, installed packs, and workspace-local overrides.`,children:o(`div`,{className:`grid gap-2`,children:P.length?P.map(e=>{let t=h(e?.workflow_id),n=t===I,r=h(e?.source?.kind||`unknown`);return o(`button`,{type:`button`,className:`tcp-list-item text-left ${n?`border-amber-400/70`:``}`,onClick:()=>ie(t),children:[o(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:[o(`strong`,{children:h(e?.name||t)}),o(`span`,{className:`tcp-badge-${r===`pack`?`warn`:`info`}`,children:r})]}),o(`div`,{className:`tcp-subtle text-xs`,children:[t,` · `,m(e?.steps,`steps`).length,` steps`]})]},t)}):o(l,{text:`No workflows are currently registered.`})})})]}),aside:o(`div`,{className:`grid gap-4`,children:[o(d,{title:`Install pack`,subtitle:`Install a local pack path and reload workflow contributions automatically.`,children:o(`div`,{className:`grid gap-3`,children:[o(`input`,{className:`tcp-input`,value:x,onInput:e=>S(e.target.value),placeholder:`/path/to/pack.zip`}),o(`button`,{className:`tcp-btn-primary`,disabled:!x.trim()||z.isPending,onClick:()=>z.mutate(),children:[o(`i`,{"data-lucide":`download`}),`Install from path`]})]})}),o(d,{title:`Pack inspector`,subtitle:`Shows which workflows and hooks a pack contributes, alongside its current capability surface.`,children:U?o(`div`,{className:`grid gap-3`,children:[o(`div`,{className:`tcp-list-item`,children:[o(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:[o(`strong`,{children:h(U?.installed?.name||F)}),o(c,{tone:`info`,children:h(U?.installed?.version||`-`)})]}),o(`div`,{className:`flex flex-wrap gap-2 text-xs`,children:[o(c,{tone:`ghost`,children:[Number(U?.workflow_extensions?.workflow_count||0),` `,`workflows`]}),o(c,{tone:`ghost`,children:[Number(U?.workflow_extensions?.workflow_hook_count||0),` `,`hooks`]}),o(c,{tone:`ghost`,children:[Number(U?.risk?.required_capabilities_count||0),` `,`required caps`]})]})]}),Y?o(`div`,{className:`tcp-list-item grid gap-3`,children:[o(`div`,{className:`flex items-start gap-3`,children:[Q?o(`img`,{src:Q,alt:`${h(Y?.display_name||U?.installed?.name||F)} cover art`,className:`h-24 w-24 rounded-2xl border border-white/10 object-cover`}):null,o(`div`,{className:`min-w-0 flex-1`,children:[o(`div`,{className:`mb-1 flex flex-wrap items-center gap-2`,children:[o(`strong`,{children:h(Y?.display_name||F)}),o(c,{tone:`info`,children:h(J?.verification_tier||`unverified`)})]}),o(`div`,{className:`tcp-subtle text-sm`,children:h(Y?.description||``)}),o(`div`,{className:`mt-2 flex flex-wrap gap-2 text-xs`,children:[o(c,{tone:`ghost`,children:h(J?.display_name||`Unknown publisher`)}),m(Y,`categories`).map(e=>o(c,{tone:`ghost`,children:h(e)},h(e))),m(Y,`tags`).map(e=>o(c,{tone:`ghost`,children:h(e)},h(e)))]})]})]}),$.length?o(`div`,{className:`grid gap-2`,children:[o(`div`,{className:`tcp-subtle text-xs uppercase tracking-[0.24em]`,children:`Screenshots`}),o(`div`,{className:`grid gap-2 md:grid-cols-2`,children:$.map(e=>o(`img`,{src:_(F,e),alt:`${h(Y?.display_name||F)} screenshot`,className:`rounded-2xl border border-white/10`},e))})]}):null,o(`div`,{className:`grid gap-2`,children:[o(`div`,{className:`tcp-subtle text-xs uppercase tracking-[0.24em]`,children:`README Preview`}),Z?o(`div`,{className:`prose prose-invert max-w-none rounded-2xl border border-white/10 bg-black/20 p-4`,dangerouslySetInnerHTML:{__html:u(Z)}}):o(l,{text:`No README preview is available for this pack.`})]})]}):null,o(`div`,{className:`grid gap-2`,children:[o(`div`,{className:`tcp-subtle text-xs uppercase tracking-[0.24em]`,children:`Workflow Entry Points`}),m(U?.workflow_extensions,`workflow_entrypoints`).length?m(U?.workflow_extensions,`workflow_entrypoints`).map((e,t)=>o(`div`,{className:`tcp-list-item text-sm`,children:h(e)},`${h(e)}-${t}`)):o(l,{text:`This pack does not declare workflow entrypoints.`})]}),o(f,{value:U?.manifest||{},label:`Manifest`,className:`tcp-list-item`,preClassName:`tcp-subtle mt-3 overflow-x-auto text-xs`})]}):o(l,{text:`Select an installed pack to inspect workflow extensions.`})})]})}),o(s,{main:o(d,{title:`Workflow viewer`,subtitle:`Structured view of workflow steps and source provenance for the selected workflow.`,actions:o(`button`,{className:`tcp-btn`,disabled:!I||B.isPending,onClick:()=>I&&B.mutate(I),children:[o(`i`,{"data-lucide":`play`}),`Run workflow`]}),children:W?o(`div`,{className:`grid gap-3`,children:[o(`div`,{className:`tcp-list-item`,children:[o(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:[o(`strong`,{children:h(W?.name||I)}),o(c,{tone:`info`,children:h(W?.source?.kind||`unknown`)})]}),o(`div`,{className:`tcp-subtle text-sm`,children:h(W?.description||`No description provided.`)})]}),o(`div`,{className:`grid gap-2`,children:m(W,`steps`).length?m(W,`steps`).map((e,t)=>o(`div`,{className:`tcp-list-item`,children:[o(`div`,{className:`mb-1 text-xs uppercase tracking-[0.24em] text-slate-400`,children:[`Step `,t+1]}),o(`div`,{className:`font-medium`,children:h(e?.action||`unknown`)}),e?.with?o(f,{value:e.with,label:`Show step config`,preClassName:`tcp-subtle mt-2 overflow-x-auto text-xs`}):null]},h(e?.step_id||t))):o(l,{text:`This workflow does not define any linear steps.`})})]}):o(l,{text:`Select a workflow to inspect its current resolved definition.`})}),aside:o(`div`,{className:`grid gap-4`,children:[o(d,{title:`Hook manager`,subtitle:`Enable or disable hook bindings on the live registry and inspect the attached actions.`,children:o(`div`,{className:`grid gap-2`,children:G.length?G.map(e=>{let t=h(e?.binding_id),n=!!e?.enabled;return o(`div`,{className:`tcp-list-item`,children:[o(`div`,{className:`mb-2 flex items-start justify-between gap-2`,children:[o(`div`,{children:[o(`div`,{className:`font-medium`,children:h(e?.event||t)}),o(`div`,{className:`tcp-subtle text-xs`,children:t})]}),o(`button`,{className:`tcp-btn`,disabled:H.isPending,onClick:()=>H.mutate({bindingId:t,enabled:!n}),children:n?`Disable`:`Enable`})]}),o(`div`,{className:`mb-2 flex flex-wrap gap-2`,children:[o(c,{tone:ne(n),children:n?`Enabled`:`Disabled`}),o(c,{tone:`ghost`,children:[m(e,`actions`).length,` actions`]})]}),o(`div`,{className:`grid gap-1`,children:m(e,`actions`).map((e,n)=>o(`div`,{className:`tcp-subtle text-xs`,children:h(e?.action||e)},`${t}-${n}`))})]},t)}):o(l,{text:`The selected workflow has no registered hooks.`})})}),o(d,{title:`Recent workflow runs`,subtitle:`Latest workflow executions for the selected workflow, including hook-triggered runs.`,children:o(`div`,{className:`grid gap-2`,children:L.length?L.map((e,t)=>{let n=h(e?.status||`unknown`),r=n===`completed`?`ok`:n===`failed`?`err`:n===`running`?`warn`:`ghost`;return o(`div`,{className:`tcp-list-item`,children:[o(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:[o(`strong`,{children:h(e?.run_id||`run-${t+1}`)}),o(c,{tone:r,children:n})]}),o(`div`,{className:`tcp-subtle text-xs`,children:[`trigger: `,h(e?.trigger_event||`manual`)]}),o(`div`,{className:`tcp-subtle text-xs`,children:[`actions: `,m(e,`actions`).length]})]},h(e?.run_id||t))}):o(l,{text:`No workflow runs have been recorded yet.`})})})]})}),o(s,{main:o(d,{title:`Workflow testing mode`,subtitle:`Simulate a source event to see which hooks will match before triggering real actions.`,actions:o(`button`,{className:`tcp-btn-primary`,disabled:!T.trim()||V.isPending,onClick:()=>V.mutate(),children:[o(`i`,{"data-lucide":`flask-conical`}),`Simulate`]}),children:o(`div`,{className:`grid gap-3`,children:[o(`input`,{className:`tcp-input`,value:T,onInput:e=>E(e.target.value),placeholder:`context.task.created`}),o(`textarea`,{className:`tcp-input min-h-[180px] font-mono text-xs`,value:D,onInput:e=>ae(e.target.value),spellCheck:!1}),K?o(`div`,{className:`grid gap-3`,children:[o(`div`,{className:`flex flex-wrap gap-2`,children:m(K,`canonical_events`).map((e,t)=>o(c,{tone:`info`,children:h(e)},`${h(e)}-${t}`))}),o(`div`,{className:`grid gap-2`,children:m(K,`matched_bindings`).length?m(K,`matched_bindings`).map(e=>o(`div`,{className:`tcp-list-item`,children:[o(`div`,{className:`font-medium`,children:h(e?.binding_id)}),o(`div`,{className:`tcp-subtle text-xs`,children:[h(e?.event),` · `,m(e,`actions`).length,` `,`actions`]})]},h(e?.binding_id))):o(l,{text:`No workflow hooks matched this event.`})})]}):o(l,{text:`Run a simulation to inspect canonical events, matched bindings, and planned actions.`})]})}),aside:o(d,{title:`Triggered actions`,subtitle:`Preview of actions the engine plans to execute for the simulated event.`,children:o(`div`,{className:`grid gap-2`,children:m(K,`planned_actions`).length?m(K,`planned_actions`).map((e,t)=>o(`div`,{className:`tcp-list-item`,children:[o(`div`,{className:`font-medium`,children:h(e?.action||e)}),e?.with?o(f,{value:e.with,label:`Show action config`,preClassName:`tcp-subtle mt-2 overflow-x-auto text-xs`}):null]},`${h(e?.action||e)}-${t}`)):o(l,{text:`No planned actions yet.`})})})}),o(d,{title:`Live workflow events`,subtitle:"Real-time `workflow.*` events for the selected workflow, including run start, action completion, and failures.",actions:o(`button`,{className:`tcp-btn`,onClick:()=>k([]),children:[o(`i`,{"data-lucide":`trash-2`}),`Clear stream`]}),children:o(`div`,{className:`grid max-h-[28rem] gap-2 overflow-auto rounded-2xl border border-slate-700/60 bg-black/20 p-2`,children:O.length?[...O].reverse().map((e,t)=>{let n=g(e.data),r=n.endsWith(`.failed`)?`err`:n.endsWith(`.completed`)?`ok`:n.endsWith(`.started`)?`warn`:`info`;return o(`div`,{className:`tcp-list-item`,children:[o(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:[o(`strong`,{children:n}),o(c,{tone:r,children:new Date(e.at).toLocaleTimeString()})]}),o(`div`,{className:`tcp-subtle text-xs`,children:[`run: `,h(e.data?.properties?.runID||`n/a`)]}),o(`div`,{className:`tcp-subtle text-xs`,children:[`action:`,` `,h(e.data?.properties?.action||e.data?.properties?.actionID||`-`)]})]},`${e.at}-${t}`)}):o(l,{text:`Run a workflow or trigger a hook to watch live workflow events here.`})})})]})}export{v as PacksPage};
@@ -0,0 +1 @@
1
+ import{i as e}from"./motion-B3ZE8SGR.js";import{h as t,x as n}from"./index-TvymvGva.js";function r({title:t,description:n,children:r,className:i=``}){return e(`div`,{className:`rounded-xl border border-white/10 bg-black/20 p-3 ${i}`.trim(),children:[e(`div`,{className:`text-xs uppercase tracking-wide text-slate-500`,children:t}),n?e(`div`,{className:`mt-1 text-xs text-slate-400`,children:n}):null,e(`div`,{className:`mt-2`,children:r})]})}function i({metrics:t,columns:n=`sm:grid-cols-2`}){return e(`div`,{className:`grid gap-2 ${n}`.trim(),children:t.map(t=>e(r,{title:t.label,children:[e(`div`,{className:`text-slate-100`,children:t.value}),t.detail?e(`div`,{className:`mt-1 text-xs text-slate-400`,children:t.detail}):null]},t.label))})}function a(e){return String(e||``).trim()}function o(e){return Array.isArray(e)?e.map(e=>a(e)).filter(Boolean):[]}function s({plannerDiagnostics:i,teachingLibrary:s,planningChangeSummary:c}){let l=o(s?.explanations||s?.explanation||[]),u=o(s?.objections||[]),d=o(s?.proof_points||s?.proofPoints||[]),f=a(i?.fallback_reason||i?.fallbackReason||``),p=a(i?.summary||i?.detail||``),m=i?.task_budget||i?.taskBudget||i?.decomposition_observation?.task_budget||i?.decompositionObservation?.taskBudget||i?.observation?.task_budget||i?.observation?.taskBudget||null,h=a(m?.status||``),g=Number(m?.original_step_count??m?.originalStepCount),_=Number(m?.generated_step_count??m?.generatedStepCount),v=Number(m?.max_generated_steps??m?.maxGeneratedSteps),y=h===`compacted`&&Number.isFinite(g)&&Number.isFinite(_)?`Planner compacted ${g} generated tasks into ${_} runnable workflow steps.`:h===`rejected`&&Number.isFinite(_)&&Number.isFinite(v)?`Generated plan has ${_} tasks, above the ${v} task budget.`:h===`within_budget`&&Number.isFinite(_)&&Number.isFinite(v)?`Generated plan is within budget: ${_}/${v} tasks.`:``;return e(n,{title:`Diagnostics`,subtitle:`Planner guidance, change summary, and compiler notes.`,children:e(`div`,{className:`grid gap-3 text-sm`,children:[e(`div`,{className:`flex flex-wrap gap-2`,children:[e(t,{tone:i?`ok`:`warn`,children:i?`diagnostics ready`:`diagnostics pending`}),e(t,{tone:l.length?`ok`:`warn`,children:l.length?`teaching library ready`:`teaching library pending`}),f?e(t,{tone:`info`,children:f.replace(/_/g,` `)}):null,h?e(t,{tone:h===`rejected`?`warn`:`ok`,children:[`task budget `,h.replace(/_/g,` `)]}):null]}),e(r,{title:`Planner diagnostics`,children:[e(`div`,{className:`text-slate-200`,children:p||`No planner diagnostics yet.`}),y?e(`div`,{className:`mt-2 rounded-lg border border-lime-400/30 bg-lime-400/10 p-2 text-lime-100`,children:y}):null]}),c.length?e(r,{title:`Latest changes`,children:e(`ul`,{className:`mt-2 grid gap-2 text-slate-200`,children:c.map(t=>e(`li`,{className:`rounded-lg border border-white/10 bg-black/20 p-2`,children:t},t))})}):null,l.length||u.length||d.length?e(`div`,{className:`grid gap-3 lg:grid-cols-3`,children:[e(r,{title:`Explanations`,children:e(`ul`,{className:`mt-2 grid gap-2 text-slate-200`,children:l.length?l.map(t=>e(`li`,{className:`rounded-lg border border-white/10 bg-black/20 p-2`,children:t},t)):e(`li`,{className:`tcp-subtle text-xs`,children:`No explanation guidance yet.`})})}),e(r,{title:`Objections`,children:e(`ul`,{className:`mt-2 grid gap-2 text-slate-200`,children:u.length?u.map(t=>e(`li`,{className:`rounded-lg border border-white/10 bg-black/20 p-2`,children:t},t)):e(`li`,{className:`tcp-subtle text-xs`,children:`No objection guidance yet.`})})}),e(r,{title:`Proof points`,children:e(`ul`,{className:`mt-2 grid gap-2 text-slate-200`,children:d.length?d.map(t=>e(`li`,{className:`rounded-lg border border-white/10 bg-black/20 p-2`,children:t},t)):e(`li`,{className:`tcp-subtle text-xs`,children:`No proof-point guidance yet.`})})})]}):null]})})}export{i as n,r,s as t};
@@ -0,0 +1 @@
1
+ import{i as e}from"./motion-B3ZE8SGR.js";function t(e,t){let n=new Set,r=[];for(let i of[t,...e]){let e=String(i||``).trim();!e||n.has(e)||(n.add(e),r.push(e))}return r}function n({providerLabel:n,modelLabel:r,draft:i,providers:a,onChange:o,inheritLabel:s=`Workspace default`,disabled:c=!1}){let l=t(a.find(e=>e.id===i.provider)?.models||[],i.model).filter(e=>{let t=String(i.model||``).trim().toLowerCase();return!t||e.toLowerCase().includes(t)}).slice(0,80);return e(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[e(`label`,{className:`block text-sm`,children:[e(`div`,{className:`mb-1 flex items-center gap-2 font-medium text-slate-200`,children:[e(`i`,{"data-lucide":`cpu`}),e(`span`,{children:n})]}),e(`select`,{value:i.provider,onInput:e=>{let t=e.target.value;o({provider:t,model:(a.find(e=>e.id===t)?.models||[])[0]||``})},className:`tcp-select h-10 w-full`,disabled:c,children:[e(`option`,{value:``,children:s}),t(a.map(e=>e.id),i.provider).map(t=>e(`option`,{value:t,children:[t,a.find(e=>e.id===t)?.configured===!1?` (not configured)`:``]},t))]})]}),e(`label`,{className:`block text-sm`,children:[e(`div`,{className:`mb-1 flex items-center gap-2 font-medium text-slate-200`,children:[e(`i`,{"data-lucide":`sparkles`}),e(`span`,{children:r})]}),e(`input`,{className:`tcp-input h-10 w-full`,value:i.model,onInput:e=>o({...i,model:e.target.value}),placeholder:i.provider?`Type to filter models`:s,disabled:c||!i.provider}),e(`div`,{className:`mt-2 max-h-48 overflow-auto rounded-xl border border-slate-700/60 bg-slate-900/20 p-1`,children:i.provider?l.length?l.map(t=>e(`button`,{type:`button`,className:`block w-full rounded-lg px-2 py-1.5 text-left text-sm hover:bg-slate-700/30 ${t===i.model?`bg-slate-700/40`:``}`,onClick:()=>o({...i,model:t}),disabled:c,children:t},t)):e(`div`,{className:`tcp-subtle px-2 py-1 text-xs`,children:`No matching models. Type a model id manually.`}):e(`div`,{className:`tcp-subtle px-2 py-1 text-xs`,children:s})})]})]})}export{n as t};
@@ -0,0 +1 @@
1
+ import{v as e}from"./fullcalendar-Bn75j0xM.js";import{i as t}from"./motion-B3ZE8SGR.js";import{c as n,m as r}from"./index-TvymvGva.js";import{MyAutomations as i}from"./AutomationsPage-BGqpmilp.js";function a({client:a,toast:o,navigate:s}){let[c,l]=e(``);return t(r,{className:`grid h-full min-h-0 gap-4`,children:t(n,{title:`Run Overview`,subtitle:`Watch active and blocked runs together, then open the full debugger for any individual automation run.`,actions:t(`div`,{className:`flex flex-wrap items-center gap-2`,children:t(`button`,{className:`tcp-btn h-8 px-3 text-xs`,onClick:()=>s(`automations`),children:[t(`i`,{"data-lucide":`bot`}),`Open automations`]})}),fullHeight:!0,children:t(i,{client:a,toast:o,navigate:s,viewMode:`running`,selectedRunId:c,onSelectRunId:l,onOpenRunningView:()=>void 0,onOpenAdvancedEdit:()=>void 0,defaultRunningSectionsOpen:{active:!0,issues:!0,history:!0}})})})}export{a as RunsPage};