claude-code-session-manager 0.68.0 → 0.70.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.
- package/dist/assets/AgentLibrary-ClxN8f2w.js +3 -0
- package/dist/assets/{History-BySQczDf.js → History-EDAc-ZMb.js} +2 -2
- package/dist/assets/{Hooks-CG8jWh3-.js → Hooks-aRH7nMJd.js} +3 -3
- package/dist/assets/HostBilko-SlCefAAH.js +1 -0
- package/dist/assets/{Library-BA8cOckT.js → Library-BCIBTN21.js} +1 -1
- package/dist/assets/{ListDetail-CVIhWPWb.js → ListDetail-CJZGbxwd.js} +1 -1
- package/dist/assets/{MarkdownEditor-DUoKh1Qr.js → MarkdownEditor-Due9TO9x.js} +1 -1
- package/dist/assets/{McpServers-CkowlPR7.js → McpServers-BYKw9iDf.js} +2 -2
- package/dist/assets/{Memory-C5Vv5Wim.js → Memory-CIqDISVo.js} +4 -4
- package/dist/assets/{Panel-CVgA2-Y3.js → Panel-C6JXCGRu.js} +1 -1
- package/dist/assets/{Permissions-u43I9j0-.js → Permissions-C1gnBLDo.js} +3 -3
- package/dist/assets/Plugins-BysI_znb.js +2 -0
- package/dist/assets/ProvenanceBadge-BxphD65P.js +1 -0
- package/dist/assets/{SaveBar-R1ZZ9WH5.js → SaveBar-4DXRUXpo.js} +1 -1
- package/dist/assets/{Scheduler-D4Gzz6iD.js → Scheduler-BmbVLNFH.js} +6 -6
- package/dist/assets/{ScopeSwitcher-DBcYhNZF.js → ScopeSwitcher-Dlbq0DLs.js} +1 -1
- package/dist/assets/Settings-BZtTqlKA.js +3 -0
- package/dist/assets/{SkillReferenceGraph-DTfBzZ7O.js → SkillReferenceGraph-CQ-0ZVDl.js} +1 -1
- package/dist/assets/Skills-BGBKWxNl.js +3 -0
- package/dist/assets/SystemPrompt-Bc715ZOf.js +1 -0
- package/dist/assets/TagLibrary-CAnB2jV8.js +1 -0
- package/dist/assets/{TiptapBody-DxzA0zb5.js → TiptapBody-CxLrfTQ5.js} +1 -1
- package/dist/assets/{Toggle-CPlUEMUg.js → Toggle-CLcPpQX-.js} +1 -1
- package/dist/assets/{index-CEnMgeQU.css → index-CFtzZuq7.css} +1 -1
- package/dist/assets/{index-Ceid3k5X.js → index-DVVeB50r.js} +356 -355
- package/dist/assets/{settingsSchema-CgmSslES.js → settingsSchema-DS2QMkuB.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/plugins/session-manager-dev/.claude-plugin/plugin.json +1 -1
- package/plugins/session-manager-dev/skills/send-feedback/SKILL.md +149 -0
- package/src/main/__tests__/crossProjectFeedback.test.cjs +327 -0
- package/src/main/__tests__/crossProjectFeedbackRoutes.test.cjs +154 -0
- package/src/main/index.cjs +5 -0
- package/src/main/lib/buildTarget.cjs +15 -0
- package/src/main/lib/crossProjectFeedback.cjs +545 -0
- package/src/main/lib/epicMint.cjs +38 -7
- package/src/main/lib/promptSessionSchema.cjs +7 -1
- package/dist/assets/AgentLibrary-D1SHQWCQ.js +0 -3
- package/dist/assets/HostBilko-BxjPY1PW.js +0 -1
- package/dist/assets/Plugins-DComjLBQ.js +0 -2
- package/dist/assets/ProvenanceBadge-DNTnbu6f.js +0 -1
- package/dist/assets/Settings-CXcfro2y.js +0 -3
- package/dist/assets/Skills-CVlcQjVO.js +0 -3
- package/dist/assets/SystemPrompt-COLmPm10.js +0 -1
- package/dist/assets/TagLibrary-BN6bvsjU.js +0 -1
- package/plugins/session-manager-dev/skills/builder/session-manager-operations/scheduler/state/queue.json +0 -3
|
@@ -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-Ceid3k5X.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-DTfBzZ7O.js","./index-Ceid3k5X.js","./monaco-editor-BW5C4Iv1.js","./monaco-editor-BTnBOi8r.css","./index-CEnMgeQU.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-Ceid3k5X.js";import{P as K}from"./Panel-CVgA2-Y3.js";import{P as V}from"./ProvenanceBadge-DNTnbu6f.js";import{e as X}from"./Library-BA8cOckT.js";import{p as W}from"./skillFrontmatter-Dif5JIg7.js";import{_ as Z}from"./monaco-editor-BW5C4Iv1.js";import{L as ee}from"./ListDetail-CVIhWPWb.js";import{M as te}from"./MarkdownEditor-DUoKh1Qr.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-DTfBzZ7O.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-Ceid3k5X.js";import{a as E,C as B,c as L,d as S,b as I}from"./Library-BA8cOckT.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-Ceid3k5X.js";import{P as se}from"./Panel-CVgA2-Y3.js";import{S as ae}from"./ScopeSwitcher-DBcYhNZF.js";import{S as re}from"./SaveBar-R1ZZ9WH5.js";import{u as ne,m as le,p as ie,a as G,E as oe,s as ce}from"./settingsSchema-CgmSslES.js";import{T as U}from"./Toggle-CPlUEMUg.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,3 +0,0 @@
|
|
|
1
|
-
import{Y as l,aa as G,a6 as J,ac as Q,a8 as u,K as t,d as R,a5 as L}from"./index-Ceid3k5X.js";import{P as D}from"./Panel-CVgA2-Y3.js";import{L as U}from"./ListDetail-CVIhWPWb.js";import{M as X}from"./MarkdownEditor-DUoKh1Qr.js";import{S as Z}from"./SaveBar-R1ZZ9WH5.js";import{S as V}from"./ScopeSwitcher-DBcYhNZF.js";import{T as _}from"./Toggle-CPlUEMUg.js";import{P as B}from"./ProvenanceBadge-DNTnbu6f.js";import{l as ee}from"./listSkills-QORduPIk.js";import{S as te,V as F}from"./Library-BA8cOckT.js";import{p as se,r as ae,s as ne}from"./skillFrontmatter-Dif5JIg7.js";import"./monaco-editor-BW5C4Iv1.js";function re(d,m){return{user:{skills:`${d}/.claude/skills`,commands:`${d}/.claude/commands`},project:m?{skills:`${m}/.claude/skills`,commands:`${m}/.claude/commands`}:null}}function le(){const d=G(),m=J(),h=(m==null?void 0:m.cwd)??null,x=Q(e=>e.navFace),j=l.useRef(!1),T=l.useRef(x),[p,N]=l.useState(()=>x==="project"&&h?"project":"user"),[v,k]=l.useState([]),[r,C]=l.useState(null),[w,E]=l.useState("installed"),[$,I]=l.useState(""),b=l.useMemo(()=>d?re(d,h):null,[d,h]);l.useEffect(()=>{if(T.current!==x){if(T.current=x,j.current){j.current=!1;return}N(x==="project"&&h?"project":"user")}},[x,h]),l.useEffect(()=>{if(!b)return;let e=!1;const i=p==="user"?b.user:b.project;if(!i){k([]);return}return(async()=>{var c;const n=[],s=await ee(i.skills);for(const a of s)n.push({kind:"skills",scope:p,name:a.name,path:a.path,dir:a.dir,disabled:ae(a.text),description:se(a.text).description??void 0});const o=await window.api.config.listDir(i.commands,{filesOnly:!0});for(const a of o.entries)a.name.endsWith(".md")&&n.push({kind:"commands",scope:p,name:a.name.replace(/\.md$/,""),path:a.path,dir:null,disabled:!1});e||(n.sort((a,A)=>a.kind===A.kind?a.name.localeCompare(A.name):a.kind==="skills"?-1:1),k(n),n.find(a=>a.path===r)||C(((c=n[0])==null?void 0:c.path)??null))})(),()=>{e=!0}},[p,b]);const S=u(e=>e.files),P=u(e=>e.loadText),H=u(e=>e.setDraft),K=u(e=>e.saveText),O=u(e=>e.revert),W=u(e=>e.watchFile),M=u(e=>e.unwatchFile);async function Y(e,i){const n=await window.api.config.readText(e.path);if(!n.exists)return;const s=ne(n.text,i);if(s===n.text)return;const o=await window.api.config.writeText(e.path,s);if(!o.ok){L.error(o.error??"failed to update skill");return}k(c=>c.map(a=>a.path===e.path?{...a,disabled:i}:a)),S[e.path]&&P(e.path)}async function q(e){if(!e.dir||!window.confirm(`Remove skill "${e.name}"?
|
|
2
|
-
|
|
3
|
-
Its folder moves to the trash (recoverable); reinstall any time from the Library.`))return;const i=await window.api.files.delete(e.dir);if(!i.ok){L.error(i.error??"failed to remove skill");return}L.info(`Removed "${e.name}" — moved to trash`),M(e.path),k(n=>n.filter(s=>s.path!==e.path)),C(n=>{var o;return n!==e.path?n:((o=v.filter(c=>c.path!==e.path)[0])==null?void 0:o.path)??null})}l.useEffect(()=>{if(r)return S[r]||P(r),W(r),()=>M(r)},[r]);const[z,y]=l.useState(null);if(!d)return t.jsx(R,{title:"loading…"});if(w==="library")return t.jsx(D,{toolbar:t.jsx(F,{active:w,onChange:E,installedLabel:"Installed",libraryLabel:"Library"}),children:t.jsx(te,{})});if(p==="project"&&!h)return t.jsx(D,{toolbar:t.jsxs(t.Fragment,{children:[t.jsx(F,{active:w,onChange:E}),t.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),t.jsx(V,{scopes:["user","project"],active:p,onChange:e=>{j.current=!0,N(e)}})]}),children:t.jsx(R,{title:"no active project",hint:"open a tab in a project directory to view project skills & commands"})});const f=v.find(e=>e.path===r)??null,g=r?S[r]:null;return t.jsx(D,{toolbar:t.jsxs(t.Fragment,{children:[t.jsx(F,{active:w,onChange:E}),t.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),t.jsx(V,{scopes:["user","project"],active:p,onChange:e=>{j.current=!0,N(e)}}),t.jsxs("span",{className:"ml-3 text-fg-faint",children:[v.length," ",v.length===1?"item":"items"]}),t.jsx("div",{className:"flex-1"}),f&&t.jsx(B,{scope:f.scope,input:{type:f.kind==="commands"?"command":"skill",name:f.name}}),t.jsx("span",{className:"ml-2 text-fg-faint truncate",children:(f==null?void 0:f.path)??""})]}),footer:r&&g?t.jsx(Z,{dirty:g.dirty,busy:g.busy,parseError:z,lastSavedAt:g.lastSavedAt,onSave:async()=>{y(null);const e=await K(r);e.ok||y(e.error??"save failed")},onRevert:()=>{y(null),O(r)}}):null,children:t.jsx(U,{sidebar:t.jsxs("div",{className:"py-1",children:[t.jsx("div",{className:"px-2 pb-1",children:t.jsx("input",{value:$,onChange:e=>I(e.target.value),placeholder:"filter…",className:"w-full bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"})}),["skills","commands"].map(e=>{const i=$.toLowerCase(),n=v.filter(s=>s.kind===e&&(!i||s.name.toLowerCase().includes(i)));return t.jsxs("div",{className:"mb-3",children:[t.jsx("div",{className:"px-3 py-1 text-xs uppercase tracking-wider text-fg-faint",children:e==="skills"?"Skills":"Slash Commands"}),n.length===0?t.jsx("div",{className:"px-3 py-1 text-xs text-fg-faint italic",children:"none"}):n.map(s=>{var c;const o=s.kind==="skills";return t.jsxs("div",{className:`w-full px-3 py-1 text-xs flex items-center justify-between gap-2 ${r===s.path?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:[t.jsxs("button",{onClick:()=>C(s.path),className:"flex-1 min-w-0 text-left",children:[t.jsxs("div",{className:`truncate ${s.disabled?"line-through opacity-50":""}`,title:s.disabled?"Disabled — Claude will not auto-invoke this skill":void 0,children:[s.kind==="commands"?"/":"",s.name]}),s.description&&t.jsx("div",{className:"truncate text-fg-faint",children:s.description})]}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[t.jsx(B,{interactive:!1,scope:s.scope,input:{type:s.kind==="commands"?"command":"skill",name:s.name}}),((c=S[s.path])==null?void 0:c.dirty)&&t.jsx("span",{className:"w-1 h-1 rounded-full bg-accent"}),o&&t.jsx(_,{checked:!s.disabled,onChange:a=>void Y(s,!a)}),s.kind==="skills"&&t.jsx("button",{onClick:a=>{a.stopPropagation(),q(s)},title:"Remove skill — moves the folder to trash; reinstall from the Library","aria-label":`Remove ${s.name}`,className:"text-fg-faint hover:text-red-400 leading-none px-0.5",children:"✕"})]})]},s.path)})]},e)})]}),detail:r&&g?t.jsx("div",{className:"h-full",children:t.jsx(X,{path:r,value:g.draftRaw,onChange:e=>{y(null),H(r,e)}})}):t.jsx(R,{title:v.length===0?"no skills or commands":"select an item"})})})}const je=l.memo(le);export{je as Skills};
|
|
@@ -1 +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-Ceid3k5X.js";import{P as j}from"./Panel-CVgA2-Y3.js";import{S as L}from"./SaveBar-R1ZZ9WH5.js";import{M as w}from"./MarkdownEditor-DUoKh1Qr.js";import{f as P,V as v}from"./Library-BA8cOckT.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-Ceid3k5X.js";import{P as y}from"./Panel-CVgA2-Y3.js";import{L as T}from"./ListDetail-CVIhWPWb.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};
|