@kidlat-dakila/flightplan 0.1.8 → 0.1.9

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 (86) hide show
  1. package/backend/main.js +118 -980
  2. package/frontend/assets/_branchId-7x6qWn3I.js +1 -0
  3. package/frontend/assets/_branchId-OMHvVhfT.js +1 -0
  4. package/frontend/assets/_id-1eTNGJK9.js +1 -0
  5. package/frontend/assets/_id-CHxZrl-p.js +1 -0
  6. package/frontend/assets/agents-C9xHqVQD.js +1 -0
  7. package/frontend/assets/agents-KKXkUQ27.js +1 -0
  8. package/frontend/assets/create-B3JUVzoL.js +1 -0
  9. package/frontend/assets/create-CriuRRQV.js +1 -0
  10. package/frontend/assets/create-CsL8aMCo.js +1 -0
  11. package/frontend/assets/create-DhWyrgF0.js +1 -0
  12. package/frontend/assets/download-B00Se_e0.js +1 -0
  13. package/frontend/assets/forges-BMb9Pcn1.js +1 -0
  14. package/frontend/assets/forges-BOVWBO1B.js +1 -0
  15. package/frontend/assets/index-4USZJYGF.js +1 -0
  16. package/frontend/assets/index-B4xFHIrG.js +1 -0
  17. package/frontend/assets/index-BA8Qwprc.js +6 -0
  18. package/frontend/assets/index-BUcr0tJt.js +1 -0
  19. package/frontend/assets/index-Ba3RqmDE.js +1 -0
  20. package/frontend/assets/index-CFZ7PaJE.js +1 -0
  21. package/frontend/assets/index-COS3U9jZ.js +1 -0
  22. package/frontend/assets/index-COdzqD_M.js +1 -0
  23. package/frontend/assets/index-CZ3Rr8-h.js +1 -0
  24. package/frontend/assets/index-CikPFj0e.js +1 -0
  25. package/frontend/assets/index-Cl1Gcfks.js +1 -0
  26. package/frontend/assets/index-CmrDaRXW.js +1 -0
  27. package/frontend/assets/index-CrCss1qG.js +1 -0
  28. package/frontend/assets/index-D8-ze-TP.js +1 -0
  29. package/frontend/assets/index-DB42uFFk.js +1 -0
  30. package/frontend/assets/index-DGsH5lbQ.js +170 -0
  31. package/frontend/assets/index-DQyWuir1.js +1 -0
  32. package/frontend/assets/index-DRndyOxR.js +463 -0
  33. package/frontend/assets/index-DaFaImds.js +1 -0
  34. package/frontend/assets/index-DbJECumi.js +1 -0
  35. package/frontend/assets/index-DpY8OPAr.js +1 -0
  36. package/frontend/assets/index-DvuJKeYS.js +1 -0
  37. package/frontend/assets/index-paF1osGm.js +1 -0
  38. package/frontend/assets/repositories-AJnxH9f7.js +1 -0
  39. package/frontend/assets/repositories-Dy8KRYwV.js +1 -0
  40. package/frontend/assets/review-B9u6XA77.js +1 -0
  41. package/frontend/assets/review-M5J-BQx7.js +1 -0
  42. package/frontend/assets/route-BLz_XVsx.js +1 -0
  43. package/frontend/index.html +1 -1
  44. package/package.json +1 -1
  45. package/published-review/app.js +106 -98
  46. package/frontend/assets/_branchId-Caxyy__g.js +0 -1
  47. package/frontend/assets/_branchId-IJ4VEzEl.js +0 -1
  48. package/frontend/assets/_id-3L9ONe4W.js +0 -1
  49. package/frontend/assets/_id-CvORsoNj.js +0 -1
  50. package/frontend/assets/agents-DnjhKMUc.js +0 -1
  51. package/frontend/assets/agents-bla75JmI.js +0 -1
  52. package/frontend/assets/create-B82q7ZMu.js +0 -1
  53. package/frontend/assets/create-C9yw-thL.js +0 -1
  54. package/frontend/assets/create-CEpA1s8S.js +0 -1
  55. package/frontend/assets/create-D0h6PRxn.js +0 -1
  56. package/frontend/assets/download-CwWMZwNG.js +0 -1
  57. package/frontend/assets/forges-BH3uXIQL.js +0 -1
  58. package/frontend/assets/forges-uSh1-w20.js +0 -1
  59. package/frontend/assets/index--nj01XKS.js +0 -1
  60. package/frontend/assets/index-0VAWT0gs.js +0 -1
  61. package/frontend/assets/index-B0zuYONu.js +0 -1
  62. package/frontend/assets/index-BQaZ5gZR.js +0 -1
  63. package/frontend/assets/index-BZ6iL63Z.js +0 -1
  64. package/frontend/assets/index-Bar8NyIm.js +0 -1
  65. package/frontend/assets/index-BlTfCkr5.js +0 -1
  66. package/frontend/assets/index-BvuPClj3.js +0 -1
  67. package/frontend/assets/index-C9xsdcXo.js +0 -1
  68. package/frontend/assets/index-CJDNq1TA.js +0 -1
  69. package/frontend/assets/index-CJslcuJ0.js +0 -1
  70. package/frontend/assets/index-CXyB0ld0.js +0 -1
  71. package/frontend/assets/index-CcORd1N6.js +0 -1
  72. package/frontend/assets/index-CrAQ5_e4.js +0 -1
  73. package/frontend/assets/index-DG0FDX8u.js +0 -1
  74. package/frontend/assets/index-DKnoo-kT.js +0 -455
  75. package/frontend/assets/index-DKzDkR6v.js +0 -1
  76. package/frontend/assets/index-DfKNJbUM.js +0 -170
  77. package/frontend/assets/index-DlUHisPA.js +0 -1
  78. package/frontend/assets/index-Dv5cF6qF.js +0 -1
  79. package/frontend/assets/index-JPWJ3IiN.js +0 -1
  80. package/frontend/assets/index-V1avMli5.js +0 -6
  81. package/frontend/assets/index-iRAoFOv3.js +0 -1
  82. package/frontend/assets/repositories-DqGU7W63.js +0 -1
  83. package/frontend/assets/repositories-DuObN8PJ.js +0 -1
  84. package/frontend/assets/review-BbbMUFsk.js +0 -1
  85. package/frontend/assets/review-C3k0h5Vl.js +0 -1
  86. package/frontend/assets/route-D8s8AylJ.js +0 -1
