glimmervoid 0.52.3-next.749 → 0.52.3-next.751

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 (104) hide show
  1. package/dist/bin/glimmervoid.js +7 -7
  2. package/dist/chunks/agent-api-cli-D5LpKt3J.js +1 -0
  3. package/dist/chunks/{agent-api-cli-PgRkZU4P.js → agent-api-cli-DvnXm4kI.js} +1 -1
  4. package/dist/chunks/{main-Buf2PV_P.js → main-BWbKEWLs.js} +16 -2
  5. package/dist/chunks/{packs-cli-s61MOWh7.js → packs-cli-BY5iV3hA.js} +1 -1
  6. package/dist/chunks/{pr-flows-cli-D6M6kXRm.js → pr-flows-cli-DMrno1BY.js} +2 -2
  7. package/dist/chunks/{settings-cli-CYaiaFRJ.js → settings-cli-D6vMWRbr.js} +1 -1
  8. package/dist/chunks/{ssh-sign-cli-BAlpaJTq.js → ssh-sign-cli-CYoKi2i6.js} +1 -1
  9. package/dist/chunks/whiteboard-svg-core-Cidy3DqV.js +3844 -0
  10. package/dist/client/assets/{agent-mark-CvEqiBo4.js → agent-mark-CPPMGmer.js} +1 -1
  11. package/dist/client/assets/agent-mark-CPPMGmer.js.br +0 -0
  12. package/dist/client/assets/{arena-panel-ISlMnhdr.js → arena-panel-Dgw6ZGdZ.js} +2 -2
  13. package/dist/client/assets/arena-panel-Dgw6ZGdZ.js.br +0 -0
  14. package/dist/client/assets/{benchmark-panel-CbNeD1Aa.js → benchmark-panel-DR6aAOVJ.js} +1 -1
  15. package/dist/client/assets/benchmark-panel-DR6aAOVJ.js.br +0 -0
  16. package/dist/client/assets/boards-view-BzjY5fys.js +1 -0
  17. package/dist/client/assets/boards-view-BzjY5fys.js.br +0 -0
  18. package/dist/client/assets/{community-panel-DFjyCuQn.js → community-panel-BMBam6Rk.js} +1 -1
  19. package/dist/client/assets/community-panel-BMBam6Rk.js.br +0 -0
  20. package/dist/client/assets/{dialogs-3m6N2GQi.js → dialogs-HOpRh5gr.js} +1 -1
  21. package/dist/client/assets/dialogs-HOpRh5gr.js.br +0 -0
  22. package/dist/client/assets/{doc-editor-ui-CrshwKCN.js → doc-editor-ui-BQW70vY2.js} +1 -1
  23. package/dist/client/assets/doc-editor-ui-BQW70vY2.js.br +0 -0
  24. package/dist/client/assets/{feature-hint-DOqkkS_S.js → feature-hint-CqdX9ZAW.js} +1 -1
  25. package/dist/client/assets/feature-hint-CqdX9ZAW.js.br +0 -0
  26. package/dist/client/assets/{first-run-checklist-DLbuF9fv.js → first-run-checklist-BlZGURU2.js} +1 -1
  27. package/dist/client/assets/first-run-checklist-BlZGURU2.js.br +0 -0
  28. package/dist/client/assets/{hooks-panel-Cy_NwPQM.js → hooks-panel-ByIwabVS.js} +1 -1
  29. package/dist/client/assets/hooks-panel-ByIwabVS.js.br +0 -0
  30. package/dist/client/assets/index-B12zcEVW.js +75 -0
  31. package/dist/client/assets/index-B12zcEVW.js.br +0 -0
  32. package/dist/client/assets/{issues-panel-DA-TyQpb.js → issues-panel-Sus7muya.js} +1 -1
  33. package/dist/client/assets/issues-panel-Sus7muya.js.br +0 -0
  34. package/dist/client/assets/{lane-read-token-step-B2qvZxxP.js → lane-read-token-step-7jOMda7j.js} +1 -1
  35. package/dist/client/assets/lane-read-token-step-7jOMda7j.js.br +0 -0
  36. package/dist/client/assets/{my-prs-panel-BbATOOLT.js → my-prs-panel-ChhHuCoo.js} +1 -1
  37. package/dist/client/assets/my-prs-panel-ChhHuCoo.js.br +0 -0
  38. package/dist/client/assets/{nyan-cat-FdK_g6uh.js → nyan-cat-CVhgfmIv.js} +1 -1
  39. package/dist/client/assets/nyan-cat-CVhgfmIv.js.br +0 -0
  40. package/dist/client/assets/{phone-shell-9b-bf4Dm.js → phone-shell-QCuH5boT.js} +1 -1
  41. package/dist/client/assets/phone-shell-QCuH5boT.js.br +0 -0
  42. package/dist/client/assets/{plan-face-B9S4yUcj.js → plan-face-DUhdCaFO.js} +1 -1
  43. package/dist/client/assets/plan-face-DUhdCaFO.js.br +0 -0
  44. package/dist/client/assets/{plan-render-d5VbtGtB.js → plan-render-DLBH8WcZ.js} +1 -1
  45. package/dist/client/assets/plan-render-DLBH8WcZ.js.br +0 -0
  46. package/dist/client/assets/{pr-queue-columns-MoAluWAc.js → pr-queue-columns-CBvxTcrj.js} +1 -1
  47. package/dist/client/assets/pr-queue-columns-CBvxTcrj.js.br +0 -0
  48. package/dist/client/assets/{radar-panel-DxnKC0O3.js → radar-panel-BVMuKUyT.js} +1 -1
  49. package/dist/client/assets/radar-panel-BVMuKUyT.js.br +0 -0
  50. package/dist/client/assets/{repo-roots-adder-D-YdrTBd.js → repo-roots-adder-wqJpeF0h.js} +1 -1
  51. package/dist/client/assets/repo-roots-adder-wqJpeF0h.js.br +0 -0
  52. package/dist/client/assets/{resume-dialog-CuNFDUKu.js → resume-dialog-CiIZCDh7.js} +1 -1
  53. package/dist/client/assets/resume-dialog-CiIZCDh7.js.br +0 -0
  54. package/dist/client/assets/{review-queue-panel-CREnMu2I.js → review-queue-panel-DcpL1Oa_.js} +1 -1
  55. package/dist/client/assets/review-queue-panel-DcpL1Oa_.js.br +0 -0
  56. package/dist/client/assets/{session-actions-BGzOI9VS.js → session-actions-9ZhnsG51.js} +2 -2
  57. package/dist/client/assets/session-actions-9ZhnsG51.js.br +0 -0
  58. package/dist/client/assets/{session-row-B9VNB7jC.js → session-row-DGItX9OU.js} +1 -1
  59. package/dist/client/assets/session-row-DGItX9OU.js.br +0 -0
  60. package/dist/client/assets/{settings-panel-C8mHUg30.js → settings-panel-DbON5896.js} +2 -2
  61. package/dist/client/assets/settings-panel-DbON5896.js.br +0 -0
  62. package/dist/client/assets/{trace-panel-Bsr2Easc.js → trace-panel-BBnR2Rin.js} +1 -1
  63. package/dist/client/assets/trace-panel-BBnR2Rin.js.br +0 -0
  64. package/dist/client/assets/{usage-panel-DWVbDiG1.js → usage-panel-Cj4D9QUu.js} +1 -1
  65. package/dist/client/assets/usage-panel-Cj4D9QUu.js.br +0 -0
  66. package/dist/client/assets/{your-day-tip-DGI6fbHA.js → your-day-tip-Ckl6WABy.js} +1 -1
  67. package/dist/client/assets/your-day-tip-Ckl6WABy.js.br +0 -0
  68. package/dist/client/index.html +4 -4
  69. package/dist/client/index.html.br +0 -0
  70. package/dist/server/index.js +1 -1
  71. package/package.json +1 -1
  72. package/dist/chunks/agent-api-cli-Hv7ZSe1j.js +0 -1
  73. package/dist/chunks/whiteboard-svg-core-bnP72KuQ.js +0 -2476
  74. package/dist/client/assets/agent-mark-CvEqiBo4.js.br +0 -0
  75. package/dist/client/assets/arena-panel-ISlMnhdr.js.br +0 -0
  76. package/dist/client/assets/benchmark-panel-CbNeD1Aa.js.br +0 -0
  77. package/dist/client/assets/boards-view-DQTSAGYw.js +0 -1
  78. package/dist/client/assets/boards-view-DQTSAGYw.js.br +0 -0
  79. package/dist/client/assets/community-panel-DFjyCuQn.js.br +0 -0
  80. package/dist/client/assets/dialogs-3m6N2GQi.js.br +0 -0
  81. package/dist/client/assets/doc-editor-ui-CrshwKCN.js.br +0 -0
  82. package/dist/client/assets/feature-hint-DOqkkS_S.js.br +0 -0
  83. package/dist/client/assets/first-run-checklist-DLbuF9fv.js.br +0 -0
  84. package/dist/client/assets/hooks-panel-Cy_NwPQM.js.br +0 -0
  85. package/dist/client/assets/index-CrpXpbdb.js +0 -75
  86. package/dist/client/assets/index-CrpXpbdb.js.br +0 -0
  87. package/dist/client/assets/issues-panel-DA-TyQpb.js.br +0 -0
  88. package/dist/client/assets/lane-read-token-step-B2qvZxxP.js.br +0 -0
  89. package/dist/client/assets/my-prs-panel-BbATOOLT.js.br +0 -0
  90. package/dist/client/assets/nyan-cat-FdK_g6uh.js.br +0 -0
  91. package/dist/client/assets/phone-shell-9b-bf4Dm.js.br +0 -0
  92. package/dist/client/assets/plan-face-B9S4yUcj.js.br +0 -0
  93. package/dist/client/assets/plan-render-d5VbtGtB.js.br +0 -0
  94. package/dist/client/assets/pr-queue-columns-MoAluWAc.js.br +0 -0
  95. package/dist/client/assets/radar-panel-DxnKC0O3.js.br +0 -0
  96. package/dist/client/assets/repo-roots-adder-D-YdrTBd.js.br +0 -0
  97. package/dist/client/assets/resume-dialog-CuNFDUKu.js.br +0 -0
  98. package/dist/client/assets/review-queue-panel-CREnMu2I.js.br +0 -0
  99. package/dist/client/assets/session-actions-BGzOI9VS.js.br +0 -0
  100. package/dist/client/assets/session-row-B9VNB7jC.js.br +0 -0
  101. package/dist/client/assets/settings-panel-C8mHUg30.js.br +0 -0
  102. package/dist/client/assets/trace-panel-Bsr2Easc.js.br +0 -0
  103. package/dist/client/assets/usage-panel-DWVbDiG1.js.br +0 -0
  104. package/dist/client/assets/your-day-tip-DGI6fbHA.js.br +0 -0
