@knpkv/control-center 0.8.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/dist/client/.vite/manifest.json +66 -66
  2. package/dist/client/assets/ActiveWorkPage-DKlotZGc.js +2 -0
  3. package/dist/client/assets/{ActiveWorkPage-C6lIQfjL.js.map → ActiveWorkPage-DKlotZGc.js.map} +1 -1
  4. package/dist/client/assets/{AgentPage-DqB5BilE.js → AgentPage-Cxm1gj2C.js} +3 -3
  5. package/dist/client/assets/{AgentPage-DqB5BilE.js.map → AgentPage-Cxm1gj2C.js.map} +1 -1
  6. package/dist/client/assets/{AtlassianOAuthCallbackPage-DzTO6SqN.js → AtlassianOAuthCallbackPage-fEFUJE2g.js} +2 -2
  7. package/dist/client/assets/{AtlassianOAuthCallbackPage-DzTO6SqN.js.map → AtlassianOAuthCallbackPage-fEFUJE2g.js.map} +1 -1
  8. package/dist/client/assets/{AuthorizedSharePage-V_E5giT7.js → AuthorizedSharePage-Dh7Y_gmJ.js} +2 -2
  9. package/dist/client/assets/{AuthorizedSharePage-V_E5giT7.js.map → AuthorizedSharePage-Dh7Y_gmJ.js.map} +1 -1
  10. package/dist/client/assets/{BrowserSessionHydrator-CEypgMkR.js → BrowserSessionHydrator-DkomS8Yl.js} +2 -2
  11. package/dist/client/assets/{BrowserSessionHydrator-CEypgMkR.js.map → BrowserSessionHydrator-DkomS8Yl.js.map} +1 -1
  12. package/dist/client/assets/{CommandSearch-syQMt_rx.js → CommandSearch-nf16HEqz.js} +2 -2
  13. package/dist/client/assets/{CommandSearch-syQMt_rx.js.map → CommandSearch-nf16HEqz.js.map} +1 -1
  14. package/dist/client/assets/{ItemsPage-Cr3--iJc.js → ItemsPage-Bok8Vpy4.js} +2 -2
  15. package/dist/client/assets/{ItemsPage-Cr3--iJc.js.map → ItemsPage-Bok8Vpy4.js.map} +1 -1
  16. package/dist/client/assets/{OpenPullRequestPage-BYoRmtui.js → OpenPullRequestPage-DdL7PhKZ.js} +2 -2
  17. package/dist/client/assets/{OpenPullRequestPage-BYoRmtui.js.map → OpenPullRequestPage-DdL7PhKZ.js.map} +1 -1
  18. package/dist/client/assets/{PairPage-ByOBKuBB.js → PairPage-BCtzYqK6.js} +2 -2
  19. package/dist/client/assets/{PairPage-ByOBKuBB.js.map → PairPage-BCtzYqK6.js.map} +1 -1
  20. package/dist/client/assets/{PortfolioOverview-BacOXO-c.js → PortfolioOverview-C-jqvYgQ.js} +2 -2
  21. package/dist/client/assets/{PortfolioOverview-BacOXO-c.js.map → PortfolioOverview-C-jqvYgQ.js.map} +1 -1
  22. package/dist/client/assets/{ReleaseRoute-C-MfQKnL.js → ReleaseRoute-cuvP4ug5.js} +2 -2
  23. package/dist/client/assets/{ReleaseRoute-C-MfQKnL.js.map → ReleaseRoute-cuvP4ug5.js.map} +1 -1
  24. package/dist/client/assets/{ReleaseWorkset-MV3I0HCi.js → ReleaseWorkset-DImwmjS3.js} +2 -2
  25. package/dist/client/assets/{ReleaseWorkset-MV3I0HCi.js.map → ReleaseWorkset-DImwmjS3.js.map} +1 -1
  26. package/dist/client/assets/{ServicesPage-BjeCOlsh.js → ServicesPage-CrM8R820.js} +2 -2
  27. package/dist/client/assets/{ServicesPage-BjeCOlsh.js.map → ServicesPage-CrM8R820.js.map} +1 -1
  28. package/dist/client/assets/{TimelinePage-Ccnp6Mmg.js → TimelinePage-FrvepGa_.js} +2 -2
  29. package/dist/client/assets/{TimelinePage-Ccnp6Mmg.js.map → TimelinePage-FrvepGa_.js.map} +1 -1
  30. package/dist/client/assets/{WorkspaceEntityLink-D3TXDcD0.js → WorkspaceEntityLink-CAj42f02.js} +2 -2
  31. package/dist/client/assets/{WorkspaceEntityLink-D3TXDcD0.js.map → WorkspaceEntityLink-CAj42f02.js.map} +1 -1
  32. package/dist/client/assets/WorkspaceEntityRoute-rQ9ccetx.js +14 -0
  33. package/dist/client/assets/{WorkspaceEntityRoute-uUK6vwM_.js.map → WorkspaceEntityRoute-rQ9ccetx.js.map} +1 -1
  34. package/dist/client/assets/WorkspaceHomeLink-ObQ3AQVw.js +2 -0
  35. package/dist/client/assets/{WorkspaceHomeLink-D5SdEgJJ.js.map → WorkspaceHomeLink-ObQ3AQVw.js.map} +1 -1
  36. package/dist/client/assets/{WorkspacePullRequestDetails-CKedGIT8.js → WorkspacePullRequestDetails-BhxoqR7V.js} +2 -2
  37. package/dist/client/assets/{WorkspacePullRequestDetails-CKedGIT8.js.map → WorkspacePullRequestDetails-BhxoqR7V.js.map} +1 -1
  38. package/dist/client/assets/{WorkspaceReleaseLayout-Bdvl0q99.js → WorkspaceReleaseLayout-BWL66Fff.js} +2 -2
  39. package/dist/client/assets/{WorkspaceReleaseLayout-Bdvl0q99.js.map → WorkspaceReleaseLayout-BWL66Fff.js.map} +1 -1
  40. package/dist/client/assets/{WorkspaceSettingsPage-BxFq65Vf.js → WorkspaceSettingsPage-DutfiGPe.js} +2 -2
  41. package/dist/client/assets/{WorkspaceSettingsPage-BxFq65Vf.js.map → WorkspaceSettingsPage-DutfiGPe.js.map} +1 -1
  42. package/dist/client/assets/{controlCenterRelayDock-D7375HPG.js → controlCenterRelayDock-CyYeXh75.js} +3 -3
  43. package/dist/client/assets/{controlCenterRelayDock-D7375HPG.js.map → controlCenterRelayDock-CyYeXh75.js.map} +1 -1
  44. package/dist/client/assets/{controlCenterRelayDockChrome-B7jSUI3t.js → controlCenterRelayDockChrome-upgtq649.js} +2 -2
  45. package/dist/client/assets/{controlCenterRelayDockChrome-B7jSUI3t.js.map → controlCenterRelayDockChrome-upgtq649.js.map} +1 -1
  46. package/dist/client/assets/{index-BVikncBH.js → index-kmYFvwT0.js} +3 -3
  47. package/dist/client/assets/{index-BVikncBH.js.map → index-kmYFvwT0.js.map} +1 -1
  48. package/dist/client/assets/patterns-DuFUSnJW.js +2 -0
  49. package/dist/client/assets/patterns-DuFUSnJW.js.map +1 -0
  50. package/dist/client/assets/{useWorkspaceDefaultLanding-DMWfrZfF.js → useWorkspaceDefaultLanding-BmaR7aTj.js} +2 -2
  51. package/dist/client/assets/{useWorkspaceDefaultLanding-DMWfrZfF.js.map → useWorkspaceDefaultLanding-BmaR7aTj.js.map} +1 -1
  52. package/dist/client/assets/{workspaceEntityRoutes-BJ-SC0Jd.js → workspaceEntityRoutes-BHccxrFj.js} +2 -2
  53. package/dist/client/assets/{workspaceEntityRoutes-BJ-SC0Jd.js.map → workspaceEntityRoutes-BHccxrFj.js.map} +1 -1
  54. package/dist/client/assets/{workspaceScrollCapture-CwBIBHg8.js → workspaceScrollCapture-BzsNJoL7.js} +2 -2
  55. package/dist/client/assets/{workspaceScrollCapture-CwBIBHg8.js.map → workspaceScrollCapture-BzsNJoL7.js.map} +1 -1
  56. package/dist/client/index.html +1 -1
  57. package/dist/server/assets/{BindConfig-D8aIjI_R.js → BindConfig-BG-FGtB5.js} +13 -4
  58. package/dist/server/assets/BindConfig-BG-FGtB5.js.map +1 -0
  59. package/dist/server/server/cli.js +1 -1
  60. package/dist/server/server/index.js +1 -1
  61. package/package.json +5 -5
  62. package/dist/client/assets/ActiveWorkPage-C6lIQfjL.js +0 -2
  63. package/dist/client/assets/WorkspaceEntityRoute-uUK6vwM_.js +0 -14
  64. package/dist/client/assets/WorkspaceHomeLink-D5SdEgJJ.js +0 -2
  65. package/dist/client/assets/patterns-DAeEdyxU.js +0 -2
  66. package/dist/client/assets/patterns-DAeEdyxU.js.map +0 -1
  67. package/dist/server/assets/BindConfig-D8aIjI_R.js.map +0 -1
