codeharden 2026.1122.2133 → 2026.1122.2302

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 (108) hide show
  1. package/README.md +48 -3
  2. package/dist/{args-B0i5tyjE.js → args-BJ0ric8X.js} +5 -5
  3. package/dist/args-BJ0ric8X.js.map +1 -0
  4. package/dist/cli.js +2 -2
  5. package/dist/{commands-CvAvyECH.js → commands-BPobEsBP.js} +33 -14
  6. package/dist/commands-BPobEsBP.js.map +1 -0
  7. package/dist/{env-wDgRchH9.js → env-CMkse2o0.js} +2 -2
  8. package/dist/{env-wDgRchH9.js.map → env-CMkse2o0.js.map} +1 -1
  9. package/dist/{harden-channel-2IT0Y7p3.js → harden-channel-D7h06kQ_.js} +41 -3
  10. package/dist/harden-channel-D7h06kQ_.js.map +1 -0
  11. package/dist/{launcher-D17oQovS.js → launcher-CvQZcEIC.js} +3 -3
  12. package/dist/launcher-CvQZcEIC.js.map +1 -0
  13. package/dist/{lock-DxXcNd2w.js → lock-iovTSSb0.js} +2 -2
  14. package/dist/{lock-DxXcNd2w.js.map → lock-iovTSSb0.js.map} +1 -1
  15. package/dist/{main-BRHfJHGf.js → main-BFo94KOF.js} +6 -6
  16. package/dist/{main-BRHfJHGf.js.map → main-BFo94KOF.js.map} +1 -1
  17. package/dist/{main-CJdbWeA_.js → main-B_ui4G93.js} +3 -3
  18. package/dist/{main-CJdbWeA_.js.map → main-B_ui4G93.js.map} +1 -1
  19. package/dist/{mediaType-e66mt7Cb.js → mediaType-DHbUOwRj.js} +2 -2
  20. package/dist/{mediaType-e66mt7Cb.js.map → mediaType-DHbUOwRj.js.map} +1 -1
  21. package/dist/{runner-CKo8zFVx.js → runner-agAgr2qn.js} +5 -5
  22. package/dist/{runner-CKo8zFVx.js.map → runner-agAgr2qn.js.map} +1 -1
  23. package/dist/{runner-link-CGefyJ5U.js → runner-link-B7SsTYaz.js} +3 -3
  24. package/dist/{runner-link-CGefyJ5U.js.map → runner-link-B7SsTYaz.js.map} +1 -1
  25. package/dist/runner.js +1 -1
  26. package/dist/{server-test-aa-ENBUk.js → server-test-Cad_bM68.js} +4 -4
  27. package/dist/{server-test-aa-ENBUk.js.map → server-test-Cad_bM68.js.map} +1 -1
  28. package/dist/{src-CwV8i4Mj.js → src-BPcdaWEw.js} +4 -6
  29. package/dist/{src-CwV8i4Mj.js.map → src-BPcdaWEw.js.map} +1 -1
  30. package/dist/web/assets/{add-project-dialog-VBi3WXnh.js → add-project-dialog-BHbgORVh.js} +1 -1
  31. package/dist/web/assets/{agent-tabs-BNgrQWDq.js → agent-tabs-B6uUKAXD.js} +1 -1
  32. package/dist/web/assets/{agents-Ir1aHz-I.js → agents-NbcZbVrc.js} +1 -1
  33. package/dist/web/assets/{api-jkvqht5P.js → api-B9OffDXw.js} +1 -1
  34. package/dist/web/assets/{api-B620HpC2.js → api-yvn34iKU.js} +27 -27
  35. package/dist/web/assets/{archived-sessions-D4fJHB37.js → archived-sessions-C1-stU7x.js} +1 -1
  36. package/dist/web/assets/{automation-B91XTDIM.js → automation-Co7V1tcW.js} +1 -1
  37. package/dist/web/assets/{automation-new-CN7YhryW.js → automation-new-hCV8HoK1.js} +1 -1
  38. package/dist/web/assets/{automations-CLzVG-zc.js → automations-7GJxGbPp.js} +1 -1
  39. package/dist/web/assets/{composer-Dd8joSgj.js → composer-B1tdNGSi.js} +1 -1
  40. package/dist/web/assets/{conflict-card-BN9kNMVL.js → conflict-card-Bx8tT_d5.js} +1 -1
  41. package/dist/web/assets/{dialog-Dyw3b_Tu.js → dialog-Cvj_lHPY.js} +1 -1
  42. package/dist/web/assets/{diff-panel-CQ2XZMk2.js → diff-panel-BHhM9z93.js} +1 -1
  43. package/dist/web/assets/{draft-BmnE6-7J.js → draft-JkaN3nCS.js} +1 -1
  44. package/dist/web/assets/{dropdown-menu-C4XI7F63.js → dropdown-menu-Bflkx6wY.js} +1 -1
  45. package/dist/web/assets/{engines-Chq2ih3x.js → engines-pLQJYIu_.js} +1 -1
  46. package/dist/web/assets/{factory-BBYEYI9i.js → factory-DVCs5zxg.js} +1 -1
  47. package/dist/web/assets/{factory-columns-CtJOpFim.js → factory-columns-DExb6gW2.js} +1 -1
  48. package/dist/web/assets/{factory-item-BjydL6AH.js → factory-item-efMFkxnv.js} +1 -1
  49. package/dist/web/assets/{factory-view-BU2AKcD8.js → factory-view-Cot7flHA.js} +1 -1
  50. package/dist/web/assets/{files-panel-B6_6pSo9.js → files-panel-BIkR_seN.js} +1 -1
  51. package/dist/web/assets/{floor-scene-DCpEq0j7.js → floor-scene-DGy8i_5R.js} +1 -1
  52. package/dist/web/assets/{form-bits-BSfnSmQ7.js → form-bits-5XojWhBG.js} +1 -1
  53. package/dist/web/assets/{format-D1ma_o2D.js → format-D3kairnQ.js} +1 -1
  54. package/dist/web/assets/{home-_m_Aihwv.js → home-BtFPGjza.js} +1 -1
  55. package/dist/web/assets/{inbox-FDD5FMWW.js → inbox-CUPkJ4WC.js} +1 -1
  56. package/dist/web/assets/{index-BkpVvQrC.js → index-C0C9GyeX.js} +4 -4
  57. package/dist/web/assets/{item-parts-BhDFWsT1.js → item-parts-DZ3TQad4.js} +1 -1
  58. package/dist/web/assets/{kill-switch-Dvqaozhz.js → kill-switch-BDAFCjui.js} +1 -1
  59. package/dist/web/assets/{label-DcWfyglU.js → label-Bm_8Eqe2.js} +1 -1
  60. package/dist/web/assets/{local-whisper-test-DPTOEA1M.js → local-whisper-test-CqGlAOvK.js} +1 -1
  61. package/dist/web/assets/{markdown-ad2jia51.js → markdown-DGHfubu-.js} +1 -1
  62. package/dist/web/assets/{mobile-nav-D8FZcJzG.js → mobile-nav-CrjrDJZ5.js} +1 -1
  63. package/dist/web/assets/{model-picker-4yoJPkRY.js → model-picker-DnKv2cbc.js} +1 -1
  64. package/dist/web/assets/{new-session-ddLbjOoZ.js → new-session-Bc93-xJK.js} +1 -1
  65. package/dist/web/assets/{new-session-GpxXZWbB.js → new-session-CUpOffXI.js} +1 -1
  66. package/dist/web/assets/{new-session-CwbgcYzY.js → new-session-DVYesr8z.js} +1 -1
  67. package/dist/web/assets/{now-next-D-6j1g_S.js → now-next-x8fwFm7p.js} +1 -1
  68. package/dist/web/assets/{on-demand-Cvu5D9uT.js → on-demand-Cvi90jRi.js} +2 -2
  69. package/dist/web/assets/{open-pr-controls--EtUvzD2.js → open-pr-controls-CYypJCKQ.js} +1 -1
  70. package/dist/web/assets/{orchestration-pknfiYFr.js → orchestration-BZj0HlxR.js} +1 -1
  71. package/dist/web/assets/{page-header-BqPf-jRo.js → page-header-t9HzSrxd.js} +1 -1
  72. package/dist/web/assets/{pm-fMuSJMPP.js → pm-DJfHcB90.js} +1 -1
  73. package/dist/web/assets/{popover-OrzLEhHL.js → popover-BqwWmyWQ.js} +1 -1
  74. package/dist/web/assets/{pr-details-BBVM9Kll.js → pr-details-1hhbiFWa.js} +1 -1
  75. package/dist/web/assets/{project-ws85aDq4.js → project-dy2_DT0H.js} +1 -1
  76. package/dist/web/assets/{question-card-4aNx5IRX.js → question-card-ldxLXNS_.js} +1 -1
  77. package/dist/web/assets/{remote-check-BAPXUznK.js → remote-check-CQktPgyp.js} +2 -2
  78. package/dist/web/assets/{reports-BZj5_wsp.js → reports-D0GAsXFv.js} +1 -1
  79. package/dist/web/assets/{role-chat-CeJXMsYB.js → role-chat-nIyzM-vQ.js} +1 -1
  80. package/dist/web/assets/{run-conflict-CPr9OWa3.js → run-conflict-BlgKVpOG.js} +1 -1
  81. package/dist/web/assets/{runs-table-DpBJ4ZeQ.js → runs-table-DMPF5_D6.js} +1 -1
  82. package/dist/web/assets/{search-BFTvT67N.js → search-gwjIEGis.js} +1 -1
  83. package/dist/web/assets/{search-Da3B5-lr.js → search-hK5b8Xwb.js} +1 -1
  84. package/dist/web/assets/{select-B4LGxZQI.js → select-B1ES0hhy.js} +1 -1
  85. package/dist/web/assets/{session-_62x2rSZ.js → session-CPUTlq1O.js} +1 -1
  86. package/dist/web/assets/{settings-CUYuBL-5.js → settings-DRd0b0Kz.js} +1 -1
  87. package/dist/web/assets/{settings-ui-Ux8rPFol.js → settings-ui-Bc6ymtc_.js} +1 -1
  88. package/dist/web/assets/{setup-BKOOV6vX.js → setup-Bn2CFYAt.js} +1 -1
  89. package/dist/web/assets/{shallow-CbfSRfYC.js → shallow-BUNpybIA.js} +1 -1
  90. package/dist/web/assets/{spec-approval-9S-jPMrI.js → spec-approval-CmC6QBSh.js} +1 -1
  91. package/dist/web/assets/{spot-check-actions-5CmYjt8A.js → spot-check-actions-DzMUED1O.js} +1 -1
  92. package/dist/web/assets/{spot-checks-BadmkHuG.js → spot-checks-CDZxwwu0.js} +1 -1
  93. package/dist/web/assets/{storeys-OlWmOmqA.js → storeys-BEgFUsix.js} +1 -1
  94. package/dist/web/assets/{switch-DuBpF2_h.js → switch-BHplnCdo.js} +1 -1
  95. package/dist/web/assets/{terminal-view-ChO1pNp0.js → terminal-view-WNT8FI6K.js} +1 -1
  96. package/dist/web/assets/{theme-DsW-i9mD.js → theme-3eeE0sp4.js} +1 -1
  97. package/dist/web/assets/{thread-view-CPlJsMhl.js → thread-view-AQKzJlKb.js} +1 -1
  98. package/dist/web/assets/{update-banner-CNYd8gAf.js → update-banner-CZGRgiG8.js} +1 -1
  99. package/dist/web/assets/{updates-CQZDqpFF.js → updates-4l7pwDq1.js} +1 -1
  100. package/dist/web/assets/{use-retry-item-CWwb3JGo.js → use-retry-item-3n4BD_3J.js} +1 -1
  101. package/dist/web/assets/{vision-7gkgZ-Ap.js → vision-Z1sLHr_c.js} +1 -1
  102. package/dist/web/assets/{wip-chip-D5-cZcfN.js → wip-chip-DXwuAo3A.js} +1 -1
  103. package/dist/web/index.html +34 -34
  104. package/package.json +1 -1
  105. package/dist/args-B0i5tyjE.js.map +0 -1
  106. package/dist/commands-CvAvyECH.js.map +0 -1
  107. package/dist/harden-channel-2IT0Y7p3.js.map +0 -1
  108. package/dist/launcher-D17oQovS.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t}from"./api-B620HpC2.js";import{j as n,m as r,y as i,yt as a}from"./format-D1ma_o2D.js";import{F as o}from"./useQuery-VSotSwry.js";import{L as s}from"./dropdown-menu-C4XI7F63.js";import{F as c,Mn as l,P as u,b as d,dr as f}from"./icons-COCLuOtb.js";import{n as p,t as m}from"./jsx-runtime-C3cWAN_r.js";import{o as h}from"./bits-B2GRjm37.js";import{a as g,t as _}from"./on-demand-Cvu5D9uT.js";import{a as v,c as y,i as b,n as x,r as S,t as C}from"./dialog-Dyw3b_Tu.js";import{r as w}from"./theme-DsW-i9mD.js";import{t as T}from"./skeleton-D8Sbd2jT.js";import{s as E,t as D}from"./factory-BBYEYI9i.js";import{t as O}from"./dist-wxbqfqV1.js";import{t as k}from"./page-header-BqPf-jRo.js";var A=[[/^goals?\b/i,`goals`],[/^(target\s+)?users?\b|^audience/i,`users`],[/^principles?\b|^values?\b/i,`principles`],[/^out\s+of\s+scope|^non[-\s]?goals?/i,`outOfScope`],[/^quality(\s+bar)?\b/i,`qualityBar`],[/^protected(\s+areas?)?\b/i,`protected`]],j={auth:[`**/auth/**`,`**/*auth*.*`],authentication:[`**/auth/**`,`**/*auth*.*`],payments:[`**/payment*/**`,`**/billing/**`,`**/*payment*.*`,`**/*billing*.*`],billing:[`**/billing/**`,`**/*billing*.*`],"data migrations":[`**/migrations/**`,`**/*migration*.*`],migrations:[`**/migrations/**`,`**/*migration*.*`],infrastructure:[`**/infra/**`,`**/terraform/**`,`**/*.tf`,`.github/workflows/**`],infra:[`**/infra/**`,`**/terraform/**`,`**/*.tf`,`.github/workflows/**`],licensing:[`LICENSE`,`LICENSE.*`,`COPYING`],license:[`LICENSE`,`LICENSE.*`,`COPYING`]};function M(e){let t=/^\s*(?:[-*+]|\d+[.)])\s+(.*)$/.exec(e);if(!t?.[1])return null;let n=t[1].trim();return!n||/^\[ \]$/.test(n)?null:n}function N(e){let t={goals:[],users:[],principles:[],outOfScope:[],qualityBar:[],protectedAreas:{globs:[],topics:[]}},n=[],r=null;for(let i of e.split(/\r?\n/)){let e=/^#{2,3}\s+(.+?)\s*#*\s*$/.exec(i);if(e?.[1]){r=A.find(([t])=>t.test(e[1]??``))?.[1]??null;continue}if(!r)continue;let a=M(i);a&&(r===`protected`?n.push(a):t[r].push(a))}return t.protectedAreas=P(n),t}function P(e){let t=new Set,n=new Set;for(let r of e){let e=[...r.matchAll(/`([^`]+)`/g)].map(e=>(e[1]??``).trim()).filter(Boolean);if(e.length>0){for(let n of e)t.add(n);continue}let i=r.split(/\s+[-:(]|\s+—\s+|,/)[0]?.trim()??``;if(/[/*]/.test(i)||/^[\w.-]+\.\w{1,6}$/.test(i)||/^[A-Z]+$/.test(i)){t.add(i);continue}let a=i.toLowerCase().replace(/[.:;]+$/,``);if(a){n.add(a);for(let e of j[a]??[])t.add(e)}}return{globs:[...t],topics:[...n]}}var F=e(p(),1),I=m();function L({open:e,onOpenChange:t,path:n,before:i,after:a,onConfirm:o,saving:s}){let l=w(),u=n.split(/[\\/]/).at(-1)??n;return(0,I.jsx)(C,{open:e,onOpenChange:t,children:(0,I.jsxs)(x,{className:`sm:max-w-3xl`,children:[(0,I.jsxs)(v,{children:[(0,I.jsxs)(y,{children:[`Review changes to `,u]}),(0,I.jsx)(S,{className:`font-mono text-2xs`,children:n})]}),(0,I.jsx)(`div`,{className:`max-h-[55dvh] overflow-auto rounded-lg border border-border scroll-thin`,children:(0,I.jsx)(g,{oldFile:{name:u,contents:i},newFile:{name:u,contents:a},options:{theme:{dark:`pierre-dark`,light:`pierre-light`},themeType:l,diffStyle:`unified`,overflow:`wrap`,disableFileHeader:!0}})}),(0,I.jsxs)(b,{className:`items-center sm:justify-between`,children:[(0,I.jsxs)(`span`,{className:`flex items-center gap-1.5 text-2xs text-muted-foreground`,children:[(0,I.jsx)(c,{className:`size-3.5 text-status-done`}),` A backup is saved before the file is overwritten.`]}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(r,{variant:`ghost`,onClick:()=>t(!1),children:`Keep editing`}),(0,I.jsx)(r,{onClick:o,disabled:s,children:s?`Saving…`:`Save to file`})]})]})]})})}var R=[{key:`goals`,label:`Goals`},{key:`users`,label:`Target users`},{key:`principles`,label:`Principles`},{key:`outOfScope`,label:`Out of scope`},{key:`qualityBar`,label:`Quality bar`}];function z({parsed:e,extraPaths:t}){let{globs:n,topics:r}=e.protectedAreas;return(0,I.jsxs)(`div`,{className:`space-y-5`,"data-testid":`vision-preview`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(h,{className:`mb-2`,children:`Sections`}),(0,I.jsx)(`div`,{className:`space-y-1 text-[13px]`,children:R.map(t=>{let n=e[t.key].length;return(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:O(`size-1.5 rounded-full`,n?`bg-status-done`:`bg-status-waiting`)}),(0,I.jsx)(`span`,{className:n?``:`text-muted-foreground`,children:t.label}),(0,I.jsx)(`span`,{className:`ml-auto text-3xs text-muted-foreground tabular-nums`,children:n||`empty`})]},t.key)})})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(h,{className:`mb-2 flex items-center gap-1.5`,children:[(0,I.jsx)(u,{className:`size-3.5`}),` Protected areas`]}),(0,I.jsx)(`p`,{className:`mb-2 text-2xs text-muted-foreground`,children:`Changes that touch these are never merged by the factory; they come to your inbox.`}),(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-1`,"data-testid":`protected-globs`,children:[n.map(e=>(0,I.jsx)(`code`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-3xs`,children:e},e)),n.length===0&&(0,I.jsx)(`span`,{className:`text-2xs text-status-waiting`,children:`No paths`})]}),r.length>0&&(0,I.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1`,"data-testid":`protected-topics`,children:r.map(e=>(0,I.jsx)(`span`,{className:`rounded-full border border-status-waiting/30 bg-status-waiting/8 px-2 py-0.5 text-3xs text-status-waiting`,children:e},e))}),r.length>0&&(0,I.jsx)(`p`,{className:`mt-1.5 text-3xs text-muted-foreground`,children:`Topics are also searched for in PR titles and descriptions.`}),t.length>0&&(0,I.jsxs)(`p`,{className:`mt-2 text-3xs text-muted-foreground`,children:[`Plus from the limits: `,(0,I.jsx)(`span`,{className:`font-mono`,children:t.join(`, `)})]})]})]})}function B({projectId:e}){let c=t(),u=o(),p=i(e),{data:m}=E(e),[h,g]=(0,F.useState)(null),[v,y]=(0,F.useState)(!1),b=m?.contents.replace(/\r\n/g,`
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t}from"./api-yvn34iKU.js";import{j as n,m as r,y as i,yt as a}from"./format-D3kairnQ.js";import{F as o}from"./useQuery-VSotSwry.js";import{L as s}from"./dropdown-menu-Bflkx6wY.js";import{F as c,Mn as l,P as u,b as d,dr as f}from"./icons-COCLuOtb.js";import{n as p,t as m}from"./jsx-runtime-C3cWAN_r.js";import{o as h}from"./bits-B2GRjm37.js";import{a as g,t as _}from"./on-demand-Cvi90jRi.js";import{a as v,c as y,i as b,n as x,r as S,t as C}from"./dialog-Cvj_lHPY.js";import{r as w}from"./theme-3eeE0sp4.js";import{t as T}from"./skeleton-D8Sbd2jT.js";import{s as E,t as D}from"./factory-DVCs5zxg.js";import{t as O}from"./dist-wxbqfqV1.js";import{t as k}from"./page-header-t9HzSrxd.js";var A=[[/^goals?\b/i,`goals`],[/^(target\s+)?users?\b|^audience/i,`users`],[/^principles?\b|^values?\b/i,`principles`],[/^out\s+of\s+scope|^non[-\s]?goals?/i,`outOfScope`],[/^quality(\s+bar)?\b/i,`qualityBar`],[/^protected(\s+areas?)?\b/i,`protected`]],j={auth:[`**/auth/**`,`**/*auth*.*`],authentication:[`**/auth/**`,`**/*auth*.*`],payments:[`**/payment*/**`,`**/billing/**`,`**/*payment*.*`,`**/*billing*.*`],billing:[`**/billing/**`,`**/*billing*.*`],"data migrations":[`**/migrations/**`,`**/*migration*.*`],migrations:[`**/migrations/**`,`**/*migration*.*`],infrastructure:[`**/infra/**`,`**/terraform/**`,`**/*.tf`,`.github/workflows/**`],infra:[`**/infra/**`,`**/terraform/**`,`**/*.tf`,`.github/workflows/**`],licensing:[`LICENSE`,`LICENSE.*`,`COPYING`],license:[`LICENSE`,`LICENSE.*`,`COPYING`]};function M(e){let t=/^\s*(?:[-*+]|\d+[.)])\s+(.*)$/.exec(e);if(!t?.[1])return null;let n=t[1].trim();return!n||/^\[ \]$/.test(n)?null:n}function N(e){let t={goals:[],users:[],principles:[],outOfScope:[],qualityBar:[],protectedAreas:{globs:[],topics:[]}},n=[],r=null;for(let i of e.split(/\r?\n/)){let e=/^#{2,3}\s+(.+?)\s*#*\s*$/.exec(i);if(e?.[1]){r=A.find(([t])=>t.test(e[1]??``))?.[1]??null;continue}if(!r)continue;let a=M(i);a&&(r===`protected`?n.push(a):t[r].push(a))}return t.protectedAreas=P(n),t}function P(e){let t=new Set,n=new Set;for(let r of e){let e=[...r.matchAll(/`([^`]+)`/g)].map(e=>(e[1]??``).trim()).filter(Boolean);if(e.length>0){for(let n of e)t.add(n);continue}let i=r.split(/\s+[-:(]|\s+—\s+|,/)[0]?.trim()??``;if(/[/*]/.test(i)||/^[\w.-]+\.\w{1,6}$/.test(i)||/^[A-Z]+$/.test(i)){t.add(i);continue}let a=i.toLowerCase().replace(/[.:;]+$/,``);if(a){n.add(a);for(let e of j[a]??[])t.add(e)}}return{globs:[...t],topics:[...n]}}var F=e(p(),1),I=m();function L({open:e,onOpenChange:t,path:n,before:i,after:a,onConfirm:o,saving:s}){let l=w(),u=n.split(/[\\/]/).at(-1)??n;return(0,I.jsx)(C,{open:e,onOpenChange:t,children:(0,I.jsxs)(x,{className:`sm:max-w-3xl`,children:[(0,I.jsxs)(v,{children:[(0,I.jsxs)(y,{children:[`Review changes to `,u]}),(0,I.jsx)(S,{className:`font-mono text-2xs`,children:n})]}),(0,I.jsx)(`div`,{className:`max-h-[55dvh] overflow-auto rounded-lg border border-border scroll-thin`,children:(0,I.jsx)(g,{oldFile:{name:u,contents:i},newFile:{name:u,contents:a},options:{theme:{dark:`pierre-dark`,light:`pierre-light`},themeType:l,diffStyle:`unified`,overflow:`wrap`,disableFileHeader:!0}})}),(0,I.jsxs)(b,{className:`items-center sm:justify-between`,children:[(0,I.jsxs)(`span`,{className:`flex items-center gap-1.5 text-2xs text-muted-foreground`,children:[(0,I.jsx)(c,{className:`size-3.5 text-status-done`}),` A backup is saved before the file is overwritten.`]}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(r,{variant:`ghost`,onClick:()=>t(!1),children:`Keep editing`}),(0,I.jsx)(r,{onClick:o,disabled:s,children:s?`Saving…`:`Save to file`})]})]})]})})}var R=[{key:`goals`,label:`Goals`},{key:`users`,label:`Target users`},{key:`principles`,label:`Principles`},{key:`outOfScope`,label:`Out of scope`},{key:`qualityBar`,label:`Quality bar`}];function z({parsed:e,extraPaths:t}){let{globs:n,topics:r}=e.protectedAreas;return(0,I.jsxs)(`div`,{className:`space-y-5`,"data-testid":`vision-preview`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(h,{className:`mb-2`,children:`Sections`}),(0,I.jsx)(`div`,{className:`space-y-1 text-[13px]`,children:R.map(t=>{let n=e[t.key].length;return(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:O(`size-1.5 rounded-full`,n?`bg-status-done`:`bg-status-waiting`)}),(0,I.jsx)(`span`,{className:n?``:`text-muted-foreground`,children:t.label}),(0,I.jsx)(`span`,{className:`ml-auto text-3xs text-muted-foreground tabular-nums`,children:n||`empty`})]},t.key)})})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(h,{className:`mb-2 flex items-center gap-1.5`,children:[(0,I.jsx)(u,{className:`size-3.5`}),` Protected areas`]}),(0,I.jsx)(`p`,{className:`mb-2 text-2xs text-muted-foreground`,children:`Changes that touch these are never merged by the factory; they come to your inbox.`}),(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-1`,"data-testid":`protected-globs`,children:[n.map(e=>(0,I.jsx)(`code`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-3xs`,children:e},e)),n.length===0&&(0,I.jsx)(`span`,{className:`text-2xs text-status-waiting`,children:`No paths`})]}),r.length>0&&(0,I.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1`,"data-testid":`protected-topics`,children:r.map(e=>(0,I.jsx)(`span`,{className:`rounded-full border border-status-waiting/30 bg-status-waiting/8 px-2 py-0.5 text-3xs text-status-waiting`,children:e},e))}),r.length>0&&(0,I.jsx)(`p`,{className:`mt-1.5 text-3xs text-muted-foreground`,children:`Topics are also searched for in PR titles and descriptions.`}),t.length>0&&(0,I.jsxs)(`p`,{className:`mt-2 text-3xs text-muted-foreground`,children:[`Plus from the limits: `,(0,I.jsx)(`span`,{className:`font-mono`,children:t.join(`, `)})]})]})]})}function B({projectId:e}){let c=t(),u=o(),p=i(e),{data:m}=E(e),[h,g]=(0,F.useState)(null),[v,y]=(0,F.useState)(!1),b=m?.contents.replace(/\r\n/g,`
2
2
  `);(0,F.useEffect)(()=>g(b??null),[b]);let x=(0,F.useMemo)(()=>N(h??``),[h]),S=a({mutationFn:()=>c.factory.saveVision(e,h??``),onSuccess:t=>{y(!1),u.setQueryData(D.vision(e),t),u.invalidateQueries({queryKey:[`factory`,`status`,e]}),n.success(`Vision saved`,{description:t.path})},onError:e=>n.error(`Couldn't save the vision`,{description:e.message})}),C=m?.exists??!1,w=h!==null&&(h!==b||!C);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(k,{icon:(0,I.jsx)(d,{}),title:`${p?.name??`Project`} vision`,meta:(0,I.jsx)(`code`,{className:`font-mono`,children:m?.path??p?.visionPath}),actions:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(r,{size:`sm`,variant:`ghost`,asChild:!0,children:(0,I.jsxs)(s,{to:`/projects/$projectId`,params:{projectId:e},children:[(0,I.jsx)(f,{}),` Project`]})}),(0,I.jsx)(r,{size:`sm`,disabled:!w,onClick:()=>y(!0),children:C?`Review & save`:`Create vision file`})]})}),m&&!C&&(0,I.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-status-waiting/25 bg-status-waiting/[0.06] px-5 py-2 text-2xs`,children:[(0,I.jsx)(l,{className:`size-3.5 text-status-waiting`}),`No vision file yet. This is the template; edit it and save to create `,m.path,`.`]}),(0,I.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,I.jsx)(`div`,{className:`min-w-0 flex-1 border-r border-border`,"data-testid":`vision-editor`,children:h===null?(0,I.jsxs)(`div`,{className:`space-y-2 p-6`,children:[(0,I.jsx)(T,{className:`h-5 w-1/3`}),(0,I.jsx)(T,{className:`h-40`})]}):(0,I.jsx)(_,{docKey:`vision-${e}-${C}`,value:h,onChange:g,onSave:()=>w&&y(!0)})}),(0,I.jsxs)(`aside`,{className:`hidden w-80 shrink-0 overflow-y-auto p-5 scroll-thin lg:block`,children:[(0,I.jsx)(`p`,{className:`mb-5 text-[13px] text-muted-foreground`,children:`The PM scores every candidate against this file and the reviewer checks changes against it. Keep it short and concrete.`}),(0,I.jsx)(z,{parsed:x,extraPaths:p?.factoryLimits.protectedPaths??[]})]})]}),(0,I.jsx)(L,{open:v,onOpenChange:y,path:m?.path??`VISION.md`,before:C?m?.contents??``:``,after:h??``,onConfirm:()=>S.mutate(),saving:S.isPending})]})}export{B as VisionPage};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{X as t,Z as n,i as r}from"./api-B620HpC2.js";import{n as i,t as a}from"./jsx-runtime-C3cWAN_r.js";import{F as o}from"./useQuery-VSotSwry.js";import{D as s,T as c,j as l,m as u,p as d,r as f,s as p,yt as m}from"./format-D1ma_o2D.js";import{L as h}from"./dropdown-menu-C4XI7F63.js";import{F as g,I as _,R as v}from"./mobile-nav-D8FZcJzG.js";import{o as y,t as b}from"./switch-DuBpF2_h.js";import{t as x}from"./dist-wxbqfqV1.js";import{n as S,r as C,t as w}from"./popover-OrzLEhHL.js";import{c as T,d as E,f as D}from"./logic-BTt00I9b.js";import{o as ee,r as te,s as ne,t as O}from"./factory-BBYEYI9i.js";import{X as k,Z as A,f as re,fr as ie,kn as ae,n as j,pr as oe,tn as M,yt as se}from"./icons-COCLuOtb.js";import{a as ce,c as le,i as ue,n as de,r as fe,t as pe}from"./dialog-Dyw3b_Tu.js";import{t as me}from"./remote-check-BAPXUznK.js";import{t as N}from"./textarea-gD4G5Znx.js";import{t as he}from"./input-CPpbtC2H.js";import{b as ge,c as P,f as _e,h as F,o as I,s as ve,w as ye}from"./use-retry-item-CWwb3JGo.js";import{t as L}from"./number-field-Bzzs0k9i.js";import{i as R,n as z}from"./form-bits-BSfnSmQ7.js";import{s as be}from"./factory-columns-CtJOpFim.js";var B=a(),xe=`Non-blocking findings from the reviews of merged pull requests. The scout weighs them with its area reviewers' findings and files at most Issues per round in total; ones it doesn't file are dropped after 14 days.`;function Se({projectId:e,held:t,className:n}){let i=r(),a=o(),s=m({mutationFn:({h:t,action:n})=>n===`file`?i.factory.fileFollowUp(e,t.itemId,t.index):i.factory.dismissFollowUp(e,t.itemId,t.index),onSuccess:(e,{h:t,action:n})=>{let r=e.followUps[t.index]?.issue;l.success(n===`dismiss`?`Dismissed`:r?`Filed as #${r.number}`:`Filed`),a.invalidateQueries({queryKey:O.all})},onError:(e,{action:t})=>l.error(t===`file`?`Couldn't file the issue`:`Couldn't dismiss it`,{description:e.message})});if(t.length===0)return null;let c=`${t.length} held follow-up${t.length===1?``:`s`}`;return(0,B.jsxs)(w,{children:[(0,B.jsx)(C,{asChild:!0,children:(0,B.jsx)(`button`,{type:`button`,className:x(`text-[10px] text-muted-foreground underline decoration-dotted underline-offset-2 hover:text-primary`,n),"data-testid":`held-follow-ups`,children:c})}),(0,B.jsxs)(S,{className:`w-96 gap-0 p-0`,children:[(0,B.jsxs)(`div`,{className:`border-b border-border px-3 py-2`,children:[(0,B.jsx)(`div`,{className:`text-[13px] font-medium`,children:`Held review follow-ups`}),(0,B.jsx)(`p`,{className:`mt-0.5 text-2xs text-muted-foreground`,children:xe})]}),(0,B.jsx)(`ul`,{className:`max-h-80 overflow-y-auto`,"aria-label":`Held review follow-ups`,children:t.map(e=>{let t=s.isPending&&s.variables?.h.id===e.id;return(0,B.jsxs)(`li`,{className:`flex flex-col gap-1 border-b border-border px-3 py-2 last:border-0`,children:[(0,B.jsx)(`span`,{className:`text-[12px] leading-snug`,children:e.title}),(0,B.jsxs)(`span`,{className:`flex items-center gap-1.5 text-3xs text-muted-foreground`,children:[(0,B.jsx)(`span`,{className:x(`rounded-full border px-1.5`,be[e.severity??`medium`]),children:e.severity??`medium`}),e.area&&(0,B.jsx)(`span`,{className:`rounded-full border border-border px-1.5 font-mono`,children:e.area}),e.pr?(0,B.jsxs)(`button`,{type:`button`,className:`truncate text-primary hover:underline`,title:e.itemTitle,onClick:()=>e.pr&&y.openExternal(e.pr.url),children:[`from PR #`,e.pr.number]}):(0,B.jsxs)(`span`,{className:`truncate`,title:e.itemTitle,children:[`from `,e.itemTitle]}),(0,B.jsx)(`span`,{className:`flex-1`}),(0,B.jsxs)(u,{size:`xs`,variant:`outline`,disabled:t,onClick:()=>s.mutate({h:e,action:`file`}),children:[(0,B.jsx)(ae,{}),` File now`]}),(0,B.jsxs)(u,{size:`xs`,variant:`ghost`,disabled:t,onClick:()=>s.mutate({h:e,action:`dismiss`}),"aria-label":`Dismiss "${e.title}"`,children:[(0,B.jsx)(j,{}),` Dismiss`]})]})]},e.id)})})]})]})}function V(e){let t=Math.round(e/6e4);if(t<60)return`${Math.max(1,t)}m`;if(t<2880){let e=Math.floor(t/60),n=t%60;return n?`${e}h ${n}m`:`${e}h`}return`${(t/1440).toFixed(1)}d`}function Ce(e){return e.pullRequests.filter(e=>e.state!==`merged`&&e.state!==`superseded`)}function we(e){if(e.fastMerges7d+e.retestedMerges7d!==0)return`${e.fastMerges7d} fast · ${e.retestedMerges7d} re-tested, 7 days`}function Te(e){let t=e.limits.dailyBudget.usd,n=e.limits.dailyBudget.tokens,r=Ce(e),i=r.filter(e=>e.queuePosition!==null).length,a=r.filter(e=>e.state===`waiting_for_you`||e.state===`stuck`).length,{stats:o}=e,s=we(o);return[{id:`spend`,label:`Spend today`,value:t?d(e.spendToday.usd):f(e.spendToday.tokens),detail:t?`of ${d(t)}`:n?`of ${f(n)} tokens`:`no budget set`,bar:{value:t?e.spendToday.usd:e.spendToday.tokens,max:t??n??0,warn:!0}},e.limits.autoMerge?{id:`merges`,label:`Merges today`,value:String(e.mergesToday),detail:`of ${e.limits.maxMergesPerDay} a day`,bar:{value:e.mergesToday,max:e.limits.maxMergesPerDay,warn:!1},...s?{note:s}:{}}:{id:`merges`,label:`Merges today`,value:String(o.mergedToday),detail:`auto-merge off`,...s?{note:s}:{}},{id:`agents`,label:`Agents working`,value:String(e.activeSessions),detail:`of ${e.limits.maxConcurrentSessions}`,bar:{value:e.activeSessions,max:e.limits.maxConcurrentSessions,warn:!1}},{id:`prs`,label:`Open PRs`,value:String(r.length),detail:a>0?`${a} for you`:i>0?`${i} queued`:void 0},{id:`failures`,label:`Failed · reverted`,value:`${o.failedToday} · ${o.revertedToday}`,detail:`today · ${e.consecutiveFailures} in a row`,alert:o.failedToday+o.revertedToday>0,...o.fastReverts7d>0?{note:`${p(o.fastReverts7d,`fast merge`)} reverted, 7 days`}:{}},{id:`median`,label:`Issue to merge`,value:o.medianMergeMs7d===null?`—`:V(o.medianMergeMs7d),detail:o.merged7d>0?`median of ${p(o.merged7d,`merge`)}, 7 days`:`no merges in 7 days`}]}var H=e(i(),1),Ee=[{id:`builder`,label:`Review on the builder's provider and model`},{id:`any`,label:`Review on any available provider`},{id:`wait`,label:`Wait until it is available again`}],De={builder:`reviews run on the builder's provider and model`,any:`reviews run on any available provider`,wait:`reviews wait`},U=`h-9 w-full rounded-md border border-border bg-background px-2.5 text-[13px] disabled:opacity-60`;function Oe({value:e,onChange:t}){let n=(0,H.useId)();return(0,B.jsxs)(`div`,{className:`space-y-3 border-t border-border pt-4`,"data-testid":`agents-tuning`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-[13px] font-medium`,children:`Agents`}),(0,B.jsx)(`p`,{className:`text-3xs text-muted-foreground`,children:`A reviewer on a different provider from the builder gives the most independent review. Docs builds can run on a cheaper model. Providers that aren't signed in, are too old to run or are at their usage limit are skipped.`})]}),(0,B.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,B.jsx)(W,{id:`${n}-b`,label:`Builder`,provider:e.builderProvider,model:e.builderModel,meanwhile:`builders start on another available provider`,onChange:(n,r)=>t({...e,builderProvider:n,builderModel:r})}),(0,B.jsx)(W,{id:`${n}-d`,label:`Docs builder`,provider:e.docsBuilderProvider??``,model:e.docsBuilderModel,autoValue:``,autoLabel:`Same as builders`,hint:`Builds of docs items (READMEs, guides, comments). Same as builders: they build on the builder's provider and model. Feature and bug builds always use the builder's.`,meanwhile:`docs builds start on another available provider`,onChange:(n,r)=>t({...e,docsBuilderProvider:n||null,docsBuilderModel:r})}),(0,B.jsx)(W,{id:`${n}-r`,label:`Reviewer`,provider:e.reviewerProvider,model:e.reviewerModel,autoLabel:`Automatic (a different provider from the builder)`,meanwhile:De[e.reviewerFallback],onChange:(n,r)=>t({...e,reviewerProvider:n,reviewerModel:r})})]}),(0,B.jsx)(z,{label:`When the reviewer's provider is unavailable`,htmlFor:`${n}-fb`,hint:`Unavailable means not installed, not signed in, at its usage limit, or failing to start. With no provider available at all, the review waits.`,children:(0,B.jsx)(`select`,{id:`${n}-fb`,className:U,value:e.reviewerFallback,onChange:n=>t({...e,reviewerFallback:n.target.value}),children:Ee.map(e=>(0,B.jsx)(`option`,{value:e.id,children:e.label},e.id))})})]})}function W({id:e,label:t,provider:n,model:r,autoValue:i=`auto`,autoLabel:a,hint:o,meanwhile:l,onChange:u}){let d=s(e=>e.runner.providers,[]),f=c({staleTime:6e4}).data?.checks;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(ke,{id:`${e}p`,label:`${t} provider`,providers:d,checks:f,value:n,autoValue:i,autoLabel:a,hint:o,meanwhile:l,onChange:e=>u(e,null)}),(0,B.jsx)(Ae,{id:`${e}m`,label:`${t} model`,provider:d.find(e=>e.id===n),value:r,onChange:e=>u(n,e)})]})}function ke({id:e,label:t,providers:n,checks:r,value:i,autoValue:a=`auto`,autoLabel:o=`Automatic`,hint:s,meanwhile:c,onChange:l}){let u=n.find(e=>e.id===i),d=u?E(u.id,r):null,f;if(u&&d&&!d.ready){let e=d.reason===`Too old`&&d.detail?d.detail:`${u.displayName}: ${T(d.reason??`Not ready`)}`;f=(0,B.jsxs)(`span`,{className:`text-status-waiting`,children:[e,d.command&&(0,B.jsxs)(B.Fragment,{children:[` `,`(run `,(0,B.jsx)(`code`,{className:`rounded bg-muted px-1 font-mono`,children:d.command}),`)`]}),`. Until it can run, `,c,`.`]})}return(0,B.jsx)(z,{label:t,htmlFor:e,hint:s,help:f,children:(0,B.jsxs)(`select`,{id:e,className:U,value:i,onChange:e=>l(e.target.value),children:[(0,B.jsx)(`option`,{value:a,children:o}),n.map(e=>(0,B.jsx)(`option`,{value:e.id,children:D(e.displayName,E(e.id,r))},e.id)),!u&&i!==a&&(0,B.jsxs)(`option`,{value:i,children:[i,` (not connected)`]})]})})}function Ae({id:e,label:t,provider:n,value:r,onChange:i}){let a=n?.models??[],o=r===null||a.some(e=>e.id===r);return(0,B.jsx)(z,{label:t,htmlFor:e,children:(0,B.jsxs)(`select`,{id:e,className:U,value:r??``,disabled:!n,onChange:e=>i(e.target.value||null),children:[(0,B.jsx)(`option`,{value:``,children:n?`Provider default`:`Choose a provider first`}),a.map(e=>(0,B.jsx)(`option`,{value:e.id,children:e.label},e.id)),!o&&r&&(0,B.jsx)(`option`,{value:r,children:r})]})})}function G(e,t){let n={...e,...t};for(let e of[`usd`,`tokens`])n[e]||delete n[e];return n}function K({label:e,budget:t,onChange:n,usdHelp:r,tokensHelp:i,usdPlaceholder:a,tokensPlaceholder:o}){let s=(0,H.useId)();return(0,B.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,B.jsx)(z,{label:`${e} (USD)`,htmlFor:`${s}-usd`,help:r,children:(0,B.jsx)(L,{id:`${s}-usd`,decimal:!0,optional:!0,min:0,value:t.usd,placeholder:a,onChange:e=>n(G(t,{usd:e||void 0})),className:`text-[13px]`})}),(0,B.jsx)(z,{label:`${e} (tokens)`,htmlFor:`${s}-tok`,help:i,children:(0,B.jsx)(L,{id:`${s}-tok`,optional:!0,min:0,value:t.tokens,placeholder:o,onChange:e=>n(G(t,{tokens:e||void 0})),className:`text-[13px]`})})]})}function je({limits:e,onChange:t}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(K,{label:`Daily budget`,budget:e.dailyBudget,onChange:n=>t({...e,dailyBudget:n}),usdHelp:`The loop pauses until tomorrow when today's spend reaches it.`,tokensHelp:`Optional, alongside USD.`,usdPlaceholder:`e.g. 10`,tokensPlaceholder:`e.g. 5000000`}),(0,B.jsxs)(`div`,{className:`flex items-start gap-2.5 text-xs`,children:[(0,B.jsx)(b,{checked:e.budgetScope===`project`,"aria-label":`Count all project spend against the budget`,onCheckedChange:n=>t({...e,budgetScope:n?`project`:`factory`}),className:`mt-0.5`}),(0,B.jsxs)(`span`,{children:[`Count all spend in this project`,(0,B.jsx)(`span`,{className:`block text-3xs text-muted-foreground`,children:`Off: only the factory's own sessions (builders, reviewers, the scout, reverts) count.`})]})]}),(0,B.jsx)(K,{label:`Per-item cap`,budget:e.itemBudget,onChange:n=>t({...e,itemBudget:n}),usdHelp:`Optional. An item that spends this much stops and waits for you; a retry gives it the same again. Empty: no cap.`,tokensHelp:`Optional, alongside USD.`,usdPlaceholder:`No cap`,tokensPlaceholder:`No cap`})]})}function Me(e){return e===0?`0: scheduled rounds are off. The scout only runs when you click Run scout now on the factory panel.`:`The scout starts a scheduled round only when ${q(e)} to be classified or for a free agent, and the interval has passed. 0 turns scheduled rounds off: then only Run scout now starts one.`}function q(e){return e===1?`no issue waits`:`fewer than ${e} issues wait`}function Ne({tuning:e,onChange:t}){let n=(0,H.useId)();return(0,B.jsxs)(`div`,{className:`space-y-3 border-t border-border pt-4`,"data-testid":`scout-tuning`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`p`,{className:`flex items-center gap-1 text-[13px] font-medium`,children:[`The scout`,(0,B.jsx)(R,{label:`the scout`,children:F})]}),(0,B.jsxs)(`p`,{className:`text-3xs text-muted-foreground`,children:[`It reviews the app against the vision`,` `,e.minBacklog===0?`when you click Run scout now`:`on a schedule, when ${q(e.minBacklog)}`,`, using a few long-lived area reviewers (one reviewer agent per review area, such as security or UX), and files the work worth doing.`]})]}),(0,B.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,B.jsx)(z,{label:`Review when fewer than`,htmlFor:`${n}-backlog`,hint:Me(e.minBacklog),help:e.minBacklog===0?`Off: only Run scout now starts a round.`:`issue${e.minBacklog===1?``:`s`} wait for an agent.`,children:(0,B.jsx)(L,{id:`${n}-backlog`,min:0,value:e.minBacklog,onChange:n=>t({...e,minBacklog:n}),className:`text-[13px]`})}),(0,B.jsx)(z,{label:`Every (hours)`,htmlFor:`${n}-every`,hint:`How often the scout runs a review round: it plans what to look at, its area reviewers review, and it files issues. ${e.minBacklog===0?`Scheduled rounds are off while the threshold is 0.`:`It also waits until ${q(e.minBacklog)}.`}`,children:(0,B.jsx)(L,{id:`${n}-every`,min:1,value:Math.round(e.discoveryIntervalMin/60),onChange:n=>t({...e,discoveryIntervalMin:n*60}),className:`text-[13px]`})}),(0,B.jsx)(z,{label:`Review areas per round`,htmlFor:`${n}-areas`,hint:_e,children:(0,B.jsx)(L,{id:`${n}-areas`,min:0,max:8,value:e.discoveryPerRound,onChange:n=>t({...e,discoveryPerRound:n}),className:`text-[13px]`})}),(0,B.jsx)(z,{label:`Issues per round`,htmlFor:`${n}-issues`,hint:`The most issues the scout files from one round. It files only what is most worth doing, so a round can file fewer or none.`,children:(0,B.jsx)(L,{id:`${n}-issues`,min:1,value:e.maxIssuesPerRound,onChange:n=>t({...e,maxIssuesPerRound:n}),className:`text-[13px]`})}),(0,B.jsx)(W,{id:`${n}-agent`,label:`Scout`,provider:e.scoutProvider,model:e.scoutModel,hint:`Runs the scout and its area reviewers, long-lived agents that read a lot of code each round. Automatic: the project's provider. A scout or area reviewer on another provider or model starts afresh at its next round.`,meanwhile:`the scout starts on another available provider`,onChange:(n,r)=>t({...e,scoutProvider:n,scoutModel:r})})]})]})}var Pe=`A share of the pull requests the factory merges by itself is set aside for a quick look by a person, picked the same way every time for the same work. Merges of work let in from an untrusted author or allowed past the size limit are always included. One inbox item says how many wait; record Looks good or Found a problem on the factory panel's Spot-checks list. Nothing waits on a spot-check.`;function Fe({value:e,dark:t,onChange:n}){let r=(0,H.useId)();return(0,B.jsx)(z,{label:`Spot-check share of automatic merges (%)`,htmlFor:r,hint:Pe,help:`Empty: the default, 10% in a dark factory and off otherwise. 0 turns spot-checks off.`,children:(0,B.jsx)(L,{id:r,optional:!0,min:0,max:100,value:e,placeholder:t?`10 (default)`:`Off (default)`,onChange:n,className:`text-[13px]`})})}function Ie(e){return{maxOpenPrs:e.maxOpenPrs,requireCi:e.requireCi,maxChangedLines:e.maxChangedLines,maxChangedFiles:e.maxChangedFiles,auditCommand:e.auditCommand,maxFixAttempts:e.maxFixAttempts,watchTimeoutMin:e.watchTimeoutMin,learnFromReviews:e.learnFromReviews,specApproval:e.specApproval,spotCheckPercent:e.spotCheckPercent,minBacklog:e.minBacklog,discoveryIntervalMin:e.discoveryIntervalMin,discoveryPerRound:e.discoveryPerRound,maxIssuesPerRound:e.maxIssuesPerRound,scoutProvider:e.scoutProvider,scoutModel:e.scoutModel,builderProvider:e.builderProvider,builderModel:e.builderModel,docsBuilderProvider:e.docsBuilderProvider,docsBuilderModel:e.docsBuilderModel,reviewerProvider:e.reviewerProvider,reviewerModel:e.reviewerModel,reviewerFallback:e.reviewerFallback}}function Le(e){return[...new Set(e.split(/[\s,]+/).map(e=>e.trim().replace(/^@/,``)).filter(e=>/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})(?:\[bot\])?$/.test(e)))]}var Re=`h-9 w-full rounded-md border border-border bg-background px-2.5 text-[13px] disabled:opacity-60`,ze={fast:`A pull request behind the default branch merges on its own green CI as long as GitHub reports no conflict. It is re-tested first only when it and the new commits both changed dependency files or both changed migrations, or while the default branch is red.`,strict:`A pull request behind the default branch is always brought up to date and waits for CI to pass again before it merges, one pull request at a time.`},J=`Re-testing every pull request after each merge costs a full CI run per merge, so pull requests wait minutes instead of seconds. Fast skips it: GitHub reports conflicts, CI on the default branch is still watched after every merge, and a merge that breaks it is reverted.`;function Be(e){return!!(e.dailyBudget.usd||e.dailyBudget.tokens)}function Ve({limits:e,onChange:t,tuning:n,onTuningChange:r,githubLogin:i,dark:a=!1}){let o=(0,H.useId)(),[s,c]=(0,H.useState)(()=>e.trustedAuthors.join(`
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{X as t,Z as n,i as r}from"./api-yvn34iKU.js";import{n as i,t as a}from"./jsx-runtime-C3cWAN_r.js";import{F as o}from"./useQuery-VSotSwry.js";import{D as s,T as c,j as l,m as u,p as d,r as f,s as p,yt as m}from"./format-D3kairnQ.js";import{L as h}from"./dropdown-menu-Bflkx6wY.js";import{F as g,I as _,R as v}from"./mobile-nav-CrjrDJZ5.js";import{o as y,t as b}from"./switch-BHplnCdo.js";import{t as x}from"./dist-wxbqfqV1.js";import{n as S,r as C,t as w}from"./popover-BqwWmyWQ.js";import{c as T,d as E,f as D}from"./logic-BTt00I9b.js";import{o as ee,r as te,s as ne,t as O}from"./factory-DVCs5zxg.js";import{X as k,Z as A,f as re,fr as ie,kn as ae,n as j,pr as oe,tn as M,yt as se}from"./icons-COCLuOtb.js";import{a as ce,c as le,i as ue,n as de,r as fe,t as pe}from"./dialog-Cvj_lHPY.js";import{t as me}from"./remote-check-CQktPgyp.js";import{t as N}from"./textarea-gD4G5Znx.js";import{t as he}from"./input-CPpbtC2H.js";import{b as ge,c as P,f as _e,h as F,o as I,s as ve,w as ye}from"./use-retry-item-3n4BD_3J.js";import{t as L}from"./number-field-Bzzs0k9i.js";import{i as R,n as z}from"./form-bits-5XojWhBG.js";import{s as be}from"./factory-columns-DExb6gW2.js";var B=a(),xe=`Non-blocking findings from the reviews of merged pull requests. The scout weighs them with its area reviewers' findings and files at most Issues per round in total; ones it doesn't file are dropped after 14 days.`;function Se({projectId:e,held:t,className:n}){let i=r(),a=o(),s=m({mutationFn:({h:t,action:n})=>n===`file`?i.factory.fileFollowUp(e,t.itemId,t.index):i.factory.dismissFollowUp(e,t.itemId,t.index),onSuccess:(e,{h:t,action:n})=>{let r=e.followUps[t.index]?.issue;l.success(n===`dismiss`?`Dismissed`:r?`Filed as #${r.number}`:`Filed`),a.invalidateQueries({queryKey:O.all})},onError:(e,{action:t})=>l.error(t===`file`?`Couldn't file the issue`:`Couldn't dismiss it`,{description:e.message})});if(t.length===0)return null;let c=`${t.length} held follow-up${t.length===1?``:`s`}`;return(0,B.jsxs)(w,{children:[(0,B.jsx)(C,{asChild:!0,children:(0,B.jsx)(`button`,{type:`button`,className:x(`text-[10px] text-muted-foreground underline decoration-dotted underline-offset-2 hover:text-primary`,n),"data-testid":`held-follow-ups`,children:c})}),(0,B.jsxs)(S,{className:`w-96 gap-0 p-0`,children:[(0,B.jsxs)(`div`,{className:`border-b border-border px-3 py-2`,children:[(0,B.jsx)(`div`,{className:`text-[13px] font-medium`,children:`Held review follow-ups`}),(0,B.jsx)(`p`,{className:`mt-0.5 text-2xs text-muted-foreground`,children:xe})]}),(0,B.jsx)(`ul`,{className:`max-h-80 overflow-y-auto`,"aria-label":`Held review follow-ups`,children:t.map(e=>{let t=s.isPending&&s.variables?.h.id===e.id;return(0,B.jsxs)(`li`,{className:`flex flex-col gap-1 border-b border-border px-3 py-2 last:border-0`,children:[(0,B.jsx)(`span`,{className:`text-[12px] leading-snug`,children:e.title}),(0,B.jsxs)(`span`,{className:`flex items-center gap-1.5 text-3xs text-muted-foreground`,children:[(0,B.jsx)(`span`,{className:x(`rounded-full border px-1.5`,be[e.severity??`medium`]),children:e.severity??`medium`}),e.area&&(0,B.jsx)(`span`,{className:`rounded-full border border-border px-1.5 font-mono`,children:e.area}),e.pr?(0,B.jsxs)(`button`,{type:`button`,className:`truncate text-primary hover:underline`,title:e.itemTitle,onClick:()=>e.pr&&y.openExternal(e.pr.url),children:[`from PR #`,e.pr.number]}):(0,B.jsxs)(`span`,{className:`truncate`,title:e.itemTitle,children:[`from `,e.itemTitle]}),(0,B.jsx)(`span`,{className:`flex-1`}),(0,B.jsxs)(u,{size:`xs`,variant:`outline`,disabled:t,onClick:()=>s.mutate({h:e,action:`file`}),children:[(0,B.jsx)(ae,{}),` File now`]}),(0,B.jsxs)(u,{size:`xs`,variant:`ghost`,disabled:t,onClick:()=>s.mutate({h:e,action:`dismiss`}),"aria-label":`Dismiss "${e.title}"`,children:[(0,B.jsx)(j,{}),` Dismiss`]})]})]},e.id)})})]})]})}function V(e){let t=Math.round(e/6e4);if(t<60)return`${Math.max(1,t)}m`;if(t<2880){let e=Math.floor(t/60),n=t%60;return n?`${e}h ${n}m`:`${e}h`}return`${(t/1440).toFixed(1)}d`}function Ce(e){return e.pullRequests.filter(e=>e.state!==`merged`&&e.state!==`superseded`)}function we(e){if(e.fastMerges7d+e.retestedMerges7d!==0)return`${e.fastMerges7d} fast · ${e.retestedMerges7d} re-tested, 7 days`}function Te(e){let t=e.limits.dailyBudget.usd,n=e.limits.dailyBudget.tokens,r=Ce(e),i=r.filter(e=>e.queuePosition!==null).length,a=r.filter(e=>e.state===`waiting_for_you`||e.state===`stuck`).length,{stats:o}=e,s=we(o);return[{id:`spend`,label:`Spend today`,value:t?d(e.spendToday.usd):f(e.spendToday.tokens),detail:t?`of ${d(t)}`:n?`of ${f(n)} tokens`:`no budget set`,bar:{value:t?e.spendToday.usd:e.spendToday.tokens,max:t??n??0,warn:!0}},e.limits.autoMerge?{id:`merges`,label:`Merges today`,value:String(e.mergesToday),detail:`of ${e.limits.maxMergesPerDay} a day`,bar:{value:e.mergesToday,max:e.limits.maxMergesPerDay,warn:!1},...s?{note:s}:{}}:{id:`merges`,label:`Merges today`,value:String(o.mergedToday),detail:`auto-merge off`,...s?{note:s}:{}},{id:`agents`,label:`Agents working`,value:String(e.activeSessions),detail:`of ${e.limits.maxConcurrentSessions}`,bar:{value:e.activeSessions,max:e.limits.maxConcurrentSessions,warn:!1}},{id:`prs`,label:`Open PRs`,value:String(r.length),detail:a>0?`${a} for you`:i>0?`${i} queued`:void 0},{id:`failures`,label:`Failed · reverted`,value:`${o.failedToday} · ${o.revertedToday}`,detail:`today · ${e.consecutiveFailures} in a row`,alert:o.failedToday+o.revertedToday>0,...o.fastReverts7d>0?{note:`${p(o.fastReverts7d,`fast merge`)} reverted, 7 days`}:{}},{id:`median`,label:`Issue to merge`,value:o.medianMergeMs7d===null?`—`:V(o.medianMergeMs7d),detail:o.merged7d>0?`median of ${p(o.merged7d,`merge`)}, 7 days`:`no merges in 7 days`}]}var H=e(i(),1),Ee=[{id:`builder`,label:`Review on the builder's provider and model`},{id:`any`,label:`Review on any available provider`},{id:`wait`,label:`Wait until it is available again`}],De={builder:`reviews run on the builder's provider and model`,any:`reviews run on any available provider`,wait:`reviews wait`},U=`h-9 w-full rounded-md border border-border bg-background px-2.5 text-[13px] disabled:opacity-60`;function Oe({value:e,onChange:t}){let n=(0,H.useId)();return(0,B.jsxs)(`div`,{className:`space-y-3 border-t border-border pt-4`,"data-testid":`agents-tuning`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-[13px] font-medium`,children:`Agents`}),(0,B.jsx)(`p`,{className:`text-3xs text-muted-foreground`,children:`A reviewer on a different provider from the builder gives the most independent review. Docs builds can run on a cheaper model. Providers that aren't signed in, are too old to run or are at their usage limit are skipped.`})]}),(0,B.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,B.jsx)(W,{id:`${n}-b`,label:`Builder`,provider:e.builderProvider,model:e.builderModel,meanwhile:`builders start on another available provider`,onChange:(n,r)=>t({...e,builderProvider:n,builderModel:r})}),(0,B.jsx)(W,{id:`${n}-d`,label:`Docs builder`,provider:e.docsBuilderProvider??``,model:e.docsBuilderModel,autoValue:``,autoLabel:`Same as builders`,hint:`Builds of docs items (READMEs, guides, comments). Same as builders: they build on the builder's provider and model. Feature and bug builds always use the builder's.`,meanwhile:`docs builds start on another available provider`,onChange:(n,r)=>t({...e,docsBuilderProvider:n||null,docsBuilderModel:r})}),(0,B.jsx)(W,{id:`${n}-r`,label:`Reviewer`,provider:e.reviewerProvider,model:e.reviewerModel,autoLabel:`Automatic (a different provider from the builder)`,meanwhile:De[e.reviewerFallback],onChange:(n,r)=>t({...e,reviewerProvider:n,reviewerModel:r})})]}),(0,B.jsx)(z,{label:`When the reviewer's provider is unavailable`,htmlFor:`${n}-fb`,hint:`Unavailable means not installed, not signed in, at its usage limit, or failing to start. With no provider available at all, the review waits.`,children:(0,B.jsx)(`select`,{id:`${n}-fb`,className:U,value:e.reviewerFallback,onChange:n=>t({...e,reviewerFallback:n.target.value}),children:Ee.map(e=>(0,B.jsx)(`option`,{value:e.id,children:e.label},e.id))})})]})}function W({id:e,label:t,provider:n,model:r,autoValue:i=`auto`,autoLabel:a,hint:o,meanwhile:l,onChange:u}){let d=s(e=>e.runner.providers,[]),f=c({staleTime:6e4}).data?.checks;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(ke,{id:`${e}p`,label:`${t} provider`,providers:d,checks:f,value:n,autoValue:i,autoLabel:a,hint:o,meanwhile:l,onChange:e=>u(e,null)}),(0,B.jsx)(Ae,{id:`${e}m`,label:`${t} model`,provider:d.find(e=>e.id===n),value:r,onChange:e=>u(n,e)})]})}function ke({id:e,label:t,providers:n,checks:r,value:i,autoValue:a=`auto`,autoLabel:o=`Automatic`,hint:s,meanwhile:c,onChange:l}){let u=n.find(e=>e.id===i),d=u?E(u.id,r):null,f;if(u&&d&&!d.ready){let e=d.reason===`Too old`&&d.detail?d.detail:`${u.displayName}: ${T(d.reason??`Not ready`)}`;f=(0,B.jsxs)(`span`,{className:`text-status-waiting`,children:[e,d.command&&(0,B.jsxs)(B.Fragment,{children:[` `,`(run `,(0,B.jsx)(`code`,{className:`rounded bg-muted px-1 font-mono`,children:d.command}),`)`]}),`. Until it can run, `,c,`.`]})}return(0,B.jsx)(z,{label:t,htmlFor:e,hint:s,help:f,children:(0,B.jsxs)(`select`,{id:e,className:U,value:i,onChange:e=>l(e.target.value),children:[(0,B.jsx)(`option`,{value:a,children:o}),n.map(e=>(0,B.jsx)(`option`,{value:e.id,children:D(e.displayName,E(e.id,r))},e.id)),!u&&i!==a&&(0,B.jsxs)(`option`,{value:i,children:[i,` (not connected)`]})]})})}function Ae({id:e,label:t,provider:n,value:r,onChange:i}){let a=n?.models??[],o=r===null||a.some(e=>e.id===r);return(0,B.jsx)(z,{label:t,htmlFor:e,children:(0,B.jsxs)(`select`,{id:e,className:U,value:r??``,disabled:!n,onChange:e=>i(e.target.value||null),children:[(0,B.jsx)(`option`,{value:``,children:n?`Provider default`:`Choose a provider first`}),a.map(e=>(0,B.jsx)(`option`,{value:e.id,children:e.label},e.id)),!o&&r&&(0,B.jsx)(`option`,{value:r,children:r})]})})}function G(e,t){let n={...e,...t};for(let e of[`usd`,`tokens`])n[e]||delete n[e];return n}function K({label:e,budget:t,onChange:n,usdHelp:r,tokensHelp:i,usdPlaceholder:a,tokensPlaceholder:o}){let s=(0,H.useId)();return(0,B.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,B.jsx)(z,{label:`${e} (USD)`,htmlFor:`${s}-usd`,help:r,children:(0,B.jsx)(L,{id:`${s}-usd`,decimal:!0,optional:!0,min:0,value:t.usd,placeholder:a,onChange:e=>n(G(t,{usd:e||void 0})),className:`text-[13px]`})}),(0,B.jsx)(z,{label:`${e} (tokens)`,htmlFor:`${s}-tok`,help:i,children:(0,B.jsx)(L,{id:`${s}-tok`,optional:!0,min:0,value:t.tokens,placeholder:o,onChange:e=>n(G(t,{tokens:e||void 0})),className:`text-[13px]`})})]})}function je({limits:e,onChange:t}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(K,{label:`Daily budget`,budget:e.dailyBudget,onChange:n=>t({...e,dailyBudget:n}),usdHelp:`The loop pauses until tomorrow when today's spend reaches it.`,tokensHelp:`Optional, alongside USD.`,usdPlaceholder:`e.g. 10`,tokensPlaceholder:`e.g. 5000000`}),(0,B.jsxs)(`div`,{className:`flex items-start gap-2.5 text-xs`,children:[(0,B.jsx)(b,{checked:e.budgetScope===`project`,"aria-label":`Count all project spend against the budget`,onCheckedChange:n=>t({...e,budgetScope:n?`project`:`factory`}),className:`mt-0.5`}),(0,B.jsxs)(`span`,{children:[`Count all spend in this project`,(0,B.jsx)(`span`,{className:`block text-3xs text-muted-foreground`,children:`Off: only the factory's own sessions (builders, reviewers, the scout, reverts) count.`})]})]}),(0,B.jsx)(K,{label:`Per-item cap`,budget:e.itemBudget,onChange:n=>t({...e,itemBudget:n}),usdHelp:`Optional. An item that spends this much stops and waits for you; a retry gives it the same again. Empty: no cap.`,tokensHelp:`Optional, alongside USD.`,usdPlaceholder:`No cap`,tokensPlaceholder:`No cap`})]})}function Me(e){return e===0?`0: scheduled rounds are off. The scout only runs when you click Run scout now on the factory panel.`:`The scout starts a scheduled round only when ${q(e)} to be classified or for a free agent, and the interval has passed. 0 turns scheduled rounds off: then only Run scout now starts one.`}function q(e){return e===1?`no issue waits`:`fewer than ${e} issues wait`}function Ne({tuning:e,onChange:t}){let n=(0,H.useId)();return(0,B.jsxs)(`div`,{className:`space-y-3 border-t border-border pt-4`,"data-testid":`scout-tuning`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`p`,{className:`flex items-center gap-1 text-[13px] font-medium`,children:[`The scout`,(0,B.jsx)(R,{label:`the scout`,children:F})]}),(0,B.jsxs)(`p`,{className:`text-3xs text-muted-foreground`,children:[`It reviews the app against the vision`,` `,e.minBacklog===0?`when you click Run scout now`:`on a schedule, when ${q(e.minBacklog)}`,`, using a few long-lived area reviewers (one reviewer agent per review area, such as security or UX), and files the work worth doing.`]})]}),(0,B.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,B.jsx)(z,{label:`Review when fewer than`,htmlFor:`${n}-backlog`,hint:Me(e.minBacklog),help:e.minBacklog===0?`Off: only Run scout now starts a round.`:`issue${e.minBacklog===1?``:`s`} wait for an agent.`,children:(0,B.jsx)(L,{id:`${n}-backlog`,min:0,value:e.minBacklog,onChange:n=>t({...e,minBacklog:n}),className:`text-[13px]`})}),(0,B.jsx)(z,{label:`Every (hours)`,htmlFor:`${n}-every`,hint:`How often the scout runs a review round: it plans what to look at, its area reviewers review, and it files issues. ${e.minBacklog===0?`Scheduled rounds are off while the threshold is 0.`:`It also waits until ${q(e.minBacklog)}.`}`,children:(0,B.jsx)(L,{id:`${n}-every`,min:1,value:Math.round(e.discoveryIntervalMin/60),onChange:n=>t({...e,discoveryIntervalMin:n*60}),className:`text-[13px]`})}),(0,B.jsx)(z,{label:`Review areas per round`,htmlFor:`${n}-areas`,hint:_e,children:(0,B.jsx)(L,{id:`${n}-areas`,min:0,max:8,value:e.discoveryPerRound,onChange:n=>t({...e,discoveryPerRound:n}),className:`text-[13px]`})}),(0,B.jsx)(z,{label:`Issues per round`,htmlFor:`${n}-issues`,hint:`The most issues the scout files from one round. It files only what is most worth doing, so a round can file fewer or none.`,children:(0,B.jsx)(L,{id:`${n}-issues`,min:1,value:e.maxIssuesPerRound,onChange:n=>t({...e,maxIssuesPerRound:n}),className:`text-[13px]`})}),(0,B.jsx)(W,{id:`${n}-agent`,label:`Scout`,provider:e.scoutProvider,model:e.scoutModel,hint:`Runs the scout and its area reviewers, long-lived agents that read a lot of code each round. Automatic: the project's provider. A scout or area reviewer on another provider or model starts afresh at its next round.`,meanwhile:`the scout starts on another available provider`,onChange:(n,r)=>t({...e,scoutProvider:n,scoutModel:r})})]})]})}var Pe=`A share of the pull requests the factory merges by itself is set aside for a quick look by a person, picked the same way every time for the same work. Merges of work let in from an untrusted author or allowed past the size limit are always included. One inbox item says how many wait; record Looks good or Found a problem on the factory panel's Spot-checks list. Nothing waits on a spot-check.`;function Fe({value:e,dark:t,onChange:n}){let r=(0,H.useId)();return(0,B.jsx)(z,{label:`Spot-check share of automatic merges (%)`,htmlFor:r,hint:Pe,help:`Empty: the default, 10% in a dark factory and off otherwise. 0 turns spot-checks off.`,children:(0,B.jsx)(L,{id:r,optional:!0,min:0,max:100,value:e,placeholder:t?`10 (default)`:`Off (default)`,onChange:n,className:`text-[13px]`})})}function Ie(e){return{maxOpenPrs:e.maxOpenPrs,requireCi:e.requireCi,maxChangedLines:e.maxChangedLines,maxChangedFiles:e.maxChangedFiles,auditCommand:e.auditCommand,maxFixAttempts:e.maxFixAttempts,watchTimeoutMin:e.watchTimeoutMin,learnFromReviews:e.learnFromReviews,specApproval:e.specApproval,spotCheckPercent:e.spotCheckPercent,minBacklog:e.minBacklog,discoveryIntervalMin:e.discoveryIntervalMin,discoveryPerRound:e.discoveryPerRound,maxIssuesPerRound:e.maxIssuesPerRound,scoutProvider:e.scoutProvider,scoutModel:e.scoutModel,builderProvider:e.builderProvider,builderModel:e.builderModel,docsBuilderProvider:e.docsBuilderProvider,docsBuilderModel:e.docsBuilderModel,reviewerProvider:e.reviewerProvider,reviewerModel:e.reviewerModel,reviewerFallback:e.reviewerFallback}}function Le(e){return[...new Set(e.split(/[\s,]+/).map(e=>e.trim().replace(/^@/,``)).filter(e=>/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})(?:\[bot\])?$/.test(e)))]}var Re=`h-9 w-full rounded-md border border-border bg-background px-2.5 text-[13px] disabled:opacity-60`,ze={fast:`A pull request behind the default branch merges on its own green CI as long as GitHub reports no conflict. It is re-tested first only when it and the new commits both changed dependency files or both changed migrations, or while the default branch is red.`,strict:`A pull request behind the default branch is always brought up to date and waits for CI to pass again before it merges, one pull request at a time.`},J=`Re-testing every pull request after each merge costs a full CI run per merge, so pull requests wait minutes instead of seconds. Fast skips it: GitHub reports conflicts, CI on the default branch is still watched after every merge, and a merge that breaks it is reverted.`;function Be(e){return!!(e.dailyBudget.usd||e.dailyBudget.tokens)}function Ve({limits:e,onChange:t,tuning:n,onTuningChange:r,githubLogin:i,dark:a=!1}){let o=(0,H.useId)(),[s,c]=(0,H.useState)(()=>e.trustedAuthors.join(`
2
2
  `));return(0,B.jsxs)(`div`,{className:`space-y-4`,"data-testid":`limits-editor`,children:[(0,B.jsxs)(`div`,{className:`flex items-start gap-2.5 text-xs`,children:[(0,B.jsx)(b,{checked:e.autoMerge,"aria-label":`Merge automatically`,onCheckedChange:n=>t({...e,autoMerge:n}),className:`mt-0.5`}),(0,B.jsxs)(`span`,{children:[`Merge automatically when every check passes`,(0,B.jsx)(`span`,{className:`block text-3xs text-muted-foreground`,children:`Off (recommended to start): every pull request waits for you to review and merge it. Work let in from an untrusted author always waits for you.`})]})]}),e.autoMerge&&(0,B.jsx)(z,{label:`Merge policy`,htmlFor:`${o}-policy`,hint:J,help:ze[e.mergePolicy],children:(0,B.jsxs)(`select`,{id:`${o}-policy`,className:Re,value:e.mergePolicy,onChange:n=>t({...e,mergePolicy:n.target.value}),children:[(0,B.jsx)(`option`,{value:`fast`,children:`Fast: merge on its own CI unless GitHub reports a conflict`}),(0,B.jsx)(`option`,{value:`strict`,children:`Strict: always re-test against the default branch`})]})}),n&&r&&(0,B.jsx)(Fe,{value:n.spotCheckPercent,dark:a,onChange:e=>r({...n,spotCheckPercent:e})}),!a&&n&&r&&(0,B.jsxs)(`div`,{className:`flex items-start gap-2.5 text-xs`,children:[(0,B.jsx)(b,{checked:n.specApproval,"aria-label":`Approve specs before building`,onCheckedChange:e=>r({...n,specApproval:e}),className:`mt-0.5`}),(0,B.jsxs)(`span`,{children:[`Approve specs before building`,(0,B.jsx)(`span`,{className:`block text-3xs text-muted-foreground`,children:`A feature stops after Analyze until you approve its spec or ask for changes, so a misunderstood request costs a short spec instead of a build and a review. Off: the agent builds its spec at once. A dark factory never waits, so it skips this.`})]})]}),(0,B.jsx)(z,{label:`Trusted authors`,htmlFor:`${o}-authors`,help:`GitHub logins, one per line. The factory only takes on issues they open${i?`, plus @${i} (the account CodeDen uses)`:` and the account CodeDen uses`}. On a public repository anyone can open an issue: everyone else's are ignored until you let one in.`,children:(0,B.jsx)(N,{id:`${o}-authors`,value:s,placeholder:`octocat
3
3
  my-teammate`,onChange:n=>{c(n.target.value),t({...e,trustedAuthors:Le(n.target.value)})},className:`min-h-16 font-mono text-[12.5px]`})}),(0,B.jsx)(je,{limits:e,onChange:t}),(0,B.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:[(0,B.jsx)(z,{label:`Agents at once`,htmlFor:`${o}-conc`,help:`The swarm: builders, reviewers and the scout share it.`,children:(0,B.jsx)(L,{id:`${o}-conc`,min:1,value:e.maxConcurrentSessions,onChange:n=>t({...e,maxConcurrentSessions:n}),className:`text-[13px]`})}),(0,B.jsx)(z,{label:`Auto-merges per day`,htmlFor:`${o}-merges`,hint:`With auto-merge on, the most pull requests CodeDen merges by itself in a day. Once it's reached, more work waits for tomorrow.`,children:(0,B.jsx)(L,{id:`${o}-merges`,min:0,value:e.maxMergesPerDay,onChange:n=>t({...e,maxMergesPerDay:n}),className:`text-[13px]`})}),(0,B.jsx)(z,{label:`Pause after failures`,htmlFor:`${o}-fails`,hint:`The factory pauses after this many failed merge checks or reverts in a row, so a broken setup doesn't keep spending. Resume it from the factory panel.`,children:(0,B.jsx)(L,{id:`${o}-fails`,min:1,value:e.pauseAfterConsecutiveFailures,onChange:n=>t({...e,pauseAfterConsecutiveFailures:n}),className:`text-[13px]`})})]}),n&&r&&(0,B.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:(0,B.jsx)(z,{label:`PRs open at most`,htmlFor:`${o}-open-prs`,hint:`The work-in-progress limit. With this many factory pull requests open, the factory finishes them before it starts more: no new build starts from the queue, the scout files nothing, and free agents go to reviews, fixes and rebases until one merges or closes. Builds that haven't opened their pull request yet take room too, since each will. Fixes for failing checks on the default branch still start. Pull requests of failed or escalated work, which wait for you, don't count (work that failed for a reason outside its code goes back by itself, so its pull request does, unless it waits on a provider that is signed out or at its usage limit). Fewer open PRs means fewer merge conflicts between them.`,help:`Empty: the same as Agents at once.`,children:(0,B.jsx)(L,{id:`${o}-open-prs`,optional:!0,min:1,value:n.maxOpenPrs,placeholder:`${e.maxConcurrentSessions} (Agents at once)`,onChange:e=>r({...n,maxOpenPrs:e}),className:`text-[13px]`})})}),(0,B.jsx)(z,{label:`Protected paths`,htmlFor:`${o}-paths`,help:`One glob per line, on top of the vision's protected areas. Changes there always go to you.`,children:(0,B.jsx)(N,{id:`${o}-paths`,value:e.protectedPaths.join(`
4
4
  `),placeholder:`**/auth/**
@@ -14,29 +14,29 @@
14
14
  <meta name="apple-mobile-web-app-title" content="CodeDen" />
15
15
  <meta name="apple-mobile-web-app-status-bar-style" content="black" />
16
16
  <title>CodeDen</title>
17
- <script type="module" crossorigin src="/assets/index-BkpVvQrC.js"></script>
17
+ <script type="module" crossorigin src="/assets/index-C0C9GyeX.js"></script>
18
18
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-XKyaHtl9.js">
19
19
  <link rel="modulepreload" crossorigin href="/assets/jsx-runtime-C3cWAN_r.js">
20
20
  <link rel="modulepreload" crossorigin href="/assets/useQuery-VSotSwry.js">
21
- <link rel="modulepreload" crossorigin href="/assets/api-B620HpC2.js">
21
+ <link rel="modulepreload" crossorigin href="/assets/api-yvn34iKU.js">
22
22
  <link rel="modulepreload" crossorigin href="/assets/clsx-BxLRjTE8.js">
23
23
  <link rel="modulepreload" crossorigin href="/assets/dist-wxbqfqV1.js">
24
- <link rel="modulepreload" crossorigin href="/assets/format-D1ma_o2D.js">
24
+ <link rel="modulepreload" crossorigin href="/assets/format-D3kairnQ.js">
25
25
  <link rel="modulepreload" crossorigin href="/assets/icons-COCLuOtb.js">
26
- <link rel="modulepreload" crossorigin href="/assets/theme-DsW-i9mD.js">
27
- <link rel="modulepreload" crossorigin href="/assets/dropdown-menu-C4XI7F63.js">
28
- <link rel="modulepreload" crossorigin href="/assets/switch-DuBpF2_h.js">
26
+ <link rel="modulepreload" crossorigin href="/assets/theme-3eeE0sp4.js">
27
+ <link rel="modulepreload" crossorigin href="/assets/dropdown-menu-Bflkx6wY.js">
28
+ <link rel="modulepreload" crossorigin href="/assets/switch-BHplnCdo.js">
29
29
  <link rel="modulepreload" crossorigin href="/assets/bits-B2GRjm37.js">
30
- <link rel="modulepreload" crossorigin href="/assets/mobile-nav-D8FZcJzG.js">
30
+ <link rel="modulepreload" crossorigin href="/assets/mobile-nav-CrjrDJZ5.js">
31
31
  <link rel="modulepreload" crossorigin href="/assets/useInfiniteQuery-CoCb1Ya8.js">
32
- <link rel="modulepreload" crossorigin href="/assets/archived-sessions-D4fJHB37.js">
33
- <link rel="modulepreload" crossorigin href="/assets/factory-BBYEYI9i.js">
34
- <link rel="modulepreload" crossorigin href="/assets/updates-CQZDqpFF.js">
35
- <link rel="modulepreload" crossorigin href="/assets/composer-Dd8joSgj.js">
36
- <link rel="modulepreload" crossorigin href="/assets/shallow-CbfSRfYC.js">
32
+ <link rel="modulepreload" crossorigin href="/assets/archived-sessions-C1-stU7x.js">
33
+ <link rel="modulepreload" crossorigin href="/assets/factory-DVCs5zxg.js">
34
+ <link rel="modulepreload" crossorigin href="/assets/updates-4l7pwDq1.js">
35
+ <link rel="modulepreload" crossorigin href="/assets/composer-B1tdNGSi.js">
36
+ <link rel="modulepreload" crossorigin href="/assets/shallow-BUNpybIA.js">
37
37
  <link rel="modulepreload" crossorigin href="/assets/skeleton-D8Sbd2jT.js">
38
38
  <link rel="modulepreload" crossorigin href="/assets/preload-helper-7y9sWmk5.js">
39
- <link rel="modulepreload" crossorigin href="/assets/on-demand-Cvu5D9uT.js">
39
+ <link rel="modulepreload" crossorigin href="/assets/on-demand-Cvi90jRi.js">
40
40
  <link rel="modulepreload" crossorigin href="/assets/langs-bundle-full-CSdmXkDy-Dw8EfGyl.js">
41
41
  <link rel="modulepreload" crossorigin href="/assets/dist-Cc5XWWBt.js">
42
42
  <link rel="modulepreload" crossorigin href="/assets/lib-DMtK1EFU.js">
@@ -44,36 +44,36 @@
44
44
  <link rel="modulepreload" crossorigin href="/assets/dist-5JF3pQvh.js">
45
45
  <link rel="modulepreload" crossorigin href="/assets/engine-javascript-DG4nFvXa.js">
46
46
  <link rel="modulepreload" crossorigin href="/assets/chunk-7TTQLYRW-BeGKB8s3.js">
47
- <link rel="modulepreload" crossorigin href="/assets/dialog-Dyw3b_Tu.js">
48
- <link rel="modulepreload" crossorigin href="/assets/markdown-ad2jia51.js">
49
- <link rel="modulepreload" crossorigin href="/assets/remote-check-BAPXUznK.js">
47
+ <link rel="modulepreload" crossorigin href="/assets/dialog-Cvj_lHPY.js">
48
+ <link rel="modulepreload" crossorigin href="/assets/markdown-DGHfubu-.js">
49
+ <link rel="modulepreload" crossorigin href="/assets/remote-check-CQktPgyp.js">
50
50
  <link rel="modulepreload" crossorigin href="/assets/logic-BTt00I9b.js">
51
- <link rel="modulepreload" crossorigin href="/assets/settings-ui-Ux8rPFol.js">
52
- <link rel="modulepreload" crossorigin href="/assets/popover-OrzLEhHL.js">
53
- <link rel="modulepreload" crossorigin href="/assets/model-picker-4yoJPkRY.js">
54
- <link rel="modulepreload" crossorigin href="/assets/engines-Chq2ih3x.js">
51
+ <link rel="modulepreload" crossorigin href="/assets/settings-ui-Bc6ymtc_.js">
52
+ <link rel="modulepreload" crossorigin href="/assets/popover-BqwWmyWQ.js">
53
+ <link rel="modulepreload" crossorigin href="/assets/model-picker-DnKv2cbc.js">
54
+ <link rel="modulepreload" crossorigin href="/assets/engines-pLQJYIu_.js">
55
55
  <link rel="modulepreload" crossorigin href="/assets/send-to-session-CdnAb3k6.js">
56
56
  <link rel="modulepreload" crossorigin href="/assets/autonomy-Bx33JDEO.js">
57
57
  <link rel="modulepreload" crossorigin href="/assets/footer-BFGvnowz.js">
58
58
  <link rel="modulepreload" crossorigin href="/assets/tap-tooltip-Pz23Abjm.js">
59
- <link rel="modulepreload" crossorigin href="/assets/new-session-ddLbjOoZ.js">
60
- <link rel="modulepreload" crossorigin href="/assets/new-session-GpxXZWbB.js">
61
- <link rel="modulepreload" crossorigin href="/assets/orchestration-pknfiYFr.js">
59
+ <link rel="modulepreload" crossorigin href="/assets/new-session-Bc93-xJK.js">
60
+ <link rel="modulepreload" crossorigin href="/assets/new-session-CUpOffXI.js">
61
+ <link rel="modulepreload" crossorigin href="/assets/orchestration-BZj0HlxR.js">
62
62
  <link rel="modulepreload" crossorigin href="/assets/textarea-gD4G5Znx.js">
63
- <link rel="modulepreload" crossorigin href="/assets/api-jkvqht5P.js">
63
+ <link rel="modulepreload" crossorigin href="/assets/api-B9OffDXw.js">
64
64
  <link rel="modulepreload" crossorigin href="/assets/format-CPIs7kVL.js">
65
65
  <link rel="modulepreload" crossorigin href="/assets/github-bits-BLf93Pkz.js">
66
66
  <link rel="modulepreload" crossorigin href="/assets/input-CPpbtC2H.js">
67
- <link rel="modulepreload" crossorigin href="/assets/question-card-4aNx5IRX.js">
68
- <link rel="modulepreload" crossorigin href="/assets/thread-view-CPlJsMhl.js">
69
- <link rel="modulepreload" crossorigin href="/assets/role-chat-CeJXMsYB.js">
70
- <link rel="modulepreload" crossorigin href="/assets/add-project-dialog-VBi3WXnh.js">
71
- <link rel="modulepreload" crossorigin href="/assets/label-DcWfyglU.js">
72
- <link rel="modulepreload" crossorigin href="/assets/agent-tabs-BNgrQWDq.js">
73
- <link rel="modulepreload" crossorigin href="/assets/pr-details-BBVM9Kll.js">
74
- <link rel="modulepreload" crossorigin href="/assets/open-pr-controls--EtUvzD2.js">
75
- <link rel="modulepreload" crossorigin href="/assets/search-Da3B5-lr.js">
76
- <link rel="modulepreload" crossorigin href="/assets/update-banner-CNYd8gAf.js">
67
+ <link rel="modulepreload" crossorigin href="/assets/question-card-ldxLXNS_.js">
68
+ <link rel="modulepreload" crossorigin href="/assets/thread-view-AQKzJlKb.js">
69
+ <link rel="modulepreload" crossorigin href="/assets/role-chat-nIyzM-vQ.js">
70
+ <link rel="modulepreload" crossorigin href="/assets/add-project-dialog-BHbgORVh.js">
71
+ <link rel="modulepreload" crossorigin href="/assets/label-Bm_8Eqe2.js">
72
+ <link rel="modulepreload" crossorigin href="/assets/agent-tabs-B6uUKAXD.js">
73
+ <link rel="modulepreload" crossorigin href="/assets/pr-details-1hhbiFWa.js">
74
+ <link rel="modulepreload" crossorigin href="/assets/open-pr-controls-CYypJCKQ.js">
75
+ <link rel="modulepreload" crossorigin href="/assets/search-hK5b8Xwb.js">
76
+ <link rel="modulepreload" crossorigin href="/assets/update-banner-CZGRgiG8.js">
77
77
  <link rel="stylesheet" crossorigin href="/assets/index-D8opha3I.css">
78
78
  </head>
79
79
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeharden",
3
- "version": "2026.1122.2133",
3
+ "version": "2026.1122.2302",
4
4
  "description": "A local-first harness for coding agents: Claude Code, Codex and OpenCode sessions, an orchestrator and project managers, an inbox, GitHub traceability, automations and an experimental dark factory.",
5
5
  "license": "MIT",
6
6
  "author": "Leon van Zyl",
@@ -1 +0,0 @@
1
- {"version":3,"file":"args-B0i5tyjE.js","names":[],"sources":["../src/args.ts"],"sourcesContent":["import { parseArgs } from \"node:util\";\nimport { formatHardenVersion, HARDEN_COMMAND } from \"@codeden/contracts\";\n\nexport const DEFAULT_PORT = 4317;\n\n/** The help text below, with its commands named after the channel's command (`HARDEN_COMMAND`). */\nconst named = (help: string) =>\n help\n .replaceAll(\"\\n codeden\", `\\n ${HARDEN_COMMAND}`)\n .replaceAll(`\\n${\" \".repeat(25)}`, `\\n${\" \".repeat(18 + HARDEN_COMMAND.length)}`);\n\nexport const HELP = named(`${formatHardenVersion()}: a local-first harness for coding agents\n\nUsage:\n codeden [options] Start CodeDen and open it in the browser\n codeden doctor Check the installation (--install: add Claude Code support now)\n codeden update Install the latest version and switch to it (--rollback: go back)\n codeden stop Stop the server and the runner\n codeden password Set the network access password (--generate: make one up)\n codeden network on|off Let phones on your network open CodeDen, or stop it\n codeden runner-link Connect stdin/stdout to the runner in --home (run by the server\n inside a sandbox; stdout carries only protocol frames)\n\nOptions:\n --port <n> Port to listen on (default ${DEFAULT_PORT})\n --home <dir> Data directory (default ~/.codeden, or CODEDEN_HOME)\n --no-open Do not open the browser\n -v, --version Print the version\n -h, --help Show this help\n`);\n\n/** The command line; throws on an unknown option. */\nexport function parseCli(args: string[]) {\n return parseArgs({\n args,\n allowPositionals: true,\n options: {\n port: { type: \"string\" },\n home: { type: \"string\" },\n \"no-open\": { type: \"boolean\", default: false },\n install: { type: \"boolean\", default: false },\n rollback: { type: \"boolean\", default: false },\n generate: { type: \"boolean\", default: false },\n version: { type: \"boolean\", short: \"v\", default: false },\n help: { type: \"boolean\", short: \"h\", default: false },\n },\n });\n}\n\nexport type ParsedCli = ReturnType<typeof parseCli>;\n"],"mappings":";;;;AAGA,MAAa,eAAe;;AAG5B,MAAM,SAAS,SACb,KACG,WAAW,eAAe,OAAO,gBAAgB,CAAC,CAClD,WAAW,KAAK,IAAI,OAAO,EAAE,KAAK,KAAK,IAAI,OAAO,KAAK,eAAe,MAAM,GAAG;AAEpF,MAAa,OAAO,MAAM,GAAG,oBAAoB,EAAE;;;;;;;;;;;;;8CAaL,aAAa;;;;;CAK1D;;AAGD,SAAgB,SAAS,MAAgB;CACvC,OAAO,UAAU;EACf;EACA,kBAAkB;EAClB,SAAS;GACP,MAAM,EAAE,MAAM,SAAS;GACvB,MAAM,EAAE,MAAM,SAAS;GACvB,WAAW;IAAE,MAAM;IAAW,SAAS;GAAM;GAC7C,SAAS;IAAE,MAAM;IAAW,SAAS;GAAM;GAC3C,UAAU;IAAE,MAAM;IAAW,SAAS;GAAM;GAC5C,UAAU;IAAE,MAAM;IAAW,SAAS;GAAM;GAC5C,SAAS;IAAE,MAAM;IAAW,OAAO;IAAK,SAAS;GAAM;GACvD,MAAM;IAAE,MAAM;IAAW,OAAO;IAAK,SAAS;GAAM;EACtD;CACF,CAAC;AACH"}