claude-code-session-manager 0.91.0 → 0.91.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/assets/{AgentLibrary-zkgdnCnG.js → AgentLibrary-Chmfxih8.js} +1 -1
  2. package/dist/assets/{DataModel-CNFdqxrR.js → DataModel-Cp38ePS_.js} +1 -1
  3. package/dist/assets/{History-C-qijfXz.js → History-SMWV7lD6.js} +1 -1
  4. package/dist/assets/{Hooks-DGxt1nBd.js → Hooks-JUWiyu-r.js} +1 -1
  5. package/dist/assets/{HostBilko-sIYTK-m9.js → HostBilko-DFTixTqy.js} +1 -1
  6. package/dist/assets/{Library-51Jx0oGl.js → Library-zUu71gsR.js} +1 -1
  7. package/dist/assets/{ListDetail-ByNJU-ie.js → ListDetail-BK_PH4lf.js} +1 -1
  8. package/dist/assets/{MarkdownEditor-Wwcpe9O1.js → MarkdownEditor-ITJDD0Mr.js} +1 -1
  9. package/dist/assets/{McpServers-Bs5xPbTG.js → McpServers-CWwrfGkx.js} +1 -1
  10. package/dist/assets/{Memory-BsHGInmd.js → Memory-DgHttor9.js} +1 -1
  11. package/dist/assets/{Panel-ilEDcV0m.js → Panel-C2Cb7TS4.js} +1 -1
  12. package/dist/assets/{Permissions-Djgc3TFk.js → Permissions-hd8OBsj_.js} +1 -1
  13. package/dist/assets/{Plugins-BBojr1mt.js → Plugins-BYa-ClGK.js} +2 -2
  14. package/dist/assets/{ProvenanceBadge-Cz1VLnXb.js → ProvenanceBadge-Dmhz8ZOB.js} +1 -1
  15. package/dist/assets/{SaveBar-Cj0wz84u.js → SaveBar-1NvfbO9r.js} +1 -1
  16. package/dist/assets/{Scheduler-D4Ekm93R.js → Scheduler-SYgINPCB.js} +1 -1
  17. package/dist/assets/{ScopeSwitcher-DA5MqWli.js → ScopeSwitcher-MBmWNzFk.js} +1 -1
  18. package/dist/assets/{Settings-B1Kfgjvl.js → Settings-C1WOHoYb.js} +1 -1
  19. package/dist/assets/{SkillReferenceGraph-Dew-1uMy.js → SkillReferenceGraph-Cuse__ul.js} +1 -1
  20. package/dist/assets/{Skills-DzuhnXy9.js → Skills-CQmLYgNh.js} +1 -1
  21. package/dist/assets/{SystemPrompt-CNcCwEev.js → SystemPrompt-DkhAYRXL.js} +1 -1
  22. package/dist/assets/{TagLibrary-D0plTZgP.js → TagLibrary-DGxI_3m3.js} +1 -1
  23. package/dist/assets/{TiptapBody-BlmUt7SR.js → TiptapBody-BY-fFjwh.js} +1 -1
  24. package/dist/assets/{Toggle-yTfx2R-e.js → Toggle--nwLR-_8.js} +1 -1
  25. package/dist/assets/{index-ju-h7BFf.js → index-4dEn1t8J.js} +3 -3
  26. package/dist/assets/{settingsSchema-BkcnLBYk.js → settingsSchema-DiqEpSBA.js} +1 -1
  27. package/dist/index.html +1 -1
  28. package/package.json +1 -1
  29. package/src/main/build-info.json +4 -4
