@knpkv/control-center 0.7.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 +312 -255
- package/dist/client/assets/ActiveWorkPage-DKlotZGc.js +2 -0
- package/dist/client/assets/{ActiveWorkPage-BsaIr8ah.js.map → ActiveWorkPage-DKlotZGc.js.map} +1 -1
- package/dist/client/assets/AgentPage-Cxm1gj2C.js +6 -0
- package/dist/client/assets/{AgentPage-Cybynsnc.js.map → AgentPage-Cxm1gj2C.js.map} +1 -1
- package/dist/client/assets/{AtlassianOAuthCallbackPage-Du3pHuS9.js → AtlassianOAuthCallbackPage-fEFUJE2g.js} +2 -2
- package/dist/client/assets/{AtlassianOAuthCallbackPage-Du3pHuS9.js.map → AtlassianOAuthCallbackPage-fEFUJE2g.js.map} +1 -1
- package/dist/client/assets/AuthorizedSharePage-Dh7Y_gmJ.js +2 -0
- package/dist/client/assets/{AuthorizedSharePage-tfTdXNjt.js.map → AuthorizedSharePage-Dh7Y_gmJ.js.map} +1 -1
- package/dist/client/assets/BrowserCrypto-CoBR2WBd.js +2 -0
- package/dist/client/assets/{BrowserCrypto-DVxU0-Oc.js.map → BrowserCrypto-CoBR2WBd.js.map} +1 -1
- package/dist/client/assets/BrowserSessionHydrator-DkomS8Yl.js +2 -0
- package/dist/client/assets/{BrowserSessionHydrator-CvtvZstV.js.map → BrowserSessionHydrator-DkomS8Yl.js.map} +1 -1
- package/dist/client/assets/CommandSearch-nf16HEqz.js +2 -0
- package/dist/client/assets/{CommandSearch-Bf_oW_kD.js.map → CommandSearch-nf16HEqz.js.map} +1 -1
- package/dist/client/assets/Dialog-DSwimdwG-BeHnBpPp.js +42 -0
- package/dist/client/assets/Dialog-DSwimdwG-BeHnBpPp.js.map +1 -0
- package/dist/client/assets/Domain-cJ5aJFpE.js +2 -0
- package/dist/client/assets/Domain-cJ5aJFpE.js.map +1 -0
- package/dist/client/assets/ItemsPage-Bok8Vpy4.js +2 -0
- package/dist/client/assets/{ItemsPage-BmWEHinz.js.map → ItemsPage-Bok8Vpy4.js.map} +1 -1
- package/dist/client/assets/OpenPullRequestPage-DdL7PhKZ.js +2 -0
- package/dist/client/assets/OpenPullRequestPage-DdL7PhKZ.js.map +1 -0
- package/dist/client/assets/{Pages-BmZj4KzS.js → Pages-DrDuXLFH.js} +2 -2
- package/dist/client/assets/{Pages-BmZj4KzS.js.map → Pages-DrDuXLFH.js.map} +1 -1
- package/dist/client/assets/PairPage-BCtzYqK6.js +2 -0
- package/dist/client/assets/{PairPage-CLLUweYZ.js.map → PairPage-BCtzYqK6.js.map} +1 -1
- package/dist/client/assets/PortalProvider-CN_81Fy3-D_japesx.js +2 -0
- package/dist/client/assets/{PortalProvider-BpgZwSpw-nEH0TqWT.js.map → PortalProvider-CN_81Fy3-D_japesx.js.map} +1 -1
- package/dist/client/assets/PortfolioOverview-C-jqvYgQ.js +2 -0
- package/dist/client/assets/{PortfolioOverview-BBKSc-yI.js.map → PortfolioOverview-C-jqvYgQ.js.map} +1 -1
- package/dist/client/assets/{PullRequestReviewPanel-Boi0A6pq.js → PullRequestReviewPanel-DwVYuZ8Q.js} +5 -5
- package/dist/client/assets/{PullRequestReviewPanel-Boi0A6pq.js.map → PullRequestReviewPanel-DwVYuZ8Q.js.map} +1 -1
- package/dist/client/assets/ReleaseRoute-cuvP4ug5.js +2 -0
- package/dist/client/assets/{ReleaseRoute-D4CttCjC.js.map → ReleaseRoute-cuvP4ug5.js.map} +1 -1
- package/dist/client/assets/ReleaseWorkset-DImwmjS3.js +2 -0
- package/dist/client/assets/{ReleaseWorkset-Dt-ArwsN.js.map → ReleaseWorkset-DImwmjS3.js.map} +1 -1
- package/dist/client/assets/ReviewSuggestionPublicationSurface-BZIa-Vvc.js +2 -0
- package/dist/client/assets/{ReviewSuggestionPublicationSurface-N9Qwdh2n.js.map → ReviewSuggestionPublicationSurface-BZIa-Vvc.js.map} +1 -1
- package/dist/client/assets/ServicesPage-CrM8R820.js +2 -0
- package/dist/client/assets/{ServicesPage-D0ygZTFD.js.map → ServicesPage-CrM8R820.js.map} +1 -1
- package/dist/client/assets/TimelinePage-FrvepGa_.js +2 -0
- package/dist/client/assets/{TimelinePage-Bb2o9DGU.js.map → TimelinePage-FrvepGa_.js.map} +1 -1
- package/dist/client/assets/{WorkspaceEntityLink-Cw675wTN.js → WorkspaceEntityLink-CAj42f02.js} +2 -2
- package/dist/client/assets/{WorkspaceEntityLink-Cw675wTN.js.map → WorkspaceEntityLink-CAj42f02.js.map} +1 -1
- package/dist/client/assets/WorkspaceEntityRoute-rQ9ccetx.js +14 -0
- package/dist/client/assets/WorkspaceEntityRoute-rQ9ccetx.js.map +1 -0
- package/dist/client/assets/WorkspaceHomeLink-ObQ3AQVw.js +2 -0
- package/dist/client/assets/{WorkspaceHomeLink-FGslxXCu.js.map → WorkspaceHomeLink-ObQ3AQVw.js.map} +1 -1
- package/dist/client/assets/WorkspacePullRequestDetails-BhxoqR7V.js +3 -0
- package/dist/client/assets/{WorkspacePullRequestDetails-Dxg8argO.js.map → WorkspacePullRequestDetails-BhxoqR7V.js.map} +1 -1
- package/dist/client/assets/{WorkspaceReleaseLayout-BvEiZJEb.js → WorkspaceReleaseLayout-BWL66Fff.js} +2 -2
- package/dist/client/assets/{WorkspaceReleaseLayout-BvEiZJEb.js.map → WorkspaceReleaseLayout-BWL66Fff.js.map} +1 -1
- package/dist/client/assets/{WorkspaceRichText-CocmKQ4T.js → WorkspaceRichText-Beh64wsV.js} +2 -2
- package/dist/client/assets/{WorkspaceRichText-CocmKQ4T.js.map → WorkspaceRichText-Beh64wsV.js.map} +1 -1
- package/dist/client/assets/WorkspaceSettingsPage-DutfiGPe.js +2 -0
- package/dist/client/assets/{WorkspaceSettingsPage-iZhUs-pg.js.map → WorkspaceSettingsPage-DutfiGPe.js.map} +1 -1
- package/dist/client/assets/{agent-api-CzdQFCcD.js → agent-api-CUWP1qs8.js} +2 -2
- package/dist/client/assets/{agent-api-CzdQFCcD.js.map → agent-api-CUWP1qs8.js.map} +1 -1
- package/dist/client/assets/{atlassianOAuthSetupIntentStorage-BxsxmjSm.js → atlassianOAuthSetupIntentStorage-Cy1Gw639.js} +2 -2
- package/dist/client/assets/{atlassianOAuthSetupIntentStorage-BxsxmjSm.js.map → atlassianOAuthSetupIntentStorage-Cy1Gw639.js.map} +1 -1
- package/dist/client/assets/authenticatedMutationClient-Bc_-Jpbo.js +2 -0
- package/dist/client/assets/{authenticatedMutationClient-DUqEcJHu.js.map → authenticatedMutationClient-Bc_-Jpbo.js.map} +1 -1
- package/dist/client/assets/authorizedShareTransport-kkT3Jf6q.js +2 -0
- package/dist/client/assets/{authorizedShareTransport-7YCNH9l3.js.map → authorizedShareTransport-kkT3Jf6q.js.map} +1 -1
- package/dist/client/assets/client-D3WRV6yl.js +5 -0
- package/dist/client/assets/client-D3WRV6yl.js.map +1 -0
- package/dist/client/assets/{confluenceTasks-D9yrB-oV.js → confluenceTasks-By7BV0WN.js} +2 -2
- package/dist/client/assets/{confluenceTasks-D9yrB-oV.js.map → confluenceTasks-By7BV0WN.js.map} +1 -1
- package/dist/client/assets/connectionTestTransport-CRq7l9X0.js +2 -0
- package/dist/client/assets/{connectionTestTransport-D8tiZ4ym.js.map → connectionTestTransport-CRq7l9X0.js.map} +1 -1
- package/dist/client/assets/controlCenterRelayDock-CyYeXh75.js +3 -0
- package/dist/client/assets/controlCenterRelayDock-CyYeXh75.js.map +1 -0
- package/dist/client/assets/controlCenterRelayDockChrome-upgtq649.js +3 -0
- package/dist/client/assets/controlCenterRelayDockChrome-upgtq649.js.map +1 -0
- package/dist/client/assets/index-kmYFvwT0.js +11 -0
- package/dist/client/assets/index-kmYFvwT0.js.map +1 -0
- package/dist/client/assets/index-tjRpNCt_.css +1 -0
- package/dist/client/assets/openPullRequest-BMlmibLP.js +2 -0
- package/dist/client/assets/openPullRequest-BMlmibLP.js.map +1 -0
- package/dist/client/assets/patterns-DuFUSnJW.js +2 -0
- package/dist/client/assets/patterns-DuFUSnJW.js.map +1 -0
- package/dist/client/assets/{presentPortfolio-c8-wbodG.js → presentPortfolio-DVP-zqTg.js} +2 -2
- package/dist/client/assets/{presentPortfolio-c8-wbodG.js.map → presentPortfolio-DVP-zqTg.js.map} +1 -1
- package/dist/client/assets/{presentWorkspaceItems-DfhyQeSY.js → presentWorkspaceItems-BY8bmqjF.js} +2 -2
- package/dist/client/assets/{presentWorkspaceItems-DfhyQeSY.js.map → presentWorkspaceItems-BY8bmqjF.js.map} +1 -1
- package/dist/client/assets/primitives-DYGtIZqB-r-Glkv2i.js +2 -0
- package/dist/client/assets/primitives-DYGtIZqB-r-Glkv2i.js.map +1 -0
- package/dist/client/assets/pullRequestReviewFailures-CCNxSXP6.js +2 -0
- package/dist/client/assets/{pullRequestReviewFailures-QvtS729d.js.map → pullRequestReviewFailures-CCNxSXP6.js.map} +1 -1
- package/dist/client/assets/pullRequestReviewThreadReplay-eI3Y4i6s.js +2 -0
- package/dist/client/assets/{pullRequestReviewThreadReplay-CpPdYxQE.js.map → pullRequestReviewThreadReplay-eI3Y4i6s.js.map} +1 -1
- package/dist/client/assets/{releaseAgentTransport-BCQDYqZt.js → releaseAgentTransport-CJjWwE8y.js} +2 -2
- package/dist/client/assets/{releaseAgentTransport-BCQDYqZt.js.map → releaseAgentTransport-CJjWwE8y.js.map} +1 -1
- package/dist/client/assets/releaseRoutes-h4FVwFvJ.js +2 -0
- package/dist/client/assets/{releaseRoutes-CSP_eBj6.js.map → releaseRoutes-h4FVwFvJ.js.map} +1 -1
- package/dist/client/assets/{serviceOnboarding-B6v5VXTG.js → serviceOnboarding-F9Lj6a7y.js} +2 -2
- package/dist/client/assets/{serviceOnboarding-B6v5VXTG.js.map → serviceOnboarding-F9Lj6a7y.js.map} +1 -1
- package/dist/client/assets/useWorkspaceDefaultLanding-BmaR7aTj.js +3 -0
- package/dist/client/assets/{useWorkspaceDefaultLanding-C3PRrLgk.js.map → useWorkspaceDefaultLanding-BmaR7aTj.js.map} +1 -1
- package/dist/client/assets/useWorkspaceItems-6KWfmFtx.js +2 -0
- package/dist/client/assets/{useWorkspaceItems-CHYpfLmL.js.map → useWorkspaceItems-6KWfmFtx.js.map} +1 -1
- package/dist/client/assets/{workspaceEntityRoutes-CFPO-iFw.js → workspaceEntityRoutes-BHccxrFj.js} +2 -2
- package/dist/client/assets/{workspaceEntityRoutes-CFPO-iFw.js.map → workspaceEntityRoutes-BHccxrFj.js.map} +1 -1
- package/dist/client/assets/{workspaceScrollCapture-DUj-_YMd.js → workspaceScrollCapture-BzsNJoL7.js} +2 -2
- package/dist/client/assets/{workspaceScrollCapture-DUj-_YMd.js.map → workspaceScrollCapture-BzsNJoL7.js.map} +1 -1
- package/dist/client/assets/workspaceSettingsTransport-BwRQteEH.js +2 -0
- package/dist/client/assets/{workspaceSettingsTransport-Kq7lfPsC.js.map → workspaceSettingsTransport-BwRQteEH.js.map} +1 -1
- package/dist/client/build-graph.json +63 -0
- package/dist/client/index.html +3 -3
- package/dist/server/api/index.js +1 -1
- package/dist/server/assets/{BindConfig-hNWrGfu2.js → BindConfig-BG-FGtB5.js} +14 -5
- package/dist/server/assets/BindConfig-BG-FGtB5.js.map +1 -0
- package/dist/server/assets/{controlCenterApi-BcVWTP9F.js → controlCenterApi-WaKi6EUb.js} +2 -1
- package/dist/server/assets/controlCenterApi-WaKi6EUb.js.map +1 -0
- package/dist/server/index.js +1 -1
- package/dist/server/server/cli.js +1 -1
- package/dist/server/server/index.js +1 -1
- package/package.json +8 -7
- package/dist/client/assets/ActiveWorkPage-BsaIr8ah.js +0 -2
- package/dist/client/assets/AgentPage-Cybynsnc.js +0 -6
- package/dist/client/assets/AuthorizedSharePage-tfTdXNjt.js +0 -2
- package/dist/client/assets/BrowserCrypto-DVxU0-Oc.js +0 -2
- package/dist/client/assets/BrowserSessionHydrator-CvtvZstV.js +0 -2
- package/dist/client/assets/CommandSearch-Bf_oW_kD.js +0 -2
- package/dist/client/assets/Dialog-1WvU8GjA-C7r26HF0.js +0 -42
- package/dist/client/assets/Dialog-1WvU8GjA-C7r26HF0.js.map +0 -1
- package/dist/client/assets/ItemsPage-BmWEHinz.js +0 -2
- package/dist/client/assets/OpenPullRequestPage-DkCom6mf.js +0 -2
- package/dist/client/assets/OpenPullRequestPage-DkCom6mf.js.map +0 -1
- package/dist/client/assets/PairPage-CLLUweYZ.js +0 -2
- package/dist/client/assets/PortalProvider-BpgZwSpw-nEH0TqWT.js +0 -2
- package/dist/client/assets/PortfolioOverview-BBKSc-yI.js +0 -2
- package/dist/client/assets/ReleaseRoute-D4CttCjC.js +0 -2
- package/dist/client/assets/ReleaseWorkset-Dt-ArwsN.js +0 -2
- package/dist/client/assets/ReviewSuggestionPublicationSurface-N9Qwdh2n.js +0 -2
- package/dist/client/assets/ServicesPage-D0ygZTFD.js +0 -2
- package/dist/client/assets/TimelinePage-Bb2o9DGU.js +0 -2
- package/dist/client/assets/WorkspaceEntityRoute-rLRiaF8b.js +0 -14
- package/dist/client/assets/WorkspaceEntityRoute-rLRiaF8b.js.map +0 -1
- package/dist/client/assets/WorkspaceHomeLink-FGslxXCu.js +0 -2
- package/dist/client/assets/WorkspacePullRequestDetails-Dxg8argO.js +0 -3
- package/dist/client/assets/WorkspaceSettingsPage-iZhUs-pg.js +0 -2
- package/dist/client/assets/authenticatedMutationClient-DUqEcJHu.js +0 -2
- package/dist/client/assets/authorizedShareTransport-7YCNH9l3.js +0 -2
- package/dist/client/assets/client-D2F6HlDk.js +0 -5
- package/dist/client/assets/client-D2F6HlDk.js.map +0 -1
- package/dist/client/assets/connectionTestTransport-D8tiZ4ym.js +0 -2
- package/dist/client/assets/index-BWx9sNOT.js +0 -11
- package/dist/client/assets/index-BWx9sNOT.js.map +0 -1
- package/dist/client/assets/index-CIfiz7oF.css +0 -1
- package/dist/client/assets/patterns-CxMz8DKX-ByHwV03y.js +0 -2
- package/dist/client/assets/patterns-CxMz8DKX-ByHwV03y.js.map +0 -1
- package/dist/client/assets/primitives-CW89TsFB-BBLwFFPo.js +0 -2
- package/dist/client/assets/primitives-CW89TsFB-BBLwFFPo.js.map +0 -1
- package/dist/client/assets/pullRequestReviewFailures-QvtS729d.js +0 -2
- package/dist/client/assets/pullRequestReviewThreadReplay-CpPdYxQE.js +0 -2
- package/dist/client/assets/releaseRoutes-CSP_eBj6.js +0 -2
- package/dist/client/assets/useWorkspaceDefaultLanding-C3PRrLgk.js +0 -3
- package/dist/client/assets/useWorkspaceItems-CHYpfLmL.js +0 -2
- package/dist/client/assets/workspaceSettingsTransport-Kq7lfPsC.js +0 -2
- package/dist/server/assets/BindConfig-hNWrGfu2.js.map +0 -1
- package/dist/server/assets/controlCenterApi-BcVWTP9F.js.map +0 -1
package/dist/client/assets/{PullRequestReviewPanel-Boi0A6pq.js → PullRequestReviewPanel-DwVYuZ8Q.js}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ReviewSuggestionPublicationSurface-
|
|
2
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-CwJFpaho.js";import{t as n}from"./preload-helper-Czpn1I53.js";import{t as r}from"./jsx-runtime-NZYk81nU.js";import{
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ReviewSuggestionPublicationSurface-BZIa-Vvc.js","assets/rolldown-runtime-hePW80VL.js","assets/react-CwJFpaho.js","assets/jsx-runtime-NZYk81nU.js","assets/Dialog-DSwimdwG-BeHnBpPp.js","assets/loader-circle-Dem7LJJw.js","assets/PortalProvider-CN_81Fy3-D_japesx.js","assets/component-DKy8kjZl-DJ62HeaY.js","assets/primitives-DYGtIZqB-r-Glkv2i.js","assets/WorkspacePullRequestDetails.module-Bl8z_AMw.js","assets/WorkspacePullRequestDetails-q_Ngh_tB.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-CwJFpaho.js";import{t as n}from"./preload-helper-Czpn1I53.js";import{t as r}from"./jsx-runtime-NZYk81nU.js";import{l as i,r as a,u as o}from"./Dialog-DSwimdwG-BeHnBpPp.js";import{n as s}from"./primitives-DYGtIZqB-r-Glkv2i.js";import{$r as c,A as l,Bn as u,Jr as d,M as f,N as p,Ti as m,Ya as h,Yr as g,_i as _,ir as v,j as y,ki as b,ma as x,r as S,rr as C,sr as w,ti as T}from"./agent-api-CUWP1qs8.js";import{a as E,t as D}from"./client-D3WRV6yl.js";import{t as O}from"./authenticatedMutationClient-Bc_-Jpbo.js";import{t as k}from"./WorkspacePullRequestDetails.module-Bl8z_AMw.js";import{t as A}from"./reviewPlatformAdapter-Duu9pLcg.js";var j=r(),M=({accessibleName:e,className:t,describeProfile:n=e=>`${e.provider} · ${e.model}`,disabled:r=!1,groupName:a=`review-profile`,label:o=`Profile`,onProfileChange:s,presentation:c=`select`,profiles:l,selectedProfileId:u})=>{let d=l.find(({id:e})=>e===u);return c===`radios`?(0,j.jsx)(`fieldset`,{"aria-label":e??o,className:t,disabled:r,children:l.map(e=>(0,j.jsxs)(`label`,{children:[(0,j.jsx)(`input`,{checked:e.id===u,name:a,onChange:()=>s(e),type:`radio`,value:e.id}),(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`strong`,{children:e.name}),(0,j.jsx)(`small`,{children:n(e)})]})]},e.id))}):(0,j.jsx)(i,{...t===void 0?{}:{className:t},...d===void 0?{}:{description:n(d)},label:o,size:`compact`,children:e=>(0,j.jsxs)(`select`,{...e,disabled:r||l.length===0,onChange:e=>{let t=l.find(({id:t})=>t===e.currentTarget.value);t!==void 0&&s(t)},value:d?.id??``,children:[d===void 0?(0,j.jsx)(`option`,{value:``,children:`Select a profile`}):null,l.map(e=>(0,j.jsx)(`option`,{value:e.id,children:e.name},e.id))]})})},N=e(t(),1),P=e=>{switch(e.anchor._tag){case`line`:return`Line suggestion · ${e.anchor.path}:${String(e.anchor.line)}`;case`file`:return`File suggestion · ${e.anchor.path}:${String(e.anchor.line)}`;case`changes`:return`Whole-change suggestion`}},F=e=>{let t=[],n=[],r=``,i=0,a=0;for(let o of e.split(`
|
|
3
3
|
`)){let e=/^@@ -\d+(?:,(\d+))? \+\d+(?:,(\d+))? @@/u.exec(o);if(e!==null){let s=`⋯ ${r} · ${o}`;t.push(s),n.push(s),i=Number(e[1]??`1`),a=Number(e[2]??`1`);continue}if(i===0&&a===0){o.startsWith(`+++ `)&&(r=o.slice(4).replace(/^b\//u,``));continue}if(o!==`\`){if(o.startsWith(`-`)&&i>0){t.push(o.slice(1)),--i;continue}if(o.startsWith(`+`)&&a>0){n.push(o.slice(1)),--a;continue}if(o.startsWith(` `)&&i>0&&a>0){let e=o.slice(1);t.push(e),n.push(e),--i,--a;continue}}}return{before:t.join(`
|
|
4
4
|
`),after:n.join(`
|
|
5
|
-
`)}},I=e=>`${e.slice(0,1).toUpperCase()}${e.slice(1)}`,ee=({canPublish:e,extraActions:t,isPreviewing:n,jobId:r,metadata:a,onPreviewPublication:o,publicationBlockedReason:c,suggestion:l})=>{let u=l.replacement===void 0?null:F(l.replacement.unifiedDiff);return(0,j.jsxs)(`article`,{className:k.suggestionCard,"data-severity":l.severity,children:[(0,j.jsxs)(`header`,{className:k.suggestionHeading,children:[(0,j.jsx)(`span`,{className:k.severity,children:l.severity}),(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`small`,{children:P(l)}),(0,j.jsx)(`strong`,{children:l.title})]}),(0,j.jsxs)(`span`,{className:k.confidence,children:[I(l.state),` · `,l.confidence.level,` confidence`]})]}),a,(0,j.jsx)(s,{children:l.problem}),(0,j.jsxs)(`dl`,{className:k.suggestionDetails,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Impact`}),(0,j.jsx)(`dd`,{children:l.impact})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Recommendation`}),(0,j.jsx)(`dd`,{children:l.recommendation})]})]}),(0,j.jsxs)(`details`,{children:[(0,j.jsx)(`summary`,{children:`Evidence and confidence`}),(0,j.jsxs)(`code`,{children:[l.evidence.path,`:`,String(l.evidence.startLine),l.evidence.endLine===l.evidence.startLine?``:`–${String(l.evidence.endLine)}`]}),(0,j.jsx)(`pre`,{children:l.evidence.excerpt}),(0,j.jsx)(s,{children:l.confidence.reason})]}),l.relatedLocations.length===0?null:(0,j.jsxs)(`section`,{"aria-label":`Related locations`,className:k.relatedLocations,children:[(0,j.jsx)(`strong`,{children:`Related locations`}),(0,j.jsx)(`ul`,{children:l.relatedLocations.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsxs)(`code`,{children:[e.path,`:`,String(e.startLine),e.endLine===e.startLine?``:`–${String(e.endLine)}`]}),(0,j.jsx)(`span`,{children:e.label})]},`${e.path}:${String(e.startLine)}:${String(e.endLine)}`))})]}),u===null||l.replacement===void 0?null:(0,j.jsxs)(`section`,{"aria-label":`Suggested replacement`,className:k.replacementPreview,children:[(0,j.jsxs)(`header`,{children:[(0,j.jsx)(`strong`,{children:`Suggested replacement`}),(0,j.jsxs)(`span`,{children:[`Inert patch · `,l.replacement.reviewedHead.slice(0,12)]})]}),(0,j.jsx)(s,{children:l.replacement.explanation}),(0,j.jsxs)(`div`,{children:[(0,j.jsxs)(`figure`,{children:[(0,j.jsx)(`figcaption`,{children:`Before`}),(0,j.jsx)(`pre`,{children:u.before})]}),(0,j.jsxs)(`figure`,{children:[(0,j.jsx)(`figcaption`,{children:`After`}),(0,j.jsx)(`pre`,{children:u.after})]})]})]}),l.prevention===void 0?null:l.prevention.enforcement===`none`?(0,j.jsxs)(`details`,{className:k.preventionProposal,children:[(0,j.jsx)(`summary`,{children:`Prevention note · no stable guardrail`}),(0,j.jsxs)(s,{children:[l.prevention.summary,` · `,l.prevention.rationale]})]}):(0,j.jsxs)(`details`,{className:k.preventionProposal,children:[(0,j.jsx)(`summary`,{children:`Prevention proposal · separate review required`}),(0,j.jsxs)(s,{children:[l.prevention.summary,` · `,l.prevention.enforcement]}),(0,j.jsxs)(`dl`,{children:[(0,j.jsx)(`dt`,{children:`Recurring evidence`}),(0,j.jsx)(`dd`,{children:l.prevention.recurrenceEvidence}),(0,j.jsx)(`dt`,{children:`Existing rule or configuration`}),(0,j.jsx)(`dd`,{children:l.prevention.existingRuleOrConfig}),(0,j.jsx)(`dt`,{children:`Target file`}),(0,j.jsx)(`dd`,{children:l.prevention.targetFile}),(0,j.jsx)(`dt`,{children:`Source paths`}),(0,j.jsx)(`dd`,{children:l.prevention.sourcePaths.join(`, `)}),(0,j.jsx)(`dt`,{children:`Matcher or invariant`}),(0,j.jsx)(`dd`,{children:l.prevention.matcherOrInvariant}),(0,j.jsx)(`dt`,{children:`Invalid fixture`}),(0,j.jsx)(`dd`,{children:(0,j.jsx)(`pre`,{children:l.prevention.invalidFixture})}),(0,j.jsx)(`dt`,{children:`Valid fixture`}),(0,j.jsx)(`dd`,{children:(0,j.jsx)(`pre`,{children:l.prevention.validFixture})}),(0,j.jsx)(`dt`,{children:`Boundary and exclusions`}),(0,j.jsx)(`dd`,{children:l.prevention.boundary})]})]}),t===void 0&&(!e||l.state!==`draft`)?null:(0,j.jsxs)(`div`,{className:k.suggestionActions,children:[t,e&&l.state===`draft`?(0,j.jsx)(i,{disabled:n||c!==void 0,onClick:()=>o({jobId:r,suggestionId:l.suggestionId}),children:n?`Preparing approval…`:`Review & approve`}):null]}),c===void 0?null:(0,j.jsx)(s,{role:`status`,tone:`secondary`,variant:`meta`,children:c})]})},L=({notes:e})=>e.length===0?null:(0,j.jsxs)(`section`,{"aria-labelledby":`review-notes-title`,className:k.reviewNotes,children:[(0,j.jsxs)(`header`,{children:[(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`small`,{children:`Never publishable`}),(0,j.jsx)(`strong`,{id:`review-notes-title`,children:`Review Notes`})]}),(0,j.jsx)(`span`,{children:e.length})]}),(0,j.jsx)(`ul`,{children:e.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsxs)(`span`,{children:[e.reason===`pre-existing`?`Pre-existing`:`Low confidence`,` · `,e.confidence.level]}),(0,j.jsx)(`strong`,{children:e.title}),(0,j.jsx)(s,{children:e.observation}),e.location===void 0?null:(0,j.jsxs)(`code`,{children:[e.location.path,`:`,String(e.location.startLine),e.location.endLine===e.location.startLine?``:`–${String(e.location.endLine)}`]}),(0,j.jsx)(`small`,{children:e.confidence.reason})]},e.noteId))})]}),R=e=>e.author._tag===`operator`?`Operator`:`${e.author.providerId}${e.author.model===null?``:` · ${e.author.model}`}`,z=e=>e.validation._tag===`validated`?`Validated`:`Needs revalidation`,te=({loadEarlier:e,loadingEarlier:t,page:n})=>{let r=[n.current,...n.revisions.filter(({revisionId:e})=>e!==n.current.revisionId)];return(0,j.jsxs)(`div`,{className:k.revisionHistory,children:[(0,j.jsx)(`ol`,{children:r.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsxs)(`header`,{children:[(0,j.jsxs)(`strong`,{children:[`Revision `,String(e.sequence)]}),(0,j.jsxs)(`span`,{children:[z(e),` · `,R(e)]})]}),(0,j.jsx)(`time`,{dateTime:d(e.createdAt),children:f(e.createdAt,{dateStyle:`medium`,timeStyle:`short`})}),(0,j.jsxs)(`details`,{children:[(0,j.jsx)(`summary`,{children:e.suggestion.title}),(0,j.jsx)(s,{children:e.suggestion.problem}),(0,j.jsxs)(`dl`,{children:[(0,j.jsx)(`dt`,{children:`Impact`}),(0,j.jsx)(`dd`,{children:e.suggestion.impact}),(0,j.jsx)(`dt`,{children:`Recommendation`}),(0,j.jsx)(`dd`,{children:e.suggestion.recommendation}),(0,j.jsx)(`dt`,{children:`Severity`}),(0,j.jsx)(`dd`,{children:e.suggestion.severity}),(0,j.jsx)(`dt`,{children:`Confidence`}),(0,j.jsxs)(`dd`,{children:[e.suggestion.confidence.level,` · `,e.suggestion.confidence.reason]}),(0,j.jsx)(`dt`,{children:`Evidence`}),(0,j.jsxs)(`dd`,{children:[(0,j.jsxs)(`code`,{children:[e.suggestion.evidence.path,`:`,String(e.suggestion.evidence.startLine)]}),(0,j.jsx)(`pre`,{children:e.suggestion.evidence.excerpt})]}),(0,j.jsx)(`dt`,{children:`Anchor`}),(0,j.jsx)(`dd`,{children:(0,j.jsx)(`code`,{children:JSON.stringify(e.suggestion.anchor)})}),(0,j.jsx)(`dt`,{children:`Related locations`}),(0,j.jsx)(`dd`,{children:e.suggestion.relatedLocations.length===0?`None`:(0,j.jsx)(`pre`,{children:JSON.stringify(e.suggestion.relatedLocations,null,2)})}),(0,j.jsx)(`dt`,{children:`Replacement`}),(0,j.jsx)(`dd`,{children:e.suggestion.replacement===void 0?`None`:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(s,{children:e.suggestion.replacement.explanation}),(0,j.jsx)(`pre`,{children:e.suggestion.replacement.unifiedDiff})]})}),(0,j.jsx)(`dt`,{children:`Prevention`}),(0,j.jsx)(`dd`,{children:e.suggestion.prevention===void 0?`None`:(0,j.jsx)(`pre`,{children:JSON.stringify(e.suggestion.prevention,null,2)})})]})]})]},e.revisionId))}),n.hasMore?(0,j.jsx)(i,{"aria-busy":t,disabled:t,loading:t,onClick:e,children:t?`Loading earlier revisions…`:`Load earlier revisions`}):null]})},ne=T({anchor:p.fields.anchor,evidence:p.fields.evidence,relatedLocations:p.fields.relatedLocations,replacement:p.fields.replacement,prevention:p.fields.prevention}),re=_(ne),ie=[[`Problem`,`problem`],[`Impact`,`impact`],[`Recommendation`,`recommendation`]],ae=e=>({title:e.title,severity:e.severity,problem:e.problem,impact:e.impact,evidence:e.evidence,recommendation:e.recommendation,confidence:e.confidence,relatedLocations:e.relatedLocations,...e.prevention!==void 0&&{prevention:e.prevention},...e.replacement!==void 0&&{replacement:e.replacement},anchor:e.anchor}),oe=e=>S(re)({anchor:e.anchor,evidence:e.evidence,relatedLocations:e.relatedLocations,...e.prevention!==void 0&&{prevention:e.prevention},...e.replacement!==void 0&&{replacement:e.replacement}}),se=({canEdit:e,conflict:t,loadEarlier:n,loadingEarlier:r,mode:o,onOpenChange:c,onResolveConflict:l,onSave:u,open:d,page:f,preservedDraft:m,saving:h})=>{let g=f.current,[_,v]=(0,N.useState)(()=>ae(g.suggestion)),[b,x]=(0,N.useState)(()=>oe(g.suggestion)),[S,T]=(0,N.useState)(!1);(0,N.useEffect)(()=>{if(!d)return;let e=m??ae(g.suggestion);v(e),x(oe(e)),T(!1)},[g.revisionId,g.suggestion,d,m]);let E=(0,N.useMemo)(()=>`Revision ${String(g.sequence)} · ${z(g)} · ${R(g)}`,[g]),D=()=>{let e=C(re)(b);if(w(e)){T(!0);return}T(!1);let t=C(y)({title:_.title,severity:_.severity,problem:_.problem,impact:_.impact,recommendation:_.recommendation,confidence:_.confidence,...e.success});if(w(t)){T(!0);return}u(t.success)};return(0,j.jsx)(a.Root,{onOpenChange:c,open:d,children:(0,j.jsx)(a.Content,{className:k.revisionDialog,description:E,size:`wide`,title:o===`edit`?`Edit review suggestion`:`Revision history`,children:o===`history`?(0,j.jsx)(te,{loadEarlier:n,loadingEarlier:r,page:f}):(0,j.jsxs)(`form`,{className:k.revisionEditor,onSubmit:e=>{e.preventDefault(),D()},children:[(0,j.jsxs)(`div`,{className:k.revisionEditorLead,children:[(0,j.jsxs)(`label`,{children:[(0,j.jsx)(`span`,{children:`Title`}),(0,j.jsx)(`input`,{maxLength:500,onChange:e=>v({..._,title:e.currentTarget.value}),required:!0,value:_.title})]}),(0,j.jsxs)(`label`,{children:[(0,j.jsx)(`span`,{children:`Severity`}),(0,j.jsxs)(`select`,{onChange:e=>{let t=C(p.fields.severity)(e.currentTarget.value);w(t)||v({..._,severity:t.success})},value:_.severity,children:[(0,j.jsx)(`option`,{value:`P1`,children:`P1`}),(0,j.jsx)(`option`,{value:`P2`,children:`P2`}),(0,j.jsx)(`option`,{value:`P3`,children:`P3`}),(0,j.jsx)(`option`,{value:`P4`,children:`P4`})]})]}),(0,j.jsxs)(`label`,{children:[(0,j.jsx)(`span`,{children:`Confidence`}),(0,j.jsxs)(`select`,{onChange:e=>{let t=C(p.fields.confidence.fields.level)(e.currentTarget.value);w(t)||v({..._,confidence:{..._.confidence,level:t.success}})},value:_.confidence.level,children:[(0,j.jsx)(`option`,{value:`high`,children:`High`}),(0,j.jsx)(`option`,{value:`medium`,children:`Medium`})]})]})]}),ie.map(([e,t])=>(0,j.jsxs)(`label`,{children:[(0,j.jsx)(`span`,{children:e}),(0,j.jsx)(`textarea`,{maxLength:4e3,onChange:e=>v({..._,[t]:e.currentTarget.value}),required:!0,rows:4,value:_[t]})]},t)),(0,j.jsxs)(`label`,{children:[(0,j.jsx)(`span`,{children:`Confidence reason`}),(0,j.jsx)(`textarea`,{maxLength:2e3,onChange:e=>v({..._,confidence:{..._.confidence,reason:e.currentTarget.value}}),required:!0,rows:3,value:_.confidence.reason})]}),(0,j.jsxs)(`details`,{className:k.revisionAdvanced,children:[(0,j.jsx)(`summary`,{children:`Advanced evidence, anchor, replacement and prevention`}),(0,j.jsx)(s,{tone:`secondary`,children:`Complete schema-checked JSON. Invalid or incoherent evidence cannot be saved.`}),(0,j.jsx)(`textarea`,{"aria-describedby":S?`revision-advanced-error`:void 0,"aria-invalid":S,"aria-label":`Advanced evidence, anchor, replacement and prevention JSON`,onChange:e=>x(e.currentTarget.value),rows:14,spellCheck:!1,value:b}),S?(0,j.jsx)(`span`,{id:`revision-advanced-error`,role:`alert`,children:`Advanced fields are not a valid complete suggestion.`}):null]}),t?(0,j.jsxs)(`div`,{role:`alert`,children:[(0,j.jsx)(`span`,{children:`A newer revision won. Your draft is preserved, but cannot be saved over the winner.`}),(0,j.jsx)(i,{onClick:l,type:`button`,variant:`quiet`,children:`Use latest revision`})]}):g.validation._tag===`requires-revalidation`?(0,j.jsx)(`span`,{role:`status`,children:`Technical changes remain blocked from publication until revalidated.`}):null,(0,j.jsxs)(`div`,{className:k.revisionDialogActions,children:[(0,j.jsx)(a.Close,{disabled:h,children:`Cancel`}),(0,j.jsx)(i,{disabled:!e||h,loading:h,type:`submit`,children:h?`Saving revision…`:`Save revision`})]})]})})})},B=c.make(24),V={dismiss:(e,t,n)=>l(b(function*(){return yield*(yield*O).agent.dismissReviewSuggestion({params:{entityId:e.entityId,jobId:e.jobId,suggestionId:e.suggestionId},payload:t})}).pipe(h(E)),{signal:n}),edit:(e,t,n)=>l(b(function*(){return yield*(yield*O).agent.editReviewSuggestion({params:{entityId:e.entityId,jobId:e.jobId,suggestionId:e.suggestionId},payload:t})}).pipe(h(E)),{signal:n}),load:(e,t,n)=>l(b(function*(){return yield*(yield*D()).agent.reviewSuggestionRevisions({params:{entityId:e.entityId,jobId:e.jobId,suggestionId:e.suggestionId},query:{...t!==null&&{before:t},limit:B}})}).pipe(h(E)),{signal:n})},H=(e,t)=>e.entityId===t.entityId&&e.jobId===t.jobId&&e.sessionKey===t.sessionKey&&e.suggestionId===t.suggestionId,U=(e,t)=>{let n=t.current.sequence>e.current.sequence?t.current:e.current;return{current:n,revisions:[...new Map([e.current,t.current,...e.revisions,...t.revisions].filter(({revisionId:e})=>e!==n.revisionId).map(e=>[e.revisionId,e])).values()].sort((e,t)=>t.sequence-e.sequence),hasMore:t.hasMore,nextBeforeSequence:t.nextBeforeSequence}},W=(e,t)=>({current:t,revisions:[e.current,...e.revisions].filter(({revisionId:e})=>e!==t.revisionId).sort((e,t)=>t.sequence-e.sequence),hasMore:e.hasMore,nextBeforeSequence:e.nextBeforeSequence}),G=(e,t)=>({_tag:e,page:t}),K=u(`ConflictApiError`),q=e=>void 0,J=(e,t=V,n=q)=>{let[r,i]=(0,N.useState)(0),[a,o]=(0,N.useState)(!1),[s,c]=(0,N.useState)({_tag:`idle`}),l=(0,N.useRef)(null),u=(0,N.useRef)(!1),d=(0,N.useRef)(e),f=(0,N.useRef)(n);d.current=e,f.current=n,(0,N.useEffect)(()=>{if(l.current?.abort(),u.current=!1,o(!1),e===null){c({_tag:`idle`});return}let n=e,r=new AbortController;return l.current=r,c({_tag:`loading`}),t.load(n,null,r.signal).then(e=>{r.signal.aborted||d.current===null||!H(d.current,n)||c({_tag:`ready`,page:e})},()=>{r.signal.aborted||d.current===null||!H(d.current,n)||c({_tag:`failed`,draft:null,page:null})}),()=>r.abort()},[r,e,t]);let p=(0,N.useCallback)(n=>{if(e===null||s._tag===`conflict`)return;let r=s._tag===`ready`||s._tag===`failed`?s.page:null;if(r===null)return;let i=e;l.current?.abort(),u.current=!1,o(!1);let a=new AbortController;l.current=a,c({_tag:`saving`,draft:n,page:r}),t.edit(i,{expectedRevisionId:r.current.revisionId,expectedSequence:r.current.sequence,edit:n},a.signal).then(e=>{let n=W(r,e);return t.load(i,null,a.signal).then(e=>G(`refreshed`,e),()=>G(`accepted-refresh-failed`,n))},e=>{if(!K(e))throw e;return t.load(i,null,a.signal).then(e=>(a.signal.aborted||d.current===null||!H(d.current,i)||c({_tag:`conflict`,draft:n,page:e}),G(`conflict`,e)))}).then(e=>{a.signal.aborted||d.current===null||!H(d.current,i)||(c(t=>t._tag===`conflict`?t:e._tag===`accepted-refresh-failed`?{_tag:`failed`,draft:null,page:e.page}:{_tag:`ready`,page:e.page}),e._tag!==`conflict`&&f.current(e.page.current.suggestion))},()=>{a.signal.aborted||d.current===null||!H(d.current,i)||c({_tag:`failed`,draft:n,page:r})})},[e,s,t]),m=(0,N.useCallback)(n=>{if(e===null||s._tag!==`ready`||t.dismiss===void 0)return;let r=e,i=s.page;l.current?.abort(),u.current=!1,o(!1);let a=new AbortController;l.current=a,c({_tag:`dismissing`,page:i}),t.dismiss(r,{expectedRevisionId:i.current.revisionId,expectedSequence:i.current.sequence,reason:n},a.signal).then(e=>{a.signal.aborted||d.current===null||!H(d.current,r)||(c({_tag:`ready`,page:W(i,e)}),f.current(e.suggestion))},()=>{a.signal.aborted||d.current===null||!H(d.current,r)||c({_tag:`failed`,draft:null,page:i})})},[e,s,t]),h=(0,N.useCallback)(()=>{if(e===null||s._tag!==`ready`&&s._tag!==`conflict`||u.current||!s.page.hasMore||s.page.nextBeforeSequence===null)return;let n=e,r=s.page;l.current?.abort();let i=new AbortController;l.current=i,u.current=!0,o(!0),t.load(n,r.nextBeforeSequence,i.signal).then(e=>{i.signal.aborted||d.current===null||!H(d.current,n)||l.current===i&&(c(t=>t._tag===`ready`||t._tag===`conflict`?{...t,page:U(t.page,e)}:t),u.current=!1,o(!1))},()=>{i.signal.aborted||d.current===null||!H(d.current,n)||l.current===i&&(c(e=>e._tag===`ready`?{_tag:`failed`,draft:null,page:e.page}:e),u.current=!1,o(!1))})},[e,s,t]);return(0,N.useMemo)(()=>({dismiss:m,loadEarlier:h,loadingEarlier:a,resolveConflict:()=>c(e=>e._tag===`conflict`?{_tag:`ready`,page:e.page}:e),retry:()=>{if(s._tag!==`conflict`){if(s._tag===`failed`&&s.draft!==null&&s.page!==null){p(s.draft);return}i(e=>e+1)}},save:p,state:s}),[m,h,a,p,s])},ce=e=>e._tag===`operator`?`Operator`:e.providerId,le=({canEdit:e,entityId:t,isPreviewing:n,jobId:r,onPreviewPublication:o,onSuggestionRevisionAccepted:c,onTargetSuggestion:l,revisionTransport:u=V,sessionKey:p,suggestion:m})=>{let h=J((0,N.useMemo)(()=>({entityId:t,jobId:r,sessionKey:p,suggestionId:m.suggestionId}),[t,r,p,m.suggestionId]),u,c),[g,_]=(0,N.useState)(`history`),[y,b]=(0,N.useState)(!1),[x,S]=(0,N.useState)(!1),[T,E]=(0,N.useState)(`false-positive`),D=h.state._tag===`ready`||h.state._tag===`dismissing`||h.state._tag===`saving`||h.state._tag===`conflict`||h.state._tag===`failed`?h.state.page:null,O=h.state._tag===`saving`||h.state._tag===`conflict`||h.state._tag===`failed`?h.state.draft:null,A=D?.current,M=A===void 0?m:{...A.suggestion,state:m.state===`published`?`published`:A.suggestion.state},P=e&&M.state===`draft`&&h.state._tag!==`dismissing`,F=A?.validation._tag===`requires-revalidation`,I=h.state._tag===`loading`?`Loading the exact revision before publication.`:h.state._tag===`failed`?`Revision history is unavailable. Retry before publishing.`:F?`This technical edit needs agent revalidation before it can be posted.`:void 0,L=e=>{_(e),b(!0)};return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(ee,{canPublish:P,extraActions:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(i,{disabled:D===null,onClick:()=>L(`history`),variant:`quiet`,children:`History`}),P?(0,j.jsx)(i,{disabled:D===null,onClick:()=>L(`edit`),variant:`quiet`,children:`Edit`}):null,P?(0,j.jsx)(i,{disabled:D===null,onClick:()=>S(!0),variant:`quiet`,children:`Dismiss`}):null,P&&A!==void 0&&A.validation._tag!==`requires-revalidation`?(0,j.jsx)(i,{disabled:h.state._tag===`loading`,onClick:()=>l({expectedRevisionId:A.revisionId,expectedSequence:A.sequence,intent:`suggestion-edit`,jobId:r,suggestionId:M.suggestionId}),variant:`quiet`,children:`Ask agent to edit`}):null,e&&A?.validation._tag===`requires-revalidation`?(0,j.jsx)(i,{disabled:h.state._tag===`loading`,onClick:()=>l({expectedRevisionId:A.revisionId,expectedSequence:A.sequence,intent:`suggestion-revalidation`,jobId:r,suggestionId:M.suggestionId}),variant:`quiet`,children:`Revalidate`}):null,h.state._tag===`dismissing`?(0,j.jsx)(i,{disabled:!0,variant:`quiet`,children:`Dismissing…`}):null,h.state._tag===`failed`?(0,j.jsx)(i,{onClick:h.retry,variant:`quiet`,children:`Retry revision`}):null]}),isPreviewing:n,jobId:r,metadata:A===void 0?null:(0,j.jsxs)(`div`,{className:k.suggestionRevisionMeta,"data-validation":A.validation._tag,children:[(0,j.jsxs)(`strong`,{children:[`Revision `,String(A.sequence)]}),(0,j.jsx)(`span`,{children:A.validation._tag===`validated`?`Validated`:`Needs revalidation`}),(0,j.jsx)(`span`,{children:ce(A.author)}),(0,j.jsx)(`time`,{dateTime:d(A.createdAt),children:f(A.createdAt,{dateStyle:`medium`,timeStyle:`short`})})]}),onPreviewPublication:e=>{A!==void 0&&o({...e,revisionId:A.revisionId})},...I===void 0?{}:{publicationBlockedReason:I},suggestion:M}),D===null?null:(0,j.jsx)(se,{canEdit:P,conflict:h.state._tag===`conflict`,loadEarlier:h.loadEarlier,loadingEarlier:h.loadingEarlier,mode:g,onOpenChange:b,onResolveConflict:h.resolveConflict,onSave:h.save,open:y,page:D,preservedDraft:O,saving:h.state._tag===`saving`}),(0,j.jsx)(a.Root,{onOpenChange:S,open:x,children:(0,j.jsxs)(a.Content,{description:`Dismiss this finding for the reviewed head. It will remain in revision history and will not be posted to CodeCommit.`,size:`default`,title:`Dismiss finding?`,children:[(0,j.jsx)(s,{children:`This records your decision without changing the pull request or publishing a comment.`}),(0,j.jsxs)(`label`,{children:[`Reason`,(0,j.jsxs)(`select`,{"aria-label":`Dismissal reason`,onChange:e=>{let t=C(v)(e.currentTarget.value);w(t)||E(t.success)},value:T,children:[(0,j.jsx)(`option`,{value:`false-positive`,children:`False positive`}),(0,j.jsx)(`option`,{value:`not-applicable`,children:`Not applicable`}),(0,j.jsx)(`option`,{value:`accepted-risk`,children:`Accepted risk`}),(0,j.jsx)(`option`,{value:`duplicate`,children:`Duplicate`}),(0,j.jsx)(`option`,{value:`other`,children:`Other`})]})]}),(0,j.jsxs)(`div`,{className:k.publicationActions,children:[(0,j.jsx)(a.Close,{children:`Keep finding`}),(0,j.jsx)(i,{onClick:()=>{S(!1),h.dismiss(T)},children:`Dismiss finding`})]})]})})]})},ue=e=>{switch(e){case`not-codecommit`:case`not-pull-request`:return`Agent review is available only for synchronized CodeCommit pull requests.`;case`source-stale`:return`Synchronize this pull request before reviewing its immutable head.`;case`base-revision-unavailable`:return`The base revision has not been synchronized, so an exact review cannot start.`}},de=e=>{switch(e){case`changes-required`:return`Changes Required`;case`non-blocking-suggestions`:return`Non-blocking Suggestions`;case`no-issues-found`:return`No Issues Found`;case`unable-to-conclude`:return`Unable to Conclude`}},Y=e=>{let t=Math.round(e/6e4);return`${String(t)} minute${t===1?``:`s`}`},fe=e=>{switch(e){case`codex`:return`Codex`;case`claude`:return`Claude`;case`relay-gateway`:return`Relay Gateway`;default:return e}},X=e=>e.displayName??fe(e.providerId),pe=e=>`${X(e)} review`,Z=(e,t)=>t===`configured-default`||e===`claude`&&t==="default"?`CLI default`:t,me=(e,t)=>e===`blocked`?`Network blocked`:`${t} access enabled`,he=e=>{switch(e){case`source-checkout`:return`Source checkout failed`;case`review-setup`:return`Review setup is incomplete`;case`sandbox-start`:return`Review sandbox failed to start`;case`agent-run`:return`Agent review failed`;case`cleanup`:return`Review cleanup did not finish`;case`result-validation`:return`Review result was invalid`;case`control-center`:return`Control Center could not save the review`}},ge=e=>{switch(e){case void 0:return null;case`invalid-configuration`:return`The Review Sandbox configuration is invalid.`;case`invalid-request`:return`Control Center rejected the generated review command.`;case`source-rejected`:return`The source exceeded review safety limits or failed validation.`;case`source-unavailable`:return`CodeCommit source could not be materialized.`;case`sandbox-unavailable`:return`sbx could not create or reach the review sandbox.`;case`sandbox-timeout`:return`The review sandbox did not become ready in time.`;case`command-timeout`:return`The review command exceeded its time budget.`;case`provider-authentication`:return`The agent provider rejected its credentials or required API access is missing.`;case`provider-rate-limited`:return`The agent provider rate-limited this review.`;case`provider-unavailable`:return`The agent provider could not be reached.`;case`agent-command-failed`:return`The agent command exited before producing a review.`;case`output-rejected`:return`The review command returned output outside the safe limits.`;case`artifact-unavailable`:return`The retained review output could not be read.`;case`session-closed`:return`The review sandbox closed before the command finished.`;case`cleanup-failed`:return`The run ended, but sbx cleanup did not complete.`}},_e=({retryable:e,stage:t})=>{if(e&&t!==`cleanup`)return`The failure may be temporary. Retry this exact-head review.`;switch(t){case`source-checkout`:return`Check the CodeCommit connection, AWS credentials, region, and repository access.`;case`review-setup`:return`Check the workspace review policy and selected runner.`;case`sandbox-start`:return`Check the sbx installation and Review sandbox configuration.`;case`agent-run`:return`Check the selected review runner and its authentication.`;case`cleanup`:return`Check sbx status and reconcile the orphaned review sandbox before retrying.`;case`result-validation`:return`The runner returned a result Control Center could not safely accept. Check its version and configuration.`;case`control-center`:return`Check Control Center storage and worker health before starting a new review.`}},ve=[{label:`Correctness`,prompt:`Review correctness, regressions, error handling, and boundary conditions.`},{label:`Security`,prompt:`Review authorization, credential handling, unsafe input, and privilege boundaries.`},{label:`Tests`,prompt:`Review test coverage, failure paths, race conditions, and missing regression guardrails.`}],ye=({accessibleName:e,groupName:t,onSelect:n,presets:r,selectedProviderId:i})=>{let a=r.map(e=>({...A(e),name:pe(e)}));return(0,j.jsx)(M,{accessibleName:e,...k.reviewPresetList===void 0?{}:{className:k.reviewPresetList},describeProfile:e=>{let t=r.find(({providerId:t})=>String(t)===e.provider);return t===void 0?e.model:Z(t.providerId,t.model)},groupName:t,onProfileChange:e=>{let t=r.find(({providerId:t})=>String(t)===e.provider);t!==void 0&&n(t.providerId)},presentation:`radios`,profiles:a,selectedProfileId:String(i)})},Q=24,be=({events:e,hasEarlier:t,historyAction:n,historyLoaded:r,onLoadEarlier:a})=>{let o=(0,N.useRef)(null),c=(0,N.useRef)(!0),l=(0,N.useRef)({first:null,firstOffsetTop:0,last:null}),[u,d]=(0,N.useState)(!1),f=e[0]?.event.eventSequence??null,p=e.at(-1)?.event.eventSequence??null;return(0,N.useLayoutEffect)(()=>{let e=o.current;if(e===null)return;let t=l.current,n=t.first!==null&&f!==null&&f<t.first,r=t.last!==null&&p!==null&&p>t.last,i=[...e.querySelectorAll(`[data-review-event-sequence]`)].find(e=>e.dataset.reviewEventSequence===String(t.first));if(n&&i!==void 0){e.scrollTop+=i.offsetTop-t.firstOffsetTop;let n=e.scrollHeight-e.clientHeight-e.scrollTop<=Q;c.current=n,d(r&&!n)}else c.current?(e.scrollTop=e.scrollHeight,d(!1)):r&&d(!0);let a=e.querySelector(`[data-review-event-sequence]`);l.current={first:f,firstOffsetTop:a?.offsetTop??0,last:p}},[f,p]),(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{"aria-label":`Review activity`,"aria-live":`polite`,"aria-relevant":`additions text`,className:k.reviewThreadTranscript,onScroll:e=>{let t=e.currentTarget,n=t.scrollHeight-t.clientHeight-t.scrollTop<=Q;c.current=n,n&&d(!1)},ref:o,role:`log`,tabIndex:0,children:[t?(0,j.jsx)(i,{loading:n===`loading`,onClick:a,children:n===`loading`?`Loading earlier activity…`:n===`failed`?`Retry earlier activity`:`Load earlier activity`}):r?(0,j.jsx)(s,{tone:`secondary`,variant:`meta`,children:`Beginning of review thread`}):null,e.length===0?null:(0,j.jsx)(`ol`,{className:k.reviewThreadEvents,children:e.map(({event:e,summary:t})=>(0,j.jsx)(`li`,{"data-review-event-sequence":e.eventSequence,children:(0,j.jsx)(`span`,{children:t})},e.eventSequence))})]}),u?(0,j.jsx)(i,{onClick:()=>{let e=o.current;e!==null&&(c.current=!0,e.scrollTop=e.scrollHeight,d(!1),e.focus({preventScroll:!0}))},children:`New activity · Jump to latest`}):null]})},xe=(0,N.lazy)(()=>n(()=>import(`./ReviewSuggestionPublicationSurface-N9Qwdh2n.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]))),Se=({orientation:e})=>e===void 0?null:(0,j.jsxs)(`section`,{"aria-label":`Pull request orientation`,className:k.reviewOrientation,children:[(0,j.jsxs)(`header`,{children:[(0,j.jsx)(`strong`,{children:`What this PR changes`}),(0,j.jsx)(s,{tone:`secondary`,variant:`body`,children:e.summary})]}),e.cohorts.map((e,t)=>(0,j.jsxs)(`article`,{children:[(0,j.jsx)(`h3`,{children:e.title}),(0,j.jsx)(`p`,{children:e.summary}),(0,j.jsx)(`ol`,{children:e.layers.map((e,t)=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`strong`,{children:`${e.kind} · ${e.title}`}),(0,j.jsx)(`span`,{children:e.summary}),(0,j.jsx)(`small`,{children:e.ranges.map(({endLine:e,label:t,path:n,startLine:r})=>`${t} · ${n}:${String(r)}${e===r?``:`–${String(e)}`}`).join(` · `)})]},`${String(t)}:${e.title}`))})]},`${String(t)}:${e.title}`))]}),Ce=e=>{switch(e._tag){case`operator-message`:return`Local Operator · ${e.prompt}`;case`run-queued`:return`${e.reviewProfile.label} · head ${e.subject.headRevision.slice(0,12)}`;case`run-started`:return e.runtimeMetadata===void 0?`Review sandbox started`:`Review sandbox started · ${e.runtimeMetadata.implementation} ${e.runtimeMetadata.version??``}`.trim();case`progress`:return e.text;case`review-report`:return`${String(e.report.suggestions.length)} suggestions · ${String(e.report.notes.length)} notes`;case`suggestion-revised`:return e.suggestionState===`dismissed`?`Suggestion revision ${String(e.sequence)} · dismissed by operator`:`Suggestion revision ${String(e.sequence)} · ${e.validationState===`validated`?`validated`:`needs revalidation`}`;case`suggestion-published`:return`Suggestion published to CodeCommit`;case`run-completed`:return`Run completed · ${e.outcome}`;case`run-failed`:return`${he(e.stage)}${e.cause===void 0?``:` · ${ge(e.cause)}`}${e.retryable?` · retryable`:``}`;case`run-interrupted`:return`Run interrupted · Control Center restarted`;case`cancellation-requested`:return`Cancellation requested`;case`usage`:return null}},we=({canEnqueue:e,onCancelPublication:t,onCancelReview:n=()=>void 0,onExtendReviewBudget:r=()=>void 0,onLoadEarlier:o=()=>void 0,onPreviewPublication:c,onPublishSuggestion:l,onRetry:u,onStart:d,onSuggestionRevisionAccepted:f,onTargetSuggestion:p=()=>void 0,publication:h,revisionTransport:_,state:v,suggestions:y})=>{let[b,S]=(0,N.useState)(!1),[C,w]=(0,N.useState)(``),[T,E]=(0,N.useState)(null),[D,O]=(0,N.useState)(null),[A,M]=(0,N.useState)(null),P=(0,N.useRef)(null),F=(0,N.useRef)(!1),I=(0,N.useMemo)(()=>v._tag===`ready`?v.providerPresets??(v.provider===null?[]:[v.provider]):[],[v]),R=I.find(({providerId:e})=>e===A)??I[0]??null,z=e=>{let t=I.find(t=>t.providerId===e);return t===void 0?fe(e):X(t)},te=v._tag===`idle`?null:`${v.entityId}:${v.baseRevision??``}:${v.headRevision}:${v.sessionKey}`;(0,N.useEffect)(()=>{S(!1),w(``),E(null),O(null),M(null),F.current=!1},[te]),(0,N.useEffect)(()=>{if(I.length===0){M(null);return}I.some(({providerId:e})=>e===A)||M(I[0]?.providerId??null)},[I,A]),(0,N.useLayoutEffect)(()=>{if(T===null)return;let e=P.current;e!==null&&(e.focus({preventScroll:!0}),e.setSelectionRange(T,T),E(null))},[C,T]),(0,N.useEffect)(()=>{if(D!==null&&v._tag===`ready`){if(v.action===`failed`){F.current=!1;return}v.action===`idle`&&v.review._tag===`pending`&&(F.current=!1,w(e=>e.trim()===D?``:e),O(null))}},[v,D]);let ne=(0,N.useCallback)(e=>{S(e)},[]),re=(0,N.useCallback)(()=>{R!==null&&(O(null),d(void 0,R.providerId))},[d,R]),ie=(0,N.useCallback)(()=>{let e=C.trim();e.length===0||R===null||F.current||v._tag!==`ready`||v.action===`starting`||v.review._tag===`pending`||(F.current=!0,O(e),d(e,R.providerId))},[d,C,R,v]),ae=e=>{e.nativeEvent.isComposing||e.key!==`Enter`||!e.metaKey&&!e.ctrlKey||(e.preventDefault(),ie())},oe=e=>{let t=P.current,n=t?.selectionStart??C.length,r=t?.selectionEnd??n,i=C.slice(0,n),a=C.slice(r),o=i.length>0&&!/\s$/u.test(i)?`
|
|
5
|
+
`)}},I=e=>`${e.slice(0,1).toUpperCase()}${e.slice(1)}`,ee=({canPublish:e,extraActions:t,isPreviewing:n,jobId:r,metadata:i,onPreviewPublication:o,publicationBlockedReason:c,suggestion:l})=>{let u=l.replacement===void 0?null:F(l.replacement.unifiedDiff);return(0,j.jsxs)(`article`,{className:k.suggestionCard,"data-severity":l.severity,children:[(0,j.jsxs)(`header`,{className:k.suggestionHeading,children:[(0,j.jsx)(`span`,{className:k.severity,children:l.severity}),(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`small`,{children:P(l)}),(0,j.jsx)(`strong`,{children:l.title})]}),(0,j.jsxs)(`span`,{className:k.confidence,children:[I(l.state),` · `,l.confidence.level,` confidence`]})]}),i,(0,j.jsx)(s,{children:l.problem}),(0,j.jsxs)(`dl`,{className:k.suggestionDetails,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Impact`}),(0,j.jsx)(`dd`,{children:l.impact})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Recommendation`}),(0,j.jsx)(`dd`,{children:l.recommendation})]})]}),(0,j.jsxs)(`details`,{children:[(0,j.jsx)(`summary`,{children:`Evidence and confidence`}),(0,j.jsxs)(`code`,{children:[l.evidence.path,`:`,String(l.evidence.startLine),l.evidence.endLine===l.evidence.startLine?``:`–${String(l.evidence.endLine)}`]}),(0,j.jsx)(`pre`,{children:l.evidence.excerpt}),(0,j.jsx)(s,{children:l.confidence.reason})]}),l.relatedLocations.length===0?null:(0,j.jsxs)(`section`,{"aria-label":`Related locations`,className:k.relatedLocations,children:[(0,j.jsx)(`strong`,{children:`Related locations`}),(0,j.jsx)(`ul`,{children:l.relatedLocations.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsxs)(`code`,{children:[e.path,`:`,String(e.startLine),e.endLine===e.startLine?``:`–${String(e.endLine)}`]}),(0,j.jsx)(`span`,{children:e.label})]},`${e.path}:${String(e.startLine)}:${String(e.endLine)}`))})]}),u===null||l.replacement===void 0?null:(0,j.jsxs)(`section`,{"aria-label":`Suggested replacement`,className:k.replacementPreview,children:[(0,j.jsxs)(`header`,{children:[(0,j.jsx)(`strong`,{children:`Suggested replacement`}),(0,j.jsxs)(`span`,{children:[`Inert patch · `,l.replacement.reviewedHead.slice(0,12)]})]}),(0,j.jsx)(s,{children:l.replacement.explanation}),(0,j.jsxs)(`div`,{children:[(0,j.jsxs)(`figure`,{children:[(0,j.jsx)(`figcaption`,{children:`Before`}),(0,j.jsx)(`pre`,{children:u.before})]}),(0,j.jsxs)(`figure`,{children:[(0,j.jsx)(`figcaption`,{children:`After`}),(0,j.jsx)(`pre`,{children:u.after})]})]})]}),l.prevention===void 0?null:l.prevention.enforcement===`none`?(0,j.jsxs)(`details`,{className:k.preventionProposal,children:[(0,j.jsx)(`summary`,{children:`Prevention note · no stable guardrail`}),(0,j.jsxs)(s,{children:[l.prevention.summary,` · `,l.prevention.rationale]})]}):(0,j.jsxs)(`details`,{className:k.preventionProposal,children:[(0,j.jsx)(`summary`,{children:`Prevention proposal · separate review required`}),(0,j.jsxs)(s,{children:[l.prevention.summary,` · `,l.prevention.enforcement]}),(0,j.jsxs)(`dl`,{children:[(0,j.jsx)(`dt`,{children:`Recurring evidence`}),(0,j.jsx)(`dd`,{children:l.prevention.recurrenceEvidence}),(0,j.jsx)(`dt`,{children:`Existing rule or configuration`}),(0,j.jsx)(`dd`,{children:l.prevention.existingRuleOrConfig}),(0,j.jsx)(`dt`,{children:`Target file`}),(0,j.jsx)(`dd`,{children:l.prevention.targetFile}),(0,j.jsx)(`dt`,{children:`Source paths`}),(0,j.jsx)(`dd`,{children:l.prevention.sourcePaths.join(`, `)}),(0,j.jsx)(`dt`,{children:`Matcher or invariant`}),(0,j.jsx)(`dd`,{children:l.prevention.matcherOrInvariant}),(0,j.jsx)(`dt`,{children:`Invalid fixture`}),(0,j.jsx)(`dd`,{children:(0,j.jsx)(`pre`,{children:l.prevention.invalidFixture})}),(0,j.jsx)(`dt`,{children:`Valid fixture`}),(0,j.jsx)(`dd`,{children:(0,j.jsx)(`pre`,{children:l.prevention.validFixture})}),(0,j.jsx)(`dt`,{children:`Boundary and exclusions`}),(0,j.jsx)(`dd`,{children:l.prevention.boundary})]})]}),t===void 0&&(!e||l.state!==`draft`)?null:(0,j.jsxs)(`div`,{className:k.suggestionActions,children:[t,e&&l.state===`draft`?(0,j.jsx)(a,{disabled:n||c!==void 0,onClick:()=>o({jobId:r,suggestionId:l.suggestionId}),children:n?`Preparing approval…`:`Review & approve`}):null]}),c===void 0?null:(0,j.jsx)(s,{role:`status`,tone:`secondary`,variant:`meta`,children:c})]})},L=({notes:e})=>e.length===0?null:(0,j.jsxs)(`section`,{"aria-labelledby":`review-notes-title`,className:k.reviewNotes,children:[(0,j.jsxs)(`header`,{children:[(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`small`,{children:`Never publishable`}),(0,j.jsx)(`strong`,{id:`review-notes-title`,children:`Review Notes`})]}),(0,j.jsx)(`span`,{children:e.length})]}),(0,j.jsx)(`ul`,{children:e.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsxs)(`span`,{children:[e.reason===`pre-existing`?`Pre-existing`:`Low confidence`,` · `,e.confidence.level]}),(0,j.jsx)(`strong`,{children:e.title}),(0,j.jsx)(s,{children:e.observation}),e.location===void 0?null:(0,j.jsxs)(`code`,{children:[e.location.path,`:`,String(e.location.startLine),e.location.endLine===e.location.startLine?``:`–${String(e.location.endLine)}`]}),(0,j.jsx)(`small`,{children:e.confidence.reason})]},e.noteId))})]}),R=e=>e.author._tag===`operator`?`Operator`:`${e.author.providerId}${e.author.model===null?``:` · ${e.author.model}`}`,z=e=>e.validation._tag===`validated`?`Validated`:`Needs revalidation`,te=({loadEarlier:e,loadingEarlier:t,page:n})=>{let r=[n.current,...n.revisions.filter(({revisionId:e})=>e!==n.current.revisionId)];return(0,j.jsxs)(`div`,{className:k.revisionHistory,children:[(0,j.jsx)(`ol`,{children:r.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsxs)(`header`,{children:[(0,j.jsxs)(`strong`,{children:[`Revision `,String(e.sequence)]}),(0,j.jsxs)(`span`,{children:[z(e),` · `,R(e)]})]}),(0,j.jsx)(`time`,{dateTime:d(e.createdAt),children:g(e.createdAt,{dateStyle:`medium`,timeStyle:`short`})}),(0,j.jsxs)(`details`,{children:[(0,j.jsx)(`summary`,{children:e.suggestion.title}),(0,j.jsx)(s,{children:e.suggestion.problem}),(0,j.jsxs)(`dl`,{children:[(0,j.jsx)(`dt`,{children:`Impact`}),(0,j.jsx)(`dd`,{children:e.suggestion.impact}),(0,j.jsx)(`dt`,{children:`Recommendation`}),(0,j.jsx)(`dd`,{children:e.suggestion.recommendation}),(0,j.jsx)(`dt`,{children:`Severity`}),(0,j.jsx)(`dd`,{children:e.suggestion.severity}),(0,j.jsx)(`dt`,{children:`Confidence`}),(0,j.jsxs)(`dd`,{children:[e.suggestion.confidence.level,` · `,e.suggestion.confidence.reason]}),(0,j.jsx)(`dt`,{children:`Evidence`}),(0,j.jsxs)(`dd`,{children:[(0,j.jsxs)(`code`,{children:[e.suggestion.evidence.path,`:`,String(e.suggestion.evidence.startLine)]}),(0,j.jsx)(`pre`,{children:e.suggestion.evidence.excerpt})]}),(0,j.jsx)(`dt`,{children:`Anchor`}),(0,j.jsx)(`dd`,{children:(0,j.jsx)(`code`,{children:JSON.stringify(e.suggestion.anchor)})}),(0,j.jsx)(`dt`,{children:`Related locations`}),(0,j.jsx)(`dd`,{children:e.suggestion.relatedLocations.length===0?`None`:(0,j.jsx)(`pre`,{children:JSON.stringify(e.suggestion.relatedLocations,null,2)})}),(0,j.jsx)(`dt`,{children:`Replacement`}),(0,j.jsx)(`dd`,{children:e.suggestion.replacement===void 0?`None`:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(s,{children:e.suggestion.replacement.explanation}),(0,j.jsx)(`pre`,{children:e.suggestion.replacement.unifiedDiff})]})}),(0,j.jsx)(`dt`,{children:`Prevention`}),(0,j.jsx)(`dd`,{children:e.suggestion.prevention===void 0?`None`:(0,j.jsx)(`pre`,{children:JSON.stringify(e.suggestion.prevention,null,2)})})]})]})]},e.revisionId))}),n.hasMore?(0,j.jsx)(a,{"aria-busy":t,disabled:t,loading:t,onClick:e,children:t?`Loading earlier revisions…`:`Load earlier revisions`}):null]})},ne=u({anchor:p.fields.anchor,evidence:p.fields.evidence,relatedLocations:p.fields.relatedLocations,replacement:p.fields.replacement,prevention:p.fields.prevention}),re=w(ne),ie=[[`Problem`,`problem`],[`Impact`,`impact`],[`Recommendation`,`recommendation`]],ae=e=>({title:e.title,severity:e.severity,problem:e.problem,impact:e.impact,evidence:e.evidence,recommendation:e.recommendation,confidence:e.confidence,relatedLocations:e.relatedLocations,...e.prevention!==void 0&&{prevention:e.prevention},...e.replacement!==void 0&&{replacement:e.replacement},anchor:e.anchor}),oe=e=>v(re)({anchor:e.anchor,evidence:e.evidence,relatedLocations:e.relatedLocations,...e.prevention!==void 0&&{prevention:e.prevention},...e.replacement!==void 0&&{replacement:e.replacement}}),se=({canEdit:e,conflict:t,loadEarlier:n,loadingEarlier:r,mode:i,onOpenChange:c,onResolveConflict:u,onSave:d,open:f,page:m,preservedDraft:h,saving:g})=>{let _=m.current,[v,y]=(0,N.useState)(()=>ae(_.suggestion)),[b,S]=(0,N.useState)(()=>oe(_.suggestion)),[w,T]=(0,N.useState)(!1);(0,N.useEffect)(()=>{if(!f)return;let e=h??ae(_.suggestion);y(e),S(oe(e)),T(!1)},[_.revisionId,_.suggestion,f,h]);let E=(0,N.useMemo)(()=>`Revision ${String(_.sequence)} · ${z(_)} · ${R(_)}`,[_]),D=()=>{let e=C(re)(b);if(x(e)){T(!0);return}T(!1);let t=C(l)({title:v.title,severity:v.severity,problem:v.problem,impact:v.impact,recommendation:v.recommendation,confidence:v.confidence,...e.success});if(x(t)){T(!0);return}d(t.success)};return(0,j.jsx)(o.Root,{onOpenChange:c,open:f,children:(0,j.jsx)(o.Content,{className:k.revisionDialog,description:E,size:`wide`,title:i===`edit`?`Edit review suggestion`:`Revision history`,children:i===`history`?(0,j.jsx)(te,{loadEarlier:n,loadingEarlier:r,page:m}):(0,j.jsxs)(`form`,{className:k.revisionEditor,onSubmit:e=>{e.preventDefault(),D()},children:[(0,j.jsxs)(`div`,{className:k.revisionEditorLead,children:[(0,j.jsxs)(`label`,{children:[(0,j.jsx)(`span`,{children:`Title`}),(0,j.jsx)(`input`,{maxLength:500,onChange:e=>y({...v,title:e.currentTarget.value}),required:!0,value:v.title})]}),(0,j.jsxs)(`label`,{children:[(0,j.jsx)(`span`,{children:`Severity`}),(0,j.jsxs)(`select`,{onChange:e=>{let t=C(p.fields.severity)(e.currentTarget.value);x(t)||y({...v,severity:t.success})},value:v.severity,children:[(0,j.jsx)(`option`,{value:`P1`,children:`P1`}),(0,j.jsx)(`option`,{value:`P2`,children:`P2`}),(0,j.jsx)(`option`,{value:`P3`,children:`P3`}),(0,j.jsx)(`option`,{value:`P4`,children:`P4`})]})]}),(0,j.jsxs)(`label`,{children:[(0,j.jsx)(`span`,{children:`Confidence`}),(0,j.jsxs)(`select`,{onChange:e=>{let t=C(p.fields.confidence.fields.level)(e.currentTarget.value);x(t)||y({...v,confidence:{...v.confidence,level:t.success}})},value:v.confidence.level,children:[(0,j.jsx)(`option`,{value:`high`,children:`High`}),(0,j.jsx)(`option`,{value:`medium`,children:`Medium`})]})]})]}),ie.map(([e,t])=>(0,j.jsxs)(`label`,{children:[(0,j.jsx)(`span`,{children:e}),(0,j.jsx)(`textarea`,{maxLength:4e3,onChange:e=>y({...v,[t]:e.currentTarget.value}),required:!0,rows:4,value:v[t]})]},t)),(0,j.jsxs)(`label`,{children:[(0,j.jsx)(`span`,{children:`Confidence reason`}),(0,j.jsx)(`textarea`,{maxLength:2e3,onChange:e=>y({...v,confidence:{...v.confidence,reason:e.currentTarget.value}}),required:!0,rows:3,value:v.confidence.reason})]}),(0,j.jsxs)(`details`,{className:k.revisionAdvanced,children:[(0,j.jsx)(`summary`,{children:`Advanced evidence, anchor, replacement and prevention`}),(0,j.jsx)(s,{tone:`secondary`,children:`Complete schema-checked JSON. Invalid or incoherent evidence cannot be saved.`}),(0,j.jsx)(`textarea`,{"aria-describedby":w?`revision-advanced-error`:void 0,"aria-invalid":w,"aria-label":`Advanced evidence, anchor, replacement and prevention JSON`,onChange:e=>S(e.currentTarget.value),rows:14,spellCheck:!1,value:b}),w?(0,j.jsx)(`span`,{id:`revision-advanced-error`,role:`alert`,children:`Advanced fields are not a valid complete suggestion.`}):null]}),t?(0,j.jsxs)(`div`,{role:`alert`,children:[(0,j.jsx)(`span`,{children:`A newer revision won. Your draft is preserved, but cannot be saved over the winner.`}),(0,j.jsx)(a,{onClick:u,type:`button`,variant:`quiet`,children:`Use latest revision`})]}):_.validation._tag===`requires-revalidation`?(0,j.jsx)(`span`,{role:`status`,children:`Technical changes remain blocked from publication until revalidated.`}):null,(0,j.jsxs)(`div`,{className:k.revisionDialogActions,children:[(0,j.jsx)(o.Close,{disabled:g,children:`Cancel`}),(0,j.jsx)(a,{disabled:!e||g,loading:g,type:`submit`,children:g?`Saving revision…`:`Save revision`})]})]})})})},B=y.make(24),V={dismiss:(e,t,n)=>b(_(function*(){return yield*(yield*O).agent.dismissReviewSuggestion({params:{entityId:e.entityId,jobId:e.jobId,suggestionId:e.suggestionId},payload:t})}).pipe(m(E)),{signal:n}),edit:(e,t,n)=>b(_(function*(){return yield*(yield*O).agent.editReviewSuggestion({params:{entityId:e.entityId,jobId:e.jobId,suggestionId:e.suggestionId},payload:t})}).pipe(m(E)),{signal:n}),load:(e,t,n)=>b(_(function*(){return yield*(yield*D()).agent.reviewSuggestionRevisions({params:{entityId:e.entityId,jobId:e.jobId,suggestionId:e.suggestionId},query:{...t!==null&&{before:t},limit:B}})}).pipe(m(E)),{signal:n})},H=(e,t)=>e.entityId===t.entityId&&e.jobId===t.jobId&&e.sessionKey===t.sessionKey&&e.suggestionId===t.suggestionId,U=(e,t)=>{let n=t.current.sequence>e.current.sequence?t.current:e.current;return{current:n,revisions:[...new Map([e.current,t.current,...e.revisions,...t.revisions].filter(({revisionId:e})=>e!==n.revisionId).map(e=>[e.revisionId,e])).values()].sort((e,t)=>t.sequence-e.sequence),hasMore:t.hasMore,nextBeforeSequence:t.nextBeforeSequence}},W=(e,t)=>({current:t,revisions:[e.current,...e.revisions].filter(({revisionId:e})=>e!==t.revisionId).sort((e,t)=>t.sequence-e.sequence),hasMore:e.hasMore,nextBeforeSequence:e.nextBeforeSequence}),G=(e,t)=>({_tag:e,page:t}),K=h(`ConflictApiError`),q=e=>void 0,J=(e,t=V,n=q)=>{let[r,i]=(0,N.useState)(0),[a,o]=(0,N.useState)(!1),[s,c]=(0,N.useState)({_tag:`idle`}),l=(0,N.useRef)(null),u=(0,N.useRef)(!1),d=(0,N.useRef)(e),f=(0,N.useRef)(n);d.current=e,f.current=n,(0,N.useEffect)(()=>{if(l.current?.abort(),u.current=!1,o(!1),e===null){c({_tag:`idle`});return}let n=e,r=new AbortController;return l.current=r,c({_tag:`loading`}),t.load(n,null,r.signal).then(e=>{r.signal.aborted||d.current===null||!H(d.current,n)||c({_tag:`ready`,page:e})},()=>{r.signal.aborted||d.current===null||!H(d.current,n)||c({_tag:`failed`,draft:null,page:null})}),()=>r.abort()},[r,e,t]);let p=(0,N.useCallback)(n=>{if(e===null||s._tag===`conflict`)return;let r=s._tag===`ready`||s._tag===`failed`?s.page:null;if(r===null)return;let i=e;l.current?.abort(),u.current=!1,o(!1);let a=new AbortController;l.current=a,c({_tag:`saving`,draft:n,page:r}),t.edit(i,{expectedRevisionId:r.current.revisionId,expectedSequence:r.current.sequence,edit:n},a.signal).then(e=>{let n=W(r,e);return t.load(i,null,a.signal).then(e=>G(`refreshed`,e),()=>G(`accepted-refresh-failed`,n))},e=>{if(!K(e))throw e;return t.load(i,null,a.signal).then(e=>(a.signal.aborted||d.current===null||!H(d.current,i)||c({_tag:`conflict`,draft:n,page:e}),G(`conflict`,e)))}).then(e=>{a.signal.aborted||d.current===null||!H(d.current,i)||(c(t=>t._tag===`conflict`?t:e._tag===`accepted-refresh-failed`?{_tag:`failed`,draft:null,page:e.page}:{_tag:`ready`,page:e.page}),e._tag!==`conflict`&&f.current(e.page.current.suggestion))},()=>{a.signal.aborted||d.current===null||!H(d.current,i)||c({_tag:`failed`,draft:n,page:r})})},[e,s,t]),m=(0,N.useCallback)(n=>{if(e===null||s._tag!==`ready`||t.dismiss===void 0)return;let r=e,i=s.page;l.current?.abort(),u.current=!1,o(!1);let a=new AbortController;l.current=a,c({_tag:`dismissing`,page:i}),t.dismiss(r,{expectedRevisionId:i.current.revisionId,expectedSequence:i.current.sequence,reason:n},a.signal).then(e=>{a.signal.aborted||d.current===null||!H(d.current,r)||(c({_tag:`ready`,page:W(i,e)}),f.current(e.suggestion))},()=>{a.signal.aborted||d.current===null||!H(d.current,r)||c({_tag:`failed`,draft:null,page:i})})},[e,s,t]),h=(0,N.useCallback)(()=>{if(e===null||s._tag!==`ready`&&s._tag!==`conflict`||u.current||!s.page.hasMore||s.page.nextBeforeSequence===null)return;let n=e,r=s.page;l.current?.abort();let i=new AbortController;l.current=i,u.current=!0,o(!0),t.load(n,r.nextBeforeSequence,i.signal).then(e=>{i.signal.aborted||d.current===null||!H(d.current,n)||l.current===i&&(c(t=>t._tag===`ready`||t._tag===`conflict`?{...t,page:U(t.page,e)}:t),u.current=!1,o(!1))},()=>{i.signal.aborted||d.current===null||!H(d.current,n)||l.current===i&&(c(e=>e._tag===`ready`?{_tag:`failed`,draft:null,page:e.page}:e),u.current=!1,o(!1))})},[e,s,t]);return(0,N.useMemo)(()=>({dismiss:m,loadEarlier:h,loadingEarlier:a,resolveConflict:()=>c(e=>e._tag===`conflict`?{_tag:`ready`,page:e.page}:e),retry:()=>{if(s._tag!==`conflict`){if(s._tag===`failed`&&s.draft!==null&&s.page!==null){p(s.draft);return}i(e=>e+1)}},save:p,state:s}),[m,h,a,p,s])},ce=e=>e._tag===`operator`?`Operator`:e.providerId,le=({canEdit:e,entityId:t,isPreviewing:n,jobId:r,onPreviewPublication:i,onSuggestionRevisionAccepted:c,onTargetSuggestion:l,revisionTransport:u=V,sessionKey:p,suggestion:m})=>{let h=J((0,N.useMemo)(()=>({entityId:t,jobId:r,sessionKey:p,suggestionId:m.suggestionId}),[t,r,p,m.suggestionId]),u,c),[_,v]=(0,N.useState)(`history`),[y,b]=(0,N.useState)(!1),[S,w]=(0,N.useState)(!1),[T,E]=(0,N.useState)(`false-positive`),D=h.state._tag===`ready`||h.state._tag===`dismissing`||h.state._tag===`saving`||h.state._tag===`conflict`||h.state._tag===`failed`?h.state.page:null,O=h.state._tag===`saving`||h.state._tag===`conflict`||h.state._tag===`failed`?h.state.draft:null,A=D?.current,M=A===void 0?m:{...A.suggestion,state:m.state===`published`?`published`:A.suggestion.state},P=e&&M.state===`draft`&&h.state._tag!==`dismissing`,F=A?.validation._tag===`requires-revalidation`,I=h.state._tag===`loading`?`Loading the exact revision before publication.`:h.state._tag===`failed`?`Revision history is unavailable. Retry before publishing.`:F?`This technical edit needs agent revalidation before it can be posted.`:void 0,L=e=>{v(e),b(!0)};return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(ee,{canPublish:P,extraActions:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(a,{disabled:D===null,onClick:()=>L(`history`),variant:`quiet`,children:`History`}),P?(0,j.jsx)(a,{disabled:D===null,onClick:()=>L(`edit`),variant:`quiet`,children:`Edit`}):null,P?(0,j.jsx)(a,{disabled:D===null,onClick:()=>w(!0),variant:`quiet`,children:`Dismiss`}):null,P&&A!==void 0&&A.validation._tag!==`requires-revalidation`?(0,j.jsx)(a,{disabled:h.state._tag===`loading`,onClick:()=>l({expectedRevisionId:A.revisionId,expectedSequence:A.sequence,intent:`suggestion-edit`,jobId:r,suggestionId:M.suggestionId}),variant:`quiet`,children:`Ask agent to edit`}):null,e&&A?.validation._tag===`requires-revalidation`?(0,j.jsx)(a,{disabled:h.state._tag===`loading`,onClick:()=>l({expectedRevisionId:A.revisionId,expectedSequence:A.sequence,intent:`suggestion-revalidation`,jobId:r,suggestionId:M.suggestionId}),variant:`quiet`,children:`Revalidate`}):null,h.state._tag===`dismissing`?(0,j.jsx)(a,{disabled:!0,variant:`quiet`,children:`Dismissing…`}):null,h.state._tag===`failed`?(0,j.jsx)(a,{onClick:h.retry,variant:`quiet`,children:`Retry revision`}):null]}),isPreviewing:n,jobId:r,metadata:A===void 0?null:(0,j.jsxs)(`div`,{className:k.suggestionRevisionMeta,"data-validation":A.validation._tag,children:[(0,j.jsxs)(`strong`,{children:[`Revision `,String(A.sequence)]}),(0,j.jsx)(`span`,{children:A.validation._tag===`validated`?`Validated`:`Needs revalidation`}),(0,j.jsx)(`span`,{children:ce(A.author)}),(0,j.jsx)(`time`,{dateTime:d(A.createdAt),children:g(A.createdAt,{dateStyle:`medium`,timeStyle:`short`})})]}),onPreviewPublication:e=>{A!==void 0&&i({...e,revisionId:A.revisionId})},...I===void 0?{}:{publicationBlockedReason:I},suggestion:M}),D===null?null:(0,j.jsx)(se,{canEdit:P,conflict:h.state._tag===`conflict`,loadEarlier:h.loadEarlier,loadingEarlier:h.loadingEarlier,mode:_,onOpenChange:b,onResolveConflict:h.resolveConflict,onSave:h.save,open:y,page:D,preservedDraft:O,saving:h.state._tag===`saving`}),(0,j.jsx)(o.Root,{onOpenChange:w,open:S,children:(0,j.jsxs)(o.Content,{description:`Dismiss this finding for the reviewed head. It will remain in revision history and will not be posted to CodeCommit.`,size:`default`,title:`Dismiss finding?`,children:[(0,j.jsx)(s,{children:`This records your decision without changing the pull request or publishing a comment.`}),(0,j.jsxs)(`label`,{children:[`Reason`,(0,j.jsxs)(`select`,{"aria-label":`Dismissal reason`,onChange:e=>{let t=C(f)(e.currentTarget.value);x(t)||E(t.success)},value:T,children:[(0,j.jsx)(`option`,{value:`false-positive`,children:`False positive`}),(0,j.jsx)(`option`,{value:`not-applicable`,children:`Not applicable`}),(0,j.jsx)(`option`,{value:`accepted-risk`,children:`Accepted risk`}),(0,j.jsx)(`option`,{value:`duplicate`,children:`Duplicate`}),(0,j.jsx)(`option`,{value:`other`,children:`Other`})]})]}),(0,j.jsxs)(`div`,{className:k.publicationActions,children:[(0,j.jsx)(o.Close,{children:`Keep finding`}),(0,j.jsx)(a,{onClick:()=>{w(!1),h.dismiss(T)},children:`Dismiss finding`})]})]})})]})},ue=e=>{switch(e){case`not-codecommit`:case`not-pull-request`:return`Agent review is available only for synchronized CodeCommit pull requests.`;case`source-stale`:return`Synchronize this pull request before reviewing its immutable head.`;case`base-revision-unavailable`:return`The base revision has not been synchronized, so an exact review cannot start.`}},de=e=>{switch(e){case`changes-required`:return`Changes Required`;case`non-blocking-suggestions`:return`Non-blocking Suggestions`;case`no-issues-found`:return`No Issues Found`;case`unable-to-conclude`:return`Unable to Conclude`}},Y=e=>{let t=Math.round(e/6e4);return`${String(t)} minute${t===1?``:`s`}`},fe=e=>{switch(e){case`codex`:return`Codex`;case`claude`:return`Claude`;case`relay-gateway`:return`Relay Gateway`;default:return e}},X=e=>e.displayName??fe(e.providerId),pe=e=>`${X(e)} review`,Z=(e,t)=>t===`configured-default`||e===`claude`&&t==="default"?`CLI default`:t,me=(e,t)=>e===`blocked`?`Network blocked`:`${t} access enabled`,he=e=>{switch(e){case`source-checkout`:return`Source checkout failed`;case`review-setup`:return`Review setup is incomplete`;case`sandbox-start`:return`Review sandbox failed to start`;case`agent-run`:return`Agent review failed`;case`cleanup`:return`Review cleanup did not finish`;case`result-validation`:return`Review result was invalid`;case`control-center`:return`Control Center could not save the review`}},ge=e=>{switch(e){case void 0:return null;case`invalid-configuration`:return`The Review Sandbox configuration is invalid.`;case`invalid-request`:return`Control Center rejected the generated review command.`;case`source-rejected`:return`The source exceeded review safety limits or failed validation.`;case`source-unavailable`:return`CodeCommit source could not be materialized.`;case`sandbox-unavailable`:return`sbx could not create or reach the review sandbox.`;case`sandbox-timeout`:return`The review sandbox did not become ready in time.`;case`command-timeout`:return`The review command exceeded its time budget.`;case`provider-authentication`:return`The agent provider rejected its credentials or required API access is missing.`;case`provider-rate-limited`:return`The agent provider rate-limited this review.`;case`provider-unavailable`:return`The agent provider could not be reached.`;case`agent-command-failed`:return`The agent command exited before producing a review.`;case`output-rejected`:return`The review command returned output outside the safe limits.`;case`artifact-unavailable`:return`The retained review output could not be read.`;case`session-closed`:return`The review sandbox closed before the command finished.`;case`cleanup-failed`:return`The run ended, but sbx cleanup did not complete.`}},_e=({retryable:e,stage:t})=>{if(e&&t!==`cleanup`)return`The failure may be temporary. Retry this exact-head review.`;switch(t){case`source-checkout`:return`Check the CodeCommit connection, AWS credentials, region, and repository access.`;case`review-setup`:return`Check the workspace review policy and selected runner.`;case`sandbox-start`:return`Check the sbx installation and Review sandbox configuration.`;case`agent-run`:return`Check the selected review runner and its authentication.`;case`cleanup`:return`Check sbx status and reconcile the orphaned review sandbox before retrying.`;case`result-validation`:return`The runner returned a result Control Center could not safely accept. Check its version and configuration.`;case`control-center`:return`Check Control Center storage and worker health before starting a new review.`}},ve=[{label:`Correctness`,prompt:`Review correctness, regressions, error handling, and boundary conditions.`},{label:`Security`,prompt:`Review authorization, credential handling, unsafe input, and privilege boundaries.`},{label:`Tests`,prompt:`Review test coverage, failure paths, race conditions, and missing regression guardrails.`}],ye=({accessibleName:e,groupName:t,onSelect:n,presets:r,selectedProviderId:i})=>{let a=r.map(e=>({...A(e),name:pe(e)}));return(0,j.jsx)(M,{accessibleName:e,...k.reviewPresetList===void 0?{}:{className:k.reviewPresetList},describeProfile:e=>{let t=r.find(({providerId:t})=>String(t)===e.provider);return t===void 0?e.model:Z(t.providerId,t.model)},groupName:t,onProfileChange:e=>{let t=r.find(({providerId:t})=>String(t)===e.provider);t!==void 0&&n(t.providerId)},presentation:`radios`,profiles:a,selectedProfileId:String(i)})},Q=24,be=({events:e,hasEarlier:t,historyAction:n,historyLoaded:r,onLoadEarlier:i})=>{let o=(0,N.useRef)(null),c=(0,N.useRef)(!0),l=(0,N.useRef)({first:null,firstOffsetTop:0,last:null}),[u,d]=(0,N.useState)(!1),f=e[0]?.event.eventSequence??null,p=e.at(-1)?.event.eventSequence??null;return(0,N.useLayoutEffect)(()=>{let e=o.current;if(e===null)return;let t=l.current,n=t.first!==null&&f!==null&&f<t.first,r=t.last!==null&&p!==null&&p>t.last,i=[...e.querySelectorAll(`[data-review-event-sequence]`)].find(e=>e.dataset.reviewEventSequence===String(t.first));if(n&&i!==void 0){e.scrollTop+=i.offsetTop-t.firstOffsetTop;let n=e.scrollHeight-e.clientHeight-e.scrollTop<=Q;c.current=n,d(r&&!n)}else c.current?(e.scrollTop=e.scrollHeight,d(!1)):r&&d(!0);let a=e.querySelector(`[data-review-event-sequence]`);l.current={first:f,firstOffsetTop:a?.offsetTop??0,last:p}},[f,p]),(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{"aria-label":`Review activity`,"aria-live":`polite`,"aria-relevant":`additions text`,className:k.reviewThreadTranscript,onScroll:e=>{let t=e.currentTarget,n=t.scrollHeight-t.clientHeight-t.scrollTop<=Q;c.current=n,n&&d(!1)},ref:o,role:`log`,tabIndex:0,children:[t?(0,j.jsx)(a,{loading:n===`loading`,onClick:i,children:n===`loading`?`Loading earlier activity…`:n===`failed`?`Retry earlier activity`:`Load earlier activity`}):r?(0,j.jsx)(s,{tone:`secondary`,variant:`meta`,children:`Beginning of review thread`}):null,e.length===0?null:(0,j.jsx)(`ol`,{className:k.reviewThreadEvents,children:e.map(({event:e,summary:t})=>(0,j.jsx)(`li`,{"data-review-event-sequence":e.eventSequence,children:(0,j.jsx)(`span`,{children:t})},e.eventSequence))})]}),u?(0,j.jsx)(a,{onClick:()=>{let e=o.current;e!==null&&(c.current=!0,e.scrollTop=e.scrollHeight,d(!1),e.focus({preventScroll:!0}))},children:`New activity · Jump to latest`}):null]})},xe=(0,N.lazy)(()=>n(()=>import(`./ReviewSuggestionPublicationSurface-BZIa-Vvc.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]))),Se=({orientation:e})=>e===void 0?null:(0,j.jsxs)(`section`,{"aria-label":`Pull request orientation`,className:k.reviewOrientation,children:[(0,j.jsxs)(`header`,{children:[(0,j.jsx)(`strong`,{children:`What this PR changes`}),(0,j.jsx)(s,{tone:`secondary`,variant:`body`,children:e.summary})]}),e.cohorts.map((e,t)=>(0,j.jsxs)(`article`,{children:[(0,j.jsx)(`h3`,{children:e.title}),(0,j.jsx)(`p`,{children:e.summary}),(0,j.jsx)(`ol`,{children:e.layers.map((e,t)=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`strong`,{children:`${e.kind} · ${e.title}`}),(0,j.jsx)(`span`,{children:e.summary}),(0,j.jsx)(`small`,{children:e.ranges.map(({endLine:e,label:t,path:n,startLine:r})=>`${t} · ${n}:${String(r)}${e===r?``:`–${String(e)}`}`).join(` · `)})]},`${String(t)}:${e.title}`))})]},`${String(t)}:${e.title}`))]}),Ce=e=>{switch(e._tag){case`operator-message`:return`Local Operator · ${e.prompt}`;case`run-queued`:return`${e.reviewProfile.label} · head ${e.subject.headRevision.slice(0,12)}`;case`run-started`:return e.runtimeMetadata===void 0?`Review sandbox started`:`Review sandbox started · ${e.runtimeMetadata.implementation} ${e.runtimeMetadata.version??``}`.trim();case`progress`:return e.text;case`review-report`:return`${String(e.report.suggestions.length)} suggestions · ${String(e.report.notes.length)} notes`;case`suggestion-revised`:return e.suggestionState===`dismissed`?`Suggestion revision ${String(e.sequence)} · dismissed by operator`:`Suggestion revision ${String(e.sequence)} · ${e.validationState===`validated`?`validated`:`needs revalidation`}`;case`suggestion-published`:return`Suggestion published to CodeCommit`;case`run-completed`:return`Run completed · ${e.outcome}`;case`run-failed`:return`${he(e.stage)}${e.cause===void 0?``:` · ${ge(e.cause)}`}${e.retryable?` · retryable`:``}`;case`run-interrupted`:return`Run interrupted · Control Center restarted`;case`cancellation-requested`:return`Cancellation requested`;case`usage`:return null}},we=({canEnqueue:e,onCancelPublication:t,onCancelReview:n=()=>void 0,onExtendReviewBudget:r=()=>void 0,onLoadEarlier:i=()=>void 0,onPreviewPublication:l,onPublishSuggestion:u,onRetry:d,onStart:f,onSuggestionRevisionAccepted:p,onTargetSuggestion:m=()=>void 0,publication:h,revisionTransport:g,state:_,suggestions:v})=>{let[y,b]=(0,N.useState)(!1),[x,C]=(0,N.useState)(``),[w,E]=(0,N.useState)(null),[D,O]=(0,N.useState)(null),[A,M]=(0,N.useState)(null),P=(0,N.useRef)(null),F=(0,N.useRef)(!1),I=(0,N.useMemo)(()=>_._tag===`ready`?_.providerPresets??(_.provider===null?[]:[_.provider]):[],[_]),R=I.find(({providerId:e})=>e===A)??I[0]??null,z=e=>{let t=I.find(t=>t.providerId===e);return t===void 0?fe(e):X(t)},te=_._tag===`idle`?null:`${_.entityId}:${_.baseRevision??``}:${_.headRevision}:${_.sessionKey}`;(0,N.useEffect)(()=>{b(!1),C(``),E(null),O(null),M(null),F.current=!1},[te]),(0,N.useEffect)(()=>{if(I.length===0){M(null);return}I.some(({providerId:e})=>e===A)||M(I[0]?.providerId??null)},[I,A]),(0,N.useLayoutEffect)(()=>{if(w===null)return;let e=P.current;e!==null&&(e.focus({preventScroll:!0}),e.setSelectionRange(w,w),E(null))},[x,w]),(0,N.useEffect)(()=>{if(D!==null&&_._tag===`ready`){if(_.action===`failed`){F.current=!1;return}_.action===`idle`&&_.review._tag===`pending`&&(F.current=!1,C(e=>e.trim()===D?``:e),O(null))}},[_,D]);let ne=(0,N.useCallback)(e=>{b(e)},[]),re=(0,N.useCallback)(()=>{R!==null&&(O(null),f(void 0,R.providerId))},[f,R]),ie=(0,N.useCallback)(()=>{let e=x.trim();e.length===0||R===null||F.current||_._tag!==`ready`||_.action===`starting`||_.review._tag===`pending`||(F.current=!0,O(e),f(e,R.providerId))},[f,x,R,_]),ae=e=>{e.nativeEvent.isComposing||e.key!==`Enter`||!e.metaKey&&!e.ctrlKey||(e.preventDefault(),ie())},oe=e=>{let t=P.current,n=t?.selectionStart??x.length,r=t?.selectionEnd??n,i=x.slice(0,n),a=x.slice(r),o=i.length>0&&!/\s$/u.test(i)?`
|
|
6
6
|
`:``,s=a.length>0&&!/^\s/u.test(a)?`
|
|
7
|
-
`:``,c=Math.max(0,x-i.length-a.length),l=`${o}${e}${s}`.slice(0,c),u=`${i}${l}${a}`;w(u),E(i.length+l.length)},se=h._tag===`idle`||h._tag===`previewing`?null:(0,j.jsx)(N.Suspense,{fallback:(0,j.jsx)(`span`,{children:`Preparing publication surface…`}),children:(0,j.jsx)(xe,{onCancel:t,onPublish:l,publication:h})}),B=e=>(0,j.jsxs)(j.Fragment,{children:[e,se]});if(v._tag===`idle`||v._tag===`loading`)return B((0,j.jsxs)(`div`,{"aria-live":`polite`,className:k.reviewStatus,role:`status`,children:[(0,j.jsx)(`strong`,{children:`Loading review state`}),(0,j.jsx)(`span`,{children:`Checking durable review history for this exact head.`}),(0,j.jsx)(`span`,{"aria-hidden":`true`,className:k.reviewRunway})]}));if(v._tag===`failed`)return B((0,j.jsxs)(`div`,{className:k.reviewStatus,children:[(0,j.jsx)(`strong`,{children:`Review state unavailable`}),(0,j.jsx)(`span`,{children:`The current review could not be loaded. No human decision was changed.`}),(0,j.jsx)(i,{onClick:u,children:`Retry`})]}));let V=v.review,H=v.thread?.events??[],U=V._tag===`stale`?V.previousJobId:V._tag===`pending`||V._tag===`completed`||V._tag===`failed`||V._tag===`interrupted`?V.jobId:null,W=U===null?[]:H.filter(e=>e._tag===`usage`&&e.jobId===U),G=W.reduce((e,t)=>({inputTokens:e.inputTokens+t.inputTokens,outputTokens:e.outputTokens+t.outputTokens}),{inputTokens:0,outputTokens:0}),K=U===null?null:H.find(e=>e._tag===`run-queued`&&e.jobId===U),q=v.thread!==void 0&&(!v.thread.hasEarlier||K!=null),J=q?`Not reported`:`Load earlier history`,ce=H.map(e=>({event:e,summary:Ce(e)})).filter(e=>e.summary!==null),pe=v.thread!==void 0&&(v.thread.historyLoaded||!v.thread.hasEarlier)?ce:ce.slice(-12),Q=V._tag===`pending`,we=v.action===`starting`||Q,Te=(0,j.jsxs)(`section`,{"aria-label":`Review thread`,className:k.reviewThread,children:[(0,j.jsxs)(`header`,{children:[(0,j.jsx)(`strong`,{children:`Review thread`}),(0,j.jsx)(`span`,{children:H.length===0?`No runs yet`:`Durable across pull-request heads`})]}),U===null?null:(0,j.jsxs)(`dl`,{"aria-label":`Review run usage`,className:k.reviewUsage,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Agent`}),(0,j.jsx)(`dd`,{children:K==null?J:`${z(K.providerId)} · ${K.model===null?`model not reported`:Z(K.providerId,K.model)}`})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Input tokens`}),(0,j.jsx)(`dd`,{children:!q||W.length===0?J:G.inputTokens.toLocaleString(`en-US`)})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Output tokens`}),(0,j.jsx)(`dd`,{children:!q||W.length===0?J:G.outputTokens.toLocaleString(`en-US`)})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Cost`}),(0,j.jsx)(`dd`,{children:`Not reported`})]})]}),(0,j.jsx)(be,{events:pe,hasEarlier:v.thread?.hasEarlier??!1,historyAction:v.historyAction,historyLoaded:v.thread!==void 0,onLoadEarlier:o},te),e&&v.provider!==null&&V._tag!==`unavailable`?(0,j.jsxs)(`div`,{className:k.reviewThreadComposer,children:[(0,j.jsx)(`label`,{htmlFor:`review-thread-request`,children:Q?`Draft the next review request`:`Ask Relay about this pull request`}),I.length>1?R===null?null:(0,j.jsx)(ye,{accessibleName:`Targeted review agent presets`,groupName:`targeted-review-agent`,onSelect:M,presets:I,selectedProviderId:R.providerId}):R===null?null:(0,j.jsxs)(`span`,{className:k.reviewSelectedPreset,children:[`Review with `,X(R),` ·`,` `,Z(R.providerId,R.model)]}),(0,j.jsx)(`div`,{"aria-label":`Review prompt templates`,className:k.reviewTemplateList,children:ve.map(e=>(0,j.jsx)(i,{onClick:()=>oe(e.prompt),children:e.label},e.label))}),(0,j.jsx)(`textarea`,{"aria-describedby":`review-thread-request-help review-thread-request-count`,id:`review-thread-request`,maxLength:x,onChange:e=>w(e.currentTarget.value),onKeyDown:ae,placeholder:`Re-check the error handling in the connection flow…`,ref:P,rows:3,value:C}),(0,j.jsxs)(`div`,{className:k.reviewThreadComposerFooter,children:[(0,j.jsx)(`span`,{id:`review-thread-request-help`,children:`Ctrl/⌘ + Enter to run`}),(0,j.jsxs)(`span`,{id:`review-thread-request-count`,children:[String(C.length),` / `,String(x)]})]}),v.action===`failed`&&D!==null?(0,j.jsx)(`span`,{role:`alert`,children:`Targeted review did not start. Your request is still here—check the provider and worker, then try again.`}):null,(0,j.jsx)(i,{disabled:we||C.trim().length===0,onClick:ie,children:v.action===`starting`?`Starting targeted review…`:Q?`Review in progress`:`Start targeted review`})]}):null]}),$=e=>B((0,j.jsxs)(j.Fragment,{children:[e,Te]})),Ee=(e,t,n=!1)=>R===null?null:(0,j.jsxs)(a.Root,{onOpenChange:ne,open:b,children:[(0,j.jsx)(a.Trigger,{disabled:v.action===`starting`,children:v.action===`starting`?`Starting review…`:t}),(0,j.jsx)(a.Content,{className:k.reviewLaunchDialog,description:`${X(R)} can inspect and temporarily edit the disposable checkout. It cannot approve, comment on, or change this CodeCommit pull request.`,title:n?`Review this exact head again`:`Review this exact head`,children:(0,j.jsxs)(`div`,{className:k.reviewLaunchBody,children:[(0,j.jsx)(`small`,{className:k.reviewLaunchEyebrow,children:`No CodeCommit writes`}),I.length>1?(0,j.jsx)(ye,{accessibleName:`Review agent presets`,groupName:`full-review-agent`,onSelect:M,presets:I,selectedProviderId:R.providerId}):null,(0,j.jsxs)(`dl`,{className:k.reviewLaunchFacts,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Exact head`}),(0,j.jsx)(`dd`,{children:(0,j.jsx)(`code`,{children:e})})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Agent`}),(0,j.jsx)(`dd`,{children:X(R)})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Model`}),(0,j.jsx)(`dd`,{children:Z(R.providerId,R.model)})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Scope`}),(0,j.jsx)(`dd`,{children:`Full project`})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Budget`}),(0,j.jsx)(`dd`,{children:Y(R.reviewProfile.budgetMillis)})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Network`}),(0,j.jsx)(`dd`,{children:me(R.reviewProfile.networkAccess,X(R))})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Isolation`}),(0,j.jsx)(`dd`,{children:`Disposable sbx sandbox`})]})]}),(0,j.jsxs)(`div`,{className:k.reviewLaunchActions,children:[(0,j.jsx)(a.Close,{children:`Cancel`}),(0,j.jsx)(a.Close,{onClick:re,children:`Start full-project review`})]})]})})]});if(V._tag===`unavailable`)return $((0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`strong`,{children:`Review unavailable`}),(0,j.jsx)(`span`,{children:ue(V.reason)})]}));if(V._tag===`pending`){let t=V.startedAt??null,a=V.budgetMillis??V.reviewProfile.budgetMillis,o=V.state===`queued`?`Review queued`:V.state===`running`?`Reviewing exact head`:`Cancellation requested`;return $((0,j.jsxs)(`div`,{"aria-live":`polite`,className:k.reviewStatus,role:`status`,children:[(0,j.jsx)(`strong`,{children:o}),(0,j.jsxs)(`span`,{children:[z(V.providerId),` · `,Z(V.providerId,V.model),`. This page updates automatically.`]}),(0,j.jsxs)(`span`,{children:[me(V.reviewProfile.networkAccess,z(V.providerId)),` · Disposable sbx sandbox`]}),(0,j.jsxs)(`dl`,{children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Elapsed`}),(0,j.jsx)(`dd`,{children:t===null?`Waiting for worker`:Y(Math.max(0,m(g())-m(t)))})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Remaining budget`}),(0,j.jsx)(`dd`,{children:Y(t===null?a:Math.max(0,a-(m(g())-m(t))))})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Current step`}),(0,j.jsx)(`dd`,{children:V.activity.events.at(-1)??`Fetching exact source and starting the sandbox…`})]})]}),V.activity.events.length===0?null:(0,j.jsx)(`ol`,{"aria-label":`Live review activity`,children:V.activity.events.map((e,t)=>(0,j.jsx)(`li`,{children:e},`${String(t)}:${e}`))}),V.activity.truncated?(0,j.jsx)(`span`,{children:`Earlier review activity is not shown.`}):null,e?(0,j.jsxs)(`div`,{children:[V.budgetExtensionCount===0?(0,j.jsx)(i,{onClick:r,children:`Add ${Y(V.reviewProfile.budgetMillis)}`}):(0,j.jsx)(`span`,{children:`One budget extension used.`}),(0,j.jsx)(i,{onClick:n,children:`Cancel review`})]}):null,(0,j.jsx)(`code`,{className:k.reviewHead,children:V.subject.headRevision}),(0,j.jsx)(`span`,{"aria-hidden":`true`,className:k.reviewRunway})]}))}if(V._tag===`stale`){let t=V.previousState===`succeeded`;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{"aria-live":`polite`,className:k.reviewStatus,role:`status`,children:[(0,j.jsx)(`strong`,{children:`New head available`}),t?(0,j.jsx)(`span`,{children:`The last completed review belongs to an older immutable revision. Its findings cannot be published against the current head.`}):(0,j.jsx)(`span`,{children:`The previous review did not finish and belongs to an older immutable revision. Its retained findings are incomplete and cannot be published against the current head.`}),(0,j.jsxs)(`dl`,{children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Last reviewed`}),(0,j.jsx)(`dd`,{children:(0,j.jsx)(`code`,{children:V.previousHead})})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Current head`}),(0,j.jsx)(`dd`,{children:(0,j.jsx)(`code`,{children:V.subject.headRevision})})]})]}),(0,j.jsx)(Se,{orientation:V.previousReport.orientation}),V.previousReport.suggestions.length===0?(0,j.jsx)(`span`,{children:`The previous review retained no validated suggestions.`}):(0,j.jsx)(`ol`,{"aria-label":`Previous review findings`,className:k.reviewFindings,children:V.previousReport.suggestions.map(e=>(0,j.jsx)(`li`,{children:(0,j.jsx)(ee,{canPublish:!1,isPreviewing:!1,jobId:V.previousJobId,onPreviewPublication:()=>void 0,suggestion:e})},e.suggestionId))}),(0,j.jsx)(L,{notes:V.previousReport.notes}),(0,j.jsx)(`span`,{children:`Previous-head findings are read-only. Start a current-head review before publishing anything.`}),e?v.provider===null?(0,j.jsx)(`span`,{children:`Configure an sbx Review Agent Profile to review the new head.`}):(0,j.jsxs)(j.Fragment,{children:[Ee(V.subject.headRevision,`Review current head`),v.action===`failed`?(0,j.jsx)(`span`,{role:`alert`,children:`The current-head review could not be started. Check the provider and worker, then try again.`}):null]}):(0,j.jsx)(`span`,{children:`Only a workspace owner can start the new review.`})]}),Te]})}if(V._tag===`failed`){let t=V.report,n=V.failure??null;return $((0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`strong`,{children:V.state===`cancelled`?`Review cancelled`:n===null?`Review did not finish`:he(n.stage)}),V.state===`failed`&&n!==null?(0,j.jsx)(`span`,{children:_e(n)}):null,V.state===`failed`&&n!==null&&ge(n.cause)!==null?(0,j.jsxs)(`span`,{children:[`Cause: `,ge(n.cause)]}):null,t==null?(0,j.jsx)(`span`,{children:`The failed run did not change approval or publish a recommendation.`}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(s,{children:`This review is incomplete. The retained findings were validated before the run stopped; unreviewed areas remain.`}),(0,j.jsx)(Se,{orientation:t.orientation}),t.suggestions.length===0?(0,j.jsx)(`span`,{children:`No validated suggestions were retained before the run stopped.`}):(0,j.jsx)(`ol`,{className:k.reviewFindings,children:t.suggestions.map(t=>(0,j.jsx)(`li`,{children:(0,j.jsx)(le,{canEdit:e,entityId:v.entityId,isPreviewing:h._tag===`previewing`&&h.selection.suggestionId===t.suggestionId,jobId:V.jobId,onPreviewPublication:c,onTargetSuggestion:p,...f===void 0?{}:{onSuggestionRevisionAccepted:f},..._===void 0?{}:{revisionTransport:_},sessionKey:v.sessionKey,suggestion:t})},t.suggestionId))}),(0,j.jsx)(L,{notes:t.notes}),(0,j.jsx)(`span`,{children:`Retained findings remain advice only and may be published after confirmation.`})]}),e&&v.provider!==null?(0,j.jsxs)(j.Fragment,{children:[v.action===`failed`&&D===null?(0,j.jsx)(`span`,{role:`alert`,children:`A new full review could not be started. Check the provider and worker, then try again.`}):null,Ee(V.subject.headRevision,n?.retryable===!1?`Review again`:`Retry review`,!0)]}):null]}))}return V._tag===`interrupted`?$((0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`strong`,{children:`Review interrupted by restart`}),(0,j.jsx)(s,{children:`Control Center restarted before this run finished. The retained findings were validated before the run stopped; unreviewed areas remain.`}),(0,j.jsx)(Se,{orientation:V.report.orientation}),V.report.suggestions.length===0?(0,j.jsx)(`span`,{children:`No validated suggestions were retained before the run stopped.`}):(0,j.jsx)(`ol`,{className:k.reviewFindings,children:V.report.suggestions.map(t=>(0,j.jsx)(`li`,{children:(0,j.jsx)(le,{canEdit:e,entityId:v.entityId,isPreviewing:h._tag===`previewing`&&h.selection.suggestionId===t.suggestionId,jobId:V.jobId,onPreviewPublication:c,onTargetSuggestion:p,...f===void 0?{}:{onSuggestionRevisionAccepted:f},..._===void 0?{}:{revisionTransport:_},sessionKey:v.sessionKey,suggestion:t})},t.suggestionId))}),(0,j.jsx)(L,{notes:V.report.notes}),(0,j.jsx)(`span`,{children:`Retained findings remain advice only and may be published after confirmation.`}),e&&v.provider!==null?(0,j.jsxs)(j.Fragment,{children:[v.action===`failed`&&D===null?(0,j.jsx)(`span`,{role:`alert`,children:`A new full review could not be started. Check the provider and worker, then try again.`}):null,Ee(V.subject.headRevision,`Start a new review`)]}):null]})):V._tag===`completed`?$((0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`strong`,{children:de(V.outcome)}),V.report.completion.status===`unable-to-conclude`?(0,j.jsx)(s,{children:V.report.completion.reason}):null,(0,j.jsx)(Se,{orientation:V.report.orientation}),(y??V.report.suggestions).length===0?(0,j.jsx)(`span`,{children:`No validated suggestions were retained for this exact head.`}):(0,j.jsx)(`ol`,{className:k.reviewFindings,children:(y??V.report.suggestions).map(t=>(0,j.jsx)(`li`,{children:(0,j.jsx)(le,{canEdit:e,entityId:v.entityId,isPreviewing:h._tag===`previewing`&&h.selection.suggestionId===t.suggestionId,jobId:V.jobId,onPreviewPublication:c,onTargetSuggestion:p,...f===void 0?{}:{onSuggestionRevisionAccepted:f},..._===void 0?{}:{revisionTransport:_},sessionKey:v.sessionKey,suggestion:t})},t.suggestionId))}),(0,j.jsx)(L,{notes:V.report.notes}),(0,j.jsx)(`span`,{children:`Agent advice only. Preview and confirm a finding to post it to CodeCommit, or dismiss it locally.`})]})):$((0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`strong`,{children:`Agent review not run`}),(0,j.jsx)(`span`,{children:`An immutable-head review produces advice, never a human approval.`}),e?v.provider===null?(0,j.jsx)(`span`,{children:`PR review is not configured. Enable Codex, Claude, or an Effect AI review runner on the Control Center server. The workspace must allow that provider with Review sandbox and Isolated profile.`}):(0,j.jsx)(j.Fragment,{children:Ee(V.subject.headRevision,`Review exact head`)}):(0,j.jsx)(`span`,{children:`Only a workspace owner can start a review.`}),v.action===`failed`?(0,j.jsx)(`span`,{role:`alert`,children:`The review could not be started. Check provider and worker configuration, then retry.`}):null]}))};export{we as PullRequestReviewPanel,we as default};
|
|
8
|
-
//# sourceMappingURL=PullRequestReviewPanel-
|
|
7
|
+
`:``,c=Math.max(0,S-i.length-a.length),l=`${o}${e}${s}`.slice(0,c),u=`${i}${l}${a}`;C(u),E(i.length+l.length)},se=h._tag===`idle`||h._tag===`previewing`?null:(0,j.jsx)(N.Suspense,{fallback:(0,j.jsx)(`span`,{children:`Preparing publication surface…`}),children:(0,j.jsx)(xe,{onCancel:t,onPublish:u,publication:h})}),B=e=>(0,j.jsxs)(j.Fragment,{children:[e,se]});if(_._tag===`idle`||_._tag===`loading`)return B((0,j.jsxs)(`div`,{"aria-live":`polite`,className:k.reviewStatus,role:`status`,children:[(0,j.jsx)(`strong`,{children:`Loading review state`}),(0,j.jsx)(`span`,{children:`Checking durable review history for this exact head.`}),(0,j.jsx)(`span`,{"aria-hidden":`true`,className:k.reviewRunway})]}));if(_._tag===`failed`)return B((0,j.jsxs)(`div`,{className:k.reviewStatus,children:[(0,j.jsx)(`strong`,{children:`Review state unavailable`}),(0,j.jsx)(`span`,{children:`The current review could not be loaded. No human decision was changed.`}),(0,j.jsx)(a,{onClick:d,children:`Retry`})]}));let V=_.review,H=_.thread?.events??[],U=V._tag===`stale`?V.previousJobId:V._tag===`pending`||V._tag===`completed`||V._tag===`failed`||V._tag===`interrupted`?V.jobId:null,W=U===null?[]:H.filter(e=>e._tag===`usage`&&e.jobId===U),G=W.reduce((e,t)=>({inputTokens:e.inputTokens+t.inputTokens,outputTokens:e.outputTokens+t.outputTokens}),{inputTokens:0,outputTokens:0}),K=U===null?null:H.find(e=>e._tag===`run-queued`&&e.jobId===U),q=_.thread!==void 0&&(!_.thread.hasEarlier||K!=null),J=q?`Not reported`:`Load earlier history`,ce=H.map(e=>({event:e,summary:Ce(e)})).filter(e=>e.summary!==null),pe=_.thread!==void 0&&(_.thread.historyLoaded||!_.thread.hasEarlier)?ce:ce.slice(-12),Q=V._tag===`pending`,we=_.action===`starting`||Q,Te=(0,j.jsxs)(`section`,{"aria-label":`Review thread`,className:k.reviewThread,children:[(0,j.jsxs)(`header`,{children:[(0,j.jsx)(`strong`,{children:`Review thread`}),(0,j.jsx)(`span`,{children:H.length===0?`No runs yet`:`Durable across pull-request heads`})]}),U===null?null:(0,j.jsxs)(`dl`,{"aria-label":`Review run usage`,className:k.reviewUsage,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Agent`}),(0,j.jsx)(`dd`,{children:K==null?J:`${z(K.providerId)} · ${K.model===null?`model not reported`:Z(K.providerId,K.model)}`})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Input tokens`}),(0,j.jsx)(`dd`,{children:!q||W.length===0?J:G.inputTokens.toLocaleString(`en-US`)})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Output tokens`}),(0,j.jsx)(`dd`,{children:!q||W.length===0?J:G.outputTokens.toLocaleString(`en-US`)})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Cost`}),(0,j.jsx)(`dd`,{children:`Not reported`})]})]}),(0,j.jsx)(be,{events:pe,hasEarlier:_.thread?.hasEarlier??!1,historyAction:_.historyAction,historyLoaded:_.thread!==void 0,onLoadEarlier:i},te),e&&_.provider!==null&&V._tag!==`unavailable`?(0,j.jsxs)(`div`,{className:k.reviewThreadComposer,children:[(0,j.jsx)(`label`,{htmlFor:`review-thread-request`,children:Q?`Draft the next review request`:`Ask Relay about this pull request`}),I.length>1?R===null?null:(0,j.jsx)(ye,{accessibleName:`Targeted review agent presets`,groupName:`targeted-review-agent`,onSelect:M,presets:I,selectedProviderId:R.providerId}):R===null?null:(0,j.jsxs)(`span`,{className:k.reviewSelectedPreset,children:[`Review with `,X(R),` ·`,` `,Z(R.providerId,R.model)]}),(0,j.jsx)(`div`,{"aria-label":`Review prompt templates`,className:k.reviewTemplateList,children:ve.map(e=>(0,j.jsx)(a,{onClick:()=>oe(e.prompt),children:e.label},e.label))}),(0,j.jsx)(`textarea`,{"aria-describedby":`review-thread-request-help review-thread-request-count`,id:`review-thread-request`,maxLength:S,onChange:e=>C(e.currentTarget.value),onKeyDown:ae,placeholder:`Re-check the error handling in the connection flow…`,ref:P,rows:3,value:x}),(0,j.jsxs)(`div`,{className:k.reviewThreadComposerFooter,children:[(0,j.jsx)(`span`,{id:`review-thread-request-help`,children:`Ctrl/⌘ + Enter to run`}),(0,j.jsxs)(`span`,{id:`review-thread-request-count`,children:[String(x.length),` / `,String(S)]})]}),_.action===`failed`&&D!==null?(0,j.jsx)(`span`,{role:`alert`,children:`Targeted review did not start. Your request is still here—check the provider and worker, then try again.`}):null,(0,j.jsx)(a,{disabled:we||x.trim().length===0,onClick:ie,children:_.action===`starting`?`Starting targeted review…`:Q?`Review in progress`:`Start targeted review`})]}):null]}),$=e=>B((0,j.jsxs)(j.Fragment,{children:[e,Te]})),Ee=(e,t,n=!1)=>R===null?null:(0,j.jsxs)(o.Root,{onOpenChange:ne,open:y,children:[(0,j.jsx)(o.Trigger,{disabled:_.action===`starting`,children:_.action===`starting`?`Starting review…`:t}),(0,j.jsx)(o.Content,{className:k.reviewLaunchDialog,description:`${X(R)} can inspect and temporarily edit the disposable checkout. It cannot approve, comment on, or change this CodeCommit pull request.`,title:n?`Review this exact head again`:`Review this exact head`,children:(0,j.jsxs)(`div`,{className:k.reviewLaunchBody,children:[(0,j.jsx)(`small`,{className:k.reviewLaunchEyebrow,children:`No CodeCommit writes`}),I.length>1?(0,j.jsx)(ye,{accessibleName:`Review agent presets`,groupName:`full-review-agent`,onSelect:M,presets:I,selectedProviderId:R.providerId}):null,(0,j.jsxs)(`dl`,{className:k.reviewLaunchFacts,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Exact head`}),(0,j.jsx)(`dd`,{children:(0,j.jsx)(`code`,{children:e})})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Agent`}),(0,j.jsx)(`dd`,{children:X(R)})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Model`}),(0,j.jsx)(`dd`,{children:Z(R.providerId,R.model)})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Scope`}),(0,j.jsx)(`dd`,{children:`Full project`})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Budget`}),(0,j.jsx)(`dd`,{children:Y(R.reviewProfile.budgetMillis)})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Network`}),(0,j.jsx)(`dd`,{children:me(R.reviewProfile.networkAccess,X(R))})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Isolation`}),(0,j.jsx)(`dd`,{children:`Disposable sbx sandbox`})]})]}),(0,j.jsxs)(`div`,{className:k.reviewLaunchActions,children:[(0,j.jsx)(o.Close,{children:`Cancel`}),(0,j.jsx)(o.Close,{onClick:re,children:`Start full-project review`})]})]})})]});if(V._tag===`unavailable`)return $((0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`strong`,{children:`Review unavailable`}),(0,j.jsx)(`span`,{children:ue(V.reason)})]}));if(V._tag===`pending`){let t=V.startedAt??null,i=V.budgetMillis??V.reviewProfile.budgetMillis,o=V.state===`queued`?`Review queued`:V.state===`running`?`Reviewing exact head`:`Cancellation requested`;return $((0,j.jsxs)(`div`,{"aria-live":`polite`,className:k.reviewStatus,role:`status`,children:[(0,j.jsx)(`strong`,{children:o}),(0,j.jsxs)(`span`,{children:[z(V.providerId),` · `,Z(V.providerId,V.model),`. This page updates automatically.`]}),(0,j.jsxs)(`span`,{children:[me(V.reviewProfile.networkAccess,z(V.providerId)),` · Disposable sbx sandbox`]}),(0,j.jsxs)(`dl`,{children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Elapsed`}),(0,j.jsx)(`dd`,{children:t===null?`Waiting for worker`:Y(Math.max(0,T(c())-T(t)))})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Remaining budget`}),(0,j.jsx)(`dd`,{children:Y(t===null?i:Math.max(0,i-(T(c())-T(t))))})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Current step`}),(0,j.jsx)(`dd`,{children:V.activity.events.at(-1)??`Fetching exact source and starting the sandbox…`})]})]}),V.activity.events.length===0?null:(0,j.jsx)(`ol`,{"aria-label":`Live review activity`,children:V.activity.events.map((e,t)=>(0,j.jsx)(`li`,{children:e},`${String(t)}:${e}`))}),V.activity.truncated?(0,j.jsx)(`span`,{children:`Earlier review activity is not shown.`}):null,e?(0,j.jsxs)(`div`,{children:[V.budgetExtensionCount===0?(0,j.jsx)(a,{onClick:r,children:`Add ${Y(V.reviewProfile.budgetMillis)}`}):(0,j.jsx)(`span`,{children:`One budget extension used.`}),(0,j.jsx)(a,{onClick:n,children:`Cancel review`})]}):null,(0,j.jsx)(`code`,{className:k.reviewHead,children:V.subject.headRevision}),(0,j.jsx)(`span`,{"aria-hidden":`true`,className:k.reviewRunway})]}))}if(V._tag===`stale`){let t=V.previousState===`succeeded`;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{"aria-live":`polite`,className:k.reviewStatus,role:`status`,children:[(0,j.jsx)(`strong`,{children:`New head available`}),t?(0,j.jsx)(`span`,{children:`The last completed review belongs to an older immutable revision. Its findings cannot be published against the current head.`}):(0,j.jsx)(`span`,{children:`The previous review did not finish and belongs to an older immutable revision. Its retained findings are incomplete and cannot be published against the current head.`}),(0,j.jsxs)(`dl`,{children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Last reviewed`}),(0,j.jsx)(`dd`,{children:(0,j.jsx)(`code`,{children:V.previousHead})})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Current head`}),(0,j.jsx)(`dd`,{children:(0,j.jsx)(`code`,{children:V.subject.headRevision})})]})]}),(0,j.jsx)(Se,{orientation:V.previousReport.orientation}),V.previousReport.suggestions.length===0?(0,j.jsx)(`span`,{children:`The previous review retained no validated suggestions.`}):(0,j.jsx)(`ol`,{"aria-label":`Previous review findings`,className:k.reviewFindings,children:V.previousReport.suggestions.map(e=>(0,j.jsx)(`li`,{children:(0,j.jsx)(ee,{canPublish:!1,isPreviewing:!1,jobId:V.previousJobId,onPreviewPublication:()=>void 0,suggestion:e})},e.suggestionId))}),(0,j.jsx)(L,{notes:V.previousReport.notes}),(0,j.jsx)(`span`,{children:`Previous-head findings are read-only. Start a current-head review before publishing anything.`}),e?_.provider===null?(0,j.jsx)(`span`,{children:`Configure an sbx Review Agent Profile to review the new head.`}):(0,j.jsxs)(j.Fragment,{children:[Ee(V.subject.headRevision,`Review current head`),_.action===`failed`?(0,j.jsx)(`span`,{role:`alert`,children:`The current-head review could not be started. Check the provider and worker, then try again.`}):null]}):(0,j.jsx)(`span`,{children:`Only a workspace owner can start the new review.`})]}),Te]})}if(V._tag===`failed`){let t=V.report,n=V.failure??null;return $((0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`strong`,{children:V.state===`cancelled`?`Review cancelled`:n===null?`Review did not finish`:he(n.stage)}),V.state===`failed`&&n!==null?(0,j.jsx)(`span`,{children:_e(n)}):null,V.state===`failed`&&n!==null&&ge(n.cause)!==null?(0,j.jsxs)(`span`,{children:[`Cause: `,ge(n.cause)]}):null,t==null?(0,j.jsx)(`span`,{children:`The failed run did not change approval or publish a recommendation.`}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(s,{children:`This review is incomplete. The retained findings were validated before the run stopped; unreviewed areas remain.`}),(0,j.jsx)(Se,{orientation:t.orientation}),t.suggestions.length===0?(0,j.jsx)(`span`,{children:`No validated suggestions were retained before the run stopped.`}):(0,j.jsx)(`ol`,{className:k.reviewFindings,children:t.suggestions.map(t=>(0,j.jsx)(`li`,{children:(0,j.jsx)(le,{canEdit:e,entityId:_.entityId,isPreviewing:h._tag===`previewing`&&h.selection.suggestionId===t.suggestionId,jobId:V.jobId,onPreviewPublication:l,onTargetSuggestion:m,...p===void 0?{}:{onSuggestionRevisionAccepted:p},...g===void 0?{}:{revisionTransport:g},sessionKey:_.sessionKey,suggestion:t})},t.suggestionId))}),(0,j.jsx)(L,{notes:t.notes}),(0,j.jsx)(`span`,{children:`Retained findings remain advice only and may be published after confirmation.`})]}),e&&_.provider!==null?(0,j.jsxs)(j.Fragment,{children:[_.action===`failed`&&D===null?(0,j.jsx)(`span`,{role:`alert`,children:`A new full review could not be started. Check the provider and worker, then try again.`}):null,Ee(V.subject.headRevision,n?.retryable===!1?`Review again`:`Retry review`,!0)]}):null]}))}return V._tag===`interrupted`?$((0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`strong`,{children:`Review interrupted by restart`}),(0,j.jsx)(s,{children:`Control Center restarted before this run finished. The retained findings were validated before the run stopped; unreviewed areas remain.`}),(0,j.jsx)(Se,{orientation:V.report.orientation}),V.report.suggestions.length===0?(0,j.jsx)(`span`,{children:`No validated suggestions were retained before the run stopped.`}):(0,j.jsx)(`ol`,{className:k.reviewFindings,children:V.report.suggestions.map(t=>(0,j.jsx)(`li`,{children:(0,j.jsx)(le,{canEdit:e,entityId:_.entityId,isPreviewing:h._tag===`previewing`&&h.selection.suggestionId===t.suggestionId,jobId:V.jobId,onPreviewPublication:l,onTargetSuggestion:m,...p===void 0?{}:{onSuggestionRevisionAccepted:p},...g===void 0?{}:{revisionTransport:g},sessionKey:_.sessionKey,suggestion:t})},t.suggestionId))}),(0,j.jsx)(L,{notes:V.report.notes}),(0,j.jsx)(`span`,{children:`Retained findings remain advice only and may be published after confirmation.`}),e&&_.provider!==null?(0,j.jsxs)(j.Fragment,{children:[_.action===`failed`&&D===null?(0,j.jsx)(`span`,{role:`alert`,children:`A new full review could not be started. Check the provider and worker, then try again.`}):null,Ee(V.subject.headRevision,`Start a new review`)]}):null]})):V._tag===`completed`?$((0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`strong`,{children:de(V.outcome)}),V.report.completion.status===`unable-to-conclude`?(0,j.jsx)(s,{children:V.report.completion.reason}):null,(0,j.jsx)(Se,{orientation:V.report.orientation}),(v??V.report.suggestions).length===0?(0,j.jsx)(`span`,{children:`No validated suggestions were retained for this exact head.`}):(0,j.jsx)(`ol`,{className:k.reviewFindings,children:(v??V.report.suggestions).map(t=>(0,j.jsx)(`li`,{children:(0,j.jsx)(le,{canEdit:e,entityId:_.entityId,isPreviewing:h._tag===`previewing`&&h.selection.suggestionId===t.suggestionId,jobId:V.jobId,onPreviewPublication:l,onTargetSuggestion:m,...p===void 0?{}:{onSuggestionRevisionAccepted:p},...g===void 0?{}:{revisionTransport:g},sessionKey:_.sessionKey,suggestion:t})},t.suggestionId))}),(0,j.jsx)(L,{notes:V.report.notes}),(0,j.jsx)(`span`,{children:`Agent advice only. Preview and confirm a finding to post it to CodeCommit, or dismiss it locally.`})]})):$((0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`strong`,{children:`Agent review not run`}),(0,j.jsx)(`span`,{children:`An immutable-head review produces advice, never a human approval.`}),e?_.provider===null?(0,j.jsx)(`span`,{children:`PR review is not configured. Enable Codex, Claude, or an Effect AI review runner on the Control Center server. The workspace must allow that provider with Review sandbox and Isolated profile.`}):(0,j.jsx)(j.Fragment,{children:Ee(V.subject.headRevision,`Review exact head`)}):(0,j.jsx)(`span`,{children:`Only a workspace owner can start a review.`}),_.action===`failed`?(0,j.jsx)(`span`,{role:`alert`,children:`The review could not be started. Check provider and worker configuration, then retry.`}):null]}))};export{we as PullRequestReviewPanel,we as default};
|
|
8
|
+
//# sourceMappingURL=PullRequestReviewPanel-DwVYuZ8Q.js.map
|