@kilocode/cli-darwin-arm64 7.5.16 → 7.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/bin/console/assets/AgentsRoute-DJcYrv6h.js +3 -0
  2. package/bin/console/assets/CliNotificationsRoute-Bxfy6kBS.js +1 -0
  3. package/bin/console/assets/CliUiRoute-kOIr2sXL.js +1 -0
  4. package/bin/console/assets/ConfigLayout-DjHPFaCq.css +1 -0
  5. package/bin/console/assets/ConfigLayout-zgXVE6dF.js +1 -0
  6. package/bin/console/assets/ConfigPage-CFkfj5pU.js +1 -0
  7. package/bin/console/assets/ConfirmDialog-kzGpMvPd.js +1 -0
  8. package/bin/console/assets/ConsoleUiRoute--VRAeLR0.js +1 -0
  9. package/bin/console/assets/CustomSelect-BukE91GR.js +1 -0
  10. package/bin/console/assets/FormattersRoute-5K8HEXB2.css +1 -0
  11. package/bin/console/assets/FormattersRoute-BWodvsWm.js +3 -0
  12. package/bin/console/assets/GhosttyTerminal-CYFOlDbt.js +13 -0
  13. package/bin/console/assets/IndexingRoute-2yel9lrf.js +1 -0
  14. package/bin/console/assets/IndexingRoute-D0nIx9Pv.css +1 -0
  15. package/bin/console/assets/KeybindsRoute-DPP8xngh.css +1 -0
  16. package/bin/console/assets/KeybindsRoute-McnML03L.js +1 -0
  17. package/bin/console/assets/LoginRoute-CyJAA6AC.js +1 -0
  18. package/bin/console/assets/McpRoute-D22Npdv0.css +1 -0
  19. package/bin/console/assets/McpRoute-D2NCS8W_.js +138 -0
  20. package/bin/console/assets/ModelsRoute-BcNQLrbm.js +1 -0
  21. package/bin/console/assets/ModelsRoute-Dk1uAzWQ.css +1 -0
  22. package/bin/console/assets/OverviewRoute-JXN401zJ.js +1 -0
  23. package/bin/console/assets/OverviewRoute-neFLWBjP.css +1 -0
  24. package/bin/console/assets/PermissionsRoute-BIjHuwFU.css +1 -0
  25. package/bin/console/assets/PermissionsRoute-FkoN6ci-.js +1 -0
  26. package/bin/console/assets/ProfileRoute-ChHcJQ6b.js +1 -0
  27. package/bin/console/assets/ProjectConsoleRoute-Df0w2iOW.css +1 -0
  28. package/bin/console/assets/ProjectConsoleRoute-xIHV_Od_.js +4 -0
  29. package/bin/console/assets/ProvidersRoute-DXIU7yYj.js +5 -0
  30. package/bin/console/assets/ServersRoute-BBRszzTY.css +1 -0
  31. package/bin/console/assets/ServersRoute-CNBMyJ4o.js +1 -0
  32. package/bin/console/assets/SourcesRoute-DMPIzkTG.js +1 -0
  33. package/bin/console/assets/SourcesRoute-DMunRt3T.css +1 -0
  34. package/bin/console/assets/ToolsRoute-CtJ1CPKJ.js +1 -0
  35. package/bin/console/assets/agents-tools-DXx49OgX.css +1 -0
  36. package/bin/console/assets/button-BT_ytG5s.js +1 -0
  37. package/bin/console/assets/cli-ui-DymkjzY0.css +1 -0
  38. package/bin/console/assets/config-De5WBuy1.js +1 -0
  39. package/bin/console/assets/console-DBczKSnI.js +1 -0
  40. package/bin/console/assets/dialogs-BCnEWnpn.css +1 -0
  41. package/bin/console/assets/file-B0aQP9j1.js +649 -0
  42. package/bin/console/assets/index-6uAP9-SB.js +19 -0
  43. package/bin/console/assets/index-B-RNivcl.css +1 -0
  44. package/bin/console/assets/models-C5w_34p2.js +1 -0
  45. package/bin/console/assets/models-CkIsKFzm.css +1 -0
  46. package/bin/console/assets/profile-BT3_Yn05.js +1 -0
  47. package/bin/console/assets/profile-Do_gK9qi.css +1 -0
  48. package/bin/console/assets/session-review-C49EA5sE.js +30 -0
  49. package/bin/console/assets/tag-ndRFRrjh.js +1 -0
  50. package/bin/console/assets/ui-DeoAcBNH.js +1 -0
  51. package/bin/console/index.html +2 -2
  52. package/bin/kilo +0 -0
  53. package/package.json +1 -1
  54. package/bin/console/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  55. package/bin/console/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  56. package/bin/console/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  57. package/bin/console/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  58. package/bin/console/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  59. package/bin/console/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  60. package/bin/console/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  61. package/bin/console/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  62. package/bin/console/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  63. package/bin/console/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  64. package/bin/console/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  65. package/bin/console/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  66. package/bin/console/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  67. package/bin/console/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  68. package/bin/console/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  69. package/bin/console/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  70. package/bin/console/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  71. package/bin/console/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  72. package/bin/console/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  73. package/bin/console/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  74. package/bin/console/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  75. package/bin/console/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  76. package/bin/console/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  77. package/bin/console/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  78. package/bin/console/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  79. package/bin/console/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  80. package/bin/console/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  81. package/bin/console/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  82. package/bin/console/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  83. package/bin/console/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  84. package/bin/console/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  85. package/bin/console/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  86. package/bin/console/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  87. package/bin/console/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  88. package/bin/console/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  89. package/bin/console/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  90. package/bin/console/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  91. package/bin/console/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  92. package/bin/console/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  93. package/bin/console/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  94. package/bin/console/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  95. package/bin/console/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  96. package/bin/console/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  97. package/bin/console/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  98. package/bin/console/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  99. package/bin/console/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  100. package/bin/console/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  101. package/bin/console/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  102. package/bin/console/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  103. package/bin/console/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  104. package/bin/console/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  105. package/bin/console/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  106. package/bin/console/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  107. package/bin/console/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  108. package/bin/console/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  109. package/bin/console/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  110. package/bin/console/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  111. package/bin/console/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  112. package/bin/console/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  113. package/bin/console/assets/index-B2oknisZ.css +0 -1
  114. package/bin/console/assets/index-oVVWPmdA.js +0 -857
  115. package/bin/console/logo.lottie +0 -0
