@knpkv/control-center 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/.vite/manifest.json +66 -66
- package/dist/client/assets/ActiveWorkPage-DKlotZGc.js +2 -0
- package/dist/client/assets/{ActiveWorkPage-C6lIQfjL.js.map → ActiveWorkPage-DKlotZGc.js.map} +1 -1
- package/dist/client/assets/{AgentPage-DqB5BilE.js → AgentPage-Cxm1gj2C.js} +3 -3
- package/dist/client/assets/{AgentPage-DqB5BilE.js.map → AgentPage-Cxm1gj2C.js.map} +1 -1
- package/dist/client/assets/{AtlassianOAuthCallbackPage-DzTO6SqN.js → AtlassianOAuthCallbackPage-fEFUJE2g.js} +2 -2
- package/dist/client/assets/{AtlassianOAuthCallbackPage-DzTO6SqN.js.map → AtlassianOAuthCallbackPage-fEFUJE2g.js.map} +1 -1
- package/dist/client/assets/{AuthorizedSharePage-V_E5giT7.js → AuthorizedSharePage-Dh7Y_gmJ.js} +2 -2
- package/dist/client/assets/{AuthorizedSharePage-V_E5giT7.js.map → AuthorizedSharePage-Dh7Y_gmJ.js.map} +1 -1
- package/dist/client/assets/{BrowserSessionHydrator-CEypgMkR.js → BrowserSessionHydrator-DkomS8Yl.js} +2 -2
- package/dist/client/assets/{BrowserSessionHydrator-CEypgMkR.js.map → BrowserSessionHydrator-DkomS8Yl.js.map} +1 -1
- package/dist/client/assets/{CommandSearch-syQMt_rx.js → CommandSearch-nf16HEqz.js} +2 -2
- package/dist/client/assets/{CommandSearch-syQMt_rx.js.map → CommandSearch-nf16HEqz.js.map} +1 -1
- package/dist/client/assets/{ItemsPage-Cr3--iJc.js → ItemsPage-Bok8Vpy4.js} +2 -2
- package/dist/client/assets/{ItemsPage-Cr3--iJc.js.map → ItemsPage-Bok8Vpy4.js.map} +1 -1
- package/dist/client/assets/{OpenPullRequestPage-BYoRmtui.js → OpenPullRequestPage-DdL7PhKZ.js} +2 -2
- package/dist/client/assets/{OpenPullRequestPage-BYoRmtui.js.map → OpenPullRequestPage-DdL7PhKZ.js.map} +1 -1
- package/dist/client/assets/{PairPage-ByOBKuBB.js → PairPage-BCtzYqK6.js} +2 -2
- package/dist/client/assets/{PairPage-ByOBKuBB.js.map → PairPage-BCtzYqK6.js.map} +1 -1
- package/dist/client/assets/{PortfolioOverview-BacOXO-c.js → PortfolioOverview-C-jqvYgQ.js} +2 -2
- package/dist/client/assets/{PortfolioOverview-BacOXO-c.js.map → PortfolioOverview-C-jqvYgQ.js.map} +1 -1
- package/dist/client/assets/{ReleaseRoute-C-MfQKnL.js → ReleaseRoute-cuvP4ug5.js} +2 -2
- package/dist/client/assets/{ReleaseRoute-C-MfQKnL.js.map → ReleaseRoute-cuvP4ug5.js.map} +1 -1
- package/dist/client/assets/{ReleaseWorkset-MV3I0HCi.js → ReleaseWorkset-DImwmjS3.js} +2 -2
- package/dist/client/assets/{ReleaseWorkset-MV3I0HCi.js.map → ReleaseWorkset-DImwmjS3.js.map} +1 -1
- package/dist/client/assets/{ServicesPage-BjeCOlsh.js → ServicesPage-CrM8R820.js} +2 -2
- package/dist/client/assets/{ServicesPage-BjeCOlsh.js.map → ServicesPage-CrM8R820.js.map} +1 -1
- package/dist/client/assets/{TimelinePage-Ccnp6Mmg.js → TimelinePage-FrvepGa_.js} +2 -2
- package/dist/client/assets/{TimelinePage-Ccnp6Mmg.js.map → TimelinePage-FrvepGa_.js.map} +1 -1
- package/dist/client/assets/{WorkspaceEntityLink-D3TXDcD0.js → WorkspaceEntityLink-CAj42f02.js} +2 -2
- package/dist/client/assets/{WorkspaceEntityLink-D3TXDcD0.js.map → WorkspaceEntityLink-CAj42f02.js.map} +1 -1
- package/dist/client/assets/WorkspaceEntityRoute-rQ9ccetx.js +14 -0
- package/dist/client/assets/{WorkspaceEntityRoute-uUK6vwM_.js.map → WorkspaceEntityRoute-rQ9ccetx.js.map} +1 -1
- package/dist/client/assets/WorkspaceHomeLink-ObQ3AQVw.js +2 -0
- package/dist/client/assets/{WorkspaceHomeLink-D5SdEgJJ.js.map → WorkspaceHomeLink-ObQ3AQVw.js.map} +1 -1
- package/dist/client/assets/{WorkspacePullRequestDetails-CKedGIT8.js → WorkspacePullRequestDetails-BhxoqR7V.js} +2 -2
- package/dist/client/assets/{WorkspacePullRequestDetails-CKedGIT8.js.map → WorkspacePullRequestDetails-BhxoqR7V.js.map} +1 -1
- package/dist/client/assets/{WorkspaceReleaseLayout-Bdvl0q99.js → WorkspaceReleaseLayout-BWL66Fff.js} +2 -2
- package/dist/client/assets/{WorkspaceReleaseLayout-Bdvl0q99.js.map → WorkspaceReleaseLayout-BWL66Fff.js.map} +1 -1
- package/dist/client/assets/{WorkspaceSettingsPage-BxFq65Vf.js → WorkspaceSettingsPage-DutfiGPe.js} +2 -2
- package/dist/client/assets/{WorkspaceSettingsPage-BxFq65Vf.js.map → WorkspaceSettingsPage-DutfiGPe.js.map} +1 -1
- package/dist/client/assets/{controlCenterRelayDock-D7375HPG.js → controlCenterRelayDock-CyYeXh75.js} +3 -3
- package/dist/client/assets/{controlCenterRelayDock-D7375HPG.js.map → controlCenterRelayDock-CyYeXh75.js.map} +1 -1
- package/dist/client/assets/{controlCenterRelayDockChrome-B7jSUI3t.js → controlCenterRelayDockChrome-upgtq649.js} +2 -2
- package/dist/client/assets/{controlCenterRelayDockChrome-B7jSUI3t.js.map → controlCenterRelayDockChrome-upgtq649.js.map} +1 -1
- package/dist/client/assets/{index-BVikncBH.js → index-kmYFvwT0.js} +3 -3
- package/dist/client/assets/{index-BVikncBH.js.map → index-kmYFvwT0.js.map} +1 -1
- package/dist/client/assets/patterns-DuFUSnJW.js +2 -0
- package/dist/client/assets/patterns-DuFUSnJW.js.map +1 -0
- package/dist/client/assets/{useWorkspaceDefaultLanding-DMWfrZfF.js → useWorkspaceDefaultLanding-BmaR7aTj.js} +2 -2
- package/dist/client/assets/{useWorkspaceDefaultLanding-DMWfrZfF.js.map → useWorkspaceDefaultLanding-BmaR7aTj.js.map} +1 -1
- package/dist/client/assets/{workspaceEntityRoutes-BJ-SC0Jd.js → workspaceEntityRoutes-BHccxrFj.js} +2 -2
- package/dist/client/assets/{workspaceEntityRoutes-BJ-SC0Jd.js.map → workspaceEntityRoutes-BHccxrFj.js.map} +1 -1
- package/dist/client/assets/{workspaceScrollCapture-CwBIBHg8.js → workspaceScrollCapture-BzsNJoL7.js} +2 -2
- package/dist/client/assets/{workspaceScrollCapture-CwBIBHg8.js.map → workspaceScrollCapture-BzsNJoL7.js.map} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/assets/{BindConfig-D8aIjI_R.js → BindConfig-BG-FGtB5.js} +13 -4
- package/dist/server/assets/BindConfig-BG-FGtB5.js.map +1 -0
- package/dist/server/server/cli.js +1 -1
- package/dist/server/server/index.js +1 -1
- package/package.json +5 -5
- package/dist/client/assets/ActiveWorkPage-C6lIQfjL.js +0 -2
- package/dist/client/assets/WorkspaceEntityRoute-uUK6vwM_.js +0 -14
- package/dist/client/assets/WorkspaceHomeLink-D5SdEgJJ.js +0 -2
- package/dist/client/assets/patterns-DAeEdyxU.js +0 -2
- package/dist/client/assets/patterns-DAeEdyxU.js.map +0 -1
- package/dist/server/assets/BindConfig-D8aIjI_R.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-CwJFpaho.js";import{r as n}from"./hooks-K-sIfGqH.js";import{t as r}from"./lib-6h955hh9.js";import{t as i}from"./jsx-runtime-NZYk81nU.js";import{d as a,g as o,p as s,r as c,v as l}from"./Dialog-DSwimdwG-BeHnBpPp.js";import{f as u,l as d,m as f,p}from"./index-BVikncBH.js";import{n as m,r as h}from"./patterns-DAeEdyxU.js";import{n as g}from"./primitives-DYGtIZqB-r-Glkv2i.js";import{Jr as _,Ti as v,Xr as y,Ya as b,Zt as x,_i as S,ei as C,ki as w,tr as T}from"./agent-api-CUWP1qs8.js";import{a as E,t as D}from"./client-D3WRV6yl.js";import{t as O}from"./WorkspaceEntityLink-D3TXDcD0.js";var k=e(t(),1),A={body:`_body_vqgmt_1`,loading:`_loading_vqgmt_2`,content:`_content_vqgmt_3`,identity:`_identity_vqgmt_4`,identityMeta:`_identityMeta_vqgmt_5`,section:`_section_vqgmt_6`,ledger:`_ledger_vqgmt_7`,footerLink:`_footerLink_vqgmt_70`},j=b(`UnauthorizedApiError`),M={load:(e,t)=>w(S(function*(){return yield*(yield*D()).timeline.detail({params:{eventKey:e}})}).pipe(v(E)),{signal:t})},N=(e,t,n,r=M)=>{let[i,a]=(0,k.useState)(0),[o,s]=(0,k.useState)({_tag:`idle`});(0,k.useEffect)(()=>{if(e===null||t===null){s({_tag:`idle`});return}let i=new AbortController;return s({_tag:`loading`,eventKey:e,sessionKey:t}),r.load(e,i.signal).then(n=>{i.signal.aborted||s({_tag:`ready`,detail:n,eventKey:e,sessionKey:t})},r=>{i.signal.aborted||(j(r)&&n(t),s({_tag:`failed`,eventKey:e,sessionKey:t}))}),()=>i.abort()},[e,n,i,t,r]);let c=e===null||t===null?{_tag:`idle`}:o._tag===`idle`||o.eventKey!==e||o.sessionKey!==t?{_tag:`loading`,eventKey:e,sessionKey:t}:o;return{retry:(0,k.useCallback)(()=>a(e=>e+1),[]),state:c}},P=i(),F={action:`Governed action`,"plugin-sync":`Service sync`,relationship:`Delivery link`,system:`Control Center`},I=e=>y(e.occurredAt,{day:`2-digit`,hour:`2-digit`,hour12:!1,locale:`en-GB`,minute:`2-digit`,month:`short`,second:`2-digit`,year:`numeric`}),L=e=>{let t=[{label:`Actor`,value:e.identifiers.actorId},{label:`Agent job`,value:e.agentJob?.jobId??null},{label:`Action`,value:e.identifiers.actionId},{label:`Relationship`,value:e.identifiers.relationshipId},{label:`Connection`,value:e.identifiers.pluginConnectionId},{label:`Release`,value:e.identifiers.releaseId},{label:`Entity`,value:e.identifiers.entityId}];return[{label:`Event`,value:e.event.eventKey},{label:`Type`,value:e.event.eventType},...t.filter(e=>e.value!==null)]},R=({agentHref:e,event:t,onClose:n,onSessionExpired:i,sessionKey:u,transport:d})=>{let f=N(t?.eventKey??null,u,i,d);return(0,P.jsx)(s.Root,{onOpenChange:e=>{e||n()},open:t!==null,children:(0,P.jsxs)(s.Content,{closeLabel:`Close event details`,description:`Durable provenance for this exact workspace event.`,title:`Event details`,children:[(0,P.jsx)(s.Body,{className:A.body,children:t===null||f.state._tag===`idle`||f.state._tag===`loading`?(0,P.jsxs)(`div`,{"aria-busy":`true`,"aria-label":`Loading event details`,className:A.loading,children:[(0,P.jsx)(l,{height:`10rem`}),(0,P.jsx)(l,{height:`14rem`})]}):f.state._tag===`failed`?(0,P.jsx)(o,{action:(0,P.jsx)(c,{onClick:f.retry,children:`Try again`}),description:`The Timeline row remains unchanged. Its provenance could not be loaded.`,title:`Event details unavailable`,tone:`caution`}):(0,P.jsxs)(`div`,{className:A.content,children:[(0,P.jsxs)(`section`,{"aria-labelledby":`timeline-detail-title`,className:A.identity,children:[(0,P.jsx)(g,{tone:`secondary`,variant:`label`,children:F[f.state.detail.event.sourceKind]}),(0,P.jsx)(g,{as:`h2`,id:`timeline-detail-title`,variant:`page-title`,children:f.state.detail.event.title}),(0,P.jsxs)(`div`,{className:A.identityMeta,children:[(0,P.jsx)(a,{label:f.state.detail.event.actor.kind,size:`compact`,tone:f.state.detail.event.actor.kind===`agent`?`progress`:`neutral`}),f.state.detail.event.service===null?null:(0,P.jsx)(m,{service:f.state.detail.event.service,size:`compact`}),(0,P.jsx)(g,{tone:`secondary`,variant:`meta`,children:f.state.detail.event.actor.label}),(0,P.jsxs)(g,{as:`time`,dateTime:_(f.state.detail.event.occurredAt),tone:`secondary`,variant:`meta`,children:[I(f.state.detail.event),` UTC`]})]})]}),(0,P.jsxs)(`section`,{"aria-labelledby":`timeline-provenance-title`,className:A.section,children:[(0,P.jsx)(g,{as:`h3`,id:`timeline-provenance-title`,variant:`section-title`,children:`Provenance`}),(0,P.jsx)(`dl`,{className:A.ledger,children:L(f.state.detail).map(({label:e,value:t})=>(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`dt`,{children:e}),(0,P.jsx)(`dd`,{children:t})]},e))})]})]})}),(0,P.jsx)(s.Footer,{children:(0,P.jsx)(r,{className:A.footerLink,to:e,children:`Ask Relay about this event`})})]})})},z={page:`_page_18su2_1`,hero:`_hero_18su2_2`,intro:`_intro_18su2_22`,askRelay:`_askRelay_18su2_26`,summary:`_summary_18su2_40`,filters:`_filters_18su2_89`,events:`_events_18su2_115`,rowActor:`_rowActor_18su2_122`},B={load:(e,t,n)=>w(S(function*(){let e=yield*D(),r=t.from.length===0?void 0:yield*T(x)(`${t.from}T00:00:00.000Z`),i=t.to.length===0?void 0:yield*T(x)(`${t.to}T23:59:59.999Z`);return yield*e.timeline.page({query:{...t.actorKind!==`all`&&{actor:t.actorKind},...n!==null&&{beforeEventKey:n.eventKey,beforeOccurredAt:n.occurredAt},...r!==void 0&&{from:r},limit:50,...i!==void 0&&{to:i}}})}).pipe(v(E)),{signal:e})},V=b(`UnauthorizedApiError`),H=(e,t,n,r=B)=>{let[i,a]=(0,k.useState)(0),[o,s]=(0,k.useState)({_tag:`idle`}),c=(0,k.useRef)(null),l=`${e.actorKind}|${e.from}|${e.to}`;return(0,k.useEffect)(()=>{if(c.current?.abort(),t===null){s({_tag:`idle`});return}let i=new AbortController;return c.current=i,s({_tag:`loading`}),r.load(i.signal,e,null).then(e=>{i.signal.aborted||s({_tag:`ready`,events:e.events,isLoadingMore:!1,nextCursor:e.nextCursor})},e=>{i.signal.aborted||(V(e)&&n(t),s({_tag:`failed`}))}),()=>i.abort()},[l,e,n,i,t,r]),{loadMore:(0,k.useCallback)(()=>{if(t===null||o._tag!==`ready`||o.nextCursor===null||o.isLoadingMore)return;c.current?.abort();let i=new AbortController;c.current=i;let a=o;s({...a,isLoadingMore:!0}),r.load(i.signal,e,a.nextCursor).then(e=>{i.signal.aborted||s({_tag:`ready`,events:[...a.events,...e.events],isLoadingMore:!1,nextCursor:e.nextCursor})},e=>{i.signal.aborted||(V(e)&&n(t),s({...a,isLoadingMore:!1}))})},[e,n,t,o,r]),retry:(0,k.useCallback)(()=>a(e=>e+1),[]),state:o}},U=e=>new Intl.DateTimeFormat(`en-GB`,{dateStyle:`medium`,timeStyle:`short`,timeZone:`UTC`}).format(C(e)),W=[{label:`Everyone`,value:`all`},{label:`People`,value:`human`},{label:`Agents`,value:`agent`},{label:`Services`,value:`plugin`},{label:`System`,value:`system`}],G=[`action`,`relationship`,`plugin-sync`,`system`],K=e=>W.find(t=>t.value===e)?.value??`all`,q={action:{label:`Governed action`},"plugin-sync":{label:`Service sync`},relationship:{label:`Delivery link`},system:{label:`Control Center`}},J=({actor:e,continued:t,event:n})=>(0,P.jsx)(h,{continued:t,event:{actor:e??n.actor.label,actorKind:n.actor.kind,dateTime:_(n.occurredAt),detail:q[n.sourceKind].label,...n.href!==null&&{href:n.href},id:n.eventKey,...n.service!==null&&{service:n.service},time:U(n.occurredAt),title:n.title}}),Y=e=>{switch(e._tag){case`authenticated`:return e.session.permission===`workspace-owner`;case`storage-unavailable`:return e.session?.permission===`workspace-owner`;case`anonymous`:case`blocked`:case`checking`:case`unavailable`:return!1}},X=(e,t,n,r)=>{let i=new URLSearchParams(t);return i.set(`event`,r),d(e,`?${i.toString()}`,n)},Z=({events:e})=>{let t=(0,k.useMemo)(()=>new Map([[`action`,e.filter(({sourceKind:e})=>e===`action`).length],[`relationship`,e.filter(({sourceKind:e})=>e===`relationship`).length],[`plugin-sync`,e.filter(({sourceKind:e})=>e===`plugin-sync`).length],[`system`,e.filter(({sourceKind:e})=>e===`system`).length]]),[e]);return(0,P.jsx)(`dl`,{className:z.summary,children:G.map(e=>(0,P.jsxs)(`div`,{"data-source":e,children:[(0,P.jsx)(`dt`,{children:q[e].label}),(0,P.jsx)(`dd`,{children:t.get(e)??0})]},e))})},Q=({detailTransport:e,transport:t=B}={})=>{let i=n(),a=p(),s=u(a.state),[l,m]=(0,k.useState)({actorKind:`all`,from:``,to:``}),[h,_]=(0,k.useState)(null),v=H(l,s,a.invalidateSession,t),y=d(i.pathname,i.search,i.hash),b=Y(a.state);if(v.state._tag===`idle`||v.state._tag===`loading`)return(0,P.jsx)(o,{description:`Combining durable activity across your connected services.`,title:`Loading Timeline`});if(v.state._tag===`failed`)return(0,P.jsx)(o,{action:(0,P.jsx)(c,{onClick:v.retry,children:`Try again`}),description:`The Timeline could not be read.`,title:`Timeline unavailable`});let x=v.state;return(0,P.jsxs)(`article`,{className:z.page,children:[(0,P.jsxs)(`header`,{className:z.hero,children:[(0,P.jsx)(g,{as:`p`,tone:`secondary`,variant:`label`,children:`Timeline`}),(0,P.jsxs)(g,{as:`h1`,variant:`verdict`,children:[`Everything`,(0,P.jsx)(`br`,{}),`that moved.`]}),(0,P.jsx)(g,{className:z.intro,tone:`secondary`,variant:`body-large`,children:`One chronological truth across people, agents, code, delivery links, and connected services.`}),(0,P.jsx)(r,{className:z.askRelay,to:y,children:`Ask Relay about this Timeline`})]}),(0,P.jsx)(Z,{events:x.events}),(0,P.jsxs)(`section`,{"aria-label":`Timeline filters`,className:z.filters,children:[(0,P.jsxs)(`label`,{children:[(0,P.jsx)(`span`,{children:`Actor`}),(0,P.jsx)(`select`,{value:l.actorKind,onChange:e=>m({...l,actorKind:K(e.currentTarget.value)}),children:W.map(e=>(0,P.jsx)(`option`,{value:e.value,children:e.label},e.value))})]}),(0,P.jsxs)(`label`,{children:[(0,P.jsx)(`span`,{children:`From`}),(0,P.jsx)(`input`,{type:`date`,value:l.from,onChange:e=>m({...l,from:e.currentTarget.value})})]}),(0,P.jsxs)(`label`,{children:[(0,P.jsx)(`span`,{children:`To`}),(0,P.jsx)(`input`,{type:`date`,value:l.to,onChange:e=>m({...l,to:e.currentTarget.value})})]})]}),x.events.length===0?(0,P.jsx)(o,{description:`Try a wider date range or another actor.`,title:`No activity in this view`}):(0,P.jsx)(f,{component:O,children:(0,P.jsx)(`ol`,{className:z.events,children:x.events.map((e,t)=>(0,P.jsx)(J,{actor:b?(0,P.jsxs)(`span`,{className:z.rowActor,children:[(0,P.jsx)(`span`,{children:e.actor.label}),(0,P.jsx)(c,{onClick:()=>_(e),size:`compact`,variant:`quiet`,children:`Inspect`})]}):void 0,continued:t<x.events.length-1,event:e},e.eventKey))})}),x.nextCursor===null?null:(0,P.jsx)(c,{disabled:x.isLoadingMore,onClick:v.loadMore,size:`principal`,stretch:!0,children:x.isLoadingMore?`Loading…`:`Show earlier activity`}),(0,P.jsx)(R,{agentHref:h===null?y:X(i.pathname,i.search,i.hash,h.eventKey),event:h,onClose:()=>_(null),onSessionExpired:a.invalidateSession,sessionKey:s,...e===void 0?{}:{transport:e}})]})};export{Q as TimelinePage,Y as canInspectTimelineDetails,X as timelineEventAgentPath};
|
|
2
|
-
//# sourceMappingURL=TimelinePage-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-CwJFpaho.js";import{r as n}from"./hooks-K-sIfGqH.js";import{t as r}from"./lib-6h955hh9.js";import{t as i}from"./jsx-runtime-NZYk81nU.js";import{d as a,g as o,p as s,r as c,v as l}from"./Dialog-DSwimdwG-BeHnBpPp.js";import{f as u,l as d,m as f,p}from"./index-kmYFvwT0.js";import{n as m,r as h}from"./patterns-DuFUSnJW.js";import{n as g}from"./primitives-DYGtIZqB-r-Glkv2i.js";import{Jr as _,Ti as v,Xr as y,Ya as b,Zt as x,_i as S,ei as C,ki as w,tr as T}from"./agent-api-CUWP1qs8.js";import{a as E,t as D}from"./client-D3WRV6yl.js";import{t as O}from"./WorkspaceEntityLink-CAj42f02.js";var k=e(t(),1),A={body:`_body_vqgmt_1`,loading:`_loading_vqgmt_2`,content:`_content_vqgmt_3`,identity:`_identity_vqgmt_4`,identityMeta:`_identityMeta_vqgmt_5`,section:`_section_vqgmt_6`,ledger:`_ledger_vqgmt_7`,footerLink:`_footerLink_vqgmt_70`},j=b(`UnauthorizedApiError`),M={load:(e,t)=>w(S(function*(){return yield*(yield*D()).timeline.detail({params:{eventKey:e}})}).pipe(v(E)),{signal:t})},N=(e,t,n,r=M)=>{let[i,a]=(0,k.useState)(0),[o,s]=(0,k.useState)({_tag:`idle`});(0,k.useEffect)(()=>{if(e===null||t===null){s({_tag:`idle`});return}let i=new AbortController;return s({_tag:`loading`,eventKey:e,sessionKey:t}),r.load(e,i.signal).then(n=>{i.signal.aborted||s({_tag:`ready`,detail:n,eventKey:e,sessionKey:t})},r=>{i.signal.aborted||(j(r)&&n(t),s({_tag:`failed`,eventKey:e,sessionKey:t}))}),()=>i.abort()},[e,n,i,t,r]);let c=e===null||t===null?{_tag:`idle`}:o._tag===`idle`||o.eventKey!==e||o.sessionKey!==t?{_tag:`loading`,eventKey:e,sessionKey:t}:o;return{retry:(0,k.useCallback)(()=>a(e=>e+1),[]),state:c}},P=i(),F={action:`Governed action`,"plugin-sync":`Service sync`,relationship:`Delivery link`,system:`Control Center`},I=e=>y(e.occurredAt,{day:`2-digit`,hour:`2-digit`,hour12:!1,locale:`en-GB`,minute:`2-digit`,month:`short`,second:`2-digit`,year:`numeric`}),L=e=>{let t=[{label:`Actor`,value:e.identifiers.actorId},{label:`Agent job`,value:e.agentJob?.jobId??null},{label:`Action`,value:e.identifiers.actionId},{label:`Relationship`,value:e.identifiers.relationshipId},{label:`Connection`,value:e.identifiers.pluginConnectionId},{label:`Release`,value:e.identifiers.releaseId},{label:`Entity`,value:e.identifiers.entityId}];return[{label:`Event`,value:e.event.eventKey},{label:`Type`,value:e.event.eventType},...t.filter(e=>e.value!==null)]},R=({agentHref:e,event:t,onClose:n,onSessionExpired:i,sessionKey:u,transport:d})=>{let f=N(t?.eventKey??null,u,i,d);return(0,P.jsx)(s.Root,{onOpenChange:e=>{e||n()},open:t!==null,children:(0,P.jsxs)(s.Content,{closeLabel:`Close event details`,description:`Durable provenance for this exact workspace event.`,title:`Event details`,children:[(0,P.jsx)(s.Body,{className:A.body,children:t===null||f.state._tag===`idle`||f.state._tag===`loading`?(0,P.jsxs)(`div`,{"aria-busy":`true`,"aria-label":`Loading event details`,className:A.loading,children:[(0,P.jsx)(l,{height:`10rem`}),(0,P.jsx)(l,{height:`14rem`})]}):f.state._tag===`failed`?(0,P.jsx)(o,{action:(0,P.jsx)(c,{onClick:f.retry,children:`Try again`}),description:`The Timeline row remains unchanged. Its provenance could not be loaded.`,title:`Event details unavailable`,tone:`caution`}):(0,P.jsxs)(`div`,{className:A.content,children:[(0,P.jsxs)(`section`,{"aria-labelledby":`timeline-detail-title`,className:A.identity,children:[(0,P.jsx)(g,{tone:`secondary`,variant:`label`,children:F[f.state.detail.event.sourceKind]}),(0,P.jsx)(g,{as:`h2`,id:`timeline-detail-title`,variant:`page-title`,children:f.state.detail.event.title}),(0,P.jsxs)(`div`,{className:A.identityMeta,children:[(0,P.jsx)(a,{label:f.state.detail.event.actor.kind,size:`compact`,tone:f.state.detail.event.actor.kind===`agent`?`progress`:`neutral`}),f.state.detail.event.service===null?null:(0,P.jsx)(h,{service:f.state.detail.event.service,size:`compact`}),(0,P.jsx)(g,{tone:`secondary`,variant:`meta`,children:f.state.detail.event.actor.label}),(0,P.jsxs)(g,{as:`time`,dateTime:_(f.state.detail.event.occurredAt),tone:`secondary`,variant:`meta`,children:[I(f.state.detail.event),` UTC`]})]})]}),(0,P.jsxs)(`section`,{"aria-labelledby":`timeline-provenance-title`,className:A.section,children:[(0,P.jsx)(g,{as:`h3`,id:`timeline-provenance-title`,variant:`section-title`,children:`Provenance`}),(0,P.jsx)(`dl`,{className:A.ledger,children:L(f.state.detail).map(({label:e,value:t})=>(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`dt`,{children:e}),(0,P.jsx)(`dd`,{children:t})]},e))})]})]})}),(0,P.jsx)(s.Footer,{children:(0,P.jsx)(r,{className:A.footerLink,to:e,children:`Ask Relay about this event`})})]})})},z={page:`_page_18su2_1`,hero:`_hero_18su2_2`,intro:`_intro_18su2_22`,askRelay:`_askRelay_18su2_26`,summary:`_summary_18su2_40`,filters:`_filters_18su2_89`,events:`_events_18su2_115`,rowActor:`_rowActor_18su2_122`},B={load:(e,t,n)=>w(S(function*(){let e=yield*D(),r=t.from.length===0?void 0:yield*T(x)(`${t.from}T00:00:00.000Z`),i=t.to.length===0?void 0:yield*T(x)(`${t.to}T23:59:59.999Z`);return yield*e.timeline.page({query:{...t.actorKind!==`all`&&{actor:t.actorKind},...n!==null&&{beforeEventKey:n.eventKey,beforeOccurredAt:n.occurredAt},...r!==void 0&&{from:r},limit:50,...i!==void 0&&{to:i}}})}).pipe(v(E)),{signal:e})},V=b(`UnauthorizedApiError`),H=(e,t,n,r=B)=>{let[i,a]=(0,k.useState)(0),[o,s]=(0,k.useState)({_tag:`idle`}),c=(0,k.useRef)(null),l=`${e.actorKind}|${e.from}|${e.to}`;return(0,k.useEffect)(()=>{if(c.current?.abort(),t===null){s({_tag:`idle`});return}let i=new AbortController;return c.current=i,s({_tag:`loading`}),r.load(i.signal,e,null).then(e=>{i.signal.aborted||s({_tag:`ready`,events:e.events,isLoadingMore:!1,nextCursor:e.nextCursor})},e=>{i.signal.aborted||(V(e)&&n(t),s({_tag:`failed`}))}),()=>i.abort()},[l,e,n,i,t,r]),{loadMore:(0,k.useCallback)(()=>{if(t===null||o._tag!==`ready`||o.nextCursor===null||o.isLoadingMore)return;c.current?.abort();let i=new AbortController;c.current=i;let a=o;s({...a,isLoadingMore:!0}),r.load(i.signal,e,a.nextCursor).then(e=>{i.signal.aborted||s({_tag:`ready`,events:[...a.events,...e.events],isLoadingMore:!1,nextCursor:e.nextCursor})},e=>{i.signal.aborted||(V(e)&&n(t),s({...a,isLoadingMore:!1}))})},[e,n,t,o,r]),retry:(0,k.useCallback)(()=>a(e=>e+1),[]),state:o}},U=e=>new Intl.DateTimeFormat(`en-GB`,{dateStyle:`medium`,timeStyle:`short`,timeZone:`UTC`}).format(C(e)),W=[{label:`Everyone`,value:`all`},{label:`People`,value:`human`},{label:`Agents`,value:`agent`},{label:`Services`,value:`plugin`},{label:`System`,value:`system`}],G=[`action`,`relationship`,`plugin-sync`,`system`],K=e=>W.find(t=>t.value===e)?.value??`all`,q={action:{label:`Governed action`},"plugin-sync":{label:`Service sync`},relationship:{label:`Delivery link`},system:{label:`Control Center`}},J=({actor:e,continued:t,event:n})=>(0,P.jsx)(m,{continued:t,event:{actor:e??n.actor.label,actorKind:n.actor.kind,dateTime:_(n.occurredAt),detail:q[n.sourceKind].label,...n.href!==null&&{href:n.href},id:n.eventKey,...n.service!==null&&{service:n.service},time:U(n.occurredAt),title:n.title}}),Y=e=>{switch(e._tag){case`authenticated`:return e.session.permission===`workspace-owner`;case`storage-unavailable`:return e.session?.permission===`workspace-owner`;case`anonymous`:case`blocked`:case`checking`:case`unavailable`:return!1}},X=(e,t,n,r)=>{let i=new URLSearchParams(t);return i.set(`event`,r),d(e,`?${i.toString()}`,n)},Z=({events:e})=>{let t=(0,k.useMemo)(()=>new Map([[`action`,e.filter(({sourceKind:e})=>e===`action`).length],[`relationship`,e.filter(({sourceKind:e})=>e===`relationship`).length],[`plugin-sync`,e.filter(({sourceKind:e})=>e===`plugin-sync`).length],[`system`,e.filter(({sourceKind:e})=>e===`system`).length]]),[e]);return(0,P.jsx)(`dl`,{className:z.summary,children:G.map(e=>(0,P.jsxs)(`div`,{"data-source":e,children:[(0,P.jsx)(`dt`,{children:q[e].label}),(0,P.jsx)(`dd`,{children:t.get(e)??0})]},e))})},Q=({detailTransport:e,transport:t=B}={})=>{let i=n(),a=p(),s=u(a.state),[l,m]=(0,k.useState)({actorKind:`all`,from:``,to:``}),[h,_]=(0,k.useState)(null),v=H(l,s,a.invalidateSession,t),y=d(i.pathname,i.search,i.hash),b=Y(a.state);if(v.state._tag===`idle`||v.state._tag===`loading`)return(0,P.jsx)(o,{description:`Combining durable activity across your connected services.`,title:`Loading Timeline`});if(v.state._tag===`failed`)return(0,P.jsx)(o,{action:(0,P.jsx)(c,{onClick:v.retry,children:`Try again`}),description:`The Timeline could not be read.`,title:`Timeline unavailable`});let x=v.state;return(0,P.jsxs)(`article`,{className:z.page,children:[(0,P.jsxs)(`header`,{className:z.hero,children:[(0,P.jsx)(g,{as:`p`,tone:`secondary`,variant:`label`,children:`Timeline`}),(0,P.jsxs)(g,{as:`h1`,variant:`verdict`,children:[`Everything`,(0,P.jsx)(`br`,{}),`that moved.`]}),(0,P.jsx)(g,{className:z.intro,tone:`secondary`,variant:`body-large`,children:`One chronological truth across people, agents, code, delivery links, and connected services.`}),(0,P.jsx)(r,{className:z.askRelay,to:y,children:`Ask Relay about this Timeline`})]}),(0,P.jsx)(Z,{events:x.events}),(0,P.jsxs)(`section`,{"aria-label":`Timeline filters`,className:z.filters,children:[(0,P.jsxs)(`label`,{children:[(0,P.jsx)(`span`,{children:`Actor`}),(0,P.jsx)(`select`,{value:l.actorKind,onChange:e=>m({...l,actorKind:K(e.currentTarget.value)}),children:W.map(e=>(0,P.jsx)(`option`,{value:e.value,children:e.label},e.value))})]}),(0,P.jsxs)(`label`,{children:[(0,P.jsx)(`span`,{children:`From`}),(0,P.jsx)(`input`,{type:`date`,value:l.from,onChange:e=>m({...l,from:e.currentTarget.value})})]}),(0,P.jsxs)(`label`,{children:[(0,P.jsx)(`span`,{children:`To`}),(0,P.jsx)(`input`,{type:`date`,value:l.to,onChange:e=>m({...l,to:e.currentTarget.value})})]})]}),x.events.length===0?(0,P.jsx)(o,{description:`Try a wider date range or another actor.`,title:`No activity in this view`}):(0,P.jsx)(f,{component:O,children:(0,P.jsx)(`ol`,{className:z.events,children:x.events.map((e,t)=>(0,P.jsx)(J,{actor:b?(0,P.jsxs)(`span`,{className:z.rowActor,children:[(0,P.jsx)(`span`,{children:e.actor.label}),(0,P.jsx)(c,{onClick:()=>_(e),size:`compact`,variant:`quiet`,children:`Inspect`})]}):void 0,continued:t<x.events.length-1,event:e},e.eventKey))})}),x.nextCursor===null?null:(0,P.jsx)(c,{disabled:x.isLoadingMore,onClick:v.loadMore,size:`principal`,stretch:!0,children:x.isLoadingMore?`Loading…`:`Show earlier activity`}),(0,P.jsx)(R,{agentHref:h===null?y:X(i.pathname,i.search,i.hash,h.eventKey),event:h,onClose:()=>_(null),onSessionExpired:a.invalidateSession,sessionKey:s,...e===void 0?{}:{transport:e}})]})};export{Q as TimelinePage,Y as canInspectTimelineDetails,X as timelineEventAgentPath};
|
|
2
|
+
//# sourceMappingURL=TimelinePage-FrvepGa_.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimelinePage-Ccnp6Mmg.js","names":[],"sources":["../../../src/client/timeline/TimelineDetailSheet.module.css","../../../src/client/timeline/useTimelineDetail.ts","../../../src/client/timeline/TimelineDetailSheet.tsx","../../../src/client/timeline/TimelinePage.module.css","../../../src/client/timeline/useTimeline.ts","../../../src/client/timeline/TimelinePage.tsx"],"sourcesContent":[".body,\n.loading,\n.content,\n.identity,\n.identityMeta,\n.section,\n.ledger {\n display: grid;\n}\n\n.body,\n.loading,\n.content {\n gap: var(--rly-space-20);\n}\n\n.identity,\n.section {\n gap: var(--rly-space-12);\n}\n\n.identity {\n padding-block: var(--rly-space-12) var(--rly-space-20);\n border-block-end: 1px solid var(--rly-color-border-1);\n}\n\n.identity h2,\n.identity p,\n.section h3,\n.ledger dd {\n margin: 0;\n}\n\n.identity h2 {\n max-inline-size: 13ch;\n overflow-wrap: anywhere;\n text-wrap: balance;\n}\n\n.identityMeta {\n grid-template-columns: repeat(2, minmax(0, max-content));\n align-items: center;\n gap: var(--rly-space-8) var(--rly-space-12);\n}\n\n.ledger {\n margin: 0;\n}\n\n.ledger div {\n display: grid;\n grid-template-columns: minmax(7rem, 0.35fr) minmax(0, 1fr);\n gap: var(--rly-space-12);\n padding-block: var(--rly-space-12);\n border-block-start: 1px solid var(--rly-color-border-1);\n}\n\n.ledger dt {\n color: var(--rly-color-text-2);\n font: var(--rly-type-meta-weight) var(--rly-type-meta-size) / var(--rly-type-meta-line-height)\n var(--rly-type-meta-font);\n}\n\n.ledger dd {\n overflow-wrap: anywhere;\n font: var(--rly-type-code-weight) var(--rly-type-code-size) / var(--rly-type-code-line-height)\n var(--rly-type-code-font);\n}\n\n.footerLink {\n min-block-size: 3rem;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding-inline: var(--rly-space-16);\n border-radius: var(--rly-radius-control);\n background: var(--rly-color-action-background);\n color: var(--rly-color-action-foreground);\n font: var(--rly-type-label-weight) var(--rly-type-label-size) / var(--rly-type-label-line-height)\n var(--rly-type-label-font);\n text-align: center;\n text-decoration: none;\n}\n\n.footerLink:focus-visible {\n outline: 2px solid var(--rly-color-focus);\n outline-offset: var(--rly-space-2);\n}\n\n@media (max-width: 30rem) {\n .identityMeta,\n .ledger div {\n grid-template-columns: minmax(0, 1fr);\n }\n}\n","import * as Effect from \"effect/Effect\"\nimport * as Predicate from \"effect/Predicate\"\nimport * as FetchHttpClient from \"effect/unstable/http/FetchHttpClient\"\nimport { useCallback, useEffect, useState } from \"react\"\n\nimport { makeControlCenterApiClient } from \"../../api/client.js\"\nimport type { TimelineEvent, TimelineEventDetail } from \"../../domain/timeline.js\"\n\n/** Browser boundary for one exact owner-only Timeline event expansion. */\nexport interface TimelineDetailTransport {\n readonly load: (eventKey: TimelineEvent[\"eventKey\"], signal: AbortSignal) => Promise<TimelineEventDetail>\n}\n\nexport type TimelineDetailState =\n | { readonly _tag: \"idle\" }\n | {\n readonly _tag: \"loading\"\n readonly eventKey: TimelineEvent[\"eventKey\"]\n readonly sessionKey: string\n }\n | {\n readonly _tag: \"failed\"\n readonly eventKey: TimelineEvent[\"eventKey\"]\n readonly sessionKey: string\n }\n | {\n readonly _tag: \"ready\"\n readonly detail: TimelineEventDetail\n readonly eventKey: TimelineEvent[\"eventKey\"]\n readonly sessionKey: string\n }\n\nconst isUnauthorizedFailure = Predicate.isTagged(\"UnauthorizedApiError\")\n\n/** Generated-client transport for an owner-authorized event detail read. */\nexport const browserTimelineDetailTransport: TimelineDetailTransport = {\n load: (eventKey, signal) =>\n Effect.runPromise(\n Effect.gen(function*() {\n const client = yield* makeControlCenterApiClient()\n return yield* client.timeline.detail({ params: { eventKey } })\n }).pipe(Effect.provide(FetchHttpClient.layer)),\n { signal }\n )\n}\n\n/** Keep a detail result bound to the exact event and authenticated session that requested it. */\nexport const useTimelineDetail = (\n eventKey: TimelineEvent[\"eventKey\"] | null,\n sessionKey: string | null,\n onSessionExpired: (sessionKey: string) => void,\n transport: TimelineDetailTransport = browserTimelineDetailTransport\n) => {\n const [requestRevision, setRequestRevision] = useState(0)\n const [state, setState] = useState<TimelineDetailState>({ _tag: \"idle\" })\n\n useEffect(() => {\n if (eventKey === null || sessionKey === null) {\n setState({ _tag: \"idle\" })\n return\n }\n const abort = new AbortController()\n setState({ _tag: \"loading\", eventKey, sessionKey })\n transport.load(eventKey, abort.signal).then(\n (detail) => {\n if (!abort.signal.aborted) setState({ _tag: \"ready\", detail, eventKey, sessionKey })\n },\n (failure) => {\n if (abort.signal.aborted) return\n if (isUnauthorizedFailure(failure)) onSessionExpired(sessionKey)\n setState({ _tag: \"failed\", eventKey, sessionKey })\n }\n )\n return () => abort.abort()\n }, [eventKey, onSessionExpired, requestRevision, sessionKey, transport])\n\n const currentState: TimelineDetailState = eventKey === null || sessionKey === null\n ? { _tag: \"idle\" }\n : state._tag === \"idle\" || state.eventKey !== eventKey || state.sessionKey !== sessionKey\n ? { _tag: \"loading\", eventKey, sessionKey }\n : state\n\n return {\n retry: useCallback(() => setRequestRevision((revision) => revision + 1), []),\n state: currentState\n }\n}\n","import { ServiceMark } from \"@knpkv/rly/patterns\"\nimport { Button, Sheet, Skeleton, StateLabel, StatePanel, Text } from \"@knpkv/rly/primitives\"\nimport * as DateTime from \"effect/DateTime\"\nimport type { ReactElement } from \"react\"\nimport { Link } from \"react-router\"\n\nimport type { TimelineEvent, TimelineEventDetail, TimelineSourceKind } from \"../../domain/timeline.js\"\nimport styles from \"./TimelineDetailSheet.module.css\"\nimport { type TimelineDetailTransport, useTimelineDetail } from \"./useTimelineDetail.js\"\n\nconst sourceLabels = {\n action: \"Governed action\",\n \"plugin-sync\": \"Service sync\",\n relationship: \"Delivery link\",\n system: \"Control Center\"\n} satisfies Readonly<Record<TimelineSourceKind, string>>\n\nconst formatTimestamp = (event: TimelineEvent): string =>\n DateTime.formatUtc(event.occurredAt, {\n day: \"2-digit\",\n hour: \"2-digit\",\n hour12: false,\n locale: \"en-GB\",\n minute: \"2-digit\",\n month: \"short\",\n second: \"2-digit\",\n year: \"numeric\"\n })\n\n/** Non-secret durable references that make one owner-visible event attributable. */\nexport const timelineDetailLedger = (\n detail: TimelineEventDetail\n): ReadonlyArray<{ readonly label: string; readonly value: string }> => {\n const optionalEntries: ReadonlyArray<{ readonly label: string; readonly value: string | null }> = [\n { label: \"Actor\", value: detail.identifiers.actorId },\n { label: \"Agent job\", value: detail.agentJob?.jobId ?? null },\n { label: \"Action\", value: detail.identifiers.actionId },\n { label: \"Relationship\", value: detail.identifiers.relationshipId },\n { label: \"Connection\", value: detail.identifiers.pluginConnectionId },\n { label: \"Release\", value: detail.identifiers.releaseId },\n { label: \"Entity\", value: detail.identifiers.entityId }\n ]\n return [\n { label: \"Event\", value: detail.event.eventKey },\n { label: \"Type\", value: detail.event.eventType },\n ...optionalEntries.filter(\n (entry): entry is { readonly label: string; readonly value: string } => entry.value !== null\n )\n ]\n}\n\n/** Owner-only expansion of one redacted Timeline row into its durable provenance. */\nexport const TimelineDetailSheet = ({\n agentHref,\n event,\n onClose,\n onSessionExpired,\n sessionKey,\n transport\n}: {\n readonly agentHref: string\n readonly event: TimelineEvent | null\n readonly onClose: () => void\n readonly onSessionExpired: (sessionKey: string) => void\n readonly sessionKey: string | null\n readonly transport?: TimelineDetailTransport\n}): ReactElement => {\n const controller = useTimelineDetail(event?.eventKey ?? null, sessionKey, onSessionExpired, transport)\n\n return (\n <Sheet.Root\n onOpenChange={(open) => {\n if (!open) onClose()\n }}\n open={event !== null}\n >\n <Sheet.Content\n closeLabel=\"Close event details\"\n description=\"Durable provenance for this exact workspace event.\"\n title=\"Event details\"\n >\n <Sheet.Body className={styles.body}>\n {event === null || controller.state._tag === \"idle\" || controller.state._tag === \"loading\" ? (\n <div aria-busy=\"true\" aria-label=\"Loading event details\" className={styles.loading}>\n <Skeleton height=\"10rem\" />\n <Skeleton height=\"14rem\" />\n </div>\n ) : controller.state._tag === \"failed\" ? (\n <StatePanel\n action={<Button onClick={controller.retry}>Try again</Button>}\n description=\"The Timeline row remains unchanged. Its provenance could not be loaded.\"\n title=\"Event details unavailable\"\n tone=\"caution\"\n />\n ) : (\n <div className={styles.content}>\n <section aria-labelledby=\"timeline-detail-title\" className={styles.identity}>\n <Text tone=\"secondary\" variant=\"label\">\n {sourceLabels[controller.state.detail.event.sourceKind]}\n </Text>\n <Text as=\"h2\" id=\"timeline-detail-title\" variant=\"page-title\">\n {controller.state.detail.event.title}\n </Text>\n <div className={styles.identityMeta}>\n <StateLabel\n label={controller.state.detail.event.actor.kind}\n size=\"compact\"\n tone={controller.state.detail.event.actor.kind === \"agent\" ? \"progress\" : \"neutral\"}\n />\n {controller.state.detail.event.service === null ? null : (\n <ServiceMark service={controller.state.detail.event.service} size=\"compact\" />\n )}\n <Text tone=\"secondary\" variant=\"meta\">\n {controller.state.detail.event.actor.label}\n </Text>\n <Text\n as=\"time\"\n dateTime={DateTime.formatIso(controller.state.detail.event.occurredAt)}\n tone=\"secondary\"\n variant=\"meta\"\n >\n {formatTimestamp(controller.state.detail.event)} UTC\n </Text>\n </div>\n </section>\n\n <section aria-labelledby=\"timeline-provenance-title\" className={styles.section}>\n <Text as=\"h3\" id=\"timeline-provenance-title\" variant=\"section-title\">\n Provenance\n </Text>\n <dl className={styles.ledger}>\n {timelineDetailLedger(controller.state.detail).map(({ label, value }) => (\n <div key={label}>\n <dt>{label}</dt>\n <dd>{value}</dd>\n </div>\n ))}\n </dl>\n </section>\n </div>\n )}\n </Sheet.Body>\n <Sheet.Footer>\n <Link className={styles.footerLink} to={agentHref}>\n Ask Relay about this event\n </Link>\n </Sheet.Footer>\n </Sheet.Content>\n </Sheet.Root>\n )\n}\n",".page,\n.hero,\n.page {\n gap: clamp(2.5rem, 7vw, 6rem);\n}\n\n.hero {\n gap: var(--rly-space-16);\n}\n\n.hero p,\n.hero h1 {\n margin: 0;\n}\n\n.hero h1 {\n max-inline-size: 9ch;\n letter-spacing: -0.075em;\n text-wrap: balance;\n}\n\n.intro {\n max-inline-size: 46rem;\n}\n\n.askRelay {\n inline-size: fit-content;\n min-block-size: 3.5rem;\n display: inline-flex;\n align-items: center;\n padding-inline: var(--rly-space-20);\n border-radius: var(--rly-radius-control);\n background: var(--rly-color-action-background);\n color: var(--rly-color-action-foreground);\n font: var(--rly-type-label-weight) var(--rly-type-label-size) / var(--rly-type-label-line-height)\n var(--rly-type-label-font);\n text-decoration: none;\n}\n\n.summary {\n display: grid;\n grid-template-columns: repeat(4, minmax(0, 1fr));\n margin: 0;\n overflow: hidden;\n border: 1px solid var(--rly-color-border-1);\n border-radius: var(--rly-radius-group);\n}\n\n.summary div {\n display: grid;\n gap: var(--rly-space-12);\n min-block-size: 8rem;\n padding: var(--rly-space-20);\n background: var(--rly-color-surface-1);\n}\n\n.summary div + div {\n border-inline-start: 1px solid var(--rly-color-border-1);\n}\n\n.summary dt {\n color: var(--rly-color-text-2);\n font: var(--rly-type-label-weight) var(--rly-type-label-size) / var(--rly-type-label-line-height)\n var(--rly-type-label-font);\n}\n\n.summary dd {\n margin: 0;\n color: var(--rly-color-text-1);\n font-size: clamp(2.5rem, 6vw, 5rem);\n font-weight: 700;\n line-height: 0.9;\n letter-spacing: -0.07em;\n}\n\n.summary div[data-source=\"action\"] {\n box-shadow: inset 0 4px var(--rly-color-service-codecommit);\n}\n.summary div[data-source=\"relationship\"] {\n box-shadow: inset 0 4px var(--rly-color-service-codepipeline);\n}\n.summary div[data-source=\"plugin-sync\"] {\n box-shadow: inset 0 4px var(--rly-color-service-jira);\n}\n.summary div[data-source=\"system\"] {\n box-shadow: inset 0 4px var(--rly-color-focus);\n}\n\n.filters {\n display: grid;\n grid-template-columns: 2fr 1fr 1fr;\n gap: var(--rly-space-12);\n}\n\n.filters label {\n display: grid;\n gap: var(--rly-space-8);\n color: var(--rly-color-text-2);\n font: var(--rly-type-label-weight) var(--rly-type-label-size) / var(--rly-type-label-line-height)\n var(--rly-type-label-font);\n}\n\n.filters select,\n.filters input {\n min-block-size: 3.5rem;\n inline-size: 100%;\n padding-inline: var(--rly-space-16);\n border: 1px solid var(--rly-color-border-2);\n border-radius: var(--rly-radius-control);\n background: var(--rly-color-surface-1);\n color: var(--rly-color-text-1);\n font: inherit;\n}\n\n.events {\n margin: 0;\n padding: 0;\n list-style: none;\n border-block-start: 1px solid var(--rly-color-border-1);\n}\n\n.rowActor {\n display: grid;\n gap: var(--rly-space-8);\n justify-items: start;\n}\n\n@media (max-width: 48rem) {\n .summary {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n }\n .summary div:nth-child(3) {\n border-inline-start: 0;\n }\n .summary div:nth-child(n + 3) {\n border-block-start: 1px solid var(--rly-color-border-1);\n }\n .filters {\n grid-template-columns: 1fr;\n }\n}\n","import * as DateTime from \"effect/DateTime\"\nimport * as Effect from \"effect/Effect\"\nimport * as Predicate from \"effect/Predicate\"\nimport * as Schema from \"effect/Schema\"\nimport * as FetchHttpClient from \"effect/unstable/http/FetchHttpClient\"\nimport { useCallback, useEffect, useRef, useState } from \"react\"\n\nimport { makeControlCenterApiClient } from \"../../api/client.js\"\nimport type { TimelineActorKind, TimelineCursor, TimelineEvent, TimelinePage } from \"../../domain/timeline.js\"\nimport { UtcTimestamp } from \"../../domain/utcTimestamp.js\"\n\n/** User-controlled Timeline filters. */\nexport interface TimelineFilters {\n readonly actorKind: TimelineActorKind | \"all\"\n readonly from: string\n readonly to: string\n}\n\n/** Browser transport boundary for Timeline tests and authenticated reads. */\nexport interface TimelineTransport {\n readonly load: (\n signal: AbortSignal,\n filters: TimelineFilters,\n cursor: TimelineCursor | null\n ) => Promise<TimelinePage>\n}\n\nexport type TimelineState =\n | { readonly _tag: \"idle\" }\n | { readonly _tag: \"loading\" }\n | { readonly _tag: \"failed\" }\n | {\n readonly _tag: \"ready\"\n readonly events: ReadonlyArray<TimelineEvent>\n readonly isLoadingMore: boolean\n readonly nextCursor: TimelineCursor | null\n }\n\n/** Generated-client transport for the authenticated Timeline page. */\nexport const browserTimelineTransport: TimelineTransport = {\n load: (signal, filters, cursor) =>\n Effect.runPromise(\n Effect.gen(function*() {\n const client = yield* makeControlCenterApiClient()\n const from = filters.from.length === 0\n ? undefined\n : yield* Schema.decodeUnknownEffect(UtcTimestamp)(`${filters.from}T00:00:00.000Z`)\n const to = filters.to.length === 0\n ? undefined\n : yield* Schema.decodeUnknownEffect(UtcTimestamp)(`${filters.to}T23:59:59.999Z`)\n return yield* client.timeline.page({\n query: {\n ...(!(filters.actorKind === \"all\") && { actor: filters.actorKind }),\n ...(!(cursor === null) && { beforeEventKey: cursor.eventKey, beforeOccurredAt: cursor.occurredAt }),\n ...(!(from === undefined) && { from }),\n limit: 50,\n ...(!(to === undefined) && { to })\n }\n })\n }).pipe(Effect.provide(FetchHttpClient.layer)),\n { signal }\n )\n}\n\nconst isUnauthorizedFailure = Predicate.isTagged(\"UnauthorizedApiError\")\n\n/** Load and incrementally page one exact authenticated Timeline filter set. */\nexport const useTimeline = (\n filters: TimelineFilters,\n sessionKey: string | null,\n onSessionExpired: (sessionKey: string) => void,\n transport: TimelineTransport = browserTimelineTransport\n) => {\n const [requestRevision, setRequestRevision] = useState(0)\n const [state, setState] = useState<TimelineState>({ _tag: \"idle\" })\n const activeRequest = useRef<AbortController | null>(null)\n const filterKey = `${filters.actorKind}|${filters.from}|${filters.to}`\n\n useEffect(() => {\n activeRequest.current?.abort()\n if (sessionKey === null) {\n setState({ _tag: \"idle\" })\n return\n }\n const request = new AbortController()\n activeRequest.current = request\n setState({ _tag: \"loading\" })\n transport.load(request.signal, filters, null).then(\n (page) => {\n if (!request.signal.aborted) {\n setState({ _tag: \"ready\", events: page.events, isLoadingMore: false, nextCursor: page.nextCursor })\n }\n },\n (failure) => {\n if (request.signal.aborted) return\n if (isUnauthorizedFailure(failure)) onSessionExpired(sessionKey)\n setState({ _tag: \"failed\" })\n }\n )\n return () => request.abort()\n }, [filterKey, filters, onSessionExpired, requestRevision, sessionKey, transport])\n\n const loadMore = useCallback((): void => {\n if (sessionKey === null || state._tag !== \"ready\" || state.nextCursor === null || state.isLoadingMore) return\n activeRequest.current?.abort()\n const request = new AbortController()\n activeRequest.current = request\n const current = state\n setState({ ...current, isLoadingMore: true })\n transport.load(request.signal, filters, current.nextCursor).then(\n (page) => {\n if (!request.signal.aborted) {\n setState({\n _tag: \"ready\",\n events: [...current.events, ...page.events],\n isLoadingMore: false,\n nextCursor: page.nextCursor\n })\n }\n },\n (failure) => {\n if (request.signal.aborted) return\n if (isUnauthorizedFailure(failure)) onSessionExpired(sessionKey)\n setState({ ...current, isLoadingMore: false })\n }\n )\n }, [filters, onSessionExpired, sessionKey, state, transport])\n\n return {\n loadMore,\n retry: useCallback(() => setRequestRevision((revision) => revision + 1), []),\n state\n }\n}\n\n/** Compact UTC timestamp for Timeline rows. */\nexport const formatTimelineTimestamp = (timestamp: TimelineEvent[\"occurredAt\"]): string =>\n new Intl.DateTimeFormat(\"en-GB\", {\n dateStyle: \"medium\",\n timeStyle: \"short\",\n timeZone: \"UTC\"\n }).format(DateTime.toDateUtc(timestamp))\n","import { LinkProvider } from \"@knpkv/rly/foundations\"\nimport { TimelineRow as RlyTimelineRow } from \"@knpkv/rly/patterns\"\nimport { Button, StatePanel, Text } from \"@knpkv/rly/primitives\"\nimport * as DateTime from \"effect/DateTime\"\nimport { type ReactElement, type ReactNode, useMemo, useState } from \"react\"\nimport { Link, useLocation } from \"react-router\"\n\nimport type { TimelineActorKind, TimelineEvent, TimelineSourceKind } from \"../../domain/timeline.js\"\nimport { browserReadableSessionKey, type BrowserSessionState, useBrowserSession } from \"../BrowserSession.js\"\nimport { contextualAgentPath } from \"../contextualAgentPath.js\"\nimport { WorkspaceEntityLink } from \"../entities/WorkspaceEntityLink.js\"\nimport { TimelineDetailSheet } from \"./TimelineDetailSheet.js\"\nimport type { TimelineDetailTransport } from \"./useTimelineDetail.js\"\nimport styles from \"./TimelinePage.module.css\"\nimport {\n browserTimelineTransport,\n formatTimelineTimestamp,\n type TimelineFilters,\n type TimelineTransport,\n useTimeline\n} from \"./useTimeline.js\"\n\nconst actorOptions: ReadonlyArray<{ readonly label: string; readonly value: TimelineActorKind | \"all\" }> = [\n { label: \"Everyone\", value: \"all\" },\n { label: \"People\", value: \"human\" },\n { label: \"Agents\", value: \"agent\" },\n { label: \"Services\", value: \"plugin\" },\n { label: \"System\", value: \"system\" }\n]\nconst timelineSources: ReadonlyArray<TimelineSourceKind> = [\"action\", \"relationship\", \"plugin-sync\", \"system\"]\n\nconst actorFilter = (value: string): TimelineFilters[\"actorKind\"] =>\n actorOptions.find((option) => option.value === value)?.value ?? \"all\"\n\nconst sourcePresentation = {\n action: { label: \"Governed action\" },\n \"plugin-sync\": { label: \"Service sync\" },\n relationship: { label: \"Delivery link\" },\n system: { label: \"Control Center\" }\n} satisfies Readonly<Record<TimelineSourceKind, { readonly label: string }>>\n\nconst TimelineRow = ({\n actor,\n continued,\n event\n}: {\n readonly actor?: ReactNode\n readonly continued: boolean\n readonly event: TimelineEvent\n}): ReactElement => (\n <RlyTimelineRow\n continued={continued}\n event={{\n actor: actor ?? event.actor.label,\n actorKind: event.actor.kind,\n dateTime: DateTime.formatIso(event.occurredAt),\n detail: sourcePresentation[event.sourceKind].label,\n ...(!(event.href === null) && { href: event.href }),\n id: event.eventKey,\n ...(!(event.service === null) && { service: event.service }),\n time: formatTimelineTimestamp(event.occurredAt),\n title: event.title\n }}\n />\n)\n\n/** Only workspace owners can deliberately expand redacted Timeline rows. */\nexport const canInspectTimelineDetails = (state: BrowserSessionState): boolean => {\n switch (state._tag) {\n case \"authenticated\":\n return state.session.permission === \"workspace-owner\"\n case \"storage-unavailable\":\n return state.session?.permission === \"workspace-owner\"\n case \"anonymous\":\n case \"blocked\":\n case \"checking\":\n case \"unavailable\":\n return false\n }\n}\n\n/** Preserve one selected event alongside the current Timeline filters for Relay. */\nexport const timelineEventAgentPath = (\n pathname: string,\n search: string,\n hash: string,\n eventKey: TimelineEvent[\"eventKey\"]\n): string => {\n const context = new URLSearchParams(search)\n context.set(\"event\", eventKey)\n return contextualAgentPath(pathname, `?${context.toString()}`, hash)\n}\n\nconst SourceSummary = ({ events }: { readonly events: ReadonlyArray<TimelineEvent> }): ReactElement => {\n const totals = useMemo(\n () =>\n new Map<TimelineSourceKind, number>([\n [\"action\", events.filter(({ sourceKind }) => sourceKind === \"action\").length],\n [\"relationship\", events.filter(({ sourceKind }) => sourceKind === \"relationship\").length],\n [\"plugin-sync\", events.filter(({ sourceKind }) => sourceKind === \"plugin-sync\").length],\n [\"system\", events.filter(({ sourceKind }) => sourceKind === \"system\").length]\n ]),\n [events]\n )\n return (\n <dl className={styles.summary}>\n {timelineSources.map((source) => {\n return (\n <div data-source={source} key={source}>\n <dt>{sourcePresentation[source].label}</dt>\n <dd>{totals.get(source) ?? 0}</dd>\n </div>\n )\n })}\n </dl>\n )\n}\n\n/** Bird's-eye view of attributable human, agent, service, and system activity. */\nexport const TimelinePage = ({\n detailTransport,\n transport = browserTimelineTransport\n}: {\n readonly detailTransport?: TimelineDetailTransport\n readonly transport?: TimelineTransport\n} = {}): ReactElement => {\n const location = useLocation()\n const browserSession = useBrowserSession()\n const sessionKey = browserReadableSessionKey(browserSession.state)\n const [filters, setFilters] = useState<TimelineFilters>({ actorKind: \"all\", from: \"\", to: \"\" })\n const [selectedEvent, setSelectedEvent] = useState<TimelineEvent | null>(null)\n const controller = useTimeline(filters, sessionKey, browserSession.invalidateSession, transport)\n const agentHref = contextualAgentPath(location.pathname, location.search, location.hash)\n const canInspect = canInspectTimelineDetails(browserSession.state)\n\n if (controller.state._tag === \"idle\" || controller.state._tag === \"loading\") {\n return (\n <StatePanel description=\"Combining durable activity across your connected services.\" title=\"Loading Timeline\" />\n )\n }\n if (controller.state._tag === \"failed\") {\n return (\n <StatePanel\n action={<Button onClick={controller.retry}>Try again</Button>}\n description=\"The Timeline could not be read.\"\n title=\"Timeline unavailable\"\n />\n )\n }\n const timelineState = controller.state\n\n return (\n <article className={styles.page}>\n <header className={styles.hero}>\n <Text as=\"p\" tone=\"secondary\" variant=\"label\">\n Timeline\n </Text>\n <Text as=\"h1\" variant=\"verdict\">\n Everything\n <br />\n that moved.\n </Text>\n <Text className={styles.intro} tone=\"secondary\" variant=\"body-large\">\n One chronological truth across people, agents, code, delivery links, and connected services.\n </Text>\n <Link className={styles.askRelay} to={agentHref}>\n Ask Relay about this Timeline\n </Link>\n </header>\n\n <SourceSummary events={timelineState.events} />\n\n <section aria-label=\"Timeline filters\" className={styles.filters}>\n <label>\n <span>Actor</span>\n <select\n value={filters.actorKind}\n onChange={(event) => setFilters({ ...filters, actorKind: actorFilter(event.currentTarget.value) })}\n >\n {actorOptions.map((option) => (\n <option key={option.value} value={option.value}>\n {option.label}\n </option>\n ))}\n </select>\n </label>\n <label>\n <span>From</span>\n <input\n type=\"date\"\n value={filters.from}\n onChange={(event) => setFilters({ ...filters, from: event.currentTarget.value })}\n />\n </label>\n <label>\n <span>To</span>\n <input\n type=\"date\"\n value={filters.to}\n onChange={(event) => setFilters({ ...filters, to: event.currentTarget.value })}\n />\n </label>\n </section>\n\n {timelineState.events.length === 0 ? (\n <StatePanel description=\"Try a wider date range or another actor.\" title=\"No activity in this view\" />\n ) : (\n <LinkProvider component={WorkspaceEntityLink}>\n <ol className={styles.events}>\n {timelineState.events.map((event, index) => (\n <TimelineRow\n actor={\n canInspect ? (\n <span className={styles.rowActor}>\n <span>{event.actor.label}</span>\n <Button onClick={() => setSelectedEvent(event)} size=\"compact\" variant=\"quiet\">\n Inspect\n </Button>\n </span>\n ) : undefined\n }\n continued={index < timelineState.events.length - 1}\n event={event}\n key={event.eventKey}\n />\n ))}\n </ol>\n </LinkProvider>\n )}\n {timelineState.nextCursor === null ? null : (\n <Button disabled={timelineState.isLoadingMore} onClick={controller.loadMore} size=\"principal\" stretch>\n {timelineState.isLoadingMore ? \"Loading…\" : \"Show earlier activity\"}\n </Button>\n )}\n <TimelineDetailSheet\n agentHref={\n selectedEvent === null\n ? agentHref\n : timelineEventAgentPath(location.pathname, location.search, location.hash, selectedEvent.eventKey)\n }\n event={selectedEvent}\n onClose={() => setSelectedEvent(null)}\n onSessionExpired={browserSession.invalidateSession}\n sessionKey={sessionKey}\n {...(detailTransport === undefined ? {} : { transport: detailTransport })}\n />\n </article>\n )\n}\n"],"mappings":"y4BCgCM,EAAwB,EAAmB,sBAAsB,EAG1D,EAA0D,CACrE,MAAO,EAAU,IACf,EACE,EAAW,WAAY,CAErB,OAAO,OAAO,MADQ,EAA2B,EAAA,CAC5B,SAAS,OAAO,CAAE,OAAQ,CAAE,UAAS,CAAE,CAAC,CAC/D,CAAC,CAAC,CAAC,KAAK,EAAe,CAAqB,CAAC,EAC7C,CAAE,QAAO,CACX,CACJ,EAGa,GACX,EACA,EACA,EACA,EAAqC,IAClC,CACH,GAAM,CAAC,EAAiB,IAAA,EAAsB,EAAA,SAAA,CAAS,CAAC,EAClD,CAAC,EAAO,IAAA,EAAY,EAAA,SAAA,CAA8B,CAAE,KAAM,MAAO,CAAC,GAExE,EAAA,EAAA,UAAA,KAAgB,CACd,GAAI,IAAa,MAAQ,IAAe,KAAM,CAC5C,EAAS,CAAE,KAAM,MAAO,CAAC,EACzB,MACF,CACA,IAAM,EAAQ,IAAI,gBAYlB,OAXA,EAAS,CAAE,KAAM,UAAW,WAAU,YAAW,CAAC,EAClD,EAAU,KAAK,EAAU,EAAM,MAAM,CAAC,CAAC,KACpC,GAAW,CACL,EAAM,OAAO,SAAS,EAAS,CAAE,KAAM,QAAS,SAAQ,WAAU,YAAW,CAAC,CACrF,EACC,GAAY,CACP,EAAM,OAAO,UACb,EAAsB,CAAO,GAAG,EAAiB,CAAU,EAC/D,EAAS,CAAE,KAAM,SAAU,WAAU,YAAW,CAAC,EACnD,CACF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AAA,EACE,EAAA,EAAA,IAAA,CAAC,OAAD,CAAA,SAAO,EAAM,MAAM,KAAY,CAAA,GAC/B,EAAA,EAAA,IAAA,CAAC,EAAD,CAAQ,YAAe,EAAiB,CAAK,EAAG,KAAK,UAAU,QAAQ,QAAQ,SAAA,SAEvE,CAAA,CACJ,CACJ,CAAA,EAAA,IAAA,GAEN,UAAW,EAAQ,EAAc,OAAO,OAAS,EAC1C,OAER,EADM,EAAM,QACZ,CACF,CACC,CAAA,CACQ,CAAA,EAEf,EAAc,aAAe,KAAO,MACnC,EAAA,EAAA,IAAA,CAAC,EAAD,CAAQ,SAAU,EAAc,cAAe,QAAS,EAAW,SAAU,KAAK,YAAY,QAAA,GAC3F,SAAA,EAAc,cAAgB,WAAa,uBACtC,CAAA,GAEV,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,UACE,IAAkB,KACd,EACA,EAAuB,EAAS,SAAU,EAAS,OAAQ,EAAS,KAAM,EAAc,QAAQ,EAEtG,MAAO,EACP,YAAe,EAAiB,IAAI,EACpC,iBAAkB,EAAe,kBACrB,aACZ,GAAK,IAAoB,IAAA,GAAY,CAAC,EAAI,CAAE,UAAW,CAAgB,CACxE,CAAA,CACM,GAEb"}
|
|
1
|
+
{"version":3,"file":"TimelinePage-FrvepGa_.js","names":[],"sources":["../../../src/client/timeline/TimelineDetailSheet.module.css","../../../src/client/timeline/useTimelineDetail.ts","../../../src/client/timeline/TimelineDetailSheet.tsx","../../../src/client/timeline/TimelinePage.module.css","../../../src/client/timeline/useTimeline.ts","../../../src/client/timeline/TimelinePage.tsx"],"sourcesContent":[".body,\n.loading,\n.content,\n.identity,\n.identityMeta,\n.section,\n.ledger {\n display: grid;\n}\n\n.body,\n.loading,\n.content {\n gap: var(--rly-space-20);\n}\n\n.identity,\n.section {\n gap: var(--rly-space-12);\n}\n\n.identity {\n padding-block: var(--rly-space-12) var(--rly-space-20);\n border-block-end: 1px solid var(--rly-color-border-1);\n}\n\n.identity h2,\n.identity p,\n.section h3,\n.ledger dd {\n margin: 0;\n}\n\n.identity h2 {\n max-inline-size: 13ch;\n overflow-wrap: anywhere;\n text-wrap: balance;\n}\n\n.identityMeta {\n grid-template-columns: repeat(2, minmax(0, max-content));\n align-items: center;\n gap: var(--rly-space-8) var(--rly-space-12);\n}\n\n.ledger {\n margin: 0;\n}\n\n.ledger div {\n display: grid;\n grid-template-columns: minmax(7rem, 0.35fr) minmax(0, 1fr);\n gap: var(--rly-space-12);\n padding-block: var(--rly-space-12);\n border-block-start: 1px solid var(--rly-color-border-1);\n}\n\n.ledger dt {\n color: var(--rly-color-text-2);\n font: var(--rly-type-meta-weight) var(--rly-type-meta-size) / var(--rly-type-meta-line-height)\n var(--rly-type-meta-font);\n}\n\n.ledger dd {\n overflow-wrap: anywhere;\n font: var(--rly-type-code-weight) var(--rly-type-code-size) / var(--rly-type-code-line-height)\n var(--rly-type-code-font);\n}\n\n.footerLink {\n min-block-size: 3rem;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding-inline: var(--rly-space-16);\n border-radius: var(--rly-radius-control);\n background: var(--rly-color-action-background);\n color: var(--rly-color-action-foreground);\n font: var(--rly-type-label-weight) var(--rly-type-label-size) / var(--rly-type-label-line-height)\n var(--rly-type-label-font);\n text-align: center;\n text-decoration: none;\n}\n\n.footerLink:focus-visible {\n outline: 2px solid var(--rly-color-focus);\n outline-offset: var(--rly-space-2);\n}\n\n@media (max-width: 30rem) {\n .identityMeta,\n .ledger div {\n grid-template-columns: minmax(0, 1fr);\n }\n}\n","import * as Effect from \"effect/Effect\"\nimport * as Predicate from \"effect/Predicate\"\nimport * as FetchHttpClient from \"effect/unstable/http/FetchHttpClient\"\nimport { useCallback, useEffect, useState } from \"react\"\n\nimport { makeControlCenterApiClient } from \"../../api/client.js\"\nimport type { TimelineEvent, TimelineEventDetail } from \"../../domain/timeline.js\"\n\n/** Browser boundary for one exact owner-only Timeline event expansion. */\nexport interface TimelineDetailTransport {\n readonly load: (eventKey: TimelineEvent[\"eventKey\"], signal: AbortSignal) => Promise<TimelineEventDetail>\n}\n\nexport type TimelineDetailState =\n | { readonly _tag: \"idle\" }\n | {\n readonly _tag: \"loading\"\n readonly eventKey: TimelineEvent[\"eventKey\"]\n readonly sessionKey: string\n }\n | {\n readonly _tag: \"failed\"\n readonly eventKey: TimelineEvent[\"eventKey\"]\n readonly sessionKey: string\n }\n | {\n readonly _tag: \"ready\"\n readonly detail: TimelineEventDetail\n readonly eventKey: TimelineEvent[\"eventKey\"]\n readonly sessionKey: string\n }\n\nconst isUnauthorizedFailure = Predicate.isTagged(\"UnauthorizedApiError\")\n\n/** Generated-client transport for an owner-authorized event detail read. */\nexport const browserTimelineDetailTransport: TimelineDetailTransport = {\n load: (eventKey, signal) =>\n Effect.runPromise(\n Effect.gen(function*() {\n const client = yield* makeControlCenterApiClient()\n return yield* client.timeline.detail({ params: { eventKey } })\n }).pipe(Effect.provide(FetchHttpClient.layer)),\n { signal }\n )\n}\n\n/** Keep a detail result bound to the exact event and authenticated session that requested it. */\nexport const useTimelineDetail = (\n eventKey: TimelineEvent[\"eventKey\"] | null,\n sessionKey: string | null,\n onSessionExpired: (sessionKey: string) => void,\n transport: TimelineDetailTransport = browserTimelineDetailTransport\n) => {\n const [requestRevision, setRequestRevision] = useState(0)\n const [state, setState] = useState<TimelineDetailState>({ _tag: \"idle\" })\n\n useEffect(() => {\n if (eventKey === null || sessionKey === null) {\n setState({ _tag: \"idle\" })\n return\n }\n const abort = new AbortController()\n setState({ _tag: \"loading\", eventKey, sessionKey })\n transport.load(eventKey, abort.signal).then(\n (detail) => {\n if (!abort.signal.aborted) setState({ _tag: \"ready\", detail, eventKey, sessionKey })\n },\n (failure) => {\n if (abort.signal.aborted) return\n if (isUnauthorizedFailure(failure)) onSessionExpired(sessionKey)\n setState({ _tag: \"failed\", eventKey, sessionKey })\n }\n )\n return () => abort.abort()\n }, [eventKey, onSessionExpired, requestRevision, sessionKey, transport])\n\n const currentState: TimelineDetailState = eventKey === null || sessionKey === null\n ? { _tag: \"idle\" }\n : state._tag === \"idle\" || state.eventKey !== eventKey || state.sessionKey !== sessionKey\n ? { _tag: \"loading\", eventKey, sessionKey }\n : state\n\n return {\n retry: useCallback(() => setRequestRevision((revision) => revision + 1), []),\n state: currentState\n }\n}\n","import { ServiceMark } from \"@knpkv/rly/patterns\"\nimport { Button, Sheet, Skeleton, StateLabel, StatePanel, Text } from \"@knpkv/rly/primitives\"\nimport * as DateTime from \"effect/DateTime\"\nimport type { ReactElement } from \"react\"\nimport { Link } from \"react-router\"\n\nimport type { TimelineEvent, TimelineEventDetail, TimelineSourceKind } from \"../../domain/timeline.js\"\nimport styles from \"./TimelineDetailSheet.module.css\"\nimport { type TimelineDetailTransport, useTimelineDetail } from \"./useTimelineDetail.js\"\n\nconst sourceLabels = {\n action: \"Governed action\",\n \"plugin-sync\": \"Service sync\",\n relationship: \"Delivery link\",\n system: \"Control Center\"\n} satisfies Readonly<Record<TimelineSourceKind, string>>\n\nconst formatTimestamp = (event: TimelineEvent): string =>\n DateTime.formatUtc(event.occurredAt, {\n day: \"2-digit\",\n hour: \"2-digit\",\n hour12: false,\n locale: \"en-GB\",\n minute: \"2-digit\",\n month: \"short\",\n second: \"2-digit\",\n year: \"numeric\"\n })\n\n/** Non-secret durable references that make one owner-visible event attributable. */\nexport const timelineDetailLedger = (\n detail: TimelineEventDetail\n): ReadonlyArray<{ readonly label: string; readonly value: string }> => {\n const optionalEntries: ReadonlyArray<{ readonly label: string; readonly value: string | null }> = [\n { label: \"Actor\", value: detail.identifiers.actorId },\n { label: \"Agent job\", value: detail.agentJob?.jobId ?? null },\n { label: \"Action\", value: detail.identifiers.actionId },\n { label: \"Relationship\", value: detail.identifiers.relationshipId },\n { label: \"Connection\", value: detail.identifiers.pluginConnectionId },\n { label: \"Release\", value: detail.identifiers.releaseId },\n { label: \"Entity\", value: detail.identifiers.entityId }\n ]\n return [\n { label: \"Event\", value: detail.event.eventKey },\n { label: \"Type\", value: detail.event.eventType },\n ...optionalEntries.filter(\n (entry): entry is { readonly label: string; readonly value: string } => entry.value !== null\n )\n ]\n}\n\n/** Owner-only expansion of one redacted Timeline row into its durable provenance. */\nexport const TimelineDetailSheet = ({\n agentHref,\n event,\n onClose,\n onSessionExpired,\n sessionKey,\n transport\n}: {\n readonly agentHref: string\n readonly event: TimelineEvent | null\n readonly onClose: () => void\n readonly onSessionExpired: (sessionKey: string) => void\n readonly sessionKey: string | null\n readonly transport?: TimelineDetailTransport\n}): ReactElement => {\n const controller = useTimelineDetail(event?.eventKey ?? null, sessionKey, onSessionExpired, transport)\n\n return (\n <Sheet.Root\n onOpenChange={(open) => {\n if (!open) onClose()\n }}\n open={event !== null}\n >\n <Sheet.Content\n closeLabel=\"Close event details\"\n description=\"Durable provenance for this exact workspace event.\"\n title=\"Event details\"\n >\n <Sheet.Body className={styles.body}>\n {event === null || controller.state._tag === \"idle\" || controller.state._tag === \"loading\" ? (\n <div aria-busy=\"true\" aria-label=\"Loading event details\" className={styles.loading}>\n <Skeleton height=\"10rem\" />\n <Skeleton height=\"14rem\" />\n </div>\n ) : controller.state._tag === \"failed\" ? (\n <StatePanel\n action={<Button onClick={controller.retry}>Try again</Button>}\n description=\"The Timeline row remains unchanged. Its provenance could not be loaded.\"\n title=\"Event details unavailable\"\n tone=\"caution\"\n />\n ) : (\n <div className={styles.content}>\n <section aria-labelledby=\"timeline-detail-title\" className={styles.identity}>\n <Text tone=\"secondary\" variant=\"label\">\n {sourceLabels[controller.state.detail.event.sourceKind]}\n </Text>\n <Text as=\"h2\" id=\"timeline-detail-title\" variant=\"page-title\">\n {controller.state.detail.event.title}\n </Text>\n <div className={styles.identityMeta}>\n <StateLabel\n label={controller.state.detail.event.actor.kind}\n size=\"compact\"\n tone={controller.state.detail.event.actor.kind === \"agent\" ? \"progress\" : \"neutral\"}\n />\n {controller.state.detail.event.service === null ? null : (\n <ServiceMark service={controller.state.detail.event.service} size=\"compact\" />\n )}\n <Text tone=\"secondary\" variant=\"meta\">\n {controller.state.detail.event.actor.label}\n </Text>\n <Text\n as=\"time\"\n dateTime={DateTime.formatIso(controller.state.detail.event.occurredAt)}\n tone=\"secondary\"\n variant=\"meta\"\n >\n {formatTimestamp(controller.state.detail.event)} UTC\n </Text>\n </div>\n </section>\n\n <section aria-labelledby=\"timeline-provenance-title\" className={styles.section}>\n <Text as=\"h3\" id=\"timeline-provenance-title\" variant=\"section-title\">\n Provenance\n </Text>\n <dl className={styles.ledger}>\n {timelineDetailLedger(controller.state.detail).map(({ label, value }) => (\n <div key={label}>\n <dt>{label}</dt>\n <dd>{value}</dd>\n </div>\n ))}\n </dl>\n </section>\n </div>\n )}\n </Sheet.Body>\n <Sheet.Footer>\n <Link className={styles.footerLink} to={agentHref}>\n Ask Relay about this event\n </Link>\n </Sheet.Footer>\n </Sheet.Content>\n </Sheet.Root>\n )\n}\n",".page,\n.hero,\n.page {\n gap: clamp(2.5rem, 7vw, 6rem);\n}\n\n.hero {\n gap: var(--rly-space-16);\n}\n\n.hero p,\n.hero h1 {\n margin: 0;\n}\n\n.hero h1 {\n max-inline-size: 9ch;\n letter-spacing: -0.075em;\n text-wrap: balance;\n}\n\n.intro {\n max-inline-size: 46rem;\n}\n\n.askRelay {\n inline-size: fit-content;\n min-block-size: 3.5rem;\n display: inline-flex;\n align-items: center;\n padding-inline: var(--rly-space-20);\n border-radius: var(--rly-radius-control);\n background: var(--rly-color-action-background);\n color: var(--rly-color-action-foreground);\n font: var(--rly-type-label-weight) var(--rly-type-label-size) / var(--rly-type-label-line-height)\n var(--rly-type-label-font);\n text-decoration: none;\n}\n\n.summary {\n display: grid;\n grid-template-columns: repeat(4, minmax(0, 1fr));\n margin: 0;\n overflow: hidden;\n border: 1px solid var(--rly-color-border-1);\n border-radius: var(--rly-radius-group);\n}\n\n.summary div {\n display: grid;\n gap: var(--rly-space-12);\n min-block-size: 8rem;\n padding: var(--rly-space-20);\n background: var(--rly-color-surface-1);\n}\n\n.summary div + div {\n border-inline-start: 1px solid var(--rly-color-border-1);\n}\n\n.summary dt {\n color: var(--rly-color-text-2);\n font: var(--rly-type-label-weight) var(--rly-type-label-size) / var(--rly-type-label-line-height)\n var(--rly-type-label-font);\n}\n\n.summary dd {\n margin: 0;\n color: var(--rly-color-text-1);\n font-size: clamp(2.5rem, 6vw, 5rem);\n font-weight: 700;\n line-height: 0.9;\n letter-spacing: -0.07em;\n}\n\n.summary div[data-source=\"action\"] {\n box-shadow: inset 0 4px var(--rly-color-service-codecommit);\n}\n.summary div[data-source=\"relationship\"] {\n box-shadow: inset 0 4px var(--rly-color-service-codepipeline);\n}\n.summary div[data-source=\"plugin-sync\"] {\n box-shadow: inset 0 4px var(--rly-color-service-jira);\n}\n.summary div[data-source=\"system\"] {\n box-shadow: inset 0 4px var(--rly-color-focus);\n}\n\n.filters {\n display: grid;\n grid-template-columns: 2fr 1fr 1fr;\n gap: var(--rly-space-12);\n}\n\n.filters label {\n display: grid;\n gap: var(--rly-space-8);\n color: var(--rly-color-text-2);\n font: var(--rly-type-label-weight) var(--rly-type-label-size) / var(--rly-type-label-line-height)\n var(--rly-type-label-font);\n}\n\n.filters select,\n.filters input {\n min-block-size: 3.5rem;\n inline-size: 100%;\n padding-inline: var(--rly-space-16);\n border: 1px solid var(--rly-color-border-2);\n border-radius: var(--rly-radius-control);\n background: var(--rly-color-surface-1);\n color: var(--rly-color-text-1);\n font: inherit;\n}\n\n.events {\n margin: 0;\n padding: 0;\n list-style: none;\n border-block-start: 1px solid var(--rly-color-border-1);\n}\n\n.rowActor {\n display: grid;\n gap: var(--rly-space-8);\n justify-items: start;\n}\n\n@media (max-width: 48rem) {\n .summary {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n }\n .summary div:nth-child(3) {\n border-inline-start: 0;\n }\n .summary div:nth-child(n + 3) {\n border-block-start: 1px solid var(--rly-color-border-1);\n }\n .filters {\n grid-template-columns: 1fr;\n }\n}\n","import * as DateTime from \"effect/DateTime\"\nimport * as Effect from \"effect/Effect\"\nimport * as Predicate from \"effect/Predicate\"\nimport * as Schema from \"effect/Schema\"\nimport * as FetchHttpClient from \"effect/unstable/http/FetchHttpClient\"\nimport { useCallback, useEffect, useRef, useState } from \"react\"\n\nimport { makeControlCenterApiClient } from \"../../api/client.js\"\nimport type { TimelineActorKind, TimelineCursor, TimelineEvent, TimelinePage } from \"../../domain/timeline.js\"\nimport { UtcTimestamp } from \"../../domain/utcTimestamp.js\"\n\n/** User-controlled Timeline filters. */\nexport interface TimelineFilters {\n readonly actorKind: TimelineActorKind | \"all\"\n readonly from: string\n readonly to: string\n}\n\n/** Browser transport boundary for Timeline tests and authenticated reads. */\nexport interface TimelineTransport {\n readonly load: (\n signal: AbortSignal,\n filters: TimelineFilters,\n cursor: TimelineCursor | null\n ) => Promise<TimelinePage>\n}\n\nexport type TimelineState =\n | { readonly _tag: \"idle\" }\n | { readonly _tag: \"loading\" }\n | { readonly _tag: \"failed\" }\n | {\n readonly _tag: \"ready\"\n readonly events: ReadonlyArray<TimelineEvent>\n readonly isLoadingMore: boolean\n readonly nextCursor: TimelineCursor | null\n }\n\n/** Generated-client transport for the authenticated Timeline page. */\nexport const browserTimelineTransport: TimelineTransport = {\n load: (signal, filters, cursor) =>\n Effect.runPromise(\n Effect.gen(function*() {\n const client = yield* makeControlCenterApiClient()\n const from = filters.from.length === 0\n ? undefined\n : yield* Schema.decodeUnknownEffect(UtcTimestamp)(`${filters.from}T00:00:00.000Z`)\n const to = filters.to.length === 0\n ? undefined\n : yield* Schema.decodeUnknownEffect(UtcTimestamp)(`${filters.to}T23:59:59.999Z`)\n return yield* client.timeline.page({\n query: {\n ...(!(filters.actorKind === \"all\") && { actor: filters.actorKind }),\n ...(!(cursor === null) && { beforeEventKey: cursor.eventKey, beforeOccurredAt: cursor.occurredAt }),\n ...(!(from === undefined) && { from }),\n limit: 50,\n ...(!(to === undefined) && { to })\n }\n })\n }).pipe(Effect.provide(FetchHttpClient.layer)),\n { signal }\n )\n}\n\nconst isUnauthorizedFailure = Predicate.isTagged(\"UnauthorizedApiError\")\n\n/** Load and incrementally page one exact authenticated Timeline filter set. */\nexport const useTimeline = (\n filters: TimelineFilters,\n sessionKey: string | null,\n onSessionExpired: (sessionKey: string) => void,\n transport: TimelineTransport = browserTimelineTransport\n) => {\n const [requestRevision, setRequestRevision] = useState(0)\n const [state, setState] = useState<TimelineState>({ _tag: \"idle\" })\n const activeRequest = useRef<AbortController | null>(null)\n const filterKey = `${filters.actorKind}|${filters.from}|${filters.to}`\n\n useEffect(() => {\n activeRequest.current?.abort()\n if (sessionKey === null) {\n setState({ _tag: \"idle\" })\n return\n }\n const request = new AbortController()\n activeRequest.current = request\n setState({ _tag: \"loading\" })\n transport.load(request.signal, filters, null).then(\n (page) => {\n if (!request.signal.aborted) {\n setState({ _tag: \"ready\", events: page.events, isLoadingMore: false, nextCursor: page.nextCursor })\n }\n },\n (failure) => {\n if (request.signal.aborted) return\n if (isUnauthorizedFailure(failure)) onSessionExpired(sessionKey)\n setState({ _tag: \"failed\" })\n }\n )\n return () => request.abort()\n }, [filterKey, filters, onSessionExpired, requestRevision, sessionKey, transport])\n\n const loadMore = useCallback((): void => {\n if (sessionKey === null || state._tag !== \"ready\" || state.nextCursor === null || state.isLoadingMore) return\n activeRequest.current?.abort()\n const request = new AbortController()\n activeRequest.current = request\n const current = state\n setState({ ...current, isLoadingMore: true })\n transport.load(request.signal, filters, current.nextCursor).then(\n (page) => {\n if (!request.signal.aborted) {\n setState({\n _tag: \"ready\",\n events: [...current.events, ...page.events],\n isLoadingMore: false,\n nextCursor: page.nextCursor\n })\n }\n },\n (failure) => {\n if (request.signal.aborted) return\n if (isUnauthorizedFailure(failure)) onSessionExpired(sessionKey)\n setState({ ...current, isLoadingMore: false })\n }\n )\n }, [filters, onSessionExpired, sessionKey, state, transport])\n\n return {\n loadMore,\n retry: useCallback(() => setRequestRevision((revision) => revision + 1), []),\n state\n }\n}\n\n/** Compact UTC timestamp for Timeline rows. */\nexport const formatTimelineTimestamp = (timestamp: TimelineEvent[\"occurredAt\"]): string =>\n new Intl.DateTimeFormat(\"en-GB\", {\n dateStyle: \"medium\",\n timeStyle: \"short\",\n timeZone: \"UTC\"\n }).format(DateTime.toDateUtc(timestamp))\n","import { LinkProvider } from \"@knpkv/rly/foundations\"\nimport { TimelineRow as RlyTimelineRow } from \"@knpkv/rly/patterns\"\nimport { Button, StatePanel, Text } from \"@knpkv/rly/primitives\"\nimport * as DateTime from \"effect/DateTime\"\nimport { type ReactElement, type ReactNode, useMemo, useState } from \"react\"\nimport { Link, useLocation } from \"react-router\"\n\nimport type { TimelineActorKind, TimelineEvent, TimelineSourceKind } from \"../../domain/timeline.js\"\nimport { browserReadableSessionKey, type BrowserSessionState, useBrowserSession } from \"../BrowserSession.js\"\nimport { contextualAgentPath } from \"../contextualAgentPath.js\"\nimport { WorkspaceEntityLink } from \"../entities/WorkspaceEntityLink.js\"\nimport { TimelineDetailSheet } from \"./TimelineDetailSheet.js\"\nimport type { TimelineDetailTransport } from \"./useTimelineDetail.js\"\nimport styles from \"./TimelinePage.module.css\"\nimport {\n browserTimelineTransport,\n formatTimelineTimestamp,\n type TimelineFilters,\n type TimelineTransport,\n useTimeline\n} from \"./useTimeline.js\"\n\nconst actorOptions: ReadonlyArray<{ readonly label: string; readonly value: TimelineActorKind | \"all\" }> = [\n { label: \"Everyone\", value: \"all\" },\n { label: \"People\", value: \"human\" },\n { label: \"Agents\", value: \"agent\" },\n { label: \"Services\", value: \"plugin\" },\n { label: \"System\", value: \"system\" }\n]\nconst timelineSources: ReadonlyArray<TimelineSourceKind> = [\"action\", \"relationship\", \"plugin-sync\", \"system\"]\n\nconst actorFilter = (value: string): TimelineFilters[\"actorKind\"] =>\n actorOptions.find((option) => option.value === value)?.value ?? \"all\"\n\nconst sourcePresentation = {\n action: { label: \"Governed action\" },\n \"plugin-sync\": { label: \"Service sync\" },\n relationship: { label: \"Delivery link\" },\n system: { label: \"Control Center\" }\n} satisfies Readonly<Record<TimelineSourceKind, { readonly label: string }>>\n\nconst TimelineRow = ({\n actor,\n continued,\n event\n}: {\n readonly actor?: ReactNode\n readonly continued: boolean\n readonly event: TimelineEvent\n}): ReactElement => (\n <RlyTimelineRow\n continued={continued}\n event={{\n actor: actor ?? event.actor.label,\n actorKind: event.actor.kind,\n dateTime: DateTime.formatIso(event.occurredAt),\n detail: sourcePresentation[event.sourceKind].label,\n ...(!(event.href === null) && { href: event.href }),\n id: event.eventKey,\n ...(!(event.service === null) && { service: event.service }),\n time: formatTimelineTimestamp(event.occurredAt),\n title: event.title\n }}\n />\n)\n\n/** Only workspace owners can deliberately expand redacted Timeline rows. */\nexport const canInspectTimelineDetails = (state: BrowserSessionState): boolean => {\n switch (state._tag) {\n case \"authenticated\":\n return state.session.permission === \"workspace-owner\"\n case \"storage-unavailable\":\n return state.session?.permission === \"workspace-owner\"\n case \"anonymous\":\n case \"blocked\":\n case \"checking\":\n case \"unavailable\":\n return false\n }\n}\n\n/** Preserve one selected event alongside the current Timeline filters for Relay. */\nexport const timelineEventAgentPath = (\n pathname: string,\n search: string,\n hash: string,\n eventKey: TimelineEvent[\"eventKey\"]\n): string => {\n const context = new URLSearchParams(search)\n context.set(\"event\", eventKey)\n return contextualAgentPath(pathname, `?${context.toString()}`, hash)\n}\n\nconst SourceSummary = ({ events }: { readonly events: ReadonlyArray<TimelineEvent> }): ReactElement => {\n const totals = useMemo(\n () =>\n new Map<TimelineSourceKind, number>([\n [\"action\", events.filter(({ sourceKind }) => sourceKind === \"action\").length],\n [\"relationship\", events.filter(({ sourceKind }) => sourceKind === \"relationship\").length],\n [\"plugin-sync\", events.filter(({ sourceKind }) => sourceKind === \"plugin-sync\").length],\n [\"system\", events.filter(({ sourceKind }) => sourceKind === \"system\").length]\n ]),\n [events]\n )\n return (\n <dl className={styles.summary}>\n {timelineSources.map((source) => {\n return (\n <div data-source={source} key={source}>\n <dt>{sourcePresentation[source].label}</dt>\n <dd>{totals.get(source) ?? 0}</dd>\n </div>\n )\n })}\n </dl>\n )\n}\n\n/** Bird's-eye view of attributable human, agent, service, and system activity. */\nexport const TimelinePage = ({\n detailTransport,\n transport = browserTimelineTransport\n}: {\n readonly detailTransport?: TimelineDetailTransport\n readonly transport?: TimelineTransport\n} = {}): ReactElement => {\n const location = useLocation()\n const browserSession = useBrowserSession()\n const sessionKey = browserReadableSessionKey(browserSession.state)\n const [filters, setFilters] = useState<TimelineFilters>({ actorKind: \"all\", from: \"\", to: \"\" })\n const [selectedEvent, setSelectedEvent] = useState<TimelineEvent | null>(null)\n const controller = useTimeline(filters, sessionKey, browserSession.invalidateSession, transport)\n const agentHref = contextualAgentPath(location.pathname, location.search, location.hash)\n const canInspect = canInspectTimelineDetails(browserSession.state)\n\n if (controller.state._tag === \"idle\" || controller.state._tag === \"loading\") {\n return (\n <StatePanel description=\"Combining durable activity across your connected services.\" title=\"Loading Timeline\" />\n )\n }\n if (controller.state._tag === \"failed\") {\n return (\n <StatePanel\n action={<Button onClick={controller.retry}>Try again</Button>}\n description=\"The Timeline could not be read.\"\n title=\"Timeline unavailable\"\n />\n )\n }\n const timelineState = controller.state\n\n return (\n <article className={styles.page}>\n <header className={styles.hero}>\n <Text as=\"p\" tone=\"secondary\" variant=\"label\">\n Timeline\n </Text>\n <Text as=\"h1\" variant=\"verdict\">\n Everything\n <br />\n that moved.\n </Text>\n <Text className={styles.intro} tone=\"secondary\" variant=\"body-large\">\n One chronological truth across people, agents, code, delivery links, and connected services.\n </Text>\n <Link className={styles.askRelay} to={agentHref}>\n Ask Relay about this Timeline\n </Link>\n </header>\n\n <SourceSummary events={timelineState.events} />\n\n <section aria-label=\"Timeline filters\" className={styles.filters}>\n <label>\n <span>Actor</span>\n <select\n value={filters.actorKind}\n onChange={(event) => setFilters({ ...filters, actorKind: actorFilter(event.currentTarget.value) })}\n >\n {actorOptions.map((option) => (\n <option key={option.value} value={option.value}>\n {option.label}\n </option>\n ))}\n </select>\n </label>\n <label>\n <span>From</span>\n <input\n type=\"date\"\n value={filters.from}\n onChange={(event) => setFilters({ ...filters, from: event.currentTarget.value })}\n />\n </label>\n <label>\n <span>To</span>\n <input\n type=\"date\"\n value={filters.to}\n onChange={(event) => setFilters({ ...filters, to: event.currentTarget.value })}\n />\n </label>\n </section>\n\n {timelineState.events.length === 0 ? (\n <StatePanel description=\"Try a wider date range or another actor.\" title=\"No activity in this view\" />\n ) : (\n <LinkProvider component={WorkspaceEntityLink}>\n <ol className={styles.events}>\n {timelineState.events.map((event, index) => (\n <TimelineRow\n actor={\n canInspect ? (\n <span className={styles.rowActor}>\n <span>{event.actor.label}</span>\n <Button onClick={() => setSelectedEvent(event)} size=\"compact\" variant=\"quiet\">\n Inspect\n </Button>\n </span>\n ) : undefined\n }\n continued={index < timelineState.events.length - 1}\n event={event}\n key={event.eventKey}\n />\n ))}\n </ol>\n </LinkProvider>\n )}\n {timelineState.nextCursor === null ? null : (\n <Button disabled={timelineState.isLoadingMore} onClick={controller.loadMore} size=\"principal\" stretch>\n {timelineState.isLoadingMore ? \"Loading…\" : \"Show earlier activity\"}\n </Button>\n )}\n <TimelineDetailSheet\n agentHref={\n selectedEvent === null\n ? agentHref\n : timelineEventAgentPath(location.pathname, location.search, location.hash, selectedEvent.eventKey)\n }\n event={selectedEvent}\n onClose={() => setSelectedEvent(null)}\n onSessionExpired={browserSession.invalidateSession}\n sessionKey={sessionKey}\n {...(detailTransport === undefined ? {} : { transport: detailTransport })}\n />\n </article>\n )\n}\n"],"mappings":"y4BCgCM,EAAwB,EAAmB,sBAAsB,EAG1D,EAA0D,CACrE,MAAO,EAAU,IACf,EACE,EAAW,WAAY,CAErB,OAAO,OAAO,MADQ,EAA2B,EAAA,CAC5B,SAAS,OAAO,CAAE,OAAQ,CAAE,UAAS,CAAE,CAAC,CAC/D,CAAC,CAAC,CAAC,KAAK,EAAe,CAAqB,CAAC,EAC7C,CAAE,QAAO,CACX,CACJ,EAGa,GACX,EACA,EACA,EACA,EAAqC,IAClC,CACH,GAAM,CAAC,EAAiB,IAAA,EAAsB,EAAA,SAAA,CAAS,CAAC,EAClD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EAAI,CAAE,UAAW,CAAgB,CACxE,CAAA,CACM,GAEb"}
|
package/dist/client/assets/{WorkspaceEntityLink-D3TXDcD0.js → WorkspaceEntityLink-CAj42f02.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-CwJFpaho.js";import{r as n}from"./hooks-K-sIfGqH.js";import{t as r}from"./lib-6h955hh9.js";import{t as i}from"./jsx-runtime-NZYk81nU.js";import{n as a,r as o,s}from"./workspaceEntityRoutes-
|
|
2
|
-
//# sourceMappingURL=WorkspaceEntityLink-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-CwJFpaho.js";import{r as n}from"./hooks-K-sIfGqH.js";import{t as r}from"./lib-6h955hh9.js";import{t as i}from"./jsx-runtime-NZYk81nU.js";import{n as a,r as o,s}from"./workspaceEntityRoutes-BHccxrFj.js";import{n as c,t as l}from"./workspaceScrollCapture-BzsNJoL7.js";var u=e(t(),1),d=i(),f=(e,t)=>{let n=s(e);return n===null?void 0:o(t.state,n.workspaceId,n.entityId,a(t))},p=(0,u.forwardRef)(function({href:e,onClick:t,...i},a){let o=n(),s=f(e,o);return(0,d.jsx)(r,{...i,onClick:n=>{t?.(n),s!==void 0&&c(n,n.currentTarget.target)&&l(o,e)},ref:a,state:s,to:e})});export{f as n,p as t};
|
|
2
|
+
//# sourceMappingURL=WorkspaceEntityLink-CAj42f02.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspaceEntityLink-
|
|
1
|
+
{"version":3,"file":"WorkspaceEntityLink-CAj42f02.js","names":[],"sources":["../../../src/client/entities/WorkspaceEntityLink.tsx"],"sourcesContent":["import type { RlyLinkProps } from \"@knpkv/rly/foundations\"\nimport { forwardRef, type ReactElement } from \"react\"\nimport { Link, useLocation } from \"react-router\"\n\nimport {\n entityOriginFromLocation,\n makeWorkspaceEntityRouteState,\n workspaceEntityTargetFromHref\n} from \"../items/workspaceEntityRoutes.js\"\nimport { rememberWorkspaceScrollPosition, shouldRememberWorkspaceScrollPosition } from \"../workspaceScrollCapture.js\"\n\ninterface RouterLocationParts {\n readonly hash: string\n readonly pathname: string\n readonly search: string\n readonly state: unknown\n}\n\n/** Preserve the validated root origin when an Rly relationship opens another canonical entity. */\nexport const workspaceEntityStateForHref = (href: string, location: RouterLocationParts) => {\n const target = workspaceEntityTargetFromHref(href)\n return target === null\n ? undefined\n : makeWorkspaceEntityRouteState(\n location.state,\n target.workspaceId,\n target.entityId,\n entityOriginFromLocation(location)\n )\n}\n\n/** React Router bridge installed only inside lazy entity-aware route chunks. */\nexport const WorkspaceEntityLink = forwardRef<HTMLAnchorElement, RlyLinkProps>(function WorkspaceEntityLink(\n { href, onClick, ...props },\n ref\n): ReactElement {\n const location = useLocation()\n const state = workspaceEntityStateForHref(href, location)\n return (\n <Link\n {...props}\n onClick={(event) => {\n onClick?.(event)\n if (state !== undefined && shouldRememberWorkspaceScrollPosition(event, event.currentTarget.target)) {\n rememberWorkspaceScrollPosition(location, href)\n }\n }}\n ref={ref}\n state={state}\n to={href}\n />\n )\n})\n"],"mappings":"wWAmBa,GAA+B,EAAc,IAAkC,CAC1F,IAAM,EAAS,EAA8B,CAAI,EACjD,OAAO,IAAW,KACd,IAAA,GACA,EACE,EAAS,MACT,EAAO,YACP,EAAO,SACP,EAAyB,CAAQ,CACnC,CACN,EAGa,GAAA,EAAsB,EAAA,WAAA,CAA4C,SAC7E,CAAE,OAAM,UAAS,GAAG,GACpB,EACc,CACd,IAAM,EAAW,EAAY,EACvB,EAAQ,EAA4B,EAAM,CAAQ,EACxD,OACE,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,GAAI,EACJ,QAAU,GAAU,CAClB,IAAU,CAAK,EACX,IAAU,IAAA,IAAa,EAAsC,EAAO,EAAM,cAAc,MAAM,GAChG,EAAgC,EAAU,CAAI,CAElD,EACK,MACE,QACP,GAAI,CACL,CAAA,CAEL,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/pullRequestReviewThreadReplay-eI3Y4i6s.js","assets/agent-api-CUWP1qs8.js","assets/client-D3WRV6yl.js","assets/Domain-cJ5aJFpE.js","assets/authenticatedMutationClient-Bc_-Jpbo.js","assets/pullRequestReviewFailures-CCNxSXP6.js","assets/WorkspacePullRequestDetails-BhxoqR7V.js","assets/rolldown-runtime-hePW80VL.js","assets/react-CwJFpaho.js","assets/preload-helper-Czpn1I53.js","assets/jsx-runtime-NZYk81nU.js","assets/workbench-4C25n_BY-DcOIwxZW.js","assets/loader-circle-Dem7LJJw.js","assets/component-DKy8kjZl-DJ62HeaY.js","assets/patterns-DuFUSnJW.js","assets/PortalProvider-CN_81Fy3-D_japesx.js","assets/Dialog-DSwimdwG-BeHnBpPp.js","assets/index-kmYFvwT0.js","assets/hooks-K-sIfGqH.js","assets/lib-6h955hh9.js","assets/releasePaths-XoI2BHX3.js","assets/index-tjRpNCt_.css","assets/primitives-DYGtIZqB-r-Glkv2i.js","assets/WorkspacePullRequestDetails.module-Bl8z_AMw.js","assets/WorkspacePullRequestDetails-q_Ngh_tB.css","assets/WorkspacePullRequestDiff.module-DJEWRmoT.js","assets/WorkspacePullRequestDiff-HJB-ezE4.css","assets/WorkspaceRichText-Beh64wsV.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-CwJFpaho.js";import{l as n,o as r,r as i,u as a}from"./hooks-K-sIfGqH.js";import{t as o}from"./lib-6h955hh9.js";import{t as s}from"./preload-helper-Czpn1I53.js";import{t as c}from"./jsx-runtime-NZYk81nU.js";import{d as l,g as u,l as d,r as f,v as p}from"./Dialog-DSwimdwG-BeHnBpPp.js";import{c as m,f as h,m as g,p as _}from"./index-kmYFvwT0.js";import{_ as v,a as y,c as b,f as x,h as S,n as C,r as w,s as T,u as ee,v as te,y as ne}from"./patterns-DuFUSnJW.js";import{n as E}from"./primitives-DYGtIZqB-r-Glkv2i.js";import{Bn as re,Dn as ie,Fn as ae,Jr as D,Ka as oe,Li as se,Ln as ce,Mi as O,Na as le,Oi as ue,On as de,Qr as fe,Rn as pe,Ti as me,Ya as k,Yi as he,Zr as ge,_i as _e,_r as A,di as ve,ei as ye,hr as j,ir as be,ji as xe,ki as M,ma as Se,n as Ce,pa as we,pi as Te,qi as Ee,qt as De,rr as Oe,sr as ke,ti as Ae,va as je,vi as Me,vr as Ne,xr as Pe,ya as Fe,yi as Ie,yr as N,zn as P}from"./agent-api-CUWP1qs8.js";import{a as Le}from"./client-D3WRV6yl.js";import{n as Re,t as ze}from"./BrowserCrypto-CoBR2WBd.js";import{a as Be,i as Ve,o as He,r as Ue}from"./releaseAgentTransport-CJjWwE8y.js";import{n as We,t as Ge}from"./workspaceEntityPaths-xAl2jRFm.js";import{a as Ke,i as qe,o as Je,t as Ye}from"./workspaceEntityRoutes-BHccxrFj.js";import{i as Xe,n as Ze,r as Qe}from"./presentWorkspaceItems-BY8bmqjF.js";import{t as $e}from"./authenticatedMutationClient-Bc_-Jpbo.js";import{c as et,h as tt,i as nt,l as rt,n as it,r as at}from"./controlCenterRelayDock-CyYeXh75.js";import{n as ot}from"./reviewPlatformAdapter-Duu9pLcg.js";import{i as st,n as ct,t as lt}from"./confluenceTasks-By7BV0WN.js";import{t as ut}from"./WorkspaceEntityLink-CAj42f02.js";import{t as dt}from"./connectionTestTransport-CRq7l9X0.js";import{t as ft}from"./WorkspaceRichText-Beh64wsV.js";import{n as F,t as pt}from"./pullRequestReviewFailures-CCNxSXP6.js";var I=e(t(),1),mt=e=>{switch(e._tag){case`operator-message`:return{id:String(e.eventSequence),role:`operator`,text:e.prompt};case`progress`:return{id:String(e.eventSequence),role:`relay`,text:e.text};case`review-report`:return{id:String(e.eventSequence),role:`relay`,text:`${String(e.report.suggestions.length)} suggestions · ${String(e.report.notes.length)} notes`};case`run-failed`:return{id:String(e.eventSequence),role:`system`,text:`Review failed at ${e.stage}.`};case`run-completed`:return{id:String(e.eventSequence),role:`system`,text:`Review completed · ${e.outcome}`};case`run-interrupted`:return{id:String(e.eventSequence),role:`system`,text:`Review interrupted by a restart.`};case`cancellation-requested`:return{id:String(e.eventSequence),role:`system`,text:`Cancellation requested.`};case`run-queued`:case`run-started`:case`suggestion-published`:case`suggestion-revised`:case`usage`:return null}},ht=e=>e._tag===`ready`&&e.thread!==void 0?e.thread.events.flatMap(e=>{let t=mt(e);return t===null?[]:[t]}):[],gt=e=>e._tag===`ready`?e.providerPresets??(e.provider===null?[]:[e.provider]):[],_t=({conversation:e,providerId:t,request:n,startReview:r})=>{let i=tt(e),a=Oe(Ce)(n.message);return Se(a)?ve(new et({product:`control-center`,thread:i})):se({try:()=>r(a.success,t),catch:()=>new et({product:`control-center`,thread:i})})},vt=e=>{let t=gt(e),n=e._tag===`ready`?e.provider:null;return t.length===0||n===null?it:nt({modelId:n.providerId,models:t.map(({model:e,providerId:t})=>({id:t,label:`${t} · ${e}`})),profileId:n.providerId,profiles:t.map(({providerId:e,reviewProfile:t})=>({id:e,label:t.label}))})},yt=({canEnqueue:e,entityId:t,inspection:n,reviewState:r,startReview:i,workspaceId:a})=>{let o=n.entity.projection.details,s=(0,I.useMemo)(()=>vt(r),[r]),c=(0,I.useMemo)(()=>at({_tag:`control-center`,route:{entityId:t,href:We(a,t)},selection:s,thread:{pluginConnectionId:n.source.pluginConnectionId,pullRequestId:n.source.vendorImmutableId,repositoryName:o._tag===`pull-request`?o.repository:`unavailable`,workspaceId:a}}),[o,t,n.source.pluginConnectionId,n.source.vendorImmutableId,s,a]),l=(0,I.useMemo)(()=>{let t={context:[{id:`repository`,label:`Repository`,value:o._tag===`pull-request`?o.repository:`Unavailable`},{id:`pull-request`,label:`Pull request`,value:`#${n.source.vendorImmutableId}`},{id:`head`,label:`Current head`,value:o._tag===`pull-request`?o.headRevision.slice(0,12):`Unavailable`}],conversation:c,selection:s};if(r._tag===`idle`||r._tag===`loading`)return{...t,status:`loading`};if(r._tag===`failed`)return{...t,description:`Control Center could not load this durable PR thread.`,status:`error`};let a=gt(r);return!e||r.provider===null||r.review._tag===`unavailable`?{...t,description:e?`No available PR-review agent profile is configured.`:`A workspace owner session is required to continue this PR thread.`,status:`unavailable`}:{...t,continuePullRequestConversation:e=>{let t=tt(c);if(r.action===`starting`||r.review._tag===`pending`)return new rt({product:`control-center`,reason:`conversation-busy`,thread:t});let n=a.find(({providerId:t})=>String(t)===String(e.selection.modelId)&&String(t)===String(e.selection.profileId));return n===void 0?new rt({product:`control-center`,reason:`selection-unavailable`,thread:t}):_t({conversation:c,providerId:n.providerId,request:e,startReview:i})},messages:ht(r),status:`ready`}},[e,c,o,n.source.vendorImmutableId,r,s,i]);return m(l),null},bt=new Intl.DateTimeFormat(`en-GB`,{dateStyle:`medium`,timeStyle:`short`,timeZone:`UTC`}),xt=e=>e.split(/[_\-\s]+/u).filter(Boolean).map(e=>`${e.charAt(0).toLocaleUpperCase(`en-US`)}${e.slice(1).toLocaleLowerCase(`en-US`)}`).join(` `),St=e=>{let t=Math.floor(e/60),n=e%60;return t===0?`${String(n)}m`:n===0?`${String(t)}h`:`${String(t)}h ${String(n)}m`},Ct=e=>e==null?`Not synchronized`:bt.format(ye(e)),wt=e=>e==null?null:{dateTime:D(e),label:bt.format(ye(e))},Tt=e=>e.lifecycle._tag!==`missing`&&e.lifecycle._tag!==`rejected`&&e.lifecycle._tag!==`superseded`,Et=(e,t)=>{let n=new Set(t.graph.nodes.flatMap(({nodeId:e,resolution:n})=>n._tag===`resolved`&&n.target._tag===`entity`&&n.target.entityId===t.entity.projection.entityId?[e]:[])),r=new Map;for(let{nodeId:e,resolution:n}of t.graph.nodes)n._tag===`resolved`&&n.target._tag===`entity`&&n.target.entityKind===`issue`&&r.set(e,n.target.entityId);let i=new Map;for(let{projection:e}of t.graph.relatedEntityProjections)e.entityState===`present`&&e.entityType===`issue`&&i.set(e.entityId,e);let a=new Map;for(let e of t.graph.relationships){if(e.kind!==`tracks-time-for`||!n.has(e.sourceNodeId)||!Tt(e))continue;let t=r.get(e.targetNodeId),o=t===void 0?void 0:i.get(t);if(t===void 0||o===void 0)continue;let s=e.lifecycle._tag===`inferred`||e.confidence._tag===`inferred`,c=a.get(t);if(c===void 0){a.set(t,{evidenceClaimIds:new Set(e.evidenceClaimIds),issue:o,state:s?`inferred`:`linked`});continue}for(let t of e.evidenceClaimIds)c.evidenceClaimIds.add(t);s||(c.state=`linked`)}return[...a.entries()].map(([t,{evidenceClaimIds:n,issue:r,state:i}])=>({evidenceLabel:`${String(n.size)} evidence claim${n.size===1?``:`s`}`,href:We(e,t),key:r.displayKey,state:i,title:r.title}))},Dt=(e,t,n)=>{let r=Et(e,n),i=r.filter(({state:e})=>e===`inferred`).length,a=n.entity.owners.filter(({roles:e})=>e.some(e=>e.includes(`approver`))).map(({displayName:e})=>e),o=t.userId===void 0?void 0:n.entity.owners.find(({sourceIdentities:e})=>e?.some(({providerId:e,vendorPersonId:n})=>e===`clockify`&&n===t.userId)??!1);return{approvalDecidedAt:wt(n.clockifyApproval?.decidedAt),approvalDetail:n.clockifyApproval===null?`No Control Center decision is recorded for this exact Clockify revision.`:n.clockifyApproval.rationale,approvalLabel:n.clockifyApproval===null?`Pending`:xt(n.clockifyApproval.decision),approvers:a,associationDetail:r.length===0?`No current Jira relationship explains where this time belongs. The entry remains visible.`:i===0?`${String(r.length)} current Jira link${r.length===1?``:`s`}`:`${String(i)} inferred Jira link${i===1?``:`s`} — verify before reporting`,associationLabel:r.length===0?`Unattributed`:`Attributed`,billableLabel:t.billable?`Billable`:`Non-billable`,contributorLabel:o?.displayName??t.userId??`Contributor not synchronized`,description:t.description??n.entity.projection.title,durationLabel:St(t.durationMinutes),endedAt:Ct(t.endedAt),jiraAssociations:r,lockLabel:t.locked===void 0?`Lock state not synchronized`:t.locked?`Locked`:`Unlocked`,projectLabel:t.projectId??`No Clockify project`,rollupLabel:`1 visible entry · ${String(t.durationMinutes)} exact minute${t.durationMinutes===1?``:`s`}`,sourceRevision:n.source.revision,startedAt:Ct(t.startedAt),timerLabel:t.startedAt===void 0||t.endedAt===void 0?`Timer state not synchronized`:t.endedAt===null?`Timer running`:`Completed`,totalMinutes:t.durationMinutes}},Ot=new Intl.DateTimeFormat(`en-GB`,{dateStyle:`medium`,timeStyle:`short`,timeZone:`UTC`}),kt=e=>e.split(`-`).map(e=>`${e.charAt(0).toLocaleUpperCase(`en-US`)}${e.slice(1)}`).join(` `),L=e=>e===null?null:le(ge(e),{onNone:()=>e,onSome:e=>Ot.format(ye(e))}),At=e=>e.name??e.sourceId??`Not set`,jt=e=>e===void 0||e.length===0?`Not set`:e.join(` · `),Mt=e=>({id:e,name:`Unknown collaborator`,role:`Jira collaborator`}),Nt=e=>new Map((e.collaborators??[]).map(e=>{let t=e.roles.map(kt);return[e.sourcePersonId,{id:e.sourcePersonId,name:e.displayName,role:t.length===0?`Jira collaborator`:t.join(` · `),...e.avatarUrl!==null&&{avatarSrc:e.avatarUrl}}]})),Pt=(e,t)=>({href:(()=>{if(t===null||e.key===null)return null;let n=/^(.*\/browse\/)[^/]+$/u.exec(t.pathname)?.[1];return n===void 0?null:`${t.origin}${n}${encodeURIComponent(e.key)}`})(),key:e.key??e.sourceId??`Unknown issue`,status:e.status===null?`Status unknown`:At(e.status),summary:e.summary??`Summary unavailable`}),Ft=e=>{let t=e.project,n=(e.fixVersions??[]).map(At),r=(e.components??[]).map(At);return[{label:`Type`,value:e.issueType===null||e.issueType===void 0?`Not set`:At(e.issueType)},{label:`Project`,value:t==null?`Not set`:[t.key,t.name].filter(e=>e!==null).join(` · `)||`Not set`},{label:`Resolution`,value:e.resolution===null||e.resolution===void 0?`Unresolved`:At(e.resolution)},{label:`Labels`,value:jt(e.labels)},{label:`Components`,value:jt(r)},{label:`Fix versions`,value:jt(n)},{label:`Created`,value:L(e.createdAt??null)??`Not available`},{label:`Updated`,value:L(e.updatedAt??null)??`Not available`},{label:`Due`,value:L(e.dueDate??null)??`Not set`}]},It=(e,t)=>`${e??`Empty`} → ${t??`Empty`}`,Lt=(e,t)=>{let n=Nt(e),r=e=>e===null?Mt(`unknown-person`):n.get(e)??Mt(e),i=new Set(e.truncatedFields??[]),a=(e.comments??[]).map(e=>({author:r(e.authorSourcePersonId),body:e.body,id:e.sourceId,time:L(e.updatedAt??e.createdAt)})),o=(e.history??[]).map(e=>({actor:r(e.authorSourcePersonId),changes:e.changes.map(e=>({field:e.field,transition:It(e.from,e.to)})),id:e.sourceId,time:L(e.createdAt)})),s=e.commentTotal??a.length,c=e.historyTotal??o.length,l=(e.commentsTruncated??!1)||s>a.length,u=(e.historyTruncated??!1)||c>o.length,d=[...i].filter(e=>e!==`comments`&&(e!==`history`||!u));return{acceptanceCriteria:e.acceptanceCriteria??null,collaborators:[...n.values()],commentCount:s,comments:a,commentBodiesTruncated:e.commentBodiesTruncated??(i.has(`comments`)&&!l),commentsTruncated:l,description:e.description??null,environment:e.environment??null,history:o,historyCount:c,historyTruncated:u,metadata:Ft(e),parent:e.parent===null||e.parent===void 0?null:Pt(e.parent,t),subtasks:(e.subtasks??[]).map(e=>Pt(e,t)),truncationMessage:d.length===0?null:`Jira shortened ${d.map(kt).join(`, `)} to keep this synchronized view bounded.`}},Rt=new Intl.DateTimeFormat(`en-GB`,{dateStyle:`medium`,timeStyle:`short`,timeZone:`UTC`}),zt=e=>e.split(/[._\-\s]+/u).filter(e=>e.length>0).map(e=>`${e.charAt(0).toLocaleUpperCase(`en-US`)}${e.slice(1)}`).join(` `),Bt=e=>zt(e.split(`/`).filter(e=>e.length>0).at(-1)??e)||`AWS identity`,Vt=e=>e==null?null:{id:e,name:Bt(e),role:`Pull request author`},Ht=e=>e==null?null:le(ge(e),{onNone:()=>null,onSome:e=>({dateTime:D(e),label:Rt.format(ye(e))})}),Ut=e=>{switch(e){case`approved`:return`Approved by people`;case`changes-requested`:return`Changes requested`;case`merged`:return`Merged`;case`requested`:return`Human review requested`;case`not-requested`:return`No human approval synchronized`}},Wt=e=>{let t=new Map(e.graph.nodes.flatMap(({nodeId:e,resolution:t})=>t._tag===`resolved`&&t.target._tag===`entity`?[[e,t.target.entityId]]:[])),n=new Set(e.graph.nodes.flatMap(({nodeId:t,resolution:n})=>n._tag===`resolved`&&n.target._tag===`entity`&&n.target.entityId===e.entity.projection.entityId?[t]:[]));return new Set(e.graph.relationships.flatMap(e=>{if(e.lifecycle._tag===`missing`||e.lifecycle._tag===`rejected`||e.lifecycle._tag===`superseded`)return[];let r=n.has(e.sourceNodeId)?e.targetNodeId:n.has(e.targetNodeId)?e.sourceNodeId:null,i=r===null?null:t.get(r);return i==null?[]:[i]}))},Gt=(e,t,n)=>{let r=Wt(n),i=e=>n.graph.relatedEntityProjections.filter(({projection:t})=>t.entityState===`present`&&t.entityType===e&&r.has(t.entityId)).length,a=n.entity.releaseIds.length,o=i(`issue`),s=i(`pipeline-execution`),c=e=>`${String(e)}${n.graph.truncated?`+`:``}`;return{author:Vt(e.authorReference),baseRevision:e.baseRevision??null,createdAt:Ht(e.createdAt),description:e.description?.trim()||null,diffScope:{pluginConnectionId:t.pluginConnectionId,vendorImmutableId:t.vendorImmutableId,revision:t.revision},filesHref:t.sourceUrl?.href??null,headRevision:e.headRevision,issueCount:o,issueCountLabel:c(o),mergeBaseRevision:e.mergeBaseRevision??null,pipelineCount:s,pipelineCountLabel:c(s),releaseCount:a,releaseCountLabel:`${String(a)}${n.entity.releaseMembershipsTruncated?`+`:``}`,reviewLabel:Ut(e.reviewState),sourceBranch:e.sourceBranch,targetBranch:e.targetBranch,updatedAt:Ht(e.updatedAt)}},Kt=new Intl.DateTimeFormat(`en-GB`,{dateStyle:`medium`,timeStyle:`short`,timeZone:`UTC`}),R=e=>e.split(`-`).map(e=>`${e.charAt(0).toLocaleUpperCase(`en-US`)}${e.slice(1)}`).join(` `),qt={clockify:`Clockify`,codecommit:`CodeCommit`,codepipeline:`CodePipeline`,confluence:`Confluence`,jira:`Jira`},Jt={deployment:`Deployment`,issue:`Issue`,page:`Page`,"pipeline-execution":`Pipeline execution`,"pull-request":`Pull request`,"time-entry":`Time entry`},Yt=e=>Kt.format(ye(e)),Xt=e=>{if(e.sourceUrl===null)return null;let t=new URL(e.sourceUrl.href);return e.providerId===`confluence`&&t.pathname.startsWith(`/spaces/`)&&(t.pathname=`/wiki${t.pathname}`),t.href},Zt=(e,t)=>`/w/${encodeURIComponent(e)}/releases/${encodeURIComponent(t)}`,Qt=e=>e.slice(-8),$t=e=>{switch(e._tag){case`issue`:return[{label:`Priority`,value:e.priority??`Not set`},{label:`Estimate`,value:e.estimatePoints===null?`Not estimated`:`${e.estimatePoints} points`}];case`pull-request`:return[{label:`Repository`,value:e.repository},...e.lifecycle===null||e.lifecycle===void 0?[]:[{label:`State`,value:R(e.lifecycle)}],{label:`Branches`,value:`${e.sourceBranch} → ${e.targetBranch}`},{label:`Head revision`,value:e.headRevision}];case`page`:return[{label:`Space`,value:e.spaceKey},{label:`Revision`,value:e.revision}];case`pipeline-execution`:return[{label:`Pipeline`,value:e.pipelineName},{label:`Execution`,value:e.executionId},{label:`Trigger revision`,value:e.triggerRevision}];case`deployment`:return[{label:`Environment`,value:Qt(e.environmentId)},{label:`Revision`,value:e.revision}];case`time-entry`:return[{label:`Duration`,value:`${e.durationMinutes} min`},{label:`Billable`,value:e.billable?`Yes`:`No`}]}},en=e=>R(e),tn=e=>({avatarFallback:e.avatarFallback,id:e.personId,name:e.displayName,role:[...new Set(e.roles.map(en))].join(` · `)}),nn=e=>e.some(e=>e.includes(`approver`))?`approvers`:e.some(e=>e===`reviewer`||e===`watcher`)?`reviewers`:e.includes(`operator`)?`operators`:e.some(e=>e===`author`||e===`contributor`)?`authors`:`owners`,rn=e=>{let t=[`authors`,`owners`,`reviewers`,`operators`,`approvers`],n=()=>[],r={approvers:n(),authors:n(),operators:n(),owners:n(),reviewers:n()};for(let t of e)r[nn(t.roles)].push(tn(t));let i=t.filter(e=>r[e].length>0);return{...r,emptyLabel:`No collaborator is assigned to this object.`,expandedCategories:i}},an=(e,t)=>{if(t===null)return e;let n=[...e.owners],r=[...e.authors],i=new Set([...e.approvers,...e.authors,...e.operators,...e.owners,...e.reviewers].map(e=>e.name.toLocaleLowerCase(`en-US`))),a=new Set;for(let e of t.collaborators){if(a.has(e.id))continue;a.add(e.id);let t=e.name.toLocaleLowerCase(`en-US`);i.has(t)||(e.role.includes(`Assignee`)?n.push(e):r.push(e))}let o=[];r.length>0&&o.push(`authors`),n.length>0&&o.push(`owners`);for(let t of e.expandedCategories)o.push(t);return{...e,authors:r,emptyLabel:`No collaborator was synchronized or assigned to this object.`,expandedCategories:[...new Set(o)],owners:n}},on=(e,t,n)=>{if(t===null)return e;let r={approvers:[...e.approvers],authors:[...e.authors],operators:[...e.operators],owners:[...e.owners],reviewers:[...e.reviewers]},i=new Set(Object.values(r).flat().map(({id:e})=>e)),a=new Set(n.flatMap(e=>(e.sourceIdentities??[]).filter(({providerId:e})=>e===`confluence`).map(({vendorPersonId:e})=>e)));for(let e of t.contributors)i.has(e.id)||a.has(e.id)||(i.add(e.id),e.role.includes(`Owner`)?r.owners.push(e):e.role.includes(`Watcher`)?r.reviewers.push(e):r.authors.push(e));let o=[`authors`,`owners`,`reviewers`,`operators`,`approvers`];return{...r,emptyLabel:`No collaborator was synchronized or assigned to this document.`,expandedCategories:o.filter(e=>r[e].length>0)}},sn=e=>{let t=e.freshness;return t===null?e.isSourceCurrent?`current`:`cached`:t._tag===`current`?e.isSourceCurrent&&t.provenance._tag===`provider`?`current`:`cached`:t._tag},cn=e=>{let t=e.freshness;return t===null?e.entity.recordedAt:t.sourceObservedAt??t.synchronizedAt??t.pluginHealth.checkedAt},ln=(e,t,n,r)=>{if(e===void 0)return{state:`missing`,label:`Unknown graph endpoint`,reason:`The endpoint is outside this graph response.`};if(e.resolution._tag===`missing`)return{state:`missing`,label:e.resolution.missingKey,reason:`${R(e.endpointKind)} is not connected.`};let i=e.resolution.target;if(i._tag===`entity`){let e=t.get(i.entityId);return e===void 0?{state:`missing`,label:`${Jt[i.entityKind]} ${Qt(i.entityId)}`,reason:`The related object is outside this bounded response.`,service:Ze(i.entityKind)}:e.entityState===`deleted`?{state:`missing`,label:`${e.title} · Deleted`,reason:`The related object was deleted.`,service:Ze(e.entityType)}:{state:`present`,href:We(r,e.entityId),id:e.entityId,reference:e.displayKey,service:Ze(e.entityType),title:e.title}}return i._tag===`release`?{state:`present`,href:Zt(r,i.releaseId),id:i.releaseId,reference:`Control Center release · ${Qt(i.releaseId)}`,service:n,title:`Delivery release`}:{state:`present`,id:i.environmentId,reference:`Control Center environment · ${Qt(i.environmentId)}`,service:n,title:`Delivery environment`}},un=e=>{let t=e.evidenceClaimIds.length,n=e.confidence._tag===`inferred`?`${Math.round(e.confidence.score*100)}% inferred`:R(e.confidence._tag);return`${t} evidence claim${t===1?``:`s`} · ${n}`},dn=(e,t,n)=>{let r=new Map(e.graph.nodes.map(e=>[e.nodeId,e])),i=[e.entity,...e.graph.relatedEntityProjections].map(({projection:e})=>e),a=new Map(i.map(e=>[e.entityId,e])),o=new Map(e.entity.owners.map(e=>[e.personId,e]));return e.graph.relationships.map(e=>{let i=e.recordedBy._tag===`human`?o.get(e.recordedBy.personId):void 0;return{...i!==void 0&&{actor:tn(i)},direction:`forward`,evidence:un(e),id:e.relationshipId,kind:R(e.kind),lifecycle:e.lifecycle._tag,source:ln(r.get(e.sourceNodeId),a,n,t),target:ln(r.get(e.targetNodeId),a,n,t)}})},fn=e=>e.activity.events.map(e=>({actor:e.actor.label,actorKind:e.actor.kind,dateTime:D(e.occurredAt),detail:R(e.sourceKind),...e.href!==null&&{href:e.href},id:e.eventKey,...e.service!==null&&{service:e.service},time:Yt(e.occurredAt),title:e.title})),pn=(e,t,n)=>{let r=Xt(e.source);if(r!==null)return{external:!0,href:r,label:e.source.providerId===`confluence`?`View in Confluence`:`Open in ${n}`};let i=e.entity.canonicalReleaseId;return i===null?{external:!1,href:null,label:`Source link unavailable`}:{external:!1,href:Zt(t,i),label:`Open delivery release`}},mn=e=>[...e.entity.ownersTruncated?[`More collaborators exist than this bounded view can show.`]:[],...e.entity.releaseMembershipsTruncated?[`More release memberships exist than this bounded delivery path can show.`]:[],...e.graph.truncated?[`The relationship graph is partial; additional delivery links exist.`]:[],...e.activity.truncated?[`The activity list is partial; older events are not shown.`]:[]],hn=({displayKey:e,issue:t,releaseCount:n,serviceName:r,title:i})=>t===null?`${e} · ${i} · ${r}`:`${e} · ${i} · ${r} issue · ${String(n)} release${n===1?``:`s`} · ${String(t.commentCount)} synchronized comment${t.commentCount===1?``:`s`}`,gn=(e,t)=>{let n=t.entity.projection,r=Ze(n.entityType),i=qt[r],a=Qe(n.details),o=n.details._tag===`issue`?Lt(n.details,t.source.sourceUrl):null,s=n.details._tag===`pull-request`?Gt(n.details,t.source,t):null,c=n.details._tag===`pipeline-execution`?st(n.details,t):null,l=n.details._tag===`page`?He(n.details,t):null,u=n.details._tag===`time-entry`?Dt(e,n.details,t):null,d=cn(t),f=t.entity.releaseIds.length;return{activity:fn(t),activityEmptyLabel:`No attributable activity has been recorded for this object.`,agentContext:hn({displayKey:n.displayKey,issue:o,releaseCount:f,serviceName:i,title:n.title}),collaborators:on(an(rn(t.entity.owners),o),l,t.entity.owners),clockifyTimeEntry:u,confluencePage:l,contentSummary:`${Jt[n.entityType]} ${n.displayKey} is tracked in ${i}. ${f===0?`It is not linked to a release yet.`:`It belongs to ${f}${t.entity.releaseMembershipsTruncated?`+`:``} release${f===1?``:`s`}.`}`,displayKey:n.displayKey,evidence:{claimCount:t.graph.evidenceClaims.length,freshness:sn(t),freshnessDateTime:D(d),freshnessTime:Yt(d),itemCount:t.graph.evidenceItems.length,reference:`${n.displayKey} · source revision ${t.source.revision}`},facts:[{label:`Object`,value:Jt[n.entityType]},{label:`Service`,value:i},...$t(n.details)],freshness:sn(t),freshnessDateTime:D(d),freshnessTime:Yt(d),kindLabel:Jt[n.entityType],issue:o,pipelineExecution:c,pullRequest:s,partialMessages:mn(t),primaryAction:pn(t,e,i),relationships:dn(t,e,r),relationshipEmptyLabel:`No delivery relationships have been recorded for this object.`,releases:t.entity.releaseIds.map(t=>({href:Zt(e,t),id:t,label:`Release ${Qt(t)}`})),service:r,serviceName:i,title:n.title,tone:Xe(n.entityType,a).tone,verdict:a}},z={state:`_state_13ab1_1`,loading:`_loading_13ab1_12`,loadingColumns:`_loadingColumns_13ab1_13`,content:`_content_13ab1_14`,entityActions:`_entityActions_13ab1_15`,deliveryPath:`_deliveryPath_13ab1_16`,facts:`_facts_13ab1_17`,evidence:`_evidence_13ab1_18`,activity:`_activity_13ab1_19`,sectionHeading:`_sectionHeading_13ab1_20`,back:`_back_13ab1_34`,principalAction:`_principalAction_13ab1_35`,releasePath:`_releasePath_13ab1_36`,pageSynchronization:`_pageSynchronization_13ab1_67`,secondaryAction:`_secondaryAction_13ab1_76`,pathRail:`_pathRail_13ab1_112`,pathNode:`_pathNode_13ab1_121`,pathEmpty:`_pathEmpty_13ab1_122`,workingCircle:`_workingCircle_13ab1_190`,shell:`_shell_13ab1_212`,timeline:`_timeline_13ab1_236`},B={document:`_document_1mruv_1`,ledger:`_ledger_1mruv_2`,ledgerBody:`_ledgerBody_1mruv_3`,primaryFacts:`_primaryFacts_1mruv_5`,section:`_section_1mruv_7`,sectionHeading:`_sectionHeading_1mruv_8`,entry:`_entry_1mruv_9`,attribution:`_attribution_1mruv_12`,people:`_people_1mruv_17`,readOnly:`_readOnly_1mruv_19`,total:`_total_1mruv_36`},V=c(),_n=({children:e,heading:t,meta:n})=>(0,V.jsxs)(`section`,{className:B.section,children:[(0,V.jsxs)(`header`,{className:B.sectionHeading,children:[(0,V.jsx)(E,{as:`h2`,variant:`section-title`,children:t}),(0,V.jsx)(E,{tone:`secondary`,variant:`meta`,children:n})]}),e]}),vn=({canApprove:e=!1,canCorrect:t=!1,onSubmit:n,submission:r={_tag:`idle`},timeEntry:i})=>{let[a,s]=(0,I.useState)(``),[c,u]=(0,I.useState)(``),d=(0,I.useRef)(`approved`),f=!t||n===void 0||r._tag===`submitting`,p=!e||n===void 0||r._tag===`submitting`;return(0,V.jsxs)(`article`,{className:B.document,"data-workspace-clockify-time-entry-detail":!0,children:[(0,V.jsxs)(`section`,{"aria-label":`Clockify time ledger`,className:B.ledger,children:[(0,V.jsxs)(`div`,{className:B.total,children:[(0,V.jsx)(`span`,{children:`Total tracked`}),(0,V.jsx)(`strong`,{children:i.durationLabel}),(0,V.jsx)(`small`,{children:i.rollupLabel})]}),(0,V.jsxs)(`div`,{className:B.ledgerBody,children:[(0,V.jsxs)(`header`,{children:[(0,V.jsx)(`span`,{children:`Time ledger`}),(0,V.jsx)(l,{label:i.associationLabel,tone:i.jiraAssociations.length===0?`caution`:`positive`})]}),(0,V.jsx)(`p`,{children:i.description}),(0,V.jsxs)(`dl`,{className:B.primaryFacts,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{children:`Project`}),(0,V.jsx)(`dd`,{children:i.projectLabel})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{children:`Billing`}),(0,V.jsx)(`dd`,{children:i.billableLabel})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{children:`Contributor`}),(0,V.jsx)(`dd`,{children:i.contributorLabel})]})]})]})]}),(0,V.jsx)(_n,{heading:`Entry`,meta:`The exact source record included in the total`,children:(0,V.jsxs)(`div`,{className:B.entry,children:[(0,V.jsx)(`strong`,{children:i.durationLabel}),(0,V.jsxs)(`dl`,{children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{children:`Started`}),(0,V.jsx)(`dd`,{children:i.startedAt})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{children:`Ended`}),(0,V.jsx)(`dd`,{children:i.endedAt})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{children:`State`}),(0,V.jsx)(`dd`,{children:i.timerLabel})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{children:`Provider lock`}),(0,V.jsx)(`dd`,{children:i.lockLabel})]})]})]})}),(0,V.jsx)(_n,{heading:`Jira attribution`,meta:`Current delivery-ledger relationships`,children:(0,V.jsxs)(`div`,{className:B.attribution,"data-state":i.jiraAssociations.length===0?`missing`:`linked`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`strong`,{children:i.associationLabel}),(0,V.jsx)(`p`,{children:i.associationDetail})]}),i.jiraAssociations.length===0?null:(0,V.jsx)(`ul`,{children:i.jiraAssociations.map(e=>(0,V.jsx)(`li`,{children:(0,V.jsxs)(o,{to:e.href,children:[(0,V.jsx)(`span`,{children:e.key}),(0,V.jsx)(`strong`,{children:e.title}),(0,V.jsxs)(`small`,{children:[e.state===`inferred`?`Inferred`:`Linked`,` · `,e.evidenceLabel]})]})},e.href))})]})}),(0,V.jsx)(_n,{heading:`People`,meta:`Provider contributor and assigned approvers`,children:(0,V.jsxs)(`dl`,{className:B.people,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{children:`Contributor`}),(0,V.jsx)(`dd`,{children:i.contributorLabel})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{children:`Approvers`}),(0,V.jsx)(`dd`,{children:i.approvers.join(` · `)||`No approval recorded`})]})]})}),(0,V.jsxs)(`aside`,{className:B.readOnly,"data-clockify-approval":!0,children:[(0,V.jsxs)(`strong`,{children:[`Control Center approval: `,i.approvalLabel]}),(0,V.jsx)(`span`,{children:i.approvalDetail}),i.approvalDecidedAt===null?null:(0,V.jsxs)(`time`,{dateTime:i.approvalDecidedAt.dateTime,children:[`Recorded `,i.approvalDecidedAt.label]})]}),(0,V.jsxs)(`section`,{"aria-label":`Governed Clockify actions`,"data-clockify-governed-actions":!0,children:[(0,V.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),f||n({_tag:`correct-association`,expectedRevision:i.sourceRevision,jiraIssueKey:a})},children:[(0,V.jsxs)(`label`,{children:[`Jira issue key`,(0,V.jsx)(`input`,{disabled:f,maxLength:100,onChange:e=>s(e.currentTarget.value),pattern:`[A-Z][A-Z0-9]*-[1-9][0-9]*`,required:!0,value:a})]}),(0,V.jsx)(`button`,{disabled:f,type:`submit`,children:`Correct association`})]}),(0,V.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),!p&&c.trim().length>0&&(n({_tag:`record-approval`,expectedRevision:i.sourceRevision,decision:d.current,rationale:c.trim()}),d.current=`approved`)},children:[(0,V.jsxs)(`label`,{children:[`Approval rationale`,(0,V.jsx)(`input`,{disabled:p,maxLength:1e3,onChange:e=>u(e.currentTarget.value),required:!0,value:c})]}),(0,V.jsx)(`button`,{disabled:p||c.trim().length===0,onClick:()=>{d.current=`approved`},type:`submit`,children:`Approve revision`}),(0,V.jsx)(`button`,{disabled:p||c.trim().length===0,onClick:()=>{d.current=`rejected`},type:`submit`,children:`Reject revision`})]}),r._tag===`failed`?(0,V.jsx)(`p`,{role:`alert`,children:`The governed action could not be submitted.`}):null,r._tag===`succeeded`?(0,V.jsxs)(`p`,{children:[`Action recorded: `,r.result.state]}):null]})]})},yn={submit:(e,t,n)=>M(_e(function*(){let n=yield*$e;return t._tag,yield*n.deliveryGraph.submitClockifyAction({params:{entityId:e},payload:t})}).pipe(me(Le)),{signal:n})},bn=(e,t,n,r,i=yn)=>{let[a,o]=(0,I.useState)({_tag:`idle`}),s=(0,I.useRef)(null);return(0,I.useEffect)(()=>(s.current?.abort(),s.current=null,o({_tag:`idle`}),()=>{s.current?.abort(),s.current=null}),[e,t]),{state:a,submit:(0,I.useCallback)(a=>{if(t===null||s.current!==null)return;let c=new AbortController;s.current=c,o({_tag:`submitting`}),i.submit(e,a,c.signal).then(e=>{s.current===c&&(s.current=null,o({_tag:`succeeded`,result:e}),r())},e=>{s.current===c&&(s.current=null,k(`UnauthorizedApiError`)(e)&&n(t),c.signal.aborted||o({_tag:`failed`}))})},[e,n,r,t,i])}},xn=`15 seconds`,Sn=15e3,Cn=1e3,wn=9e5,Tn={synchronize:(e,t)=>{let n=dt.synchronize;return n===void 0?Promise.reject(Error(`Confluence synchronization is unavailable`)):n(e,t)}},En=re({ownerKey:P,recordedAt:pe,sessionExpired:de,state:ae([`syncing`,`synchronized`,`failed`])}),H=new Map,Dn=new WeakMap,On=new Map,kn=_e(function*(){return yield*(yield*Re).randomUUIDv4}).pipe(me(ze)),An=e=>{let t=On.get(e);if(t!==void 0)return t;let n=xe(kn);return On.set(e,n),n},jn=e=>`control-center:confluence-sync:${e}`,Mn=e=>{try{let t=localStorage.getItem(e);return t===null?null:we(Oe(ke(En))(t))}catch{return null}},Nn=(e,t)=>{try{localStorage.setItem(e,be(ke(En))(t))}catch{}},Pn=(e,t)=>{let n=Mn(e);if(n?.state===`syncing`&&n.ownerKey===t.ownerKey&&n.recordedAt===t.recordedAt)try{localStorage.removeItem(e)}catch{}},U=async(e,t)=>{let n=!1;return await Promise.all(Array.from(e.participants.values(),async e=>{if(!e.lifetime.aborted){if(t.sessionExpired&&t.ownerKey!==e.ownerKey){n=!0;return}if(t.state!==`synchronized`){e.setState(t.state),t.sessionExpired&&e.onSessionExpired();return}e.setState(`syncing`);try{let t=await e.verifySynchronized(e.lifetime);if(e.lifetime.aborted)return;e.setState(t?`synchronized`:`idle`),t&&e.onSynchronized()}catch(t){if(e.lifetime.aborted)return;k(`UnauthorizedApiError`)(t)&&e.onSessionExpired(),e.setState(`failed`)}}})),n},Fn=(e,t,n=!1)=>{if(t.active!==null)return t.active.completion;let r=new AbortController,i=M(Ee),a=jn(e),o=!1,s=async()=>{let s=await i,c=await M(Ee),l=t.participants.values().next().value;if(l===void 0||r.signal.aborted)return;let u=Mn(a),d=u===null?null:c-u.recordedAt;if(u!==null&&d!==null&&u.recordedAt<=c+Cn&&(!u.sessionExpired||u.ownerKey===l.ownerKey)&&(u.state===`syncing`?d<wn:!n&&(u.recordedAt>=s||d<Sn))){u.state!==`syncing`&&(o=await U(t,u));return}let f={ownerKey:l.ownerKey,recordedAt:c,sessionExpired:!1,state:`syncing`};Nn(a,f),o=await U(t,f);let p=()=>Pn(a,f);r.signal.addEventListener(`abort`,p,{once:!0});try{let n=await l.transport.synchronize(e,r.signal);if(r.signal.aborted)return p();let i={ownerKey:l.ownerKey,recordedAt:await M(Ee),sessionExpired:!1,state:n.result===`synchronized`?`synchronized`:`failed`};Nn(a,i),o=await U(t,i)}catch(e){if(r.signal.aborted)return p();let n={ownerKey:l.ownerKey,recordedAt:await M(Ee),sessionExpired:k(`UnauthorizedApiError`)(e),state:`failed`};Nn(a,n),o=await U(t,n)}finally{r.signal.removeEventListener(`abort`,p)}},c=`locks`in navigator?navigator.locks:null,l=(c===null?s():c.request(`control-center:confluence-sync:${e}`,{signal:r.signal},()=>s())).catch(async e=>{let n=t.participants.values().next().value;!r.signal.aborted&&n!==void 0&&(o=await U(t,{ownerKey:n.ownerKey,recordedAt:0,sessionExpired:k(`UnauthorizedApiError`)(e),state:`failed`}))}).finally(()=>{t.active?.abort===r&&(t.active=null),o&&document.visibilityState===`visible`&&Fn(e,t,!0)});return t.active={abort:r,completion:l},l},In=(e,t)=>{let n=null,r=0,i=!1,a=e=>{if(i||e!==r)return;let a=new AbortController;n=a,M(O(xn),{signal:a.signal}).then(()=>o(),e=>{if(!a.signal.aborted)for(let e of t.participants.values())e.setState(`failed`)})},o=()=>{r+=1;let i=r;n?.abort(),n=null,(document.visibilityState===`visible`?Fn(e,t):Promise.resolve()).finally(()=>a(i))},s=()=>{if(document.visibilityState===`visible`){r+=1;let i=r;n?.abort(),n=null,Fn(e,t,!0).finally(()=>a(i))}},c=n=>{if(n.key!==jn(e)||n.newValue===null)return;let r=we(Oe(ke(En))(n.newValue));r!==null&&U(t,r).then(n=>{n&&document.visibilityState===`visible`&&Fn(e,t,!0)})};return document.addEventListener(`visibilitychange`,s),window.addEventListener(`storage`,c),o(),()=>{i=!0,r+=1,n?.abort(),n=null,t.active?.abort.abort(),t.active=null,document.removeEventListener(`visibilitychange`,s),window.removeEventListener(`storage`,c)}},Ln=(e,t)=>{let n=Symbol(),r=H.get(e),i=r??{active:null,participants:new Map};return i.participants.set(n,t),r===void 0&&(H.set(e,i),Dn.set(i,In(e,i))),()=>{i.participants.delete(n),i.participants.size===0&&(Dn.get(i)?.(),Dn.delete(i),H.get(e)===i&&H.delete(e))}},Rn=async e=>{let t=Mn(e);if(t?.state!==`syncing`)return null;let n=await M(Ee);if(t.recordedAt>n+Cn)return null;let r=t.recordedAt+wn-n;return r<=0?null:{remainingMillis:r,synchronization:t}},zn=async(e,t)=>{let n=jn(e);for(;;){if(t.aborted)return;let e=await Rn(n);if(e===null)return;let r=new AbortController;await new Promise(i=>{let a=!1,o=()=>{a||(a=!0,r.abort(),window.removeEventListener(`storage`,s),t.removeEventListener(`abort`,o),i())},s=e=>{e.key===n&&o()};window.addEventListener(`storage`,s),t.addEventListener(`abort`,o,{once:!0}),t.aborted&&o();let c=Mn(n);(c?.state!==`syncing`||c.ownerKey!==e.synchronization.ownerKey||c.recordedAt!==e.synchronization.recordedAt)&&o(),M(O(e.remainingMillis),{signal:r.signal}).then(o,e=>{r.signal.aborted||o()})})}},Bn=({enabled:e,onSessionExpired:t,onSynchronized:n,pluginConnectionId:r,readSynchronizationRevision:i,sessionKey:a,synchronizationRevision:o,transport:s=Tn})=>{let[c,l]=(0,I.useState)(`idle`),u=(0,I.useRef)(null),d=(0,I.useRef)(t),f=(0,I.useRef)(n),p=(0,I.useRef)(i),m=(0,I.useRef)({pluginConnectionId:r,sessionKey:a,value:o});d.current=t,f.current=n,p.current=i,m.current.pluginConnectionId!==r||m.current.sessionKey!==a?m.current={pluginConnectionId:r,sessionKey:a,value:o}:o!==null&&(m.current.value===null||o>m.current.value)&&(m.current.value=o);let h=(0,I.useCallback)(async e=>{let t=await p.current(e),n=m.current.value;return t===null||n===null||t<=n?!1:(m.current.value=t,!0)},[]),g=(0,I.useCallback)(()=>{if(!e||r===null||a===null)return Promise.resolve();let t=H.get(r);return t===void 0?Promise.resolve():Fn(r,t,!0)},[e,r,a]),_=(0,I.useCallback)(()=>{let e=u.current?.signal;if(e===void 0||e.aborted)return;let t=r===null?void 0:H.get(r)?.active?.completion??zn(r,e);t===void 0?g():t.then(()=>{e.aborted||g()})},[r,g]);return(0,I.useEffect)(()=>{if(l(`idle`),!e||r===null||a===null)return;let t=new AbortController;u.current=t;let n=Ln(r,{lifetime:t.signal,onSessionExpired:()=>d.current(a),onSynchronized:()=>f.current(),ownerKey:An(a),sessionKey:a,setState:l,transport:s,verifySynchronized:h});return()=>{t.abort(),u.current===t&&(u.current=null),n()}},[e,r,a,s,h]),{state:c,synchronizeAfterMutation:_,synchronizeNow:_}},W={document:`_document_1dvhb_1`,folio:`_folio_1dvhb_2`,revision:`_revision_1dvhb_3`,folioMeta:`_folioMeta_1dvhb_4`,section:`_section_1dvhb_7`,sectionHeading:`_sectionHeading_1dvhb_8`,collections:`_collections_1dvhb_9`,versions:`_versions_1dvhb_10`,attachments:`_attachments_1dvhb_12`,contentState:`_contentState_1dvhb_14`,documentRead:`_documentRead_1dvhb_15`,editorEntry:`_editorEntry_1dvhb_16`,visualEditor:`_visualEditor_1dvhb_17`,editorHeading:`_editorHeading_1dvhb_18`,editorActions:`_editorActions_1dvhb_19`,editorToolbar:`_editorToolbar_1dvhb_20`,releaseTasks:`_releaseTasks_1dvhb_21`,releaseTaskHeading:`_releaseTaskHeading_1dvhb_22`,releaseTaskList:`_releaseTaskList_1dvhb_23`,evidenceCount:`_evidenceCount_1dvhb_25`,richText:`_richText_1dvhb_97`,editorCanvas:`_editorCanvas_1dvhb_250`},Vn=e=>e.replace(/([\\`*_[\]<>])/gu,`\\$1`),Hn=e=>e.nodeType===Node.ELEMENT_NODE,Un=e=>e.tagName.toLocaleLowerCase(`en-US`)===`input`&&`type`in e&&e.type===`checkbox`&&`checked`in e&&oe(e.checked),G=e=>{if(e.nodeType===Node.TEXT_NODE)return Vn(e.textContent??``);if(!Hn(e))return``;let t=[...e.childNodes].map(G).join(``);switch(e.tagName.toLocaleLowerCase(`en-US`)){case`strong`:case`b`:return`**${t}**`;case`em`:case`i`:return`*${t}*`;case`s`:case`del`:return`~~${t}~~`;case`code`:return`\`${(e.textContent??``).replace(/`/gu,"\\`")}\``;case`a`:{let n=e.getAttribute(`href`);return n===null?t:`[${t}](${n.replace(/\)/gu,`\\)`)})`}case`br`:return`
|
|
3
|
+
`;default:return t}},Wn=(e,t,n=0)=>[...e.children].filter(e=>e.tagName.toLocaleLowerCase(`en-US`)===`li`).map((e,r)=>{let i=[...e.children].find(Un),a=i===void 0?``:`[${i.checked?`x`:` `}] `,o=[...e.children].filter(e=>/^(?:ol|ul)$/u.test(e.tagName.toLowerCase())),s=[...e.childNodes].filter(e=>!Hn(e)||!/^(?:ol|ul)$/u.test(e.tagName.toLowerCase())).map(G).join(``).trim(),c=` `.repeat(n),l=o.map(e=>Wn(e,e.tagName.toLowerCase()===`ol`,n+1));return[`${c}${t?`${String(r+1)}.`:`-`} ${i===void 0?``:a}${s}`,...l].join(`
|
|
4
|
+
`)}).join(`
|
|
5
|
+
`),Gn=e=>{if(e.nodeType===Node.TEXT_NODE)return Vn(e.textContent??``);if(!Hn(e))return``;let t=e.tagName.toLocaleLowerCase(`en-US`);switch(t){case`h1`:case`h2`:case`h3`:case`h4`:case`h5`:case`h6`:return`${`#`.repeat(Number(t.slice(1)))} ${G(e).trim()}`;case`ul`:return Wn(e,!1);case`ol`:return Wn(e,!0);case`blockquote`:return G(e).trim().split(`
|
|
6
|
+
`).map(e=>`> ${e}`).join(`
|
|
7
|
+
`);case`pre`:{let t=e.textContent??``,n=Math.max(0,...[...t.matchAll(/`+/gu)].map(([e])=>e.length)),r="`".repeat(Math.max(3,n+1));return`${r}\n${t}\n${r}`}case`hr`:return`---`;case`p`:case`div`:case`section`:case`article`:return[...e.children].some(e=>/^(?:article|blockquote|div|h[1-6]|hr|ol|p|pre|section|ul)$/u.test(e.tagName.toLocaleLowerCase(`en-US`)))?[...e.childNodes].map(Gn).filter(e=>e.trim().length>0).join(`
|
|
8
|
+
|
|
9
|
+
`):G(e).trim();default:return G(e).trim()}},Kn=e=>[...e.childNodes].map(Gn).filter(e=>e.trim().length>0).join(`
|
|
10
|
+
|
|
11
|
+
`).replace(/\n{3,}/gu,`
|
|
12
|
+
|
|
13
|
+
`).trim(),K=(e,t)=>{document.execCommand(e,!1,t)},qn=e=>{let t=URL.parse(e);return t!==null&&(t.protocol===`http:`||t.protocol===`https:`)?t.href:null},Jn=e=>e===`succeeded`,Yn=(0,I.memo)(({markdown:e})=>(0,V.jsx)(ft,{value:e}),()=>!0),Xn=({canEdit:e,entityId:t,onAskAgent:n,onSaved:r,page:i,releaseId:a,submitPublication:o=Ue,title:s})=>{let[c,l]=(0,I.useState)({_tag:`idle`}),[p,m]=(0,I.useState)(null),[h,g]=(0,I.useState)(!1),[_,v]=(0,I.useState)(s),y=(0,I.useRef)(null),b=c._tag!==`idle`&&c._tag!==`saved`,x=c._tag===`saving`,S=lt(i.content??``);(0,I.useEffect)(()=>{v(s),l({_tag:`idle`}),m(null),g(!1)},[i.revision,s]);let C=(n,c)=>{if(!e||!i.taskUpdatesSafe||a===null||i.content===null||p!==null)return;let l=ct(i.content,n,c);l!==null&&(m(n),g(!1),o({releaseId:a,provider:`confluence`,title:s,markdown:l,targetEntityId:t,targetRevision:De.make(i.revision),signal:AbortSignal.timeout(3e4)}).then(e=>{Jn(e.state)?r():g(!0)},()=>g(!0)).finally(()=>m(null)))};return b?(0,V.jsxs)(`div`,{className:W.visualEditor,"data-confluence-visual-editor":!0,children:[(0,V.jsxs)(`div`,{className:W.editorHeading,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(E,{as:`strong`,children:[`Editing revision `,i.revision]}),(0,V.jsx)(E,{tone:`secondary`,variant:`meta`,children:`Save creates the next Confluence revision after an explicit owner confirmation.`})]}),(0,V.jsxs)(`div`,{className:W.editorActions,children:[(0,V.jsx)(f,{disabled:x,onClick:n,variant:`secondary`,children:`Ask Relay`}),(0,V.jsx)(f,{disabled:x,onClick:()=>l({_tag:`idle`}),variant:`secondary`,children:`Cancel`}),(0,V.jsx)(f,{disabled:x,loading:x,onClick:()=>{let e=y.current;if(e===null||a===null||x)return;let n=Kn(e),s=_.trim();if(s.length===0||n.length===0){l({_tag:`failed`});return}l({_tag:`saving`}),o({releaseId:a,provider:`confluence`,title:s,markdown:n,targetEntityId:t,targetRevision:De.make(i.revision),signal:AbortSignal.timeout(3e4)}).then(e=>{Jn(e.state)?(l({_tag:`saved`}),r()):l({_tag:`failed`})},()=>l({_tag:`failed`}))},children:`Save to Confluence`})]})]}),i.contentState!==`loaded`||i.content===null?(0,V.jsx)(u,{description:`The existing body is not synchronized. Saving this draft replaces the complete Confluence page body at the displayed revision.`,title:`Complete replacement`,tone:`caution`}):null,(0,V.jsx)(d,{label:`Page title`,children:e=>(0,V.jsx)(`input`,{...e,disabled:x,maxLength:500,onChange:e=>v(e.target.value),value:_})}),(0,V.jsxs)(`div`,{"aria-label":`Document formatting`,className:W.editorToolbar,onMouseDown:e=>e.preventDefault(),role:`toolbar`,children:[(0,V.jsx)(`button`,{onClick:()=>K(`formatBlock`,`p`),type:`button`,children:`Paragraph`}),(0,V.jsx)(`button`,{onClick:()=>K(`formatBlock`,`h2`),type:`button`,children:`Heading 2`}),(0,V.jsx)(`button`,{onClick:()=>K(`formatBlock`,`h3`),type:`button`,children:`Heading 3`}),(0,V.jsx)(`button`,{"aria-label":`Bold`,onClick:()=>K(`bold`),type:`button`,children:(0,V.jsx)(`strong`,{children:`B`})}),(0,V.jsx)(`button`,{"aria-label":`Italic`,onClick:()=>K(`italic`),type:`button`,children:(0,V.jsx)(`em`,{children:`I`})}),(0,V.jsx)(`button`,{onClick:()=>K(`insertUnorderedList`),type:`button`,children:`Bullets`}),(0,V.jsx)(`button`,{onClick:()=>K(`insertOrderedList`),type:`button`,children:`Numbered`}),(0,V.jsx)(`button`,{onClick:()=>{let e=window.prompt(`Link address`),t=e===null?null:qn(e);t!==null&&K(`createLink`,t)},type:`button`,children:`Link`})]}),(0,V.jsx)(`div`,{"aria-label":`Confluence page body`,"aria-multiline":`true`,className:`${W.editorCanvas} ${W.richText}`,contentEditable:!x,ref:y,role:`textbox`,suppressContentEditableWarning:!0,children:(0,V.jsx)(Yn,{markdown:i.content??``})}),c._tag===`failed`?(0,V.jsx)(u,{description:`Keep a non-empty title and document body, refresh the latest revision, then try again.`,title:`The page was not saved`,tone:`critical`}):null]}):(0,V.jsxs)(`div`,{className:W.documentRead,children:[i.contentState===`loaded`&&i.content!==null?(0,V.jsx)(ft,{className:W.richText,value:i.content}):(0,V.jsxs)(`div`,{className:W.contentState,"data-content-state":i.contentState,children:[(0,V.jsx)(`strong`,{children:i.contentState===`lazy`?`Content has not been loaded`:`No readable body was returned`}),(0,V.jsx)(E,{tone:`secondary`,children:`Open the authenticated Confluence source to read it now, or synchronize the connection before editing so Relay never replaces an unseen document.`})]}),S.total===0?null:(0,V.jsxs)(`section`,{"aria-labelledby":`confluence-release-tasks`,className:W.releaseTasks,children:[(0,V.jsxs)(`div`,{className:W.releaseTaskHeading,children:[(0,V.jsx)(E,{as:`h3`,id:`confluence-release-tasks`,variant:`card-title`,children:`Release tasks`}),(0,V.jsxs)(E,{tone:`secondary`,variant:`meta`,children:[S.completed,` of `,S.total,` complete`]})]}),(0,V.jsx)(`ul`,{className:W.releaseTaskList,children:S.tasks.map(t=>(0,V.jsxs)(`li`,{children:[(0,V.jsxs)(`label`,{children:[(0,V.jsx)(`input`,{checked:t.checked,disabled:!e||!i.taskUpdatesSafe||a===null||p!==null,onChange:e=>C(t.lineIndex,e.target.checked),type:`checkbox`}),(0,V.jsx)(`span`,{children:t.label})]}),p===t.lineIndex?(0,V.jsx)(E,{variant:`meta`,children:`Saving…`}):null]},`${String(t.lineIndex)}-${t.label}`))}),S.outstanding===0?(0,V.jsx)(E,{children:`All Confluence tasks are complete.`}):(0,V.jsxs)(E,{tone:`secondary`,children:[S.outstanding,` task`,S.outstanding===1?``:`s`,` block release publication.`]}),i.taskUpdatesSafe?null:(0,V.jsx)(E,{tone:`secondary`,children:`Task-only updates are unavailable because this safe page projection cannot prove a lossless ADF round trip. Review a complete replacement before changing these tasks.`}),h?(0,V.jsx)(u,{description:`Refresh the latest Confluence revision, then tick the task again.`,title:`The task was not updated`,tone:`critical`}):null]}),(0,V.jsxs)(`div`,{className:W.editorEntry,children:[(0,V.jsx)(f,{disabled:!e||a===null,onClick:()=>l({_tag:`editing`}),children:i.contentState===`loaded`&&i.content!==null?`Edit on this page`:`Write a complete replacement`}),(0,V.jsx)(f,{onClick:n,variant:`secondary`,children:`Ask Relay to edit`}),c._tag===`saved`?(0,V.jsx)(E,{children:`Saved to Confluence.`}):null,e?null:(0,V.jsx)(E,{tone:`secondary`,children:`Current source data and workspace-owner access are required to edit.`}),e&&a===null?(0,V.jsx)(E,{tone:`secondary`,children:`Link this page to a release before editing it in Relay.`}):null]})]})},q=({children:e,heading:t,meta:n})=>(0,V.jsxs)(`section`,{className:W.section,children:[(0,V.jsxs)(`header`,{className:W.sectionHeading,children:[(0,V.jsx)(E,{as:`h2`,variant:`section-title`,children:t}),(0,V.jsx)(E,{tone:`secondary`,variant:`meta`,children:n})]}),e]}),Zn=({editor:e,page:t})=>{let[n,r]=(0,I.useState)(!1);return(0,V.jsxs)(`article`,{className:W.document,"data-workspace-confluence-page-detail":!0,children:[(0,V.jsxs)(`section`,{"aria-label":`Document identity`,className:W.folio,children:[(0,V.jsxs)(`div`,{className:W.revision,children:[(0,V.jsx)(`span`,{children:`Revision`}),(0,V.jsx)(`strong`,{children:t.revision})]}),(0,V.jsxs)(`div`,{className:W.folioMeta,children:[(0,V.jsx)(l,{label:t.status,tone:t.status===`Superseded`?`caution`:t.status===`Current`?`positive`:`neutral`}),(0,V.jsxs)(`dl`,{children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{children:`Space`}),(0,V.jsx)(`dd`,{children:t.sourceSpaceId})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{children:`Updated`}),(0,V.jsx)(`dd`,{children:t.updatedAt===null?`Not synchronized`:(0,V.jsx)(`time`,{dateTime:t.updatedAt.dateTime,children:t.updatedAt.label})})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{children:`Created`}),(0,V.jsx)(`dd`,{children:t.createdAt===null?`Not synchronized`:(0,V.jsx)(`time`,{dateTime:t.createdAt.dateTime,children:t.createdAt.label})})]})]})]})]}),(0,V.jsx)(q,{heading:`Document`,meta:`Safely converted text; raw provider markup and media stay outside this view`,children:(0,V.jsx)(Xn,{...e,page:t})}),(0,V.jsx)(q,{heading:`People`,meta:t.watcherInventoryLabel,children:t.contributors.length===0?(0,V.jsx)(E,{tone:`secondary`,children:`No owner, contributor, or watcher identity was synchronized.`}):(0,V.jsx)(ee,{"aria-label":`Page collaborators`,expanded:n,limit:4,onExpandedChange:r,people:t.contributors})}),(0,V.jsxs)(`div`,{className:W.collections,children:[(0,V.jsx)(q,{heading:`Revision history`,meta:t.historyInventoryLabel,children:t.versions.length===0?(0,V.jsx)(E,{tone:`secondary`,children:`No revision history was synchronized.`}):(0,V.jsx)(`ol`,{className:W.versions,children:t.versions.map(e=>(0,V.jsxs)(`li`,{children:[(0,V.jsxs)(`strong`,{children:[`v`,e.number]}),(0,V.jsx)(`span`,{children:e.message}),(0,V.jsxs)(`small`,{children:[e.author,` · `,(0,V.jsx)(`time`,{dateTime:e.createdAt.dateTime,children:e.createdAt.label}),e.minorEdit?` · Minor edit`:``]})]},`${String(e.number)}-${e.createdAt.dateTime}`))})}),(0,V.jsx)(q,{heading:`Attachments`,meta:t.attachmentInventoryLabel,children:t.attachments.length===0?(0,V.jsx)(E,{tone:`secondary`,children:`No attachment metadata was synchronized.`}):(0,V.jsx)(`ul`,{className:W.attachments,children:t.attachments.map(e=>(0,V.jsxs)(`li`,{children:[(0,V.jsx)(`strong`,{children:e.title}),(0,V.jsxs)(`span`,{children:[e.mediaType,` · `,e.fileSize,` · `,e.version]}),(0,V.jsx)(`small`,{children:`Metadata only · authenticated proxy required`})]},e.id))})})]}),(0,V.jsx)(q,{heading:`Runbook evidence`,meta:`Immutable delivery evidence around this page`,children:(0,V.jsxs)(`div`,{className:W.evidenceCount,children:[(0,V.jsx)(`strong`,{children:t.runbookEvidenceCount}),(0,V.jsxs)(`span`,{children:[`evidence item`,t.runbookEvidenceCount===1?``:`s`,` in the current bounded graph`]})]})})]})},J={document:`_document_1cny9_1`,section:`_section_1cny9_2`,sectionHeading:`_sectionHeading_1cny9_3`,people:`_people_1cny9_4`,conversation:`_conversation_1cny9_5`,history:`_history_1cny9_6`,related:`_related_1cny9_7`,metadata:`_metadata_1cny9_8`,attribution:`_attribution_1cny9_9`,richText:`_richText_1cny9_28`,commentBody:`_commentBody_1cny9_29`,criteria:`_criteria_1cny9_70`,boundaryNotice:`_boundaryNotice_1cny9_75`,collectionNotice:`_collectionNotice_1cny9_76`},Y=({children:e,heading:t,meta:n})=>(0,V.jsxs)(`section`,{className:J.section,children:[(0,V.jsxs)(`header`,{className:J.sectionHeading,children:[(0,V.jsx)(E,{as:`h2`,variant:`section-title`,children:t}),n===void 0?null:(0,V.jsx)(E,{tone:`secondary`,variant:`meta`,children:n})]}),e]}),Qn=({empty:e,value:t})=>t===null?(0,V.jsx)(E,{tone:`secondary`,children:e}):(0,V.jsx)(ft,{className:J.richText,value:t}),$n=({issue:e})=>(0,V.jsxs)(`article`,{className:J.document,"data-workspace-issue-detail":!0,children:[e.truncationMessage===null?null:(0,V.jsx)(E,{className:J.boundaryNotice,tone:`secondary`,children:e.truncationMessage}),(0,V.jsx)(Y,{heading:`Description`,meta:`What changes and why`,children:(0,V.jsx)(Qn,{empty:`No description was synchronized from Jira.`,value:e.description})}),(0,V.jsx)(Y,{heading:`Acceptance criteria`,meta:`The finish line`,children:(0,V.jsx)(`div`,{className:J.criteria,children:(0,V.jsx)(Qn,{empty:`No acceptance criteria were synchronized.`,value:e.acceptanceCriteria})})}),e.environment===null?null:(0,V.jsx)(Y,{heading:`Environment`,meta:`Where this applies`,children:(0,V.jsx)(Qn,{empty:`No environment was synchronized.`,value:e.environment})}),(0,V.jsx)(Y,{heading:`People`,meta:`${String(e.collaborators.length)} collaborators`,children:e.collaborators.length===0?(0,V.jsx)(E,{tone:`secondary`,children:`No Jira collaborator was synchronized for this issue.`}):(0,V.jsx)(`ul`,{className:J.people,children:e.collaborators.map(e=>(0,V.jsx)(`li`,{children:(0,V.jsx)(y,{person:e})},e.id))})}),(0,V.jsx)(Y,{heading:`Issue details`,meta:`Synchronized fields`,children:(0,V.jsx)(`dl`,{className:J.metadata,children:e.metadata.map(e=>(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{children:e.label}),(0,V.jsx)(`dd`,{children:e.value})]},e.label))})}),e.parent===null&&e.subtasks.length===0?null:(0,V.jsx)(Y,{heading:`Related Jira work`,meta:`Source hierarchy`,children:(0,V.jsxs)(`div`,{className:J.related,children:[e.parent===null?null:(0,V.jsxs)(`div`,{children:[(0,V.jsx)(E,{tone:`secondary`,variant:`meta`,children:`Parent`}),e.parent.href===null?(0,V.jsx)(`strong`,{children:e.parent.key}):(0,V.jsx)(`a`,{href:e.parent.href,rel:`noreferrer`,target:`_blank`,children:e.parent.key}),(0,V.jsx)(`span`,{children:e.parent.summary}),(0,V.jsx)(`small`,{children:e.parent.status})]}),e.subtasks.map(e=>(0,V.jsxs)(`div`,{children:[(0,V.jsx)(E,{tone:`secondary`,variant:`meta`,children:`Subtask`}),e.href===null?(0,V.jsx)(`strong`,{children:e.key}):(0,V.jsx)(`a`,{href:e.href,rel:`noreferrer`,target:`_blank`,children:e.key}),(0,V.jsx)(`span`,{children:e.summary}),(0,V.jsx)(`small`,{children:e.status})]},e.key))]})}),(0,V.jsxs)(Y,{heading:`Comments`,meta:`${String(e.commentCount)} comments`,children:[e.commentBodiesTruncated?(0,V.jsx)(E,{className:J.collectionNotice,tone:`secondary`,children:`Jira shortened comment bodies to keep this synchronized view bounded.`}):null,e.commentsTruncated?(0,V.jsx)(E,{className:J.collectionNotice,tone:`secondary`,children:`Only the newest synchronized comments are shown.`}):null,e.comments.length===0?(0,V.jsx)(E,{tone:`secondary`,children:`No comment was synchronized for this issue.`}):(0,V.jsx)(`ol`,{className:J.conversation,children:e.comments.map(e=>(0,V.jsxs)(`li`,{children:[(0,V.jsxs)(`div`,{className:J.attribution,children:[(0,V.jsx)(y,{person:e.author,size:`compact`}),e.time===null?null:(0,V.jsx)(`time`,{children:e.time})]}),(0,V.jsx)(ft,{className:J.commentBody,value:e.body??`Comment body unavailable.`})]},e.id))})]}),(0,V.jsxs)(Y,{heading:`History`,meta:`${String(e.historyCount)} changes`,children:[e.historyTruncated?(0,V.jsx)(E,{className:J.collectionNotice,tone:`secondary`,children:`Only the newest synchronized history is shown.`}):null,e.history.length===0?(0,V.jsx)(E,{tone:`secondary`,children:`No field history was synchronized for this issue.`}):(0,V.jsx)(`ol`,{className:J.history,children:e.history.map(e=>(0,V.jsxs)(`li`,{children:[(0,V.jsxs)(`div`,{className:J.attribution,children:[(0,V.jsx)(y,{person:e.actor,size:`compact`}),e.time===null?null:(0,V.jsx)(`time`,{children:e.time})]}),(0,V.jsx)(`dl`,{children:e.changes.map((e,t)=>(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{children:e.field}),(0,V.jsx)(`dd`,{children:e.transition})]},`${e.field}:${String(t)}`))})]},e.id))})]})]}),X={document:`_document_173oo_1`,hero:`_hero_173oo_2`,heroHeading:`_heroHeading_173oo_3`,heroFacts:`_heroFacts_173oo_4`,executionMeta:`_executionMeta_173oo_6`,section:`_section_173oo_7`,sectionHeading:`_sectionHeading_173oo_8`,peopleLanes:`_peopleLanes_173oo_9`,actions:`_actions_173oo_11`,artifacts:`_artifacts_173oo_17`,sourceArtifacts:`_sourceArtifacts_173oo_18`,deliveryCounts:`_deliveryCounts_173oo_21`,summary:`_summary_173oo_64`,stageRail:`_stageRail_173oo_116`,partial:`_partial_173oo_142`,error:`_error_173oo_193`},er=({children:e,heading:t,meta:n})=>(0,V.jsxs)(`section`,{className:X.section,children:[(0,V.jsxs)(`header`,{className:X.sectionHeading,children:[(0,V.jsx)(E,{as:`h2`,variant:`section-title`,children:t}),(0,V.jsx)(E,{tone:`secondary`,variant:`meta`,children:n})]}),e]}),tr=({value:e})=>e===null?(0,V.jsx)(V.Fragment,{children:`Not synchronized`}):(0,V.jsx)(`time`,{dateTime:e.dateTime,children:e.label}),nr=({pipeline:e})=>(0,V.jsxs)(`article`,{className:X.document,"data-workspace-pipeline-execution-detail":!0,children:[(0,V.jsxs)(`section`,{"aria-label":`Execution identity`,className:X.hero,children:[(0,V.jsxs)(`div`,{className:X.heroHeading,children:[(0,V.jsx)(`span`,{children:`Execution`}),(0,V.jsx)(`strong`,{children:e.executionId}),(0,V.jsx)(l,{label:e.status,tone:e.status===`Succeeded`?`positive`:e.status===`Failed`?`critical`:e.status===`Running`?`progress`:e.status===`Stopped`?`caution`:`neutral`})]}),e.statusSummary===null?null:(0,V.jsx)(`p`,{className:X.summary,children:e.statusSummary}),(0,V.jsxs)(`dl`,{className:X.heroFacts,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{children:`Why`}),(0,V.jsxs)(`dd`,{children:[e.triggerType,(0,V.jsx)(`small`,{children:e.triggerDetail})]})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{children:`Revision`}),(0,V.jsx)(`dd`,{children:(0,V.jsx)(`code`,{children:e.triggerRevision})})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{children:`Where`}),(0,V.jsx)(`dd`,{children:e.targetEnvironment})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{children:`Duration`}),(0,V.jsx)(`dd`,{children:e.duration})]})]}),(0,V.jsxs)(`dl`,{className:X.executionMeta,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{children:`Pipeline`}),(0,V.jsxs)(`dd`,{children:[e.pipelineName,` · `,e.pipelineVersion]})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{children:`Started`}),(0,V.jsx)(`dd`,{children:(0,V.jsx)(tr,{value:e.startedAt})})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{children:`Updated`}),(0,V.jsx)(`dd`,{children:(0,V.jsx)(tr,{value:e.updatedAt})})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{children:`Mode`}),(0,V.jsx)(`dd`,{children:e.executionMode})]})]})]}),(0,V.jsx)(x,{className:X.stageRail,emptyLabel:`No stage detail was synchronized for this execution.`,heading:`Execution path`,stages:e.stages}),(0,V.jsx)(er,{heading:`People`,meta:`Provider identities that operated or approved this run`,children:(0,V.jsxs)(`div`,{className:X.peopleLanes,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`small`,{children:`Operators`}),(0,V.jsx)(`strong`,{children:e.operators.join(` · `)||`Not synchronized`})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`small`,{children:`Approvers`}),(0,V.jsx)(`strong`,{children:e.approvers.join(` · `)||`No approval recorded`})]})]})}),(0,V.jsxs)(er,{heading:`Actions`,meta:`${e.actionCountLabel} actions · ${String(e.pagesRead)} bounded pages read`,children:[e.actionsTruncated?(0,V.jsx)(`p`,{className:X.partial,children:`This is a bounded view. Additional action detail exists in CodePipeline.`}):null,e.actions.length===0?(0,V.jsx)(E,{tone:`secondary`,children:`No action detail was synchronized for this execution.`}):(0,V.jsx)(`ol`,{className:X.actions,children:e.actions.map(e=>(0,V.jsxs)(`li`,{"data-tone":e.tone,children:[(0,V.jsxs)(`header`,{children:[(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`small`,{children:e.stageName}),(0,V.jsx)(`strong`,{children:e.name})]}),(0,V.jsx)(l,{label:e.status,tone:e.tone})]}),(0,V.jsxs)(`dl`,{children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{children:`Provider`}),(0,V.jsx)(`dd`,{children:e.provider})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{children:`Duration`}),(0,V.jsx)(`dd`,{children:e.duration})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{children:`Actor`}),(0,V.jsx)(`dd`,{children:e.actor??`Not synchronized`})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{children:`Region`}),(0,V.jsx)(`dd`,{children:e.region??`Not synchronized`})]})]}),e.summary===null?null:(0,V.jsx)(`p`,{children:e.summary}),e.error===null?null:(0,V.jsx)(`p`,{className:X.error,children:e.error}),e.artifacts.length===0?null:(0,V.jsx)(`ul`,{className:X.artifacts,children:e.artifacts.map((e,t)=>(0,V.jsxs)(`li`,{children:[(0,V.jsx)(`span`,{children:e.direction}),(0,V.jsx)(`strong`,{children:e.name}),(0,V.jsx)(`small`,{children:e.accessLabel})]},`${e.direction}-${e.name}-${String(t)}`))})]},e.id))})]}),(0,V.jsx)(er,{heading:`Source artifacts`,meta:`Metadata only; content stays behind the authenticated proxy`,children:e.sourceArtifacts.length===0?(0,V.jsx)(E,{tone:`secondary`,children:`No source artifact metadata was synchronized.`}):(0,V.jsx)(`ul`,{className:X.sourceArtifacts,children:e.sourceArtifacts.map(e=>(0,V.jsxs)(`li`,{children:[(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`strong`,{children:e.name}),(0,V.jsx)(`code`,{children:e.revision})]}),(0,V.jsxs)(`span`,{children:[e.summary??`No summary`,(0,V.jsx)(`small`,{children:e.accessLabel})]})]},`${e.name}-${e.revision}`))})}),(0,V.jsxs)(er,{heading:`Delivery evidence`,meta:`Current accepted relationships around this exact run`,children:[(0,V.jsxs)(`dl`,{className:X.deliveryCounts,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{children:`Releases`}),(0,V.jsx)(`dd`,{children:e.releaseCountLabel})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{children:`Pull requests`}),(0,V.jsx)(`dd`,{children:e.pullRequestCountLabel})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{children:`Runbooks`}),(0,V.jsx)(`dd`,{children:e.runbookCountLabel})]})]}),(0,V.jsx)(E,{tone:`secondary`,children:`Use the delivery relationships below to open each connected object and inspect its evidence.`})]})]}),rr=e=>P.check(N(),A(),j(e),Ne(/^[A-Za-z0-9][A-Za-z0-9._:/-]*$/u)),ir=ae([`review`,`security`,`tests`,`explain`]);re({id:rr(128),name:P.check(N(),A(),j(200)),kind:ir,provider:rr(128),harness:rr(128),model:P.check(N(),A(),j(200)),skillIds:ie(rr(256)).check(j(24),Pe())}),re({namespace:rr(128),subjectId:P.check(N(),A(),j(1024)),revisionId:P.check(N(),A(),j(1024)),baseRevision:ce(P.check(N(),A(),j(1024))),headRevision:P.check(N(),A(),j(1024))});var ar=e=>JSON.stringify([e.namespace,e.subjectId,e.revisionId,e.baseRevision,e.headRevision]),or=(e,t)=>ar(e)===ar(t),sr=s(()=>import(`./pullRequestReviewThreadReplay-eI3Y4i6s.js`),__vite__mapDeps([0,1,2,3,4,5])),Z=sr.then(({generatedClientPullRequestReviewTransport:e})=>e),cr=e=>k(e,`RateLimitedApiError`),lr=e=>{if(!cr(e))return O(Fe(1));let t=e.retryAt;return t===null?O(Fe(2)):Te(fe,e=>O(je(Math.max(0,Ae(t)-Ae(e)))))},ur=class extends he(`PullRequestReviewRequestAborted`){},dr=e=>{let t=[];for(let n of e.providers){let e=n.models[0];n.health===`available`&&n.capabilities.includes(`pr-review`)&&n.reviewProfile!==void 0&&e!==void 0&&t.push({providerId:n.providerId,model:e,reviewProfile:n.reviewProfile,...n.displayName!==void 0&&{displayName:n.displayName}})}return t},fr={enqueue:(...e)=>Z.then(t=>t.enqueue(...e)),cancel:(...e)=>Z.then(t=>t.cancel(...e)),extendBudget:(...e)=>Z.then(t=>t.extendBudget(...e)),load:(...e)=>Z.then(t=>t.load(...e)),loadThread:(...e)=>Z.then(t=>t.loadThread(...e)),previewPublication:(...e)=>Z.then(t=>t.previewPublication(...e)),providers:(...e)=>Z.then(t=>t.providers(...e)),publishSuggestion:(...e)=>Z.then(t=>t.publishSuggestion(...e)),targetSuggestion:(...e)=>Z.then(t=>t.targetSuggestion(...e))},Q=(e,t)=>or(ot(e),ot(t)),pr=(e,t,n,r,i)=>{e.catch(e=>{t.aborted||r.current===null||!Q(r.current,n)||(ue(Me(`Pull-request review history boundary failed`,e)),i(e=>e._tag===`ready`&&Q(e,n)?{...e,historyAction:`failed`}:e))})},mr=(e,t,n,r,i,a)=>{t.aborted||r.current===null||!Q(r.current,n)||a(t=>t._tag===`ready`&&Q(t,n)?{...t,thread:i.current??e}:t)},hr=(e,t)=>e._tag===`unavailable`||e.subject.baseRevision===t.baseRevision&&e.subject.headRevision===t.headRevision,gr=(e,t,n,r,i,a,o=fr)=>{let[s,c]=(0,I.useState)(0),[l,u]=(0,I.useState)({_tag:`idle`}),[d,f]=(0,I.useState)({_tag:`idle`}),p=(0,I.useRef)(null),m=(0,I.useRef)(null),h=(0,I.useRef)(null),g=(0,I.useRef)(null),_=(0,I.useRef)(null),v=(0,I.useRef)(null),y=(0,I.useMemo)(()=>r===null||n===null?null:{baseRevision:t,entityId:e,headRevision:n,sessionKey:r},[t,e,n,r]);(0,I.useLayoutEffect)(()=>{_.current=y},[y]),(0,I.useLayoutEffect)(()=>{v.current=null},[e,r]),(0,I.useEffect)(()=>{if(r===null||n===null){u({_tag:`idle`});return}let s={baseRevision:t,entityId:e,headRevision:n,sessionKey:r},l=v.current??void 0,d=new AbortController,f=(e,t)=>g.current!==null&&Q(g.current,s)?!1:(g.current=s,ue(Ie(e,t)),M(lr(t),{signal:d.signal}).then(()=>{d.signal.aborted||c(e=>e+1)},e=>{d.signal.aborted||u({_tag:`failed`,...s})}),!0);return u(e=>e._tag===`ready`&&Q(e,s)?e:{_tag:`loading`,...s}),sr.then(({loadPullRequestReviewSnapshot:t})=>t(o,e,i,d.signal,l,v)).then(({catalog:e,catalogNeedsRetry:t,review:n,thread:r})=>{if(!d.signal.aborted){t||(g.current=null);let i=dr(e);u(hr(n,s)?{_tag:`ready`,...s,action:`idle`,historyAction:`idle`,provider:i[0]??null,providerPresets:i,review:n,thread:r}:{_tag:`failed`,...s}),t&&f(`Pull-request review provider catalog unavailable; retrying once`)}},e=>{if(!d.signal.aborted){if(F(e)){a(r),u({_tag:`failed`,...s});return}pt(e)&&f(`Pull-request review snapshot load failed; retrying once`,e)||u({_tag:`failed`,...s})}}),()=>d.abort()},[t,i,e,n,a,s,r,o]),(0,I.useEffect)(()=>{if(l._tag!==`ready`||l.review._tag!==`pending`)return;let e=new AbortController;return M(O(`2 seconds`),{signal:e.signal}).then(()=>{e.signal.aborted||c(e=>e+1)},t=>{e.signal.aborted||u({_tag:`failed`,baseRevision:l.baseRevision,entityId:l.entityId,headRevision:l.headRevision,sessionKey:l.sessionKey})}),()=>e.abort()},[l]),(0,I.useEffect)(()=>()=>{p.current?.abort(),m.current?.abort(),h.current?.abort()},[]),(0,I.useEffect)(()=>{p.current?.abort(),p.current=null,m.current?.abort(),m.current=null,h.current?.abort(),h.current=null,f({_tag:`idle`})},[e,r]),(0,I.useLayoutEffect)(()=>{m.current?.abort(),m.current=null,f(e=>e._tag===`publishing`?e:{_tag:`idle`})},[t,n]);let b=(0,I.useCallback)((e,t)=>{let n=v.current??void 0;sr.then(({refreshPullRequestReviewThread:r})=>r(o,e.entityId,t,n,v)).then(n=>{mr(n,t,e,_,v,u)},()=>void 0)},[o]),x=(0,I.useCallback)(()=>{if(l._tag!==`ready`||l.historyAction===`loading`||l.thread===void 0||!l.thread.hasEarlier)return;let e=l,t=l.thread;p.current?.abort();let n=new AbortController;p.current=n,u({...e,historyAction:`loading`}),pr(sr.then(({loadEarlierPullRequestReviewThreadIntoState:r})=>r(o,e,t,n.signal,_,v,a,u)),n.signal,e,_,u)},[a,l,o]),S=(0,I.useCallback)((t,n)=>{if(l._tag!==`ready`||l.review._tag===`unavailable`)return Promise.resolve();let r=n===void 0?l.provider:l.providerPresets?.find(e=>e.providerId===n)??null;if(r===null)return Promise.resolve();let i=l;m.current?.abort();let s=new AbortController;return m.current=s,u({...i,action:`starting`}),o.enqueue(e,r,t,s.signal).then(e=>{if(s.signal.aborted)return Promise.reject(new ur);u(t=>t._tag===`ready`&&Q(t,i)&&hr(e,i)?{...t,action:`idle`,review:e}:t._tag===`ready`&&Q(t,i)?{_tag:`failed`,baseRevision:i.baseRevision,entityId:i.entityId,headRevision:i.headRevision,sessionKey:i.sessionKey}:t)},e=>s.signal.aborted?Promise.reject(new ur):(F(e)&&a(i.sessionKey),u(e=>e._tag===`ready`&&Q(e,i)?{...e,action:`failed`}:e),Promise.reject(e)))},[e,a,l,o]),C=(0,I.useCallback)((e,t)=>{S(e,t).catch(e=>{k(e,`PullRequestReviewRequestAborted`)||ue(Me(`Pull-request review enqueue failed`,e))})},[S]),w=(0,I.useCallback)(e=>{if(l._tag!==`ready`)return;let t=l.review;if(t._tag!==`pending`)return;let n=l;m.current?.abort();let r=new AbortController;m.current=r,e(t.jobId,r.signal).then(e=>{r.signal.aborted||u(t=>t._tag===`ready`&&Q(t,n)&&hr(e,n)?{...t,review:e}:t)},e=>{r.signal.aborted||F(e)&&a(n.sessionKey)})},[a,l]),T=(0,I.useCallback)(t=>{if(l._tag!==`ready`||l.review._tag!==`completed`||l.review.jobId!==t.jobId||!l.review.report.suggestions.some(({suggestionId:e})=>e===t.suggestionId))return;let n=l;m.current?.abort();let r=new AbortController;m.current=r,f({_tag:`previewing`,selection:t}),o.previewPublication(e,t,r.signal).then(e=>{r.signal.aborted||f(e.subject.headRevision===n.headRevision?{_tag:`preview`,preview:e}:{_tag:`failed`,preview:null,selection:t})},e=>{r.signal.aborted||(F(e)&&a(n.sessionKey),f({_tag:`failed`,preview:null,selection:t}))})},[e,a,l,o]),ee=(0,I.useCallback)(t=>{if(l._tag!==`ready`)return;let n=d._tag===`preview`||d._tag===`failed`?d.preview:null;if(n===null)return;let r=l,i={jobId:n.jobId,suggestionId:n.suggestionId,revisionId:n.revisionId};h.current?.abort();let s=new AbortController;h.current=s,f({_tag:`publishing`,preview:n}),o.publishSuggestion(e,i,t,n.authorityBinding,s.signal).then(e=>{if(s.signal.aborted)return;let t=e.suggestionRevision.reviewedHead===n.suggestionRevision.reviewedHead;t&&u(t=>t._tag===`ready`&&t.review._tag===`completed`&&t.review.jobId===e.jobId?{...t,review:{...t.review,report:{...t.review.report,suggestions:t.review.report.suggestions.map(t=>t.suggestionId===e.suggestionId?{...t,state:`published`}:t)}}}:t),f(t?{_tag:`published`,headSuperseded:_.current===null||e.subject.baseRevision!==_.current.baseRevision||e.subject.headRevision!==_.current.headRevision,preview:n,publication:e}:{_tag:`receipt-conflict`,preview:n,publication:e});let i=_.current;i!==null&&i.entityId===r.entityId&&i.sessionKey===r.sessionKey&&b(i,s.signal)},e=>{s.signal.aborted||(F(e)&&a(r.sessionKey),f({_tag:`failed`,preview:n,selection:i}))})},[e,a,d,b,l,o]),te=(0,I.useCallback)(t=>{if(l._tag!==`ready`||l.review._tag!==`completed`||l.review.jobId!==t.jobId||l.provider===null||!l.review.report.suggestions.some(({suggestionId:e})=>e===t.suggestionId)||o.targetSuggestion===void 0)return;let n=l;m.current?.abort();let r=new AbortController;m.current=r,u({...n,action:`starting`}),o.targetSuggestion(e,t,l.provider,r.signal).then(e=>{r.signal.aborted||u(t=>t._tag===`ready`&&Q(t,n)&&hr(e,n)?{...t,action:`idle`,review:e}:t)},e=>{r.signal.aborted||(F(e)&&a(n.sessionKey),u(e=>e._tag===`ready`&&Q(e,n)?{...e,action:`failed`}:e))})},[e,a,l,o]),ne=y===null?{_tag:`idle`}:l._tag!==`idle`&&Q(l,y)?l:{_tag:`loading`,...y};return{cancel:(0,I.useCallback)(()=>{o.cancel!==void 0&&w((t,n)=>o.cancel(e,t,n))},[e,w,o]),cancelPublication:(0,I.useCallback)(()=>{m.current?.abort(),m.current=null,h.current?.abort(),h.current=null,f({_tag:`idle`})},[]),extendBudget:(0,I.useCallback)(()=>{o.extendBudget!==void 0&&w((t,n)=>o.extendBudget(e,t,n))},[e,w,o]),loadEarlier:x,previewPublication:T,publication:d,publishSuggestion:ee,targetSuggestion:te,retry:(0,I.useCallback)(()=>{g.current=null,c(e=>e+1)},[]),start:C,startAwaitable:S,state:ne}},_r=(0,I.lazy)(()=>s(()=>import(`./WorkspacePullRequestDetails-BhxoqR7V.js`).then(e=>({default:e.WorkspacePullRequestDetails})),__vite__mapDeps([6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,1,2,3,23,24,25,26,27]))),vr=(e,t)=>{let n=e.split(/[?#]/u,1)[0]??``;return n===Ge(t)?`Back to items`:n.includes(`/releases/`)?`Back to release`:n.endsWith(`/work`)?`Back to active work`:n.endsWith(`/timeline`)?`Back to timeline`:`Back to workspace`},yr=({action:e,description:t,title:n,tone:r=`neutral`})=>{let i=(0,I.useRef)(null);return(0,I.useEffect)(()=>i.current?.focus(),[]),(0,V.jsx)(`section`,{className:z.state,"data-workspace-entity-state":r,ref:i,tabIndex:-1,children:(0,V.jsx)(u,{action:e,description:t,title:n,tone:r})})},br=()=>(0,V.jsxs)(`section`,{"aria-label":`Loading canonical entity`,className:z.loading,children:[(0,V.jsx)(p,{decorative:!1,height:`12rem`,label:`Loading canonical entity`,variant:`block`}),(0,V.jsxs)(`div`,{className:z.loadingColumns,children:[(0,V.jsx)(p,{height:`20rem`,variant:`block`}),(0,V.jsx)(p,{height:`20rem`,variant:`block`})]})]}),xr=({action:e})=>e.href===null?(0,V.jsx)(f,{disabled:!0,size:`principal`,stretch:!0,variant:`primary`,children:e.label}):e.external?(0,V.jsx)(`a`,{className:z.principalAction,href:e.href,rel:`noreferrer`,target:`_blank`,children:e.label}):(0,V.jsx)(o,{className:z.principalAction,to:e.href,children:e.label}),Sr=(e,t)=>{if(e===null)return null;let n=URL.parse(e);if(n===null||n.protocol!==`https:`)return null;let r=/^\/wiki\/spaces\/([^/]+)\/pages\/([^/]+)(?:\/|$)/u.exec(n.pathname);return r?.[1]===void 0||r[2]!==encodeURIComponent(t)?null:(n.pathname=`/wiki/spaces/${r[1]}/pages/edit-v2/${encodeURIComponent(t)}`,n.search=``,n.hash=``,n.href)},Cr=({onConfluenceSynchronize:e,presentation:t,synchronizationState:n})=>{let r=t.confluencePage===null?null:Sr(t.primaryAction.href,t.displayKey);return(0,V.jsxs)(`div`,{className:z.entityActions,children:[(0,V.jsx)(xr,{action:t.primaryAction}),r===null?null:(0,V.jsx)(`a`,{className:z.secondaryAction,href:r,rel:`noreferrer`,target:`_blank`,children:`Edit in Confluence`}),t.confluencePage===null||n===null?null:(0,V.jsxs)(`div`,{className:z.pageSynchronization,children:[(0,V.jsx)(f,{disabled:n===`syncing`,loading:n===`syncing`,onClick:e,variant:`secondary`,children:`Sync now`}),(0,V.jsx)(E,{tone:`secondary`,variant:`meta`,children:n===`failed`?`Sync failed. Try again.`:n===`synchronized`?`Up to date · live sync every 15 seconds while visible`:`Live sync every 15 seconds while visible`})]})]})},wr=({presentation:e})=>(0,V.jsxs)(`section`,{"aria-labelledby":`workspace-entity-path`,className:z.deliveryPath,children:[(0,V.jsxs)(`div`,{className:z.sectionHeading,children:[(0,V.jsx)(E,{as:`h2`,id:`workspace-entity-path`,variant:`section-title`,children:`Delivery path`}),(0,V.jsx)(E,{tone:`secondary`,variant:`meta`,children:`Where this work lives`})]}),(0,V.jsxs)(`div`,{className:z.pathRail,children:[(0,V.jsxs)(`div`,{className:z.pathNode,children:[(0,V.jsx)(w,{service:e.service,size:`compact`}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`strong`,{children:e.serviceName}),(0,V.jsx)(`code`,{children:e.displayKey})]})]}),e.releases.length===0?(0,V.jsx)(`div`,{className:z.pathEmpty,children:`No release membership yet`}):(0,V.jsx)(`ol`,{className:z.releasePath,children:e.releases.map(e=>(0,V.jsx)(`li`,{children:(0,V.jsx)(o,{to:e.href,children:e.label})},e.id))})]}),(0,V.jsx)(E,{tone:`secondary`,children:e.contentSummary})]}),Tr=({presentation:e})=>(0,V.jsxs)(`section`,{"aria-labelledby":`workspace-entity-facts`,className:z.facts,children:[(0,V.jsx)(E,{as:`h2`,id:`workspace-entity-facts`,variant:`card-title`,children:`At a glance`}),(0,V.jsx)(`dl`,{children:e.facts.map(e=>(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{children:e.label}),(0,V.jsx)(`dd`,{children:e.value})]},e.label))})]}),Er=({presentation:e})=>(0,V.jsxs)(`section`,{"aria-labelledby":`workspace-entity-evidence`,className:z.evidence,children:[(0,V.jsx)(E,{as:`h2`,id:`workspace-entity-evidence`,variant:`card-title`,children:`Provenance`}),(0,V.jsx)(ne,{freshness:e.evidence.freshness,freshnessDateTime:e.evidence.freshnessDateTime,freshnessTime:e.evidence.freshnessTime,reference:e.evidence.reference,service:e.service}),(0,V.jsxs)(E,{tone:`secondary`,variant:`meta`,children:[e.evidence.itemCount,` evidence item`,e.evidence.itemCount===1?``:`s`,` ·`,` `,e.evidence.claimCount,` claim`,e.evidence.claimCount===1?``:`s`]})]}),Dr=({presentation:e})=>{let[t,n]=(0,I.useState)(e.collaborators.expandedCategories);return(0,V.jsx)(`div`,{className:z.workingCircle,children:(0,V.jsx)(T,{approvers:e.collaborators.approvers,authors:e.collaborators.authors,emptyLabel:e.collaborators.emptyLabel,expandedCategories:t,heading:`Working circle`,limit:3,onCategoryExpandedChange:(e,t)=>{n(n=>t?[...new Set([...n,e])]:n.filter(t=>t!==e))},operators:e.collaborators.operators,owners:e.collaborators.owners,reviewers:e.collaborators.reviewers,size:`compact`})})},Or=({presentation:e})=>e.relationships.length<=4?(0,V.jsx)(v,{emptyLabel:e.relationshipEmptyLabel,heading:`Delivery relationships`,relationships:e.relationships}):(0,V.jsx)(b,{emptyLabel:e.relationshipEmptyLabel,heading:`Delivery relationships`,relationships:e.relationships}),kr=({presentation:e})=>(0,V.jsxs)(`section`,{"aria-labelledby":`workspace-entity-activity`,className:z.activity,children:[(0,V.jsxs)(`div`,{className:z.sectionHeading,children:[(0,V.jsx)(E,{as:`h2`,id:`workspace-entity-activity`,variant:`section-title`,children:`Activity`}),(0,V.jsx)(E,{tone:`secondary`,variant:`meta`,children:`Quiet, attributable history`})]}),e.activity.length===0?(0,V.jsx)(E,{tone:`secondary`,children:e.activityEmptyLabel}):(0,V.jsx)(`ol`,{className:z.timeline,children:e.activity.map((t,n)=>(0,V.jsx)(C,{continued:n<e.activity.length-1,event:t},t.id))})]}),Ar=e=>{switch(e.reason){case`refreshing`:return`Refreshing from the connected service. The last complete inspection remains visible.`;case`refresh-failed`:return`The latest refresh failed. The last complete inspection remains visible and may be out of date.`;case`source-stale`:return`The connected service reported stale source data. Confirm current state before acting.`}},jr=({clockifyActionCanApprove:e,clockifyActionCanCorrect:t,clockifyActionState:n,clockifyActionSubmit:r,confluenceEditor:i,onSessionExpired:a,presentation:o,retry:s,reviewCanEnqueue:c,reviewCancel:l,reviewExtendBudget:d,reviewLoadEarlier:m,reviewPublication:h,reviewPublicationCancel:g,reviewPublicationPreview:_,reviewRetry:v,reviewStart:y,reviewState:b,reviewSuggestionPublish:x,reviewSuggestionRevisionTransport:S,reviewTargetSuggestion:C,sessionKey:w,stale:T})=>(0,V.jsxs)(`div`,{className:z.content,children:[T===null?null:(0,V.jsx)(u,{action:T.reason===`refreshing`?void 0:(0,V.jsx)(f,{onClick:s,children:`Retry refresh`}),announce:T.reason===`refresh-failed`?`polite`:`off`,description:Ar(T),title:T.reason===`refreshing`?`Refreshing source`:`Showing retained source data`,tone:`caution`}),o.partialMessages.map(e=>(0,V.jsx)(u,{description:e,title:`Partial canonical view`,tone:`caution`},e)),o.clockifyTimeEntry===null?null:(0,V.jsx)(vn,{canApprove:e,canCorrect:t,onSubmit:r,submission:n,timeEntry:o.clockifyTimeEntry}),o.issue===null?null:(0,V.jsx)($n,{issue:o.issue}),o.confluencePage===null?null:(0,V.jsx)(Zn,{editor:i,page:o.confluencePage}),o.pipelineExecution===null?null:(0,V.jsx)(nr,{pipeline:o.pipelineExecution}),o.pullRequest===null?null:(0,V.jsx)(I.Suspense,{fallback:(0,V.jsx)(p,{decorative:!1,height:`20rem`,label:`Loading pull request`,variant:`block`}),children:(0,V.jsx)(_r,{approvers:o.collaborators.approvers,onSessionExpired:a,onReviewCancel:l,onReviewExtendBudget:d,onReviewLoadEarlier:m,onReviewPublicationCancel:g,onReviewPublicationPreview:_,onReviewRetry:v,onReviewSuggestionPublish:x,onReviewTargetSuggestion:C,onReviewStart:y,pullRequest:o.pullRequest,reviewCanEnqueue:c,reviewPublication:h,...S===void 0?{}:{reviewSuggestionRevisionTransport:S},reviewState:b,reviewers:o.collaborators.reviewers,sessionKey:w})}),(0,V.jsx)(wr,{presentation:o})]}),Mr=e=>void 0,$=()=>void 0,Nr=({clockifyActionCanApprove:e=!1,clockifyActionCanCorrect:t=!1,clockifyActionState:n={_tag:`idle`},clockifyActionSubmit:r=$,confluenceCanEdit:i=!1,confluenceSynchronizationState:a=null,onAskAgent:s,onConfluenceSaved:c,onConfluenceSynchronize:l=$,onSessionExpired:u=Mr,originHref:d,originLabel:p,originState:m,retry:h,reviewCanEnqueue:_=!1,reviewCancel:v=$,reviewExtendBudget:y=$,reviewLoadEarlier:b=$,reviewPublication:x={_tag:`idle`},reviewPublicationCancel:C=$,reviewPublicationPreview:w=$,reviewRetry:T=$,reviewStart:ee=$,reviewState:ne={_tag:`idle`},reviewSuggestionPublish:E=$,reviewSuggestionRevisionTransport:re,reviewTargetSuggestion:ie=$,sessionKey:ae=null,state:D,workspaceId:oe})=>{let se=(0,I.useRef)(null),ce=D._tag===`ready`||D._tag===`stale`?D.inspection.entity.projection.entityId:D._tag;if((0,I.useEffect)(()=>se.current?.focus(),[ce]),D._tag===`idle`)return(0,V.jsx)(yr,{action:(0,V.jsx)(o,{state:m,to:d,children:p}),description:`A readable workspace session is required before this object can be loaded.`,title:`Entity unavailable`});if(D._tag===`loading`)return(0,V.jsx)(br,{});if(D._tag===`not-found`)return(0,V.jsx)(yr,{action:(0,V.jsx)(o,{state:m,to:d,children:p}),description:`This object is not in this workspace. It may have been deleted, disconnected, or the address may be wrong.`,title:`Object not found`});if(D._tag===`failed`)return(0,V.jsx)(yr,{action:(0,V.jsx)(f,{onClick:h,children:`Retry entity`}),description:`The canonical object could not be loaded. Your current workspace location is preserved.`,title:`Could not load object`,tone:`critical`});let O=gn(oe,D.inspection),le=D._tag===`ready`&&D.inspection.isSourceCurrent&&D.inspection.sourceActionsAvailable,ue=c??h;return(0,V.jsx)(g,{component:ut,children:(0,V.jsx)(te,{actions:(0,V.jsx)(Cr,{onConfluenceSynchronize:l,presentation:O,synchronizationState:a}),activity:(0,V.jsx)(kr,{presentation:O}),agentEntry:(0,V.jsx)(S,{actionLabel:O.confluencePage===null?`Ask about this object`:`Draft with Relay`,agentName:`Relay`,context:O.agentContext,onClick:s}),collaborators:(0,V.jsx)(Dr,{presentation:O},D.inspection.entity.projection.entityId),className:z.shell,content:(0,V.jsx)(jr,{clockifyActionCanApprove:le&&e,clockifyActionCanCorrect:le&&t,clockifyActionState:n,clockifyActionSubmit:r,confluenceEditor:{canEdit:i&&D._tag===`ready`&&D.inspection.isSourceCurrent&&D.inspection.sourceActionsAvailable,entityId:D.inspection.entity.projection.entityId,onAskAgent:s,onSaved:ue,releaseId:D.inspection.entity.canonicalReleaseId,title:O.title},onSessionExpired:u,presentation:O,reviewCanEnqueue:_,reviewCancel:v,reviewExtendBudget:y,reviewPublication:x,reviewPublicationCancel:C,reviewLoadEarlier:b,reviewPublicationPreview:w,reviewRetry:T,...re===void 0?{}:{reviewSuggestionRevisionTransport:re},reviewSuggestionPublish:E,reviewTargetSuggestion:ie,reviewStart:ee,reviewState:ne,retry:h,sessionKey:ae,stale:D._tag===`stale`?D:null}),"data-service":O.service,"data-workspace-entity-id":D.inspection.entity.projection.entityId,evidence:(0,V.jsx)(Er,{presentation:O}),facts:(0,V.jsx)(Tr,{presentation:O}),freshness:O.freshness,freshnessDateTime:O.freshnessDateTime,freshnessTime:O.freshnessTime,navigation:(0,V.jsx)(o,{className:z.back,state:m,to:d,children:p}),reason:`${O.displayKey} is ${O.verdict.toLocaleLowerCase(`en-US`)} in ${O.serviceName}.`,ref:se,relationships:(0,V.jsx)(Or,{presentation:O}),service:O.service,tabIndex:-1,title:O.title,tone:O.tone,verdict:O.verdict})})},Pr=({entityId:e,workspaceId:t})=>{let a=n(),o=_(),s=i(),c=r(),l=a.controller.state._tag===`ready`?a.controller.state.portfolio.generatedAt:`pending`,u=h(o.state),d=Be(t,e,l,u,o.invalidateSession),f=(d.state._tag===`ready`||d.state._tag===`stale`)&&d.state.inspection.entity.projection.details._tag===`page`?d.state.inspection.source.pluginConnectionId:null,p=f!==null&&(d.state._tag===`ready`||d.state._tag===`stale`)&&d.state.inspection.sourceSynchronizationAvailable&&o.state._tag===`authenticated`&&o.state.session.permission===`workspace-owner`,m=f!==null&&(d.state._tag===`ready`||d.state._tag===`stale`)?Ae(d.state.inspection.source.synchronizedAt):null,g=(0,I.useCallback)(async t=>{if(f===null)return null;let n=await Ve.load(e,t);return n.entity.projection.entityId===e&&n.source.pluginConnectionId===f?Ae(n.source.synchronizedAt):null},[f,e]),v=Bn({enabled:p,onSessionExpired:o.invalidateSession,onSynchronized:d.retry,pluginConnectionId:f,readSynchronizationRevision:g,sessionKey:u,synchronizationRevision:m}),y=bn(e,u,o.invalidateSession,d.retry),b=o.state._tag===`authenticated`&&o.state.session.permission===`workspace-owner`,x=(d.state._tag===`ready`||d.state._tag===`stale`)&&d.state.inspection.entity.projection.details._tag===`pull-request`?{baseRevision:d.state.inspection.entity.projection.details.baseRevision??null,headRevision:d.state.inspection.entity.projection.details.headRevision}:null,S=gr(e,x?.baseRevision??null,x?.headRevision??null,u,b,o.invalidateSession),C=qe(s.state,t,e),w=Je(C.origin),T=d.state._tag===`ready`||d.state._tag===`stale`?d.state.inspection.entity:{canonicalReleaseId:null,releaseIds:[],releaseMembershipsTruncated:!1},ee=new Set(a.controller.state._tag===`ready`?a.controller.state.portfolio.releases.map(({id:e})=>e):[]),te=Ke(C.origin,t,s,T,ee);return(0,V.jsxs)(V.Fragment,{children:[(d.state._tag===`ready`||d.state._tag===`stale`)&&d.state.inspection.entity.projection.details._tag===`pull-request`?(0,V.jsx)(yt,{canEnqueue:b,entityId:e,inspection:d.state.inspection,reviewState:S.state,startReview:S.startAwaitable,workspaceId:t}):null,(0,V.jsx)(Nr,{clockifyActionCanApprove:o.state._tag===`authenticated`&&(o.state.session.permission===`workspace-owner`||o.state.session.permission===`workspace-approver`),clockifyActionCanCorrect:o.state._tag===`authenticated`&&o.state.session.permission===`workspace-owner`,clockifyActionState:y.state,clockifyActionSubmit:y.submit,confluenceCanEdit:o.state._tag===`authenticated`&&o.state.session.permission===`workspace-owner`,confluenceSynchronizationState:p?v.state:null,onAskAgent:()=>c(te,{state:s.state}),onConfluenceSaved:v.synchronizeAfterMutation,onConfluenceSynchronize:v.synchronizeNow,onSessionExpired:o.invalidateSession,originHref:w,originLabel:vr(w,t),originState:C.origin.state,retry:d.retry,reviewCanEnqueue:b,reviewCancel:S.cancel,reviewExtendBudget:S.extendBudget,reviewPublication:S.publication,reviewPublicationCancel:S.cancelPublication,reviewLoadEarlier:S.loadEarlier,reviewPublicationPreview:S.previewPublication,reviewRetry:S.retry,reviewSuggestionPublish:S.publishSuggestion,reviewTargetSuggestion:S.targetSuggestion,reviewStart:S.start,reviewState:S.state,state:d.state,sessionKey:u,workspaceId:t})]})},Fr=()=>{let e=n(),t=a(),r=Ye(t.entityId);return r===null?(0,V.jsx)(yr,{action:(0,V.jsx)(o,{to:Ge(e.workspaceId),children:`Back to items`}),description:`The object address is not a canonical entity identifier.`,title:`Object not found`}):(0,V.jsx)(Pr,{entityId:r,workspaceId:e.workspaceId})};export{Fr as WorkspaceEntityRoute,Nr as WorkspaceEntityView,Sr as confluenceEditHref};
|
|
14
|
+
//# sourceMappingURL=WorkspaceEntityRoute-rQ9ccetx.js.map
|