@@ -1 +0,0 @@
1
- import{a8 as r}from"./index-DKnoo-kT.js";const e=r;export{e as errorComponent};
@@ -1 +0,0 @@
1
- import{a9 as e,j as t,aa as o}from"./index-DKnoo-kT.js";const n=()=>{const a=e.useNavigate();return t.jsx(o,{params:e.useParams(),search:e.useSearch(),onSearchChange:s=>{a({search:r=>({...r,...s}),replace:!0,resetScroll:!1})}})};export{n as component};
@@ -1 +0,0 @@
1
- import{u as M,r as g,j as e,x as I,Y as P,B as m,s as S,z,g as O,h as U,ab as $,ad as R,F as q,k as w}from"./index-DKnoo-kT.js";import{T as H}from"./index-DfKNJbUM.js";function V(t,a){if(t===void 0)return{shouldBlockFn:()=>!0,withResolver:!1};if("shouldBlockFn"in t)return t;if(typeof t=="function")return{shouldBlockFn:async()=>await t(),enableBeforeUnload:!0,withResolver:!1};const s=!!(t.condition??!0),n=t.blockerFn;return{shouldBlockFn:async()=>s&&n!==void 0?await n():s,enableBeforeUnload:s,withResolver:n===void 0}}function Y(t,a){const{shouldBlockFn:s,enableBeforeUnload:n=!0,disabled:l=!1,withResolver:r=!1}=V(t),x=M(),{history:p}=x,[j,o]=g.useState({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0});return g.useEffect(()=>{const h=async u=>{function i(f){const k=x.parseLocation(f),[,L,N]=x.getMatchedRoutes(k.pathname);return N===void 0?{routeId:"__notFound__",fullPath:k.pathname,pathname:k.pathname,params:L,search:x.options.parseSearch(f.search)}:{routeId:N.id,fullPath:N.fullPath,pathname:k.pathname,params:L,search:x.options.parseSearch(f.search)}}const b=i(u.currentLocation),v=i(u.nextLocation);if(b.routeId==="__notFound__"&&v.routeId!=="__notFound__")return!1;const y=await s({action:u.action,current:b,next:v});if(!r)return y;if(!y)return!1;const c=await new Promise(f=>{o({status:"blocked",current:b,next:v,action:u.action,proceed:()=>f(!1),reset:()=>f(!0)})});return o({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0}),c};return l?void 0:p.block({blockerFn:h,enableBeforeUnload:n})},[s,n,l,r,p,x]),j}const Q="All configurations",G="Rename",X="Name",W="Save name",J="Cancel",F="Delete",Z="Keep",ee="text-2xl leading-8 font-bold tracking-[-0.015em] text-signal-text",te=t=>{const[a,s]=g.useState("none"),[n,l]=g.useState(t.name);return e.jsxs("header",{className:"pb-6",children:[e.jsx(I,{to:"/settings/profiles",className:"text-sm text-muted-foreground underline decoration-input underline-offset-[0.3em] hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring",children:Q}),e.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-x-4 gap-y-3",children:[a==="renaming"?e.jsxs("form",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-2",onSubmit:S(()=>{t.onRename(n),s("none")}),children:[e.jsx(P,{value:n,"aria-label":X,className:"max-w-sm flex-1",onChange:r=>{l(r.target.value)}}),e.jsx(m,{type:"submit",size:"sm",children:W}),e.jsx(m,{type:"button",variant:"ghost",size:"sm",onClick:()=>{s("none")},children:J})]}):e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h2",{className:ee,children:t.name}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t.originLabel})]}),a==="deleting"?e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("p",{className:"text-sm",children:`Delete ${t.name}? This cannot be undone.`}),e.jsx(m,{type:"button",variant:"ghost",size:"sm",onClick:()=>{s("none")},children:Z}),e.jsx(m,{type:"button",variant:"destructive",size:"sm",disabled:t.isBusy,onClick:t.onDelete,children:F})]}):e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.canRename&&a==="none"?e.jsx(m,{type:"button",variant:"ghost",size:"sm",onClick:()=>{l(t.name),s("renaming")},children:G}):null,t.canDelete?e.jsx(m,{type:"button",variant:"ghost",size:"sm",onClick:()=>{s("deleting")},children:F}):null,t.notice===null?e.jsx(m,{type:"button",variant:"outline",size:"sm",disabled:t.isBusy,onClick:t.onDuplicate,children:t.duplicateLabel}):null]})]}),t.errorMessage===null?null:e.jsx("p",{role:"alert",className:"pt-3 text-sm text-destructive",children:t.errorMessage}),t.notice===null?null:e.jsxs("div",{role:"note",className:"mt-4 flex flex-wrap items-center gap-x-4 gap-y-2 border-y border-border py-2.5",children:[e.jsxs("p",{className:"min-w-0 flex-1 text-sm",children:[e.jsx("strong",{className:"font-bold",children:t.notice.lead}),` ${t.notice.advice}`]}),e.jsx(m,{type:"button",variant:"outline",size:"sm",disabled:t.isBusy,onClick:t.onDuplicate,children:t.duplicateLabel})]})]})},ne="cursor-pointer text-sm text-muted-foreground underline decoration-input underline-offset-[0.3em] hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring",se="mt-2 max-w-[75ch] border-l border-input pl-4 text-sm leading-6 whitespace-pre-wrap text-muted-foreground",ae="You have not saved this field. Leave it and lose what you wrote?",re="Not saved yet",ie="Keep editing",le="Leave",oe=t=>Object.fromEntries(t.map(a=>[a.key,a.value])),ce=({title:t,summary:a,path:s,offMessage:n,texts:l,renderActions:r,onSubmit:x})=>{const[p,j]=g.useState(()=>oe(l)),o=l.some(i=>p[i.key]!==i.value),h=Y({shouldBlockFn:()=>o,enableBeforeUnload:o,withResolver:!0}),u=h.status==="blocked"?e.jsxs("div",{role:"alert",className:"flex flex-wrap items-center justify-end gap-2 pb-3",children:[e.jsx("p",{className:"text-sm",children:ae}),e.jsx(m,{type:"button",variant:"ghost",size:"sm",onClick:h.reset,children:ie}),e.jsx(m,{type:"button",variant:"destructive",size:"sm",onClick:h.proceed,children:le})]}):null;return e.jsxs("form",{onSubmit:S(()=>{x(l.map(i=>({key:i.key,text:p[i.key]??i.value})))}),children:[e.jsx("h3",{className:"text-xl leading-7 font-bold",children:t}),e.jsx("p",{className:"mt-1 max-w-[62ch] text-muted-foreground",children:a}),e.jsx("p",{className:"mt-1 font-mono text-[0.8125rem] wrap-anywhere text-muted-foreground",children:s}),n===null?null:e.jsx("p",{className:"mt-4 max-w-[62ch] border-y border-border py-2.5 text-sm",children:n}),l.map(i=>e.jsxs("section",{className:"mt-6",children:[e.jsx("h4",{className:"pb-1.5 text-sm font-bold",children:i.label}),e.jsx(H,{label:`${t}: ${i.label}`,value:i.value,errorMessage:null,onChange:b=>{j(v=>({...v,[i.key]:b}))}}),i.isChanged?e.jsxs("details",{className:"mt-2",children:[e.jsx("summary",{className:ne,children:i.shippedLabel}),e.jsx("p",{className:se,children:i.shippedValue})]}):null]},i.key)),r(o?re:null,u)]})},de="Fields of this configuration",ue="What the marks mean",me=[{mark:"changed",label:"Changed"},{mark:"unchanged",label:"Unchanged"},{mark:"off",label:"Not written"}],xe={changed:"border-foreground bg-foreground",unchanged:"border-muted-foreground",off:"border-dashed border-muted-foreground"},he="group flex items-center gap-3 border-l-4 border-border py-1.5 pr-2 pl-4 transition-colors duration-[180ms] ease-out hover:bg-muted focus-visible:outline-2 focus-visible:outline-ring aria-[current=page]:border-(--line)",K=({mark:t})=>e.jsx("span",{"aria-hidden":"true",className:z("size-2.5 shrink-0 rounded-[2px] border-[1.5px]",xe[t])}),fe=({configurationId:t,groups:a})=>e.jsxs("nav",{"aria-label":de,className:"flex flex-col lg:max-h-[calc(100dvh-7rem)]",children:[e.jsx("div",{className:"min-h-0 overflow-y-auto",children:a.map(s=>e.jsxs("section",{children:[s.title===null?null:e.jsx("div",{className:"flex items-center gap-3 border-l-4 border-border pt-4 pr-2 pb-1 pl-4",children:e.jsx("h3",{className:"min-w-0 flex-1 text-xs leading-4 font-bold text-muted-foreground",children:s.title})}),e.jsx("ul",{children:s.entries.map(n=>e.jsx("li",{children:e.jsxs(I,{to:"/settings/profiles/$id",params:{id:t},search:{field:n.key},"aria-current":n.isOpen?"page":void 0,className:he,children:[e.jsx("span",{className:"min-w-0 flex-1 text-sm leading-5 group-aria-[current=page]:font-bold group-aria-[current=page]:text-signal-text",children:n.label}),e.jsx(K,{mark:n.mark}),e.jsx("span",{className:"sr-only",children:n.markLabel})]})},n.key))})]},s.title??""))}),e.jsx("ul",{"aria-label":ue,className:"flex shrink-0 flex-wrap gap-x-4 gap-y-1 border-t border-border pt-3 text-xs text-muted-foreground",children:me.map(s=>e.jsxs("li",{className:"flex items-center gap-1.5",children:[e.jsx(K,{mark:s.mark}),s.label]},s.mark))})]}),ge="Save",be="Saving…",D=({isPending:t,errorMessage:a,savedMessage:s,unsavedLabel:n=null,question:l=null,children:r})=>e.jsxs("footer",{className:"sticky bottom-0 z-10 mt-6 border-t border-border bg-background py-4 before:absolute before:-inset-x-1 before:inset-y-0 before:-z-10 before:bg-background",children:[l,a===null?null:e.jsx("p",{role:"alert",className:"pb-3 text-sm text-destructive",children:a}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2",children:[r,n===null?e.jsx("p",{role:"status",className:"ml-auto text-sm text-muted-foreground",children:t?null:s}):e.jsx("p",{className:"ml-auto text-sm font-bold",children:n}),e.jsx(m,{type:"submit",disabled:t,children:t?be:ge})]})]}),pe=(t,a)=>t.includes(a)?t.filter(s=>s!==a):[...t,a],je=({label:t,description:a,isChecked:s,onToggle:n})=>{const l=g.useId(),r=g.useId();return e.jsxs("li",{className:"flex items-start gap-3 border-b border-border py-3",children:[e.jsx("input",{id:l,type:"checkbox",checked:s,"aria-describedby":r,className:"mt-1 size-4 shrink-0 accent-(--primary)",onChange:n}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("label",{htmlFor:l,className:"block cursor-pointer font-bold",children:t}),e.jsx("p",{id:r,className:"max-w-[62ch] text-sm text-muted-foreground",children:a})]})]})},ve=t=>{const[a,s]=g.useState(()=>t.contextKinds.filter(n=>n.isRequired).map(n=>n.kind));return e.jsxs("form",{onSubmit:S(()=>{t.onSubmit(a)}),children:[e.jsx("h3",{className:"text-xl leading-7 font-bold",children:t.title}),e.jsx("p",{className:"mt-1 max-w-[62ch] text-muted-foreground",children:t.summary}),e.jsxs("fieldset",{className:"mt-6",children:[e.jsx("legend",{className:"text-sm font-bold",children:t.contextKindsTitle}),e.jsx("p",{className:"max-w-[62ch] pb-2 text-sm text-muted-foreground",children:t.contextKindsHint}),e.jsx("ul",{className:"border-t border-border",children:t.contextKinds.map(n=>e.jsx(je,{label:n.label,description:n.description,isChecked:a.includes(n.kind),onToggle:()=>{s(l=>pe(l,n.kind))}},n.kind))})]}),t.children]})},ke="Prompt configurations • Settings • Flight Plan",Le=()=>{var f,k,L,N,_,B,A,C;const t=O(),a=U(),s=$(),{id:n}=R.useParams(),{field:l=null}=R.useSearch(),{data:r}=q(t.configuration.get.queryOptions({id:n,field:l})),[x,p]=g.useState(0),j=async()=>{await a.invalidateQueries(t.configuration.pathFilter())},o=w(t.configuration.save.mutationOptions({onSuccess:async(d,E)=>{d.kind!=="rejected"&&(await j(),E.change==="reset"&&p(T=>T+1))}})),h=w(t.configuration.create.mutationOptions({onSuccess:async d=>{d.kind!=="rejected"&&(await j(),await s({to:"/settings/profiles/$id",params:{id:d.id}}))}})),u=w(t.configuration.delete.mutationOptions({onSuccess:async d=>{d.kind!=="rejected"&&(await s({to:"/settings/profiles"}),await j())}})),i=((f=o.variables)==null?void 0:f.change)==="rename",b=((k=o.data)==null?void 0:k.kind)==="rejected"?o.data.message:((L=o.error)==null?void 0:L.message)??null,v=(i?b:null)??(((N=h.data)==null?void 0:N.kind)==="rejected"?h.data.message:(_=h.error)==null?void 0:_.message)??(((B=u.data)==null?void 0:B.kind)==="rejected"?u.data.message:(A=u.error)==null?void 0:A.message)??null,y={isPending:o.isPending,errorMessage:i?null:b,savedMessage:((C=o.data)==null?void 0:C.kind)==="saved"&&!i?o.data.message:null},{panel:c}=r;return e.jsxs(e.Fragment,{children:[e.jsx("title",{children:`${r.name} • ${ke}`}),e.jsx(te,{name:r.name,originLabel:r.originLabel,notice:r.notice,canRename:r.canRename,canDelete:r.canDelete,duplicateLabel:r.duplicateLabel,isBusy:h.isPending||u.isPending,errorMessage:v,onDuplicate:()=>{h.mutate({name:null,sourceId:n})},onRename:d=>{o.mutate({change:"rename",id:n,name:d})},onDelete:()=>{u.mutate({id:n})}}),e.jsxs("div",{className:"grid gap-x-10 gap-y-8 lg:grid-cols-[17rem_minmax(0,1fr)]",children:[e.jsx("div",{className:"self-start lg:sticky lg:top-22",children:e.jsx(fe,{configurationId:n,groups:r.index})}),e.jsx("div",{className:"min-w-0",children:c.kind==="switches"?e.jsx(ve,{title:c.title,summary:c.summary,contextKindsTitle:c.contextKindsTitle,contextKindsHint:c.contextKindsHint,contextKinds:c.contextKinds,onSubmit:d=>{o.mutate({change:"switches",id:n,contextCodeBlockKinds:d})},children:e.jsx(D,{...y})},`${n}:${c.contextKinds.map(d=>String(d.isRequired)).join()}`):e.jsx(ce,{title:c.title,summary:c.summary,path:c.path,offMessage:c.offMessage,texts:c.texts,renderActions:(d,E)=>e.jsx(D,{...y,unsavedLabel:d,question:E,children:c.resetLabel===null?null:e.jsx(m,{type:"button",variant:"outline",size:"sm",disabled:o.isPending,onClick:()=>{o.mutate({change:"reset",id:n,path:c.path})},children:c.resetLabel})}),onSubmit:d=>{o.mutate({change:"field",id:n,path:c.path,texts:d})}},`${n}:${c.path}:${String(x)}`)})]})]})};export{Le as component};
@@ -1 +0,0 @@
1
- import{S as r}from"./index-BQaZ5gZR.js";import"./index-DKnoo-kT.js";const n=r;export{n as errorComponent};
@@ -1 +0,0 @@
1
- import{g as u,F as d,M as r,r as p,i as c,j as e}from"./index-DKnoo-kT.js";import{u as m,S as h}from"./index-BZ6iL63Z.js";import{A as f,a as S}from"./index-0VAWT0gs.js";import{S as w}from"./index-BlTfCkr5.js";import"./index-V1avMli5.js";import"./index-BvuPClj3.js";const x="Agent integration • Settings • Flight Plan",A="Agent integration",b=()=>{var l;const o=u(),{data:t}=d(o.settings.get.queryOptions(r)),s=m(),[n,a]=p.useState(null),i=c({...o.setup.browseFolders.queryOptions({path:n??"",purpose:"install-folder"}),enabled:n!==null});return t.section!==r.section?null:e.jsxs(e.Fragment,{children:[e.jsx("title",{children:x}),e.jsx(w,{title:A,children:"Configure which agent you prefer and where Flight Plan installs the agent plugin and the MCP server."}),e.jsxs(f,{agents:t.agents,defaultAgent:t.defaultAgent,problem:s.problem,folderBrowser:n===null?null:i.data??null,folderBrowserErrorMessage:((l=i.error)==null?void 0:l.message)??null,onBrowseFolder:a,onBrowseEnd:()=>{a(null)},onSubmit:g=>{s.save({...r,...g})},children:[e.jsx(S,{}),e.jsx(h,{isPending:s.isPending,errorMessage:s.errorMessage,savedMessage:s.savedMessage})]})]})};export{b as component};
@@ -1 +0,0 @@
1
- import{S as r}from"./index-BQaZ5gZR.js";import"./index-DKnoo-kT.js";const n=r;export{n as errorComponent};
@@ -1 +0,0 @@
1
- import{j as t,S as d,g as h,ab as p,r as l,F as x,i as S,l as v,ac as F}from"./index-DKnoo-kT.js";const j=({creationForm:a,targetSearch:e,onTargetQueryChange:r,onTargetSelect:s})=>t.jsx("div",{className:"grid max-w-208 gap-4",children:t.jsx(d,{label:a.target.label,hint:a.target.hint,placeholder:a.target.placeholder,value:e.value,suggestions:e.options,message:e.message,errorMessage:null,className:"max-w-xl",onValueChange:r,onSelect:s})}),y="Searching…",C="",N=a=>{var o,c;const e=h(),r=p(),[s,i]=l.useState(C),g=l.useDeferredValue(s),{data:u}=x(e.review.creationForm.queryOptions({repositoryName:a})),n=S({...e.review.searchTargets.queryOptions({repositoryName:a,query:g}),placeholderData:v});return{creationForm:u,targetSearch:{value:s,options:((o=n.data)==null?void 0:o.options)??[],message:((c=n.data)==null?void 0:c.message)??(n.isPending?y:null)},onTargetQueryChange:i,onTargetSelect:m=>{r({to:"/pr-reviews/$repoName/$branchId",params:{repoName:a,branchId:m}})}}},Q=()=>{const{repoName:a}=F.useParams(),e=N(a);return t.jsxs(t.Fragment,{children:[t.jsxs("header",{className:"pb-6",children:[t.jsx("h1",{className:"text-4xl leading-10 font-bold tracking-[-0.02em]",children:e.creationForm.title}),t.jsx("p",{className:"mt-2 max-w-[62ch] text-muted-foreground",children:e.creationForm.description})]}),t.jsx(j,{creationForm:e.creationForm,targetSearch:e.targetSearch,onTargetQueryChange:e.onTargetQueryChange,onTargetSelect:e.onTargetSelect})]})};export{Q as component};
@@ -1 +0,0 @@
1
- import{S as r}from"./index-BQaZ5gZR.js";import"./index-DKnoo-kT.js";const n=r;export{n as errorComponent};
@@ -1 +0,0 @@
1
- import{u as t,j as e,B as n,x as r}from"./index-DKnoo-kT.js";const a="The backend did not say what went wrong.",i=({error:o})=>{const s=t();return e.jsxs("section",{role:"alert",className:"max-w-prose",children:[e.jsx("h1",{className:"text-4xl leading-10 font-bold tracking-[-0.02em]",children:"Could not open this page"}),e.jsx("p",{className:"mt-2 text-muted-foreground",children:o instanceof Error?o.message:a}),e.jsxs("div",{className:"mt-4 flex items-center gap-4",children:[e.jsx(n,{onClick:()=>{s.invalidate()},children:"Try again"}),e.jsx(r,{to:"/",className:"underline",children:"Go to your repositories"})]})]})},c=i;export{c as errorComponent};
@@ -1 +0,0 @@
1
- import{r as c,j as e,Y as p,L as f,s as N,g as b,h as j,ab as I,F as C,k as S,x as y,v as L,B as E}from"./index-DKnoo-kT.js";import{S as v}from"./index-BlTfCkr5.js";const w="Name",T="How the configuration is listed when you create a Flight Plan.",k="Start from",A="The new configuration is a copy of the same instructions, yours to change.",B=({sources:i,selectedSourceId:d,nameError:r,sourceError:o,children:t,onSubmit:s})=>{const l=c.useId(),n=c.useId(),m=c.useId(),[u,h]=c.useState(""),[x,g]=c.useState(d);return e.jsxs("form",{onSubmit:N(()=>{s(u,x)}),children:[e.jsxs("div",{className:"max-w-md",children:[e.jsx("label",{htmlFor:l,className:"block text-sm font-bold",children:w}),e.jsx("p",{className:"pb-2 text-sm text-muted-foreground",children:T}),e.jsx(p,{id:l,value:u,"aria-invalid":r!==null,"aria-describedby":r===null?void 0:n,onChange:a=>{h(a.target.value)}}),r===null?null:e.jsx("p",{id:n,role:"alert",className:"pt-1.5 text-sm text-destructive",children:r})]}),e.jsxs("fieldset",{className:"mt-8",children:[e.jsx("legend",{className:"text-sm font-bold",children:k}),e.jsx("p",{className:"max-w-[62ch] pb-2 text-sm text-muted-foreground",children:A}),e.jsx("ul",{className:"border-t border-border",children:i.map(a=>e.jsx("li",{className:"border-b border-border py-3",children:e.jsxs("label",{className:"flex cursor-pointer items-start gap-3",children:[e.jsx("input",{type:"radio",name:m,checked:x===a.id,className:"mt-1 size-4 shrink-0 accent-(--primary)",onChange:()=>{g(a.id)}}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block font-bold",children:a.name}),a.summary===null?null:e.jsx("span",{className:"block max-w-[62ch] text-sm",children:a.summary}),e.jsx(f,{segments:a.details,className:"text-sm text-muted-foreground"})]})]})},a.id))}),o===null?null:e.jsx("p",{role:"alert",className:"pt-2 text-sm text-destructive",children:o})]}),t]})},F="New configuration • Settings • Flight Plan",_="New configuration",P="Create",O="Creating…",M="Cancel",U=()=>{var l;const i=b(),d=j(),r=I(),{data:o}=C(i.configuration.creationForm.queryOptions()),t=S(i.configuration.create.mutationOptions({onSuccess:async n=>{n.kind!=="rejected"&&(await d.invalidateQueries(i.configuration.pathFilter()),await r({to:"/settings/profiles/$id",params:{id:n.id}}))}})),s=((l=t.data)==null?void 0:l.kind)==="rejected"?t.data:null;return e.jsxs(e.Fragment,{children:[e.jsx("title",{children:F}),e.jsx(v,{title:_,children:"Name the configuration and choose what it starts from. You change its instructions on the next page."}),e.jsx(B,{sources:o.sources,selectedSourceId:o.selectedSourceId,nameError:(s==null?void 0:s.field)==="name"?s.message:null,sourceError:(s==null?void 0:s.field)==="source"?s.message:null,onSubmit:(n,m)=>{t.mutate({name:n,sourceId:m})},children:e.jsxs("footer",{className:"mt-6 border-t border-border pt-4",children:[t.error===null?null:e.jsx("p",{role:"alert",className:"pb-3 text-sm text-destructive",children:t.error.message}),e.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[e.jsx(y,{to:"/settings/profiles",className:L({variant:"ghost"}),children:M}),e.jsx(E,{type:"submit",disabled:t.isPending,children:t.isPending?O:P})]})]})})]})};export{U as component};
@@ -1 +0,0 @@
1
- import{j as s,a4 as g,z as h,g as N,h as f,a5 as u,a6 as b,r as j,F as I,k as v,a7 as w,B as y,x as L}from"./index-DKnoo-kT.js";const F=({label:t,className:l})=>s.jsxs("p",{role:"status",className:h("flex items-center gap-2 font-bold",l),children:[s.jsx(g,{"aria-hidden":"true",className:"size-4 motion-safe:animate-spin"}),t]}),R=2e3,k=()=>{var c,d;const t=N(),l=f(),r=u.useSearch(),i=u.useLoaderData(),o=b(r),[p,x]=j.useState(i.importId),{data:e}=I({...t.review.importForm.queryOptions(o),refetchInterval:R}),a=v(t.review.import.mutationOptions({onSuccess:async({importId:n})=>{x(n),await l.invalidateQueries(t.review.importForm.pathFilter())}})),m=((c=a.error)==null?void 0:c.message)??(((d=a.data)==null?void 0:d.importId)===null?a.data.message:i.refusal);return e.isFinished&&e.importId!==null&&e.importId===p?s.jsx(w,{to:"/pr-reviews/$repoName/$branchId",params:{repoName:r.repository,branchId:r.target},replace:!0}):s.jsxs("section",{className:"max-w-prose",children:[s.jsx("h1",{className:"text-4xl leading-10 font-bold tracking-[-0.02em]",children:e.heading}),s.jsx("p",{className:"mt-2 text-muted-foreground",children:e.message}),e.details.length===0?null:s.jsx("dl",{className:"mt-6 grid grid-cols-[auto_minmax(0,1fr)] gap-x-6 gap-y-1 text-sm",children:e.details.map(n=>s.jsxs("div",{className:"contents",children:[s.jsx("dt",{className:"text-muted-foreground",children:n.label}),s.jsx("dd",{className:"font-mono break-all",children:n.value})]},n.label))}),e.warning===null?null:s.jsx("p",{className:"mt-6 font-bold text-signal-text",children:e.warning}),e.isImporting||a.isPending?s.jsx(F,{label:e.pendingLabel,className:"mt-6"}):null,m===null||e.isImporting?null:s.jsx("p",{role:"alert",className:"mt-6 text-destructive",children:m}),s.jsxs("div",{className:"mt-6 flex items-center gap-4",children:[e.submitLabel===null||e.isImporting?null:s.jsx(y,{disabled:a.isPending,onClick:()=>{a.mutate(o)},children:e.submitLabel}),e.reviewHref===null?null:s.jsx(L,{to:"/pr-reviews/$repoName/$branchId",params:{repoName:r.repository,branchId:r.target},className:"underline",children:"Open the review page"})]})]})};export{k as component};
@@ -1 +0,0 @@
1
- import{S as r}from"./index-BQaZ5gZR.js";import"./index-DKnoo-kT.js";const n=r;export{n as errorComponent};
@@ -1 +0,0 @@
1
- import{g as i,F as a,N as n,j as e}from"./index-DKnoo-kT.js";import{u as g,S as c}from"./index-BZ6iL63Z.js";import{F as m}from"./index-iRAoFOv3.js";import{S as d}from"./index-BlTfCkr5.js";const l="Git integration • Settings • Flight Plan",u="Git integration",f=()=>{const o=i(),{data:t}=a(o.settings.get.queryOptions(n)),s=g();return t.section!==n.section?null:e.jsxs(e.Fragment,{children:[e.jsx("title",{children:l}),e.jsxs(d,{title:u,children:["By default, Flight Plan uses the"," ",e.jsx("code",{className:"rounded-sm bg-muted px-1.5 py-0.5 font-mono text-[0.875em]",children:"git"})," ","command to read and fetch your local and remote branches and their commits."]}),e.jsx(m,{codeHostFeatures:t.codeHostFeatures,forges:t.forges,problem:s.problem,onSubmit:r=>{s.save({...n,...r})},children:e.jsx(c,{isPending:s.isPending,errorMessage:s.errorMessage,savedMessage:s.savedMessage})})]})};export{f as component};
@@ -1 +0,0 @@
1
- import{r,j as e,T as R,B as m,Y as A,I as x,D as k,_ as L,a as P,b as F,c as W,d as G,e as B,$ as H,a0 as U,a1 as M,s as z,V as $,W as Y,C as K,X}from"./index-DKnoo-kT.js";import{I as Z}from"./index-V1avMli5.js";const V="Add pattern",q="**/*.stories.tsx",J=t=>`Path pattern ${String(t+1)}`,Q=(t,s,n)=>t.map((a,o)=>o===s?n:a),ee=(t,s)=>t.filter((n,a)=>a!==s),se=({pattern:t,position:s,problemMessage:n,onChange:a,onRemove:o})=>{const i=r.useId(),l=J(s);return e.jsxs("li",{className:"grid gap-1",children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(A,{"aria-label":l,"aria-invalid":n!==null,"aria-describedby":n===null?void 0:i,value:t,placeholder:q,spellCheck:!1,autoComplete:"off",className:"font-mono",onChange:c=>{a(c.target.value)}}),e.jsx(x,{icon:"remove",label:`Remove ${t===""?l:t}`,onClick:o})]}),n===null?null:e.jsx("span",{id:i,className:"text-sm text-destructive",children:n})]})},te=({labelledBy:t,value:s,problem:n,onChange:a})=>{const o=r.useRef(null),i=r.useRef(!1);return r.useEffect(()=>{var l,c;i.current&&(i.current=!1,(c=(l=o.current)==null?void 0:l.querySelector("li:last-child input"))==null||c.focus())},[s.length]),e.jsxs("div",{className:"grid max-w-md gap-3",children:[e.jsx("ol",{ref:o,"aria-labelledby":t,className:"grid gap-2",children:R(s).map(({key:l,item:c},u)=>e.jsx(se,{pattern:c,position:u,problemMessage:(n==null?void 0:n.position)===u?n.message:null,onChange:g=>{a(Q(s,u,g))},onRemove:()=>{a(ee(s,u))}},l))}),e.jsx(m,{type:"button",variant:"outline",className:"w-fit",onClick:()=>{i.current=!0,a([...s,""])},children:V})]})},ne={context:"Context",traceDiagram:"Trace Diagram",blastDiagram:"Blast Diagram",walkthrough:"Code Walkthrough"},T=(t,s,n)=>{const a=s+n;return t.map((o,i)=>i===s?t[a]??o:i===a?t[s]??o:o)},ae=({labelledBy:t,value:s,onChange:n})=>e.jsx("ol",{"aria-labelledby":t,className:"grid max-w-md gap-1",children:s.map((a,o)=>{const i=ne[a];return e.jsxs("li",{className:"flex items-center gap-2 rounded-md border border-border px-2.5 py-1.5",children:[e.jsx("span",{className:"min-w-0 flex-1 font-semibold",children:i}),e.jsx(x,{icon:"previous",label:`Move ${i} up`,isDisabled:o===0,onClick:()=>{n(T(s,o,-1))}}),e.jsx(x,{icon:"next",label:`Move ${i} down`,isDisabled:o===s.length-1,onClick:()=>{n(T(s,o,1))}})]},a)})}),oe="flex h-9 cursor-pointer items-center gap-2 rounded-lg border border-input bg-card pr-3.5 pl-3 text-sm transition-colors duration-[180ms] ease-out select-none hover:bg-muted has-checked:border-foreground has-focus-visible:outline-2 has-focus-visible:outline-offset-2 has-focus-visible:outline-ring",ie="size-4 shrink-0 cursor-pointer accent-(--primary) focus-visible:outline-none",w=({label:t,description:s,isChecked:n,onToggle:a})=>{const o=r.useId();return e.jsxs(e.Fragment,{children:[e.jsxs("label",{className:oe,children:[e.jsx("input",{type:"checkbox",checked:n,"aria-describedby":s===null?void 0:o,className:ie,onChange:a}),e.jsx("span",{className:"text-box-cap",children:t})]}),s===null?null:e.jsx("span",{id:o,className:"sr-only",children:s})]})},re=[{section:"context",label:"Context"},{section:"traceDiagram",label:"Trace Diagram"},{section:"blastDiagram",label:"Blast Diagram"},{section:"walkthrough",label:"Code Walkthrough"},{section:"findings",label:"Findings"}],le=t=>t==="always"?"on-demand":"always",ce=({labelledBy:t,value:s,onChange:n})=>e.jsx("div",{role:"group","aria-labelledby":t,children:e.jsx("ul",{className:"flex flex-wrap gap-2",children:re.map(({section:a,label:o})=>e.jsx("li",{children:e.jsx(w,{label:o,description:null,isChecked:s[a]==="always",onToggle:()=>{n({...s,[a]:le(s[a])})}})},a))})}),de="Show all topics",he="All topics",ue="Pick as many as you like. Each topic says which code it covers.",ge="Done",me="size-4 shrink-0 cursor-pointer accent-(--primary) focus-visible:outline-none",xe="grid cursor-pointer grid-cols-[auto_minmax(0,1fr)] items-start gap-x-3 rounded-sm px-2 py-2.5 transition-colors duration-[180ms] ease-out hover:bg-muted has-focus-visible:outline-2 has-focus-visible:outline-offset-2 has-focus-visible:outline-ring",pe=t=>t.flatMap(s=>s.choices),fe=(t,s,n)=>{const a=s.includes(n);return t.map(o=>o.classification).filter(o=>o===n?!a:s.includes(o))},be=(t,s)=>t.map(n=>({...n,choices:n.choices.filter(a=>a.isFeatured||s.includes(a.classification))})).filter(n=>n.choices.length>0),je=({choice:t,isPicked:s,onToggle:n})=>{const a=r.useId();return e.jsx("li",{className:"border-b border-border",children:e.jsxs("label",{className:xe,children:[e.jsx("input",{type:"checkbox",checked:s,"aria-describedby":a,className:`mt-0.5 ${me}`,onChange:n}),e.jsx("span",{className:"min-w-0 font-bold",children:t.label}),e.jsx("span",{id:a,className:"col-start-2 text-muted-foreground",children:t.description})]})})},Ne=({group:t,picked:s,onToggle:n})=>{const a=r.useId();return e.jsxs("li",{role:"group","aria-labelledby":a,className:"grid items-start gap-x-4 gap-y-2 border-b border-border py-3 sm:grid-cols-[7.5rem_minmax(0,1fr)]",children:[e.jsx("span",{id:a,className:"text-sm font-bold sm:pt-2",children:t.label}),e.jsx("ul",{className:"flex flex-wrap gap-2",children:t.choices.map(o=>e.jsx("li",{children:e.jsx(w,{label:o.label,description:o.description,isChecked:s.includes(o.classification),onToggle:()=>{n(o.classification)}})},o.classification))})]})},Ie=({group:t,picked:s,onToggle:n})=>{const a=r.useId();return e.jsxs("section",{"aria-labelledby":a,children:[e.jsx("h4",{id:a,className:"border-b-2 border-foreground pb-2 font-bold",children:t.label}),e.jsx("ul",{className:"grid gap-x-6 sm:grid-cols-2",children:t.choices.map(o=>e.jsx(je,{choice:o,isPicked:s.includes(o.classification),onToggle:()=>{n(o.classification)}},o.classification))})]})},Te=({groups:t,picked:s,onToggle:n})=>e.jsxs(k,{children:[e.jsx(L,{render:e.jsx(m,{type:"button",variant:"outline"}),children:de}),e.jsxs(P,{className:"gap-5 sm:max-w-3xl",children:[e.jsxs(F,{children:[e.jsx(W,{children:he}),e.jsx(G,{children:ue})]}),e.jsx("div",{className:"-mr-2 grid max-h-[62dvh] gap-6 overflow-y-auto pr-2",children:t.map(a=>e.jsx(Ie,{group:a,picked:s,onToggle:n},a.label))}),e.jsx(B,{children:e.jsx(H,{render:e.jsx(m,{type:"button"}),children:ge})})]})]}),we=({labelledBy:t,groups:s,picked:n,onChange:a})=>{const o=i=>{a(fe(pe(s),n,i))};return e.jsxs("div",{role:"group","aria-labelledby":t,children:[e.jsx("ul",{className:"border-t border-border",children:be(s,n).map(i=>e.jsx(Ne,{group:i,picked:n,onToggle:o},i.label))}),e.jsx("div",{className:"pt-3",children:e.jsx(Te,{groups:s,picked:n,onToggle:o})})]})},Se="text-lg leading-7 font-semibold text-signal-text",Ce="mt-1 max-w-[62ch] pb-4 text-muted-foreground",ye="Which topics do you care about most in a code review?",Oe="Selecting a topic helps Flight Plan organize the changes based on what you think are the most important bits when reviewing a pull request, and makes it easier for you to navigate the changes.",Ee="Which parts should the agent write for you by default?",ve="Pick the sections you want the agent to write in every review. For anything else, you can ask it to explain just the code you want, right from the review.",_e="Which writing style should the agent use?",De="Each prompt configuration gives the agent a different way of writing, from short notes to explanations for someone new to the code. The structure of the review stays the same.",Re="You can fully customize the prompt instructions",Ae="You can make your own prompt configuration in Settings > Prompt configurations and rewrite how the agent words each part of the review, down to its writing style. You can also pick a different configuration each time you create a Flight Plan.",ke="Review organization",Le="Choose whether a review is split into segments.",Pe="Code Walkthrough order",Fe="Choose the order the Code Walkthrough takes you through the changed files.",We="Split reviews into segments",Ge="Flight Plan groups the changed files into segments, each with its own Context, Trace Diagram, Blast Diagram and Code Walkthrough. With segments off, a review is one segment with one Context for the whole change, and each Trace Diagram gets a tab of its own.",Be="Display arrangement",He="Choose the order of the four sections in each segment.",Ue="Ignored files",Me="Flight Plan leaves the files these patterns match out of every review. Write each pattern from the root of the repository, as in a .gitignore. To start with, the list leaves out tests in TypeScript and Python, e2e tests included.",ze="ignoredPaths",$e="Advanced options",Ye="Segments, section order and ignored files",Ke=t=>{var s;return((s=t==null?void 0:t.field)==null?void 0:s.owner)===ze?{position:Number(t.field.name),message:t.message}:null},h=({title:t,intro:s,children:n})=>{const a=r.useId();return e.jsxs("section",{"aria-labelledby":a,children:[e.jsx("h3",{id:a,className:Se,children:t}),e.jsx("p",{className:Ce,children:s}),n(a)]})},Xe=({isOpen:t,onOpenChange:s,children:n})=>e.jsxs($,{open:t,onOpenChange:s,className:"border-t border-border",children:[e.jsxs(Y,{className:"group -mx-2 flex w-[calc(100%+1rem)] cursor-pointer items-center gap-3 rounded-sm px-2 py-4 text-left transition-colors duration-[180ms] ease-out outline-none hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring",children:[e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block text-lg leading-7 font-bold",children:$e}),e.jsx("span",{className:"block text-sm text-muted-foreground",children:Ye})]}),e.jsx(K,{"aria-hidden":"true",className:"size-5 shrink-0 text-muted-foreground transition-transform duration-[180ms] ease-out group-data-[panel-open]:rotate-180"})]}),e.jsx(X,{className:"grid gap-10 pt-6",children:n})]}),Ze=({isSegmented:t,onChange:s})=>{const n=r.useId();return e.jsxs("label",{className:"grid cursor-pointer grid-cols-[auto_minmax(0,1fr)] items-start gap-x-3",children:[e.jsx("input",{type:"checkbox",checked:t,"aria-describedby":n,className:"mt-1 size-4 shrink-0 accent-(--primary)",onChange:a=>{s(a.target.checked)}}),e.jsx("span",{className:"font-bold",children:We}),e.jsx("span",{id:n,className:"col-start-2 max-w-[62ch] text-sm text-muted-foreground",children:Ge})]})},Je=({presets:t,selectedConfigurationId:s,preferences:n,spotlightGroups:a,problem:o,children:i,onSubmit:l})=>{const[c,u]=r.useState(s),[g,S]=r.useState(n.spotlight),[p,C]=r.useState(n.sectionWriteUps),[f,y]=r.useState(n.isSegmented),[b,O]=r.useState(n.walkthroughOrder),[j,E]=r.useState(n.sectionOrder),[N,v]=r.useState(n.ignoredPaths),[_,D]=r.useState(!1),I=Ke(o);return e.jsxs("form",{className:"grid gap-10",onSubmit:z(()=>{l({configurationId:c,preferences:{spotlight:g,sectionWriteUps:p,isSegmented:f,walkthroughOrder:b,sectionOrder:j,ignoredPaths:N}})}),children:[e.jsx(h,{title:ye,intro:Oe,children:d=>e.jsx(we,{labelledBy:d,groups:a,picked:g,onChange:S})}),e.jsx(h,{title:Ee,intro:ve,children:d=>e.jsx(ce,{labelledBy:d,value:p,onChange:C})}),e.jsx(h,{title:_e,intro:De,children:()=>e.jsxs(e.Fragment,{children:[e.jsx(U,{options:t,value:c,onChange:u}),e.jsx(Z,{title:Re,className:"mt-4 max-w-xl",children:Ae})]})}),e.jsx(h,{title:Pe,intro:Fe,children:()=>e.jsx(M,{value:b,onChange:O})}),e.jsxs(Xe,{isOpen:_||I!==null,onOpenChange:D,children:[e.jsx(h,{title:ke,intro:Le,children:()=>e.jsx(Ze,{isSegmented:f,onChange:y})}),e.jsx(h,{title:Be,intro:He,children:d=>e.jsx(ae,{labelledBy:d,value:j,onChange:E})}),e.jsx(h,{title:Ue,intro:Me,children:d=>e.jsx(te,{labelledBy:d,value:N,problem:I,onChange:v})})]}),e.jsx("div",{children:i})]})};export{Je as R};
@@ -1 +0,0 @@
1
- import{j as e,V as $,W as H,C as M,X as G,r,z as B,Y as W,B as Y,Z as U}from"./index-DKnoo-kT.js";import{I as z}from"./index-V1avMli5.js";import{F as q}from"./index-BvuPClj3.js";const V="How does Flight Plan interact with the agent?",X="What Flight Plan builds and what your agent writes",Z="Flight Plan builds the review artifact from the code. Your agent reads the same change and writes the explanations into it, through the Flight Plan plugin and its MCP server. Each time Flight Plan starts, it updates the plugin if its skills changed.",J="What Flight Plan does",K="Flight Plan draws the Trace Diagram and the Blast Diagram, and arranges the Code Walkthrough based on your preferences. You can read a review before your agent writes anything.",Q="What the agent does",ee="How your agent starts",se="rounded-sm bg-muted px-1.5 py-0.5 font-mono text-[0.875em]",ae="Your agent explains why the change exists and how the code works, and points out potential issues as findings. It writes into the review Flight Plan built and cannot change its structure. While you read, you can ask it about the change and it can ask you questions back.",S=({heading:a,text:o})=>e.jsxs("section",{children:[e.jsx("h3",{className:"font-bold",children:a}),e.jsx("p",{className:"mt-1 text-muted-foreground",children:o})]}),te=()=>e.jsxs(z,{title:ee,children:["Flight Plan can open your terminal app and start your agent there. Or you can start it yourself by prompting your agent with"," ",e.jsx("code",{className:se,children:"/flightplan:live <repository>/<target>"}),"."]}),ge=()=>e.jsxs($,{children:[e.jsxs(H,{className:"group -mx-2 flex w-[calc(100%+1rem)] cursor-pointer items-center gap-3 rounded-sm px-2 py-4 text-left transition-colors duration-180 ease-out outline-none hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring",children:[e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block text-lg leading-7 font-bold",children:V}),e.jsx("span",{className:"block text-sm text-muted-foreground",children:X})]}),e.jsx(M,{"aria-hidden":"true",className:"size-5 shrink-0 text-muted-foreground transition-transform duration-180 ease-out group-data-panel-open:rotate-180"})]}),e.jsxs(G,{className:"grid max-w-[62ch] gap-5 pb-2",children:[e.jsx("p",{children:Z}),e.jsx(S,{heading:J,text:K}),e.jsx(S,{heading:Q,text:ae}),e.jsx(te,{})]})]}),ne=({label:a,options:o,value:t,className:g,onChange:u})=>{const f=r.useId();return e.jsxs("fieldset",{className:B("grid gap-1.5",g),children:[e.jsx("legend",{className:"float-left text-sm font-bold",children:a}),e.jsx("span",{className:"clear-left inline-flex w-fit overflow-hidden rounded-lg border border-input bg-card",children:o.map(l=>e.jsxs("label",{className:"flex h-[calc(2rem-2px)] cursor-pointer items-center border-l border-input px-3 text-sm transition-colors duration-[180ms] ease-out first:border-l-0 hover:bg-muted has-checked:bg-foreground has-checked:font-bold has-checked:text-background has-focus-visible:outline-2 has-focus-visible:-outline-offset-2 has-focus-visible:outline-ring",children:[e.jsx("input",{type:"radio",name:f,className:"sr-only",checked:t===l.value,onChange:()=>{u(l.value)}}),e.jsx("span",{className:"text-box-cap",children:l.label})]},l.value))})]})},D="size-4 shrink-0 accent-(--primary)",le="Open folders until you reach the one to install into, then use it.",O="model",T="effort",re=[O,T],oe=()=>{},ie=({option:a,model:o,effort:t,modelErrorMessage:g,effortErrorMessage:u,onModelChange:f,onEffortChange:l})=>{const i=a.modelOptions.find(n=>n.model===o);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-wrap items-start gap-x-6 gap-y-3 pt-3",children:[e.jsx(U,{label:`Model for ${a.label}`,options:a.modelOptions.map(n=>({value:n.model,label:n.label})),value:o,errorMessage:g,className:"w-60",onChange:n=>{const m=a.modelOptions.find(x=>x.model===n);m!==void 0&&f(m)}}),(i==null?void 0:i.hasEffortChoice)===!0?e.jsx(ne,{label:`Effort for ${a.label}`,options:i.effortOptions.map(n=>({value:n.effort,label:n.label})),value:t,onChange:l}):null]}),u===null?null:e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:u})]})},ce=({option:a,groupName:o,isPicked:t,isDefault:g,installPath:u,model:f,effort:l,pathErrorMessage:i,modelErrorMessage:n,effortErrorMessage:m,onPickedChange:x,onDefaultChange:E,onInstallPathChange:N,onModelChange:y,onEffortChange:C,onBrowse:A})=>{const p=r.useId(),b=r.useId(),v=r.useId(),w=i!==null,c=a.unavailableReason===null;return e.jsxs("li",{className:"border-b border-border py-3",children:[e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsxs("label",{className:B("flex min-w-0 flex-1 items-start gap-3",c?"cursor-pointer":""),children:[e.jsx("input",{type:"checkbox",checked:t,disabled:!c,className:`${D} mt-0.5`,onChange:j=>{x(j.target.checked)}}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"font-bold",children:a.label}),a.unavailableReason===null?null:e.jsxs("span",{className:"block max-w-[62ch] text-sm text-destructive",children:[e.jsx("span",{className:"font-bold",children:"Unavailable."}),` ${a.unavailableReason}`]})]})]}),e.jsxs("label",{className:"flex cursor-pointer items-center gap-2 pt-0.5 text-sm has-disabled:cursor-default has-disabled:text-muted-foreground",children:[e.jsx("input",{type:"radio",name:o,checked:g,disabled:!t,className:D,onChange:E}),e.jsx("span",{"aria-hidden":"true",className:"text-box-cap",children:"Default"}),e.jsx("span",{className:"sr-only",children:`Default agent: ${a.label}`})]})]}),t?e.jsxs("div",{className:"mt-3 grid gap-1.5 pl-7",children:[e.jsx("label",{htmlFor:p,className:"text-sm font-bold",children:`Install folder for ${a.label}`}),e.jsx("p",{id:b,className:"text-sm text-muted-foreground",children:a.pathHint}),e.jsxs("div",{className:"flex max-w-xl items-center gap-2",children:[e.jsx(W,{id:p,value:u,autoComplete:"off",spellCheck:!1,"aria-invalid":w,"aria-describedby":w?`${b} ${v}`:b,className:"min-w-0 flex-1 font-mono",onChange:j=>{N(j.target.value)}}),e.jsx(Y,{type:"button",variant:"outline","aria-label":`Browse for the ${a.label} install folder`,onClick:A,children:"Browse"})]}),w?e.jsx("p",{id:v,role:"alert",className:"text-sm text-destructive",children:i}):null,e.jsx(ie,{option:a,model:f,effort:l,modelErrorMessage:n,effortErrorMessage:m,onModelChange:y,onEffortChange:C})]}):null]})},fe=({agents:a,defaultAgent:o,problem:t,children:g,folderBrowser:u,folderBrowserErrorMessage:f,onBrowseFolder:l,onBrowseEnd:i,onSubmit:n})=>{const m=r.useId(),[x,E]=r.useState(()=>Object.fromEntries(a.map(s=>[s.agent,s.isPicked]))),[N,y]=r.useState(()=>Object.fromEntries(a.map(s=>[s.agent,s.installPath]))),[C,A]=r.useState(()=>Object.fromEntries(a.map(s=>[s.agent,s.model]))),[p,b]=r.useState(()=>Object.fromEntries(a.map(s=>[s.agent,s.effort]))),[v,w]=r.useState(o),[c,j]=r.useState(null),R=s=>{j(s),l(N[s.agent]??"")},k=()=>{j(null),i()},L=s=>{c!==null&&y(I=>({...I,[c.agent]:s})),k()},_=()=>{n({agents:a.map(s=>({agent:s.agent,isPicked:x[s.agent]??!1,installPath:N[s.agent]??"",model:C[s.agent]??s.model,effort:p[s.agent]??s.effort})),defaultAgent:v})};return e.jsxs("form",{onSubmit:s=>{s.preventDefault(),_()},children:[e.jsx("ul",{className:"border-t border-border",children:a.map(s=>{var I,P,F;return e.jsx(ce,{option:s,groupName:m,isPicked:x[s.agent]??!1,isDefault:v===s.agent,installPath:N[s.agent]??"",model:C[s.agent]??s.model,effort:p[s.agent]??s.effort,pathErrorMessage:((I=t==null?void 0:t.field)==null?void 0:I.owner)===s.agent&&!re.includes(t.field.name)?t.message:null,modelErrorMessage:((P=t==null?void 0:t.field)==null?void 0:P.owner)===s.agent&&t.field.name===O?t.message:null,effortErrorMessage:((F=t==null?void 0:t.field)==null?void 0:F.owner)===s.agent&&t.field.name===T?t.message:null,onPickedChange:h=>{E(d=>({...d,[s.agent]:h}))},onDefaultChange:()=>{w(s.agent)},onInstallPathChange:h=>{y(d=>({...d,[s.agent]:h}))},onModelChange:h=>{A(d=>({...d,[s.agent]:h.model})),b(d=>({...d,[s.agent]:h.selectedEffort}))},onEffortChange:h=>{b(d=>({...d,[s.agent]:h}))},onBrowse:()=>{R(s)}},s.agent)})}),g,e.jsx(q,{isOpen:c!==null,title:`Install folder for ${(c==null?void 0:c.label)??""}`,description:le,browser:u,errorMessage:f,onOpenFolder:l,onChooseRepository:oe,onChooseFolder:L,onClose:k})]})};export{fe as A,ge as a};
@@ -1 +0,0 @@
1
- import{g as S,h as y,k as I,r as a,j as e,Y as A,B as p,s as k}from"./index-DKnoo-kT.js";import{T as N}from"./index-DfKNJbUM.js";const w=(d,{segmentId:h,waypointId:g},u)=>{var n,i;const t=S(),l=y(),s=I(t.review.editWalkthrough.mutationOptions({onSuccess:async r=>{r.kind==="saved"&&(await l.invalidateQueries(t.review.get.pathFilter()),u())}})),c=((n=s.data)==null?void 0:n.kind)==="rejected"?s.data.message:null;return{isSaving:s.isPending,errorMessage:c??((i=s.error)==null?void 0:i.message)??null,onSave:r=>{s.mutate({...d,segmentId:h,edit:{kind:"change-waypoint",waypointId:g,...r}})}}},R="Title",j="Reading",_="Say what you changed in this code and what the change is for.",L="Core change",M="Mark this change as an important part of the code review. This helps the reviewer see where to look first.",v="Additional context (optional)",O="Say why this change is important, or what the reviewer should check in it.",W=({reviewKey:d,segmentId:h,waypointId:g,legend:u,text:t,renderCodeLinkDialog:l,onClose:s})=>{const c=a.useId(),n=a.useId(),[i,r]=a.useState(t.title),[C,T]=a.useState(t.reading),[m,f]=a.useState(t.coreChange!==null),[E,b]=a.useState(t.coreChange??""),o=w(d,{segmentId:h,waypointId:g},s);return e.jsxs("form",{"aria-label":u,onSubmit:k(()=>{o.onSave({title:i,reading:C,coreChange:m?E:null})}),className:"grid gap-3",children:[e.jsxs("div",{className:"grid gap-1.5",children:[e.jsx("label",{htmlFor:c,className:"text-sm font-bold",children:R}),e.jsx(A,{id:c,value:i,onChange:x=>{r(x.target.value)}})]}),e.jsxs("div",{className:"grid gap-1.5",children:[e.jsx("p",{"aria-hidden":"true",className:"text-sm font-bold",children:j}),e.jsx("p",{className:"text-sm text-muted-foreground",children:_}),e.jsx(N,{label:j,value:t.reading,errorMessage:null,renderCodeLinkDialog:l,onChange:T})]}),e.jsxs("label",{className:"flex items-center gap-2 text-sm font-bold",children:[e.jsx("input",{type:"checkbox","aria-describedby":n,checked:m,onChange:x=>{f(x.target.checked)}}),L]}),e.jsx("p",{id:n,className:"-mt-2 text-sm text-muted-foreground",children:M}),e.jsxs("div",{hidden:!m,className:"grid gap-1.5",children:[e.jsx("p",{"aria-hidden":"true",className:"text-sm font-bold",children:v}),e.jsx("p",{className:"text-sm text-muted-foreground",children:O}),e.jsx(N,{label:v,value:t.coreChange??"",errorMessage:null,renderCodeLinkDialog:l,onChange:b})]}),o.errorMessage===null?null:e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:o.errorMessage}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(p,{type:"button",variant:"ghost",onClick:s,children:"Cancel"}),e.jsx(p,{type:"submit",disabled:o.isSaving,children:o.isSaving?"Saving…":"Save"})]})]})};export{W as default};
@@ -1 +0,0 @@
1
- import{u as n,j as t,B as a}from"./index-DKnoo-kT.js";const o="The backend did not say what went wrong.",i=({error:e})=>{const s=n();return t.jsxs("section",{role:"alert",className:"max-w-prose",children:[t.jsx("h2",{className:"text-2xl leading-8 font-bold tracking-[-0.015em]",children:"Could not load the settings"}),t.jsx("p",{className:"mt-2 text-muted-foreground",children:e instanceof Error?e.message:o}),t.jsx(a,{className:"mt-4",onClick:()=>{s.invalidate()},children:"Try again"})]})};export{i as S};
@@ -1 +0,0 @@
1
- import{g as u,h as c,k as d,j as a,B as m}from"./index-DKnoo-kT.js";const v=()=>{var r,l;const s=u(),t=c(),e=d(s.settings.save.mutationOptions({onSuccess:async o=>{o.kind!=="rejected"&&(t.removeQueries({type:"inactive"}),await t.invalidateQueries(s.settings.pathFilter()))}})),i=((r=e.data)==null?void 0:r.kind)==="rejected"?e.data:null,n=e.error===null?i:{message:e.error.message,field:null};return{problem:n,errorMessage:n!==null&&n.field===null?n.message:null,savedMessage:((l=e.data)==null?void 0:l.kind)==="saved"?e.data.message:null,isPending:e.isPending,save:e.mutate}},g="Save",p="Saving…",j=({isPending:s,errorMessage:t,savedMessage:e})=>a.jsxs("footer",{className:"mt-6 border-t border-border pt-4",children:[t===null?null:a.jsx("p",{role:"alert",className:"pb-3 text-sm text-destructive",children:t}),a.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-x-4 gap-y-2",children:[a.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:s?null:e}),a.jsx(m,{type:"submit",disabled:s,children:s?p:g})]})]});export{j as S,v as u};
@@ -1 +0,0 @@
1
- import{g as j,h as S,k as y,r as v,j as a,Z as b,B as h,s as R}from"./index-DKnoo-kT.js";import{T as M}from"./index-DfKNJbUM.js";const T=(u,d,t)=>{var r,c;const e=j(),p=S(),s=y(e.review.editBlast.mutationOptions({onSuccess:async n=>{n.kind==="saved"&&(await p.invalidateQueries(e.review.get.pathFilter()),t())}})),i=((r=s.data)==null?void 0:r.kind)==="rejected"?s.data.message:null;return{isSaving:s.isPending,errorMessage:i??((c=s.error)==null?void 0:c.message)??null,onSave:n=>{s.mutate({...u,path:d,...n})}}},C=({reviewKey:u,path:d,assessment:t,form:e,renderCodeLinkDialog:p,onClose:s})=>{const[i,r]=v.useState(t.impactType),[c,n]=v.useState(t.impactReason),o=T(u,d,s),g=e.choices.some(l=>l.value===i&&l.hasReason);return a.jsxs("form",{onSubmit:R(()=>{o.onSave({impactType:i,impactReason:c})}),className:"grid gap-3",children:[a.jsx(b,{label:e.impactTypeLabel,options:e.choices,value:i,errorMessage:g?null:o.errorMessage,onChange:l=>{const m=e.choices.find(x=>x.value===l);m!==void 0&&r(m.value)}}),a.jsx("div",{hidden:!g,children:a.jsx(M,{label:e.impactReasonLabel,value:t.impactReason,errorMessage:g?o.errorMessage:null,renderCodeLinkDialog:p,onChange:n})}),a.jsxs("div",{className:"flex justify-end gap-2",children:[a.jsx(h,{type:"button",variant:"ghost",onClick:s,children:"Cancel"}),a.jsx(h,{type:"submit",disabled:o.isSaving,children:o.isSaving?"Saving…":"Save"})]})]})};export{C as default};
@@ -1 +0,0 @@
1
- import{j as t}from"./index-DKnoo-kT.js";const x=({title:e,children:s})=>t.jsxs("header",{className:"pb-6",children:[t.jsx("h2",{className:"text-2xl leading-8 font-bold tracking-[-0.015em] text-signal-text",children:e}),t.jsx("p",{className:"mt-2 max-w-[62ch] text-muted-foreground",children:s})]});export{x as S};
@@ -1 +0,0 @@
1
- import{j as e,D as p,a as h,b as m,c as u,d as j,e as g,B as l,z as f}from"./index-DKnoo-kT.js";const N={repository:"font-bold","added-repository":"text-muted-foreground",folder:""},b=({folder:t,onOpenFolder:a,onChooseRepository:s})=>t.kind==="added-repository"?null:t.kind==="repository"?e.jsx(l,{type:"button",size:"sm","aria-label":`Choose ${t.name}`,onClick:()=>{s(t.path)},children:"Choose"}):e.jsx(l,{type:"button",variant:"outline",size:"sm","aria-label":`Open ${t.name}`,onClick:()=>{a(t.path)},children:"Open"}),y=({browser:t,onOpenFolder:a,onChooseRepository:s})=>e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("p",{className:"min-w-0 flex-1 font-mono text-[0.82rem] wrap-anywhere",children:t.path}),t.parentPath===null?null:e.jsx(l,{type:"button",variant:"outline",size:"sm",onClick:()=>{t.parentPath!==null&&a(t.parentPath)},children:"Up one folder"})]}),t.message===null?e.jsx("ul",{className:"max-h-[calc(20rem+1px)] overflow-y-auto border-t border-border",children:t.folders.map(n=>e.jsxs("li",{className:"flex h-10 items-center gap-3 border-b border-border",children:[e.jsx("span",{className:f("min-w-0 flex-1 truncate",N[n.kind]),children:n.name}),e.jsx("span",{className:"text-muted-foreground",children:n.kindLabel}),e.jsx(b,{folder:n,onOpenFolder:a,onChooseRepository:s})]},n.path))}):e.jsx("p",{className:"border-t border-border pt-3 text-muted-foreground",children:t.message})]}),k=({isOpen:t,title:a,description:s,browser:n,errorMessage:i,onOpenFolder:o,onChooseRepository:d,onChooseFolder:r,onClose:c})=>e.jsx(p,{open:t,onOpenChange:x=>{x||c()},children:e.jsxs(h,{children:[e.jsxs(m,{children:[e.jsx(u,{children:a}),e.jsx(j,{children:s})]}),n===null?e.jsx("p",{role:"status",className:"text-muted-foreground",children:"Reading the folder…"}):e.jsx(y,{browser:n,onOpenFolder:o,onChooseRepository:d}),i===null?null:e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:i}),n===null||r===null?null:e.jsx(g,{children:e.jsx(l,{type:"button",onClick:()=>{r(n.path)},children:"Use this folder"})})]})});export{k as F};
@@ -1 +0,0 @@
1
- import{S as r}from"./index-BQaZ5gZR.js";import"./index-DKnoo-kT.js";const n=r;export{n as errorComponent};
@@ -1 +0,0 @@
1
- import{j as e,x as b,L as v,B as y,g as I,h as k,ab as C,F as E,k as f,r as L,v as P}from"./index-DKnoo-kT.js";import{S}from"./index-BlTfCkr5.js";const D="-mx-3 block min-w-0 flex-1 rounded-sm px-3 py-2.5 transition-colors duration-[180ms] ease-out hover:bg-muted focus-visible:outline-2 focus-visible:outline-ring",w=({title:i,rows:r,emptyMessage:l,defaultChoice:a,isDuplicating:o,onDuplicate:n})=>e.jsxs("section",{className:"border-t-2 border-foreground pt-5 pb-6",children:[e.jsx("h3",{className:"pb-2 text-xl leading-7 font-bold",children:i}),l===null?null:e.jsx("p",{className:"max-w-[62ch] text-sm text-muted-foreground",children:l}),e.jsx("ul",{children:r.map(t=>e.jsxs("li",{className:"flex items-center gap-4 border-b border-border first:border-t",children:[e.jsxs(b,{to:"/settings/profiles/$id",params:{id:t.id},className:D,children:[e.jsx("span",{className:"font-bold underline decoration-input decoration-1 underline-offset-[0.3em]",children:t.name}),t.summary===null?null:e.jsx("span",{className:"block max-w-[62ch] text-sm",children:t.summary}),e.jsx(v,{segments:t.details,className:"text-sm text-muted-foreground"})]}),e.jsxs("label",{className:"flex shrink-0 cursor-pointer items-center gap-2 text-sm has-disabled:cursor-default has-disabled:text-muted-foreground",children:[e.jsx("input",{type:"radio",name:a.groupName,checked:a.chosenId===t.id,disabled:a.isPending,className:"size-4 shrink-0 accent-primary",onChange:()=>{a.onChoose(t.id)}}),e.jsx("span",{"aria-hidden":"true",className:"text-box-cap",children:a.label}),e.jsx("span",{className:"sr-only",children:t.defaultChoiceLabel})]}),e.jsx(y,{type:"button",variant:"outline",size:"sm","aria-label":t.duplicateName,disabled:o,onClick:()=>{n(t.id)},children:t.duplicateLabel})]},t.id))})]}),F="Prompt configurations • Settings • Flight Plan",T="Prompt configurations",O="New configuration",R=()=>{var m,p,g,h,x;const i=I(),r=k(),l=C(),{data:a}=E(i.configuration.list.queryOptions()),o=f(i.configuration.create.mutationOptions({onSuccess:async s=>{s.kind!=="rejected"&&(await r.invalidateQueries(i.configuration.pathFilter()),await l({to:"/settings/profiles/$id",params:{id:s.id}}))}})),n=f(i.settings.save.mutationOptions({onSuccess:async()=>{r.removeQueries({...i.settings.pathFilter(),type:"inactive"}),await r.invalidateQueries(i.configuration.pathFilter())}})),t=L.useId(),d=((m=o.data)==null?void 0:m.kind)==="rejected"?o.data.message:((p=o.error)==null?void 0:p.message)??null,u=((g=n.data)==null?void 0:g.kind)==="rejected"?n.data.message:((h=n.error)==null?void 0:h.message)??null,j=((x=a.groups.flatMap(s=>s.rows).find(s=>s.isDefault))==null?void 0:x.id)??"",N=(n.isPending&&n.variables.section==="configuration"?n.variables.configurationId:null)??j;return e.jsxs(e.Fragment,{children:[e.jsx("title",{children:F}),e.jsx(S,{title:T,children:"A prompt configuration is the set of instructions the agent follows when it writes a review: the tone it writes in and how it words each part. A new Flight Plan uses the default unless you pick another. Open one to read or change its instructions, or duplicate one to make your own."}),e.jsx("div",{className:"pb-6",children:e.jsx(b,{to:"/settings/profiles/create",className:P(),children:O})}),d===null?null:e.jsx("p",{role:"alert",className:"pb-4 text-sm text-destructive",children:d}),u===null?null:e.jsx("p",{role:"alert",className:"pb-4 text-sm text-destructive",children:u}),a.groups.map(s=>e.jsx(w,{title:s.title,rows:s.rows,emptyMessage:s.emptyMessage,defaultChoice:{groupName:t,label:a.defaultChoiceHeading,chosenId:N,isPending:n.isPending,onChoose:c=>{n.mutate({section:"configuration",configurationId:c})}},isDuplicating:o.isPending,onDuplicate:c=>{o.mutate({name:null,sourceId:c})}},s.title))]})};export{R as component};
@@ -1 +0,0 @@
1
- import{j as e,x as Q,v as J,B as K,w as W,z,T as X,L as Y,g as F,h as Z,U as V,r as N,G as ee,F as se,k as b,J as te,K as ne,i as k,l as $}from"./index-DKnoo-kT.js";import{P as oe}from"./index-CqVakH8R.js";import{u as re,a as ae,A as ie}from"./index-Dv5cF6qF.js";import{R as le,t as ce}from"./index-DG0FDX8u.js";import{A as ue,a as de}from"./index-0VAWT0gs.js";import{R as pe}from"./index--nj01XKS.js";import{F as me}from"./index-iRAoFOv3.js";import"./index-BvuPClj3.js";import"./index-V1avMli5.js";const ge="Back",he="Skip for now",R=({backStep:s,submitLabel:t,pendingLabel:a,isPending:i,isReady:c=!0,hint:r=null,errorMessage:u,onSkip:n=null})=>e.jsxs("footer",{className:"mt-6 border-t border-border pt-4",children:[u===null?null:e.jsx("p",{role:"alert",className:"pb-3 text-sm text-destructive",children:u}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2",children:[s===null?null:e.jsx(Q,{to:"/setup",search:{step:s},className:J({variant:"ghost"}),children:e.jsx("span",{className:"text-box-cap",children:ge})}),e.jsx("span",{className:"flex-1"}),r===null?null:e.jsx("p",{className:"text-sm text-muted-foreground",children:r}),n===null?null:e.jsx(K,{type:"button",variant:"outline",disabled:i,onClick:n,children:he}),e.jsx(K,{type:"submit",disabled:i||!c,children:i?a:t})]})]}),T=({title:s,children:t})=>e.jsxs("header",{className:"pb-6",children:[e.jsx("h2",{className:"text-2xl leading-8 font-bold tracking-[-0.015em] text-signal-text",children:s}),e.jsx("p",{className:"mt-2 max-w-[62ch] text-muted-foreground",children:t})]}),xe="Agent integration",fe=({backStep:s,problem:t,isPending:a,...i})=>e.jsxs(e.Fragment,{children:[e.jsx(T,{title:xe,children:"Configure which agent you prefer and where Flight Plan installs the agent plugin and the MCP server."}),e.jsxs(ue,{...i,problem:t,children:[e.jsx(de,{}),e.jsx(R,{backStep:s,submitLabel:"Save and continue",pendingLabel:"Saving…",isPending:a,errorMessage:t!==null&&t.field===null?t.message:null})]})]}),Se=({presets:s,selectedConfigurationId:t,preferences:a,spotlightGroups:i,backStep:c,problem:r,isPending:u,onSubmit:n})=>e.jsx(pe,{presets:s,selectedConfigurationId:t,preferences:a,spotlightGroups:i,problem:r,onSubmit:n,children:e.jsx(R,{backStep:c,submitLabel:"Finish setup",pendingLabel:"Finishing…",isPending:u,errorMessage:r!==null&&r.field===null?r.message:null})}),je="Git integration",ye=({backStep:s,problem:t,isPending:a,onSkip:i,...c})=>e.jsxs(e.Fragment,{children:[e.jsxs(T,{title:je,children:["By default, Flight Plan uses the"," ",e.jsx("code",{className:"rounded-sm bg-muted px-1.5 py-0.5 font-mono text-[0.875em]",children:"git"})," ","command to read and fetch your local and remote branches and their commits."]}),e.jsx(me,{...c,problem:t,children:e.jsx(R,{backStep:s,submitLabel:"Save and continue",pendingLabel:"Saving…",isPending:a,errorMessage:t!==null&&t.field===null?t.message:null,onSkip:i})})]}),be="Select your repositories",ve=({isReadyToContinue:s,continueHint:t,backStep:a,errorMessage:i,isPending:c,onContinue:r,...u})=>e.jsxs("form",{onSubmit:n=>{n.preventDefault(),r()},children:[e.jsx(T,{title:be,children:"Choose the repositories you review. Flight Plan shows their pull requests and branches on your home page."}),e.jsx(le,{...u}),e.jsx(R,{backStep:a,submitLabel:"Save and continue",pendingLabel:"Saving…",isPending:c,isReady:s,hint:t,errorMessage:i})]}),Ne="Setup steps",Ae={saved:"merged",current:"no-review",upcoming:"draft"},we={saved:"text-signal-text",current:"font-bold text-signal-text",upcoming:"text-muted-foreground"},Re=({stop:s})=>s.state==="current"?e.jsx("span",{"aria-current":"step",children:s.label}):s.isReachable?e.jsx(Q,{to:"/setup",search:{step:s.step},className:"rounded-sm underline decoration-input underline-offset-4 hover:decoration-foreground",children:s.label}):e.jsx("span",{children:s.label}),Ee=({stops:s})=>e.jsx("nav",{"aria-label":Ne,children:e.jsx("ol",{children:s.map(t=>e.jsxs("li",{className:"group grid min-h-22 grid-cols-[2.5rem_minmax(0,1fr)]",children:[e.jsxs("span",{"aria-hidden":"true",className:"flex flex-col items-center",children:[e.jsx("span",{className:"h-0.5 w-1 bg-(--line) group-first:invisible"}),e.jsx(W,{status:Ae[t.state]}),e.jsx("span",{className:"w-1 flex-1 bg-(--line) group-last:invisible"})]}),e.jsxs("div",{className:"pb-5",children:[e.jsxs("p",{className:z("leading-6",we[t.state]),children:[e.jsx(Re,{stop:t}),e.jsx("span",{className:"sr-only",children:`, ${t.stateLabel}`})]}),X(t.lines).map(a=>e.jsx(Y,{segments:a.item,className:"text-sm text-muted-foreground"},a.key))]})]},t.step))})}),Pe="[--line:var(--primary)]",Le="Setup",Ce="Setup • Flight Plan",ke="Searching…",Fe="Looking for your recent repositories…",Te=6e4,Be=({repositories:s,isReadyToContinue:t,continueHint:a,backStep:i,errorMessage:c,isPending:r,onChanged:u,onContinue:n})=>{var B,I,O,_,M,G,q,D,H,U;const g=F(),[x,v]=N.useState(!1),[p,A]=N.useState(null),d=re(x),S=ae({isEnabled:x,folderPath:d.search.query,repositoryName:null,saved:null}),m=N.useDeferredValue(p),h=k({...g.setup.recentRepositories.queryOptions({}),staleTime:Te,placeholderData:$}),o=k({...g.setup.searchAuthors.queryOptions({repositoryName:(m==null?void 0:m.repositoryName)??"",role:(m==null?void 0:m.role)??"tracked",query:(m==null?void 0:m.query)??""}),enabled:m!==null,placeholderData:$}),f=b(g.setup.addRepository.mutationOptions({onSuccess:async()=>{v(!1),d.reset(),S.reset(),await u()}})),y=b(g.setup.addRepository.mutationOptions({onSuccess:u})),l=b(g.setup.removeRepository.mutationOptions({onSuccess:u})),w=b(g.setup.setAuthorTracking.mutationOptions({onSuccess:u})),E=()=>{f.reset(),d.reset(),S.reset(),v(!1)},P=h.isPending?Fe:((B=h.error)==null?void 0:B.message)??((I=h.data)==null?void 0:I.message)??null;return e.jsxs(e.Fragment,{children:[e.jsx(ve,{rows:ce(((O=h.data)==null?void 0:O.repositories)??[],s),listMessage:P,repositoryErrorMessage:((_=y.error)==null?void 0:_.message)??((M=l.error)==null?void 0:M.message)??null,isChangingRepositories:y.isPending||l.isPending,authorSearch:{repositoryName:(p==null?void 0:p.repositoryName)??null,role:(p==null?void 0:p.role)??null,query:(p==null?void 0:p.query)??"",options:((G=o.data)==null?void 0:G.options)??[],message:((q=o.data)==null?void 0:q.message)??(o.isPending?ke:null),errorMessage:((D=o.error)==null?void 0:D.message)??((H=w.error)==null?void 0:H.message)??null},isReadyToContinue:t,continueHint:a,backStep:i,errorMessage:c,isPending:r,onOpenAddRepository:()=>{v(!0)},onFollow:j=>{l.reset(),y.mutate({path:j,trackedAuthorIds:[]})},onUnfollow:j=>{y.reset(),l.mutate({name:j})},onAuthorQueryChange:(j,L,C)=>{A({repositoryName:j,role:L,query:C})},onAuthorTrackingChange:(j,L,C)=>{A(null),w.mutate({repositoryName:j,authorId:L,isTracked:C})},onContinue:n}),e.jsx(ie,{isOpen:x,search:d.search,browse:d.browse,authors:S.authors,isAdding:f.isPending,errorMessage:((U=f.error)==null?void 0:U.message)??null,onQueryChange:d.onQueryChange,onChooseFolder:j=>{f.reset(),d.onChooseFolder(j)},onAuthorQueryChange:S.onAuthorQueryChange,onAuthorSelect:S.onAuthorSelect,onTrackedAuthorRemove:S.onTrackedAuthorRemove,onSubmit:()=>{f.mutate({path:d.search.query,...S.selection})},onBrowse:()=>{f.reset(),d.onBrowse()},onBrowseFolder:d.onBrowseFolder,onBrowseClose:()=>{f.reset(),d.onBrowseClose()},onClose:E})]})},Ie=({form:s})=>{var r;const t=F(),[a,i]=N.useState(null),c=k({...t.setup.browseFolders.queryOptions({path:a??"",purpose:"install-folder"}),enabled:a!==null});return e.jsx(fe,{...s,folderBrowser:a===null?null:c.data??null,folderBrowserErrorMessage:((r=c.error)==null?void 0:r.message)??null,onBrowseFolder:i,onBrowseEnd:()=>{i(null)}})},Ve=()=>{var f,y;const s=F(),t=Z(),a=V.useNavigate(),i=N.use(ee),{step:c=null}=V.useSearch(),{data:r}=se(s.setup.get.queryOptions({step:c})),u=async()=>{t.removeQueries({...s.setup.pathFilter(),type:"inactive"}),await t.invalidateQueries(s.setup.pathFilter())},n=b(s.setup.saveStep.mutationOptions({onSuccess:async l=>{l.kind!=="rejected"&&(await u(),await a({search:{step:l.nextStep}}))}})),g=b(s.setup.complete.mutationOptions({onSuccess:async l=>{t.removeQueries({type:"inactive"}),await a({to:l.redirectTo})}})),x=b(s.reviewPreferences.save.mutationOptions()),v=({configurationId:l,preferences:w})=>{n.reset(),x.mutate(w,{onSuccess:E=>{E.kind!=="rejected"&&n.mutate({step:"configuration",configurationId:l},{onSuccess:P=>{P.kind==="accepted"&&g.mutate({})}})}})},p=((f=x.data)==null?void 0:f.kind)==="rejected"?x.data:null,A=x.error===null?p:{message:x.error.message,field:null},d=((y=n.data)==null?void 0:y.kind)==="rejected"?n.data:null,S=n.error===null?d:{message:n.error.message,field:null},m=A??S,h=g.error===null?m:{message:g.error.message,field:null},{form:o}=r;return e.jsxs(e.Fragment,{children:[e.jsx("title",{children:Ce}),i===null?null:te.createPortal(e.jsxs(e.Fragment,{children:[e.jsx(ne,{lineColor:"primary"}),e.jsxs("p",{className:"flex items-baseline gap-3",children:[e.jsx("span",{className:"font-bold",children:Le}),e.jsx("span",{className:"text-sm text-sign-muted tabular-nums",children:r.progressLabel})]})]}),i),e.jsxs("header",{className:"pb-8",children:[e.jsx("h1",{className:oe,children:"Welcome to Flight Plan"}),e.jsx("p",{className:"mt-1 max-w-[62ch] text-muted-foreground",children:"Let's get you ready for your first review. It takes four short steps, and each one is saved as you go, so you can stop and pick up where you left off."})]}),e.jsxs("div",{className:z("grid gap-x-10 gap-y-8 lg:grid-cols-[17rem_minmax(0,1fr)]",Pe),children:[e.jsx("div",{className:"self-start lg:sticky lg:top-22",children:e.jsx(Ee,{stops:r.route})}),e.jsxs("div",{className:"min-w-0",children:[o.step==="agents"?e.jsx(Ie,{form:{agents:o.agents,defaultAgent:o.defaultAgent,backStep:r.backStep,problem:h,isPending:n.isPending,onSubmit:l=>{n.mutate({step:"agents",...l})}}},o.step):null,o.step==="forges"?e.jsx(ye,{codeHostFeatures:o.codeHostFeatures,forges:o.forges,backStep:r.backStep,problem:h,isPending:n.isPending,onSubmit:l=>{n.mutate({step:"forges",...l})},onSkip:()=>{n.mutate({step:"forges",forges:[]})}},o.step):null,o.step==="configuration"?e.jsx(Se,{presets:o.presets,selectedConfigurationId:o.selectedConfigurationId,preferences:o.preferences,spotlightGroups:o.spotlightGroups,backStep:r.backStep,problem:h,isPending:x.isPending||n.isPending||g.isPending,onSubmit:v},o.step):null,o.step==="repositories"?e.jsx(Be,{repositories:o.repositories,isReadyToContinue:o.isReadyToContinue,continueHint:o.continueHint,backStep:r.backStep,errorMessage:(h==null?void 0:h.message)??null,isPending:n.isPending,onChanged:u,onContinue:()=>{n.mutate({step:"repositories"})}}):null]})]})]})};export{Ve as component};
@@ -1 +0,0 @@
1
- import{j as e,D as H,a as B,b as z,c as U,d as G,S as te,e as F,B as f,f as $,g as V,h as K,r as b,i as W,k as v,l as re,s as le,m as ie,n as oe,C as ce,o as de,p as me,q as ue,t as xe,A as D,L as S,v as J,w as X,x as he,y as pe,z as Y,I as Q,E as ge,R as M,F as fe}from"./index-DKnoo-kT.js";import{P as je}from"./index-s0xxzhVW.js";import{R as be,u as Ne,a as q,A as ye}from"./index-Dv5cF6qF.js";import"./index-BvuPClj3.js";const ve="Search the local and remote branches. A branch with an open pull request is added as that pull request.",Se="Branch",we="Search branches and pull requests",Ce=({title:a,search:s,errorMessage:n,onQueryChange:t,onSelect:r,onClose:l})=>e.jsx(H,{open:!0,onOpenChange:$(l),children:e.jsxs(B,{className:"sm:max-w-lg",children:[e.jsxs(z,{children:[e.jsx(U,{children:a}),e.jsx(G,{children:ve})]}),e.jsx(te,{label:Se,hint:null,placeholder:we,value:s.query,suggestions:s.options,message:s.message,errorMessage:n,onValueChange:t,onSelect:r}),e.jsx(F,{children:e.jsx(f,{type:"button",variant:"ghost",onClick:l,children:"Cancel"})})]})}),Le="Searching…",Re="Adding…",Ae=(a,s)=>{var d,o,j,p;const n=V(),t=K(),[r,l]=b.useState(""),i=b.useDeferredValue(r),m=W({...n.repository.searchTargets.queryOptions({repositoryName:a,query:i}),placeholderData:re}),x=v(n.repository.addTarget.mutationOptions({onSuccess:async()=>{await t.invalidateQueries(n.repository.list.pathFilter()),s()}}));return{search:{query:r,options:x.isPending?[]:((d=m.data)==null?void 0:d.options)??[],message:x.isPending?Re:((o=m.data)==null?void 0:o.message)??(m.isPending?Le:null)},errorMessage:((j=x.error)==null?void 0:j.message)??((p=m.error)==null?void 0:p.message)??null,onQueryChange:h=>{x.reset(),l(h)},onSelect:h=>{x.mutate({repositoryName:a,targetId:h})}}},ke=({name:a,isSaving:s,isRemoving:n,onRemove:t,onClose:r})=>{const[l,i]=b.useState(!1);return l?e.jsxs("div",{className:"grid gap-3",children:[e.jsx("p",{children:`Remove ${a} from Flight Plan? Its folder on disk is not touched.`}),e.jsxs(F,{children:[e.jsx(f,{type:"button",variant:"ghost",onClick:()=>{i(!1)},children:"Keep"}),e.jsx(f,{type:"button",variant:"destructive",disabled:n,onClick:t,children:n?"Removing…":"Remove"})]})]}):e.jsxs(F,{children:[e.jsx(f,{type:"button",variant:"outline",className:"sm:mr-auto",onClick:()=>{i(!0)},children:"Remove repository"}),e.jsx(f,{type:"button",variant:"ghost",onClick:r,children:"Cancel"}),e.jsx(f,{type:"submit",disabled:s,children:s?"Saving…":"Save"})]})},Fe=({isOpen:a,name:s,path:n,configurationHref:t,authors:r,isSaving:l,isRemoving:i,errorMessage:m,onAuthorQueryChange:x,onAuthorSelect:d,onTrackedAuthorRemove:o,onSave:j,onRemove:p,onClose:h})=>e.jsx(H,{open:a,onOpenChange:$(h),children:e.jsxs(B,{className:"sm:max-w-lg",children:[e.jsxs(z,{children:[e.jsx(U,{children:`Configure ${s}`}),e.jsx(G,{children:"Pick the team members whose work Flight Plan lists in this repository."})]}),e.jsxs("form",{onSubmit:le(j),className:"grid gap-4",children:[e.jsxs("div",{className:"grid gap-1.5",children:[e.jsx("p",{className:"text-sm font-bold",children:"Repository folder"}),e.jsx("p",{className:"font-mono text-[0.82rem] wrap-anywhere text-muted-foreground",children:n})]}),e.jsx(be,{authors:r,onAuthorQueryChange:x,onAuthorSelect:d,onTrackedAuthorRemove:o}),e.jsx("a",{href:t,className:"w-fit text-sm underline",children:"Prompt configurations"}),m===null?null:e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:m}),e.jsx(ke,{name:s,isSaving:l,isRemoving:i,onRemove:p,onClose:h})]})]})}),Z=({label:a,children:s})=>e.jsxs(ie,{children:[e.jsxs(oe,{render:e.jsx(f,{variant:"outline",size:"sm"}),children:[e.jsx("span",{className:"text-box-cap",children:a}),e.jsx(ce,{"aria-hidden":"true"})]}),e.jsx(de,{align:"end",children:s})]}),ee=({label:a,countLabel:s,isSelected:n,marker:t,onToggle:r})=>e.jsxs(me,{checked:n,onCheckedChange:r,children:[t,e.jsx("span",{className:"flex-1",children:a})," ",e.jsx("span",{className:"text-muted-foreground tabular-nums",children:s})]}),se=({label:a,onReset:s})=>e.jsxs(e.Fragment,{children:[e.jsx(ue,{}),e.jsx(xe,{onClick:s,children:a})]}),De="Show all authors",Ee=({buttonLabel:a,isDefault:s,options:n,onSelect:t})=>e.jsxs(Z,{label:a,children:[n.map(r=>e.jsx(ee,{label:r.label,countLabel:r.countLabel,isSelected:r.isSelected,marker:r.person===null?e.jsx("span",{className:"size-5 shrink-0"}):e.jsx(D,{imageUrl:r.person.avatarUrl,monogram:r.person.monogram}),onToggle:()=>{t(r.toggledAuthors)}},r.key)),s?null:e.jsx(se,{label:De,onReset:()=>{t(null)}})]}),Te=()=>e.jsxs("section",{className:"max-w-prose border-t-2 border-foreground pt-5",children:[e.jsx("h2",{className:"text-xl leading-7 font-bold",children:"No repositories yet"}),e.jsx("p",{className:"mt-1 text-muted-foreground",children:"Flight Plan lists the repository it is started in. Start it inside a repository, or add one here by its folder path. Each repository then shows its open pull requests and branches, with the status of their reviews."})]}),Ie=({kindLabel:a,title:s,details:n,author:t,updatedLabel:r,createReviewHref:l,isDismissing:i,onDismiss:m})=>e.jsxs("li",{className:"grid grid-cols-[2.5rem_minmax(0,1fr)]",children:[e.jsx("span",{"aria-hidden":"true",className:"flex flex-col items-center",children:e.jsx("span",{className:"w-1 flex-1 bg-(--line)"})}),e.jsxs("div",{className:"my-1 flex flex-wrap items-center gap-x-4 gap-y-2 rounded-sm bg-muted px-3 py-2",children:[e.jsxs("div",{className:"min-w-0 flex-1 basis-72",children:[e.jsxs("p",{className:"flex flex-wrap items-baseline gap-x-2 text-sm",children:[e.jsx("span",{className:"font-bold",children:a}),e.jsx("span",{className:"text-muted-foreground tabular-nums",children:r})]}),e.jsx(S,{segments:[s],className:"leading-6"}),e.jsxs("span",{className:"flex flex-wrap items-center gap-x-3 text-sm text-muted-foreground",children:[e.jsx(S,{segments:n}),t===null?null:e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(D,{imageUrl:t.avatarUrl,monogram:t.monogram,className:"size-4"}),t.name]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("a",{href:l,className:J({variant:"default",size:"sm"}),children:e.jsx("span",{className:"text-box-cap",children:"Create Flight Plan"})}),e.jsx(f,{variant:"ghost",size:"sm",disabled:i,onClick:m,children:"Dismiss"})]})]})]}),Pe="before:absolute before:-inset-x-3 before:inset-y-0 before:-z-10 before:rounded-sm before:transition-colors before:duration-[180ms] before:ease-out hover:before:bg-muted",_e=({title:a,details:s,author:n,repositoryName:t,targetId:r,branchStatus:l,statusLabel:i,updatedLabel:m})=>e.jsxs("li",{className:`group relative isolate grid grid-cols-[2.5rem_minmax(0,1fr)] ${Pe}`,children:[e.jsxs("span",{"aria-hidden":"true",className:"flex flex-col items-center",children:[e.jsx("span",{className:"h-3 w-1 bg-(--line)"}),e.jsx(X,{status:l}),e.jsx("span",{className:"w-1 flex-1 bg-(--line) group-last:invisible"})]}),e.jsxs(he,{to:"/pr-reviews/$repoName/$branchId",params:{repoName:t,branchId:r},className:"grid gap-x-4 gap-y-0.5 py-2.5 outline-none after:absolute after:-inset-x-3 after:inset-y-0 after:rounded-sm focus-visible:after:outline-2 focus-visible:after:outline-ring sm:grid-cols-[minmax(0,1fr)_8rem_8rem_7.5rem] sm:items-baseline",children:[e.jsxs("span",{className:"min-w-0",children:[e.jsx(S,{segments:[a],className:"leading-6"}),e.jsx(S,{segments:s,className:"text-sm text-muted-foreground"})]}),e.jsxs("span",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-sm sm:contents",children:[n===null?e.jsx("span",{className:"hidden sm:block"}):e.jsxs("span",{className:"flex min-w-0 items-center gap-2 sm:h-6 sm:self-start",children:[e.jsx(D,{imageUrl:n.avatarUrl,monogram:n.monogram}),e.jsx("span",{className:"truncate",children:n.name})]}),e.jsx("span",{className:pe[l],children:i}),e.jsx("span",{className:"text-muted-foreground tabular-nums sm:text-right",children:m})]})]})]}),Oe=({label:a,className:s})=>e.jsx("span",{"aria-hidden":"true",className:Y("inline-flex size-7 shrink-0 items-center justify-center rounded-full bg-(--line) text-sm leading-none font-bold text-line-foreground",s),children:e.jsx("span",{className:"text-box-cap",children:a})}),L="grid grid-cols-[2.5rem_minmax(0,1fr)]",k=()=>e.jsxs("span",{"aria-hidden":"true",className:"flex flex-col items-center",children:[e.jsx("span",{className:"h-4 w-1 bg-(--line)"}),e.jsx("span",{className:"h-1 w-4 bg-(--line)"})]}),Qe=({repositoryName:a,content:s,onAddTarget:n})=>s.kind==="targets"?e.jsx("ol",{children:s.targets.map(t=>e.jsx(_e,{title:t.title,details:t.details,author:t.author,repositoryName:a,targetId:t.id,branchStatus:t.branchStatus,statusLabel:t.statusLabel,updatedLabel:t.updatedLabel},t.id))}):s.kind==="no-branches"?e.jsxs("div",{className:L,children:[e.jsx(k,{}),e.jsxs("div",{className:"grid justify-items-start gap-2 py-1.5",children:[e.jsxs("div",{className:"grid gap-0.5",children:[e.jsx("p",{className:"text-sm font-bold",children:s.message}),e.jsx("p",{className:"max-w-[62ch] text-sm text-muted-foreground",children:s.detail})]}),e.jsx(f,{type:"button",variant:"outline",size:"sm",onClick:n,children:s.actionLabel})]})]}):s.kind==="problem"?e.jsxs("div",{className:L,children:[e.jsx(k,{}),e.jsxs("div",{className:"grid gap-1 py-1.5",children:[e.jsxs("p",{className:"text-sm",children:[s.message," ",e.jsx("a",{href:s.actionHref,className:"underline",children:s.actionLabel})]}),s.detail===null?null:e.jsx("p",{className:"font-mono text-[0.82rem] wrap-anywhere text-muted-foreground",children:s.detail})]})]}):e.jsxs("div",{className:L,children:[e.jsx(k,{}),e.jsx("p",{className:"py-1.5 text-sm text-muted-foreground",children:s.message})]}),Me=({name:a,lineColor:s,lineLabel:n,source:t,countLabel:r,createReviewHref:l,configurationLabel:i,addTargetLabel:m,newTargets:x,content:d,isDismissing:o,onDismissNewTarget:j,onConfigure:p,onAddTarget:h})=>{const g=b.useId();return e.jsxs("section",{"aria-labelledby":g,className:Y("border-t-2 border-foreground pt-5 pb-6",ge[s]),children:[e.jsxs("div",{className:L,children:[e.jsxs("span",{"aria-hidden":"true",className:"flex flex-col items-center",children:[e.jsx(Oe,{label:n}),e.jsx("span",{className:"w-1 flex-1 bg-(--line)"})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2 pb-2",children:[e.jsxs("div",{className:"min-w-0 flex-1 basis-64",children:[e.jsx("h2",{id:g,className:"text-xl leading-7 font-semibold tracking-[-0.01em] text-foreground",children:a}),e.jsx(S,{segments:t,className:"text-sm text-muted-foreground"})]}),e.jsx("p",{className:"text-sm text-muted-foreground tabular-nums",children:r}),e.jsx("a",{href:l,className:J({variant:"outline",size:"sm"}),children:e.jsx("span",{className:"text-box-cap",children:"Create Flight Plan"})}),e.jsx(Q,{icon:"add",label:m,onClick:h}),e.jsx(Q,{icon:"settings",label:i,onClick:p})]})]}),e.jsx("ul",{children:x.map(u=>e.jsx(Ie,{kindLabel:u.kindLabel,title:u.title,details:u.details,author:u.author,updatedLabel:u.updatedLabel,createReviewHref:u.createReviewHref,isDismissing:o,onDismiss:()=>{j(u.id)}},u.id))}),e.jsx(Qe,{repositoryName:a,content:d,onAddTarget:h})]})},qe="Reset to the default statuses",He=({buttonLabel:a,isDefault:s,options:n,onSelect:t,onReset:r})=>e.jsxs(Z,{label:a,children:[n.map(l=>e.jsx(ee,{label:l.label,countLabel:l.countLabel,isSelected:l.isSelected,marker:e.jsx(X,{status:l.status,className:"size-4 [--line:var(--muted-foreground)]"}),onToggle:()=>{t(l.toggledStatuses)}},l.status)),s?null:e.jsx(se,{label:qe,onReset:r})]}),Be=5e3,ze=({repository:a,onClose:s})=>{const n=Ae(a.name,s);return e.jsx(Ce,{title:a.title,search:n.search,errorMessage:n.errorMessage,onQueryChange:n.onQueryChange,onSelect:n.onSelect,onClose:s})},Ke=()=>{var T,I,P,_,O;const a=V(),s=K(),{status:n=null,author:t=null,fixtureCase:r}=M.useSearch(),l=M.useNavigate(),{data:i}=fe({...a.repository.list.queryOptions({statuses:n,authors:t,fixtureCase:r}),refetchInterval:Be}),[m,x]=b.useState(!1),d=Ne(m),[o,j]=b.useState(null),[p,h]=b.useState(null),g=q({isEnabled:m,folderPath:d.search.query,repositoryName:null,saved:null}),u=v(a.repository.add.mutationOptions({onSuccess:async()=>{x(!1),d.reset(),g.reset(),await s.invalidateQueries(a.repository.list.pathFilter())}})),R=W({...a.repository.configuration.queryOptions({name:(o==null?void 0:o.name)??""}),enabled:o!==null}),N=q({isEnabled:o!==null,folderPath:"",repositoryName:(o==null?void 0:o.name)??null,saved:R.data??null}),A=()=>{j(null),N.reset()},w=v(a.repository.configure.mutationOptions({onSuccess:async()=>{A(),await s.invalidateQueries(a.repository.pathFilter())}})),C=v(a.repository.remove.mutationOptions({onSuccess:async()=>{A(),await s.invalidateQueries(a.repository.pathFilter())}})),E=v(a.repository.dismissNewTarget.mutationOptions({onSuccess:async()=>{await s.invalidateQueries(a.repository.list.pathFilter())}})),ae=()=>{w.reset(),C.reset(),A()},ne=()=>{u.reset(),d.reset(),g.reset(),x(!1)};return e.jsxs(e.Fragment,{children:[e.jsxs("header",{className:"flex flex-wrap items-baseline gap-x-4 gap-y-2 pb-3",children:[e.jsx("h1",{className:je,children:"Repositories"}),i.kind==="repositories"?e.jsx("p",{className:"text-sm text-muted-foreground tabular-nums",children:i.summaryLabel}):null,e.jsx("span",{className:"flex-1"}),e.jsx(f,{onClick:()=>{x(!0)},children:"Add repository"})]}),e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-6 gap-y-2 pb-5",children:[i.notice===null?e.jsx("span",{}):e.jsx("p",{className:"text-sm text-muted-foreground",children:i.notice}),i.kind==="repositories"?e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(He,{buttonLabel:i.statusFilter.buttonLabel,isDefault:i.statusFilter.isDefault,options:i.statusFilter.options,onSelect:c=>{l({search:y=>({...y,status:[...c]})})},onReset:()=>{l({search:c=>({...c,status:void 0})})}}),e.jsx(Ee,{buttonLabel:i.authorFilter.buttonLabel,isDefault:i.authorFilter.isDefault,options:i.authorFilter.options,onSelect:c=>{l({search:y=>({...y,author:c==null?void 0:c.slice()})})}})]}):null]}),e.jsx(ye,{isOpen:m,search:d.search,browse:d.browse,authors:g.authors,isAdding:u.isPending,errorMessage:((T=u.error)==null?void 0:T.message)??null,onQueryChange:d.onQueryChange,onChooseFolder:c=>{u.reset(),d.onChooseFolder(c)},onAuthorQueryChange:g.onAuthorQueryChange,onAuthorSelect:g.onAuthorSelect,onTrackedAuthorRemove:g.onTrackedAuthorRemove,onSubmit:()=>{u.mutate({path:d.search.query,...g.selection})},onBrowse:()=>{u.reset(),d.onBrowse()},onBrowseFolder:d.onBrowseFolder,onBrowseClose:()=>{u.reset(),d.onBrowseClose()},onClose:ne}),e.jsx(Fe,{isOpen:o!==null,name:(o==null?void 0:o.name)??"",path:((I=R.data)==null?void 0:I.path)??"",configurationHref:(o==null?void 0:o.configurationHref)??"",authors:N.authors,isSaving:w.isPending,isRemoving:C.isPending,errorMessage:((P=w.error)==null?void 0:P.message)??((_=C.error)==null?void 0:_.message)??((O=R.error)==null?void 0:O.message)??null,onAuthorQueryChange:N.onAuthorQueryChange,onAuthorSelect:N.onAuthorSelect,onTrackedAuthorRemove:N.onTrackedAuthorRemove,onSave:()=>{o!==null&&w.mutate({repositoryName:o.name,...N.selection})},onRemove:()=>{o!==null&&C.mutate({name:o.name})},onClose:ae}),p===null?null:e.jsx(ze,{repository:p,onClose:()=>{h(null)}},p.name),i.kind==="repositories"?i.repositories.map(c=>e.jsx(Me,{name:c.name,lineColor:c.lineColor,lineLabel:c.lineLabel,source:c.source,countLabel:c.countLabel,createReviewHref:c.createReviewHref,configurationLabel:c.configurationLabel,addTargetLabel:c.addTargetLabel,newTargets:c.newTargets,content:c.content,isDismissing:E.isPending,onConfigure:()=>{j({name:c.name,configurationHref:c.configurationHref})},onAddTarget:()=>{h({name:c.name,title:c.addTargetLabel})},onDismissNewTarget:y=>{E.mutate({repositoryName:c.name,targetId:y})}},c.name)):e.jsx(Te,{}),null]})};export{Ke as component};
@@ -1 +0,0 @@
1
- import{u as o,j as e,B as r}from"./index-DKnoo-kT.js";import{P as a}from"./index-CqVakH8R.js";const n="The backend did not say what went wrong.",m=({error:s})=>{const t=o();return e.jsxs("section",{role:"alert",className:"max-w-prose",children:[e.jsx("h1",{className:a,children:"Could not load the setup"}),e.jsx("p",{className:"mt-2 text-muted-foreground",children:s instanceof Error?s.message:n}),e.jsx(r,{className:"mt-4",onClick:()=>{t.invalidate()},children:"Try again"})]})};export{m as errorComponent};
@@ -1 +0,0 @@
1
- import{g as F,i as B,j as e,D as w,a as T,b as M,c as $,d as H,r,ae as K,Y as f,Z as P,af as E,I as W,ag as G,e as U,B as L,s as q}from"./index-DKnoo-kT.js";import{T as Q}from"./index-DfKNJbUM.js";const V="Loading the card…",Y=t=>{var c;const a=F(),n=B({...a.review.cardForm.queryOptions(t),gcTime:0}),d=n.isFetching?null:n.data??null;return{form:d,statusMessage:d===null?((c=n.error)==null?void 0:c.message)??V:null}},Z="Modify a card",z="Write what the card says, and choose the rows it lists. Select lines in the code to add a row.",C="Label",D="Description",J="Rows",X="No rows yet. Select lines in the code, then choose Add row.",ee="Kind",se="Add row",v=t=>[...t].sort((a,n)=>a.lineStart-n.lineStart||a.lineEnd-n.lineEnd),ae=t=>({...t,key:t.id}),te=(t,a)=>t.kindOptions.some(n=>n.value===a),ne=({reviewKey:t,form:a,isSaving:n,errorMessage:d,renderCodeLinkDialog:c,onSave:p,onClose:h})=>{const m=r.useId(),i=r.useId(),[x,g]=r.useState(a.label),[I,O]=r.useState(a.description),[b,j]=r.useState(()=>v(a.rows.map(ae))),[A,y]=r.useState({lineStart:a.lineStart,lineEnd:a.lineEnd}),N=K(t,a.path),S=(s,l)=>{j(o=>o.map(u=>u.key===s?{...u,...l}:u))},R=s=>{const l={...s,key:crypto.randomUUID(),id:null,type:a.defaultKind,label:"",name:E(s)};j(o=>v([...o,l])),y(s)},_=()=>{p({label:x,description:I,rows:b.map(({id:s,type:l,label:o,lineStart:u,lineEnd:k})=>({id:s,type:l,label:o,lineStart:u,lineEnd:k}))})};return e.jsxs("form",{onSubmit:q(_),className:"contents",children:[e.jsxs("div",{className:"grid min-h-0 grid-cols-[minmax(0,26rem)_minmax(0,1fr)] gap-4 overflow-hidden",children:[e.jsxs("div",{className:"flex min-h-0 flex-col gap-4 overflow-y-auto pr-1",children:[e.jsxs("div",{className:"grid gap-1.5",children:[e.jsx("label",{htmlFor:m,className:"text-sm font-bold",children:C}),e.jsx(f,{id:m,value:x,placeholder:a.labelPlaceholder,onChange:s=>{g(s.target.value)}})]}),e.jsxs("div",{className:"grid gap-1.5",children:[e.jsx("p",{"aria-hidden":"true",className:"text-sm font-bold",children:D}),e.jsx(Q,{label:D,value:a.description,errorMessage:null,renderCodeLinkDialog:c,onChange:O})]}),e.jsxs("section",{"aria-labelledby":i,className:"grid gap-2",children:[e.jsx("h3",{id:i,className:"text-sm font-bold",children:J}),b.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:X}):null,e.jsx("ul",{className:"grid gap-2",children:b.map(s=>e.jsxs("li",{className:"grid gap-1.5 rounded-md border border-input p-2",onFocusCapture:()=>{y({lineStart:s.lineStart,lineEnd:s.lineEnd})},children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(P,{label:`${ee} of ${s.name}`,options:a.kindOptions,value:s.type,isLabelHidden:!0,className:"w-40 shrink-0",onChange:l=>{te(a,l)&&S(s.key,{type:l})}}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-muted-foreground tabular-nums",children:E(s)}),e.jsx(W,{icon:"delete",label:`Delete the row ${s.label===""?s.name:s.label}`,onClick:()=>{j(l=>l.filter(o=>o.key!==s.key))}})]}),e.jsx(f,{value:s.label,"aria-label":`${C} of ${s.name}`,placeholder:s.name,onChange:l=>{S(s.key,{label:l.target.value})}})]},s.key))})]})]}),e.jsx(G,{path:a.path,lines:N.lines,statusMessage:N.statusMessage,waypoints:a.waypoints,waypointOptions:"toggle-off",highlightButtonLabel:se,focusOn:A,onHighlightCode:R})]}),d===null?e.jsx("span",{}):e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:d}),e.jsxs(U,{children:[e.jsx(L,{type:"button",variant:"ghost",onClick:h,children:"Cancel"}),e.jsx(L,{type:"submit",disabled:n,children:n?"Saving…":"Save"})]})]})},de=({reviewKey:t,change:{segmentId:a,nodeId:n,isSaving:d,errorMessage:c,onSave:p,onClose:h},renderCodeLinkDialog:m})=>{const{form:i,statusMessage:x}=Y({...t,segmentId:a,nodeId:n});return e.jsx(w,{open:!0,onOpenChange:g=>{g||h()},children:e.jsxs(T,{className:"h-[calc(100dvh-4rem)] grid-rows-[auto_minmax(0,1fr)_auto_auto] sm:max-w-[min(90rem,calc(100vw-4rem))]",children:[e.jsxs(M,{children:[e.jsx($,{children:(i==null?void 0:i.title)??Z}),e.jsx(H,{children:z})]}),i===null?e.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:x}):e.jsx(ne,{reviewKey:t,form:i,isSaving:d,errorMessage:c,renderCodeLinkDialog:m,onSave:p,onClose:h},i.nodeId)]})})};export{de as default};
@@ -1 +0,0 @@
1
- import{j as s,B as g,z as N,A as j,I as f}from"./index-DKnoo-kT.js";import{b as A}from"./index-Dv5cF6qF.js";const R=(e,t)=>{const l=t.get(e.path)??null;return{path:e.path,name:e.name,stateLabel:l===null?e.stateLabel:null,followed:l}},y=e=>({path:e.path,name:e.name,stateLabel:null,followed:e}),E=(e,t)=>{const l=new Map(t.map(n=>[n.path,n])),r=new Set(e.map(n=>n.path));return[...e.map(n=>R(n,l)),...t.filter(n=>!r.has(n.path)).map(y)]},k="mt-1 size-4 shrink-0 accent-(--primary)",b="flex max-w-md items-center gap-2 py-1",C=[],L="Recent repositories",v="Can't find your repository?",I=({label:e,hint:t,placeholder:l,authorRole:r,repositoryName:n,authorSearch:m,onQueryChange:d,onSelect:i})=>{const a=m.repositoryName===n&&m.role===r,c=a?m.options:C;return s.jsx(A,{label:e,hint:t,placeholder:l,query:a?m.query:"",options:c,message:a?m.message:null,errorMessage:a?m.errorMessage:null,onQueryChange:x=>{d(r,x)},onOpen:()=>{d(r,a?m.query:"")},onSelect:i})},O=({author:e})=>s.jsxs("div",{className:b,children:[s.jsx(j,{imageUrl:e.avatarUrl,monogram:e.monogram}),s.jsx("span",{className:"min-w-0 truncate",children:e.name}),s.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-muted-foreground",children:e.detail})]}),S=({repository:e,authorSearch:t,onAuthorQueryChange:l,onAuthorTrackingChange:r})=>s.jsxs("div",{className:"grid max-w-xl gap-3 pt-3 pl-7",children:[e.selfAuthor===null?null:s.jsx(O,{author:e.selfAuthor}),s.jsx(I,{label:"Track branches from specific team members",hint:e.authorSearchHint,placeholder:e.authorSearchPlaceholder,authorRole:"tracked",repositoryName:e.name,authorSearch:t,onQueryChange:l,onSelect:n=>{r(n,!0)}}),e.trackedAuthors.length===0?null:s.jsx("ul",{"aria-label":`Tracked team members of ${e.name}`,children:e.trackedAuthors.map(n=>s.jsxs("li",{className:b,children:[s.jsx(j,{imageUrl:n.avatarUrl,monogram:n.monogram}),s.jsx("span",{className:"min-w-0 truncate",children:n.name}),s.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-muted-foreground",children:n.detail}),s.jsx(f,{icon:"close",label:`Stop tracking ${n.name}`,onClick:()=>{r(n.id,!1)}})]},n.id))})]}),w=({row:e,isChanging:t,followedFooter:l,authorSearch:r,onFollow:n,onUnfollow:m,onAuthorQueryChange:d,onAuthorTrackingChange:i})=>{const{followed:a}=e,c=a===null&&e.stateLabel!==null,x=()=>{a===null?n():m(a.name)};return s.jsxs("li",{className:"border-b border-border py-3 last:border-b-0",children:[s.jsxs("label",{className:N("flex min-w-0 items-start gap-3",c?"":"cursor-pointer"),children:[s.jsx("input",{type:"checkbox",checked:a!==null||c,disabled:c||t,className:k,onChange:x}),s.jsxs("span",{className:"min-w-0",children:[s.jsx("span",{className:"font-bold",children:e.name}),e.stateLabel===null?null:s.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:e.stateLabel}),s.jsx("span",{className:"block font-mono text-[0.82rem] wrap-anywhere text-muted-foreground",children:e.path})]})]}),a===null?null:s.jsxs(s.Fragment,{children:[s.jsx(S,{repository:a,authorSearch:r,onAuthorQueryChange:d,onAuthorTrackingChange:i}),l===void 0?null:s.jsx("div",{className:"pt-3 pl-7",children:l(a)})]})]})},P=({rows:e,listMessage:t,repositoryErrorMessage:l,isChangingRepositories:r,authorSearch:n,followedFooter:m,onOpenAddRepository:d,onFollow:i,onUnfollow:a,onAuthorQueryChange:c,onAuthorTrackingChange:x})=>s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"pb-2 text-sm font-bold",children:L}),t===null?null:s.jsx("p",{className:"pb-3 text-sm text-muted-foreground",children:t}),e.length===0?null:s.jsx("ul",{"aria-label":"Repositories",className:"border-t border-border",children:e.map(o=>s.jsx(w,{row:o,isChanging:r,followedFooter:m,authorSearch:n,onFollow:()=>{i(o.path)},onUnfollow:a,onAuthorQueryChange:(u,h)=>{var p;c(((p=o.followed)==null?void 0:p.name)??o.name,u,h)},onAuthorTrackingChange:(u,h)=>{var p;x(((p=o.followed)==null?void 0:p.name)??o.name,u,h)}},o.path))}),s.jsxs("div",{className:"border-t border-border pt-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:v}),s.jsx(g,{type:"button",variant:"outline",onClick:d,children:"Add repository"})]}),l===null?null:s.jsx("p",{role:"alert",className:"pt-2 text-sm text-destructive",children:l})]})]});export{P as R,E as t};