claude-code-session-manager 0.69.0 → 0.71.0

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 (35) hide show
  1. package/dist/assets/AgentLibrary-B1lh6YEM.js +3 -0
  2. package/dist/assets/{History-CiqbZNCW.js → History-B1jNdKFk.js} +2 -2
  3. package/dist/assets/{Hooks-1LHEEKhK.js → Hooks-BWHFkF7z.js} +3 -3
  4. package/dist/assets/HostBilko-CYQt0b-t.js +1 -0
  5. package/dist/assets/{Library-BXt58QDN.js → Library-DZVKlOBQ.js} +1 -1
  6. package/dist/assets/{ListDetail-V5JV-SVN.js → ListDetail-rBF1ZQv8.js} +1 -1
  7. package/dist/assets/{MarkdownEditor-BYUdiq8p.js → MarkdownEditor-zS0QmHxL.js} +1 -1
  8. package/dist/assets/{McpServers-C3b18FY5.js → McpServers-BA54nZee.js} +2 -2
  9. package/dist/assets/{Memory-MyToD3ri.js → Memory-DN97rjG5.js} +5 -5
  10. package/dist/assets/{Panel-D1z0ZvX_.js → Panel-DLn9L0Cv.js} +1 -1
  11. package/dist/assets/{Permissions-BDRMk8Uu.js → Permissions-BnDRq-EM.js} +3 -3
  12. package/dist/assets/Plugins-aPC4a4Bi.js +2 -0
  13. package/dist/assets/ProvenanceBadge-Bc1gskID.js +1 -0
  14. package/dist/assets/{SaveBar-DOJnzj3n.js → SaveBar-CjvWkRaQ.js} +1 -1
  15. package/dist/assets/{Scheduler-LdawPR1e.js → Scheduler-86oyi_P2.js} +7 -7
  16. package/dist/assets/{ScopeSwitcher-Cl3g7YOM.js → ScopeSwitcher-DJvnhSk3.js} +1 -1
  17. package/dist/assets/Settings-B7_1p_xA.js +3 -0
  18. package/dist/assets/{SkillReferenceGraph-B_KqYC6R.js → SkillReferenceGraph-CZjMRk3z.js} +1 -1
  19. package/dist/assets/{Skills-H8pCR_6D.js → Skills-EueUDa9X.js} +2 -2
  20. package/dist/assets/SystemPrompt-BQQudmyk.js +1 -0
  21. package/dist/assets/TagLibrary-BEAqaJlp.js +1 -0
  22. package/dist/assets/{TiptapBody-A93HQtTH.js → TiptapBody-DKmVDGB5.js} +1 -1
  23. package/dist/assets/{Toggle-CoFtvmoX.js → Toggle-B7Qb5e2O.js} +1 -1
  24. package/dist/assets/{index-B77KHr7n.css → index-CNmekpRK.css} +1 -1
  25. package/dist/assets/{index-C-iwyX_s.js → index-l-hKv9ou.js} +533 -533
  26. package/dist/assets/{settingsSchema-DHDH8NJR.js → settingsSchema-DEW4x9LG.js} +1 -1
  27. package/dist/index.html +2 -2
  28. package/package.json +1 -1
  29. package/dist/assets/AgentLibrary-DngWZmn2.js +0 -3
  30. package/dist/assets/HostBilko-DruBVVx_.js +0 -1
  31. package/dist/assets/Plugins-Bd1wIgVW.js +0 -2
  32. package/dist/assets/ProvenanceBadge-BIX0JW7m.js +0 -1
  33. package/dist/assets/Settings-7jHzkgfK.js +0 -3
  34. package/dist/assets/SystemPrompt-fCD2rD2R.js +0 -1
  35. package/dist/assets/TagLibrary-erEiP4bj.js +0 -1