@@ -0,0 +1 @@
1
+ .kilo-console .resolved-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(18rem,1fr));gap:.85rem}.kilo-console .model-defaults{grid-template-columns:repeat(2,minmax(0,1fr))}.kilo-console .model-default-fields{gap:.5rem}.kilo-console .model-default-fields .default-model-card{gap:0;border-color:var(--border);border-radius:var(--radius-lg);background:var(--card);padding:1rem}.kilo-console .model-default-fields .default-model-header{align-items:flex-start;gap:.75rem}.kilo-console .model-default-fields .default-model-header>span{color:var(--muted-foreground);font-size:.6875rem;font-weight:400;letter-spacing:0;line-height:1rem;text-transform:none}.kilo-console .model-default-fields .default-model-actions{gap:.375rem;margin-top:-.125rem}.kilo-console .model-default-fields .default-model-value{gap:.25rem}.kilo-console .model-default-fields .default-model-value strong{color:var(--foreground);font-size:.75rem;font-weight:500;line-height:1.45}.kilo-console .model-default-fields .default-model-value .default-model-id{color:var(--muted-foreground);font-size:.6875rem;font-weight:400;line-height:1.45}.kilo-console .resolved-card{display:flex;gap:1rem;align-items:center;justify-content:space-between;border:1px solid var(--border-weak-base);border-radius:var(--radius-xl, var(--radius-lg));background:var(--surface-raised-base);padding:1rem}.kilo-console .resolved-card>div:first-child{display:grid;gap:.25rem;min-width:0}.kilo-console .resolved-card span:where(:not([data-component=tag]):not([data-slot=source-badge])){color:var(--text-weaker);font-size:var(--font-size-small);font-weight:700;text-transform:uppercase}.kilo-console .resolved-card strong{overflow:hidden;color:var(--text-strong);font-family:var(--font-family-mono, monospace);text-overflow:ellipsis;white-space:nowrap}.kilo-console .default-model-card{display:grid;align-items:stretch;gap:1rem;grid-template-columns:minmax(0,1fr);justify-content:stretch}.kilo-console .default-model-header{display:flex;gap:1rem;align-items:center;justify-content:space-between;min-width:0;width:100%}.kilo-console .default-model-actions{flex:0 0 auto;align-items:center}.kilo-console .default-model-value{display:grid;gap:.35rem;min-width:0}.kilo-console .default-model-value strong{font-family:var(--font-family-sans)}.kilo-console .default-model-value .default-model-id{overflow:hidden;color:var(--text-weaker);font-family:var(--font-family-mono, monospace);font-size:var(--font-size-small);font-weight:600;text-overflow:ellipsis;text-transform:none;white-space:nowrap}
@@ -0,0 +1 @@
1
+ import{V as B,f as a,S as b,i as r,g as S,s as p,F as y,C as P,Y as $,$ as w,t as n,U as D}from"./index-6uAP9-SB.js";import{a as E,g as L,B as O,f as k}from"./ConfigPage-CFkfj5pU.js";import{u as F}from"./config-De5WBuy1.js";import"./tag-ndRFRrjh.js";var G=n('<section class=server-strip aria-label="Server status"><div class=server-strip-info><span>Server</span><strong class=mono></strong><span class=server-strip-separator aria-hidden=true></span><span>Version</span><strong class=mono></strong></div><span class=server-strip-state>'),z=n('<section class=metrics aria-label="Configuration metrics">'),I=n("<div class=title><div><h2>Diagnostics</h2><p>Where the dashboard is talking to."),M=n("<dl class=facts>"),N=n("<section class=overview-details>"),T=n("<em>effective"),W=n("<div class=overview-banner>"),Y=n("<span class=overview-heading>Overview"),H=n("<span>"),J=n("<strong>"),K=n("<div><dt></dt><dd>");function Q(f){return f.split(/[\\/]/).filter(Boolean).at(-1)??"Project"}function te(){const f=F(),C=B();return a(b,{get when(){return f.data()},children:i=>a(b,{get when(){return f.query()},children:v=>{const m=()=>i().effective,g=()=>v().scope==="project",_=()=>{if(!g())return"Global";const e=v().dir;return e?D(Q(e)):D(decodeURIComponent(C.project??"Project"))},U=()=>g()?`Effective configuration for ${_()}. Values inherited from global are marked.`:"Effective global configuration. Applies to all projects unless overridden.",A=()=>i().health.healthy?"healthy":"unhealthy",R=()=>[{label:"Default model",value:$(m().model),mono:!0},{label:"Small model",value:$(m().small_model),mono:!0},{label:"Default agent",value:$(m().default_agent),mono:!0},{label:"Providers",value:String(i().providers.all.length)},{label:"Agents",value:String(w(m().agent))},{label:"MCP servers",value:String(w(m().mcp))}],V=()=>[{term:"Scope",value:g()?`Project / ${_()}`:"Global"},{term:"Server URL",value:v().url,mono:!0},{term:"Server version",value:i().health.version,mono:!0},{term:"Config directory",value:v().dir||"Server default",mono:!!v().dir},{term:"Active project",value:g()?_():"None",mono:g()},{term:"Default model",value:$(m().model),mono:!0}];return a(E,{get title(){return(()=>{var e=Y();return e.firstChild,r(e,a(k,{get status(){return A()}}),null),e})()},get description(){return U()},get children(){return[(()=>{var e=G(),s=e.firstChild,t=s.firstChild,l=t.nextSibling,d=l.nextSibling,o=d.nextSibling,u=o.nextSibling,h=s.nextSibling;return r(l,()=>v().url),r(u,()=>i().health.version),r(h,a(L,{get tone(){return i().health.healthy?"success":"critical"}}),null),r(h,()=>i().health.healthy?"Online":"Unavailable",null),S(c=>{var j=v().url,x=i().health.version;return j!==c.e&&p(l,"title",c.e=j),x!==c.t&&p(u,"title",c.t=x),c},{e:void 0,t:void 0}),e})(),(()=>{var e=z();return r(e,a(y,{get each(){return R()},children:s=>a(P,{class:"metric",padding:12,get children(){return[(()=>{var t=H();return r(t,()=>s.label),t})(),(()=>{var t=J();return r(t,()=>s.value),S(l=>{var d=!!s.mono,o=s.value;return d!==l.e&&t.classList.toggle("mono",l.e=d),o!==l.t&&p(t,"title",l.t=o),l},{e:void 0,t:void 0}),t})()]}})})),e})(),(()=>{var e=N();return r(e,a(P,{class:"panel",padding:0,get children(){return[I(),(()=>{var s=M();return r(s,a(y,{get each(){return V()},children:t=>(()=>{var l=K(),d=l.firstChild,o=d.nextSibling;return r(d,()=>t.term),r(o,()=>t.value),S(u=>{var h=!!t.mono,c=t.value;return h!==u.e&&o.classList.toggle("mono",u.e=h),c!==u.t&&p(o,"title",u.t=c),u},{e:void 0,t:void 0}),l})()})),s})()]}})),e})(),a(b,{get when(){return g()},get children(){var e=W();return r(e,a(O,{tone:"info",get children(){return["Values shown here are ",T()," for this project. Use the section pages to see where each value comes from."]}})),e}})]}})}})})}export{te as OverviewRoute};
@@ -0,0 +1 @@
1
+ .kilo-console .overview-heading{display:inline-flex;gap:.625rem;align-items:center}.kilo-console .server-strip{display:flex;justify-content:space-between;align-items:center;gap:1rem;min-width:0;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--card);color:var(--muted-foreground);font-size:.75rem;line-height:1rem;padding:.625rem .875rem}.kilo-console .server-strip-info{display:flex;flex:1 1 auto;align-items:center;gap:1rem;min-width:0}.kilo-console .server-strip strong{min-width:0;overflow:hidden;color:var(--foreground);font-size:.75rem;font-weight:400;text-overflow:ellipsis;white-space:nowrap}.kilo-console .server-strip-separator{flex:0 0 auto;width:.1875rem;height:.1875rem;border-radius:999px;background:color-mix(in oklab,var(--muted-foreground) 50%,transparent)}.kilo-console .server-strip-state{display:inline-flex;flex:0 0 auto;align-items:center;gap:.375rem;color:var(--muted-foreground);font-size:.6875rem;line-height:1rem}.kilo-console .metrics{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:.5rem}.kilo-console .metric,.kilo-console .panel{border-color:var(--border);background:var(--card)}.kilo-console .metric{gap:0;min-height:4.5rem}.kilo-console .metric span,.kilo-console .facts dt{color:var(--muted-foreground)}.kilo-console .metric strong{min-width:0;margin-top:.375rem;overflow:hidden;color:var(--foreground);font-size:.75rem;font-weight:400;line-height:1.45;text-overflow:ellipsis;white-space:nowrap}.kilo-console .metric span{font-size:.6875rem;line-height:1rem}.kilo-console .overview-details{display:grid;gap:1.25rem}.kilo-console .title{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;border-bottom:1px solid var(--border);padding:.625rem .875rem}.kilo-console .title h2{margin:0;color:var(--foreground);font-size:.75rem;font-weight:500;line-height:1.45}.kilo-console .title p{margin:.125rem 0 0;color:var(--muted-foreground);font-size:.6875rem;line-height:1.45}.kilo-console .facts{display:grid;margin:0;padding:.25rem}.kilo-console .facts div{display:grid;grid-template-columns:11.25rem minmax(0,1fr);gap:1rem;border-radius:var(--radius-sm);padding:.5rem .75rem}.kilo-console .facts dt{font-size:.75rem;line-height:1.45}.kilo-console .facts dd{min-width:0;margin:0;overflow:hidden;color:var(--foreground);font-size:.75rem;line-height:1.45;text-overflow:ellipsis;white-space:nowrap}.kilo-console .overview-banner{margin-top:.25rem}
@@ -0,0 +1 @@
1
+ .kilo-console .permissions,.kilo-console .permission-group,.kilo-console .permission-rules{display:grid;gap:.5rem}.kilo-console .permission-group [data-component=section-title]{margin:.75rem 0 .25rem}.kilo-console .permission-group-header{display:flex;gap:1rem;align-items:flex-start;justify-content:space-between;margin:.75rem 0 .25rem}.kilo-console .permission-group-copy{display:grid;gap:.25rem;min-width:0}.kilo-console .permission-group-copy h2,.kilo-console .permission-group-copy p{margin:0}.kilo-console .permission-group-copy h2{color:var(--foreground);font-size:.875rem;font-weight:500;line-height:1.35}.kilo-console .permission-group-copy span{overflow:hidden;color:var(--muted-foreground);font-family:var(--font-family-mono);font-size:.75rem;line-height:1.45;text-overflow:ellipsis;white-space:nowrap}.kilo-console .permission-group-copy p{color:var(--muted-foreground);font-size:.75rem;line-height:1.45}.kilo-console .permission-row-meta{display:flex;gap:.5rem;align-items:center;justify-content:flex-end;flex-wrap:wrap}.kilo-console .permission-section-actions{display:inline-flex;gap:.5rem;align-items:center;flex:0 0 auto}.kilo-console .permission-section-actions [data-component=button][data-variant=primary] [data-component=icon],.kilo-console .permission-section-actions [data-component=button][data-variant=primary] [data-slot=icon-svg]{color:var(--primary-foreground)}.kilo-console .permission-select{width:7.5rem}.kilo-console .permission-form .permission-select{width:100%}.kilo-console .permission-select.disabled summary{cursor:not-allowed;opacity:.6}.kilo-console .permission-pattern{overflow-wrap:anywhere;font-family:var(--font-family-mono)}.kilo-console .permission-subtitle{display:grid;gap:.125rem;min-width:0}.kilo-console .permissions [data-component=config-row]{align-items:flex-start}.kilo-console .permissions [data-slot=config-row-subtitle]{overflow:visible;white-space:normal}.kilo-console .permission-empty{margin:0;border:1px dashed var(--border);border-radius:var(--radius-md);color:var(--muted-foreground);font-size:.75rem;padding:.75rem}.kilo-console .permission-form{grid-template-columns:minmax(0,1fr);align-content:start;padding:1rem}.kilo-console .permission-form .wide{grid-column:1}@media(max-width:760px){.kilo-console .permission-group-header{flex-direction:column;align-items:stretch}.kilo-console .permission-section-actions{justify-content:space-between}}
@@ -0,0 +1 @@
1
+ import{d as A,c as y,y as Z,i as s,f as n,g as P,t as m,h as ee,s as _,F as w,S as B,X as G,E as te,v as re}from"./index-6uAP9-SB.js";import{B as D}from"./button-BT_ytG5s.js";import{b as ne,S as L,e as M,c as R,d as I,a as ie}from"./ConfigPage-CFkfj5pU.js";import{u as se}from"./config-De5WBuy1.js";const N=[{value:"ask",label:"Ask"},{value:"allow",label:"Allow"},{value:"deny",label:"Deny"}],C=[{id:"external_directory",title:"External Directory",description:"Access files outside the project directory.",noun:"path",placeholder:"e.g. ~/Downloads/**"},{id:"bash",title:"Bash",description:"Run shell commands.",noun:"command",placeholder:"e.g. git status or npm *"},{id:"read",title:"Read",description:"Read files by matching file paths.",noun:"path",placeholder:"e.g. **/*.env"},{id:"edit",title:"Edit",description:"Modify files, including writes, patches, and multi-edits.",noun:"path",placeholder:"e.g. src/**/*.ts"}],X=[{id:"glob",title:"Glob",description:"Match files using glob patterns."},{id:"grep",title:"Grep",description:"Search file contents using regular expressions."},{id:"list",title:"List",description:"List files within a directory."},{id:"task",title:"Task",description:"Launch sub-agents."},{id:"skill",title:"Skill",description:"Load a skill by name."},{id:"lsp",title:"LSP",description:"Run language server queries."},{id:"todowrite",title:"Todo Write",description:"Update the todo list."},{id:"question",title:"Question",description:"Ask the user a question."},{id:"webfetch",title:"Web Fetch",description:"Fetch content from a URL."},{id:"websearch",title:"Web Search",description:"Search the web."},{id:"doom_loop",title:"Doom Loop",description:"Detect repeated tool calls with identical input."},{id:"agent_manager",title:"Agent Manager",description:"Manage Agent Manager operations."}],le=[...C,...X],ae=new Set(C.map(e=>e.id)),oe=new Set(le.map(e=>e.id));function q(e,r="ask"){return e==="ask"||e==="allow"||e==="deny"?e:r}function T(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}function z(e){return T(e.effective.permission)}function F(e,r){return e.overlay.collections.permission?.find(i=>i.key===r)}function K(e,r){return typeof e.effective.permission=="string"?e.effective.permission:z(e)[r]}function Q(e){return q(e.effective.permission)}function ce(e,r){return e?r==="*"&&typeof e.value=="string"?e.path:[...e.path,r]:["permission",r]}function S(e,r,i,o){if(!(i!=="ask"&&i!=="allow"&&i!=="deny"))return{tool:e,pattern:r,action:i,source:o?.source??"default",inherited:o?.inherited??!1,overridden:o?.overridden??!1,path:o?ce(o,r):["permission",e,r]}}function de(e){const r=e.value;if(r&&typeof r=="object"&&!Array.isArray(r))return Object.entries(r).flatMap(([o,t])=>S(e.key,o,t,e)??[]);const i=S(e.key,"*",r,e);return i?[i]:[]}function ue(e,r,i){const o=T(r);if(Object.keys(o).length)return Object.entries(o).flatMap(([l,c])=>S(e,l,c,i)??[]);const t=S(e,"*",r,i);return t?[t]:[]}function ge(e,r){const i=F(e,r.id),o=K(e,r.id),t=T(o),l=Q(e);return{...r,action:q(typeof o=="string"?o:t["*"],l),source:i?.source??"default",inherited:i?.inherited??!1,overridden:i?.overridden??!1}}function fe(e,r){const i=F(e,r.id),o=K(e,r.id),t=T(o),l=Q(e);return{...r,action:q(typeof o=="string"?o:t["*"],l),source:i?.source??"default",inherited:i?.inherited??!1,overridden:i?.overridden??!1,rules:Object.entries(t).filter(([c])=>c!=="*").flatMap(([c,a])=>S(r.id,c,a,i)??[])}}function he(){const e=se(),r=()=>e.data(),[i,o]=A("closed"),[t,l]=A("external_directory"),[c,a]=A(""),[d,u]=A("ask"),p=y(()=>(r()?.overlay.collections.permission??[]).flatMap(de)),v=y(()=>{const g=r();return g?C.map(f=>fe(g,f)):[]}),k=y(()=>{const g=r();return g?X.map(f=>ge(g,f)):[]}),h=y(()=>{const g=r();return g?Object.entries(z(g)).filter(([f])=>!oe.has(f)).flatMap(([f,b])=>ue(f,b,F(g,f))).sort((f,b)=>f.tool.localeCompare(b.tool)||f.pattern.localeCompare(b.pattern)):[]}),$=y(()=>C.find(g=>g.id===t())??C[0]);function x(g){l(g),a(""),u("ask"),o("rule")}function W(){o("closed")}function J(){const g=r(),f=Z(c());if(!g||!f){e.fail(`Enter a ${$().noun} pattern before saving.`);return}const b={[t()]:{[f]:d()}};e.save({permission:b}),W()}function V(g,f){const b=ae.has(g)?{[g]:{"*":f}}:{[g]:f};e.save({permission:b})}function Y(g){e.unset([g.path])}return{ctx:e,mode:i,kind:t,pattern:c,setPattern:a,action:d,setAction:u,rules:p,groups:v,settings:k,other:h,selected:$,open:x,close:W,add:J,setDefault:V,remove:Y}}var E=m("<div class=permission-row-meta>"),pe=m('<details class="models-select permission-select"><summary></summary><div class=models-select-menu role=listbox>'),ve=m("<button class=models-select-option type=button role=option>"),me=m("<section class=permission-group><div class=permission-rules>"),be=m("<div class=permissions><section class=permission-group><div class=permission-rules>"),$e=m("<div class=drawer-scrim>"),_e=m('<aside class="provider-drawer permission-drawer"aria-label="Permission rule configuration"><header class=drawer-header><div><h2></h2><span></span></div></header><div class="provider-form permission-form"><label class="required-field wide"><input></label><label class="required-field wide">Method</label></div><footer class=drawer-footer>'),ye=m("<span class=config-title-count>Permissions"),we=m("<section class=permission-group><header class=permission-group-header><div class=permission-group-copy><h2></h2><span></span><p></p></div><div class=permission-section-actions></div></header><div class=permission-rules>"),Ce=m("<p class=permission-empty>No specific <!> rules."),Se=m("<span class=permission-pattern>"),ke=m("<span class=permission-subtitle><span></span><span class=permission-pattern>");function H(e){return e==="allow"?"success":e==="deny"?"critical":"warning"}function U(e){return N.find(r=>r.value===e)?.label??e}function O(e){return(()=>{var r=E();return s(r,n(ne,{get tone(){return H(e.rule.action)},get children(){return U(e.rule.action)}}),null),s(r,n(L,{get source(){return e.rule.source},get inherited(){return e.rule.inherited},get overridden(){return e.rule.overridden}}),null),r})()}function j(e){const r=()=>U(e.value);function i(t,l){e.disabled||(e.onSelect(t),l.currentTarget.closest("details")?.removeAttribute("open"))}function o(t){if(e.disabled){t.currentTarget.removeAttribute("open");return}t.currentTarget.open&&t.currentTarget.parentElement?.querySelectorAll(".models-select[open]").forEach(l=>{l!==t.currentTarget&&l.removeAttribute("open")})}return(()=>{var t=pe(),l=t.firstChild,c=l.nextSibling;return t.addEventListener("toggle",o),s(l,r),s(c,n(w,{each:N,children:a=>(()=>{var d=ve();return d.$$click=u=>i(a.value,u),s(d,()=>a.label),P(u=>{var p=a.value===e.value,v=a.value===e.value;return p!==u.e&&d.classList.toggle("selected",u.e=p),v!==u.t&&_(d,"aria-selected",u.t=v),u},{e:void 0,t:void 0}),d})()})),P(a=>{var d=!!e.disabled,u=e.label,p=e.disabled,v=e.label;return d!==a.e&&t.classList.toggle("disabled",a.e=d),u!==a.t&&_(l,"aria-label",a.t=u),p!==a.a&&_(l,"aria-disabled",a.a=p),v!==a.o&&_(c,"aria-label",a.o=v),a},{e:void 0,t:void 0,a:void 0,o:void 0}),t})()}function xe(){const e=he();return n(ie,{get title(){return(()=>{var r=ye();return r.firstChild,s(r,n(M,{get children(){return e.groups().length+e.settings().length}}),null),r})()},description:"Control what tools agents can use by default and add pattern-specific allow, ask, or deny rules.",get children(){return[(()=>{var r=be(),i=r.firstChild,o=i.firstChild;return s(r,n(w,{get each(){return e.groups()},children:t=>(()=>{var l=we(),c=l.firstChild,a=c.firstChild,d=a.firstChild,u=d.nextSibling,p=u.nextSibling,v=a.nextSibling,k=c.nextSibling;return s(d,()=>t.title),s(u,()=>t.id),s(p,()=>t.description),s(v,n(M,{get children(){return t.rules.length}}),null),s(v,n(D,{icon:"plus",variant:"primary",get disabled(){return!!e.ctx.saving()},onClick:()=>e.open(t.id),children:"Add rule"}),null),s(l,n(R,{title:"Default method",get subtitle(){return`Used for ${t.noun}s that do not match a specific rule.`},get status(){return(()=>{var h=E();return s(h,n(L,{get source(){return t.source},get inherited(){return t.inherited},get overridden(){return t.overridden}})),h})()},get actions(){return n(j,{get label(){return`Default method for ${t.title}`},get value(){return t.action},get disabled(){return!!e.ctx.saving()},onSelect:h=>e.setDefault(t.id,h)})}}),k),s(k,n(B,{get when(){return t.rules.length},get fallback(){return(()=>{var h=Ce(),$=h.firstChild,x=$.nextSibling;return x.nextSibling,s(h,()=>t.noun,x),h})()},get children(){return n(w,{get each(){return t.rules},children:h=>n(R,{get title(){return(()=>{var $=Se();return s($,()=>h.pattern),$})()},get subtitle(){return`${t.title} ${t.noun} rule`},get status(){return n(O,{rule:h})},get actions(){return n(G,{icon:"trash",variant:"ghost",get"aria-label"(){return`Delete ${t.title} rule ${h.pattern}`},get disabled(){return!!e.ctx.saving()},onClick:()=>e.remove(h)})}})})}})),l})()}),i),s(i,n(I,{get trailing(){return n(M,{get children(){return e.settings().length}})},description:"Default methods for additional built-in tool permissions.",children:"Tool Defaults"}),o),s(o,n(w,{get each(){return e.settings()},children:t=>n(R,{get title(){return t.title},get subtitle(){return`${t.id} · ${t.description}`},get status(){return(()=>{var l=E();return s(l,n(L,{get source(){return t.source},get inherited(){return t.inherited},get overridden(){return t.overridden}})),l})()},get actions(){return n(j,{get label(){return`Default method for ${t.title}`},get value(){return t.action},get disabled(){return!!e.ctx.saving()},onSelect:l=>e.setDefault(t.id,l)})}})})),s(r,n(B,{get when(){return e.other().length},get children(){var t=me(),l=t.firstChild;return s(t,n(I,{get trailing(){return n(M,{get children(){return e.other().length}})},description:"Additional tool permission rules from config.",children:"Other Permissions"}),l),s(l,n(w,{get each(){return e.other()},children:c=>n(R,{get title(){return te(c.tool)},get subtitle(){return(()=>{var a=ke(),d=a.firstChild,u=d.nextSibling;return s(d,()=>c.tool),s(u,()=>c.pattern),a})()},get status(){return n(O,{rule:c})},get actions(){return n(G,{icon:"trash",variant:"ghost",get"aria-label"(){return`Delete ${c.tool} rule ${c.pattern}`},get disabled(){return!!e.ctx.saving()},onClick:()=>e.remove(c)})}})})),t}}),null),r})(),n(B,{get when(){return e.mode()==="rule"},get children(){return[(()=>{var r=$e();return re(r,"click",e.close,!0),r})(),(()=>{var r=_e(),i=r.firstChild,o=i.firstChild,t=o.firstChild,l=t.nextSibling,c=i.nextSibling,a=c.firstChild,d=a.firstChild,u=a.nextSibling;u.firstChild;var p=c.nextSibling;return s(t,()=>`Add ${e.selected().title} Rule`),s(l,()=>`${e.selected().id} · ${e.selected().description}`),s(i,n(D,{variant:"ghost","aria-label":"Close permission rule overlay",get onClick(){return e.close},children:"X"}),null),s(a,()=>e.selected().noun==="command"?"Command pattern":"Path pattern",d),d.$$input=v=>e.setPattern(v.currentTarget.value),_(d,"spellcheck",!1),s(u,n(j,{label:"Rule method",get value(){return e.action()},get disabled(){return!!e.ctx.saving()},get onSelect(){return e.setAction}}),null),s(p,n(D,{variant:"ghost",get onClick(){return e.close},children:"Cancel"}),null),s(p,n(D,{variant:"primary",get disabled(){return!!e.ctx.saving()},get onClick(){return e.add},children:"Save Rule"}),null),P(()=>_(d,"placeholder",e.selected().placeholder)),P(()=>d.value=e.pattern()),r})()]}})]}})}ee(["click","input"]);const je=Object.freeze(Object.defineProperty({__proto__:null,ActionSelect:j,PermissionsRoute:xe,RuleMeta:O,label:U,tone:H},Symbol.toStringTag,{value:"Module"}));export{j as A,je as P,X as a,le as d,U as l,C as r,H as t};
@@ -0,0 +1 @@
1
+ import{u as ue,a as ge,c as w,b as pe,d as Q,e as T,i as e,f as n,g as K,t as a,h as fe,A as V,I as B,s as R,S as _,L as W,m as O,C as y,j as U,F as he,l as ve,k as $e,n as _e}from"./index-6uAP9-SB.js";import{B as X}from"./button-BT_ytG5s.js";import{u as me,a as be,c as we,b as M,d as Ce,i as Z,m as ye,e as D,p as ee,f as Se,w as xe}from"./profile-BT3_Yn05.js";var ke=a("<span>Overview"),Ke=a('<aside class=config-sidebar aria-label="Profile sections"><div class=config-sidebar-title><span>Profile</span><span class=config-sidebar-scope><span></span></span></div><nav class=config-options><a class="config-top-option config-top-option-external"target=_blank rel=noreferrer><span>Usage</span></a><a class="config-top-option config-top-option-external"target=_blank rel=noreferrer><span>Buy Credits'),Oe=a("<header class=profile-header><div><p class=eyebrow>Kilo Account</p><h1>Your Profile</h1><p>Manage your Kilo identity, account context, credits, and billing shortcuts.</p></div><div class=profile-actions><a class=profile-primary-link data-component=button data-size=default data-variant=primary target=_blank rel=noreferrer>Open Dashboard"),ze=a("<span class=profile-connect-mark aria-hidden=true>KG"),qe=a("<div class=profile-connect-copy><p class=eyebrow>Kilo Account</p><h1>Connect your Kilo account</h1><p>Sign in to view your credits, organizations, and account details in Kilo Console."),Ae=a("<strong>Kilo server not found"),Le=a("<span>Start Kilo Console from a running Kilo server or pass a server URL with ?server=."),Pe=a("<strong>Profile request failed"),re=a("<span>"),Ie=a("<strong>Account update failed"),Be=a('<section class="config-shell profile-shell"><section class=content><div class=profile-page>'),Re=a("<div class=profile-account-head><span class=profile-avatar aria-hidden=true></span><div class=profile-account-text><strong></strong><span>"),Ue=a("<div class=profile-meta-row><span>Active account</span><strong>"),Ee=a("<div class=profile-card-actions>"),Me=a("<span class=profile-card-label>Remaining Credits"),De=a("<strong>"),Ye=a("<p>Credits shown for <!>. Switch accounts below to see organization balances when available."),Fe=a("<header class=profile-card-head><div><span class=profile-card-label>Organizations</span><h2>Your Accounts</h2></div><span class=profile-pill>"),Ge=a("<div class=profile-org-list><button type=button class=profile-org-row><span class=profile-org-icon aria-hidden=true>KG</span><span class=profile-org-body><strong>Personal Account</strong><span>Your personal Kilo credits and settings</span></span><span class=profile-org-state>"),Ne=a("<div class=profile-grid>"),je=a("<button type=button class=profile-org-row><span class=profile-org-icon aria-hidden=true></span><span class=profile-org-body><strong></strong><span></span></span><span class=profile-org-state>");async function He(c){if(xe())return{kind:"disconnected"};try{const m=await ve(c);return D(!1),{kind:"connected",data:m}}catch(m){if(M(m))return D(!0),{kind:"disconnected"};throw m}}function ne(c){if(c?.currentOrgId)return c.profile.organizations?.find(m=>m.id===c.currentOrgId)}function E(c){return ne(c)?.name??"Personal Account"}function Je(c){return c.role==="owner"?"Owner":c.role==="admin"?"Admin":c.role==="billing_manager"?"Billing":"Member"}function We(){const c=ue(),m=ge(),A=w(()=>new URLSearchParams(c.search)),g=me(A),[p,L]=pe(g.query,He),[P,z]=Q(),[Y,S]=Q(""),h=w(()=>{const i=p();if(i?.kind==="connected")return i.data}),I=w(()=>h()?.profile.organizations??[]),F=w(()=>ne(h())),q=w(()=>p()?.kind==="disconnected"),te=w(()=>h()?E(h()):p.loading?"Loading...":"Not connected"),ae=()=>ee(A(),"/kilo/login"),G=()=>ee(A(),"/profile"),le=w(()=>be(h()?.currentOrgId)),ie=w(()=>we(h()?.currentOrgId));T(()=>{h()&&g.remember()}),T(()=>{const i=p.error;!i||M(i)||g.recover()});function se(){S(""),L.refetch()}function N(i){const C=g.query();if(!C)return;const f=i??Se;(h()?.currentOrgId??null)!==i&&(z(f),S(""),_e(C,i).then(()=>L.refetch()).catch(u=>S(U(u))).finally(()=>z(void 0)))}function oe(){const i=g.query();i&&(z("logout"),S(""),$e(i).then(()=>{D(!0),L.mutate({kind:"disconnected"}),m(G(),{replace:!0})}).catch(C=>S(U(C))).finally(()=>z(void 0)))}return(()=>{var i=Be(),C=i.firstChild,f=C.firstChild;return e(i,n(_,{get when(){return!q()},get children(){var t=Ke(),u=t.firstChild,r=u.firstChild,l=r.nextSibling,d=l.firstChild,v=u.nextSibling,$=v.firstChild;$.firstChild;var s=$.nextSibling;return s.firstChild,e(d,te),e(v,n(V,{class:"config-top-option active",get href(){return G()},"aria-current":"page",get children(){return ke()}}),$),e($,n(B,{name:"square-arrow-top-right",size:"small"}),null),e(s,n(B,{name:"square-arrow-top-right",size:"small"}),null),K(o=>{var b=le(),x=ie();return b!==o.e&&R($,"href",o.e=b),x!==o.t&&R(s,"href",o.t=x),o},{e:void 0,t:void 0}),t}}),C),e(f,n(_,{get when(){return!q()},get children(){var t=Oe(),u=t.firstChild,r=u.nextSibling,l=r.firstChild;return l.firstChild,e(r,n(X,{variant:"secondary",type:"button",onClick:se,get disabled(){return p.loading||!g.query()},children:"Refresh"}),l),e(l,n(B,{name:"square-arrow-top-right",size:"small"}),null),K(()=>R(l,"href",Ce())),t}}),null),e(f,n(_,{get when(){return O(()=>!g.query())()&&g.discoverable()},get children(){return n(W,{variant:"fullscreen"})}}),null),e(f,n(_,{get when(){return O(()=>!!p.loading)()&&!p()},get children(){return n(W,{variant:"fullscreen"})}}),null),e(f,n(_,{get when(){return q()},get children(){return n(y,{class:"profile-connect-card",get children(){return[ze(),qe(),n(V,{class:"profile-primary-link","data-component":"button","data-size":"default","data-variant":"primary",get href(){return ae()},children:"Connect"})]}})}}),null),e(f,n(_,{get when(){return O(()=>!g.query())()&&!g.discoverable()},get children(){return n(y,{class:"profile-banner",variant:"warning",get children(){return[Ae(),Le()]}})}}),null),e(f,n(_,{get when(){return O(()=>!!p.error)()&&!M(p.error)},get children(){return n(y,{class:"profile-banner",variant:"error",get children(){return[Pe(),(()=>{var t=re();return e(t,()=>U(p.error)),t})()]}})}}),null),e(f,n(_,{get when(){return Y()},get children(){return n(y,{class:"profile-banner",variant:"error",get children(){return[Ie(),(()=>{var t=re();return e(t,Y),t})()]}})}}),null),e(f,n(_,{get when(){return h()},children:t=>(()=>{var u=Ne();return e(u,n(y,{class:"profile-card profile-account-card",get children(){return[(()=>{var r=Re(),l=r.firstChild,d=l.nextSibling,v=d.firstChild,$=v.nextSibling;return e(l,()=>Z(t().profile.name,t().profile.email)),e(v,()=>t().profile.name||t().profile.email),e($,()=>t().profile.email),r})(),(()=>{var r=Ue(),l=r.firstChild,d=l.nextSibling;return e(d,()=>E(t())),r})(),(()=>{var r=Ee();return e(r,n(X,{variant:"ghost",type:"button",onClick:oe,get disabled(){return!!P()},children:"Log Out"})),r})()]}}),null),e(u,n(y,{class:"profile-card profile-balance-card",get children(){return[Me(),(()=>{var r=De();return e(r,()=>ye(t().balance?.balance)),r})(),(()=>{var r=Ye(),l=r.firstChild,d=l.nextSibling;return d.nextSibling,e(r,()=>E(t()),d),r})()]}}),null),e(u,n(y,{class:"profile-card profile-wide-card",get children(){return[(()=>{var r=Fe(),l=r.firstChild,d=l.nextSibling;return e(d,(()=>{var v=O(()=>I().length===1);return()=>v()?"1 org":`${I().length} orgs`})()),r})(),(()=>{var r=Ge(),l=r.firstChild,d=l.firstChild,v=d.nextSibling,$=v.nextSibling;return l.$$click=()=>N(null),e($,()=>t().currentOrgId?"Use":"Current"),e(r,n(he,{get each(){return I()},children:s=>(()=>{var o=je(),b=o.firstChild,x=b.nextSibling,j=x.firstChild,ce=j.nextSibling,de=x.nextSibling;return o.$$click=()=>N(s.id),e(b,()=>Z(s.name,s.name)),e(j,()=>s.name),e(ce,()=>Je(s)),e(de,()=>F()?.id===s.id?"Current":"Use"),K(k=>{var H=F()?.id===s.id,J=!!P();return H!==k.e&&o.classList.toggle("active",k.e=H),J!==k.t&&(o.disabled=k.t=J),k},{e:void 0,t:void 0}),o})()}),null),K(s=>{var o=!t().currentOrgId,b=!!P();return o!==s.e&&l.classList.toggle("active",s.e=o),b!==s.t&&(l.disabled=s.t=b),s},{e:void 0,t:void 0}),r})()]}}),null),u})()}),null),K(()=>i.classList.toggle("disconnected",!!q())),i})()}fe(["click"]);export{We as ProfileRoute};
@@ -0,0 +1 @@
1
+ .kilo-console .project-console{display:grid;grid-template-columns:13.75rem minmax(24rem,1fr) clamp(250px,var(--project-info-width, 300px),var(--project-info-max, min(800px, calc(100vw - 37.75rem) )));height:100%;min-height:0;overflow:hidden;background:var(--background)}.kilo-console .project-console-sidebar,.kilo-console .project-console-info,.kilo-console .project-console-main{min-width:0;min-height:0}.kilo-console .project-console-sidebar{--project-action-rail: 5rem;display:flex;flex-direction:column;height:100%;overflow:hidden;border-right:1px solid var(--border);background:var(--background)}.kilo-console .project-console-title{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:.25rem;min-height:4.25rem;border-bottom:1px solid var(--border);color:var(--muted-foreground);font-size:.6875rem;font-weight:400;padding:.75rem .5rem}.kilo-console .project-console-heading{display:inline-flex;align-items:center;justify-content:space-between;width:100%}.kilo-console .project-console-scope{display:inline-flex;align-items:center;max-width:100%;gap:.375rem;color:var(--foreground);font-size:.75rem;font-weight:400;line-height:1.45}.kilo-console .project-console-name,.kilo-console .project-console-title small{flex:1 1 auto;overflow:hidden;min-width:0;max-width:100%;text-overflow:ellipsis;white-space:nowrap}.kilo-console .project-title-settings{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:1.25rem;height:1.25rem;border-radius:var(--radius-sm);color:var(--muted-foreground);text-decoration:none}.kilo-console .project-title-settings:hover,.kilo-console .project-title-settings:focus-visible{background:var(--muted);color:var(--foreground);outline:0}.kilo-console .project-console-title small{color:var(--muted-foreground);font-size:.6875rem}.kilo-console .project-console-dot{flex:0 0 auto;width:.375rem;height:.375rem;border-radius:999px;background:var(--primary)}.kilo-console .project-console-scroll{display:flex;flex:1 1 auto;flex-direction:column;gap:.5rem;overflow:auto;min-height:0;padding:1rem .5rem}.kilo-console .project-sidebar-group{display:grid;gap:0}.kilo-console .project-console-actions,.kilo-console .project-contexts{display:flex;flex-direction:column;gap:0}.kilo-console .project-worktree-block{display:grid;gap:.125rem}.kilo-console .project-panel-heading{display:flex;align-items:center;justify-content:flex-start;min-height:1.25rem;color:var(--text-weaker);font-size:.625rem;font-weight:500;letter-spacing:.08em;padding:.25rem .5rem;text-transform:uppercase}.kilo-console .project-panel-heading-row{display:grid;grid-template-columns:minmax(0,1fr) var(--project-action-rail);gap:.25rem;padding-right:0}.kilo-console .project-panel-heading-row .project-heading-action{justify-self:end}.kilo-console .project-console-sidebar button,.kilo-console .project-settings-link{display:flex;align-items:center;width:100%;min-height:1.75rem;overflow:hidden;border:0;border-radius:var(--radius-sm);background:transparent;color:var(--muted-foreground);cursor:pointer;font:inherit;font-size:.75rem;font-weight:500;padding:0 .5rem;text-align:left;text-decoration:none}.kilo-console .project-console-sidebar button:hover,.kilo-console .project-console-sidebar button:focus-visible,.kilo-console .project-console-sidebar button.active,.kilo-console .project-settings-link:hover,.kilo-console .project-settings-link:focus-visible{background:var(--muted);color:var(--foreground);outline:0}.kilo-console .project-console-sidebar button:disabled{cursor:not-allowed;opacity:.55}.kilo-console .project-console-sidebar .project-heading-action,.kilo-console .project-console-sidebar .project-inline-action,.kilo-console .project-console-sidebar .project-terminal-close{justify-content:center;flex:0 0 auto;width:auto;min-width:1.35rem;min-height:1.35rem;padding:0 .35rem;color:var(--text-weaker);font-size:.625rem}.kilo-console .project-console-sidebar .project-inline-action{max-width:3.5rem}.kilo-console .project-console-sidebar .project-inline-action [data-component=icon]{color:currentColor}.kilo-console .project-console-sidebar .project-inline-action.danger:hover,.kilo-console .project-console-sidebar .project-inline-action.danger:focus-visible{color:var(--destructive, #ef4444)}.kilo-console .project-context-row,.kilo-console .project-terminal-item{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:.25rem;border-radius:var(--radius-sm)}.kilo-console .project-context-row:hover,.kilo-console .project-context-row:focus-within,.kilo-console .project-context-row.active,.kilo-console .project-terminal-item:hover,.kilo-console .project-terminal-item:focus-within,.kilo-console .project-terminal-item.active{background:var(--muted);color:var(--foreground)}.kilo-console .project-context-row .project-context:hover,.kilo-console .project-context-row .project-context:focus-visible,.kilo-console .project-context-row .project-context.active,.kilo-console .project-context-row .project-inline-action:hover,.kilo-console .project-context-row .project-inline-action:focus-visible,.kilo-console .project-terminal-item .project-terminal-row:hover,.kilo-console .project-terminal-item .project-terminal-row:focus-visible,.kilo-console .project-terminal-item .project-terminal-row.active,.kilo-console .project-terminal-item .project-terminal-close:hover,.kilo-console .project-terminal-item .project-terminal-close:focus-visible{background:transparent}.kilo-console .project-context-row:hover .project-context,.kilo-console .project-context-row:focus-within .project-context,.kilo-console .project-context-row.active .project-context{color:var(--foreground)}.kilo-console .project-terminal-item:hover .project-terminal-row,.kilo-console .project-terminal-item:focus-within .project-terminal-row,.kilo-console .project-terminal-item.active .project-terminal-row{color:var(--foreground)!important}.kilo-console .project-context-row .project-context{min-width:0}.kilo-console .project-row-actions{display:inline-flex;align-items:center;justify-content:flex-end;gap:.125rem;width:var(--project-action-rail);opacity:0;pointer-events:none;transition:opacity .12s ease}.kilo-console .project-context-row:hover .project-row-actions,.kilo-console .project-context-row:focus-within .project-row-actions,.kilo-console .project-terminal-item:hover .project-terminal-close,.kilo-console .project-terminal-item:focus-within .project-terminal-close{opacity:1;pointer-events:auto}.kilo-console .project-context span,.kilo-console .project-terminal-row span,.kilo-console .project-settings-link span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kilo-console .project-context small,.kilo-console .project-settings-link small{display:none}.kilo-console .project-terminal-list{display:grid;gap:0;margin:0 0 .25rem .75rem;border-left:1px solid var(--border);padding-left:.375rem}.kilo-console .project-terminal-row{display:grid!important;grid-template-columns:auto minmax(0,1fr);gap:.375rem;min-height:1.5rem!important;color:var(--muted-foreground)!important;font-size:.6875rem!important;font-weight:400!important}.kilo-console .project-terminal-close{opacity:0;pointer-events:none;transition:opacity .12s ease}.kilo-console .project-terminal-row .project-console-dot-idle{background:var(--muted-foreground);opacity:.6}.kilo-console .project-terminal-row .project-console-dot-busy{background:var(--primary);box-shadow:0 0 0 .1875rem color-mix(in oklab,var(--primary) 18%,transparent)}.kilo-console .project-terminal-row .project-console-dot-attention{background:#f97316;box-shadow:0 0 0 .1875rem color-mix(in oklab,#f97316 18%,transparent)}.kilo-console .project-terminal-row .project-console-dot-unread{background:#22c55e;box-shadow:0 0 0 .1875rem color-mix(in oklab,#22c55e 18%,transparent)}.kilo-console .project-terminal-row.active{color:var(--foreground)!important}.kilo-console .project-sidebar-bottom{flex:0 0 auto;border-top:1px solid var(--border);padding:.5rem}.kilo-console .project-console-main{display:flex;flex-direction:column;gap:0;position:relative;overflow:hidden;padding:0;background:var(--background-base, #0f1015)}.kilo-console .project-terminal-frame{position:absolute;inset:0;display:flex;min-width:0;min-height:0;opacity:0;pointer-events:none;visibility:hidden}.kilo-console .project-terminal-frame.active{position:relative;z-index:1;flex:1 1 auto;opacity:1;pointer-events:auto;visibility:visible}.kilo-console .project-terminal-loading{display:grid;flex:1 1 auto;place-items:center;color:var(--muted-foreground);font-size:.75rem}.kilo-console .project-terminal{--project-terminal-background: var(--background-base, #0f1015);position:relative;display:flex;flex:1 1 auto;flex-direction:column;width:100%;height:100%;overflow:hidden;min-height:0;border:0;border-radius:0;background:var(--project-terminal-background)}.kilo-console .project-terminal-host{flex:1 1 auto;position:relative;width:100%;height:100%;overflow:hidden;min-height:0;background:var(--project-terminal-background);opacity:0}.kilo-console .project-terminal.shown .project-terminal-host{opacity:1}.kilo-console .project-terminal-host textarea{left:-1px!important}.kilo-console .project-terminal-host canvas{background:var(--project-terminal-background);display:block}.kilo-console .project-terminal-error{position:absolute;right:.75rem;bottom:.75rem;left:.75rem;border:1px solid color-mix(in oklab,var(--destructive, #ef4444) 55%,var(--border));border-radius:var(--radius-md);background:color-mix(in oklab,var(--card) 92%,black);color:var(--foreground);font-size:.75rem;padding:.75rem}.kilo-console .project-terminal-empty{display:grid;place-content:center;flex:1 1 auto;gap:.375rem;min-height:0;background:var(--background-base, #0f1015);color:var(--muted-foreground);text-align:center}.kilo-console .project-terminal-empty strong{color:var(--foreground);font-size:.875rem}.kilo-console .project-terminal-empty span{font-size:.75rem}.kilo-console .project-console-info{display:flex;flex-direction:column;gap:.75rem;position:relative;overflow:hidden;border-left:1px solid var(--border);background:var(--background);padding:.875rem}.kilo-console .project-console-info>[data-component=resize-handle]:after{background:var(--ring)}.kilo-console .project-info-card{display:grid;gap:.5rem;flex:0 0 auto;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--card);padding:.75rem}.kilo-console .project-info-context-head{display:flex;align-items:center;justify-content:space-between;gap:.5rem}.kilo-console .project-info-context-head .project-panel-heading{min-height:0;padding:0}.kilo-console .project-info-title{overflow:hidden;color:var(--foreground);font-size:.875rem;font-weight:600;text-overflow:ellipsis;white-space:nowrap}.kilo-console .project-info-path{overflow:hidden;color:var(--muted-foreground);font-family:var(--font-family-mono, monospace);font-size:.6875rem;text-overflow:ellipsis;white-space:nowrap}.kilo-console .project-info-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.5rem;margin-top:.125rem}.kilo-console .project-info-actions [data-component=button]{width:100%}.kilo-console .project-info-review{display:flex;flex:1 1 auto;flex-direction:column;min-height:0;overflow:hidden;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--card)}.kilo-console .project-info-review [data-component=session-review]{display:flex;flex:1 1 auto;flex-direction:column;min-height:0;height:100%}.kilo-console .project-info-review [data-slot=session-review-header]{box-sizing:border-box;height:auto;min-height:2.5rem;padding:.75rem}.kilo-console .project-info-review [data-slot=session-review-title]{display:flex;align-items:center;justify-content:flex-start;min-height:1.25rem;color:var(--text-weaker);font-family:var(--font-family-sans);font-size:.625rem;font-weight:500;line-height:normal;letter-spacing:.08em;text-transform:uppercase}.kilo-console .project-info-review [data-slot=session-review-actions]>[data-component=button]{width:auto;min-width:0;height:1.5rem;gap:.25rem;padding:0 .375rem;font-size:.6875rem}.kilo-console .project-review-state,.kilo-console .project-review-empty{display:flex;flex:1 1 auto;align-items:center;justify-content:center;gap:.5rem;min-height:0;color:var(--muted-foreground);font-size:.75rem;text-align:center;padding:1rem}.kilo-console .project-review-state-error{color:var(--destructive, #ef4444)}@media(max-width:1180px){.kilo-console .project-console{grid-template-columns:13.75rem minmax(0,1fr)}.kilo-console .project-console-info{display:none}}@media(max-width:760px){.kilo-console .project-console{grid-template-columns:1fr;grid-template-rows:auto minmax(30rem,1fr);height:auto;min-height:0;overflow:auto}.kilo-console .project-console-sidebar{height:auto;max-height:18rem;border-right:0;border-bottom:1px solid var(--border)}.kilo-console .project-console-main{padding:1rem}.kilo-console .project-terminal{min-height:30rem}}
@@ -0,0 +1,4 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GhosttyTerminal-CYFOlDbt.js","assets/index-6uAP9-SB.js","assets/index-B-RNivcl.css","assets/session-review-C49EA5sE.js","assets/file-B0aQP9j1.js","assets/console-DBczKSnI.js","assets/config-De5WBuy1.js"])))=>i.map(i=>d[i]);
2
+ import{G as Ge,f as s,H as Ye,K as At,t as m,ao as _r,h as Bt,z as Sr,s as j,i as a,S as D,g as J,u as xr,V as Ir,c as $,d as k,b as It,e as A,a1 as Lr,o as Ke,a2 as Dr,m as we,U as Nt,ap as Lt,a5 as Ot,aq as Ze,a0 as Je,j as X,y as Tr,ar as Pr,as as Er,at as zr,a9 as Rr,a8 as Dt,au as Wr,a6 as Mr,a7 as Ur,I as Xe,A as Tt,F as He,L as Pt,C as Fr,av as Et,Z as Ar,aw as Br,ax as Nr,ay as Or,az as qr,ah as zt,aA as Kr,aB as Xr,aC as Hr,aD as Vr}from"./index-6uAP9-SB.js";import{T as Gr}from"./tag-ndRFRrjh.js";import{B as Re}from"./button-BT_ytG5s.js";import{D as Yr,b as Zr,M as Rt,a as Jr,n as Wt,c as Qr,S as en}from"./console-DBczKSnI.js";import{C as tn}from"./ConfirmDialog-kzGpMvPd.js";/* empty css */import"./config-De5WBuy1.js";function rn(i){const[n,d]=Ge(i,["variant","class","classList","children"]),h=()=>n.variant==="destructive"?"critical":n.variant==="default"?"brand":"neutral";return s(Gr,Ye(d,{get"data-variant"(){return n.variant??"default"},get tone(){return h()},get class(){return n.class},get classList(){return n.classList},get children(){return n.children}}))}var nn=m("<div>");function on(i){const[n,d]=Ge(i,["direction","edge","size","min","max","onResize","onCollapse","onCollapseChange","collapseThreshold","class","classList"]),h=g=>{if(g.detail>1)return;g.preventDefault();const w=n.edge??(n.direction==="vertical"?"start":"end"),b=n.direction==="horizontal"?g.clientX:g.clientY,q=n.direction==="horizontal"&&g.currentTarget instanceof Element&&getComputedStyle(g.currentTarget).direction==="rtl",T=n.size,R=n.min,B=n.max,O=n.collapseThreshold??0,H=n.onResize,Q=n.onCollapse,I=n.onCollapseChange;let N=T,V=!1;const We=n.direction==="horizontal"?"col-resize":"row-resize";document.body.style.userSelect="none",document.body.style.overflow="hidden",document.body.style.cursor=We;const ue=$e=>{const ee=n.direction==="horizontal"?$e.clientX:$e.clientY,je=n.direction==="vertical"?w==="end"?ee-b:b-ee:w==="start"!==q?b-ee:ee-b;N=T+je;const P=O>0&&N<O;P!==V&&(V=P,I?.(V)),H(Math.min(B,Math.max(R,N)))},ye=()=>{if(document.body.style.userSelect="",document.body.style.overflow="",document.body.style.cursor="",document.removeEventListener("mousemove",ue),document.removeEventListener("mouseup",ye),V){Q?.();return}I?.(!1)};document.addEventListener("mousemove",ue),document.addEventListener("mouseup",ye)};return(()=>{var g=nn();return At(g,Ye(d,{"data-component":"resize-handle",get"data-direction"(){return n.direction},get"data-edge"(){return n.edge??(n.direction==="vertical"?"start":"end")},get classList(){return{...n.classList,[n.class??""]:!!n.class}},onMouseDown:h}),!1,!1),g})()}const sn=_r({name:"FileComponent",init:i=>i.component}),an=sn.provider;var ln=m("<input>");function cn(i){const[n,d]=Ge(i,["class","classList"]);return(()=>{var h=ln();return At(h,Ye(d,{"data-component":"input","data-slot":"input",get classList(){return{...n.classList,[n.class??""]:!!n.class}}}),!1,!1),h})()}var dn=m('<div class=confirm-scrim><section class="confirm-dialog prompt-dialog"role=dialog aria-modal=true><form class=prompt-form><div class=prompt-body><div class=prompt-copy><h2></h2></div><label class=prompt-field><span></span></label></div><footer class=confirm-actions>'),un=m("<p>");function fn(i){const n=Sr(),d=`${n}-title`,h=`${n}-message`,g=`${n}-input`;return s(D,{get when(){return i.open},get children(){var w=dn(),b=w.firstChild,q=b.firstChild,T=q.firstChild,R=T.firstChild,B=R.firstChild,O=R.nextSibling,H=O.firstChild,Q=T.nextSibling;return w.$$keydown=I=>I.key==="Escape"&&i.onCancel(),j(b,"aria-labelledby",d),q.addEventListener("submit",I=>{I.preventDefault(),i.onConfirm()}),j(B,"id",d),a(B,()=>i.title),a(R,s(D,{get when(){return i.message},children:I=>(()=>{var N=un();return j(N,"id",h),a(N,I),N})()}),null),j(O,"for",g),a(H,()=>i.label),a(O,s(cn,{id:g,get value(){return i.value},get placeholder(){return i.placeholder},get disabled(){return i.busy},autofocus:!0,onInput:I=>i.onInput(I.currentTarget.value)}),null),a(Q,s(Re,{type:"button",variant:"ghost",get disabled(){return i.busy},get onClick(){return i.onCancel},get children(){return i.cancel??"Cancel"}}),null),a(Q,s(Re,{type:"submit",variant:"primary",get disabled(){return i.busy},get children(){return i.confirm??"Confirm"}}),null),J(()=>j(b,"aria-describedby",i.message?h:void 0)),w}})}Bt(["keydown"]);function gn(i){let n,d,h;async function g(){const w=d;if(w){d=void 0,n=w;try{await w.run(),h=w.key}catch(b){i(b)}n=void 0,d&&g()}}return{push(w,b=!1){!b&&w.key===h&&!n||!b&&w.key===n?.key&&!d||(d=w,n||g())}}}var vn=m("<span>Project Settings"),pn=m("<small>Project configuration"),mn=m("<strong>Project console failed"),hn=m("<span>"),wn=m("<div class=project-terminal-empty><strong>No terminal session selected</strong><span>Use + next to a worktree to start Kilo CLI."),bn=m("<div class=project-info-actions>"),yn=m('<section class=project-console><aside class=project-console-sidebar aria-label="Project console sections"><div class=project-console-title><span class=project-console-heading><span>Project</span></span><span class=project-console-scope><span class=project-console-name></span></span><small></small></div><div class=project-console-scroll><section class=project-sidebar-group><div class="project-panel-heading project-panel-heading-row"><span>Worktrees</span><button type=button class=project-heading-action title="Create worktree"aria-label="Create worktree">+</button></div><nav class=project-contexts aria-label=Worktrees></nav></section></div><div class=project-sidebar-bottom></div></aside><main class=project-console-main></main><aside class=project-console-info aria-label="Project details"><div class="project-info-card project-info-context"><div class=project-info-context-head><span class=project-panel-heading>Context</span></div><strong class=project-info-title></strong><code class=project-info-path></code></div><div class=project-info-review>'),$n=m("<button type=button class=project-inline-action>"),jn=m('<button type=button class="project-inline-action danger">'),kn=m("<div class=project-terminal-list>"),Cn=m("<div class=project-worktree-block><div class=project-context-row><button type=button class=project-context><span></span><small></small></button><div class=project-row-actions><button type=button class=project-inline-action>+"),_n=m("<div class=project-terminal-item><button type=button class=project-terminal-row><span class=project-console-dot aria-hidden=true></span><span></span></button><button type=button class=project-terminal-close>x"),Sn=m("<div class=project-terminal-frame>"),xn=m("<span class=project-terminal-loading>Starting terminal..."),In=m('<div class="project-review-state project-review-state-error">'),Ln=m("<div class=project-review-state><span>Loading changes…"),Dn=m("<div class=project-review-state>Loading changes..."),Tn=m("<span>Changes"),Pn=m("<div class=project-review-empty>No changes detected.");const En=Ze(()=>Je(()=>import("./GhosttyTerminal-CYFOlDbt.js"),__vite__mapDeps([0,1,2])).then(i=>({default:i.GhosttyTerminal}))),zn=Ze(()=>Je(()=>import("./session-review-C49EA5sE.js"),__vite__mapDeps([3,1,2,4,5,6])).then(i=>({default:i.SessionReview}))),Rn=Ze(()=>Je(()=>import("./file-B0aQP9j1.js").then(i=>i.i),__vite__mapDeps([4,1,2])).then(i=>({default:i.File}))),Wn=new Set(["3017","3018"]);function be(i){return i.get("server")?!1:Wn.has(window.location.port)}function Mn(i){const n=i.get("server");if(n)return n;const d=be(i)?Ot():"";return d||(be(i)?"":window.location.origin)}function qt(i){return i.split(/[\\/]/).filter(Boolean).at(-1)??"Project"}function Mt(i){return Nt(qt(i))}function Ve(i){return typeof i=="object"&&i!==null}function Ut(i,n){if(!Ve(i))return;const d=i[n];if(Ve(d))return d}function Un(i){const n=i.payload,d="properties"in n?n.properties:"data"in n?n.data:void 0;if(!Ve(d))return;const h=d.sessionID;if(typeof h=="string")return h;const g=Ut(d,"info");if(typeof g?.sessionID=="string")return g.sessionID;if(typeof g?.id=="string")return g.id;const w=Ut(d,"part");if(typeof w?.sessionID=="string")return w.sessionID}function Qe(i){const n=i.payload;return n.type?n.type!=="sync"?n.type:typeof n.name=="string"?n.name:typeof n.syncEvent?.type=="string"?n.syncEvent.type:"":""}function Fn(i){return Qe(i).startsWith("message.")}function An(i){const n=Qe(i);return!!(n.startsWith("pty.")||n.startsWith("session.")||n.startsWith("permission.")||n.startsWith("question.")||n.startsWith("message.")||n==="global.config.updated")}function Ft(i,n){return`${i}
3
+ ${n.directory}
4
+ ${n.id}`}function Vn(){const i=xr(),n=Ir(),d=crypto.randomUUID(),h=$(()=>new URLSearchParams(i.search)),g=()=>Mn(h()),[w,b]=k(g()),[q,T]=k(window.localStorage.getItem(`kilo.console.${n.project}.dir`)??""),[R,B]=k(window.localStorage.getItem(`kilo.console.${n.project}.pty`)??""),[O,H]=k([]),[Q,I]=k([]),[N,V]=k({}),[We,ue]=k(Yr),[ye,$e]=k(window.innerWidth),[ee,je]=k(Zr),[P,te]=k(),[Me,re]=k(),[et,tt]=k(new Set),[Kt,Ue]=k(new Set),[Xt,rt]=k(0),[ne,ie]=k(),[fe,ke]=k(),ge={timer:void 0},y={timer:void 0,pending:!1,expected:void 0};let nt;const Ce=new Set,W=()=>n.project??"",C=$(()=>{const e=Tr(w())||g();if(!(!e||!W()))return{url:e,dir:"",project:W()}}),[v,{refetch:ve}]=It(C,Pr),it=$(()=>Math.min(We(),Ae())),_e=$(()=>{const e=v();return e?[{id:"local",dir:e.project.worktree,label:"Local",kind:"local",managed:!1},...e.worktrees.map(t=>({id:t.directory,dir:t.directory,label:Mt(t.directory),kind:"worktree",managed:t.managed}))]:[]}),Se=$(()=>{const e=new Map,t=Kt();for(const r of O())t.has(r.id)||r.status==="running"&&e.set(r.id,r);for(const r of v()?.terminals??[])t.has(r.id)||r.status==="running"&&e.set(r.id,r);return Array.from(e.values())}),Ht=$(()=>{const e=new Map;for(const t of Se()){const r=e.get(t.directory)??[];r.push(t),e.set(t.directory,r)}return e}),E=$(()=>_e().find(e=>e.dir===q())??_e()[0]),oe=$(()=>Se().find(e=>e.id===R())),Fe=$(()=>{const e=v(),t=E(),r=C();if(!(!e||!t||!r))return{url:r.url,dir:t.dir,scope:"project"}}),Vt=$(()=>{const e=Fe();if(e)return{input:e,dir:e.dir}}),[pe]=It(Vt,e=>Er(e.input,e.dir)),Gt=$(()=>{const e=N();return(pe()??[]).filter(t=>typeof t.file=="string").map(t=>e[t.file]??t)}),xe=$(()=>{const e=oe(),t=C();if(!(!e||!t))return Ft(t.url,e)}),ot=$(()=>{const e=new Map,t=C();if(!t)return e;for(const r of Se())e.set(Ft(t.url,r),r);return e}),Yt=$(()=>Array.from(ot().keys())),st=$(()=>{const e=h().toString();return`/projects/${encodeURIComponent(W())}/settings${e?`?${e}`:""}`});function se(){const e=C(),t=v();if(!(!e||!t))return{url:e.url,dir:t.project.worktree,scope:"project"}}function Ie(e){return`kilo.console.${W()}.worktree.${encodeURIComponent(e)}.label`}function M(e){return Xt(),window.localStorage.getItem(Ie(e.dir))?.trim()||e.label}function Zt(){const e=E();return e?M(e):"Project"}function Le(e){return e?.sessionID??e?.session?.id}function at(){return Le(oe())}function De(e){return e.session?.title||e.title||`Terminal ${e.id.slice(-4)}`}function Te(e){if(e.attention)return"attention";if(e.sessionStatus&&e.sessionStatus.type!=="idle")return"busy";const t=Le(e);return t&&et().has(t)?"unread":"idle"}function lt(e){const t=Le(e);if(!t||!et().has(t))return;tt(u=>{const f=new Set(u);return f.delete(t),f});const r=v()?.project.id;r&&t&&Br(r,t)}function Jt(e){if(e===at())return;tt(r=>r.has(e)?r:new Set([...r,e]));const t=v()?.project.id;t&&Nr(t,e)}function Qt(){ge.timer||(ge.timer=window.setTimeout(()=>{ge.timer=void 0,ve()},150))}function me(e){return Ht().get(e)??[]}function ae(e,t){if(window.localStorage.setItem(`kilo.console.${W()}.dir`,e),t){window.localStorage.setItem(`kilo.console.${W()}.pty`,t);return}window.localStorage.removeItem(`kilo.console.${W()}.pty`)}function er(e){T(e.dir);const t=me(e.dir)[0];B(t?.id??""),ae(e.dir,t?.id)}function tr(e){T(e.directory),B(e.id),lt(e),ae(e.directory,e.id)}function rr(e){const t=Fe();t&&(N()[e]||Ce.has(e)||(Ce.add(e),Kr(t,t.dir,e).then(r=>{r&&r.file&&V(u=>({...u,[r.file]:r}))}).catch(r=>console.warn("Worktree diff file:",r)).finally(()=>Ce.delete(e))))}function nr(e){I(e);for(const t of e)rr(t)}function ir(e){je(e);const t=C();t&&zt({url:t.url,dir:"",scope:"global"},{console:{diff_style:e}}).catch(r=>console.warn(`Console diff style: ${X(r)}`))}function or(e){const t=Wt(e);ue(t),y.pending=!0,y.expected=t,y.timer&&window.clearTimeout(y.timer),y.timer=window.setTimeout(()=>{y.timer=void 0;const r=C();if(!r){y.pending=!1,y.expected=void 0;return}zt({url:r.url,dir:"",scope:"global"},{console:{context_sidebar_width:t}}).catch(u=>{y.expected=void 0,console.warn(`Console sidebar width: ${X(u)}`)}).finally(()=>{y.pending=!1})},350)}function Ae(){return Math.max(Rt,Math.min(Jr,ye()-604))}function Be(e,t){te(e),re(void 0),t().then(()=>ve()).catch(r=>re(X(r))).finally(()=>te(void 0))}function sr(){se()&&ie({kind:"create",value:""})}function ar(){const e=ne();if(!e)return;if(e.kind==="rename"){const u=e.value.trim();u&&window.localStorage.setItem(Ie(e.item.dir),u),u||window.localStorage.removeItem(Ie(e.item.dir)),rt(f=>f+1),ie(void 0);return}const t=se();if(!t)return;const r=e.value.trim()||void 0;ie(void 0),Be("Creating worktree",async()=>{const u=await Xr(t,r);T(u.directory),window.localStorage.setItem(`kilo.console.${W()}.dir`,u.directory)})}function lr(e=E()){const t=C();if(!t||!e)return;const r={url:t.url,dir:e.dir},u=`Kilo ${me(e.dir).length+1}`;te("Creating session"),re(void 0),Or(r,e.dir,u).then(f=>{const _={...f,directory:e.dir};return H(he=>[...he.filter(le=>le.id!==_.id),_]),T(e.dir),B(_.id),ae(e.dir,_.id),ve()}).catch(f=>re(X(f))).finally(()=>te(void 0))}function ct(e){H(t=>t.filter(r=>r.id!==e)),R()===e&&(B(""),window.localStorage.removeItem(`kilo.console.${W()}.pty`))}function cr(e){ct(e),ve()}function dr(e){const t={url:C()?.url??"",dir:e.directory};t.url&&(Ue(r=>new Set([...r,e.id])),ct(e.id),te("Closing terminal"),re(void 0),qr(t,e.id).then(()=>ve()).then(()=>{Ue(r=>{const u=new Set(r);return u.delete(e.id),u})}).catch(r=>{Ue(u=>{const f=new Set(u);return f.delete(e.id),f}),re(X(r))}).finally(()=>te(void 0)))}function ur(e){e.kind!=="local"&&ie({kind:"rename",item:e,value:M(e)})}function Ne(e){return e?.kind==="worktree"&&e.managed}function dt(e){!se()||!Ne(e)||ke({kind:"delete",item:e})}function fr(){const e=E();e&&dt(e)}function gr(){const e=E();!se()||!Ne(e)||ke({kind:"reset",item:e})}function vr(){const e=fe(),t=se();if(!(!e||!t)){if(ke(void 0),e.kind==="reset"){Be("Resetting worktree",async()=>Hr(t,e.item.dir));return}Be("Removing worktree",async()=>{await Vr(t,e.item.dir),window.localStorage.removeItem(Ie(e.item.dir)),rt(r=>r+1),q()===e.item.dir&&(T(t.dir),ae(t.dir))})}}function pr(e){ie(t=>t&&{...t,value:e})}function mr(){const e=ne();return!e||e.kind==="create"?"Create worktree":`Rename ${M(e.item)}`}function hr(){return ne()?.kind==="rename"?"Leave the name blank to restore the generated worktree name.":"Choose a recognizable name, or leave it blank to generate one automatically."}function wr(){const e=fe();return e?`${e.kind==="reset"?"Reset":"Delete"} worktree ${M(e.item)}?`:""}function br(){return fe()?.kind==="reset"?"This discards all uncommitted changes in the worktree.":"This removes the worktree directory and its files from the project."}A(()=>{const e=v();if(!e)return;const t=Wt(e.config.console?.context_sidebar_width);y.expected===t&&(y.expected=void 0),!y.pending&&y.expected===void 0&&ue(t),je(Qr(e.config.console?.diff_style))}),A(()=>{const e=h().get("server");e&&e!==w()&&b(e)}),A(zr(()=>Fe()?.dir,()=>{I([]),V({}),Ce.clear()},{defer:!0})),A(()=>{be(h())&&Rr().then(e=>{e&&(Dt(e),b(e))})}),A(()=>{const e=v();!e||_e().some(r=>r.dir===q())||(T(e.project.worktree),ae(e.project.worktree))}),A(()=>{const e=new Set((v()?.terminals??[]).map(r=>r.id));if(e.size===0)return;const t=O();t.some(r=>e.has(r.id))&&H(t.filter(r=>!e.has(r.id)))}),A(()=>{const e=E();if(!e||oe()?.directory===e.dir)return;const r=me(e.dir)[0];(r?.id??"")!==R()&&(B(r?.id??""),ae(e.dir,r?.id))}),A(()=>{const e=oe();e&&lt(e)});let Oe;const ut=gn(e=>console.warn(`Viewed sessions: ${X(e)}`));function ft(e=!1){const t=C(),r=v();if(!t||!r)return;const u=at(),f=new Set;u&&f.add(u);for(const le of Se()){const Pe=Le(le);Pe&&f.add(Pe)}const _={url:t.url,dir:r.project.worktree},he=_.url+"|"+_.dir+"|"+[...f].sort().join(",");Oe=_,ut.push({key:he,run:async()=>{await Lt(_,{id:d,active:!1},[...f],[])}},e)}A(()=>ft());const yr=window.setInterval(()=>ft(!0),6e4);return A(()=>{const e=C(),t=v();if(!e||!t)return;const r=new Set([t.project.worktree,...t.worktrees.map(f=>f.directory)]),u=Wr({url:e.url,dir:t.project.worktree},f=>{if(f.directory!=="global"&&!r.has(f.directory))return;const _=Un(f);_&&Fn(f)&&Jt(_),!(y.pending&&Qe(f)==="pty.updated")&&An(f)&&Qt()});Ke(u)}),Lr(()=>{const e=nt;if(!e)return;const t=()=>$e(e.clientWidth);t();const r=new ResizeObserver(t);r.observe(e),Ke(()=>r.disconnect())}),Ke(()=>{if(ge.timer&&window.clearTimeout(ge.timer),y.timer&&window.clearTimeout(y.timer),window.clearInterval(yr),Oe){const e=Oe;ut.push({key:e.url+"|"+e.dir+"|",run:async()=>{await Lt(e,{id:d,active:!1},[],[])}},!0)}}),A(()=>{if(!v.error||!be(h()))return;const e=Ot();!e||e!==w()||(Mr(),b(""),Ur().then(t=>{t&&(Dt(t),b(t))}))}),(()=>{var e=yn(),t=e.firstChild,r=t.firstChild,u=r.firstChild;u.firstChild;var f=u.nextSibling,_=f.firstChild,he=f.nextSibling,le=r.nextSibling,Pe=le.firstChild,gt=Pe.firstChild,$r=gt.firstChild,vt=$r.nextSibling,jr=gt.nextSibling,kr=le.nextSibling,ce=t.nextSibling,pt=ce.nextSibling,Ee=pt.firstChild,qe=Ee.firstChild;qe.firstChild;var mt=qe.nextSibling,ht=mt.nextSibling,Cr=Ee.nextSibling;return Dr(o=>{nt=o},e),a(u,s(Tt,{class:"project-title-settings",get href(){return st()},title:"Project Settings","aria-label":"Project Settings",get children(){return s(Xe,{name:"settings-gear",size:"small"})}}),null),a(_,(()=>{var o=we(()=>!!v()?.project.name);return()=>o()?Nt(v()?.project.name??""):Mt(v()?.project.worktree??W())})()),a(he,()=>v()?.vcs.branch??"No branch"),vt.$$click=sr,a(jr,s(He,{get each(){return _e()},children:o=>(()=>{var U=Cn(),G=U.firstChild,L=G.firstChild,K=L.firstChild,de=K.nextSibling,F=L.nextSibling,Y=F.firstChild;return L.$$click=()=>er(o),a(K,()=>M(o)),a(de,(()=>{var l=we(()=>o.kind==="local");return()=>l()?"project":qt(o.dir)})()),Y.$$click=l=>{l.stopPropagation(),lr(o)},a(F,s(D,{get when(){return o.kind==="worktree"},get children(){return[(()=>{var l=$n();return l.$$click=c=>{c.stopPropagation(),ur(o)},a(l,s(Xe,{name:"edit",size:"small"})),J(c=>{var z=!!P(),S=`Rename ${M(o)}`,x=`Rename ${M(o)}`;return z!==c.e&&(l.disabled=c.e=z),S!==c.t&&j(l,"title",c.t=S),x!==c.a&&j(l,"aria-label",c.a=x),c},{e:void 0,t:void 0,a:void 0}),l})(),s(D,{get when(){return o.managed},get children(){var l=jn();return l.$$click=c=>{c.stopPropagation(),dt(o)},a(l,s(Xe,{name:"trash",size:"small"})),J(c=>{var z=!!P(),S=`Delete ${M(o)}`,x=`Delete ${M(o)}`;return z!==c.e&&(l.disabled=c.e=z),S!==c.t&&j(l,"title",c.t=S),x!==c.a&&j(l,"aria-label",c.a=x),c},{e:void 0,t:void 0,a:void 0}),l}})]}}),null),a(U,s(D,{get when(){return me(o.dir).length>0},get children(){var l=kn();return a(l,s(He,{get each(){return me(o.dir)},children:c=>(()=>{var z=_n(),S=z.firstChild,x=S.firstChild,ze=x.nextSibling,Z=S.nextSibling;return S.$$click=()=>tr(c),a(ze,()=>De(c)),Z.$$click=p=>{p.stopPropagation(),dr(c)},J(p=>{var wt=R()===c.id,bt=R()===c.id,yt=`${De(c)} (${c.pid})`,$t=Te(c)==="idle",jt=Te(c)==="busy",kt=Te(c)==="attention",Ct=Te(c)==="unread",_t=!!P(),St=`Close ${De(c)}`,xt=`Close ${De(c)}`;return wt!==p.e&&z.classList.toggle("active",p.e=wt),bt!==p.t&&S.classList.toggle("active",p.t=bt),yt!==p.a&&j(S,"title",p.a=yt),$t!==p.o&&x.classList.toggle("project-console-dot-idle",p.o=$t),jt!==p.i&&x.classList.toggle("project-console-dot-busy",p.i=jt),kt!==p.n&&x.classList.toggle("project-console-dot-attention",p.n=kt),Ct!==p.s&&x.classList.toggle("project-console-dot-unread",p.s=Ct),_t!==p.h&&(Z.disabled=p.h=_t),St!==p.r&&j(Z,"title",p.r=St),xt!==p.d&&j(Z,"aria-label",p.d=xt),p},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0}),z})()})),l}}),null),J(l=>{var c=E()?.dir===o.dir&&!oe(),z=E()?.dir===o.dir&&!oe(),S=o.dir,x=!C()||!!P(),ze=`New session in ${M(o)}`,Z=`New session in ${M(o)}`;return c!==l.e&&G.classList.toggle("active",l.e=c),z!==l.t&&L.classList.toggle("active",l.t=z),S!==l.a&&j(L,"title",l.a=S),x!==l.o&&(Y.disabled=l.o=x),ze!==l.i&&j(Y,"title",l.i=ze),Z!==l.n&&j(Y,"aria-label",l.n=Z),l},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),U})()})),a(kr,s(Tt,{class:"project-settings-link",get href(){return st()},get children(){return[vn(),pn()]}})),a(ce,s(D,{get when(){return we(()=>!C())()&&be(h())},get children(){return s(Pt,{variant:"fullscreen"})}}),null),a(ce,s(D,{get when(){return we(()=>!!v.loading)()&&!v()},get children(){return s(Pt,{variant:"fullscreen"})}}),null),a(ce,s(D,{get when(){return v.error||Me()},get children(){return s(Fr,{class:"banner",variant:"error",get children(){return[mn(),(()=>{var o=hn();return a(o,()=>Me()??X(v.error)),o})()]}})}}),null),a(ce,s(He,{get each(){return Yt()},children:o=>{const U=$(()=>ot().get(o)),G=$(()=>{const L=U(),K=C();if(!(!L||!K))return{url:K.url,dir:L.directory,scope:"project"}});return s(D,{get when(){return G()},children:L=>{const K=U();return K?(()=>{var de=Sn();return a(de,s(Et,{get fallback(){return xn()},get children(){return s(En,{get query(){return L()},get pty(){return K.id},get active(){return xe()===o},onExit:()=>{const F=U();F&&cr(F.id)}})}})),J(F=>{var Y=xe()===o,l=xe()!==o;return Y!==F.e&&de.classList.toggle("active",F.e=Y),l!==F.t&&j(de,"aria-hidden",F.t=l),F},{e:void 0,t:void 0}),de})():null}})}}),null),a(ce,s(D,{get when(){return we(()=>!xe()&&!v.loading&&!v.error)()&&!Me()},get children(){return wn()}}),null),a(pt,s(on,{direction:"horizontal",edge:"start",get size(){return it()},min:Rt,get max(){return Ae()},"aria-label":"Resize project context sidebar",onResize:or}),Ee),a(qe,s(rn,{variant:"outline",get children(){return E()?.kind==="worktree"?"Worktree":"Local"}}),null),a(mt,Zt),a(ht,()=>E()?.dir??v()?.project.worktree??W()),a(Ee,s(D,{get when(){return Ne(E())},get children(){var o=bn();return a(o,s(Re,{variant:"secondary",size:"small",onClick:gr,get disabled(){return!!P()},children:"Reset"}),null),a(o,s(Re,{variant:"destructive",size:"small",onClick:fr,get disabled(){return!!P()},children:"Delete"}),null),o}}),null),a(Cr,s(D,{get when(){return!pe.error},get fallback(){return(()=>{var o=In();return a(o,()=>X(pe.error)),o})()},get children(){return s(D,{get when(){return!(pe.loading&&!pe())},get fallback(){return(()=>{var o=Ln(),U=o.firstChild;return a(o,s(en,{}),U),o})()},get children(){return s(Et,{get fallback(){return Dn()},get children(){return s(an,{component:Rn,get children(){return s(zn,{get diffs(){return Gt()},get title(){return Tn()},get diffStyle(){return ee()},onDiffStyleChange:ir,get open(){return Q()},onOpenChange:nr,get empty(){return Pn()}})}})}})}})}})),a(e,s(fn,{get open(){return!!ne()},get title(){return mr()},get message(){return hr()},label:"Worktree name",get value(){return ne()?.value??""},placeholder:"feature-name",get confirm(){return ne()?.kind==="rename"?"Save":"Create"},get busy(){return!!P()},onInput:pr,onCancel:()=>ie(void 0),onConfirm:ar}),null),a(e,s(tn,{get open(){return!!fe()},get title(){return wr()},get message(){return br()},get confirm(){return fe()?.kind==="reset"?"Reset":"Delete"},get busy(){return!!P()},onCancel:()=>ke(void 0),onConfirm:vr}),null),J(o=>{var U=`--project-info-width: ${it()}px; --project-info-max: ${Ae()}px`,G=!se()||!!P(),L=E()?.dir;return o.e=Ar(e,U,o.e),G!==o.t&&(vt.disabled=o.t=G),L!==o.a&&j(ht,"title",o.a=L),o},{e:void 0,t:void 0,a:void 0}),e})()}Bt(["click"]);export{Vn as ProjectConsoleRoute};
@@ -0,0 +1,5 @@
1
+ import{G as Ve,c as z,K as Xe,H as Ye,g as f,s as C,t as h,f as i,d as v,y as L,ab as _e,al as gt,am as pt,an as vt,j as ft,h as mt,S as _,C as Me,w as Te,i as a,F as ge,X as qe,v as bt,m as Be}from"./index-6uAP9-SB.js";import{B as P}from"./button-BT_ytG5s.js";import{a as $t,S as _t,f as Fe,e as kt}from"./ConfigPage-CFkfj5pU.js";import{C as yt}from"./ConfirmDialog-kzGpMvPd.js";import{C as Ct}from"./CustomSelect-BukE91GR.js";import{u as wt}from"./config-De5WBuy1.js";import"./tag-ndRFRrjh.js";const xt="/console/assets/sprite-AeII6KVZ.svg",St=["zhipuai","zhipuai-coding-plan","zenmux","zai","zai-coding-plan","xiaomi","xiaomi-token-plan-sgp","xiaomi-token-plan-cn","xiaomi-token-plan-ams","xai","wandb","wafer.ai","vultr","vivgrid","vercel","venice","v0","upstage","togetherai","the-grid-ai","tencent-tokenhub","tencent-coding-plan","synthetic","submodel","stepfun","stackit","siliconflow","siliconflow-cn","scaleway","sap-ai-core","requesty","regolo-ai","qiniu-ai","qihang-ai","privatemode-ai","poe","perplexity","perplexity-agent","ovhcloud","openrouter","opencode","opencode-go","openai","ollama-cloud","nvidia","novita-ai","nova","neuralwatt","nebius","nano-gpt","morph","moonshotai","moonshotai-cn","modelscope","moark","mixlayer","mistral","minimax","minimax-coding-plan","minimax-cn","minimax-cn-coding-plan","meganova","lucidquery","lmstudio","llmgateway","llama","kuae-cloud-coding-plan","kiro","kimi-for-coding","kilo","jiekou","io-net","inference","inception","iflowcn","huggingface","hpc-ai","helicone","groq","google","google-vertex","google-vertex-anthropic","gitlab","github-models","github-copilot","frogbot","friendli","firmware","fireworks-ai","fastrouter","evroc","drun","dinference","digitalocean","deepseek","deepinfra","cortecs","cohere","cloudflare-workers-ai","cloudflare-ai-gateway","cloudferro-sherlock","clarifai","chutes","cerebras","berget","baseten","bailing","azure","azure-cognitive-services","atomic-chat","anthropic","amazon-bedrock","alibaba","alibaba-coding-plan","alibaba-coding-plan-cn","alibaba-cn","aihubmix","abliteration-ai","abacus","302ai"];var At=h("<svg data-component=provider-icon><use>");const Pt=e=>{const[s,m]=Ve(e,["id","class","classList"]),d=z(()=>St.includes(s.id)?s.id:"synthetic");return(()=>{var t=At(),n=t.firstChild;return Xe(t,Ye(m,{get classList(){return{...s.classList,[s.class??""]:!!s.class}}}),!0,!0),f(()=>C(n,"href",`${xt}#${d()}`)),t})()};var zt=h('<svg data-component=provider-icon data-provider=kilo viewBox="0 0 16 16"aria-hidden=true><rect width=16 height=16 rx=3 fill=var(--primary)></rect><text x=8 y=8.15 dominant-baseline=middle fill=var(--primary-foreground) font-size=10 font-weight=700 letter-spacing=-0.025em text-anchor=middle>K');const ke=e=>{const[s,m]=Ve(e,["id","class","classList"]);return s.id!=="kilo"?i(Pt,e):(()=>{var d=zt();return Xe(d,Ye(m,{get classList(){return{...s.classList,[s.class??""]:!!s.class}}}),!0,!0),d})()},Ne=["kilo","anthropic","github-copilot","openai","google","openrouter","vercel"],Lt=/^[a-z0-9][a-z0-9-_]*$/;function Re(e){const s=Ne.indexOf(e.toLowerCase());return s>=0?s:Ne.length}function De(e){return e.slice().sort((s,m)=>{const d=Re(s.id)-Re(m.id);return d!==0?d:s.name.localeCompare(m.name)})}function Ue(e){return!e||typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?"":JSON.stringify(e,null,2)}function Je(e,s,m){const d=L(e);if(!d)return{};try{const t=JSON.parse(d);if(!t||typeof t!="object"||Array.isArray(t)){m(`${s} must be a JSON object.`);return}return t}catch(t){m(`${s}: ${ft(t)}`);return}}function It(e){return Object.fromEntries(Object.entries(e??{}).filter(([s])=>s!=="apiKey"&&s!=="baseURL"))}function Ot(e,s){const m=e.when;if(!m)return!0;const d=s[m.key]??"";return m.op==="eq"?d===m.value:d!==m.value}function Et(){const e=wt(),s=()=>e.data(),[m,d]=v("closed"),[t,n]=v(""),[c,l]=v(""),[u,b]=v(""),[k,w]=v(),[x,S]=v(""),[I,O]=v(""),[M,U]=v(""),[re,T]=v(""),[J,ne]=v(""),[q,V]=v(""),[ie,B]=v(""),[X,le]=v(""),[F,Y]=v(""),[ae,N]=v(""),[H,oe]=v(""),[R,W]=v(),[G,D]=v(),[g,pe]=v(),[He,Z]=v(),[Ce,we]=v(""),[xe,Se]=v(""),[Q,Ae]=v({}),[We,ee]=v(""),[Ge,te]=v(""),se=z(()=>{const r=s();if(!r)return[];const o=r.effective.provider??{},y=new Map(r.overlay.collections.provider.map($=>[$.key,$])),p=Object.entries(o).flatMap(([$,E])=>{if(!E)return[];const j=r.providers.all.find(he=>he.id===$),K=y.get($),ue=Object.keys(j?.models??E.models??{}).length;return[{id:$,name:E.name??j?.name??$,source:K?.source??j?.source??"config",models:ue,config:E,provider:j,inherited:K?.inherited,overridden:K?.overridden,editable:K?.editable}]}),de=new Set(p.map($=>$.id)),A=r.providers.all.flatMap($=>de.has($.id)?[]:r.providers.connected.includes($.id)?[{id:$.id,name:$.name,source:$.source,models:Object.keys($.models).length,config:{},provider:$,editable:!0}]:[]);return De([...p,...A])}),Ze=z(()=>{const r=c().trim().toLowerCase();return r?se().filter(o=>`${o.name} ${o.id}`.toLowerCase().includes(r)):se()}),ve=z(()=>{const r=s();if(!r)return[];const o=new Set(se().map(p=>p.id)),y=t().trim().toLowerCase();return De(r.providers.all).filter(p=>!o.has(p.id)).filter(p=>y?`${p.name} ${p.id}`.toLowerCase().includes(y):!0)}),Qe=z(()=>{const r=x();return s()?.providers.all.find(o=>o.id===r)}),Pe=z(()=>ve().find(r=>r.id===u())??ve()[0]),fe=z(()=>s()?.authMethods[x()]??[]),ze=z(()=>{const r=G();return r===void 0?void 0:fe()[r]}),Le=z(()=>ze()?.prompts?.filter(r=>Ot(r,Q()))??[]),et=z(()=>fe().length>0);function tt(){D(void 0),pe(void 0),Z(void 0),we(""),Se(""),Ae({}),ee(""),te("")}function Ie(r,o,y){const p=o?.options??{};S(y||r?.id||o?.id||""),O(o?.name??r?.name??""),U((o?.env??r?.env??[]).join(", ")),T(o?.api??""),ne(o?.npm??""),V(typeof p.apiKey=="string"?p.apiKey:""),B(typeof p.baseURL=="string"?p.baseURL:""),le((o?.whitelist??[]).join(", ")),Y((o?.blacklist??[]).join(", ")),N(Ue(It(p))),oe(Ue(o?.models)),tt()}function Oe(r,o=x()){D(r),pe(void 0),ee(""),te(""),(s()?.authMethods[o]??[])[r]?.type==="oauth"&&(Z("authorizing"),e.run("Authorizing provider",async()=>{const p=await vt(e.target(),o,r,Q());pe(p),Z(void 0),p.url&&window.open(p.url,"_blank","noopener,noreferrer"),p.method==="auto"&&Ke(r)},{refetch:!1}))}function rt(r,o){Ae({...Q(),[r]:o})}function Ee(r){(s()?.authMethods[r]??[]).length===1&&Oe(0,r)}function nt(){w(void 0),n(""),b(""),d("select")}function ce(){d("closed")}function je(r){w(void 0),Ie(r,void 0,r.id),d("form"),Ee(r.id)}function it(r){b(r.id)}function lt(){const r=Pe();r&&je(r)}function at(r){w(r.id),Ie(r.provider,r.config,r.id),d("form"),Ee(r.id)}function ot(){const r=L(Ce());if(!r){ee("Enter an API key before saving."),te("apiKey");return}const o={};for(const y of Le()){const p=L(Q()[y.key]??"");if(!p){ee(`${y.message} is required.`),te(y.key);return}o[y.key]=p}Z("connecting"),e.run("Connecting provider",async()=>pt(e.target(),x(),r,Object.keys(o).length?o:void 0)),ce()}function Ke(r=G()){if(r===void 0)return;const o=L(xe());if(g()?.method==="code"&&!o){ee("Enter the authorization code before saving."),te("code");return}Z("connecting"),e.run("Connecting provider",async()=>gt(e.target(),x(),r,g()?.method==="code"?o:void 0)),g()?.method==="code"&&ce()}function st(){const r=L(x());if(!r||!Lt.test(r)){e.fail("Provider ID must start with a lowercase letter or number and contain only lowercase letters, numbers, dashes, or underscores.");return}const o=Je(ae(),"Extra options",e.fail),y=Je(H(),"Model overrides",e.fail);if(!o||!y)return;const p=L(q()),de=L(ie());p&&(o.apiKey=p),de&&(o.baseURL=de);const A={},$=L(I()),E=_e(M()),j=_e(X()),K=_e(F()),ue=L(re()),he=L(J());$&&(A.name=$),E.length&&(A.env=E),ue&&(A.api=ue),he&&(A.npm=he),j.length&&(A.whitelist=j),K.length&&(A.blacklist=K),Object.keys(o).length&&(A.options=o),Object.keys(y).length&&(A.models=y);const me=s();if(!me)return;const be={...me.effective.provider??{}},$e=k();$e&&$e!==r&&(be[$e]=null),be[r]=A,e.save({provider:be,disabled_providers:(me.effective.disabled_providers??[]).filter(ht=>ht!==r)}),ce()}function ct(r){W(r)}function dt(){W(void 0)}function ut(){const r=R();if(!r)return;const o=s();o&&(e.save({provider:{...o.effective.provider??{},[r.id]:null}}),W(void 0))}return{ctx:e,snap:s,mode:m,filter:t,setFilter:n,search:c,setSearch:l,configured:se,visible:Ze,available:ve,selected:Qe,target:Pe,auth:et,methods:fe,method:ze,prompts:Le,methodIndex:G,authorization:g,phase:He,authKey:Ce,setAuthKey:we,authCode:xe,setAuthCode:Se,fields:Q,setField:rt,authError:We,authField:Ge,id:x,setId:S,name:I,setName:O,env:M,setEnv:U,api:re,setApi:T,npm:J,setNpm:ne,apiKey:q,setApiKey:V,baseURL:ie,setBaseURL:B,whitelist:X,setWhitelist:le,blacklist:F,setBlacklist:Y,options:ae,setOptions:N,models:H,setModels:oe,pending:R,add:nt,close:ce,pick:je,choose:it,next:lt,edit:at,selectMethod:Oe,connectAuth:ot,completeOAuth:Ke,save:st,ask:ct,cancel:dt,confirm:ut}}var jt=h("<div class=providers>"),Kt=h("<div class=drawer-scrim>"),Mt=h('<header class="drawer-header provider-config-header"><div class="provider-title provider-drawer-title"><div><h2></h2><span>'),Tt=h("<p>Select how to connect <!>."),qt=h("<div class=auth-methods>"),Bt=h("<p>Preparing authorization..."),Ft=h("<p>Connect <!> with an API key. Extra fields are provided by the server."),Nt=h('<label>API key<input type=password placeholder="Paste API key"autocomplete=off>'),Rt=h("<p>Open the authorization page and paste the code returned by <!>."),Dt=h("<a target=_blank rel=noreferrer>Open authorization page"),Ut=h('<label>Authorization code<input placeholder="Paste authorization code">'),Jt=h("<p>Complete authorization in the browser window. This page will refresh once the provider is connected."),Vt=h("<div class=provider-auth>"),ye=h("<footer class=drawer-footer>"),Xt=h('<aside class=provider-drawer aria-label="Provider configuration">'),Yt=h("<span class=config-title-count>Providers"),Ht=h("<p class=empty>No providers match this filter."),Wt=h('<article class="provider configured-provider"><div class=provider-title><div><strong></strong><span></span></div></div><div class=tags><span class=provider-model-count></span></div><div class=provider-actions>'),Gt=h("<header class=drawer-header><div><h2>Add provider</h2><span>Choose a provider, then enter credentials."),Zt=h('<div class=add-provider-body><section class=add-provider-field><h3>Choose provider</h3><div class="provider-picker add-provider-picker">'),Qt=h("<p class=empty>No available providers match."),er=h('<button class="provider-option add-provider-option"type=button><div><strong></strong><span>'),tr=h("<span>Select a provider to enter credentials."),rr=h("<span>Step 2 · enter credentials for <strong>"),nr=h(`<div class=provider-form><label class=required-field>Provider ID<input></label><label class=required-field>Display name<input></label><label class=optional-field>Environment variables<input placeholder="ANTHROPIC_API_KEY, OPENAI_API_KEY"></label><label class=optional-field>API key<input placeholder="sk-... or {env:PROVIDER_API_KEY}"></label><label class=optional-field>Base URL<input placeholder=https://api.example.com/v1></label><label class=optional-field>NPM package<input placeholder=@ai-sdk/openai-compatible></label><label class=optional-field>API identifier<input placeholder=openai-compatible></label><label class=optional-field>Model whitelist<input placeholder="model-a, model-b"></label><label class=optional-field>Model blacklist<input placeholder="model-a, model-b"></label><label class="wide optional-field">Extra options JSON<textarea placeholder="{
2
+ &quot;timeout&quot;: 300000
3
+ }"></textarea></label><label class="wide optional-field">Model overrides JSON<textarea placeholder="{
4
+ &quot;model-id&quot;: { &quot;name&quot;: &quot;Model Name&quot; }
5
+ }">`),ir=h("<label>"),lr=h("<input>"),ar=h("<code>"),or=h("<p class=form-error>");function vr(){const e=Et(),s=()=>e.ctx.query()?.scope==="project";return i(_,{get when(){return e.snap()},children:m=>i($t,{get title(){return(()=>{var d=Yt();return d.firstChild,a(d,i(kt,{get children(){return e.configured().length}}),null),d})()},description:"Credentials and endpoints for upstream model providers. Each provider exposes one or more models.",get actions(){return i(P,{icon:"plus",variant:"primary",get disabled(){return!!e.ctx.saving()||s()},get onClick(){return e.add},children:"Add provider"})},get children(){return[i(_,{get when(){return s()},get children(){return i(Me,{class:"banner",variant:"info",children:"Providers are global credentials. Project settings show inherited providers as read-only."})}}),i(Te,{label:"Filter providers",get value(){return e.search()},placeholder:"Filter by name or ID...",get onValue(){return e.setSearch}}),(()=>{var d=jt();return a(d,i(_,{get when(){return e.visible().length},get fallback(){return Ht()},get children(){return i(ge,{get each(){return e.visible()},children:t=>(()=>{var n=Wt(),c=n.firstChild,l=c.firstChild,u=l.firstChild,b=u.nextSibling,k=c.nextSibling,w=k.firstChild,x=k.nextSibling;return a(c,i(ke,{get id(){return t.id},class:"provider-icon"}),l),a(u,()=>t.name),a(b,()=>t.id),a(k,i(_t,{get source(){return t.source},get inherited(){return t.inherited},get overridden(){return t.overridden}}),w),a(w,()=>`${t.models} ${t.models===1?"model":"models"}`),a(k,i(_,{get when(){return m().providers.connected.includes(t.id)},get children(){return i(Fe,{status:"connected"})}}),null),a(k,i(_,{get when(){return m().providers.failed.includes(t.id)},get children(){return i(Fe,{status:"failed"})}}),null),a(x,i(qe,{icon:"edit",variant:"ghost",get"aria-label"(){return`Edit ${t.name}`},get disabled(){return!!e.ctx.saving()||s()||t.editable===!1},onClick:()=>e.edit(t)}),null),a(x,i(qe,{icon:"trash",variant:"ghost",get"aria-label"(){return`Delete ${t.name}`},get disabled(){return!!e.ctx.saving()||s()||t.editable===!1},onClick:()=>e.ask(t)}),null),f(()=>n.classList.toggle("inherited",!!t.inherited)),n})()})}})),d})(),i(_,{get when(){return e.mode()!=="closed"},get children(){return[(()=>{var d=Kt();return bt(d,"click",e.close,!0),d})(),(()=>{var d=Xt();return a(d,i(_,{get when(){return e.mode()==="form"},get fallback(){return[(()=>{var t=Gt();return t.firstChild,a(t,i(P,{variant:"ghost","aria-label":"Close provider overlay",get onClick(){return e.close},children:"X"}),null),t})(),(()=>{var t=Zt(),n=t.firstChild,c=n.firstChild,l=c.nextSibling;return a(n,i(Te,{class:"drawer-search add-provider-search",label:"Filter providers",get value(){return e.filter()},variant:"drawer",placeholder:"Search by name or ID",get onValue(){return e.setFilter}}),l),a(l,i(_,{get when(){return e.available().length},get fallback(){return Qt()},get children(){return i(ge,{get each(){return e.available()},children:u=>(()=>{var b=er(),k=b.firstChild,w=k.firstChild,x=w.nextSibling;return b.$$dblclick=()=>e.pick(u),b.$$click=()=>e.choose(u),a(b,i(ke,{get id(){return u.id},class:"provider-icon"}),k),a(w,()=>u.name),a(x,()=>u.id),f(S=>{var I=e.target()?.id===u.id,O=e.target()?.id===u.id;return I!==S.e&&b.classList.toggle("selected",S.e=I),O!==S.t&&C(b,"aria-pressed",S.t=O),S},{e:void 0,t:void 0}),b})()})}})),a(t,i(Me,{class:"add-provider-step",padding:16,get children(){return i(_,{get when(){return e.target()},get fallback(){return tr()},children:u=>(()=>{var b=rr(),k=b.firstChild,w=k.nextSibling;return a(w,()=>u().name),b})()})}}),null),t})(),(()=>{var t=ye();return a(t,i(P,{variant:"ghost",get onClick(){return e.close},children:"Cancel"}),null),a(t,i(P,{variant:"primary",get disabled(){return!e.target()},get onClick(){return e.next},children:"Add provider"}),null),t})()]},get children(){return[(()=>{var t=Mt(),n=t.firstChild,c=n.firstChild,l=c.firstChild,u=l.nextSibling;return a(n,i(ke,{get id(){return e.id()||e.selected()?.id||"synthetic"},class:"provider-icon"}),c),a(l,()=>e.name()||e.selected()?.name||e.id()||"Provider"),a(u,()=>e.id()||"New provider"),a(t,i(P,{variant:"ghost","aria-label":"Close provider overlay",get onClick(){return e.close},children:"X"}),null),t})(),i(_,{get when(){return e.auth()},get fallback(){return[(()=>{var t=nr(),n=t.firstChild,c=n.firstChild,l=c.nextSibling,u=n.nextSibling,b=u.firstChild,k=b.nextSibling,w=u.nextSibling,x=w.firstChild,S=x.nextSibling,I=w.nextSibling,O=I.firstChild,M=O.nextSibling,U=I.nextSibling,re=U.firstChild,T=re.nextSibling,J=U.nextSibling,ne=J.firstChild,q=ne.nextSibling,V=J.nextSibling,ie=V.firstChild,B=ie.nextSibling,X=V.nextSibling,le=X.firstChild,F=le.nextSibling,Y=X.nextSibling,ae=Y.firstChild,N=ae.nextSibling,H=Y.nextSibling,oe=H.firstChild,R=oe.nextSibling,W=H.nextSibling,G=W.firstChild,D=G.nextSibling;return l.$$input=g=>e.setId(g.currentTarget.value),C(l,"spellcheck",!1),k.$$input=g=>e.setName(g.currentTarget.value),S.$$input=g=>e.setEnv(g.currentTarget.value),C(S,"spellcheck",!1),M.$$input=g=>e.setApiKey(g.currentTarget.value),C(M,"spellcheck",!1),T.$$input=g=>e.setBaseURL(g.currentTarget.value),C(T,"spellcheck",!1),q.$$input=g=>e.setNpm(g.currentTarget.value),C(q,"spellcheck",!1),B.$$input=g=>e.setApi(g.currentTarget.value),C(B,"spellcheck",!1),F.$$input=g=>e.setWhitelist(g.currentTarget.value),C(F,"spellcheck",!1),N.$$input=g=>e.setBlacklist(g.currentTarget.value),C(N,"spellcheck",!1),R.$$input=g=>e.setOptions(g.currentTarget.value),C(R,"spellcheck",!1),D.$$input=g=>e.setModels(g.currentTarget.value),C(D,"spellcheck",!1),f(()=>l.value=e.id()),f(()=>k.value=e.name()),f(()=>S.value=e.env()),f(()=>M.value=e.apiKey()),f(()=>T.value=e.baseURL()),f(()=>q.value=e.npm()),f(()=>B.value=e.api()),f(()=>F.value=e.whitelist()),f(()=>N.value=e.blacklist()),f(()=>R.value=e.options()),f(()=>D.value=e.models()),t})(),(()=>{var t=ye();return a(t,i(P,{variant:"ghost",get onClick(){return e.close},children:"Cancel"}),null),a(t,i(P,{variant:"primary",get disabled(){return!!e.ctx.saving()},get onClick(){return e.save},children:"Save Provider"}),null),t})()]},get children(){return[(()=>{var t=Vt();return a(t,i(_,{get when(){return Be(()=>e.methods().length>1)()&&e.methodIndex()===void 0},get children(){return[(()=>{var n=Tt(),c=n.firstChild,l=c.nextSibling;return l.nextSibling,a(n,()=>e.name()||e.id(),l),n})(),(()=>{var n=qt();return a(n,i(ge,{get each(){return e.methods()},children:(c,l)=>i(P,{variant:"secondary",onClick:()=>e.selectMethod(l()),get children(){return c.label}})})),n})()]}}),null),a(t,i(_,{get when(){return e.phase()==="authorizing"},get children(){return Bt()}}),null),a(t,i(_,{get when(){return e.method()?.type==="api"},get children(){return[(()=>{var n=Ft(),c=n.firstChild,l=c.nextSibling;return l.nextSibling,a(n,()=>e.name()||e.id(),l),n})(),(()=>{var n=Nt(),c=n.firstChild,l=c.nextSibling;return l.$$input=u=>e.setAuthKey(u.currentTarget.value),C(l,"spellcheck",!1),f(()=>l.classList.toggle("invalid",e.authField()==="apiKey")),f(()=>l.value=e.authKey()),n})(),i(ge,{get each(){return e.prompts()},children:n=>(()=>{var c=ir();return a(c,()=>n.message,null),a(c,i(_,{get when(){return n.type==="select"},get fallback(){return(()=>{var l=lr();return l.$$input=u=>e.setField(n.key,u.currentTarget.value),f(u=>{var b=n.type==="text"?n.placeholder:void 0,k=e.authField()===n.key;return b!==u.e&&C(l,"placeholder",u.e=b),k!==u.t&&l.classList.toggle("invalid",u.t=k),u},{e:void 0,t:void 0}),f(()=>l.value=e.fields()[n.key]??""),l})()},get children(){return i(Ct,{get label(){return n.message},get value(){return e.fields()[n.key]??""},get options(){return Be(()=>n.type==="select")()?[{value:"",label:"Select an option"},...n.options.map(l=>({value:l.value,label:l.hint?`${l.label} (${l.hint})`:l.label}))]:[]},get invalid(){return e.authField()===n.key},onSelect:l=>e.setField(n.key,l)})}}),null),c})()})]}}),null),a(t,i(_,{get when(){return e.authorization()?.method==="code"},get children(){return[(()=>{var n=Rt(),c=n.firstChild,l=c.nextSibling;return l.nextSibling,a(n,()=>e.name()||e.id(),l),n})(),(()=>{var n=Dt();return f(()=>C(n,"href",e.authorization()?.url??"#")),n})(),(()=>{var n=Ut(),c=n.firstChild,l=c.nextSibling;return l.$$input=u=>e.setAuthCode(u.currentTarget.value),f(()=>l.classList.toggle("invalid",e.authField()==="code")),f(()=>l.value=e.authCode()),n})()]}}),null),a(t,i(_,{get when(){return e.authorization()?.method==="auto"},get children(){return[Jt(),i(_,{get when(){return e.authorization()?.instructions},children:n=>(()=>{var c=ar();return a(c,n),c})()})]}}),null),a(t,i(_,{get when(){return e.authError()},children:n=>(()=>{var c=or();return a(c,n),c})()}),null),t})(),(()=>{var t=ye();return a(t,i(P,{variant:"ghost",get onClick(){return e.close},children:"Cancel"}),null),a(t,i(_,{get when(){return e.method()?.type==="api"},get children(){return i(P,{variant:"primary",get disabled(){return!!e.ctx.saving()},get onClick(){return e.connectAuth},children:"Save Provider"})}}),null),a(t,i(_,{get when(){return e.authorization()?.method==="code"},get children(){return i(P,{variant:"primary",get disabled(){return!!e.ctx.saving()},onClick:()=>e.completeOAuth(),children:"Save Provider"})}}),null),t})()]}})]}})),d})()]}}),i(yt,{get open(){return!!e.pending()},get title(){return`Delete provider ${e.pending()?.name??""}?`},get message(){return`This removes ${e.pending()?.id??"the provider"} from the current configuration.`},confirm:"Delete",get busy(){return!!e.ctx.saving()},get onCancel(){return e.cancel},get onConfirm(){return e.confirm}})]}})})}mt(["click","input","dblclick"]);export{vr as ProvidersRoute};
@@ -0,0 +1 @@
1
+ .kilo-console .server-draft{display:grid;grid-template-columns:minmax(10rem,16rem) minmax(18rem,1fr) auto;gap:.75rem;align-items:end;padding:1rem}.kilo-console .server-draft label{display:grid;gap:.35rem;color:var(--text-weak);font-size:var(--font-size-small)}.kilo-console .server-table-card{padding:0}.kilo-console .server-toolbar{display:flex;gap:1rem;align-items:center;border-bottom:1px solid var(--border-weak-base);padding:.85rem 1rem}.kilo-console .server-toolbar span{color:var(--text-weaker)}.kilo-console .server-table{overflow-x:auto}.kilo-console .server-row{display:grid;grid-template-columns:5rem minmax(10rem,.8fr) minmax(16rem,1.3fr) minmax(12rem,1fr) 8rem 9rem;min-width:64rem;align-items:center;border-bottom:1px solid var(--border)}.kilo-console .server-row:last-child{border-bottom:0}.kilo-console .server-row>*{overflow:hidden;padding:.85rem 1rem;text-overflow:ellipsis;white-space:nowrap}.kilo-console .server-row span{color:var(--text-weak)}.kilo-console .server-row strong{color:var(--text-strong)}.kilo-console .server-head{background:color-mix(in srgb,var(--background-stronger) 72%,transparent);color:var(--text-weaker);font-size:var(--font-size-small);font-weight:700;text-transform:uppercase}.kilo-console .server-row input[type=checkbox]{width:1rem;height:1rem;padding:0}
@@ -0,0 +1 @@
1
+ import{d as p,c as B,f as a,h as D,S as F,C as q,g as v,s as g,i as s,F as I,m as R,t as u}from"./index-6uAP9-SB.js";import{B as A}from"./button-BT_ytG5s.js";import{u as M}from"./config-De5WBuy1.js";import{h as V,b as K,a as j}from"./ConfigPage-CFkfj5pU.js";import"./tag-ndRFRrjh.js";var z=u("<label>Name<input>"),G=u("<label>Server URL<input>"),H=u("<div class=server-toolbar><strong> servers</strong><span> selected for config sync"),J=u('<div class=server-table role=table aria-label="Connected Kilo servers"><div class="server-row server-head"role=row><span>Apply</span><span>Name</span><span>URL</span><span>Directory</span><span>Version</span><span>Status'),O=u("<div class=server-row role=row><span><input type=checkbox></span><strong></strong><span></span><span></span><span></span><span>");function ee(){const i=M(),[S,b]=p([]),[L,_]=p(!1),[m,N]=p("Production"),[h,T]=p("http://127.0.0.1:4097"),d=B(()=>{const e=i.query(),r=i.data()?.health;return e?[{id:e.url,name:"Local Kilo",url:e.url,dir:e.dir||"Server default",status:r?.healthy?"connected":"pending",apply:!0},...S().filter(n=>n.url!==e.url)]:S()});function U(){const e={id:`${h()}-${Date.now()}`,name:m().trim()||"Kilo Server",url:h().trim(),dir:"Server default",status:"pending",apply:!0};e.url&&(b(r=>[e,...r.filter(t=>t.url!==e.url)]),_(!1))}function E(e){b(r=>r.map(t=>t.id===e?{...t,apply:!t.apply}:t))}return a(j,{title:"Connected Servers",get actions(){return a(A,{variant:"primary",onClick:()=>_(e=>!e),children:"Add New Server"})},get children(){return[a(V,{title:"Server Sync",description:"Register global Kilo server endpoints and choose which ones receive configuration updates.",get meta(){return a(K,{get children(){return`${d().filter(e=>e.apply).length} selected`}})}}),a(F,{get when(){return L()},get children(){return a(q,{class:"server-draft",get children(){return[(()=>{var e=z(),r=e.firstChild,t=r.nextSibling;return t.$$input=n=>N(n.currentTarget.value),v(()=>t.value=m()),e})(),(()=>{var e=G(),r=e.firstChild,t=r.nextSibling;return t.$$input=n=>T(n.currentTarget.value),g(t,"spellcheck",!1),v(()=>t.value=h()),e})(),a(A,{variant:"secondary",onClick:U,children:"Connect Server"})]}})}}),a(q,{class:"server-table-card",get children(){return[(()=>{var e=H(),r=e.firstChild,t=r.firstChild,n=r.nextSibling,o=n.firstChild;return s(r,()=>d().length,t),s(n,()=>d().filter(c=>c.apply).length,o),e})(),(()=>{var e=J();return e.firstChild,s(e,a(I,{get each(){return d()},children:r=>(()=>{var t=O(),n=t.firstChild,o=n.firstChild,c=n.nextSibling,f=c.nextSibling,$=f.nextSibling,y=$.nextSibling,P=y.nextSibling;return o.addEventListener("change",()=>E(r.id)),s(c,()=>r.name),s(f,()=>r.url),s($,()=>r.dir),s(y,(()=>{var l=R(()=>r.url===i.query()?.url);return()=>l()?i.data()?.health.version??"Unknown":"Pending"})()),s(P,a(K,{get children(){return R(()=>r.url===i.query()?.url&&!i.data.loading)()?r.status:"pending"}})),v(l=>{var C=r.url===i.query()?.url,w=`Apply configuration to ${r.name}`,x=r.url,k=r.dir;return C!==l.e&&(o.disabled=l.e=C),w!==l.t&&g(o,"aria-label",l.t=w),x!==l.a&&g(f,"title",l.a=x),k!==l.o&&g($,"title",l.o=k),l},{e:void 0,t:void 0,a:void 0,o:void 0}),v(()=>o.checked=r.apply),t})()}),null),e})()]}})]}})}D(["input"]);export{ee as ServersRoute};
@@ -0,0 +1 @@
1
+ import{f as r,m as f,i as l,F as v,g as S,s as _,S as $,t as d}from"./index-6uAP9-SB.js";import{u as C}from"./config-De5WBuy1.js";import{a as w,h as x,b as p}from"./ConfigPage-CFkfj5pU.js";import"./tag-ndRFRrjh.js";var y=d('<div class=table role=table aria-label="Config sources"><div class=thead role=rowgroup><div class=tr role=row><span role=columnheader>Order</span><span role=columnheader>Scope</span><span role=columnheader>Kind</span><span role=columnheader>Source</span><span role=columnheader>Editable</span></div></div><div role=rowgroup>'),R=d("<div class=tr role=row><span role=cell></span><span role=cell></span><span role=cell></span><span role=cell></span><span role=cell>");function T(){const g=C(),u=()=>g.data();return r($,{get when(){return u()},children:t=>r(w,{title:"Config Sources",get actions(){return r(p,{get children(){return t().sources.sources.length}})},get children(){return[r(x,{title:"Load Order",description:"Load order and editability without exposing secret values.",get meta(){return r(p,{get children(){return f(()=>!!t().overlay.targets.active.writable)()?t().overlay.targets.active.scope:"Read only"}})}}),(()=>{var n=y(),h=n.firstChild,m=h.nextSibling;return l(m,r(v,{get each(){return t().sources.sources},children:e=>(()=>{var o=R(),s=o.firstChild,i=s.nextSibling,c=i.nextSibling,a=c.nextSibling,b=a.nextSibling;return l(s,()=>e.order),l(i,()=>e.scope),l(c,()=>e.kind),l(a,()=>e.label),l(b,()=>e.editable?"Yes":"No"),S(()=>_(a,"title",e.path??e.source)),o})()})),n})()]}})})}export{T as SourcesRoute};
@@ -0,0 +1 @@
1
+ .kilo-console .table{overflow-x:auto;border:1px solid var(--border-weak-base);border-radius:var(--radius-lg)}.kilo-console .thead,.kilo-console .tr{display:grid;grid-template-columns:5rem 7rem 12rem minmax(12rem,1fr) 6rem;min-width:48rem}.kilo-console .thead{background:var(--surface-raised-base);color:var(--text-weaker);font-size:var(--font-size-small);font-weight:700;text-transform:uppercase}.kilo-console .thead span,.kilo-console .tr span{overflow:hidden;padding:.7rem .75rem;text-overflow:ellipsis;white-space:nowrap}.kilo-console .tr+.tr{border-top:1px solid var(--border-weak-base)}.kilo-console .tr span:first-child{color:var(--text-weaker)}
@@ -0,0 +1 @@
1
+ import{d as L,c,f as r,h as M,D as P,E as f,C as j,i as n,S as p,m as k,g as q,s as R,w as D,F as x,t as i}from"./index-6uAP9-SB.js";import{a as N,S as O,b as A,c as B,d as I,e as E,f as V}from"./ConfigPage-CFkfj5pU.js";import{B as W}from"./button-BT_ytG5s.js";import{u as z}from"./config-De5WBuy1.js";/* empty css */import"./tag-ndRFRrjh.js";var G=i("<header class=ui-card-header><div><h2>Web search</h2><p>Control web search availability for models from providers that do not enable it by default."),H=i("<div class=ui-form><button class=ui-toggle type=button><span><strong>Enable for all providers</strong><small>Search requests use Exa or Parallel.</small></span><span class=tags>"),J=i('<div class="tools tool-grid">'),K=i("<section class=tool-section><div class=tools>"),Q=i("<span class=config-title-count>Tools"),U=i("<small>"),X=i("<p class=empty>"),Y=i("<span class=tool-subtitle><span class=tool-id></span><span class=tool-description>");function ne(){const u=z(),[b,T]=L(""),v=()=>u.data(),o=c(()=>v()?.overlay.fields.web_search),g=c(()=>o()?.value===!0),C=c(()=>{const s=v();if(!s)return[];const e=new Map(s.toolDetails.map(t=>[t.id,t]));return s.tools.map(t=>{const a={id:t,detail:e.get(t)};return{...a,caps:P(a)}}).sort((t,a)=>f(t.id).localeCompare(f(a.id)))}),_=c(()=>{const s=b().trim().toLowerCase();return s?C().filter(e=>`${f(e.id)} ${e.id} ${e.caps.join(" ")}`.toLowerCase().includes(s)):C()}),w=c(()=>{const s=v();return s?Object.entries(s.mcp).sort(([e],[t])=>e.localeCompare(t)):[]}),$=c(()=>{const s=b().trim().toLowerCase();return s?w().filter(([e,t])=>`${e} ${t.status}`.toLowerCase().includes(s)):w()}),F=c(()=>C().length?"No tools match this filter.":"No tools registered.");return r(p,{get when(){return v()},children:s=>r(N,{get title(){return(()=>{var e=Q();return e.firstChild,n(e,r(E,{get children(){return s().tools.length}}),null),e})()},description:"Built-in tools available to agents, including file access, terminal execution, search, fetch, and orchestration tools.",get children(){return[r(j,{class:"ui-card",padding:0,get children(){return[(()=>{var e=G();return e.firstChild,n(e,r(p,{get when(){return k(()=>u.query()?.scope==="project")()&&o()?.overridden},get children(){return r(W,{variant:"secondary",get disabled(){return!!u.saving()},onClick:()=>u.unset([["web_search"]]),children:"Revert"})}}),null),e})(),(()=>{var e=H(),t=e.firstChild,a=t.firstChild,d=a.firstChild;d.nextSibling;var m=a.nextSibling;return t.$$click=()=>u.save({web_search:!g()}),n(a,r(p,{get when(){return o()?.reason},children:l=>(()=>{var h=U();return n(h,l),h})()}),null),n(m,r(O,{get source(){return o()?.source},get inherited(){return o()?.inherited},get overridden(){return o()?.overridden}}),null),n(m,r(A,{get tone(){return g()?"success":"neutral"},get children(){return g()?"On":"Off"}}),null),q(l=>{var h=!!g(),S=g(),y=!!u.saving()||o()?.editable===!1;return h!==l.e&&t.classList.toggle("selected",l.e=h),S!==l.t&&R(t,"aria-pressed",l.t=S),y!==l.a&&(t.disabled=l.a=y),l},{e:void 0,t:void 0,a:void 0}),e})()]}}),r(D,{label:"Filter tools",get value(){return b()},placeholder:"Filter by name, ID, or description...",onValue:T}),(()=>{var e=J();return n(e,r(p,{get when(){return _().length},get fallback(){return(()=>{var t=X();return n(t,F),t})()},get children(){return r(x,{get each(){return _()},children:t=>r(B,{get title(){return f(t.id)},get subtitle(){return(()=>{var a=Y(),d=a.firstChild,m=d.nextSibling;return n(d,()=>t.id),n(m,()=>t.caps.join(" ")),a})()}})})}})),e})(),r(p,{get when(){return $().length},get children(){var e=K(),t=e.firstChild;return n(e,r(I,{get trailing(){return r(E,{get children(){return $().length}})},description:"MCP server connection status available to agents.",children:"MCP Servers"}),t),n(t,r(x,{get each(){return $()},children:([a,d])=>r(B,{title:a,subtitle:"MCP server",get status(){return r(V,{get status(){return d.status}})}})})),e}})]}})})}M(["click"]);export{ne as ToolsRoute};
@@ -0,0 +1 @@
1
+ .kilo-console .agents,.kilo-console .tools{display:flex;flex-direction:column;gap:.5rem}.kilo-console .tool-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.kilo-console .tools [data-component=config-row]{align-items:flex-start}.kilo-console .agent-tags{flex-wrap:wrap;gap:.5rem}.kilo-console .agents [data-component=config-row]{align-items:flex-start}.kilo-console .agents [data-slot=config-row-subtitle]{overflow:visible;white-space:normal}.kilo-console .agent-subtitle{display:grid;gap:.125rem;min-width:0}.kilo-console .agent-id{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kilo-console .agent-description{overflow-wrap:anywhere;white-space:normal}.kilo-console .agent-section{display:flex;flex-direction:column;gap:.5rem}.kilo-console .agent-section [data-component=section-title]{margin:.75rem 0 .25rem}.kilo-console .agent-mode-dot{margin-top:.45rem;width:.5rem;height:.5rem;border-radius:999px;background:var(--muted-foreground)}.kilo-console .agent-mode-dot[data-mode=primary]{background:var(--primary)}.kilo-console .agent-mode-dot[data-mode=all]{background:var(--info)}.kilo-console .tools [data-slot=config-row-subtitle]{overflow:visible;white-space:normal}.kilo-console .tool-subtitle{display:grid;gap:.125rem;min-width:0}.kilo-console .tool-id{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kilo-console .tool-description{overflow-wrap:anywhere;white-space:normal}.kilo-console .tool-section{display:grid;gap:.75rem;margin-top:1rem}.kilo-console .provider-drawer[aria-label="Agent tool access selector"] .drawer-header span,.kilo-console .provider-drawer[aria-label="Agent tool access selector"] .tool-capabilities{color:var(--muted-foreground);font-size:.6875rem;line-height:1.45}.kilo-console .provider-drawer[aria-label="Agent tool access selector"] .tool-capabilities{margin:0;padding-left:0}@media(max-width:980px){.kilo-console .tool-grid{grid-template-columns:minmax(0,1fr)}}.kilo-console .advanced{display:grid;gap:1.25rem}.kilo-console .advanced section{display:grid;gap:.75rem;border:1px solid var(--border-weak-base);border-radius:var(--radius-lg);padding:1rem}.kilo-console .advanced h3{margin:0;color:var(--text-strong)}.kilo-console .builder{display:grid;grid-template-columns:minmax(0,1fr);gap:.75rem;align-items:start}.kilo-console .agent-builder-stack{display:grid;gap:.75rem}.kilo-console .agent-builder-card{border-color:var(--border);background:var(--card)}.kilo-console .agent-builder-form{grid-template-columns:1fr;gap:.625rem}.kilo-console .agent-builder-field{background:color-mix(in oklab,var(--card) 72%,transparent)}.kilo-console .agent-builder-field-head{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;min-width:0}.kilo-console .agent-builder-field-head>div:not(.agent-builder-field-actions){display:grid;gap:.125rem;min-width:0}.kilo-console .agent-builder-field-head span:not([data-component=tag]),.kilo-console .agent-builder-field>span:not([data-component=tag]){color:var(--foreground);font-size:.75rem;font-weight:500;line-height:1.45}.kilo-console .agent-builder-field-head small{color:var(--muted-foreground);font-size:.6875rem;line-height:1.45}.kilo-console .agent-builder-field-head>.agent-builder-field-actions{display:flex;gap:.375rem;align-items:center;flex:0 0 auto;flex-direction:row;flex-wrap:nowrap}.kilo-console .agent-builder-control{display:grid;gap:.375rem;min-width:0}.kilo-console .agent-builder-control input,.kilo-console .agent-builder-control select,.kilo-console .agent-builder-control textarea,.kilo-console .agent-builder-field input,.kilo-console .agent-builder-field select{width:100%}.kilo-console .agent-builder-control>strong,.kilo-console .agent-builder-control>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kilo-console .agent-builder-control>strong{color:var(--foreground);font-size:.75rem;font-weight:500;line-height:1.45}.kilo-console .agent-builder-control>span{color:var(--muted-foreground);font-size:.6875rem;line-height:1.45}.kilo-console .agent-prompt-input{min-height:16rem;resize:vertical}.kilo-console .agent-builder-field input[readonly],.kilo-console .agent-builder-field textarea[readonly]{border-color:var(--border);background:color-mix(in oklab,var(--muted) 45%,transparent);color:var(--muted-foreground);cursor:default}.kilo-console .agent-builder-control .tag-cloud{justify-content:flex-start}.kilo-console .agent-tool-summary{margin-top:.15rem}.kilo-console .wide{grid-column:1 / -1}.kilo-console .agent-color-control{display:grid;gap:.5rem}.kilo-console .agent-color-swatches{display:flex;gap:.375rem;flex-wrap:wrap}.kilo-console .agent-color-swatch{width:1.375rem;height:1.375rem;border:1px solid var(--border);border-radius:var(--radius-sm);cursor:pointer}.kilo-console .agent-color-swatch.selected{outline:2px solid var(--foreground);outline-offset:1px}.kilo-console .agent-color-swatch:disabled{cursor:not-allowed;opacity:.55}.kilo-console .agent-snippets{display:grid;gap:.625rem;border-top:1px solid var(--border);padding-top:.75rem}.kilo-console .block-title{display:grid;gap:.125rem}.kilo-console .block-title strong{color:var(--foreground);font-size:.75rem;font-weight:500;line-height:1.45}.kilo-console .block-title span{overflow:hidden;color:var(--muted-foreground);font-size:.6875rem;line-height:1.45;text-overflow:ellipsis;white-space:nowrap}.kilo-console .snippet-list{display:flex;gap:.5rem;flex-wrap:wrap}.kilo-console .snippet-list button{max-width:100%;white-space:normal}.kilo-console .markdown-preview{margin:0;overflow:auto;border:1px solid var(--border-weak-base);border-radius:var(--radius-lg);background:var(--background-stronger);color:var(--text-strong);font-size:var(--font-size-small);line-height:1.5;padding:1rem;white-space:pre-wrap}.kilo-console .markdown-picker .markdown-preview{min-height:100%}.kilo-console .compact{grid-template-columns:repeat(3,minmax(8rem,1fr)) auto;margin-bottom:0}.kilo-console .mini-list{display:grid;gap:.5rem}.kilo-console .mini-list.columns{grid-template-columns:repeat(2,minmax(0,1fr))}.kilo-console .mini-list.spaced{margin-top:.75rem}.kilo-console .mini-item{display:grid;grid-template-columns:minmax(12rem,1fr) auto auto;gap:.75rem;align-items:center;border:1px solid var(--border);border-radius:var(--radius-lg);padding:.65rem}.kilo-console .mini-item.simple{grid-template-columns:minmax(8rem,1fr) minmax(8rem,1.4fr) auto}.kilo-console .mini-item span{overflow:hidden;color:var(--text-weaker);font-size:var(--font-size-small);text-overflow:ellipsis;white-space:nowrap}.kilo-console .tag-cloud{display:flex;gap:.4rem;flex-wrap:wrap}
@@ -0,0 +1 @@
1
+ import{G as a,f as n,H as i,S as o,I as c,m as l,J as u}from"./index-6uAP9-SB.js";function m(t){return!t||t==="normal"?"default":t==="small"?"sm":t==="large"?"lg":t}function d(t){return!t||t==="default"?"primary":t}function g(t){const[r,e]=a(t,["variant","size","icon","class","classList","children"]);return n(u,i(e,{"data-component":"button",get"data-size"(){return m(r.size)},get"data-variant"(){return d(r.variant)},get"data-icon"(){return r.icon?"inline-start":void 0},get classList(){return{...r.classList,[r.class??""]:!!r.class}},get children(){return[n(o,{get when(){return r.icon},children:s=>n(c,{get name(){return s()},size:"small"})}),l(()=>r.children)]}}))}export{g as B};
@@ -0,0 +1 @@
1
+ .kilo-console .ui-settings{display:grid;gap:.75rem}.kilo-console .ui-card{border-color:var(--border);background:var(--card)}.kilo-console .ui-card:has(.console-diff-select[open]),.kilo-console .ui-card:has(.title-icon-select[open]){position:relative;z-index:40;overflow:visible}.kilo-console .console-diff-select[open],.kilo-console .title-icon-select[open]{z-index:41}.kilo-console .console-diff-select .models-select-menu,.kilo-console .title-icon-select .models-select-menu{z-index:42}.kilo-console .ui-card-header,.kilo-console .ui-card-footer{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;border-bottom:1px solid var(--border);padding:.75rem .875rem}.kilo-console .ui-card-footer{justify-content:flex-end;border-top:1px solid var(--border);border-bottom:0}.kilo-console .ui-card-header h2{margin:0;color:var(--foreground);font-size:.75rem;font-weight:500;line-height:1.45}.kilo-console .ui-card-header p{max-width:42rem;margin:.125rem 0 0;color:var(--muted-foreground);font-size:.6875rem;line-height:1.45}.kilo-console .ui-card-body,.kilo-console .ui-form{padding:.75rem}.kilo-console .ui-form{display:grid;grid-template-columns:1fr;gap:.625rem}.kilo-console .ui-field,.kilo-console .ui-toggle{display:grid;gap:.375rem;min-width:0;border:1px solid var(--border);border-radius:var(--radius-md);background:color-mix(in oklab,var(--card) 72%,transparent);padding:.625rem}.kilo-console .ui-field>span,.kilo-console .ui-toggle strong{color:var(--foreground);font-size:.75rem;font-weight:500;line-height:1.45}.kilo-console .ui-field small,.kilo-console .ui-toggle small{color:var(--muted-foreground);font-size:.6875rem;line-height:1.45}.kilo-console .ui-toggle strong,.kilo-console .ui-toggle small{display:block}.kilo-console .ui-field input,.kilo-console .ui-field select{height:2rem;min-height:2rem;border-radius:var(--radius-md);font-size:.75rem;line-height:1rem;padding-block:0}.kilo-console .ui-toggle{grid-template-columns:minmax(0,1fr) auto;align-items:center;color:inherit;cursor:pointer;font:inherit;text-align:left}.kilo-console .ui-toggle:disabled,.kilo-console .ui-field input:disabled{cursor:not-allowed;opacity:.55}.kilo-console .ui-toggle:hover:not(:disabled),.kilo-console .ui-toggle:focus-visible,.kilo-console .ui-toggle.selected{border-color:var(--primary);background:color-mix(in oklab,var(--primary) 10%,transparent);outline:0}.kilo-console .theme-preview{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.75rem;align-items:center;width:100%;min-width:0}.kilo-console .theme-preview strong,.kilo-console .theme-preview span,.kilo-console .theme-option strong,.kilo-console .theme-option span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kilo-console .theme-preview strong,.kilo-console .theme-option strong{color:var(--foreground);font-size:.75rem;font-weight:500;line-height:1.45}.kilo-console .theme-preview span,.kilo-console .theme-option span{color:var(--muted-foreground);font-size:.6875rem;line-height:1.45}.kilo-console .theme-swatches{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:.25rem;width:8.75rem;justify-self:end}.kilo-console .theme-swatch{position:relative;aspect-ratio:1;min-width:0;border-radius:var(--radius-md)}.kilo-console .theme-swatch:after{position:absolute;inset:0;border:1px solid var(--border);border-radius:inherit;content:"";mix-blend-mode:lighten}.kilo-console .theme-picker{gap:.375rem}.kilo-console .theme-option{grid-template-columns:minmax(0,1fr) auto;min-height:4.75rem;border-color:var(--border);background:var(--card);padding:.75rem}.kilo-console .theme-option.selected{border-color:var(--primary);background:color-mix(in oklab,var(--primary) 10%,transparent);box-shadow:inset 0 0 0 1px var(--primary)}.kilo-console .theme-footer{display:grid;grid-template-columns:minmax(0,1fr) auto}.kilo-console .theme-footer>div:last-child{display:flex;gap:.5rem;align-items:center}
@@ -0,0 +1 @@
1
+ import{N as o,O as n}from"./index-6uAP9-SB.js";const e=n();function r(){const t=o(e);if(!t)throw new Error("useConfig must be used within ConfigLayout");return t}export{e as C,r as u};
@@ -0,0 +1 @@
1
+ import{a1 as I,o as C,a2 as D,K as T,H as p,i as M,f as A,g as L,s as S,x as u,F as N,t as w,d as v,e as F}from"./index-6uAP9-SB.js";import{u as W}from"./config-De5WBuy1.js";const c=new Map;let a;function h(e,t){e.toggleAttribute("data-paused",!t||document.visibilityState==="hidden")}function x(){for(const[e,t]of c)h(e,t)}function O(e){I(()=>{a||(a=new IntersectionObserver(t=>{for(const n of t){if(!c.has(n.target))continue;const s=n.isIntersecting&&n.intersectionRatio>0;c.set(n.target,s),h(n.target,s)}}),document.addEventListener("visibilitychange",x)),c.set(e,!1),h(e,!1),a.observe(e),C(()=>{a?.unobserve(e),c.delete(e),e.removeAttribute("data-paused"),!(c.size>0)&&(a?.disconnect(),a=void 0,document.removeEventListener("visibilitychange",x))})})}var R=w("<svg>"),B=w("<svg><rect width=3 height=3 rx=1></svg>",!1,!0,!1);const H=new Set([1,2,4,7,8,11,13,14]),X=new Set([0,3,12,15]),z=Array.from({length:16},(e,t)=>({id:t,x:t%4*4,y:Math.floor(t/4)*4,delay:Math.random()*1.5,duration:1+Math.random()*1,outer:H.has(t),corner:X.has(t)}));function Y(e){return(()=>{var t=R();return D(O,t),T(t,p(e,{viewBox:"0 0 15 15","data-component":"spinner",get classList(){return{...e.classList,[e.class??""]:!!e.class}},fill:"currentColor"}),!0,!0),M(t,A(N,{each:z,children:n=>(()=>{var s=B();return L(i=>{var d=n.x,r=n.y,f=n.corner?0:n.outer?.15:.4,l=n.corner?void 0:`${n.outer?"pulse-opacity-dim":"pulse-opacity"} ${n.duration}s ease-in-out infinite`,o=n.corner?void 0:"both",_=n.corner?void 0:`${n.delay}s`;return d!==i.e&&S(s,"x",i.e=d),r!==i.t&&S(s,"y",i.t=r),f!==i.a&&u(s,"opacity",i.a=f),l!==i.o&&u(s,"animation",i.o=l),o!==i.i&&u(s,"animation-fill-mode",i.i=o),_!==i.n&&u(s,"animation-delay",i.n=_),i},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),s})()})),t})()}const m=300,g=250,y=800,b="unified";function E(e){return e==="split"?"split":b}function U(e){return typeof e!="number"||!Number.isFinite(e)?m:Math.min(y,Math.max(g,Math.round(e)))}function $(e){const t=Number(e);if(Number.isInteger(t)&&!(t<g||t>y))return t}function j(){const e=W(),[t,n]=v(String(m)),[s,i]=v(b),[d,r]=v(!1);F(()=>{if(d())return;const o=e.data()?.effective.console;n(String(U(o?.context_sidebar_width))),i(E(o?.diff_style))});function f(){const o=$(t());if(o===void 0){e.fail(`Enter a sidebar width between ${g} and ${y} pixels.`);return}e.patch({console:{context_sidebar_width:o,diff_style:s()}}),n(String(o)),r(!1)}function l(){e.unset([["console","context_sidebar_width"],["console","diff_style"]]),n(String(m)),i(b),r(!1)}return{ctx:e,width:t,setWidth:o=>{n(o),r(!0)},style:s,setStyle:o=>{i(E(o)),r(!0)},dirty:d,configured:()=>{const o=e.data()?.effective.console;return o?.context_sidebar_width!==void 0||o?.diff_style!==void 0},save:f,reset:l}}export{m as D,g as M,Y as S,y as a,b,E as c,U as n,j as u};
@@ -0,0 +1 @@
1
+ .kilo-console .confirm-scrim{position:fixed;z-index:70;inset:0;display:grid;place-items:center;background:color-mix(in srgb,black 62%,transparent);padding:1rem}.kilo-console .confirm-dialog{width:min(28rem,100%);overflow:hidden;border:1px solid var(--border-weak-base);border-radius:var(--radius-lg);background:var(--background-stronger);box-shadow:0 2rem 5rem color-mix(in srgb,black 35%,transparent)}.kilo-console .confirm-body{display:grid;grid-template-columns:auto minmax(0,1fr);gap:1.5rem;align-items:center;padding:clamp(1.5rem,4vw,2.5rem)}.kilo-console .confirm-icon{display:grid;place-items:center;color:var(--status-error-base)}.kilo-console .confirm-icon [data-component=icon]{width:3rem;height:3rem}.kilo-console .confirm-body h2,.kilo-console .prompt-copy h2{margin:0;color:var(--text-strong);font-size:.875rem;font-weight:500;line-height:1.25rem}.kilo-console .confirm-body p,.kilo-console .prompt-copy p{margin:.5rem 0 0;color:var(--text-weak);font-size:.75rem;line-height:1.625}.kilo-console .confirm-actions{display:flex;justify-content:flex-end;gap:.75rem;border-top:1px solid var(--border-weak-base);background:color-mix(in srgb,var(--background-base) 65%,transparent);padding:1rem}.kilo-console .prompt-form{margin:0}.kilo-console .prompt-body{display:grid;gap:1rem;padding:1.5rem}.kilo-console .prompt-field{display:grid;gap:.5rem;color:var(--text-strong);font-size:.75rem;font-weight:500}.kilo-console .prompt-field input{height:2rem}