@hotmeshio/long-tail 0.7.2 → 0.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dashboard/dist/assets/{AdminDashboard-rZDVS2G_.js → AdminDashboard-C9eE1VEp.js} +2 -2
- package/dashboard/dist/assets/{AdminDashboard-rZDVS2G_.js.map → AdminDashboard-C9eE1VEp.js.map} +1 -1
- package/dashboard/dist/assets/{AgentConfigPage-CbyyCjCT.js → AgentConfigPage-Ba8QfXM2.js} +2 -2
- package/dashboard/dist/assets/{AgentConfigPage-CbyyCjCT.js.map → AgentConfigPage-Ba8QfXM2.js.map} +1 -1
- package/dashboard/dist/assets/{AgentDetailPage-DMeHvidT.js → AgentDetailPage-DVmec0CP.js} +2 -2
- package/dashboard/dist/assets/{AgentDetailPage-DMeHvidT.js.map → AgentDetailPage-DVmec0CP.js.map} +1 -1
- package/dashboard/dist/assets/{AgentsPage-C8fKLxh-.js → AgentsPage-DNiCYMh3.js} +2 -2
- package/dashboard/dist/assets/{AgentsPage-C8fKLxh-.js.map → AgentsPage-DNiCYMh3.js.map} +1 -1
- package/dashboard/dist/assets/{AvailableEscalationsPage-CUHcybKU.js → AvailableEscalationsPage-gDIF8ocC.js} +2 -2
- package/dashboard/dist/assets/{AvailableEscalationsPage-CUHcybKU.js.map → AvailableEscalationsPage-gDIF8ocC.js.map} +1 -1
- package/dashboard/dist/assets/{BotPicker-DGhniNcy.js → BotPicker-3wBcBavT.js} +2 -2
- package/dashboard/dist/assets/{BotPicker-DGhniNcy.js.map → BotPicker-3wBcBavT.js.map} +1 -1
- package/dashboard/dist/assets/{CapabilitiesPage-ClfuW4ya.js → CapabilitiesPage-WoPkND2y.js} +2 -2
- package/dashboard/dist/assets/{CapabilitiesPage-ClfuW4ya.js.map → CapabilitiesPage-WoPkND2y.js.map} +1 -1
- package/dashboard/dist/assets/{CollapsibleSection-DnECdKEY.js → CollapsibleSection-Cx99mqNN.js} +2 -2
- package/dashboard/dist/assets/{CollapsibleSection-DnECdKEY.js.map → CollapsibleSection-Cx99mqNN.js.map} +1 -1
- package/dashboard/dist/assets/{CredentialsPage-DdZ-jyyc.js → CredentialsPage-DbNaoPbF.js} +2 -2
- package/dashboard/dist/assets/{CredentialsPage-DdZ-jyyc.js.map → CredentialsPage-DbNaoPbF.js.map} +1 -1
- package/dashboard/dist/assets/{CronLabel-CymxLvY0.js → CronLabel-DLW4_Zg4.js} +2 -2
- package/dashboard/dist/assets/{CronLabel-CymxLvY0.js.map → CronLabel-DLW4_Zg4.js.map} +1 -1
- package/dashboard/dist/assets/{CustomDurationPicker-8JHvVWD2.js → CustomDurationPicker-BRUFjkiu.js} +2 -2
- package/dashboard/dist/assets/{CustomDurationPicker-8JHvVWD2.js.map → CustomDurationPicker-BRUFjkiu.js.map} +1 -1
- package/dashboard/dist/assets/{ElapsedCell-BRZfw_Af.js → ElapsedCell-BtmDQaym.js} +2 -2
- package/dashboard/dist/assets/{ElapsedCell-BRZfw_Af.js.map → ElapsedCell-BtmDQaym.js.map} +1 -1
- package/dashboard/dist/assets/EscalationSchemaPage-Bm4yBEGN.js +9 -0
- package/dashboard/dist/assets/EscalationSchemaPage-Bm4yBEGN.js.map +1 -0
- package/dashboard/dist/assets/{EscalationsOverview-CiQO3ntf.js → EscalationsOverview-B3xZwTQA.js} +2 -2
- package/dashboard/dist/assets/{EscalationsOverview-CiQO3ntf.js.map → EscalationsOverview-B3xZwTQA.js.map} +1 -1
- package/dashboard/dist/assets/{EventTable-CLuAbba_.js → EventTable-Bh9FKXLI.js} +2 -2
- package/dashboard/dist/assets/{EventTable-CLuAbba_.js.map → EventTable-Bh9FKXLI.js.map} +1 -1
- package/dashboard/dist/assets/{GraphInvokePage-BFRi6Nny.js → GraphInvokePage-ov_ANlaE.js} +2 -2
- package/dashboard/dist/assets/{GraphInvokePage-BFRi6Nny.js.map → GraphInvokePage-ov_ANlaE.js.map} +1 -1
- package/dashboard/dist/assets/{HomePage-m1pnxilb.js → HomePage-D0DV6izb.js} +2 -2
- package/dashboard/dist/assets/{HomePage-m1pnxilb.js.map → HomePage-D0DV6izb.js.map} +1 -1
- package/dashboard/dist/assets/{ListToolbar-D4Y-M7wN.js → ListToolbar-FpcvqNkN.js} +2 -2
- package/dashboard/dist/assets/{ListToolbar-D4Y-M7wN.js.map → ListToolbar-FpcvqNkN.js.map} +1 -1
- package/dashboard/dist/assets/{McpOverview-mfJpETsW.js → McpOverview-DcuRiAff.js} +2 -2
- package/dashboard/dist/assets/{McpOverview-mfJpETsW.js.map → McpOverview-DcuRiAff.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryDetailPage-Cb99vI7v.js → McpQueryDetailPage-BcYl67KP.js} +2 -2
- package/dashboard/dist/assets/{McpQueryDetailPage-Cb99vI7v.js.map → McpQueryDetailPage-BcYl67KP.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryPage-CKKOxks0.js → McpQueryPage-C3GDzqZM.js} +2 -2
- package/dashboard/dist/assets/{McpQueryPage-CKKOxks0.js.map → McpQueryPage-C3GDzqZM.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunDetailPage-CyTbHs0J.js → McpRunDetailPage-SzOyhDBW.js} +2 -2
- package/dashboard/dist/assets/{McpRunDetailPage-CyTbHs0J.js.map → McpRunDetailPage-SzOyhDBW.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunsPage-MIwmK-Ky.js → McpRunsPage-BwgB6mRV.js} +2 -2
- package/dashboard/dist/assets/{McpRunsPage-MIwmK-Ky.js.map → McpRunsPage-BwgB6mRV.js.map} +1 -1
- package/dashboard/dist/assets/{OperationsPage-DPesph0U.js → OperationsPage-BCr21p8I.js} +2 -2
- package/dashboard/dist/assets/{OperationsPage-DPesph0U.js.map → OperationsPage-BCr21p8I.js.map} +1 -1
- package/dashboard/dist/assets/{OperatorDashboard-K1gzULr7.js → OperatorDashboard-DSXh-yYw.js} +2 -2
- package/dashboard/dist/assets/{OperatorDashboard-K1gzULr7.js.map → OperatorDashboard-DSXh-yYw.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessDetailPage-DBIrY6Vd.js → ProcessDetailPage-iIB1rwEt.js} +2 -2
- package/dashboard/dist/assets/{ProcessDetailPage-DBIrY6Vd.js.map → ProcessDetailPage-iIB1rwEt.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessesListPage-CrLGDCAD.js → ProcessesListPage-BrqWR2zr.js} +2 -2
- package/dashboard/dist/assets/{ProcessesListPage-CrLGDCAD.js.map → ProcessesListPage-BrqWR2zr.js.map} +1 -1
- package/dashboard/dist/assets/RoleDetailPage-DS37tJhq.js +11 -0
- package/dashboard/dist/assets/RoleDetailPage-DS37tJhq.js.map +1 -0
- package/dashboard/dist/assets/RolesPage-Bzp9FhAl.js +2 -0
- package/dashboard/dist/assets/{RolesPage-B0ZgjB2V.js.map → RolesPage-Bzp9FhAl.js.map} +1 -1
- package/dashboard/dist/assets/{RunAsSelector-DA0h41ml.js → RunAsSelector-DXbHRxQs.js} +2 -2
- package/dashboard/dist/assets/{RunAsSelector-DA0h41ml.js.map → RunAsSelector-DXbHRxQs.js.map} +1 -1
- package/dashboard/dist/assets/{StickyPagination-t5B71hwd.js → StickyPagination-D8XuMSWD.js} +2 -2
- package/dashboard/dist/assets/{StickyPagination-t5B71hwd.js.map → StickyPagination-D8XuMSWD.js.map} +1 -1
- package/dashboard/dist/assets/{StreamMessageDetail-CYFnZsYA.js → StreamMessageDetail-D5v95pmz.js} +2 -2
- package/dashboard/dist/assets/{StreamMessageDetail-CYFnZsYA.js.map → StreamMessageDetail-D5v95pmz.js.map} +1 -1
- package/dashboard/dist/assets/{SwimlaneTimeline-CY18gBek.js → SwimlaneTimeline-CUEf2R5R.js} +2 -2
- package/dashboard/dist/assets/{SwimlaneTimeline-CY18gBek.js.map → SwimlaneTimeline-CUEf2R5R.js.map} +1 -1
- package/dashboard/dist/assets/{TaskDetailPage-B9owzuhV.js → TaskDetailPage-BJvKNwEe.js} +2 -2
- package/dashboard/dist/assets/{TaskDetailPage-B9owzuhV.js.map → TaskDetailPage-BJvKNwEe.js.map} +1 -1
- package/dashboard/dist/assets/{TasksListPage-Dlsu7cWG.js → TasksListPage-CM7BWh_h.js} +2 -2
- package/dashboard/dist/assets/{TasksListPage-Dlsu7cWG.js.map → TasksListPage-CM7BWh_h.js.map} +1 -1
- package/dashboard/dist/assets/{TimeAgo-CSzifQXB.js → TimeAgo-D1K7xKq5.js} +2 -2
- package/dashboard/dist/assets/{TimeAgo-CSzifQXB.js.map → TimeAgo-D1K7xKq5.js.map} +1 -1
- package/dashboard/dist/assets/{TimestampCell-CIxgN57O.js → TimestampCell-7G0echgP.js} +2 -2
- package/dashboard/dist/assets/{TimestampCell-CIxgN57O.js.map → TimestampCell-7G0echgP.js.map} +1 -1
- package/dashboard/dist/assets/{ToolTestPanel-Bw844EW3.js → ToolTestPanel-LxuJvURK.js} +2 -2
- package/dashboard/dist/assets/{ToolTestPanel-Bw844EW3.js.map → ToolTestPanel-LxuJvURK.js.map} +1 -1
- package/dashboard/dist/assets/{TopicDetailPage-HuDx2oAW.js → TopicDetailPage-JvAX6rrR.js} +2 -2
- package/dashboard/dist/assets/{TopicDetailPage-HuDx2oAW.js.map → TopicDetailPage-JvAX6rrR.js.map} +1 -1
- package/dashboard/dist/assets/{TopicsPage-CAG0RhAK.js → TopicsPage-tFT2AcTz.js} +2 -2
- package/dashboard/dist/assets/{TopicsPage-CAG0RhAK.js.map → TopicsPage-tFT2AcTz.js.map} +1 -1
- package/dashboard/dist/assets/{UserName-CoGYeig8.js → UserName-Djz0nmaZ.js} +2 -2
- package/dashboard/dist/assets/{UserName-CoGYeig8.js.map → UserName-Djz0nmaZ.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowExecutionPage-Dhb9EWgI.js → WorkflowExecutionPage-f53hilbI.js} +2 -2
- package/dashboard/dist/assets/{WorkflowExecutionPage-Dhb9EWgI.js.map → WorkflowExecutionPage-f53hilbI.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsDashboard-bJ6Zebfv.js → WorkflowsDashboard-DM9Xe665.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsDashboard-bJ6Zebfv.js.map → WorkflowsDashboard-DM9Xe665.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsOverview-B8262fVx.js → WorkflowsOverview-CUGSrx9N.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsOverview-B8262fVx.js.map → WorkflowsOverview-CUGSrx9N.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-DhW3q2cO.js → YamlWorkflowDetailPage-B1_yqxAw.js} +2 -2
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-DhW3q2cO.js.map → YamlWorkflowDetailPage-B1_yqxAw.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowsPage-C8hBjSn_.js → YamlWorkflowsPage-NtGvqiu7.js} +2 -2
- package/dashboard/dist/assets/{YamlWorkflowsPage-C8hBjSn_.js.map → YamlWorkflowsPage-NtGvqiu7.js.map} +1 -1
- package/dashboard/dist/assets/{agents-j2YErVp4.js → agents-tML6AjDj.js} +2 -2
- package/dashboard/dist/assets/{agents-j2YErVp4.js.map → agents-tML6AjDj.js.map} +1 -1
- package/dashboard/dist/assets/{bots-CD8Bl5pL.js → bots-Cb0WTwhY.js} +2 -2
- package/dashboard/dist/assets/{bots-CD8Bl5pL.js.map → bots-Cb0WTwhY.js.map} +1 -1
- package/dashboard/dist/assets/{capabilities-Dz190EAa.js → capabilities-BGZogsi_.js} +2 -2
- package/dashboard/dist/assets/{capabilities-Dz190EAa.js.map → capabilities-BGZogsi_.js.map} +1 -1
- package/dashboard/dist/assets/{controlplane-CkUHGPA3.js → controlplane-B7VJTlZD.js} +2 -2
- package/dashboard/dist/assets/{controlplane-CkUHGPA3.js.map → controlplane-B7VJTlZD.js.map} +1 -1
- package/dashboard/dist/assets/{escalation-BXTwi4J1.js → escalation-Bl-SQV_u.js} +2 -2
- package/dashboard/dist/assets/{escalation-BXTwi4J1.js.map → escalation-Bl-SQV_u.js.map} +1 -1
- package/dashboard/dist/assets/{escalation-columns-GxxwSbDk.js → escalation-columns-BlJOswRx.js} +2 -2
- package/dashboard/dist/assets/{escalation-columns-GxxwSbDk.js.map → escalation-columns-BlJOswRx.js.map} +1 -1
- package/dashboard/dist/assets/{index-NfVWOFbF.js → index--WeZDfeN.js} +2 -2
- package/dashboard/dist/assets/{index-NfVWOFbF.js.map → index--WeZDfeN.js.map} +1 -1
- package/dashboard/dist/assets/{index-BK3PVYcd.js → index-0o71lRuY.js} +2 -2
- package/dashboard/dist/assets/{index-BK3PVYcd.js.map → index-0o71lRuY.js.map} +1 -1
- package/dashboard/dist/assets/{index-DGKgXObc.js → index-3A_5CL81.js} +2 -2
- package/dashboard/dist/assets/{index-DGKgXObc.js.map → index-3A_5CL81.js.map} +1 -1
- package/dashboard/dist/assets/{index-DTrcYOM2.js → index-BorpZbZA.js} +2 -2
- package/dashboard/dist/assets/{index-DTrcYOM2.js.map → index-BorpZbZA.js.map} +1 -1
- package/dashboard/dist/assets/{index-BkwsJ-0v.js → index-CBv3UxF2.js} +2 -2
- package/dashboard/dist/assets/{index-BkwsJ-0v.js.map → index-CBv3UxF2.js.map} +1 -1
- package/dashboard/dist/assets/{index-CkL8bpdH.js → index-D0-8byNu.js} +2 -2
- package/dashboard/dist/assets/{index-CkL8bpdH.js.map → index-D0-8byNu.js.map} +1 -1
- package/dashboard/dist/assets/{index-qT7eB_Hk.js → index-DcbEIXit.js} +2 -2
- package/dashboard/dist/assets/{index-qT7eB_Hk.js.map → index-DcbEIXit.js.map} +1 -1
- package/dashboard/dist/assets/{index-YliQ4kW_.js → index-DfDfJivY.js} +2 -2
- package/dashboard/dist/assets/{index-YliQ4kW_.js.map → index-DfDfJivY.js.map} +1 -1
- package/dashboard/dist/assets/{index-D-7W2AHB.js → index-Dgw1KKpq.js} +3 -3
- package/dashboard/dist/assets/{index-D-7W2AHB.js.map → index-Dgw1KKpq.js.map} +1 -1
- package/dashboard/dist/assets/{index-CoGkgm9-.js → index-Il_g7kw5.js} +2 -2
- package/dashboard/dist/assets/{index-CoGkgm9-.js.map → index-Il_g7kw5.js.map} +1 -1
- package/dashboard/dist/assets/{index-CaMVn0kW.js → index-SCrD3l-K.js} +2 -2
- package/dashboard/dist/assets/{index-CaMVn0kW.js.map → index-SCrD3l-K.js.map} +1 -1
- package/dashboard/dist/assets/{index-n-lZY5S6.js → index-TiKh2Ctj.js} +2 -2
- package/dashboard/dist/assets/{index-n-lZY5S6.js.map → index-TiKh2Ctj.js.map} +1 -1
- package/dashboard/dist/assets/{index-eLRh-2NW.js → index-e97M6GoI.js} +2 -2
- package/dashboard/dist/assets/{index-eLRh-2NW.js.map → index-e97M6GoI.js.map} +1 -1
- package/dashboard/dist/assets/{knowledge-CSAbLtk7.js → knowledge-CDzw4E6q.js} +2 -2
- package/dashboard/dist/assets/{knowledge-CSAbLtk7.js.map → knowledge-CDzw4E6q.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-D0Ha3aEo.js → mcp-D_-NQtnG.js} +2 -2
- package/dashboard/dist/assets/{mcp-D0Ha3aEo.js.map → mcp-D_-NQtnG.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-query-BySmvmuS.js → mcp-query-BqZXdf9A.js} +2 -2
- package/dashboard/dist/assets/{mcp-query-BySmvmuS.js.map → mcp-query-BqZXdf9A.js.map} +1 -1
- package/dashboard/dist/assets/{pipelines-DiqWgxJd.js → pipelines-CNLhgj8b.js} +2 -2
- package/dashboard/dist/assets/{pipelines-DiqWgxJd.js.map → pipelines-CNLhgj8b.js.map} +1 -1
- package/dashboard/dist/assets/{roles-BdtnzLsL.js → roles-CFD2eYap.js} +2 -2
- package/dashboard/dist/assets/{roles-BdtnzLsL.js.map → roles-CFD2eYap.js.map} +1 -1
- package/dashboard/dist/assets/{tasks-DYCUi5nZ.js → tasks-DcSvF636.js} +2 -2
- package/dashboard/dist/assets/{tasks-DYCUi5nZ.js.map → tasks-DcSvF636.js.map} +1 -1
- package/dashboard/dist/assets/{topics-CA7i8ymr.js → topics-DI8TFSZv.js} +2 -2
- package/dashboard/dist/assets/{topics-CA7i8ymr.js.map → topics-DI8TFSZv.js.map} +1 -1
- package/dashboard/dist/assets/{useEventHooks-SfWdyc5L.js → useEventHooks-DcIgMDh3.js} +2 -2
- package/dashboard/dist/assets/{useEventHooks-SfWdyc5L.js.map → useEventHooks-DcIgMDh3.js.map} +1 -1
- package/dashboard/dist/assets/{useNamespace-CZUsk5Vv.js → useNamespace-C88ZxGoX.js} +2 -2
- package/dashboard/dist/assets/{useNamespace-CZUsk5Vv.js.map → useNamespace-C88ZxGoX.js.map} +1 -1
- package/dashboard/dist/assets/{useYamlActivityEvents-DKQ5dREx.js → useYamlActivityEvents-D2-yVjJ7.js} +2 -2
- package/dashboard/dist/assets/{useYamlActivityEvents-DKQ5dREx.js.map → useYamlActivityEvents-D2-yVjJ7.js.map} +1 -1
- package/dashboard/dist/assets/{users-BxKf5dAX.js → users-C0WV36X8.js} +2 -2
- package/dashboard/dist/assets/{users-BxKf5dAX.js.map → users-C0WV36X8.js.map} +1 -1
- package/dashboard/dist/assets/{workflows-DNPQ-j-7.js → workflows-CkPv7xk-.js} +2 -2
- package/dashboard/dist/assets/{workflows-DNPQ-j-7.js.map → workflows-CkPv7xk-.js.map} +1 -1
- package/dashboard/dist/assets/{yaml-workflows-CA8BrFxc.js → yaml-workflows-BjrMQLTK.js} +2 -2
- package/dashboard/dist/assets/{yaml-workflows-CA8BrFxc.js.map → yaml-workflows-BjrMQLTK.js.map} +1 -1
- package/dashboard/dist/index.html +1 -1
- package/docs/dashboard.md +65 -23
- package/package.json +2 -2
- package/dashboard/dist/assets/EscalationSchemaPage-Do2iPKUl.js +0 -9
- package/dashboard/dist/assets/EscalationSchemaPage-Do2iPKUl.js.map +0 -1
- package/dashboard/dist/assets/RoleDetailPage-7j6Mk780.js +0 -11
- package/dashboard/dist/assets/RoleDetailPage-7j6Mk780.js.map +0 -1
- package/dashboard/dist/assets/RolesPage-B0ZgjB2V.js +0 -2
package/dashboard/dist/assets/{ProcessDetailPage-DBIrY6Vd.js → ProcessDetailPage-iIB1rwEt.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as b,j as e}from"./vendor-query-B2UbickB.js";import{a as z}from"./tasks-DYCUi5nZ.js";import{a as V}from"./useEventHooks-SfWdyc5L.js";import{D as S,f as L,C as J,u as q,a as G,J as P,S as T}from"./index-D-7W2AHB.js";import{P as K}from"./PageHeaderWithStats-yex5WmHB.js";import{S as W}from"./StatusBadge-D9MeQHrh.js";import{W as Q}from"./WorkflowPill-IDjTRfQ8.js";import{T as y}from"./TimestampCell-CIxgN57O.js";import{L as D,e as X}from"./vendor-react-CXumBFUA.js";import{R as Y}from"./RolePill-Cl71eDUA.js";import{U as Z}from"./UserName-CoGYeig8.js";import"./vendor-icons-CEWCGPeJ.js";import"./users-BxKf5dAX.js";const ee="bg-stripes animate-pulse opacity-70";function $(t){switch(t){case"completed":return"text-status-success";case"in_progress":case"pending":return"text-status-warning";case"needs_intervention":return"text-status-error";case"cancelled":return"text-text-tertiary";default:return"text-text-tertiary"}}function I(t){switch(t){case"resolved":return"text-status-success";case"pending":return"text-status-warning";case"cancelled":return"text-text-tertiary";default:return"text-text-tertiary"}}function te(t,a,l){return`${t==="task"?"Task":l?"Notification":"Escalation"} is ${a.replace(/_/g," ")}`}function se(t,a){if(a)return ee;switch(t){case"completed":case"resolved":return"bg-status-success";case"pending":case"in_progress":case"needs_intervention":return"bg-status-warning";case"cancelled":return"bg-status-error";default:return"bg-text-tertiary"}}function ae(t){return t.startsWith("mcp")||t.startsWith("Mcp")}function E(t){return!t.workflow_type}function A(t,a){if(t.length<=a)return t;const l=Math.floor((a-1)/2);return`${t.slice(0,l)}…${t.slice(t.length-l)}`}function ne(t,a){const l=Date.now(),c=new Map,x=[];for(const s of a)s.task_id?(c.has(s.task_id)||c.set(s.task_id,[]),c.get(s.task_id).push(s)):x.push(s);const r=[...t].sort((s,d)=>new Date(s.created_at).getTime()-new Date(d.created_at).getTime()),i=[];for(const s of t)i.push(new Date(s.created_at).getTime()),s.completed_at&&i.push(new Date(s.completed_at).getTime());for(const s of a)i.push(new Date(s.created_at).getTime()),s.resolved_at&&i.push(new Date(s.resolved_at).getTime()),s.claimed_at&&i.push(new Date(s.claimed_at).getTime());if(i.length===0)return{lanes:[],timeMin:0,timeMax:1};const o=Math.min(...i),f=t.some(s=>!s.completed_at)||a.some(s=>!s.resolved_at)?Math.max(l,Math.max(...i)):Math.max(...i),p=f-o||1,m=s=>(s-o)/p*100,h=[];for(const s of r){const d=new Date(s.created_at).getTime(),j=s.completed_at?new Date(s.completed_at).getTime():l,g=!s.completed_at;h.push({kind:"task",id:s.id,label:s.workflow_type,taskId:s.id,startMs:d,endMs:j,startPct:m(d),widthPct:Math.max((j-d)/p*100,.5),durationMs:j-d,isOpen:g,task:s});const v=(c.get(s.id)||[]).sort((n,u)=>new Date(n.created_at).getTime()-new Date(u.created_at).getTime());for(const n of v){const u=new Date(n.created_at).getTime(),N=n.resolved_at?new Date(n.resolved_at).getTime():l,M=!n.resolved_at;let w=null;if(n.claimed_at){const U=new Date(n.claimed_at).getTime(),H=N-u||1;w=(U-u)/H*100}h.push({kind:"escalation",id:n.id,label:n.role,taskId:s.id,startMs:u,endMs:N,startPct:m(u),widthPct:Math.max((N-u)/p*100,.5),durationMs:N-u,isOpen:M,escalation:n,claimPct:w})}}for(const s of x){const d=new Date(s.created_at).getTime(),j=s.resolved_at?new Date(s.resolved_at).getTime():l;let g=null;if(s.claimed_at){const v=new Date(s.claimed_at).getTime(),n=j-d||1;g=(v-d)/n*100}h.push({kind:"escalation",id:s.id,label:s.role,taskId:"",startMs:d,endMs:j,startPct:m(d),widthPct:Math.max((j-d)/p*100,.5),durationMs:j-d,isOpen:!s.resolved_at,escalation:s,claimPct:g})}return{lanes:h,timeMin:o,timeMax:f}}function re(t,a,l,c=500){const[x,r]=b.useState(0),i=b.useRef(null),o=l-a||1;b.useEffect(()=>{if(t===0)return;i.current=null,r(0);let f;const p=m=>{i.current===null&&(i.current=m);const h=m-i.current,s=Math.min(h/c,1),d=1-Math.pow(1-s,3);r(d),s<1&&(f=requestAnimationFrame(p))};return f=requestAnimationFrame(p),()=>cancelAnimationFrame(f)},[t,c]);const k=b.useCallback(f=>{const p=(f.startMs-a)/o,m=(f.endMs-a)/o;if(x<p)return{width:0,opacity:0};const h=m-p||.001,s=Math.min((x-p)/h,1),d=f.widthPct*s,j=Math.min(s/.1,1);return{width:d,opacity:j}},[x,a,o]);return{progress:x,animatedBar:k}}function R({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"})})}function B({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09zM18.259 8.715L18 9.75l-.259-1.035a3.375 3.375 0 00-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 002.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 002.455 2.456L21.75 6l-1.036.259a3.375 3.375 0 00-2.455 2.456zM16.894 20.567L16.5 21.75l-.394-1.183a2.25 2.25 0 00-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 001.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 001.423 1.423l1.183.394-1.183.394a2.25 2.25 0 00-1.423 1.423z"})})}function O({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0"})})}function F({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})})}function ie({allExpanded:t,onToggleAll:a}){return e.jsxs("div",{className:"flex items-center gap-4 mb-4 flex-wrap",children:[e.jsx("button",{onClick:a,className:"text-[10px] text-accent hover:underline",children:t?"Collapse all":"Expand all"}),e.jsxs("div",{className:"flex items-center gap-4 ml-auto",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(R,{className:"w-3.5 h-3.5 text-text-tertiary"}),e.jsx("span",{className:"text-[9px] text-text-tertiary",children:"Task"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(B,{className:"w-3.5 h-3.5 text-text-tertiary"}),e.jsx("span",{className:"text-[9px] text-text-tertiary",children:"AI Task"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(F,{className:"w-3.5 h-3.5 text-text-tertiary"}),e.jsx("span",{className:"text-[9px] text-text-tertiary",children:"Escalation"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(O,{className:"w-3.5 h-3.5 text-text-tertiary"}),e.jsx("span",{className:"text-[9px] text-text-tertiary",children:"Notification"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-status-success"}),e.jsx("span",{className:"text-[9px] text-text-tertiary",children:"Done"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-status-warning"}),e.jsx("span",{className:"text-[9px] text-text-tertiary",children:"Active"})]})]})]})}function oe({ticks:t}){return e.jsxs("div",{className:"flex",children:[e.jsx("div",{className:"w-52 shrink-0"}),e.jsx("div",{className:"flex-1 relative h-6 border-b border-surface-border",children:t.map(a=>e.jsx("span",{className:"absolute text-[9px] font-mono text-text-tertiary -translate-x-1/2 bottom-1 whitespace-nowrap",style:{left:`${a.pct}%`},children:a.label},a.pct))})]})}function _({label:t,children:a}){return e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-0.5",children:t}),e.jsx("div",{className:"text-xs text-text-primary",children:a})]})}function le({traceId:t,href:a}){const[l,c]=b.useState(!1),x=i=>{i.stopPropagation(),navigator.clipboard.writeText(t),c(!0),setTimeout(()=>c(!1),1500)},r=i=>{i.stopPropagation(),a&&window.open(a,"_blank","noopener,noreferrer")};return e.jsxs("span",{className:"group/trace inline-flex items-center gap-1.5",children:[a&&e.jsx("button",{onClick:r,title:"Open trace",className:"opacity-0 group-hover/trace:opacity-100 transition-opacity p-0.5",children:e.jsx("svg",{className:"w-3 h-3 text-text-tertiary hover:text-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-4.5-4.5h6m0 0v6m0-6L10.5 15"})})}),e.jsx("button",{onClick:x,title:"Copy trace ID",className:"opacity-0 group-hover/trace:opacity-100 transition-opacity p-0.5",children:e.jsx("svg",{className:`w-3 h-3 transition-colors ${l?"text-status-success":"text-text-tertiary hover:text-accent"}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:l?e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"}):e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3"})})}),e.jsx("span",{className:"text-[11px] text-accent",children:"Trace Details"})]})}function ce({task:t,traceUrl:a}){const l=t.completed_at?new Date(t.completed_at).getTime()-new Date(t.created_at).getTime():Date.now()-new Date(t.created_at).getTime();return e.jsxs("div",{className:"grid grid-cols-[3fr_1fr] gap-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(W,{status:t.status}),e.jsx(Q,{type:t.workflow_type})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsx(_,{label:"Started",children:e.jsx(y,{date:t.created_at})}),e.jsx(_,{label:"Completed",children:t.completed_at?e.jsx(y,{date:t.completed_at}):e.jsx("span",{className:"text-text-tertiary italic text-xs",children:"In progress"})}),e.jsx(_,{label:"Duration",children:e.jsx(S,{ms:l,className:"font-mono text-sm"})})]}),t.milestones.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:"Milestones"}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.milestones.map((c,x)=>e.jsxs("span",{className:"px-2 py-0.5 text-[10px] font-mono bg-accent-faint/50 rounded text-text-secondary",children:[c.name,": ",String(c.value)]},x))})]})]}),e.jsxs("div",{className:"flex flex-col items-end gap-2",children:[e.jsx(D,{to:`/workflows/executions/${encodeURIComponent(t.workflow_id)}`,className:"block text-[11px] text-accent hover:underline",children:"Execution Details"}),e.jsx(D,{to:`/workflows/tasks/detail/${t.id}`,className:"block text-[11px] text-accent hover:underline",children:"Task Details"}),t.trace_id&&e.jsx(le,{traceId:t.trace_id,href:a?a.replace("{traceId}",t.trace_id):void 0})]})]})}function de({escalation:t}){const a=new Date(t.created_at).getTime(),l=t.claimed_at?new Date(t.claimed_at).getTime()-a:null,c=t.resolved_at?new Date(t.resolved_at).getTime()-a:null;return e.jsxs("div",{className:"grid grid-cols-[3fr_1fr] gap-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(W,{status:t.status}),e.jsx(Y,{role:t.role}),t.type&&e.jsxs("span",{className:"text-[10px] text-text-tertiary",children:[t.type,t.subtype?` / ${t.subtype}`:""]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsx(_,{label:"Created",children:e.jsx(y,{date:t.created_at})}),e.jsx(_,{label:"Claimed",children:t.claimed_at?e.jsxs(e.Fragment,{children:[e.jsx(y,{date:t.claimed_at}),e.jsxs("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:["after ",e.jsx(S,{ms:l}),t.assigned_to&&e.jsxs(e.Fragment,{children:[" ","by"," ",e.jsx("span",{className:"text-text-secondary font-medium",children:e.jsx(Z,{userId:t.assigned_to})})]})]})]}):e.jsx("span",{className:"text-text-tertiary italic text-xs",children:"Unclaimed"})}),e.jsx(_,{label:"Resolved",children:t.resolved_at?e.jsxs(e.Fragment,{children:[e.jsx(y,{date:t.resolved_at}),e.jsxs("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:[e.jsx(S,{ms:c})," total"]})]}):e.jsx("span",{className:"text-text-tertiary italic text-xs",children:"Pending"})})]}),t.description&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Description"}),e.jsx("p",{className:"text-[11px] text-text-secondary leading-relaxed",children:t.description})]})]}),e.jsxs("div",{className:"flex flex-col items-end gap-2",children:[t.workflow_id&&e.jsx(D,{to:`/workflows/executions/${encodeURIComponent(t.workflow_id)}`,className:"block text-[11px] text-accent hover:underline",children:"Execution Details"}),e.jsx(D,{to:`/escalations/detail/${t.id}`,className:"block text-[11px] text-accent hover:underline",children:"Escalation Details"})]})]})}function xe({lane:t,ticks:a,isExpanded:l,onToggle:c,anim:x,animDone:r,traceUrl:i}){var m,h;const o=t.kind==="task",k=o?t.task.status:t.escalation.status,f=se(k,t.isOpen),p=x.opacity>0;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center border-b border-surface-border cursor-pointer hover:bg-surface-sunken/40 transition-colors",onClick:c,children:[e.jsxs("div",{className:`w-52 shrink-0 py-3 pr-4 flex items-center gap-2 ${o?"":"pl-6"}`,style:{opacity:p?1:0,transition:"opacity 0.15s ease-out"},children:[o?ae(t.task.workflow_type)?e.jsx(B,{className:`w-4 h-4 shrink-0 ${$(t.task.status)}`}):e.jsx(R,{className:`w-4 h-4 shrink-0 ${$(t.task.status)}`}):E(t.escalation)?e.jsx(O,{className:`w-4 h-4 shrink-0 ${I(t.escalation.status)}`}):e.jsx(F,{className:`w-4 h-4 shrink-0 ${I(t.escalation.status)}`}),e.jsx("p",{className:"text-xs font-mono text-text-secondary whitespace-nowrap overflow-hidden",title:te(t.kind,o?t.task.status:t.escalation.status,!o&&E(t.escalation)),children:o?A(t.label,24):A(((m=t.escalation)==null?void 0:m.role)??t.label,20)})]}),e.jsxs("div",{className:"flex-1 relative h-10",children:[a.map(s=>e.jsx("div",{className:"absolute top-0 bottom-0 w-px bg-surface-border opacity-30",style:{left:`${s.pct}%`}},s.pct)),e.jsxs("div",{className:`absolute top-2 h-6 rounded-sm ${l?`${f} ring-2 ring-accent ring-offset-1`:`${f} hover:opacity-80`}`,style:{left:`${t.startPct}%`,width:p?`${Math.max(x.width,.3)}%`:"0%",minWidth:p?"4px":"0px",opacity:x.opacity},title:`${t.label} — ${L(t.durationMs)} — ${new Date(t.startMs).toLocaleTimeString()}`,children:[x.width>8&&r&&e.jsx("span",{className:"absolute inset-0 flex items-center px-1.5 text-[9px] font-mono text-white truncate",children:L(t.durationMs)}),t.claimPct!=null&&r&&e.jsx("div",{className:"absolute top-0 bottom-0 w-px border-l border-dashed border-white/70",style:{left:`${t.claimPct}%`},title:(h=t.escalation)!=null&&h.assigned_to?`Claimed by ${t.escalation.assigned_to}`:"Claimed",children:e.jsx("div",{className:"absolute -top-1 -left-[3px] w-[7px] h-[7px] rounded-full bg-white border border-amber-600"})})]})]})]}),e.jsx(J,{open:l,children:e.jsx("div",{className:"py-4 px-6 pl-52 border-b border-surface-border bg-surface-sunken/20",children:o&&t.task?e.jsx(ce,{task:t.task,traceUrl:i}):t.escalation?e.jsx(de,{escalation:t.escalation}):null})})]})}function me({tasks:t,escalations:a,traceUrl:l}){const[c,x]=b.useState(new Set),{lanes:r,timeMin:i,timeMax:o}=b.useMemo(()=>ne(t,a),[t,a]),k=o-i||1,{progress:f,animatedBar:p}=re(r.length,i,o);if(r.length===0)return e.jsx("p",{className:"text-sm text-text-tertiary py-8 text-center",children:"No events in this process."});const m=5,h=Array.from({length:m+1},(n,u)=>({pct:u/m*100,label:L(Math.round(u/m*k))})),s=n=>{x(u=>{const N=new Set(u);return N.has(n)?N.delete(n):N.add(n),N})},d=r.map(n=>n.id),j=d.length>0&&d.every(n=>c.has(n)),g=()=>{x(j?new Set:new Set(d))},v=f>=1;return e.jsxs("div",{className:"py-2",children:[e.jsx(ie,{allExpanded:j,onToggleAll:g}),e.jsx(oe,{ticks:h}),r.map(n=>e.jsx(xe,{lane:n,ticks:h,isExpanded:c.has(n.id),onToggle:()=>s(n.id),anim:p(n),animDone:v,traceUrl:l},`${n.kind}-${n.id}`))]})}function C(t){if(!t)return null;try{return JSON.parse(t)}catch{return null}}function ue(t){return t.length===0?null:[...t].sort((a,l)=>new Date(a.created_at).getTime()-new Date(l.created_at).getTime())[0]}function De(){var j;const{originId:t}=X();V(t);const{data:a,isLoading:l}=z(t??""),{data:c}=q(),x=((j=c==null?void 0:c.telemetry)==null?void 0:j.traceUrl)??null,r=(a==null?void 0:a.tasks)??[],i=(a==null?void 0:a.escalations)??[],o=b.useMemo(()=>ue(r),[r]),k=b.useMemo(()=>C(o==null?void 0:o.envelope),[o]),f=b.useMemo(()=>{if(o!=null&&o.data)return C(o.data);const g=r.filter(v=>v.status==="completed"&&v.data).sort((v,n)=>new Date(n.completed_at).getTime()-new Date(v.completed_at).getTime());return g.length>0?C(g[0].data):null},[o,r]),p=b.useMemo(()=>r.length>0&&r.some(g=>g.status!=="completed"&&g.status!=="cancelled"),[r]),m=b.useMemo(()=>{const g=r.filter(u=>u.status==="completed").length,v=r.filter(u=>u.status==="needs_intervention").length,n=i.filter(u=>u.status==="resolved").length;return{tasks:r.length,completed:g,escalated:v,escalations:i.length,resolved:n}},[r,i]),h=b.useMemo(()=>{if(r.length===0&&i.length===0)return null;const v=[...r.map(w=>w.created_at),...i.map(w=>w.created_at)].sort()[0],n=r.every(w=>w.status==="completed"||w.status==="cancelled"),u=i.every(w=>w.status==="resolved"),N=r.length>0&&n&&u,M=N?[...r.map(w=>w.completed_at),...i.map(w=>w.resolved_at)].filter(Boolean).sort().pop()??null:null;return{startIso:v,endIso:M,isFinished:N,elapsed:G(v,M)}},[r,i]),s=b.useMemo(()=>{const g=[];return h&&g.push({label:h.isFinished?"Completed":"Running",value:h.elapsed,dotClass:h.isFinished?"bg-status-success":"bg-status-pending animate-pulse"}),g.push({label:"Tasks",value:`${m.completed}/${m.tasks}`},{label:"Escalations",value:`${m.resolved}/${m.escalations}`}),g},[h,m]);if(l&&r.length===0)return e.jsxs("div",{className:"animate-pulse space-y-4",children:[e.jsx("div",{className:"h-8 bg-surface-sunken rounded w-48"}),e.jsx("div",{className:"h-40 bg-surface-sunken rounded"})]});const d=k||f||p;return e.jsxs("div",{children:[e.jsx(K,{title:"Process Detail",docsHash:"#docs:dashboard.md:process-detail",subtitle:t,stats:s}),d&&e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8 mb-10",children:[e.jsx("div",{children:k?e.jsx(P,{data:k,label:"Input",defaultMode:"json",defaultCollapsed:!0}):e.jsxs("div",{children:[e.jsx(T,{children:"Input"}),e.jsx("div",{className:"font-mono text-xs bg-surface-sunken rounded-md p-4 text-text-tertiary italic mt-2",children:"Waiting for task..."})]})}),e.jsx("div",{children:f?e.jsx(P,{data:f,label:"Output",defaultMode:"json",defaultCollapsed:!0}):p?e.jsxs("div",{children:[e.jsx(T,{children:"Output"}),e.jsxs("div",{className:"flex items-center gap-2 font-mono text-xs bg-surface-sunken rounded-md p-4 text-text-secondary mt-2",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-status-pending animate-pulse"}),"Processing..."]})]}):null})]}),e.jsx(T,{className:"mb-6",children:"Timeline"}),e.jsx(me,{tasks:r,escalations:i,traceUrl:x})]})}export{De as ProcessDetailPage};
|
|
2
|
-
//# sourceMappingURL=ProcessDetailPage-
|
|
1
|
+
import{a as b,j as e}from"./vendor-query-B2UbickB.js";import{a as z}from"./tasks-DcSvF636.js";import{a as V}from"./useEventHooks-DcIgMDh3.js";import{D as S,f as L,C as J,u as q,a as G,J as P,S as T}from"./index-Dgw1KKpq.js";import{P as K}from"./PageHeaderWithStats-yex5WmHB.js";import{S as W}from"./StatusBadge-D9MeQHrh.js";import{W as Q}from"./WorkflowPill-IDjTRfQ8.js";import{T as y}from"./TimestampCell-7G0echgP.js";import{L as D,e as X}from"./vendor-react-CXumBFUA.js";import{R as Y}from"./RolePill-Cl71eDUA.js";import{U as Z}from"./UserName-Djz0nmaZ.js";import"./vendor-icons-CEWCGPeJ.js";import"./users-C0WV36X8.js";const ee="bg-stripes animate-pulse opacity-70";function $(t){switch(t){case"completed":return"text-status-success";case"in_progress":case"pending":return"text-status-warning";case"needs_intervention":return"text-status-error";case"cancelled":return"text-text-tertiary";default:return"text-text-tertiary"}}function I(t){switch(t){case"resolved":return"text-status-success";case"pending":return"text-status-warning";case"cancelled":return"text-text-tertiary";default:return"text-text-tertiary"}}function te(t,a,l){return`${t==="task"?"Task":l?"Notification":"Escalation"} is ${a.replace(/_/g," ")}`}function se(t,a){if(a)return ee;switch(t){case"completed":case"resolved":return"bg-status-success";case"pending":case"in_progress":case"needs_intervention":return"bg-status-warning";case"cancelled":return"bg-status-error";default:return"bg-text-tertiary"}}function ae(t){return t.startsWith("mcp")||t.startsWith("Mcp")}function E(t){return!t.workflow_type}function A(t,a){if(t.length<=a)return t;const l=Math.floor((a-1)/2);return`${t.slice(0,l)}…${t.slice(t.length-l)}`}function ne(t,a){const l=Date.now(),c=new Map,x=[];for(const s of a)s.task_id?(c.has(s.task_id)||c.set(s.task_id,[]),c.get(s.task_id).push(s)):x.push(s);const r=[...t].sort((s,d)=>new Date(s.created_at).getTime()-new Date(d.created_at).getTime()),i=[];for(const s of t)i.push(new Date(s.created_at).getTime()),s.completed_at&&i.push(new Date(s.completed_at).getTime());for(const s of a)i.push(new Date(s.created_at).getTime()),s.resolved_at&&i.push(new Date(s.resolved_at).getTime()),s.claimed_at&&i.push(new Date(s.claimed_at).getTime());if(i.length===0)return{lanes:[],timeMin:0,timeMax:1};const o=Math.min(...i),f=t.some(s=>!s.completed_at)||a.some(s=>!s.resolved_at)?Math.max(l,Math.max(...i)):Math.max(...i),p=f-o||1,m=s=>(s-o)/p*100,h=[];for(const s of r){const d=new Date(s.created_at).getTime(),j=s.completed_at?new Date(s.completed_at).getTime():l,g=!s.completed_at;h.push({kind:"task",id:s.id,label:s.workflow_type,taskId:s.id,startMs:d,endMs:j,startPct:m(d),widthPct:Math.max((j-d)/p*100,.5),durationMs:j-d,isOpen:g,task:s});const v=(c.get(s.id)||[]).sort((n,u)=>new Date(n.created_at).getTime()-new Date(u.created_at).getTime());for(const n of v){const u=new Date(n.created_at).getTime(),N=n.resolved_at?new Date(n.resolved_at).getTime():l,M=!n.resolved_at;let w=null;if(n.claimed_at){const U=new Date(n.claimed_at).getTime(),H=N-u||1;w=(U-u)/H*100}h.push({kind:"escalation",id:n.id,label:n.role,taskId:s.id,startMs:u,endMs:N,startPct:m(u),widthPct:Math.max((N-u)/p*100,.5),durationMs:N-u,isOpen:M,escalation:n,claimPct:w})}}for(const s of x){const d=new Date(s.created_at).getTime(),j=s.resolved_at?new Date(s.resolved_at).getTime():l;let g=null;if(s.claimed_at){const v=new Date(s.claimed_at).getTime(),n=j-d||1;g=(v-d)/n*100}h.push({kind:"escalation",id:s.id,label:s.role,taskId:"",startMs:d,endMs:j,startPct:m(d),widthPct:Math.max((j-d)/p*100,.5),durationMs:j-d,isOpen:!s.resolved_at,escalation:s,claimPct:g})}return{lanes:h,timeMin:o,timeMax:f}}function re(t,a,l,c=500){const[x,r]=b.useState(0),i=b.useRef(null),o=l-a||1;b.useEffect(()=>{if(t===0)return;i.current=null,r(0);let f;const p=m=>{i.current===null&&(i.current=m);const h=m-i.current,s=Math.min(h/c,1),d=1-Math.pow(1-s,3);r(d),s<1&&(f=requestAnimationFrame(p))};return f=requestAnimationFrame(p),()=>cancelAnimationFrame(f)},[t,c]);const k=b.useCallback(f=>{const p=(f.startMs-a)/o,m=(f.endMs-a)/o;if(x<p)return{width:0,opacity:0};const h=m-p||.001,s=Math.min((x-p)/h,1),d=f.widthPct*s,j=Math.min(s/.1,1);return{width:d,opacity:j}},[x,a,o]);return{progress:x,animatedBar:k}}function R({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"})})}function B({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09zM18.259 8.715L18 9.75l-.259-1.035a3.375 3.375 0 00-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 002.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 002.455 2.456L21.75 6l-1.036.259a3.375 3.375 0 00-2.455 2.456zM16.894 20.567L16.5 21.75l-.394-1.183a2.25 2.25 0 00-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 001.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 001.423 1.423l1.183.394-1.183.394a2.25 2.25 0 00-1.423 1.423z"})})}function O({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0"})})}function F({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})})}function ie({allExpanded:t,onToggleAll:a}){return e.jsxs("div",{className:"flex items-center gap-4 mb-4 flex-wrap",children:[e.jsx("button",{onClick:a,className:"text-[10px] text-accent hover:underline",children:t?"Collapse all":"Expand all"}),e.jsxs("div",{className:"flex items-center gap-4 ml-auto",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(R,{className:"w-3.5 h-3.5 text-text-tertiary"}),e.jsx("span",{className:"text-[9px] text-text-tertiary",children:"Task"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(B,{className:"w-3.5 h-3.5 text-text-tertiary"}),e.jsx("span",{className:"text-[9px] text-text-tertiary",children:"AI Task"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(F,{className:"w-3.5 h-3.5 text-text-tertiary"}),e.jsx("span",{className:"text-[9px] text-text-tertiary",children:"Escalation"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(O,{className:"w-3.5 h-3.5 text-text-tertiary"}),e.jsx("span",{className:"text-[9px] text-text-tertiary",children:"Notification"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-status-success"}),e.jsx("span",{className:"text-[9px] text-text-tertiary",children:"Done"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-status-warning"}),e.jsx("span",{className:"text-[9px] text-text-tertiary",children:"Active"})]})]})]})}function oe({ticks:t}){return e.jsxs("div",{className:"flex",children:[e.jsx("div",{className:"w-52 shrink-0"}),e.jsx("div",{className:"flex-1 relative h-6 border-b border-surface-border",children:t.map(a=>e.jsx("span",{className:"absolute text-[9px] font-mono text-text-tertiary -translate-x-1/2 bottom-1 whitespace-nowrap",style:{left:`${a.pct}%`},children:a.label},a.pct))})]})}function _({label:t,children:a}){return e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-0.5",children:t}),e.jsx("div",{className:"text-xs text-text-primary",children:a})]})}function le({traceId:t,href:a}){const[l,c]=b.useState(!1),x=i=>{i.stopPropagation(),navigator.clipboard.writeText(t),c(!0),setTimeout(()=>c(!1),1500)},r=i=>{i.stopPropagation(),a&&window.open(a,"_blank","noopener,noreferrer")};return e.jsxs("span",{className:"group/trace inline-flex items-center gap-1.5",children:[a&&e.jsx("button",{onClick:r,title:"Open trace",className:"opacity-0 group-hover/trace:opacity-100 transition-opacity p-0.5",children:e.jsx("svg",{className:"w-3 h-3 text-text-tertiary hover:text-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-4.5-4.5h6m0 0v6m0-6L10.5 15"})})}),e.jsx("button",{onClick:x,title:"Copy trace ID",className:"opacity-0 group-hover/trace:opacity-100 transition-opacity p-0.5",children:e.jsx("svg",{className:`w-3 h-3 transition-colors ${l?"text-status-success":"text-text-tertiary hover:text-accent"}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:l?e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"}):e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3"})})}),e.jsx("span",{className:"text-[11px] text-accent",children:"Trace Details"})]})}function ce({task:t,traceUrl:a}){const l=t.completed_at?new Date(t.completed_at).getTime()-new Date(t.created_at).getTime():Date.now()-new Date(t.created_at).getTime();return e.jsxs("div",{className:"grid grid-cols-[3fr_1fr] gap-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(W,{status:t.status}),e.jsx(Q,{type:t.workflow_type})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsx(_,{label:"Started",children:e.jsx(y,{date:t.created_at})}),e.jsx(_,{label:"Completed",children:t.completed_at?e.jsx(y,{date:t.completed_at}):e.jsx("span",{className:"text-text-tertiary italic text-xs",children:"In progress"})}),e.jsx(_,{label:"Duration",children:e.jsx(S,{ms:l,className:"font-mono text-sm"})})]}),t.milestones.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:"Milestones"}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.milestones.map((c,x)=>e.jsxs("span",{className:"px-2 py-0.5 text-[10px] font-mono bg-accent-faint/50 rounded text-text-secondary",children:[c.name,": ",String(c.value)]},x))})]})]}),e.jsxs("div",{className:"flex flex-col items-end gap-2",children:[e.jsx(D,{to:`/workflows/executions/${encodeURIComponent(t.workflow_id)}`,className:"block text-[11px] text-accent hover:underline",children:"Execution Details"}),e.jsx(D,{to:`/workflows/tasks/detail/${t.id}`,className:"block text-[11px] text-accent hover:underline",children:"Task Details"}),t.trace_id&&e.jsx(le,{traceId:t.trace_id,href:a?a.replace("{traceId}",t.trace_id):void 0})]})]})}function de({escalation:t}){const a=new Date(t.created_at).getTime(),l=t.claimed_at?new Date(t.claimed_at).getTime()-a:null,c=t.resolved_at?new Date(t.resolved_at).getTime()-a:null;return e.jsxs("div",{className:"grid grid-cols-[3fr_1fr] gap-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(W,{status:t.status}),e.jsx(Y,{role:t.role}),t.type&&e.jsxs("span",{className:"text-[10px] text-text-tertiary",children:[t.type,t.subtype?` / ${t.subtype}`:""]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsx(_,{label:"Created",children:e.jsx(y,{date:t.created_at})}),e.jsx(_,{label:"Claimed",children:t.claimed_at?e.jsxs(e.Fragment,{children:[e.jsx(y,{date:t.claimed_at}),e.jsxs("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:["after ",e.jsx(S,{ms:l}),t.assigned_to&&e.jsxs(e.Fragment,{children:[" ","by"," ",e.jsx("span",{className:"text-text-secondary font-medium",children:e.jsx(Z,{userId:t.assigned_to})})]})]})]}):e.jsx("span",{className:"text-text-tertiary italic text-xs",children:"Unclaimed"})}),e.jsx(_,{label:"Resolved",children:t.resolved_at?e.jsxs(e.Fragment,{children:[e.jsx(y,{date:t.resolved_at}),e.jsxs("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:[e.jsx(S,{ms:c})," total"]})]}):e.jsx("span",{className:"text-text-tertiary italic text-xs",children:"Pending"})})]}),t.description&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Description"}),e.jsx("p",{className:"text-[11px] text-text-secondary leading-relaxed",children:t.description})]})]}),e.jsxs("div",{className:"flex flex-col items-end gap-2",children:[t.workflow_id&&e.jsx(D,{to:`/workflows/executions/${encodeURIComponent(t.workflow_id)}`,className:"block text-[11px] text-accent hover:underline",children:"Execution Details"}),e.jsx(D,{to:`/escalations/detail/${t.id}`,className:"block text-[11px] text-accent hover:underline",children:"Escalation Details"})]})]})}function xe({lane:t,ticks:a,isExpanded:l,onToggle:c,anim:x,animDone:r,traceUrl:i}){var m,h;const o=t.kind==="task",k=o?t.task.status:t.escalation.status,f=se(k,t.isOpen),p=x.opacity>0;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center border-b border-surface-border cursor-pointer hover:bg-surface-sunken/40 transition-colors",onClick:c,children:[e.jsxs("div",{className:`w-52 shrink-0 py-3 pr-4 flex items-center gap-2 ${o?"":"pl-6"}`,style:{opacity:p?1:0,transition:"opacity 0.15s ease-out"},children:[o?ae(t.task.workflow_type)?e.jsx(B,{className:`w-4 h-4 shrink-0 ${$(t.task.status)}`}):e.jsx(R,{className:`w-4 h-4 shrink-0 ${$(t.task.status)}`}):E(t.escalation)?e.jsx(O,{className:`w-4 h-4 shrink-0 ${I(t.escalation.status)}`}):e.jsx(F,{className:`w-4 h-4 shrink-0 ${I(t.escalation.status)}`}),e.jsx("p",{className:"text-xs font-mono text-text-secondary whitespace-nowrap overflow-hidden",title:te(t.kind,o?t.task.status:t.escalation.status,!o&&E(t.escalation)),children:o?A(t.label,24):A(((m=t.escalation)==null?void 0:m.role)??t.label,20)})]}),e.jsxs("div",{className:"flex-1 relative h-10",children:[a.map(s=>e.jsx("div",{className:"absolute top-0 bottom-0 w-px bg-surface-border opacity-30",style:{left:`${s.pct}%`}},s.pct)),e.jsxs("div",{className:`absolute top-2 h-6 rounded-sm ${l?`${f} ring-2 ring-accent ring-offset-1`:`${f} hover:opacity-80`}`,style:{left:`${t.startPct}%`,width:p?`${Math.max(x.width,.3)}%`:"0%",minWidth:p?"4px":"0px",opacity:x.opacity},title:`${t.label} — ${L(t.durationMs)} — ${new Date(t.startMs).toLocaleTimeString()}`,children:[x.width>8&&r&&e.jsx("span",{className:"absolute inset-0 flex items-center px-1.5 text-[9px] font-mono text-white truncate",children:L(t.durationMs)}),t.claimPct!=null&&r&&e.jsx("div",{className:"absolute top-0 bottom-0 w-px border-l border-dashed border-white/70",style:{left:`${t.claimPct}%`},title:(h=t.escalation)!=null&&h.assigned_to?`Claimed by ${t.escalation.assigned_to}`:"Claimed",children:e.jsx("div",{className:"absolute -top-1 -left-[3px] w-[7px] h-[7px] rounded-full bg-white border border-amber-600"})})]})]})]}),e.jsx(J,{open:l,children:e.jsx("div",{className:"py-4 px-6 pl-52 border-b border-surface-border bg-surface-sunken/20",children:o&&t.task?e.jsx(ce,{task:t.task,traceUrl:i}):t.escalation?e.jsx(de,{escalation:t.escalation}):null})})]})}function me({tasks:t,escalations:a,traceUrl:l}){const[c,x]=b.useState(new Set),{lanes:r,timeMin:i,timeMax:o}=b.useMemo(()=>ne(t,a),[t,a]),k=o-i||1,{progress:f,animatedBar:p}=re(r.length,i,o);if(r.length===0)return e.jsx("p",{className:"text-sm text-text-tertiary py-8 text-center",children:"No events in this process."});const m=5,h=Array.from({length:m+1},(n,u)=>({pct:u/m*100,label:L(Math.round(u/m*k))})),s=n=>{x(u=>{const N=new Set(u);return N.has(n)?N.delete(n):N.add(n),N})},d=r.map(n=>n.id),j=d.length>0&&d.every(n=>c.has(n)),g=()=>{x(j?new Set:new Set(d))},v=f>=1;return e.jsxs("div",{className:"py-2",children:[e.jsx(ie,{allExpanded:j,onToggleAll:g}),e.jsx(oe,{ticks:h}),r.map(n=>e.jsx(xe,{lane:n,ticks:h,isExpanded:c.has(n.id),onToggle:()=>s(n.id),anim:p(n),animDone:v,traceUrl:l},`${n.kind}-${n.id}`))]})}function C(t){if(!t)return null;try{return JSON.parse(t)}catch{return null}}function ue(t){return t.length===0?null:[...t].sort((a,l)=>new Date(a.created_at).getTime()-new Date(l.created_at).getTime())[0]}function De(){var j;const{originId:t}=X();V(t);const{data:a,isLoading:l}=z(t??""),{data:c}=q(),x=((j=c==null?void 0:c.telemetry)==null?void 0:j.traceUrl)??null,r=(a==null?void 0:a.tasks)??[],i=(a==null?void 0:a.escalations)??[],o=b.useMemo(()=>ue(r),[r]),k=b.useMemo(()=>C(o==null?void 0:o.envelope),[o]),f=b.useMemo(()=>{if(o!=null&&o.data)return C(o.data);const g=r.filter(v=>v.status==="completed"&&v.data).sort((v,n)=>new Date(n.completed_at).getTime()-new Date(v.completed_at).getTime());return g.length>0?C(g[0].data):null},[o,r]),p=b.useMemo(()=>r.length>0&&r.some(g=>g.status!=="completed"&&g.status!=="cancelled"),[r]),m=b.useMemo(()=>{const g=r.filter(u=>u.status==="completed").length,v=r.filter(u=>u.status==="needs_intervention").length,n=i.filter(u=>u.status==="resolved").length;return{tasks:r.length,completed:g,escalated:v,escalations:i.length,resolved:n}},[r,i]),h=b.useMemo(()=>{if(r.length===0&&i.length===0)return null;const v=[...r.map(w=>w.created_at),...i.map(w=>w.created_at)].sort()[0],n=r.every(w=>w.status==="completed"||w.status==="cancelled"),u=i.every(w=>w.status==="resolved"),N=r.length>0&&n&&u,M=N?[...r.map(w=>w.completed_at),...i.map(w=>w.resolved_at)].filter(Boolean).sort().pop()??null:null;return{startIso:v,endIso:M,isFinished:N,elapsed:G(v,M)}},[r,i]),s=b.useMemo(()=>{const g=[];return h&&g.push({label:h.isFinished?"Completed":"Running",value:h.elapsed,dotClass:h.isFinished?"bg-status-success":"bg-status-pending animate-pulse"}),g.push({label:"Tasks",value:`${m.completed}/${m.tasks}`},{label:"Escalations",value:`${m.resolved}/${m.escalations}`}),g},[h,m]);if(l&&r.length===0)return e.jsxs("div",{className:"animate-pulse space-y-4",children:[e.jsx("div",{className:"h-8 bg-surface-sunken rounded w-48"}),e.jsx("div",{className:"h-40 bg-surface-sunken rounded"})]});const d=k||f||p;return e.jsxs("div",{children:[e.jsx(K,{title:"Process Detail",docsHash:"#docs:dashboard.md:process-detail",subtitle:t,stats:s}),d&&e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8 mb-10",children:[e.jsx("div",{children:k?e.jsx(P,{data:k,label:"Input",defaultMode:"json",defaultCollapsed:!0}):e.jsxs("div",{children:[e.jsx(T,{children:"Input"}),e.jsx("div",{className:"font-mono text-xs bg-surface-sunken rounded-md p-4 text-text-tertiary italic mt-2",children:"Waiting for task..."})]})}),e.jsx("div",{children:f?e.jsx(P,{data:f,label:"Output",defaultMode:"json",defaultCollapsed:!0}):p?e.jsxs("div",{children:[e.jsx(T,{children:"Output"}),e.jsxs("div",{className:"flex items-center gap-2 font-mono text-xs bg-surface-sunken rounded-md p-4 text-text-secondary mt-2",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-status-pending animate-pulse"}),"Processing..."]})]}):null})]}),e.jsx(T,{className:"mb-6",children:"Timeline"}),e.jsx(me,{tasks:r,escalations:i,traceUrl:x})]})}export{De as ProcessDetailPage};
|
|
2
|
+
//# sourceMappingURL=ProcessDetailPage-iIB1rwEt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProcessDetailPage-DBIrY6Vd.js","sources":["../../src/pages/processes/process-swimlane/helpers.ts","../../src/pages/processes/process-swimlane/useTimelineAnimation.ts","../../src/pages/processes/process-swimlane/SwimlaneIcons.tsx","../../src/pages/processes/process-swimlane/SwimlaneHeader.tsx","../../src/pages/processes/process-swimlane/TimeAxis.tsx","../../src/pages/processes/process-swimlane/MetricCell.tsx","../../src/pages/processes/process-swimlane/TraceLink.tsx","../../src/pages/processes/process-swimlane/TaskDetailPanel.tsx","../../src/pages/processes/process-swimlane/EscalationDetailPanel.tsx","../../src/pages/processes/process-swimlane/SwimlaneRow.tsx","../../src/pages/processes/process-swimlane/ProcessSwimlaneTimeline.tsx","../../src/pages/processes/ProcessDetailPage.tsx"],"sourcesContent":["import type { LTTaskRecord, LTEscalationRecord, LTTaskStatus, LTEscalationStatus } from '../../../api/types';\n\nexport interface ProcessLane {\n kind: 'task' | 'escalation';\n id: string;\n label: string;\n taskId: string;\n startMs: number;\n endMs: number;\n startPct: number;\n widthPct: number;\n durationMs: number;\n isOpen: boolean;\n // task fields\n task?: LTTaskRecord;\n // escalation fields\n escalation?: LTEscalationRecord;\n claimPct?: number | null; // percent position of claim within the bar\n}\n\nexport interface ProcessSwimlaneTimelineProps {\n tasks: LTTaskRecord[];\n escalations: LTEscalationRecord[];\n traceUrl?: string | null;\n}\n\nexport const PENDING_CLASS = 'bg-stripes animate-pulse opacity-70';\n\nexport function taskStatusColor(status: LTTaskStatus): string {\n switch (status) {\n case 'completed': return 'text-status-success';\n case 'in_progress': case 'pending': return 'text-status-warning';\n case 'needs_intervention': return 'text-status-error';\n case 'cancelled': return 'text-text-tertiary';\n default: return 'text-text-tertiary';\n }\n}\n\nexport function escStatusColor(status: LTEscalationStatus): string {\n switch (status) {\n case 'resolved': return 'text-status-success';\n case 'pending': return 'text-status-warning';\n case 'cancelled': return 'text-text-tertiary';\n default: return 'text-text-tertiary';\n }\n}\n\nexport function statusLabel(kind: 'task' | 'escalation', status: string, isAck?: boolean): string {\n const noun = kind === 'task' ? 'Task' : isAck ? 'Notification' : 'Escalation';\n return `${noun} is ${status.replace(/_/g, ' ')}`;\n}\n\nexport function barColorForStatus(status: string, isOpen: boolean): string {\n if (isOpen) return PENDING_CLASS;\n switch (status) {\n case 'completed':\n case 'resolved':\n return 'bg-status-success';\n case 'pending':\n case 'in_progress':\n case 'needs_intervention':\n return 'bg-status-warning';\n case 'cancelled':\n return 'bg-status-error';\n default:\n return 'bg-text-tertiary';\n }\n}\n\nexport function isMcpWorkflow(workflowType: string): boolean {\n return workflowType.startsWith('mcp') || workflowType.startsWith('Mcp');\n}\n\nexport function isAckEscalation(esc: LTEscalationRecord): boolean {\n return !esc.workflow_type;\n}\n\nexport function middleTruncate(str: string, maxLen: number): string {\n if (str.length <= maxLen) return str;\n const keep = Math.floor((maxLen - 1) / 2);\n return `${str.slice(0, keep)}…${str.slice(str.length - keep)}`;\n}\n\nexport function formatAbsoluteTime(iso: string): string {\n const d = new Date(iso);\n return d.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit', second: '2-digit' });\n}\n\n// ── Build lanes from raw task + escalation records ──────────────────────────\n\nexport function buildLanes(\n tasks: LTTaskRecord[],\n escalations: LTEscalationRecord[],\n): { lanes: ProcessLane[]; timeMin: number; timeMax: number } {\n const now = Date.now();\n\n // Group escalations by task_id\n const escByTask = new Map<string, LTEscalationRecord[]>();\n const unlinked: LTEscalationRecord[] = [];\n for (const e of escalations) {\n if (e.task_id) {\n if (!escByTask.has(e.task_id)) escByTask.set(e.task_id, []);\n escByTask.get(e.task_id)!.push(e);\n } else {\n unlinked.push(e);\n }\n }\n\n // Sort tasks by created_at\n const sorted = [...tasks].sort(\n (a, b) => new Date(a.created_at).getTime() - new Date(b.created_at).getTime(),\n );\n\n // Collect all timestamps for axis bounds\n const allTimes: number[] = [];\n for (const t of tasks) {\n allTimes.push(new Date(t.created_at).getTime());\n if (t.completed_at) allTimes.push(new Date(t.completed_at).getTime());\n }\n for (const e of escalations) {\n allTimes.push(new Date(e.created_at).getTime());\n if (e.resolved_at) allTimes.push(new Date(e.resolved_at).getTime());\n if (e.claimed_at) allTimes.push(new Date(e.claimed_at).getTime());\n }\n if (allTimes.length === 0) return { lanes: [], timeMin: 0, timeMax: 1 };\n\n const timeMin = Math.min(...allTimes);\n const hasOpen =\n tasks.some((t) => !t.completed_at) || escalations.some((e) => !e.resolved_at);\n const timeMax = hasOpen ? Math.max(now, Math.max(...allTimes)) : Math.max(...allTimes);\n const span = timeMax - timeMin || 1;\n\n const toPct = (ms: number) => ((ms - timeMin) / span) * 100;\n\n const lanes: ProcessLane[] = [];\n\n for (const task of sorted) {\n const tStart = new Date(task.created_at).getTime();\n const tEnd = task.completed_at ? new Date(task.completed_at).getTime() : now;\n const tOpen = !task.completed_at;\n\n lanes.push({\n kind: 'task',\n id: task.id,\n label: task.workflow_type,\n taskId: task.id,\n startMs: tStart,\n endMs: tEnd,\n startPct: toPct(tStart),\n widthPct: Math.max(((tEnd - tStart) / span) * 100, 0.5),\n durationMs: tEnd - tStart,\n isOpen: tOpen,\n task,\n });\n\n const taskEscs = (escByTask.get(task.id) || []).sort(\n (a, b) => new Date(a.created_at).getTime() - new Date(b.created_at).getTime(),\n );\n for (const esc of taskEscs) {\n const eStart = new Date(esc.created_at).getTime();\n const eEnd = esc.resolved_at ? new Date(esc.resolved_at).getTime() : now;\n const eOpen = !esc.resolved_at;\n\n let claimPct: number | null = null;\n if (esc.claimed_at) {\n const claimMs = new Date(esc.claimed_at).getTime();\n const escSpan = eEnd - eStart || 1;\n claimPct = ((claimMs - eStart) / escSpan) * 100;\n }\n\n lanes.push({\n kind: 'escalation',\n id: esc.id,\n label: esc.role,\n taskId: task.id,\n startMs: eStart,\n endMs: eEnd,\n startPct: toPct(eStart),\n widthPct: Math.max(((eEnd - eStart) / span) * 100, 0.5),\n durationMs: eEnd - eStart,\n isOpen: eOpen,\n escalation: esc,\n claimPct,\n });\n }\n }\n\n // Unlinked escalations at the bottom\n for (const esc of unlinked) {\n const eStart = new Date(esc.created_at).getTime();\n const eEnd = esc.resolved_at ? new Date(esc.resolved_at).getTime() : now;\n let claimPct: number | null = null;\n if (esc.claimed_at) {\n const claimMs = new Date(esc.claimed_at).getTime();\n const escSpan = eEnd - eStart || 1;\n claimPct = ((claimMs - eStart) / escSpan) * 100;\n }\n lanes.push({\n kind: 'escalation',\n id: esc.id,\n label: esc.role,\n taskId: '',\n startMs: eStart,\n endMs: eEnd,\n startPct: toPct(eStart),\n widthPct: Math.max(((eEnd - eStart) / span) * 100, 0.5),\n durationMs: eEnd - eStart,\n isOpen: !esc.resolved_at,\n escalation: esc,\n claimPct,\n });\n }\n\n return { lanes, timeMin, timeMax };\n}\n","import { useState, useEffect, useRef, useCallback } from 'react';\nimport type { ProcessLane } from './helpers';\n\nexport interface BarAnim {\n width: number;\n opacity: number;\n}\n\nexport function useTimelineAnimation(\n laneCount: number,\n timeMin: number,\n timeMax: number,\n durationMs = 500,\n) {\n const [progress, setProgress] = useState(0); // 0 → 1\n const startRef = useRef<number | null>(null);\n const totalSpanMs = timeMax - timeMin || 1;\n\n useEffect(() => {\n if (laneCount === 0) return;\n startRef.current = null;\n setProgress(0);\n\n let raf: number;\n const step = (ts: number) => {\n if (startRef.current === null) startRef.current = ts;\n const elapsed = ts - startRef.current;\n const t = Math.min(elapsed / durationMs, 1);\n // ease-out cubic for a smooth deceleration\n const eased = 1 - Math.pow(1 - t, 3);\n setProgress(eased);\n if (t < 1) raf = requestAnimationFrame(step);\n };\n raf = requestAnimationFrame(step);\n return () => cancelAnimationFrame(raf);\n }, [laneCount, durationMs]);\n\n const animatedBar = useCallback(\n (lane: ProcessLane): BarAnim => {\n const appearAt = (lane.startMs - timeMin) / totalSpanMs;\n const doneAt = (lane.endMs - timeMin) / totalSpanMs;\n\n if (progress < appearAt) {\n return { width: 0, opacity: 0 };\n }\n\n const laneSpan = doneAt - appearAt || 0.001;\n const fill = Math.min((progress - appearAt) / laneSpan, 1);\n const animatedWidth = lane.widthPct * fill;\n const fadeIn = Math.min(fill / 0.1, 1);\n\n return { width: animatedWidth, opacity: fadeIn };\n },\n [progress, timeMin, totalSpanMs],\n );\n\n return { progress, animatedBar };\n}\n","export function ClipboardIcon({ className }: { className?: string }) {\n return (\n <svg className={className} fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={1.5}>\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\" />\n </svg>\n );\n}\n\n/** Sparkle/AI icon for mcp* system workflows */\nexport function SparkleIcon({ className }: { className?: string }) {\n return (\n <svg className={className} fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={1.5}>\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09zM18.259 8.715L18 9.75l-.259-1.035a3.375 3.375 0 00-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 002.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 002.455 2.456L21.75 6l-1.036.259a3.375 3.375 0 00-2.455 2.456zM16.894 20.567L16.5 21.75l-.394-1.183a2.25 2.25 0 00-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 001.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 001.423 1.423l1.183.394-1.183.394a2.25 2.25 0 00-1.423 1.423z\" />\n </svg>\n );\n}\n\n/** Bell icon for notification/ACK escalations */\nexport function BellIcon({ className }: { className?: string }) {\n return (\n <svg className={className} fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={1.5}>\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0\" />\n </svg>\n );\n}\n\nexport function UserIcon({ className }: { className?: string }) {\n return (\n <svg className={className} fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={1.5}>\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z\" />\n </svg>\n );\n}\n","import { ClipboardIcon, SparkleIcon, BellIcon, UserIcon } from './SwimlaneIcons';\n\ninterface SwimlaneHeaderProps {\n allExpanded: boolean;\n onToggleAll: () => void;\n}\n\nexport function SwimlaneHeader({ allExpanded, onToggleAll }: SwimlaneHeaderProps) {\n return (\n <div className=\"flex items-center gap-4 mb-4 flex-wrap\">\n <button onClick={onToggleAll} className=\"text-[10px] text-accent hover:underline\">\n {allExpanded ? 'Collapse all' : 'Expand all'}\n </button>\n\n {/* Legend */}\n <div className=\"flex items-center gap-4 ml-auto\">\n <div className=\"flex items-center gap-1\">\n <ClipboardIcon className=\"w-3.5 h-3.5 text-text-tertiary\" />\n <span className=\"text-[9px] text-text-tertiary\">Task</span>\n </div>\n <div className=\"flex items-center gap-1\">\n <SparkleIcon className=\"w-3.5 h-3.5 text-text-tertiary\" />\n <span className=\"text-[9px] text-text-tertiary\">AI Task</span>\n </div>\n <div className=\"flex items-center gap-1\">\n <UserIcon className=\"w-3.5 h-3.5 text-text-tertiary\" />\n <span className=\"text-[9px] text-text-tertiary\">Escalation</span>\n </div>\n <div className=\"flex items-center gap-1\">\n <BellIcon className=\"w-3.5 h-3.5 text-text-tertiary\" />\n <span className=\"text-[9px] text-text-tertiary\">Notification</span>\n </div>\n <div className=\"flex items-center gap-1\">\n <span className=\"w-2 h-2 rounded-full bg-status-success\" />\n <span className=\"text-[9px] text-text-tertiary\">Done</span>\n </div>\n <div className=\"flex items-center gap-1\">\n <span className=\"w-2 h-2 rounded-full bg-status-warning\" />\n <span className=\"text-[9px] text-text-tertiary\">Active</span>\n </div>\n </div>\n </div>\n );\n}\n","export interface Tick {\n pct: number;\n label: string;\n}\n\ninterface TimeAxisProps {\n ticks: Tick[];\n}\n\nexport function TimeAxis({ ticks }: TimeAxisProps) {\n return (\n <div className=\"flex\">\n <div className=\"w-52 shrink-0\" />\n <div className=\"flex-1 relative h-6 border-b border-surface-border\">\n {ticks.map((tick) => (\n <span\n key={tick.pct}\n className=\"absolute text-[9px] font-mono text-text-tertiary -translate-x-1/2 bottom-1 whitespace-nowrap\"\n style={{ left: `${tick.pct}%` }}\n >\n {tick.label}\n </span>\n ))}\n </div>\n </div>\n );\n}\n","/** Small labeled metric cell used inside detail panels */\nexport function MetricCell({\n label,\n children,\n}: {\n label: string;\n children: React.ReactNode;\n}) {\n return (\n <div>\n <p className=\"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-0.5\">\n {label}\n </p>\n <div className=\"text-xs text-text-primary\">{children}</div>\n </div>\n );\n}\n","import { useState } from 'react';\n\nexport function TraceLink({ traceId, href }: { traceId: string; href?: string }) {\n const [copied, setCopied] = useState(false);\n\n const handleCopy = (e: React.MouseEvent) => {\n e.stopPropagation();\n navigator.clipboard.writeText(traceId);\n setCopied(true);\n setTimeout(() => setCopied(false), 1500);\n };\n\n const handleNav = (e: React.MouseEvent) => {\n e.stopPropagation();\n if (href) window.open(href, '_blank', 'noopener,noreferrer');\n };\n\n return (\n <span className=\"group/trace inline-flex items-center gap-1.5\">\n {href && (\n <button\n onClick={handleNav}\n title=\"Open trace\"\n className=\"opacity-0 group-hover/trace:opacity-100 transition-opacity p-0.5\"\n >\n <svg className=\"w-3 h-3 text-text-tertiary hover:text-accent\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={2}>\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-4.5-4.5h6m0 0v6m0-6L10.5 15\" />\n </svg>\n </button>\n )}\n <button\n onClick={handleCopy}\n title=\"Copy trace ID\"\n className=\"opacity-0 group-hover/trace:opacity-100 transition-opacity p-0.5\"\n >\n <svg\n className={`w-3 h-3 transition-colors ${copied ? 'text-status-success' : 'text-text-tertiary hover:text-accent'}`}\n fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={2}\n >\n {copied\n ? <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M5 13l4 4L19 7\" />\n : <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3\" />\n }\n </svg>\n </button>\n <span className=\"text-[11px] text-accent\">Trace Details</span>\n </span>\n );\n}\n","import { Link } from 'react-router-dom';\nimport { StatusBadge } from '../../../components/common/display/StatusBadge';\nimport { WorkflowPill } from '../../../components/common/display/WorkflowPill';\nimport { TimestampCell } from '../../../components/common/display/TimestampCell';\nimport { DurationValue } from '../../../components/common/display/DurationValue';\nimport type { LTTaskRecord } from '../../../api/types';\nimport { MetricCell } from './MetricCell';\nimport { TraceLink } from './TraceLink';\n\nexport function TaskDetailPanel({\n task,\n traceUrl,\n}: {\n task: LTTaskRecord;\n traceUrl?: string | null;\n}) {\n const elapsed = task.completed_at\n ? new Date(task.completed_at).getTime() - new Date(task.created_at).getTime()\n : Date.now() - new Date(task.created_at).getTime();\n\n return (\n <div className=\"grid grid-cols-[3fr_1fr] gap-6\">\n {/* Left: timing metrics */}\n <div className=\"space-y-4\">\n <div className=\"flex items-center gap-3\">\n <StatusBadge status={task.status} />\n <WorkflowPill type={task.workflow_type} />\n </div>\n\n <div className=\"grid grid-cols-3 gap-4\">\n <MetricCell label=\"Started\">\n <TimestampCell date={task.created_at} />\n </MetricCell>\n\n <MetricCell label=\"Completed\">\n {task.completed_at ? (\n <TimestampCell date={task.completed_at} />\n ) : (\n <span className=\"text-text-tertiary italic text-xs\">In progress</span>\n )}\n </MetricCell>\n\n <MetricCell label=\"Duration\">\n <DurationValue ms={elapsed} className=\"font-mono text-sm\" />\n </MetricCell>\n </div>\n\n {task.milestones.length > 0 && (\n <div>\n <p className=\"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1.5\">\n Milestones\n </p>\n <div className=\"flex flex-wrap gap-1.5\">\n {task.milestones.map((m, i) => (\n <span\n key={i}\n className=\"px-2 py-0.5 text-[10px] font-mono bg-accent-faint/50 rounded text-text-secondary\"\n >\n {m.name}: {String(m.value)}\n </span>\n ))}\n </div>\n </div>\n )}\n </div>\n\n {/* Right: links */}\n <div className=\"flex flex-col items-end gap-2\">\n <Link\n to={`/workflows/executions/${encodeURIComponent(task.workflow_id)}`}\n className=\"block text-[11px] text-accent hover:underline\"\n >\n Execution Details\n </Link>\n <Link\n to={`/workflows/tasks/detail/${task.id}`}\n className=\"block text-[11px] text-accent hover:underline\"\n >\n Task Details\n </Link>\n {task.trace_id && (\n <TraceLink\n traceId={task.trace_id}\n href={traceUrl ? traceUrl.replace('{traceId}', task.trace_id) : undefined}\n />\n )}\n </div>\n </div>\n );\n}\n","import { Link } from 'react-router-dom';\nimport { StatusBadge } from '../../../components/common/display/StatusBadge';\nimport { RolePill } from '../../../components/common/display/RolePill';\nimport { UserName } from '../../../components/common/display/UserName';\nimport { TimestampCell } from '../../../components/common/display/TimestampCell';\nimport { DurationValue } from '../../../components/common/display/DurationValue';\nimport type { LTEscalationRecord } from '../../../api/types';\nimport { MetricCell } from './MetricCell';\n\nexport function EscalationDetailPanel({\n escalation,\n}: {\n escalation: LTEscalationRecord;\n}) {\n const created = new Date(escalation.created_at).getTime();\n const claimedMs = escalation.claimed_at\n ? new Date(escalation.claimed_at).getTime() - created\n : null;\n const resolvedMs = escalation.resolved_at\n ? new Date(escalation.resolved_at).getTime() - created\n : null;\n\n return (\n <div className=\"grid grid-cols-[3fr_1fr] gap-6\">\n {/* Left: timing metrics */}\n <div className=\"space-y-4\">\n <div className=\"flex items-center gap-3\">\n <StatusBadge status={escalation.status} />\n <RolePill role={escalation.role} />\n {escalation.type && (\n <span className=\"text-[10px] text-text-tertiary\">\n {escalation.type}\n {escalation.subtype ? ` / ${escalation.subtype}` : ''}\n </span>\n )}\n </div>\n\n <div className=\"grid grid-cols-3 gap-4\">\n <MetricCell label=\"Created\">\n <TimestampCell date={escalation.created_at} />\n </MetricCell>\n\n <MetricCell label=\"Claimed\">\n {escalation.claimed_at ? (\n <>\n <TimestampCell date={escalation.claimed_at} />\n <p className=\"text-[10px] text-text-tertiary mt-0.5\">\n after <DurationValue ms={claimedMs} />\n {escalation.assigned_to && (\n <>\n {' '}by{' '}\n <span className=\"text-text-secondary font-medium\">\n <UserName userId={escalation.assigned_to} />\n </span>\n </>\n )}\n </p>\n </>\n ) : (\n <span className=\"text-text-tertiary italic text-xs\">Unclaimed</span>\n )}\n </MetricCell>\n\n <MetricCell label=\"Resolved\">\n {escalation.resolved_at ? (\n <>\n <TimestampCell date={escalation.resolved_at} />\n <p className=\"text-[10px] text-text-tertiary mt-0.5\">\n <DurationValue ms={resolvedMs} /> total\n </p>\n </>\n ) : (\n <span className=\"text-text-tertiary italic text-xs\">Pending</span>\n )}\n </MetricCell>\n </div>\n\n {escalation.description && (\n <div>\n <p className=\"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1\">\n Description\n </p>\n <p className=\"text-[11px] text-text-secondary leading-relaxed\">\n {escalation.description}\n </p>\n </div>\n )}\n </div>\n\n {/* Right: links */}\n <div className=\"flex flex-col items-end gap-2\">\n {escalation.workflow_id && (\n <Link\n to={`/workflows/executions/${encodeURIComponent(escalation.workflow_id)}`}\n className=\"block text-[11px] text-accent hover:underline\"\n >\n Execution Details\n </Link>\n )}\n <Link\n to={`/escalations/detail/${escalation.id}`}\n className=\"block text-[11px] text-accent hover:underline\"\n >\n Escalation Details\n </Link>\n </div>\n </div>\n );\n}\n","import { Collapsible } from '../../../components/common/layout/Collapsible';\nimport { formatDuration } from '../../../lib/format';\nimport {\n taskStatusColor,\n escStatusColor,\n statusLabel,\n barColorForStatus,\n isMcpWorkflow,\n isAckEscalation,\n middleTruncate,\n} from './helpers';\nimport type { ProcessLane } from './helpers';\nimport type { BarAnim } from './useTimelineAnimation';\nimport type { Tick } from './TimeAxis';\nimport { ClipboardIcon, SparkleIcon, BellIcon, UserIcon } from './SwimlaneIcons';\nimport { TaskDetailPanel } from './TaskDetailPanel';\nimport { EscalationDetailPanel } from './EscalationDetailPanel';\n\ninterface SwimlaneRowProps {\n lane: ProcessLane;\n ticks: Tick[];\n isExpanded: boolean;\n onToggle: () => void;\n anim: BarAnim;\n animDone: boolean;\n traceUrl?: string | null;\n}\n\nexport function SwimlaneRow({\n lane,\n ticks,\n isExpanded,\n onToggle,\n anim,\n animDone,\n traceUrl,\n}: SwimlaneRowProps) {\n const isTask = lane.kind === 'task';\n const status = isTask ? lane.task!.status : lane.escalation!.status;\n const barBase = barColorForStatus(status, lane.isOpen);\n const visible = anim.opacity > 0;\n\n return (\n <div>\n {/* Lane row */}\n <div\n className=\"flex items-center border-b border-surface-border cursor-pointer hover:bg-surface-sunken/40 transition-colors\"\n onClick={onToggle}\n >\n {/* Label column */}\n <div\n className={`w-52 shrink-0 py-3 pr-4 flex items-center gap-2 ${\n isTask ? '' : 'pl-6'\n }`}\n style={{ opacity: visible ? 1 : 0, transition: 'opacity 0.15s ease-out' }}\n >\n {isTask ? (\n isMcpWorkflow(lane.task!.workflow_type) ? (\n <SparkleIcon\n className={`w-4 h-4 shrink-0 ${taskStatusColor(lane.task!.status)}`}\n />\n ) : (\n <ClipboardIcon\n className={`w-4 h-4 shrink-0 ${taskStatusColor(lane.task!.status)}`}\n />\n )\n ) : isAckEscalation(lane.escalation!) ? (\n <BellIcon\n className={`w-4 h-4 shrink-0 ${escStatusColor(lane.escalation!.status)}`}\n />\n ) : (\n <UserIcon\n className={`w-4 h-4 shrink-0 ${escStatusColor(lane.escalation!.status)}`}\n />\n )}\n <p\n className=\"text-xs font-mono text-text-secondary whitespace-nowrap overflow-hidden\"\n title={statusLabel(lane.kind, isTask ? lane.task!.status : lane.escalation!.status, !isTask && isAckEscalation(lane.escalation!))}\n >\n {isTask\n ? middleTruncate(lane.label, 24)\n : middleTruncate(lane.escalation?.role ?? lane.label, 20)}\n </p>\n </div>\n\n {/* Bar area */}\n <div className=\"flex-1 relative h-10\">\n {/* Tick gridlines */}\n {ticks.map((tick) => (\n <div\n key={tick.pct}\n className=\"absolute top-0 bottom-0 w-px bg-surface-border opacity-30\"\n style={{ left: `${tick.pct}%` }}\n />\n ))}\n\n {/* Duration bar (animated reveal + grow) */}\n <div\n className={`absolute top-2 h-6 rounded-sm ${\n isExpanded\n ? `${barBase} ring-2 ring-accent ring-offset-1`\n : `${barBase} hover:opacity-80`\n }`}\n style={{\n left: `${lane.startPct}%`,\n width: visible ? `${Math.max(anim.width, 0.3)}%` : '0%',\n minWidth: visible ? '4px' : '0px',\n opacity: anim.opacity,\n }}\n title={`${lane.label} — ${formatDuration(lane.durationMs)} — ${new Date(lane.startMs).toLocaleTimeString()}`}\n >\n {/* Duration text inside bar (show only when fully revealed) */}\n {anim.width > 8 && animDone && (\n <span className=\"absolute inset-0 flex items-center px-1.5 text-[9px] font-mono text-white truncate\">\n {formatDuration(lane.durationMs)}\n </span>\n )}\n\n {/* Claim marker (vertical dashed line) — show after animation */}\n {lane.claimPct != null && animDone && (\n <div\n className=\"absolute top-0 bottom-0 w-px border-l border-dashed border-white/70\"\n style={{ left: `${lane.claimPct}%` }}\n title={\n lane.escalation?.assigned_to\n ? `Claimed by ${lane.escalation.assigned_to}`\n : 'Claimed'\n }\n >\n {/* Claim dot */}\n <div className=\"absolute -top-1 -left-[3px] w-[7px] h-[7px] rounded-full bg-white border border-amber-600\" />\n </div>\n )}\n </div>\n </div>\n </div>\n\n {/* Expandable detail panel */}\n <Collapsible open={isExpanded}>\n <div className=\"py-4 px-6 pl-52 border-b border-surface-border bg-surface-sunken/20\">\n {isTask && lane.task ? (\n <TaskDetailPanel task={lane.task} traceUrl={traceUrl} />\n ) : lane.escalation ? (\n <EscalationDetailPanel escalation={lane.escalation} />\n ) : null}\n </div>\n </Collapsible>\n </div>\n );\n}\n","import { useState, useMemo } from 'react';\nimport { formatDuration } from '../../../lib/format';\nimport { buildLanes } from './helpers';\nimport type { ProcessSwimlaneTimelineProps } from './helpers';\nimport { useTimelineAnimation } from './useTimelineAnimation';\nimport { SwimlaneHeader } from './SwimlaneHeader';\nimport { TimeAxis } from './TimeAxis';\nimport { SwimlaneRow } from './SwimlaneRow';\n\nexport function ProcessSwimlaneTimeline({\n tasks,\n escalations,\n traceUrl,\n}: ProcessSwimlaneTimelineProps) {\n const [expanded, setExpanded] = useState<Set<string>>(new Set());\n\n const { lanes, timeMin, timeMax } = useMemo(\n () => buildLanes(tasks, escalations),\n [tasks, escalations],\n );\n\n const totalSpanMs = timeMax - timeMin || 1;\n const { progress, animatedBar } = useTimelineAnimation(lanes.length, timeMin, timeMax);\n\n if (lanes.length === 0) {\n return (\n <p className=\"text-sm text-text-tertiary py-8 text-center\">\n No events in this process.\n </p>\n );\n }\n\n // Time axis ticks\n const tickCount = 5;\n const ticks = Array.from({ length: tickCount + 1 }, (_, i) => ({\n pct: (i / tickCount) * 100,\n label: formatDuration(Math.round((i / tickCount) * totalSpanMs)),\n }));\n\n const toggle = (id: string) => {\n setExpanded((prev) => {\n const next = new Set(prev);\n if (next.has(id)) next.delete(id);\n else next.add(id);\n return next;\n });\n };\n\n const allIds = lanes.map((l) => l.id);\n const allExpanded = allIds.length > 0 && allIds.every((id) => expanded.has(id));\n const toggleAll = () => {\n if (allExpanded) setExpanded(new Set());\n else setExpanded(new Set(allIds));\n };\n\n const animDone = progress >= 1;\n\n return (\n <div className=\"py-2\">\n <SwimlaneHeader allExpanded={allExpanded} onToggleAll={toggleAll} />\n <TimeAxis ticks={ticks} />\n\n {lanes.map((lane) => (\n <SwimlaneRow\n key={`${lane.kind}-${lane.id}`}\n lane={lane}\n ticks={ticks}\n isExpanded={expanded.has(lane.id)}\n onToggle={() => toggle(lane.id)}\n anim={animatedBar(lane)}\n animDone={animDone}\n traceUrl={traceUrl}\n />\n ))}\n </div>\n );\n}\n","import { useMemo } from 'react';\nimport { useParams } from 'react-router-dom';\nimport { useProcessDetail } from '../../api/tasks';\nimport { useProcessDetailEvents } from '../../hooks/useEventHooks';\nimport { useSettings } from '../../api/settings';\nimport { PageHeaderWithStats, type InlineStat } from '../../components/common/layout/PageHeaderWithStats';\nimport { SectionLabel } from '../../components/common/layout/SectionLabel';\nimport { JsonViewer } from '../../components/common/data/JsonViewer';\nimport { ProcessSwimlaneTimeline } from './process-swimlane/ProcessSwimlaneTimeline';\nimport { formatElapsed } from '../../lib/format';\nimport type { LTTaskRecord } from '../../api/types';\n\nfunction safeParseJson(raw: string | null | undefined): Record<string, unknown> | null {\n if (!raw) return null;\n try { return JSON.parse(raw); } catch { return null; }\n}\n\nfunction extractRootTask(tasks: LTTaskRecord[]): LTTaskRecord | null {\n if (tasks.length === 0) return null;\n return [...tasks].sort(\n (a, b) => new Date(a.created_at).getTime() - new Date(b.created_at).getTime(),\n )[0];\n}\n\nexport function ProcessDetailPage() {\n const { originId } = useParams<{ originId: string }>();\n useProcessDetailEvents(originId);\n const { data, isLoading } = useProcessDetail(originId ?? '');\n const { data: settings } = useSettings();\n const traceUrl = settings?.telemetry?.traceUrl ?? null;\n\n const tasks = data?.tasks ?? [];\n const escalations = data?.escalations ?? [];\n\n const rootTask = useMemo(() => extractRootTask(tasks), [tasks]);\n const rootEnvelope = useMemo(() => safeParseJson(rootTask?.envelope), [rootTask]);\n const rootResult = useMemo(() => {\n if (rootTask?.data) return safeParseJson(rootTask.data);\n const completed = tasks\n .filter((t) => t.status === 'completed' && t.data)\n .sort((a, b) => new Date(b.completed_at!).getTime() - new Date(a.completed_at!).getTime());\n return completed.length > 0 ? safeParseJson(completed[0].data) : null;\n }, [rootTask, tasks]);\n\n const isRunning = useMemo(() => {\n return tasks.length > 0 && tasks.some(\n (t) => t.status !== 'completed' && t.status !== 'cancelled',\n );\n }, [tasks]);\n\n const stats = useMemo(() => {\n const completed = tasks.filter((t) => t.status === 'completed').length;\n const escalated = tasks.filter((t) => t.status === 'needs_intervention').length;\n const resolved = escalations.filter((e) => e.status === 'resolved').length;\n return { tasks: tasks.length, completed, escalated, escalations: escalations.length, resolved };\n }, [tasks, escalations]);\n\n const duration = useMemo(() => {\n if (tasks.length === 0 && escalations.length === 0) return null;\n const allDates = [\n ...tasks.map((t) => t.created_at),\n ...escalations.map((e) => e.created_at),\n ].sort();\n const startIso = allDates[0];\n const allCompleted = tasks.every((t) => t.status === 'completed' || t.status === 'cancelled');\n const allResolved = escalations.every((e) => e.status === 'resolved');\n const isFinished = tasks.length > 0 && allCompleted && allResolved;\n const endIso = isFinished\n ? [...tasks.map((t) => t.completed_at), ...escalations.map((e) => e.resolved_at)]\n .filter(Boolean)\n .sort()\n .pop() ?? null\n : null;\n return { startIso, endIso, isFinished, elapsed: formatElapsed(startIso, endIso) };\n }, [tasks, escalations]);\n\n const inlineStats = useMemo<InlineStat[]>(() => {\n const items: InlineStat[] = [];\n if (duration) {\n items.push({\n label: duration.isFinished ? 'Completed' : 'Running',\n value: duration.elapsed,\n dotClass: duration.isFinished ? 'bg-status-success' : 'bg-status-pending animate-pulse',\n });\n }\n items.push(\n { label: 'Tasks', value: `${stats.completed}/${stats.tasks}` },\n { label: 'Escalations', value: `${stats.resolved}/${stats.escalations}` },\n );\n return items;\n }, [duration, stats]);\n\n if (isLoading && tasks.length === 0) {\n return (\n <div className=\"animate-pulse space-y-4\">\n <div className=\"h-8 bg-surface-sunken rounded w-48\" />\n <div className=\"h-40 bg-surface-sunken rounded\" />\n </div>\n );\n }\n\n const hasMessages = rootEnvelope || rootResult || isRunning;\n\n return (\n <div>\n <PageHeaderWithStats\n title=\"Process Detail\"\n docsHash=\"#docs:dashboard.md:process-detail\"\n subtitle={originId}\n stats={inlineStats}\n />\n\n {hasMessages && (\n <div className=\"grid grid-cols-1 lg:grid-cols-2 gap-8 mb-10\">\n <div>\n {rootEnvelope ? (\n <JsonViewer data={rootEnvelope} label=\"Input\" defaultMode=\"json\" defaultCollapsed />\n ) : (\n <div>\n <SectionLabel>Input</SectionLabel>\n <div className=\"font-mono text-xs bg-surface-sunken rounded-md p-4 text-text-tertiary italic mt-2\">\n Waiting for task...\n </div>\n </div>\n )}\n </div>\n <div>\n {rootResult ? (\n <JsonViewer data={rootResult} label=\"Output\" defaultMode=\"json\" defaultCollapsed />\n ) : isRunning ? (\n <div>\n <SectionLabel>Output</SectionLabel>\n <div className=\"flex items-center gap-2 font-mono text-xs bg-surface-sunken rounded-md p-4 text-text-secondary mt-2\">\n <span className=\"w-1.5 h-1.5 rounded-full bg-status-pending animate-pulse\" />\n Processing...\n </div>\n </div>\n ) : null}\n </div>\n </div>\n )}\n\n <SectionLabel className=\"mb-6\">Timeline</SectionLabel>\n\n <ProcessSwimlaneTimeline\n tasks={tasks}\n escalations={escalations}\n traceUrl={traceUrl}\n />\n </div>\n );\n}\n"],"names":["PENDING_CLASS","taskStatusColor","status","escStatusColor","statusLabel","kind","isAck","barColorForStatus","isOpen","isMcpWorkflow","workflowType","isAckEscalation","esc","middleTruncate","str","maxLen","keep","buildLanes","tasks","escalations","now","escByTask","unlinked","e","sorted","a","b","allTimes","t","timeMin","timeMax","span","toPct","ms","lanes","task","tStart","tEnd","tOpen","taskEscs","eStart","eEnd","eOpen","claimPct","claimMs","escSpan","useTimelineAnimation","laneCount","durationMs","progress","setProgress","useState","startRef","useRef","totalSpanMs","useEffect","raf","step","ts","elapsed","eased","animatedBar","useCallback","lane","appearAt","doneAt","laneSpan","fill","animatedWidth","fadeIn","ClipboardIcon","className","jsx","SparkleIcon","BellIcon","UserIcon","SwimlaneHeader","allExpanded","onToggleAll","jsxs","TimeAxis","ticks","tick","MetricCell","label","children","TraceLink","traceId","href","copied","setCopied","handleCopy","handleNav","TaskDetailPanel","traceUrl","StatusBadge","WorkflowPill","TimestampCell","DurationValue","m","i","Link","EscalationDetailPanel","escalation","created","claimedMs","resolvedMs","RolePill","Fragment","UserName","SwimlaneRow","isExpanded","onToggle","anim","animDone","isTask","barBase","visible","_a","formatDuration","_b","Collapsible","ProcessSwimlaneTimeline","expanded","setExpanded","useMemo","tickCount","_","toggle","id","prev","next","allIds","l","toggleAll","safeParseJson","raw","extractRootTask","ProcessDetailPage","originId","useParams","useProcessDetailEvents","data","isLoading","useProcessDetail","settings","useSettings","rootTask","rootEnvelope","rootResult","completed","isRunning","stats","escalated","resolved","duration","startIso","allCompleted","allResolved","isFinished","endIso","formatElapsed","inlineStats","items","hasMessages","PageHeaderWithStats","JsonViewer","SectionLabel"],"mappings":"8mBA0BO,MAAMA,GAAgB,sCAEtB,SAASC,EAAgBC,EAA8B,CAC5D,OAAQA,EAAA,CACN,IAAK,YAAa,MAAO,sBACzB,IAAK,cAAe,IAAK,UAAW,MAAO,sBAC3C,IAAK,qBAAsB,MAAO,oBAClC,IAAK,YAAa,MAAO,qBACzB,QAAS,MAAO,oBAAA,CAEpB,CAEO,SAASC,EAAeD,EAAoC,CACjE,OAAQA,EAAA,CACN,IAAK,WAAY,MAAO,sBACxB,IAAK,UAAW,MAAO,sBACvB,IAAK,YAAa,MAAO,qBACzB,QAAS,MAAO,oBAAA,CAEpB,CAEO,SAASE,GAAYC,EAA6BH,EAAgBI,EAAyB,CAEhG,MAAO,GADMD,IAAS,OAAS,OAASC,EAAQ,eAAiB,YACnD,OAAOJ,EAAO,QAAQ,KAAM,GAAG,CAAC,EAChD,CAEO,SAASK,GAAkBL,EAAgBM,EA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,OAAA,CAAK,UAAU,0DAAA,CAA2D,EAAE,eAAA,CAAA,CAE/E,CAAA,CAAA,CACF,EACE,IAAA,CACN,CAAA,EACF,EAGFA,EAAAA,IAAC+F,EAAA,CAAa,UAAU,OAAO,SAAA,WAAQ,EAEvC/F,EAAAA,IAACkD,GAAA,CACC,MAAAxG,EACA,YAAAC,EACA,SAAA2E,CAAA,CAAA,CACF,EACF,CAEJ"}
|
|
1
|
+
{"version":3,"file":"ProcessDetailPage-iIB1rwEt.js","sources":["../../src/pages/processes/process-swimlane/helpers.ts","../../src/pages/processes/process-swimlane/useTimelineAnimation.ts","../../src/pages/processes/process-swimlane/SwimlaneIcons.tsx","../../src/pages/processes/process-swimlane/SwimlaneHeader.tsx","../../src/pages/processes/process-swimlane/TimeAxis.tsx","../../src/pages/processes/process-swimlane/MetricCell.tsx","../../src/pages/processes/process-swimlane/TraceLink.tsx","../../src/pages/processes/process-swimlane/TaskDetailPanel.tsx","../../src/pages/processes/process-swimlane/EscalationDetailPanel.tsx","../../src/pages/processes/process-swimlane/SwimlaneRow.tsx","../../src/pages/processes/process-swimlane/ProcessSwimlaneTimeline.tsx","../../src/pages/processes/ProcessDetailPage.tsx"],"sourcesContent":["import type { LTTaskRecord, LTEscalationRecord, LTTaskStatus, LTEscalationStatus } from '../../../api/types';\n\nexport interface ProcessLane {\n kind: 'task' | 'escalation';\n id: string;\n label: string;\n taskId: string;\n startMs: number;\n endMs: number;\n startPct: number;\n widthPct: number;\n durationMs: number;\n isOpen: boolean;\n // task fields\n task?: LTTaskRecord;\n // escalation fields\n escalation?: LTEscalationRecord;\n claimPct?: number | null; // percent position of claim within the bar\n}\n\nexport interface ProcessSwimlaneTimelineProps {\n tasks: LTTaskRecord[];\n escalations: LTEscalationRecord[];\n traceUrl?: string | null;\n}\n\nexport const PENDING_CLASS = 'bg-stripes animate-pulse opacity-70';\n\nexport function taskStatusColor(status: LTTaskStatus): string {\n switch (status) {\n case 'completed': return 'text-status-success';\n case 'in_progress': case 'pending': return 'text-status-warning';\n case 'needs_intervention': return 'text-status-error';\n case 'cancelled': return 'text-text-tertiary';\n default: return 'text-text-tertiary';\n }\n}\n\nexport function escStatusColor(status: LTEscalationStatus): string {\n switch (status) {\n case 'resolved': return 'text-status-success';\n case 'pending': return 'text-status-warning';\n case 'cancelled': return 'text-text-tertiary';\n default: return 'text-text-tertiary';\n }\n}\n\nexport function statusLabel(kind: 'task' | 'escalation', status: string, isAck?: boolean): string {\n const noun = kind === 'task' ? 'Task' : isAck ? 'Notification' : 'Escalation';\n return `${noun} is ${status.replace(/_/g, ' ')}`;\n}\n\nexport function barColorForStatus(status: string, isOpen: boolean): string {\n if (isOpen) return PENDING_CLASS;\n switch (status) {\n case 'completed':\n case 'resolved':\n return 'bg-status-success';\n case 'pending':\n case 'in_progress':\n case 'needs_intervention':\n return 'bg-status-warning';\n case 'cancelled':\n return 'bg-status-error';\n default:\n return 'bg-text-tertiary';\n }\n}\n\nexport function isMcpWorkflow(workflowType: string): boolean {\n return workflowType.startsWith('mcp') || workflowType.startsWith('Mcp');\n}\n\nexport function isAckEscalation(esc: LTEscalationRecord): boolean {\n return !esc.workflow_type;\n}\n\nexport function middleTruncate(str: string, maxLen: number): string {\n if (str.length <= maxLen) return str;\n const keep = Math.floor((maxLen - 1) / 2);\n return `${str.slice(0, keep)}…${str.slice(str.length - keep)}`;\n}\n\nexport function formatAbsoluteTime(iso: string): string {\n const d = new Date(iso);\n return d.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit', second: '2-digit' });\n}\n\n// ── Build lanes from raw task + escalation records ──────────────────────────\n\nexport function buildLanes(\n tasks: LTTaskRecord[],\n escalations: LTEscalationRecord[],\n): { lanes: ProcessLane[]; timeMin: number; timeMax: number } {\n const now = Date.now();\n\n // Group escalations by task_id\n const escByTask = new Map<string, LTEscalationRecord[]>();\n const unlinked: LTEscalationRecord[] = [];\n for (const e of escalations) {\n if (e.task_id) {\n if (!escByTask.has(e.task_id)) escByTask.set(e.task_id, []);\n escByTask.get(e.task_id)!.push(e);\n } else {\n unlinked.push(e);\n }\n }\n\n // Sort tasks by created_at\n const sorted = [...tasks].sort(\n (a, b) => new Date(a.created_at).getTime() - new Date(b.created_at).getTime(),\n );\n\n // Collect all timestamps for axis bounds\n const allTimes: number[] = [];\n for (const t of tasks) {\n allTimes.push(new Date(t.created_at).getTime());\n if (t.completed_at) allTimes.push(new Date(t.completed_at).getTime());\n }\n for (const e of escalations) {\n allTimes.push(new Date(e.created_at).getTime());\n if (e.resolved_at) allTimes.push(new Date(e.resolved_at).getTime());\n if (e.claimed_at) allTimes.push(new Date(e.claimed_at).getTime());\n }\n if (allTimes.length === 0) return { lanes: [], timeMin: 0, timeMax: 1 };\n\n const timeMin = Math.min(...allTimes);\n const hasOpen =\n tasks.some((t) => !t.completed_at) || escalations.some((e) => !e.resolved_at);\n const timeMax = hasOpen ? Math.max(now, Math.max(...allTimes)) : Math.max(...allTimes);\n const span = timeMax - timeMin || 1;\n\n const toPct = (ms: number) => ((ms - timeMin) / span) * 100;\n\n const lanes: ProcessLane[] = [];\n\n for (const task of sorted) {\n const tStart = new Date(task.created_at).getTime();\n const tEnd = task.completed_at ? new Date(task.completed_at).getTime() : now;\n const tOpen = !task.completed_at;\n\n lanes.push({\n kind: 'task',\n id: task.id,\n label: task.workflow_type,\n taskId: task.id,\n startMs: tStart,\n endMs: tEnd,\n startPct: toPct(tStart),\n widthPct: Math.max(((tEnd - tStart) / span) * 100, 0.5),\n durationMs: tEnd - tStart,\n isOpen: tOpen,\n task,\n });\n\n const taskEscs = (escByTask.get(task.id) || []).sort(\n (a, b) => new Date(a.created_at).getTime() - new Date(b.created_at).getTime(),\n );\n for (const esc of taskEscs) {\n const eStart = new Date(esc.created_at).getTime();\n const eEnd = esc.resolved_at ? new Date(esc.resolved_at).getTime() : now;\n const eOpen = !esc.resolved_at;\n\n let claimPct: number | null = null;\n if (esc.claimed_at) {\n const claimMs = new Date(esc.claimed_at).getTime();\n const escSpan = eEnd - eStart || 1;\n claimPct = ((claimMs - eStart) / escSpan) * 100;\n }\n\n lanes.push({\n kind: 'escalation',\n id: esc.id,\n label: esc.role,\n taskId: task.id,\n startMs: eStart,\n endMs: eEnd,\n startPct: toPct(eStart),\n widthPct: Math.max(((eEnd - eStart) / span) * 100, 0.5),\n durationMs: eEnd - eStart,\n isOpen: eOpen,\n escalation: esc,\n claimPct,\n });\n }\n }\n\n // Unlinked escalations at the bottom\n for (const esc of unlinked) {\n const eStart = new Date(esc.created_at).getTime();\n const eEnd = esc.resolved_at ? new Date(esc.resolved_at).getTime() : now;\n let claimPct: number | null = null;\n if (esc.claimed_at) {\n const claimMs = new Date(esc.claimed_at).getTime();\n const escSpan = eEnd - eStart || 1;\n claimPct = ((claimMs - eStart) / escSpan) * 100;\n }\n lanes.push({\n kind: 'escalation',\n id: esc.id,\n label: esc.role,\n taskId: '',\n startMs: eStart,\n endMs: eEnd,\n startPct: toPct(eStart),\n widthPct: Math.max(((eEnd - eStart) / span) * 100, 0.5),\n durationMs: eEnd - eStart,\n isOpen: !esc.resolved_at,\n escalation: esc,\n claimPct,\n });\n }\n\n return { lanes, timeMin, timeMax };\n}\n","import { useState, useEffect, useRef, useCallback } from 'react';\nimport type { ProcessLane } from './helpers';\n\nexport interface BarAnim {\n width: number;\n opacity: number;\n}\n\nexport function useTimelineAnimation(\n laneCount: number,\n timeMin: number,\n timeMax: number,\n durationMs = 500,\n) {\n const [progress, setProgress] = useState(0); // 0 → 1\n const startRef = useRef<number | null>(null);\n const totalSpanMs = timeMax - timeMin || 1;\n\n useEffect(() => {\n if (laneCount === 0) return;\n startRef.current = null;\n setProgress(0);\n\n let raf: number;\n const step = (ts: number) => {\n if (startRef.current === null) startRef.current = ts;\n const elapsed = ts - startRef.current;\n const t = Math.min(elapsed / durationMs, 1);\n // ease-out cubic for a smooth deceleration\n const eased = 1 - Math.pow(1 - t, 3);\n setProgress(eased);\n if (t < 1) raf = requestAnimationFrame(step);\n };\n raf = requestAnimationFrame(step);\n return () => cancelAnimationFrame(raf);\n }, [laneCount, durationMs]);\n\n const animatedBar = useCallback(\n (lane: ProcessLane): BarAnim => {\n const appearAt = (lane.startMs - timeMin) / totalSpanMs;\n const doneAt = (lane.endMs - timeMin) / totalSpanMs;\n\n if (progress < appearAt) {\n return { width: 0, opacity: 0 };\n }\n\n const laneSpan = doneAt - appearAt || 0.001;\n const fill = Math.min((progress - appearAt) / laneSpan, 1);\n const animatedWidth = lane.widthPct * fill;\n const fadeIn = Math.min(fill / 0.1, 1);\n\n return { width: animatedWidth, opacity: fadeIn };\n },\n [progress, timeMin, totalSpanMs],\n );\n\n return { progress, animatedBar };\n}\n","export function ClipboardIcon({ className }: { className?: string }) {\n return (\n <svg className={className} fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={1.5}>\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\" />\n </svg>\n );\n}\n\n/** Sparkle/AI icon for mcp* system workflows */\nexport function SparkleIcon({ className }: { className?: string }) {\n return (\n <svg className={className} fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={1.5}>\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09zM18.259 8.715L18 9.75l-.259-1.035a3.375 3.375 0 00-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 002.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 002.455 2.456L21.75 6l-1.036.259a3.375 3.375 0 00-2.455 2.456zM16.894 20.567L16.5 21.75l-.394-1.183a2.25 2.25 0 00-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 001.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 001.423 1.423l1.183.394-1.183.394a2.25 2.25 0 00-1.423 1.423z\" />\n </svg>\n );\n}\n\n/** Bell icon for notification/ACK escalations */\nexport function BellIcon({ className }: { className?: string }) {\n return (\n <svg className={className} fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={1.5}>\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0\" />\n </svg>\n );\n}\n\nexport function UserIcon({ className }: { className?: string }) {\n return (\n <svg className={className} fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={1.5}>\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z\" />\n </svg>\n );\n}\n","import { ClipboardIcon, SparkleIcon, BellIcon, UserIcon } from './SwimlaneIcons';\n\ninterface SwimlaneHeaderProps {\n allExpanded: boolean;\n onToggleAll: () => void;\n}\n\nexport function SwimlaneHeader({ allExpanded, onToggleAll }: SwimlaneHeaderProps) {\n return (\n <div className=\"flex items-center gap-4 mb-4 flex-wrap\">\n <button onClick={onToggleAll} className=\"text-[10px] text-accent hover:underline\">\n {allExpanded ? 'Collapse all' : 'Expand all'}\n </button>\n\n {/* Legend */}\n <div className=\"flex items-center gap-4 ml-auto\">\n <div className=\"flex items-center gap-1\">\n <ClipboardIcon className=\"w-3.5 h-3.5 text-text-tertiary\" />\n <span className=\"text-[9px] text-text-tertiary\">Task</span>\n </div>\n <div className=\"flex items-center gap-1\">\n <SparkleIcon className=\"w-3.5 h-3.5 text-text-tertiary\" />\n <span className=\"text-[9px] text-text-tertiary\">AI Task</span>\n </div>\n <div className=\"flex items-center gap-1\">\n <UserIcon className=\"w-3.5 h-3.5 text-text-tertiary\" />\n <span className=\"text-[9px] text-text-tertiary\">Escalation</span>\n </div>\n <div className=\"flex items-center gap-1\">\n <BellIcon className=\"w-3.5 h-3.5 text-text-tertiary\" />\n <span className=\"text-[9px] text-text-tertiary\">Notification</span>\n </div>\n <div className=\"flex items-center gap-1\">\n <span className=\"w-2 h-2 rounded-full bg-status-success\" />\n <span className=\"text-[9px] text-text-tertiary\">Done</span>\n </div>\n <div className=\"flex items-center gap-1\">\n <span className=\"w-2 h-2 rounded-full bg-status-warning\" />\n <span className=\"text-[9px] text-text-tertiary\">Active</span>\n </div>\n </div>\n </div>\n );\n}\n","export interface Tick {\n pct: number;\n label: string;\n}\n\ninterface TimeAxisProps {\n ticks: Tick[];\n}\n\nexport function TimeAxis({ ticks }: TimeAxisProps) {\n return (\n <div className=\"flex\">\n <div className=\"w-52 shrink-0\" />\n <div className=\"flex-1 relative h-6 border-b border-surface-border\">\n {ticks.map((tick) => (\n <span\n key={tick.pct}\n className=\"absolute text-[9px] font-mono text-text-tertiary -translate-x-1/2 bottom-1 whitespace-nowrap\"\n style={{ left: `${tick.pct}%` }}\n >\n {tick.label}\n </span>\n ))}\n </div>\n </div>\n );\n}\n","/** Small labeled metric cell used inside detail panels */\nexport function MetricCell({\n label,\n children,\n}: {\n label: string;\n children: React.ReactNode;\n}) {\n return (\n <div>\n <p className=\"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-0.5\">\n {label}\n </p>\n <div className=\"text-xs text-text-primary\">{children}</div>\n </div>\n );\n}\n","import { useState } from 'react';\n\nexport function TraceLink({ traceId, href }: { traceId: string; href?: string }) {\n const [copied, setCopied] = useState(false);\n\n const handleCopy = (e: React.MouseEvent) => {\n e.stopPropagation();\n navigator.clipboard.writeText(traceId);\n setCopied(true);\n setTimeout(() => setCopied(false), 1500);\n };\n\n const handleNav = (e: React.MouseEvent) => {\n e.stopPropagation();\n if (href) window.open(href, '_blank', 'noopener,noreferrer');\n };\n\n return (\n <span className=\"group/trace inline-flex items-center gap-1.5\">\n {href && (\n <button\n onClick={handleNav}\n title=\"Open trace\"\n className=\"opacity-0 group-hover/trace:opacity-100 transition-opacity p-0.5\"\n >\n <svg className=\"w-3 h-3 text-text-tertiary hover:text-accent\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={2}>\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-4.5-4.5h6m0 0v6m0-6L10.5 15\" />\n </svg>\n </button>\n )}\n <button\n onClick={handleCopy}\n title=\"Copy trace ID\"\n className=\"opacity-0 group-hover/trace:opacity-100 transition-opacity p-0.5\"\n >\n <svg\n className={`w-3 h-3 transition-colors ${copied ? 'text-status-success' : 'text-text-tertiary hover:text-accent'}`}\n fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={2}\n >\n {copied\n ? <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M5 13l4 4L19 7\" />\n : <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3\" />\n }\n </svg>\n </button>\n <span className=\"text-[11px] text-accent\">Trace Details</span>\n </span>\n );\n}\n","import { Link } from 'react-router-dom';\nimport { StatusBadge } from '../../../components/common/display/StatusBadge';\nimport { WorkflowPill } from '../../../components/common/display/WorkflowPill';\nimport { TimestampCell } from '../../../components/common/display/TimestampCell';\nimport { DurationValue } from '../../../components/common/display/DurationValue';\nimport type { LTTaskRecord } from '../../../api/types';\nimport { MetricCell } from './MetricCell';\nimport { TraceLink } from './TraceLink';\n\nexport function TaskDetailPanel({\n task,\n traceUrl,\n}: {\n task: LTTaskRecord;\n traceUrl?: string | null;\n}) {\n const elapsed = task.completed_at\n ? new Date(task.completed_at).getTime() - new Date(task.created_at).getTime()\n : Date.now() - new Date(task.created_at).getTime();\n\n return (\n <div className=\"grid grid-cols-[3fr_1fr] gap-6\">\n {/* Left: timing metrics */}\n <div className=\"space-y-4\">\n <div className=\"flex items-center gap-3\">\n <StatusBadge status={task.status} />\n <WorkflowPill type={task.workflow_type} />\n </div>\n\n <div className=\"grid grid-cols-3 gap-4\">\n <MetricCell label=\"Started\">\n <TimestampCell date={task.created_at} />\n </MetricCell>\n\n <MetricCell label=\"Completed\">\n {task.completed_at ? (\n <TimestampCell date={task.completed_at} />\n ) : (\n <span className=\"text-text-tertiary italic text-xs\">In progress</span>\n )}\n </MetricCell>\n\n <MetricCell label=\"Duration\">\n <DurationValue ms={elapsed} className=\"font-mono text-sm\" />\n </MetricCell>\n </div>\n\n {task.milestones.length > 0 && (\n <div>\n <p className=\"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1.5\">\n Milestones\n </p>\n <div className=\"flex flex-wrap gap-1.5\">\n {task.milestones.map((m, i) => (\n <span\n key={i}\n className=\"px-2 py-0.5 text-[10px] font-mono bg-accent-faint/50 rounded text-text-secondary\"\n >\n {m.name}: {String(m.value)}\n </span>\n ))}\n </div>\n </div>\n )}\n </div>\n\n {/* Right: links */}\n <div className=\"flex flex-col items-end gap-2\">\n <Link\n to={`/workflows/executions/${encodeURIComponent(task.workflow_id)}`}\n className=\"block text-[11px] text-accent hover:underline\"\n >\n Execution Details\n </Link>\n <Link\n to={`/workflows/tasks/detail/${task.id}`}\n className=\"block text-[11px] text-accent hover:underline\"\n >\n Task Details\n </Link>\n {task.trace_id && (\n <TraceLink\n traceId={task.trace_id}\n href={traceUrl ? traceUrl.replace('{traceId}', task.trace_id) : undefined}\n />\n )}\n </div>\n </div>\n );\n}\n","import { Link } from 'react-router-dom';\nimport { StatusBadge } from '../../../components/common/display/StatusBadge';\nimport { RolePill } from '../../../components/common/display/RolePill';\nimport { UserName } from '../../../components/common/display/UserName';\nimport { TimestampCell } from '../../../components/common/display/TimestampCell';\nimport { DurationValue } from '../../../components/common/display/DurationValue';\nimport type { LTEscalationRecord } from '../../../api/types';\nimport { MetricCell } from './MetricCell';\n\nexport function EscalationDetailPanel({\n escalation,\n}: {\n escalation: LTEscalationRecord;\n}) {\n const created = new Date(escalation.created_at).getTime();\n const claimedMs = escalation.claimed_at\n ? new Date(escalation.claimed_at).getTime() - created\n : null;\n const resolvedMs = escalation.resolved_at\n ? new Date(escalation.resolved_at).getTime() - created\n : null;\n\n return (\n <div className=\"grid grid-cols-[3fr_1fr] gap-6\">\n {/* Left: timing metrics */}\n <div className=\"space-y-4\">\n <div className=\"flex items-center gap-3\">\n <StatusBadge status={escalation.status} />\n <RolePill role={escalation.role} />\n {escalation.type && (\n <span className=\"text-[10px] text-text-tertiary\">\n {escalation.type}\n {escalation.subtype ? ` / ${escalation.subtype}` : ''}\n </span>\n )}\n </div>\n\n <div className=\"grid grid-cols-3 gap-4\">\n <MetricCell label=\"Created\">\n <TimestampCell date={escalation.created_at} />\n </MetricCell>\n\n <MetricCell label=\"Claimed\">\n {escalation.claimed_at ? (\n <>\n <TimestampCell date={escalation.claimed_at} />\n <p className=\"text-[10px] text-text-tertiary mt-0.5\">\n after <DurationValue ms={claimedMs} />\n {escalation.assigned_to && (\n <>\n {' '}by{' '}\n <span className=\"text-text-secondary font-medium\">\n <UserName userId={escalation.assigned_to} />\n </span>\n </>\n )}\n </p>\n </>\n ) : (\n <span className=\"text-text-tertiary italic text-xs\">Unclaimed</span>\n )}\n </MetricCell>\n\n <MetricCell label=\"Resolved\">\n {escalation.resolved_at ? (\n <>\n <TimestampCell date={escalation.resolved_at} />\n <p className=\"text-[10px] text-text-tertiary mt-0.5\">\n <DurationValue ms={resolvedMs} /> total\n </p>\n </>\n ) : (\n <span className=\"text-text-tertiary italic text-xs\">Pending</span>\n )}\n </MetricCell>\n </div>\n\n {escalation.description && (\n <div>\n <p className=\"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1\">\n Description\n </p>\n <p className=\"text-[11px] text-text-secondary leading-relaxed\">\n {escalation.description}\n </p>\n </div>\n )}\n </div>\n\n {/* Right: links */}\n <div className=\"flex flex-col items-end gap-2\">\n {escalation.workflow_id && (\n <Link\n to={`/workflows/executions/${encodeURIComponent(escalation.workflow_id)}`}\n className=\"block text-[11px] text-accent hover:underline\"\n >\n Execution Details\n </Link>\n )}\n <Link\n to={`/escalations/detail/${escalation.id}`}\n className=\"block text-[11px] text-accent hover:underline\"\n >\n Escalation Details\n </Link>\n </div>\n </div>\n );\n}\n","import { Collapsible } from '../../../components/common/layout/Collapsible';\nimport { formatDuration } from '../../../lib/format';\nimport {\n taskStatusColor,\n escStatusColor,\n statusLabel,\n barColorForStatus,\n isMcpWorkflow,\n isAckEscalation,\n middleTruncate,\n} from './helpers';\nimport type { ProcessLane } from './helpers';\nimport type { BarAnim } from './useTimelineAnimation';\nimport type { Tick } from './TimeAxis';\nimport { ClipboardIcon, SparkleIcon, BellIcon, UserIcon } from './SwimlaneIcons';\nimport { TaskDetailPanel } from './TaskDetailPanel';\nimport { EscalationDetailPanel } from './EscalationDetailPanel';\n\ninterface SwimlaneRowProps {\n lane: ProcessLane;\n ticks: Tick[];\n isExpanded: boolean;\n onToggle: () => void;\n anim: BarAnim;\n animDone: boolean;\n traceUrl?: string | null;\n}\n\nexport function SwimlaneRow({\n lane,\n ticks,\n isExpanded,\n onToggle,\n anim,\n animDone,\n traceUrl,\n}: SwimlaneRowProps) {\n const isTask = lane.kind === 'task';\n const status = isTask ? lane.task!.status : lane.escalation!.status;\n const barBase = barColorForStatus(status, lane.isOpen);\n const visible = anim.opacity > 0;\n\n return (\n <div>\n {/* Lane row */}\n <div\n className=\"flex items-center border-b border-surface-border cursor-pointer hover:bg-surface-sunken/40 transition-colors\"\n onClick={onToggle}\n >\n {/* Label column */}\n <div\n className={`w-52 shrink-0 py-3 pr-4 flex items-center gap-2 ${\n isTask ? '' : 'pl-6'\n }`}\n style={{ opacity: visible ? 1 : 0, transition: 'opacity 0.15s ease-out' }}\n >\n {isTask ? (\n isMcpWorkflow(lane.task!.workflow_type) ? (\n <SparkleIcon\n className={`w-4 h-4 shrink-0 ${taskStatusColor(lane.task!.status)}`}\n />\n ) : (\n <ClipboardIcon\n className={`w-4 h-4 shrink-0 ${taskStatusColor(lane.task!.status)}`}\n />\n )\n ) : isAckEscalation(lane.escalation!) ? (\n <BellIcon\n className={`w-4 h-4 shrink-0 ${escStatusColor(lane.escalation!.status)}`}\n />\n ) : (\n <UserIcon\n className={`w-4 h-4 shrink-0 ${escStatusColor(lane.escalation!.status)}`}\n />\n )}\n <p\n className=\"text-xs font-mono text-text-secondary whitespace-nowrap overflow-hidden\"\n title={statusLabel(lane.kind, isTask ? lane.task!.status : lane.escalation!.status, !isTask && isAckEscalation(lane.escalation!))}\n >\n {isTask\n ? middleTruncate(lane.label, 24)\n : middleTruncate(lane.escalation?.role ?? lane.label, 20)}\n </p>\n </div>\n\n {/* Bar area */}\n <div className=\"flex-1 relative h-10\">\n {/* Tick gridlines */}\n {ticks.map((tick) => (\n <div\n key={tick.pct}\n className=\"absolute top-0 bottom-0 w-px bg-surface-border opacity-30\"\n style={{ left: `${tick.pct}%` }}\n />\n ))}\n\n {/* Duration bar (animated reveal + grow) */}\n <div\n className={`absolute top-2 h-6 rounded-sm ${\n isExpanded\n ? `${barBase} ring-2 ring-accent ring-offset-1`\n : `${barBase} hover:opacity-80`\n }`}\n style={{\n left: `${lane.startPct}%`,\n width: visible ? `${Math.max(anim.width, 0.3)}%` : '0%',\n minWidth: visible ? '4px' : '0px',\n opacity: anim.opacity,\n }}\n title={`${lane.label} — ${formatDuration(lane.durationMs)} — ${new Date(lane.startMs).toLocaleTimeString()}`}\n >\n {/* Duration text inside bar (show only when fully revealed) */}\n {anim.width > 8 && animDone && (\n <span className=\"absolute inset-0 flex items-center px-1.5 text-[9px] font-mono text-white truncate\">\n {formatDuration(lane.durationMs)}\n </span>\n )}\n\n {/* Claim marker (vertical dashed line) — show after animation */}\n {lane.claimPct != null && animDone && (\n <div\n className=\"absolute top-0 bottom-0 w-px border-l border-dashed border-white/70\"\n style={{ left: `${lane.claimPct}%` }}\n title={\n lane.escalation?.assigned_to\n ? `Claimed by ${lane.escalation.assigned_to}`\n : 'Claimed'\n }\n >\n {/* Claim dot */}\n <div className=\"absolute -top-1 -left-[3px] w-[7px] h-[7px] rounded-full bg-white border border-amber-600\" />\n </div>\n )}\n </div>\n </div>\n </div>\n\n {/* Expandable detail panel */}\n <Collapsible open={isExpanded}>\n <div className=\"py-4 px-6 pl-52 border-b border-surface-border bg-surface-sunken/20\">\n {isTask && lane.task ? (\n <TaskDetailPanel task={lane.task} traceUrl={traceUrl} />\n ) : lane.escalation ? (\n <EscalationDetailPanel escalation={lane.escalation} />\n ) : null}\n </div>\n </Collapsible>\n </div>\n );\n}\n","import { useState, useMemo } from 'react';\nimport { formatDuration } from '../../../lib/format';\nimport { buildLanes } from './helpers';\nimport type { ProcessSwimlaneTimelineProps } from './helpers';\nimport { useTimelineAnimation } from './useTimelineAnimation';\nimport { SwimlaneHeader } from './SwimlaneHeader';\nimport { TimeAxis } from './TimeAxis';\nimport { SwimlaneRow } from './SwimlaneRow';\n\nexport function ProcessSwimlaneTimeline({\n tasks,\n escalations,\n traceUrl,\n}: ProcessSwimlaneTimelineProps) {\n const [expanded, setExpanded] = useState<Set<string>>(new Set());\n\n const { lanes, timeMin, timeMax } = useMemo(\n () => buildLanes(tasks, escalations),\n [tasks, escalations],\n );\n\n const totalSpanMs = timeMax - timeMin || 1;\n const { progress, animatedBar } = useTimelineAnimation(lanes.length, timeMin, timeMax);\n\n if (lanes.length === 0) {\n return (\n <p className=\"text-sm text-text-tertiary py-8 text-center\">\n No events in this process.\n </p>\n );\n }\n\n // Time axis ticks\n const tickCount = 5;\n const ticks = Array.from({ length: tickCount + 1 }, (_, i) => ({\n pct: (i / tickCount) * 100,\n label: formatDuration(Math.round((i / tickCount) * totalSpanMs)),\n }));\n\n const toggle = (id: string) => {\n setExpanded((prev) => {\n const next = new Set(prev);\n if (next.has(id)) next.delete(id);\n else next.add(id);\n return next;\n });\n };\n\n const allIds = lanes.map((l) => l.id);\n const allExpanded = allIds.length > 0 && allIds.every((id) => expanded.has(id));\n const toggleAll = () => {\n if (allExpanded) setExpanded(new Set());\n else setExpanded(new Set(allIds));\n };\n\n const animDone = progress >= 1;\n\n return (\n <div className=\"py-2\">\n <SwimlaneHeader allExpanded={allExpanded} onToggleAll={toggleAll} />\n <TimeAxis ticks={ticks} />\n\n {lanes.map((lane) => (\n <SwimlaneRow\n key={`${lane.kind}-${lane.id}`}\n lane={lane}\n ticks={ticks}\n isExpanded={expanded.has(lane.id)}\n onToggle={() => toggle(lane.id)}\n anim={animatedBar(lane)}\n animDone={animDone}\n traceUrl={traceUrl}\n />\n ))}\n </div>\n );\n}\n","import { useMemo } from 'react';\nimport { useParams } from 'react-router-dom';\nimport { useProcessDetail } from '../../api/tasks';\nimport { useProcessDetailEvents } from '../../hooks/useEventHooks';\nimport { useSettings } from '../../api/settings';\nimport { PageHeaderWithStats, type InlineStat } from '../../components/common/layout/PageHeaderWithStats';\nimport { SectionLabel } from '../../components/common/layout/SectionLabel';\nimport { JsonViewer } from '../../components/common/data/JsonViewer';\nimport { ProcessSwimlaneTimeline } from './process-swimlane/ProcessSwimlaneTimeline';\nimport { formatElapsed } from '../../lib/format';\nimport type { LTTaskRecord } from '../../api/types';\n\nfunction safeParseJson(raw: string | null | undefined): Record<string, unknown> | null {\n if (!raw) return null;\n try { return JSON.parse(raw); } catch { return null; }\n}\n\nfunction extractRootTask(tasks: LTTaskRecord[]): LTTaskRecord | null {\n if (tasks.length === 0) return null;\n return [...tasks].sort(\n (a, b) => new Date(a.created_at).getTime() - new Date(b.created_at).getTime(),\n )[0];\n}\n\nexport function ProcessDetailPage() {\n const { originId } = useParams<{ originId: string }>();\n useProcessDetailEvents(originId);\n const { data, isLoading } = useProcessDetail(originId ?? '');\n const { data: settings } = useSettings();\n const traceUrl = settings?.telemetry?.traceUrl ?? null;\n\n const tasks = data?.tasks ?? [];\n const escalations = data?.escalations ?? [];\n\n const rootTask = useMemo(() => extractRootTask(tasks), [tasks]);\n const rootEnvelope = useMemo(() => safeParseJson(rootTask?.envelope), [rootTask]);\n const rootResult = useMemo(() => {\n if (rootTask?.data) return safeParseJson(rootTask.data);\n const completed = tasks\n .filter((t) => t.status === 'completed' && t.data)\n .sort((a, b) => new Date(b.completed_at!).getTime() - new Date(a.completed_at!).getTime());\n return completed.length > 0 ? safeParseJson(completed[0].data) : null;\n }, [rootTask, tasks]);\n\n const isRunning = useMemo(() => {\n return tasks.length > 0 && tasks.some(\n (t) => t.status !== 'completed' && t.status !== 'cancelled',\n );\n }, [tasks]);\n\n const stats = useMemo(() => {\n const completed = tasks.filter((t) => t.status === 'completed').length;\n const escalated = tasks.filter((t) => t.status === 'needs_intervention').length;\n const resolved = escalations.filter((e) => e.status === 'resolved').length;\n return { tasks: tasks.length, completed, escalated, escalations: escalations.length, resolved };\n }, [tasks, escalations]);\n\n const duration = useMemo(() => {\n if (tasks.length === 0 && escalations.length === 0) return null;\n const allDates = [\n ...tasks.map((t) => t.created_at),\n ...escalations.map((e) => e.created_at),\n ].sort();\n const startIso = allDates[0];\n const allCompleted = tasks.every((t) => t.status === 'completed' || t.status === 'cancelled');\n const allResolved = escalations.every((e) => e.status === 'resolved');\n const isFinished = tasks.length > 0 && allCompleted && allResolved;\n const endIso = isFinished\n ? [...tasks.map((t) => t.completed_at), ...escalations.map((e) => e.resolved_at)]\n .filter(Boolean)\n .sort()\n .pop() ?? null\n : null;\n return { startIso, endIso, isFinished, elapsed: formatElapsed(startIso, endIso) };\n }, [tasks, escalations]);\n\n const inlineStats = useMemo<InlineStat[]>(() => {\n const items: InlineStat[] = [];\n if (duration) {\n items.push({\n label: duration.isFinished ? 'Completed' : 'Running',\n value: duration.elapsed,\n dotClass: duration.isFinished ? 'bg-status-success' : 'bg-status-pending animate-pulse',\n });\n }\n items.push(\n { label: 'Tasks', value: `${stats.completed}/${stats.tasks}` },\n { label: 'Escalations', value: `${stats.resolved}/${stats.escalations}` },\n );\n return items;\n }, [duration, stats]);\n\n if (isLoading && tasks.length === 0) {\n return (\n <div className=\"animate-pulse space-y-4\">\n <div className=\"h-8 bg-surface-sunken rounded w-48\" />\n <div className=\"h-40 bg-surface-sunken rounded\" />\n </div>\n );\n }\n\n const hasMessages = rootEnvelope || rootResult || isRunning;\n\n return (\n <div>\n <PageHeaderWithStats\n title=\"Process Detail\"\n docsHash=\"#docs:dashboard.md:process-detail\"\n subtitle={originId}\n stats={inlineStats}\n />\n\n {hasMessages && (\n <div className=\"grid grid-cols-1 lg:grid-cols-2 gap-8 mb-10\">\n <div>\n {rootEnvelope ? (\n <JsonViewer data={rootEnvelope} label=\"Input\" defaultMode=\"json\" defaultCollapsed />\n ) : (\n <div>\n <SectionLabel>Input</SectionLabel>\n <div className=\"font-mono text-xs bg-surface-sunken rounded-md p-4 text-text-tertiary italic mt-2\">\n Waiting for task...\n </div>\n </div>\n )}\n </div>\n <div>\n {rootResult ? (\n <JsonViewer data={rootResult} label=\"Output\" defaultMode=\"json\" defaultCollapsed />\n ) : isRunning ? (\n <div>\n <SectionLabel>Output</SectionLabel>\n <div className=\"flex items-center gap-2 font-mono text-xs bg-surface-sunken rounded-md p-4 text-text-secondary mt-2\">\n <span className=\"w-1.5 h-1.5 rounded-full bg-status-pending animate-pulse\" />\n Processing...\n </div>\n </div>\n ) : null}\n </div>\n </div>\n )}\n\n <SectionLabel className=\"mb-6\">Timeline</SectionLabel>\n\n <ProcessSwimlaneTimeline\n tasks={tasks}\n escalations={escalations}\n traceUrl={traceUrl}\n />\n </div>\n );\n}\n"],"names":["PENDING_CLASS","taskStatusColor","status","escStatusColor","statusLabel","kind","isAck","barColorForStatus","isOpen","isMcpWorkflow","workflowType","isAckEscalation","esc","middleTruncate","str","maxLen","keep","buildLanes","tasks","escalations","now","escByTask","unlinked","e","sorted","a","b","allTimes","t","timeMin","timeMax","span","toPct","ms","lanes","task","tStart","tEnd","tOpen","taskEscs","eStart","eEnd","eOpen","claimPct","claimMs","escSpan","useTimelineAnimation","laneCount","durationMs","progress","setProgress","useState","startRef","useRef","totalSpanMs","useEffect","raf","step","ts","elapsed","eased","animatedBar","useCallback","lane","appearAt","doneAt","laneSpan","fill","animatedWidth","fadeIn","ClipboardIcon","className","jsx","SparkleIcon","BellIcon","UserIcon","SwimlaneHeader","allExpanded","onToggleAll","jsxs","TimeAxis","ticks","tick","MetricCell","label","children","TraceLink","traceId","href","copied","setCopied","handleCopy","handleNav","TaskDetailPanel","traceUrl","StatusBadge","WorkflowPill","TimestampCell","DurationValue","m","i","Link","EscalationDetailPanel","escalation","created","claimedMs","resolvedMs","RolePill","Fragment","UserName","SwimlaneRow","isExpanded","onToggle","anim","animDone","isTask","barBase","visible","_a","formatDuration","_b","Collapsible","ProcessSwimlaneTimeline","expanded","setExpanded","useMemo","tickCount","_","toggle","id","prev","next","allIds","l","toggleAll","safeParseJson","raw","extractRootTask","ProcessDetailPage","originId","useParams","useProcessDetailEvents","data","isLoading","useProcessDetail","settings","useSettings","rootTask","rootEnvelope","rootResult","completed","isRunning","stats","escalated","resolved","duration","startIso","allCompleted","allResolved","isFinished","endIso","formatElapsed","inlineStats","items","hasMessages","PageHeaderWithStats","JsonViewer","SectionLabel"],"mappings":"8mBA0BO,MAAMA,GAAgB,sCAEtB,SAASC,EAAgBC,EAA8B,CAC5D,OAAQA,EAAA,CACN,IAAK,YAAa,MAAO,sBACzB,IAAK,cAAe,IAAK,UAAW,MAAO,sBAC3C,IAAK,qBAAsB,MAAO,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GAAa,SAAA,OAAA,CAAK,EACnB/F,EAAAA,IAAC,MAAA,CAAI,UAAU,oFAAoF,SAAA,qBAAA,CAEnG,CAAA,CAAA,CACF,CAAA,CAEJ,QACC,MAAA,CACE,SAAA6E,EACC7E,EAAAA,IAAC8F,EAAA,CAAW,KAAMjB,EAAY,MAAM,SAAS,YAAY,OAAO,iBAAgB,EAAA,CAAC,EAC/EE,SACD,MAAA,CACC,SAAA,CAAA/E,EAAAA,IAAC+F,GAAa,SAAA,QAAA,CAAM,EACpBxF,EAAAA,KAAC,MAAA,CAAI,UAAU,sGACb,SAAA,CAAAP,EAAAA,IAAC,OAAA,CAAK,UAAU,0DAAA,CAA2D,EAAE,eAAA,CAAA,CAE/E,CAAA,CAAA,CACF,EACE,IAAA,CACN,CAAA,EACF,EAGFA,EAAAA,IAAC+F,EAAA,CAAa,UAAU,OAAO,SAAA,WAAQ,EAEvC/F,EAAAA,IAACkD,GAAA,CACC,MAAAxG,EACA,YAAAC,EACA,SAAA2E,CAAA,CAAA,CACF,EACF,CAEJ"}
|
package/dashboard/dist/assets/{ProcessesListPage-CrLGDCAD.js → ProcessesListPage-BrqWR2zr.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as s}from"./vendor-query-B2UbickB.js";import{u as x}from"./tasks-
|
|
2
|
-
//# sourceMappingURL=ProcessesListPage-
|
|
1
|
+
import{j as s}from"./vendor-query-B2UbickB.js";import{u as x}from"./tasks-DcSvF636.js";import{u as h}from"./workflows-CkPv7xk-.js";import{u as w}from"./useEventHooks-DcIgMDh3.js";import{u as k}from"./useFilterParams-x-Dg0Vgz.js";import{u as y}from"./useDebouncedValue-BA5S7V54.js";import{b as v}from"./api-path-u2Jf9QXS.js";import{D as _}from"./DataTable-ZWgVQg7F.js";import{T as c}from"./TimestampCell-7G0echgP.js";import{S as b}from"./StickyPagination-D8XuMSWD.js";import{F as j,a as P,b as p}from"./FilterBar-BQ2JGg8U.js";import{P as S}from"./PageHeader-BhaWTWcM.js";import{L as N}from"./ListToolbar-FpcvqNkN.js";import{W as C}from"./WorkflowPill-IDjTRfQ8.js";import{c as T}from"./vendor-react-CXumBFUA.js";import"./index-Dgw1KKpq.js";import"./vendor-icons-CEWCGPeJ.js";import"./EmptyState-BcsfPq9T.js";const F=[{value:"active",label:"Active"},{value:"completed",label:"Completed"},{value:"escalated",label:"Escalated"}],z=[{key:"origin_id",label:"Origin",render:e=>s.jsx("span",{className:"font-mono text-xs",title:e.origin_id,children:e.origin_id.length>40?`${e.origin_id.slice(0,40)}…`:e.origin_id})},{key:"workflow_types",label:"Workflows",render:e=>s.jsx("div",{className:"flex flex-wrap gap-1",children:e.workflow_types.map(a=>s.jsx(C,{type:a},a))})},{key:"task_count",label:"Tasks",render:e=>s.jsx("span",{children:e.task_count}),className:"w-20 text-right"},{key:"completed",label:"Completed",render:e=>e.completed>0?s.jsx("span",{className:"text-status-success",children:e.completed}):s.jsx("span",{className:"text-text-tertiary",children:"0"}),className:"w-24 text-right"},{key:"escalated",label:"Escalated",render:e=>e.escalated>0?s.jsx("span",{className:"text-status-error",children:e.escalated}):s.jsx("span",{className:"text-text-tertiary",children:"0"}),className:"w-24 text-right"},{key:"started_at",label:"Started",render:e=>s.jsx(c,{date:e.started_at}),className:"w-44"},{key:"last_activity",label:"Last Activity",render:e=>s.jsx(c,{date:e.last_activity}),className:"w-44"}];function Q(){w();const e=T(),{filters:a,setFilter:i,pagination:o}=k({filters:{workflow_type:"",status:"",search:""}}),l=y(a.search,300),{data:m}=h(),d=[...new Set((m??[]).map(t=>t.workflow_type))].sort(),{data:r,isLoading:f,refetch:g,isFetching:u}=x({workflow_type:a.workflow_type||void 0,status:a.status||void 0,search:l||void 0,limit:o.pageSize,offset:o.offset}),n=(r==null?void 0:r.total)??0;return s.jsxs("div",{children:[s.jsx(S,{title:"All Processes",docsHash:"#docs:dashboard.md:processes-overview"}),s.jsxs(j,{actions:s.jsx(N,{onRefresh:()=>g(),isFetching:u,apiPath:v("/tasks/processes",{limit:o.pageSize,offset:o.offset,workflow_type:a.workflow_type||void 0,status:a.status||void 0,search:l||void 0})}),children:[s.jsx(P,{label:"Search",value:a.search,onChange:t=>i("search",t),placeholder:"origin, workflow, or trace ID"}),s.jsx(p,{label:"Status",value:a.status,onChange:t=>i("status",t),options:F}),s.jsx(p,{label:"Workflow Type",value:a.workflow_type,onChange:t=>i("workflow_type",t),options:d.map(t=>({value:t,label:t}))})]}),s.jsx(_,{columns:z,data:(r==null?void 0:r.processes)??[],keyFn:t=>t.origin_id,onRowClick:t=>e(`/processes/detail/${encodeURIComponent(t.origin_id)}`),isLoading:f,emptyMessage:"No business processes found"}),s.jsx(b,{page:o.page,totalPages:o.totalPages(n),onPageChange:o.setPage,total:n,pageSize:o.pageSize,onPageSizeChange:o.setPageSize})]})}export{Q as ProcessesListPage};
|
|
2
|
+
//# sourceMappingURL=ProcessesListPage-BrqWR2zr.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProcessesListPage-
|
|
1
|
+
{"version":3,"file":"ProcessesListPage-BrqWR2zr.js","sources":["../../src/pages/processes/ProcessesListPage.tsx"],"sourcesContent":["import { useNavigate } from 'react-router-dom';\nimport { useProcesses, type ProcessSummary } from '../../api/tasks';\nimport { useWorkflowConfigs } from '../../api/workflows';\nimport { useProcessListEvents } from '../../hooks/useEventHooks';\nimport { useFilterParams } from '../../hooks/useFilterParams';\nimport { useDebouncedValue } from '../../hooks/useDebouncedValue';\nimport { buildApiPath } from '../../lib/api-path';\nimport { DataTable, type Column } from '../../components/common/data/DataTable';\nimport { TimestampCell } from '../../components/common/display/TimestampCell';\nimport { StickyPagination } from '../../components/common/data/StickyPagination';\nimport { FilterBar, FilterSelect, FilterInput } from '../../components/common/data/FilterBar';\nimport { PageHeader } from '../../components/common/layout/PageHeader';\nimport { ListToolbar } from '../../components/common/data/ListToolbar';\nimport { WorkflowPill } from '../../components/common/display/WorkflowPill';\n\nconst STATUS_OPTIONS = [\n { value: 'active', label: 'Active' },\n { value: 'completed', label: 'Completed' },\n { value: 'escalated', label: 'Escalated' },\n];\n\nconst columns: Column<ProcessSummary>[] = [\n {\n key: 'origin_id',\n label: 'Origin',\n render: (row) => (\n <span className=\"font-mono text-xs\" title={row.origin_id}>\n {row.origin_id.length > 40 ? `${row.origin_id.slice(0, 40)}…` : row.origin_id}\n </span>\n ),\n },\n {\n key: 'workflow_types',\n label: 'Workflows',\n render: (row) => (\n <div className=\"flex flex-wrap gap-1\">\n {row.workflow_types.map((wt) => (\n <WorkflowPill key={wt} type={wt} />\n ))}\n </div>\n ),\n },\n {\n key: 'task_count',\n label: 'Tasks',\n render: (row) => <span>{row.task_count}</span>,\n className: 'w-20 text-right',\n },\n {\n key: 'completed',\n label: 'Completed',\n render: (row) =>\n row.completed > 0\n ? <span className=\"text-status-success\">{row.completed}</span>\n : <span className=\"text-text-tertiary\">0</span>,\n className: 'w-24 text-right',\n },\n {\n key: 'escalated',\n label: 'Escalated',\n render: (row) =>\n row.escalated > 0\n ? <span className=\"text-status-error\">{row.escalated}</span>\n : <span className=\"text-text-tertiary\">0</span>,\n className: 'w-24 text-right',\n },\n {\n key: 'started_at',\n label: 'Started',\n render: (row) => <TimestampCell date={row.started_at} />,\n className: 'w-44',\n },\n {\n key: 'last_activity',\n label: 'Last Activity',\n render: (row) => <TimestampCell date={row.last_activity} />,\n className: 'w-44',\n },\n];\n\nexport function ProcessesListPage() {\n useProcessListEvents();\n const navigate = useNavigate();\n const { filters, setFilter, pagination } = useFilterParams({\n filters: { workflow_type: '', status: '', search: '' },\n });\n\n const debouncedSearch = useDebouncedValue(filters.search, 300);\n\n const { data: configs } = useWorkflowConfigs();\n const workflowTypes = [...new Set((configs ?? []).map((c) => c.workflow_type))].sort();\n\n const { data, isLoading, refetch, isFetching } = useProcesses({\n workflow_type: filters.workflow_type || undefined,\n status: filters.status || undefined,\n search: debouncedSearch || undefined,\n limit: pagination.pageSize,\n offset: pagination.offset,\n });\n\n const total = data?.total ?? 0;\n\n return (\n <div>\n <PageHeader title=\"All Processes\" docsHash=\"#docs:dashboard.md:processes-overview\" />\n\n <FilterBar actions={\n <ListToolbar\n onRefresh={() => refetch()}\n isFetching={isFetching}\n apiPath={buildApiPath('/tasks/processes', {\n limit: pagination.pageSize,\n offset: pagination.offset,\n workflow_type: filters.workflow_type || undefined,\n status: filters.status || undefined,\n search: debouncedSearch || undefined,\n })}\n />\n }>\n <FilterInput\n label=\"Search\"\n value={filters.search}\n onChange={(v) => setFilter('search', v)}\n placeholder=\"origin, workflow, or trace ID\"\n />\n <FilterSelect\n label=\"Status\"\n value={filters.status}\n onChange={(v) => setFilter('status', v)}\n options={STATUS_OPTIONS}\n />\n <FilterSelect\n label=\"Workflow Type\"\n value={filters.workflow_type}\n onChange={(v) => setFilter('workflow_type', v)}\n options={workflowTypes.map((t) => ({ value: t, label: t }))}\n />\n </FilterBar>\n\n <DataTable\n columns={columns}\n data={data?.processes ?? []}\n keyFn={(row) => row.origin_id}\n onRowClick={(row) => navigate(`/processes/detail/${encodeURIComponent(row.origin_id)}`)}\n isLoading={isLoading}\n emptyMessage=\"No business processes found\"\n />\n\n <StickyPagination\n page={pagination.page}\n totalPages={pagination.totalPages(total)}\n onPageChange={pagination.setPage}\n total={total}\n pageSize={pagination.pageSize}\n onPageSizeChange={pagination.setPageSize}\n />\n </div>\n );\n}\n"],"names":["STATUS_OPTIONS","columns","row","jsx","wt","WorkflowPill","TimestampCell","ProcessesListPage","useProcessListEvents","navigate","useNavigate","filters","setFilter","pagination","useFilterParams","debouncedSearch","useDebouncedValue","configs","useWorkflowConfigs","workflowTypes","c","data","isLoading","refetch","isFetching","useProcesses","total","PageHeader","jsxs","FilterBar","ListToolbar","buildApiPath","FilterInput","v","FilterSelect","DataTable","StickyPagination"],"mappings":"syBAeA,MAAMA,EAAiB,CACrB,CAAE,MAAO,SAAU,MAAO,QAAA,EAC1B,CAAE,MAAO,YAAa,MAAO,WAAA,EAC7B,CAAE,MAAO,YAAa,MAAO,W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AAA,CAAA,CAC5D,EACF,EAEAhB,EAAAA,IAACgC,EAAA,CACC,QAAAlC,EACA,MAAMoB,GAAA,YAAAA,EAAM,YAAa,CAAA,EACzB,MAAQnB,GAAQA,EAAI,UACpB,WAAaA,GAAQO,EAAS,qBAAqB,mBAAmBP,EAAI,SAAS,CAAC,EAAE,EACtF,UAAAoB,EACA,aAAa,6BAAA,CAAA,EAGfnB,EAAAA,IAACiC,EAAA,CACC,KAAMvB,EAAW,KACjB,WAAYA,EAAW,WAAWa,CAAK,EACvC,aAAcb,EAAW,QACzB,MAAAa,EACA,SAAUb,EAAW,SACrB,iBAAkBA,EAAW,WAAA,CAAA,CAC/B,EACF,CAEJ"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{j as e,a as m}from"./vendor-query-B2UbickB.js";import{b as X,f as L,g as Y,e as Z,h as ee,i as te}from"./roles-CFD2eYap.js";import{J as U}from"./index-Dgw1KKpq.js";import{C as se}from"./ConfirmDeleteModal-D9_1b4MW.js";import{u as ae}from"./users-C0WV36X8.js";import{T as $,B as re,v as B,V as ne,p as oe,as as le,N as ie,f as ce,g as J}from"./vendor-icons-CEWCGPeJ.js";import{e as de,c as xe,L as pe}from"./vendor-react-CXumBFUA.js";import"./Modal-CSrxpXeM.js";function me({role:a}){const{data:d}=ae({role:a,limit:100}),n=(d==null?void 0:d.users)??[];return n.length===0?e.jsx("p",{className:"text-[11px] text-text-tertiary",children:"Assign users to this role to staff its queue. Members see and resolve escalations here according to their read/write scope; admins manage the role itself."}):e.jsx("div",{className:"divide-y divide-surface-border/40",children:n.map(i=>{const p=i.roles.find(c=>c.role===a);return p?e.jsxs("div",{className:"flex items-center justify-between py-1.5 gap-2",children:[e.jsx("span",{className:"text-xs text-text-secondary truncate",children:i.display_name||i.external_id}),e.jsx("span",{className:"text-[10px] text-text-quaternary font-mono shrink-0",children:ue(p)})]},i.id):null})})}function ue(a){return a.type==="superadmin"||a.type==="admin"?a.type:`member · read ${a.read_scope} · write ${a.write_scope}`}function I(a){return a==null?"":JSON.stringify(a,null,2)}function C(a){const d=a.trim();if(!d)return{ok:!0,value:void 0};try{const n=JSON.parse(d);return typeof n!="object"||Array.isArray(n)||n===null?{ok:!1}:{ok:!0,value:n}}catch{return{ok:!1}}}function h({icon:a,color:d,label:n,aside:i}){return e.jsxs("div",{className:"flex items-center justify-between mb-3 pb-2 border-b border-surface-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(a,{className:`w-4 h-4 ${d}`,strokeWidth:1.5}),e.jsx("h2",{className:"section-h2",children:n})]}),i]})}function he({role:a,allRoles:d}){const{data:n}=Z(),i=ee(),p=te(),[c,u]=m.useState(""),t=(n==null?void 0:n.chains)??[],s=m.useMemo(()=>t.filter(l=>l.source_role===a.role).map(l=>l.target_role),[t,a.role]),f=m.useMemo(()=>d.map(l=>l.role).filter(l=>l!==a.role&&l!=="superadmin"&&!s.includes(l)),[d,a.role,s]);return a.role==="superadmin"?e.jsx("p",{className:"text-[11px] text-text-tertiary",children:"Superadmins can escalate to any role implicitly."}):e.jsxs("div",{className:"space-y-3",children:[s.length===0?e.jsx("p",{className:"text-[11px] text-text-tertiary",children:"Add a target role to route hand-offs."}):e.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.map(l=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 text-[10px] bg-surface-sunken rounded font-mono text-text-secondary",children:[l,e.jsx("button",{onClick:()=>p.mutate({source_role:a.role,target_role:l}),className:"text-text-quaternary hover:text-red-400 transition-colors leading-none ml-0.5",children:"×"})]},l))}),f.length>0&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("select",{value:c,onChange:l=>u(l.target.value),className:"select text-xs font-mono flex-1",children:[e.jsx("option",{value:"",children:"Add target…"}),f.map(l=>e.jsx("option",{value:l,children:l},l))]}),e.jsx("button",{onClick:()=>{c&&i.mutate({source_role:a.role,target_role:c},{onSuccess:()=>u("")})},disabled:!c||i.isPending,className:"px-2.5 py-1 text-xs rounded bg-accent text-text-inverse hover:bg-accent-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed shrink-0",children:i.isPending?"…":"Add"})]})]})}function fe({role:a,allRoles:d}){const n=L(),[i,p]=m.useState(""),c=a.upstream_roles??[],u=m.useMemo(()=>d.map(s=>s.role).filter(s=>s!==a.role&&s!=="superadmin"&&!c.includes(s)),[d,a.role,c]),t=s=>n.mutate({role:a.role,upstream_roles:s},{onSuccess:()=>p("")});return e.jsxs("div",{className:"space-y-3",children:[c.length===0?e.jsx("p",{className:"text-[11px] text-text-tertiary",children:"Add a role from another sequence that this station draws input from. Prior Step sets where this role sits in its own sequence; upstream inputs mark the side-quests that land here."}):e.jsx("div",{className:"flex flex-wrap gap-1.5",children:c.map(s=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 text-[10px] bg-surface-sunken rounded font-mono text-text-secondary",children:[s,e.jsx("button",{onClick:()=>t(c.filter(f=>f!==s)),className:"text-text-quaternary hover:text-red-400 transition-colors leading-none ml-0.5",children:"×"})]},s))}),u.length>0&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("select",{value:i,onChange:s=>p(s.target.value),className:"select text-xs font-mono flex-1",children:[e.jsx("option",{value:"",children:"Add upstream input…"}),u.map(s=>e.jsx("option",{value:s,children:s},s))]}),e.jsx("button",{onClick:()=>{i&&t([...c,i])},disabled:!i||n.isPending,className:"px-2.5 py-1 text-xs rounded bg-accent text-text-inverse hover:bg-accent-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed shrink-0",children:n.isPending?"…":"Add"})]}),n.error&&e.jsx("p",{className:"text-[10px] text-status-error",children:n.error.message})]})}function ve(a){return{title:a.title??"",description:a.description??"",ops_visible:a.ops_visible,parent_role:a.parent_role??"",metadata_schema:I(a.metadata_schema),properties:I(a.properties)||"{}",sla_minutes:a.sla_minutes!=null?String(a.sla_minutes):"",target_per_hour:a.target_per_hour!=null?String(a.target_per_hour):"",worker_count:a.worker_count!=null?String(a.worker_count):""}}function Se(){const{role:a}=de(),d=xe(),{data:n,isLoading:i}=X(),p=L(),c=Y(),u=(n==null?void 0:n.roles)??[],t=u.find(r=>r.role===a),[s,f]=m.useState({title:"",description:"",ops_visible:!1,parent_role:"",metadata_schema:"",properties:"{}",sla_minutes:"",target_per_hour:"",worker_count:""}),[l,q]=m.useState(!1),[V,b]=m.useState(!1),[g,_]=m.useState({}),[W,M]=m.useState(!1),[y,O]=m.useState(new Set),F=r=>O(o=>new Set([...o,r]));m.useEffect(()=>{t&&(f(ve(t)),q(!1),b(!1),_({}),O(new Set))},[a,t==null?void 0:t.role]);const v=r=>{f(o=>({...o,...r})),q(!0),b(!1)},z=m.useMemo(()=>u.filter(r=>{if(!t||r.role===t.role)return!1;let o=r;const x=new Set;for(;o!=null&&o.parent_role;){if(o.parent_role===t.role)return!1;if(x.has(o.parent_role))break;x.add(o.parent_role),o=u.find(j=>j.role===o.parent_role)}return!0}),[u,t]),G=()=>{const r=C(s.metadata_schema),o=C(s.properties),x={};if(r.ok||(x.metadata_schema="Invalid JSON"),o.ok||(x.properties="Invalid JSON"),_(x),Object.keys(x).length||!t)return;const j=D=>{const N=parseFloat(D);return isNaN(N)?null:N},E=D=>{const N=j(D);return N==null?null:Math.round(N)};p.mutate({role:t.role,title:s.title.trim()||null,description:s.description.trim()||null,ops_visible:s.ops_visible,parent_role:s.parent_role||null,metadata_schema:r.value??null,properties:o.value??{},sla_minutes:j(s.sla_minutes),target_per_hour:j(s.target_per_hour),worker_count:E(s.worker_count)},{onSuccess:()=>{q(!1),b(!0),O(new Set),window.setTimeout(()=>b(!1),2500)}})},H=()=>{t&&c.mutate(t.role,{onSuccess:()=>d("/admin/roles")})};if(i)return e.jsxs("div",{className:"animate-pulse space-y-4",children:[e.jsx("div",{className:"h-8 bg-surface-sunken rounded w-48"}),e.jsx("div",{className:"h-4 bg-surface-sunken rounded w-64"}),e.jsx("div",{className:"h-64 bg-surface-sunken rounded"})]});if(!t)return e.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-center",children:[e.jsx($,{className:"w-12 h-12 text-text-quaternary mb-4",strokeWidth:1}),e.jsx("h2",{className:"text-lg font-medium text-text-primary mb-2",children:"Role not found"})]});const K=t.user_count>0||t.chain_count>0||t.workflow_count>0,Q=l&&!Object.values(g).some(Boolean),w=parseFloat(s.sla_minutes),k=parseFloat(s.target_per_hour),S=parseFloat(s.worker_count),P=!isNaN(w)&&w>0,R=!isNaN(k)&&k>0,A=!isNaN(S)&&S>0,T=P&&A&&!R?`→ target ≈ ${(S/(w/60)).toFixed(1)}/h`:P&&R&&!A?`→ workers ≈ ${(k*(w/60)).toFixed(1)}`:R&&A&&!P?`→ SLA ≈ ${(S/k*60).toFixed(0)}m`:null;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-start justify-between gap-8 mb-12",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[e.jsx($,{className:"w-5 h-5 text-accent",strokeWidth:1.5}),e.jsx("h1",{className:"text-lg font-mono font-medium text-text-primary",children:t.role}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:dashboard.md:role-detail"},className:"text-text-quaternary hover:text-accent transition-colors",title:"Open docs for this page",children:e.jsx(re,{className:"w-4 h-4",strokeWidth:1.5})}),t.parent_role&&e.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-text-quaternary font-mono",children:[e.jsx(B,{className:"w-3 h-3"})," ",t.parent_role]})]}),t.title&&e.jsx("p",{className:"text-sm text-text-secondary pl-8",children:t.title})]}),e.jsxs("div",{className:"flex items-end gap-4 bg-surface-sunken rounded-lg px-4 py-2.5 shrink-0 mx-auto",title:"throughput = workers / (sla / 60)",children:[[{key:"sla_minutes",label:"SLA",unit:"min",placeholder:"30"},{key:"target_per_hour",label:"Target",unit:"/h",placeholder:"20"},{key:"worker_count",label:"Workers",unit:"",placeholder:"4"}].map(({key:r,label:o,unit:x,placeholder:j})=>e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[9px] font-semibold uppercase tracking-widest text-text-quaternary mb-1",children:[o,x&&e.jsx("span",{className:"normal-case font-normal ml-1",children:x})]}),e.jsx("input",{type:"number",min:"0",step:"any",value:s[r],onChange:E=>v({[r]:E.target.value}),placeholder:j,className:"input text-xs w-16 font-mono"})]},r)),T&&e.jsx("span",{className:"text-[10px] text-accent font-mono whitespace-nowrap pb-2",children:T})]}),e.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2",title:"Show as a station on the Pace Board",children:[e.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary",children:"Ops"}),e.jsx("button",{onClick:()=>v({ops_visible:!s.ops_visible}),className:`w-9 h-5 rounded-full transition-colors relative shrink-0 ${s.ops_visible?"bg-accent":"bg-surface-border"}`,children:e.jsx("span",{className:`absolute top-[3px] left-0 w-3.5 h-3.5 rounded-full bg-white transition-transform shadow ${s.ops_visible?"translate-x-[18px]":"translate-x-[3px]"}`})})]}),V&&e.jsxs("span",{className:"flex items-center gap-1 text-xs text-status-success animate-page-enter",children:[e.jsx(ne,{className:"w-3 h-3"})," Saved"]}),p.error&&e.jsx("span",{className:"text-xs text-status-error max-w-[180px] truncate",children:p.error.message}),e.jsx("button",{onClick:G,disabled:!Q||p.isPending,className:"px-3 py-1.5 text-xs rounded-md bg-accent text-text-inverse hover:bg-accent-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:p.isPending?"Saving…":"Save Role"}),!K&&e.jsxs("button",{onClick:()=>M(!0),className:"px-3 py-1.5 text-xs rounded-md text-red-400/60 hover:text-red-400 hover:bg-red-600/10 transition-colors flex items-center gap-1",children:[e.jsx(oe,{className:"w-3 h-3"})," Delete"]})]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-16 items-start",children:[e.jsxs("div",{className:"space-y-14",children:[e.jsxs("div",{className:"space-y-8",children:[e.jsx(h,{icon:$,color:"text-accent",label:"Identity"}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:"Display Name"}),e.jsx("input",{type:"text",value:s.title,onChange:r=>v({title:r.target.value}),placeholder:`e.g., ${t.role.charAt(0).toUpperCase()+t.role.slice(1)}`,className:"input text-sm w-full"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:"Description"}),e.jsx("textarea",{value:s.description,onChange:r=>v({description:r.target.value}),placeholder:"A short description shown on role cards and in the operations view.",rows:4,className:"input text-sm w-full resize-none"})]})]}),e.jsxs("div",{className:`space-y-14 overflow-hidden transition-all duration-300 ease-out ${s.ops_visible?"opacity-100 max-h-[900px]":"opacity-0 max-h-0 pointer-events-none"}`,"aria-hidden":!s.ops_visible,children:[e.jsxs("div",{className:"space-y-5",children:[e.jsx(h,{icon:B,color:"text-text-tertiary",label:"Prior Step"}),e.jsxs("select",{value:s.parent_role,onChange:r=>v({parent_role:r.target.value}),className:"select text-sm w-full font-mono",children:[e.jsx("option",{value:"",children:"None — root process"}),z.map(r=>e.jsx("option",{value:r.role,children:r.title?`${r.role} — ${r.title}`:r.role},r.role))]}),e.jsx("p",{className:"text-[10px] text-text-tertiary leading-relaxed",children:"Places this role in one Pace Board sequence. A role with no prior step starts its own sequence."})]}),e.jsxs("div",{className:"space-y-5",children:[e.jsx(h,{icon:le,color:"text-text-tertiary",label:"Upstream Inputs",aside:e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500"}),e.jsx("span",{className:"text-[9px] font-semibold uppercase tracking-widest text-emerald-600",children:"Live"})]})}),e.jsx(fe,{role:t,allRoles:u})]})]})]}),e.jsxs("div",{className:"space-y-14",children:[e.jsxs("div",{children:[e.jsx(h,{icon:ie,color:"text-text-quaternary",label:"Escalation Targets",aside:e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500"}),e.jsx("span",{className:"text-[9px] font-semibold uppercase tracking-widest text-emerald-600",children:"Live"})]})}),e.jsx(he,{role:t,allRoles:u})]}),e.jsxs("div",{className:"pt-3 pb-4 border-t border-surface-border/40",children:[e.jsx(h,{icon:ce,color:"text-text-quaternary",label:"Members",aside:e.jsx("span",{className:"text-[9px] font-normal normal-case text-text-quaternary",children:"read = what appears · write = what they can act on"})}),e.jsx(me,{role:t.role})]})]}),e.jsxs("div",{className:"space-y-14",children:[e.jsxs("div",{children:[e.jsx(h,{icon:J,color:"text-cyan-400",label:"Escalation Schema",aside:t.current_schema_version!=null?e.jsxs("span",{className:"text-[9px] font-mono text-text-quaternary",children:["v",t.current_schema_version," in use"]}):void 0}),e.jsxs("p",{className:"text-[10px] text-text-tertiary mb-3 leading-relaxed",children:["The form a person completes to resolve this role's escalations. Versioned — each save adds one; workflows pin any version via"," ",e.jsx("code",{className:"font-mono",children:"schemaVersion"}),"."]}),e.jsx(pe,{to:`/admin/roles/${encodeURIComponent(t.role)}/schema`,className:"text-xs text-accent hover:underline",children:t.form_schema?`Open schema editor — v${t.current_schema_version??1} in use →`:"Define the escalation form →"})]}),e.jsxs("div",{children:[e.jsx(h,{icon:J,color:"text-violet-400",label:"Metadata Schema",aside:!y.has("metadata_schema")&&t.metadata_schema?e.jsx("button",{onClick:()=>F("metadata_schema"),className:"text-[9px] text-accent hover:underline",children:"Edit"}):void 0}),e.jsxs("p",{className:"text-[10px] text-text-tertiary mb-3 leading-relaxed",children:["Validates ",e.jsx("code",{className:"font-mono",children:"metadata"})," at creation time. Keys appear in faceted search autocomplete."]}),!y.has("metadata_schema")&&t.metadata_schema?e.jsx(U,{data:t.metadata_schema}):e.jsxs(e.Fragment,{children:[e.jsx("textarea",{value:s.metadata_schema,onChange:r=>{const o=r.target.value;v({metadata_schema:o}),_(x=>({...x,metadata_schema:C(o).ok?void 0:"Invalid JSON"}))},rows:10,spellCheck:!1,className:"input text-xs font-mono w-full resize-y",placeholder:`{
|
|
2
|
+
"type": "object",
|
|
3
|
+
"properties": {
|
|
4
|
+
"order_id": { "type": "string" }
|
|
5
|
+
},
|
|
6
|
+
"required": ["order_id"]
|
|
7
|
+
}`}),g.metadata_schema&&e.jsx("p",{className:"text-[10px] text-status-error mt-1",children:g.metadata_schema})]})]}),e.jsxs("div",{children:[e.jsx(h,{icon:J,color:"text-text-quaternary",label:"Properties",aside:!y.has("properties")&&t.properties&&Object.keys(t.properties).length>0?e.jsx("button",{onClick:()=>F("properties"),className:"text-[9px] text-accent hover:underline",children:"Edit"}):e.jsx("span",{className:"text-[9px] font-normal normal-case text-text-quaternary",children:"custom JSON"})}),!y.has("properties")&&t.properties&&Object.keys(t.properties).length>0?e.jsx(U,{data:t.properties,defaultCollapsed:!0}):e.jsxs(e.Fragment,{children:[e.jsx("textarea",{value:s.properties,onChange:r=>{const o=r.target.value;v({properties:o}),_(x=>({...x,properties:C(o).ok?void 0:"Invalid JSON"}))},rows:5,spellCheck:!1,className:"input text-xs font-mono w-full resize-none",placeholder:`{
|
|
8
|
+
"icon": "wrench",
|
|
9
|
+
"color": "#6366f1"
|
|
10
|
+
}`}),g.properties&&e.jsx("p",{className:"text-[10px] text-status-error mt-1",children:g.properties})]})]})]})]}),e.jsx(se,{open:W,onClose:()=>M(!1),onConfirm:H,title:"Delete Role",description:e.jsxs(e.Fragment,{children:["Delete role ",e.jsx("span",{className:"font-medium font-mono text-text-primary",children:t.role}),"? This cannot be undone."]}),isPending:c.isPending,error:c.error})]})}export{Se as RoleDetailPage};
|
|
11
|
+
//# sourceMappingURL=RoleDetailPage-DS37tJhq.js.map
|