@@ -1,3 +1,3 @@
1
- import{Y as x,K as o,S as j,a8 as P}from"./index-C-iwyX_s.js";function re({node:e,targetScope:t,onOverride:r,schema:n,rootLabel:m}){const[c,f]=x.useState(""),[d,l]=x.useState(!0),g=[],i=e.kind==="object"&&Object.keys(e.children).length===0,h=((n==null?void 0:n.rootKeys())??[]).length>0;return o.jsxs("div",{className:"h-full flex flex-col",children:[o.jsxs("div",{className:"shrink-0 border-b border-line bg-bg-elev px-3 py-1.5 flex items-center gap-2 text-xs",children:[o.jsxs("span",{className:"text-fg-faint",children:["merged · overrides → ",o.jsx("span",{className:"text-fg-dim",children:j[t].label})]}),h&&o.jsxs("label",{className:"flex items-center gap-1 text-fg-faint cursor-pointer",children:[o.jsx("input",{type:"checkbox",checked:d,onChange:s=>l(s.target.checked),className:"accent-accent"}),"show unset keys"]}),o.jsx("div",{className:"flex-1"}),o.jsx("input",{value:c,onChange:s=>f(s.target.value),placeholder:"filter keys or descriptions…",className:"bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg w-56"})]}),o.jsx("div",{className:"flex-1 overflow-auto px-3 py-2 font-mono text-xs",children:i&&!d?o.jsx("div",{className:"text-fg-faint italic px-2 py-4",children:"no settings resolved — all scope files empty or missing"}):o.jsx(O,{node:e,path:g,label:m??"(root)",targetScope:t,onOverride:r,filter:c,depth:0,schema:n,showGhosts:d,defaultOpen:!0})})]})}function O(e){return e.node.kind==="object"?o.jsx(D,{...e,node:e.node}):e.node.kind==="array"?o.jsx(R,{...e,node:e.node}):o.jsx($,{...e,node:e.node})}function L(e,t){return t.trim()?e.toLowerCase().includes(t.toLowerCase()):!0}function w(e,t,r){return!!(!r.trim()||e.some(n=>L(n,r))||t!=null&&t.description&&L(t.description,r))}function D({node:e,path:t,label:r,targetScope:n,onOverride:m,filter:c,depth:f,schema:d,showGhosts:l,defaultOpen:g}){const[i,b]=x.useState(g??f<2),h=(d==null?void 0:d.at(t))??null,s=new Set(Object.keys(e.children)),a=l?(h==null?void 0:h.knownChildren)??[]:[],u=Array.from(new Set([...s,...a])).sort(),p=x.useMemo(()=>c.trim()?u.filter(y=>{const v=(d==null?void 0:d.at([...t,y]))??null;return w([...t,y],v,c)?!0:s.has(y)?N(e.children[y],[...t,y],c,d):!1}):u,[u.join(","),c,e,t.join("."),d]);if(c.trim()&&p.length===0&&!w(t,h,c))return null;if(t.length===0)return o.jsx("div",{children:p.map(y=>k(y))});return o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-1 py-0.5 hover:bg-bg-elev/50 rounded cursor-pointer",style:{paddingLeft:f*14},onClick:()=>b(!i),children:[o.jsx("span",{className:"text-fg-faint w-3 shrink-0",children:i?"▾":"▸"}),o.jsx("span",{className:"text-fg",children:r}),o.jsxs("span",{className:"text-fg-faint",children:[" {",s.size,a.length>s.size?`/${new Set([...s,...a]).size}`:"","}"]}),(h==null?void 0:h.description)&&o.jsxs("span",{className:"text-fg-faint truncate max-w-md",title:h.description,children:["— ",h.description]})]}),i&&p.map(y=>k(y))]});function k(y){if(s.has(y))return o.jsx(O,{node:e.children[y],path:[...t,y],label:y,targetScope:n,onOverride:m,filter:c,depth:f+1,schema:d,showGhosts:l},y);const v=(d==null?void 0:d.at([...t,y]))??null;return v?o.jsx(_,{path:[...t,y],label:y,info:v,targetScope:n,onSet:m,depth:f+1,filter:c},y):null}}function N(e,t,r,n){const m=(n==null?void 0:n.at(t))??null;if(w(t,m,r))return!0;if(e.kind!=="object")return!1;for(const c of Object.keys(e.children))if(N(e.children[c],[...t,c],r,n))return!0;return!1}function R({node:e,path:t,label:r,filter:n,depth:m,schema:c}){const[f,d]=x.useState(!0),l=(c==null?void 0:c.at(t))??null;return w(t,l,n)?o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-1 py-0.5 hover:bg-bg-elev/50 rounded cursor-pointer",style:{paddingLeft:m*14},onClick:()=>d(!f),children:[o.jsx("span",{className:"text-fg-faint w-3 shrink-0",children:f?"▾":"▸"}),o.jsx("span",{className:"text-fg",children:r}),o.jsxs("span",{className:"text-fg-faint",children:[" [",e.items.length,"]"]}),o.jsx(S,{tone:"warn",children:"accumulated"}),(l==null?void 0:l.description)&&o.jsxs("span",{className:"text-fg-faint truncate max-w-md",title:l.description,children:["— ",l.description]})]}),f&&e.items.map((g,i)=>o.jsxs("div",{className:"flex items-start gap-2 py-0.5",style:{paddingLeft:(m+1)*14},children:[o.jsx("span",{className:"text-fg-faint w-3 shrink-0"}),o.jsxs("span",{className:"text-fg-faint",children:[i,":"]}),o.jsx("span",{className:"text-fg-dim truncate max-w-xl",children:E(g.value)}),o.jsx(M,{scope:g.fromScope})]},i))]}):null}function $({node:e,path:t,label:r,targetScope:n,onOverride:m,filter:c,depth:f,schema:d}){const[l,g]=x.useState(!1),i=(d==null?void 0:d.at(t))??null;if(!w(t,i,c))return null;const b=e.winner!==n,h=e.shadowed.length>0;return o.jsxs("div",{children:[o.jsxs("div",{className:"group flex items-center gap-2 py-0.5 hover:bg-bg-elev/50 rounded",style:{paddingLeft:f*14},children:[o.jsx("span",{className:`w-3 shrink-0 ${h?"text-fg-faint cursor-pointer":""}`,onClick:()=>h&&g(!l),children:h?l?"▾":"▸":""}),o.jsxs("span",{className:"text-fg",children:[r,":"]}),o.jsx("span",{className:"text-fg-dim truncate max-w-md",children:E(e.value)}),o.jsx(M,{scope:e.winner}),(i==null?void 0:i.deprecated)&&o.jsx(S,{tone:"warn",children:"deprecated"}),(i==null?void 0:i.default)!==void 0&&I(e.value,i.default)&&o.jsx(S,{tone:"dim",children:"= default"}),e.typeMismatch&&o.jsx("span",{className:"text-yellow-500/80",title:"shadowed scopes have a different value type",children:"⚠"}),(i==null?void 0:i.description)&&o.jsxs("span",{className:"text-fg-faint truncate max-w-md",title:i.description,children:["— ",i.description]}),o.jsx("div",{className:"flex-1"}),(i==null?void 0:i.enum)&&o.jsx(T,{values:i.enum}),o.jsx("button",{disabled:!b,onClick:()=>m(t,e.value),className:`opacity-0 group-hover:opacity-100 px-1.5 py-0 text-[10px] border rounded transition-opacity ${b?"border-accent/50 text-accent hover:bg-accent hover:text-bg":"border-line text-fg-faint cursor-not-allowed"}`,title:b?`copy into ${j[n].label} draft`:`already winning in ${j[n].label}`,children:"override"})]}),l&&e.shadowed.map((s,a)=>o.jsxs("div",{className:"flex items-center gap-2 py-0.5 text-fg-faint line-through",style:{paddingLeft:(f+1)*14+12},children:[o.jsx("span",{children:"shadowed:"}),o.jsx("span",{className:"truncate max-w-xl",children:E(s.value)}),o.jsx(M,{scope:s.scope,dim:!0})]},a))]})}function _({path:e,label:t,info:r,targetScope:n,onSet:m,depth:c,filter:f}){if(!w(e,r,f))return null;const d=r.default!==void 0?r.default:H(r.type),l=Array.isArray(r.type)?r.type.join("|"):r.type??"?";return o.jsxs("div",{className:"group flex items-center gap-2 py-0.5 hover:bg-bg-elev/50 rounded opacity-60",style:{paddingLeft:c*14},children:[o.jsx("span",{className:"w-3 shrink-0"}),o.jsx("span",{className:"text-fg-dim",children:t}),o.jsx(S,{tone:"dim",children:l}),r.required&&o.jsx(S,{tone:"warn",children:"required"}),r.default!==void 0&&o.jsxs("span",{className:"text-fg-faint",children:["default: ",E(r.default)]}),r.description&&o.jsxs("span",{className:"text-fg-faint truncate max-w-md",title:r.description,children:["— ",r.description]}),o.jsx("div",{className:"flex-1"}),r.enum&&o.jsx(T,{values:r.enum}),o.jsx("button",{onClick:()=>m(e,d),className:"opacity-0 group-hover:opacity-100 px-1.5 py-0 text-[10px] border border-accent/50 rounded text-accent hover:bg-accent hover:text-bg transition-opacity",title:`write to ${j[n].label} draft`,children:"set"})]})}function I(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"?JSON.stringify(e)===JSON.stringify(t):!1}function H(e){switch(Array.isArray(e)?e[0]:e){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};case"null":return null;default:return null}}function E(e){if(typeof e=="string")return JSON.stringify(e);if(e===null)return"null";if(typeof e=="object"){const t=JSON.stringify(e);return t.length>100?t.slice(0,100)+"…":t}return String(e)}function M({scope:e,dim:t}){const r=e==="user"?"bg-bg-hi text-fg-dim border-line":e==="project"?"bg-blue-950/30 text-blue-400/80 border-blue-900/40":"bg-purple-950/30 text-purple-400/80 border-purple-900/40";return o.jsx("span",{className:`text-[10px] px-1 py-0 rounded border uppercase tracking-wide shrink-0 ${r} ${t?"opacity-60":""}`,children:j[e].label})}function S({children:e,tone:t="default"}){const r={default:"bg-bg-hi text-fg-dim border-line",warn:"bg-yellow-950/30 text-yellow-500/80 border-yellow-900/40",dim:"bg-bg-elev text-fg-faint border-line"}[t];return o.jsx("span",{className:`text-[10px] px-1 py-0 rounded border uppercase tracking-wide shrink-0 ${r}`,children:e})}function T({values:e}){const t=e.map(r=>String(r)).join(" | ");return o.jsxs("span",{className:"text-[10px] text-fg-faint truncate max-w-xs",title:`allowed: ${t}`,children:["∈ ",t.length>30?t.slice(0,30)+"…":t]})}function ie(e,t,r){const n=P(l=>l.files),m=P(l=>l.loadJson),c=P(l=>l.watchFile),f=P(l=>l.unwatchFile),d=x.useMemo(()=>{const l={};for(const g of e.scopes){const i=e.resolve(g,t??"",r);i&&(l[g]=i)}return l},[e,t,r]);return x.useEffect(()=>{const l=Object.values(d).filter(Boolean);return l.forEach(g=>{n[g]||m(g),c(g)}),()=>{l.forEach(g=>f(g))}},[JSON.stringify(d)]),d}const q=[];function C(e){return Array.isArray(e)?"array":e!==null&&typeof e=="object"?"object":"scalar"}function ne(e){const t=e.filter(r=>r.data!==void 0);return t.length===0?{kind:"object",children:{}}:U(t,[])}function U(e,t){const r=q.includes(t.join(".")),n=e.every(i=>C(i.data)==="object"),m=e.every(i=>C(i.data)==="array");if(n){const i=new Set;for(const h of e)for(const s of Object.keys(h.data))i.add(s);const b={};for(const h of i){const s=e.filter(a=>h in a.data).map(a=>({scope:a.scope,data:a.data[h]}));b[h]=U(s,[...t,h])}return{kind:"object",children:b}}if(m&&!r){const i=[];for(const b of[...e].reverse())for(const h of b.data)i.push({value:h,fromScope:b.scope,index:i.length});return{kind:"array",items:i}}const c=[...e].reverse(),f=c[0],d=c.slice(1).map(i=>({scope:i.scope,value:i.data})),l=C(f.data),g=d.some(i=>C(i.value)!==l);return{kind:"leaf",value:f.data,winner:f.scope,shadowed:d,...g?{typeMismatch:!0}:{}}}function B(e,t){if(t.length===0)return e;if(e.kind!=="object")return null;const[r,...n]=t,m=e.children[r];return m?B(m,n):null}function G(e,t,r){if(t.length===0)return r;const[n,...m]=t,c=e&&typeof e=="object"&&!Array.isArray(e)?{...e}:{};return c[n]=G(c[n],m,r),c}const F=["user","project","local"];function ae(e,t){const r=[];for(const n of F){const m=t[n];if(!m)continue;const c=e[m];if(!c||!c.exists)continue;const f=c.draftRaw??"";if(f.trim())try{r.push({scope:n,data:JSON.parse(f)})}catch{}}return r}const W="http://json-schema.org/draft-07/schema#",K="https://json.schemastore.org/claude-code-settings.json",J={permissionRule:{type:"string",description:`Tool permission rule.
1
+ import{a5 as x,_ as o,S as j,ah as P}from"./index-l-hKv9ou.js";function re({node:e,targetScope:t,onOverride:r,schema:n,rootLabel:m}){const[c,f]=x.useState(""),[d,l]=x.useState(!0),g=[],i=e.kind==="object"&&Object.keys(e.children).length===0,h=((n==null?void 0:n.rootKeys())??[]).length>0;return o.jsxs("div",{className:"h-full flex flex-col",children:[o.jsxs("div",{className:"shrink-0 border-b border-line bg-bg-elev px-3 py-1.5 flex items-center gap-2 text-xs",children:[o.jsxs("span",{className:"text-fg-faint",children:["merged · overrides → ",o.jsx("span",{className:"text-fg-dim",children:j[t].label})]}),h&&o.jsxs("label",{className:"flex items-center gap-1 text-fg-faint cursor-pointer",children:[o.jsx("input",{type:"checkbox",checked:d,onChange:s=>l(s.target.checked),className:"accent-accent"}),"show unset keys"]}),o.jsx("div",{className:"flex-1"}),o.jsx("input",{value:c,onChange:s=>f(s.target.value),placeholder:"filter keys or descriptions…",className:"bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg w-56"})]}),o.jsx("div",{className:"flex-1 overflow-auto px-3 py-2 font-mono text-xs",children:i&&!d?o.jsx("div",{className:"text-fg-faint italic px-2 py-4",children:"no settings resolved — all scope files empty or missing"}):o.jsx(O,{node:e,path:g,label:m??"(root)",targetScope:t,onOverride:r,filter:c,depth:0,schema:n,showGhosts:d,defaultOpen:!0})})]})}function O(e){return e.node.kind==="object"?o.jsx(D,{...e,node:e.node}):e.node.kind==="array"?o.jsx(R,{...e,node:e.node}):o.jsx($,{...e,node:e.node})}function L(e,t){return t.trim()?e.toLowerCase().includes(t.toLowerCase()):!0}function w(e,t,r){return!!(!r.trim()||e.some(n=>L(n,r))||t!=null&&t.description&&L(t.description,r))}function D({node:e,path:t,label:r,targetScope:n,onOverride:m,filter:c,depth:f,schema:d,showGhosts:l,defaultOpen:g}){const[i,b]=x.useState(g??f<2),h=(d==null?void 0:d.at(t))??null,s=new Set(Object.keys(e.children)),a=l?(h==null?void 0:h.knownChildren)??[]:[],u=Array.from(new Set([...s,...a])).sort(),p=x.useMemo(()=>c.trim()?u.filter(y=>{const v=(d==null?void 0:d.at([...t,y]))??null;return w([...t,y],v,c)?!0:s.has(y)?N(e.children[y],[...t,y],c,d):!1}):u,[u.join(","),c,e,t.join("."),d]);if(c.trim()&&p.length===0&&!w(t,h,c))return null;if(t.length===0)return o.jsx("div",{children:p.map(y=>k(y))});return o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-1 py-0.5 hover:bg-bg-elev/50 rounded cursor-pointer",style:{paddingLeft:f*14},onClick:()=>b(!i),children:[o.jsx("span",{className:"text-fg-faint w-3 shrink-0",children:i?"▾":"▸"}),o.jsx("span",{className:"text-fg",children:r}),o.jsxs("span",{className:"text-fg-faint",children:[" {",s.size,a.length>s.size?`/${new Set([...s,...a]).size}`:"","}"]}),(h==null?void 0:h.description)&&o.jsxs("span",{className:"text-fg-faint truncate max-w-md",title:h.description,children:["— ",h.description]})]}),i&&p.map(y=>k(y))]});function k(y){if(s.has(y))return o.jsx(O,{node:e.children[y],path:[...t,y],label:y,targetScope:n,onOverride:m,filter:c,depth:f+1,schema:d,showGhosts:l},y);const v=(d==null?void 0:d.at([...t,y]))??null;return v?o.jsx(_,{path:[...t,y],label:y,info:v,targetScope:n,onSet:m,depth:f+1,filter:c},y):null}}function N(e,t,r,n){const m=(n==null?void 0:n.at(t))??null;if(w(t,m,r))return!0;if(e.kind!=="object")return!1;for(const c of Object.keys(e.children))if(N(e.children[c],[...t,c],r,n))return!0;return!1}function R({node:e,path:t,label:r,filter:n,depth:m,schema:c}){const[f,d]=x.useState(!0),l=(c==null?void 0:c.at(t))??null;return w(t,l,n)?o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-1 py-0.5 hover:bg-bg-elev/50 rounded cursor-pointer",style:{paddingLeft:m*14},onClick:()=>d(!f),children:[o.jsx("span",{className:"text-fg-faint w-3 shrink-0",children:f?"▾":"▸"}),o.jsx("span",{className:"text-fg",children:r}),o.jsxs("span",{className:"text-fg-faint",children:[" [",e.items.length,"]"]}),o.jsx(S,{tone:"warn",children:"accumulated"}),(l==null?void 0:l.description)&&o.jsxs("span",{className:"text-fg-faint truncate max-w-md",title:l.description,children:["— ",l.description]})]}),f&&e.items.map((g,i)=>o.jsxs("div",{className:"flex items-start gap-2 py-0.5",style:{paddingLeft:(m+1)*14},children:[o.jsx("span",{className:"text-fg-faint w-3 shrink-0"}),o.jsxs("span",{className:"text-fg-faint",children:[i,":"]}),o.jsx("span",{className:"text-fg-dim truncate max-w-xl",children:E(g.value)}),o.jsx(M,{scope:g.fromScope})]},i))]}):null}function $({node:e,path:t,label:r,targetScope:n,onOverride:m,filter:c,depth:f,schema:d}){const[l,g]=x.useState(!1),i=(d==null?void 0:d.at(t))??null;if(!w(t,i,c))return null;const b=e.winner!==n,h=e.shadowed.length>0;return o.jsxs("div",{children:[o.jsxs("div",{className:"group flex items-center gap-2 py-0.5 hover:bg-bg-elev/50 rounded",style:{paddingLeft:f*14},children:[o.jsx("span",{className:`w-3 shrink-0 ${h?"text-fg-faint cursor-pointer":""}`,onClick:()=>h&&g(!l),children:h?l?"▾":"▸":""}),o.jsxs("span",{className:"text-fg",children:[r,":"]}),o.jsx("span",{className:"text-fg-dim truncate max-w-md",children:E(e.value)}),o.jsx(M,{scope:e.winner}),(i==null?void 0:i.deprecated)&&o.jsx(S,{tone:"warn",children:"deprecated"}),(i==null?void 0:i.default)!==void 0&&I(e.value,i.default)&&o.jsx(S,{tone:"dim",children:"= default"}),e.typeMismatch&&o.jsx("span",{className:"text-yellow-500/80",title:"shadowed scopes have a different value type",children:"⚠"}),(i==null?void 0:i.description)&&o.jsxs("span",{className:"text-fg-faint truncate max-w-md",title:i.description,children:["— ",i.description]}),o.jsx("div",{className:"flex-1"}),(i==null?void 0:i.enum)&&o.jsx(T,{values:i.enum}),o.jsx("button",{disabled:!b,onClick:()=>m(t,e.value),className:`opacity-0 group-hover:opacity-100 px-1.5 py-0 text-[10px] border rounded transition-opacity ${b?"border-accent/50 text-accent hover:bg-accent hover:text-bg":"border-line text-fg-faint cursor-not-allowed"}`,title:b?`copy into ${j[n].label} draft`:`already winning in ${j[n].label}`,children:"override"})]}),l&&e.shadowed.map((s,a)=>o.jsxs("div",{className:"flex items-center gap-2 py-0.5 text-fg-faint line-through",style:{paddingLeft:(f+1)*14+12},children:[o.jsx("span",{children:"shadowed:"}),o.jsx("span",{className:"truncate max-w-xl",children:E(s.value)}),o.jsx(M,{scope:s.scope,dim:!0})]},a))]})}function _({path:e,label:t,info:r,targetScope:n,onSet:m,depth:c,filter:f}){if(!w(e,r,f))return null;const d=r.default!==void 0?r.default:H(r.type),l=Array.isArray(r.type)?r.type.join("|"):r.type??"?";return o.jsxs("div",{className:"group flex items-center gap-2 py-0.5 hover:bg-bg-elev/50 rounded opacity-60",style:{paddingLeft:c*14},children:[o.jsx("span",{className:"w-3 shrink-0"}),o.jsx("span",{className:"text-fg-dim",children:t}),o.jsx(S,{tone:"dim",children:l}),r.required&&o.jsx(S,{tone:"warn",children:"required"}),r.default!==void 0&&o.jsxs("span",{className:"text-fg-faint",children:["default: ",E(r.default)]}),r.description&&o.jsxs("span",{className:"text-fg-faint truncate max-w-md",title:r.description,children:["— ",r.description]}),o.jsx("div",{className:"flex-1"}),r.enum&&o.jsx(T,{values:r.enum}),o.jsx("button",{onClick:()=>m(e,d),className:"opacity-0 group-hover:opacity-100 px-1.5 py-0 text-[10px] border border-accent/50 rounded text-accent hover:bg-accent hover:text-bg transition-opacity",title:`write to ${j[n].label} draft`,children:"set"})]})}function I(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"?JSON.stringify(e)===JSON.stringify(t):!1}function H(e){switch(Array.isArray(e)?e[0]:e){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};case"null":return null;default:return null}}function E(e){if(typeof e=="string")return JSON.stringify(e);if(e===null)return"null";if(typeof e=="object"){const t=JSON.stringify(e);return t.length>100?t.slice(0,100)+"…":t}return String(e)}function M({scope:e,dim:t}){const r=e==="user"?"bg-bg-hi text-fg-dim border-line":e==="project"?"bg-blue-950/30 text-blue-400/80 border-blue-900/40":"bg-purple-950/30 text-purple-400/80 border-purple-900/40";return o.jsx("span",{className:`text-[10px] px-1 py-0 rounded border uppercase tracking-wide shrink-0 ${r} ${t?"opacity-60":""}`,children:j[e].label})}function S({children:e,tone:t="default"}){const r={default:"bg-bg-hi text-fg-dim border-line",warn:"bg-yellow-950/30 text-yellow-500/80 border-yellow-900/40",dim:"bg-bg-elev text-fg-faint border-line"}[t];return o.jsx("span",{className:`text-[10px] px-1 py-0 rounded border uppercase tracking-wide shrink-0 ${r}`,children:e})}function T({values:e}){const t=e.map(r=>String(r)).join(" | ");return o.jsxs("span",{className:"text-[10px] text-fg-faint truncate max-w-xs",title:`allowed: ${t}`,children:["∈ ",t.length>30?t.slice(0,30)+"…":t]})}function ie(e,t,r){const n=P(l=>l.files),m=P(l=>l.loadJson),c=P(l=>l.watchFile),f=P(l=>l.unwatchFile),d=x.useMemo(()=>{const l={};for(const g of e.scopes){const i=e.resolve(g,t??"",r);i&&(l[g]=i)}return l},[e,t,r]);return x.useEffect(()=>{const l=Object.values(d).filter(Boolean);return l.forEach(g=>{n[g]||m(g),c(g)}),()=>{l.forEach(g=>f(g))}},[JSON.stringify(d)]),d}const q=[];function C(e){return Array.isArray(e)?"array":e!==null&&typeof e=="object"?"object":"scalar"}function ne(e){const t=e.filter(r=>r.data!==void 0);return t.length===0?{kind:"object",children:{}}:U(t,[])}function U(e,t){const r=q.includes(t.join(".")),n=e.every(i=>C(i.data)==="object"),m=e.every(i=>C(i.data)==="array");if(n){const i=new Set;for(const h of e)for(const s of Object.keys(h.data))i.add(s);const b={};for(const h of i){const s=e.filter(a=>h in a.data).map(a=>({scope:a.scope,data:a.data[h]}));b[h]=U(s,[...t,h])}return{kind:"object",children:b}}if(m&&!r){const i=[];for(const b of[...e].reverse())for(const h of b.data)i.push({value:h,fromScope:b.scope,index:i.length});return{kind:"array",items:i}}const c=[...e].reverse(),f=c[0],d=c.slice(1).map(i=>({scope:i.scope,value:i.data})),l=C(f.data),g=d.some(i=>C(i.value)!==l);return{kind:"leaf",value:f.data,winner:f.scope,shadowed:d,...g?{typeMismatch:!0}:{}}}function B(e,t){if(t.length===0)return e;if(e.kind!=="object")return null;const[r,...n]=t,m=e.children[r];return m?B(m,n):null}function G(e,t,r){if(t.length===0)return r;const[n,...m]=t,c=e&&typeof e=="object"&&!Array.isArray(e)?{...e}:{};return c[n]=G(c[n],m,r),c}const F=["user","project","local"];function ae(e,t){const r=[];for(const n of F){const m=t[n];if(!m)continue;const c=e[m];if(!c||!c.exists)continue;const f=c.draftRaw??"";if(f.trim())try{r.push({scope:n,data:JSON.parse(f)})}catch{}}return r}const W="http://json-schema.org/draft-07/schema#",K="https://json.schemastore.org/claude-code-settings.json",J={permissionRule:{type:"string",description:`Tool permission rule.
2
2
  See https://code.claude.com/docs/en/settings#permission-rule-syntax
3
3
  See https://code.claude.com/docs/en/settings#tools-available-to-claude for full list of tools available to Claude.`,pattern:"^((Agent|Bash|Edit|ExitPlanMode|Glob|Grep|KillShell|LSP|NotebookEdit|Read|Skill|TaskCreate|TaskGet|TaskList|TaskOutput|TaskStop|TaskUpdate|TodoWrite|ToolSearch|WebFetch|WebSearch|Write)(\\((?=.*[^)*?])[^)]+\\))?|mcp__.*)$",examples:["Bash","Bash(npm run build)","Bash(git commit *)","Bash(npm run *)","Bash(ls*)","Bash(git * main)","Edit","Edit(/src/**/*.ts)","Read(./.env)","Read(./secrets/**)","Read(//Users/alice/secrets/**)","Read(~/Documents/*.pdf)","Agent(Explore)","WebFetch","WebFetch(domain:example.com)","mcp__puppeteer","mcp__github__search_repositories"]},hookCommand:{anyOf:[{type:"object",description:"Bash command hook",additionalProperties:!1,required:["type","command"],properties:{type:{type:"string",description:"Hook type",const:"command"},command:{type:"string",description:"Shell command to execute",minLength:1},timeout:{type:"number",description:"Optional timeout in seconds",exclusiveMinimum:0},async:{type:"boolean",description:"Run this hook asynchronously without blocking Claude Code"},statusMessage:{type:"string",description:"Custom spinner message displayed while the hook runs"}}},{type:"object",description:"LLM prompt hook. See https://code.claude.com/docs/en/hooks#prompt-based-hooks",additionalProperties:!1,required:["type","prompt"],properties:{type:{type:"string",description:"Hook type",const:"prompt"},prompt:{type:"string",description:"Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON.",minLength:1},model:{type:"string",description:"Model to use for evaluation. Defaults to a fast model"},timeout:{type:"number",description:"Optional timeout in seconds (default: 30)",exclusiveMinimum:0},statusMessage:{type:"string",description:"Custom spinner message displayed while the hook runs"}}},{type:"object",description:"Agent hook with multi-turn tool access for verification. See https://code.claude.com/docs/en/hooks#agent-based-hooks",additionalProperties:!1,required:["type","prompt"],properties:{type:{type:"string",description:"Hook type",const:"agent"},prompt:{type:"string",description:"Prompt describing what to verify. Use $ARGUMENTS placeholder for hook input JSON.",minLength:1},model:{type:"string",description:"Model to use for evaluation. Defaults to a fast model"},timeout:{type:"number",description:"Optional timeout in seconds (default: 60)",exclusiveMinimum:0},statusMessage:{type:"string",description:"Custom spinner message displayed while the hook runs"}}},{type:"object",description:"HTTP webhook hook. POST JSON to a URL and receive JSON response. See https://code.claude.com/docs/en/hooks#http-hooks",additionalProperties:!1,required:["type","url"],properties:{type:{type:"string",description:"Hook type",const:"http"},url:{type:"string",description:"URL to POST hook input JSON to. Endpoint must accept POST requests and return JSON.",minLength:1},headers:{type:"object",additionalProperties:{type:"string"},description:"Custom HTTP headers (e.g., Authorization: Bearer token). Values support $VAR_NAME or ${VAR_NAME} interpolation."},allowedEnvVars:{type:"array",items:{type:"string",minLength:1},description:"List of environment variable names permitted for interpolation in headers. If not set, no env var interpolation is allowed."},timeout:{type:"number",description:"Optional timeout in seconds (default: 30)",exclusiveMinimum:0},statusMessage:{type:"string",description:"Custom spinner message displayed while the hook runs"}}}]},hookMatcher:{type:"object",description:"Hook matcher configuration with multiple hooks",additionalProperties:!1,required:["hooks"],properties:{matcher:{type:"string",description:"Optional pattern to match event contexts, case-sensitive. Behavior depends on event type. See https://code.claude.com/docs/en/hooks#matcher-patterns for event-specific details and examples"},hooks:{type:"array",description:"Array of hooks to execute",items:{$ref:"#/$defs/hookCommand"}}}}},V="Configuration settings for Claude Code. Learn more: https://code.claude.com/docs/en/settings",z=!0,Y=!0,Z="object",X=JSON.parse(`{"$schema":{"type":"string","description":"JSON Schema reference for Claude Code settings"},"apiKeyHelper":{"type":"string","description":"Path to a script that outputs authentication values","examples":["/bin/generate_temp_api_key.sh"],"minLength":1},"autoMemoryEnabled":{"type":"boolean","description":"Enable automatic memory saves that capture useful context to .claude/memory/. Also configurable via CLAUDE_CODE_DISABLE_AUTO_MEMORY environment variable (set to 1 to disable, 0 to enable). See https://code.claude.com/docs/en/memory#auto-memory","default":true},"autoUpdatesChannel":{"type":"string","enum":["stable","latest"],"description":"Release channel to follow for updates. Use \\"stable\\" for a version that is typically about one week old and skips versions with major regressions, or \\"latest\\" (default) for the most recent release. Set DISABLE_AUTOUPDATER=1 to disable updates entirely.","default":"latest"},"awsCredentialExport":{"type":"string","description":"Path to a script that exports AWS credentials","examples":["/bin/generate_aws_grant.sh"],"minLength":1},"awsAuthRefresh":{"type":"string","description":"Path to a script that refreshes AWS authentication","examples":["aws sso login --profile myprofile"],"minLength":1},"claudeMdExcludes":{"type":"array","items":{"type":"string","minLength":1},"description":"Glob patterns for CLAUDE.md files to exclude from loading. Useful in monorepos to skip irrelevant instructions from other teams. Patterns match against absolute file paths. Arrays merge across settings layers. Managed policy CLAUDE.md files cannot be excluded. See https://code.claude.com/docs/en/memory#exclude-specific-claudemd-files","examples":[["**/monorepo/CLAUDE.md","/home/user/monorepo/other-team/.claude/rules/**"]]},"cleanupPeriodDays":{"type":"integer","minimum":0,"description":"Number of days to retain chat transcripts (0 to disable cleanup)","examples":[20,30,60],"default":30},"env":{"type":"object","additionalProperties":false,"description":"Environment variables to set for Claude Code sessions. Many environment variables provide settings dimensions not available as dedicated settings.json properties (e.g., thinking tokens, prompt caching, bash timeouts, shell configuration). See https://code.claude.com/docs/en/settings#environment-variables for the full list.\\nUNDOCUMENTED: CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS (plugin marketplace git timeout in ms, default 120000, see https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md#2151).\\nUNDOCUMENTED: ENABLE_CLAUDEAI_MCP_SERVERS (set to false to opt out of claude.ai MCP servers, see https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md#2163).","examples":[{"ANTHROPIC_MODEL":"claude-opus-4-1","ANTHROPIC_SMALL_FAST_MODEL":"claude-3-5-haiku-latest"}],"default":{},"patternProperties":{"^[A-Z_][A-Z0-9_]*$":{"type":"string","description":"Environment variable value"}}},"attribution":{"type":"object","description":"Customize attribution for git commits and pull requests. See https://code.claude.com/docs/en/settings#attribution-settings","additionalProperties":false,"properties":{"commit":{"type":"string","description":"Attribution for git commits, including any trailers. Empty string hides commit attribution"},"pr":{"type":"string","description":"Attribution for pull request descriptions. Empty string hides pull request attribution"}}},"includeGitInstructions":{"type":"boolean","description":"Include built-in git commit and PR workflow instructions in Claude's system prompt. Also configurable via CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS environment variable (set to 1 to disable). See https://code.claude.com/docs/en/settings#available-settings","default":true},"includeCoAuthoredBy":{"type":"boolean","description":"DEPRECATED. Use 'attribution' instead. Whether to include the co-authored-by Claude byline in git commits and pull requests (default: true)","default":true},"plansDirectory":{"type":"string","description":"Customize where plan files are stored. Path is relative to project root (default: ~/.claude/plans)","default":"~/.claude/plans","examples":["./plans"]},"respectGitignore":{"type":"boolean","description":"Control whether the @ file picker respects .gitignore patterns. When true (default), files matching .gitignore patterns are excluded from suggestions","default":true},"permissions":{"type":"object","properties":{"allow":{"type":"array","items":{"$ref":"#/$defs/permissionRule"},"description":"List of permission rules for allowed operations","uniqueItems":true},"deny":{"type":"array","items":{"$ref":"#/$defs/permissionRule"},"description":"List of permission rules for denied operations","uniqueItems":true},"ask":{"type":"array","items":{"$ref":"#/$defs/permissionRule"},"description":"List of permission rules that should always prompt for confirmation","uniqueItems":true},"defaultMode":{"type":"string","enum":["acceptEdits","bypassPermissions","default","delegate","dontAsk","plan"],"description":"Default permission mode.\\n\\"default\\": prompts on first use.\\n\\"acceptEdits\\": auto-accepts file edits.\\n\\"plan\\": read-only, no modifications.\\nUNDOCUMENTED. \\"delegate\\": coordination-only for agent team leads (agent teams are experimental; enable via CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS).\\n\\"dontAsk\\": auto-denies unless pre-approved via permissions.\\n\\"bypassPermissions\\": skips all prompts (use only in isolated environments).\\nSee https://code.claude.com/docs/en/permissions"},"disableBypassPermissionsMode":{"type":"string","enum":["disable"],"description":"Disable the ability to bypass permission prompts"},"additionalDirectories":{"type":"array","items":{"type":"string","minLength":1},"description":"Additional directories to include in the permission scope","examples":[["//Users/alice/Documents","~/projects"]],"uniqueItems":true}},"additionalProperties":false,"description":"Tool usage permissions configuration.\\nSee https://code.claude.com/docs/en/permissions and https://code.claude.com/docs/en/settings#permission-settings\\nSee https://code.claude.com/docs/en/settings#tools-available-to-claude for full list of tools available to Claude.","examples":[{"allow":["Bash(git add:*)"],"ask":["Bash(gh pr create:*)","Bash(git commit:*)"],"deny":["Read(*.env)","Bash(rm:*)","Bash(curl:*)"],"defaultMode":"default"}]},"language":{"type":"string","description":"Preferred language for Claude's responses","examples":["japanese","spanish","french"]},"model":{"type":"string","enum":["opus","sonnet","haiku","default"],"description":"Override the default model used by Claude Code. Accepts a short alias (opus|sonnet|haiku) or a full model ID. For finer control, use environment variables: ANTHROPIC_MODEL (runtime override), ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL (per-class pinning), CLAUDE_CODE_SUBAGENT_MODEL (subagent model). See https://code.claude.com/docs/en/model-config"},"availableModels":{"type":"array","items":{"type":"string"},"description":"Restrict which models users can select. When defined at multiple settings levels (user, project, etc.), arrays are merged and deduplicated. See https://code.claude.com/docs/en/model-config#restrict-model-selection","examples":[["sonnet","haiku"]]},"modelOverrides":{"type":"object","additionalProperties":{"type":"string"},"description":"Map Anthropic model IDs to provider-specific model IDs such as Bedrock inference profile ARNs, Vertex AI version names, or Foundry deployment names. Each model picker entry uses its mapped value when calling the provider API. Unknown keys are ignored. See https://code.claude.com/docs/en/model-config#override-model-ids-per-version","examples":[{"claude-opus-4-6":"arn:aws:bedrock:us-east-2:123456789012:application-inference-profile/opus-prod"}]},"effortLevel":{"type":"string","enum":["low","medium","high"],"description":"Control Opus 4.6 adaptive reasoning effort. Lower effort is faster and cheaper for straightforward tasks, higher effort provides deeper reasoning. Defaults vary by model and plan (Opus 4.6 defaults to medium for Max and Team subscribers). Use /effort auto to reset to model default. Also configurable via CLAUDE_CODE_EFFORT_LEVEL environment variable. See https://code.claude.com/docs/en/model-config#adjust-effort-level"},"fastMode":{"type":"boolean","description":"Enable fast mode for Opus 4.6 (research preview). Fast mode uses the same model with 2.5x faster output at higher per-token cost. Requires extra usage enabled. Alternatively, toggle with /fast command. See https://code.claude.com/docs/en/fast-mode","default":false},"fastModePerSessionOptIn":{"type":"boolean","description":"Require per-session opt-in for fast mode. When true, fast mode does not persist across sessions and users must enable it with /fast each session. Useful for controlling costs. See https://code.claude.com/docs/en/fast-mode","default":false},"feedbackSurveyRate":{"type":"number","minimum":0,"maximum":1,"description":"Probability (0–1) that the session quality survey appears when eligible. A value of 0.05 means 5% of eligible sessions. See https://code.claude.com/docs/en/settings","examples":[0.05]},"editorMode":{"type":"string","enum":["normal","vim"],"default":"normal","description":"Editor input mode for the Claude Code terminal prompt. 'vim' enables modal editing (Esc for normal mode, i for insert). See https://code.claude.com/docs/en/settings"},"skillOverrides":{"type":"object","additionalProperties":{"type":"string","enum":["on","name-only","user-invocable-only","off"]},"description":"Per-skill availability override map. Keys are skill names; values are one of 'on' (default), 'name-only' (skill name listed but not auto-loaded), 'user-invocable-only' (load only when user explicitly invokes), or 'off' (hidden). Requires Claude Code v2.1.129+. See https://code.claude.com/docs/en/settings","examples":[{"playwright-debug":"user-invocable-only","init":"off"}]},"disableAgentView":{"type":"boolean","default":false,"description":"Disable the Agent View feature (read-only inspection of sub-agent activity). Useful when administering managed deployments. Requires Claude Code v2.1.139+. See https://code.claude.com/docs/en/settings"},"disableRemoteControl":{"type":"boolean","default":false,"description":"Block the \`claude remote-control\` channel that allows external clients to drive this Claude Code instance. Recommended default for shared/CI environments. Requires Claude Code v2.1.128+. See https://code.claude.com/docs/en/settings"},"enableAllProjectMcpServers":{"type":"boolean","description":"Whether to automatically approve all MCP servers in the project. See https://code.claude.com/docs/en/mcp","examples":[true]},"enabledMcpjsonServers":{"type":"array","items":{"type":"string","minLength":1},"description":"List of approved MCP servers from .mcp.json. See https://code.claude.com/docs/en/mcp","examples":[["memory","github"]]},"disabledMcpjsonServers":{"type":"array","items":{"type":"string","minLength":1},"description":"List of rejected MCP servers from .mcp.json. See https://code.claude.com/docs/en/mcp","examples":[["filesystem"]]},"allowedMcpServers":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"serverName":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$","description":"Name of the MCP server that users are allowed to configure"}},"required":["serverName"],"additionalProperties":false},{"type":"object","properties":{"serverCommand":{"type":"array","items":{"type":"string"},"description":"Exact command and arguments used to start stdio servers"}},"required":["serverCommand"],"additionalProperties":false},{"type":"object","properties":{"serverUrl":{"type":"string","description":"URL pattern for remote servers, supports wildcards (e.g., https://*.example.com/*)"}},"required":["serverUrl"],"additionalProperties":false}]},"description":"Enterprise allowlist of MCP servers that can be used. Applies to all scopes including enterprise servers from managed-mcp.json. If undefined, all servers are allowed. If empty array, no servers are allowed. Denylist takes precedence - if a server is on both lists, it is denied. See https://code.claude.com/docs/en/mcp#restriction-options"},"deniedMcpServers":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"serverName":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$","description":"Name of the MCP server that is explicitly blocked"}},"required":["serverName"],"additionalProperties":false},{"type":"object","properties":{"serverCommand":{"type":"array","items":{"type":"string"},"description":"Exact command and arguments used to start stdio servers"}},"required":["serverCommand"],"additionalProperties":false},{"type":"object","properties":{"serverUrl":{"type":"string","description":"URL pattern for remote servers, supports wildcards (e.g., https://*.example.com/*)"}},"required":["serverUrl"],"additionalProperties":false}]},"description":"Enterprise denylist of MCP servers that are explicitly blocked. If a server is on the denylist, it will be blocked across all scopes including enterprise. Denylist takes precedence over allowlist - if a server is on both lists, it is denied. See https://code.claude.com/docs/en/mcp#restriction-options"},"httpHookAllowedEnvVars":{"type":"array","items":{"type":"string","minLength":1},"description":"Allowlist of environment variable names HTTP hooks may interpolate into headers. When set, each hook's effective allowedEnvVars is the intersection with this list. Undefined = no restriction. Arrays merge across settings sources. See https://code.claude.com/docs/en/settings#hook-configuration","examples":[["MY_TOKEN","HOOK_SECRET"]]},"hooks":{"type":"object","additionalProperties":false,"description":"Custom commands to run before/after tool executions. See https://code.claude.com/docs/en/hooks","examples":[{"PostToolUse":[{"matcher":"Edit|Write","hooks":[{"type":"command","command":"prettier --write","timeout":5}]}]}],"properties":{"PreToolUse":{"type":"array","description":"Hooks that run before tool calls","items":{"$ref":"#/$defs/hookMatcher"}},"PostToolUse":{"type":"array","description":"Hooks that run after tool completion","items":{"$ref":"#/$defs/hookMatcher"}},"PostToolUseFailure":{"type":"array","description":"Hooks that run after a tool fails","items":{"$ref":"#/$defs/hookMatcher"}},"PermissionRequest":{"type":"array","description":"Hooks that run when a permission dialog appears","items":{"$ref":"#/$defs/hookMatcher"}},"Notification":{"type":"array","description":"Hooks that trigger on notifications","items":{"$ref":"#/$defs/hookMatcher"}},"UserPromptSubmit":{"type":"array","description":"Hooks that run when a user submits a prompt","items":{"$ref":"#/$defs/hookMatcher"}},"Stop":{"type":"array","description":"Hooks that run when agents finish responding. Does not run on user interrupt","items":{"$ref":"#/$defs/hookMatcher"}},"SubagentStart":{"type":"array","description":"Hooks that run when a subagent is spawned","items":{"$ref":"#/$defs/hookMatcher"}},"SubagentStop":{"type":"array","description":"Hooks that run when subagents finish responding","items":{"$ref":"#/$defs/hookMatcher"}},"PreCompact":{"type":"array","description":"Hooks that run before the context is compacted","items":{"$ref":"#/$defs/hookMatcher"}},"PostCompact":{"type":"array","description":"Hooks that run after the context is compacted. See https://code.claude.com/docs/en/hooks","items":{"$ref":"#/$defs/hookMatcher"}},"Elicitation":{"type":"array","description":"Hooks that run when an MCP server requests user input during a tool call. See https://code.claude.com/docs/en/hooks","items":{"$ref":"#/$defs/hookMatcher"}},"ElicitationResult":{"type":"array","description":"Hooks that run after a user responds to an MCP elicitation, before the response is sent back to the server. See https://code.claude.com/docs/en/hooks","items":{"$ref":"#/$defs/hookMatcher"}},"TeammateIdle":{"type":"array","description":"Hooks that run when an agent team teammate is about to go idle. Exit code 2 sends feedback and keeps the teammate working. Does not support matchers. Agent teams are experimental. See https://code.claude.com/docs/en/hooks#teammateidle","items":{"$ref":"#/$defs/hookMatcher"}},"TaskCompleted":{"type":"array","description":"Hooks that run when a task is being marked as completed. Exit code 2 prevents completion and sends feedback. Does not support matchers. See https://code.claude.com/docs/en/hooks#taskcompleted","items":{"$ref":"#/$defs/hookMatcher"}},"Setup":{"type":"array","description":"UNDOCUMENTED. Hooks that run during repository initialization (--init, --init-only) or maintenance (--maintenance)","items":{"$ref":"#/$defs/hookMatcher"}},"InstructionsLoaded":{"type":"array","description":"Hooks that run when a CLAUDE.md or .claude/rules/*.md file is loaded into context. Fires at session start and when files are lazily loaded (e.g., nested traversal, path glob match). No decision control; used for audit logging and observability. Does not support matchers. See https://code.claude.com/docs/en/hooks#instructionsloaded","items":{"$ref":"#/$defs/hookMatcher"}},"ConfigChange":{"type":"array","description":"Hooks that run when settings, managed settings, or skill files change during a session. Supports matchers: user_settings, project_settings, local_settings, policy_settings, skills. Command handlers only. Exit code 2 blocks the change (except policy_settings which is audit-only). See https://code.claude.com/docs/en/hooks#configchange","items":{"$ref":"#/$defs/hookMatcher"}},"WorktreeCreate":{"type":"array","description":"Hooks that run when a worktree is created via --worktree or isolation: \\"worktree\\" in subagents. Command handlers only, no matchers. Hook must print absolute path to created worktree on stdout; non-zero exit fails creation. See https://code.claude.com/docs/en/hooks#worktreecreate","items":{"$ref":"#/$defs/hookMatcher"}},"WorktreeRemove":{"type":"array","description":"Hooks that run when a worktree is being removed at session exit or when a subagent finishes. Command handlers only, no matchers. Used for cleanup tasks; cannot block removal. See https://code.claude.com/docs/en/hooks#worktreeremove","items":{"$ref":"#/$defs/hookMatcher"}},"SessionStart":{"type":"array","description":"Hooks that run when a new session starts","items":{"$ref":"#/$defs/hookMatcher"}},"SessionEnd":{"type":"array","description":"Hooks that run when a session ends","items":{"$ref":"#/$defs/hookMatcher"}}}},"disableAllHooks":{"type":"boolean","description":"Disable all hooks and statusLine execution. When true in managed settings, user and project-level disableAllHooks cannot override it. See https://code.claude.com/docs/en/hooks#disable-or-remove-hooks"},"allowedHttpHookUrls":{"type":"array","items":{"type":"string","minLength":1},"description":"Allowlist of URL patterns that HTTP hooks may target. Supports * as a wildcard. When set, hooks with non-matching URLs are blocked. Undefined = no restriction, empty array = block all HTTP hooks. Arrays merge across settings sources. See https://code.claude.com/docs/en/settings#hook-configuration","examples":[["https://hooks.example.com/*","http://localhost:*"]]},"allowManagedHooksOnly":{"type":"boolean","description":"(Managed settings only) Prevent loading of user, project, and plugin hooks. Only allows managed hooks and SDK hooks. See https://code.claude.com/docs/en/settings#hook-configuration"},"allowManagedPermissionRulesOnly":{"type":"boolean","description":"(Managed settings only) Prevent user and project settings from defining allow, ask, or deny permission rules. Only rules in managed settings apply. See https://code.claude.com/docs/en/settings#permission-settings"},"statusLine":{"type":"object","properties":{"type":{"type":"string","description":"The type of status line handler; must be set to \\"command\\" to run a custom shell script that receives JSON session data via stdin.","const":"command"},"command":{"type":"string","description":"A shell command or path to a script that displays session information (context usage, costs, git status, etc.) by reading JSON data from stdin and writing output to stdout. See https://code.claude.com/docs/en/statusline"},"padding":{"type":"number","description":"Optional number of extra horizontal spacing characters added to the status line content; defaults to 0."}},"required":["type","command"],"additionalProperties":false,"description":"Custom status line display configuration. See https://code.claude.com/docs/en/statusline","examples":[{"type":"command","command":"~/.claude/statusline.sh"}]},"fileSuggestion":{"type":"object","properties":{"type":{"type":"string","description":"The type of file suggestion handler; must be set to \\"command\\" to execute a custom shell script that generates file suggestions for the @ file picker.","const":"command"},"command":{"type":"string","description":"Shell command to execute for file suggestions"}},"required":["type","command"],"additionalProperties":false,"description":"Configure a custom script for @ file autocomplete. See https://code.claude.com/docs/en/settings#file-suggestion-settings","examples":[{"type":"command","command":"~/.claude/file-suggestion.sh"}]},"enabledPlugins":{"type":"object","additionalProperties":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"boolean"},{"not":{}}]},"description":"Enabled plugins using plugin-id@marketplace-id format. Example: { \\"formatter@anthropic-tools\\": true }. See https://code.claude.com/docs/en/plugins"},"extraKnownMarketplaces":{"type":"object","additionalProperties":{"type":"object","properties":{"source":{"anyOf":[{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"url"},"url":{"type":"string","format":"uri","description":"Direct URL to marketplace.json file"}},"required":["source","url"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"hostPattern"},"hostPattern":{"type":"string","description":"Git host pattern to trust for repositories in source specifications"}},"required":["source","hostPattern"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"github"},"repo":{"type":"string","description":"GitHub repository in owner/repo format"},"ref":{"type":"string","description":"Git branch or tag to use (e.g., \\"main\\", \\"v1.0.0\\"). Defaults to repository default branch."},"path":{"type":"string","description":"Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"}},"required":["source","repo"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"git"},"url":{"type":"string","pattern":"\\\\.git$","description":"Full git repository URL"},"ref":{"type":"string","description":"Git branch or tag to use (e.g., \\"main\\", \\"v1.0.0\\"). Defaults to repository default branch."},"path":{"type":"string","description":"Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"}},"required":["source","url"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"npm"},"package":{"type":"string","description":"NPM package containing marketplace.json"}},"required":["source","package"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"file"},"path":{"type":"string","description":"Local file path to marketplace.json"}},"required":["source","path"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"directory"},"path":{"type":"string","description":"Local directory containing .claude-plugin/marketplace.json"}},"required":["source","path"],"additionalProperties":false}],"description":"Where to fetch the marketplace from"},"installLocation":{"type":"string","description":"Local cache path where marketplace manifest is stored (auto-generated if not provided)"}},"required":["source"],"additionalProperties":false},"description":"Additional marketplaces to make available for this repository. Typically used in repository .claude/settings.json to ensure team members have required plugin sources. See https://code.claude.com/docs/en/plugin-marketplaces"},"strictKnownMarketplaces":{"type":"array","description":"(Managed settings only) Allowlist of plugin marketplaces users can add. Undefined = no restrictions, empty array = lockdown. Uses exact matching for source specifications. See https://code.claude.com/docs/en/settings#strictknownmarketplaces","items":{"anyOf":[{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"hostPattern"},"hostPattern":{"type":"string","description":"Git host pattern to trust for repositories in source specifications"}},"required":["source","hostPattern"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"github"},"repo":{"type":"string","description":"GitHub repository in owner/repo format"},"ref":{"type":"string","description":"Git branch, tag, or SHA"},"path":{"type":"string","description":"Subdirectory path"}},"required":["source","repo"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"git"},"url":{"type":"string","description":"Full git repository URL"},"ref":{"type":"string","description":"Git branch, tag, or SHA"},"path":{"type":"string","description":"Subdirectory path"}},"required":["source","url"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"url"},"url":{"type":"string","format":"uri","description":"Direct URL to marketplace.json"},"headers":{"type":"object","additionalProperties":{"type":"string"},"description":"HTTP headers for authenticated access"}},"required":["source","url"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"npm"},"package":{"type":"string","description":"NPM package name (supports scoped packages)"}},"required":["source","package"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"file"},"path":{"type":"string","description":"Absolute path to marketplace.json file"}},"required":["source","path"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"directory"},"path":{"type":"string","description":"Absolute path to directory containing .claude-plugin/marketplace.json"}},"required":["source","path"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"pathPattern"},"pathPattern":{"type":"string","description":"Regex pattern to match file or directory paths for marketplace sources"}},"required":["source","pathPattern"],"additionalProperties":false}]},"examples":[[{"source":"github","repo":"acme-corp/approved-plugins"},{"source":"npm","package":"@acme-corp/compliance-plugins"}]]},"skippedMarketplaces":{"type":"array","items":{"type":"string","minLength":1},"description":"List of marketplace names the user has chosen not to install when prompted"},"skippedPlugins":{"type":"array","items":{"type":"string","minLength":1},"description":"List of plugin IDs (plugin@marketplace format) the user has chosen not to install when prompted"},"forceLoginMethod":{"type":"string","enum":["claudeai","console"],"description":"Force a specific login method: \\"claudeai\\" for Claude Pro/Max, \\"console\\" for Console billing","examples":["claudeai"]},"forceLoginOrgUUID":{"type":"string","description":"Organization UUID to use for OAuth login","examples":["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"],"minLength":1},"otelHeadersHelper":{"type":"string","description":"Path to a script that outputs OpenTelemetry headers","minLength":1},"outputStyle":{"type":"string","description":"Controls the output style for assistant responses. Built-in styles: default, Explanatory, Learning. Custom styles can be added in ~/.claude/output-styles/ or .claude/output-styles/. See https://code.claude.com/docs/en/output-styles","examples":["default","Explanatory","Learning"],"minLength":1},"skipWebFetchPreflight":{"type":"boolean","description":"Skip the WebFetch blocklist check for enterprise environments with restrictive security policies"},"sandbox":{"type":"object","description":"Sandbox execution configuration. See https://code.claude.com/docs/en/sandboxing","properties":{"network":{"type":"object","description":"Configures network isolation settings for the sandboxed bash environment, including domain restrictions, Unix socket access, and custom proxy configuration.","properties":{"allowUnixSockets":{"type":"array","items":{"type":"string"},"description":"Allow Unix domain sockets for local IPC (SSH agent, Docker, etc.). Provide an array of specific paths. Defaults to blocking if not specified"},"allowLocalBinding":{"type":"boolean","description":"Allow binding to local network addresses (e.g., localhost ports). Defaults to false if not specified"},"httpProxyPort":{"type":"integer","minimum":1,"maximum":65535,"description":"HTTP proxy port to use for network filtering. If not specified, a proxy server will be started automatically"},"socksProxyPort":{"type":"integer","minimum":1,"maximum":65535,"description":"SOCKS proxy port to use for network filtering. If not specified, a proxy server will be started automatically"},"allowAllUnixSockets":{"type":"boolean","description":"Allow all Unix domain socket connections. If true, this overrides allowUnixSockets"},"allowedDomains":{"type":"array","items":{"type":"string","minLength":1},"description":"Allowlist of network domains for sandboxed commands. Supports wildcard patterns like *.example.com"},"allowManagedDomainsOnly":{"type":"boolean","description":"(Managed settings only) Only allowedDomains and WebFetch(domain:...) allow rules from managed settings are respected. User, project, local, and flag settings domains are ignored. Denied domains are still respected from all sources. Non-allowed domains are automatically blocked without user prompts."}},"additionalProperties":false},"ignoreViolations":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"},"description":"List of filesystem paths to ignore sandbox violations for when this command pattern matches"},"description":"Map of command patterns to filesystem paths to ignore violations for. Use \\"*\\" to match all commands"},"excludedCommands":{"type":"array","items":{"type":"string"},"description":"Commands that should never run in the sandbox (e.g., [\\"git\\", \\"docker\\"])"},"autoAllowBashIfSandboxed":{"type":"boolean","description":"Automatically allow bash commands without prompting when they run in the sandbox. Only applies to commands that will run sandboxed.","default":true},"enableWeakerNetworkIsolation":{"type":"boolean","description":"macOS only. Allow access to the system TLS trust service (com.apple.trustd.agent) in the sandbox. Required for Go-based tools like gh, gcloud, and terraform to verify TLS certificates when using httpProxyPort with a MITM proxy and custom CA. Reduces security by opening a potential data exfiltration path. Default: false. See https://code.claude.com/docs/en/settings#sandbox-settings","default":false},"enableWeakerNestedSandbox":{"type":"boolean","description":"Enable weaker sandbox mode for unprivileged docker environments where --proc mounting fails. This significantly reduces the strength of the sandbox and should only be used when this risk is acceptable.Default: false (secure)."},"allowUnsandboxedCommands":{"type":"boolean","description":"Allow commands to run outside the sandbox via the dangerouslyDisableSandbox parameter. When false, the dangerouslyDisableSandbox parameter is completely ignored and all commands must run sandboxed. Default: true."},"enabled":{"type":"boolean","description":"Enable sandboxed bash"},"filesystem":{"type":"object","description":"Filesystem access control for sandboxed commands. See https://code.claude.com/docs/en/sandboxing#filesystem-isolation","properties":{"allowWrite":{"type":"array","items":{"type":"string","minLength":1},"description":"Paths where subprocesses are allowed to write. Supports prefixes: // (absolute), ~/ (home directory), / (relative to settings file), ./ or no prefix (relative path)"},"denyWrite":{"type":"array","items":{"type":"string","minLength":1},"description":"Paths where subprocesses are explicitly denied write access. Takes precedence over allowWrite"},"denyRead":{"type":"array","items":{"type":"string","minLength":1},"description":"Paths where subprocesses are explicitly denied read access"},"allowRead":{"type":"array","items":{"type":"string","minLength":1},"description":"Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths"},"allowManagedReadPathsOnly":{"type":"boolean","description":"When true (managed settings only), only allowRead paths from managed settings are used"}},"additionalProperties":false}},"additionalProperties":false},"spinnerVerbs":{"type":"object","description":"Customize the verbs shown in spinner progress messages","properties":{"mode":{"type":"string","enum":["append","replace"],"description":"How to combine custom verbs with default spinner verbs: 'append' adds custom verbs to the default list, 'replace' uses only custom verbs"},"verbs":{"type":"array","items":{"type":"string","minLength":1},"minItems":1,"description":"Custom verbs used in spinner progress text"}},"required":["verbs"],"additionalProperties":false},"spinnerTipsEnabled":{"type":"boolean","description":"Show tips in the spinner while Claude is working. Set to false to disable tips (default: true)","default":true},"spinnerTipsOverride":{"type":"object","description":"Customize the tips displayed in the spinner while Claude is working. See https://code.claude.com/docs/en/settings#available-settings","properties":{"excludeDefault":{"type":"boolean","description":"If true, only show custom tips. If false or absent, custom tips merge with built-in tips","default":false},"tips":{"type":"array","items":{"type":"string","minLength":1},"description":"Custom tip strings to display in the spinner","minItems":1}},"required":["tips"],"additionalProperties":false},"terminalProgressBarEnabled":{"type":"boolean","description":"Enable the terminal progress bar that shows progress in supported terminals like Windows Terminal and iTerm2 (default: true)","default":true},"showTurnDuration":{"type":"boolean","description":"Show turn duration messages after responses (e.g., \\"Cooked for 1m 6s\\"). Set to false to hide these messages (default: true)","default":true},"prefersReducedMotion":{"type":"boolean","description":"Reduce or disable UI animations (spinners, shimmer, flash effects) for accessibility","default":false},"alwaysThinkingEnabled":{"type":"boolean","description":"Enable extended thinking by default for all sessions. Typically configured via the /config command rather than editing directly. See https://code.claude.com/docs/en/common-workflows#use-extended-thinking-thinking-mode"},"companyAnnouncements":{"type":"array","items":{"type":"string","minLength":1},"description":"Company announcements to display at startup (one will be randomly selected if multiple are provided)"},"teammateMode":{"type":"string","enum":["auto","in-process","tmux"],"description":"How agent team teammates display: \\"auto\\" picks split panes in tmux or iTerm2, in-process otherwise. Agent teams are experimental and disabled by default. Enable them by adding CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS to your settings.json or environment. See https://code.claude.com/docs/en/agent-teams","default":"auto"},"worktree":{"type":"object","additionalProperties":false,"description":"Configuration for --worktree sessions. See https://code.claude.com/docs/en/settings","properties":{"sparsePaths":{"type":"array","items":{"type":"string","minLength":1},"description":"Directories to check out in each worktree via git sparse-checkout (cone mode). Only the listed paths are written to disk, which is faster in large monorepos.","examples":[["packages/my-app","shared/utils"]]}}},"pluginTrustMessage":{"type":"string","description":"(Managed settings only) Custom message appended to the plugin trust warning shown before installation. Use to provide organization-specific context about approved plugins. See https://code.claude.com/docs/en/settings#plugin-settings","minLength":1},"pluginConfigs":{"type":"object","additionalProperties":{"type":"object","properties":{"mcpServers":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}}]}},"description":"User configuration values for MCP servers keyed by server name"}},"additionalProperties":false},"description":"Per-plugin configuration including MCP server user configs, keyed by plugin ID (plugin@marketplace format). See https://code.claude.com/docs/en/plugins"},"allowManagedMcpServersOnly":{"type":"boolean","description":"(Managed settings only) Only allowedMcpServers from managed settings are respected. deniedMcpServers still merges from all sources. Users can still add their own MCP servers, but only the admin-defined allowlist applies."},"blockedMarketplaces":{"type":"array","description":"(Managed settings only) Blocklist of marketplace sources. These exact sources are blocked from being added as marketplaces. The check happens before downloading, so blocked sources never touch the filesystem.","items":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","const":"url","description":"Block marketplace fetched from direct URL"},"url":{"type":"string","format":"uri","description":"Direct URL to marketplace.json file"},"headers":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom HTTP headers (e.g., for authentication)"}},"required":["source","url"]},{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","const":"github","description":"Block marketplace from GitHub repository"},"repo":{"type":"string","description":"GitHub repository in owner/repo format"},"ref":{"type":"string","description":"Git branch or tag to use"},"path":{"type":"string","description":"Path to marketplace.json within repo"}},"required":["source","repo"]},{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","const":"git","description":"Block marketplace from git repository URL"},"url":{"type":"string","pattern":".*\\\\.git$","description":"Full git repository URL"},"ref":{"type":"string","description":"Git branch or tag to use"},"path":{"type":"string","description":"Path to marketplace.json within repo"}},"required":["source","url"]},{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","const":"npm","description":"Block marketplace from NPM package"},"package":{"type":"string","description":"NPM package containing marketplace.json"}},"required":["source","package"]},{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","const":"file","description":"Block marketplace from local file"},"path":{"type":"string","description":"Local file path to marketplace.json"}},"required":["source","path"]},{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","const":"directory","description":"Block marketplace from local directory"},"path":{"type":"string","description":"Local directory containing .claude-plugin/marketplace.json"}},"required":["source","path"]},{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","const":"hostPattern","description":"Block marketplace by host pattern matching"},"hostPattern":{"type":"string","description":"Regex pattern to match the host/domain extracted from any marketplace source type"}},"required":["source","hostPattern"]},{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","const":"pathPattern","description":"Block marketplace by file/directory path pattern matching"},"pathPattern":{"type":"string","description":"Regex pattern to match file or directory paths for marketplace sources"}},"required":["source","pathPattern"]}]}}}`),Q="Claude Code Settings",ee={$schema:W,$id:K,$defs:J,description:V,allowTrailingCommas:z,additionalProperties:Y,type:Z,properties:X,title:Q};function te(e){const t=e??{},r={...t.$defs??{},...t.definitions??{}},n=s=>{if(!s)return{};if(!s.$ref)return f(s);const a=/^#\/(\$defs|definitions)\/(.+)$/.exec(s.$ref);if(!a)return f(s);const u=r[a[2]];return u?n({...u,...d(s)}):f(s)},m=new Set(["__proto__","constructor","prototype"]),c=s=>{if(!s)return{};const a={};for(const[u,p]of Object.entries(s))m.has(u)||(a[u]=p);return a},f=s=>{if(!s.allOf||s.allOf.length===0)return s;const a={...s};delete a.allOf;for(const u of s.allOf){const p=n(u);Object.assign(a,{properties:{...c(a.properties),...c(p.properties)},required:se([...a.required??[],...p.required??[]])}),!a.description&&p.description&&(a.description=p.description),a.default===void 0&&p.default!==void 0&&(a.default=p.default),!a.type&&p.type&&(a.type=p.type)}return a},d=s=>{const{$ref:a,...u}=s;return u},l=(s,a)=>{let u=n(s);for(const p of a){if(!u)return null;if(/^\d+$/.test(p)){const v=Array.isArray(u.items)?u.items[Number(p)]:u.items;u=v?n(v):null;continue}const k=u.properties;if(k&&!m.has(p)&&p in k){u=n(k[p]);continue}const y=u.additionalProperties;if(y&&typeof y=="object"){u=n(y);continue}return null}return u},g=(s,a,u)=>{if(!s)return null;const p={};if(s.description&&(p.description=s.description),s.type&&(p.type=s.type),s.default!==void 0&&(p.default=s.default),s.enum&&(p.enum=s.enum),s.const!==void 0&&(p.const=s.const),s.deprecated&&(p.deprecated=!0),s.examples&&(p.examples=s.examples),s.properties&&(p.knownChildren=Object.keys(s.properties)),u&&(a!=null&&a.includes(u))&&(p.required=!0),s.items&&!Array.isArray(s.items)){const k=n(s.items),y=g(k,void 0,null);y&&(p.itemsInfo=y)}return(s.additionalProperties===!0||typeof s.additionalProperties=="object")&&(p.open=!0),p},i=s=>a=>{if(a.length===0)return g(n(s),void 0,null);const u=l(s,a.slice(0,-1));if(!u)return null;const p=a[a.length-1],k=l(u,[p]);return g(k,u.required,p)},b=s=>{const a=n(s);return Object.keys(a.properties??{})},h=s=>({at:i(s),rootKeys:()=>b(s),rootedAt:a=>{const u=l(s,a);return h(u??{})}});return h(t)}function se(e){return Array.from(new Set(e))}let A=null;function ce(){return A||(A=te(ee)),A}export{re as E,ce as a,B as g,ne as m,ae as p,G as s,ie as u};
package/dist/index.html CHANGED
@@ -7,10 +7,10 @@
7
7
  <link rel="preconnect" href="https://fonts.googleapis.com">
8
8
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9
9
  <link href="https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;0,6..72,700;1,6..72,400&family=Geist:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap" rel="stylesheet">
10
- <script type="module" crossorigin src="./assets/index-C-iwyX_s.js"></script>
10
+ <script type="module" crossorigin src="./assets/index-l-hKv9ou.js"></script>
11
11
  <link rel="modulepreload" crossorigin href="./assets/monaco-editor-BW5C4Iv1.js">
12
12
  <link rel="stylesheet" crossorigin href="./assets/monaco-editor-BTnBOi8r.css">
13
- <link rel="stylesheet" crossorigin href="./assets/index-B77KHr7n.css">
13
+ <link rel="stylesheet" crossorigin href="./assets/index-CNmekpRK.css">
14
14
  </head>
15
15
  <body class="bg-bg text-fg font-sans antialiased">
16
16
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-session-manager",
3
- "version": "0.69.0",
3
+ "version": "0.71.0",
4
4
  "description": "Local cockpit for the Claude Code CLI — multi-tab terminal, full config surface, scheduler, voice dictation, and live observability.",
5
5
  "type": "module",
6
6
  "main": "src/main/index.cjs",
@@ -1,3 +0,0 @@
1
- import{K as e,p as U,Y as m,d as B,b as D,a5 as b,a2 as V,T as X,a4 as Z,ab as ee,A as R}from"./index-C-iwyX_s.js";import{P as te}from"./Panel-D1z0ZvX_.js";import{L as ne}from"./ListDetail-V5JV-SVN.js";import"./monaco-editor-BW5C4Iv1.js";function y({children:t,onClick:o,disabled:x,variant:g="default",tooltip:i,type:f="button",className:u}){const v=`px-2 py-0.5 text-xs rounded border transition-colors disabled:opacity-40 disabled:cursor-not-allowed ${g==="primary"?"text-accent border-accent/50 hover:bg-bg-hi":g==="danger"?"text-red-400 hover:text-red-300 border-line hover:border-red-400/50":"text-fg-dim border-line hover:text-fg hover:bg-bg-hi"} ${u??""}`,a=e.jsx("button",{type:f,title:i,onClick:o,disabled:x,className:v,children:t});return i?e.jsx(U,{content:i,align:"bottom-center",children:a}):a}const ae=["inherit","haiku","sonnet","opus"],I=["Read","Grep","Glob","Bash","Write","Edit","WebFetch","WebSearch","Task"],se=["","red","orange","yellow","green","cyan","blue","purple","pink"],G={red:"#c0392b",orange:"#b85c34",yellow:"#c9a227",green:"#6f7d52",cyan:"#3f8f8a",blue:"#4a6fa5",purple:"#7a6a8a",pink:"#b45a80"};function T(t){return{name:t.name,description:t.description??"",tools:t.tools,model:t.model??"inherit",color:t.color??"",tags:t.tags,projects:t.projects??[],action:t.action??"",actionLabel:t.actionLabel??"",body:t.body}}const z={name:"new-agent",description:"",tools:["Read","Grep"],model:"inherit",color:"",tags:[],projects:[],action:"",actionLabel:"",body:""};function re(){const[t,o]=m.useState(null),[x,g]=m.useState(null),[i,f]=m.useState(""),[u,c]=m.useState(null),[v,a]=m.useState(!1),[j,N]=m.useState(!1),[O,C]=m.useState(null),[k,s]=m.useState(!1),w=m.useRef(!0);m.useEffect(()=>()=>{w.current=!1},[]);const p=async n=>{try{const d=await window.api.agents.listPersonas();if(!w.current)return;o(d),g(L=>{var P;return n??L??((P=d[0])==null?void 0:P.name)??null})}catch(d){if(!w.current)return;o([]),b.error(d.message||"failed to load agent personas")}};if(m.useEffect(()=>{p()},[]),m.useEffect(()=>window.api.agents.onChanged(()=>p()),[]),m.useEffect(()=>{const n=V();n&&g(n);const d=L=>g(L.detail);return window.addEventListener("sm:select-persona",d),()=>window.removeEventListener("sm:select-persona",d)},[]),t===null)return e.jsx(B,{title:"loading…"});const $=i.toLowerCase(),E=t.filter(n=>!$||n.name.toLowerCase().includes($)||(n.description??"").toLowerCase().includes($)),l=t.find(n=>n.name===x)??t[0]??null,r=u??(l?T(l):null),F=!!u&&!!l&&JSON.stringify(u)!==JSON.stringify(T(l)),S=v,K=n=>{c(null),a(!1),N(!1),C(null),g(n)},M=n=>c(d=>({...d??(l?T(l):z),...n})),W=()=>{c({...z}),a(!0),N(!1)},_=()=>{r&&(c({...r,name:r.name+"-copy"}),a(!0))},J=()=>{c(null),a(!1)},Y=async()=>{if(r){if(!/^[a-z][a-z0-9-]*$/.test(r.name)){b.error('agent name must be lowercase, hyphenated (e.g. "my-agent")');return}s(!0);try{const n={name:r.name,originalName:S||l==null?void 0:l.name,description:r.description,tools:r.tools,model:r.model,color:r.color,tags:r.tags,projects:r.projects,action:r.action,actionLabel:r.actionLabel,body:r.body};await window.api.agents.savePersona(n),b.info(S?`created ${r.name}`:`saved ${r.name}`),c(null),a(!1),await p(r.name)}catch(n){b.error(n.message||"failed to save agent persona")}finally{s(!1)}}},H=async()=>{if(l){s(!0);try{await window.api.agents.deletePersona({name:l.name}),b.info(`deleted ${l.name}`),N(!1),c(null),a(!1),await p()}catch(n){b.error(n.message||"failed to delete agent persona")}finally{s(!1)}}},q=async n=>{s(!0);try{await window.api.agents.deletePersona({name:n}),b.info(`deleted ${n}`),C(null),x===n&&(c(null),a(!1)),await p()}catch(d){b.error(d.message||"failed to delete agent persona")}finally{s(!1)}},Q=async n=>{if(l)try{await window.api.agents.removeOverride({name:l.name,projectName:n}),b.info(`removed ${n}'s override of ${l.name}`),await p(l.name)}catch(d){b.error(d.message||"failed to remove override")}};return e.jsx(te,{toolbar:e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-fg-faint",children:[t.length," persona",t.length===1?"":"s"]}),e.jsx("input",{value:i,onChange:n=>f(n.target.value),placeholder:"filter…",className:"bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg w-40"}),e.jsx("div",{className:"flex-1"}),e.jsx(y,{variant:"primary",onClick:W,children:"+ New agent"})]}),children:e.jsx(ne,{sidebar:e.jsxs("div",{className:"py-1",children:[S&&e.jsx("div",{className:"w-full text-left px-3 py-1 text-xs flex flex-col gap-0.5 bg-bg-hi text-fg border-l-2 border-accent",children:e.jsxs("span",{className:"flex items-center gap-2 justify-between w-full",children:[e.jsx("span",{className:"truncate font-mono",children:r==null?void 0:r.name}),e.jsx("span",{className:"shrink-0 text-[10px] font-semibold text-accent",children:"new"})]})}),E.length===0&&!S?e.jsx("div",{className:"px-3 py-1 text-xs text-fg-faint italic",children:"no agent personas found"}):E.map(n=>{const d=!S&&n.name===x,L=d&&F,P=O===n.name;return e.jsxs("div",{"data-agent-row":n.name,className:`group w-full text-left px-3 py-1 text-xs flex flex-col gap-0.5 border-l-2 cursor-pointer ${d?"bg-bg-hi text-fg border-accent":"text-fg-dim hover:text-fg hover:bg-bg-hi border-transparent"}`,onClick:()=>K(n.name),children:[e.jsxs("span",{className:"flex items-center gap-2 justify-between w-full",children:[e.jsxs("span",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx("span",{className:"w-2 h-2 rounded-sm shrink-0",style:{background:n.color?G[n.color]??n.color:"var(--fg-faint, #999)",opacity:n.color?1:.35}}),e.jsx("span",{className:"truncate font-mono",children:n.name})]}),e.jsxs("span",{className:"shrink-0 flex items-center gap-1.5",children:[L&&e.jsx("span",{className:"text-[10px] font-semibold text-accent",children:"unsaved"}),!L&&n.overridingProjects.length>0&&e.jsxs(D,{tone:"dim",children:[n.overridingProjects.length," override",n.overridingProjects.length>1?"s":""]}),P?e.jsxs("span",{className:"flex items-center gap-1",onClick:A=>A.stopPropagation(),children:[e.jsx("button",{onClick:()=>q(n.name),disabled:k,title:`Delete ${n.name}`,className:"text-[10px] font-semibold text-red-400 hover:text-red-300",children:"confirm"}),e.jsx("button",{onClick:()=>C(null),title:"Cancel",className:"text-[10px] text-fg-faint hover:text-fg",children:"cancel"})]}):e.jsx("button",{onClick:A=>{A.stopPropagation(),C(n.name)},title:`Delete ${n.name}`,className:"opacity-0 group-hover:opacity-100 text-fg-faint hover:text-red-400 transition-opacity",children:"×"})]})]}),n.description&&e.jsx("span",{className:"truncate text-fg-faint",children:n.description})]},n.name)})]}),detail:r?e.jsx(oe,{obj:r,set:M,saved:l,dirty:F,isNew:S,busy:k,confirmDelete:j,setConfirmDelete:N,onDuplicate:_,onRevert:J,onSave:Y,onDelete:H,onDropOverride:Q}):e.jsx(B,{title:"select an agent"})})})}const fe=m.memo(re);function oe({obj:t,set:o,saved:x,dirty:g,isNew:i,busy:f,confirmDelete:u,setConfirmDelete:c,onDuplicate:v,onRevert:a,onSave:j,onDelete:N,onDropOverride:O}){const C=`~/.claude/agents/${t.name}.md`,k=g||i;return e.jsxs("div",{className:"max-w-3xl",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-line flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-sm font-semibold text-fg font-mono",children:t.name}),i?e.jsx(D,{tone:"accent",children:"unsaved draft"}):g?e.jsx(D,{tone:"warn",children:"edited"}):e.jsx(D,{tone:"good",children:"saved"}),e.jsx("span",{className:"ml-auto text-[11px] text-fg-faint font-mono",children:C})]}),e.jsxs("div",{className:"p-4 space-y-4",children:[e.jsx(h,{label:"name",hint:"Filename on disk — lowercase, hyphenated.",children:e.jsx("input",{value:t.name,onChange:s=>o({name:s.target.value.toLowerCase()}),className:"w-full bg-bg border border-line rounded px-2 py-1 text-xs text-fg font-mono"})}),e.jsx(h,{label:"description",hint:"Shown in the list and in agent pickers.",children:e.jsx("input",{value:t.description,onChange:s=>o({description:s.target.value}),className:"w-full bg-bg border border-line rounded px-2 py-1 text-xs text-fg"})}),e.jsx(h,{label:"default model",hint:"This persona's default model for its Epics — sets the --model an Epic launches with (Terminal + Chat both honor it). 'inherit' falls back to each view's own default, not this Settings page. Cheap models for read-only personas; opus for judgement calls.",children:e.jsx(le,{options:ae,value:t.model,onChange:s=>o({model:s}),mono:!0})}),e.jsx(h,{label:"tools",hint:`${t.tools.length} of ${I.length} granted. Anything not ticked is refused at call time.`,children:e.jsx("div",{className:"flex flex-wrap gap-1.5",children:I.map(s=>{const w=t.tools.includes(s);return e.jsx("button",{onClick:()=>o({tools:w?t.tools.filter(p=>p!==s):[...t.tools,s]}),className:`px-2 py-0.5 rounded-full text-[11px] font-mono border ${w?"bg-sage/15 text-sage-dark border-sage/30":"bg-bg-hi text-fg-faint border-line"}`,children:s},s)})})}),e.jsx(h,{label:"color",children:e.jsx("div",{className:"flex gap-1.5",children:se.map(s=>e.jsx("button",{title:s||"none",onClick:()=>o({color:s}),className:"w-5 h-5 rounded",style:{background:s?G[s]:"transparent",border:t.color===s?"2px solid var(--accent, #b85c34)":"1px solid var(--line, #555)"}},s||"none"))})}),e.jsx(h,{label:"tags",hint:"Session mission tags this persona is associated with — shown as the default agent on that tag's own page. The first one (in Tag Library order) is the MISSION an Action button's session opens with.",children:e.jsx("div",{className:"flex flex-wrap gap-1.5",children:X.map(s=>{const w=t.tags.includes(s.tag),p=Z(s.tag);return e.jsxs("button",{onClick:()=>o({tags:w?t.tags.filter($=>$!==s.tag):[...t.tags,s.tag]}),className:`px-2 py-0.5 rounded-full text-[11px] font-mono border ${w?`${p.bg} ${p.text} ${p.border?"border-current/30":"border-transparent"}`:"bg-bg-hi text-fg-faint border-line"}`,children:["#",s.tag]},s.tag)})})}),e.jsx(ie,{obj:t,set:o}),e.jsx(h,{label:"definition",hint:"The system prompt this persona runs under.",children:e.jsx("textarea",{rows:9,value:t.body,onChange:s=>o({body:s.target.value}),className:"w-full bg-bg border border-line rounded px-2 py-1.5 text-xs text-fg font-mono leading-relaxed resize-y"})}),e.jsx(h,{label:"project overrides",hint:"Open projects that shadow this definition with a local copy.",children:x&&x.overridingProjects.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:x.overridingProjects.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,e.jsx("button",{onClick:()=>O(s),title:"Drop the local copy",className:"text-fg-faint hover:text-fg",children:"×"})]},s))}):e.jsx("div",{className:"text-xs text-fg-faint italic",children:i?"save first to see project overrides.":"no open project overlays this agent — the global definition applies everywhere."})})]}),e.jsx("div",{className:"px-4 py-2.5 border-t border-line flex items-center gap-2 flex-wrap",children:u?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-xs text-fg-dim",children:["Delete ",e.jsx("strong",{className:"font-mono",children:t.name})," and its file?"]}),e.jsx(y,{variant:"danger",onClick:N,disabled:f,children:"Delete"}),e.jsx(y,{onClick:()=>c(!1),children:"Keep"})]}):e.jsxs(e.Fragment,{children:[e.jsx(y,{onClick:v,disabled:f,children:"Duplicate"}),!i&&e.jsx(y,{variant:"danger",onClick:()=>c(!0),disabled:f,children:"Delete"}),e.jsx("div",{className:"flex-1"}),k&&e.jsx("span",{className:"text-[11px] text-fg-faint",children:"unsaved changes"}),e.jsx(y,{onClick:a,disabled:!k||f,children:"Revert"}),e.jsx(y,{variant:"primary",onClick:j,disabled:!k||f,children:f?"Saving…":i?"Create":"Save"})]})})]})}function ie({obj:t,set:o}){const{projects:x}=ee(),g=x.map(a=>({cwd:a.cwd,name:a.name})),i=new Set(g.map(a=>a.cwd)),f=t.projects.filter(a=>a!==R&&!i.has(a)),u=t.projects.includes(R),c=a=>o({projects:t.projects.includes(a)?t.projects.filter(j=>j!==a):[...t.projects,a]}),v=t.projects.length>0;return e.jsxs(e.Fragment,{children:[e.jsx(h,{label:"action — appears in",hint:"Projects whose Sessions toolbar gets a one-click button for this agent. Pressing it starts a normal session: this persona is the ACTOR, its first tag is the MISSION, and the action text below is the opening goal. Leave empty for an agent that is only picked by hand in the New Session card.",children:e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[e.jsx("button",{onClick:()=>c(R),className:`px-2 py-0.5 rounded-full text-[11px] font-mono border ${u?"bg-accent/15 text-accent border-accent/40 font-semibold":"bg-bg-hi text-fg-faint border-line"}`,children:"every project"}),g.map(a=>{const j=t.projects.includes(a.cwd);return e.jsx("button",{title:a.cwd,onClick:()=>c(a.cwd),className:`px-2 py-0.5 rounded-full text-[11px] font-mono border ${j?"bg-sage/15 text-sage-dark border-sage/30":"bg-bg-hi text-fg-faint border-line"} ${u&&!j?"opacity-40":""}`,children:a.name},a.cwd)}),f.map(a=>e.jsxs("button",{title:`${a} — not a known project on this machine`,onClick:()=>c(a),className:"px-2 py-0.5 rounded-full text-[11px] font-mono border bg-bg-hi text-fg-faint border-dashed border-line",children:[a," ×"]},a))]})}),v&&e.jsxs(e.Fragment,{children:[e.jsx(h,{label:"action — button label",hint:"Caption on the Sessions toolbar button. Defaults to the agent name.",children:e.jsx("input",{value:t.actionLabel,onChange:a=>o({actionLabel:a.target.value}),placeholder:t.name,className:"w-full bg-bg border border-line rounded px-2 py-1 text-xs text-fg"})}),e.jsx(h,{label:"action — opening instruction",hint:"Sent as the session's first message, under the AIM framing. Falls back to this persona's description when empty; with neither, no button is shown.",children:e.jsx("textarea",{rows:3,value:t.action,onChange:a=>o({action:a.target.value}),placeholder:t.description||`e.g. /builder
2
-
3
- Check git vs the published package and publish anything new.`,className:"w-full bg-bg border border-line rounded px-2 py-1.5 text-xs text-fg font-mono leading-relaxed resize-y"})})]})]})}function h({label:t,hint:o,children:x}){return e.jsxs("div",{children:[e.jsx("div",{className:"text-[10.5px] font-semibold uppercase tracking-wide text-fg-faint mb-1.5 font-mono",children:t}),x,o&&e.jsx("div",{className:"text-[11px] text-fg-faint mt-1 leading-snug",children:o})]})}function le({options:t,value:o,onChange:x,mono:g}){return e.jsx("div",{className:"flex flex-wrap gap-1",children:t.map(i=>{const f=i===o;return e.jsx("button",{onClick:()=>x(i),className:`px-2.5 py-1 rounded text-xs border ${g?"font-mono":""} ${f?"bg-accent/15 text-accent border-accent/40 font-semibold":"bg-bg-hi text-fg-dim border-line"}`,children:i},i)})})}export{fe as AgentLibrary};
@@ -1 +0,0 @@
1
- import{Y as i,a6 as J,ae as P,a5 as m,s as V,a7 as Q,K as t,d as I,a1 as W}from"./index-C-iwyX_s.js";import"./monaco-editor-BW5C4Iv1.js";function X(r){return r.hasMarketingPage?r.packagePrivate&&!r.packageHomepage?{kind:"private-needs-confirm"}:{kind:"ready"}:{kind:"no-marketing-page"}}const Z=["home","marketing","feature","architecture"],ee={home:"Home page",marketing:"Marketing page",feature:"Feature page",architecture:"Architecture page"};function $(r){return ee[r]}function D(r){const n=r.find(l=>l.subpath==="");return Z.map(l=>{const p=r.find(h=>h.source.kind==="project-page-lens"&&h.source.lens===l);return p?{lens:l,status:p.subpath===""?"root":"hosted",subpath:p.subpath,documentId:p.id}:!n&&l==="marketing"?{lens:l,status:"root",subpath:"",documentId:null}:{lens:l,status:"available",subpath:l,documentId:null}})}function te(r){return r.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64)||"project"}const j="bilko-host-publisher",se="bilko-host-publisher",ne=[{value:"home",label:"Home lens"},{value:"marketing",label:"Marketing lens"},{value:"feature",label:"Feature lens"},{value:"architecture",label:"Architecture lens"}];function ae(r,n){for(const l of Object.values(r))if(l.cwd===n&&l.tag===j&&l.status==="active")return l;return null}function _(r){W(r),window.dispatchEvent(new CustomEvent("sm:navigate",{detail:"terminal"}))}function oe(){const r=J(),n=(r==null?void 0:r.cwd)??null,l=P(e=>e.sessions),p=P(e=>e.createPromptSession),h=P(e=>e.approveProposed),[o,C]=i.useState(null),[R,v]=i.useState(!1),[b,k]=i.useState(""),[E,H]=i.useState(!1),[B,M]=i.useState(!1),[u,A]=i.useState(null),[N,L]=i.useState(""),[f,T]=i.useState(""),[w,O]=i.useState("feature");i.useEffect(()=>{let e=!1;return window.api.agents.listPersonas().then(a=>{if(e)return;const s=a.find(g=>g.name===se);A(s?{name:s.name,description:s.description}:null)}).catch(()=>{e||A(null)}),()=>{e=!0}},[]);const c=i.useCallback(()=>{n&&(v(!1),window.api.bilkoHost.get(n).then(e=>{C(e),k(a=>{var s;return a||((s=e.bundleManifest)==null?void 0:s.slug)||e.defaultSlug}),v(!0)}).catch(e=>{v(!0),m.error(`Could not load bilko-host status: ${e instanceof Error?e.message:String(e)}`)}))},[n]);i.useEffect(()=>{C(null),k(""),H(!1),c()},[c]);const x=n?ae(l,n):null,z=i.useCallback(()=>{!n||!b||(M(!0),window.api.bilkoHost.prepareBundle(n,b).then(()=>c()).catch(e=>m.error(`Could not prepare bundle: ${e instanceof Error?e.message:String(e)}`)).finally(()=>M(!1)))},[n,b,c]),F=i.useCallback(()=>{if(!n)return;const e=te(N).replace(/^-+|-+$/g,"");if(!e||!f.trim()){m.error("A sub-path and a title are required.");return}const a={kind:"project-page-lens",lens:w};window.api.bilkoHost.addDocument(n,e,f.trim(),a).then(()=>{L(""),T(""),c()}).catch(s=>m.error(`Could not add document: ${s instanceof Error?s.message:String(s)}`))},[n,N,f,w,c]),G=i.useCallback((e,a)=>{n&&window.api.bilkoHost.addDocument(n,a,$(e),{kind:"project-page-lens",lens:e}).then(()=>c()).catch(s=>m.error(`Could not add ${e} page: ${s instanceof Error?s.message:String(s)}`))},[n,c]),K=i.useCallback(async()=>{if(!n||!o)return;const e=D(o.documents).filter(a=>a.status==="available");for(const a of e)try{await window.api.bilkoHost.addDocument(n,a.subpath,$(a.lens),{kind:"project-page-lens",lens:a.lens})}catch(s){m.error(`Could not add ${a.lens} page: ${s instanceof Error?s.message:String(s)}`)}c()},[n,o,c]),U=i.useCallback(e=>{n&&window.api.bilkoHost.removeDocument(n,e).then(()=>c()).catch(a=>m.error(`Could not remove document: ${a instanceof Error?a.message:String(a)}`))},[n,c]),Y=i.useCallback(async()=>{if(!n||!b)return;if(x){_(x.id);return}const e=`Publish this project to bilko.run as a static-path listing, slug "${b}". Bundle is at session-manager-operations/bilko-host/dist/ (prepare it first via Prepare Bundle if it's missing or stale) — it may contain multiple documents (a root page plus sub-paths); publish the whole dist/ tree as one static-path app.`,{goalText:a,openingPrompt:s}=V({title:"",goal:e,tag:j,agentName:u==null?void 0:u.name,agentDescription:(u==null?void 0:u.description)??void 0}),g=u?await p(n,a,j,"HostBilko",u.name):await p(n,a,j,"HostBilko");h(g.id,"HostBilko"),Q.getState().send({tabId:g.id,sessionId:g.claudeSessionId,cwd:n,prompt:s}),_(g.id)},[n,b,x,p,h,u]);if(!n)return t.jsx(I,{title:"Open a project to host it on Bilko.run"});if(!R||!o)return null;const y=X(o);if(y.kind==="no-marketing-page")return t.jsx(I,{title:"No Marketing page yet",hint:"Generate this project's Project Pages from Project Home first — the root document publishes the Marketing lens."});const d=o.publishState,q=(d==null?void 0:d.status)??(o.bundleManifest?"bundle-ready":"not-published"),S=y.kind==="ready"||E;return t.jsxs("div",{className:"max-w-2xl space-y-4",children:[t.jsxs("div",{className:"rounded-card border border-line bg-bg-hi p-5 space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("div",{className:"font-serif text-lg text-fg",children:o.projectName}),t.jsxs("div",{className:"text-xs text-fg-faint mt-0.5",children:["Status: ",t.jsx("span",{className:"font-mono",children:q}),o.bundleStale&&o.bundleManifest&&t.jsx("span",{className:"ml-2 text-accent",children:"bundle out of date — Prepare Bundle again"})]})]}),(d==null?void 0:d.status)==="published"&&d.url&&t.jsx("a",{href:d.url,target:"_blank",rel:"noreferrer",className:"text-xs text-accent hover:underline",children:d.url})]}),y.kind==="private-needs-confirm"&&!E&&t.jsxs("div",{className:"rounded-md border border-line bg-bg p-3 text-xs text-fg-dim",children:["This project's package.json is marked private with no public homepage. Confirm you want to publish it to bilko.run anyway.",t.jsx("button",{type:"button",onClick:()=>H(!0),className:"mt-2 block rounded-md bg-accent px-3 py-1.5 text-xs font-semibold text-bg-hi hover:bg-accent-dark",children:"Yes, this can be public"})]}),S&&t.jsxs(t.Fragment,{children:[t.jsxs("label",{className:"block text-xs text-fg-faint",children:["Slug (bilko.run/projects/<slug>/)",t.jsx("input",{value:b,onChange:e=>k(e.target.value.toLowerCase()),className:"mt-1 block w-full rounded-md border border-line bg-bg px-2.5 py-1.5 text-sm font-mono text-fg"})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("button",{type:"button",onClick:z,disabled:B,className:"rounded-md border border-line bg-bg px-3.5 py-1.5 text-xs font-semibold text-fg hover:bg-bg-hi disabled:opacity-50",children:B?"Preparing…":"Prepare Bundle"}),t.jsx("button",{type:"button",onClick:()=>{Y().catch(e=>{m.error(e instanceof Error?e.message:String(e))})},disabled:!o.bundleManifest,title:o.bundleManifest?void 0:"Prepare a bundle first",className:"rounded-md bg-accent px-3.5 py-1.5 text-xs font-semibold text-bg-hi hover:bg-accent-dark disabled:opacity-50",children:x?"View publish in progress":"Publish"})]}),o.bundleManifest&&t.jsxs("div",{className:"text-[11px] text-fg-faint font-mono",children:["bundle: ",(o.bundleManifest.bundle.sizeBytesGz/1024).toFixed(1)," KB gz ·"," ",o.bundleManifest.bundle.fileCount," document",o.bundleManifest.bundle.fileCount===1?"":"s"," · built"," ",new Date(o.bundleManifest.builtAt).toLocaleString()," · ",o.bundleManifest.gitSha]}),(d==null?void 0:d.status)==="publish-failed"&&d.lastError&&t.jsxs("div",{className:"text-xs text-accent",children:["Last publish failed: ",d.lastError]})]})]}),S&&(()=>{const e=D(o.documents),a=e.filter(s=>s.status==="available").length;return t.jsxs("div",{className:"rounded-card border border-line bg-bg-hi p-5 space-y-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:"font-serif text-base text-fg",children:"Project Pages"}),a>1&&t.jsxs("button",{type:"button",onClick:K,className:"text-xs text-accent hover:underline",children:["Host all ",a," remaining"]})]}),t.jsxs("p",{className:"text-xs text-fg-faint",children:["This project generates 4 pages (Home / Marketing / Feature / Architecture). Marketing is the project's root (bilko.run/projects/",b||"<slug>","/); host any of the others as their own sub-page if you want them public too."]}),t.jsx("ul",{className:"space-y-1.5",children:e.map(s=>t.jsxs("li",{className:"flex items-center justify-between gap-2 rounded-md border border-line bg-bg px-3 py-2 text-xs",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"text-fg capitalize",children:s.lens}),t.jsx("div",{className:"text-fg-faint font-mono truncate",children:s.status==="root"?"(project root)":`/${s.subpath}/`})]}),s.status==="available"?t.jsxs("button",{type:"button",onClick:()=>G(s.lens,s.subpath),className:"shrink-0 rounded-md border border-line px-2 py-1 text-fg hover:bg-bg-hi",children:["+ Host as /",s.subpath,"/"]}):t.jsx("span",{className:"shrink-0 text-fg-faint",children:s.status==="root"?"root":"hosted"})]},s.lens))})]})})(),S&&t.jsxs("div",{className:"rounded-card border border-line bg-bg-hi p-5 space-y-3",children:[t.jsx("div",{className:"font-serif text-base text-fg",children:"Hosted documents"}),t.jsx("p",{className:"text-xs text-fg-faint",children:"One project, one Bilko listing — add as many explanatory pages as you want under it, each at its own sub-path. Removing one here takes it down on the next Publish."}),t.jsx("ul",{className:"space-y-1.5",children:o.documents.map(e=>t.jsxs("li",{className:"flex items-center justify-between gap-2 rounded-md border border-line bg-bg px-3 py-2 text-xs",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"text-fg truncate",children:e.title}),t.jsxs("div",{className:"text-fg-faint font-mono truncate",children:[e.subpath===""?"(root)":`/${e.subpath}/`," · ",e.url]})]}),e.subpath!==""&&t.jsx("button",{type:"button",onClick:()=>U(e.id),title:"Remove — takes effect on the next Publish",className:"shrink-0 rounded-md border border-line px-2 py-1 text-fg-faint hover:text-accent hover:border-accent/40",children:"Remove"})]},e.id))}),t.jsxs("div",{className:"rounded-md border border-line bg-bg p-3 space-y-2",children:[t.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wide text-fg-faint",children:"Add a document"}),t.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[t.jsx("input",{value:N,onChange:e=>L(e.target.value),placeholder:"sub-path, e.g. special-doc/01",className:"rounded-md border border-line bg-bg-hi px-2.5 py-1.5 text-xs font-mono text-fg"}),t.jsx("input",{value:f,onChange:e=>T(e.target.value),placeholder:"Title",className:"rounded-md border border-line bg-bg-hi px-2.5 py-1.5 text-xs text-fg"})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("select",{value:w,onChange:e=>O(e.target.value),className:"rounded-md border border-line bg-bg-hi px-2.5 py-1.5 text-xs text-fg",children:ne.map(e=>t.jsx("option",{value:e.value,children:e.label},e.value))}),t.jsx("button",{type:"button",onClick:F,className:"rounded-md border border-line bg-bg-hi px-3.5 py-1.5 text-xs font-semibold text-fg hover:bg-bg",children:"Add document"})]})]})]})]})}const le=i.memo(oe);export{le as HostBilko};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./SkillReferenceGraph-B_KqYC6R.js","./index-C-iwyX_s.js","./monaco-editor-BW5C4Iv1.js","./monaco-editor-BTnBOi8r.css","./index-B77KHr7n.css"])))=>i.map(i=>d[i]);
2
- import{K as e,Y as h,d as j,aa as Q,a5 as T,b as U}from"./index-C-iwyX_s.js";import{P as K}from"./Panel-D1z0ZvX_.js";import{P as V}from"./ProvenanceBadge-BIX0JW7m.js";import{e as X}from"./Library-BXt58QDN.js";import{p as W}from"./skillFrontmatter-Dif5JIg7.js";import{_ as Z}from"./monaco-editor-BW5C4Iv1.js";import{L as ee}from"./ListDetail-V5JV-SVN.js";import{M as te}from"./MarkdownEditor-BYUdiq8p.js";function ne({columns:t,rows:s,getKey:r,onRowClick:a,activeKey:o,empty:d}){return s.length===0?e.jsx("div",{className:"p-6 text-fg-faint text-xs text-center",children:d??"no entries"}):e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{className:"sticky top-0 bg-bg-elev text-fg-faint uppercase tracking-wider",children:e.jsx("tr",{className:"border-b border-line",children:t.map(i=>e.jsx("th",{className:`text-left font-normal px-3 py-1.5 ${i.className??""}`,style:i.width?{width:i.width}:void 0,children:i.header},i.key))})}),e.jsx("tbody",{children:s.map(i=>{const l=r(i),c=o===l;return e.jsx("tr",{"data-row-key":l,onClick:()=>a==null?void 0:a(i),className:`border-b border-line/50 transition-colors ${a?"cursor-pointer":""} ${c?"bg-bg-hi text-fg":"text-fg-dim hover:bg-bg-hi/50"}`,children:t.map(m=>e.jsx("td",{className:`px-3 py-1 ${m.className??""}`,children:m.render(i)},m.key))},l)})})]})}async function se(t,s,r){var m,x;const a=`${s}/skills`;try{const n=await window.api.config.listDir(a,{dirsOnly:!0});if(n.ok&&n.entries.length>0)return a}catch{}let o=null;try{const n=await window.api.config.readJson(`${r}/.claude/plugins/installed_plugins.json`);n.exists&&!n.parseError&&n.data&&typeof n.data=="object"&&(o=n.data)}catch{return null}if(!(o!=null&&o.plugins))return null;const d=Object.keys(o.plugins).find(n=>n===t||n.startsWith(`${t}@`));if(!d)return null;const i=(x=(m=o.plugins[d])==null?void 0:m[0])==null?void 0:x.installPath;if(!i)return null;const l=`${i}/skills`;return await window.api.config.exists(l)?l:null}async function ie(t){const s=await window.api.config.listDir(t,{dirsOnly:!0}),r=[];for(const a of s.entries){const o=`${a.path}/SKILL.md`,d=await window.api.config.readText(o);if(!d.exists)continue;const i=W(d.text);r.push({id:a.name,name:i.name,description:i.description,dir:a.path,path:o,body:i.body})}return r}function ae(t){const s=[],r=new Set;for(const a of t)for(const o of t){if(a.id===o.id)continue;const d=o.id.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=[`/${d}\\b`,`\`${d}\``];if(o.id.length>=4&&i.push(`\\b${d}\\b`),!i.some(m=>new RegExp(m,"i").test(a.body)))continue;const c=`${a.id}->${o.id}`;r.has(c)||(r.add(c),s.push({from:a.id,to:o.id}))}return s}const le=h.lazy(()=>Z(()=>import("./SkillReferenceGraph-B_KqYC6R.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url).then(t=>({default:t.SkillReferenceGraph})));function oe({pluginName:t,skills:s,onBack:r,initialSelectedId:a}){var x;const[o,d]=h.useState(a??((x=s[0])==null?void 0:x.id)??null),i=o?s.find(n=>n.id===o)??null:null,l=h.useMemo(()=>ae(s),[s]),[c,m]=h.useState("list");return e.jsxs("div",{className:"flex flex-col h-full min-h-0 overflow-hidden",children:[e.jsxs("div",{className:"shrink-0 h-11 flex items-baseline gap-3.5 px-3 border-b border-line bg-bg",children:[e.jsxs("button",{type:"button",onClick:r,className:"font-mono text-accent hover:underline shrink-0 text-xs",children:["← ",t]}),e.jsx("span",{className:"font-serif text-[22px] text-fg shrink-0 truncate max-w-[16rem]",children:(i==null?void 0:i.name)??(i==null?void 0:i.id)??"skill"}),e.jsx("span",{className:"flex-1"}),e.jsx("div",{className:"flex items-center gap-1.5 shrink-0",children:e.jsxs("div",{className:"flex rounded border border-line overflow-hidden",children:[e.jsx("button",{onClick:()=>m("list"),className:`px-2 py-0.5 text-xs ${c==="list"?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:"list"}),e.jsx("button",{onClick:()=>m("graph"),className:`px-2 py-0.5 text-xs ${c==="graph"?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:"graph"})]})})]}),e.jsxs("div",{className:"shrink-0 h-[26px] flex items-center gap-[18px] px-3 bg-bg-elev border-b border-line text-[9px] font-mono uppercase tracking-wide overflow-hidden",children:[i!=null&&i.description?e.jsx("span",{className:"text-fg-dim truncate normal-case",children:i.description}):null,e.jsxs("span",{className:"ml-auto text-fg-faint truncate normal-case",children:[s.length," ",s.length===1?"skill":"skills"," · ",l.length," ",l.length===1?"reference":"references"]})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:s.length===0?e.jsx(j,{title:"no skills in this plugin"}):c==="graph"?e.jsx(h.Suspense,{fallback:e.jsx("div",{className:"p-6 text-xs text-fg-faint",children:"Loading graph…"}),children:e.jsx(le,{skills:s,edges:l,selectedId:o,onSelect:d})}):e.jsx(ee,{sidebar:e.jsx("div",{className:"py-1",children:s.map(n=>e.jsxs("button",{onClick:()=>d(n.id),className:`w-full px-3 py-1 text-xs text-left ${o===n.id?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:[e.jsx("div",{className:"truncate",children:n.name??n.id}),n.description?e.jsx("div",{className:"truncate text-fg-faint",children:n.description}):null]},n.id))}),detail:i?e.jsx("div",{className:"h-full min-h-0",children:e.jsx(te,{path:i.path,value:i.body,onChange:()=>{},readOnly:!0})}):e.jsx(j,{title:"select a skill"})})})]})}const z=t=>{var s,r;return{type:"plugin",name:t.name,repository:(s=t.manifest)==null?void 0:s.repository,homepage:(r=t.manifest)==null?void 0:r.homepage}};function re(){const t=Q(),[s,r]=h.useState([]),[a,o]=h.useState(!0),[d,i]=h.useState(null),[l,c]=h.useState("installed");h.useEffect(()=>{if(!t)return;let n=!1;return(async()=>{var y;o(!0);const u=[];try{const g=await window.api.config.readJson(`${t}/.claude/plugins/installed_plugins.json`);if(g.exists&&!g.parseError&&g.data&&typeof g.data=="object"){const w=g.data;for(const[f,L]of Object.entries(w.plugins??{})){if(!Array.isArray(L))continue;const $=f.split("@")[0],E=f.split("@")[1];for(const b of L){if(!(b!=null&&b.installPath))continue;const S={name:$,path:b.installPath,isDirectory:!0,isFile:!1,mtimeMs:0,size:0},N=await fe(S);(y=N.manifest)!=null&&y.version||(N.manifest={...N.manifest??{},version:b.version}),N.marketplace=E,u.push(N)}}}}catch{}n||(u.sort((g,w)=>g.name.localeCompare(w.name)),n||(r(u),o(!1)))})(),()=>{n=!0}},[t]);const m=[{key:"name",header:"name",render:n=>{var u;return e.jsxs("div",{style:{maxWidth:"16rem"},children:[e.jsx("div",{className:"truncate",children:n.name}),(u=n.manifest)!=null&&u.description?e.jsx("div",{className:"truncate text-fg-faint",title:n.manifest.description,children:n.manifest.description}):null]})},width:"16rem"},{key:"origin",header:"origin",render:n=>e.jsx(V,{interactive:!1,input:z(n)}),width:"7rem"},{key:"version",header:"version",render:n=>{var u;return((u=n.manifest)==null?void 0:u.version)??e.jsx("span",{className:"text-fg-faint",children:"—"})},width:"6rem"},{key:"manifest",header:"manifest",render:n=>n.hasManifest?"plugin.json":e.jsx("span",{className:"text-fg-faint",children:"—"}),width:"8rem"},{key:"contents",header:"contents",render:n=>e.jsx("span",{className:"font-mono text-fg-faint text-xs",children:[n.agents>0?`${n.agents} agents`:null,n.skills>0?`${n.skills} skills`:null,n.hooks>0?`${n.hooks} hooks`:null,n.monitors>0?`${n.monitors} monitors`:null,n.binCount>0?`${n.binCount} bin`:null,n.hasLsp?"lsp":null,n.hasMcp?"mcp":null].filter(Boolean).join(" · ")||"—"})},{key:"path",header:"path",render:n=>e.jsx("span",{className:"font-mono text-fg-faint truncate",children:n.path})}];if(l==="library")return e.jsx(K,{toolbar:e.jsx(R,{active:l,onChange:c}),children:e.jsx(X,{})});const x=d?s.find(n=>n.path===d)??null:null;return e.jsx(K,{toolbar:e.jsxs(e.Fragment,{children:[e.jsx(R,{active:l,onChange:c}),e.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),e.jsxs("span",{className:"text-fg-faint",children:[s.length," plugins"]}),e.jsx("div",{className:"flex-1"}),e.jsx("span",{className:"text-fg-faint font-mono truncate",children:"~/.claude/plugins/installed_plugins.json"})]}),children:a?e.jsx(j,{title:"scanning plugins…"}):x?e.jsx(ce,{row:x,home:t,onBack:()=>i(null)},x.path):e.jsx("div",{className:"flex flex-col h-full",children:e.jsx("div",{className:"flex-1 min-h-0 overflow-auto",children:e.jsx(ne,{columns:m,rows:s,getKey:n=>n.path,activeKey:d,onRowClick:n=>i(n.path),empty:e.jsxs(e.Fragment,{children:["no plugins installed",e.jsxs("div",{className:"mt-2 text-fg-faint",children:["drop a plugin into ",e.jsx("code",{children:"~/.claude/plugins/"})]})]})})})})})}const ke=h.memo(re);function R({active:t,onChange:s}){const r=[["installed","Installed"],["library","Library"]];return e.jsx("div",{className:"flex rounded border border-line overflow-hidden",role:"tablist","aria-label":"Plugins view",children:r.map(([a,o])=>e.jsx("button",{onClick:()=>s(a),role:"tab","aria-selected":t===a,className:`px-2 py-0.5 text-xs ${t===a?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:o},a))})}function ce({row:t,home:s,onBack:r}){var b,S,N,I,B;const[a,o]=h.useState([]),[d,i]=h.useState([]),[l,c]=h.useState([]),[m,x]=h.useState([]),[n,u]=h.useState("skills"),[y,g]=h.useState(null),[w,f]=h.useState(!0);h.useEffect(()=>{if(!s)return;let p=!1;return(async()=>{f(!0);try{const[v,G,M,Y]=await Promise.all([se(t.name,t.path,s),O(`${t.path}/agents`,{filesOnly:!0}),t.hasMcp?window.api.config.readJson(`${t.path}/.mcp.json`):Promise.resolve(null),O(`${t.path}/bin`,{filesOnly:!0})]),H=v?await ie(v):[],J=G.filter(k=>k.endsWith(".md")),q=await Promise.all(J.map(k=>window.api.config.readText(`${t.path}/agents/${k}`))),F=[];J.forEach((k,D)=>{const C=q[D];if(!C.exists)return;const A=W(C.text);F.push({id:k,name:A.name??k.replace(/\.md$/,""),description:A.description})});const _=[];if(M&&M.exists&&!M.parseError&&M.data&&typeof M.data=="object"){const k=M.data.mcpServers;if(k&&typeof k=="object")for(const[D,C]of Object.entries(k)){const A=C&&typeof C=="object"?C.command:void 0;_.push({id:D,name:D,description:typeof A=="string"?A:null})}}if(p)return;o(H),i(F),c(_),x(Y),u(H.length>0?"skills":F.length>0?"agents":_.length>0?"mcp":t.hooks>0?"hooks":t.monitors>0?"monitors":t.hasLsp?"lsp":"files")}catch(v){if(p)return;T.error(`Failed to load plugin contents: ${v instanceof Error?v.message:String(v)}`),o([]),i([]),c([]),x([])}finally{p||f(!1)}})(),()=>{p=!0}},[t.path,t.name,t.hasMcp,t.hooks,t.monitors,t.hasLsp,s]);const L=[{key:"skills",label:"Skills",count:a.length},{key:"agents",label:"Agents",count:d.length},{key:"mcp",label:"MCP server",count:l.length},{key:"hooks",label:"Hooks",count:t.hooks},{key:"monitors",label:"Monitors",count:t.monitors},{key:"lsp",label:"LSP",count:t.hasLsp?1:0},{key:"files",label:"Bin",count:m.length}],$=(b=t.manifest)!=null&&b.author?typeof t.manifest.author=="string"?t.manifest.author:t.manifest.author.name??null:null,E=async p=>{const v=await window.api.shell.open({as:"external",url:p});v.ok||T.error(v.error??`Failed to open ${p}`)};return y?e.jsx(oe,{pluginName:((S=t.manifest)==null?void 0:S.name)??t.name,skills:a,initialSelectedId:y.id,onBack:()=>g(null)},y.id):e.jsxs("div",{className:"flex flex-col h-full min-h-0 overflow-hidden",children:[e.jsxs("div",{className:"shrink-0 h-11 flex items-baseline gap-3.5 px-3 border-b border-line bg-bg",children:[e.jsx("button",{type:"button",onClick:r,className:"font-mono text-accent hover:underline shrink-0 text-xs",children:"← Plugins"}),e.jsx("span",{className:"font-serif text-[22px] text-fg shrink-0 truncate max-w-[16rem]",children:((N=t.manifest)==null?void 0:N.name)??t.name}),(I=t.manifest)!=null&&I.version?e.jsxs("span",{className:"font-mono text-fg-faint text-xs shrink-0",children:["v",t.manifest.version]}):null,(B=t.manifest)!=null&&B.description?e.jsx("span",{className:"text-fg-dim text-xs min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap",children:t.manifest.description}):e.jsx("span",{className:"flex-1"}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsx(V,{input:z(t)}),t.hasMcp?e.jsx(U,{tone:"accent",children:"MCP"}):null]})]}),t.manifest?e.jsxs("div",{className:"shrink-0 h-[26px] flex items-center gap-[18px] px-3 bg-bg-elev border-b border-line text-[9px] font-mono uppercase tracking-wide overflow-hidden",children:[$?e.jsxs("span",{className:"text-fg-dim truncate",children:[e.jsx("span",{className:"text-fg-faint",children:"Author "}),$]}):null,t.manifest.license?e.jsxs("span",{className:"text-fg-dim truncate",children:[e.jsx("span",{className:"text-fg-faint",children:"License "}),t.manifest.license]}):null,t.manifest.homepage?e.jsxs("button",{onClick:()=>E(t.manifest.homepage),className:"text-accent hover:underline truncate normal-case",title:t.manifest.homepage,children:[e.jsx("span",{className:"text-fg-faint uppercase",children:"Homepage "}),t.manifest.homepage]}):null,e.jsx("span",{className:"ml-auto text-fg-faint truncate normal-case",children:t.path})]}):e.jsx("div",{className:"shrink-0 h-[26px] flex items-center px-3 bg-bg-elev border-b border-line text-[9px] font-mono uppercase tracking-wide overflow-hidden",children:e.jsx("span",{className:"ml-auto text-fg-faint truncate normal-case",children:t.path})}),e.jsxs("div",{className:"flex-1 min-h-0 grid overflow-hidden",style:{gridTemplateColumns:"170px 1fr"},children:[e.jsx("div",{className:"min-h-0 overflow-auto bg-bg-elev border-r border-line py-1",children:L.map(p=>e.jsxs("button",{type:"button",disabled:p.count===0,onClick:()=>u(p.key),className:`w-full text-left px-3 py-1.5 text-xs flex items-center justify-between ${p.count===0?"text-fg-faint opacity-50 cursor-default":n===p.key?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:[e.jsx("span",{children:p.label}),p.count>0?e.jsx("span",{className:"font-mono text-fg-faint",children:p.count}):null]},p.key))}),e.jsx("div",{className:"min-h-0 overflow-auto",children:w?e.jsx(j,{title:"scanning…"}):e.jsx(de,{active:n,row:t,skills:a,agents:d,mcpServers:l,files:m,onOpenSkill:g})})]})]})}function de({active:t,row:s,skills:r,agents:a,mcpServers:o,files:d,onOpenSkill:i}){return t==="skills"?r.length===0?e.jsx(j,{title:"no components"}):e.jsx("div",{children:r.map((l,c)=>e.jsx(P,{n:c+1,name:l.name??l.id,description:l.description,onClick:()=>i(l)},l.id))}):t==="agents"?a.length===0?e.jsx(j,{title:"no components"}):e.jsx("div",{children:a.map((l,c)=>e.jsx(P,{n:c+1,name:l.name??l.id,description:l.description},l.id))}):t==="mcp"?o.length===0?e.jsx(j,{title:"no components"}):e.jsx("div",{children:o.map((l,c)=>e.jsx(P,{n:c+1,name:l.name,description:l.description},l.id))}):t==="hooks"?s.hooks===0?e.jsx(j,{title:"no components"}):e.jsx("div",{children:e.jsx(P,{n:1,name:`${s.hooks} ${s.hooks===1?"hook":"hooks"} configured`,description:`${s.path}/hooks/hooks.json`})}):t==="monitors"?s.monitors===0?e.jsx(j,{title:"no components"}):e.jsx("div",{children:e.jsx(P,{n:1,name:`${s.monitors} ${s.monitors===1?"monitor":"monitors"} configured`,description:`${s.path}/monitors/monitors.json`})}):t==="lsp"?s.hasLsp?e.jsx("div",{children:e.jsx(P,{n:1,name:"LSP server enabled",description:`${s.path}/.lsp.json`})}):e.jsx(j,{title:"no components"}):d.length===0?e.jsx(j,{title:"no components"}):e.jsx("div",{children:d.map((l,c)=>e.jsx(P,{n:c+1,name:l,description:null},l))})}function P({n:t,name:s,description:r,onClick:a}){const o=a?"button":"div";return e.jsxs(o,{onClick:a,className:`w-full flex items-baseline gap-2.5 py-[9px] px-3 border-b border-line text-left min-w-0 ${a?"hover:bg-bg-hi cursor-pointer":""}`,children:[e.jsx("span",{className:"font-serif text-fg-faint text-xs shrink-0 w-6 text-right",children:String(t).padStart(2,"0")}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"font-mono font-semibold text-accent truncate",children:s}),r?e.jsx("div",{className:"text-fg-dim text-xs truncate",children:r}):null]})]})}async function fe(t){let s=`${t.path}/.claude-plugin/plugin.json`,r=await window.api.config.exists(s);r||(s=`${t.path}/plugin.json`,r=await window.api.config.exists(s));let a=null;if(r){const f=await window.api.config.readJson(s);f.exists&&!f.parseError&&f.data&&typeof f.data=="object"&&(a=f.data)}const[o,d,i,l]=await Promise.all([window.api.config.exists(`${t.path}/.lsp.json`),window.api.config.exists(`${t.path}/.mcp.json`),window.api.config.exists(`${t.path}/monitors/monitors.json`),window.api.config.exists(`${t.path}/hooks/hooks.json`)]);let c=0;if(i){const f=await window.api.config.readJson(`${t.path}/monitors/monitors.json`);Array.isArray(f.data)?c=f.data.length:f.data&&typeof f.data=="object"&&Array.isArray(f.data.monitors)&&(c=f.data.monitors.length)}let m=0;if(l){const f=await window.api.config.readJson(`${t.path}/hooks/hooks.json`);if(f.data&&typeof f.data=="object"){const L=f.data;m=Object.values(L).reduce(($,E)=>Array.isArray(E)?$+E.reduce((b,S)=>b+(Array.isArray(S.hooks)?S.hooks.length:0),0):$,0)}}const[x,n,u]=await Promise.all([O(`${t.path}/agents`,{filesOnly:!0}),O(`${t.path}/bin`,{filesOnly:!0}),O(`${t.path}/skills`,{dirsOnly:!0})]),y=x.filter(f=>f.endsWith(".md")).length,g=n.length,w=u.length;return{name:t.name,path:t.path,mtimeMs:t.mtimeMs,hasManifest:r,manifest:a,hasLsp:o,monitors:c,hooks:m,agents:y,skills:w,binCount:g,hasMcp:d}}async function O(t,s){try{return(await window.api.config.listDir(t,s)).entries.map(a=>a.name)}catch{return[]}}export{ke as Plugins};
@@ -1 +0,0 @@
1
- import{t as P,aa as G,Y as x,K as i,Z as R,B as T,b as _}from"./index-C-iwyX_s.js";import{a as E,C as B,c as L,d as S,b as I}from"./Library-BXt58QDN.js";const O=e=>`${e}/.claude/session-manager/provenance.json`;function K(e){if(!e||typeof e!="object")return{};const t={};for(const[n,o]of Object.entries(e))(o==="anthropic"||o==="community"||o==="local")&&(t[n]=o);return t}const D=P((e,t)=>({overrides:{},loaded:!1,loading:!1,home:null,load:async n=>{const o=t();if(!(o.home===n&&(o.loaded||o.loading))){e({home:n,loading:!0});try{const r=await window.api.config.readJson(O(n)),d=r.exists?K(r.data):{};e(h=>({overrides:{...d,...h.overrides},loaded:!0,loading:!1}))}catch{e({loaded:!0,loading:!1})}}},setOverride:async(n,o)=>{const r={...t().overrides};o===null?delete r[n]:r[n]=o,e({overrides:r});const d=t().home;if(d)try{await window.api.config.writeJson(O(d),r)}catch{}}})),a=e=>(e??"").toLowerCase().trim(),j=new Set,$=new Set;for(const e of I){const t=e.official?j:$;t.add(a(e.id)),t.add(a(e.name))}const H=new Set(S.filter(e=>e.official).flatMap(e=>[a(e.id),a(e.name)])),J=new Set(S.filter(e=>!e.official).flatMap(e=>[a(e.id),a(e.name)])),U=new Set(L.filter(e=>e.official).flatMap(e=>[a(e.id),a(e.name)])),V=new Set(L.filter(e=>!e.official).flatMap(e=>[a(e.id),a(e.name)])),z=new Set(B.flatMap(e=>[a(e.id),a(e.name)])),Y=new Set(E.flatMap(e=>[a(e.id),a(e.name)])),Z=new Set(E.map(e=>e.command.trim())),q=new Set(["security-review","pr-comments","release-notes","add-dir","code-review","simplify"]),F=/(@anthropic-ai\/|anthropic\.com|github\.com\/anthropics)/i,Q=/(^|\s)(npx|uvx|pipx|bunx|mcp-remote|deno\s+run|docker\s+run)(\s|$)/i;function W(e){return[e.command,...e.args??[],e.url,e.repository,e.homepage].filter(Boolean).join(" ").toLowerCase()}const l=e=>({provenance:"anthropic",reason:e}),y=e=>({provenance:"community",reason:e});function X(e,t,n){switch(e){case"mcp":return j.has(t)?l("official MCP server (catalog)"):$.has(t)?y("third-party server (catalog)"):null;case"skill":case"command":return H.has(t)?l("official Anthropic skill (catalog)"):J.has(t)?y("third-party skill (catalog)"):null;case"plugin":return U.has(t)?l("official Anthropic plugin (catalog)"):V.has(t)?y("third-party plugin (catalog)"):null;case"subagent":return z.has(t)?l("bundled Anthropic subagent (catalog)"):null;case"hook":return Y.has(t)||n&&Z.has(n.trim())?l("bundled hook (catalog)"):null}}function ee(e,t){return e.repository?"has a source repository":e.homepage?"has a homepage":e.url?"remote endpoint":Q.test(t)?"installed from a package registry":null}function te(e){const t=a(e.name),n=W(e),o=X(e.type,t,e.command);if(o)return o;if((e.type==="command"||e.type==="skill")&&q.has(t))return l("built-in Claude Code command");if(F.test(n))return l("Anthropic package or repo");const r=ee(e,n);return r?y(r):{provenance:"local",reason:"no external source — assumed self-created"}}function ne(e,t,n){return`${e}:${t??"-"}:${n}`}const c={anthropic:"Anthropic",community:"Community",local:"Local"},N={anthropic:"accent",community:"warn",local:"dim"},oe=["anthropic","community","local"];function se({input:e,scope:t,interactive:n=!0,className:o=""}){const r=G(),{overrides:d,load:h,setOverride:k}=D(),[b,m]=x.useState(!1),v=x.useRef(null);x.useEffect(()=>{r&&h(r)},[r,h]),x.useEffect(()=>{if(!b)return;const s=C=>{v.current&&!v.current.contains(C.target)&&m(!1)},g=C=>{C.key==="Escape"&&m(!1)};return window.addEventListener("mousedown",s),window.addEventListener("keydown",g),()=>{window.removeEventListener("mousedown",s),window.removeEventListener("keydown",g)}},[b]);const w=ne(e.type,t??null,e.name),f=te(e),p=d[w],u=p??f.provenance,M=p?`Origin manually set to ${c[u]} — auto-detected ${c[f.provenance]} (${f.reason})`:`Auto-detected ${c[u]}: ${f.reason}`,A=i.jsxs(_,{tone:N[u],title:M,className:`${n?"cursor-pointer hover:brightness-125":""} ${o}`,children:[c[u],p&&i.jsx("span",{className:"w-1 h-1 rounded-full bg-current opacity-70","aria-hidden":!0})]});return n?i.jsxs("span",{ref:v,className:"relative inline-flex",children:[i.jsx("button",{type:"button",onClick:s=>{s.stopPropagation(),m(g=>!g)},className:"inline-flex","aria-label":`Origin: ${c[u]}. Click to change.`,children:A}),b&&i.jsxs("span",{className:`absolute ${R.dialog} top-full right-0 mt-1 min-w-[7.5rem] rounded-md border border-line bg-bg-elev shadow-lg py-1 text-left`,onClick:s=>s.stopPropagation(),children:[i.jsx("span",{className:"block px-2 pb-1 text-[10px] uppercase tracking-wide text-fg-faint",children:"Mark origin as"}),oe.map(s=>i.jsxs("button",{type:"button",onClick:()=>{k(w,s),m(!1)},className:`flex w-full items-center gap-2 px-2 py-1 text-[12px] hover:bg-bg-hi/60 ${u===s?"text-fg":"text-fg-dim"}`,children:[i.jsx("span",{className:`w-2 h-2 rounded-full border ${T[N[s]]}`,"aria-hidden":!0}),c[s],p===s&&i.jsx("span",{className:"ml-auto text-[10px] text-fg-faint",children:"set"})]},s)),i.jsx("div",{className:"my-1 border-t border-line"}),i.jsxs("button",{type:"button",onClick:()=>{k(w,null),m(!1)},disabled:!p,className:"flex w-full items-center gap-2 px-2 py-1 text-[12px] text-fg-dim hover:bg-bg-hi/60 disabled:opacity-40 disabled:hover:bg-transparent",title:`Revert to auto-detection (${c[f.provenance]})`,children:["Auto-detect",i.jsx("span",{className:"ml-auto text-[10px] text-fg-faint",children:c[f.provenance]})]})]})]}):A}export{se as P};
@@ -1,3 +0,0 @@
1
- import{Y as p,K as e,S as k,a as q,d as M,af as Y,R as Z,aa as Q,ai as $,ac as X,a8 as R,J as ee,V as te,n as F}from"./index-C-iwyX_s.js";import{P as se}from"./Panel-D1z0ZvX_.js";import{S as ae}from"./ScopeSwitcher-Cl3g7YOM.js";import{S as re}from"./SaveBar-DOJnzj3n.js";import{u as ne,m as le,p as ie,a as G,E as oe,s as ce}from"./settingsSchema-DHDH8NJR.js";import{T as U}from"./Toggle-CoFtvmoX.js";import"./monaco-editor-BW5C4Iv1.js";const de=[{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"]},{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"]}],ue={mcp:"MCP",url:"URL",urls:"URLs",http:"HTTP",ui:"UI",id:"ID",uuid:"UUID",api:"API",aws:"AWS",otel:"OTel",json:"JSON"};function J(a){return a.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,r)=>{const n=ue[l];return n||(r===0?l.charAt(0).toUpperCase()+l.slice(1):l)}).join(" ")}function B(a){const s=new Set,t=[];for(const r of de){const n=r.keys.filter(i=>a.has(i));n.forEach(i=>s.add(i)),n.length!==0&&t.push({id:r.id,title:r.title,summary:r.summary,advanced:!!r.advanced,keys:n})}const l=Array.from(a).filter(r=>!s.has(r)&&r!=="$schema").sort();return l.length>0&&t.push({id:"other",title:"Other",summary:"Keys not yet grouped.",advanced:!1,keys:l}),t}function pe(a,s){return B(a).map(t=>({id:t.id,title:t.title,advanced:t.advanced,total:t.keys.length,setCount:t.keys.filter(l=>s.has(l)).length}))}const xe={};function K(a,s){if(s)return{text:s,authored:!1};const t=xe[a];return t?{text:t,authored:!0}:null}const me={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"},fe=["user","project","local","default"],ge={user:"user",project:"project",local:"local",default:"default"};function he({node:a,targetScope:s,onOverride:t,schema:l}){const[r,n]=p.useState(""),[i,x]=p.useState(!1),[m,j]=p.useState(!0),u=a.kind==="object"?a:null,S=u?Object.keys(u.children):[],h=l.rootKeys(),N=new Set([...S,...h]),f=p.useMemo(()=>B(N),[Array.from(N).sort().join(",")]),b=p.useMemo(()=>pe(N,new Set(S)),[Array.from(N).sort().join(","),S.join(",")]),[C,E]=p.useState(null),c=p.useRef(null),w=o=>{const g=f.find(y=>y.id===o);g!=null&&g.advanced&&!i&&x(!0),E(o)};p.useEffect(()=>{if(!C)return;E(null);const o=c.current,g=document.getElementById(`settings-group-${C}`);if(!o||!g)return;const y=g.getBoundingClientRect().top-o.getBoundingClientRect().top;o.scrollBy({top:y,behavior:"smooth"})},[C]);const v=p.useMemo(()=>f.filter(o=>i||!o.advanced).map(o=>({...o,keys:o.keys.filter(g=>{const y=(u==null?void 0:u.children[g])!==void 0;if(!m&&!y)return!1;if(!r.trim())return!0;const T=l.at([g]);return[g,J(g),(T==null?void 0:T.description)??""].join(" ").toLowerCase().includes(r.toLowerCase())})})).filter(o=>o.keys.length>0),[f,r,i,m,u,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:k[s].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=>j(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=>x(o.target.checked),className:"accent-accent"}),"show advanced"]}),e.jsx("div",{className:"flex-1"}),e.jsx("input",{value:r,onChange:o=>n(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(be,{groups:b,onJump:w}),e.jsxs("div",{ref:c,className:"flex-1 overflow-auto py-3",children:[v.map(o=>e.jsx(ye,{id:o.id,title:o.title,summary:o.summary,advanced:o.advanced,children:o.keys.map(g=>{const y=u==null?void 0:u.children[g],T=l.at([g]);return e.jsx(ve,{keyName:g,node:y,info:T,targetScope:s,onOverride:(d,P)=>t([g],d,P)},g)})},o.id)),v.length===0&&e.jsxs("div",{className:"px-6 py-12 text-center text-fg-faint text-sm",children:['no settings match "',r,'"']})]})]})]})}function be({groups:a,onJump:s}){return e.jsx("nav",{className:"shrink-0 w-48 border-r border-line bg-bg-elev/30 overflow-y-auto py-3",children:a.map(t=>e.jsxs("button",{onClick:()=>s(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:me[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 ye({id:a,title:s,summary:t,advanced:l,children:r}){const[n,i]=p.useState(!0);return e.jsxs("section",{id:`settings-group-${a}`,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(!n),children:[e.jsx("span",{className:"text-fg-faint w-3",children:n?"▾":"▸"}),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:s}),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})]})]}),n&&e.jsx("div",{className:"divide-y divide-line/60",children:r})]})}function ve({keyName:a,node:s,info:t,targetScope:l,onOverride:r}){const[n,i]=p.useState(!1),[x,m]=p.useState(!1),j=J(a),u=s!==void 0,h=(s==null?void 0:s.kind)==="leaf"?s:null,N=(s==null?void 0:s.kind)==="object"||(s==null?void 0:s.kind)==="array",f=t==null?void 0:t.default,b=h&&f!==void 0&&z(h.value,f),C=Te({isSet:u,leafNode:h,defaultVal:f,isDefault:!!b,node:s}),E=je(h,f),c=E.length>=2,w=!!h&&!b,v=K(a,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(!n),className:"text-fg-faint hover:text-fg w-3 mt-0.5",title:n?"collapse":"expand",children:n?"▾":"▸"}),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:j}),e.jsx(Oe,{kind:C.kind,label:C.label}),c&&e.jsxs("button",{onClick:o=>{o.stopPropagation(),n||i(!0),m(g=>!g)},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=>ge[o]).join(" · ")]}),w&&h&&e.jsx("button",{onClick:o=>{o.stopPropagation(),r(void 0,h.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 ${k[h.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)&&!u&&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"})]}),v&&e.jsx("p",{className:`text-fg-dim text-xs mt-0.5 leading-relaxed ${v.authored?"inline-block border-b border-dotted border-fg-faint/70 cursor-help":""}`,title:v.authored?"In-app-authored description — not from the official Claude Code schema":void 0,children:Pe(v.text)}),n&&x&&h&&e.jsx(Ne,{leaf:h,defaultVal:f,onReset:o=>r(void 0,o)}),n&&e.jsx(we,{keyName:a,node:s,info:t,targetScope:l,onOverride:o=>r(o)})]}),e.jsx("div",{className:"shrink-0",children:!n&&e.jsx(Ee,{node:s,info:t,onSet:o=>{r(o)},disabled:N&&u})})]})})}function je(a,s){if(!a)return[];const t=new Set;t.add(a.winner);for(const l of a.shadowed)t.add(l.scope);return s!==void 0&&t.add("default"),fe.filter(l=>t.has(l))}function Ne({leaf:a,defaultVal:s,onReset:t}){const l={};l[a.winner]={value:a.value,winner:!0};for(const r of a.shadowed)l[r.scope]={value:r.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(r=>{const n=l[r],i=n!==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:k[r].label}),e.jsx("span",{className:`font-mono truncate ${n!=null&&n.winner?"text-accent":"text-fg-dim"}`,children:i?A(n.value):e.jsx("span",{className:"text-fg-faint",children:"—"})}),i?e.jsx("button",{onClick:()=>t(r),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 ${k[r].label}`,children:"↺"}):e.jsx("span",{})]},r)}),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:s!==void 0?A(s):e.jsx("span",{className:"text-fg-faint",children:"—"})}),e.jsx("span",{})]})]})]})}function we({keyName:a,node:s,info:t,targetScope:l,onOverride:r}){const i=(s==null?void 0:s.kind)==="leaf"?s:null,x=K(a,t==null?void 0:t.description);return e.jsxs("div",{className:"mt-3 space-y-2 text-xs",children:[x&&e.jsx("p",{className:`text-fg-dim leading-relaxed whitespace-pre-wrap ${x.authored?"inline-block border-b border-dotted border-fg-faint/70 cursor-help":""}`,title:x.authored?"In-app-authored description — not from the official Claude Code schema":void 0,children:x.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:A(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:A(i.value)}),e.jsxs("span",{className:"ml-2 text-fg-faint",children:["from ",k[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,j)=>e.jsxs("div",{className:"font-mono text-fg-faint line-through",children:[A(m.value)," —"," ",e.jsx("span",{className:"no-underline",children:k[m.scope].label})]},j))})]}),(s==null?void 0:s.kind)==="array"&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Accumulated"}),e.jsxs("dd",{className:"text-fg-dim",children:[s.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(Se,{keyName:a,node:s,info:t,onChange:r,targetScope:l})})]})}function Se({node:a,info:s,onChange:t,targetScope:l}){const n=(a==null?void 0:a.kind)==="leaf"?a.value:s==null?void 0:s.default,i=V(s==null?void 0:s.type);if(i==="boolean"){const x=n===!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:j})=>e.jsx("button",{onClick:()=>t(m),className:`px-3 py-0.5 text-xs transition-colors ${x===m?"bg-accent text-bg":"bg-bg-elev text-fg-dim hover:bg-bg-hi hover:text-fg"}`,children:j},j))}),e.jsxs("span",{className:"text-fg-faint",children:["→ ",k[l].label]})]})}return s!=null&&s.enum?e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-fg-faint",children:"Choose:"}),s.enum.map(x=>{const m=z(n,x);return e.jsx("button",{onClick:()=>t(x),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(x)},String(x))}),e.jsxs("span",{className:"text-fg-faint",children:["→ ",k[l].label]})]}):i==="integer"||i==="number"?e.jsx(ke,{value:typeof n=="number"?n:void 0,integer:i==="integer",onCommit:t,target:k[l].label}):i==="string"?e.jsx(Ce,{value:typeof n=="string"?n:"",onCommit:t,target:k[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 ke({value:a,integer:s,onCommit:t,target:l}){const[r,n]=p.useState(a!==void 0?String(a):""),i=()=>{const x=s?parseInt(r,10):parseFloat(r);Number.isNaN(x)||t(x)};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:r,onChange:x=>n(x.target.value),onBlur:i,onKeyDown:x=>{x.key==="Enter"&&x.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 Ce({value:a,onCommit:s,target:t}){const[l,r]=p.useState(a);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:n=>r(n.target.value),onKeyDown:n=>{n.key==="Enter"&&s(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:()=>s(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 Ee({node:a,info:s,onSet:t,disabled:l}){const r=(a==null?void 0:a.kind)==="leaf",n=V(s==null?void 0:s.type);if(l)return null;if(n==="boolean"){const i=r&&a.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 Te({isSet:a,leafNode:s,defaultVal:t,isDefault:l,node:r}){return a?(r==null?void 0:r.kind)==="array"?{kind:"accumulated",label:`${r.items.length} items`}:(r==null?void 0:r.kind)==="object"?{kind:"set",label:"configured"}:s?l?{kind:"default",label:`= default · ${k[s.winner].label}`}:s.shadowed.length>0?{kind:"override",label:`overriding ${s.shadowed.length} scope(s)`}:{kind:"set",label:`set in ${k[s.winner].label}`}:{kind:"set",label:"configured"}:t!==void 0?{kind:"default",label:`using default: ${A(t)}`}:{kind:"unset",label:"not configured"}}function Oe({kind:a,label:s}){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"}[a];return e.jsx("span",{className:`text-[9px] px-1.5 py-0 rounded border uppercase tracking-wide ${t}`,children:s})}function V(a){if(a)return Array.isArray(a)?a.find(t=>t!=="null")??a[0]:a}function z(a,s){return a===s?!0:typeof a!=typeof s?!1:a&&s&&typeof a=="object"?JSON.stringify(a)===JSON.stringify(s):!1}function Pe(a){const s=a.trim().split(`
2
- `)[0],t=s.match(/^([^.!?]+[.!?])/);return t?t[1]:s.length>120?s.slice(0,120)+"…":s}function A(a){if(typeof a=="string")return a===""?'""':JSON.stringify(a);if(a===null)return"null";if(a===void 0)return"—";if(typeof a=="object"){const s=JSON.stringify(a);return s.length>60?s.slice(0,60)+"…":s}return String(a)}function Ae(){const[a,s]=p.useState(null),[t,l]=p.useState(null),[r,n]=p.useState(null),[i,x]=p.useState(null),[m,j]=p.useState(!1),[u,S]=p.useState(null),[h,N]=p.useState(null);if(p.useEffect(()=>{let c=!1;return Promise.all([window.api.otel.getConfig(),window.api.otel.status(),window.api.otel.configPath()]).then(([w,v,o])=>{c||(s(w),n(w),l(v),x(o))}).catch(w=>{console.warn("[telemetry] load failed:",w==null?void 0:w.message)}),()=>{c=!0}},[]),!r||!a)return e.jsx(M,{title:"loading…"});const f=JSON.stringify(r)!==JSON.stringify(a),b=(c,w)=>{S(null),n({...r,[c]:w})},C=async()=>{j(!0),S(null);try{const c=await window.api.otel.setConfig(r);!c.ok&&c.error&&S(c.error),s(c.config),n(c.config),l(c.status),N(Date.now())}catch(c){S(c instanceof Error?c.message:String(c))}finally{j(!1)}},E=()=>{S(null),n(a)};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:"Telemetry — 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(U,{checked:r.enabled,onChange:c=>b("enabled",c),label:r.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:r.endpoint,onChange:c=>b("endpoint",c.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:r.headers,onChange:c=>b("headers",c.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:r.serviceName,onChange:c=>b("serviceName",c.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(U,{checked:r.includeContent,onChange:c=>b("includeContent",c),label:r.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:!f||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:!f||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"}),u&&e.jsx("span",{className:"text-red-400 text-xs",children:u}),!u&&h&&!f&&e.jsx("span",{className:"text-fg-faint text-xs",children:"saved"})]})]})}function Re(){const{model:a,setModel:s}=Y();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:a,onChange:t=>s(t.target.value),className:"w-full bg-bg border border-line rounded px-2 py-1 text-fg font-mono text-xs",children:Z.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."})]})})]})}const H={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 Me(){const a=Q(),s=$(d=>d.tabs),t=$(d=>d.activeTabId),l=s.find(d=>d.id===t)??null,r=(l==null?void 0:l.cwd)??null,n=X(d=>d.navFace),i=p.useRef(!1),x=p.useRef(n),[m,j]=p.useState(()=>n==="project"&&r?"project":"user"),[u,S]=p.useState("effective");p.useEffect(()=>{if(x.current!==n){if(x.current=n,i.current){i.current=!1;return}j(n==="project"&&r?"project":"user")}},[n,r]),p.useEffect(()=>{n==="project"&&(u==="telemetry"||u==="app")&&S("effective")},[n,u]);const h=d=>{i.current=!0,j(d)},N=ne(F,a,r),f=N[m]??null,b=R(d=>d.files),C=R(d=>d.setDraft),E=R(d=>d.saveJson),c=R(d=>d.revert),[w,v]=p.useState(null),o=p.useMemo(()=>le(ie(b,N)),[b,N]),g=(d,P,O)=>{var _;const I=N[O??m];if(!I)return;v(null);const D=((_=b[I])==null?void 0:_.draftRaw)??"";let L={};if(D.trim())try{L=JSON.parse(D)}catch{L={}}const W=ce(L,d,P);C(I,JSON.stringify(W,null,2)+`
3
- `)};if(!a)return e.jsx(M,{title:"loading…"});const y=f?b[f]:null,T=d=>d!=="user"&&!r;return e.jsx(se,{toolbar:e.jsxs(e.Fragment,{children:[e.jsx(te,{options:[{key:"effective",label:"Guided"},{key:"tree",label:"Tree"},{key:"raw",label:"Raw"},...n==="home"?[{key:"telemetry",label:"Telemetry"},{key:"app",label:"Session Manager"}]:[]],active:u,onChange:S}),u!=="telemetry"&&u!=="app"&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),e.jsx(ae,{scopes:F.scopes,active:m,onChange:h,annotate:d=>{if(T(d))return{exists:!1};const P=N[d];if(!P)return null;const O=b[P];return{exists:(O==null?void 0:O.exists)??!1,dirty:(O==null?void 0:O.dirty)??!1}}}),e.jsx("span",{className:"ml-3 text-fg-faint truncate",children:u==="effective"?`overrides → ${f??"—"}`:f??"—"})]}),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:u!=="telemetry"&&u!=="app"&&f&&y?e.jsx(re,{dirty:y.dirty,busy:y.busy,parseError:w||y.parseError,lastSavedAt:y.lastSavedAt,leading:y.exists?null:e.jsx("span",{children:"file will be created on save"}),onSave:async()=>{v(null);const d=await E(f);d.ok||v(d.error??"save failed")},onRevert:()=>{v(null),c(f)}}):null,children:u==="telemetry"?e.jsx(Ae,{}):u==="app"?e.jsx(Re,{}):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:H[m].title}),e.jsx("span",{className:"mx-1.5 text-fg-faint",children:"·"}),e.jsx("span",{className:"text-fg-dim",children:H[m].body}),f&&e.jsx("span",{className:"ml-1.5 font-mono text-fg-faint",children:f})]}),T(m)?e.jsx(M,{title:"no active project",hint:"open a tab in a project directory to edit project or local settings"}):u==="effective"?e.jsx(he,{node:o,targetScope:m,onOverride:g,schema:G()}):u==="tree"?e.jsx(oe,{node:o,targetScope:m,onOverride:g,schema:G()}):f&&y?e.jsx(ee,{path:f,value:y.draftRaw,onChange:d=>{v(null),C(f,d)}}):e.jsx(M,{title:"resolving…"})]})})}const He=p.memo(Me);export{H as SETTINGS_SCOPE_NOTES,He as Settings};
@@ -1 +0,0 @@
1
- import{Y as o,a5 as E,K as e,aa as k,C,a8 as x,d as b}from"./index-C-iwyX_s.js";import{P as j}from"./Panel-D1z0ZvX_.js";import{S as L}from"./SaveBar-DOJnzj3n.js";import{M as w}from"./MarkdownEditor-BYUdiq8p.js";import{f as P,V as v}from"./Library-BXt58QDN.js";import"./monaco-editor-BW5C4Iv1.js";function R(n){return n.split("/").pop()||n}function D({activePath:n}){const[m,u]=o.useState([]),[s,p]=o.useState(null),[h,f]=o.useState({}),d=o.useRef(0);if(o.useEffect(()=>{if(d.current+=1,p(null),f({}),!n){u([]);return}const t=d.current;let c=!1;return window.api.config.parseImports(n).then(a=>{c||d.current!==t||(a.ok?u(a.imports):(u([]),E.error(a.error||"failed to parse @-imports")))}),()=>{c=!0}},[n]),m.length===0)return null;function g(t){if(s===t){p(null);return}if(p(t),!h[t]){const c=d.current;f(a=>({...a,[t]:{loading:!0,text:null,error:null}})),window.api.config.readText(t).then(a=>{d.current===c&&f(l=>({...l,[t]:{loading:!1,text:a.text,error:a.error}}))})}}return e.jsx("div",{className:"shrink-0 border-b border-line bg-bg-elev text-xs max-h-64 overflow-auto",children:m.map(t=>{const c=!t.ok||!t.exists,a=s===t.path,l=h[t.path];return e.jsxs("div",{className:"border-b border-line last:border-b-0","data-testid":"referenced-file-row",children:[e.jsxs("button",{type:"button",onClick:()=>g(t.path),className:"w-full flex items-center gap-2 px-3 py-1.5 text-left hover:bg-bg",children:[e.jsx("span",{className:`shrink-0 text-fg-faint transition-transform ${a?"rotate-90":""}`,children:"›"}),e.jsx("span",{className:"shrink-0 font-medium",children:R(t.path)}),e.jsx("span",{className:"text-fg-faint truncate flex-1",title:t.path,children:t.path}),e.jsxs("span",{className:"text-fg-faint shrink-0",children:[t.sizeBytes.toLocaleString()," bytes · ~",t.tokenEstimate.toLocaleString()," tokens"]}),c?e.jsx("span",{className:"shrink-0 px-1.5 py-0.5 rounded text-[10px] uppercase tracking-wide text-amber-400/90 border border-amber-400/30","data-testid":"referenced-file-missing",children:"missing"}):null]}),a?e.jsx("div",{className:"h-64 border-t border-line",children:!l||l.loading?e.jsx("div",{className:"px-3 py-2 text-fg-faint",children:"loading…"}):l.error?e.jsx("div",{className:"px-3 py-2 text-amber-400/90",children:l.error}):e.jsx(w,{path:t.path,value:l.text??"",onChange:()=>{},readOnly:!0})}):null]},t.path)})})}const y={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 F(n){return Math.round(n.length/4)}function T(){const n=k(),[m,u]=o.useState("installed"),s=o.useMemo(()=>n?C.resolve("user",n,null):null,[n]),p=x(r=>r.files),h=x(r=>r.loadText),f=x(r=>r.setDraft),d=x(r=>r.saveText),g=x(r=>r.revert),t=x(r=>r.watchFile),c=x(r=>r.unwatchFile);o.useEffect(()=>{if(s)return h(s,!0),t(s),()=>{c(s)}},[s]);const[a,l]=o.useState(null);if(!n)return e.jsx(b,{title:"loading…"});if(m==="library")return e.jsx(j,{toolbar:e.jsx(v,{active:m,onChange:u,installedLabel:"Editor",libraryLabel:"Presets"}),children:e.jsx(P,{})});const i=s?p[s]:null,N=i?F(i.draftRaw):0,S=(i==null?void 0:i.draftRaw.length)??0;return e.jsx(j,{toolbar:e.jsxs(e.Fragment,{children:[e.jsx(v,{active:m,onChange:u,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:s??"—"}),e.jsx("div",{className:"flex-1"}),e.jsxs("span",{className:"text-fg-faint",children:[S.toLocaleString()," chars · ~",N.toLocaleString()," tokens"]})]}),footer:s&&i?e.jsx(L,{dirty:i.dirty,busy:i.busy,parseError:a,lastSavedAt:i.lastSavedAt,leading:i.exists?null:e.jsx("span",{children:"file will be created on save"}),onSave:async()=>{l(null);const r=await d(s);r.ok||l(r.error??"save failed")},onRevert:()=>{l(null),g(s)}}):null,children:s&&i?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:y.title}),e.jsx("span",{className:"mx-1.5 text-fg-faint",children:"·"}),e.jsx("span",{className:"text-fg-dim",children:y.body}),e.jsx("span",{className:"ml-1.5 font-mono text-fg-faint",children:s})]}),e.jsx(D,{activePath:s}),e.jsx("div",{className:"flex-1 min-h-0",children:e.jsx(w,{path:s,value:i.draftRaw,onChange:r=>{l(null),f(s,r)}})})]}):e.jsx(b,{title:"resolving…"})})}const V=o.memo(T);export{V as SystemPrompt};
@@ -1 +0,0 @@
1
- import{Y as o,T as f,K as e,d as N,a4 as j,a5 as u,r as w}from"./index-C-iwyX_s.js";import{P as y}from"./Panel-D1z0ZvX_.js";import{L as T}from"./ListDetail-V5JV-SVN.js";import"./monaco-editor-BW5C4Iv1.js";function k(){const[s,n]=o.useState(f[0].tag),[l,g]=o.useState(null),[h,x]=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&&g(t)}catch(t){if(!r.current)return;g([]),u.error(t.message||"failed to load agent personas")}};o.useEffect(()=>{c()},[]),o.useEffect(()=>window.api.agents.onChanged(()=>c()),[]);const m=f.find(t=>t.tag===s)??null,p=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:[...t.tags,i],body:t.body}),x(!1),await c()}catch(d){u.error(d.message||"failed to assign tag")}},a=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:t.tags.filter(d=>d!==i),body:t.body}),await c()}catch(d){u.error(d.message||"failed to remove tag")}};return e.jsx(y,{toolbar:e.jsxs("span",{className:"text-fg-faint",children:[f.length," tag",f.length===1?"":"s"]}),children:e.jsx(T,{sidebar:e.jsx("div",{className:"py-1",children:f.map(t=>{const i=j(t.tag),d=s===t.tag,b=(l==null?void 0:l.filter(v=>v.tags.includes(t.tag)).length)??0;return e.jsxs("button",{onClick:()=>{n(t.tag),x(!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:m?e.jsx(E,{entry:m,personas:l,adding:h,setAdding:x,onAssign:p,onUnassign:a}):e.jsx(N,{title:"select a tag"})})})}const R=o.memo(k);function E({entry:s,personas:n,adding:l,setAdding:g,onAssign:h,onUnassign:x}){const r=j(s.tag),c=w(s.tag),m=(n==null?void 0:n.filter(a=>a.tags.includes(s.tag)))??[],p=(n==null?void 0:n.filter(a=>!a.tags.includes(s.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:["#",s.tag]}),e.jsx("span",{className:"text-sm font-semibold text-fg",children:s.label})]}),e.jsx("div",{className:"text-xs text-fg-dim leading-relaxed",children:s.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:s.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:s.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:[m.map(a=>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:[a.name,e.jsx("button",{onClick:()=>x(a,s.tag),title:"Remove this tag from the agent",className:"text-fg-faint hover:text-fg",children:"×"})]},a.name)),m.length===0&&!l&&e.jsx("span",{className:"text-xs text-fg-faint italic mr-1",children:"no agent carries this tag yet."}),l?p.length>0?e.jsxs("select",{autoFocus:!0,defaultValue:"",onChange:a=>{const t=n.find(i=>i.name===a.target.value);t&&h(t,s.tag)},onBlur:()=>g(!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…"}),p.map(a=>e.jsx("option",{value:a.name,children:a.name},a.name))]}):e.jsx("span",{className:"text-xs text-fg-faint italic",children:"every agent already carries this tag."}):e.jsx("button",{onClick:()=>g(!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{R as TagLibrary};