@@ -1,3 +1,3 @@
1
- import{au as d,ah as e,S as O,a as Q,l as R,aS as X,R as ee,aH as te,aN as se,aV as $,aP as ne,aK as M,aj as ae,an as re,J as le,V as ie,z as H,az as oe}from"./index-ju-h7BFf.js";import{P as ce}from"./Panel-ilEDcV0m.js";import{S as de}from"./ScopeSwitcher-DA5MqWli.js";import{S as K}from"./SaveBar-Cj0wz84u.js";import{u as ue,s as G,E as xe}from"./settingsSchema-BkcnLBYk.js";import{T as L}from"./Toggle-yTfx2R-e.js";import"./monaco-editor-BW5C4Iv1.js";const pe=[{id:"essentials",title:"Essentials",summary:"The knobs you reach for first.",keys:["model","language","outputStyle","permissions"]},{id:"git",title:"Git & Commits",summary:"How Claude writes commits and pull requests on your behalf.",keys:["attribution","includeGitInstructions","includeCoAuthoredBy"]},{id:"memory",title:"Memory & Plans",summary:"Context Claude keeps between sessions and where it files plans.",keys:["autoMemoryEnabled","plansDirectory","claudeMdExcludes","respectGitignore"]},{id:"model",title:"Model & Reasoning",summary:"Model allow/override lists, reasoning depth, and fast-mode toggles — machine-wide, with no per-Epic override yet. An Epic's Agent persona model (Agent Library) still wins over Essentials' plain model default.",advanced:!0,keys:["availableModels","modelOverrides","effortLevel","fastMode","fastModePerSessionOptIn","alwaysThinkingEnabled","fallbackModel","enforceAvailableModels","teammateDefaultModel","advisorModel"]},{id:"interface",title:"Interface",summary:"Visual polish — spinners, progress bars, motion.",keys:["spinnerTipsEnabled","spinnerTipsOverride","spinnerVerbs","terminalProgressBarEnabled","showTurnDuration","prefersReducedMotion","companyAnnouncements","statusLine","teammateMode"]},{id:"updates",title:"Updates & Cleanup",summary:"Release channel and how long transcripts stick around.",keys:["autoUpdatesChannel","cleanupPeriodDays"]},{id:"env",title:"Environment & Auth",summary:"Environment variables and auth-helper scripts.",keys:["env","apiKeyHelper","awsCredentialExport","awsAuthRefresh"]},{id:"hooks",title:"Hooks",summary:"Scripts Claude runs before/after tool use.",keys:["hooks","disableAllHooks","allowedHttpHookUrls","httpHookAllowedEnvVars"]},{id:"mcp",title:"MCP Servers",summary:"External tool providers Claude can talk to.",keys:["enableAllProjectMcpServers","enabledMcpjsonServers","disabledMcpjsonServers"]},{id:"plugins",title:"Plugins",summary:"Installed plugins, marketplaces, and per-plugin configuration.",keys:["enabledPlugins","extraKnownMarketplaces","skippedPlugins","skippedMarketplaces","pluginConfigs"]},{id:"filesystem",title:"File Picker & Sandbox",summary:"How Claude browses files and the sandbox it runs in.",keys:["fileSuggestion","sandbox","worktree"]},{id:"login",title:"Login",summary:"Which login method to force on startup.",keys:["forceLoginMethod","forceLoginOrgUUID"]},{id:"feedback",title:"Feedback",summary:"Session-quality surveys.",keys:["feedbackSurveyRate"]},{id:"advanced",title:"Advanced / Enterprise",summary:"Managed-settings-only keys and enterprise allow/denylists.",advanced:!0,keys:["allowedMcpServers","deniedMcpServers","allowManagedHooksOnly","allowManagedPermissionRulesOnly","allowManagedMcpServersOnly","strictKnownMarketplaces","blockedMarketplaces","pluginTrustMessage","otelHeadersHelper","skipWebFetchPreflight"]}],me={mcp:"MCP",url:"URL",urls:"URLs",http:"HTTP",ui:"UI",id:"ID",uuid:"UUID",api:"API",aws:"AWS",otel:"OTel",json:"JSON"};function V(s){return s.replace(/^\$/,"").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").toLowerCase().split(/\s+/).filter(Boolean).map((l,a)=>{const r=me[l];return r||(a===0?l.charAt(0).toUpperCase()+l.slice(1):l)}).join(" ")}function W(s){const n=new Set,t=[];for(const a of pe){const r=a.keys.filter(i=>s.has(i));r.forEach(i=>n.add(i)),r.length!==0&&t.push({id:a.id,title:a.title,summary:a.summary,advanced:!!a.advanced,keys:r})}const l=Array.from(s).filter(a=>!n.has(a)&&a!=="$schema").sort();return l.length>0&&t.push({id:"other",title:"Other",summary:"Keys not yet grouped.",advanced:!1,keys:l}),t}function fe(s,n){return W(s).map(t=>({id:t.id,title:t.title,advanced:t.advanced,total:t.keys.length,setCount:t.keys.filter(l=>n.has(l)).length}))}const he={};function z(s,n){if(n)return{text:n,authored:!1};const t=he[s];return t?{text:t,authored:!0}:null}const ge={essentials:"star",git:"link",memory:"memory",model:"sparkle",interface:"eye",updates:"reload",env:"keys",hooks:"hooks",mcp:"mcp",plugins:"plugins",filesystem:"folder",login:"lock",feedback:"send",advanced:"shield",other:"dot"},be=["user","project","local","default"],ye={user:"user",project:"project",local:"local",default:"default"};function je({node:s,targetScope:n,onOverride:t,schema:l}){const[a,r]=d.useState(""),[i,p]=d.useState(!1),[m,v]=d.useState(!0),x=s.kind==="object"?s:null,w=x?Object.keys(x.children):[],g=l.rootKeys(),y=new Set([...w,...g]),u=d.useMemo(()=>W(y),[Array.from(y).sort().join(",")]),b=d.useMemo(()=>fe(y,new Set(w)),[Array.from(y).sort().join(","),w.join(",")]),[C,E]=d.useState(null),f=d.useRef(null),S=o=>{const j=u.find(N=>N.id===o);j!=null&&j.advanced&&!i&&p(!0),E(o)};d.useEffect(()=>{if(!C)return;E(null);const o=f.current,j=document.getElementById(`settings-group-${C}`);if(!o||!j)return;const N=j.getBoundingClientRect().top-o.getBoundingClientRect().top;o.scrollBy({top:N,behavior:"smooth"})},[C]);const k=d.useMemo(()=>u.filter(o=>i||!o.advanced).map(o=>({...o,keys:o.keys.filter(j=>{const N=(x==null?void 0:x.children[j])!==void 0;if(!m&&!N)return!1;if(!a.trim())return!0;const h=l.at([j]);return[j,V(j),(h==null?void 0:h.description)??""].join(" ").toLowerCase().includes(a.toLowerCase())})})).filter(o=>o.keys.length>0),[u,a,i,m,x,l]);return e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{className:"shrink-0 border-b border-line bg-bg-elev px-3 py-1.5 flex items-center gap-3 text-xs",children:[e.jsxs("span",{className:"text-fg-faint",children:["writing overrides to"," ",e.jsx("span",{className:"text-fg-dim font-medium",children:O[n].label})]}),e.jsxs("label",{className:"flex items-center gap-1 text-fg-faint cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:m,onChange:o=>v(o.target.checked),className:"accent-accent"}),"show not-yet-configured"]}),e.jsxs("label",{className:"flex items-center gap-1 text-fg-faint cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:i,onChange:o=>p(o.target.checked),className:"accent-accent"}),"show advanced"]}),e.jsx("div",{className:"flex-1"}),e.jsx("input",{value:a,onChange:o=>r(o.target.value),placeholder:"search settings…",className:"bg-bg border border-line rounded px-2 py-1 text-xs text-fg w-64"})]}),e.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[e.jsx(ve,{groups:b,onJump:S}),e.jsxs("div",{ref:f,className:"flex-1 overflow-auto py-3",children:[k.map(o=>e.jsx(Ne,{id:o.id,title:o.title,summary:o.summary,advanced:o.advanced,children:o.keys.map(j=>{const N=x==null?void 0:x.children[j],h=l.at([j]);return e.jsx(we,{keyName:j,node:N,info:h,targetScope:n,onOverride:(c,T)=>t([j],c,T)},j)})},o.id)),k.length===0&&e.jsxs("div",{className:"px-6 py-12 text-center text-fg-faint text-sm",children:['no settings match "',a,'"']})]})]})]})}function ve({groups:s,onJump:n}){return e.jsx("nav",{className:"shrink-0 w-48 border-r border-line bg-bg-elev/30 overflow-y-auto py-3",children:s.map(t=>e.jsxs("button",{onClick:()=>n(t.id),className:"w-full flex items-center gap-2 px-3 py-2 text-left hover:bg-bg-hi transition-colors",title:`jump to ${t.title}`,children:[e.jsx(Q,{name:ge[t.id]??"dot",size:15,className:"text-fg-faint shrink-0"}),e.jsx("span",{className:"flex-1 min-w-0 truncate text-xs text-fg-dim",children:t.title}),e.jsxs("span",{className:"text-[10px] text-fg-faint font-mono shrink-0",children:[t.setCount,"/",t.total]})]},t.id))})}function Ne({id:s,title:n,summary:t,advanced:l,children:a}){const[r,i]=d.useState(!0);return e.jsxs("section",{id:`settings-group-${s}`,className:"mx-4 mb-4 rounded-lg border border-line shadow-sm bg-bg-elev/50 overflow-hidden",children:[e.jsxs("header",{className:"px-4 py-3 bg-bg-elev cursor-pointer hover:bg-bg-hi flex items-center gap-3 border-b border-line",onClick:()=>i(!r),children:[e.jsx("span",{className:"text-fg-faint w-3",children:r?"▾":"▸"}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-fg text-base font-semibold",children:n}),l&&e.jsx("span",{className:"text-[9px] px-1.5 py-0 rounded border border-yellow-900/40 bg-yellow-950/30 text-yellow-500/80 uppercase tracking-wide",children:"advanced"})]}),e.jsx("p",{className:"text-fg-dim text-sm mt-0.5",children:t})]})]}),r&&e.jsx("div",{className:"divide-y divide-line/60",children:a})]})}function we({keyName:s,node:n,info:t,targetScope:l,onOverride:a}){const[r,i]=d.useState(!1),[p,m]=d.useState(!1),v=V(s),x=n!==void 0,g=(n==null?void 0:n.kind)==="leaf"?n:null,y=(n==null?void 0:n.kind)==="object"||(n==null?void 0:n.kind)==="array",u=t==null?void 0:t.default,b=g&&u!==void 0&&Y(g.value,u),C=Pe({isSet:x,leafNode:g,defaultVal:u,isDefault:!!b,node:n}),E=Se(g,u),f=E.length>=2,S=!!g&&!b,k=z(s,t==null?void 0:t.description);return e.jsx("div",{className:"px-4 py-3 hover:bg-bg-elev/20",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("button",{onClick:()=>i(!r),className:"text-fg-faint hover:text-fg w-3 mt-0.5",title:r?"collapse":"expand",children:r?"▾":"▸"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-baseline gap-2 flex-wrap",children:[e.jsx("h3",{className:"text-fg text-sm",children:v}),e.jsx(Re,{kind:C.kind,label:C.label}),f&&e.jsxs("button",{onClick:o=>{o.stopPropagation(),r||i(!0),m(j=>!j)},className:"text-[9px] px-1.5 py-0 rounded border border-blue-900/40 bg-blue-950/30 text-blue-300/90 uppercase tracking-wide hover:bg-blue-900/40",title:"this key is defined in multiple scopes — click to expand",children:["drift · ",E.map(o=>ye[o]).join(" · ")]}),S&&g&&e.jsx("button",{onClick:o=>{o.stopPropagation(),a(void 0,g.winner)},className:"text-[9px] px-1.5 py-0 rounded border border-line bg-bg-elev text-fg-faint uppercase tracking-wide hover:text-fg hover:bg-bg-hi",title:`reset · delete from ${O[g.winner].label}`,children:"↺ reset"}),(t==null?void 0:t.deprecated)&&e.jsx("span",{className:"text-[9px] px-1 py-0 rounded border border-yellow-900/40 bg-yellow-950/30 text-yellow-500/80 uppercase tracking-wide",children:"deprecated"}),(t==null?void 0:t.required)&&!x&&e.jsx("span",{className:"text-[9px] px-1 py-0 rounded border border-red-900/40 bg-red-950/30 text-red-400/80 uppercase tracking-wide",children:"required"})]}),k&&e.jsx("p",{className:`text-fg-dim text-xs mt-0.5 leading-relaxed ${k.authored?"inline-block border-b border-dotted border-fg-faint/70 cursor-help":""}`,title:k.authored?"In-app-authored description — not from the official Claude Code schema":void 0,children:Me(k.text)}),r&&p&&g&&e.jsx(ke,{leaf:g,defaultVal:u,onReset:o=>a(void 0,o)}),r&&e.jsx(Ce,{keyName:s,node:n,info:t,targetScope:l,onOverride:o=>a(o)})]}),e.jsx("div",{className:"shrink-0",children:!r&&e.jsx(Ae,{node:n,info:t,onSet:o=>{a(o)},disabled:y&&x})})]})})}function Se(s,n){if(!s)return[];const t=new Set;t.add(s.winner);for(const l of s.shadowed)t.add(l.scope);return n!==void 0&&t.add("default"),be.filter(l=>t.has(l))}function ke({leaf:s,defaultVal:n,onReset:t}){const l={};l[s.winner]={value:s.value,winner:!0};for(const a of s.shadowed)l[a.scope]={value:a.value,winner:!1};return e.jsxs("div",{className:"mt-2 border border-line rounded bg-bg-elev/40 text-xs",children:[e.jsx("div",{className:"px-2 py-1 text-fg-faint border-b border-line/60",children:"Values across all scopes (winner highlighted · reset removes that scope's value):"}),e.jsxs("div",{className:"divide-y divide-line/60",children:[["user","project","local"].map(a=>{const r=l[a],i=r!==void 0;return e.jsxs("div",{className:"grid grid-cols-[5rem_1fr_auto] gap-2 px-2 py-1 items-center",children:[e.jsx("span",{className:"text-fg-faint",children:O[a].label}),e.jsx("span",{className:`font-mono truncate ${r!=null&&r.winner?"text-accent":"text-fg-dim"}`,children:i?P(r.value):e.jsx("span",{className:"text-fg-faint",children:"—"})}),i?e.jsx("button",{onClick:()=>t(a),className:"text-[9px] px-1.5 py-0 rounded border border-line text-fg-faint uppercase tracking-wide hover:text-fg hover:bg-bg-hi",title:`delete this key from ${O[a].label}`,children:"↺"}):e.jsx("span",{})]},a)}),e.jsxs("div",{className:"grid grid-cols-[5rem_1fr_auto] gap-2 px-2 py-1 items-center",children:[e.jsx("span",{className:"text-fg-faint",children:"Default"}),e.jsx("span",{className:"font-mono text-fg-dim truncate",children:n!==void 0?P(n):e.jsx("span",{className:"text-fg-faint",children:"—"})}),e.jsx("span",{})]})]})]})}function Ce({keyName:s,node:n,info:t,targetScope:l,onOverride:a}){const i=(n==null?void 0:n.kind)==="leaf"?n:null,p=z(s,t==null?void 0:t.description);return e.jsxs("div",{className:"mt-3 space-y-2 text-xs",children:[p&&e.jsx("p",{className:`text-fg-dim leading-relaxed whitespace-pre-wrap ${p.authored?"inline-block border-b border-dotted border-fg-faint/70 cursor-help":""}`,title:p.authored?"In-app-authored description — not from the official Claude Code schema":void 0,children:p.text}),e.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-fg-faint",children:[(t==null?void 0:t.type)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Type"}),e.jsx("dd",{className:"text-fg-dim font-mono",children:Array.isArray(t.type)?t.type.join(" | "):t.type})]}),(t==null?void 0:t.default)!==void 0&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Default"}),e.jsx("dd",{className:"text-fg-dim font-mono",children:P(t.default)})]}),(t==null?void 0:t.enum)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Options"}),e.jsx("dd",{className:"text-fg-dim font-mono",children:t.enum.map(m=>String(m)).join(" | ")})]}),i&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Current"}),e.jsxs("dd",{className:"font-mono",children:[e.jsx("span",{className:"text-fg-dim",children:P(i.value)}),e.jsxs("span",{className:"ml-2 text-fg-faint",children:["from ",O[i.winner].label]})]})]}),i&&i.shadowed.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Shadowed"}),e.jsx("dd",{className:"space-y-0.5",children:i.shadowed.map((m,v)=>e.jsxs("div",{className:"font-mono text-fg-faint line-through",children:[P(m.value)," —"," ",e.jsx("span",{className:"no-underline",children:O[m.scope].label})]},v))})]}),(n==null?void 0:n.kind)==="array"&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Accumulated"}),e.jsxs("dd",{className:"text-fg-dim",children:[n.items.length," items across all scopes"]})]})]}),e.jsx("div",{className:"pt-2 flex items-center gap-2 flex-wrap border-t border-line/60",children:e.jsx(Ee,{keyName:s,node:n,info:t,onChange:a,targetScope:l})})]})}function Ee({node:s,info:n,onChange:t,targetScope:l}){const r=(s==null?void 0:s.kind)==="leaf"?s.value:n==null?void 0:n.default,i=q(n==null?void 0:n.type);if(i==="boolean"){const p=r===!0;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-fg-faint",children:"Set to:"}),e.jsx("div",{className:"inline-flex rounded border border-line overflow-hidden",children:[{v:!0,label:"on"},{v:!1,label:"off"}].map(({v:m,label:v})=>e.jsx("button",{onClick:()=>t(m),className:`px-3 py-0.5 text-xs transition-colors ${p===m?"bg-accent text-bg":"bg-bg-elev text-fg-dim hover:bg-bg-hi hover:text-fg"}`,children:v},v))}),e.jsxs("span",{className:"text-fg-faint",children:["→ ",O[l].label]})]})}return n!=null&&n.enum?e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-fg-faint",children:"Choose:"}),n.enum.map(p=>{const m=Y(r,p);return e.jsx("button",{onClick:()=>t(p),className:`px-2 py-0.5 text-xs rounded border ${m?"bg-accent text-bg border-accent":"bg-bg-elev text-fg-dim border-line hover:text-fg hover:bg-bg-hi"}`,children:String(p)},String(p))}),e.jsxs("span",{className:"text-fg-faint",children:["→ ",O[l].label]})]}):i==="integer"||i==="number"?e.jsx(Oe,{value:typeof r=="number"?r:void 0,integer:i==="integer",onCommit:t,target:O[l].label}):i==="string"?e.jsx(Te,{value:typeof r=="string"?r:"",onCommit:t,target:O[l].label}):e.jsxs("div",{className:"text-fg-faint",children:["Complex value (",i??"object/array",") — use the"," ",e.jsx("span",{className:"text-fg-dim",children:"Raw"})," tab to edit."]})}function Oe({value:s,integer:n,onCommit:t,target:l}){const[a,r]=d.useState(s!==void 0?String(s):""),i=()=>{const p=n?parseInt(a,10):parseFloat(a);Number.isNaN(p)||t(p)};return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-fg-faint",children:"Set to:"}),e.jsx("input",{type:"number",value:a,onChange:p=>r(p.target.value),onBlur:i,onKeyDown:p=>{p.key==="Enter"&&p.target.blur()},className:"w-24 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"}),e.jsxs("button",{onClick:i,className:"px-2 py-0.5 text-xs border border-accent/50 rounded text-accent hover:bg-accent hover:text-bg",children:["save → ",l]})]})}function Te({value:s,onCommit:n,target:t}){const[l,a]=d.useState(s);return e.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[e.jsx("span",{className:"text-fg-faint shrink-0",children:"Set to:"}),e.jsx("input",{type:"text",value:l,onChange:r=>a(r.target.value),onKeyDown:r=>{r.key==="Enter"&&n(l)},className:"flex-1 min-w-0 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"}),e.jsxs("button",{onClick:()=>n(l),className:"shrink-0 px-2 py-0.5 text-xs border border-accent/50 rounded text-accent hover:bg-accent hover:text-bg",children:["save → ",t]})]})}function Ae({node:s,info:n,onSet:t,disabled:l}){const a=(s==null?void 0:s.kind)==="leaf",r=q(n==null?void 0:n.type);if(l)return null;if(r==="boolean"){const i=a&&s.value===!0;return e.jsx("button",{onClick:()=>t(!i),className:`px-2.5 py-0.5 text-xs rounded border transition-colors ${i?"bg-accent/15 text-accent border-accent/40 hover:bg-accent hover:text-bg":"bg-bg-elev text-fg-dim border-line hover:text-fg hover:bg-bg-hi"}`,title:"toggle",children:i?"on":"off"})}return null}function Pe({isSet:s,leafNode:n,defaultVal:t,isDefault:l,node:a}){return s?(a==null?void 0:a.kind)==="array"?{kind:"accumulated",label:`${a.items.length} items`}:(a==null?void 0:a.kind)==="object"?{kind:"set",label:"configured"}:n?l?{kind:"default",label:`= default · ${O[n.winner].label}`}:n.shadowed.length>0?{kind:"override",label:`overriding ${n.shadowed.length} scope(s)`}:{kind:"set",label:`set in ${O[n.winner].label}`}:{kind:"set",label:"configured"}:t!==void 0?{kind:"default",label:`using default: ${P(t)}`}:{kind:"unset",label:"not configured"}}function Re({kind:s,label:n}){const t={set:"bg-accent/15 text-accent border-accent/30",default:"bg-bg-hi text-fg-dim border-line",unset:"bg-bg-elev text-fg-faint border-line",override:"bg-purple-950/30 text-purple-400/80 border-purple-900/40",accumulated:"bg-blue-950/30 text-blue-400/80 border-blue-900/40"}[s];return e.jsx("span",{className:`text-[9px] px-1.5 py-0 rounded border uppercase tracking-wide ${t}`,children:n})}function q(s){if(s)return Array.isArray(s)?s.find(t=>t!=="null")??s[0]:s}function Y(s,n){return s===n?!0:typeof s!=typeof n?!1:s&&n&&typeof s=="object"?JSON.stringify(s)===JSON.stringify(n):!1}function Me(s){const n=s.trim().split(`
1
+ import{au as d,ah as e,S as O,a as Q,l as R,aS as X,R as ee,aH as te,aN as se,aV as $,aP as ne,aK as M,aj as ae,an as re,J as le,V as ie,z as H,az as oe}from"./index-4dEn1t8J.js";import{P as ce}from"./Panel-C2Cb7TS4.js";import{S as de}from"./ScopeSwitcher-MBmWNzFk.js";import{S as K}from"./SaveBar-1NvfbO9r.js";import{u as ue,s as G,E as xe}from"./settingsSchema-DiqEpSBA.js";import{T as L}from"./Toggle--nwLR-_8.js";import"./monaco-editor-BW5C4Iv1.js";const pe=[{id:"essentials",title:"Essentials",summary:"The knobs you reach for first.",keys:["model","language","outputStyle","permissions"]},{id:"git",title:"Git & Commits",summary:"How Claude writes commits and pull requests on your behalf.",keys:["attribution","includeGitInstructions","includeCoAuthoredBy"]},{id:"memory",title:"Memory & Plans",summary:"Context Claude keeps between sessions and where it files plans.",keys:["autoMemoryEnabled","plansDirectory","claudeMdExcludes","respectGitignore"]},{id:"model",title:"Model & Reasoning",summary:"Model allow/override lists, reasoning depth, and fast-mode toggles — machine-wide, with no per-Epic override yet. An Epic's Agent persona model (Agent Library) still wins over Essentials' plain model default.",advanced:!0,keys:["availableModels","modelOverrides","effortLevel","fastMode","fastModePerSessionOptIn","alwaysThinkingEnabled","fallbackModel","enforceAvailableModels","teammateDefaultModel","advisorModel"]},{id:"interface",title:"Interface",summary:"Visual polish — spinners, progress bars, motion.",keys:["spinnerTipsEnabled","spinnerTipsOverride","spinnerVerbs","terminalProgressBarEnabled","showTurnDuration","prefersReducedMotion","companyAnnouncements","statusLine","teammateMode"]},{id:"updates",title:"Updates & Cleanup",summary:"Release channel and how long transcripts stick around.",keys:["autoUpdatesChannel","cleanupPeriodDays"]},{id:"env",title:"Environment & Auth",summary:"Environment variables and auth-helper scripts.",keys:["env","apiKeyHelper","awsCredentialExport","awsAuthRefresh"]},{id:"hooks",title:"Hooks",summary:"Scripts Claude runs before/after tool use.",keys:["hooks","disableAllHooks","allowedHttpHookUrls","httpHookAllowedEnvVars"]},{id:"mcp",title:"MCP Servers",summary:"External tool providers Claude can talk to.",keys:["enableAllProjectMcpServers","enabledMcpjsonServers","disabledMcpjsonServers"]},{id:"plugins",title:"Plugins",summary:"Installed plugins, marketplaces, and per-plugin configuration.",keys:["enabledPlugins","extraKnownMarketplaces","skippedPlugins","skippedMarketplaces","pluginConfigs"]},{id:"filesystem",title:"File Picker & Sandbox",summary:"How Claude browses files and the sandbox it runs in.",keys:["fileSuggestion","sandbox","worktree"]},{id:"login",title:"Login",summary:"Which login method to force on startup.",keys:["forceLoginMethod","forceLoginOrgUUID"]},{id:"feedback",title:"Feedback",summary:"Session-quality surveys.",keys:["feedbackSurveyRate"]},{id:"advanced",title:"Advanced / Enterprise",summary:"Managed-settings-only keys and enterprise allow/denylists.",advanced:!0,keys:["allowedMcpServers","deniedMcpServers","allowManagedHooksOnly","allowManagedPermissionRulesOnly","allowManagedMcpServersOnly","strictKnownMarketplaces","blockedMarketplaces","pluginTrustMessage","otelHeadersHelper","skipWebFetchPreflight"]}],me={mcp:"MCP",url:"URL",urls:"URLs",http:"HTTP",ui:"UI",id:"ID",uuid:"UUID",api:"API",aws:"AWS",otel:"OTel",json:"JSON"};function V(s){return s.replace(/^\$/,"").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").toLowerCase().split(/\s+/).filter(Boolean).map((l,a)=>{const r=me[l];return r||(a===0?l.charAt(0).toUpperCase()+l.slice(1):l)}).join(" ")}function W(s){const n=new Set,t=[];for(const a of pe){const r=a.keys.filter(i=>s.has(i));r.forEach(i=>n.add(i)),r.length!==0&&t.push({id:a.id,title:a.title,summary:a.summary,advanced:!!a.advanced,keys:r})}const l=Array.from(s).filter(a=>!n.has(a)&&a!=="$schema").sort();return l.length>0&&t.push({id:"other",title:"Other",summary:"Keys not yet grouped.",advanced:!1,keys:l}),t}function fe(s,n){return W(s).map(t=>({id:t.id,title:t.title,advanced:t.advanced,total:t.keys.length,setCount:t.keys.filter(l=>n.has(l)).length}))}const he={};function z(s,n){if(n)return{text:n,authored:!1};const t=he[s];return t?{text:t,authored:!0}:null}const ge={essentials:"star",git:"link",memory:"memory",model:"sparkle",interface:"eye",updates:"reload",env:"keys",hooks:"hooks",mcp:"mcp",plugins:"plugins",filesystem:"folder",login:"lock",feedback:"send",advanced:"shield",other:"dot"},be=["user","project","local","default"],ye={user:"user",project:"project",local:"local",default:"default"};function je({node:s,targetScope:n,onOverride:t,schema:l}){const[a,r]=d.useState(""),[i,p]=d.useState(!1),[m,v]=d.useState(!0),x=s.kind==="object"?s:null,w=x?Object.keys(x.children):[],g=l.rootKeys(),y=new Set([...w,...g]),u=d.useMemo(()=>W(y),[Array.from(y).sort().join(",")]),b=d.useMemo(()=>fe(y,new Set(w)),[Array.from(y).sort().join(","),w.join(",")]),[C,E]=d.useState(null),f=d.useRef(null),S=o=>{const j=u.find(N=>N.id===o);j!=null&&j.advanced&&!i&&p(!0),E(o)};d.useEffect(()=>{if(!C)return;E(null);const o=f.current,j=document.getElementById(`settings-group-${C}`);if(!o||!j)return;const N=j.getBoundingClientRect().top-o.getBoundingClientRect().top;o.scrollBy({top:N,behavior:"smooth"})},[C]);const k=d.useMemo(()=>u.filter(o=>i||!o.advanced).map(o=>({...o,keys:o.keys.filter(j=>{const N=(x==null?void 0:x.children[j])!==void 0;if(!m&&!N)return!1;if(!a.trim())return!0;const h=l.at([j]);return[j,V(j),(h==null?void 0:h.description)??""].join(" ").toLowerCase().includes(a.toLowerCase())})})).filter(o=>o.keys.length>0),[u,a,i,m,x,l]);return e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{className:"shrink-0 border-b border-line bg-bg-elev px-3 py-1.5 flex items-center gap-3 text-xs",children:[e.jsxs("span",{className:"text-fg-faint",children:["writing overrides to"," ",e.jsx("span",{className:"text-fg-dim font-medium",children:O[n].label})]}),e.jsxs("label",{className:"flex items-center gap-1 text-fg-faint cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:m,onChange:o=>v(o.target.checked),className:"accent-accent"}),"show not-yet-configured"]}),e.jsxs("label",{className:"flex items-center gap-1 text-fg-faint cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:i,onChange:o=>p(o.target.checked),className:"accent-accent"}),"show advanced"]}),e.jsx("div",{className:"flex-1"}),e.jsx("input",{value:a,onChange:o=>r(o.target.value),placeholder:"search settings…",className:"bg-bg border border-line rounded px-2 py-1 text-xs text-fg w-64"})]}),e.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[e.jsx(ve,{groups:b,onJump:S}),e.jsxs("div",{ref:f,className:"flex-1 overflow-auto py-3",children:[k.map(o=>e.jsx(Ne,{id:o.id,title:o.title,summary:o.summary,advanced:o.advanced,children:o.keys.map(j=>{const N=x==null?void 0:x.children[j],h=l.at([j]);return e.jsx(we,{keyName:j,node:N,info:h,targetScope:n,onOverride:(c,T)=>t([j],c,T)},j)})},o.id)),k.length===0&&e.jsxs("div",{className:"px-6 py-12 text-center text-fg-faint text-sm",children:['no settings match "',a,'"']})]})]})]})}function ve({groups:s,onJump:n}){return e.jsx("nav",{className:"shrink-0 w-48 border-r border-line bg-bg-elev/30 overflow-y-auto py-3",children:s.map(t=>e.jsxs("button",{onClick:()=>n(t.id),className:"w-full flex items-center gap-2 px-3 py-2 text-left hover:bg-bg-hi transition-colors",title:`jump to ${t.title}`,children:[e.jsx(Q,{name:ge[t.id]??"dot",size:15,className:"text-fg-faint shrink-0"}),e.jsx("span",{className:"flex-1 min-w-0 truncate text-xs text-fg-dim",children:t.title}),e.jsxs("span",{className:"text-[10px] text-fg-faint font-mono shrink-0",children:[t.setCount,"/",t.total]})]},t.id))})}function Ne({id:s,title:n,summary:t,advanced:l,children:a}){const[r,i]=d.useState(!0);return e.jsxs("section",{id:`settings-group-${s}`,className:"mx-4 mb-4 rounded-lg border border-line shadow-sm bg-bg-elev/50 overflow-hidden",children:[e.jsxs("header",{className:"px-4 py-3 bg-bg-elev cursor-pointer hover:bg-bg-hi flex items-center gap-3 border-b border-line",onClick:()=>i(!r),children:[e.jsx("span",{className:"text-fg-faint w-3",children:r?"▾":"▸"}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-fg text-base font-semibold",children:n}),l&&e.jsx("span",{className:"text-[9px] px-1.5 py-0 rounded border border-yellow-900/40 bg-yellow-950/30 text-yellow-500/80 uppercase tracking-wide",children:"advanced"})]}),e.jsx("p",{className:"text-fg-dim text-sm mt-0.5",children:t})]})]}),r&&e.jsx("div",{className:"divide-y divide-line/60",children:a})]})}function we({keyName:s,node:n,info:t,targetScope:l,onOverride:a}){const[r,i]=d.useState(!1),[p,m]=d.useState(!1),v=V(s),x=n!==void 0,g=(n==null?void 0:n.kind)==="leaf"?n:null,y=(n==null?void 0:n.kind)==="object"||(n==null?void 0:n.kind)==="array",u=t==null?void 0:t.default,b=g&&u!==void 0&&Y(g.value,u),C=Pe({isSet:x,leafNode:g,defaultVal:u,isDefault:!!b,node:n}),E=Se(g,u),f=E.length>=2,S=!!g&&!b,k=z(s,t==null?void 0:t.description);return e.jsx("div",{className:"px-4 py-3 hover:bg-bg-elev/20",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("button",{onClick:()=>i(!r),className:"text-fg-faint hover:text-fg w-3 mt-0.5",title:r?"collapse":"expand",children:r?"▾":"▸"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-baseline gap-2 flex-wrap",children:[e.jsx("h3",{className:"text-fg text-sm",children:v}),e.jsx(Re,{kind:C.kind,label:C.label}),f&&e.jsxs("button",{onClick:o=>{o.stopPropagation(),r||i(!0),m(j=>!j)},className:"text-[9px] px-1.5 py-0 rounded border border-blue-900/40 bg-blue-950/30 text-blue-300/90 uppercase tracking-wide hover:bg-blue-900/40",title:"this key is defined in multiple scopes — click to expand",children:["drift · ",E.map(o=>ye[o]).join(" · ")]}),S&&g&&e.jsx("button",{onClick:o=>{o.stopPropagation(),a(void 0,g.winner)},className:"text-[9px] px-1.5 py-0 rounded border border-line bg-bg-elev text-fg-faint uppercase tracking-wide hover:text-fg hover:bg-bg-hi",title:`reset · delete from ${O[g.winner].label}`,children:"↺ reset"}),(t==null?void 0:t.deprecated)&&e.jsx("span",{className:"text-[9px] px-1 py-0 rounded border border-yellow-900/40 bg-yellow-950/30 text-yellow-500/80 uppercase tracking-wide",children:"deprecated"}),(t==null?void 0:t.required)&&!x&&e.jsx("span",{className:"text-[9px] px-1 py-0 rounded border border-red-900/40 bg-red-950/30 text-red-400/80 uppercase tracking-wide",children:"required"})]}),k&&e.jsx("p",{className:`text-fg-dim text-xs mt-0.5 leading-relaxed ${k.authored?"inline-block border-b border-dotted border-fg-faint/70 cursor-help":""}`,title:k.authored?"In-app-authored description — not from the official Claude Code schema":void 0,children:Me(k.text)}),r&&p&&g&&e.jsx(ke,{leaf:g,defaultVal:u,onReset:o=>a(void 0,o)}),r&&e.jsx(Ce,{keyName:s,node:n,info:t,targetScope:l,onOverride:o=>a(o)})]}),e.jsx("div",{className:"shrink-0",children:!r&&e.jsx(Ae,{node:n,info:t,onSet:o=>{a(o)},disabled:y&&x})})]})})}function Se(s,n){if(!s)return[];const t=new Set;t.add(s.winner);for(const l of s.shadowed)t.add(l.scope);return n!==void 0&&t.add("default"),be.filter(l=>t.has(l))}function ke({leaf:s,defaultVal:n,onReset:t}){const l={};l[s.winner]={value:s.value,winner:!0};for(const a of s.shadowed)l[a.scope]={value:a.value,winner:!1};return e.jsxs("div",{className:"mt-2 border border-line rounded bg-bg-elev/40 text-xs",children:[e.jsx("div",{className:"px-2 py-1 text-fg-faint border-b border-line/60",children:"Values across all scopes (winner highlighted · reset removes that scope's value):"}),e.jsxs("div",{className:"divide-y divide-line/60",children:[["user","project","local"].map(a=>{const r=l[a],i=r!==void 0;return e.jsxs("div",{className:"grid grid-cols-[5rem_1fr_auto] gap-2 px-2 py-1 items-center",children:[e.jsx("span",{className:"text-fg-faint",children:O[a].label}),e.jsx("span",{className:`font-mono truncate ${r!=null&&r.winner?"text-accent":"text-fg-dim"}`,children:i?P(r.value):e.jsx("span",{className:"text-fg-faint",children:"—"})}),i?e.jsx("button",{onClick:()=>t(a),className:"text-[9px] px-1.5 py-0 rounded border border-line text-fg-faint uppercase tracking-wide hover:text-fg hover:bg-bg-hi",title:`delete this key from ${O[a].label}`,children:"↺"}):e.jsx("span",{})]},a)}),e.jsxs("div",{className:"grid grid-cols-[5rem_1fr_auto] gap-2 px-2 py-1 items-center",children:[e.jsx("span",{className:"text-fg-faint",children:"Default"}),e.jsx("span",{className:"font-mono text-fg-dim truncate",children:n!==void 0?P(n):e.jsx("span",{className:"text-fg-faint",children:"—"})}),e.jsx("span",{})]})]})]})}function Ce({keyName:s,node:n,info:t,targetScope:l,onOverride:a}){const i=(n==null?void 0:n.kind)==="leaf"?n:null,p=z(s,t==null?void 0:t.description);return e.jsxs("div",{className:"mt-3 space-y-2 text-xs",children:[p&&e.jsx("p",{className:`text-fg-dim leading-relaxed whitespace-pre-wrap ${p.authored?"inline-block border-b border-dotted border-fg-faint/70 cursor-help":""}`,title:p.authored?"In-app-authored description — not from the official Claude Code schema":void 0,children:p.text}),e.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-fg-faint",children:[(t==null?void 0:t.type)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Type"}),e.jsx("dd",{className:"text-fg-dim font-mono",children:Array.isArray(t.type)?t.type.join(" | "):t.type})]}),(t==null?void 0:t.default)!==void 0&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Default"}),e.jsx("dd",{className:"text-fg-dim font-mono",children:P(t.default)})]}),(t==null?void 0:t.enum)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Options"}),e.jsx("dd",{className:"text-fg-dim font-mono",children:t.enum.map(m=>String(m)).join(" | ")})]}),i&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Current"}),e.jsxs("dd",{className:"font-mono",children:[e.jsx("span",{className:"text-fg-dim",children:P(i.value)}),e.jsxs("span",{className:"ml-2 text-fg-faint",children:["from ",O[i.winner].label]})]})]}),i&&i.shadowed.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Shadowed"}),e.jsx("dd",{className:"space-y-0.5",children:i.shadowed.map((m,v)=>e.jsxs("div",{className:"font-mono text-fg-faint line-through",children:[P(m.value)," —"," ",e.jsx("span",{className:"no-underline",children:O[m.scope].label})]},v))})]}),(n==null?void 0:n.kind)==="array"&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Accumulated"}),e.jsxs("dd",{className:"text-fg-dim",children:[n.items.length," items across all scopes"]})]})]}),e.jsx("div",{className:"pt-2 flex items-center gap-2 flex-wrap border-t border-line/60",children:e.jsx(Ee,{keyName:s,node:n,info:t,onChange:a,targetScope:l})})]})}function Ee({node:s,info:n,onChange:t,targetScope:l}){const r=(s==null?void 0:s.kind)==="leaf"?s.value:n==null?void 0:n.default,i=q(n==null?void 0:n.type);if(i==="boolean"){const p=r===!0;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-fg-faint",children:"Set to:"}),e.jsx("div",{className:"inline-flex rounded border border-line overflow-hidden",children:[{v:!0,label:"on"},{v:!1,label:"off"}].map(({v:m,label:v})=>e.jsx("button",{onClick:()=>t(m),className:`px-3 py-0.5 text-xs transition-colors ${p===m?"bg-accent text-bg":"bg-bg-elev text-fg-dim hover:bg-bg-hi hover:text-fg"}`,children:v},v))}),e.jsxs("span",{className:"text-fg-faint",children:["→ ",O[l].label]})]})}return n!=null&&n.enum?e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-fg-faint",children:"Choose:"}),n.enum.map(p=>{const m=Y(r,p);return e.jsx("button",{onClick:()=>t(p),className:`px-2 py-0.5 text-xs rounded border ${m?"bg-accent text-bg border-accent":"bg-bg-elev text-fg-dim border-line hover:text-fg hover:bg-bg-hi"}`,children:String(p)},String(p))}),e.jsxs("span",{className:"text-fg-faint",children:["→ ",O[l].label]})]}):i==="integer"||i==="number"?e.jsx(Oe,{value:typeof r=="number"?r:void 0,integer:i==="integer",onCommit:t,target:O[l].label}):i==="string"?e.jsx(Te,{value:typeof r=="string"?r:"",onCommit:t,target:O[l].label}):e.jsxs("div",{className:"text-fg-faint",children:["Complex value (",i??"object/array",") — use the"," ",e.jsx("span",{className:"text-fg-dim",children:"Raw"})," tab to edit."]})}function Oe({value:s,integer:n,onCommit:t,target:l}){const[a,r]=d.useState(s!==void 0?String(s):""),i=()=>{const p=n?parseInt(a,10):parseFloat(a);Number.isNaN(p)||t(p)};return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-fg-faint",children:"Set to:"}),e.jsx("input",{type:"number",value:a,onChange:p=>r(p.target.value),onBlur:i,onKeyDown:p=>{p.key==="Enter"&&p.target.blur()},className:"w-24 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"}),e.jsxs("button",{onClick:i,className:"px-2 py-0.5 text-xs border border-accent/50 rounded text-accent hover:bg-accent hover:text-bg",children:["save → ",l]})]})}function Te({value:s,onCommit:n,target:t}){const[l,a]=d.useState(s);return e.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[e.jsx("span",{className:"text-fg-faint shrink-0",children:"Set to:"}),e.jsx("input",{type:"text",value:l,onChange:r=>a(r.target.value),onKeyDown:r=>{r.key==="Enter"&&n(l)},className:"flex-1 min-w-0 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"}),e.jsxs("button",{onClick:()=>n(l),className:"shrink-0 px-2 py-0.5 text-xs border border-accent/50 rounded text-accent hover:bg-accent hover:text-bg",children:["save → ",t]})]})}function Ae({node:s,info:n,onSet:t,disabled:l}){const a=(s==null?void 0:s.kind)==="leaf",r=q(n==null?void 0:n.type);if(l)return null;if(r==="boolean"){const i=a&&s.value===!0;return e.jsx("button",{onClick:()=>t(!i),className:`px-2.5 py-0.5 text-xs rounded border transition-colors ${i?"bg-accent/15 text-accent border-accent/40 hover:bg-accent hover:text-bg":"bg-bg-elev text-fg-dim border-line hover:text-fg hover:bg-bg-hi"}`,title:"toggle",children:i?"on":"off"})}return null}function Pe({isSet:s,leafNode:n,defaultVal:t,isDefault:l,node:a}){return s?(a==null?void 0:a.kind)==="array"?{kind:"accumulated",label:`${a.items.length} items`}:(a==null?void 0:a.kind)==="object"?{kind:"set",label:"configured"}:n?l?{kind:"default",label:`= default · ${O[n.winner].label}`}:n.shadowed.length>0?{kind:"override",label:`overriding ${n.shadowed.length} scope(s)`}:{kind:"set",label:`set in ${O[n.winner].label}`}:{kind:"set",label:"configured"}:t!==void 0?{kind:"default",label:`using default: ${P(t)}`}:{kind:"unset",label:"not configured"}}function Re({kind:s,label:n}){const t={set:"bg-accent/15 text-accent border-accent/30",default:"bg-bg-hi text-fg-dim border-line",unset:"bg-bg-elev text-fg-faint border-line",override:"bg-purple-950/30 text-purple-400/80 border-purple-900/40",accumulated:"bg-blue-950/30 text-blue-400/80 border-blue-900/40"}[s];return e.jsx("span",{className:`text-[9px] px-1.5 py-0 rounded border uppercase tracking-wide ${t}`,children:n})}function q(s){if(s)return Array.isArray(s)?s.find(t=>t!=="null")??s[0]:s}function Y(s,n){return s===n?!0:typeof s!=typeof n?!1:s&&n&&typeof s=="object"?JSON.stringify(s)===JSON.stringify(n):!1}function Me(s){const n=s.trim().split(`
2
2
  `)[0],t=n.match(/^([^.!?]+[.!?])/);return t?t[1]:n.length>120?n.slice(0,120)+"…":n}function P(s){if(typeof s=="string")return s===""?'""':JSON.stringify(s);if(s===null)return"null";if(s===void 0)return"—";if(typeof s=="object"){const n=JSON.stringify(s);return n.length>60?n.slice(0,60)+"…":n}return String(s)}const Ie=1440*60*1e3;function U(s){if(!s)return"never";const n=new Date(s).getTime();return Number.isNaN(n)?"never":new Date(n).toLocaleString()}function J(s){return s?new Date(s).toLocaleString():"never"}function De(){return e.jsxs("div",{className:"p-4 max-w-3xl space-y-8 text-sm",children:[e.jsx(Le,{}),e.jsx("hr",{className:"border-line"}),e.jsx(_e,{})]})}function Le(){const[s,n]=d.useState(null),[t,l]=d.useState(null),[a,r]=d.useState(null),[i,p]=d.useState(null),[m,v]=d.useState(!1),[x,w]=d.useState(null),[g,y]=d.useState(null);if(d.useEffect(()=>{let f=!1;return Promise.all([window.api.otel.getConfig(),window.api.otel.status(),window.api.otel.configPath()]).then(([S,k,o])=>{f||(n(S),r(S),l(k),p(o))}).catch(S=>{console.warn("[telemetry] load failed:",S==null?void 0:S.message)}),()=>{f=!0}},[]),!a||!s)return e.jsx(R,{title:"loading…"});const u=JSON.stringify(a)!==JSON.stringify(s),b=(f,S)=>{w(null),r({...a,[f]:S})},C=async()=>{v(!0),w(null);try{const f=await window.api.otel.setConfig(a);!f.ok&&f.error&&w(f.error),n(f.config),r(f.config),l(f.status),y(Date.now())}catch(f){w(f instanceof Error?f.message:String(f))}finally{v(!1)}},E=()=>{w(null),r(s)};return e.jsxs("div",{className:"space-y-5",children:[e.jsxs("header",{className:"space-y-1",children:[e.jsx("h2",{className:"text-fg text-base font-medium",children:"OpenTelemetry export"}),e.jsx("p",{className:"text-fg-dim text-xs leading-relaxed",children:"When enabled, every classified transcript event (tool_use, todo_write, plan, usage, agent_spawn) is mirrored as a 0-duration OTLP/HTTP span. Point this at a local collector (Jaeger, Grafana Tempo, SigNoz, Honeycomb) for cross-session analysis."}),i&&e.jsxs("p",{className:"text-fg-faint text-[11px]",children:["stored at ",e.jsx("span",{className:"font-mono",children:i})]})]}),e.jsxs("section",{className:"border border-line rounded p-3 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-fg",children:"Export transcripts to OTEL"}),e.jsx("div",{className:"text-fg-faint text-xs",children:"Toggle off to disable all span emission immediately."})]}),e.jsx(L,{checked:a.enabled,onChange:f=>b("enabled",f),label:a.enabled?"on":"off"})]}),e.jsxs("label",{className:"block space-y-1",children:[e.jsx("span",{className:"text-fg-dim text-xs",children:"OTLP/HTTP traces endpoint"}),e.jsx("input",{type:"text",value:a.endpoint,onChange:f=>b("endpoint",f.target.value),placeholder:"http://localhost:4318/v1/traces",className:"w-full bg-bg border border-line rounded px-2 py-1 text-fg font-mono text-xs"})]}),e.jsxs("label",{className:"block space-y-1",children:[e.jsxs("span",{className:"text-fg-dim text-xs",children:["Headers (newline-separated ",e.jsx("span",{className:"font-mono",children:"Key: Value"}),")"]}),e.jsx("textarea",{value:a.headers,onChange:f=>b("headers",f.target.value),placeholder:"x-honeycomb-team: YOUR_API_KEY",rows:3,className:"w-full bg-bg border border-line rounded px-2 py-1 text-fg font-mono text-xs"})]}),e.jsxs("label",{className:"block space-y-1",children:[e.jsx("span",{className:"text-fg-dim text-xs",children:"Service name"}),e.jsx("input",{type:"text",value:a.serviceName,onChange:f=>b("serviceName",f.target.value),placeholder:"session-manager",className:"w-full bg-bg border border-line rounded px-2 py-1 text-fg font-mono text-xs"})]}),e.jsxs("div",{className:"flex items-start justify-between gap-3 pt-1",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-fg",children:"Include content (PII)"}),e.jsxs("div",{className:"text-fg-faint text-xs leading-relaxed",children:["Adds tool inputs, plan text, and agent prompts to span attributes. Off by default — matches upstream Claude Code's ",e.jsx("span",{className:"font-mono",children:"OTEL_LOG_USER_PROMPTS"})," opt-in."]})]}),e.jsx(L,{checked:a.includeContent,onChange:f=>b("includeContent",f),label:a.includeContent?"on":"off"})]})]}),t&&e.jsxs("section",{className:"border border-line rounded p-3 text-xs space-y-1",children:[e.jsx("div",{className:"text-fg-dim",children:"Runtime status"}),e.jsxs("div",{children:[e.jsx("span",{className:"text-fg-faint",children:"enabled:"})," ",e.jsx("span",{className:t.enabled?"text-accent":"text-fg-dim",children:String(t.enabled)})]}),t.error&&e.jsxs("div",{className:"text-red-400 break-words",children:[e.jsx("span",{className:"text-fg-faint",children:"error:"})," ",t.error]}),!t.error&&t.enabled&&e.jsx("div",{className:"text-fg-faint",children:"spans batched and exported in the background. Verify by enabling and pointing at a local Jaeger."})]}),e.jsxs("footer",{className:"flex items-center gap-3 pt-2 border-t border-line",children:[e.jsx("button",{onClick:C,disabled:!u||m,className:"px-3 py-1 text-xs rounded bg-accent text-bg disabled:opacity-50 disabled:cursor-not-allowed",children:m?"saving…":"Save"}),e.jsx("button",{onClick:E,disabled:!u||m,className:"px-3 py-1 text-xs rounded border border-line text-fg-dim hover:text-fg disabled:opacity-50 disabled:cursor-not-allowed",children:"Revert"}),x&&e.jsx("span",{className:"text-red-400 text-xs",children:x}),!x&&g&&!u&&e.jsx("span",{className:"text-fg-faint text-xs",children:"saved"})]})]})}function _e(){const[s,n]=d.useState(null),[t,l]=d.useState(null),[a,r]=d.useState("Copy"),[i,p]=d.useState(!1),[m,v]=d.useState(null),[x,w]=d.useState(null),[g,y]=d.useState(null),[u,b]=d.useState(!1),C=()=>{window.api.telemetry.status().then(l).catch(h=>{console.warn("[product-telemetry] status reload failed:",h==null?void 0:h.message)})};if(d.useEffect(()=>{let h=!1;return Promise.all([window.api.telemetry.getConfig(),window.api.telemetry.status()]).then(([c,T])=>{h||(n(c),l(T))}).catch(c=>{console.warn("[product-telemetry] load failed:",c==null?void 0:c.message)}),()=>{h=!0}},[]),!s||!t)return e.jsx(R,{title:"loading…"});const E=async h=>{w(null);try{const c=await window.api.telemetry.setConfig(h);n(c.config),l(c.status)}catch(c){w(c instanceof Error?c.message:String(c))}},f=h=>{E({...s,enabled:h})},S=h=>{E({...s,enabled:h.turnOff?!1:s.enabled,noticeAckedAt:new Date().toISOString()})},k=async()=>{try{await navigator.clipboard.writeText(s.installId),r("Copied"),setTimeout(()=>r("Copy"),1500)}catch{}},o=async()=>{p(!0),v(null);try{const h=await window.api.telemetry.flushNow();v(`sent ${h.sent.length}, failed ${h.failed.length}`),C()}catch(h){v(h instanceof Error?h.message:String(h))}finally{p(!1)}},j=async()=>{if(u){b(!1);return}try{const h=await window.api.telemetry.recentRecords();y(h),b(!0)}catch(h){console.warn("[product-telemetry] recentRecords failed:",h instanceof Error?h.message:h)}},N=s.lastDailyFlushAt?new Date(s.lastDailyFlushAt).getTime()+Ie:null;return e.jsxs("div",{className:"space-y-5","data-testid":"product-telemetry-section",children:[e.jsxs("header",{className:"space-y-1",children:[e.jsx("h2",{className:"text-fg text-base font-medium",children:"Product telemetry (bilko.run)"}),e.jsxs("p",{className:"text-fg-dim text-xs leading-relaxed",children:["Anonymous, strictly non-identifying usage/error reporting that helps improve this app. On by default; switchable off in one click. See"," ",e.jsx("span",{className:"font-mono",children:"session-manager-operations/architecture/telemetry.md"})," for the full data model."]})]}),!s.noticeAckedAt&&e.jsxs("section",{"data-testid":"telemetry-first-run-notice",className:"border border-accent rounded p-3 space-y-2 text-xs",children:[e.jsx("div",{className:"text-fg font-medium",children:"This app sends anonymous product telemetry"}),e.jsx("p",{className:"text-fg-dim leading-relaxed",children:"Collected: a coarse machine profile (OS/arch/app version, no hardware id), error and warning counts, and session counts — sent on start-up, after an update, and once a day."}),e.jsx("p",{className:"text-fg-dim leading-relaxed",children:"Never collected: prompts, transcripts, file paths, project names, email, or username."}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx("button",{onClick:()=>S({turnOff:!1}),className:"px-3 py-1 rounded bg-accent text-bg",children:"OK"}),e.jsx("button",{onClick:()=>S({turnOff:!0}),className:"px-3 py-1 rounded border border-line text-fg-dim hover:text-fg",children:"Turn off"})]})]}),e.jsxs("section",{className:"border border-line rounded p-3 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-fg",children:"Send anonymous product telemetry"}),e.jsx("div",{className:"text-fg-faint text-xs",children:"Sent on start-up, after an update, and once a day. Strictly anonymous — an install id only, never an email, name, or other identifier."})]}),e.jsx(L,{checked:s.enabled,onChange:f,label:s.enabled?"on":"off"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-fg-dim text-xs",children:"Anonymous install id"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text",readOnly:!0,value:s.installId,"aria-label":"Anonymous install identifier",className:"flex-1 bg-bg border border-line rounded px-2 py-1 text-fg font-mono text-xs"}),e.jsx("button",{onClick:k,className:"px-2 py-1 text-xs rounded border border-line text-fg-dim hover:text-fg",children:a})]})]}),e.jsxs("div",{className:"space-y-1 text-xs",children:[e.jsx("div",{className:"text-fg-faint",children:"Endpoint"}),e.jsx("div",{className:"font-mono text-fg-dim break-all",children:s.endpoint})]}),e.jsxs("div",{className:"space-y-1 text-xs",children:[e.jsx("div",{className:"text-fg-faint",children:"Send cadence"}),e.jsx("div",{className:"text-fg-dim",children:"on start-up, after an update, and once a day"})]}),x&&e.jsx("div",{className:"text-red-400 text-xs",children:x})]}),t.pendingCount>0&&t.sentCount===0&&e.jsxs("section",{"data-testid":"telemetry-never-delivered-warning",className:"border border-red-400 rounded p-3 text-xs space-y-1 text-red-400",children:[e.jsx("div",{className:"font-medium",children:"Never delivered"}),e.jsxs("div",{className:"leading-relaxed",children:[t.pendingCount," record",t.pendingCount===1?"":"s",' queued but none have ever been sent to bilko.run on this install. Check the endpoint/network, or click "Send now" below.']})]}),e.jsxs("section",{className:"border border-line rounded p-3 text-xs space-y-1.5",children:[e.jsx("div",{className:"text-fg-dim",children:"Runtime status"}),e.jsxs("div",{children:[e.jsx("span",{className:"text-fg-faint",children:"last send:"})," ",J(t.lastFlushAt)]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-fg-faint",children:"next daily send due:"})," ",U(N?new Date(N).toISOString():null)]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-fg-faint",children:"queued records:"})," ",t.pendingCount]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-fg-faint",children:"delivered so far:"})," ",t.sentCount]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-fg-faint",children:"de-duplicated:"})," ",t.dedupedAppends]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-fg-faint",children:"evicted:"})," ",t.evictedCount]}),t.backlog&&e.jsxs("div",{className:"text-fg-faint",children:["last backlog drain (",t.backlog.reason,", ",U(t.backlog.ranAt),"):"," ",t.backlog.linesEnqueued," enqueued, ",t.backlog.linesConfirmed," confirmed,"," ",t.backlog.watermarksRewound," watermarks rewound"]}),t.lastError&&e.jsxs("div",{className:"text-red-400 break-words",children:[e.jsx("span",{className:"text-fg-faint",children:"last error:"})," ",t.lastError.message," ","(",J(t.lastError.at),")"]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{onClick:o,disabled:i,className:"px-3 py-1 text-xs rounded bg-accent text-bg disabled:opacity-50 disabled:cursor-not-allowed",children:i?"sending…":"Send now"}),m&&e.jsx("span",{className:"text-fg-faint text-xs",children:m})]}),e.jsxs("section",{className:"space-y-2",children:[e.jsx("button",{onClick:j,className:"px-3 py-1 text-xs rounded border border-line text-fg-dim hover:text-fg",children:u?"Hide last records":"Inspect last records sent"}),u&&e.jsx("pre",{"data-testid":"telemetry-inspector-json",className:"bg-bg border border-line rounded p-2 text-[11px] font-mono overflow-auto max-h-96 whitespace-pre-wrap",children:JSON.stringify(g??[],null,2)})]})]})}function Fe(){const{model:s,setModel:n}=X();return e.jsxs("div",{className:"p-4 max-w-3xl space-y-5 text-sm",children:[e.jsxs("header",{className:"space-y-1",children:[e.jsx("h2",{className:"text-fg text-base font-medium",children:"Session Manager preferences"}),e.jsx("p",{className:"text-fg-dim text-xs leading-relaxed",children:"Native app preferences, stored locally — not part of Claude Code's own settings."})]}),e.jsx("section",{className:"border border-line rounded p-3 space-y-3",children:e.jsxs("label",{className:"block space-y-1",children:[e.jsx("span",{className:"text-fg-dim text-xs",children:"Default model for raw sessions"}),e.jsx("select",{value:s,onChange:t=>n(t.target.value),className:"w-full bg-bg border border-line rounded px-2 py-1 text-fg font-mono text-xs",children:ee.map(t=>e.jsx("option",{value:t,children:t.charAt(0).toUpperCase()+t.slice(1)},t))}),e.jsx("span",{className:"text-fg-faint text-[11px]",children:"Used when opening a raw interactive session without an explicit per-launch override."})]})})]})}function $e({cwd:s}){const[n,t]=d.useState(!1),[l,a]=d.useState(!1),[r,i]=d.useState(!1),[p,m]=d.useState(!1);d.useEffect(()=>{var y,u;let g=!1;return t(!1),Promise.resolve((u=(y=window.api.promptSessions)==null?void 0:y.getWorktreeDisabled)==null?void 0:u.call(y,{cwd:s})).then(b=>{g||(a((b==null?void 0:b.disabled)??!1),i((b==null?void 0:b.disabled)??!1),t(!0))},()=>{g||t(!0)}),()=>{g=!0}},[s]);const v=n&&r!==l,x=()=>{var g,y;m(!0),Promise.resolve((y=(g=window.api.promptSessions)==null?void 0:g.setWorktreeDisabled)==null?void 0:y.call(g,{cwd:s,disabled:r})).then(u=>{a((u==null?void 0:u.disabled)??r),i((u==null?void 0:u.disabled)??r)}).catch(u=>te.error(u instanceof Error?u.message:String(u))).finally(()=>m(!1))},w=()=>i(l);return e.jsxs("div",{"data-testid":"settings-epic-isolation",className:"border-b border-line bg-bg-elev px-3 py-2.5 text-[11.5px] leading-snug",children:[e.jsxs("label",{className:"flex items-start gap-2",children:[e.jsx("input",{type:"checkbox",checked:r,disabled:!n||p,onChange:g=>i(g.target.checked),"data-testid":"settings-epic-isolation-checkbox",className:"mt-0.5"}),e.jsxs("span",{children:[e.jsx("span",{className:"font-semibold text-fg",children:"Disable Epic worktree isolation for this project"}),e.jsxs("span",{className:"block text-fg-dim",children:["Off by default — each active Epic runs in its own isolated ",e.jsx("code",{children:"git worktree"})," (branch"," ",e.jsx("code",{children:"sm-epic/<id>"}),"), merged back to main at an explicit checkpoint. Turning this on makes every new Epic in this project run directly in the shared working tree instead, same as before this feature existed."]})]})]}),v&&e.jsx(K,{dirty:v,busy:p,onSave:x,onRevert:w})]})}const B={user:{title:"Global settings",body:"This is the real ~/.claude/settings.json on disk — the same file the claude CLI reads on every session it starts. Edits apply machine-wide, to every project and every session."},project:{title:"Project settings",body:"This is the real <project>/.claude/settings.json on disk, checked into git. Edits apply to every current and future session in this project, for anyone who clones it."},local:{title:"Local settings",body:"This is the real <project>/.claude/settings.local.json on disk, gitignored. Edits apply to every current and future session in this project, on this machine only."}};function He(){const s=se(),n=$(c=>c.tabs),t=$(c=>c.activeTabId),l=n.find(c=>c.id===t)??null,a=(l==null?void 0:l.cwd)??null,r=ne(c=>c.navFace),i=d.useRef(!1),p=d.useRef(r),[m,v]=d.useState(()=>r==="project"&&a?"project":"user"),[x,w]=d.useState("effective");d.useEffect(()=>{if(p.current!==r){if(p.current=r,i.current){i.current=!1;return}v(r==="project"&&a?"project":"user")}},[r,a]),d.useEffect(()=>{r==="project"&&(x==="telemetry"||x==="app")&&w("effective")},[r,x]);const g=c=>{i.current=!0,v(c)},y=ue(H,s,a),u=y[m]??null,b=M(c=>c.files),C=M(c=>c.setDraft),E=M(c=>c.saveJson),f=M(c=>c.revert),[S,k]=d.useState(null),o=d.useMemo(()=>ae(re(b,y)),[b,y]),j=(c,T,A)=>{var F;const I=y[A??m];if(!I)return;k(null);const _=((F=b[I])==null?void 0:F.draftRaw)??"";let D={};if(_.trim())try{D=JSON.parse(_)}catch{D={}}const Z=oe(D,c,T);C(I,JSON.stringify(Z,null,2)+`
3
3
  `)};if(!s)return e.jsx(R,{title:"loading…"});const N=u?b[u]:null,h=c=>c!=="user"&&!a;return e.jsx(ce,{toolbar:e.jsxs(e.Fragment,{children:[e.jsx(ie,{options:[{key:"effective",label:"Guided"},{key:"tree",label:"Tree"},{key:"raw",label:"Raw"},...r==="home"?[{key:"telemetry",label:"Telemetry"},{key:"app",label:"Session Manager"}]:[]],active:x,onChange:w}),x!=="telemetry"&&x!=="app"&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),e.jsx(de,{scopes:H.scopes,active:m,onChange:g,annotate:c=>{if(h(c))return{exists:!1};const T=y[c];if(!T)return null;const A=b[T];return{exists:(A==null?void 0:A.exists)??!1,dirty:(A==null?void 0:A.dirty)??!1}}}),e.jsx("span",{className:"ml-3 text-fg-faint truncate",children:x==="effective"?`overrides → ${u??"—"}`:u??"—"})]}),e.jsx("div",{className:"flex-1"}),e.jsx("a",{href:"https://code.claude.com/docs/en/settings",target:"_blank",rel:"noreferrer",className:"text-fg-faint hover:text-fg-dim underline-offset-2 hover:underline",children:"schema reference ↗"})]}),footer:x!=="telemetry"&&x!=="app"&&u&&N?e.jsx(K,{dirty:N.dirty,busy:N.busy,parseError:S||N.parseError,lastSavedAt:N.lastSavedAt,leading:N.exists?null:e.jsx("span",{children:"file will be created on save"}),onSave:async()=>{k(null);const c=await E(u);c.ok||k(c.error??"save failed")},onRevert:()=>{k(null),f(u)}}):null,children:x==="telemetry"?e.jsx(De,{}):x==="app"?e.jsx(Fe,{}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{"data-testid":"settings-scope-note",className:"sticky top-0 z-10 border-b border-line bg-bg-elev px-3 py-2 text-[11.5px] leading-snug",children:[e.jsx("span",{className:"font-semibold text-fg",children:B[m].title}),e.jsx("span",{className:"mx-1.5 text-fg-faint",children:"·"}),e.jsx("span",{className:"text-fg-dim",children:B[m].body}),u&&e.jsx("span",{className:"ml-1.5 font-mono text-fg-faint",children:u})]}),m==="project"&&a&&e.jsx($e,{cwd:a}),h(m)?e.jsx(R,{title:"no active project",hint:"open a tab in a project directory to edit project or local settings"}):x==="effective"?e.jsx(je,{node:o,targetScope:m,onOverride:j,schema:G()}):x==="tree"?e.jsx(xe,{node:o,targetScope:m,onOverride:j,schema:G()}):u&&N?e.jsx(le,{path:u,value:N.draftRaw,onChange:c=>{k(null),C(u,c)}}):e.jsx(R,{title:"resolving…"})]})})}const qe=d.memo(He);export{B as SETTINGS_SCOPE_NOTES,qe as Settings};
@@ -1,4 +1,4 @@
1
- import{au as Q,w as bo,ae as wo,ah as tr}from"./index-ju-h7BFf.js";import"./monaco-editor-BW5C4Iv1.js";function ko(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,o,a,s,u=[],l=!0,f=!1;try{if(a=(r=r.call(e)).next,n===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(i=a.call(r)).done)&&(u.push(i.value),u.length!==n);l=!0);}catch(h){f=!0,o=h}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(f)throw o}}return u}}function Ao(e,n,r){return n=Ro(n),n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function er(e,n){return Mo(e)||ko(e,n)||fi(e,n)||Oo()}function Co(e){return So(e)||To(e)||fi(e)||Po()}function So(e){if(Array.isArray(e))return gn(e)}function Mo(e){if(Array.isArray(e))return e}function To(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function fi(e,n){if(e){if(typeof e=="string")return gn(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return gn(e,n)}}function gn(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=new Array(n);r<n;r++)i[r]=e[r];return i}function Po(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1
+ import{au as Q,w as bo,ae as wo,ah as tr}from"./index-4dEn1t8J.js";import"./monaco-editor-BW5C4Iv1.js";function ko(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,o,a,s,u=[],l=!0,f=!1;try{if(a=(r=r.call(e)).next,n===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(i=a.call(r)).done)&&(u.push(i.value),u.length!==n);l=!0);}catch(h){f=!0,o=h}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(f)throw o}}return u}}function Ao(e,n,r){return n=Ro(n),n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function er(e,n){return Mo(e)||ko(e,n)||fi(e,n)||Oo()}function Co(e){return So(e)||To(e)||fi(e)||Po()}function So(e){if(Array.isArray(e))return gn(e)}function Mo(e){if(Array.isArray(e))return e}function To(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function fi(e,n){if(e){if(typeof e=="string")return gn(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return gn(e,n)}}function gn(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=new Array(n);r<n;r++)i[r]=e[r];return i}function Po(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Oo(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
3
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Eo(e,n){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function Ro(e){var n=Eo(e,"string");return typeof n=="symbol"?n:String(n)}var zo=function(n,r){var i=new Set(r);return Object.assign.apply(Object,[{}].concat(Co(Object.entries(n).filter(function(o){var a=er(o,1),s=a[0];return!i.has(s)}).map(function(o){var a=er(o,2),s=a[0],u=a[1];return Ao({},s,u)}))))};function yn(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function No(e){if(Array.isArray(e))return e}function Io(e){if(Array.isArray(e))return yn(e)}function $o(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Do(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,o,a,s,u=[],l=!0,f=!1;try{if(a=(r=r.call(e)).next,n!==0)for(;!(l=(i=a.call(r)).done)&&(u.push(i.value),u.length!==n);l=!0);}catch(h){f=!0,o=h}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(f)throw o}}return u}}function jo(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4
4
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Fo(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
@@ -1,3 +1,3 @@
1
- import{au as l,aN as J,aI as Q,aP as U,aK as f,ah as t,l as R,aH as L}from"./index-ju-h7BFf.js";import{P as D}from"./Panel-ilEDcV0m.js";import{L as X}from"./ListDetail-ByNJU-ie.js";import{M as Y}from"./MarkdownEditor-Wwcpe9O1.js";import{S as Z}from"./SaveBar-Cj0wz84u.js";import{S as I}from"./ScopeSwitcher-DA5MqWli.js";import{T as _}from"./Toggle-yTfx2R-e.js";import{P as V}from"./ProvenanceBadge-Cz1VLnXb.js";import{l as ee}from"./listSkills-QORduPIk.js";import{S as te,V as F}from"./Library-51Jx0oGl.js";import{p as se,r as ae,s as ne}from"./skillFrontmatter-Dif5JIg7.js";import"./monaco-editor-BW5C4Iv1.js";function re(d,m){return{user:{skills:`${d}/.claude/skills`,commands:`${d}/.claude/commands`},project:m?{skills:`${m}/.claude/skills`,commands:`${m}/.claude/commands`}:null}}function le(){const d=J(),m=Q(),h=(m==null?void 0:m.cwd)??null,x=U(e=>e.navFace),j=l.useRef(!1),T=l.useRef(x),[p,N]=l.useState(()=>x==="project"&&h?"project":"user"),[v,k]=l.useState([]),[r,C]=l.useState(null),[w,E]=l.useState("installed"),[$,B]=l.useState(""),b=l.useMemo(()=>d?re(d,h):null,[d,h]);l.useEffect(()=>{if(T.current!==x){if(T.current=x,j.current){j.current=!1;return}N(x==="project"&&h?"project":"user")}},[x,h]),l.useEffect(()=>{if(!b)return;let e=!1;const i=p==="user"?b.user:b.project;if(!i){k([]);return}return(async()=>{var c;const n=[],s=await ee(i.skills);for(const a of s)n.push({kind:"skills",scope:p,name:a.name,path:a.path,dir:a.dir,disabled:ae(a.text),description:se(a.text).description??void 0});const o=await window.api.config.listDir(i.commands,{filesOnly:!0});for(const a of o.entries)a.name.endsWith(".md")&&n.push({kind:"commands",scope:p,name:a.name.replace(/\.md$/,""),path:a.path,dir:null,disabled:!1});e||(n.sort((a,A)=>a.kind===A.kind?a.name.localeCompare(A.name):a.kind==="skills"?-1:1),k(n),n.find(a=>a.path===r)||C(((c=n[0])==null?void 0:c.path)??null))})(),()=>{e=!0}},[p,b]);const S=f(e=>e.files),P=f(e=>e.loadText),H=f(e=>e.setDraft),K=f(e=>e.saveText),O=f(e=>e.revert),W=f(e=>e.watchFile),M=f(e=>e.unwatchFile);async function q(e,i){const n=await window.api.config.readText(e.path);if(!n.exists)return;const s=ne(n.text,i);if(s===n.text)return;const o=await window.api.config.writeText(e.path,s);if(!o.ok){L.error(o.error??"failed to update skill");return}k(c=>c.map(a=>a.path===e.path?{...a,disabled:i}:a)),S[e.path]&&P(e.path)}async function z(e){if(!e.dir||!window.confirm(`Remove skill "${e.name}"?
1
+ import{au as l,aN as J,aI as Q,aP as U,aK as f,ah as t,l as R,aH as L}from"./index-4dEn1t8J.js";import{P as D}from"./Panel-C2Cb7TS4.js";import{L as X}from"./ListDetail-BK_PH4lf.js";import{M as Y}from"./MarkdownEditor-ITJDD0Mr.js";import{S as Z}from"./SaveBar-1NvfbO9r.js";import{S as I}from"./ScopeSwitcher-MBmWNzFk.js";import{T as _}from"./Toggle--nwLR-_8.js";import{P as V}from"./ProvenanceBadge-Dmhz8ZOB.js";import{l as ee}from"./listSkills-QORduPIk.js";import{S as te,V as F}from"./Library-zUu71gsR.js";import{p as se,r as ae,s as ne}from"./skillFrontmatter-Dif5JIg7.js";import"./monaco-editor-BW5C4Iv1.js";function re(d,m){return{user:{skills:`${d}/.claude/skills`,commands:`${d}/.claude/commands`},project:m?{skills:`${m}/.claude/skills`,commands:`${m}/.claude/commands`}:null}}function le(){const d=J(),m=Q(),h=(m==null?void 0:m.cwd)??null,x=U(e=>e.navFace),j=l.useRef(!1),T=l.useRef(x),[p,N]=l.useState(()=>x==="project"&&h?"project":"user"),[v,k]=l.useState([]),[r,C]=l.useState(null),[w,E]=l.useState("installed"),[$,B]=l.useState(""),b=l.useMemo(()=>d?re(d,h):null,[d,h]);l.useEffect(()=>{if(T.current!==x){if(T.current=x,j.current){j.current=!1;return}N(x==="project"&&h?"project":"user")}},[x,h]),l.useEffect(()=>{if(!b)return;let e=!1;const i=p==="user"?b.user:b.project;if(!i){k([]);return}return(async()=>{var c;const n=[],s=await ee(i.skills);for(const a of s)n.push({kind:"skills",scope:p,name:a.name,path:a.path,dir:a.dir,disabled:ae(a.text),description:se(a.text).description??void 0});const o=await window.api.config.listDir(i.commands,{filesOnly:!0});for(const a of o.entries)a.name.endsWith(".md")&&n.push({kind:"commands",scope:p,name:a.name.replace(/\.md$/,""),path:a.path,dir:null,disabled:!1});e||(n.sort((a,A)=>a.kind===A.kind?a.name.localeCompare(A.name):a.kind==="skills"?-1:1),k(n),n.find(a=>a.path===r)||C(((c=n[0])==null?void 0:c.path)??null))})(),()=>{e=!0}},[p,b]);const S=f(e=>e.files),P=f(e=>e.loadText),H=f(e=>e.setDraft),K=f(e=>e.saveText),O=f(e=>e.revert),W=f(e=>e.watchFile),M=f(e=>e.unwatchFile);async function q(e,i){const n=await window.api.config.readText(e.path);if(!n.exists)return;const s=ne(n.text,i);if(s===n.text)return;const o=await window.api.config.writeText(e.path,s);if(!o.ok){L.error(o.error??"failed to update skill");return}k(c=>c.map(a=>a.path===e.path?{...a,disabled:i}:a)),S[e.path]&&P(e.path)}async function z(e){if(!e.dir||!window.confirm(`Remove skill "${e.name}"?
2
2
 
3
3
  Its folder moves to the trash (recoverable); reinstall any time from the Library.`))return;const i=await window.api.files.delete(e.dir);if(!i.ok){L.error(i.error??"failed to remove skill");return}L.info(`Removed "${e.name}" — moved to trash`),M(e.path),k(n=>n.filter(s=>s.path!==e.path)),C(n=>{var o;return n!==e.path?n:((o=v.filter(c=>c.path!==e.path)[0])==null?void 0:o.path)??null})}l.useEffect(()=>{if(r)return S[r]||P(r),W(r),()=>M(r)},[r]);const[G,y]=l.useState(null);if(!d)return t.jsx(R,{title:"loading…"});if(w==="library")return t.jsx(D,{toolbar:t.jsx(F,{active:w,onChange:E,installedLabel:"Installed",libraryLabel:"Library"}),children:t.jsx(te,{})});if(p==="project"&&!h)return t.jsx(D,{toolbar:t.jsxs(t.Fragment,{children:[t.jsx(F,{active:w,onChange:E}),t.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),t.jsx(I,{scopes:["user","project"],active:p,onChange:e=>{j.current=!0,N(e)}})]}),children:t.jsx(R,{title:"no active project",hint:"open a tab in a project directory to view project skills & commands"})});const u=v.find(e=>e.path===r)??null,g=r?S[r]:null;return t.jsx(D,{toolbar:t.jsxs(t.Fragment,{children:[t.jsx(F,{active:w,onChange:E}),t.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),t.jsx(I,{scopes:["user","project"],active:p,onChange:e=>{j.current=!0,N(e)}}),t.jsxs("span",{className:"ml-3 text-fg-faint",children:[v.length," ",v.length===1?"item":"items"]}),t.jsx("div",{className:"flex-1"}),u&&t.jsx(V,{scope:u.scope,input:{type:u.kind==="commands"?"command":"skill",name:u.name}}),t.jsx("span",{className:"ml-2 text-fg-faint truncate",children:(u==null?void 0:u.path)??""})]}),footer:r&&g?t.jsx(Z,{dirty:g.dirty,busy:g.busy,parseError:G,lastSavedAt:g.lastSavedAt,onSave:async()=>{y(null);const e=await K(r);e.ok||y(e.error??"save failed")},onRevert:()=>{y(null),O(r)}}):null,children:t.jsx(X,{sidebar:t.jsxs("div",{className:"py-1",children:[t.jsx("div",{className:"px-2 pb-1",children:t.jsx("input",{value:$,onChange:e=>B(e.target.value),placeholder:"filter…",className:"w-full bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"})}),["skills","commands"].map(e=>{const i=$.toLowerCase(),n=v.filter(s=>s.kind===e&&(!i||s.name.toLowerCase().includes(i)));return t.jsxs("div",{className:"mb-3",children:[t.jsx("div",{className:"px-3 py-1 text-xs uppercase tracking-wider text-fg-faint",children:e==="skills"?"Skills":"Slash Commands"}),n.length===0?t.jsx("div",{className:"px-3 py-1 text-xs text-fg-faint italic",children:"none"}):n.map(s=>{var c;const o=s.kind==="skills";return t.jsxs("div",{className:`w-full px-3 py-1 text-xs flex items-center justify-between gap-2 ${r===s.path?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:[t.jsxs("button",{onClick:()=>C(s.path),className:"flex-1 min-w-0 text-left",children:[t.jsxs("div",{className:`truncate ${s.disabled?"line-through opacity-50":""}`,title:s.disabled?"Disabled — Claude will not auto-invoke this skill":void 0,children:[s.kind==="commands"?"/":"",s.name]}),s.description&&t.jsx("div",{className:"truncate text-fg-faint",children:s.description})]}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[t.jsx(V,{interactive:!1,scope:s.scope,input:{type:s.kind==="commands"?"command":"skill",name:s.name}}),((c=S[s.path])==null?void 0:c.dirty)&&t.jsx("span",{className:"w-1 h-1 rounded-full bg-accent"}),o&&t.jsx(_,{checked:!s.disabled,onChange:a=>void q(s,!a)}),s.kind==="skills"&&t.jsx("button",{onClick:a=>{a.stopPropagation(),z(s)},title:"Remove skill — moves the folder to trash; reinstall from the Library","aria-label":`Remove ${s.name}`,className:"text-fg-faint hover:text-red-400 leading-none px-0.5",children:"✕"})]})]},s.path)})]},e)})]}),detail:r&&g?t.jsx("div",{className:"h-full",children:t.jsx(Y,{path:r,value:g.draftRaw,onChange:e=>{y(null),H(r,e)}})}):t.jsx(R,{title:v.length===0?"no skills or commands":"select an item"})})})}const je=l.memo(le);export{je as Skills};
@@ -1 +1 @@
1
- import{au as l,aH as $,ah as e,aM as B,af as I,ag as V,aD as _,a0 as z,e as H,g as M,q as L,M as D,j as q,a3 as K,aN as G,C as J,aK as h,l as P}from"./index-ju-h7BFf.js";import{P as T}from"./Panel-ilEDcV0m.js";import{S as Q}from"./SaveBar-Cj0wz84u.js";import{f as W,V as A}from"./Library-51Jx0oGl.js";import"./monaco-editor-BW5C4Iv1.js";function F(t){return t.split("/").pop()||t}function X({activePath:t,selectedPath:o,onSelect:f}){const[n,i]=l.useState([]),m=l.useRef(0),r=l.useRef(f);if(r.current=f,l.useEffect(()=>{if(m.current+=1,r.current(null),!t){i([]);return}const a=m.current;let x=!1;return window.api.config.parseImports(t).then(c=>{x||m.current!==a||(c.ok?i(c.imports):(i([]),$.error(c.error||"failed to parse @-imports")))}),()=>{x=!0}},[t]),n.length===0||!t)return null;const b=o===t||o===null;return e.jsxs("div",{className:"w-64 shrink-0 border-r border-line bg-bg-elev overflow-auto","data-testid":"referenced-files-rail",children:[e.jsxs("div",{className:"px-3 py-2 text-[10px] uppercase tracking-wide text-fg-faint border-b border-line",children:["Documents · ",n.length+1]}),e.jsxs("button",{type:"button",onClick:()=>f(null),"aria-current":b,"data-testid":"referenced-file-root",className:`w-full text-left px-3 py-2 border-b border-line ${b?"bg-bg-hi text-fg":"text-fg-dim hover:bg-bg"}`,children:[e.jsx("div",{className:"text-[11.5px] font-medium truncate",children:F(t)}),e.jsx("div",{className:"text-[10px] text-fg-faint truncate",title:t,children:"this system prompt"})]}),n.map(a=>{const x=!a.ok||!a.exists,c=o===a.path;return e.jsxs("button",{type:"button",onClick:()=>f(a),"aria-current":c,"data-testid":"referenced-file-row",className:`w-full text-left px-3 py-2 border-b border-line last:border-b-0 ${c?"bg-bg-hi text-fg":"text-fg-dim hover:bg-bg"}`,children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[11.5px] font-medium truncate flex-1",children:F(a.path)}),x&&e.jsx("span",{className:"shrink-0 px-1.5 py-0.5 rounded text-[9px] uppercase tracking-wide text-amber-400/90 border border-amber-400/30","data-testid":"referenced-file-missing",children:"missing"})]}),e.jsx("div",{className:"text-[10px] text-fg-faint truncate",title:a.path,children:a.path}),e.jsxs("div",{className:"text-[10px] text-fg-faint",children:[a.sizeBytes.toLocaleString()," bytes · ~",a.tokenEstimate.toLocaleString()," tokens"]})]},a.path)})]})}function U(t){return t.split("/").filter(Boolean).pop()||t}function Y({path:t,value:o,onChange:f,onSave:n,readOnly:i,defaultMode:m,headerRight:r,hideStatusBar:b}){const a=B(),x=I(t),c=V(t),S=_(t),[E,w]=l.useState(()=>i&&c?"preview":m??z(t)),[g,C]=l.useState(!0),[p,R]=l.useState(null),N=l.useRef(null),d=l.useRef(null),v=l.useCallback(s=>{N.current=s},[]),y=l.useCallback(()=>N.current,[]),k=i?c?["preview","edit"]:[]:S?["edit","preview","split"]:c?["edit","preview"]:[],u=c?E:"edit",j=e.jsx(H,{path:t,name:U(t),value:o,onChange:f,onSave:()=>n==null?void 0:n(),onReady:v,onCursor:R,readOnly:i});return e.jsxs("div",{className:"flex flex-col h-full min-h-0","data-testid":"document-editor-pane",children:[e.jsxs("div",{className:"flex items-center gap-1 px-2 h-7 shrink-0 border-b border-line bg-bg-elev",children:[e.jsx("span",{className:"text-[11px] font-medium text-fg truncate",children:U(t)}),i&&e.jsx("span",{className:"ml-1 px-1.5 py-0.5 rounded text-[9px] uppercase tracking-wide text-fg-faint border border-line",children:"read-only"}),e.jsx("div",{className:"flex-1"}),r,x&&(u==="preview"||u==="split")&&e.jsx("button",{onClick:()=>C(s=>!s),"data-testid":"document-outline-toggle",className:`px-2 py-0.5 text-[10px] border border-line rounded ${g?"bg-bg-hi text-fg":"text-fg-faint hover:text-fg"}`,title:"Toggle document outline",children:"Outline"}),k.length>0&&e.jsx("div",{className:"flex items-center ml-1 rounded border border-line overflow-hidden","data-testid":"document-mode-toggle",children:k.map(s=>e.jsx("button",{onClick:()=>w(s),className:`px-2 py-0.5 text-[10px] capitalize transition-colors ${u===s?"bg-bg-hi text-fg":"text-fg-faint hover:text-fg"}`,children:s},s))})]}),e.jsx("div",{className:"flex-1 min-h-0",children:u==="split"&&x?e.jsxs("div",{className:"flex h-full",children:[g&&e.jsx(M,{text:o,scrollRef:d}),e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col border-r border-line",children:[!i&&e.jsx(L,{getEditor:y}),e.jsx("div",{className:"flex-1 min-h-0",children:j})]}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(D,{ref:d,text:o,flush:!0,wideMeasure:a.wideMeasure})})]}):u==="preview"&&x?e.jsxs("div",{className:"flex h-full",children:[g&&e.jsx(M,{text:o,scrollRef:d}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(D,{ref:d,text:o,wideMeasure:a.wideMeasure})})]}):x?e.jsxs("div",{className:"flex flex-col h-full",children:[!i&&e.jsx(L,{getEditor:y}),e.jsx("div",{className:"flex-1 min-h-0",children:j})]}):j}),!b&&e.jsx(q,{text:o,cursor:p,language:K(t)||void 0})]})}const O={title:"User system prompt",body:"This is the real ~/.claude/CLAUDE.md on disk — the instructions the claude CLI loads into every session it starts on this machine, in every project. A project's own CLAUDE.md / CLAUDE.local.md are read from that project's directory when a session launches there; they are not edited here."};function Z(t){return Math.round(t.length/4)}function ee(){const t=G(),[o,f]=l.useState("installed"),n=l.useMemo(()=>t?J.resolve("user",t,null):null,[t]),[i,m]=l.useState(null),r=(i==null?void 0:i.path)??n,b=!!i&&(!i.ok||!i.exists),a=h(s=>s.files),x=h(s=>s.loadText),c=h(s=>s.setDraft),S=h(s=>s.saveText),E=h(s=>s.revert),w=h(s=>s.watchFile),g=h(s=>s.unwatchFile);l.useEffect(()=>{if(n)return x(n,!0),w(n),()=>{g(n)}},[n]),l.useEffect(()=>{if(!(!r||r===n))return x(r,!0),w(r),()=>{g(r)}},[r,n]);const[C,p]=l.useState(null),R=l.useCallback(s=>{p(null),m(s)},[]);if(!t)return e.jsx(P,{title:"loading…"});if(o==="library")return e.jsx(T,{toolbar:e.jsx(A,{active:o,onChange:f,installedLabel:"Editor",libraryLabel:"Presets"}),children:e.jsx(W,{})});const N=n?a[n]:null,d=r?a[r]:null,v=(d==null?void 0:d.draftRaw)??"",y=Z(v),k=v.length,u=b,j=async()=>{if(!r)return;p(null);const s=await S(r);s.ok||p(s.error??"save failed")};return e.jsx(T,{toolbar:e.jsxs(e.Fragment,{children:[e.jsx(A,{active:o,onChange:f,installedLabel:"Editor",libraryLabel:"Presets"}),e.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),e.jsx("span",{className:"text-fg-dim",children:"User scope"}),e.jsx("span",{className:"ml-3 text-fg-faint truncate",children:r??"—"}),e.jsx("div",{className:"flex-1"}),e.jsxs("span",{className:"text-fg-faint",children:[k.toLocaleString()," chars · ~",y.toLocaleString()," tokens"]})]}),footer:r&&d&&!u?e.jsx(Q,{dirty:d.dirty,busy:d.busy,parseError:C,lastSavedAt:d.lastSavedAt,leading:d.exists?i?e.jsx("span",{children:"editing an imported file"}):null:e.jsx("span",{children:"file will be created on save"}),onSave:j,onRevert:()=>{p(null),E(r)}}):null,children:n&&N?e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{"data-testid":"system-prompt-scope-note",className:"shrink-0 border-b border-line bg-bg-elev px-3 py-2 text-[11.5px] leading-snug",children:[e.jsx("span",{className:"font-semibold text-fg",children:O.title}),e.jsx("span",{className:"mx-1.5 text-fg-faint",children:"·"}),e.jsx("span",{className:"text-fg-dim",children:O.body}),e.jsx("span",{className:"ml-1.5 font-mono text-fg-faint",children:n})]}),e.jsxs("div",{className:"flex-1 min-h-0 flex",children:[e.jsx(X,{activePath:n,selectedPath:r,onSelect:R}),e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col",children:[u&&e.jsx("div",{"data-testid":"system-prompt-missing-note",className:"shrink-0 border-b border-line bg-bg-elev px-3 py-1.5 text-[11px] text-amber-400/90",children:"This import does not resolve to a readable file — the CLI will skip it."}),r&&e.jsx("div",{className:"flex-1 min-h-0",children:e.jsx(Y,{path:r,value:v,readOnly:u,defaultMode:"split",onChange:s=>{p(null),c(r,s)},onSave:()=>{j()}},r)})]})]})]}):e.jsx(P,{title:"resolving…"})})}const ie=l.memo(ee);export{ie as SystemPrompt};
1
+ import{au as l,aH as $,ah as e,aM as B,af as I,ag as V,aD as _,a0 as z,e as H,g as M,q as L,M as D,j as q,a3 as K,aN as G,C as J,aK as h,l as P}from"./index-4dEn1t8J.js";import{P as T}from"./Panel-C2Cb7TS4.js";import{S as Q}from"./SaveBar-1NvfbO9r.js";import{f as W,V as A}from"./Library-zUu71gsR.js";import"./monaco-editor-BW5C4Iv1.js";function F(t){return t.split("/").pop()||t}function X({activePath:t,selectedPath:o,onSelect:f}){const[n,i]=l.useState([]),m=l.useRef(0),r=l.useRef(f);if(r.current=f,l.useEffect(()=>{if(m.current+=1,r.current(null),!t){i([]);return}const a=m.current;let x=!1;return window.api.config.parseImports(t).then(c=>{x||m.current!==a||(c.ok?i(c.imports):(i([]),$.error(c.error||"failed to parse @-imports")))}),()=>{x=!0}},[t]),n.length===0||!t)return null;const b=o===t||o===null;return e.jsxs("div",{className:"w-64 shrink-0 border-r border-line bg-bg-elev overflow-auto","data-testid":"referenced-files-rail",children:[e.jsxs("div",{className:"px-3 py-2 text-[10px] uppercase tracking-wide text-fg-faint border-b border-line",children:["Documents · ",n.length+1]}),e.jsxs("button",{type:"button",onClick:()=>f(null),"aria-current":b,"data-testid":"referenced-file-root",className:`w-full text-left px-3 py-2 border-b border-line ${b?"bg-bg-hi text-fg":"text-fg-dim hover:bg-bg"}`,children:[e.jsx("div",{className:"text-[11.5px] font-medium truncate",children:F(t)}),e.jsx("div",{className:"text-[10px] text-fg-faint truncate",title:t,children:"this system prompt"})]}),n.map(a=>{const x=!a.ok||!a.exists,c=o===a.path;return e.jsxs("button",{type:"button",onClick:()=>f(a),"aria-current":c,"data-testid":"referenced-file-row",className:`w-full text-left px-3 py-2 border-b border-line last:border-b-0 ${c?"bg-bg-hi text-fg":"text-fg-dim hover:bg-bg"}`,children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[11.5px] font-medium truncate flex-1",children:F(a.path)}),x&&e.jsx("span",{className:"shrink-0 px-1.5 py-0.5 rounded text-[9px] uppercase tracking-wide text-amber-400/90 border border-amber-400/30","data-testid":"referenced-file-missing",children:"missing"})]}),e.jsx("div",{className:"text-[10px] text-fg-faint truncate",title:a.path,children:a.path}),e.jsxs("div",{className:"text-[10px] text-fg-faint",children:[a.sizeBytes.toLocaleString()," bytes · ~",a.tokenEstimate.toLocaleString()," tokens"]})]},a.path)})]})}function U(t){return t.split("/").filter(Boolean).pop()||t}function Y({path:t,value:o,onChange:f,onSave:n,readOnly:i,defaultMode:m,headerRight:r,hideStatusBar:b}){const a=B(),x=I(t),c=V(t),S=_(t),[E,w]=l.useState(()=>i&&c?"preview":m??z(t)),[g,C]=l.useState(!0),[p,R]=l.useState(null),N=l.useRef(null),d=l.useRef(null),v=l.useCallback(s=>{N.current=s},[]),y=l.useCallback(()=>N.current,[]),k=i?c?["preview","edit"]:[]:S?["edit","preview","split"]:c?["edit","preview"]:[],u=c?E:"edit",j=e.jsx(H,{path:t,name:U(t),value:o,onChange:f,onSave:()=>n==null?void 0:n(),onReady:v,onCursor:R,readOnly:i});return e.jsxs("div",{className:"flex flex-col h-full min-h-0","data-testid":"document-editor-pane",children:[e.jsxs("div",{className:"flex items-center gap-1 px-2 h-7 shrink-0 border-b border-line bg-bg-elev",children:[e.jsx("span",{className:"text-[11px] font-medium text-fg truncate",children:U(t)}),i&&e.jsx("span",{className:"ml-1 px-1.5 py-0.5 rounded text-[9px] uppercase tracking-wide text-fg-faint border border-line",children:"read-only"}),e.jsx("div",{className:"flex-1"}),r,x&&(u==="preview"||u==="split")&&e.jsx("button",{onClick:()=>C(s=>!s),"data-testid":"document-outline-toggle",className:`px-2 py-0.5 text-[10px] border border-line rounded ${g?"bg-bg-hi text-fg":"text-fg-faint hover:text-fg"}`,title:"Toggle document outline",children:"Outline"}),k.length>0&&e.jsx("div",{className:"flex items-center ml-1 rounded border border-line overflow-hidden","data-testid":"document-mode-toggle",children:k.map(s=>e.jsx("button",{onClick:()=>w(s),className:`px-2 py-0.5 text-[10px] capitalize transition-colors ${u===s?"bg-bg-hi text-fg":"text-fg-faint hover:text-fg"}`,children:s},s))})]}),e.jsx("div",{className:"flex-1 min-h-0",children:u==="split"&&x?e.jsxs("div",{className:"flex h-full",children:[g&&e.jsx(M,{text:o,scrollRef:d}),e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col border-r border-line",children:[!i&&e.jsx(L,{getEditor:y}),e.jsx("div",{className:"flex-1 min-h-0",children:j})]}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(D,{ref:d,text:o,flush:!0,wideMeasure:a.wideMeasure})})]}):u==="preview"&&x?e.jsxs("div",{className:"flex h-full",children:[g&&e.jsx(M,{text:o,scrollRef:d}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(D,{ref:d,text:o,wideMeasure:a.wideMeasure})})]}):x?e.jsxs("div",{className:"flex flex-col h-full",children:[!i&&e.jsx(L,{getEditor:y}),e.jsx("div",{className:"flex-1 min-h-0",children:j})]}):j}),!b&&e.jsx(q,{text:o,cursor:p,language:K(t)||void 0})]})}const O={title:"User system prompt",body:"This is the real ~/.claude/CLAUDE.md on disk — the instructions the claude CLI loads into every session it starts on this machine, in every project. A project's own CLAUDE.md / CLAUDE.local.md are read from that project's directory when a session launches there; they are not edited here."};function Z(t){return Math.round(t.length/4)}function ee(){const t=G(),[o,f]=l.useState("installed"),n=l.useMemo(()=>t?J.resolve("user",t,null):null,[t]),[i,m]=l.useState(null),r=(i==null?void 0:i.path)??n,b=!!i&&(!i.ok||!i.exists),a=h(s=>s.files),x=h(s=>s.loadText),c=h(s=>s.setDraft),S=h(s=>s.saveText),E=h(s=>s.revert),w=h(s=>s.watchFile),g=h(s=>s.unwatchFile);l.useEffect(()=>{if(n)return x(n,!0),w(n),()=>{g(n)}},[n]),l.useEffect(()=>{if(!(!r||r===n))return x(r,!0),w(r),()=>{g(r)}},[r,n]);const[C,p]=l.useState(null),R=l.useCallback(s=>{p(null),m(s)},[]);if(!t)return e.jsx(P,{title:"loading…"});if(o==="library")return e.jsx(T,{toolbar:e.jsx(A,{active:o,onChange:f,installedLabel:"Editor",libraryLabel:"Presets"}),children:e.jsx(W,{})});const N=n?a[n]:null,d=r?a[r]:null,v=(d==null?void 0:d.draftRaw)??"",y=Z(v),k=v.length,u=b,j=async()=>{if(!r)return;p(null);const s=await S(r);s.ok||p(s.error??"save failed")};return e.jsx(T,{toolbar:e.jsxs(e.Fragment,{children:[e.jsx(A,{active:o,onChange:f,installedLabel:"Editor",libraryLabel:"Presets"}),e.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),e.jsx("span",{className:"text-fg-dim",children:"User scope"}),e.jsx("span",{className:"ml-3 text-fg-faint truncate",children:r??"—"}),e.jsx("div",{className:"flex-1"}),e.jsxs("span",{className:"text-fg-faint",children:[k.toLocaleString()," chars · ~",y.toLocaleString()," tokens"]})]}),footer:r&&d&&!u?e.jsx(Q,{dirty:d.dirty,busy:d.busy,parseError:C,lastSavedAt:d.lastSavedAt,leading:d.exists?i?e.jsx("span",{children:"editing an imported file"}):null:e.jsx("span",{children:"file will be created on save"}),onSave:j,onRevert:()=>{p(null),E(r)}}):null,children:n&&N?e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{"data-testid":"system-prompt-scope-note",className:"shrink-0 border-b border-line bg-bg-elev px-3 py-2 text-[11.5px] leading-snug",children:[e.jsx("span",{className:"font-semibold text-fg",children:O.title}),e.jsx("span",{className:"mx-1.5 text-fg-faint",children:"·"}),e.jsx("span",{className:"text-fg-dim",children:O.body}),e.jsx("span",{className:"ml-1.5 font-mono text-fg-faint",children:n})]}),e.jsxs("div",{className:"flex-1 min-h-0 flex",children:[e.jsx(X,{activePath:n,selectedPath:r,onSelect:R}),e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col",children:[u&&e.jsx("div",{"data-testid":"system-prompt-missing-note",className:"shrink-0 border-b border-line bg-bg-elev px-3 py-1.5 text-[11px] text-amber-400/90",children:"This import does not resolve to a readable file — the CLI will skip it."}),r&&e.jsx("div",{className:"flex-1 min-h-0",children:e.jsx(Y,{path:r,value:v,readOnly:u,defaultMode:"split",onChange:s=>{p(null),c(r,s)},onSave:()=>{j()}},r)})]})]})]}):e.jsx(P,{title:"resolving…"})})}const ie=l.memo(ee);export{ie as SystemPrompt};
@@ -1 +1 @@
1
- import{au as o,T as g,ah as e,l as w,aG as v,aH as u,X as y}from"./index-ju-h7BFf.js";import{P as T}from"./Panel-ilEDcV0m.js";import{L as k}from"./ListDetail-ByNJU-ie.js";import"./monaco-editor-BW5C4Iv1.js";const E=new Set(g.map(a=>a.tag));function j(a){return a.filter(n=>E.has(n))}function P(){const[a,n]=o.useState(g[0].tag),[l,x]=o.useState(null),[p,m]=o.useState(!1),r=o.useRef(!0);o.useEffect(()=>()=>{r.current=!1},[]);const c=async()=>{try{const t=await window.api.agents.listPersonas();r.current&&x(t)}catch(t){if(!r.current)return;x([]),u.error(t.message||"failed to load agent personas")}};o.useEffect(()=>{c()},[]),o.useEffect(()=>window.api.agents.onChanged(()=>c()),[]);const f=g.find(t=>t.tag===a)??null,h=async(t,i)=>{try{await window.api.agents.savePersona({name:t.name,originalName:t.name,description:t.description??"",tools:t.tools,model:t.model??"inherit",color:t.color??"",tags:j([...t.tags,i]),body:t.body}),m(!1),await c()}catch(d){u.error(d.message||"failed to assign tag")}},s=async(t,i)=>{try{await window.api.agents.savePersona({name:t.name,originalName:t.name,description:t.description??"",tools:t.tools,model:t.model??"inherit",color:t.color??"",tags:j(t.tags.filter(d=>d!==i)),body:t.body}),await c()}catch(d){u.error(d.message||"failed to remove tag")}};return e.jsx(T,{toolbar:e.jsxs("span",{className:"text-fg-faint",children:[g.length," tag",g.length===1?"":"s"]}),children:e.jsx(k,{sidebar:e.jsx("div",{className:"py-1",children:g.map(t=>{const i=v(t.tag),d=a===t.tag,b=(l==null?void 0:l.filter(N=>N.tags.includes(t.tag)).length)??0;return e.jsxs("button",{onClick:()=>{n(t.tag),m(!1)},className:`w-full text-left px-3 py-1.5 text-xs flex items-center gap-2 border-l-2 ${d?"bg-bg-hi text-fg border-accent":"text-fg-dim hover:text-fg hover:bg-bg-hi border-transparent"}`,children:[e.jsxs("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-mono font-semibold ${i.bg} ${i.text} ${i.border?"border border-current/30":""}`,children:["#",t.tag]}),e.jsx("span",{className:"truncate",children:t.label}),b>0&&e.jsx("span",{className:"ml-auto text-[10.5px] text-fg-faint font-mono shrink-0",children:b})]},t.tag)})}),detail:f?e.jsx(S,{entry:f,personas:l,adding:p,setAdding:m,onAssign:h,onUnassign:s}):e.jsx(w,{title:"select a tag"})})})}const A=o.memo(P);function S({entry:a,personas:n,adding:l,setAdding:x,onAssign:p,onUnassign:m}){const r=v(a.tag),c=y(a.tag),f=(n==null?void 0:n.filter(s=>s.tags.includes(a.tag)))??[],h=(n==null?void 0:n.filter(s=>!s.tags.includes(a.tag)))??[];return e.jsxs("div",{className:"p-4 space-y-4 max-w-3xl",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsxs("span",{className:`px-2 py-1 rounded text-xs font-mono font-semibold ${r.bg} ${r.text} ${r.border?"border border-current/30":""}`,children:["#",a.tag]}),e.jsx("span",{className:"text-sm font-semibold text-fg",children:a.label})]}),e.jsx("div",{className:"text-xs text-fg-dim leading-relaxed",children:a.description}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10.5px] uppercase tracking-wide text-fg-faint mb-1.5 font-mono",children:"/develop eagerness"}),e.jsx("span",{className:"px-1.5 py-0.5 text-[10px] rounded border border-line text-fg-dim font-mono",children:a.developEagerness})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10.5px] uppercase tracking-wide text-fg-faint mb-1.5 font-mono",children:"develops via"}),e.jsx("span",{className:"px-1.5 py-0.5 text-[10px] rounded border border-line text-fg-dim font-mono",children:a.developsVia})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10.5px] uppercase tracking-wide text-fg-faint mb-1.5 font-mono",children:"agents carrying this tag"}),n===null?e.jsx("div",{className:"text-xs text-fg-faint italic",children:"loading…"}):e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[f.map(s=>e.jsxs("span",{className:"inline-flex items-center gap-1.5 bg-bg-elev border border-line rounded px-2 py-0.5 text-[11px] font-mono text-fg-dim",children:[s.name,e.jsx("button",{onClick:()=>m(s,a.tag),title:"Remove this tag from the agent",className:"text-fg-faint hover:text-fg",children:"×"})]},s.name)),f.length===0&&!l&&e.jsx("span",{className:"text-xs text-fg-faint italic mr-1",children:"no agent carries this tag yet."}),l?h.length>0?e.jsxs("select",{autoFocus:!0,defaultValue:"",onChange:s=>{const t=n.find(i=>i.name===s.target.value);t&&p(t,a.tag)},onBlur:()=>x(!1),className:"bg-bg border border-line rounded px-2 py-0.5 text-[11px] text-fg font-mono",children:[e.jsx("option",{value:"",disabled:!0,children:"pick an agent…"}),h.map(s=>e.jsx("option",{value:s.name,children:s.name},s.name))]}):e.jsx("span",{className:"text-xs text-fg-faint italic",children:"every agent already carries this tag."}):e.jsx("button",{onClick:()=>x(!0),className:"px-2 py-0.5 rounded-full text-[11px] font-mono border border-line text-fg-faint hover:text-fg hover:bg-bg-hi",children:"+ assign agent"})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10.5px] uppercase tracking-wide text-fg-faint mb-1.5 font-mono",children:"opening framing — sent before the human's goal"}),e.jsx("pre",{className:"text-xs text-fg-dim whitespace-pre-wrap bg-bg-elev border border-line rounded p-3 leading-relaxed font-sans",children:c.initialPromptTemplate})]})]})}export{A as TagLibrary};
1
+ import{au as o,T as g,ah as e,l as w,aG as v,aH as u,X as y}from"./index-4dEn1t8J.js";import{P as T}from"./Panel-C2Cb7TS4.js";import{L as k}from"./ListDetail-BK_PH4lf.js";import"./monaco-editor-BW5C4Iv1.js";const E=new Set(g.map(a=>a.tag));function j(a){return a.filter(n=>E.has(n))}function P(){const[a,n]=o.useState(g[0].tag),[l,x]=o.useState(null),[p,m]=o.useState(!1),r=o.useRef(!0);o.useEffect(()=>()=>{r.current=!1},[]);const c=async()=>{try{const t=await window.api.agents.listPersonas();r.current&&x(t)}catch(t){if(!r.current)return;x([]),u.error(t.message||"failed to load agent personas")}};o.useEffect(()=>{c()},[]),o.useEffect(()=>window.api.agents.onChanged(()=>c()),[]);const f=g.find(t=>t.tag===a)??null,h=async(t,i)=>{try{await window.api.agents.savePersona({name:t.name,originalName:t.name,description:t.description??"",tools:t.tools,model:t.model??"inherit",color:t.color??"",tags:j([...t.tags,i]),body:t.body}),m(!1),await c()}catch(d){u.error(d.message||"failed to assign tag")}},s=async(t,i)=>{try{await window.api.agents.savePersona({name:t.name,originalName:t.name,description:t.description??"",tools:t.tools,model:t.model??"inherit",color:t.color??"",tags:j(t.tags.filter(d=>d!==i)),body:t.body}),await c()}catch(d){u.error(d.message||"failed to remove tag")}};return e.jsx(T,{toolbar:e.jsxs("span",{className:"text-fg-faint",children:[g.length," tag",g.length===1?"":"s"]}),children:e.jsx(k,{sidebar:e.jsx("div",{className:"py-1",children:g.map(t=>{const i=v(t.tag),d=a===t.tag,b=(l==null?void 0:l.filter(N=>N.tags.includes(t.tag)).length)??0;return e.jsxs("button",{onClick:()=>{n(t.tag),m(!1)},className:`w-full text-left px-3 py-1.5 text-xs flex items-center gap-2 border-l-2 ${d?"bg-bg-hi text-fg border-accent":"text-fg-dim hover:text-fg hover:bg-bg-hi border-transparent"}`,children:[e.jsxs("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-mono font-semibold ${i.bg} ${i.text} ${i.border?"border border-current/30":""}`,children:["#",t.tag]}),e.jsx("span",{className:"truncate",children:t.label}),b>0&&e.jsx("span",{className:"ml-auto text-[10.5px] text-fg-faint font-mono shrink-0",children:b})]},t.tag)})}),detail:f?e.jsx(S,{entry:f,personas:l,adding:p,setAdding:m,onAssign:h,onUnassign:s}):e.jsx(w,{title:"select a tag"})})})}const A=o.memo(P);function S({entry:a,personas:n,adding:l,setAdding:x,onAssign:p,onUnassign:m}){const r=v(a.tag),c=y(a.tag),f=(n==null?void 0:n.filter(s=>s.tags.includes(a.tag)))??[],h=(n==null?void 0:n.filter(s=>!s.tags.includes(a.tag)))??[];return e.jsxs("div",{className:"p-4 space-y-4 max-w-3xl",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsxs("span",{className:`px-2 py-1 rounded text-xs font-mono font-semibold ${r.bg} ${r.text} ${r.border?"border border-current/30":""}`,children:["#",a.tag]}),e.jsx("span",{className:"text-sm font-semibold text-fg",children:a.label})]}),e.jsx("div",{className:"text-xs text-fg-dim leading-relaxed",children:a.description}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10.5px] uppercase tracking-wide text-fg-faint mb-1.5 font-mono",children:"/develop eagerness"}),e.jsx("span",{className:"px-1.5 py-0.5 text-[10px] rounded border border-line text-fg-dim font-mono",children:a.developEagerness})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10.5px] uppercase tracking-wide text-fg-faint mb-1.5 font-mono",children:"develops via"}),e.jsx("span",{className:"px-1.5 py-0.5 text-[10px] rounded border border-line text-fg-dim font-mono",children:a.developsVia})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10.5px] uppercase tracking-wide text-fg-faint mb-1.5 font-mono",children:"agents carrying this tag"}),n===null?e.jsx("div",{className:"text-xs text-fg-faint italic",children:"loading…"}):e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[f.map(s=>e.jsxs("span",{className:"inline-flex items-center gap-1.5 bg-bg-elev border border-line rounded px-2 py-0.5 text-[11px] font-mono text-fg-dim",children:[s.name,e.jsx("button",{onClick:()=>m(s,a.tag),title:"Remove this tag from the agent",className:"text-fg-faint hover:text-fg",children:"×"})]},s.name)),f.length===0&&!l&&e.jsx("span",{className:"text-xs text-fg-faint italic mr-1",children:"no agent carries this tag yet."}),l?h.length>0?e.jsxs("select",{autoFocus:!0,defaultValue:"",onChange:s=>{const t=n.find(i=>i.name===s.target.value);t&&p(t,a.tag)},onBlur:()=>x(!1),className:"bg-bg border border-line rounded px-2 py-0.5 text-[11px] text-fg font-mono",children:[e.jsx("option",{value:"",disabled:!0,children:"pick an agent…"}),h.map(s=>e.jsx("option",{value:s.name,children:s.name},s.name))]}):e.jsx("span",{className:"text-xs text-fg-faint italic",children:"every agent already carries this tag."}):e.jsx("button",{onClick:()=>x(!0),className:"px-2 py-0.5 rounded-full text-[11px] font-mono border border-line text-fg-faint hover:text-fg hover:bg-bg-hi",children:"+ assign agent"})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10.5px] uppercase tracking-wide text-fg-faint mb-1.5 font-mono",children:"opening framing — sent before the human's goal"}),e.jsx("pre",{className:"text-xs text-fg-dim whitespace-pre-wrap bg-bg-elev border border-line rounded p-3 leading-relaxed font-sans",children:c.initialPromptTemplate})]})]})}export{A as TagLibrary};
@@ -1,4 +1,4 @@
1
- import{ax as aa,au as G,w as Pt,ah as R,x as Nf,ae as If,Z as Rf}from"./index-ju-h7BFf.js";import"./monaco-editor-BW5C4Iv1.js";var zi={exports:{}},$i={};/**
1
+ import{ax as aa,au as G,w as Pt,ah as R,x as Nf,ae as If,Z as Rf}from"./index-4dEn1t8J.js";import"./monaco-editor-BW5C4Iv1.js";var zi={exports:{}},$i={};/**
2
2
  * @license React
3
3
  * use-sync-external-store-shim.production.js
4
4
  *
@@ -1 +1 @@
1
- import{ah as r}from"./index-ju-h7BFf.js";function a({checked:t,onChange:e,label:n,disabled:s}){return r.jsxs("label",{className:`inline-flex items-center gap-2 text-xs ${s?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:[r.jsx("button",{type:"button",role:"switch","aria-checked":t,disabled:s,onClick:()=>!s&&e(!t),className:`relative w-7 h-4 rounded-full transition-colors ${t?"bg-accent":"bg-bg-hi border border-line"}`,children:r.jsx("span",{className:`absolute top-0.5 w-3 h-3 rounded-full bg-fg transition-transform ${t?"translate-x-3.5":"translate-x-0.5"}`})}),n&&r.jsx("span",{className:"text-fg-dim",children:n})]})}export{a as T};
1
+ import{ah as r}from"./index-4dEn1t8J.js";function a({checked:t,onChange:e,label:n,disabled:s}){return r.jsxs("label",{className:`inline-flex items-center gap-2 text-xs ${s?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:[r.jsx("button",{type:"button",role:"switch","aria-checked":t,disabled:s,onClick:()=>!s&&e(!t),className:`relative w-7 h-4 rounded-full transition-colors ${t?"bg-accent":"bg-bg-hi border border-line"}`,children:r.jsx("span",{className:`absolute top-0.5 w-3 h-3 rounded-full bg-fg transition-transform ${t?"translate-x-3.5":"translate-x-0.5"}`})}),n&&r.jsx("span",{className:"text-fg-dim",children:n})]})}export{a as T};