@@ -0,0 +1,2 @@
1
+ import{n as e}from"./lib-6h955hh9.js";import{t}from"./jsx-runtime-NZYk81nU.js";import{t as n}from"./useWorkspaceDefaultLanding-BmaR7aTj.js";var r=t(),i=({children:t,className:i,fallbackPath:a,workspaceId:o})=>{let s=n(o);return(0,r.jsx)(e,{className:i,to:s??a,children:t})};export{i as WorkspaceHomeLink};
2
+ //# sourceMappingURL=WorkspaceHomeLink-ObQ3AQVw.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"WorkspaceHomeLink-D5SdEgJJ.js","names":[],"sources":["../../../src/client/settings/WorkspaceHomeLink.tsx"],"sourcesContent":["import type { ReactElement, ReactNode } from \"react\"\nimport { NavLink } from \"react-router\"\n\nimport type { WorkspaceId } from \"../../domain/identifiers.js\"\nimport { useWorkspaceDefaultLandingPath } from \"./useWorkspaceDefaultLanding.js\"\n\nexport interface WorkspaceHomeLinkProps {\n readonly children: ReactNode\n readonly className: string\n readonly fallbackPath: string\n readonly workspaceId: WorkspaceId\n}\n\n/** Brand navigation that resolves the workspace-owned presentation default lazily. */\nexport const WorkspaceHomeLink = ({\n children,\n className,\n fallbackPath,\n workspaceId\n}: WorkspaceHomeLinkProps): ReactElement => {\n const defaultLandingPath = useWorkspaceDefaultLandingPath(workspaceId)\n return (\n <NavLink className={className} to={defaultLandingPath ?? fallbackPath}>\n {children}\n </NavLink>\n )\n}\n"],"mappings":"sJAca,GAAqB,CAChC,WACA,YACA,eACA,iBAC0C,CAC1C,IAAM,EAAqB,EAA+B,CAAW,EACrE,OACE,EAAA,EAAA,IAAA,CAAC,EAAD,CAAoB,YAAW,GAAI,GAAsB,EACtD,UACM,CAAA,CAEb"}
1
+ {"version":3,"file":"WorkspaceHomeLink-ObQ3AQVw.js","names":[],"sources":["../../../src/client/settings/WorkspaceHomeLink.tsx"],"sourcesContent":["import type { ReactElement, ReactNode } from \"react\"\nimport { NavLink } from \"react-router\"\n\nimport type { WorkspaceId } from \"../../domain/identifiers.js\"\nimport { useWorkspaceDefaultLandingPath } from \"./useWorkspaceDefaultLanding.js\"\n\nexport interface WorkspaceHomeLinkProps {\n readonly children: ReactNode\n readonly className: string\n readonly fallbackPath: string\n readonly workspaceId: WorkspaceId\n}\n\n/** Brand navigation that resolves the workspace-owned presentation default lazily. */\nexport const WorkspaceHomeLink = ({\n children,\n className,\n fallbackPath,\n workspaceId\n}: WorkspaceHomeLinkProps): ReactElement => {\n const defaultLandingPath = useWorkspaceDefaultLandingPath(workspaceId)\n return (\n <NavLink className={className} to={defaultLandingPath ?? fallbackPath}>\n {children}\n </NavLink>\n )\n}\n"],"mappings":"sJAca,GAAqB,CAChC,WACA,YACA,eACA,iBAC0C,CAC1C,IAAM,EAAqB,EAA+B,CAAW,EACrE,OACE,EAAA,EAAA,IAAA,CAAC,EAAD,CAAoB,YAAW,GAAI,GAAsB,EACtD,UACM,CAAA,CAEb"}
@@ -1,3 +1,3 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/diff-18-fMaVc.js","assets/rolldown-runtime-hePW80VL.js","assets/react-CwJFpaho.js","assets/loader-circle-Dem7LJJw.js","assets/preload-helper-Czpn1I53.js","assets/jsx-runtime-NZYk81nU.js","assets/workbench-4C25n_BY-DcOIwxZW.js","assets/component-DKy8kjZl-DJ62HeaY.js","assets/rolldown-runtime-B0aSnxlc-WE5nrRaW.js","assets/DiffLineFocus-Cs87hlsH.js","assets/ReviewSuggestionOverview-DfYo6Ute.js","assets/WorkspacePullRequestDiff.module-DJEWRmoT.js","assets/WorkspacePullRequestDiff-HJB-ezE4.css","assets/PullRequestReviewPanel-DwVYuZ8Q.js","assets/Dialog-DSwimdwG-BeHnBpPp.js","assets/PortalProvider-CN_81Fy3-D_japesx.js","assets/primitives-DYGtIZqB-r-Glkv2i.js","assets/agent-api-CUWP1qs8.js","assets/client-D3WRV6yl.js","assets/Domain-cJ5aJFpE.js","assets/authenticatedMutationClient-Bc_-Jpbo.js","assets/WorkspacePullRequestDetails.module-Bl8z_AMw.js","assets/WorkspacePullRequestDetails-q_Ngh_tB.css","assets/reviewPlatformAdapter-Duu9pLcg.js"])))=>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{n as i,r as a,t as ee}from"./workbench-4C25n_BY-DcOIwxZW.js";import{i as o}from"./patterns-DAeEdyxU.js";import{n as s}from"./primitives-DYGtIZqB-r-Glkv2i.js";import{$a as c,$i as l,Aa as u,Ba as d,Da as f,Ea as p,Fa as m,Ga as h,Ha as g,Ma as _,Oa as v,Pa as y,Ti as b,Ua as x,Ur as S,Va as C,Wa as w,Ya as T,Za as E,_a as D,_i as O,ea as k,eo as A,fa as j,ga as M,ha as N,ja as P,ki as F,ma as I,oa as te,ta as ne,za as L}from"./agent-api-CUWP1qs8.js";import{a as R,t as z}from"./client-D3WRV6yl.js";import{t as B}from"./WorkspacePullRequestDetails.module-Bl8z_AMw.js";import{t as re}from"./WorkspacePullRequestDiff.module-DJEWRmoT.js";import{t as V}from"./WorkspaceRichText-Beh64wsV.js";var H={"~effect/match/Match/Matcher":{_input:c,_filters:c,_remaining:c,_result:c,_return:c},_tag:`TypeMatcher`,add(e){return U([...this.cases,e])},pipe(){return A(this,arguments)}};function U(e){let t=Object.create(H);return t.cases=e,t}var W=(e,t)=>({_tag:`When`,guard:e,evaluate:t}),G=e=>{if(typeof e==`function`)return e;if(Array.isArray(e)){let t=e.map(G),n=t.length;return e=>{if(!Array.isArray(e))return!1;for(let r=0;r<n;r++)if(t[r](e[r])===!1)return!1;return!0}}if(typeof e==`object`&&e){let t=Reflect.ownKeys(e).map(t=>[t,G(e[t])]),n=t.length;return e=>{if(typeof e!=`object`||!e)return!1;for(let r=0;r<n;r++){let[n,i]=t[r];if(!(n in e)||i(e[n])===!1)return!1}return!0}}return t=>t===e},ie=()=>U([]),K=(e,t)=>n=>n.add(W(G(e),t)),ae=e=>t=>{let n=q(t);return N(n)?n._tag===`Success`?n.success:e(n.failure):t=>{let r=n(t);return M(r)?r.success:e(r.failure)}},q=e=>{if(e._tag===`ValueMatcher`)return e.value;let t=e.cases.length;if(t===1){let t=e.cases[0];return e=>t._tag===`When`&&t.guard(e)===!0||t._tag===`Not`&&t.guard(e)===!1?D(t.evaluate(e)):j(e)}return n=>{for(let r=0;r<t;r++){let t=e.cases[r];if(t._tag===`When`&&t.guard(n)===!0||t._tag===`Not`&&t.guard(n)===!1)return D(t.evaluate(n))}return j(n)}},J=ie,oe=K,se=ae,ce={"~effect/reactivity/AsyncResult":{E:c,A:c},pipe(){return A(this,arguments)},[d](e){if(this._tag!==e._tag||this.waiting!==e.waiting)return!1;switch(this._tag){case`Initial`:return!0;case`Success`:return L(this.value,e.value);case`Failure`:return L(this.cause,e.cause)}},[w](){let e=x(`${this._tag}:${this.waiting}`);return this._tag===`Initial`?e:C(e)(this._tag===`Success`?g(this.value):g(this.cause))}},le=e=>e._tag===`Initial`,ue=(e=!1)=>{let t=Object.create(ce);return t._tag=`Initial`,t.waiting=e,t},de=e=>e._tag===`Success`,fe=(e,t)=>{let n=Object.create(ce);return n._tag=`Success`,n.value=e,n.waiting=t?.waiting??!1,n.timestamp=t?.timestamp??Date.now(),n},Y=e=>e._tag===`Failure`,pe=e=>new me(e),me=class{constructor(e){this.result=e}result;output=y();when(e,t){if(u(this.output)&&e(this.result)){let e=t(this.result);P(e)&&(this.output=e)}return this}pipe(){return A(this,arguments)}onWaiting(e){return this.when(e=>e.waiting,t=>m(e(t)))}onInitialOrWaiting(e){return this.when(e=>le(e)||e.waiting,t=>m(e(t)))}onInitial(e){return this.when(le,t=>m(e(t)))}onSuccess(e){return this.when(de,t=>m(e(t.value,t)))}onFailure(e){return this.when(Y,t=>m(e(t.cause,t)))}onError(e){return this.onErrorIf(E,e)}onErrorIf(e,t){return this.when(Y,n=>ne(n.cause).pipe(p(e),_(e=>t(e,n))))}onErrorTag(e,t){return this.onErrorIf(t=>h(t,`_tag`)&&(Array.isArray(e)?e.includes(t._tag):t._tag===e),t)}onDefect(e){return this.when(Y,t=>{let n=k(t.cause);return I(n)?y():m(e(n.success,t))})}onInterrupt(e){return this.when(Y,t=>{let n=l(t.cause);return I(n)?y():m(e(n.success,t))})}orElse(e){return f(this.output,e)}orNull(){return v(this.output)}render(){if(P(this.output))return this.output.value;if(Y(this.result))throw te(this.result.cause);return null}exhaustive(){return this.render()}},X=e(t(),1),Z=r(),he=(0,X.lazy)(async()=>{let e=await n(()=>import(`./diff-18-fMaVc.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8]));return{default:(0,X.forwardRef)((t,n)=>(0,Z.jsx)(e.DiffWorkerProvider,{poolSize:2,children:(0,Z.jsx)(e.DiffCodeView,{...t,ref:n})}))}}),ge=(0,X.lazy)(async()=>({default:(await n(()=>import(`./DiffLineFocus-Cs87hlsH.js`),__vite__mapDeps([9,1,2]))).DiffLineFocus})),_e=(0,X.lazy)(async()=>({default:(await n(()=>import(`./ReviewSuggestionOverview-DfYo6Ute.js`),__vite__mapDeps([10,5,1,11,12]))).ReviewSuggestionOverview})),ve={inventory:(e,t)=>F(O(function*(){return yield*(yield*z()).diff.inventory({params:{pluginConnectionId:e.pluginConnectionId,vendorImmutableId:e.vendorImmutableId},query:{revision:e.revision}})}).pipe(b(R)),{signal:t}),content:(e,t,n,r)=>F(O(function*(){return yield*(yield*z()).diff.content({params:{pluginConnectionId:e.pluginConnectionId,vendorImmutableId:e.vendorImmutableId},payload:{revision:e.revision,anchor:t.anchor,path:t.path,status:t.status,previousPath:t.previousPath,side:n,offset:0,length:1048576}})}).pipe(b(R)),{signal:r})},ye=e=>void 0,be=T(`UnauthorizedApiError`),xe=(e,t)=>{switch(t){case`all`:case`agent`:return!0;case`human`:return!1;case`unresolved`:return e.state!==`dismissed`&&e.state!==`resolved`}},Se=e=>e.binary?{state:`binary`,reason:`CodeCommit reports binary content.`}:e.generated?{state:`generated`,reason:`Generated content is indexed but not rendered.`}:e.oversized?{state:`oversized`,reason:`Content exceeds the bounded renderer limit.`}:{state:`ready`},Ce=e=>{switch(e){case`binary`:return{state:`binary`,reason:`Binary content is indexed but not rendered.`};case`generated`:return{state:`generated`,reason:`Generated content is indexed but not rendered.`};case`oversized`:return{state:`oversized`,reason:`Content exceeds the one MiB renderer limit.`};case`missing`:return{state:`unavailable`,reason:`This side is not present at the immutable revision.`};case`provider-unavailable`:return{state:`unavailable`,reason:`CodeCommit content is temporarily unavailable.`}}},Q=(e,t)=>t.relativeFileVersion===`BEFORE`?e.find(e=>e.status===`renamed`&&e.previousPath!==null&&String(e.previousPath)===String(t.path))??e.find(({path:e})=>String(e)===String(t.path)):e.find(({path:e})=>String(e)===String(t.path)),we=e=>{if(e.unavailableReason!==null||e.bytesBase64===null)return null;let t=S(e.bytesBase64);return t._tag===`Failure`?null:new TextDecoder().decode(t.success)},Te=(e,t)=>e.status===`renamed`&&e.previousPath!==null?{id:e.anchor,path:e.path,previousPath:e.previousPath,change:`renamed`,content:t}:{id:e.anchor,path:e.path,change:e.status===`copied`?`added`:e.status===`renamed`?`modified`:e.status,content:t},Ee=({heading:e,onSessionExpired:t=ye,scope:n,sessionKey:r=null,suggestions:o=[],transport:s=ve})=>{let c=(0,X.useRef)(t),l=(0,X.useRef)(n);c.current=t,l.current=n;let[u,d]=(0,X.useState)({_tag:`loading`}),[f,p]=(0,X.useState)(),[m,h]=(0,X.useState)(new Map),[g,_]=(0,X.useState)(new Map),[v,y]=(0,X.useState)(0),[b,x]=(0,X.useState)(`split`),[S,C]=(0,X.useState)(!1),[w,T]=(0,X.useState)(`agent`),[E,D]=(0,X.useState)(`all`),[O,k]=(0,X.useState)(`all`),[A,j]=(0,X.useState)(),M=(0,X.useRef)(null),N=(0,X.useRef)(void 0),P=(0,X.useRef)(new Set),F=(0,X.useRef)(null),[I,te]=(0,X.useState)(null),ne=(0,X.useCallback)(e=>{F.current=e,te(e)},[]);(0,X.useEffect)(()=>{T(`agent`),D(`all`),k(`all`)},[n.pluginConnectionId,n.revision,n.vendorImmutableId]),(0,X.useEffect)(()=>{let e=new AbortController;return d({_tag:`loading`}),p(void 0),h(new Map),_(new Map),y(0),j(void 0),N.current=void 0,P.current.clear(),s.inventory(l.current,e.signal).then(t=>{e.signal.aborted||(d({_tag:`ready`,inventory:t}),p(t.entries.find(e=>!e.generated)?.anchor))},t=>{if(!e.signal.aborted){if(r!==null&&be(t)){c.current(r);return}d({_tag:`failed`})}}),()=>e.abort()},[n.pluginConnectionId,n.revision,n.vendorImmutableId,r,s]);let L=u._tag===`ready`?u.inventory.entries:[],R=L.find(({anchor:e})=>e===f);(0,X.useEffect)(()=>{if(R===void 0||R.binary||R.generated||R.oversized||g.has(R.anchor))return;let e=new AbortController;return h(e=>new Map(e).set(R.anchor,{state:`loading`,label:`Loading bounded content`})),Promise.all([s.content(l.current,R,`before`,e.signal),s.content(l.current,R,`after`,e.signal)]).then(([t,n])=>{if(e.signal.aborted)return;let r=t.unavailableReason!==null&&t.unavailableReason!==`missing`?t.unavailableReason:n.unavailableReason!==null&&n.unavailableReason!==`missing`?n.unavailableReason:null;if(r!==null){h(e=>new Map(e).set(R.anchor,Ce(r)));return}let i=t.unavailableReason===`missing`?``:we(t),a=n.unavailableReason===`missing`?``:we(n);if(i===null||a===null){h(e=>new Map(e).set(R.anchor,{state:`error`,reason:`The bounded content response could not be decoded.`}));return}_(e=>new Map(e).set(R.anchor,{before:i,after:a})),h(e=>new Map(e).set(R.anchor,{state:`ready`}))},t=>{if(!e.signal.aborted){if(r!==null&&be(t)){c.current(r);return}h(e=>new Map(e).set(R.anchor,{state:`error`,reason:`The file content request failed; select the file to retry.`}))}}),()=>e.abort()},[v,g,R,r,s]);let z=(0,X.useMemo)(()=>L.map(e=>Te(e,m.get(e.anchor)??Se(e))),[m,L]),B=u._tag===`loading`?{files:[],indexedCount:0,totalCount:0,label:`Indexing every changed file`,state:`loading`}:u._tag===`failed`?{files:[],indexedCount:0,totalCount:0,title:`Diff inventory unavailable`,description:`No partial inventory is reported as ready. Refresh the page to retry.`,state:`error`}:{files:z,state:`ready`},V=(0,X.useMemo)(()=>L.flatMap(e=>{let t=g.get(e.anchor);return t===void 0?[]:[{id:e.anchor,before:{cacheKey:`${n.revision}:${e.anchor}:before`,contents:t.before,name:e.previousPath??e.path},after:{cacheKey:`${n.revision}:${e.anchor}:after`,contents:t.after,name:e.path}}]}),[L,g,n.revision]),H=f===void 0?V:V.filter(({id:e})=>e===f);(0,X.useEffect)(()=>{f===void 0&&I!==null&&N.current!==void 0&&I.scrollTo({align:`start`,id:N.current,type:`item`})},[I,f]);let U=(0,X.useCallback)((e,t)=>{let n=N.current;n===void 0||P.current.has(t)||(F.current?.scrollTo({align:`start`,id:n,type:`item`}),e===n&&(M.current?.querySelector(`diffs-container[data-rly-diff-item="${CSS.escape(n)}"]`)?.scrollIntoView({block:`nearest`}),P.current.add(t)))},[]),W=(0,X.useMemo)(()=>o.filter(e=>xe(e,w)&&(E===`all`||e.severity===E)&&(O===`all`||e.state===O)),[w,E,O,o]),G=(0,X.useCallback)((e,t,n)=>{N.current=void 0,P.current.clear(),j(r=>({fileId:e,lineNumber:t,requestId:(r?.requestId??0)+1,side:n})),p(e)},[]),ie=(0,X.useMemo)(()=>W.flatMap(e=>{if(e.anchor._tag!==`line`)return[];let t=e.anchor,n=L.find(({path:e})=>String(e)===String(t.path));return n===void 0?[]:[{accessibilityLabel:`${e.severity} review suggestion with ${e.confidence.level} confidence`,id:e.suggestionId,location:{itemId:n.anchor,lineNumber:t.line,side:`additions`},render:({returnFocus:t})=>(0,Z.jsxs)(`article`,{children:[(0,Z.jsxs)(`strong`,{children:[e.severity,` · `,e.confidence.level,` confidence`]}),(0,Z.jsx)(`p`,{children:e.title}),(0,Z.jsxs)(`p`,{children:[(0,Z.jsx)(`strong`,{children:`Impact:`}),` `,e.impact]}),(0,Z.jsx)(`pre`,{children:e.evidence.excerpt}),(0,Z.jsxs)(`p`,{children:[(0,Z.jsx)(`strong`,{children:`Recommendation:`}),` `,e.recommendation]}),(0,Z.jsx)(`p`,{children:e.confidence.reason}),e.relatedLocations.length===0?null:(0,Z.jsxs)(`p`,{children:[e.relatedLocations.length,` related locations`]}),e.replacement===void 0?null:(0,Z.jsx)(`pre`,{children:e.replacement.unifiedDiff}),(0,Z.jsx)(`button`,{onClick:t,type:`button`,children:`Return to line`})]})}]}),[L,W]),K=(0,X.useMemo)(()=>W.filter(e=>{let t=e.anchor;return t._tag!==`changes`&&Q(L,t)===void 0}).length,[L,W]),ae=(0,X.useMemo)(()=>W.map(e=>({id:e.suggestionId,content:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`strong`,{children:[e.severity,` · `,e.title]}),(0,Z.jsx)(`p`,{children:e.anchor._tag===`changes`?`Whole change`:`${e.anchor.path}:${String(e.anchor.line)}`})]})})),[W]),q=[`all`,`P1`,`P2`,`P3`,`P4`],J=[`all`,...new Set(o.map(({state:e})=>e))];return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`section`,{"aria-label":`Review suggestion filters`,className:re.filters,children:[(0,Z.jsx)(`div`,{"aria-label":`Severity`,role:`group`,children:q.map(e=>(0,Z.jsx)(`button`,{"aria-label":e===`all`?`All severities`:e,"aria-pressed":E===e,onClick:()=>D(e),type:`button`,children:e===`all`?`All severities`:e},e))}),(0,Z.jsx)(`div`,{"aria-label":`Suggestion state`,role:`group`,children:J.map(e=>(0,Z.jsx)(`button`,{"aria-label":e===`all`?`All states`:e,"aria-pressed":O===e,onClick:()=>k(e),type:`button`,children:e===`all`?`All states`:e},e))})]}),(0,Z.jsx)(X.Suspense,{fallback:null,children:(0,Z.jsx)(_e,{entries:L,onNavigate:G,onSelectAnchor:e=>{let t=Q(L,e);t!==void 0&&G(t.anchor,e.line,e.relativeFileVersion===`BEFORE`?`deletions`:`additions`)},suggestions:W})}),K===0?null:(0,Z.jsxs)(`p`,{role:`status`,children:[K,` validated review`,` `,K===1?`suggestion is`:`suggestions are`,` not attached because the anchor path is absent from this diff inventory.`]}),(0,Z.jsx)(i,{emptyFindings:`No validated review suggestions are attached to this revision.`,findings:ae,header:(0,Z.jsx)(a,{findingFilter:w,heading:e,indexedCount:z.length,isWrapped:S,layout:b,onFindingFilterChange:T,onLayoutChange:x,onWrapChange:C,totalCount:z.length,...R===void 0?{}:{selectedFileLabel:R.path}}),inventory:(0,Z.jsx)(ee,{data:B,heading:`Complete file inventory`,onSelectedFileChange:e=>{N.current=void 0,P.current.clear(),m.get(e)?.state===`error`&&(h(t=>{let n=new Map(t);return n.delete(e),n}),y(e=>e+1)),p(e)},...f===void 0?{}:{selectedFileId:f}}),label:`Complete diff for ${e}`,onShowAllFiles:()=>{N.current=H[0]?.id??V.at(-1)?.id,P.current.clear(),p(void 0)},scope:R===void 0?{label:`All changed files`,mode:`all-files`}:{fileId:R.anchor,label:R.path,mode:`selected-file`},statusNotice:R===void 0?V.length===0?`Select a supported file to load its content.`:`Showing ${String(V.length)} lazily loaded ${V.length===1?`file`:`files`}.`:H.length===0?m.get(R.anchor)?.state===`loading`?`Loading this file only.`:`Content is not rendered for this file.`:void 0,viewer:H.length===0?`Select a supported text file to render its change.`:(0,Z.jsxs)(`div`,{className:re.viewerTarget,ref:M,children:[(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(`p`,{"aria-live":`polite`,children:`Rendering complete diff…`}),children:(0,Z.jsx)(he,{annotations:ie,initialItems:H,mode:b,onItemRender:U,ref:ne,wrap:S},f??`all-files`)}),A===void 0||A.fileId!==f?null:(0,Z.jsx)(X.Suspense,{fallback:null,children:(0,Z.jsx)(ge,{fileId:A.fileId,lineNumber:A.lineNumber,root:M,side:A.side,viewer:I},A.requestId)})]})})]})},De=(0,X.lazy)(()=>n(()=>import(`./PullRequestReviewPanel-DwVYuZ8Q.js`),__vite__mapDeps([13,1,2,4,5,14,3,15,7,16,17,18,19,20,21,22,23]))),Oe=J().pipe(oe({_tag:`ready`,review:{_tag:`completed`}},({review:e})=>fe(e)),se(()=>ue())),$=({children:e,heading:t,meta:n})=>(0,Z.jsxs)(`section`,{className:B.section,children:[(0,Z.jsxs)(`header`,{className:B.sectionHeading,children:[(0,Z.jsx)(s,{as:`h2`,variant:`section-title`,children:t}),(0,Z.jsx)(s,{tone:`secondary`,variant:`meta`,children:n})]}),e]}),ke=({empty:e,people:t})=>t.length===0?(0,Z.jsx)(s,{tone:`secondary`,children:e}):(0,Z.jsx)(`ul`,{className:B.people,children:t.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsx)(o,{person:e,size:`compact`})},e.id))}),Ae=({approvers:e,onReviewCancel:t,onReviewExtendBudget:n,onReviewLoadEarlier:r,onReviewPublicationCancel:i,onReviewPublicationPreview:a,onReviewRetry:ee,onReviewStart:c,onReviewSuggestionPublish:l,onReviewTargetSuggestion:u=()=>void 0,onSessionExpired:d,pullRequest:f,reviewCanEnqueue:p,reviewPublication:m,reviewState:h,reviewSuggestionRevisionTransport:g,reviewers:_,sessionKey:v})=>{let y=pe(Oe(h)).onInitial(()=>null).onSuccess(e=>e).exhaustive(),b=y?.jobId??null,x=y?.report.suggestions??[],[S,C]=(0,X.useState)(()=>({jobId:b,suggestions:new Map})),w=(0,X.useMemo)(()=>S.jobId===b?x.map(e=>{let t=S.suggestions.get(e.suggestionId);return t===void 0?e:e.state===`published`||e.state===`resolved`?{...t,state:e.state}:t}):x,[x,b,S]),T=(0,X.useCallback)(e=>{b!==null&&C(t=>{let n=t.jobId===b?new Map(t.suggestions):new Map;return n.set(e.suggestionId,e),{jobId:b,suggestions:n}})},[b]);return(0,Z.jsxs)(`article`,{className:B.document,"data-workspace-pull-request-detail":!0,children:[(0,Z.jsxs)(`div`,{className:B.revisionCard,children:[(0,Z.jsxs)(`div`,{className:B.branchPair,children:[(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(`small`,{children:`Head`}),(0,Z.jsx)(`strong`,{children:f.sourceBranch})]}),(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:B.direction,children:`→`}),(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(`small`,{children:`Base`}),(0,Z.jsx)(`strong`,{children:f.targetBranch})]})]}),(0,Z.jsxs)(`div`,{className:B.commitPair,children:[(0,Z.jsx)(`code`,{title:f.headRevision,children:f.headRevision}),(0,Z.jsx)(`span`,{children:`against`}),(0,Z.jsx)(`code`,{title:f.baseRevision??void 0,children:f.baseRevision??`Base revision unavailable`})]}),(0,Z.jsxs)(`dl`,{className:B.revisionMeta,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Created`}),(0,Z.jsx)(`dd`,{children:f.createdAt===null?`Not synchronized`:(0,Z.jsx)(`time`,{dateTime:f.createdAt.dateTime,children:f.createdAt.label})})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Merge base`}),(0,Z.jsx)(`dd`,{children:f.mergeBaseRevision??`Not synchronized`})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Last activity`}),(0,Z.jsx)(`dd`,{children:f.updatedAt===null?`Not synchronized`:(0,Z.jsx)(`time`,{dateTime:f.updatedAt.dateTime,children:f.updatedAt.label})})]})]})]}),(0,Z.jsx)($,{heading:`Description`,meta:`What this revision changes`,children:f.description===null?(0,Z.jsx)(s,{tone:`secondary`,children:`No description was synchronized from CodeCommit.`}):(0,Z.jsx)(V,{className:B.description,value:f.description})}),(0,Z.jsx)($,{heading:`People`,meta:`Author, reviewers, and approvers`,children:(0,Z.jsxs)(`div`,{className:B.peopleGroups,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(s,{tone:`secondary`,variant:`meta`,children:`Author`}),f.author===null?(0,Z.jsx)(s,{tone:`secondary`,children:`No author identity was synchronized.`}):(0,Z.jsx)(o,{person:f.author})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(s,{tone:`secondary`,variant:`meta`,children:`Reviewers`}),(0,Z.jsx)(ke,{empty:`No reviewer is assigned in the canonical workspace.`,people:_})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(s,{tone:`secondary`,variant:`meta`,children:`Approvers`}),(0,Z.jsx)(ke,{empty:`No approver is assigned in the canonical workspace.`,people:e})]})]})}),(0,Z.jsx)($,{heading:`Review`,meta:`Human decisions stay separate from agent advice`,children:(0,Z.jsxs)(`div`,{className:B.reviewLanes,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`small`,{children:`Human decision`}),(0,Z.jsx)(`strong`,{children:f.reviewLabel}),(0,Z.jsx)(`span`,{children:`Only provider and workspace evidence can change this state.`})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`small`,{children:`Relay recommendation`}),(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(`span`,{children:`Loading review tools…`}),children:(0,Z.jsx)(De,{canEnqueue:p,onCancelReview:t,onCancelPublication:i,onExtendReviewBudget:n,onLoadEarlier:r,onPreviewPublication:a,onPublishSuggestion:l,onTargetSuggestion:u,onRetry:ee,onStart:c,onSuggestionRevisionAccepted:T,publication:m,...g===void 0?{}:{revisionTransport:g},state:h,suggestions:w})})]})]})}),(0,Z.jsxs)($,{heading:`Delivery evidence`,meta:`Connected work around this exact head`,children:[(0,Z.jsxs)(`dl`,{className:B.deliveryCounts,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Jira items`}),(0,Z.jsx)(`dd`,{children:f.issueCountLabel})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Pipeline runs`}),(0,Z.jsx)(`dd`,{children:f.pipelineCountLabel})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Releases`}),(0,Z.jsx)(`dd`,{children:f.releaseCountLabel})]})]}),(0,Z.jsx)(s,{tone:`secondary`,children:`The delivery relationships below explain every linked item and its evidence.`})]}),(0,Z.jsxs)($,{heading:`Files`,meta:`Complete immutable diff`,children:[(0,Z.jsx)(Ee,{heading:`Pull request ${f.headRevision.slice(0,12)}`,onSessionExpired:d,suggestions:w,scope:f.diffScope,sessionKey:v}),f.filesHref===null?null:(0,Z.jsx)(`a`,{className:B.filesLink,href:f.filesHref,rel:`noreferrer`,target:`_blank`,children:`Open this revision in CodeCommit`})]})]})};export{Ae as WorkspacePullRequestDetails};
3
- //# sourceMappingURL=WorkspacePullRequestDetails-CKedGIT8.js.map
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{n as i,r as a,t as ee}from"./workbench-4C25n_BY-DcOIwxZW.js";import{a as o}from"./patterns-DuFUSnJW.js";import{n as s}from"./primitives-DYGtIZqB-r-Glkv2i.js";import{$a as c,$i as l,Aa as u,Ba as d,Da as f,Ea as p,Fa as m,Ga as h,Ha as g,Ma as _,Oa as v,Pa as y,Ti as b,Ua as x,Ur as S,Va as C,Wa as w,Ya as T,Za as E,_a as D,_i as O,ea as k,eo as A,fa as j,ga as M,ha as N,ja as P,ki as F,ma as I,oa as te,ta as ne,za as L}from"./agent-api-CUWP1qs8.js";import{a as R,t as z}from"./client-D3WRV6yl.js";import{t as B}from"./WorkspacePullRequestDetails.module-Bl8z_AMw.js";import{t as re}from"./WorkspacePullRequestDiff.module-DJEWRmoT.js";import{t as V}from"./WorkspaceRichText-Beh64wsV.js";var H={"~effect/match/Match/Matcher":{_input:c,_filters:c,_remaining:c,_result:c,_return:c},_tag:`TypeMatcher`,add(e){return U([...this.cases,e])},pipe(){return A(this,arguments)}};function U(e){let t=Object.create(H);return t.cases=e,t}var W=(e,t)=>({_tag:`When`,guard:e,evaluate:t}),G=e=>{if(typeof e==`function`)return e;if(Array.isArray(e)){let t=e.map(G),n=t.length;return e=>{if(!Array.isArray(e))return!1;for(let r=0;r<n;r++)if(t[r](e[r])===!1)return!1;return!0}}if(typeof e==`object`&&e){let t=Reflect.ownKeys(e).map(t=>[t,G(e[t])]),n=t.length;return e=>{if(typeof e!=`object`||!e)return!1;for(let r=0;r<n;r++){let[n,i]=t[r];if(!(n in e)||i(e[n])===!1)return!1}return!0}}return t=>t===e},ie=()=>U([]),K=(e,t)=>n=>n.add(W(G(e),t)),ae=e=>t=>{let n=q(t);return N(n)?n._tag===`Success`?n.success:e(n.failure):t=>{let r=n(t);return M(r)?r.success:e(r.failure)}},q=e=>{if(e._tag===`ValueMatcher`)return e.value;let t=e.cases.length;if(t===1){let t=e.cases[0];return e=>t._tag===`When`&&t.guard(e)===!0||t._tag===`Not`&&t.guard(e)===!1?D(t.evaluate(e)):j(e)}return n=>{for(let r=0;r<t;r++){let t=e.cases[r];if(t._tag===`When`&&t.guard(n)===!0||t._tag===`Not`&&t.guard(n)===!1)return D(t.evaluate(n))}return j(n)}},J=ie,oe=K,se=ae,ce={"~effect/reactivity/AsyncResult":{E:c,A:c},pipe(){return A(this,arguments)},[d](e){if(this._tag!==e._tag||this.waiting!==e.waiting)return!1;switch(this._tag){case`Initial`:return!0;case`Success`:return L(this.value,e.value);case`Failure`:return L(this.cause,e.cause)}},[w](){let e=x(`${this._tag}:${this.waiting}`);return this._tag===`Initial`?e:C(e)(this._tag===`Success`?g(this.value):g(this.cause))}},le=e=>e._tag===`Initial`,ue=(e=!1)=>{let t=Object.create(ce);return t._tag=`Initial`,t.waiting=e,t},de=e=>e._tag===`Success`,fe=(e,t)=>{let n=Object.create(ce);return n._tag=`Success`,n.value=e,n.waiting=t?.waiting??!1,n.timestamp=t?.timestamp??Date.now(),n},Y=e=>e._tag===`Failure`,pe=e=>new me(e),me=class{constructor(e){this.result=e}result;output=y();when(e,t){if(u(this.output)&&e(this.result)){let e=t(this.result);P(e)&&(this.output=e)}return this}pipe(){return A(this,arguments)}onWaiting(e){return this.when(e=>e.waiting,t=>m(e(t)))}onInitialOrWaiting(e){return this.when(e=>le(e)||e.waiting,t=>m(e(t)))}onInitial(e){return this.when(le,t=>m(e(t)))}onSuccess(e){return this.when(de,t=>m(e(t.value,t)))}onFailure(e){return this.when(Y,t=>m(e(t.cause,t)))}onError(e){return this.onErrorIf(E,e)}onErrorIf(e,t){return this.when(Y,n=>ne(n.cause).pipe(p(e),_(e=>t(e,n))))}onErrorTag(e,t){return this.onErrorIf(t=>h(t,`_tag`)&&(Array.isArray(e)?e.includes(t._tag):t._tag===e),t)}onDefect(e){return this.when(Y,t=>{let n=k(t.cause);return I(n)?y():m(e(n.success,t))})}onInterrupt(e){return this.when(Y,t=>{let n=l(t.cause);return I(n)?y():m(e(n.success,t))})}orElse(e){return f(this.output,e)}orNull(){return v(this.output)}render(){if(P(this.output))return this.output.value;if(Y(this.result))throw te(this.result.cause);return null}exhaustive(){return this.render()}},X=e(t(),1),Z=r(),he=(0,X.lazy)(async()=>{let e=await n(()=>import(`./diff-18-fMaVc.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8]));return{default:(0,X.forwardRef)((t,n)=>(0,Z.jsx)(e.DiffWorkerProvider,{poolSize:2,children:(0,Z.jsx)(e.DiffCodeView,{...t,ref:n})}))}}),ge=(0,X.lazy)(async()=>({default:(await n(()=>import(`./DiffLineFocus-Cs87hlsH.js`),__vite__mapDeps([9,1,2]))).DiffLineFocus})),_e=(0,X.lazy)(async()=>({default:(await n(()=>import(`./ReviewSuggestionOverview-DfYo6Ute.js`),__vite__mapDeps([10,5,1,11,12]))).ReviewSuggestionOverview})),ve={inventory:(e,t)=>F(O(function*(){return yield*(yield*z()).diff.inventory({params:{pluginConnectionId:e.pluginConnectionId,vendorImmutableId:e.vendorImmutableId},query:{revision:e.revision}})}).pipe(b(R)),{signal:t}),content:(e,t,n,r)=>F(O(function*(){return yield*(yield*z()).diff.content({params:{pluginConnectionId:e.pluginConnectionId,vendorImmutableId:e.vendorImmutableId},payload:{revision:e.revision,anchor:t.anchor,path:t.path,status:t.status,previousPath:t.previousPath,side:n,offset:0,length:1048576}})}).pipe(b(R)),{signal:r})},ye=e=>void 0,be=T(`UnauthorizedApiError`),xe=(e,t)=>{switch(t){case`all`:case`agent`:return!0;case`human`:return!1;case`unresolved`:return e.state!==`dismissed`&&e.state!==`resolved`}},Se=e=>e.binary?{state:`binary`,reason:`CodeCommit reports binary content.`}:e.generated?{state:`generated`,reason:`Generated content is indexed but not rendered.`}:e.oversized?{state:`oversized`,reason:`Content exceeds the bounded renderer limit.`}:{state:`ready`},Ce=e=>{switch(e){case`binary`:return{state:`binary`,reason:`Binary content is indexed but not rendered.`};case`generated`:return{state:`generated`,reason:`Generated content is indexed but not rendered.`};case`oversized`:return{state:`oversized`,reason:`Content exceeds the one MiB renderer limit.`};case`missing`:return{state:`unavailable`,reason:`This side is not present at the immutable revision.`};case`provider-unavailable`:return{state:`unavailable`,reason:`CodeCommit content is temporarily unavailable.`}}},Q=(e,t)=>t.relativeFileVersion===`BEFORE`?e.find(e=>e.status===`renamed`&&e.previousPath!==null&&String(e.previousPath)===String(t.path))??e.find(({path:e})=>String(e)===String(t.path)):e.find(({path:e})=>String(e)===String(t.path)),we=e=>{if(e.unavailableReason!==null||e.bytesBase64===null)return null;let t=S(e.bytesBase64);return t._tag===`Failure`?null:new TextDecoder().decode(t.success)},Te=(e,t)=>e.status===`renamed`&&e.previousPath!==null?{id:e.anchor,path:e.path,previousPath:e.previousPath,change:`renamed`,content:t}:{id:e.anchor,path:e.path,change:e.status===`copied`?`added`:e.status===`renamed`?`modified`:e.status,content:t},Ee=({heading:e,onSessionExpired:t=ye,scope:n,sessionKey:r=null,suggestions:o=[],transport:s=ve})=>{let c=(0,X.useRef)(t),l=(0,X.useRef)(n);c.current=t,l.current=n;let[u,d]=(0,X.useState)({_tag:`loading`}),[f,p]=(0,X.useState)(),[m,h]=(0,X.useState)(new Map),[g,_]=(0,X.useState)(new Map),[v,y]=(0,X.useState)(0),[b,x]=(0,X.useState)(`split`),[S,C]=(0,X.useState)(!1),[w,T]=(0,X.useState)(`agent`),[E,D]=(0,X.useState)(`all`),[O,k]=(0,X.useState)(`all`),[A,j]=(0,X.useState)(),M=(0,X.useRef)(null),N=(0,X.useRef)(void 0),P=(0,X.useRef)(new Set),F=(0,X.useRef)(null),[I,te]=(0,X.useState)(null),ne=(0,X.useCallback)(e=>{F.current=e,te(e)},[]);(0,X.useEffect)(()=>{T(`agent`),D(`all`),k(`all`)},[n.pluginConnectionId,n.revision,n.vendorImmutableId]),(0,X.useEffect)(()=>{let e=new AbortController;return d({_tag:`loading`}),p(void 0),h(new Map),_(new Map),y(0),j(void 0),N.current=void 0,P.current.clear(),s.inventory(l.current,e.signal).then(t=>{e.signal.aborted||(d({_tag:`ready`,inventory:t}),p(t.entries.find(e=>!e.generated)?.anchor))},t=>{if(!e.signal.aborted){if(r!==null&&be(t)){c.current(r);return}d({_tag:`failed`})}}),()=>e.abort()},[n.pluginConnectionId,n.revision,n.vendorImmutableId,r,s]);let L=u._tag===`ready`?u.inventory.entries:[],R=L.find(({anchor:e})=>e===f);(0,X.useEffect)(()=>{if(R===void 0||R.binary||R.generated||R.oversized||g.has(R.anchor))return;let e=new AbortController;return h(e=>new Map(e).set(R.anchor,{state:`loading`,label:`Loading bounded content`})),Promise.all([s.content(l.current,R,`before`,e.signal),s.content(l.current,R,`after`,e.signal)]).then(([t,n])=>{if(e.signal.aborted)return;let r=t.unavailableReason!==null&&t.unavailableReason!==`missing`?t.unavailableReason:n.unavailableReason!==null&&n.unavailableReason!==`missing`?n.unavailableReason:null;if(r!==null){h(e=>new Map(e).set(R.anchor,Ce(r)));return}let i=t.unavailableReason===`missing`?``:we(t),a=n.unavailableReason===`missing`?``:we(n);if(i===null||a===null){h(e=>new Map(e).set(R.anchor,{state:`error`,reason:`The bounded content response could not be decoded.`}));return}_(e=>new Map(e).set(R.anchor,{before:i,after:a})),h(e=>new Map(e).set(R.anchor,{state:`ready`}))},t=>{if(!e.signal.aborted){if(r!==null&&be(t)){c.current(r);return}h(e=>new Map(e).set(R.anchor,{state:`error`,reason:`The file content request failed; select the file to retry.`}))}}),()=>e.abort()},[v,g,R,r,s]);let z=(0,X.useMemo)(()=>L.map(e=>Te(e,m.get(e.anchor)??Se(e))),[m,L]),B=u._tag===`loading`?{files:[],indexedCount:0,totalCount:0,label:`Indexing every changed file`,state:`loading`}:u._tag===`failed`?{files:[],indexedCount:0,totalCount:0,title:`Diff inventory unavailable`,description:`No partial inventory is reported as ready. Refresh the page to retry.`,state:`error`}:{files:z,state:`ready`},V=(0,X.useMemo)(()=>L.flatMap(e=>{let t=g.get(e.anchor);return t===void 0?[]:[{id:e.anchor,before:{cacheKey:`${n.revision}:${e.anchor}:before`,contents:t.before,name:e.previousPath??e.path},after:{cacheKey:`${n.revision}:${e.anchor}:after`,contents:t.after,name:e.path}}]}),[L,g,n.revision]),H=f===void 0?V:V.filter(({id:e})=>e===f);(0,X.useEffect)(()=>{f===void 0&&I!==null&&N.current!==void 0&&I.scrollTo({align:`start`,id:N.current,type:`item`})},[I,f]);let U=(0,X.useCallback)((e,t)=>{let n=N.current;n===void 0||P.current.has(t)||(F.current?.scrollTo({align:`start`,id:n,type:`item`}),e===n&&(M.current?.querySelector(`diffs-container[data-rly-diff-item="${CSS.escape(n)}"]`)?.scrollIntoView({block:`nearest`}),P.current.add(t)))},[]),W=(0,X.useMemo)(()=>o.filter(e=>xe(e,w)&&(E===`all`||e.severity===E)&&(O===`all`||e.state===O)),[w,E,O,o]),G=(0,X.useCallback)((e,t,n)=>{N.current=void 0,P.current.clear(),j(r=>({fileId:e,lineNumber:t,requestId:(r?.requestId??0)+1,side:n})),p(e)},[]),ie=(0,X.useMemo)(()=>W.flatMap(e=>{if(e.anchor._tag!==`line`)return[];let t=e.anchor,n=L.find(({path:e})=>String(e)===String(t.path));return n===void 0?[]:[{accessibilityLabel:`${e.severity} review suggestion with ${e.confidence.level} confidence`,id:e.suggestionId,location:{itemId:n.anchor,lineNumber:t.line,side:`additions`},render:({returnFocus:t})=>(0,Z.jsxs)(`article`,{children:[(0,Z.jsxs)(`strong`,{children:[e.severity,` · `,e.confidence.level,` confidence`]}),(0,Z.jsx)(`p`,{children:e.title}),(0,Z.jsxs)(`p`,{children:[(0,Z.jsx)(`strong`,{children:`Impact:`}),` `,e.impact]}),(0,Z.jsx)(`pre`,{children:e.evidence.excerpt}),(0,Z.jsxs)(`p`,{children:[(0,Z.jsx)(`strong`,{children:`Recommendation:`}),` `,e.recommendation]}),(0,Z.jsx)(`p`,{children:e.confidence.reason}),e.relatedLocations.length===0?null:(0,Z.jsxs)(`p`,{children:[e.relatedLocations.length,` related locations`]}),e.replacement===void 0?null:(0,Z.jsx)(`pre`,{children:e.replacement.unifiedDiff}),(0,Z.jsx)(`button`,{onClick:t,type:`button`,children:`Return to line`})]})}]}),[L,W]),K=(0,X.useMemo)(()=>W.filter(e=>{let t=e.anchor;return t._tag!==`changes`&&Q(L,t)===void 0}).length,[L,W]),ae=(0,X.useMemo)(()=>W.map(e=>({id:e.suggestionId,content:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`strong`,{children:[e.severity,` · `,e.title]}),(0,Z.jsx)(`p`,{children:e.anchor._tag===`changes`?`Whole change`:`${e.anchor.path}:${String(e.anchor.line)}`})]})})),[W]),q=[`all`,`P1`,`P2`,`P3`,`P4`],J=[`all`,...new Set(o.map(({state:e})=>e))];return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`section`,{"aria-label":`Review suggestion filters`,className:re.filters,children:[(0,Z.jsx)(`div`,{"aria-label":`Severity`,role:`group`,children:q.map(e=>(0,Z.jsx)(`button`,{"aria-label":e===`all`?`All severities`:e,"aria-pressed":E===e,onClick:()=>D(e),type:`button`,children:e===`all`?`All severities`:e},e))}),(0,Z.jsx)(`div`,{"aria-label":`Suggestion state`,role:`group`,children:J.map(e=>(0,Z.jsx)(`button`,{"aria-label":e===`all`?`All states`:e,"aria-pressed":O===e,onClick:()=>k(e),type:`button`,children:e===`all`?`All states`:e},e))})]}),(0,Z.jsx)(X.Suspense,{fallback:null,children:(0,Z.jsx)(_e,{entries:L,onNavigate:G,onSelectAnchor:e=>{let t=Q(L,e);t!==void 0&&G(t.anchor,e.line,e.relativeFileVersion===`BEFORE`?`deletions`:`additions`)},suggestions:W})}),K===0?null:(0,Z.jsxs)(`p`,{role:`status`,children:[K,` validated review`,` `,K===1?`suggestion is`:`suggestions are`,` not attached because the anchor path is absent from this diff inventory.`]}),(0,Z.jsx)(i,{emptyFindings:`No validated review suggestions are attached to this revision.`,findings:ae,header:(0,Z.jsx)(a,{findingFilter:w,heading:e,indexedCount:z.length,isWrapped:S,layout:b,onFindingFilterChange:T,onLayoutChange:x,onWrapChange:C,totalCount:z.length,...R===void 0?{}:{selectedFileLabel:R.path}}),inventory:(0,Z.jsx)(ee,{data:B,heading:`Complete file inventory`,onSelectedFileChange:e=>{N.current=void 0,P.current.clear(),m.get(e)?.state===`error`&&(h(t=>{let n=new Map(t);return n.delete(e),n}),y(e=>e+1)),p(e)},...f===void 0?{}:{selectedFileId:f}}),label:`Complete diff for ${e}`,onShowAllFiles:()=>{N.current=H[0]?.id??V.at(-1)?.id,P.current.clear(),p(void 0)},scope:R===void 0?{label:`All changed files`,mode:`all-files`}:{fileId:R.anchor,label:R.path,mode:`selected-file`},statusNotice:R===void 0?V.length===0?`Select a supported file to load its content.`:`Showing ${String(V.length)} lazily loaded ${V.length===1?`file`:`files`}.`:H.length===0?m.get(R.anchor)?.state===`loading`?`Loading this file only.`:`Content is not rendered for this file.`:void 0,viewer:H.length===0?`Select a supported text file to render its change.`:(0,Z.jsxs)(`div`,{className:re.viewerTarget,ref:M,children:[(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(`p`,{"aria-live":`polite`,children:`Rendering complete diff…`}),children:(0,Z.jsx)(he,{annotations:ie,initialItems:H,mode:b,onItemRender:U,ref:ne,wrap:S},f??`all-files`)}),A===void 0||A.fileId!==f?null:(0,Z.jsx)(X.Suspense,{fallback:null,children:(0,Z.jsx)(ge,{fileId:A.fileId,lineNumber:A.lineNumber,root:M,side:A.side,viewer:I},A.requestId)})]})})]})},De=(0,X.lazy)(()=>n(()=>import(`./PullRequestReviewPanel-DwVYuZ8Q.js`),__vite__mapDeps([13,1,2,4,5,14,3,15,7,16,17,18,19,20,21,22,23]))),Oe=J().pipe(oe({_tag:`ready`,review:{_tag:`completed`}},({review:e})=>fe(e)),se(()=>ue())),$=({children:e,heading:t,meta:n})=>(0,Z.jsxs)(`section`,{className:B.section,children:[(0,Z.jsxs)(`header`,{className:B.sectionHeading,children:[(0,Z.jsx)(s,{as:`h2`,variant:`section-title`,children:t}),(0,Z.jsx)(s,{tone:`secondary`,variant:`meta`,children:n})]}),e]}),ke=({empty:e,people:t})=>t.length===0?(0,Z.jsx)(s,{tone:`secondary`,children:e}):(0,Z.jsx)(`ul`,{className:B.people,children:t.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsx)(o,{person:e,size:`compact`})},e.id))}),Ae=({approvers:e,onReviewCancel:t,onReviewExtendBudget:n,onReviewLoadEarlier:r,onReviewPublicationCancel:i,onReviewPublicationPreview:a,onReviewRetry:ee,onReviewStart:c,onReviewSuggestionPublish:l,onReviewTargetSuggestion:u=()=>void 0,onSessionExpired:d,pullRequest:f,reviewCanEnqueue:p,reviewPublication:m,reviewState:h,reviewSuggestionRevisionTransport:g,reviewers:_,sessionKey:v})=>{let y=pe(Oe(h)).onInitial(()=>null).onSuccess(e=>e).exhaustive(),b=y?.jobId??null,x=y?.report.suggestions??[],[S,C]=(0,X.useState)(()=>({jobId:b,suggestions:new Map})),w=(0,X.useMemo)(()=>S.jobId===b?x.map(e=>{let t=S.suggestions.get(e.suggestionId);return t===void 0?e:e.state===`published`||e.state===`resolved`?{...t,state:e.state}:t}):x,[x,b,S]),T=(0,X.useCallback)(e=>{b!==null&&C(t=>{let n=t.jobId===b?new Map(t.suggestions):new Map;return n.set(e.suggestionId,e),{jobId:b,suggestions:n}})},[b]);return(0,Z.jsxs)(`article`,{className:B.document,"data-workspace-pull-request-detail":!0,children:[(0,Z.jsxs)(`div`,{className:B.revisionCard,children:[(0,Z.jsxs)(`div`,{className:B.branchPair,children:[(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(`small`,{children:`Head`}),(0,Z.jsx)(`strong`,{children:f.sourceBranch})]}),(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:B.direction,children:`→`}),(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(`small`,{children:`Base`}),(0,Z.jsx)(`strong`,{children:f.targetBranch})]})]}),(0,Z.jsxs)(`div`,{className:B.commitPair,children:[(0,Z.jsx)(`code`,{title:f.headRevision,children:f.headRevision}),(0,Z.jsx)(`span`,{children:`against`}),(0,Z.jsx)(`code`,{title:f.baseRevision??void 0,children:f.baseRevision??`Base revision unavailable`})]}),(0,Z.jsxs)(`dl`,{className:B.revisionMeta,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Created`}),(0,Z.jsx)(`dd`,{children:f.createdAt===null?`Not synchronized`:(0,Z.jsx)(`time`,{dateTime:f.createdAt.dateTime,children:f.createdAt.label})})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Merge base`}),(0,Z.jsx)(`dd`,{children:f.mergeBaseRevision??`Not synchronized`})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Last activity`}),(0,Z.jsx)(`dd`,{children:f.updatedAt===null?`Not synchronized`:(0,Z.jsx)(`time`,{dateTime:f.updatedAt.dateTime,children:f.updatedAt.label})})]})]})]}),(0,Z.jsx)($,{heading:`Description`,meta:`What this revision changes`,children:f.description===null?(0,Z.jsx)(s,{tone:`secondary`,children:`No description was synchronized from CodeCommit.`}):(0,Z.jsx)(V,{className:B.description,value:f.description})}),(0,Z.jsx)($,{heading:`People`,meta:`Author, reviewers, and approvers`,children:(0,Z.jsxs)(`div`,{className:B.peopleGroups,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(s,{tone:`secondary`,variant:`meta`,children:`Author`}),f.author===null?(0,Z.jsx)(s,{tone:`secondary`,children:`No author identity was synchronized.`}):(0,Z.jsx)(o,{person:f.author})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(s,{tone:`secondary`,variant:`meta`,children:`Reviewers`}),(0,Z.jsx)(ke,{empty:`No reviewer is assigned in the canonical workspace.`,people:_})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(s,{tone:`secondary`,variant:`meta`,children:`Approvers`}),(0,Z.jsx)(ke,{empty:`No approver is assigned in the canonical workspace.`,people:e})]})]})}),(0,Z.jsx)($,{heading:`Review`,meta:`Human decisions stay separate from agent advice`,children:(0,Z.jsxs)(`div`,{className:B.reviewLanes,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`small`,{children:`Human decision`}),(0,Z.jsx)(`strong`,{children:f.reviewLabel}),(0,Z.jsx)(`span`,{children:`Only provider and workspace evidence can change this state.`})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`small`,{children:`Relay recommendation`}),(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(`span`,{children:`Loading review tools…`}),children:(0,Z.jsx)(De,{canEnqueue:p,onCancelReview:t,onCancelPublication:i,onExtendReviewBudget:n,onLoadEarlier:r,onPreviewPublication:a,onPublishSuggestion:l,onTargetSuggestion:u,onRetry:ee,onStart:c,onSuggestionRevisionAccepted:T,publication:m,...g===void 0?{}:{revisionTransport:g},state:h,suggestions:w})})]})]})}),(0,Z.jsxs)($,{heading:`Delivery evidence`,meta:`Connected work around this exact head`,children:[(0,Z.jsxs)(`dl`,{className:B.deliveryCounts,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Jira items`}),(0,Z.jsx)(`dd`,{children:f.issueCountLabel})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Pipeline runs`}),(0,Z.jsx)(`dd`,{children:f.pipelineCountLabel})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Releases`}),(0,Z.jsx)(`dd`,{children:f.releaseCountLabel})]})]}),(0,Z.jsx)(s,{tone:`secondary`,children:`The delivery relationships below explain every linked item and its evidence.`})]}),(0,Z.jsxs)($,{heading:`Files`,meta:`Complete immutable diff`,children:[(0,Z.jsx)(Ee,{heading:`Pull request ${f.headRevision.slice(0,12)}`,onSessionExpired:d,suggestions:w,scope:f.diffScope,sessionKey:v}),f.filesHref===null?null:(0,Z.jsx)(`a`,{className:B.filesLink,href:f.filesHref,rel:`noreferrer`,target:`_blank`,children:`Open this revision in CodeCommit`})]})]})};export{Ae as WorkspacePullRequestDetails};
3
+ //# sourceMappingURL=WorkspacePullRequestDetails-BhxoqR7V.js.map