@@ -1,4 +1,4 @@
1
- import{d as e}from"./control-ws-CPMlFaao.js";import{S as t,g as n,m as r,r as i}from"./zod-_N0uRWDY.js";import{An as a,B as o,Dn as s,En as c,F as l,Gt as u,H as ee,I as te,L as ne,O as re,On as ie,P as ae,Rt as oe,Tn as se,W as ce,Xt as le,a as ue,cn as de,o as fe,t as d,un as pe,z as me}from"./button-mkFeAYAx.js";import{A as he,B as ge,D as _e,E as ve,F as ye,G as be,H as xe,I as Se,K as Ce,L as we,M as Te,N as f,O as Ee,P as De,R as Oe,T as p,U as ke,V as Ae,W as je,b as Me,j as Ne,k as Pe,s as m,w as Fe,z as Ie}from"./dom-helpers-BFFApPgS.js";import{a as h}from"./modal-Dhk9uL5H.js";import{a as Le,c as Re,i as ze,s as Be,t as Ve}from"./action-status-DVzULV_M.js";import{E as He,F as Ue,H as We,I as Ge,L as Ke,M as qe,N as Je,P as Ye,Q as Xe,R as Ze,U as Qe,V as $e,a as et,b as tt,bt as nt,dt as rt,et as it,g as at,gt as ot,h as st,j as ct,l as lt,o as ut,pt as dt,w as ft,x as pt,y as mt,yt as ht}from"./ui-prefs-DDS1bMmm.js";import{M as gt}from"./session-actions-BGzOI9VS.js";import{t as _t}from"./agent-mark-CvEqiBo4.js";import{A as vt,Aa as yt,B as bt,C as xt,D as St,Da as Ct,E as wt,Ea as Tt,F as Et,Gr as Dt,H as Ot,I as kt,Jr as At,L as jt,M as Mt,N as Nt,O as Pt,Oa as Ft,P as It,R as g,S as Lt,Sa as Rt,Sr as zt,T as Bt,Ta as Vt,Ur as Ht,V as Ut,W as Wt,Wr as Gt,_t as Kt,a as qt,ba as Jt,c as Yt,ca as Xt,ga as Zt,ha as Qt,i as $t,j as en,k as tn,ka as nn,l as rn,ma as an,n as on,o as sn,qt as cn,r as ln,s as un,t as dn,va as fn,vt as pn,w as mn,xa as hn,ya as gn,z as _}from"./index-CrpXpbdb.js";import{loadCustomSounds as _n,playAlertSound as vn,resolveSoundId as yn,soundOptions as bn}from"./alert-sound-Da6VQFBS.js";import{agentLoginSummary as xn,openAgentConnectDialog as Sn,openRemoteSetupDialog as Cn}from"./dialogs-3m6N2GQi.js";import{r as wn,t as Tn}from"./flying-animal-preview-BcM0Sll8.js";import{t as En}from"./my-prs-panel-BbATOOLT.js";import{n as Dn,r as On,t as kn}from"./team-review-settings-core-BHv0yl1m.js";import{n as An,t as jn}from"./nyan-cat-FdK_g6uh.js";function Mn(){let e=m(`div`),t=m(`p`,`flying-animals-status`);t.id=`flying-animals-gallery-status`,t.setAttribute(`role`,`status`);let n=m(`div`,`flying-animals-gallery`);n.setAttribute(`aria-label`,`Animal gallery`);let r=[],i=()=>{let e=jn(),n=rt(ut().flyingAnimalsExcludedSprites);t.textContent=[e,n?``:`No animals are included, so automatic flights are paused.`].filter(Boolean).join(` `);for(let t of r)t.disabled=e!==null},a=ut();for(let e of dt){let o=m(`article`,`flying-animal-tile`),s=Tn(e),c=m(`label`,`flying-animal-include`),l=m(`input`,`settings-view-checkbox`);l.type=`checkbox`,l.checked=!a.flyingAnimalsExcludedSprites.includes(e.sprite),l.setAttribute(`aria-label`,`Include ${e.name}`),l.addEventListener(`change`,()=>{let t=new Set(ut().flyingAnimalsExcludedSprites);l.checked&&t.delete(e.sprite),l.checked||t.add(e.sprite),qe([...t]),Xt(mt()),i()}),c.append(l,document.createTextNode(`Include`));let u=d({variant:`secondary`,label:`Fly now`});u.setAttribute(`aria-describedby`,t.id),u.addEventListener(`click`,()=>An(e.sprite)),r.push(u),o.append(s,m(`h2`,`flying-animal-name`,e.name),c,u),n.append(o)}return i(),e.append(t,n),e}var v={scope:`browser`,access:`editable`,takesEffect:`now`},y={scope:`browser`,access:`advanced`,takesEffect:`now`},b={scope:`machine`,access:`editable`,takesEffect:`now`},Nn={scope:`machine`,access:`editable`,takesEffect:`new-sessions`},x={scope:`machine`,access:`readout`,takesEffect:`now`},S={scope:`machine`,access:`file-only`},Pn=1e3,Fn=60,In=60,Ln=Pn*Fn,Rn=Ln*In,zn={label:`investigations`,storedPerDisplay:1},Bn={label:`sessions`,storedPerDisplay:1},Vn={label:`recurrences`,storedPerDisplay:1},Hn={label:`actions`,storedPerDisplay:1},C={label:`seconds`,storedPerDisplay:1},Un={label:`minutes`,storedPerDisplay:1},Wn={label:`hours`,storedPerDisplay:1},w={label:`days`,storedPerDisplay:1},Gn={label:`seconds`,storedPerDisplay:Pn,storedLabel:`ms`},Kn={label:`minutes`,storedPerDisplay:Ln,storedLabel:`ms`},qn={label:`minutes`,storedPerDisplay:Fn,storedLabel:`seconds`},Jn={label:`hours`,storedPerDisplay:Rn,storedLabel:`ms`},Yn={label:`hours`,storedPerDisplay:In,storedLabel:`minutes`},Xn={label:`USD`,storedPerDisplay:1},Zn={label:`users`,storedPerDisplay:1},Qn={label:`times`,storedPerDisplay:1},T=`A tuning knob kept out of the Settings view; the default suits almost every install.`,E=`A diagnostic switch kept out of the Settings view; change it in config.json while investigating.`,D=`Changes how the server process or its worktrees behave, so it is set in config.json with a restart or new sessions in mind.`,$n=`A structured value with no dashboard control; edit it in config.json.`,er=`Never editable from the dashboard by rule; edit it in config.json.`;function tr(e){return e.map(e=>({value:e,label:e[0].toUpperCase()+e.slice(1)}))}var nr={id:`browser-appearance`,level:`browser`,title:`Appearance`,description:`How this browser draws the dashboard.`,legacyIds:[`browser-flying-animals`,`animals`,`flying-animals`],settings:[{id:`theme`,path:`pref:themeId`,title:`Theme`,description:`Color scheme for the dashboard.`,control:`select`,optionsFrom:`themes`,keywords:[`color`,`palette`],defaultValue:`phyrexian`,...v},{id:`phone-arrow-pad`,path:`pref:phoneArrowPad`,title:`Swipe arrow pad on phone`,description:`Swap the phone arrow keys for one pad you swipe on.`,control:`toggle`,keywords:[`experimental`,`mobile`,`keys`,`arrows`,`swipe`,`gesture`],defaultValue:!1,...v},{id:`flying-animals`,path:`pref:flyingAnimalsEnabled`,title:`Flying animals`,description:`Show animated animals flying across the dashboard.`,control:`toggle`,keywords:[`animation`,`motion`,`animals`],defaultValue:!1,...v},{id:`animals-min-gap`,path:`pref:flyingAnimalsMinGapSeconds`,title:`Time between flights: minimum`,description:`Shortest pause between flights.`,control:`number`,integer:!1,step:.1,range:_e,unit:C,maximumSettingId:`animals-max-gap`,keywords:[`animals`,`frequency`],defaultValue:p.flyingAnimalsMinGapSeconds,...y},{id:`animals-max-gap`,path:`pref:flyingAnimalsMaxGapSeconds`,title:`Time between flights: maximum`,description:`Longest pause between flights.`,control:`number`,integer:!1,step:.1,range:_e,unit:C,keywords:[`animals`,`frequency`],defaultValue:p.flyingAnimalsMaxGapSeconds,...y},{id:`animals-min-duration`,path:`pref:flyingAnimalsMinDurationSeconds`,title:`Flight duration: minimum`,description:`Shortest flight, for faster animals.`,control:`number`,integer:!1,step:.1,range:ve,unit:C,maximumSettingId:`animals-max-duration`,keywords:[`animals`,`speed`],defaultValue:p.flyingAnimalsMinDurationSeconds,...y},{id:`animals-max-duration`,path:`pref:flyingAnimalsMaxDurationSeconds`,title:`Flight duration: maximum`,description:`Longest flight, for slower animals.`,control:`number`,integer:!1,step:.1,range:ve,unit:C,keywords:[`animals`,`speed`],defaultValue:p.flyingAnimalsMaxDurationSeconds,...y},{id:`animals-scale`,path:`pref:flyingAnimalsScale`,title:`Size multiplier`,description:`Scale applied on top of the viewport size.`,control:`number`,integer:!1,step:.1,range:Ee,unit:Qn,keywords:[`animals`,`size`],defaultValue:p.flyingAnimalsScale,...y},{id:`animals-on-phone`,path:`pref:flyingAnimalsOnPhone`,title:`Show on phone layout`,description:`Allow flights on the phone layout.`,control:`toggle`,keywords:[`animals`,`mobile`],defaultValue:p.flyingAnimalsOnPhone,...y}]},rr={id:`browser-notifications`,level:`browser`,title:`Notifications`,description:`How sessions get your attention.`,settings:[{id:`alert-sounds-enabled`,path:`pref:soundEnabled`,title:`Alert sounds`,legacyIds:[{sectionId:`browser-appearance`,settingId:`alert-sounds-enabled`}],description:`Play a sound when a session needs you, like the note button in the header.`,control:`toggle`,keywords:[`audio`,`mute`,`sound`,`notification`],defaultValue:!0,...v},{id:`alert-sound`,path:`pref:soundId`,title:`Alert sound`,legacyIds:[{sectionId:`browser-appearance`,settingId:`alert-sound`}],description:`Sound played when a session needs you, including files you add to ~/.glimmervoid/sounds/.`,control:`select`,optionsFrom:`sounds`,keywords:[`audio`,`notification`,`custom`],defaultValue:`chime`,...v},{id:`desktop-notifications`,path:`pref:notificationsEnabled`,title:`Desktop notifications`,legacyIds:[{sectionId:`browser-appearance`,settingId:`desktop-notifications`}],description:`Notify you when a session needs you and the dashboard is in the background.`,control:`toggle`,keywords:[`browser`,`attention`],defaultValue:!0,...v}]},ir={id:`browser-shortcuts`,level:`browser`,title:`Shortcuts`,description:`Keyboard shortcuts.`,legacyIds:[`shortcuts`],settings:[{id:`next-attention-key`,path:`pref:nextAttentionKeyCode`,title:`Jump to the next session needing you`,description:`Key held with Cmd on a Mac, or Alt elsewhere, to jump to the next session that needs you.`,control:`shortcut-key`,keywords:[`shortcut`,`keyboard`,`hotkey`,`jump`,`next`,`attention`],defaultValue:`KeyJ`,...v}]},ar={id:`machine-telegram`,level:`machine`,parent:`browser-notifications`,title:`Telegram`,description:`One bot for session, review and PostHog alerts.`,legacyIds:[`telegram`,`notifications`],settings:[{id:`telegram-bot-token`,path:`telegram.botToken`,title:`Bot token`,description:`Token from @BotFather in Telegram (send /newbot).`,control:`password`,keywords:[`credential`,`api`],defaultValue:``,...b},{id:`telegram-chat-id`,path:`telegram.chatId`,title:`Chat id`,description:`Chat the bot posts to, read as message.chat.id from its getUpdates page after you message it.`,control:`text`,keywords:[`destination`,`channel`],defaultValue:``,...b},{id:`telegram-session-notifications`,path:`telegramNotifications`,title:`Send session notifications`,description:`Alert in Telegram when no dashboard is open, or when an alert sits unacknowledged.`,control:`toggle`,keywords:[`phone`,`off dashboard`,`test`],defaultValue:!1,status:`telegram-delivery`,...b}]},or={id:`machine-sessions`,level:`machine`,title:`Sessions`,description:`How sessions start, where projects are found, and branch cleanup.`,legacyIds:[`machine-general`,`general`,`machine-repositories`,`repos`,`repositories`],settings:[{id:`auto-resume`,path:`autoResume`,title:`Auto-resume sessions on startup`,description:`Resume sessions that were live when Glimmervoid last stopped or crashed.`,control:`toggle`,keywords:[`startup`,`conversation`],defaultValue:!0,...b},{id:`tab-order`,path:`viewTabOrder`,title:`Tab order`,description:`Order of the dashboard tabs, also set by dragging tabs in the header.`,control:`tab-order`,keywords:[`tabs`,`order`,`rearrange`,`reorder`,`header`,`more`,`menu`],defaultValue:[],...b},{id:`remote-sessions`,path:`remoteSessions`,title:`Remote Coder sessions`,description:`Offer Coder workspaces when adding a session.`,control:`toggle`,keywords:[`experimental`,`coder`,`remote`,`workspace`,`cloud`],defaultValue:!1,...b},{id:`streamer-mode`,path:`streamerMode`,title:`Streamer mode`,description:`Hide sensitive details while screen sharing.`,control:`toggle`,keywords:[`streaming`,`screen share`,`privacy`],defaultValue:!1,...b},{id:`link-previews`,path:`linkPreviews`,title:`Link page previews`,description:`Resting the pointer on a terminal link for about 600 ms fetches that page from this machine to show its title and icon. Off, the link card shows the address only.`,control:`toggle`,keywords:[`links`,`preview`,`title`,`favicon`,`hover`,`privacy`],defaultValue:!0,...b},{id:`hint-cards`,path:`hintCards`,title:`Hint cards`,description:`Show tip cards: Your day tips and feature suggestions.`,control:`toggle`,keywords:[`experimental`,`hints`,`tips`,`your day`],defaultValue:!1,...b},{id:`repository-roots`,path:`repoRoots`,title:`Repository roots`,description:`Folders scanned for projects when adding a session.`,control:`list`,keywords:[`folders`,`project discovery`],defaultValue:[],listPlaceholder:`Repository root path`,listEmptyText:`No repository roots configured.`,...b},{id:`hidden-agents`,path:`hiddenAgents`,title:`Agents in Add Session`,description:`Agents left out of the Add Session picker. Switch an agent off here to hide it; the default agent always stays.`,control:`agent-visibility`,keywords:[`agents`,`picker`,`hide`,`show`,`add session`,`gemini`,`qwen`,`copilot`,`opencode`,`goose`,`cursor`],defaultValue:[],...b},{id:`custom-agents`,path:`status:custom-agents`,title:`Custom agents`,description:`Extra agent CLIs a session can run.`,control:`readonly`,keywords:[`adapters`,`cli`],status:`custom-agents`,...x},{id:`agent-logins`,path:`status:agent-logins`,title:`Agent logins`,description:`How Claude Code and Codex sign in inside a Coder workspace.`,control:`readonly`,keywords:[`claude`,`codex`,`sign in`,`login`,`coder`,`remote`],status:`agent-logins`,...x},{id:`remote-setup`,path:`status:remote-setup`,title:`Remote host setup`,description:`Start a session that helps you run Glimmervoid on another Linux machine over ssh.`,control:`readonly`,keywords:[`remote`,`ssh`,`server`,`devbox`,`tailscale`,`pair`,`host`],status:`remote-setup`,...x},{id:`branch-gc-delete-unmerged`,path:`branchGc.deleteUnmerged`,title:`Delete unmerged branches`,description:`Also delete stale remote branches with no proof they were merged.`,control:`toggle`,keywords:[`git`,`cleanup`,`orphan`],danger:!0,warning:`Enabling this control lets branch cleanup delete stale remote branches without merge proof.`,legacyIds:[{sectionId:`machine-safety`,settingId:`branch-gc-delete-unmerged`}],defaultValue:!1,...b}]},sr={id:`machine-safety`,level:`machine`,title:`Sane YOLO`,description:`What agents may do without asking, and what Sane YOLO blocks.`,legacyIds:[`machine-guardrails`,`lanes-unattended`,`unattended`],settings:[{id:`skip-permissions-by-default`,path:`skipPermissionsByDefault`,title:`Skip permission prompts by default`,description:`Skip agent permission prompts for projects that set no choice.`,control:`toggle`,keywords:[`permissions`,`yolo`,`dangerously`],danger:!0,warning:`Enabling this control lets agents edit files and run shell commands without asking, and restarts running sessions that inherit it.`,defaultValue:!1,...b},{id:`sane-yolo`,path:`saneYolo`,title:`Sane YOLO`,description:`Block catastrophic commands and credential reads in every session that supports it.`,control:`toggle`,keywords:[`permissions`,`yolo`,`safety`],defaultValue:!0,...Nn},{id:`sane-yolo-unreadable-paths`,path:`saneYoloUnreadablePaths`,title:`Unreadable folders`,description:`Extra files and folders agents may not read, where ~ is your home folder.`,control:`list`,keywords:[`guardrails`,`secrets`,`credentials`,`sane yolo`],defaultValue:[],listPlaceholder:`~/folder`,listEmptyText:`Only the built-in credential list is unreadable.`,...Nn}]},cr={id:`machine-server`,level:`machine`,title:`Server`,description:`Restart or shut down the Glimmervoid server.`,settings:[{id:`server-power`,path:`status:server-power`,title:`Restart or shut down`,description:`Ends every running session first.`,control:`readonly`,keywords:[`power`,`restart`,`shutdown`,`stop`,`quit`,`reboot`,`server`],status:`server-power`,...x}]},lr={id:`machine-updates`,level:`machine`,title:`Updates`,description:`Which version is running, and updating to the newest.`,legacyIds:[`updates`],settings:[{id:`update-actions`,path:`status:update-actions`,title:`Status and actions`,legacyIds:[`update-summary`,`update-installed`,`update-latest`,`update-last-checked`].map(e=>({sectionId:`machine-updates`,settingId:e})),description:`Running and newest versions, with update and restart.`,control:`readonly`,keywords:[`version`,`available`,`current`,`check`,`restart`,`commit`,`installed`,`release`,`failure`],status:`update-actions`,...x},{id:`update-channel`,path:`updateChannel`,title:`Channel`,description:`Stable releases, or Experimental builds from every change to main.`,control:`select`,options:tr(pe),keywords:[`release`,`prerelease`,`next`,`beta`,`early`],defaultValue:`release`,...b},{id:`check-updates`,path:`checkForUpdates`,title:`Check for updates automatically`,description:`Check for a newer version at launch and while the dashboard is open.`,control:`toggle`,keywords:[`release`,`github`],defaultValue:!0,...b}]},ur={id:`machine-usage`,level:`machine`,title:`Usage`,description:`Token accounting and estimated-cost budgets.`,legacyIds:[`usage`],settings:[{id:`usage-enabled`,path:`usage.enabled`,title:`Track token usage`,description:`Read local agent transcripts for the Usage tab and session cards.`,control:`toggle`,keywords:[`tokens`,`cost`],defaultValue:!0,status:`usage-last-report`,...b},{id:`usage-your-day`,path:`usage.yourDay`,title:`Your day`,description:`Recap yesterday and suggest a pace for today when usage tracking is on.`,control:`toggle`,keywords:[`burnout`,`breaks`,`pace`,`wellbeing`],defaultValue:!0,...b},{id:`usage-retain-days`,path:`usage.retainDays`,title:`Retain transcript detail`,description:`How long detailed usage is kept.`,control:`number`,range:ke,unit:w,keywords:[`history`,`retention`],defaultValue:90,...b},{id:`usage-daily-budget`,path:`usage.budget.dailyUsd`,title:`Daily budget`,description:`Alert at 50%, 75% and 100% of this estimated daily spend, or never at zero.`,control:`number`,range:Ae,unit:Xn,keywords:[`spend`,`alert`],defaultValue:null,integer:!1,nullable:!0,zeroIsNull:!0,step:.01,...b},{id:`usage-monthly-budget`,path:`usage.budget.monthlyUsd`,title:`Monthly budget`,description:`Alert at 50%, 75% and 100% of this estimated monthly spend, or never at zero.`,control:`number`,range:Ae,unit:Xn,keywords:[`spend`,`alert`],defaultValue:null,integer:!1,nullable:!0,zeroIsNull:!0,step:.01,...b}]},dr={id:`machine-privacy`,level:`machine`,title:`Privacy`,description:`What Glimmervoid sends about itself.`,legacyIds:[`privacy`,`telemetry`],settings:[{id:`telemetry-enabled`,path:`telemetry.enabled`,title:`Send usage data`,description:`Helps us improve Glimmervoid. Sent under a random install id: version, platform, app starts, daily activity, session starts and ends with agent kind, exit kind and duration, errors as their type, error code and scrubbed stack frames, per session token counts, models and estimated costs from the usage scan, and a salted one-way hash of your Claude and Codex account ids so installs of one account count together. The text of errors the dashboard shows in its header line, with your home folder shown as ~, which can name a session, folder or branch. Otherwise never prompts, project information, other error messages, paths, repository or branch names, objectives, terminal output, emails or names. Delete my data asks for everything sent under this install to be erased and starts a new install id. GLIMMERVOID_TELEMETRY=0, DO_NOT_TRACK=1 or CI=true turn it off regardless.`,control:`toggle`,keywords:[`telemetry`,`analytics`,`tracking`,`opt out`],defaultValue:!0,...b}]},fr={id:`lanes-posthog`,level:`lanes`,title:`PostHog`,description:`Error monitoring, investigations and traffic-spike alerts.`,legacyIds:[`lanes`,`posthog`],settings:[{id:`posthog-enabled`,path:`posthog.enabled`,title:`Enable PostHog monitoring`,description:`Watch PostHog error tracking and investigate issues that move.`,control:`toggle`,keywords:[`errors`,`monitoring`],defaultValue:!1,...b},{id:`posthog-host`,path:`posthog.host`,title:`Host`,description:`PostHog cloud or self-hosted URL.`,control:`text`,keywords:[`url`,`server`],defaultValue:`https://us.posthog.com`,...b},{id:`posthog-api-key`,path:`posthog.apiKey`,title:`Personal API key`,description:`Personal API key with read access to your projects.`,control:`password`,keywords:[`credential`,`token`],defaultValue:``,...b},{id:`posthog-projects`,path:`posthog.projects`,title:`Projects`,description:`Project ids to watch, where empty watches all and none watches none.`,control:`list`,keywords:[`project ids`,`filter`],defaultValue:`all`,valueKind:`posthog-projects`,listPlaceholder:`Project id`,listEmptyText:`Every project the key can read.`,...b},{id:`posthog-interval`,path:`posthog.intervalMinutes`,title:`Poll interval`,description:`Time between PostHog checks.`,control:`number`,integer:!1,step:`any`,range:f,unit:Un,keywords:[`refresh`,`schedule`],defaultValue:15,...b},{id:`posthog-max-investigations`,path:`posthog.maxConcurrentInvestigations`,title:`Max concurrent investigations`,description:`Most investigations running at once.`,control:`number`,range:f,unit:zn,keywords:[`parallel`,`workers`],defaultValue:2,...b},{id:`posthog-min-users`,path:`posthog.minUsersToInvestigate`,title:`Min users to investigate`,description:`Fewest affected users before a new issue is investigated.`,control:`number`,range:f,unit:Zn,keywords:[`threshold`,`affected`],defaultValue:1,...b},{id:`posthog-traffic-enabled`,path:`posthog.trafficSpikeEnabled`,title:`Traffic spike alerts`,description:`Alert when unique users jump above normal.`,control:`toggle`,keywords:[`analytics`,`alert`],defaultValue:!0,...b},{id:`posthog-auto-fix`,path:`posthog.autoFix`,title:`Attempt fixes for major issues`,description:`Let an agent fix an issue on a local branch, opening a pull request only after you approve.`,control:`toggle`,keywords:[`automatic`,`pull request`],danger:!0,warning:`Enabling this control lets an agent that read PostHog error data edit code onto a local branch; nothing is pushed until you approve it.`,defaultValue:!1,...b}]},pr={id:`lanes-github-access`,level:`lanes`,title:`Lane GitHub access`,description:`What background lanes may read on GitHub and the web.`,settings:[{id:`github-read-token`,path:`github.readToken`,title:`GitHub read token`,description:`Read-only fine-grained GitHub token lanes use for gh. Team review and community research need it.`,control:`password`,keywords:[`credential`,`token`,`gh`,`pull requests`],defaultValue:``,...b},{id:`lanes-fetch-domains`,path:`lanes.fetchDomains`,title:`Extra fetch domains`,description:`Domains lanes may fetch pages from, beyond GitHub and posthog.com.`,control:`list`,keywords:[`web`,`fetch`,`domains`,`allowlist`],defaultValue:[],listPlaceholder:`docs.example.com`,listEmptyText:`Only the built-in domains.`,...b}]},mr={id:`lanes-team-review`,level:`lanes`,title:`Team review`,description:`Draft reviews of teammates' pull requests for you to post.`,legacyIds:[`team-review`,`reviews`],settings:[{id:`team-review-enabled`,path:`teamReview.enabled`,title:`Enable team review`,description:`Draft a review of each open team pull request, posting nothing until you approve or comment.`,control:`toggle`,keywords:[`pull requests`,`github`],defaultValue:!0,...b},{id:`github-teams`,path:`github.teams`,title:`GitHub teams`,description:`GitHub teams whose review requests are drafted, as org/team-slug.`,control:`list`,keywords:[`github`,`teams`,`review requests`],defaultValue:[],listPlaceholder:`org/team-slug`,listEmptyText:`No GitHub teams configured.`,...b},{id:`team-review-org`,path:`teamReview.org`,title:`GitHub organization`,description:`Organization whose pull requests that request your review directly are drafted. Needed only when no GitHub team is set.`,control:`text`,keywords:[`github`,`organization`,`org`,`review requests`],defaultValue:``,...b},{id:`team-review-re-review-after-hours`,path:`teamReview.reReviewAfterHours`,title:`Re-review after`,description:`Review a pull request again after a new push, once this much time has passed.`,control:`number`,range:f,unit:Wn,keywords:[`review`,`delay`],defaultValue:24,integer:!1,step:.5,...b},{id:`team-review-skip-idle-after-days`,path:`teamReview.skipIdleAfterDays`,title:`Skip PRs idle for`,description:`Skip pull requests with no activity for this long.`,control:`number`,range:f,unit:w,keywords:[`idle`,`activity`],defaultValue:14,integer:!1,step:.5,...b},{id:`team-review-skill`,path:`teamReview.skill`,title:`Review skill`,description:`Skill Claude Code follows for each review, or none when empty.`,control:`text`,keywords:[`skill`,`claude code`,`pr review`],defaultValue:``,suggestionsFrom:`review-skills`,...b},{id:`team-review-reviewer-model`,path:`teamReview.reviewer.model`,title:`Review model`,description:`Model for reviews, or the agent's default when empty.`,control:`text`,keywords:[`model`,`reviewer`],defaultValue:``,suggestionsFrom:`review-models`,...b},{id:`team-review-reviewer-effort`,path:`teamReview.reviewer.effort`,title:`Review effort`,description:`Effort for reviews, or the agent's default when empty.`,control:`text`,keywords:[`effort`,`thinking`,`reasoning`,`reviewer`],defaultValue:``,suggestionsFrom:`review-efforts`,...b},{id:`team-review-stamp-reviewer-model`,path:`teamReview.stampReviewer.model`,title:`Docs and tests PR model`,description:`Model for pull requests that only touch docs and tests.`,control:`text`,keywords:[`stamp`,`model`,`small pull requests`,`docs`,`tests`],defaultValue:``,suggestionsFrom:`review-stamp-models`,...b},{id:`team-review-stamp-reviewer-effort`,path:`teamReview.stampReviewer.effort`,title:`Docs and tests PR effort`,description:`Effort for pull requests that only touch docs and tests.`,control:`text`,keywords:[`stamp`,`effort`,`small pull requests`,`docs`,`tests`],defaultValue:``,suggestionsFrom:`review-stamp-efforts`,...b},{id:`team-review-sandbox-load-mcp-servers`,path:`teamReview.sandbox.loadMcpServers`,title:`Load my MCP servers`,description:`Give the review agent your own MCP servers.`,control:`toggle`,keywords:[`mcp`,`servers`,`tools`],danger:!0,warning:`Enabling this control gives the review agent, which reads untrusted pull request text, every tool your MCP servers expose.`,defaultValue:!1,...b},{id:`team-review-auto-rebase-my-prs`,path:`teamReview.autoRebaseMyPrs`,title:`Keep my pull requests rebased`,description:`Rebase your open pull requests when they fall behind their base branch.`,control:`toggle`,keywords:[`rebase`,`update branch`,`behind`,`my prs`],danger:!0,warning:`Enabling this control rewrites your pull request branches on GitHub. Pull before you push from a local checkout of one.`,defaultValue:!1,...b},{id:`team-review-keep-mergeable-enabled`,path:`teamReview.keepMergeableEnabled`,title:`Keep mergeable`,description:`Offer Keep mergeable: an agent fixes conflicts and failing checks on your pull requests.`,control:`toggle`,keywords:[`repair`,`conflicts`,`my prs`],defaultValue:!0,...b},{id:`team-review-keep-mergeable-timeout`,path:`teamReview.keepMergeableTimeoutMinutes`,title:`Keep mergeable deadline`,description:`Longest a Keep mergeable repair may run.`,control:`number`,range:Pe,unit:Un,keywords:[`timeout`,`repair`],defaultValue:30,...b},{id:`team-review-merge-queue-enabled`,path:`teamReview.mergeQueueEnabled`,title:`Merge when ready`,description:`Offer Merge when ready: queued pull requests merge once they pass.`,control:`toggle`,keywords:[`merge queue`,`auto merge`,`my prs`],defaultValue:!0,...b}]},hr={id:`lanes-workflows`,level:`lanes`,title:`Workflows`,description:`Rules that act on pull request events.`,legacyIds:[`workflows`],settings:[{id:`workflows-enabled`,path:`workflows.enabled`,title:`Run workflows`,description:`Watch the repositories your rules name and run their actions.`,control:`toggle`,keywords:[`pull requests`,`automation`,`master switch`],defaultValue:!0,...b},{id:`workflows-max-concurrent-sessions`,path:`workflows.maxConcurrentSessions`,title:`Concurrent agent sessions`,description:`Most workflow sessions running at once.`,control:`number`,range:Ce,unit:Bn,keywords:[`parallel`,`spawn`],defaultValue:2,...b},{id:`workflows-rules`,path:`status:workflow-rules`,title:`Workflow rules`,description:`Turn each workflow rule on or off.`,control:`readonly`,keywords:[`pull requests`,`automation`,`github`,`rules`],status:`workflows`,...x}]},gr={id:`lanes-benchmarks`,level:`lanes`,title:`Benchmarks`,description:`Compare agent setups on frozen benchmark cases.`,legacyIds:[`benchmarks`],settings:[{id:`benchmarks-enabled`,path:`benchmarks.enabled`,title:`Enable benchmarks`,description:`Show the Bench tab, where nothing runs until you start it.`,control:`toggle`,keywords:[`eval`,`arms`,`recall`,`compare`],defaultValue:!1,...b}]},_r={id:`lanes-coherence`,level:`lanes`,title:`Coherence`,description:`Coherence hook status and decision journal per session.`,settings:[{id:`coherence-enabled`,path:`coherence.enabled`,title:`Show session Coherence`,description:`Show the Coherence hook status and decisions of each session in a repository with a coherence.config.json (needs @posthog/coherence 1.8 or newer).`,control:`toggle`,keywords:[`experimental`,`coherence`,`journal`,`decisions`],defaultValue:!0,...b}]},vr={id:`lanes-issues`,level:`lanes`,title:`Issues`,description:`GitHub issues from your projects and teams.`,settings:[{id:`issues-enabled`,path:`issues.enabled`,title:`Show the Issues tab`,description:`Show an Issues tab listing GitHub issues for your projects and teams.`,control:`toggle`,keywords:[`experimental`,`issues`,`github`,`tab`],defaultValue:!1,...b}]},yr={id:`lanes-community`,level:`lanes`,title:`Community`,description:`Research new posthog.com community questions and draft replies.`,settings:[{id:`community-enabled`,path:`community.enabled`,title:`Show the Community tab`,description:`Research new community questions and draft a reply for each.`,control:`toggle`,keywords:[`experimental`,`community`,`questions`,`forum`,`tab`],defaultValue:!1,...b},{id:`community-skill`,path:`community.skill`,title:`Research skill`,description:`Skill the research agent follows, or none when empty.`,control:`text`,keywords:[`skill`,`answering`,`claude code`],defaultValue:``,...b},{id:`community-project-id`,path:`community.projectId`,title:`PostHog project`,description:`PostHog project holding the community forum and Discord data.`,control:`number`,integer:!0,range:ye,unit:{label:`project id`,storedPerDisplay:1},keywords:[`project id`,`warehouse`],defaultValue:2,...b},{id:`community-interval`,path:`community.intervalMinutes`,title:`Poll interval`,description:`Time between community checks.`,control:`number`,integer:!0,range:Fe,unit:Un,keywords:[`refresh`,`schedule`],defaultValue:30,...b},{id:`community-discord-channels`,path:`community.discordChannels`,title:`Discord channels`,description:`Discord channels to watch for questions, without the #, or none to skip Discord.`,control:`list`,keywords:[`discord`,`channels`,`allowlist`],defaultValue:[],...b}]},br={id:`lanes-question-manager`,level:`lanes`,title:`Question manager`,description:`Answer a session question from your rules and pass every other question to you.`,settings:[{id:`question-manager-enabled`,path:`questionManager.enabled`,title:`Answer questions from rules`,description:`Default for every repository. Questions with a risk word or no matching rule still come to you.`,control:`toggle`,keywords:[`experimental`,`questions`,`rules`,`automation`,`answer`],defaultValue:!1,...b},{id:`question-manager-repos`,path:`questionManager.repos`,title:`Exceptions`,description:`Repositories, by path or owner/name, that do the opposite of the default.`,control:`list`,keywords:[`experimental`,`repositories`,`projects`,`per project`],defaultValue:[],listPlaceholder:`Path or owner/name`,listEmptyText:`Every repository follows the default.`,...b}]},xr=Object.freeze([`auto`,`calculate`,`display`]);Object.freeze([`codex`,`grok`,`kimi`]),Object.freeze([`dailyUsd`,`monthlyUsd`]);var Sr=Object.freeze([{id:`file-debug-mode`,path:`debugMode`,title:`Debug mode`,group:`machine-sessions`,description:`Show session-card diagnostics for state, transitions and detection signals.`,control:`toggle`,keywords:[`diagnostics`,`state`],defaultValue:!1,takesEffect:`now`,fileOnlyReason:E,...S},{id:`file-replay-buffer`,path:`replayBufferKB`,title:`Replay buffer`,group:`machine-terminal`,description:`PTY output retained for clients that reconnect or join late.`,control:`number`,range:Ie,unit:{label:`KB`,storedPerDisplay:1},keywords:[`history`,`backfill`],defaultValue:512,takesEffect:`new-sessions`,fileOnlyReason:T,...S},{id:`file-session-memory-reserve`,path:`sessionMemoryReserveMB`,title:`Session memory reserve`,group:`machine-sessions`,description:`Free memory an automatic session start waits for; 0 starts sessions without checking.`,control:`number`,range:he,unit:{label:`MB`,storedPerDisplay:1},keywords:[`memory`,`headroom`],defaultValue:600,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-cursor-blink`,path:`cursorBlink`,title:`Cursor blink`,group:`machine-terminal`,description:`Blink the cursor in every terminal.`,control:`toggle`,keywords:[`caret`,`terminal`],defaultValue:!1,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-detect-background-agents`,path:`detectBackgroundAgents`,title:`Detect background agents`,group:`machine-detection-sessions`,description:`Hold completion while tracked background work is active.`,control:`toggle`,keywords:[`subagents`,`completion`],defaultValue:!0,takesEffect:`new-sessions`,fileOnlyReason:E,...S},{id:`file-record-signals`,path:`recordSignals`,title:`Record structural signals`,group:`machine-detection-sessions`,description:`Keep forensic status and hook recordings for each session. Full capture (capture.enabled) records these signals even when this is off.`,control:`toggle`,keywords:[`recordings`,`diagnostics`],defaultValue:!0,takesEffect:`new-sessions`,fileOnlyReason:E,...S},{id:`file-trace-enabled`,path:`trace.enabled`,title:`Capture session traces`,group:`machine-detection-sessions`,description:`Keep normalized Claude transcript traces for session debugging.`,control:`toggle`,keywords:[`transcripts`,`diagnostics`],defaultValue:!0,takesEffect:`restart`,fileOnlyReason:E,...S},{id:`file-detect-scheduled-wakeups`,path:`detectScheduledWakeups`,title:`Detect scheduled wakeups`,group:`machine-detection-sessions`,description:`Surface advisory wakeup timing for scheduled sessions.`,control:`toggle`,keywords:[`schedule`,`sleep`],defaultValue:!0,takesEffect:`restart`,fileOnlyReason:E,...S},{id:`file-worktree-auto-rebase`,path:`worktreeAutoRebase`,title:`Worktree auto-rebase`,group:`machine-detection-sessions`,description:`Rebase eligible session worktrees when the integration branch moves.`,control:`toggle`,keywords:[`git`,`branch`],defaultValue:!0,takesEffect:`new-sessions`,fileOnlyReason:D,...S},{id:`file-worktree-sync-on-start`,path:`worktreeSyncOnStart`,title:`Worktree sync on start`,group:`machine-detection-sessions`,description:`Fetch origin and fast-forward the local integration branch before a session starts its worktree.`,control:`toggle`,keywords:[`git`,`fetch`,`fast-forward`],defaultValue:!0,takesEffect:`new-sessions`,fileOnlyReason:D,...S},{id:`file-worktree-clone-dependencies`,path:`worktreeCloneDependencies`,title:`Worktree dependencies`,group:`machine-detection-sessions`,description:`Give a session worktree its node_modules before the agent starts: on macOS, clone the main checkout's when it matches the worktree's lockfile, then, except on Windows, install each folder still without one from its package-lock.json or pnpm-lock.yaml, with no package scripts.`,control:`toggle`,keywords:[`node_modules`,`npm`,`pnpm`,`install`],defaultValue:!0,takesEffect:`new-sessions`,fileOnlyReason:D,...S},{id:`file-worktree-rerere`,path:`worktreeRerere`,title:`Worktree rerere`,group:`machine-detection-sessions`,description:`Reuse recorded Git conflict resolutions.`,control:`toggle`,keywords:[`git`,`conflicts`],defaultValue:!0,takesEffect:`restart`,fileOnlyReason:D,...S},{id:`file-share-commit-provenance`,path:`shareCommitProvenance`,title:`Share commit provenance`,group:`machine-detection-sessions`,description:`After Merge pushes the base branch, also push the git notes that let glimmervoid why name the agent and session of a commit on any clone. The notes hold a hashed session id and the agent name, never a task or prompt. Off keeps them on this machine.`,control:`toggle`,keywords:[`git`,`notes`,`why`,`privacy`],defaultValue:!0,takesEffect:`now`,fileOnlyReason:D,...S},{id:`file-integration-branch`,path:`integrationBranch`,title:`Integration branch`,group:`machine-detection-sessions`,description:`Base branch for session worktrees. Empty = each repo's default branch. Existing sessions are never retargeted.`,control:`text`,nullable:!0,keywords:[`git`,`merge`],defaultValue:null,takesEffect:`new-sessions`,fileOnlyReason:D,...S},{id:`file-worktree-root`,path:`worktreeRoot`,title:`Worktree root`,group:`machine-detection-sessions`,description:`Directory that contains session worktrees. Existing worktrees are never relocated.`,control:`text`,keywords:[`git`,`directory`],defaultValue:``,takesEffect:`new-sessions`,fileOnlyReason:D,...S},{id:`file-worktree-share`,path:`worktreeShare`,title:`Shared worktree paths`,group:`machine-detection-sessions`,description:`Local paths copied or linked during worktree preparation. A * matches names at the project root, never one containing production; name such a file in full to share it.`,control:`list`,keywords:[`files`,`context`,`env`],defaultValue:[`.env*`,`.claude`],takesEffect:`new-sessions`,fileOnlyReason:er,...S},{id:`file-port`,path:`port`,title:`Local port`,group:`machine-detection-sessions`,description:`Port used by the local dashboard listener.`,control:`number`,range:Te,unit:{label:`port`,storedPerDisplay:1},keywords:[`server`,`listener`],defaultValue:3e3,takesEffect:`restart`,fileOnlyReason:er,...S},{id:`file-notify-debounce-ms`,path:`notifyDebounceMs`,title:`Notification grouping window`,group:`machine-detection-sessions`,description:`Alerts from any session within this long of the first one fold into one sound, one desktop notification and one Telegram message.`,control:`number`,integer:!1,step:`any`,range:f,unit:Gn,keywords:[`timer`,`alerts`],defaultValue:3e3,takesEffect:`new-sessions`,fileOnlyReason:T,...S},{id:`file-phone-escalation-ms`,path:`phoneEscalationMs`,title:`Phone escalation delay`,group:`machine-detection-sessions`,description:`Delay before off-dashboard escalation.`,control:`number`,integer:!1,step:`any`,range:f,unit:Kn,keywords:[`timer`,`telegram`],defaultValue:3e5,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-branch-gc-enabled`,path:`branchGc.enabled`,title:`Branch cleanup`,group:`machine-detection-sessions`,description:`Enable cleanup of eligible session branches.`,control:`toggle`,keywords:[`git`,`cleanup`],defaultValue:!0,takesEffect:`now`,fileOnlyReason:D,...S},{id:`file-branch-gc-worktrees`,path:`branchGc.worktrees`,title:`Local worktree cleanup`,group:`machine-detection-sessions`,description:`Enable cleanup of eligible local worktrees.`,control:`toggle`,keywords:[`git`,`worktree`,`cleanup`],defaultValue:!0,takesEffect:`now`,fileOnlyReason:D,...S},{id:`file-branch-gc-prefixes`,path:`branchGc.prefixes`,title:`Branch cleanup prefixes`,group:`machine-detection-sessions`,description:`Branch prefixes that filter both remote branch cleanup and local worktree cleanup.`,control:`list`,keywords:[`git`,`branch`],defaultValue:[`glimmervoid/session/`,`worktree-agent-`],takesEffect:`now`,fileOnlyReason:D,...S},{id:`file-branch-gc-dry-run`,path:`branchGc.dryRun`,title:`Branch cleanup dry run`,group:`machine-detection-sessions`,description:`Report planned cleanup without deleting remote branches.`,control:`toggle`,keywords:[`git`,`safety`],defaultValue:!1,takesEffect:`now`,fileOnlyReason:D,...S},{id:`file-branch-gc-stale-days`,path:`branchGc.staleDays`,title:`Branch stale days`,group:`machine-detection-sessions`,description:`Age threshold for orphan branch cleanup when unmerged deletion is on.`,control:`number`,integer:!1,step:`any`,range:f,unit:w,keywords:[`git`,`retention`],defaultValue:14,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-branch-gc-interval-ms`,path:`branchGc.intervalMs`,title:`Branch cleanup interval`,group:`machine-detection-sessions`,description:`Delay between branch cleanup passes.`,control:`number`,integer:!1,step:`any`,range:f,unit:Jn,keywords:[`git`,`schedule`],defaultValue:216e5,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-custom-agents`,path:`customAgents`,title:`Custom agents`,group:`machine-detection-sessions`,description:`Extra agent CLIs a session can be spawned with. The Sessions section lists the declared agents and whether each command resolves.`,control:`json`,keywords:[`adapters`,`cli`],defaultValue:[],takesEffect:`new-sessions`,fileOnlyReason:er,...S},{id:`file-task-title-refiner-enabled`,path:`taskTitle.refiner.enabled`,title:`Refine task titles`,group:`machine-detection-sessions`,description:`Keep session card titles useful when prompts change topic by asking a model for a short title.`,control:`toggle`,keywords:[`title`,`refiner`,`card`],defaultValue:!0,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-task-title-refiner-model`,path:`taskTitle.refiner.model`,title:`Task title model`,group:`machine-detection-sessions`,description:`Claude model alias the title refiner asks.`,control:`text`,keywords:[`title`,`refiner`,`model`],defaultValue:u.taskTitleRefiner,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-task-title-refiner-min-interval`,path:`taskTitle.refiner.minIntervalSeconds`,title:`Task title refresh interval`,group:`machine-detection-sessions`,description:`Shortest pause between two title refinements of one session.`,control:`number`,integer:!1,step:`any`,range:Ne,unit:C,keywords:[`title`,`refiner`,`interval`],defaultValue:60,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-task-title-refiner-timeout`,path:`taskTitle.refiner.timeoutSeconds`,title:`Task title timeout`,group:`machine-detection-sessions`,description:`Maximum time allowed for one title refinement.`,control:`number`,integer:!1,step:`any`,range:ge,unit:C,keywords:[`title`,`refiner`,`deadline`],defaultValue:60,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-usage-codex`,path:`usage.vendors.codex`,title:`Track Codex usage`,group:`machine-usage`,description:`Include local Codex CLI transcripts in usage reports.`,control:`toggle`,keywords:[`openai`,`vendor`],defaultValue:!0,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-usage-grok`,path:`usage.vendors.grok`,title:`Track Grok usage`,group:`machine-usage`,description:`Include local Grok CLI transcripts in usage reports.`,control:`toggle`,keywords:[`xai`,`vendor`],defaultValue:!0,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-usage-kimi`,path:`usage.vendors.kimi`,title:`Track Kimi Code usage`,group:`machine-usage`,description:`Include local Kimi Code transcripts in usage reports.`,control:`toggle`,keywords:[`moonshot`,`vendor`],defaultValue:!0,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-usage-fetch-pricing`,path:`usage.fetchPricing`,title:`Fetch current model prices`,group:`machine-usage`,description:`Load public model prices when usage tracking starts, using a cached table for up to one day. Falls back to cached or bundled prices if the fetch fails; no daily refresh runs while tracking continues.`,control:`toggle`,keywords:[`rates`,`models`],defaultValue:!0,takesEffect:`restart`,fileOnlyReason:T,...S},{id:`file-usage-plan-limits`,path:`usage.planLimits`,title:`Show plan limits`,group:`machine-usage`,description:`Read the Claude plan limit the CLI reports and show it beside usage.`,control:`toggle`,keywords:[`plan`,`limits`,`quota`],defaultValue:!0,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-usage-scan-interval`,path:`usage.scanIntervalMinutes`,title:`Scan interval`,group:`machine-usage`,description:`Periodic transcript polling interval. Session activity can also trigger scans between timer ticks.`,control:`number`,range:je,unit:Un,keywords:[`poll`,`refresh`],defaultValue:5,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-usage-warehouse-retain-days`,path:`usage.warehouseRetainDays`,title:`Retain usage history`,group:`machine-usage`,description:`How long the daily usage warehouse keeps rolled-up totals after transcript detail expires.`,control:`number`,range:xe.warehouseRetainDays,unit:w,keywords:[`history`,`warehouse`,`retention`],defaultValue:365,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-usage-session-block-hours`,path:`usage.sessionBlockHours`,title:`Session block length`,group:`machine-usage`,description:`Length of the rolling block the Usage view groups activity into.`,control:`number`,range:xe.sessionBlockHours,unit:Wn,keywords:[`block`,`window`,`hours`],defaultValue:5,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-usage-cost-mode`,path:`usage.costMode`,title:`Cost mode`,group:`machine-usage`,description:`Choose whether recorded costs, calculated costs or both can appear.`,control:`select`,options:tr(xr),keywords:[`pricing`,`estimate`],defaultValue:`auto`,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-usage-extra-projects-dirs`,path:`usage.extraProjectsDirs`,title:`Extra transcript folders`,group:`machine-usage`,description:`Absolute paths of additional Claude projects folders the usage scan reads.`,control:`list`,keywords:[`transcripts`,`folders`,`scan`],defaultValue:[],takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-posthog-investigation-timeout`,path:`posthog.investigationTimeoutSeconds`,title:`Investigation timeout`,group:`lanes-posthog`,description:`Maximum time allowed for one investigation.`,control:`number`,integer:!1,step:`any`,range:f,unit:qn,keywords:[`deadline`,`session`],defaultValue:900,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-posthog-escalation`,path:`posthog.userEscalationThreshold`,title:`Escalation threshold`,group:`lanes-posthog`,description:`Affected-user count that escalates an issue.`,control:`number`,range:f,unit:Zn,keywords:[`threshold`,`severity`],defaultValue:25,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-posthog-fix-timeout`,path:`posthog.fixTimeoutSeconds`,title:`Fix timeout`,group:`lanes-posthog`,description:`Maximum time allowed for one fix session.`,control:`number`,integer:!1,step:`any`,range:De,unit:qn,keywords:[`deadline`,`repair`],defaultValue:1800,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-posthog-traffic-multiplier`,path:`posthog.trafficSpikeMultiplier`,title:`Spike multiplier`,group:`lanes-posthog`,description:`Baseline multiplier required to classify a traffic spike.`,control:`number`,integer:!1,step:`any`,range:Oe,unit:Qn,keywords:[`baseline`,`ratio`],defaultValue:3,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-posthog-traffic-min-users`,path:`posthog.trafficSpikeMinUsers`,title:`Min users to alert`,group:`lanes-posthog`,description:`Minimum recent unique users for an initial traffic-spike alert. Escalation and recovery alerts bypass this minimum.`,control:`number`,range:we,unit:Zn,keywords:[`threshold`,`analytics`],defaultValue:10,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-posthog-traffic-cooldown`,path:`posthog.trafficSpikeCooldownMinutes`,title:`Spike cooldown`,group:`lanes-posthog`,description:`Cooldown for new traffic spikes. Escalation and recovery alerts bypass it. Zero removes the time delay; repeated active-spike alerts are still suppressed.`,control:`number`,integer:!1,step:`any`,range:Ne,unit:Yn,keywords:[`silence`,`delay`],defaultValue:360,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-posthog-traffic-baseline`,path:`posthog.trafficSpikeBaselineDays`,title:`Baseline window`,group:`lanes-posthog`,description:`Historical window used to calculate normal hourly traffic.`,control:`number`,range:Se,unit:w,keywords:[`history`,`analytics`],defaultValue:7,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-posthog-recurrence-dedupe`,path:`posthog.recurrenceDedupe`,title:`Deduplicate recurring issues`,group:`lanes-posthog`,description:`Treat an issue seen again inside the recurrence window as the same investigation instead of opening a new one.`,control:`toggle`,keywords:[`recurrence`,`dedupe`,`issues`],defaultValue:!0,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-posthog-recurrence-window-days`,path:`posthog.recurrenceWindowDays`,title:`Recurrence window`,group:`lanes-posthog`,description:`How far back an issue counts as a recurrence of an investigated one.`,control:`number`,integer:!1,step:`any`,range:f,unit:w,keywords:[`recurrence`,`window`],defaultValue:7,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-posthog-transient-recurrence-limit`,path:`posthog.transientRecurrenceLimit`,title:`Transient recurrence limit`,group:`lanes-posthog`,description:`How many times a transient issue may recur before it is investigated again.`,control:`number`,integer:!1,step:`any`,range:f,unit:Vn,keywords:[`recurrence`,`transient`,`limit`],defaultValue:3,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-posthog-repo-path`,path:`posthog.repoPath`,title:`Repository path`,group:`lanes-posthog`,description:`Absolute path of the local checkout investigations read and fixes branch from, for every project the project map does not name.`,control:`text`,keywords:[`repository`,`checkout`,`path`],defaultValue:``,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-posthog-project-map`,path:`posthog.projectMap`,title:`Project map`,group:`lanes-posthog`,description:`PostHog project id to a label: the name shown for that project, and, when it is an absolute path to a checkout, the repository its issues are investigated in.`,control:`json`,keywords:[`projects`,`repositories`,`map`],defaultValue:{},takesEffect:`now`,fileOnlyReason:$n,...S},{id:`file-team-review-team`,path:`teamReview.team`,title:`GitHub team (legacy)`,group:`lanes-team-review`,description:`Team slug whose members and review requests are polled. Read only when github.teams is empty.`,control:`text`,keywords:[`github`,`slug`,`legacy`],defaultValue:``,takesEffect:`now`,fileOnlyReason:`A legacy key: github.teams names teams as org/slug entries and wins whenever it is set.`,...S},{id:`file-workflows-max-actions-per-poll`,path:`workflows.maxActionsPerPoll`,title:`Actions per poll`,group:`lanes-workflows`,description:`Most actions run in one poll. The rest are dropped and logged.`,control:`number`,range:be,unit:Hn,keywords:[`cap`,`rate limit`],defaultValue:20,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-workflows-rules`,path:`workflows.rules`,title:`Workflow rule definitions`,group:`lanes-workflows`,description:`The rules the Workflows section switches on and off: each names its repositories, one pull request event, its filters and its actions.`,control:`json`,keywords:[`pull requests`,`automation`,`rules`],defaultValue:[],takesEffect:`now`,fileOnlyReason:`Rule definitions are written in config.json; the Workflows section only switches each rule on or off.`,...S},{id:`file-pr-flows-sources`,path:`prFlows.sources`,title:`PR flows sources`,group:`lanes-team-review`,description:`Commands that report review findings for your own pull requests, run without a shell on each new head once you approve the exact command in My PRs. Each entry has id, label, command (an argv array; {prUrl}, {repo}, {number} and {head} expand inside one argument, and GLIMMERVOID_PR_URL, GLIMMERVOID_PR_REPO, GLIMMERVOID_PR_NUMBER and GLIMMERVOID_PR_HEAD are set), timeoutSeconds and optional repos (owner/name; every repository when absent), and prints {"findings": [{"path", "lineStart", "lineEnd", "priority", "body", "url"}], "status": [{"label", "state"}]} JSON. Each id is unique within the list. Check entries with glimmervoid pr-flows check.`,jsonSchema:t(i(ie),{io:`input`}),example:[{id:`scanner`,label:`Scanner`,command:[`my-review-scanner`,`--pr`,`{prUrl}`,`--json`],timeoutSeconds:120}],control:`json`,keywords:[`pull requests`,`review items`,`bots`,`commands`],defaultValue:[],takesEffect:`now`,fileOnlyReason:`Commands run on this machine, so they are written in config.json and each one waits for your approval in My PRs.`,...S},{id:`file-pr-flows-actions`,path:`prFlows.actions`,title:`PR flows actions`,group:`lanes-team-review`,description:`Commands that act on a review item of your own pull request, shown as a button with their label and named by rules as run:<id>. Each entry has id, label, command and timeoutSeconds like a source, also expands {itemPath} and {itemLine}, gets the item as GLIMMERVOID_ITEM_JSON, waits for your approval in My PRs, and has an id unique within the list. Exit 0 is done and non-zero failed, unless stdout prints {"outcome": "done" | "started" | "refused" | "failed", "message"} JSON.`,jsonSchema:t(i(se),{io:`input`}),example:[{id:`ask-bot`,label:`Ask bot`,command:[`gh`,`pr`,`comment`,`{prUrl}`,`--body`,`@review-bot fix {itemPath}:{itemLine}`]}],control:`json`,keywords:[`pull requests`,`review items`,`commands`],defaultValue:[],takesEffect:`now`,fileOnlyReason:`Commands run on this machine, so they are written in config.json and each one waits for your approval in My PRs.`,...S},{id:`file-pr-flows-pr-actions`,path:`prFlows.prActions`,title:`PR flows PR actions`,group:`lanes-team-review`,description:`Commands that act on a whole pull request of yours, shown as a button next to Keep mergeable and Merge when ready and run once per click, never by a rule. Each entry has id, label, command and timeoutSeconds like an action, plus optional repos (owner/name; every repository when absent), expands {headRef} and {baseRef} instead of the item placeholders, gets GLIMMERVOID_PR_HEAD_REF, GLIMMERVOID_PR_BASE_REF and the pull request as GLIMMERVOID_PR_JSON, and waits for your approval in My PRs. Exit 0 is done and non-zero failed, unless stdout prints {"outcome": "done" | "started" | "refused" | "failed", "message"} JSON.`,jsonSchema:t(i(c),{io:`input`}),example:[{id:`agent-merge`,label:`Merge via agent`,repos:[`acme/app`],command:[`my-merge-trigger`,`{prUrl}`,`{headRef}`],timeoutSeconds:60}],control:`json`,keywords:[`pull requests`,`buttons`,`commands`,`merge`],defaultValue:[],takesEffect:`now`,fileOnlyReason:`Commands run on this machine, so they are written in config.json and each one waits for your approval in My PRs.`,...S},{id:`file-packs`,path:`packs`,title:`Packs`,group:`lanes-team-review`,description:`More pack directories to load besides every directory under ~/.glimmervoid/packs/. A pack is a pack.json (name, version, description, requires, and sections such as prFlows with prActions, sources, actions, rules and a repos default for them) plus the files it uses, shared by copying the directory; its commands can use {packDir}, its ids show as <pack>/<id>, and it waits for one approval in Settings, Packs that any edit to a file in it asks again.`,control:`list`,keywords:[`packs`,`share`,`plugins`,`pull requests`,`commands`],defaultValue:[],takesEffect:`now`,fileOnlyReason:`A pack can run commands on this machine, so its directory is written in config.json and the pack waits for your approval.`,...S},{id:`file-pr-flows-rules`,path:`prFlows.rules`,title:`PR flows rules`,group:`lanes-team-review`,description:`Ordered rules for review items on your own pull requests; the first match acts with no click and lands in the Handled list, where Undo reopens it. Each matches on sources (source ids, <pack>/<id> for a pack source), authors (GitHub logins of review comment authors), priority, paths, text, scope and repos (owner/name; every repository when absent), and acts with ask, fix-local, dismiss or run:<action id>.`,jsonSchema:a(i(s)),example:[{name:`Generated files`,paths:[`dist/`],action:`dismiss`,reason:`Generated output; the source change is reviewed instead.`},{name:`Bot nits`,authors:[`review-bot[bot]`],priority:[`low`],repos:[`acme/app`],action:`run:ask-bot`}],control:`json`,keywords:[`pull requests`,`review items`,`dismiss`,`automation`],defaultValue:[],takesEffect:`now`,fileOnlyReason:`Rules are written in config.json; Save as rule in My PRs is the one dashboard writer, and it only appends.`,...S},{id:`file-pr-flows-repo-rules`,path:`prFlows.repoRules`,title:`PR flows repository rules`,group:`lanes-team-review`,description:`Deprecated: put repos on each rule in prFlows.rules instead. Rules per repository (owner/name to a list of rules), still checked before prFlows.rules for that repository.`,jsonSchema:a(r(n(),i(s))),example:{"acme/app":[{name:`Docs typos`,paths:[`docs/`],text:`typo`,action:`fix-local`}]},control:`json`,keywords:[`pull requests`,`review items`,`repositories`],defaultValue:{},takesEffect:`now`,fileOnlyReason:$n,...S},{id:`file-question-manager-rules`,path:`questionManager.rules`,title:`Question manager rules`,group:`lanes-question-manager`,description:`Rules the question manager answers from. An object with name, question (text the question contains) and pick (the exact option labels to choose) answers at once. A plain sentence is a rule a model applies when no object matches; it must cite one rule and pick exact option labels within 60 seconds, or the question comes to you. A question with a risk word such as push, delete or deploy always comes to you.`,jsonSchema:t(i(At),{io:`input`}),example:[{name:`README length`,question:`README`,pick:[`Short`]},`Prefer the existing library over adding a dependency.`],control:`json`,keywords:[`questions`,`rules`,`automation`],defaultValue:[],takesEffect:`now`,fileOnlyReason:$n,...S},{id:`file-question-manager-model`,path:`questionManager.model`,title:`Question manager model`,group:`lanes-question-manager`,description:`Claude model alias that applies the plain-language question manager rules.`,control:`text`,keywords:[`questions`,`rules`,`model`],defaultValue:u.questionManager,takesEffect:`now`,fileOnlyReason:T,...S}]),Cr=Object.freeze({"machine-terminal":{title:`Terminal`,description:`Terminal behavior shared by dashboard clients.`},"machine-detection-sessions":{title:`Detection and sessions`,description:`Config-file-only detection, timing, worktree and process settings.`}}),wr=Object.freeze([nr,rr,ar,or,sr,lr,cr,ur,fr,pr,mr,hr,gr,_r,vr,yr,br,dr,ir]),Tr=Object.freeze({sections:wr,fileOnly:Sr}),Er=`experimental`;function Dr(e){return e.keywords.includes(Er)}function Or(e){let t=e.settings[0];return t!==void 0&&Dr(t)}function kr(e,t){return t?e:e.flatMap(e=>{let t=e.settings.filter(e=>!Dr(e));return t.length===0&&e.settings.length>0?[]:[{...e,settings:t}]})}var Ar=Object.freeze(Object.fromEntries(wr.flatMap(e=>(e.legacyIds??[]).map(t=>[t,e.id])))),jr=Object.freeze(wr.reduce((e,t)=>{for(let n of t.settings)for(let r of n.legacyIds??[])e[r.sectionId]={...e[r.sectionId],[r.settingId]:t.id};return e},{}));function Mr(e){let t=[],n=e=>{if(!e||typeof e!=`object`)return e;let n=Array.isArray(e)?[]:{};return t.push([e,n]),n},r=n(e);for(let e=t.pop();e;e=t.pop()){let[t,r]=e;for(let[e,i]of Object.entries(t))Object.defineProperty(r,e,{value:n(i),writable:!0,enumerable:!0,configurable:!0})}return r}function Nr(e,t){let n=e;for(let e of t.split(`.`)){if(typeof n!=`object`||!n)return;n=n[e]}return n}function Pr(e,t){let n=t.split(`.`),r=e;for(let e of n.slice(0,-1)){if(!r||typeof r!=`object`)return;r=r[e]}r&&typeof r==`object`&&delete r[n.at(-1)]}function Fr(e,t,n){let r=t.split(`.`),i=e;for(let e of r.slice(0,-1))(!i[e]||typeof i[e]!=`object`||Array.isArray(i[e]))&&(i[e]={}),i=i[e];i[r.at(-1)]=Mr(n)}function O(e){return e.flatMap(e=>e.settings)}function Ir(e){return e.access===`file-only`||e.control===`readonly`}function Lr(e){let t=String(e??``).trim().toLowerCase();if(!t||t===`all`)return`all`;if(t===`none`)return[];let n=t.split(`,`).map(e=>e.trim());return n.every(e=>/^\d+$/.test(e)&&Number.isSafeInteger(Number(e))&&Number(e)>0)?n.map(Number):null}var Rr=6;function k(e,t){return e.control===`number`&&typeof t==`number`?t/(e.unit?.storedPerDisplay??1):e.valueKind===`posthog-projects`?Array.isArray(t)?t.length===0?[`none`]:t.map(String):[]:Mr(t)}function zr(e){return e.control===`number`&&(e.unit?.storedPerDisplay??1)!==1}function Br(e){return String(Number(e.toFixed(Rr)))}function Vr(e,t){let n=k(e,t);return e.valueKind===`posthog-projects`&&Array.isArray(n)?n.join(`, `)||`all`:typeof n==`number`&&e.unit?`${Br(n)} ${e.unit.label}`:JSON.stringify(n??null)}function A(e,t){if(e.control===`number`){if(e.nullable&&(t==null||String(t).trim()===``))return null;let n=Number(t);if(e.zeroIsNull&&n<=0)return null;let r=n*(e.unit?.storedPerDisplay??1);return e.integer===!1?r:Math.round(r)}if(e.valueKind===`posthog-projects`)return Lr(Array.isArray(t)?t.join(`,`):t);if(e.control===`text`||e.control===`password`){let n=String(t??``).trim();return e.nullable&&!n?null:n}return Mr(t)}function j(e){return String(e||``).toLowerCase().match(/[a-z0-9]+/g)||[]}var Hr=3,Ur=2,Wr=1,Gr=3,Kr=30,qr=16;function Jr(e,t){return e===t?Hr:e.startsWith(t)?Ur:t.length>=Gr&&e.includes(t)?Wr:0}function M(e,t,n){let r=0;for(let n of t){let t=Math.max(0,...e.map(e=>Jr(e,n)));if(t===0)return 0;r+=t}return r*n}function Yr(e){return e.options?.map(e=>e.label).join(`, `)??``}function Xr(e){return ii(e.group??``)?.title??``}function Zr(e,t,n){let r=M(j(e.title),n,1e3),i=M(j(e.keywords.join(` `)),n,100),a=M(t,n,10),o=M(j(e.path),n,10),s=M(j(Yr(e)),n,10),c=M(j(e.description),n,1);return r+i+a+o+s+c}function Qr(e){return e.section?.title??``}function $r(e,t){return Number(e.section===null)-Number(t.section===null)}function ei(e,t,n){return[[`title`,e.title],[`keywords`,e.keywords.join(` `)],[`section`,t?.title??Xr(e)],[`description`,e.description],[`path`,e.path],[`options`,Yr(e)]].flatMap(([e,t])=>{let r=[];for(let e of t.matchAll(/[a-z0-9]+/gi)){let t=e[0].toLowerCase();for(let i of n){if(Jr(t,i)===0)continue;let n=e.index+t.indexOf(i);r.push({start:n,end:n+i.length})}}let i=[];for(let e of r.sort((e,t)=>e.start-t.start||e.end-t.end)){let t=i.at(-1);t&&e.start<=t.end?t.end=Math.max(t.end,e.end):i.push({...e})}return i.length?[{field:e,text:t,spans:i}]:[]})}function ti(e,t,n=[]){let r=j(t).slice(0,qr);if(r.length===0)return[];let i=[];for(let t of e){let e=j(t.title);for(let n of t.settings){let a=Zr(n,e,r);a!==0&&i.push({section:t,setting:n,score:a,matches:ei(n,t,r)})}}for(let e of n){let t=Zr(e,j(Xr(e)),r);t!==0&&i.push({section:null,setting:e,score:t,matches:ei(e,null,r)})}return i.sort((e,t)=>t.score-e.score||$r(e,t)||Qr(e).localeCompare(Qr(t))||e.setting.title.localeCompare(t.setting.title)).slice(0,Kr)}function ni(e,t,n={},r={}){let i=/^#settings\/([^/]+)(?:\/([^/]+))?$/.exec(String(e||``));if(!i)return null;let a,o;try{a=decodeURIComponent(i[1]),o=i[2]?decodeURIComponent(i[2]):null}catch{return null}let s=n[a]||a,c=(o?r[s]?.[o]:void 0)||s,l=t.find(e=>e.id===c);if(!l)return null;let u=o?l.settings.find(e=>e.id===o||e.legacyIds?.some(e=>e.settingId===o&&e.sectionId===s)):null;return o&&!u?null:{sectionId:c,settingId:u?.id||null,hash:`#settings/${c}${u?`/${u.id}`:``}`}}function ri(e){let t=new Map,n=new Map;for(let r of[...O(e.sections),...e.fileOnly])t.set(r.id,r),n.set(r.path,r);return{byId:t,byPath:n}}ri(Tr);function ii(e,t=Tr){let n=t.sections.find(t=>t.id===e);return n?{title:n.title,description:n.description}:Cr[e]??null}var ai=new WeakMap,oi=`Configured`,si=`•`.repeat(12),ci=`Each line must be a positive whole-number PostHog project id, or the one word none.`,li=3,ui=new Set([`customAgents`]),di=1e-9,fi=`Lanes`,pi=Object.freeze({now:`Applies now`,"new-sessions":`New sessions`,restart:`After restart`}),mi=Object.freeze({browser:`This browser`,machine:`This machine`});function hi(e){let t=new Map;for(let n of e)t.set(n.scope,(t.get(n.scope)??0)+1);let n=null,r=0;for(let[e,i]of t)i<=r||(n=e,r=i);return n}function gi(e,t){let n=[];return e.scope!==t&&n.push({kind:`scope`,text:mi[e.scope]}),e.takesEffect!==`now`&&n.push({kind:`effect`,text:pi[e.takesEffect]}),n}function _i(e,t){let n=t.secretSources;if(!n||typeof n!=`object`)return null;let r=n[e.path];return typeof r==`string`?r:null}function vi(e){return e.control===`password`}function yi(e){return`${e.path}${oi}`}function bi(e,t){if(Object.is(e,t))return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((e,n)=>bi(e,t[n]));if(!e||!t||typeof e!=`object`||typeof t!=`object`)return!1;let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>Object.hasOwn(t,n)&&bi(e[n],t[n]))}function xi(e){return ai.get(e)||null}function Si(e){return Array.isArray(e)?e.map(e=>String(e)):[]}function Ci(e){return e.split(`
1
+ import{d as e}from"./control-ws-CPMlFaao.js";import{S as t,g as n,m as r,r as i}from"./zod-_N0uRWDY.js";import{An as a,B as o,Dn as s,En as c,F as l,Gt as u,H as ee,I as te,L as ne,O as re,On as ie,P as ae,Rt as oe,Tn as se,W as ce,Xt as le,a as ue,cn as de,o as fe,t as d,un as pe,z as me}from"./button-mkFeAYAx.js";import{A as he,B as ge,D as _e,E as ve,F as ye,G as be,H as xe,I as Se,K as Ce,L as we,M as Te,N as f,O as Ee,P as De,R as Oe,T as p,U as ke,V as Ae,W as je,b as Me,j as Ne,k as Pe,s as m,w as Fe,z as Ie}from"./dom-helpers-BFFApPgS.js";import{a as h}from"./modal-Dhk9uL5H.js";import{a as Le,c as Re,i as ze,s as Be,t as Ve}from"./action-status-DVzULV_M.js";import{E as He,F as Ue,H as We,I as Ge,L as Ke,M as qe,N as Je,P as Ye,Q as Xe,R as Ze,U as Qe,V as $e,a as et,b as tt,bt as nt,dt as rt,et as it,g as at,gt as ot,h as st,j as ct,l as lt,o as ut,pt as dt,w as ft,x as pt,y as mt,yt as ht}from"./ui-prefs-DDS1bMmm.js";import{M as gt}from"./session-actions-9ZhnsG51.js";import{t as _t}from"./agent-mark-CPPMGmer.js";import{A as vt,Aa as yt,B as bt,C as xt,D as St,Da as Ct,E as wt,Ea as Tt,F as Et,Gr as Dt,H as Ot,I as kt,Jr as At,L as jt,M as Mt,N as Nt,O as Pt,Oa as Ft,P as It,R as g,S as Lt,Sa as Rt,Sr as zt,T as Bt,Ta as Vt,Ur as Ht,V as Ut,W as Wt,Wr as Gt,_t as Kt,a as qt,ba as Jt,c as Yt,ca as Xt,ga as Zt,ha as Qt,i as $t,j as en,k as tn,ka as nn,l as rn,ma as an,n as on,o as sn,qt as cn,r as ln,s as un,t as dn,va as fn,vt as pn,w as mn,xa as hn,ya as gn,z as _}from"./index-B12zcEVW.js";import{loadCustomSounds as _n,playAlertSound as vn,resolveSoundId as yn,soundOptions as bn}from"./alert-sound-Da6VQFBS.js";import{agentLoginSummary as xn,openAgentConnectDialog as Sn,openRemoteSetupDialog as Cn}from"./dialogs-HOpRh5gr.js";import{r as wn,t as Tn}from"./flying-animal-preview-BcM0Sll8.js";import{t as En}from"./my-prs-panel-ChhHuCoo.js";import{n as Dn,r as On,t as kn}from"./team-review-settings-core-BHv0yl1m.js";import{n as An,t as jn}from"./nyan-cat-CVhgfmIv.js";function Mn(){let e=m(`div`),t=m(`p`,`flying-animals-status`);t.id=`flying-animals-gallery-status`,t.setAttribute(`role`,`status`);let n=m(`div`,`flying-animals-gallery`);n.setAttribute(`aria-label`,`Animal gallery`);let r=[],i=()=>{let e=jn(),n=rt(ut().flyingAnimalsExcludedSprites);t.textContent=[e,n?``:`No animals are included, so automatic flights are paused.`].filter(Boolean).join(` `);for(let t of r)t.disabled=e!==null},a=ut();for(let e of dt){let o=m(`article`,`flying-animal-tile`),s=Tn(e),c=m(`label`,`flying-animal-include`),l=m(`input`,`settings-view-checkbox`);l.type=`checkbox`,l.checked=!a.flyingAnimalsExcludedSprites.includes(e.sprite),l.setAttribute(`aria-label`,`Include ${e.name}`),l.addEventListener(`change`,()=>{let t=new Set(ut().flyingAnimalsExcludedSprites);l.checked&&t.delete(e.sprite),l.checked||t.add(e.sprite),qe([...t]),Xt(mt()),i()}),c.append(l,document.createTextNode(`Include`));let u=d({variant:`secondary`,label:`Fly now`});u.setAttribute(`aria-describedby`,t.id),u.addEventListener(`click`,()=>An(e.sprite)),r.push(u),o.append(s,m(`h2`,`flying-animal-name`,e.name),c,u),n.append(o)}return i(),e.append(t,n),e}var v={scope:`browser`,access:`editable`,takesEffect:`now`},y={scope:`browser`,access:`advanced`,takesEffect:`now`},b={scope:`machine`,access:`editable`,takesEffect:`now`},Nn={scope:`machine`,access:`editable`,takesEffect:`new-sessions`},x={scope:`machine`,access:`readout`,takesEffect:`now`},S={scope:`machine`,access:`file-only`},Pn=1e3,Fn=60,In=60,Ln=Pn*Fn,Rn=Ln*In,zn={label:`investigations`,storedPerDisplay:1},Bn={label:`sessions`,storedPerDisplay:1},Vn={label:`recurrences`,storedPerDisplay:1},Hn={label:`actions`,storedPerDisplay:1},C={label:`seconds`,storedPerDisplay:1},Un={label:`minutes`,storedPerDisplay:1},Wn={label:`hours`,storedPerDisplay:1},w={label:`days`,storedPerDisplay:1},Gn={label:`seconds`,storedPerDisplay:Pn,storedLabel:`ms`},Kn={label:`minutes`,storedPerDisplay:Ln,storedLabel:`ms`},qn={label:`minutes`,storedPerDisplay:Fn,storedLabel:`seconds`},Jn={label:`hours`,storedPerDisplay:Rn,storedLabel:`ms`},Yn={label:`hours`,storedPerDisplay:In,storedLabel:`minutes`},Xn={label:`USD`,storedPerDisplay:1},Zn={label:`users`,storedPerDisplay:1},Qn={label:`times`,storedPerDisplay:1},T=`A tuning knob kept out of the Settings view; the default suits almost every install.`,E=`A diagnostic switch kept out of the Settings view; change it in config.json while investigating.`,D=`Changes how the server process or its worktrees behave, so it is set in config.json with a restart or new sessions in mind.`,$n=`A structured value with no dashboard control; edit it in config.json.`,er=`Never editable from the dashboard by rule; edit it in config.json.`;function tr(e){return e.map(e=>({value:e,label:e[0].toUpperCase()+e.slice(1)}))}var nr={id:`browser-appearance`,level:`browser`,title:`Appearance`,description:`How this browser draws the dashboard.`,legacyIds:[`browser-flying-animals`,`animals`,`flying-animals`],settings:[{id:`theme`,path:`pref:themeId`,title:`Theme`,description:`Color scheme for the dashboard.`,control:`select`,optionsFrom:`themes`,keywords:[`color`,`palette`],defaultValue:`phyrexian`,...v},{id:`phone-arrow-pad`,path:`pref:phoneArrowPad`,title:`Swipe arrow pad on phone`,description:`Swap the phone arrow keys for one pad you swipe on.`,control:`toggle`,keywords:[`experimental`,`mobile`,`keys`,`arrows`,`swipe`,`gesture`],defaultValue:!1,...v},{id:`flying-animals`,path:`pref:flyingAnimalsEnabled`,title:`Flying animals`,description:`Show animated animals flying across the dashboard.`,control:`toggle`,keywords:[`animation`,`motion`,`animals`],defaultValue:!1,...v},{id:`animals-min-gap`,path:`pref:flyingAnimalsMinGapSeconds`,title:`Time between flights: minimum`,description:`Shortest pause between flights.`,control:`number`,integer:!1,step:.1,range:_e,unit:C,maximumSettingId:`animals-max-gap`,keywords:[`animals`,`frequency`],defaultValue:p.flyingAnimalsMinGapSeconds,...y},{id:`animals-max-gap`,path:`pref:flyingAnimalsMaxGapSeconds`,title:`Time between flights: maximum`,description:`Longest pause between flights.`,control:`number`,integer:!1,step:.1,range:_e,unit:C,keywords:[`animals`,`frequency`],defaultValue:p.flyingAnimalsMaxGapSeconds,...y},{id:`animals-min-duration`,path:`pref:flyingAnimalsMinDurationSeconds`,title:`Flight duration: minimum`,description:`Shortest flight, for faster animals.`,control:`number`,integer:!1,step:.1,range:ve,unit:C,maximumSettingId:`animals-max-duration`,keywords:[`animals`,`speed`],defaultValue:p.flyingAnimalsMinDurationSeconds,...y},{id:`animals-max-duration`,path:`pref:flyingAnimalsMaxDurationSeconds`,title:`Flight duration: maximum`,description:`Longest flight, for slower animals.`,control:`number`,integer:!1,step:.1,range:ve,unit:C,keywords:[`animals`,`speed`],defaultValue:p.flyingAnimalsMaxDurationSeconds,...y},{id:`animals-scale`,path:`pref:flyingAnimalsScale`,title:`Size multiplier`,description:`Scale applied on top of the viewport size.`,control:`number`,integer:!1,step:.1,range:Ee,unit:Qn,keywords:[`animals`,`size`],defaultValue:p.flyingAnimalsScale,...y},{id:`animals-on-phone`,path:`pref:flyingAnimalsOnPhone`,title:`Show on phone layout`,description:`Allow flights on the phone layout.`,control:`toggle`,keywords:[`animals`,`mobile`],defaultValue:p.flyingAnimalsOnPhone,...y}]},rr={id:`browser-notifications`,level:`browser`,title:`Notifications`,description:`How sessions get your attention.`,settings:[{id:`alert-sounds-enabled`,path:`pref:soundEnabled`,title:`Alert sounds`,legacyIds:[{sectionId:`browser-appearance`,settingId:`alert-sounds-enabled`}],description:`Play a sound when a session needs you, like the note button in the header.`,control:`toggle`,keywords:[`audio`,`mute`,`sound`,`notification`],defaultValue:!0,...v},{id:`alert-sound`,path:`pref:soundId`,title:`Alert sound`,legacyIds:[{sectionId:`browser-appearance`,settingId:`alert-sound`}],description:`Sound played when a session needs you, including files you add to ~/.glimmervoid/sounds/.`,control:`select`,optionsFrom:`sounds`,keywords:[`audio`,`notification`,`custom`],defaultValue:`chime`,...v},{id:`desktop-notifications`,path:`pref:notificationsEnabled`,title:`Desktop notifications`,legacyIds:[{sectionId:`browser-appearance`,settingId:`desktop-notifications`}],description:`Notify you when a session needs you and the dashboard is in the background.`,control:`toggle`,keywords:[`browser`,`attention`],defaultValue:!0,...v}]},ir={id:`browser-shortcuts`,level:`browser`,title:`Shortcuts`,description:`Keyboard shortcuts.`,legacyIds:[`shortcuts`],settings:[{id:`next-attention-key`,path:`pref:nextAttentionKeyCode`,title:`Jump to the next session needing you`,description:`Key held with Cmd on a Mac, or Alt elsewhere, to jump to the next session that needs you.`,control:`shortcut-key`,keywords:[`shortcut`,`keyboard`,`hotkey`,`jump`,`next`,`attention`],defaultValue:`KeyJ`,...v}]},ar={id:`machine-telegram`,level:`machine`,parent:`browser-notifications`,title:`Telegram`,description:`One bot for session, review and PostHog alerts.`,legacyIds:[`telegram`,`notifications`],settings:[{id:`telegram-bot-token`,path:`telegram.botToken`,title:`Bot token`,description:`Token from @BotFather in Telegram (send /newbot).`,control:`password`,keywords:[`credential`,`api`],defaultValue:``,...b},{id:`telegram-chat-id`,path:`telegram.chatId`,title:`Chat id`,description:`Chat the bot posts to, read as message.chat.id from its getUpdates page after you message it.`,control:`text`,keywords:[`destination`,`channel`],defaultValue:``,...b},{id:`telegram-session-notifications`,path:`telegramNotifications`,title:`Send session notifications`,description:`Alert in Telegram when no dashboard is open, or when an alert sits unacknowledged.`,control:`toggle`,keywords:[`phone`,`off dashboard`,`test`],defaultValue:!1,status:`telegram-delivery`,...b}]},or={id:`machine-sessions`,level:`machine`,title:`Sessions`,description:`How sessions start, where projects are found, and branch cleanup.`,legacyIds:[`machine-general`,`general`,`machine-repositories`,`repos`,`repositories`],settings:[{id:`auto-resume`,path:`autoResume`,title:`Auto-resume sessions on startup`,description:`Resume sessions that were live when Glimmervoid last stopped or crashed.`,control:`toggle`,keywords:[`startup`,`conversation`],defaultValue:!0,...b},{id:`tab-order`,path:`viewTabOrder`,title:`Tab order`,description:`Order of the dashboard tabs, also set by dragging tabs in the header.`,control:`tab-order`,keywords:[`tabs`,`order`,`rearrange`,`reorder`,`header`,`more`,`menu`],defaultValue:[],...b},{id:`remote-sessions`,path:`remoteSessions`,title:`Remote Coder sessions`,description:`Offer Coder workspaces when adding a session.`,control:`toggle`,keywords:[`experimental`,`coder`,`remote`,`workspace`,`cloud`],defaultValue:!1,...b},{id:`streamer-mode`,path:`streamerMode`,title:`Streamer mode`,description:`Hide sensitive details while screen sharing.`,control:`toggle`,keywords:[`streaming`,`screen share`,`privacy`],defaultValue:!1,...b},{id:`link-previews`,path:`linkPreviews`,title:`Link page previews`,description:`Resting the pointer on a terminal link for about 600 ms fetches that page from this machine to show its title and icon. Off, the link card shows the address only.`,control:`toggle`,keywords:[`links`,`preview`,`title`,`favicon`,`hover`,`privacy`],defaultValue:!0,...b},{id:`hint-cards`,path:`hintCards`,title:`Hint cards`,description:`Show tip cards: Your day tips and feature suggestions.`,control:`toggle`,keywords:[`experimental`,`hints`,`tips`,`your day`],defaultValue:!1,...b},{id:`repository-roots`,path:`repoRoots`,title:`Repository roots`,description:`Folders scanned for projects when adding a session.`,control:`list`,keywords:[`folders`,`project discovery`],defaultValue:[],listPlaceholder:`Repository root path`,listEmptyText:`No repository roots configured.`,...b},{id:`hidden-agents`,path:`hiddenAgents`,title:`Agents in Add Session`,description:`Agents left out of the Add Session picker. Switch an agent off here to hide it; the default agent always stays.`,control:`agent-visibility`,keywords:[`agents`,`picker`,`hide`,`show`,`add session`,`gemini`,`qwen`,`copilot`,`opencode`,`goose`,`cursor`],defaultValue:[],...b},{id:`custom-agents`,path:`status:custom-agents`,title:`Custom agents`,description:`Extra agent CLIs a session can run.`,control:`readonly`,keywords:[`adapters`,`cli`],status:`custom-agents`,...x},{id:`agent-logins`,path:`status:agent-logins`,title:`Agent logins`,description:`How Claude Code and Codex sign in inside a Coder workspace.`,control:`readonly`,keywords:[`claude`,`codex`,`sign in`,`login`,`coder`,`remote`],status:`agent-logins`,...x},{id:`remote-setup`,path:`status:remote-setup`,title:`Remote host setup`,description:`Start a session that helps you run Glimmervoid on another Linux machine over ssh.`,control:`readonly`,keywords:[`remote`,`ssh`,`server`,`devbox`,`tailscale`,`pair`,`host`],status:`remote-setup`,...x},{id:`branch-gc-delete-unmerged`,path:`branchGc.deleteUnmerged`,title:`Delete unmerged branches`,description:`Also delete stale remote branches with no proof they were merged.`,control:`toggle`,keywords:[`git`,`cleanup`,`orphan`],danger:!0,warning:`Enabling this control lets branch cleanup delete stale remote branches without merge proof.`,legacyIds:[{sectionId:`machine-safety`,settingId:`branch-gc-delete-unmerged`}],defaultValue:!1,...b}]},sr={id:`machine-safety`,level:`machine`,title:`Sane YOLO`,description:`What agents may do without asking, and what Sane YOLO blocks.`,legacyIds:[`machine-guardrails`,`lanes-unattended`,`unattended`],settings:[{id:`skip-permissions-by-default`,path:`skipPermissionsByDefault`,title:`Skip permission prompts by default`,description:`Skip agent permission prompts for projects that set no choice.`,control:`toggle`,keywords:[`permissions`,`yolo`,`dangerously`],danger:!0,warning:`Enabling this control lets agents edit files and run shell commands without asking, and restarts running sessions that inherit it.`,defaultValue:!1,...b},{id:`sane-yolo`,path:`saneYolo`,title:`Sane YOLO`,description:`Block catastrophic commands and credential reads in every session that supports it.`,control:`toggle`,keywords:[`permissions`,`yolo`,`safety`],defaultValue:!0,...Nn},{id:`sane-yolo-unreadable-paths`,path:`saneYoloUnreadablePaths`,title:`Unreadable folders`,description:`Extra files and folders agents may not read, where ~ is your home folder.`,control:`list`,keywords:[`guardrails`,`secrets`,`credentials`,`sane yolo`],defaultValue:[],listPlaceholder:`~/folder`,listEmptyText:`Only the built-in credential list is unreadable.`,...Nn}]},cr={id:`machine-server`,level:`machine`,title:`Server`,description:`Restart or shut down the Glimmervoid server.`,settings:[{id:`server-power`,path:`status:server-power`,title:`Restart or shut down`,description:`Ends every running session first.`,control:`readonly`,keywords:[`power`,`restart`,`shutdown`,`stop`,`quit`,`reboot`,`server`],status:`server-power`,...x}]},lr={id:`machine-updates`,level:`machine`,title:`Updates`,description:`Which version is running, and updating to the newest.`,legacyIds:[`updates`],settings:[{id:`update-actions`,path:`status:update-actions`,title:`Status and actions`,legacyIds:[`update-summary`,`update-installed`,`update-latest`,`update-last-checked`].map(e=>({sectionId:`machine-updates`,settingId:e})),description:`Running and newest versions, with update and restart.`,control:`readonly`,keywords:[`version`,`available`,`current`,`check`,`restart`,`commit`,`installed`,`release`,`failure`],status:`update-actions`,...x},{id:`update-channel`,path:`updateChannel`,title:`Channel`,description:`Stable releases, or Experimental builds from every change to main.`,control:`select`,options:tr(pe),keywords:[`release`,`prerelease`,`next`,`beta`,`early`],defaultValue:`release`,...b},{id:`check-updates`,path:`checkForUpdates`,title:`Check for updates automatically`,description:`Check for a newer version at launch and while the dashboard is open.`,control:`toggle`,keywords:[`release`,`github`],defaultValue:!0,...b}]},ur={id:`machine-usage`,level:`machine`,title:`Usage`,description:`Token accounting and estimated-cost budgets.`,legacyIds:[`usage`],settings:[{id:`usage-enabled`,path:`usage.enabled`,title:`Track token usage`,description:`Read local agent transcripts for the Usage tab and session cards.`,control:`toggle`,keywords:[`tokens`,`cost`],defaultValue:!0,status:`usage-last-report`,...b},{id:`usage-your-day`,path:`usage.yourDay`,title:`Your day`,description:`Recap yesterday and suggest a pace for today when usage tracking is on.`,control:`toggle`,keywords:[`burnout`,`breaks`,`pace`,`wellbeing`],defaultValue:!0,...b},{id:`usage-retain-days`,path:`usage.retainDays`,title:`Retain transcript detail`,description:`How long detailed usage is kept.`,control:`number`,range:ke,unit:w,keywords:[`history`,`retention`],defaultValue:90,...b},{id:`usage-daily-budget`,path:`usage.budget.dailyUsd`,title:`Daily budget`,description:`Alert at 50%, 75% and 100% of this estimated daily spend, or never at zero.`,control:`number`,range:Ae,unit:Xn,keywords:[`spend`,`alert`],defaultValue:null,integer:!1,nullable:!0,zeroIsNull:!0,step:.01,...b},{id:`usage-monthly-budget`,path:`usage.budget.monthlyUsd`,title:`Monthly budget`,description:`Alert at 50%, 75% and 100% of this estimated monthly spend, or never at zero.`,control:`number`,range:Ae,unit:Xn,keywords:[`spend`,`alert`],defaultValue:null,integer:!1,nullable:!0,zeroIsNull:!0,step:.01,...b}]},dr={id:`machine-privacy`,level:`machine`,title:`Privacy`,description:`What Glimmervoid sends about itself.`,legacyIds:[`privacy`,`telemetry`],settings:[{id:`telemetry-enabled`,path:`telemetry.enabled`,title:`Send usage data`,description:`Helps us improve Glimmervoid. Sent under a random install id: version, platform, app starts, daily activity, session starts and ends with agent kind, exit kind and duration, errors as their type, error code and scrubbed stack frames, per session token counts, models and estimated costs from the usage scan, and a salted one-way hash of your Claude and Codex account ids so installs of one account count together. The text of errors the dashboard shows in its header line, with your home folder shown as ~, which can name a session, folder or branch. Otherwise never prompts, project information, other error messages, paths, repository or branch names, objectives, terminal output, emails or names. Delete my data asks for everything sent under this install to be erased and starts a new install id. GLIMMERVOID_TELEMETRY=0, DO_NOT_TRACK=1 or CI=true turn it off regardless.`,control:`toggle`,keywords:[`telemetry`,`analytics`,`tracking`,`opt out`],defaultValue:!0,...b}]},fr={id:`lanes-posthog`,level:`lanes`,title:`PostHog`,description:`Error monitoring, investigations and traffic-spike alerts.`,legacyIds:[`lanes`,`posthog`],settings:[{id:`posthog-enabled`,path:`posthog.enabled`,title:`Enable PostHog monitoring`,description:`Watch PostHog error tracking and investigate issues that move.`,control:`toggle`,keywords:[`errors`,`monitoring`],defaultValue:!1,...b},{id:`posthog-host`,path:`posthog.host`,title:`Host`,description:`PostHog cloud or self-hosted URL.`,control:`text`,keywords:[`url`,`server`],defaultValue:`https://us.posthog.com`,...b},{id:`posthog-api-key`,path:`posthog.apiKey`,title:`Personal API key`,description:`Personal API key with read access to your projects.`,control:`password`,keywords:[`credential`,`token`],defaultValue:``,...b},{id:`posthog-projects`,path:`posthog.projects`,title:`Projects`,description:`Project ids to watch, where empty watches all and none watches none.`,control:`list`,keywords:[`project ids`,`filter`],defaultValue:`all`,valueKind:`posthog-projects`,listPlaceholder:`Project id`,listEmptyText:`Every project the key can read.`,...b},{id:`posthog-interval`,path:`posthog.intervalMinutes`,title:`Poll interval`,description:`Time between PostHog checks.`,control:`number`,integer:!1,step:`any`,range:f,unit:Un,keywords:[`refresh`,`schedule`],defaultValue:15,...b},{id:`posthog-max-investigations`,path:`posthog.maxConcurrentInvestigations`,title:`Max concurrent investigations`,description:`Most investigations running at once.`,control:`number`,range:f,unit:zn,keywords:[`parallel`,`workers`],defaultValue:2,...b},{id:`posthog-min-users`,path:`posthog.minUsersToInvestigate`,title:`Min users to investigate`,description:`Fewest affected users before a new issue is investigated.`,control:`number`,range:f,unit:Zn,keywords:[`threshold`,`affected`],defaultValue:1,...b},{id:`posthog-traffic-enabled`,path:`posthog.trafficSpikeEnabled`,title:`Traffic spike alerts`,description:`Alert when unique users jump above normal.`,control:`toggle`,keywords:[`analytics`,`alert`],defaultValue:!0,...b},{id:`posthog-auto-fix`,path:`posthog.autoFix`,title:`Attempt fixes for major issues`,description:`Let an agent fix an issue on a local branch, opening a pull request only after you approve.`,control:`toggle`,keywords:[`automatic`,`pull request`],danger:!0,warning:`Enabling this control lets an agent that read PostHog error data edit code onto a local branch; nothing is pushed until you approve it.`,defaultValue:!1,...b}]},pr={id:`lanes-github-access`,level:`lanes`,title:`Lane GitHub access`,description:`What background lanes may read on GitHub and the web.`,settings:[{id:`github-read-token`,path:`github.readToken`,title:`GitHub read token`,description:`Read-only fine-grained GitHub token lanes use for gh. Team review and community research need it.`,control:`password`,keywords:[`credential`,`token`,`gh`,`pull requests`],defaultValue:``,...b},{id:`lanes-fetch-domains`,path:`lanes.fetchDomains`,title:`Extra fetch domains`,description:`Domains lanes may fetch pages from, beyond GitHub and posthog.com.`,control:`list`,keywords:[`web`,`fetch`,`domains`,`allowlist`],defaultValue:[],listPlaceholder:`docs.example.com`,listEmptyText:`Only the built-in domains.`,...b}]},mr={id:`lanes-team-review`,level:`lanes`,title:`Team review`,description:`Draft reviews of teammates' pull requests for you to post.`,legacyIds:[`team-review`,`reviews`],settings:[{id:`team-review-enabled`,path:`teamReview.enabled`,title:`Enable team review`,description:`Draft a review of each open team pull request, posting nothing until you approve or comment.`,control:`toggle`,keywords:[`pull requests`,`github`],defaultValue:!0,...b},{id:`github-teams`,path:`github.teams`,title:`GitHub teams`,description:`GitHub teams whose review requests are drafted, as org/team-slug.`,control:`list`,keywords:[`github`,`teams`,`review requests`],defaultValue:[],listPlaceholder:`org/team-slug`,listEmptyText:`No GitHub teams configured.`,...b},{id:`team-review-org`,path:`teamReview.org`,title:`GitHub organization`,description:`Organization whose pull requests that request your review directly are drafted. Needed only when no GitHub team is set.`,control:`text`,keywords:[`github`,`organization`,`org`,`review requests`],defaultValue:``,...b},{id:`team-review-re-review-after-hours`,path:`teamReview.reReviewAfterHours`,title:`Re-review after`,description:`Review a pull request again after a new push, once this much time has passed.`,control:`number`,range:f,unit:Wn,keywords:[`review`,`delay`],defaultValue:24,integer:!1,step:.5,...b},{id:`team-review-skip-idle-after-days`,path:`teamReview.skipIdleAfterDays`,title:`Skip PRs idle for`,description:`Skip pull requests with no activity for this long.`,control:`number`,range:f,unit:w,keywords:[`idle`,`activity`],defaultValue:14,integer:!1,step:.5,...b},{id:`team-review-skill`,path:`teamReview.skill`,title:`Review skill`,description:`Skill Claude Code follows for each review, or none when empty.`,control:`text`,keywords:[`skill`,`claude code`,`pr review`],defaultValue:``,suggestionsFrom:`review-skills`,...b},{id:`team-review-reviewer-model`,path:`teamReview.reviewer.model`,title:`Review model`,description:`Model for reviews, or the agent's default when empty.`,control:`text`,keywords:[`model`,`reviewer`],defaultValue:``,suggestionsFrom:`review-models`,...b},{id:`team-review-reviewer-effort`,path:`teamReview.reviewer.effort`,title:`Review effort`,description:`Effort for reviews, or the agent's default when empty.`,control:`text`,keywords:[`effort`,`thinking`,`reasoning`,`reviewer`],defaultValue:``,suggestionsFrom:`review-efforts`,...b},{id:`team-review-stamp-reviewer-model`,path:`teamReview.stampReviewer.model`,title:`Docs and tests PR model`,description:`Model for pull requests that only touch docs and tests.`,control:`text`,keywords:[`stamp`,`model`,`small pull requests`,`docs`,`tests`],defaultValue:``,suggestionsFrom:`review-stamp-models`,...b},{id:`team-review-stamp-reviewer-effort`,path:`teamReview.stampReviewer.effort`,title:`Docs and tests PR effort`,description:`Effort for pull requests that only touch docs and tests.`,control:`text`,keywords:[`stamp`,`effort`,`small pull requests`,`docs`,`tests`],defaultValue:``,suggestionsFrom:`review-stamp-efforts`,...b},{id:`team-review-sandbox-load-mcp-servers`,path:`teamReview.sandbox.loadMcpServers`,title:`Load my MCP servers`,description:`Give the review agent your own MCP servers.`,control:`toggle`,keywords:[`mcp`,`servers`,`tools`],danger:!0,warning:`Enabling this control gives the review agent, which reads untrusted pull request text, every tool your MCP servers expose.`,defaultValue:!1,...b},{id:`team-review-auto-rebase-my-prs`,path:`teamReview.autoRebaseMyPrs`,title:`Keep my pull requests rebased`,description:`Rebase your open pull requests when they fall behind their base branch.`,control:`toggle`,keywords:[`rebase`,`update branch`,`behind`,`my prs`],danger:!0,warning:`Enabling this control rewrites your pull request branches on GitHub. Pull before you push from a local checkout of one.`,defaultValue:!1,...b},{id:`team-review-keep-mergeable-enabled`,path:`teamReview.keepMergeableEnabled`,title:`Keep mergeable`,description:`Offer Keep mergeable: an agent fixes conflicts and failing checks on your pull requests.`,control:`toggle`,keywords:[`repair`,`conflicts`,`my prs`],defaultValue:!0,...b},{id:`team-review-keep-mergeable-timeout`,path:`teamReview.keepMergeableTimeoutMinutes`,title:`Keep mergeable deadline`,description:`Longest a Keep mergeable repair may run.`,control:`number`,range:Pe,unit:Un,keywords:[`timeout`,`repair`],defaultValue:30,...b},{id:`team-review-merge-queue-enabled`,path:`teamReview.mergeQueueEnabled`,title:`Merge when ready`,description:`Offer Merge when ready: queued pull requests merge once they pass.`,control:`toggle`,keywords:[`merge queue`,`auto merge`,`my prs`],defaultValue:!0,...b}]},hr={id:`lanes-workflows`,level:`lanes`,title:`Workflows`,description:`Rules that act on pull request events.`,legacyIds:[`workflows`],settings:[{id:`workflows-enabled`,path:`workflows.enabled`,title:`Run workflows`,description:`Watch the repositories your rules name and run their actions.`,control:`toggle`,keywords:[`pull requests`,`automation`,`master switch`],defaultValue:!0,...b},{id:`workflows-max-concurrent-sessions`,path:`workflows.maxConcurrentSessions`,title:`Concurrent agent sessions`,description:`Most workflow sessions running at once.`,control:`number`,range:Ce,unit:Bn,keywords:[`parallel`,`spawn`],defaultValue:2,...b},{id:`workflows-rules`,path:`status:workflow-rules`,title:`Workflow rules`,description:`Turn each workflow rule on or off.`,control:`readonly`,keywords:[`pull requests`,`automation`,`github`,`rules`],status:`workflows`,...x}]},gr={id:`lanes-benchmarks`,level:`lanes`,title:`Benchmarks`,description:`Compare agent setups on frozen benchmark cases.`,legacyIds:[`benchmarks`],settings:[{id:`benchmarks-enabled`,path:`benchmarks.enabled`,title:`Enable benchmarks`,description:`Show the Bench tab, where nothing runs until you start it.`,control:`toggle`,keywords:[`eval`,`arms`,`recall`,`compare`],defaultValue:!1,...b}]},_r={id:`lanes-coherence`,level:`lanes`,title:`Coherence`,description:`Coherence hook status and decision journal per session.`,settings:[{id:`coherence-enabled`,path:`coherence.enabled`,title:`Show session Coherence`,description:`Show the Coherence hook status and decisions of each session in a repository with a coherence.config.json (needs @posthog/coherence 1.8 or newer).`,control:`toggle`,keywords:[`experimental`,`coherence`,`journal`,`decisions`],defaultValue:!0,...b}]},vr={id:`lanes-issues`,level:`lanes`,title:`Issues`,description:`GitHub issues from your projects and teams.`,settings:[{id:`issues-enabled`,path:`issues.enabled`,title:`Show the Issues tab`,description:`Show an Issues tab listing GitHub issues for your projects and teams.`,control:`toggle`,keywords:[`experimental`,`issues`,`github`,`tab`],defaultValue:!1,...b}]},yr={id:`lanes-community`,level:`lanes`,title:`Community`,description:`Research new posthog.com community questions and draft replies.`,settings:[{id:`community-enabled`,path:`community.enabled`,title:`Show the Community tab`,description:`Research new community questions and draft a reply for each.`,control:`toggle`,keywords:[`experimental`,`community`,`questions`,`forum`,`tab`],defaultValue:!1,...b},{id:`community-skill`,path:`community.skill`,title:`Research skill`,description:`Skill the research agent follows, or none when empty.`,control:`text`,keywords:[`skill`,`answering`,`claude code`],defaultValue:``,...b},{id:`community-project-id`,path:`community.projectId`,title:`PostHog project`,description:`PostHog project holding the community forum and Discord data.`,control:`number`,integer:!0,range:ye,unit:{label:`project id`,storedPerDisplay:1},keywords:[`project id`,`warehouse`],defaultValue:2,...b},{id:`community-interval`,path:`community.intervalMinutes`,title:`Poll interval`,description:`Time between community checks.`,control:`number`,integer:!0,range:Fe,unit:Un,keywords:[`refresh`,`schedule`],defaultValue:30,...b},{id:`community-discord-channels`,path:`community.discordChannels`,title:`Discord channels`,description:`Discord channels to watch for questions, without the #, or none to skip Discord.`,control:`list`,keywords:[`discord`,`channels`,`allowlist`],defaultValue:[],...b}]},br={id:`lanes-question-manager`,level:`lanes`,title:`Question manager`,description:`Answer a session question from your rules and pass every other question to you.`,settings:[{id:`question-manager-enabled`,path:`questionManager.enabled`,title:`Answer questions from rules`,description:`Default for every repository. Questions with a risk word or no matching rule still come to you.`,control:`toggle`,keywords:[`experimental`,`questions`,`rules`,`automation`,`answer`],defaultValue:!1,...b},{id:`question-manager-repos`,path:`questionManager.repos`,title:`Exceptions`,description:`Repositories, by path or owner/name, that do the opposite of the default.`,control:`list`,keywords:[`experimental`,`repositories`,`projects`,`per project`],defaultValue:[],listPlaceholder:`Path or owner/name`,listEmptyText:`Every repository follows the default.`,...b}]},xr=Object.freeze([`auto`,`calculate`,`display`]);Object.freeze([`codex`,`grok`,`kimi`]),Object.freeze([`dailyUsd`,`monthlyUsd`]);var Sr=Object.freeze([{id:`file-debug-mode`,path:`debugMode`,title:`Debug mode`,group:`machine-sessions`,description:`Show session-card diagnostics for state, transitions and detection signals.`,control:`toggle`,keywords:[`diagnostics`,`state`],defaultValue:!1,takesEffect:`now`,fileOnlyReason:E,...S},{id:`file-replay-buffer`,path:`replayBufferKB`,title:`Replay buffer`,group:`machine-terminal`,description:`PTY output retained for clients that reconnect or join late.`,control:`number`,range:Ie,unit:{label:`KB`,storedPerDisplay:1},keywords:[`history`,`backfill`],defaultValue:512,takesEffect:`new-sessions`,fileOnlyReason:T,...S},{id:`file-session-memory-reserve`,path:`sessionMemoryReserveMB`,title:`Session memory reserve`,group:`machine-sessions`,description:`Free memory an automatic session start waits for; 0 starts sessions without checking.`,control:`number`,range:he,unit:{label:`MB`,storedPerDisplay:1},keywords:[`memory`,`headroom`],defaultValue:600,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-cursor-blink`,path:`cursorBlink`,title:`Cursor blink`,group:`machine-terminal`,description:`Blink the cursor in every terminal.`,control:`toggle`,keywords:[`caret`,`terminal`],defaultValue:!1,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-detect-background-agents`,path:`detectBackgroundAgents`,title:`Detect background agents`,group:`machine-detection-sessions`,description:`Hold completion while tracked background work is active.`,control:`toggle`,keywords:[`subagents`,`completion`],defaultValue:!0,takesEffect:`new-sessions`,fileOnlyReason:E,...S},{id:`file-record-signals`,path:`recordSignals`,title:`Record structural signals`,group:`machine-detection-sessions`,description:`Keep forensic status and hook recordings for each session. Full capture (capture.enabled) records these signals even when this is off.`,control:`toggle`,keywords:[`recordings`,`diagnostics`],defaultValue:!0,takesEffect:`new-sessions`,fileOnlyReason:E,...S},{id:`file-trace-enabled`,path:`trace.enabled`,title:`Capture session traces`,group:`machine-detection-sessions`,description:`Keep normalized Claude transcript traces for session debugging.`,control:`toggle`,keywords:[`transcripts`,`diagnostics`],defaultValue:!0,takesEffect:`restart`,fileOnlyReason:E,...S},{id:`file-detect-scheduled-wakeups`,path:`detectScheduledWakeups`,title:`Detect scheduled wakeups`,group:`machine-detection-sessions`,description:`Surface advisory wakeup timing for scheduled sessions.`,control:`toggle`,keywords:[`schedule`,`sleep`],defaultValue:!0,takesEffect:`restart`,fileOnlyReason:E,...S},{id:`file-worktree-auto-rebase`,path:`worktreeAutoRebase`,title:`Worktree auto-rebase`,group:`machine-detection-sessions`,description:`Rebase eligible session worktrees when the integration branch moves.`,control:`toggle`,keywords:[`git`,`branch`],defaultValue:!0,takesEffect:`new-sessions`,fileOnlyReason:D,...S},{id:`file-worktree-sync-on-start`,path:`worktreeSyncOnStart`,title:`Worktree sync on start`,group:`machine-detection-sessions`,description:`Fetch origin and fast-forward the local integration branch before a session starts its worktree.`,control:`toggle`,keywords:[`git`,`fetch`,`fast-forward`],defaultValue:!0,takesEffect:`new-sessions`,fileOnlyReason:D,...S},{id:`file-worktree-clone-dependencies`,path:`worktreeCloneDependencies`,title:`Worktree dependencies`,group:`machine-detection-sessions`,description:`Give a session worktree its node_modules before the agent starts: on macOS, clone the main checkout's when it matches the worktree's lockfile, then, except on Windows, install each folder still without one from its package-lock.json or pnpm-lock.yaml, with no package scripts.`,control:`toggle`,keywords:[`node_modules`,`npm`,`pnpm`,`install`],defaultValue:!0,takesEffect:`new-sessions`,fileOnlyReason:D,...S},{id:`file-worktree-rerere`,path:`worktreeRerere`,title:`Worktree rerere`,group:`machine-detection-sessions`,description:`Reuse recorded Git conflict resolutions.`,control:`toggle`,keywords:[`git`,`conflicts`],defaultValue:!0,takesEffect:`restart`,fileOnlyReason:D,...S},{id:`file-share-commit-provenance`,path:`shareCommitProvenance`,title:`Share commit provenance`,group:`machine-detection-sessions`,description:`After Merge pushes the base branch, also push the git notes that let glimmervoid why name the agent and session of a commit on any clone. The notes hold a hashed session id and the agent name, never a task or prompt. Off keeps them on this machine.`,control:`toggle`,keywords:[`git`,`notes`,`why`,`privacy`],defaultValue:!0,takesEffect:`now`,fileOnlyReason:D,...S},{id:`file-integration-branch`,path:`integrationBranch`,title:`Integration branch`,group:`machine-detection-sessions`,description:`Base branch for session worktrees. Empty = each repo's default branch. Existing sessions are never retargeted.`,control:`text`,nullable:!0,keywords:[`git`,`merge`],defaultValue:null,takesEffect:`new-sessions`,fileOnlyReason:D,...S},{id:`file-worktree-root`,path:`worktreeRoot`,title:`Worktree root`,group:`machine-detection-sessions`,description:`Directory that contains session worktrees. Existing worktrees are never relocated.`,control:`text`,keywords:[`git`,`directory`],defaultValue:``,takesEffect:`new-sessions`,fileOnlyReason:D,...S},{id:`file-worktree-share`,path:`worktreeShare`,title:`Shared worktree paths`,group:`machine-detection-sessions`,description:`Local paths copied or linked during worktree preparation. A * matches names at the project root, never one containing production; name such a file in full to share it.`,control:`list`,keywords:[`files`,`context`,`env`],defaultValue:[`.env*`,`.claude`],takesEffect:`new-sessions`,fileOnlyReason:er,...S},{id:`file-port`,path:`port`,title:`Local port`,group:`machine-detection-sessions`,description:`Port used by the local dashboard listener.`,control:`number`,range:Te,unit:{label:`port`,storedPerDisplay:1},keywords:[`server`,`listener`],defaultValue:3e3,takesEffect:`restart`,fileOnlyReason:er,...S},{id:`file-notify-debounce-ms`,path:`notifyDebounceMs`,title:`Notification grouping window`,group:`machine-detection-sessions`,description:`Alerts from any session within this long of the first one fold into one sound, one desktop notification and one Telegram message.`,control:`number`,integer:!1,step:`any`,range:f,unit:Gn,keywords:[`timer`,`alerts`],defaultValue:3e3,takesEffect:`new-sessions`,fileOnlyReason:T,...S},{id:`file-phone-escalation-ms`,path:`phoneEscalationMs`,title:`Phone escalation delay`,group:`machine-detection-sessions`,description:`Delay before off-dashboard escalation.`,control:`number`,integer:!1,step:`any`,range:f,unit:Kn,keywords:[`timer`,`telegram`],defaultValue:3e5,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-branch-gc-enabled`,path:`branchGc.enabled`,title:`Branch cleanup`,group:`machine-detection-sessions`,description:`Enable cleanup of eligible session branches.`,control:`toggle`,keywords:[`git`,`cleanup`],defaultValue:!0,takesEffect:`now`,fileOnlyReason:D,...S},{id:`file-branch-gc-worktrees`,path:`branchGc.worktrees`,title:`Local worktree cleanup`,group:`machine-detection-sessions`,description:`Enable cleanup of eligible local worktrees.`,control:`toggle`,keywords:[`git`,`worktree`,`cleanup`],defaultValue:!0,takesEffect:`now`,fileOnlyReason:D,...S},{id:`file-branch-gc-prefixes`,path:`branchGc.prefixes`,title:`Branch cleanup prefixes`,group:`machine-detection-sessions`,description:`Branch prefixes that filter both remote branch cleanup and local worktree cleanup.`,control:`list`,keywords:[`git`,`branch`],defaultValue:[`glimmervoid/session/`,`worktree-agent-`],takesEffect:`now`,fileOnlyReason:D,...S},{id:`file-branch-gc-dry-run`,path:`branchGc.dryRun`,title:`Branch cleanup dry run`,group:`machine-detection-sessions`,description:`Report planned cleanup without deleting remote branches.`,control:`toggle`,keywords:[`git`,`safety`],defaultValue:!1,takesEffect:`now`,fileOnlyReason:D,...S},{id:`file-branch-gc-stale-days`,path:`branchGc.staleDays`,title:`Branch stale days`,group:`machine-detection-sessions`,description:`Age threshold for orphan branch cleanup when unmerged deletion is on.`,control:`number`,integer:!1,step:`any`,range:f,unit:w,keywords:[`git`,`retention`],defaultValue:14,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-branch-gc-interval-ms`,path:`branchGc.intervalMs`,title:`Branch cleanup interval`,group:`machine-detection-sessions`,description:`Delay between branch cleanup passes.`,control:`number`,integer:!1,step:`any`,range:f,unit:Jn,keywords:[`git`,`schedule`],defaultValue:216e5,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-custom-agents`,path:`customAgents`,title:`Custom agents`,group:`machine-detection-sessions`,description:`Extra agent CLIs a session can be spawned with. The Sessions section lists the declared agents and whether each command resolves.`,control:`json`,keywords:[`adapters`,`cli`],defaultValue:[],takesEffect:`new-sessions`,fileOnlyReason:er,...S},{id:`file-task-title-refiner-enabled`,path:`taskTitle.refiner.enabled`,title:`Refine task titles`,group:`machine-detection-sessions`,description:`Keep session card titles useful when prompts change topic by asking a model for a short title.`,control:`toggle`,keywords:[`title`,`refiner`,`card`],defaultValue:!0,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-task-title-refiner-model`,path:`taskTitle.refiner.model`,title:`Task title model`,group:`machine-detection-sessions`,description:`Claude model alias the title refiner asks.`,control:`text`,keywords:[`title`,`refiner`,`model`],defaultValue:u.taskTitleRefiner,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-task-title-refiner-min-interval`,path:`taskTitle.refiner.minIntervalSeconds`,title:`Task title refresh interval`,group:`machine-detection-sessions`,description:`Shortest pause between two title refinements of one session.`,control:`number`,integer:!1,step:`any`,range:Ne,unit:C,keywords:[`title`,`refiner`,`interval`],defaultValue:60,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-task-title-refiner-timeout`,path:`taskTitle.refiner.timeoutSeconds`,title:`Task title timeout`,group:`machine-detection-sessions`,description:`Maximum time allowed for one title refinement.`,control:`number`,integer:!1,step:`any`,range:ge,unit:C,keywords:[`title`,`refiner`,`deadline`],defaultValue:60,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-usage-codex`,path:`usage.vendors.codex`,title:`Track Codex usage`,group:`machine-usage`,description:`Include local Codex CLI transcripts in usage reports.`,control:`toggle`,keywords:[`openai`,`vendor`],defaultValue:!0,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-usage-grok`,path:`usage.vendors.grok`,title:`Track Grok usage`,group:`machine-usage`,description:`Include local Grok CLI transcripts in usage reports.`,control:`toggle`,keywords:[`xai`,`vendor`],defaultValue:!0,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-usage-kimi`,path:`usage.vendors.kimi`,title:`Track Kimi Code usage`,group:`machine-usage`,description:`Include local Kimi Code transcripts in usage reports.`,control:`toggle`,keywords:[`moonshot`,`vendor`],defaultValue:!0,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-usage-fetch-pricing`,path:`usage.fetchPricing`,title:`Fetch current model prices`,group:`machine-usage`,description:`Load public model prices when usage tracking starts, using a cached table for up to one day. Falls back to cached or bundled prices if the fetch fails; no daily refresh runs while tracking continues.`,control:`toggle`,keywords:[`rates`,`models`],defaultValue:!0,takesEffect:`restart`,fileOnlyReason:T,...S},{id:`file-usage-plan-limits`,path:`usage.planLimits`,title:`Show plan limits`,group:`machine-usage`,description:`Read the Claude plan limit the CLI reports and show it beside usage.`,control:`toggle`,keywords:[`plan`,`limits`,`quota`],defaultValue:!0,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-usage-scan-interval`,path:`usage.scanIntervalMinutes`,title:`Scan interval`,group:`machine-usage`,description:`Periodic transcript polling interval. Session activity can also trigger scans between timer ticks.`,control:`number`,range:je,unit:Un,keywords:[`poll`,`refresh`],defaultValue:5,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-usage-warehouse-retain-days`,path:`usage.warehouseRetainDays`,title:`Retain usage history`,group:`machine-usage`,description:`How long the daily usage warehouse keeps rolled-up totals after transcript detail expires.`,control:`number`,range:xe.warehouseRetainDays,unit:w,keywords:[`history`,`warehouse`,`retention`],defaultValue:365,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-usage-session-block-hours`,path:`usage.sessionBlockHours`,title:`Session block length`,group:`machine-usage`,description:`Length of the rolling block the Usage view groups activity into.`,control:`number`,range:xe.sessionBlockHours,unit:Wn,keywords:[`block`,`window`,`hours`],defaultValue:5,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-usage-cost-mode`,path:`usage.costMode`,title:`Cost mode`,group:`machine-usage`,description:`Choose whether recorded costs, calculated costs or both can appear.`,control:`select`,options:tr(xr),keywords:[`pricing`,`estimate`],defaultValue:`auto`,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-usage-extra-projects-dirs`,path:`usage.extraProjectsDirs`,title:`Extra transcript folders`,group:`machine-usage`,description:`Absolute paths of additional Claude projects folders the usage scan reads.`,control:`list`,keywords:[`transcripts`,`folders`,`scan`],defaultValue:[],takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-posthog-investigation-timeout`,path:`posthog.investigationTimeoutSeconds`,title:`Investigation timeout`,group:`lanes-posthog`,description:`Maximum time allowed for one investigation.`,control:`number`,integer:!1,step:`any`,range:f,unit:qn,keywords:[`deadline`,`session`],defaultValue:900,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-posthog-escalation`,path:`posthog.userEscalationThreshold`,title:`Escalation threshold`,group:`lanes-posthog`,description:`Affected-user count that escalates an issue.`,control:`number`,range:f,unit:Zn,keywords:[`threshold`,`severity`],defaultValue:25,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-posthog-fix-timeout`,path:`posthog.fixTimeoutSeconds`,title:`Fix timeout`,group:`lanes-posthog`,description:`Maximum time allowed for one fix session.`,control:`number`,integer:!1,step:`any`,range:De,unit:qn,keywords:[`deadline`,`repair`],defaultValue:1800,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-posthog-traffic-multiplier`,path:`posthog.trafficSpikeMultiplier`,title:`Spike multiplier`,group:`lanes-posthog`,description:`Baseline multiplier required to classify a traffic spike.`,control:`number`,integer:!1,step:`any`,range:Oe,unit:Qn,keywords:[`baseline`,`ratio`],defaultValue:3,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-posthog-traffic-min-users`,path:`posthog.trafficSpikeMinUsers`,title:`Min users to alert`,group:`lanes-posthog`,description:`Minimum recent unique users for an initial traffic-spike alert. Escalation and recovery alerts bypass this minimum.`,control:`number`,range:we,unit:Zn,keywords:[`threshold`,`analytics`],defaultValue:10,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-posthog-traffic-cooldown`,path:`posthog.trafficSpikeCooldownMinutes`,title:`Spike cooldown`,group:`lanes-posthog`,description:`Cooldown for new traffic spikes. Escalation and recovery alerts bypass it. Zero removes the time delay; repeated active-spike alerts are still suppressed.`,control:`number`,integer:!1,step:`any`,range:Ne,unit:Yn,keywords:[`silence`,`delay`],defaultValue:360,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-posthog-traffic-baseline`,path:`posthog.trafficSpikeBaselineDays`,title:`Baseline window`,group:`lanes-posthog`,description:`Historical window used to calculate normal hourly traffic.`,control:`number`,range:Se,unit:w,keywords:[`history`,`analytics`],defaultValue:7,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-posthog-recurrence-dedupe`,path:`posthog.recurrenceDedupe`,title:`Deduplicate recurring issues`,group:`lanes-posthog`,description:`Treat an issue seen again inside the recurrence window as the same investigation instead of opening a new one.`,control:`toggle`,keywords:[`recurrence`,`dedupe`,`issues`],defaultValue:!0,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-posthog-recurrence-window-days`,path:`posthog.recurrenceWindowDays`,title:`Recurrence window`,group:`lanes-posthog`,description:`How far back an issue counts as a recurrence of an investigated one.`,control:`number`,integer:!1,step:`any`,range:f,unit:w,keywords:[`recurrence`,`window`],defaultValue:7,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-posthog-transient-recurrence-limit`,path:`posthog.transientRecurrenceLimit`,title:`Transient recurrence limit`,group:`lanes-posthog`,description:`How many times a transient issue may recur before it is investigated again.`,control:`number`,integer:!1,step:`any`,range:f,unit:Vn,keywords:[`recurrence`,`transient`,`limit`],defaultValue:3,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-posthog-repo-path`,path:`posthog.repoPath`,title:`Repository path`,group:`lanes-posthog`,description:`Absolute path of the local checkout investigations read and fixes branch from, for every project the project map does not name.`,control:`text`,keywords:[`repository`,`checkout`,`path`],defaultValue:``,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-posthog-project-map`,path:`posthog.projectMap`,title:`Project map`,group:`lanes-posthog`,description:`PostHog project id to a label: the name shown for that project, and, when it is an absolute path to a checkout, the repository its issues are investigated in.`,control:`json`,keywords:[`projects`,`repositories`,`map`],defaultValue:{},takesEffect:`now`,fileOnlyReason:$n,...S},{id:`file-team-review-team`,path:`teamReview.team`,title:`GitHub team (legacy)`,group:`lanes-team-review`,description:`Team slug whose members and review requests are polled. Read only when github.teams is empty.`,control:`text`,keywords:[`github`,`slug`,`legacy`],defaultValue:``,takesEffect:`now`,fileOnlyReason:`A legacy key: github.teams names teams as org/slug entries and wins whenever it is set.`,...S},{id:`file-workflows-max-actions-per-poll`,path:`workflows.maxActionsPerPoll`,title:`Actions per poll`,group:`lanes-workflows`,description:`Most actions run in one poll. The rest are dropped and logged.`,control:`number`,range:be,unit:Hn,keywords:[`cap`,`rate limit`],defaultValue:20,takesEffect:`now`,fileOnlyReason:T,...S},{id:`file-workflows-rules`,path:`workflows.rules`,title:`Workflow rule definitions`,group:`lanes-workflows`,description:`The rules the Workflows section switches on and off: each names its repositories, one pull request event, its filters and its actions.`,control:`json`,keywords:[`pull requests`,`automation`,`rules`],defaultValue:[],takesEffect:`now`,fileOnlyReason:`Rule definitions are written in config.json; the Workflows section only switches each rule on or off.`,...S},{id:`file-pr-flows-sources`,path:`prFlows.sources`,title:`PR flows sources`,group:`lanes-team-review`,description:`Commands that report review findings for your own pull requests, run without a shell on each new head once you approve the exact command in My PRs. Each entry has id, label, command (an argv array; {prUrl}, {repo}, {number} and {head} expand inside one argument, and GLIMMERVOID_PR_URL, GLIMMERVOID_PR_REPO, GLIMMERVOID_PR_NUMBER and GLIMMERVOID_PR_HEAD are set), timeoutSeconds and optional repos (owner/name; every repository when absent), and prints {"findings": [{"path", "lineStart", "lineEnd", "priority", "body", "url"}], "status": [{"label", "state"}]} JSON. Each id is unique within the list. Check entries with glimmervoid pr-flows check.`,jsonSchema:t(i(ie),{io:`input`}),example:[{id:`scanner`,label:`Scanner`,command:[`my-review-scanner`,`--pr`,`{prUrl}`,`--json`],timeoutSeconds:120}],control:`json`,keywords:[`pull requests`,`review items`,`bots`,`commands`],defaultValue:[],takesEffect:`now`,fileOnlyReason:`Commands run on this machine, so they are written in config.json and each one waits for your approval in My PRs.`,...S},{id:`file-pr-flows-actions`,path:`prFlows.actions`,title:`PR flows actions`,group:`lanes-team-review`,description:`Commands that act on a review item of your own pull request, shown as a button with their label and named by rules as run:<id>. Each entry has id, label, command and timeoutSeconds like a source, also expands {itemPath} and {itemLine}, gets the item as GLIMMERVOID_ITEM_JSON, waits for your approval in My PRs, and has an id unique within the list. Exit 0 is done and non-zero failed, unless stdout prints {"outcome": "done" | "started" | "refused" | "failed", "message"} JSON.`,jsonSchema:t(i(se),{io:`input`}),example:[{id:`ask-bot`,label:`Ask bot`,command:[`gh`,`pr`,`comment`,`{prUrl}`,`--body`,`@review-bot fix {itemPath}:{itemLine}`]}],control:`json`,keywords:[`pull requests`,`review items`,`commands`],defaultValue:[],takesEffect:`now`,fileOnlyReason:`Commands run on this machine, so they are written in config.json and each one waits for your approval in My PRs.`,...S},{id:`file-pr-flows-pr-actions`,path:`prFlows.prActions`,title:`PR flows PR actions`,group:`lanes-team-review`,description:`Commands that act on a whole pull request of yours, shown as a button next to Keep mergeable and Merge when ready and run once per click, never by a rule. Each entry has id, label, command and timeoutSeconds like an action, plus optional repos (owner/name; every repository when absent), expands {headRef} and {baseRef} instead of the item placeholders, gets GLIMMERVOID_PR_HEAD_REF, GLIMMERVOID_PR_BASE_REF and the pull request as GLIMMERVOID_PR_JSON, and waits for your approval in My PRs. Exit 0 is done and non-zero failed, unless stdout prints {"outcome": "done" | "started" | "refused" | "failed", "message"} JSON.`,jsonSchema:t(i(c),{io:`input`}),example:[{id:`agent-merge`,label:`Merge via agent`,repos:[`acme/app`],command:[`my-merge-trigger`,`{prUrl}`,`{headRef}`],timeoutSeconds:60}],control:`json`,keywords:[`pull requests`,`buttons`,`commands`,`merge`],defaultValue:[],takesEffect:`now`,fileOnlyReason:`Commands run on this machine, so they are written in config.json and each one waits for your approval in My PRs.`,...S},{id:`file-packs`,path:`packs`,title:`Packs`,group:`lanes-team-review`,description:`More pack directories to load besides every directory under ~/.glimmervoid/packs/. A pack is a pack.json (name, version, description, requires, and sections such as prFlows with prActions, sources, actions, rules and a repos default for them) plus the files it uses, shared by copying the directory; its commands can use {packDir}, its ids show as <pack>/<id>, and it waits for one approval in Settings, Packs that any edit to a file in it asks again.`,control:`list`,keywords:[`packs`,`share`,`plugins`,`pull requests`,`commands`],defaultValue:[],takesEffect:`now`,fileOnlyReason:`A pack can run commands on this machine, so its directory is written in config.json and the pack waits for your approval.`,...S},{id:`file-pr-flows-rules`,path:`prFlows.rules`,title:`PR flows rules`,group:`lanes-team-review`,description:`Ordered rules for review items on your own pull requests; the first match acts with no click and lands in the Handled list, where Undo reopens it. Each matches on sources (source ids, <pack>/<id> for a pack source), authors (GitHub logins of review comment authors), priority, paths, text, scope and repos (owner/name; every repository when absent), and acts with ask, fix-local, dismiss or run:<action id>.`,jsonSchema:a(i(s)),example:[{name:`Generated files`,paths:[`dist/`],action:`dismiss`,reason:`Generated output; the source change is reviewed instead.`},{name:`Bot nits`,authors:[`review-bot[bot]`],priority:[`low`],repos:[`acme/app`],action:`run:ask-bot`}],control:`json`,keywords:[`pull requests`,`review items`,`dismiss`,`automation`],defaultValue:[],takesEffect:`now`,fileOnlyReason:`Rules are written in config.json; Save as rule in My PRs is the one dashboard writer, and it only appends.`,...S},{id:`file-pr-flows-repo-rules`,path:`prFlows.repoRules`,title:`PR flows repository rules`,group:`lanes-team-review`,description:`Deprecated: put repos on each rule in prFlows.rules instead. Rules per repository (owner/name to a list of rules), still checked before prFlows.rules for that repository.`,jsonSchema:a(r(n(),i(s))),example:{"acme/app":[{name:`Docs typos`,paths:[`docs/`],text:`typo`,action:`fix-local`}]},control:`json`,keywords:[`pull requests`,`review items`,`repositories`],defaultValue:{},takesEffect:`now`,fileOnlyReason:$n,...S},{id:`file-question-manager-rules`,path:`questionManager.rules`,title:`Question manager rules`,group:`lanes-question-manager`,description:`Rules the question manager answers from. An object with name, question (text the question contains) and pick (the exact option labels to choose) answers at once. A plain sentence is a rule a model applies when no object matches; it must cite one rule and pick exact option labels within 60 seconds, or the question comes to you. A question with a risk word such as push, delete or deploy always comes to you.`,jsonSchema:t(i(At),{io:`input`}),example:[{name:`README length`,question:`README`,pick:[`Short`]},`Prefer the existing library over adding a dependency.`],control:`json`,keywords:[`questions`,`rules`,`automation`],defaultValue:[],takesEffect:`now`,fileOnlyReason:$n,...S},{id:`file-question-manager-model`,path:`questionManager.model`,title:`Question manager model`,group:`lanes-question-manager`,description:`Claude model alias that applies the plain-language question manager rules.`,control:`text`,keywords:[`questions`,`rules`,`model`],defaultValue:u.questionManager,takesEffect:`now`,fileOnlyReason:T,...S}]),Cr=Object.freeze({"machine-terminal":{title:`Terminal`,description:`Terminal behavior shared by dashboard clients.`},"machine-detection-sessions":{title:`Detection and sessions`,description:`Config-file-only detection, timing, worktree and process settings.`}}),wr=Object.freeze([nr,rr,ar,or,sr,lr,cr,ur,fr,pr,mr,hr,gr,_r,vr,yr,br,dr,ir]),Tr=Object.freeze({sections:wr,fileOnly:Sr}),Er=`experimental`;function Dr(e){return e.keywords.includes(Er)}function Or(e){let t=e.settings[0];return t!==void 0&&Dr(t)}function kr(e,t){return t?e:e.flatMap(e=>{let t=e.settings.filter(e=>!Dr(e));return t.length===0&&e.settings.length>0?[]:[{...e,settings:t}]})}var Ar=Object.freeze(Object.fromEntries(wr.flatMap(e=>(e.legacyIds??[]).map(t=>[t,e.id])))),jr=Object.freeze(wr.reduce((e,t)=>{for(let n of t.settings)for(let r of n.legacyIds??[])e[r.sectionId]={...e[r.sectionId],[r.settingId]:t.id};return e},{}));function Mr(e){let t=[],n=e=>{if(!e||typeof e!=`object`)return e;let n=Array.isArray(e)?[]:{};return t.push([e,n]),n},r=n(e);for(let e=t.pop();e;e=t.pop()){let[t,r]=e;for(let[e,i]of Object.entries(t))Object.defineProperty(r,e,{value:n(i),writable:!0,enumerable:!0,configurable:!0})}return r}function Nr(e,t){let n=e;for(let e of t.split(`.`)){if(typeof n!=`object`||!n)return;n=n[e]}return n}function Pr(e,t){let n=t.split(`.`),r=e;for(let e of n.slice(0,-1)){if(!r||typeof r!=`object`)return;r=r[e]}r&&typeof r==`object`&&delete r[n.at(-1)]}function Fr(e,t,n){let r=t.split(`.`),i=e;for(let e of r.slice(0,-1))(!i[e]||typeof i[e]!=`object`||Array.isArray(i[e]))&&(i[e]={}),i=i[e];i[r.at(-1)]=Mr(n)}function O(e){return e.flatMap(e=>e.settings)}function Ir(e){return e.access===`file-only`||e.control===`readonly`}function Lr(e){let t=String(e??``).trim().toLowerCase();if(!t||t===`all`)return`all`;if(t===`none`)return[];let n=t.split(`,`).map(e=>e.trim());return n.every(e=>/^\d+$/.test(e)&&Number.isSafeInteger(Number(e))&&Number(e)>0)?n.map(Number):null}var Rr=6;function k(e,t){return e.control===`number`&&typeof t==`number`?t/(e.unit?.storedPerDisplay??1):e.valueKind===`posthog-projects`?Array.isArray(t)?t.length===0?[`none`]:t.map(String):[]:Mr(t)}function zr(e){return e.control===`number`&&(e.unit?.storedPerDisplay??1)!==1}function Br(e){return String(Number(e.toFixed(Rr)))}function Vr(e,t){let n=k(e,t);return e.valueKind===`posthog-projects`&&Array.isArray(n)?n.join(`, `)||`all`:typeof n==`number`&&e.unit?`${Br(n)} ${e.unit.label}`:JSON.stringify(n??null)}function A(e,t){if(e.control===`number`){if(e.nullable&&(t==null||String(t).trim()===``))return null;let n=Number(t);if(e.zeroIsNull&&n<=0)return null;let r=n*(e.unit?.storedPerDisplay??1);return e.integer===!1?r:Math.round(r)}if(e.valueKind===`posthog-projects`)return Lr(Array.isArray(t)?t.join(`,`):t);if(e.control===`text`||e.control===`password`){let n=String(t??``).trim();return e.nullable&&!n?null:n}return Mr(t)}function j(e){return String(e||``).toLowerCase().match(/[a-z0-9]+/g)||[]}var Hr=3,Ur=2,Wr=1,Gr=3,Kr=30,qr=16;function Jr(e,t){return e===t?Hr:e.startsWith(t)?Ur:t.length>=Gr&&e.includes(t)?Wr:0}function M(e,t,n){let r=0;for(let n of t){let t=Math.max(0,...e.map(e=>Jr(e,n)));if(t===0)return 0;r+=t}return r*n}function Yr(e){return e.options?.map(e=>e.label).join(`, `)??``}function Xr(e){return ii(e.group??``)?.title??``}function Zr(e,t,n){let r=M(j(e.title),n,1e3),i=M(j(e.keywords.join(` `)),n,100),a=M(t,n,10),o=M(j(e.path),n,10),s=M(j(Yr(e)),n,10),c=M(j(e.description),n,1);return r+i+a+o+s+c}function Qr(e){return e.section?.title??``}function $r(e,t){return Number(e.section===null)-Number(t.section===null)}function ei(e,t,n){return[[`title`,e.title],[`keywords`,e.keywords.join(` `)],[`section`,t?.title??Xr(e)],[`description`,e.description],[`path`,e.path],[`options`,Yr(e)]].flatMap(([e,t])=>{let r=[];for(let e of t.matchAll(/[a-z0-9]+/gi)){let t=e[0].toLowerCase();for(let i of n){if(Jr(t,i)===0)continue;let n=e.index+t.indexOf(i);r.push({start:n,end:n+i.length})}}let i=[];for(let e of r.sort((e,t)=>e.start-t.start||e.end-t.end)){let t=i.at(-1);t&&e.start<=t.end?t.end=Math.max(t.end,e.end):i.push({...e})}return i.length?[{field:e,text:t,spans:i}]:[]})}function ti(e,t,n=[]){let r=j(t).slice(0,qr);if(r.length===0)return[];let i=[];for(let t of e){let e=j(t.title);for(let n of t.settings){let a=Zr(n,e,r);a!==0&&i.push({section:t,setting:n,score:a,matches:ei(n,t,r)})}}for(let e of n){let t=Zr(e,j(Xr(e)),r);t!==0&&i.push({section:null,setting:e,score:t,matches:ei(e,null,r)})}return i.sort((e,t)=>t.score-e.score||$r(e,t)||Qr(e).localeCompare(Qr(t))||e.setting.title.localeCompare(t.setting.title)).slice(0,Kr)}function ni(e,t,n={},r={}){let i=/^#settings\/([^/]+)(?:\/([^/]+))?$/.exec(String(e||``));if(!i)return null;let a,o;try{a=decodeURIComponent(i[1]),o=i[2]?decodeURIComponent(i[2]):null}catch{return null}let s=n[a]||a,c=(o?r[s]?.[o]:void 0)||s,l=t.find(e=>e.id===c);if(!l)return null;let u=o?l.settings.find(e=>e.id===o||e.legacyIds?.some(e=>e.settingId===o&&e.sectionId===s)):null;return o&&!u?null:{sectionId:c,settingId:u?.id||null,hash:`#settings/${c}${u?`/${u.id}`:``}`}}function ri(e){let t=new Map,n=new Map;for(let r of[...O(e.sections),...e.fileOnly])t.set(r.id,r),n.set(r.path,r);return{byId:t,byPath:n}}ri(Tr);function ii(e,t=Tr){let n=t.sections.find(t=>t.id===e);return n?{title:n.title,description:n.description}:Cr[e]??null}var ai=new WeakMap,oi=`Configured`,si=`•`.repeat(12),ci=`Each line must be a positive whole-number PostHog project id, or the one word none.`,li=3,ui=new Set([`customAgents`]),di=1e-9,fi=`Lanes`,pi=Object.freeze({now:`Applies now`,"new-sessions":`New sessions`,restart:`After restart`}),mi=Object.freeze({browser:`This browser`,machine:`This machine`});function hi(e){let t=new Map;for(let n of e)t.set(n.scope,(t.get(n.scope)??0)+1);let n=null,r=0;for(let[e,i]of t)i<=r||(n=e,r=i);return n}function gi(e,t){let n=[];return e.scope!==t&&n.push({kind:`scope`,text:mi[e.scope]}),e.takesEffect!==`now`&&n.push({kind:`effect`,text:pi[e.takesEffect]}),n}function _i(e,t){let n=t.secretSources;if(!n||typeof n!=`object`)return null;let r=n[e.path];return typeof r==`string`?r:null}function vi(e){return e.control===`password`}function yi(e){return`${e.path}${oi}`}function bi(e,t){if(Object.is(e,t))return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((e,n)=>bi(e,t[n]));if(!e||!t||typeof e!=`object`||typeof t!=`object`)return!1;let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>Object.hasOwn(t,n)&&bi(e[n],t[n]))}function xi(e){return ai.get(e)||null}function Si(e){return Array.isArray(e)?e.map(e=>String(e)):[]}function Ci(e){return e.split(`
2
2
  `).map(e=>e.trim()).filter(e=>e!==``)}function wi(e){let t=e.range;if(!t)return null;let n={min:Number(k(e,t.min))};return t.max!=null&&(n.max=Number(k(e,t.max))),t.exclusiveMin&&(n.exclusiveMin=!0),n}function Ti(e){let t=`Default ${Vr(e,e.defaultValue)}`;return zr(e)?`${t}, stored as ${JSON.stringify(e.defaultValue)} ${e.unit?.storedLabel??``}`.trimEnd():t}function Ei(e,t){let n=Ti(e),r=ui.has(e.path)?void 0:Nr(t,e.path);if(r===void 0)return{currentText:null,defaultText:n,jsonFragment:null};let i={};return Fr(i,e.path,r),{currentText:`Current ${Vr(e,r)}`,defaultText:n,jsonFragment:JSON.stringify(i,null,2)}}function Di(e,t,n){let r=t??e.find(e=>e.id===n.group);if(!r)return ii(n.group??``)?.title??`config.json`;let i=e.find(e=>e.id===r.parent);return i?`${i.title} / ${r.title}`:r.level===`lanes`?`${fi} / ${r.title}`:r.title}function Oi(e,t){return e.filter(e=>e.parent===t)}function ki(e,t){let n=e.find(e=>e.id===t);return n?n.parent?e.find(e=>e.id===n.parent)??n:n:null}function Ai(e){return e.filter(e=>!e.parent)}function ji(e){let t=e.filter(e=>e.level===`lanes`);return[{heading:null,sections:e.filter(e=>e.level!==`lanes`)},{heading:fi,sections:t}].filter(e=>e.sections.length>0)}function Mi(e,t,n,r){return r?`hidden`:n.trim()?`search`:t&&ki(e,t)?`section`:`list`}function Ni(e,t={}){let n={};for(let r of O(e)){if(Ir(r))continue;if(r.path.startsWith(`pref:`)){let e=r.path.slice(5),i=t.prefs?.[e]??t[r.path];n[r.path]=k(r,i??r.defaultValue);continue}if(vi(r)){let e=Nr(t,yi(r))===!0;n[r.path]=e?si:``;continue}let e=Nr(t,r.path);n[r.path]=k(r,e??r.defaultValue)}return ai.set(n,Mr(t)),n}function Pi(e,t,n){let r=O(e).filter(e=>Ir(e)||e.path.startsWith(`pref:`)||_i(e,xi(t)||{})||vi(e)&&n[e.path]===si?!1:!bi(t[e.path],n[e.path]));if(r.length===0)return{};let i=xi(t)||{},a={},o=new Set;for(let e of r){let[t]=e.path.split(`.`);if(!e.path.includes(`.`))a[t]=A(e,n[e.path]);else{if(!o.has(t)){let e=i[t];a[t]=e&&typeof e==`object`&&!Array.isArray(e)?Mr(e):{},o.add(t)}Fr(a,e.path,A(e,n[e.path]))}}for(let t of O(e))vi(t)&&Pr(a,yi(t));return delete a.secretSources,a}function Fi(e,t,n,r){return da(Pi(e,t,{...t,[n.path]:r}))}function Ii(e){let t=e.unit?.label;return t?` of ${t}`:``}function Li(e){let t=wi(e);if(!t)return`Allowed range is unavailable.`;let n=`${e.integer!==!1&&!zr(e)?`whole number`:`number`}${Ii(e)}`;return t.exclusiveMin&&t.min===0?`Must be a positive ${n}.`:t.max==null?`Must be a ${n} ${t.exclusiveMin?`above`:`of at least`} ${Br(t.min)}.`:`Must be a ${n} between ${Br(t.min)} and ${Br(t.max)}.`}function Ri(e){return`Must be a multiple of ${Vr(e,1)}.`}function zi(e){return Math.abs(e-Math.round(e))<di&&Number.isSafeInteger(Math.round(e))}function Bi(e,t){return Number(A({...e,integer:!1,nullable:!1,zeroIsNull:!1},t))}function Vi(e,t){if(e.nullable&&(t==null||String(t).trim()===``))return null;let n=e.range;if(!n)return`Allowed range is unavailable.`;if(t==null||String(t).trim()===``)return Li(e);let r=Number(t);if(!Number.isFinite(r))return Li(e);if(e.zeroIsNull&&r<=0)return null;let i=Bi(e,r);if(e.integer!==!1&&!zi(i))return zr(e)?Ri(e):Li(e);let a=Number(A(e,r));return n.exclusiveMin&&a<=n.min||!n.exclusiveMin&&a<n.min||n.max!=null&&a>n.max?Li(e):null}function Hi(e,t,n=!1){return n?Li(e):Vi(e,t.trim())}function Ui(e,t){let n=t.trim();if(e.nullable&&n===``)return null;let r=Number(n);return e.zeroIsNull&&r<=0?null:r}function Wi(e){if(e==null||e===``)return``;let t=Number(e);return Number.isFinite(t)?Br(t):String(e)}function Gi(e,t){return Array.isArray(t)?e.valueKind===`posthog-projects`&&A(e,t)===null?ci:null:`Must be a list.`}function Ki(e,t){let n={};for(let r of O(e)){if(Ir(r))continue;let e=null;r.control===`number`&&(e=Vi(r,t[r.path])),r.control===`list`&&(e=Gi(r,t[r.path])),r.control===`select`&&r.options&&!r.options.some(e=>e.value===t[r.path])&&(e=`Choose one of the available options.`),e&&(n[r.id]=e)}return qi(O(e),t,n),n}function qi(e,t,n){for(let r of e){let i=e.find(e=>e.id===r.maximumSettingId);if(!i||n[r.id]||n[i.id])continue;let a=t[r.path],o=t[i.path];Number(A(r,a))>Number(A(i,o))&&(n[r.id]=`Minimum must not exceed the maximum (${Wi(o)}).`,n[i.id]=`Maximum must not be below the minimum (${Wi(a)}).`)}}function Ji(e,t){return O(e).find(e=>e.id===t.maximumSettingId||e.maximumSettingId===t.id)}function Yi(e,t,n){let r=Ji(e,t);return Ki([{id:`scoped`,level:`machine`,title:``,description:``,settings:r?[t,r]:[t]}],n)[t.id]??null}function Xi(e,t){return e.control===`number`?Ui(e,t):e.control===`list`?Ci(t):t}function Zi(e,t){return A(e,e.control===`list`?Si(t):t)}function Qi(e){return e?.isDirty===!0}function $i(e,t,n,r,i,a=!1){if(!Qi(n))return{kind:`unchanged`};let o=t.control===`number`?Hi(t,r,a):null;if(o)return{kind:`invalid`,error:o};let s=Xi(t,r);if(bi(A(t,s),Zi(t,n.base)))return{kind:`unchanged`};let c=Yi(e,t,{...i,[t.path]:s});return c?{kind:`invalid`,error:c}:{kind:`changed`,value:s}}function ea(e){return vi(e)?``:k(e,e.defaultValue)}function ta(e,t){return bi(t,ea(e))}function na(e){return e.presentation?e.presentation:(e.options?.length??0)<=li?`segmented`:`select`}function ra(e){return Array.isArray(e)?e.length>0:typeof e==`string`?e.trim()!==``:e===!0}function ia(e,t){return e.danger===!0&&!!e.warning&&ra(t)}function aa(e,t){return ia(e,t)}function oa(e){return e.title.charAt(0).toLowerCase()+e.title.slice(1)}function sa(e){return vi(e)?`Reset removes the stored ${oa(e)}. Anything that relies on it stops until a new one is saved.`:aa(e,ea(e))?e.warning??``:null}function ca(e){return[e.repos.join(`, `),e.trigger,e.actions.map(e=>e.type).join(`, `)].join(` `)}function la(e){if(e==null)return[`No rules. Add workflows.rules to config.json.`];let t=le.safeParse(e);return t.success?t.data.rules.length===0?[`No rules. Add workflows.rules to config.json.`]:t.data.rules.map(e=>[e.name,e.enabled?`enabled`:`disabled`,ca(e)].join(` `)):[`The workflows block is invalid, so no rule runs: ${t.error.issues[0]?.message??`unknown problem`}`]}function ua(e){let t=le.safeParse(e??{});return t.success?t.data.rules.map(e=>({id:e.id,name:e.name,isEnabled:e.enabled,summary:ca(e)})):[]}function da(e){let t=e.workflows;return typeof t!=`object`||!t||Array.isArray(t)?e:{...e,workflows:Object.fromEntries(Object.entries(t).filter(([e])=>e!==`rules`))}}var fa=`https://glimmervoid.dev`,pa=Object.freeze({id:`lanes-features`,level:`lanes`,title:`Features`,description:`Optional tabs, each hidden until its own toggle is on.`,settings:[]}),ma=Object.freeze({id:`machine-packs`,level:`machine`,title:`Packs`,description:`Packs other people share, each waiting for your approval before anything in it runs.`,settings:[]}),ha=`browser-shortcuts`,ga=Object.freeze({id:`browser-status-key`,level:`browser`,title:`Status key`,description:`What each session status and pull request icon means.`,settings:[]}),_a=Object.freeze({id:`browser-about`,level:`browser`,title:`About`,description:`The running build and where the project lives.`,settings:[]}),va=Object.freeze({sounds:()=>bn(),themes:yt});function ya(e){if(!e.optionsFrom)return e;let t=va[e.optionsFrom]?.()??[];return{...e,options:t.map(e=>({value:e.id,label:e.label}))}}function ba(e){return e.isExperimentalBuild===!0}function xa(){return kr(Tr.sections,ba(g()))}function Sa(){let e=xa().map(e=>({...e,settings:e.settings.map(ya)})),t=e.findIndex(e=>e.id===ha)+1,n=[...e.slice(0,t),ga,...e.slice(t)],r=n.findIndex(e=>e.level===`lanes`);return Object.freeze([...n.slice(0,r),ma,pa,...n.slice(r),_a])}var Ca=new Map,N=new Map,P=new WeakMap,F=new Map;function wa(){return{themeId:at(),flyingAnimalsEnabled:mt(),...et(),soundEnabled:ft(),soundId:yn(st()),notificationsEnabled:tt(),phoneArrowPad:pt(),nextAttentionKeyCode:lt()}}function Ta(e){H=Ni(R,{...e,prefs:wa()})}function I(e){return N.has(e.id)?N.get(e.id):H[e.path]}function Ea(e){return[e,...Oi(R,e.id)]}function L(e){return Ea(e).flatMap(e=>e.settings)}function Da(e){return R.find(t=>t.settings.some(t=>t.id===e.id))??B}function Oa(e,t=null){history.replaceState(history.state,``,wt(e,t))}function ka(e){let t=new URL(e,fa),{telemetryInstallId:n}=V;return typeof n==`string`&&n&&t.searchParams.set(`gv`,n),t.href}function Aa(e){return R.flatMap(e=>e.settings).find(t=>t.id===e)??null}function ja(){R=Sa(),Na=ba(g()),B=ki(R,B.id)??R[0]}function Ma(){return ba(V)!==Na&&(ja(),!0)}var R=Sa(),Na=ba(g()),z=null,B=R[0],V=g(),H={},Pa=!1;function Fa(e){z=e}function Ia(e){B=e}function La(e){V=e}function Ra(e){Pa=e}var za={refreshRow:()=>{},refreshRowFoot:()=>{},refreshSettingsStatus:()=>{},refreshShortcutGroups:()=>{}};function Ba(e){za=e}function U(){return za}function Va(e){let t=m(`span`,`settings-update-action-status`,e??``);return t.setAttribute(`role`,`status`),t}function Ha(){let{isCheckInFlight:e,checkSendFailure:t}=_();return e?`Checking for updates.`:t}function Ua(){let{status:e,lastAutoCheckAt:t}=_();e?(Ra(!1),me({status:e,checkForUpdates:V.checkForUpdates,now:Date.now(),lastAutoCheckAt:t})&&Nt()):Ra(!0)}function Wa(e){return d(e===`update`?{variant:`primary`,label:`Update`,action:`apply-update`,onClick:Mt}:e===`restart`?{variant:`primary`,label:`Restart`,action:`restart-server`,onClick:It}:{variant:`secondary`,label:`Check for updates`,action:`check-for-updates`,disabled:_().isCheckInFlight,onClick:Nt})}function Ga(){let{status:e,journal:t,request:n}=_(),r=ee({status:e,journal:t,request:n}),i=m(`div`,`settings-update-actions`);if(r.actions.length>0){let e=m(`div`,`settings-update-buttons`);e.append(...r.actions.map(Wa)),i.appendChild(e)}let a=Ha();return a&&i.appendChild(Va(a)),r.note&&i.appendChild(Va(r.note)),r.command&&i.appendChild(m(`code`,`settings-update-command`,r.command)),i}function Ka(e,...t){let n=m(`div`,`settings-update-fact`);return n.append(m(`span`,`settings-update-fact-label`,e),...t),n}function qa(){let e=ne(_().journal);if(!e)return null;let t=m(`div`,`settings-update-progress`);t.dataset.state=e.state,t.setAttribute(`role`,`status`);let n=e.state===`failed`;e.terminalLine&&t.appendChild(m(`div`,n?`dialog-error`:`settings-update-terminal`,e.terminalLine));let r=n?Ja(t,e.failureDetail):t,i=m(`ol`,`settings-update-steps`);for(let t of e.steps){let e=m(`li`,`settings-update-step`);e.dataset.status=t.status,e.append(m(`span`,`settings-update-step-state`,t.status),m(`span`,`settings-update-step-label`,t.label)),i.appendChild(e)}if(r.appendChild(i),e.outputTail.length===0)return t;let a=m(`pre`,`settings-update-output`,e.outputTail.join(`
3
3
  `));if(e.outputStepId&&(a.dataset.step=e.outputStepId),!e.outputStepLabel)return r.appendChild(a),t;let o=`Output from ${e.outputStepLabel}`;return a.setAttribute(`aria-label`,o),r.append(m(`div`,`settings-update-output-label`,o),a),t}function Ja(e,t){let n=m(`details`,`settings-update-details`);return n.appendChild(m(`summary`,`settings-update-details-summary`,`Show details`)),t&&n.appendChild(m(`div`,`settings-update-failure-detail`,t)),e.appendChild(n),n}function Ya(){let e=te(_().status),t=[e.label];if(e.releaseUrl){let n=m(`a`,`settings-link`,`View release`);n.href=e.releaseUrl,n.target=`_blank`,n.rel=`noopener noreferrer`,t.push(n)}return Ka(`Latest`,...t)}function Xa(){let e=m(`div`,`settings-view-status-block settings-update-status`),{status:t,journal:n}=_(),r=ce(t,n),i=m(`div`,`settings-update-summary`,r.headline);i.dataset.tone=r.tone,e.appendChild(i),e.appendChild(Ka(`Running`,ae(t))),o(t)&&e.appendChild(Ya());let a=typeof t?.lastCheckAt==`number`?t.lastCheckAt:null,s=Ka(`Last checked`,l({status:t,checkForUpdates:V.checkForUpdates,relativeTime:a?`${zt(a)}, ${new Date(a).toLocaleString()}`:zt(a)}));e.appendChild(s),e.appendChild(Ga());let c=qa();return c&&e.appendChild(c),e}var Za=2200,Qa=1600,$a=15e3,eo=new Set,W=new Map;function to(e,t){let n=m(`a`,`settings-about-link`,e);return n.href=t,n.target=`_blank`,n.rel=`noopener`,n}function no(e){return e?`On`:`Off`}function ro(e){return e===null?`not probed yet`:e?`resolved`:`not found on PATH`}function io(){let e=Array.isArray(V.customAgents)?V.customAgents:[];return e.length===0?[`None declared. Add customAgents to config.json.`]:e.map(e=>{let t=e.args.length>0?`${e.command} ${e.args.join(` `)}`:e.command,n=e.isShadowedByBuiltIn?`ignored: a built-in agent has this id, rename it`:ro(e.resolvable);return`${e.id} ${e.label} ${t} ${n}`})}function ao(){let e=m(`div`,`settings-view-status-block`);e.appendChild(m(`div`,`settings-section-title`,`Declared agents`));for(let t of io())e.appendChild(m(`div`,`settings-readonly`,t));return e}function oo(e){W.set(e,{tone:`ok`,text:`Saved`}),window.setTimeout(()=>{W.get(e)?.tone===`ok`&&(W.delete(e),U().refreshSettingsStatus())},Za)}async function so(t,n){eo.add(t.id),W.delete(t.id),U().refreshSettingsStatus();try{let r=await e(`update-settings`,{settings:{workflows:{rules:[{id:t.id,enabled:n}]}}},{timeoutMs:Ve});if(eo.delete(t.id),r.type===`settings-error`&&W.set(t.id,{tone:`error`,text:String(r.message)}),r.type===`settings-updated`){oo(t.id),Pt(r.settings);return}}catch(e){W.set(t.id,{tone:`error`,text:Be(e,Ve)})}eo.delete(t.id),U().refreshSettingsStatus()}function co(e){let t=ze(`settings-workflow-rule-status`);if(eo.has(e.id))return t.show(`busy`,`Saving`),t.element;let n=W.get(e.id);return n&&t.show(n.tone,n.text),t.element}function lo(e){let t=m(`div`,`settings-view-toggle-wrap`),n=m(`label`,`settings-view-toggle`),r=m(`input`,`settings-view-checkbox`);return r.type=`checkbox`,r.checked=e.isEnabled,r.disabled=eo.has(e.id),r.setAttribute(`aria-label`,`Run rule ${e.name}`),r.addEventListener(`change`,()=>{so(e,r.checked)}),n.append(r,m(`span`,`settings-view-toggle-state`,no(e.isEnabled)),m(`span`,`settings-readonly`,`${e.name} ${e.summary}`)),t.append(n,co(e)),t}function uo(){let e=m(`div`,`settings-view-status-block`);e.appendChild(m(`div`,`settings-section-title`,`Rules`));let t=ua(V.workflows);if(t.length>0){for(let n of t)e.appendChild(lo(n));return e}for(let t of la(V.workflows))e.appendChild(m(`div`,`settings-readonly`,t));return e}function fo(){let e=m(`div`,`settings-view-status-block`);e.appendChild(m(`div`,`settings-section-title`,`Last report`));for(let t of cn())e.appendChild(m(`div`,`settings-readonly`,t));return e}function po(){let e=m(`div`,`settings-view-status-block`);if((N.get(`remote-sessions`)??H.remoteSessions)!==!0)return e.appendChild(m(`div`,`settings-readonly`,`Turn on Remote Coder sessions to connect agent logins for them.`)),e;for(let t of[`claude-code`,`codex`]){let n=m(`div`,`settings-telegram-test`),r=d({variant:`secondary`,label:`Connect`,action:`connect-agent-login`,onClick:()=>Sn(t)});n.append(m(`div`,`settings-readonly`,xn(Ot(t),t)),r),e.appendChild(n)}return e}function mo(){let e=m(`div`,`settings-view-status-block`);return e.appendChild(d({variant:`secondary`,label:`Set up remote host`,action:`set-up-remote-host`,onClick:Cn})),e}function ho(){let e=m(`div`,`settings-view-status-block settings-server-power`),t=d({variant:`danger`,label:`Shut down`,action:`shutdown-server`,onClick:$t});return qt(t),e.append(d({variant:`secondary`,label:`Restart server`,action:`restart-server`,onClick:ln}),t),e}function go(e){return e.status===`server-power`?ho():e.status===`agent-logins`?po():e.status===`remote-setup`?mo():e.status===`update-actions`?Xa():e.status===`custom-agents`?ao():e.status===`workflows`?uo():m(`div`,`settings-readonly`,`Not available`)}function _o(e){let t=_i(e,V);return t?`Supplied by ${t}. Change the server environment and restart to replace this credential.`:``}function vo(e){if(e.control===`readonly`)return null;if(e.status===`usage-last-report`){let e=fo();return e.classList.add(`settings-view-status-slot`),e}if(e.id===`desktop-notifications`)return Eo(e);if(e.id===`telemetry-enabled`)return To();if(e.status===`telegram-delivery`)return xo();let t=_o(e);return t?m(`div`,`settings-view-warning settings-view-status-slot`,t):null}function yo(){let e=de.safeParse(V.telegramDelivery);if(!e.success)return[];let{setupWarning:t,lastFailure:n}=e.data,r=t?[t]:[];return n&&r.push(`The last Telegram send failed at ${new Date(n.failedAt).toLocaleString()}: ${n.message}`),r}function bo(e){e.replaceChildren(...yo().map(e=>m(`p`,`settings-view-warning`,e)))}function xo(){let e=m(`div`,`settings-view-status-slot settings-telegram-delivery`),t=m(`div`,`settings-telegram-delivery-lines`);bo(t);let n=d({variant:`secondary`,label:`Send test message`,action:`send-telegram-test`}),r=ze(`settings-telegram-test-status`);n.addEventListener(`click`,async()=>{n.disabled=!0;let e=await Re(`telegram-test`,{},r,{busyText:`Sending a test message to Telegram.`});n.disabled=!1,e?.type===`telegram-test-result`&&(La(tn({telegramDelivery:e.telegramDelivery})),bo(t),e.ok?r.show(`ok`,`Sent. Check the Telegram chat for the test message.`):r.show(`error`,`Not sent: ${e.error??`Telegram refused the message.`}`))});let i=m(`div`,`settings-telegram-test`);return i.append(n,r.element),e.append(t,i),e}async function So(){Co.disabled=!0;let e=await Re(`request-telemetry-deletion`,{},wo,{busyText:`Sending the deletion request.`,timeoutMs:$a});Co.disabled=!1,e?.type===`telemetry-deletion-result`&&(e.ok?wo.show(`ok`,`Deletion requested. New usage starts under a new id.`):wo.show(`error`,`Not sent: PostHog did not take the request. Try again later.`))}var Co=d({variant:`danger`,label:`Delete my data`,action:`delete-telemetry-data`,onClick:()=>h({title:`Delete your usage data?`,message:`We delete everything collected under this install. New usage starts under a new id.`,confirmLabel:`Delete my data`,danger:!0,onConfirm:()=>{So()}})}),wo=ze(`settings-telemetry-deletion-status`);function To(){let e=m(`div`,`settings-view-status-slot settings-telemetry-data`);return e.append(to(`Privacy details`,ka(`/privacy`)),Co,wo.element),e}function Eo(e){let t=Ht(()=>U().refreshRow(e,{force:!0}));return t.element.hidden?null:(t.element.classList.add(`settings-view-status-slot`),t.element)}function Do(){return m(`span`,`settings-view-experimental-tag`,`Experimental`)}function Oo(e,t){let n=m(`span`,`settings-view-chip`,t);return n.dataset.chip=e,n}function ko(e,t){let n=Me(e);return n?n.then(()=>t,()=>`Copy failed`):Promise.resolve(`Copy failed`)}function Ao(e,t,{copiedText:n,textToCopy:r}){let i=m(`span`,`settings-view-copy-status`);i.setAttribute(`role`,`status`),t.addEventListener(`click`,async()=>{i.textContent=await ko(r(),n),setTimeout(()=>{i.textContent=``},Qa)}),e.append(t,i)}var jo=`Approving a pack lets its commands run on this machine and its panels show what they read. Panels cannot reach the network, but they are trusted not to leak what they read. Any change to a file in a pack asks again.`,Mo={pending:`Pending`,approved:`Approved`,invalid:`Not loaded`},No=new Map,Po=null;async function Fo(t){No.set(t,{tone:`busy`,text:`Approving`}),Vo();try{let n=await e(`pack-approve`,{fingerprint:t},{timeoutMs:Ve});if(n.type!==`pack-approve-result`)throw Error(`Unexpected pack approval reply.`);if(!n.ok){No.set(t,{tone:`error`,text:n.error??`Could not approve this pack.`});return}No.delete(t)}catch(e){No.set(t,{tone:`error`,text:Be(e,Ve)})}finally{Vo()}}function Io(e){let t=m(`div`,`settings-view-setting-heading`);return t.append(m(`h2`,`settings-view-setting-title`,e.version===null?e.name:`${e.name} v${e.version}`),` `,Oo(`pack-state`,Mo[e.state])),t}function Lo(e){return[...[...e.description?[e.description]:[],`Folder: ${e.dir}`,...e.panels.map(e=>`Panel: ${e.label}${e.reads.length===0?`, reads nothing from the dashboard`:`, reads ${e.reads.join(`, `)}`}${e.acts.includes(`reviews`)?`; acts as you in Reviews without asking: may ${oe}`:``}`),...e.themes.length===0?[]:[`Themes: ${e.themes.map(e=>`${e.label} (${e.mode})`).join(`, `)}`],...e.files.length===0?[]:[`Files: ${e.files.join(`, `)}`],...e.needs.length===0?[]:[`Needs: ${e.needs.join(`, `)}`],...e.missingRequires.length===0?[]:[`Missing here: ${e.missingRequires.join(`, `)}; the pack stays off until this machine has them`]].map(e=>m(`p`,`settings-view-setting-description`,e)),...e.errors.map(e=>m(`p`,`settings-view-warning`,e)),...e.prFlows?En(e.prFlows):[]]}function Ro(e){let t=m(`div`,`settings-view-setting-control`),n=e.fingerprint;if(n===null)return t;let r=No.get(n),i=d({variant:`secondary`,label:`Approve`,action:`pack-approve`,disabled:e.state!==`pending`||r?.tone===`busy`,onClick:()=>{Fo(n)}}),a=m(`span`,`settings-view-pack-status`);return a.setAttribute(`role`,`status`),Le(a,r?.tone??null,r?.text??``),t.append(i,a),t}function zo(e){let t=m(`article`,`settings-view-setting settings-view-pack`);t.dataset.packState=e.state;let n=m(`div`,`settings-view-setting-text`);return n.append(Io(e),...Lo(e)),t.append(n,Ro(e)),t}function Bo(){let e=Yt(),t=m(`p`,`settings-view-section-description`,jo);if(!e)return[t,m(`p`,`settings-view-setting-description`,`Waiting for the server to list packs.`)];let n=e.warnings.map(e=>m(`p`,`settings-view-warning`,e));return e.packs.length===0?[t,...n,m(`p`,`settings-view-setting-description`,`No packs yet. Copy a pack folder into ~/.glimmervoid/packs/ or list its path in packs in config.json.`)]:[t,...n,...e.packs.map(zo)]}function Vo(){Po?.isConnected&&Po.replaceChildren(...Bo())}rn(Vo);function Ho(e){Po=m(`div`,`settings-view-stack`),e.appendChild(Po),Vo()}var Uo=`team-review-enabled`,Wo=new Map,Go=Promise.resolve(),Ko={"pref:flyingAnimalsMinGapSeconds":e=>Ge(Number(e)),"pref:flyingAnimalsMaxGapSeconds":e=>Ye(Number(e)),"pref:flyingAnimalsMinDurationSeconds":e=>Ue(Number(e)),"pref:flyingAnimalsMaxDurationSeconds":e=>Je(Number(e)),"pref:flyingAnimalsScale":e=>Ze(Number(e)),"pref:flyingAnimalsOnPhone":e=>Ke(e===!0)};function qo(e,t){if(e.path===`pref:phoneArrowPad`){Qe(t===!0),Ft(t===!0);return}if(e.path===`pref:nextAttentionKeyCode`){$e(String(t)),Zt(lt()),U().refreshShortcutGroups();return}if(e.path===`pref:themeId`){it(String(t)),nn(String(t)),Ct();return}if(e.path===`pref:flyingAnimalsEnabled`){ct(t===!0),Xt(t===!0);return}let n=Ko[e.path];n?(n(t),Xt(mt())):e.path===`pref:soundEnabled`?dn(t===!0):e.path===`pref:soundId`?(Xe(String(t)),vn(String(t))):e.path===`pref:notificationsEnabled`&&(We(t===!0),t===!0&&Gt().then(()=>U().refreshRow(e,{force:!0})))}function G(e,t){let n=Wo.get(e.id);n!==void 0&&clearTimeout(n),Wo.delete(e.id),t&&Ca.set(e.id,t),t||Ca.delete(e.id),U().refreshRowFoot(e)}function Jo(e){G(e,{tone:`saved`,text:`Saved`}),Wo.set(e.id,window.setTimeout(()=>G(e,null),Za))}function Yo(e,t){return e.id===Uo&&t===!0&&I(e)!==!0&&kn(V.teamReview)}function K(e,t){F.delete(e.id),Yo(e,t)?(U().refreshRow(e,{force:!0}),Qo(e)):e.path.startsWith(`pref:`)?(H[e.path]=t,qo(e,t),U().refreshRow(e),Jo(e)):N.has(e.id)&&JSON.stringify(N.get(e.id))===JSON.stringify(t)||(N.set(e.id,t),G(e,{tone:`saving`,text:`Saving`}),Go=Go.then(()=>Xo(e,t)))}async function Xo(t,n){let r=Fi(R,H,t,n);if(Object.keys(r).length===0)N.delete(t.id),G(t,null),U().refreshRow(t);else{G(t,{tone:`saving`,text:`Saving`});try{let i=await e(`update-settings`,{settings:r});if(N.get(t.id)===n&&N.delete(t.id),i.type===`settings-error`){G(t,{tone:`error`,text:String(i.message)}),U().refreshRow(t,{force:!0});return}if(i.type!==`settings-updated`){G(t,{tone:`error`,text:`The server did not confirm the save.`}),U().refreshRow(t,{force:!0});return}Pt(i.settings),Jo(t)}catch(e){N.get(t.id)===n&&N.delete(t.id),G(t,{tone:`error`,text:e?.message||`Failed to save the setting.`}),U().refreshRow(t,{force:!0})}}}function Zo(e,t){t&&F.set(e.id,t),t||F.delete(e.id),U().refreshRowFoot(e)}function Qo(e){h({title:e.title,message:`No review skill is chosen yet. Pick one in Review skill below and turn team review on again, or turn it on now to review with no skill, where the agent uses whatever skills it has.`,confirmLabel:`Turn on with no skill`,onConfirm:()=>{$o(e)}})}async function $o(t){let n=V.teamReview,r={...n&&typeof n==`object`?n:{},enabled:!0,skill:``};G(t,{tone:`saving`,text:`Saving`});try{let n=await e(`update-settings`,{settings:{teamReview:r}});if(n.type!==`settings-updated`){G(t,{tone:`error`,text:n.type===`settings-error`?String(n.message):`The server did not confirm the save.`});return}Pt(n.settings),Jo(t)}catch(e){G(t,{tone:`error`,text:e?.message||`Failed to save the setting.`})}}var es=`M4 10L8 6L12 10`,ts=`M4 6L8 10L12 6`,ns=`M6 4h0.01M10 4h0.01M6 8h0.01M10 8h0.01M6 12h0.01M10 12h0.01`,rs=Object.freeze({ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1});function is(e,t){if(!t.exclusiveMin)return t.min;if(e.integer!==!1)return t.min+1}function as(e){let t=m(`div`,`settings-view-toggle-wrap`),n=m(`input`,`settings-view-switch`);return n.type=`checkbox`,n.setAttribute(`role`,`switch`),n.checked=I(e)===!0,e.id===`desktop-notifications`&&!Dt()&&(n.checked=!1,n.disabled=!0),n.setAttribute(`aria-labelledby`,e.id),n.addEventListener(`change`,()=>{let t=n.checked;aa(e,t)?(n.checked=!1,h({title:e.title,message:e.warning??``,confirmLabel:`Turn on`,danger:!0,onConfirm:()=>K(e,!0)})):K(e,t)}),t.appendChild(n),t}function os(e,t){if(!e.suggestionsFrom)return;let n=Dn(V.teamReviewEnvironment);n?.agents.length===0&&en();let r=On(e.suggestionsFrom,n,H),i=`${e.id}-suggestions`;document.getElementById(i)?.remove();let a=m(`datalist`);a.id=i;for(let e of r){let t=m(`option`);t.value=e.value,t.label=e.label,a.appendChild(t)}document.body.appendChild(a),t.setAttribute(`list`,i),t.placeholder=`Agent default`,e.suggestionsFrom===`review-skills`&&(t.placeholder=`No skill`)}function ss(e){let t=m(`div`,`settings-view-shortcut-key`),n=fn(ht(`next-attention`,an,String(I(e)))),r=d({variant:`secondary`,label:`Record`,action:`record-shortcut-key`}),i=m(`span`,`settings-view-shortcut-key-prompt`);return i.setAttribute(`role`,`status`),r.addEventListener(`click`,()=>cs(e,t,r,i)),t.append(n,r,i),t}function cs(e,t,n,r){let i=()=>{window.removeEventListener(`keydown`,o,!0),window.removeEventListener(`pointerdown`,a,!0),window.removeEventListener(`focusin`,a,!0),n.disabled=!1,r.textContent=``},a=e=>{e.target instanceof Node&&t.contains(e.target)||i()},o=t=>{if(!n.isConnected||!n.checkVisibility()){i();return}t.preventDefault(),t.stopImmediatePropagation();let r=ot(t,an);r.kind!==`ignored`&&(r.kind===`refused`?Zo(e,r.reason):(i(),Zo(e,null),n.focus(),r.kind===`recorded`&&K(e,r.keyCode)))};Zo(e,null),n.disabled=!0,r.textContent=`Press the new shortcut, or Esc to cancel.`,window.addEventListener(`keydown`,o,!0),window.addEventListener(`pointerdown`,a,!0),window.addEventListener(`focusin`,a,!0)}function ls(e,t,n){e.addEventListener(`blur`,t),e.addEventListener(`keydown`,e=>{e.key===`Enter`?(e.preventDefault(),t()):e.key===`Escape`&&(e.preventDefault(),n())})}function us(e){return e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&[`text`,`number`,`password`].includes(e.type)}function ds(e,t){P.set(t,{base:I(e),isDirty:!1}),t.addEventListener(`input`,()=>{let e=P.get(t);e&&(e.isDirty=!0)})}function q(e,t,n){t.value!==n&&(t.value=n),P.set(t,{base:I(e),isDirty:!1}),Zo(e,null)}function fs(e,t,n,r=!1){let i=P.get(t);if(!i)return;let a=$i(R,e,i,t.value,H,r);a.kind===`invalid`?Zo(e,a.error):a.kind===`unchanged`?q(e,t,n):aa(e,a.value)?(q(e,t,n),h({title:e.title,message:e.warning??``,confirmLabel:`Save`,danger:!0,onConfirm:()=>K(e,a.value)})):(P.set(t,{base:a.value,isDirty:!1}),K(e,a.value))}function ps(e){let t=m(`input`,`settings-view-input`);t.type=e.control===`password`?`password`:`text`;let n=()=>String(I(e)??``);t.value=n(),e.control===`password`&&(t.value=``,t.placeholder=n()?`Configured`:`Not configured`);let r=_i(e,V);return r&&(t.disabled=!0,t.setAttribute(`aria-description`,`Supplied by ${r}`)),t.autocomplete=`off`,t.spellcheck=!1,t.setAttribute(`aria-labelledby`,e.id),os(e,t),ds(e,t),ls(t,()=>{if(e.control===`password`){let n=t.value;if(n===``)return;q(e,t,``),K(e,n)}else fs(e,t,n())},()=>q(e,t,e.control===`password`?``:n())),t}function ms(e){let t=m(`input`,`settings-view-input`),n=wi(e);t.type=`number`;let r=()=>Wi(I(e));t.value=r(),t.step=e.integer===!1?String(e.step??`any`):`1`;let i=n?is(e,n):void 0;i!=null&&(t.min=String(i)),n?.max!=null&&(t.max=String(n.max)),t.autocomplete=`off`,t.setAttribute(`aria-labelledby`,e.id),ds(e,t),ls(t,()=>fs(e,t,r(),t.validity.badInput),()=>q(e,t,r()));let a=e.unit?.label;if(!a)return t;let o=m(`div`,`settings-view-number`),s=m(`span`,`settings-view-unit`,a);return s.setAttribute(`aria-hidden`,`true`),t.setAttribute(`aria-description`,a),o.append(t,s),o}function hs(e,t){let n=[...e.querySelectorAll(`[role="radio"]`)],r=n.some(e=>e.dataset.value===t);for(let[e,i]of n.entries()){let n=i.dataset.value===t;i.setAttribute(`aria-checked`,String(n)),i.tabIndex=n||!r&&e===0?0:-1}}function gs(e,t,n){n!==String(I(e))&&(hs(t,n),K(e,n),hs(t,String(I(e))))}function _s(e){let t=m(`div`,`settings-view-segmented`);t.setAttribute(`role`,`radiogroup`),t.setAttribute(`aria-labelledby`,e.id);let n=e.options??[];for(let r of n){let n=ue(`settings-view-segment`,r.label);n.dataset.value=r.value,n.setAttribute(`role`,`radio`),n.addEventListener(`click`,()=>gs(e,t,r.value)),t.appendChild(n)}return t.addEventListener(`keydown`,r=>{let i=rs[r.key];if(!i||n.length===0)return;r.preventDefault();let a=Math.max(0,n.findIndex(t=>t.value===String(I(e)))),o=n[(a+i+n.length)%n.length];gs(e,t,o.value),t.querySelector(`[data-value="${CSS.escape(o.value)}"]`)?.focus()}),hs(t,String(I(e))),t}function vs(e){let t=m(`select`,`settings-view-input`);t.setAttribute(`aria-labelledby`,e.id);for(let n of e.options??[]){let e=m(`option`,null,n.label);e.value=n.value,t.appendChild(e)}return t.value=String(I(e)),t.addEventListener(`change`,()=>K(e,t.value)),t}function ys(e,t){let n=e.valueKind===`posthog-projects`?`One project id per line, or none. Shift+Enter for a new line.`:`One per line. Shift+Enter for a new line.`;return t.length>0||!e.listEmptyText?n:`${e.listEmptyText} ${n}`}function bs(e){let t=m(`textarea`,`settings-view-input settings-view-list-input`),n=()=>Si(I(e)),r=()=>n().join(`
4
- `);t.rows=3,t.value=r(),t.autocomplete=`off`,t.spellcheck=!1,t.placeholder=e.listPlaceholder??``,t.setAttribute(`aria-labelledby`,e.id),ds(e,t),t.addEventListener(`blur`,()=>fs(e,t,r())),t.addEventListener(`keydown`,n=>{n.key===`Escape`?(n.preventDefault(),q(e,t,r())):n.key!==`Enter`||n.shiftKey||(n.preventDefault(),fs(e,t,r()))});let i=m(`div`,`settings-view-list`);return i.append(t,m(`span`,`settings-view-list-hint`,ys(e,n()))),i}var xs=null,J=null;function Ss(e){let t=jt(),n=new Map(t.map(e=>[e.view,e.label])),r=un(t.map(e=>e.view),Si(I(e))),i=m(`ol`,`settings-view-tab-order`);i.setAttribute(`aria-labelledby`,e.id);for(let[t,a]of r.entries()){let o=n.get(a)??a,s=m(`li`,`settings-view-tab-order-item`),c=m(`span`,`settings-view-tab-order-grip`);c.setAttribute(`aria-hidden`,`true`),c.appendChild(re(ns,`2.4`)),s.append(c,m(`span`,`settings-view-tab-order-label`,o),ws(e,r,a,t-1,`up`,`Move ${o} up`),ws(e,r,a,t+1,`down`,`Move ${o} down`)),Cs(e,s,r,a,t),i.append(s)}return i}function Cs(e,t,n,r,i){t.draggable=!0,t.addEventListener(`dragstart`,e=>{J=r,e.dataTransfer?.setData(`text/plain`,r),e.dataTransfer&&(e.dataTransfer.effectAllowed=`move`)}),t.addEventListener(`dragend`,()=>{J=null}),t.addEventListener(`dragover`,e=>{J&&J!==r&&(e.preventDefault(),t.dataset.dropTarget=n.indexOf(J)<i?`after`:`before`)}),t.addEventListener(`dragleave`,()=>delete t.dataset.dropTarget),t.addEventListener(`drop`,a=>{a.preventDefault(),delete t.dataset.dropTarget;let o=J;J=null,o&&o!==r&&K(e,sn(n,o,i))})}function ws(e,t,n,r,i,a){let o=`${n}:${i}`,s=d({variant:`icon`,size:`small`,label:a,icon:re(i===`up`?es:ts),action:`move-tab-${i}`,disabled:r<0||r>=t.length,onClick:()=>{xs=o,K(e,sn(t,n,r))}});return o===xs&&(s.dataset.restoresFocus=`true`),s}var Ts=null;function Es(){return e(`list-agents`,{}).then(e=>{if(e.type!==`agents-listed`)throw Error(`the agent list did not arrive`);return Ts=e.agents.map(({id:e,label:t,resolvable:n})=>({id:e,label:t,resolvable:n})),Ts})}function Ds(e,t){let n=m(`li`,`settings-view-agent-visibility-item`),r=m(`span`,`agent-mark`);r.setAttribute(`aria-hidden`,`true`),_t(r,t.id,t.label);let i=m(`span`,`settings-view-agent-visibility-label`,t.label);i.id=`${e.id}-${t.id}`;let a=m(`input`,`settings-view-switch`);return a.type=`checkbox`,a.setAttribute(`role`,`switch`),a.setAttribute(`aria-labelledby`,i.id),a.checked=!Si(I(e)).includes(t.id),a.disabled=t.id===gt,a.addEventListener(`change`,()=>{let n=Si(I(e)).filter(e=>e!==t.id);K(e,a.checked?n:[...n,t.id])}),n.append(r,i,a),n}function Os(e,t,n,r){t.replaceChildren(...r.filter(e=>e.resolvable).map(t=>Ds(e,t)));let i=r.filter(e=>!e.resolvable).map(e=>e.label);n.textContent=i.length>0?`Not installed: ${i.join(`, `)}.`:``}function ks(e){let t=m(`div`,`settings-view-agent-visibility`),n=m(`ul`,`settings-view-agent-visibility-list`);n.setAttribute(`aria-labelledby`,e.id);let r=m(`span`,`settings-view-list-hint`,`Checking which agents are installed.`);return t.append(n,r),Ts&&Os(e,n,r,Ts),Es().then(t=>Os(e,n,r,t)).catch(()=>{r.textContent=`Could not load the agent list. Reopen Settings to try again.`}),t}function As(e){return e.control===`readonly`?go(e):e.control===`toggle`?as(e):e.control===`number`?ms(e):e.control===`select`?na(e)===`segmented`?_s(e):vs(e):e.control===`list`?bs(e):e.control===`shortcut-key`?ss(e):e.control===`tab-order`?Ss(e):e.control===`agent-visibility`?ks(e):ps(e)}function js(e){let t=m(`div`,`settings-view-setting-heading`),n=Da(e),r=m(`h2`,`settings-view-setting-title`,e.title);r.id=e.id,Dr(e)&&!Or(ki(R,n.id)??n)&&r.append(` `,Do()),r.addEventListener(`click`,()=>Oa(n.id,e.id));let i=d({variant:`quiet`,size:`small`,label:`#`,action:`copy-setting-link`});return i.setAttribute(`aria-label`,`Copy link`),t.appendChild(r),Ao(t,i,{copiedText:`Link copied`,textToCopy:()=>new URL(wt(n.id,e.id),location.href).href}),t}function Ms(e){let t=ki(R,Da(e).id);return t?hi(L(t)):null}function Ns(e,t){let n=m(`div`,`settings-view-chips`);for(let r of gi(e,t))n.appendChild(Oo(r.kind,r.text));return n}function Ps(e){return e.control===`readonly`||_i(e,V)?!1:!ta(e,I(e))}function Fs(e){let t=m(`div`,`settings-view-control-foot`),n=m(`span`,`settings-view-save-status`);n.setAttribute(`role`,`status`);let r=d({variant:`quiet`,size:`small`,label:`Reset`,action:`reset-setting`});return r.addEventListener(`click`,()=>{let t=ea(e),n=sa(e);n===null?K(e,t):h({title:e.title,message:n,confirmLabel:`Reset`,danger:!0,onConfirm:()=>K(e,t)})}),t.append(n,r),t}function Is(e,t){let n=e.querySelector(`.settings-view-save-status`),r=Ca.get(t.id);n&&(n.textContent=r?.text??``,r&&(n.dataset.tone=r.tone),r||delete n.dataset.tone);let i=e.querySelector(`[data-action="reset-setting"]`);i&&(i.hidden=!Ps(t));let a=e.querySelector(`.settings-view-control-foot`);a&&(a.hidden=!r&&!Ps(t));let o=e.querySelector(`.settings-view-field-error`),s=F.get(t.id);o&&!s&&o.remove(),o&&s&&(o.textContent=s),!o&&s&&e.querySelector(`.settings-view-setting-control`)?.appendChild(m(`div`,`settings-view-field-error`,s))}function Ls(e){let t=m(`article`,`settings-view-setting`);t.dataset.settingId=e.id,e.control===`readonly`&&(t.dataset.readout=`true`);let n=m(`div`,`settings-view-setting-text`);n.append(js(e),m(`p`,`settings-view-setting-description`,e.description));let r=Ns(e,Ms(e));r.childElementCount>0&&n.appendChild(r);let i=m(`div`,`settings-view-setting-control`);i.appendChild(As(e)),e.control!==`readonly`&&i.appendChild(Fs(e)),t.append(n,i),ia(e,I(e))&&t.appendChild(m(`div`,`settings-view-warning settings-warning`,e.warning));let a=vo(e);return a&&t.appendChild(a),Is(t,e),t}function Rs(e){return z?.querySelector(`[data-setting-id="${e.id}"]`)??null}function zs(e){let t=e.querySelector(`.settings-view-setting-control`);t&&(t.querySelector(`[data-restores-focus="true"]:not([disabled])`)??t.querySelector(`[role="radio"][aria-checked="true"]`)??t.querySelector(`input:not([disabled]), textarea:not([disabled]), select:not([disabled]), button:not([disabled])`))?.focus()}function Bs(e,t){if(!us(e)||!us(t))return;e.disabled=t.disabled,e.placeholder=t.placeholder;let n=P.get(t);n&&!Qi(P.get(e))&&(P.set(e,{base:n.base,isDirty:!1}),e.value!==t.value&&(e.value=t.value))}function Vs(e,t,n){if(e===n){Bs(e,t);return}let r=[...e.children],i=[...t.children];for(let[t,a]of i.entries()){let i=r[t];i?i.contains(n)?Vs(i,a,n):i.replaceWith(a):e.appendChild(a)}for(let e of r.slice(i.length))e.remove()}function Hs(e,{force:t=!1}={}){let n=Rs(e);if(!n)return;let r=document.activeElement,i=n.contains(r),a=i&&!t&&us(r)?r:null;(!a||!Qi(P.get(a)))&&F.delete(e.id);let o=Ls(e);a?Vs(n,o,a):(n.replaceWith(o),i&&zs(o))}function Us(e){let t=Rs(e);t&&Is(t,e)}function Ws(e){Rs(e)?.querySelector(`.settings-view-setting-control`)?.replaceChildren(go(e))}function Gs(){for(let e of L(B))e.control===`readonly`?Ws(e):Hs(e)}function Ks(e,t){let n=t.querySelector(`.settings-view-status-slot`),r=vo(e);n&&r&&n.replaceWith(r),n&&!r&&n.remove(),!n&&r&&t.appendChild(r)}function qs(){for(let e of L(B)){if(!e.status)continue;let t=Rs(e);t&&(e.control===`readonly`?Ws(e):Ks(e,t))}}var Js=`browser-appearance`,Ys=`flying-animals`,Y=!1,Xs=!1,Zs=null,Qs=null,X=null,Z=null,Q=null,$s=null,ec=null,$=``;function tc(e){requestAnimationFrame(()=>{let t=document.getElementById(e),n=t?.closest(`.settings-view-advanced-panel`);n&&(Y=!0,n.hidden=!1,z?.querySelector(`.settings-view-advanced-toggle`)?.setAttribute(`aria-expanded`,`true`));let r=t?.closest(`.settings-view-setting`);r&&(r.scrollIntoView({block:`center`}),r.classList.remove(`settings-view-setting-flash`),requestAnimationFrame(()=>r.classList.add(`settings-view-setting-flash`)))})}function nc(e){e.replaceChildren();for(let t of nt(an,gn())){let n=m(`div`,`shortcut-group`);n.appendChild(m(`h2`,`settings-view-subsection-title`,t.title));let r=m(`dl`,`shortcut-rows`);for(let e of t.items){let t=m(`dd`,`shortcut-keys`);e.combos.forEach((e,n)=>{n>0&&t.appendChild(m(`span`,`shortcut-sep`,`/`)),Qt(t,e)}),r.append(m(`dt`,`shortcut-label`,e.label),t)}n.appendChild(r),e.appendChild(n)}}function rc(e){return jt().find(t=>t.gate!==void 0&&`fromSettings`in t.gate&&t.gate.fromSettings===e)?.label}function ic(e){let t=m(`ul`,`settings-view-stack settings-features`);for(let e of xt){let n=R.find(t=>t.id===e.sectionId),r=Aa(e.settingId),i=rc(Lt[e.rule]);if(!n||!r||!i)continue;let a=I(r)===!0,o=m(`li`,`settings-feature`),s=m(`div`,`settings-feature-head`);s.append(m(`span`,`settings-feature-name`,i),Oo(`feature`,a?`On`:`Off`)),o.append(s,m(`p`,`settings-view-section-description`,n.description),mn(e.sectionId,e.settingId,r.title)),t.appendChild(o)}e.appendChild(t)}function ac(e){let t=m(`div`,`settings-about`),n=m(`span`,`settings-about-version`,`GLIMMERVOID `);n.appendChild(m(`span`,`settings-about-v`,`v0.52.3-next.749`));let r=m(`span`,`settings-about-links`);r.append(to(`GitHub`,`https://github.com/${wn}`),to(`Changelog`,`https://github.com/${wn}/blob/main/CHANGELOG.md`),to(`Website`,ka(`/`))),t.append(n,r),e.appendChild(t)}function oc(e){if(H[`pref:soundEnabled`]===e)return;H[`pref:soundEnabled`]=e;let t=Aa(`alert-sounds-enabled`);t&&Hs(t)}function sc(){return d({variant:`secondary`,label:`Reset all to defaults`,action:`reset-flying-animals`,onClick:()=>{He(),Ta(V),Xt(mt()),pc()}})}function cc(e){let t=m(`div`,`settings-view-advanced`),n=ue(`dialog-advanced-toggle settings-view-advanced-toggle`,`Advanced`);n.setAttribute(`aria-expanded`,String(Y)),n.setAttribute(`aria-controls`,`settings-view-advanced-panel`);let r=m(`div`,`dialog-advanced-panel settings-view-advanced-panel`);r.id=`settings-view-advanced-panel`,r.hidden=!Y,n.addEventListener(`click`,()=>{Y=!Y,r.hidden=!Y,n.setAttribute(`aria-expanded`,String(Y))});for(let t of e)r.append(Ls(t));return B.id===Js&&r.append(sc()),t.append(n,r),t}function lc(e){let t=m(`div`,`settings-view-streamer-placeholder`),n=d({variant:`primary`,label:`Turn off streamer mode`,action:`turn-off-streamer-mode`}),r=m(`span`,`settings-view-copy-status`,``);r.setAttribute(`role`,`status`),n.addEventListener(`click`,async()=>{n.disabled=!0,r.textContent=``;let e=await Rt(!1);n.disabled=!1,r.textContent=e}),t.append(m(`p`,`settings-view-section-description`,`Settings are hidden in streamer mode.`),n,r),e.appendChild(t)}hn(()=>pc());function uc(){let e=m(`div`,`settings-view-advanced`),t=ue(`dialog-advanced-toggle`,`Animal gallery`);t.setAttribute(`aria-controls`,`settings-view-animal-gallery-panel`);let n=m(`div`,`dialog-advanced-panel settings-view-advanced-panel`);n.id=`settings-view-animal-gallery-panel`;let r=()=>{t.setAttribute(`aria-expanded`,String(Xs)),n.hidden=!Xs,Xs&&n.childElementCount===0&&n.append(Mn())};return t.addEventListener(`click`,()=>{Xs=!Xs,r()}),r(),e.append(t,n),e}function dc(e){let t=m(`header`,`settings-view-subsection`),n=m(`h2`,`settings-view-subsection-title`,e.title);return n.addEventListener(`click`,()=>Oa(e.id)),t.append(n,m(`p`,`settings-view-section-description`,e.description)),t}function fc(e,t){for(let n of t.settings.filter(e=>e.access!==`advanced`))e.appendChild(Ls(n)),n.id===Ys&&e.appendChild(uc());let n=t.settings.filter(e=>e.access===`advanced`);n.length>0&&e.append(cc(n))}function pc(){if(Cc(),$){xc();return}if(!z)return;if(z.textContent=``,Jt()){lc(z);return}let e=m(`header`,`settings-view-section-header`),t=m(`h1`,`settings-view-section-title`,B.title);t.tabIndex=-1,t.addEventListener(`click`,()=>Oa(B.id));let n=m(`div`,`settings-view-section-title-row`);n.appendChild(t);let r=Or(B);r&&t.append(` `,Do());let i=hi(L(B));if(i&&n.appendChild(Oo(`scope`,mi[i])),e.append(n,m(`p`,`settings-view-section-description`,B.description)),r&&e.appendChild(m(`p`,`settings-view-warning settings-view-experimental-caution`,`Experimental: this may change or break between releases.`)),z.appendChild(e),B.id===`browser-shortcuts`){let e=m(`div`,`settings-view-stack`);fc(e,B),z.appendChild(e);let t=m(`div`,`shortcut-groups settings-view-shortcuts`);nc(t),z.appendChild(t);return}if(B.id===`browser-about`){ac(z);return}if(B.id===`browser-status-key`){z.appendChild(pn()),z.appendChild(Kt());return}if(B.id===`lanes-features`){ic(z);return}if(B.id===`machine-packs`){Ho(z);return}let a=m(`div`,`settings-view-stack`);for(let e of Ea(B))e.id!==B.id&&a.appendChild(dc(e)),fc(a,e);z.appendChild(a)}function mc(e,{focusContent:t=!1,settingId:n=null,updateHash:r=!0,openPhoneSection:i=!0}={}){r&&$&&($=``,Q&&(Q.value=``));let a=ki(R,e)??B;B.id!==a.id&&(Y=!1),Ia(a);let o=R.find(t=>t.id===e)??a;hc(Z),i&&Vt()&&($s=o.id),pc(),Ac(B)&&kc(),B.id===`machine-updates`&&Ua(),r&&Oa(o.id,n),n&&tc(n),t&&z?.querySelector(`h1`)?.focus()}function hc(e){for(let t of e?.querySelectorAll(`[data-settings-section]`)||[]){let e=t.dataset.settingsSection===B.id;t.setAttribute(`aria-current`,e?`page`:`false`)}}function gc(e){return e.section!==null}function _c(e){Q&&(Q.value=``,$=``,Tc(),mc(e.section.id,{settingId:e.setting.id}))}function vc(e){return ti(xa(),e,Tr.fileOnly)}function yc(e,t,n,r,i){let a=m(e,t),o=r.matches.find(e=>e.field===i),s=o?n.indexOf(o.text):-1;if(!o||s<0)return a.textContent=n,a;let c=0;for(let e of o.spans)a.append(n.slice(c,s+e.start),m(`mark`,`settings-view-search-highlight`,n.slice(s+e.start,s+e.end))),c=s+e.end;return a.append(n.slice(c)),a}function bc(e,t){let{currentText:n,defaultText:r,jsonFragment:i}=Ei(t.setting,V);if(n!==null&&e.appendChild(m(`span`,`settings-view-search-current`,n)),e.append(m(`span`,`settings-view-search-default`,r),Ns(t.setting,null),m(`p`,`settings-view-list-hint`,`Edit in config.json or with glimmervoid settings set.`)),i===null)return;let a=m(`div`,`settings-view-control-foot`);Ao(a,d({variant:`quiet`,size:`small`,label:`Copy as JSON`,action:`copy-json`}),{copiedText:`JSON copied`,textToCopy:()=>i}),e.appendChild(a)}function xc(){if(!z)return;if(z.textContent=``,Jt()){lc(z);return}let e=vc($),t=m(`div`,`settings-view-section-header`);if(t.append(m(`h1`,`settings-view-section-title`,`Settings search`),m(`p`,`settings-view-section-description`,`${e.length} ${e.length===1?`result`:`results`} for "${$}"`)),z.appendChild(t),e.length===0){z.appendChild(m(`p`,`settings-empty settings-view-search-empty`,`No settings found.`));return}let n=m(`ol`,`settings-view-search-results`);n.setAttribute(`aria-label`,`Settings search results`);for(let t of e){let e=m(`li`,`settings-view-search-result`);e.tabIndex=-1;let r=Di(R,t.section,t.setting);e.appendChild(yc(`p`,`settings-view-search-breadcrumb`,r,t,`section`));let i=yc(`span`,`settings-view-setting-title`,t.setting.title,t,`title`);if(gc(t)){let n=ue(`settings-view-search-open`);n.appendChild(i),n.addEventListener(`click`,()=>_c(t)),e.appendChild(n)}gc(t)||(e.classList.add(`settings-view-search-file-only`),e.appendChild(i)),e.append(yc(`p`,`settings-view-setting-description`,t.setting.description,t,`description`),yc(`code`,`settings-view-key-path`,t.setting.path,t,`path`));let a=new Set([`title`,`description`,`path`,`section`]);if(!t.matches.some(e=>a.has(e.field))){let n=t.matches.find(e=>e.field===`options`)??t.matches.find(e=>e.field===`keywords`);n&&e.appendChild(yc(`p`,`settings-view-list-hint`,n.text,t,n.field))}gc(t)||bc(e,t),n.appendChild(e)}z.appendChild(n)}function Sc(){return Mi(R,$s,$,Jt())}function Cc(){if(!X)return;let e=Sc(),t=X.dataset.settingsScreen!==e;X.dataset.settingsScreen=e,ec&&(ec.hidden=e!==`section`),t&&vt()}function wc(){let e=B.id;Ec(``),Z?.querySelector(`[data-settings-section="${e}"]`)?.focus()}function Tc(){if(Z&&X){Z.textContent=``;for(let e of ji(Ai(R))){let t=m(`div`,`settings-view-nav-group`);e.heading&&t.appendChild(m(`div`,`settings-view-nav-heading`,e.heading));for(let n of e.sections){let e=ue(`settings-view-nav-item`,n.title);Or(n)&&e.append(` `,Do()),e.dataset.settingsSection=n.id,e.addEventListener(`click`,()=>mc(n.id,{focusContent:Vt()})),t.appendChild(e)}Z.appendChild(t)}$?(Cc(),xc()):mc(B.id,{updateHash:!1,openPhoneSection:!1})}}function Ec(e,{updateHash:t=!0}={}){$=e.trim(),Q&&(Q.value=e),$s=null,t&&history.replaceState(history.state,``,St($)),Tc()}function Dc(e){if($&&e.key===`Enter`&&e.target===Q){let t=vc($).find(gc);if(!t)return;e.preventDefault(),_c(t);return}if(e.key===`Escape`&&$){if(!Q)return;e.preventDefault(),Ec(``),Q.focus();return}if(e.key!==`ArrowUp`&&e.key!==`ArrowDown`||!Z)return;let t=[...Z.querySelectorAll(`[data-settings-section]`)].filter(e=>e instanceof HTMLElement),n=document.activeElement;if(!(n instanceof HTMLElement))return;let r=t.indexOf(n);r<0||(e.preventDefault(),t[(r+(e.key===`ArrowDown`?1:-1)+t.length)%t.length].focus())}function Oc(e){on(oc),Zs=e,Zs.textContent=``,X=m(`div`,`settings-view-shell`);let t=m(`div`,`settings-view-sidebar`);Q=m(`input`,`settings-view-search`),Q.type=`search`,Q.placeholder=`Search settings`,Q.setAttribute(`aria-label`,`Search settings`),Z=m(`nav`,`settings-view-nav`),Z.setAttribute(`role`,`navigation`),Z.setAttribute(`aria-label`,`Settings sections`),ec=d({variant:`secondary`,label:`Settings`,icon:re(fe),action:`back-to-settings-list`,hidden:!0,onClick:Et}),ec.setAttribute(`aria-label`,`Back to settings sections`);let n=m(`div`,`settings-view-content`);n.setAttribute(`aria-live`,`polite`),Fa(n),Q.addEventListener(`input`,()=>{let e=Q;e&&Ec(e.value)}),Q.addEventListener(`keydown`,Dc),Z.addEventListener(`keydown`,Dc),t.append(Q,ec,Z),X.append(t,n),Zs.appendChild(X),La(g()),Ma(),Ta(V),kt(Sc),bt(Lc),Tc(),kc(),Qs?.disconnect(),Qs=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&kc()}),Qs.observe(Zs),Pc()}function kc(){_n().then(jc)}function Ac(e){return L(e).some(e=>e.path===`pref:soundId`)}function jc(){if(ja(),H[`pref:soundId`]=yn(st()),$){xc();return}let e=Aa(`alert-sound`);e&&Ac(B)&&Hs(e)}function Mc(e,t,n){let r=Bt(e??n);r?Ec(r.query):(Ec(``,{updateHash:!1}),Vt()&&!e?history.replaceState(history.state,``,St(``)):mc(e||B.id,{settingId:t}))}function Nc(e){let t=ni(e,R,Ar,jr);Mc(t?.sectionId??null,t?.settingId??null,e)}function Pc(){let e=Ut();e&&(e.isLink?Nc(e.hashAtRequest):Mc(e.sectionId,e.settingId,e.hashAtRequest))}function Fc(){La(g());let e=Ma();Ta(V),$?xc():e?(Tc(),pc()):Gs()}function Ic(){if(B.id!==`machine-updates`)return;let e=Aa(`update-actions`);e&&Ws(e)}function Lc(e){switch(e.kind){case`broadcast`:Fc();return;case`status`:qs();return;case`update`:Ic(),e.frame===`status`&&Pa&&B.id===`machine-updates`&&Ua();return;case`activate`:Pc();return;case`return-to-list`:wc()}}function Rc(){B.id===Js&&pc()}window.matchMedia(`(prefers-reduced-motion: reduce)`).addEventListener(`change`,Rc),Tt(()=>{$s=null,Cc(),Rc()}),Wt(qs);function zc(){let e=z?.querySelector(`.settings-view-shortcuts`);e&&nc(e)}Ba({refreshRow:Hs,refreshRowFoot:Us,refreshSettingsStatus:qs,refreshShortcutGroups:zc});var Bc={mount:Oc};export{Bc as view};
4
+ `);t.rows=3,t.value=r(),t.autocomplete=`off`,t.spellcheck=!1,t.placeholder=e.listPlaceholder??``,t.setAttribute(`aria-labelledby`,e.id),ds(e,t),t.addEventListener(`blur`,()=>fs(e,t,r())),t.addEventListener(`keydown`,n=>{n.key===`Escape`?(n.preventDefault(),q(e,t,r())):n.key!==`Enter`||n.shiftKey||(n.preventDefault(),fs(e,t,r()))});let i=m(`div`,`settings-view-list`);return i.append(t,m(`span`,`settings-view-list-hint`,ys(e,n()))),i}var xs=null,J=null;function Ss(e){let t=jt(),n=new Map(t.map(e=>[e.view,e.label])),r=un(t.map(e=>e.view),Si(I(e))),i=m(`ol`,`settings-view-tab-order`);i.setAttribute(`aria-labelledby`,e.id);for(let[t,a]of r.entries()){let o=n.get(a)??a,s=m(`li`,`settings-view-tab-order-item`),c=m(`span`,`settings-view-tab-order-grip`);c.setAttribute(`aria-hidden`,`true`),c.appendChild(re(ns,`2.4`)),s.append(c,m(`span`,`settings-view-tab-order-label`,o),ws(e,r,a,t-1,`up`,`Move ${o} up`),ws(e,r,a,t+1,`down`,`Move ${o} down`)),Cs(e,s,r,a,t),i.append(s)}return i}function Cs(e,t,n,r,i){t.draggable=!0,t.addEventListener(`dragstart`,e=>{J=r,e.dataTransfer?.setData(`text/plain`,r),e.dataTransfer&&(e.dataTransfer.effectAllowed=`move`)}),t.addEventListener(`dragend`,()=>{J=null}),t.addEventListener(`dragover`,e=>{J&&J!==r&&(e.preventDefault(),t.dataset.dropTarget=n.indexOf(J)<i?`after`:`before`)}),t.addEventListener(`dragleave`,()=>delete t.dataset.dropTarget),t.addEventListener(`drop`,a=>{a.preventDefault(),delete t.dataset.dropTarget;let o=J;J=null,o&&o!==r&&K(e,sn(n,o,i))})}function ws(e,t,n,r,i,a){let o=`${n}:${i}`,s=d({variant:`icon`,size:`small`,label:a,icon:re(i===`up`?es:ts),action:`move-tab-${i}`,disabled:r<0||r>=t.length,onClick:()=>{xs=o,K(e,sn(t,n,r))}});return o===xs&&(s.dataset.restoresFocus=`true`),s}var Ts=null;function Es(){return e(`list-agents`,{}).then(e=>{if(e.type!==`agents-listed`)throw Error(`the agent list did not arrive`);return Ts=e.agents.map(({id:e,label:t,resolvable:n})=>({id:e,label:t,resolvable:n})),Ts})}function Ds(e,t){let n=m(`li`,`settings-view-agent-visibility-item`),r=m(`span`,`agent-mark`);r.setAttribute(`aria-hidden`,`true`),_t(r,t.id,t.label);let i=m(`span`,`settings-view-agent-visibility-label`,t.label);i.id=`${e.id}-${t.id}`;let a=m(`input`,`settings-view-switch`);return a.type=`checkbox`,a.setAttribute(`role`,`switch`),a.setAttribute(`aria-labelledby`,i.id),a.checked=!Si(I(e)).includes(t.id),a.disabled=t.id===gt,a.addEventListener(`change`,()=>{let n=Si(I(e)).filter(e=>e!==t.id);K(e,a.checked?n:[...n,t.id])}),n.append(r,i,a),n}function Os(e,t,n,r){t.replaceChildren(...r.filter(e=>e.resolvable).map(t=>Ds(e,t)));let i=r.filter(e=>!e.resolvable).map(e=>e.label);n.textContent=i.length>0?`Not installed: ${i.join(`, `)}.`:``}function ks(e){let t=m(`div`,`settings-view-agent-visibility`),n=m(`ul`,`settings-view-agent-visibility-list`);n.setAttribute(`aria-labelledby`,e.id);let r=m(`span`,`settings-view-list-hint`,`Checking which agents are installed.`);return t.append(n,r),Ts&&Os(e,n,r,Ts),Es().then(t=>Os(e,n,r,t)).catch(()=>{r.textContent=`Could not load the agent list. Reopen Settings to try again.`}),t}function As(e){return e.control===`readonly`?go(e):e.control===`toggle`?as(e):e.control===`number`?ms(e):e.control===`select`?na(e)===`segmented`?_s(e):vs(e):e.control===`list`?bs(e):e.control===`shortcut-key`?ss(e):e.control===`tab-order`?Ss(e):e.control===`agent-visibility`?ks(e):ps(e)}function js(e){let t=m(`div`,`settings-view-setting-heading`),n=Da(e),r=m(`h2`,`settings-view-setting-title`,e.title);r.id=e.id,Dr(e)&&!Or(ki(R,n.id)??n)&&r.append(` `,Do()),r.addEventListener(`click`,()=>Oa(n.id,e.id));let i=d({variant:`quiet`,size:`small`,label:`#`,action:`copy-setting-link`});return i.setAttribute(`aria-label`,`Copy link`),t.appendChild(r),Ao(t,i,{copiedText:`Link copied`,textToCopy:()=>new URL(wt(n.id,e.id),location.href).href}),t}function Ms(e){let t=ki(R,Da(e).id);return t?hi(L(t)):null}function Ns(e,t){let n=m(`div`,`settings-view-chips`);for(let r of gi(e,t))n.appendChild(Oo(r.kind,r.text));return n}function Ps(e){return e.control===`readonly`||_i(e,V)?!1:!ta(e,I(e))}function Fs(e){let t=m(`div`,`settings-view-control-foot`),n=m(`span`,`settings-view-save-status`);n.setAttribute(`role`,`status`);let r=d({variant:`quiet`,size:`small`,label:`Reset`,action:`reset-setting`});return r.addEventListener(`click`,()=>{let t=ea(e),n=sa(e);n===null?K(e,t):h({title:e.title,message:n,confirmLabel:`Reset`,danger:!0,onConfirm:()=>K(e,t)})}),t.append(n,r),t}function Is(e,t){let n=e.querySelector(`.settings-view-save-status`),r=Ca.get(t.id);n&&(n.textContent=r?.text??``,r&&(n.dataset.tone=r.tone),r||delete n.dataset.tone);let i=e.querySelector(`[data-action="reset-setting"]`);i&&(i.hidden=!Ps(t));let a=e.querySelector(`.settings-view-control-foot`);a&&(a.hidden=!r&&!Ps(t));let o=e.querySelector(`.settings-view-field-error`),s=F.get(t.id);o&&!s&&o.remove(),o&&s&&(o.textContent=s),!o&&s&&e.querySelector(`.settings-view-setting-control`)?.appendChild(m(`div`,`settings-view-field-error`,s))}function Ls(e){let t=m(`article`,`settings-view-setting`);t.dataset.settingId=e.id,e.control===`readonly`&&(t.dataset.readout=`true`);let n=m(`div`,`settings-view-setting-text`);n.append(js(e),m(`p`,`settings-view-setting-description`,e.description));let r=Ns(e,Ms(e));r.childElementCount>0&&n.appendChild(r);let i=m(`div`,`settings-view-setting-control`);i.appendChild(As(e)),e.control!==`readonly`&&i.appendChild(Fs(e)),t.append(n,i),ia(e,I(e))&&t.appendChild(m(`div`,`settings-view-warning settings-warning`,e.warning));let a=vo(e);return a&&t.appendChild(a),Is(t,e),t}function Rs(e){return z?.querySelector(`[data-setting-id="${e.id}"]`)??null}function zs(e){let t=e.querySelector(`.settings-view-setting-control`);t&&(t.querySelector(`[data-restores-focus="true"]:not([disabled])`)??t.querySelector(`[role="radio"][aria-checked="true"]`)??t.querySelector(`input:not([disabled]), textarea:not([disabled]), select:not([disabled]), button:not([disabled])`))?.focus()}function Bs(e,t){if(!us(e)||!us(t))return;e.disabled=t.disabled,e.placeholder=t.placeholder;let n=P.get(t);n&&!Qi(P.get(e))&&(P.set(e,{base:n.base,isDirty:!1}),e.value!==t.value&&(e.value=t.value))}function Vs(e,t,n){if(e===n){Bs(e,t);return}let r=[...e.children],i=[...t.children];for(let[t,a]of i.entries()){let i=r[t];i?i.contains(n)?Vs(i,a,n):i.replaceWith(a):e.appendChild(a)}for(let e of r.slice(i.length))e.remove()}function Hs(e,{force:t=!1}={}){let n=Rs(e);if(!n)return;let r=document.activeElement,i=n.contains(r),a=i&&!t&&us(r)?r:null;(!a||!Qi(P.get(a)))&&F.delete(e.id);let o=Ls(e);a?Vs(n,o,a):(n.replaceWith(o),i&&zs(o))}function Us(e){let t=Rs(e);t&&Is(t,e)}function Ws(e){Rs(e)?.querySelector(`.settings-view-setting-control`)?.replaceChildren(go(e))}function Gs(){for(let e of L(B))e.control===`readonly`?Ws(e):Hs(e)}function Ks(e,t){let n=t.querySelector(`.settings-view-status-slot`),r=vo(e);n&&r&&n.replaceWith(r),n&&!r&&n.remove(),!n&&r&&t.appendChild(r)}function qs(){for(let e of L(B)){if(!e.status)continue;let t=Rs(e);t&&(e.control===`readonly`?Ws(e):Ks(e,t))}}var Js=`browser-appearance`,Ys=`flying-animals`,Y=!1,Xs=!1,Zs=null,Qs=null,X=null,Z=null,Q=null,$s=null,ec=null,$=``;function tc(e){requestAnimationFrame(()=>{let t=document.getElementById(e),n=t?.closest(`.settings-view-advanced-panel`);n&&(Y=!0,n.hidden=!1,z?.querySelector(`.settings-view-advanced-toggle`)?.setAttribute(`aria-expanded`,`true`));let r=t?.closest(`.settings-view-setting`);r&&(r.scrollIntoView({block:`center`}),r.classList.remove(`settings-view-setting-flash`),requestAnimationFrame(()=>r.classList.add(`settings-view-setting-flash`)))})}function nc(e){e.replaceChildren();for(let t of nt(an,gn())){let n=m(`div`,`shortcut-group`);n.appendChild(m(`h2`,`settings-view-subsection-title`,t.title));let r=m(`dl`,`shortcut-rows`);for(let e of t.items){let t=m(`dd`,`shortcut-keys`);e.combos.forEach((e,n)=>{n>0&&t.appendChild(m(`span`,`shortcut-sep`,`/`)),Qt(t,e)}),r.append(m(`dt`,`shortcut-label`,e.label),t)}n.appendChild(r),e.appendChild(n)}}function rc(e){return jt().find(t=>t.gate!==void 0&&`fromSettings`in t.gate&&t.gate.fromSettings===e)?.label}function ic(e){let t=m(`ul`,`settings-view-stack settings-features`);for(let e of xt){let n=R.find(t=>t.id===e.sectionId),r=Aa(e.settingId),i=rc(Lt[e.rule]);if(!n||!r||!i)continue;let a=I(r)===!0,o=m(`li`,`settings-feature`),s=m(`div`,`settings-feature-head`);s.append(m(`span`,`settings-feature-name`,i),Oo(`feature`,a?`On`:`Off`)),o.append(s,m(`p`,`settings-view-section-description`,n.description),mn(e.sectionId,e.settingId,r.title)),t.appendChild(o)}e.appendChild(t)}function ac(e){let t=m(`div`,`settings-about`),n=m(`span`,`settings-about-version`,`GLIMMERVOID `);n.appendChild(m(`span`,`settings-about-v`,`v0.52.3-next.751`));let r=m(`span`,`settings-about-links`);r.append(to(`GitHub`,`https://github.com/${wn}`),to(`Changelog`,`https://github.com/${wn}/blob/main/CHANGELOG.md`),to(`Website`,ka(`/`))),t.append(n,r),e.appendChild(t)}function oc(e){if(H[`pref:soundEnabled`]===e)return;H[`pref:soundEnabled`]=e;let t=Aa(`alert-sounds-enabled`);t&&Hs(t)}function sc(){return d({variant:`secondary`,label:`Reset all to defaults`,action:`reset-flying-animals`,onClick:()=>{He(),Ta(V),Xt(mt()),pc()}})}function cc(e){let t=m(`div`,`settings-view-advanced`),n=ue(`dialog-advanced-toggle settings-view-advanced-toggle`,`Advanced`);n.setAttribute(`aria-expanded`,String(Y)),n.setAttribute(`aria-controls`,`settings-view-advanced-panel`);let r=m(`div`,`dialog-advanced-panel settings-view-advanced-panel`);r.id=`settings-view-advanced-panel`,r.hidden=!Y,n.addEventListener(`click`,()=>{Y=!Y,r.hidden=!Y,n.setAttribute(`aria-expanded`,String(Y))});for(let t of e)r.append(Ls(t));return B.id===Js&&r.append(sc()),t.append(n,r),t}function lc(e){let t=m(`div`,`settings-view-streamer-placeholder`),n=d({variant:`primary`,label:`Turn off streamer mode`,action:`turn-off-streamer-mode`}),r=m(`span`,`settings-view-copy-status`,``);r.setAttribute(`role`,`status`),n.addEventListener(`click`,async()=>{n.disabled=!0,r.textContent=``;let e=await Rt(!1);n.disabled=!1,r.textContent=e}),t.append(m(`p`,`settings-view-section-description`,`Settings are hidden in streamer mode.`),n,r),e.appendChild(t)}hn(()=>pc());function uc(){let e=m(`div`,`settings-view-advanced`),t=ue(`dialog-advanced-toggle`,`Animal gallery`);t.setAttribute(`aria-controls`,`settings-view-animal-gallery-panel`);let n=m(`div`,`dialog-advanced-panel settings-view-advanced-panel`);n.id=`settings-view-animal-gallery-panel`;let r=()=>{t.setAttribute(`aria-expanded`,String(Xs)),n.hidden=!Xs,Xs&&n.childElementCount===0&&n.append(Mn())};return t.addEventListener(`click`,()=>{Xs=!Xs,r()}),r(),e.append(t,n),e}function dc(e){let t=m(`header`,`settings-view-subsection`),n=m(`h2`,`settings-view-subsection-title`,e.title);return n.addEventListener(`click`,()=>Oa(e.id)),t.append(n,m(`p`,`settings-view-section-description`,e.description)),t}function fc(e,t){for(let n of t.settings.filter(e=>e.access!==`advanced`))e.appendChild(Ls(n)),n.id===Ys&&e.appendChild(uc());let n=t.settings.filter(e=>e.access===`advanced`);n.length>0&&e.append(cc(n))}function pc(){if(Cc(),$){xc();return}if(!z)return;if(z.textContent=``,Jt()){lc(z);return}let e=m(`header`,`settings-view-section-header`),t=m(`h1`,`settings-view-section-title`,B.title);t.tabIndex=-1,t.addEventListener(`click`,()=>Oa(B.id));let n=m(`div`,`settings-view-section-title-row`);n.appendChild(t);let r=Or(B);r&&t.append(` `,Do());let i=hi(L(B));if(i&&n.appendChild(Oo(`scope`,mi[i])),e.append(n,m(`p`,`settings-view-section-description`,B.description)),r&&e.appendChild(m(`p`,`settings-view-warning settings-view-experimental-caution`,`Experimental: this may change or break between releases.`)),z.appendChild(e),B.id===`browser-shortcuts`){let e=m(`div`,`settings-view-stack`);fc(e,B),z.appendChild(e);let t=m(`div`,`shortcut-groups settings-view-shortcuts`);nc(t),z.appendChild(t);return}if(B.id===`browser-about`){ac(z);return}if(B.id===`browser-status-key`){z.appendChild(pn()),z.appendChild(Kt());return}if(B.id===`lanes-features`){ic(z);return}if(B.id===`machine-packs`){Ho(z);return}let a=m(`div`,`settings-view-stack`);for(let e of Ea(B))e.id!==B.id&&a.appendChild(dc(e)),fc(a,e);z.appendChild(a)}function mc(e,{focusContent:t=!1,settingId:n=null,updateHash:r=!0,openPhoneSection:i=!0}={}){r&&$&&($=``,Q&&(Q.value=``));let a=ki(R,e)??B;B.id!==a.id&&(Y=!1),Ia(a);let o=R.find(t=>t.id===e)??a;hc(Z),i&&Vt()&&($s=o.id),pc(),Ac(B)&&kc(),B.id===`machine-updates`&&Ua(),r&&Oa(o.id,n),n&&tc(n),t&&z?.querySelector(`h1`)?.focus()}function hc(e){for(let t of e?.querySelectorAll(`[data-settings-section]`)||[]){let e=t.dataset.settingsSection===B.id;t.setAttribute(`aria-current`,e?`page`:`false`)}}function gc(e){return e.section!==null}function _c(e){Q&&(Q.value=``,$=``,Tc(),mc(e.section.id,{settingId:e.setting.id}))}function vc(e){return ti(xa(),e,Tr.fileOnly)}function yc(e,t,n,r,i){let a=m(e,t),o=r.matches.find(e=>e.field===i),s=o?n.indexOf(o.text):-1;if(!o||s<0)return a.textContent=n,a;let c=0;for(let e of o.spans)a.append(n.slice(c,s+e.start),m(`mark`,`settings-view-search-highlight`,n.slice(s+e.start,s+e.end))),c=s+e.end;return a.append(n.slice(c)),a}function bc(e,t){let{currentText:n,defaultText:r,jsonFragment:i}=Ei(t.setting,V);if(n!==null&&e.appendChild(m(`span`,`settings-view-search-current`,n)),e.append(m(`span`,`settings-view-search-default`,r),Ns(t.setting,null),m(`p`,`settings-view-list-hint`,`Edit in config.json or with glimmervoid settings set.`)),i===null)return;let a=m(`div`,`settings-view-control-foot`);Ao(a,d({variant:`quiet`,size:`small`,label:`Copy as JSON`,action:`copy-json`}),{copiedText:`JSON copied`,textToCopy:()=>i}),e.appendChild(a)}function xc(){if(!z)return;if(z.textContent=``,Jt()){lc(z);return}let e=vc($),t=m(`div`,`settings-view-section-header`);if(t.append(m(`h1`,`settings-view-section-title`,`Settings search`),m(`p`,`settings-view-section-description`,`${e.length} ${e.length===1?`result`:`results`} for "${$}"`)),z.appendChild(t),e.length===0){z.appendChild(m(`p`,`settings-empty settings-view-search-empty`,`No settings found.`));return}let n=m(`ol`,`settings-view-search-results`);n.setAttribute(`aria-label`,`Settings search results`);for(let t of e){let e=m(`li`,`settings-view-search-result`);e.tabIndex=-1;let r=Di(R,t.section,t.setting);e.appendChild(yc(`p`,`settings-view-search-breadcrumb`,r,t,`section`));let i=yc(`span`,`settings-view-setting-title`,t.setting.title,t,`title`);if(gc(t)){let n=ue(`settings-view-search-open`);n.appendChild(i),n.addEventListener(`click`,()=>_c(t)),e.appendChild(n)}gc(t)||(e.classList.add(`settings-view-search-file-only`),e.appendChild(i)),e.append(yc(`p`,`settings-view-setting-description`,t.setting.description,t,`description`),yc(`code`,`settings-view-key-path`,t.setting.path,t,`path`));let a=new Set([`title`,`description`,`path`,`section`]);if(!t.matches.some(e=>a.has(e.field))){let n=t.matches.find(e=>e.field===`options`)??t.matches.find(e=>e.field===`keywords`);n&&e.appendChild(yc(`p`,`settings-view-list-hint`,n.text,t,n.field))}gc(t)||bc(e,t),n.appendChild(e)}z.appendChild(n)}function Sc(){return Mi(R,$s,$,Jt())}function Cc(){if(!X)return;let e=Sc(),t=X.dataset.settingsScreen!==e;X.dataset.settingsScreen=e,ec&&(ec.hidden=e!==`section`),t&&vt()}function wc(){let e=B.id;Ec(``),Z?.querySelector(`[data-settings-section="${e}"]`)?.focus()}function Tc(){if(Z&&X){Z.textContent=``;for(let e of ji(Ai(R))){let t=m(`div`,`settings-view-nav-group`);e.heading&&t.appendChild(m(`div`,`settings-view-nav-heading`,e.heading));for(let n of e.sections){let e=ue(`settings-view-nav-item`,n.title);Or(n)&&e.append(` `,Do()),e.dataset.settingsSection=n.id,e.addEventListener(`click`,()=>mc(n.id,{focusContent:Vt()})),t.appendChild(e)}Z.appendChild(t)}$?(Cc(),xc()):mc(B.id,{updateHash:!1,openPhoneSection:!1})}}function Ec(e,{updateHash:t=!0}={}){$=e.trim(),Q&&(Q.value=e),$s=null,t&&history.replaceState(history.state,``,St($)),Tc()}function Dc(e){if($&&e.key===`Enter`&&e.target===Q){let t=vc($).find(gc);if(!t)return;e.preventDefault(),_c(t);return}if(e.key===`Escape`&&$){if(!Q)return;e.preventDefault(),Ec(``),Q.focus();return}if(e.key!==`ArrowUp`&&e.key!==`ArrowDown`||!Z)return;let t=[...Z.querySelectorAll(`[data-settings-section]`)].filter(e=>e instanceof HTMLElement),n=document.activeElement;if(!(n instanceof HTMLElement))return;let r=t.indexOf(n);r<0||(e.preventDefault(),t[(r+(e.key===`ArrowDown`?1:-1)+t.length)%t.length].focus())}function Oc(e){on(oc),Zs=e,Zs.textContent=``,X=m(`div`,`settings-view-shell`);let t=m(`div`,`settings-view-sidebar`);Q=m(`input`,`settings-view-search`),Q.type=`search`,Q.placeholder=`Search settings`,Q.setAttribute(`aria-label`,`Search settings`),Z=m(`nav`,`settings-view-nav`),Z.setAttribute(`role`,`navigation`),Z.setAttribute(`aria-label`,`Settings sections`),ec=d({variant:`secondary`,label:`Settings`,icon:re(fe),action:`back-to-settings-list`,hidden:!0,onClick:Et}),ec.setAttribute(`aria-label`,`Back to settings sections`);let n=m(`div`,`settings-view-content`);n.setAttribute(`aria-live`,`polite`),Fa(n),Q.addEventListener(`input`,()=>{let e=Q;e&&Ec(e.value)}),Q.addEventListener(`keydown`,Dc),Z.addEventListener(`keydown`,Dc),t.append(Q,ec,Z),X.append(t,n),Zs.appendChild(X),La(g()),Ma(),Ta(V),kt(Sc),bt(Lc),Tc(),kc(),Qs?.disconnect(),Qs=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&kc()}),Qs.observe(Zs),Pc()}function kc(){_n().then(jc)}function Ac(e){return L(e).some(e=>e.path===`pref:soundId`)}function jc(){if(ja(),H[`pref:soundId`]=yn(st()),$){xc();return}let e=Aa(`alert-sound`);e&&Ac(B)&&Hs(e)}function Mc(e,t,n){let r=Bt(e??n);r?Ec(r.query):(Ec(``,{updateHash:!1}),Vt()&&!e?history.replaceState(history.state,``,St(``)):mc(e||B.id,{settingId:t}))}function Nc(e){let t=ni(e,R,Ar,jr);Mc(t?.sectionId??null,t?.settingId??null,e)}function Pc(){let e=Ut();e&&(e.isLink?Nc(e.hashAtRequest):Mc(e.sectionId,e.settingId,e.hashAtRequest))}function Fc(){La(g());let e=Ma();Ta(V),$?xc():e?(Tc(),pc()):Gs()}function Ic(){if(B.id!==`machine-updates`)return;let e=Aa(`update-actions`);e&&Ws(e)}function Lc(e){switch(e.kind){case`broadcast`:Fc();return;case`status`:qs();return;case`update`:Ic(),e.frame===`status`&&Pa&&B.id===`machine-updates`&&Ua();return;case`activate`:Pc();return;case`return-to-list`:wc()}}function Rc(){B.id===Js&&pc()}window.matchMedia(`(prefers-reduced-motion: reduce)`).addEventListener(`change`,Rc),Tt(()=>{$s=null,Cc(),Rc()}),Wt(qs);function zc(){let e=z?.querySelector(`.settings-view-shortcuts`);e&&nc(e)}Ba({refreshRow:Hs,refreshRowFoot:Us,refreshSettingsStatus:qs,refreshShortcutGroups:zc});var Bc={mount:Oc};export{Bc as view};
@@ -1,2 +1,2 @@
1
- import{$ as e,a as t,bt as n,et as r,t as i}from"./button-mkFeAYAx.js";import{b as a,d as o,h as s,n as c,s as l}from"./dom-helpers-BFFApPgS.js";import{i as u}from"./action-status-DVzULV_M.js";import{_ as d,tt as f}from"./ui-prefs-DDS1bMmm.js";import{Ar as p,Dr as ee,Er as te,Mr as m,Nr as h,Or as ne,jr as g,kr as _}from"./index-CrpXpbdb.js";function v(e){return e.kind===`prompt`||e.kind===`expansion`||e.kind===`thinking`||e.kind===`assistant`||e.kind===`notice`?e.text:e.kind===`tool_result`?e.content:e.kind===`raw`?e.line:e.kind===`tool_call`?JSON.stringify(e.input,null,2)??String(e.input??``):[`${e.vendor} ${e.vendorSessionId}`,e.transcriptPath,e.reason??``].filter(Boolean).join(`
1
+ import{$ as e,a as t,bt as n,et as r,t as i}from"./button-mkFeAYAx.js";import{b as a,d as o,h as s,n as c,s as l}from"./dom-helpers-BFFApPgS.js";import{i as u}from"./action-status-DVzULV_M.js";import{_ as d,tt as f}from"./ui-prefs-DDS1bMmm.js";import{Ar as p,Dr as ee,Er as te,Mr as m,Nr as h,Or as ne,jr as g,kr as _}from"./index-B12zcEVW.js";function v(e){return e.kind===`prompt`||e.kind===`expansion`||e.kind===`thinking`||e.kind===`assistant`||e.kind===`notice`?e.text:e.kind===`tool_result`?e.content:e.kind===`raw`?e.line:e.kind===`tool_call`?JSON.stringify(e.input,null,2)??String(e.input??``):[`${e.vendor} ${e.vendorSessionId}`,e.transcriptPath,e.reason??``].filter(Boolean).join(`
2
2
  `)}var y=[{kind:`thinking`,label:`Thinking`},{kind:`tool_result`,label:`Tool result`},{kind:`raw`,label:`Raw`}];function re(e){if(e.startedAt===null)return 0;let t=e.head?.record.ts??e.startedAt;for(let n of e.rows)t=Math.max(t,n.record.ts);return Math.max(0,t-e.startedAt)}function b(t){let{rowCount:r,toolCallCount:i,errorCount:a,resultBytes:o}=t.metrics;return`${`${r} ${r===1?`row`:`rows`}`}, ${`${i} ${i===1?`tool`:`tools`}`}, ${`${a} ${a===1?`error`:`errors`}`}, ${n(o,`KB`)}, ${e(re(t))}`}function ie(e){return e.hasSelectionChanged||e.isRenderedTraceStale||!e.hasRenderedOnce}function x(e,t,n){return e!==0||t?null:n?.startedAt??null}function S(e,t){return C(e,t)?e.filter(e=>e!==t):[...e,t]}function C(e,t){return e.includes(t)}function w(e){return e?`No trace has been recorded for ${e.label}.`:`No sessions are available.`}var T=null,E=null,D=null,O=null,k=[],A=!1,j=d(),M=!1,N=null;function P(){return!!T&&!o(T)}function F(){let{sessionOptions:e,selectedSessionId:t}=m();return e.find(e=>e.id===t)??null}function I(){let e=l(`label`,`trace-session-field`),t=l(`span`,`trace-session-label`,`Session`),n=l(`select`,`trace-session-select`),{sessionOptions:r,selectedSessionId:i}=m();n.disabled=r.length===0;for(let e of r){let t=l(`option`,null,e.label);t.value=e.id,t.selected=e.id===i,n.append(t)}return n.addEventListener(`change`,()=>ne(n.value)),e.append(t,n),e}function L(e){e.toggleAttribute(`data-hidden`,C(j,e.dataset.kind??``))}function R(){if(D)for(let e of D.querySelectorAll(`.trace-row`))L(e)}function z(e){if(D)for(let t of D.querySelectorAll(`details`))t.open=e}function B(){let e=l(`div`,`trace-filters`);for(let n of y){let r=t(`trace-filter`,n.label),i=()=>{r.setAttribute(`aria-pressed`,String(!C(j,n.kind)))};i(),r.addEventListener(`click`,()=>{j=S(j,n.kind),f(j),i(),R()}),e.append(r)}return e.append(i({variant:`quiet`,label:`Expand all`,action:`expand-all-trace-rows`,onClick:()=>z(!0)}),i({variant:`quiet`,label:`Collapse all`,action:`collapse-all-trace-rows`,onClick:()=>z(!1)})),e}function V(){let e=c(`trace`,`Session trace`,`Bodies load from the local trace file only when requested.`),t=l(`div`,`trace-controls`),{selectedTrace:n,traceFailureText:r}=m();t.append(I());let i=n?.filePath??``,a=l(`code`,`trace-path`,i);t.append(a);let o=n?x(n.firstOffset,n.hasDroppedEarliestRows,n.grouping.turns[0]):null;if(o!==null&&t.append(l(`span`,`trace-session-start`,`Started ${new Date(o).toLocaleString()}`)),e.append(t,B()),!r)return e;let s=u(`trace-status`);return s.show(`error`,r),e.append(s.element),e}function H(e){let t=l(`div`,`trace-copy-wrap`),n=l(`span`,`trace-copy-status`);n.setAttribute(`role`,`status`);let r=i({variant:`secondary`,size:`small`,label:`Copy`,action:`copy-trace-body`});return r.addEventListener(`click`,()=>{let t=a(e);t?(t.then(()=>{n.textContent=`Copied`}).catch(()=>{n.textContent=`Copy failed`}),setTimeout(()=>{n.textContent=``},1600)):n.textContent=`Copy failed`}),t.append(r,n),t}function U(){let e=l(`div`,`trace-earlier-wrap`);return e.append(i({variant:`secondary`,label:`Load earlier`,action:`load-earlier-trace`,onClick:()=>ee()})),e}function W(e,t,n=``){let i=l(`details`,`trace-row${n?` ${n}`:``}`);i.dataset.kind=e.kind,i.dataset.tone=e.tone,L(i);let a=l(`summary`,`trace-row-summary`);a.append(l(`span`,`trace-offset`,r(t,e.record.ts)),l(`span`,`trace-kind`,e.tag),l(`span`,`trace-row-label`,e.text));for(let t of e.badges){let e=l(`span`,`trace-badge`,t);e.dataset.badge=t,a.append(e)}let o=l(`div`,`trace-row-body`);i.append(a,o);let s=!1;return i.addEventListener(`toggle`,()=>{if(!i.open||s)return;s=!0;let t=v(e.record);o.append(H(t),l(`pre`,`trace-row-pre`,t))}),i}function G(e){return l(`span`,`trace-turn-metrics`,b(e))}function K(e,t){e&&t&&(t.textContent=b(e))}function q(e,t){let n=e.children,i=Math.min(t.rows.length,n.length);for(let e=0;e<i;e+=1){let i=n[e]?.querySelector(`.trace-offset`);i&&(i.textContent=r(t.startedAt,t.rows[e].record.ts))}}function J(e,t,n){let r=W(t,e.startedAt,`trace-turn-head`);return s(r,`.trace-row-summary`).append(n),r}function Y(e){let t=l(`section`,`trace-turn`),n=G(e);if(e.head&&t.append(J(e,e.head,n)),!e.head){let e=l(`h2`,`trace-leading-title`);e.append(l(`span`,`trace-leading-label`,`Before first prompt`),n),t.append(e)}let r=l(`div`,`trace-rows`);for(let t of e.rows)r.append(W(t,e.startedAt));return e.hasTrimmedRows&&t.append(l(`p`,`trace-trimmed`,`Earlier rows trimmed`)),t.append(r),{section:t,rowsElement:r,metricsElement:n}}function ae(e){if(!e)return w(null);let{pendingSessionId:t,selectedTrace:n}=m();return t===e.id&&!n?.hasLoadedOnce?`Loading trace.`:w(e)}function X(){if(!T)return;let e=l(`div`,`trace-content`);E=V(),e.append(E),D=null,O=null,k=[];let t=F(),n=m().selectedTrace?.grouping.turns??[];if(!t||n.length===0){e.append(l(`p`,`trace-empty`,ae(t))),T.replaceChildren(e),A=!1;return}h(g())&&(O=U(),e.append(O));let r=l(`div`,`trace-turns`);for(let e of n){let t=Y(e);k.push(t),r.append(t.section)}D=r,R(),e.append(r),T.replaceChildren(e),A=!1}function Z(){T&&(P()?X():A=!0)}function Q(){if(!E||!P())return;let e=V();E.replaceWith(e),E=e}function oe(e){if(!D)return;let t=m().selectedTrace?.grouping.turns[e.turnIndex];if(!t)return;if(e.isNewTurn){let e=Y(t);k.push(e),D.append(e.section);return}let n=k[e.turnIndex];if(n){for(let r of e.rows)n.rowsElement.append(W(r,t.startedAt));K(t,n.metricsElement)}}function se(e){let t=e.parentElement;t&&!t.querySelector(`.trace-trimmed`)&&t.insertBefore(l(`p`,`trace-trimmed`,`Earlier rows trimmed`),e)}function $(){h(g())?!O&&D?.parentElement&&(O=U(),D.parentElement.insertBefore(O,D)):(O?.remove(),O=null)}function ce(e){if(!(e.droppedTurnCount>0||e.droppedRowCount>0)){$();return}if(k=k.slice(e.droppedTurnCount),D)for(let t=0;t<e.droppedTurnCount;t+=1)D.firstElementChild?.remove();let t=k[0];if(t&&e.droppedRowCount>0){for(let n=0;n<e.droppedRowCount;n+=1)t.rowsElement.firstElementChild?.remove();se(t.rowsElement),K(m().selectedTrace?.grouping.turns[0],t.metricsElement)}e.hasJustDroppedEarliestRows&&Q(),$()}function le(e){if(P()&&!A&&D)for(let t of e)oe(t);else D=null,M=!0}function ue(e){if(!D)return;let t=k[0]??null,n=t?.rowsElement.parentElement??null,r=m().selectedTrace?.grouping.turns[e.newTurns.length]??null;if((e.mergedHead||e.mergedRows.length>0)&&t&&n&&r){let i=t.rowsElement;if(e.mergedHead){n.querySelector(`.trace-leading-title`)?.remove();let a=G(r),o=J(r,e.mergedHead,a);n.insertBefore(o,i),t.metricsElement=a}e.mergedHead||K(r,t.metricsElement);let a=document.createDocumentFragment();for(let t of e.mergedRows)a.append(W(t,r.startedAt));i.prepend(a),q(i,r)}let i=document.createDocumentFragment(),a=[];for(let t of e.newTurns){let e=Y(t);a.push(e),i.append(e.section)}D.prepend(i),k.unshift(...a)}function de(e){let t=P()&&!A&&!!D&&!e.needsRerender,n=T?.parentElement??null;N={canPrependInPlace:t,scrollElement:n,previousScrollHeight:n?.scrollHeight??0,previousScrollTop:n?.scrollTop??0},t&&ue(e)}function fe(e){ce(e),M&&(M=!1,Z());let t=N;N=null,t&&(t.canPrependInPlace||Z(),t.canPrependInPlace&&Q(),t.scrollElement&&(t.scrollElement.scrollTop=t.previousScrollTop+t.scrollElement.scrollHeight-t.previousScrollHeight))}function pe(e){switch(e.kind){case`selection-reset`:A=!0;return;case`rebuild`:Z();return;case`header`:Q();return;case`sessions`:(e.hasSelectionChanged||!E)&&Z(),!e.hasSelectionChanged&&E&&Q();return;case`records-appended`:le(e.appends);return;case`records-prepended`:de(e.prepend);return;case`trimmed`:fe(e.trim);return}}function me(e){T||(T=l(`div`,`trace-panel`),e.append(T),_(P),p(pe),X())}function he(){T&&ie({hasSelectionChanged:te(),isRenderedTraceStale:A,hasRenderedOnce:!!E})&&X()}var ge={mount:me,refresh:he};export{ge as view};