claude-code-session-manager 0.124.0 → 0.125.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-tsHX4uUD.js → AgentLibrary-CcnnJg8P.js} +1 -1
- package/dist/assets/{Button-BC94OZc0.js → Button-sA4lqAao.js} +1 -1
- package/dist/assets/{DataModel-DX3sReg5.js → DataModel-BSTejIBU.js} +1 -1
- package/dist/assets/{History-DtscQica.js → History-DuwlZsQ5.js} +1 -1
- package/dist/assets/{Hooks-CQERyV2Q.js → Hooks-DHDSoDJ_.js} +1 -1
- package/dist/assets/{Library-DGZ1bv-H.js → Library-XA9osRfi.js} +1 -1
- package/dist/assets/{ListDetail-C6JB9n9x.js → ListDetail-B3goE3Wc.js} +1 -1
- package/dist/assets/{McpServers-C5G8m3j2.js → McpServers-cMZTsPS6.js} +1 -1
- package/dist/assets/{Memory-KgM5KHiQ.js → Memory-D6qntpZ0.js} +1 -1
- package/dist/assets/{Panel-BsOgpYZG.js → Panel-DIyJXHfp.js} +1 -1
- package/dist/assets/{Permissions-DruyM6MH.js → Permissions-DJda4Aii.js} +1 -1
- package/dist/assets/{Plugins-BBWfU2sh.js → Plugins-DcdRVBnU.js} +2 -2
- package/dist/assets/{ProvenanceBadge-CyzjcuYD.js → ProvenanceBadge-BSI_2wAv.js} +1 -1
- package/dist/assets/{SaveBar-D5nZclkV.js → SaveBar-CeL4vXRp.js} +1 -1
- package/dist/assets/{Scheduler-BuxUAv-X.js → Scheduler-CTd19y5U.js} +1 -1
- package/dist/assets/{ScopeSwitcher-BFTsmyXK.js → ScopeSwitcher-BMiHySnz.js} +1 -1
- package/dist/assets/{Settings-CsU2wgPl.js → Settings-D-oIEKZy.js} +1 -1
- package/dist/assets/{SkillReferenceGraph-WTwaKQBk.js → SkillReferenceGraph-B_7WfFjn.js} +1 -1
- package/dist/assets/{Skills-DooJ8MqG.js → Skills-CKpgxhSS.js} +1 -1
- package/dist/assets/{SystemPrompt-DjWMf9Rk.js → SystemPrompt-BjJPTx_a.js} +1 -1
- package/dist/assets/{TagLibrary-DN8yO-eg.js → TagLibrary-DJBB4gL0.js} +1 -1
- package/dist/assets/{TiptapBody-DlbOZsU-.js → TiptapBody-C9Cu2GBL.js} +1 -1
- package/dist/assets/{Toggle-BgPR-zkl.js → Toggle-DbIRTOix.js} +1 -1
- package/dist/assets/{ViewTabs-Bsqxjjs8.js → ViewTabs-BDpHur6l.js} +1 -1
- package/dist/assets/{historyTotals-Dw4jn69k.js → historyTotals-WCJHsBMq.js} +1 -1
- package/dist/assets/{index-DCbAgcJt.js → index-BD0ufZqe.js} +3 -3
- package/dist/assets/{settingsSchema-Duk46cGB.js → settingsSchema-DmjBj3q7.js} +1 -1
- package/dist/assets/{skillFrontmatter-B8F8a18M.js → skillFrontmatter-Tn_XHajE.js} +1 -1
- package/dist/assets/{useAgentsDirWatch-0oP0fhBV.js → useAgentsDirWatch-Vz2iXtsQ.js} +1 -1
- package/dist/index.html +1 -1
- package/dist-web/assets/app.css +32 -0
- package/dist-web/assets/app.js +1479 -0
- package/dist-web/index.html +16 -0
- package/package.json +3 -3
- package/plugins/session-manager-dev/skills/builder/3-publish/SKILL.md +28 -10
- package/src/main/build-info.json +4 -4
- package/src/main/chatRunner.cjs +11 -5
- package/src/main/docEdit.cjs +8 -4
- package/src/main/ipcSchemas.cjs +4 -1
- package/src/main/lib/classifyPromptTicket.cjs +9 -4
- package/src/main/lib/claude/runClaudeP.cjs +7 -4
- package/src/main/lib/process/childStdin.cjs +39 -0
- package/src/main/lib/process/childWithLog.cjs +15 -1
- package/src/main/lib/scheduler/launchFailure.cjs +37 -1
- package/src/main/scheduler.cjs +111 -30
- package/src/main/supervisor.cjs +6 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ao as A,aB as y,ba as le,al as e,m as z,a as M,aT as $,aQ as de,V as ce,aS as fe,b3 as Q,M as me,c as _,E as xe}from"./index-
|
|
1
|
+
import{ao as A,aB as y,ba as le,al as e,m as z,a as M,aT as $,aQ as de,V as ce,aS as fe,b3 as Q,M as me,c as _,E as xe}from"./index-BD0ufZqe.js";import{P as he}from"./Panel-DIyJXHfp.js";import{L as pe}from"./ListDetail-B3goE3Wc.js";import{B as R}from"./Button-sA4lqAao.js";import{u as ue,t as ge,a as ve}from"./useAgentsDirWatch-Vz2iXtsQ.js";import{r as be}from"./claude-settings-schema-COigsajx.js";import"./monaco-editor-BsIlgG7c.js";const je=n=>{const[s,r]=n.split(".");return Number(s)+(r?Number(r)/100:0)};function we(n){const s=/Effort is supported on ([^.]*?)(?:, with|\.|$)/.exec(n);if(!s)return[];const r=[];for(const d of s[1].split(/,\s*|\s+and\s+/)){const o=/^(\w+)\s+(\d+(?:\.\d+)?)$/.exec(d.trim());o&&r.push({family:o[1].toLowerCase(),version:je(o[2])})}return r}var J,Y;const ye=we(String(((Y=(J=be.properties)==null?void 0:J.effortLevel)==null?void 0:Y.description)??""));function Ne(n,s){const r=new RegExp(`${s}-(\\d+)(?:-(\\d{1,2})(?!\\d))?`,"i").exec(n);if(r)return Number(r[1])+(r[2]?Number(r[2])/100:0);const d=new RegExp(`claude-(\\d+)(?:-(\\d{1,2}))?-${s}`,"i").exec(n);return d?Number(d[1])+(d[2]?Number(d[2])/100:0):null}function Ce(n,s=ye){if(!n||n==="inherit"||s.length===0)return null;const r=A(n);if(!r)return null;const d=s.filter(l=>l.family===r);if(d.length===0)return!1;const o=Ne(n,r);return o===null?null:o>=Math.min(...d.map(l=>l.version))}const U=["Read","Grep","Glob","Bash","Write","Edit","WebFetch","WebSearch","Task"],ke=["","red","orange","yellow","green","cyan","blue","purple","pink"],X={red:"#c0392b",orange:"#b85c34",yellow:"#c9a227",green:"#6f7d52",cyan:"#3f8f8a",blue:"#4a6fa5",purple:"#7a6a8a",pink:"#b45a80"};function G(n){return{name:n.name,description:n.description??"",tools:n.tools,model:n.model??"inherit",effort:n.effort??"inherit",color:n.color??"",tags:n.tags,body:n.body}}const q={name:"new-agent",description:"",tools:["Read","Grep"],model:"inherit",effort:"inherit",color:"",tags:[],body:""};function $e(n){return n.overridingProjects.map(s=>{var o;const r=(o=n.overrideDetails)==null?void 0:o.find(l=>l.project===s);if(!r)return s;const d=[...r.fields.filter(l=>l!=="name"),...r.bodyOverridden?["full body"]:[]];return`${s}: ${d.join(", ")||"overlay"}`}).join(`
|
|
2
2
|
`)}function Se(){const[n,s]=y.useState(null),[r,d]=y.useState(null),[o,l]=y.useState(""),[i,x]=y.useState(null),[L,h]=y.useState(!1),[w,v]=y.useState(!1),[N,u]=y.useState(null),[b,j]=y.useState(!1),E=y.useRef(!0);y.useEffect(()=>()=>{E.current=!1},[]);const a=le(t=>{var m;return((m=t.tabs.find(k=>k.id===t.activeTabId))==null?void 0:m.cwd)??null}),g=a?a.replace(/\/+$/,"").split("/").pop()||a:null,C=y.useRef(0),S=async t=>{const m=++C.current;try{const k=await window.api.agents.listPersonas();if(!E.current||C.current!==m)return;s(k),d(W=>{var P;return t??W??((P=k[0])==null?void 0:P.name)??null})}catch(k){if(!E.current||C.current!==m)return;s([]),$.error(k.message||"failed to load agent personas")}};if(y.useEffect(()=>{S()},[]),y.useEffect(()=>window.api.agents.onChanged(()=>S()),[]),ue(a,()=>S()),y.useEffect(()=>{const t=de();t&&d(t);const m=k=>d(k.detail);return window.addEventListener("sm:select-persona",m),()=>window.removeEventListener("sm:select-persona",m)},[]),n===null)return e.jsx(z,{title:"loading…"});const T=o.toLowerCase(),F=n.filter(t=>!T||t.name.toLowerCase().includes(T)||(t.description??"").toLowerCase().includes(T)),f=n.find(t=>t.name===r)??n[0]??null,c=i??(f?G(f):null),B=!!i&&!!f&&JSON.stringify(i)!==JSON.stringify(G(f)),O=L,I=t=>{x(null),h(!1),v(!1),u(null),d(t)},p=t=>x(m=>({...m??(f?G(f):q),...t})),V=()=>{x({...q}),h(!0),v(!1)},te=()=>{c&&(x({...c,name:c.name+"-copy"}),h(!0))},ne=()=>{x(null),h(!1)},se=async()=>{if(c){if(!/^[a-z][a-z0-9-]*$/.test(c.name)){$.error('agent name must be lowercase, hyphenated (e.g. "my-agent")');return}j(!0);try{const t=O?null:f,m={name:c.name,originalName:t==null?void 0:t.name,description:c.description,tools:c.tools,model:c.model,effort:c.effort,color:c.color,tags:ge(c.tags),body:c.body},k=t?ve(t,m):m;await window.api.agents.savePersona(k),$.info(O?`created ${c.name}`:`saved ${c.name}`),x(null),h(!1),await S(c.name)}catch(t){$.error(t.message||"failed to save agent persona")}finally{j(!1)}}},ae=async()=>{if(f){j(!0);try{await window.api.agents.deletePersona({name:f.name}),$.info(`deleted ${f.name}`),v(!1),x(null),h(!1),await S()}catch(t){$.error(t.message||"failed to delete agent persona")}finally{j(!1)}}},oe=async t=>{j(!0);try{await window.api.agents.deletePersona({name:t}),$.info(`deleted ${t}`),u(null),r===t&&(x(null),h(!1)),await S()}catch(m){$.error(m.message||"failed to delete agent persona")}finally{j(!1)}},re=async t=>{if(f)try{await window.api.agents.removeOverride({name:f.name,projectName:t}),$.info(`removed ${t}'s override of ${f.name}`),await S(f.name)}catch(m){$.error(m.message||"failed to remove override")}},ie=async t=>{if(!(!f||!g)){j(!0);try{t.model==="inherit"&&t.effort==="inherit"?(await window.api.agents.removeOverride({name:f.name,projectName:g}),$.info(`cleared ${g}'s override of ${f.name}`)):(await window.api.agents.savePersona({name:f.name,projectName:g,description:"",tools:[],color:"",tags:[],body:"",model:t.model,effort:t.effort}),$.info(`saved ${g}'s override of ${f.name}`)),await S(f.name)}catch(m){$.error(m.message||"failed to save project override")}finally{j(!1)}}};return e.jsx(he,{toolbar:e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-fg-faint",children:[n.length," persona",n.length===1?"":"s"]}),e.jsx("input",{value:o,onChange:t=>l(t.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(R,{variant:"primary",onClick:V,children:"+ New agent"})]}),children:e.jsx(pe,{sidebar:e.jsxs("div",{className:"py-1",children:[O&&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:c==null?void 0:c.name}),e.jsx("span",{className:"shrink-0 text-[10px] font-semibold text-accent",children:"new"})]})}),F.length===0&&!O?e.jsx("div",{className:"px-3 py-1 text-xs text-fg-faint italic",children:"no agent personas found"}):F.map(t=>{const m=!O&&t.name===r,k=m&&B,W=N===t.name;return e.jsxs("div",{"data-agent-row":t.name,className:`group w-full text-left px-3 py-1 text-xs flex flex-col gap-0.5 border-l-2 cursor-pointer ${m?"bg-bg-hi text-fg border-accent":"text-fg-dim hover:text-fg hover:bg-bg-hi border-transparent"}`,onClick:()=>I(t.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:t.color?X[t.color]??t.color:"var(--fg-faint, #999)",opacity:t.color?1:.35}}),e.jsx("span",{className:"truncate font-mono",children:t.name})]}),e.jsxs("span",{className:"shrink-0 flex items-center gap-1.5",children:[k&&e.jsx("span",{className:"text-[10px] font-semibold text-accent",children:"unsaved"}),!k&&t.overridingProjects.length>0&&e.jsx("span",{title:$e(t),children:e.jsxs(M,{tone:"dim",children:[t.overridingProjects.length," override",t.overridingProjects.length>1?"s":""]})}),W?e.jsxs("span",{className:"flex items-center gap-1",onClick:P=>P.stopPropagation(),children:[e.jsx("button",{onClick:()=>oe(t.name),disabled:b,title:`Delete ${t.name}`,className:"text-[10px] font-semibold text-red-400 hover:text-red-300",children:"confirm"}),e.jsx("button",{onClick:()=>u(null),title:"Cancel",className:"text-[10px] text-fg-faint hover:text-fg",children:"cancel"})]}):e.jsx("button",{onClick:P=>{P.stopPropagation(),u(t.name)},title:`Delete ${t.name}`,className:"opacity-0 group-hover:opacity-100 text-fg-faint hover:text-red-400 transition-opacity",children:"×"})]})]}),t.description&&e.jsx("span",{className:"truncate text-fg-faint",children:t.description})]},t.name)})]}),detail:c?e.jsx(Le,{obj:c,set:p,saved:f,dirty:B,isNew:O,busy:b,confirmDelete:w,setConfirmDelete:v,onDuplicate:te,onRevert:ne,onSave:se,onDelete:ae,onDropOverride:re,activeProject:g,onSaveOverride:ie}):e.jsx(z,{title:"select an agent"})})})}const Be=y.memo(Se);function Le({obj:n,set:s,saved:r,dirty:d,isNew:o,busy:l,confirmDelete:i,setConfirmDelete:x,onDuplicate:L,onRevert:h,onSave:w,onDelete:v,onDropOverride:N,activeProject:u,onSaveOverride:b}){const j=`~/.claude/agents/${n.name}.md`,E=d||o;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:n.name}),o?e.jsx(M,{tone:"accent",children:"unsaved draft"}):d?e.jsx(M,{tone:"warn",children:"edited"}):e.jsx(M,{tone:"good",children:"saved"}),e.jsx("span",{className:"ml-auto text-[11px] text-fg-faint font-mono",children:j})]}),e.jsxs("div",{className:"p-4 space-y-4",children:[e.jsx(D,{label:"name",hint:"Filename on disk — lowercase, hyphenated.",children:e.jsx("input",{value:n.name,onChange:a=>s({name:a.target.value.toLowerCase()}),className:"w-full bg-bg border border-line rounded px-2 py-1 text-xs text-fg font-mono"})}),e.jsx(D,{label:"description",hint:"Shown in the list and in agent pickers.",children:e.jsx("input",{value:n.description,onChange:a=>s({description:a.target.value}),className:"w-full bg-bg border border-line rounded px-2 py-1 text-xs text-fg"})}),e.jsx(Z,{value:n.model,onChange:a=>s({model:a})}),e.jsx(ee,{value:n.effort,model:n.model,onChange:a=>s({effort:a})}),!o&&r&&e.jsx(Ee,{saved:r,activeProject:u,busy:l,onSave:b}),e.jsx(D,{label:"tools",hint:`${n.tools.length} of ${U.length} granted. Anything not ticked is refused at call time.`,children:e.jsx("div",{className:"flex flex-wrap gap-1.5",children:U.map(a=>{const g=n.tools.includes(a);return e.jsx("button",{onClick:()=>s({tools:g?n.tools.filter(C=>C!==a):[...n.tools,a]}),className:`px-2 py-0.5 rounded-full text-[11px] font-mono border ${g?"bg-sage/15 text-sage-dark border-sage/30":"bg-bg-hi text-fg-faint border-line"}`,children:a},a)})})}),e.jsx(D,{label:"color",children:e.jsx("div",{className:"flex gap-1.5",children:ke.map(a=>e.jsx("button",{title:a||"none",onClick:()=>s({color:a}),className:"w-5 h-5 rounded",style:{background:a?X[a]:"transparent",border:n.color===a?"2px solid var(--accent, #b85c34)":"1px solid var(--line, #555)"}},a||"none"))})}),e.jsx(D,{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:ce.map(a=>{const g=n.tags.includes(a.tag),C=fe(a.tag);return e.jsxs("button",{onClick:()=>s({tags:g?n.tags.filter(S=>S!==a.tag):[...n.tags,a.tag]}),className:`px-2 py-0.5 rounded-full text-[11px] font-mono border ${g?`${C.bg} ${C.text} ${C.border?"border-current/30":"border-transparent"}`:"bg-bg-hi text-fg-faint border-line"}`,children:["#",a.tag]},a.tag)})})}),e.jsx(D,{label:"definition",hint:"The system prompt this persona runs under.",children:e.jsx("textarea",{rows:9,value:n.body,onChange:a=>s({body:a.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(D,{label:"project overrides",hint:"Open projects that shadow this definition with a local copy.",children:r&&r.overridingProjects.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:r.overridingProjects.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,e.jsx("button",{onClick:()=>N(a),title:"Drop the local copy",className:"text-fg-faint hover:text-fg",children:"×"})]},a))}):e.jsx("div",{className:"text-xs text-fg-faint italic",children:o?"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:i?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-xs text-fg-dim",children:["Delete ",e.jsx("strong",{className:"font-mono",children:n.name})," and its file?"]}),e.jsx(R,{variant:"danger",onClick:v,disabled:l,children:"Delete"}),e.jsx(R,{onClick:()=>x(!1),children:"Keep"})]}):e.jsxs(e.Fragment,{children:[e.jsx(R,{onClick:L,disabled:l,children:"Duplicate"}),!o&&e.jsx(R,{variant:"danger",onClick:()=>x(!0),disabled:l,children:"Delete"}),e.jsx("div",{className:"flex-1"}),E&&e.jsx("span",{className:"text-[11px] text-fg-faint",children:"unsaved changes"}),e.jsx(R,{onClick:h,disabled:!E||l,children:"Revert"}),e.jsx(R,{variant:"primary",onClick:w,disabled:!E||l,children:l?"Saving…":o?"Create":"Save"})]})})]})}function D({label:n,hint:s,children:r}){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:n}),r,s&&e.jsx("div",{className:"text-[11px] text-fg-faint mt-1 leading-snug",children:s})]})}const K="latest",H="Blocked by the availableModels allowlist in your Claude settings";function Z({value:n,onChange:s,label:r="default model",hint:d,testIdPrefix:o="",inheritLabel:l}){var O,I;const{catalog:i,loading:x,degraded:L,refresh:h}=Q(null),w=i?["inherit",...i.aliases]:[...me],v=(i==null?void 0:i.availableModels)??null,N=p=>!!v&&p!=="inherit"&&!v.includes(p),u=(p,V)=>!!v&&!v.includes(p)&&!(V&&v.includes(V)),b=n||"inherit",j=((O=/\[[^\]]*\]$/.exec(b))==null?void 0:O[0])??"",E=w.includes(b),a=!E&&i&&A(b)&&w.includes(A(b)+j)?A(b)+j:null,g=E?b:a??b,C=A(g),S=((I=/\[[^\]]*\]$/.exec(g))==null?void 0:I[0])??"",T=!!i&&b!=="inherit"&&!!C&&w.includes(g),F=T?i.models.filter(p=>A(p)===C).map(p=>p+S):[],f=E?K:b,c={};if(i)for(const p of w)N(p)&&(c[p]=H);const B={};for(const p of F)u(p,C)&&(B[p]=H);return e.jsxs(D,{label:r,hint:d??"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("div",{"data-testid":`${o}model-row`,children:e.jsx(_,{options:w,value:g,onChange:s,mono:!0,blocked:c,labels:l?{inherit:l}:void 0})}),T&&e.jsxs("div",{className:"mt-2","data-testid":`${o}model-version-row`,children:[e.jsx("div",{className:"text-[10.5px] text-fg-faint mb-1 font-mono",children:"version"}),e.jsx(_,{options:[K,...F],value:f,onChange:p=>s(p===K?g:p),mono:!0,blocked:B})]}),e.jsxs("div",{className:"text-[11px] text-fg-faint mt-1 leading-snug flex items-center gap-2",children:[e.jsx("span",{children:i?`Models are live-read from the installed claude CLI${L?" (cached — CLI probe unavailable)":""}. "latest" keeps the floating alias.`:x?"Loading model catalog…":"catalog unavailable — showing the standard list."}),e.jsx("button",{"data-testid":`${o}model-catalog-refresh`,onClick:()=>{h()},disabled:x,className:"underline text-fg-dim disabled:opacity-40",children:"refresh"})]})]})}function ee({value:n,model:s,onChange:r,label:d="effort",testIdPrefix:o="",inheritLabel:l}){const{catalog:i}=Q(null),x=i&&i.effortLevels.length?["inherit",...i.effortLevels]:[...xe],L=(i==null?void 0:i.settingsEffortLevels)??[],h=i?x.filter(N=>N!=="inherit"&&!L.includes(N)):[],w=n||"inherit",v=w!=="inherit"&&Ce(s)===!1;return e.jsxs(D,{label:d,hint:i?`Effort levels are live-read from the installed claude CLI (what /effort accepts). ${h.length?`${h.join(", ")} ${h.length>1?"are":"is"} session-only — settings.json accepts ${L.join(", ")}. `:""}'inherit' writes no effort: line.`:"catalog unavailable — showing the standard list. 'inherit' writes no effort: line.",children:[e.jsx("div",{"data-testid":`${o}effort-row`,children:e.jsx(_,{options:x,value:w,onChange:r,mono:!0,labels:l?{inherit:l}:void 0})}),h.length>0&&e.jsx("div",{className:"text-[11px] text-fg-faint mt-1 font-mono","data-testid":`${o}effort-session-only`,children:h.map(N=>`${N} (session-only)`).join(" · ")}),v&&e.jsx("div",{className:"text-[11px] text-amber-400 mt-1 leading-snug","data-testid":`${o}effort-unsupported-note`,children:"The selected model does not support effort — the CLI will ignore this setting."})]})}function Ee({saved:n,activeProject:s,busy:r,onSave:d}){var w,v,N;if(!s)return e.jsxs("div",{"data-testid":"project-override-none",className:"border border-dashed border-line rounded p-3 text-[11px] text-fg-faint",children:[e.jsx("div",{className:"text-[10.5px] font-semibold uppercase tracking-wide mb-1 font-mono",children:"project override"}),"No active project — open a project tab to override this persona's model or effort for that project only."]});const o=(w=n.overrideDetails)==null?void 0:w.find(u=>u.project===s),l=!!(o!=null&&o.bodyOverridden),i=((v=o==null?void 0:o.values)==null?void 0:v.model)??"inherit",x=((N=o==null?void 0:o.values)==null?void 0:N.effort)??"inherit",L=n.model??"inherit",h=n.effort??"inherit";return e.jsxs("div",{"data-testid":"project-override",className:"border border-accent/40 rounded p-3 space-y-3 bg-accent/5",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-[10.5px] font-semibold uppercase tracking-wide text-accent font-mono",children:"project override"}),e.jsxs(M,{tone:"accent",children:[s," only"]}),e.jsx("span",{className:"ml-auto text-[11px] text-fg-faint font-mono",children:`<project>/.claude/agents/${n.name}.md`})]}),e.jsxs("div",{className:"text-[11px] text-fg-faint leading-snug",children:["Changes what the SCHEDULER (and new Epics) spawn for ",e.jsx("strong",{children:s})," only — a frontmatter-only overlay with just the keys you set; the persona's body stays the global one. The global model/effort rows edit the machine-wide persona and are never touched here."]}),l&&e.jsxs("div",{"data-testid":"project-override-fullbody",className:"text-[11px] text-amber-400 leading-snug",children:[s,' already has a FULL-BODY override of this persona (its own definition text). It is shown as-is and not converted to a frontmatter-only overlay — edit that file directly, or drop it with × under "project overrides" below.']}),e.jsxs("fieldset",{disabled:r||l,className:"space-y-3 border-0 p-0 m-0 min-w-0",children:[e.jsx(Z,{value:i,onChange:u=>{l||d({model:u,effort:x})},label:"project model",hint:"'use global' writes no model: line in the overlay.",testIdPrefix:"override-",inheritLabel:"use global"}),e.jsx(ee,{value:x,model:i!=="inherit"?i:L,onChange:u=>{l||d({model:i,effort:u})},label:"project effort",testIdPrefix:"override-",inheritLabel:"use global"})]}),e.jsx("div",{"data-testid":"override-provenance",className:"text-[11px] font-mono text-fg-dim space-y-0.5",children:[["model",L,i],["effort",h,x]].map(([u,b,j])=>e.jsxs("div",{"data-testid":`override-provenance-${u}`,children:[u,": ",j!=="inherit"?e.jsxs(e.Fragment,{children:[b," ",e.jsx("span",{className:"text-fg-faint",children:"(global)"})," → ",e.jsx("span",{className:"text-accent",children:j})," ",e.jsx("span",{className:"text-fg-faint",children:"(this project)"})]}):e.jsxs(e.Fragment,{children:[b," ",e.jsx("span",{className:"text-fg-faint",children:"(global — not overridden)"})]})]},u))})]})}export{Be as AgentLibrary};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{al as o,X as l}from"./index-
|
|
1
|
+
import{al as o,X as l}from"./index-BD0ufZqe.js";function u({children:n,onClick:s,disabled:a,variant:e="default",tooltip:t,type:d="button",className:c}){const i=`px-2 py-0.5 text-xs rounded border transition-colors disabled:opacity-40 disabled:cursor-not-allowed ${e==="primary"?"text-accent border-accent/50 hover:bg-bg-hi":e==="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"} ${c??""}`,r=o.jsx("button",{type:d,title:t,onClick:s,disabled:a,className:i,children:n});return t?o.jsx(l,{content:t,align:"bottom-center",children:r}):r}export{u as B};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aB as d,i as j,am as $,a5 as g,al as e,m as N,ap as E,a6 as b,aF as S,a as f,a0 as T,j as v,h as D}from"./index-
|
|
1
|
+
import{aB as d,i as j,am as $,a5 as g,al as e,m as N,ap as E,a6 as b,aF as S,a as f,a0 as T,j as v,h as D}from"./index-BD0ufZqe.js";import{P as R}from"./Panel-DIyJXHfp.js";import{V}from"./ViewTabs-BDpHur6l.js";import"./monaco-editor-BsIlgG7c.js";const C=[{key:"diagram",label:"Diagram"},{key:"tables",label:"Tables"}];function G(){const[s,t]=d.useState("diagram"),[a,i]=d.useState(null),[l,n]=d.useState(()=>new Set),c=d.useMemo(()=>j.filter(r=>!l.has(r.group)),[l]),m=d.useMemo(()=>$(c),[c]),o=r=>{n(x=>{const h=new Set(x);return h.has(r)?h.delete(r):h.add(r),h}),i(null)},u=a?g(a):null,y=r=>c.some(x=>x.id===r);return e.jsx(R,{toolbar:e.jsxs(e.Fragment,{children:[e.jsx(V,{options:C,active:s,onChange:t}),e.jsx(M,{hiddenGroups:l,onToggle:o}),e.jsxs("span",{className:"ml-auto text-fg-faint",children:[j.length," entities"]})]}),children:s==="diagram"?e.jsxs("div",{className:"h-full flex",children:[e.jsx("div",{className:"flex-1 min-w-0 overflow-auto",children:e.jsx(O,{layout:m,selectedId:a,onSelect:r=>i(x=>x===r?null:r)})}),e.jsx("div",{className:"w-96 shrink-0 border-l border-line overflow-y-auto",children:u?e.jsx(F,{entity:u,onSelectRelated:r=>y(r)?i(r):void 0}):e.jsx(N,{title:"select an entity",hint:"click a box in the diagram to see its storage, fields, and relations"})})]}):e.jsx(B,{})})}const X=d.memo(G);function M({hiddenGroups:s,onToggle:t}){return e.jsx("div",{className:"flex items-center gap-1.5 flex-wrap",children:v.map(a=>{const i=s.has(a.id);return e.jsxs("button",{onClick:()=>t(a.id),title:`${a.blurb} (${a.realm})`,className:`flex items-center gap-1 px-1.5 py-0.5 rounded border text-[10.5px] ${i?"border-line text-fg-faint opacity-50":"border-line text-fg-dim hover:text-fg"}`,children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${a.tone.dot}`}),a.label,e.jsx("span",{className:"text-fg-faint",children:a.realm})]},a.id)})})}function O({layout:s,selectedId:t,onSelect:a}){const i=d.useMemo(()=>t?new Set(E(t)):null,[t]),l=n=>!!t&&(n.relation.from===t||n.relation.to===t);return s.boxes.length===0?e.jsx(N,{title:"no entities in view",hint:"toggle a group in the legend to show its entities"}):e.jsxs("div",{className:"relative p-4",style:{width:s.width+32,height:s.height+32},children:[e.jsxs("svg",{width:s.width,height:s.height,className:"absolute left-4 top-4 overflow-visible",children:[s.edges.map(n=>{const c=l(n);return e.jsx("path",{"data-testid":`erd-edge-${n.relation.from}-${n.relation.to}`,d:n.d,fill:"none",className:c?"stroke-accent":"stroke-line",strokeWidth:c?2:1,opacity:t&&!c?.25:1},`${n.relation.from}-${n.relation.to}-${n.relation.label}`)}),s.edges.map(n=>l(n)?e.jsx("text",{x:n.mx,y:n.my,textAnchor:"middle",className:"fill-fg-dim text-[10px]",children:n.relation.label},`label-${n.relation.from}-${n.relation.to}-${n.relation.label}`):null)]}),s.boxes.map(n=>e.jsx(_,{box:n,selected:n.id===t,dimmed:!!t&&n.id!==t&&!(i!=null&&i.has(n.id)),onClick:()=>a(n.id)},n.id))]})}function _({box:s,selected:t,dimmed:a,onClick:i}){const l=g(s.id),n=b(s.group),c=l.fields.slice(0,D),m=l.fields.length-c.length;return e.jsxs("button",{type:"button","data-testid":`erd-box-${s.id}`,onClick:i,className:`absolute text-left rounded border overflow-hidden bg-bg-hi ${t?"border-accent ring-1 ring-accent":"border-line"} ${a?"opacity-30":""}`,style:{left:s.x,top:s.y,width:s.w,height:s.h},children:[e.jsxs("div",{className:"px-2 py-1 border-b border-line flex items-center gap-1.5",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${n.tone.dot}`}),e.jsx("span",{className:"text-[11px] font-semibold text-fg truncate",children:l.name})]}),l.aka&&e.jsx("div",{className:"px-2 pt-0.5 text-[9.5px] text-fg-faint truncate",children:l.aka}),e.jsxs("div",{className:"px-2 py-0.5",children:[c.map(o=>e.jsxs("div",{className:"text-[9.5px] font-mono text-fg-dim truncate flex items-center gap-1",children:[o.key&&e.jsx("span",{className:"text-fg-faint",children:o.key}),e.jsx("span",{className:"truncate",children:o.name})]},o.name)),m>0&&e.jsxs("div",{className:"text-[9.5px] text-fg-faint italic",children:["+",m," more"]})]})]})}function w({fields:s}){return e.jsxs("table",{className:"w-full text-[11px] font-mono",children:[e.jsx("thead",{className:"text-fg-faint uppercase tracking-wide text-[9.5px]",children:e.jsxs("tr",{className:"border-b border-line",children:[e.jsx("th",{className:"text-left font-normal px-2 py-1",children:"name"}),e.jsx("th",{className:"text-left font-normal px-2 py-1",children:"type"}),e.jsx("th",{className:"text-left font-normal px-2 py-1",children:"key"}),e.jsx("th",{className:"text-left font-normal px-2 py-1",children:"note"})]})}),e.jsx("tbody",{children:s.map(t=>e.jsxs("tr",{className:"border-b border-line/50",children:[e.jsxs("td",{className:"px-2 py-1 text-fg",children:[t.name,t.optional&&e.jsx("span",{className:"text-fg-faint",children:"?"})]}),e.jsx("td",{className:"px-2 py-1 text-fg-dim",children:t.type}),e.jsx("td",{className:"px-2 py-1",children:t.key&&e.jsxs(f,{tone:t.key==="pk"?"accent":"dim",children:[t.key,t.ref?` → ${t.ref}`:""]})}),e.jsx("td",{className:"px-2 py-1 text-fg-faint",children:t.note})]},t.name))})]})}function k({entity:s}){return e.jsxs("div",{className:"space-y-1 text-[11px]",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-fg-faint w-20 shrink-0",children:"path"}),e.jsx("span",{className:"font-mono text-fg-dim break-all",children:s.store.path})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-fg-faint w-20 shrink-0",children:"format"}),e.jsx("span",{className:"font-mono text-fg-dim",children:s.store.format})]}),s.store.writer&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-fg-faint w-20 shrink-0",children:"writer"}),e.jsxs(f,{tone:"accent",children:["single-writer: ",s.store.writer]})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-fg-faint w-20 shrink-0",children:"definedIn"}),e.jsx("span",{className:"font-mono text-fg-dim break-all",children:s.store.definedIn})]})]})}function F({entity:s,onSelectRelated:t}){const a=b(s.group),i=S(s.id);return e.jsxs("div",{className:"p-3 space-y-3",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:`w-2 h-2 rounded-full ${a.tone.dot}`}),e.jsx("span",{className:"text-sm font-semibold text-fg",children:s.name})]}),s.aka&&e.jsx("div",{className:"text-[10.5px] text-fg-faint",children:s.aka}),e.jsx(f,{tone:"dim",className:"mt-1",children:a.label})]}),e.jsx("div",{className:"text-xs text-fg-dim leading-relaxed",children:s.summary}),e.jsxs("div",{children:[e.jsx(p,{children:"storage"}),e.jsx(k,{entity:s})]}),e.jsxs("div",{children:[e.jsx(p,{children:"fields"}),e.jsx(w,{fields:s.fields})]}),s.notes&&s.notes.length>0&&e.jsxs("div",{children:[e.jsx(p,{children:"notes"}),e.jsx("ul",{className:"list-disc pl-4 space-y-0.5 text-xs text-fg-dim",children:s.notes.map(l=>e.jsx("li",{children:l},l))})]}),e.jsxs("div",{children:[e.jsx(p,{children:"relations"}),i.length===0?e.jsx("div",{className:"text-xs text-fg-faint italic",children:"no relations"}):e.jsx("ul",{className:"space-y-1",children:i.map(l=>{const n=l.from===s.id?l.to:l.from,c=g(n);return e.jsxs("li",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:"font-mono text-fg-faint w-10 shrink-0",children:T(l.cardinality)}),e.jsx("span",{className:"text-fg-dim",children:l.label}),l.via&&e.jsxs("span",{className:"font-mono text-[10px] text-fg-faint",children:["via ",l.via]}),e.jsx("button",{type:"button",onClick:()=>t(n),className:"ml-auto text-accent hover:underline font-mono",children:c.name})]},`${l.from}-${l.to}-${l.label}`)})})]})]})}function p({children:s}){return e.jsx("div",{className:"text-[10.5px] uppercase tracking-wide text-fg-faint mb-1 font-mono",children:s})}function B(){return e.jsx("div",{className:"p-4 space-y-6",children:v.map(s=>{const t=j.filter(a=>a.group===s.id);return t.length===0?null:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[e.jsx("span",{className:`w-2 h-2 rounded-full ${s.tone.dot}`}),e.jsx("span",{className:"text-xs font-semibold text-fg",children:s.label}),e.jsx("span",{className:"text-[10.5px] text-fg-faint",children:s.realm})]}),e.jsx("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-3",children:t.map(a=>e.jsxs("div",{className:"border border-line rounded bg-bg-hi p-3 space-y-2",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-semibold text-fg",children:a.name}),a.aka&&e.jsx("span",{className:"text-[10.5px] text-fg-faint",children:a.aka})]}),e.jsx(f,{tone:"dim",className:"mt-1",children:s.label})]}),e.jsx("div",{className:"text-xs text-fg-dim leading-relaxed",children:a.summary}),e.jsx(k,{entity:a}),e.jsx(w,{fields:a.fields}),a.notes&&a.notes.length>0&&e.jsx("ul",{className:"list-disc pl-4 space-y-0.5 text-xs text-fg-dim",children:a.notes.map(i=>e.jsx("li",{children:i},i))})]},a.id))})]},s.id)})})}export{X as DataModel};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{av as xe,aE as Ke,bh as ze,al as e,aB as x,aT as q,aw as A,ax as L,bb as Ve,b2 as Ye,ba as ye,aq as Xe,b1 as qe,m as Qe}from"./index-
|
|
1
|
+
import{av as xe,aE as Ke,bh as ze,al as e,aB as x,aT as q,aw as A,ax as L,bb as Ve,b2 as Ye,ba as ye,aq as Xe,b1 as qe,m as Qe}from"./index-BD0ufZqe.js";import{P as Ze}from"./Panel-DIyJXHfp.js";import{p as Ee,i as O,m as De,t as I,u as E,f as Je}from"./historyTotals-WCJHsBMq.js";import"./monaco-editor-BsIlgG7c.js";function ce(){return{promptCount:0,inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheCreationTokens:0,toolCallCount:0,sessionCount:0,errorCount:0,activeMinutes:0,estimatedCostUsd:0}}function Ce(t,s){t.promptCount+=s.promptCount,t.inputTokens+=s.inputTokens,t.outputTokens+=s.outputTokens,t.cacheReadTokens+=s.cacheReadTokens,t.cacheCreationTokens+=s.cacheCreationTokens,t.toolCallCount+=s.toolCallCount,t.sessionCount+=s.sessionCount,t.errorCount+=s.errorCount,t.activeMinutes+=s.activeMinutes,t.estimatedCostUsd+=s.estimatedCostUsd}function et(t){return t.promptCount>0||t.sessionCount>0||t.toolCallCount>0||t.inputTokens>0||t.outputTokens>0}function tt(t,s){const n=s===null,r=[],o=ce(),i={};let a=0;for(const c of t.days){const u=ce();let d=!1;for(const[l,p]of Object.entries(c.byProject))if(!(!n&&!s.has(l))){Ce(u,p),Ce(o,p),et(p)&&(d=!0);for(const[m,v]of Object.entries(p.byModel)){const k=i[m]??(i[m]={inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheCreationTokens:0,costUsd:0});k.inputTokens+=v.inputTokens,k.outputTokens+=v.outputTokens,k.cacheReadTokens+=v.cacheReadTokens,k.cacheCreationTokens+=v.cacheCreationTokens,k.costUsd+=v.costUsd,v.estimated&&(k.estimated=!0)}}d&&(a+=1),r.push({date:c.date,totals:u})}return{days:r,totals:o,prevTotals:n?t.prevTotals:ce(),prevAvailable:n,byModelTotals:i,activeDays:a}}function Ue(t,s){if(!s)return{pct:null,direction:"flat"};const n=(t-s)/s*100,r=n>0?"up":n<0?"down":"flat";return{pct:n,direction:r}}function st(t,s,n){return s<=0?0:t/s*n}const nt=["promptCount","inputTokens","outputTokens","cacheReadTokens","cacheCreationTokens","toolCallCount","sessionCount","errorCount","activeMinutes","estimatedCostUsd"],ot=["inputTokens","outputTokens","cacheReadTokens","cacheCreationTokens","costUsd"];function Ne(t){const s={promptCount:0,inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheCreationTokens:0,toolCallCount:0,sessionCount:0,errorCount:0,activeMinutes:0,estimatedCostUsd:0,byModel:{}},n=r=>typeof r=="number"&&Number.isFinite(r)?r:0;for(const r of t){for(const o of nt)s[o]+=n(r[o]);for(const[o,i]of Object.entries(r.byModel??{})){const a=s.byModel[o]??(s.byModel[o]={inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheCreationTokens:0,costUsd:0});for(const c of ot)a[c]+=n(i==null?void 0:i[c])}}return s}const Pe={in:"In tokens",out:"Out tokens",total:"Total tokens",prompts:"Prompts",sessions:"Sessions",time:"Time",spend:"Spend"};function $(t,s){const n=t.inputTokens+t.cacheReadTokens+t.cacheCreationTokens;switch(s){case"in":return n;case"out":return t.outputTokens;case"total":return n+t.outputTokens;case"prompts":return t.promptCount;case"sessions":return t.sessionCount;case"time":return t.activeMinutes;case"spend":return t.estimatedCostUsd}}function at(t,s){const n=$(t.totals,s),r=t.prevAvailable?Ue(n,$(t.prevTotals,s)):null,o=t.days.map(i=>$(i.totals,s));return{value:n,delta:r,series:o}}function Te(t,s){const n=new Map,r=Math.ceil(t.length/2);t.forEach((a,c)=>{for(const[u,d]of Object.entries(a.byProject)){let l=n.get(u);l||(l={totals:{promptCount:0,inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheCreationTokens:0,toolCallCount:0,sessionCount:0,errorCount:0,activeMinutes:0,estimatedCostUsd:0},toolBreakdown:{},firstHalf:0,secondHalf:0},n.set(u,l)),l.totals.promptCount+=d.promptCount,l.totals.inputTokens+=d.inputTokens,l.totals.outputTokens+=d.outputTokens,l.totals.cacheReadTokens+=d.cacheReadTokens,l.totals.cacheCreationTokens+=d.cacheCreationTokens,l.totals.toolCallCount+=d.toolCallCount,l.totals.sessionCount+=d.sessionCount,l.totals.errorCount+=d.errorCount,l.totals.activeMinutes+=d.activeMinutes,l.totals.estimatedCostUsd+=d.estimatedCostUsd;for(const[m,v]of Object.entries(d.toolBreakdown))l.toolBreakdown[m]=(l.toolBreakdown[m]??0)+v;const p=$(d,s);c<r?l.firstHalf+=p:l.secondHalf+=p}});const o=Array.from(n.entries()).map(([a,c])=>{let u="",d=-1;for(const[l,p]of Object.entries(c.toolBreakdown))p>d&&(d=p,u=l);return{projectDir:a,value:$(c.totals,s),sharePct:0,trend:Ue(c.secondHalf,c.firstHalf),sessions:c.totals.sessionCount,topTool:u}}),i=o.reduce((a,c)=>a+c.value,0);for(const a of o)a.sharePct=i>0?a.value/i*100:0;return o.sort((a,c)=>c.value-a.value)}const rt=["date","cost_usd","input_tokens","output_tokens","cache_write_tokens","cache_read_tokens","total_tokens","cache_hit_pct","num_models","top_model"];function ct(t){return/[",\n]/.test(t)?`"${t.replace(/"/g,'""')}"`:t}function we(t){return t.inputTokens+t.outputTokens+t.cacheReadTokens+t.cacheCreationTokens}function it(t){const s=t.map(n=>{const r=n.inputTokens+n.outputTokens+n.cacheCreationTokens+n.cacheReadTokens,o=n.inputTokens+n.cacheReadTokens+n.cacheCreationTokens,i=o>0?n.cacheReadTokens/o*100:0,a=Object.entries(n.byModel).filter(([,l])=>we(l)>0);let c="",u=-1;for(const[l,p]of a){const m=we(p);m>u&&(u=m,c=l)}return[n.date,n.costUsd.toFixed(4),String(n.inputTokens),String(n.outputTokens),String(n.cacheCreationTokens),String(n.cacheReadTokens),String(r),i.toFixed(1),String(a.length),c?xe(c):""].map(ct).join(",")});return[rt.join(","),...s].join(`
|
|
2
2
|
`)}const lt={folderCount:0,sessionCount:0,promptCount:0,estimatedCostUsd:0,totalTokens:0};function dt(t,s){t.promptCount+=s.promptCount,t.inputTokens+=s.inputTokens,t.outputTokens+=s.outputTokens,t.cacheReadTokens+=s.cacheReadTokens,t.cacheCreationTokens+=s.cacheCreationTokens,t.toolCallCount+=s.toolCallCount,t.sessionCount+=s.sessionCount,t.errorCount+=s.errorCount,t.activeMinutes+=s.activeMinutes,t.estimatedCostUsd+=s.estimatedCostUsd;for(const[n,r]of Object.entries(s.toolBreakdown??{}))t.toolBreakdown[n]=(t.toolBreakdown[n]??0)+r;for(const[n,r]of Object.entries(s.byModel??{})){const o=t.byModel[n]??(t.byModel[n]={inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheCreationTokens:0,costUsd:0});o.inputTokens+=r.inputTokens,o.outputTokens+=r.outputTokens,o.cacheReadTokens+=r.cacheReadTokens,o.cacheCreationTokens+=r.cacheCreationTokens,o.costUsd+=r.costUsd,r.estimated&&(o.estimated=!0)}}function ut(t,s){const n={};for(const[r,o]of Object.entries(t.byModel??{}))n[r]={...o};return{...t,projectDir:s,toolBreakdown:{...t.toolBreakdown??{}},byModel:n}}function ft(t,s){const n={...lt},r=new Set,o=t.map(i=>{const a={};for(const[c,u]of Object.entries(i.byProject)){const d=s[c];if(!d){r.add(c),n.sessionCount+=u.sessionCount,n.promptCount+=u.promptCount,n.estimatedCostUsd+=u.estimatedCostUsd,n.totalTokens+=u.inputTokens+u.outputTokens;continue}const l=a[d];l?dt(l,u):a[d]=ut(u,d)}return{...i,byProject:a}});return n.folderCount=r.size,{days:o,excluded:n}}function xt(t){return t.folderCount>0}function pt(t){const s=[`${t.folderCount} transcript folder${t.folderCount===1?"":"s"} with no resolvable working directory`];return t.sessionCount&&s.push(`${t.sessionCount.toLocaleString()} sessions`),t.promptCount&&s.push(`${t.promptCount.toLocaleString()} prompts`),t.estimatedCostUsd>=.005&&s.push(`$${t.estimatedCostUsd.toFixed(2)}`),`Excluded: ${s.join(" · ")}`}async function pe(){return(await Ke()).history??{}}let Re=Promise.resolve();function ue(t){const s=Re.then(async()=>{const n=await pe();await ze({history:{...n,...t}})});return Re=s.catch(()=>{}),s}const ht=["in","out","total","prompts","sessions","time","spend"],mt=[{value:30,label:"30d"},{value:60,label:"60d"},{value:90,label:"90d"},{value:0,label:"All time"}];function Me({value:t,options:s,onChange:n}){return e.jsx("div",{className:"flex gap-0.5 p-0.5 rounded bg-bg-elev shadow-[inset_0_0_0_1px_rgba(0,0,0,0.06)] text-[11px]",children:s.map(r=>e.jsx("button",{onClick:()=>n(r.value),className:`px-2 py-1 rounded whitespace-nowrap font-mono ${t===r.value?"bg-bg-hi text-fg shadow-sm":"text-fg-faint hover:text-fg"}`,children:r.label},String(r.value)))})}function jt({measure:t,onMeasure:s,range:n,onRange:r,projectsShown:o,projectsTotal:i,fromDate:a,toDate:c,onRefresh:u,onExport:d,exportDisabled:l}){return e.jsxs("div",{className:"sticky top-0 z-10 border-b border-line px-4 py-2.5 flex flex-wrap items-center gap-3 backdrop-blur-sm",style:{backgroundColor:"rgba(246,239,225,0.93)"},children:[e.jsx(Me,{value:t,options:ht.map(p=>({value:p,label:Pe[p]})),onChange:s}),e.jsx(Me,{value:n,options:mt,onChange:r}),e.jsxs("span",{className:"text-[11px] text-fg-faint font-mono",children:[o," / ",i," projects"]}),e.jsxs("span",{className:"text-[11px] text-fg-faint font-mono",children:[a," → ",c]}),e.jsx("div",{className:"flex-1"}),e.jsx("button",{onClick:u,className:"px-2 py-1 text-[11px] border border-line rounded hover:text-fg hover:bg-bg-hi text-fg-faint",title:"Re-fetch the rollup (no scan)",children:"↻ Refresh"}),e.jsx("button",{onClick:d,disabled:l,className:"px-2 py-1 text-[11px] border border-line rounded hover:text-fg hover:bg-bg-hi text-fg-faint disabled:opacity-40 disabled:pointer-events-none",children:"Export CSV"})]})}const T="rounded-card bg-bg-hi border border-line",gt="#ded2bd",bt="#6f7d52";function R({kicker:t,title:s,right:n}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-3 mb-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-[10.5px] uppercase tracking-wider text-accent font-mono",children:t}),e.jsx("h2",{className:"font-serif text-[25px] leading-tight tracking-tight text-fg",children:s})]}),n]})}function Q(t,s){switch(t){case"spend":return E(s);case"in":case"out":case"total":return I(s);case"time":return De(s);default:return O(s)}}function vt({measure:t,headline:s,activeDays:n,projectsTouched:r,totalSessions:o}){const i=n>0?s.value/n:0,a=o>0?s.value/o:0,{delta:c}=s,u=c&&(t==="spend"?c.direction==="down":c.direction==="up"),d=c&&c.direction!=="flat"&&(t==="spend"?c.direction==="up":c.direction==="down"),l=u?"text-delta-good":d?"text-delta-bad":"text-fg-faint";return e.jsxs("div",{className:`${T} p-4`,children:[e.jsx(R,{kicker:"01 · overview",title:Pe[t]}),e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-[52px] leading-none font-mono tracking-tight text-fg",children:Q(t,s.value)}),c?e.jsxs("div",{className:`text-xs font-mono mt-2 ${l}`,children:[c.direction==="up"?"▲":c.direction==="down"?"▼":"·"," ",Ee(Math.abs(c.pct??0))," vs prior period"]}):e.jsx("div",{className:"text-xs text-fg-faint mt-2",children:"no prior window to compare"})]}),e.jsx("div",{className:"flex-1 min-w-0 self-stretch",children:e.jsx(kt,{series:s.series})})]}),e.jsxs("div",{className:"grid grid-cols-4 gap-3 mt-4 pt-3 border-t border-line",children:[e.jsx(X,{label:"per active day",value:Q(t,i)}),e.jsx(X,{label:"per session",value:Q(t,a)}),e.jsx(X,{label:"active days",value:O(n)}),e.jsx(X,{label:"projects touched",value:O(r)})]})]})}function X({label:t,value:s}){return e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] text-fg-faint uppercase tracking-wider",children:t}),e.jsx("div",{className:"text-[17px] font-mono tracking-tight text-fg-dim",children:s})]})}function kt({series:t}){if(t.length<2)return null;const r=Math.max(...t,0),o=Math.min(...t,0),i=r-o||1,a=160/(t.length-1),c=t.map((d,l)=>`${l*a},${48-(d-o)/i*48}`).join(" "),u=`0,48 ${c} 160,48`;return e.jsxs("svg",{viewBox:"0 0 160 48",preserveAspectRatio:"none",className:"w-full h-full min-h-[48px]",children:[e.jsx("polygon",{points:u,fill:"#b85c34",opacity:.15}),e.jsx("polyline",{points:c,fill:"none",stroke:"#b85c34",strokeWidth:1.5,vectorEffect:"non-scaling-stroke"})]})}const yt=50;function Ct({days:t}){const[s,n]=x.useState(yt),r=x.useRef(!1);x.useEffect(()=>{let d=!1;return pe().then(l=>{d||r.current||typeof l.budgetCapUsd=="number"&&Number.isFinite(l.budgetCapUsd)&&l.budgetCapUsd>0&&n(l.budgetCapUsd)}),()=>{d=!0}},[]);const o=d=>{r.current=!0;const l=s;n(d),ue({budgetCapUsd:d}).catch(()=>{n(l),q.error("Couldn't save the budget cap — reverted.")})},{mtdSpend:i,projectedSpend:a}=x.useMemo(()=>{const d=new Date,l=d.toLocaleDateString("en-CA").slice(0,7),p=new Date(d.getFullYear(),d.getMonth()+1,0).getDate(),m=d.getDate();let v=0;for(const k of t)if(k.date.startsWith(l))for(const M of Object.values(k.byProject))v+=M.estimatedCostUsd;return{mtdSpend:v,projectedSpend:st(v,m,p)}},[t]),c=a>s,u=s>0?Math.min(100,i/s*100):0;return e.jsxs("div",{className:`${T} p-3`,children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("h3",{className:"text-[10.5px] uppercase tracking-wider text-fg-faint font-mono",children:"Monthly budget"}),e.jsxs("label",{className:"flex items-center gap-1.5 text-[10px] text-fg-faint",children:["cap",e.jsx("span",{children:"$"}),e.jsx("input",{type:"number",min:1,step:1,value:s,onChange:d=>{const l=Number(d.target.value);Number.isFinite(l)&&l>0&&o(l)},className:"w-16 bg-bg border border-line rounded px-1.5 py-0.5 text-xs text-fg font-mono"})]})]}),e.jsxs("div",{className:"flex items-center gap-4 text-xs font-mono mb-1.5",children:[e.jsxs("span",{className:"text-fg",children:[E(i)," ",e.jsx("span",{className:"text-fg-faint",children:"month-to-date"})]}),e.jsxs("span",{className:c?"text-delta-bad":"text-fg-dim",children:[E(a)," ",e.jsx("span",{className:"text-fg-faint",children:"projected"})]})]}),e.jsx("div",{className:"h-1.5 rounded bg-bg-hi overflow-hidden",children:e.jsx("div",{className:`h-full ${c?"bg-delta-bad":"bg-sage"}`,style:{width:`${Math.max(u,u>0?2:0)}%`}})}),e.jsx("div",{className:`text-[10px] mt-1 font-mono ${c?"text-delta-bad":"text-fg-faint"}`,children:c?`projected to exceed $${s.toFixed(0)} cap`:`${u.toFixed(0)}% of $${s.toFixed(0)} cap`})]})}function Nt({chips:t,keep:s,onToggle:n,onIsolate:r,onShowAll:o}){const i=s===null;return e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.jsxs("button",{onClick:o,className:`px-2 py-1 rounded text-[11px] font-mono border ${i?"bg-accent text-white border-accent":"border-line text-fg-faint hover:text-fg hover:bg-bg-hi"}`,children:["show all (",t.length,")"]}),t.map(a=>{const c=i||s.has(a.projectDir);return e.jsxs("button",{onClick:u=>u.shiftKey?r(a.projectDir):n(a.projectDir),title:a.projectDir,className:`inline-flex items-center gap-1.5 px-2 py-1 rounded text-[11px] font-mono border ${c?"border-line text-fg-dim bg-bg-hi":"border-line text-fg-faint opacity-40 hover:opacity-70"}`,children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full shrink-0",style:{backgroundColor:A(a.projectDir)}}),L(a.projectDir)]},a.projectDir)})]})}function Tt(t,s){const n=new Map;for(const o of t)for(const[i,a]of Object.entries(o.values))n.set(i,(n.get(i)??0)+a);const r=Array.from(n.entries()).sort((o,i)=>i[1]-o[1]).map(([o])=>o);return t.map(o=>{const i=r.reduce((u,d)=>u+(o.values[d]??0),0);let a=0;const c=r.map(u=>{const d=o.values[u]??0;if(i<=0)return{projectDir:u,value:d,y0:0,y1:0};const l=s==="share"?d/i:d,p=a,m=a+l;return a=m,{projectDir:u,value:d,y0:p,y1:m}});return{date:o.date,bands:c,total:i}})}const ie=720,le=220,de=44,wt=20;function Rt(t,s){return t==="spend"?E(s):I(s)}function Mt({days:t,measure:s,selected:n,onSelect:r}){const[o,i]=x.useState("absolute"),a=x.useMemo(()=>Tt(t,o),[t,o]),c=x.useMemo(()=>{if(o==="share")return 1;let h=0;for(const g of a)h=Math.max(h,g.total);return h||1},[a,o]),u=ie-de,d=le-wt,l=a.length>1?u/(a.length-1):u,p=h=>de+h*l,m=h=>d-h/c*d,v=Math.max(1,Math.ceil(a.length/8)),k=4,M=Array.from({length:k+1},(h,g)=>c/k*g);return e.jsxs("div",{className:`${T} p-4`,children:[e.jsx(R,{kicker:"02 · over time",title:"Trend by project",right:e.jsx("div",{className:"flex border border-line rounded overflow-hidden text-[10px] font-mono",children:["absolute","share"].map(h=>e.jsx("button",{onClick:()=>i(h),className:`px-2 py-0.5 ${o===h?"bg-accent text-white":"text-fg-faint hover:text-fg"}`,children:h},h))})}),e.jsxs("svg",{width:"100%",viewBox:`0 0 ${ie} ${le}`,className:"overflow-visible",children:[M.map((h,g)=>e.jsxs("g",{children:[e.jsx("line",{x1:de,x2:ie,y1:m(h),y2:m(h),stroke:"currentColor",className:"text-line",strokeWidth:1}),e.jsx("text",{x:0,y:m(h)+3,fontSize:9,className:"fill-fg-faint",children:o==="share"?`${Math.round(h*100)}%`:Rt(s,h)})]},g)),a.map((h,g)=>{if(g===0)return null;const D=a[g-1];return h.bands.map((j,J)=>{const G=D.bands[J],W=n!==null&&n!==j.projectDir,ee=W?gt:A(j.projectDir),te=[`${p(g-1)},${m(G.y0)}`,`${p(g)},${m(j.y0)}`,`${p(g)},${m(j.y1)}`,`${p(g-1)},${m(G.y1)}`].join(" ");return e.jsx("polygon",{points:te,fill:ee,opacity:W?.6:.75,className:"cursor-pointer",onClick:()=>r(n===j.projectDir?null:j.projectDir),children:e.jsx("title",{children:L(j.projectDir)})},`${j.projectDir}-${g}`)})}),a.map((h,g)=>g%v!==0&&g!==a.length-1?null:e.jsx("text",{x:p(g),y:le-4,fontSize:9,textAnchor:"middle",className:"fill-fg-faint",children:h.date.slice(5)},h.date))]})]})}function St({rows:t,measure:s,selected:n,onSelect:r}){return t.length?e.jsxs("div",{className:`${T} overflow-hidden`,children:[e.jsx("div",{className:"p-4 pb-0",children:e.jsx(R,{kicker:"03 · by project",title:"Ranking"})}),e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{className:"bg-bg-elev",children:e.jsx("tr",{children:["project","share","value","share %","trend","sessions","top tool"].map(o=>e.jsx("th",{className:"text-left px-3 py-2 text-fg-faint uppercase tracking-wider whitespace-nowrap",children:o},o))})}),e.jsx("tbody",{children:t.map(o=>{const i=A(o.projectDir),a=n===o.projectDir;return e.jsxs("tr",{onClick:()=>r(o.projectDir),className:`border-t border-line hover:bg-bg-elev cursor-pointer ${a?"bg-bg-elev":""}`,children:[e.jsx("td",{className:"px-3 py-2 font-mono text-fg-dim",children:e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full shrink-0",style:{backgroundColor:i}}),L(o.projectDir)]})}),e.jsx("td",{className:"px-3 py-2 w-32",children:e.jsx("div",{className:"h-1.5 rounded bg-bg-hi overflow-hidden",children:e.jsx("div",{className:"h-full",style:{width:`${Math.max(o.sharePct,o.sharePct>0?2:0)}%`,backgroundColor:i}})})}),e.jsx("td",{className:"px-3 py-2 text-fg-faint font-mono",children:Q(s,o.value)}),e.jsxs("td",{className:"px-3 py-2 text-fg-faint font-mono",children:[o.sharePct.toFixed(1),"%"]}),e.jsx("td",{className:"px-3 py-2 font-mono",children:o.trend.pct===null?e.jsx("span",{className:"text-fg-faint",children:"—"}):e.jsxs("span",{className:o.trend.direction==="up"?"text-delta-good":o.trend.direction==="down"?"text-delta-bad":"text-fg-faint",children:[o.trend.direction==="up"?"▲":o.trend.direction==="down"?"▼":"·"," ",Ee(Math.abs(o.trend.pct))]})}),e.jsx("td",{className:"px-3 py-2 text-fg-faint font-mono",children:O(o.sessions)}),e.jsx("td",{className:"px-3 py-2 text-fg-faint font-mono",children:o.topTool||"—"})]},o.projectDir)})})]})]}):e.jsxs("div",{className:`${T} p-4`,children:[e.jsx(R,{kicker:"03 · by project",title:"Ranking"}),e.jsx("div",{className:"text-xs text-fg-faint",children:"no projects in range"})]})}function $t({projectDir:t,totals:s,byModel:n,toolBreakdown:r,onClear:o}){var l;const i=$(s,"in"),a=$(s,"out"),c=Object.entries(n).sort((p,m)=>m[1].costUsd-p[1].costUsd),u=Object.entries(r).sort((p,m)=>m[1]-p[1]),d=((l=u[0])==null?void 0:l[1])??0;return e.jsxs("div",{className:`${T} p-4`,children:[e.jsx(R,{kicker:"04 · drill in",title:L(t),right:e.jsx("button",{onClick:o,className:"text-[11px] text-fg-faint hover:text-fg font-mono",children:"clear ✕"})}),e.jsx("div",{className:"flex items-center gap-1.5 -mt-2 mb-3",children:e.jsx("span",{className:"w-1.5 h-1.5 rounded-full shrink-0",style:{backgroundColor:A(t)}})}),e.jsxs("div",{className:"grid grid-cols-6 gap-3 mb-4",children:[e.jsx(H,{label:"prompts",value:O(s.promptCount)}),e.jsx(H,{label:"sessions",value:O(s.sessionCount)}),e.jsx(H,{label:"in tokens",value:I(i)}),e.jsx(H,{label:"out tokens",value:I(a)}),e.jsx(H,{label:"spend",value:E(s.estimatedCostUsd)}),e.jsx(H,{label:"time",value:De(s.activeMinutes)})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] text-fg-faint uppercase tracking-wider mb-1.5",children:"model mix"}),c.length===0?e.jsx("div",{className:"text-xs text-fg-faint",children:"no model data"}):e.jsx("div",{className:"space-y-1",children:c.map(([p,m])=>e.jsxs("div",{className:"flex items-center justify-between text-[11px] font-mono text-fg-dim",children:[e.jsx("span",{children:xe(p)}),e.jsx("span",{className:"text-fg-faint",children:E(m.costUsd)})]},p))})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] text-fg-faint uppercase tracking-wider mb-1.5",children:"tool mix"}),u.length===0?e.jsx("div",{className:"text-xs text-fg-faint",children:"no tool data"}):e.jsx("div",{className:"space-y-1",children:u.slice(0,6).map(([p,m])=>e.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[e.jsx("span",{className:"w-20 shrink-0 truncate text-fg-dim font-mono",children:p}),e.jsx("div",{className:"flex-1 h-1.5 rounded bg-bg-hi overflow-hidden",children:e.jsx("div",{className:"h-full bg-hive-teal",style:{width:`${d>0?m/d*100:0}%`}})}),e.jsx("span",{className:"text-fg-faint font-mono w-8 text-right",children:m})]},p))})]})]})]})}function H({label:t,value:s}){return e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] text-fg-faint uppercase tracking-wider",children:t}),e.jsx("div",{className:"text-[17px] font-mono tracking-tight text-fg",children:s})]})}function Et({byModelTotals:t}){const s=Object.entries(t).sort((r,o)=>o[1].costUsd-r[1].costUsd),n=s.reduce((r,[,o])=>r+o.costUsd,0);return e.jsxs("div",{className:`${T} p-4`,children:[e.jsx(R,{kicker:"05 · composition",title:"Model mix",right:e.jsxs("span",{className:"text-xs font-mono text-fg-faint",children:[E(n)," total"]})}),s.length===0?e.jsx("div",{className:"text-xs text-fg-faint",children:"no model data in range"}):e.jsx("div",{className:"space-y-2",children:s.map(([r,o])=>{const i=n>0?o.costUsd/n*100:0,a=A(r);return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between text-xs mb-0.5",children:[e.jsxs("span",{className:"flex items-center gap-1.5 font-mono text-fg-dim truncate",children:[e.jsx("span",{className:"w-2 h-2 rounded-sm shrink-0",style:{backgroundColor:a}}),xe(r),o.estimated&&e.jsx("span",{className:"text-fg-faint",children:"(est.)"})]}),e.jsxs("span",{className:"text-fg-faint whitespace-nowrap ml-2",children:[E(o.costUsd)," · ",i.toFixed(0),"%"]})]}),e.jsx("div",{className:"h-1.5 rounded bg-bg-hi overflow-hidden",children:e.jsx("div",{className:"h-full",style:{width:`${Math.max(i,i>0?2:0)}%`,backgroundColor:a}})})]},r)})})]})}function Dt({rows:t}){const s=t.slice(0,3),n=s.reduce((i,a)=>i+a.sharePct,0),r=t.slice(3),o=r.reduce((i,a)=>i+a.sharePct,0);return e.jsxs("div",{className:`${T} p-4`,children:[e.jsx(R,{kicker:"05 · composition",title:"Concentration",right:e.jsxs("span",{className:"text-xs font-mono text-fg-faint",children:["top 3 = ",n.toFixed(0),"%"]})}),t.length===0?e.jsx("div",{className:"text-xs text-fg-faint",children:"no projects in range"}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex h-3 rounded overflow-hidden mb-2",children:t.map(i=>e.jsx("div",{style:{width:`${Math.max(i.sharePct,.5)}%`,backgroundColor:A(i.projectDir)},title:`${L(i.projectDir)} · ${i.sharePct.toFixed(1)}%`},i.projectDir))}),e.jsx("div",{className:"space-y-1 mb-2",children:s.map(i=>e.jsxs("div",{className:"flex items-center justify-between text-[11px] font-mono",children:[e.jsxs("span",{className:"flex items-center gap-1.5 text-fg-dim truncate",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full shrink-0",style:{backgroundColor:A(i.projectDir)}}),L(i.projectDir)]}),e.jsxs("span",{className:"text-fg-faint",children:[i.sharePct.toFixed(1),"%"]})]},i.projectDir))}),r.length>0&&e.jsxs("p",{className:"text-[10px] text-fg-faint",children:[r.length," more project",r.length===1?"":"s"," account for ",o.toFixed(1),"% (long tail)."]})]})]})}const Z=30,fe=9,P=(Z+fe)*2;function Ut({totals:t}){const s=t.inputTokens+t.cacheReadTokens+t.cacheCreationTokens,n=s>0?t.cacheReadTokens/s*100:0,r=2*Math.PI*Z,o=P/2;return e.jsxs("div",{className:`${T} p-4`,children:[e.jsx(R,{kicker:"05 · composition",title:"Cache"}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"relative shrink-0",style:{width:P,height:P},children:[e.jsxs("svg",{width:P,height:P,viewBox:`0 0 ${P} ${P}`,className:"-rotate-90",children:[e.jsx("circle",{cx:o,cy:o,r:Z,fill:"none",stroke:"currentColor",className:"text-bg-hi",strokeWidth:fe}),e.jsx("circle",{cx:o,cy:o,r:Z,fill:"none",stroke:bt,strokeWidth:fe,strokeDasharray:r,strokeDashoffset:r*(1-n/100),strokeLinecap:"round"})]}),e.jsxs("div",{className:"absolute inset-0 flex items-center justify-center text-[13px] font-mono text-fg",children:[n.toFixed(0),"%"]})]}),e.jsxs("div",{className:"text-[11px] space-y-1 font-mono",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"text-fg-faint",children:"reused (cache read)"}),e.jsx("span",{className:"text-fg-dim",children:I(t.cacheReadTokens)})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"text-fg-faint",children:"written to cache"}),e.jsx("span",{className:"text-fg-dim",children:I(t.cacheCreationTokens)})]})]})]})]})}const Pt=.05,At="—",Se=t=>`$${t.toFixed(2)}`;function Ft(){const[t,s]=x.useState(null),[n,r]=x.useState(null),o=Ve(a=>a.show);x.useEffect(()=>{let a=!0;const c=()=>{window.api.history.loopEfficiency().then(d=>{a&&(s(d),r(null))}).catch(d=>{if(!a)return;const l=d instanceof Error?d.message:String(d);r(l),o("error",`Loop efficiency failed to load: ${l}`)})};c();const u=window.api.history.onUpdated(c);return()=>{a=!1,u()}},[o]);let i;if(n&&!t)i=e.jsxs("div",{"data-testid":"loop-eff-error",className:"text-[11px] font-mono text-fg-faint",children:["Failed to load: ",n]});else if(!t)i=e.jsx("div",{"data-testid":"loop-eff-loading",className:"text-[11px] font-mono text-fg-faint",children:"Loading…"});else if(t.rows.length===0)i=e.jsx("div",{"data-testid":"loop-eff-empty",className:"text-[11px] font-mono text-fg-faint",children:"No runs this week."});else{const a=t.totals.wastedRunRate>Pt;i=e.jsxs(e.Fragment,{children:[e.jsxs("table",{className:"w-full text-[11px] font-mono","data-testid":"loop-eff-table",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"text-fg-faint text-left",children:[e.jsx("th",{className:"font-normal",children:"Project"}),e.jsx("th",{className:"font-normal text-right",children:"Runs"}),e.jsx("th",{className:"font-normal text-right",children:"Wasted"}),e.jsx("th",{className:"font-normal text-right",children:"Verified"}),e.jsx("th",{className:"font-normal text-right",children:"Refuted"}),e.jsx("th",{className:"font-normal text-right",children:"List-price $"}),e.jsx("th",{className:"font-normal text-right",children:"$ / verified"})]})}),e.jsx("tbody",{className:"text-fg-dim",children:t.rows.map(c=>e.jsxs("tr",{"data-testid":"loop-eff-row",children:[e.jsx("td",{children:c.project}),e.jsx("td",{className:"text-right",children:c.runs}),e.jsx("td",{className:"text-right",children:c.wastedRuns}),e.jsx("td",{className:"text-right",children:c.verified}),e.jsx("td",{className:"text-right",children:c.refuted}),e.jsx("td",{className:"text-right",children:Se(c.executorUsd)}),e.jsx("td",{className:"text-right","data-testid":"loop-eff-per-verified",children:c.usdPerVerified==null?At:Se(c.usdPerVerified)})]},c.cwd))})]}),e.jsxs("div",{"data-testid":"loop-eff-totals","data-warning":a?"true":"false",className:`mt-2 text-[11px] font-mono ${a?"text-amber-300":"text-fg-dim"}`,children:["wasted runs ",(t.totals.wastedRunRate*100).toFixed(1),"% (",t.totals.wastedRuns,"/",t.totals.runs,") · target ≤ 5%"]}),e.jsx("div",{"data-testid":"loop-eff-usage",className:"mt-1 text-[11px] font-mono text-fg-faint",children:t.verifiedPerUsagePct!=null?`${t.verifiedPerUsagePct} verified PRDs per 1% of weekly usage`:"weekly usage unavailable"})]})}return e.jsxs("div",{className:`${T} p-4`,"data-testid":"loop-efficiency",children:[e.jsx(R,{kicker:"06 · reliability",title:"Loop efficiency"}),i]})}const _t=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function Bt({days:t,measure:s}){const{buckets:n,weekendShare:r,peakIdx:o}=x.useMemo(()=>{const a=new Array(7).fill(0);for(const l of t){const[p,m,v]=l.date.split("-").map(Number),k=new Date(p,m-1,v).getDay();a[k]+=$(l.totals,s)}const c=a.reduce((l,p)=>l+p,0),u=a[0]+a[6];let d=0;for(let l=1;l<7;l++)a[l]>a[d]&&(d=l);return{buckets:a,weekendShare:c>0?u/c*100:0,peakIdx:d}},[t,s]),i=Math.max(...n,1);return e.jsxs("div",{className:`${T} p-4`,children:[e.jsx(R,{kicker:"05 · composition",title:"Rhythm",right:e.jsxs("span",{className:"text-xs font-mono text-fg-faint",children:["weekend ",r.toFixed(0),"%"]})}),e.jsx("div",{className:"flex items-end gap-2 h-24",children:n.map((a,c)=>e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-end gap-1 h-full",children:[e.jsx("div",{className:`w-full rounded-t ${c===o?"bg-accent":"bg-rhythm"}`,style:{height:`${i>0?a/i*100:0}%`,minHeight:a>0?2:0}}),e.jsx("span",{className:"text-[9px] text-fg-faint font-mono",children:_t[c]})]},c))})]})}const Ht=["in","out","total","prompts","sessions","time","spend"],Lt=[30,60,90,0],Ot="spend",It=30,Wt=3e4,Gt=[];function Kt(){var ke;const[t,s]=x.useState(Ot),[n,r]=x.useState(It),o=x.useRef(!1),i=x.useRef(!1),a=f=>{o.current=!0;const b=t;s(f),ue({measure:f}).catch(()=>{s(b),q.error("Couldn't save the measure preference — reverted.")})},c=f=>{i.current=!0;const b=n;r(f),ue({range:f}).catch(()=>{r(b),q.error("Couldn't save the range preference — reverted.")})};x.useEffect(()=>{let f=!1;return pe().then(b=>{f||(!o.current&&b.measure&&Ht.includes(b.measure)&&s(b.measure),!i.current&&b.range!==void 0&&Lt.includes(b.range)&&r(b.range))}),()=>{f=!0}},[]);const u=Ye(f=>f.navFace),d=ye(f=>f.tabs),l=ye(f=>f.activeTabId),p=((ke=d.find(f=>f.id===l))==null?void 0:ke.cwd)??null,m=x.useRef(u),v=p?Xe(p):null,[k,M]=x.useState(null),h=x.useMemo(()=>u==="project"&&v?new Set([v]):k,[u,v,k]),[g,D]=x.useState(null),[j,J]=x.useState(null),[G,W]=x.useState(!0),[ee,te]=x.useState(0),se=x.useRef(n);se.current=n;const K=x.useRef(!0),ne=x.useRef(0),he=x.useRef(0),F=x.useRef(null),z=x.useCallback(f=>{const b=se.current;ne.current+=1,he.current=Date.now(),Je(b).then(y=>{if(ne.current-=1,!(!K.current||b!==se.current)){if(W(!1),y.ok){J(y.data);return}f||q.error(`History analytics failed to load: ${y.error}`)}})},[]);x.useEffect(()=>{K.current=!0,W(!0),z(!1)},[n,ee,z]),x.useEffect(()=>{const f=()=>{if(!K.current)return;const N=he.current+Wt-Date.now();if(ne.current===0&&N<=0){z(!0);return}F.current||(F.current=setTimeout(()=>{F.current=null,f()},Math.max(N,1e3)))},b=()=>{document.visibilityState==="visible"&&f()},y=window.api.history.onUpdated(f);return window.addEventListener("focus",f),document.addEventListener("visibilitychange",b),()=>{K.current=!1,y(),window.removeEventListener("focus",f),document.removeEventListener("visibilitychange",b),F.current&&(clearTimeout(F.current),F.current=null)}},[z]);const me=x.useRef(!1);x.useEffect(()=>{if(!me.current){me.current=!0;return}M(null),D(null)},[n]),x.useEffect(()=>{m.current!==u&&(m.current=u,u==="home"&&M(null))},[u]);const{projects:je,resolving:ge}=qe(),be=x.useMemo(()=>{const f={};for(const b of je)for(const y of b.encodedIds)f[y]=b.cwd;return f},[je]),_=x.useMemo(()=>j&&!ge?ft(j.days,be):null,[j,be,ge]),w=(_==null?void 0:_.days)??(j==null?void 0:j.days)??Gt,oe=(_==null?void 0:_.excluded)??null,S=x.useMemo(()=>j?tt({days:w,totals:j.totals,prevTotals:j.prevTotals},h):null,[j,w,h]),B=x.useMemo(()=>h===null?w:w.map(f=>({date:f.date,byProject:Object.fromEntries(Object.entries(f.byProject).filter(([b])=>h.has(b)))})),[w,h]),V=x.useMemo(()=>Te(w,t),[w,t]),ae=x.useMemo(()=>Te(B,t),[B,t]),Ae=x.useMemo(()=>B.map(f=>({date:f.date,values:Object.fromEntries(Object.entries(f.byProject).map(([b,y])=>[b,$(y,t)]))})),[B,t]),ve=x.useMemo(()=>S?at(S,t):null,[S,t]),Y=x.useMemo(()=>{if(!j||!g)return null;const f=w.flatMap(C=>C.byProject[g]?[C.byProject[g]]:[]),{byModel:b,...y}=Ne(f),N={};for(const C of f)for(const[U,re]of Object.entries(C.toolBreakdown))N[U]=(N[U]??0)+re;return{totals:y,byModel:b,toolBreakdown:N}},[j,w,g]);x.useEffect(()=>{g&&h!==null&&!h.has(g)&&D(null)},[g,h]);function Fe(f){M(b=>{const y=new Set(V.map(U=>U.projectDir)),N=b??new Set(y),C=new Set(N);return C.has(f)?C.delete(f):C.add(f),C.size>=y.size?null:C})}function _e(f){M(new Set([f]))}function Be(){M(null)}function He(){if(!j)return;const f=B.map(U=>{const{byModel:re,estimatedCostUsd:Le,inputTokens:Oe,outputTokens:Ie,cacheCreationTokens:We,cacheReadTokens:Ge}=Ne(Object.values(U.byProject));return{date:U.date,costUsd:Le,inputTokens:Oe,outputTokens:Ie,cacheCreationTokens:We,cacheReadTokens:Ge,byModel:re}}),b=it(f),y=new Blob([b],{type:"text/csv"}),N=URL.createObjectURL(y),C=document.createElement("a");C.href=N,C.download=`usage-history-${j.from}-${j.to}.csv`,C.click(),URL.revokeObjectURL(N)}return G&&!j?e.jsx($e,{}):j&&j.days.length===0?e.jsx(Qe,{title:"no sessions in range",hint:"Widen the range or check back after your next session."}):!j||!S||!ve?e.jsx($e,{}):e.jsxs("div",{"data-testid":"history-dashboard",className:"flex flex-col h-full",children:[e.jsxs("h1",{className:"font-serif text-[42px] leading-tight tracking-tight text-fg px-4 pt-4",children:["Where your ",e.jsx("em",{className:"italic text-accent",children:"Claude time"})," goes"]}),e.jsx(jt,{measure:t,onMeasure:a,range:n,onRange:c,projectsShown:h===null?V.length:h.size,projectsTotal:V.length,fromDate:j.from,toDate:j.to,onRefresh:()=>te(f=>f+1),onExport:He,exportDisabled:B.length===0}),e.jsxs("div",{className:"flex-1 min-h-0 overflow-auto p-4 space-y-4",children:[e.jsx(vt,{measure:t,headline:ve,activeDays:S.activeDays,projectsTouched:ae.length,totalSessions:S.totals.sessionCount}),e.jsx(Ct,{days:w}),oe&&xt(oe)&&e.jsx("div",{"data-testid":"history-excluded-note",className:"rounded-[10px] border border-line bg-bg-hi px-3 py-2 text-[11.5px] font-mono text-fg-faint",title:"A project is a working directory. ~/.claude/projects holds one folder per path the CLI was ever launched from — throwaway /tmp dirs and test fixtures included — and a folder whose cwd can't be recovered from its transcripts is not a project. Their totals are stated here rather than silently folded into the charts.",children:pt(oe)}),u==="home"&&e.jsx(Nt,{chips:V.map(f=>({projectDir:f.projectDir,value:f.value})),keep:h,onToggle:Fe,onIsolate:_e,onShowAll:Be}),e.jsx(Mt,{days:Ae,measure:t,selected:g,onSelect:D}),e.jsx(St,{rows:ae,measure:t,selected:g,onSelect:D}),g&&Y&&e.jsx($t,{projectDir:g,totals:Y.totals,byModel:Y.byModel,toolBreakdown:Y.toolBreakdown,onClear:()=>D(null)}),e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[e.jsx(Et,{byModelTotals:S.byModelTotals}),e.jsx(Dt,{rows:ae}),e.jsx(Ut,{totals:S.totals}),e.jsx(Bt,{days:S.days,measure:t})]}),e.jsx(Ft,{})]})]})}function $e(){return e.jsxs("div",{className:"p-4 space-y-4 animate-pulse",children:[e.jsx("div",{className:"h-24 bg-bg-elev rounded"}),e.jsx("div",{className:"h-16 bg-bg-elev rounded"}),e.jsx("div",{className:"h-8 bg-bg-elev rounded"}),e.jsx("div",{className:"h-56 bg-bg-elev rounded"}),e.jsx("div",{className:"h-40 bg-bg-elev rounded"})]})}function zt(){return e.jsx(Ze,{children:e.jsx(Kt,{})})}const Qt=x.memo(zt);export{Qt as History};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{aB as d,b0 as te,aU as se,b2 as ae,aW as T,an as oe,as as ne,ah as re,al as e,m as R,X as ie,H as le,aT as D,aK as ce,u as de}from"./index-
|
|
1
|
+
import{aB as d,b0 as te,aU as se,b2 as ae,aW as T,an as oe,as as ne,ah as re,al as e,m as R,X as ie,H as le,aT as D,aK as ce,u as de}from"./index-BD0ufZqe.js";import{P as O}from"./Panel-DIyJXHfp.js";import{L as me}from"./ListDetail-B3goE3Wc.js";import{S as pe}from"./SaveBar-CeL4vXRp.js";import{S as q}from"./ScopeSwitcher-BMiHySnz.js";import{P as ue}from"./ProvenanceBadge-BSI_2wAv.js";import{u as he,E as xe,s as fe}from"./settingsSchema-DmjBj3q7.js";import{H as ge}from"./Library-XA9osRfi.js";import{V as be}from"./ViewTabs-BDpHur6l.js";import"./monaco-editor-BsIlgG7c.js";import"./claude-settings-schema-COigsajx.js";import"./Button-sA4lqAao.js";import"./listSkills-C1aWKf0T.js";const ye={UserPromptSubmit:{when:"Fires just before the user prompt is sent to the model.",payload:"{ prompt: string }",example:"Block submission if the prompt mentions a secret."},UserPromptExpansion:{when:"Fires when a slash command expands into its final prompt text.",payload:"{ command: string, expanded: string }",example:"Audit which slash commands actually run, post-expansion."},PreToolUse:{when:"Fires before any tool runs. Can block the call.",payload:"{ tool_name: string, tool_input: object }",example:'matcher="Bash" — block dangerous shell commands.'},PostToolUse:{when:"Fires after a tool completes successfully.",payload:"{ tool_name: string, tool_input: object, tool_result: string }",example:'matcher="Write|Edit" — run a linter on changed files.'},PostToolUseFailure:{when:"Fires after a tool errors out (non-zero exit, exception, or refusal).",payload:"{ tool_name: string, tool_input: object, error: string }",example:"Pipe failed Bash runs into a desktop notification."},PostToolBatch:{when:"Fires once after a parallel batch of tool calls all complete.",payload:"{ tool_uses: Array<{ tool_name, tool_input, tool_result? }> }",example:"Aggregate file-edit batches into a single commit message."},Stop:{when:"Fires when the model emits end_turn.",payload:"{ stop_reason: string, output_tokens: number }",example:"Play a chime when the agent finishes a long task."},StopFailure:{when:"Fires when a turn aborts without end_turn (rate-limit, network, OOM).",payload:'{ reason: "rate_limit"|"network"|"oom"|"killed"|string }',example:"Auto-resume on transient failures."},SessionStart:{when:"Fires once when a session boots (claude or claude -p).",payload:'{ source: "startup"|"resume", model: string, agent_type: string }',example:"Inject a project-specific system prompt addendum."},SessionEnd:{when:"Fires once when the session terminates.",payload:'{ reason: "user_quit"|"timeout"|"error"|string }',example:"Persist transcript summary to ~/.claude/projects/<>."},Setup:{when:"Fires during interactive setup (claude /setup, /init).",payload:'{ mode: "init"|"reconfigure"|string }'},PreCompact:{when:"Fires before transcript compaction runs.",payload:'{ transcript_path: string, trigger: "manual"|"auto" }',example:"Snapshot the pre-compact transcript for later diffing."},PostCompact:{when:"Fires after compaction; the active transcript is the compacted one.",payload:'{ transcript_path: string, trigger: "manual"|"auto" }'},InstructionsLoaded:{when:"Fires after CLAUDE.md and any imported memory files are loaded.",payload:'{ source: "session_start"|"reload" }'},Notification:{when:"Fires when Claude Code emits a desktop notification.",payload:"{ title: string, message: string }",example:"Forward to your own notify-send / osascript pipeline."},PermissionRequest:{when:"Fires when a tool needs user permission (per the permissions block).",payload:"{ tool_name: string, tool_input?: object }",example:"Auto-allow npm test invocations."},PermissionDenied:{when:"Fires when the user (or policy) denies a permission request.",payload:"{ tool_name: string, retry: boolean }",example:"Track which tools the user habitually rejects."},SubagentStart:{when:"Fires when a subagent (Task tool) spawns.",payload:"{ agent_type: string }",example:'matcher="security-reviewer" — log every security scan.'},SubagentStop:{when:"Fires when a subagent finishes.",payload:'{ agent_type: string, reason: "end_turn"|"error"|string }'},TeammateIdle:{when:"Fires when a teammate agent goes idle (waiting for input).",payload:"{ teammate_id?: string }"},TaskCreated:{when:"Fires when a new Task is created via the Task tool.",payload:"{ task: { description: string, ...} }",example:"Track each spawned task in an external queue."},TaskCompleted:{when:"Fires when a Task completes (success or failure).",payload:"{ task: { description: string, ...} }"},ConfigChange:{when:"Fires when settings.json (any scope) is mutated mid-session.",payload:'{ source: "user_settings"|"project_settings"|"local_settings" }',example:"Reload tooling that depends on env vars on config change."},CwdChanged:{when:"Fires when the working directory changes (e.g. agent cd-ing).",payload:"{ old_cwd: string, new_cwd: string }",example:"Refresh project-scoped indexers when cwd drifts."},FileChanged:{when:"Fires when a watched file outside Claude Code's edits changes.",payload:'{ file_path: string, change_type: "modified"|"created"|"deleted" }',example:"Re-run typecheck when any .ts file changes."},WorktreeCreate:{when:"Fires after a git worktree is created via /worktree or subagent isolation.",payload:"{ worktree_path?: string, branch?: string }"},WorktreeRemove:{when:"Fires after a git worktree is removed.",payload:"{ worktree_path?: string }"},Elicitation:{when:"Fires when Claude asks the user a multiple-choice question.",payload:'{ action: "accept"|"reject", ...}'},ElicitationResult:{when:"Fires after the user resolves an elicitation prompt.",payload:"{ choice?: string }"}},M=["UserPromptSubmit","UserPromptExpansion","PreToolUse","PostToolUse","PostToolUseFailure","PostToolBatch","Stop","StopFailure","SessionStart","SessionEnd","Setup","PreCompact","PostCompact","InstructionsLoaded","Notification","PermissionRequest","PermissionDenied","SubagentStart","SubagentStop","TeammateIdle","TaskCreated","TaskCompleted","ConfigChange","CwdChanged","FileChanged","WorktreeCreate","WorktreeRemove","Elicitation","ElicitationResult"],ve=new Set(M),we=["command","http","prompt","agent","mcp_tool"],je={UserPromptSubmit:{prompt:"hello"},UserPromptExpansion:{command:"/example",expanded:"hello"},PreToolUse:{tool_name:"Bash",tool_input:{command:"ls"}},PostToolUse:{tool_name:"Bash",tool_input:{command:"ls"},tool_result:""},PostToolUseFailure:{tool_name:"Bash",tool_input:{command:"ls"},error:""},PostToolBatch:{tool_uses:[]},Stop:{stop_reason:"end_turn",output_tokens:0},StopFailure:{reason:"rate_limit"},SessionStart:{source:"startup",model:"",agent_type:""},SessionEnd:{reason:"user_quit"},Setup:{mode:"init"},PreCompact:{transcript_path:"",trigger:"manual"},PostCompact:{transcript_path:"",trigger:"manual"},InstructionsLoaded:{source:"session_start"},Notification:{title:"test",message:"test notification"},PermissionRequest:{tool_name:"Bash"},PermissionDenied:{tool_name:"Bash",retry:!1},SubagentStart:{agent_type:"general-purpose"},SubagentStop:{agent_type:"general-purpose",reason:"end_turn"},TeammateIdle:{},TaskCreated:{task:{description:""}},TaskCompleted:{task:{description:""}},ConfigChange:{source:"user_settings"},CwdChanged:{old_cwd:"",new_cwd:""},FileChanged:{file_path:"",change_type:"modified"},WorktreeCreate:{},WorktreeRemove:{},Elicitation:{action:"accept"},ElicitationResult:{}},H="This settings file has invalid JSON. Fix it in the Settings raw editor first; Hooks will not overwrite it.";function W(t){if(t.trim()==="")return{full:{},hooks:{},err:null};try{const o=JSON.parse(t);if(o===null||typeof o!="object"||Array.isArray(o))return{full:{},hooks:{},err:"settings file is not a JSON object"};const n=o;return{full:n,hooks:n.hooks??{},err:null}}catch(o){return{full:{},hooks:{},err:o.message}}}function ke(t,o){return JSON.stringify({...t,hooks:o},null,2)+`
|
|
2
2
|
`}function Ne(t,o){return(t[o]??[]).reduce((n,l)=>{var c;return n+(((c=l.hooks)==null?void 0:c.length)??0)},0)}function _e(){const t=te(),o=se(),n=(o==null?void 0:o.cwd)??null,l=ae(a=>a.navFace),c=d.useRef(!1),f=d.useRef(l),[m,x]=d.useState(()=>l==="project"&&n?"project":"user"),[r,u]=d.useState("PreToolUse"),[s,S]=d.useState("effective");d.useEffect(()=>{if(f.current!==l){if(f.current=l,c.current){c.current=!1;return}x(l==="project"&&n?"project":"user")}},[l,n]),d.useEffect(()=>{l==="project"&&s==="library"&&S("effective")},[l,s]);const g=a=>{c.current=!0,x(a)},v=he(le,t,n),p=v[m]??null,w=T(a=>a.files),U=T(a=>a.setDraft),$=T(a=>a.saveJson),K=T(a=>a.revert),[V,N]=d.useState(null),[C,A]=d.useState(null),P=e.jsx(be,{options:[{key:"effective",label:"Effective"},{key:"events",label:"Events"},...l==="home"?[{key:"library",label:"Library"}]:[]],active:s,onChange:S}),G=d.useMemo(()=>{const a=oe(ne(w,v));return re(a,["hooks"])??{kind:"object",children:{}}},[w,v]),I=(a,h)=>{var J;const i=v[m];if(!i)return;const{full:k,err:F}=W(((J=w[i])==null?void 0:J.draftRaw)??"");if(F){D.error(H);return}N(null);const Z=ce(k.hooks??{},a,h),ee={...k,hooks:Z};U(i,JSON.stringify(ee,null,2)+`
|
|
3
3
|
`)};if(!t)return e.jsx(R,{title:"loading…"});if(s==="library")return e.jsx(O,{toolbar:P,children:e.jsx(ge,{})});if(m!=="user"&&!n)return e.jsx(O,{toolbar:e.jsxs(e.Fragment,{children:[P,e.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),e.jsx(q,{scopes:["user","project","local"],active:m,onChange:g})]}),children:e.jsx(R,{title:"no active project"})});if(!p)return e.jsx(R,{title:"loading…"});const b=w[p],{full:z,hooks:y,err:j}=b?W(b.draftRaw):{full:{},hooks:{},err:null},B=Object.keys(y).filter(a=>!ve.has(a)),L=B.reduce((a,h)=>a+(y[h]??[]).reduce((i,k)=>{var F;return i+(((F=k.hooks)==null?void 0:F.length)??0)},0),0),E=a=>{if(j){D.error(H);return}N(null),U(p,ke(z,a))},_=y[r]??[],Y=()=>{E({...y,[r]:[..._,{matcher:"",hooks:[{type:"command",command:""}]}]})},X=(a,h)=>{const i=_.slice();i[a]=h,E({...y,[r]:i})},Q=a=>{E({...y,[r]:_.filter((h,i)=>i!==a)})};return e.jsxs(O,{toolbar:e.jsxs(e.Fragment,{children:[P,e.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),e.jsx(q,{scopes:["user","project","local"],active:m,onChange:g}),e.jsx("span",{className:"ml-3 text-fg-faint truncate",children:s==="effective"?`overrides → ${p}`:p}),e.jsx("div",{className:"flex-1"}),e.jsx("a",{href:"https://code.claude.com/docs/en/hooks",target:"_blank",rel:"noreferrer",className:"text-fg-faint hover:text-fg-dim underline-offset-2 hover:underline",children:"hook reference ↗"})]}),footer:b?e.jsx(pe,{dirty:b.dirty,busy:b.busy,parseError:V||j||b.parseError,lastSavedAt:b.lastSavedAt,onSave:async()=>{N(null);const a=await $(p);a.ok||N(a.error??"save failed")},onRevert:()=>{N(null),K(p)}}):null,children:[s==="effective"?e.jsx(xe,{node:G,targetScope:m,onOverride:I,schema:fe().rootedAt(["hooks"]),rootLabel:"hooks"}):e.jsxs("div",{className:"flex flex-col h-full",children:[j?e.jsxs("div",{role:"alert",className:"px-3 py-2 border-b border-line text-xs text-red-400",children:[H," (",j,")"]}):null,L>0?e.jsxs("div",{className:"px-3 py-2 border-b border-line text-xs bg-bg-elev text-fg-dim",children:[e.jsx("span",{className:"text-yellow-400",children:"⚠"})," ",L," hook(s) configured under unknown event names: ",e.jsx("span",{className:"font-mono text-fg",children:B.join(", ")}),e.jsx("span",{className:"text-fg-faint",children:" · these are ignored by Claude Code 2026; edit settings.json directly to remove."})]}):null,e.jsx(me,{sidebarWidth:"14rem",sidebar:e.jsx("div",{className:"py-1",children:M.map(a=>{const h=Ne(y,a),i=ye[a],k=i?e.jsxs("span",{className:"block space-y-1",children:[e.jsx("span",{className:"block text-fg",children:i.when}),e.jsxs("span",{className:"block text-fg-faint font-mono",children:["payload: ",i.payload]}),i.example?e.jsxs("span",{className:"block text-fg-faint italic",children:["e.g. ",i.example]}):null]}):e.jsx("span",{className:"text-fg-faint italic",children:"no documentation yet"});return e.jsx("div",{className:"[&>span]:w-full",children:e.jsx(ie,{content:k,align:"bottom-center",children:e.jsxs("button",{onClick:()=>u(a),title:i==null?void 0:i.when,className:`w-full text-left px-3 py-1 text-xs ${r===a?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"truncate",children:a}),h>0&&e.jsx("span",{className:"text-accent shrink-0 ml-2",children:h})]}),i?e.jsx("span",{className:"block text-[11px] leading-[1.3] text-fg-faint/80 font-normal truncate",children:i.when}):e.jsx("span",{className:"block text-[11px] leading-[1.3] text-fg-faint/80 italic font-normal truncate",children:"no documentation yet"})]})})},a)})}),detail:e.jsxs("div",{className:"p-4 space-y-3 max-w-3xl",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-xs uppercase tracking-wider text-fg",children:r}),e.jsx("button",{onClick:Y,disabled:!!j,className:"px-2 py-0.5 text-xs border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi disabled:opacity-40 disabled:cursor-not-allowed",children:"+ add group"})]}),_.length===0?e.jsx("div",{className:"text-fg-faint text-xs",children:"no hooks for this event"}):_.map((a,h)=>e.jsx(Se,{group:a,jsonInvalid:!!j,onChange:i=>X(h,i),onRemove:()=>Q(h),onTestFire:i=>A({event:r,matcher:a.matcher??"",command:i.command??""})},h))]})})]}),C?e.jsx(Pe,{event:C.event,matcher:C.matcher,command:C.command,onClose:()=>A(null)}):null]})}const $e=d.memo(_e);function Se({group:t,jsonInvalid:o,onChange:n,onRemove:l,onTestFire:c}){const f=()=>n({...t,hooks:[...t.hooks??[],{type:"command",command:""}]}),m=(r,u)=>{const s=t.hooks.slice();s[r]=u,n({...t,hooks:s})},x=r=>n({...t,hooks:t.hooks.filter((u,s)=>s!==r)});return e.jsxs("div",{className:"border border-line rounded p-3 bg-bg-elev space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs text-fg-faint w-16",children:"matcher"}),e.jsx("input",{value:t.matcher??"",disabled:o,onChange:r=>n({...t,matcher:r.target.value}),placeholder:"tool name regex or exact match (optional)",className:"flex-1 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg font-mono"}),e.jsx("button",{onClick:l,disabled:o,className:"text-fg-faint hover:text-red-400 text-xs disabled:opacity-40",title:"remove group",children:"× group"})]}),(t.hooks??[]).map((r,u)=>e.jsx(Ce,{rule:r,jsonInvalid:o,onChange:s=>m(u,s),onRemove:()=>x(u),onTestFire:()=>c(r)},u)),e.jsx("button",{onClick:f,disabled:o,className:"text-xs text-fg-faint hover:text-fg disabled:opacity-40",children:"+ add hook"})]})}function Ce({rule:t,jsonInvalid:o,onChange:n,onRemove:l,onTestFire:c}){const f=s=>({command:"e.g. node ./scripts/lint.js $FILE",http:"e.g. https://hooks.example.com/notify",prompt:"e.g. Review this change for security issues",agent:"e.g. security-reviewer",mcp_tool:"e.g. mcp__server__tool"})[s],m=t.type==="command"?"command":t.type==="http"?"url":t.type==="prompt"?"prompt":t.type==="mcp_tool"?"mcpTool":"agent",x=t[m]??"",r=(t.args??[]).join(" "),u={type:"hook",name:x||t.type,command:t.type==="command"?t.command:void 0,url:t.type==="http"?t.url:void 0};return e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("select",{value:t.type,disabled:o,onChange:s=>n({type:s.target.value}),className:"bg-bg border border-line rounded px-1 py-0.5 text-xs text-fg",children:we.map(s=>e.jsx("option",{value:s,children:s},s))}),e.jsx(ue,{interactive:!1,input:u}),e.jsx("input",{value:x,disabled:o,onChange:s=>n({...t,[m]:s.target.value}),placeholder:f(t.type),className:`flex-1 bg-bg border rounded px-2 py-0.5 text-xs text-fg font-mono ${o?"border-red-500/70":x.trim()?"border-line":"border-yellow-600/50"}`}),o?e.jsx("span",{className:"text-red-400 text-xs",title:"The enclosing settings.json is malformed; fix the JSON before editing.",children:"× invalid"}):null,e.jsx("input",{value:t.timeout??"",disabled:o,onChange:s=>n({...t,timeout:s.target.value?Number(s.target.value):void 0}),placeholder:"timeout ms",className:"w-20 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"}),t.type==="command"?e.jsx("button",{onClick:c,disabled:o||!x.trim(),className:"px-2 py-0.5 text-xs border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi disabled:opacity-40 disabled:cursor-not-allowed",title:"Run this command with a fake event payload",children:"test fire"}):null,e.jsx("button",{onClick:l,disabled:o,className:"text-fg-faint hover:text-red-400 text-xs disabled:opacity-40",children:"×"})]}),t.type==="command"?e.jsxs("div",{className:"flex items-center gap-2 pl-[3.75rem]",children:[e.jsx("span",{className:"text-xs text-fg-faint w-12",children:"args"}),e.jsx("input",{value:r,disabled:o,onChange:s=>n({...t,args:s.target.value.trim()?s.target.value.split(/\s+/).filter(Boolean):void 0}),placeholder:"argv array (v2.1.139+ exec form, no shell)",className:"flex-1 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg font-mono"})]}):null,e.jsxs("div",{className:"flex items-center gap-2 pl-[3.75rem]",children:[e.jsx("span",{className:"text-xs text-fg-faint w-12",children:"term"}),e.jsx("input",{value:t.terminalSequence??"",disabled:o,onChange:s=>n({...t,terminalSequence:s.target.value||void 0}),placeholder:"terminalSequence — e.g. \\\\a (bell), v2.1.141+",className:"flex-1 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg font-mono"})]})]})}function Fe(t){return JSON.stringify(je[t]??{},null,2)}function Te(t,o){if(!t.trim())return{matched:!0,target:null,note:"empty matcher → matches all"};const n=o&&typeof o=="object"&&"tool_name"in o?String(o.tool_name??""):null;if(n==null)return{matched:!1,target:null,note:"payload has no tool_name to match against"};try{return{matched:new RegExp(`^(?:${t})$`).test(n),target:n}}catch{return{matched:t===n,target:n,note:"matcher not valid regex; fell back to exact match"}}}function Pe({event:t,matcher:o,command:n,onClose:l}){const[c,f]=d.useState(()=>Fe(t)),[m,x]=d.useState(!1),[r,u]=d.useState(null),[s,S]=d.useState(null);let g=null;try{JSON.parse(c)}catch(p){g=p.message}const v=async()=>{x(!0),u(null);let p=null;try{p=JSON.parse(c)}catch{}S(Te(o,p));try{const w=await window.api.app.testFireHook({command:n,payload:c,timeoutMs:5e3});u(w)}finally{x(!1)}};return e.jsx(de,{open:!0,onClose:l,title:`Test fire — ${t}`,children:e.jsxs("div",{className:"space-y-3 text-xs",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-fg-faint mb-1",children:"resolved command"}),e.jsx("div",{className:"font-mono text-fg bg-bg border border-line rounded px-2 py-1 break-all",children:n})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-fg-faint mb-1",children:"matcher"}),e.jsx("div",{className:"font-mono text-fg bg-bg border border-line rounded px-2 py-1",children:o||e.jsx("span",{className:"text-fg-faint",children:"(empty — matches all)"})})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"text-fg-faint",children:"fake event payload (stdin)"}),g?e.jsxs("span",{className:"text-red-400",children:["× ",g]}):null]}),e.jsx("textarea",{value:c,onChange:p=>f(p.target.value),rows:8,className:`w-full bg-bg border rounded px-2 py-1 font-mono text-fg ${g?"border-red-500/70":"border-line"}`})]}),s?e.jsxs("div",{children:[e.jsx("div",{className:"text-fg-faint mb-1",children:"matcher result"}),e.jsxs("div",{className:"font-mono",children:[e.jsx("span",{className:s.matched?"text-green-400":"text-red-400",children:s.matched?"✓ match":"✗ no match"}),s.target!=null?e.jsxs("span",{className:"text-fg-dim",children:[' · target tool_name="',s.target,'"']}):null,s.note?e.jsx("div",{className:"text-fg-faint",children:s.note}):null]})]}):null,r?e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"text-fg-faint",children:["exit ",r.exitCode," · ",r.durationMs,"ms"]}),r.stdout?e.jsxs("div",{children:[e.jsx("div",{className:"text-fg-faint",children:"stdout"}),e.jsx("pre",{className:"bg-bg border border-line rounded p-2 font-mono text-fg whitespace-pre-wrap break-all max-h-40 overflow-auto",children:r.stdout})]}):null,r.stderr?e.jsxs("div",{children:[e.jsx("div",{className:"text-fg-faint",children:"stderr"}),e.jsx("pre",{className:"bg-bg border border-line rounded p-2 font-mono text-red-300 whitespace-pre-wrap break-all max-h-40 overflow-auto",children:r.stderr})]}):null]}):null,e.jsxs("div",{className:"flex items-center justify-end gap-2 pt-1",children:[e.jsx("button",{onClick:l,className:"px-2 py-0.5 text-xs border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi",children:"close"}),e.jsx("button",{onClick:v,disabled:m||!!g||!n.trim(),className:"px-2 py-0.5 text-xs border border-line rounded text-fg hover:bg-bg-hi disabled:opacity-40 disabled:cursor-not-allowed",children:m?"running…":"run"})]})]})})}export{$e as Hooks};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b0 as B,aB as m,al as e,m as N,a as C,aW as D,a1 as X,aT as T}from"./index-DCbAgcJt.js";import{B as _}from"./Button-BC94OZc0.js";import{l as Z}from"./listSkills-C1aWKf0T.js";const z=[{id:"filesystem",name:"Filesystem",description:"Secure file operations with configurable access controls",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/filesystem",config:{command:"npx",args:["-y","@modelcontextprotocol/server-filesystem","<path>"]},envVars:[]},{id:"fetch",name:"Fetch",description:"Web content fetching and conversion for efficient LLM usage",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/fetch",config:{command:"uvx",args:["mcp-server-fetch"]},envVars:[]},{id:"memory",name:"Memory",description:"Knowledge graph-based persistent memory system",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/memory",config:{command:"npx",args:["-y","@modelcontextprotocol/server-memory"]},envVars:[]},{id:"sequential-thinking",name:"Sequential Thinking",description:"Dynamic and reflective problem-solving through thought sequences",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/sequentialthinking",config:{command:"npx",args:["-y","@modelcontextprotocol/server-sequential-thinking"]},envVars:[]},{id:"git",name:"Git",description:"Tools to read, search, and manipulate Git repositories",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/git",config:{command:"uvx",args:["mcp-server-git","--repository","<path>"]},envVars:[]},{id:"time",name:"Time",description:"Time and timezone conversion capabilities",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/time",config:{command:"uvx",args:["mcp-server-time"]},envVars:[]},{id:"everything",name:"Everything",description:"Reference/test server with prompts, resources, and tools",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/everything",config:{command:"npx",args:["-y","@modelcontextprotocol/server-everything"]},envVars:[]},{id:"github",name:"GitHub",description:"Official GitHub repository, issues, and PR management",official:!1,homepage:"https://github.com/github/github-mcp-server",config:{command:"docker",args:["run","-i","--rm","-e","GITHUB_PERSONAL_ACCESS_TOKEN","ghcr.io/github/github-mcp-server"]},envVars:["GITHUB_PERSONAL_ACCESS_TOKEN"]},{id:"gitlab",name:"GitLab",description:"GitLab API integration for projects, issues, and merge requests",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/gitlab",config:{command:"npx",args:["-y","@modelcontextprotocol/server-gitlab"]},envVars:["GITLAB_PERSONAL_ACCESS_TOKEN","GITLAB_API_URL"]},{id:"postgres",name:"PostgreSQL",description:"Read-only database access with schema inspection",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/postgres",config:{command:"npx",args:["-y","@modelcontextprotocol/server-postgres","<connection-string>"]},envVars:[]},{id:"sqlite",name:"SQLite",description:"Database interaction and business intelligence over SQLite",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/sqlite",config:{command:"uvx",args:["mcp-server-sqlite","--db-path","<path>"]},envVars:[]},{id:"slack",name:"Slack",description:"Channel management and messaging for Slack workspaces",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/slack",config:{command:"npx",args:["-y","@modelcontextprotocol/server-slack"]},envVars:["SLACK_BOT_TOKEN","SLACK_TEAM_ID"]},{id:"google-drive",name:"Google Drive",description:"File access and search for Google Drive",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/gdrive",config:{command:"npx",args:["-y","@modelcontextprotocol/server-gdrive"]},envVars:["GDRIVE_CREDENTIALS_PATH"]},{id:"google-maps",name:"Google Maps",description:"Location services, directions, and place details",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/google-maps",config:{command:"npx",args:["-y","@modelcontextprotocol/server-google-maps"]},envVars:["GOOGLE_MAPS_API_KEY"]},{id:"puppeteer",name:"Puppeteer",description:"Browser automation and web scraping via Puppeteer",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/puppeteer",config:{command:"npx",args:["-y","@modelcontextprotocol/server-puppeteer"]},envVars:[]},{id:"playwright",name:"Playwright",description:"Cross-browser automation for navigation, screenshots, and data extraction",official:!1,homepage:"https://github.com/microsoft/playwright-mcp",config:{command:"npx",args:["-y","@playwright/mcp@latest"]},envVars:[]},{id:"brave-search",name:"Brave Search",description:"Web and local search using the Brave Search API",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/brave-search",config:{command:"npx",args:["-y","@modelcontextprotocol/server-brave-search"]},envVars:["BRAVE_API_KEY"]},{id:"redis",name:"Redis",description:"Interact with Redis key-value stores",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/redis",config:{command:"npx",args:["-y","@modelcontextprotocol/server-redis","<redis-url>"]},envVars:[]},{id:"sentry",name:"Sentry",description:"Retrieve and analyze Sentry error tracking issues",official:!1,homepage:"https://github.com/getsentry/sentry-mcp",config:{command:"npx",args:["-y","@sentry/mcp-server@latest"]},envVars:["SENTRY_AUTH_TOKEN"]},{id:"linear",name:"Linear",description:"Issue tracking and project management for Linear",official:!1,homepage:"https://linear.app/docs/mcp",config:{command:"npx",args:["-y","mcp-remote","https://mcp.linear.app/sse"]},envVars:[]},{id:"notion",name:"Notion",description:"Notion workspace page and database management",official:!1,homepage:"https://github.com/makenotion/notion-mcp-server",config:{command:"npx",args:["-y","@notionhq/notion-mcp-server"]},envVars:["NOTION_API_KEY"]},{id:"stripe",name:"Stripe",description:"Payment processing, customers, and invoices via Stripe API",official:!1,homepage:"https://github.com/stripe/agent-toolkit",config:{command:"npx",args:["-y","@stripe/mcp","--tools=all"]},envVars:["STRIPE_SECRET_KEY"]},{id:"cloudflare",name:"Cloudflare",description:"Manage Cloudflare Workers, KV, R2, D1, and Workers AI",official:!1,homepage:"https://github.com/cloudflare/mcp-server-cloudflare",config:{command:"npx",args:["-y","mcp-remote","https://observability.mcp.cloudflare.com/sse"]},envVars:[]},{id:"context7",name:"Context7",description:"Up-to-date version-specific library docs injected into prompts",official:!1,homepage:"https://github.com/upstash/context7",config:{command:"npx",args:["-y","@upstash/context7-mcp@latest"]},envVars:[]},{id:"tavily",name:"Tavily",description:"AI-optimized web search with clean structured results",official:!1,homepage:"https://github.com/tavily-ai/tavily-mcp",config:{command:"npx",args:["-y","tavily-mcp@latest"]},envVars:["TAVILY_API_KEY"]},{id:"perplexity",name:"Perplexity",description:"Answer-engine search with deep research and reasoning",official:!1,homepage:"https://github.com/ppl-ai/modelcontextprotocol",config:{command:"npx",args:["-y","server-perplexity-ask"]},envVars:["PERPLEXITY_API_KEY"]},{id:"figma",name:"Figma Dev Mode",description:"First-party Figma design-to-code bridge exposing node tree",official:!1,homepage:"https://help.figma.com/hc/en-us/articles/32132100833559",config:{url:"http://127.0.0.1:3845/sse"},envVars:[]},{id:"supabase",name:"Supabase",description:"Manage Supabase projects, tables, and SQL queries",official:!1,homepage:"https://github.com/supabase-community/supabase-mcp",config:{command:"npx",args:["-y","@supabase/mcp-server-supabase@latest"]},envVars:["SUPABASE_ACCESS_TOKEN"]},{id:"atlassian",name:"Atlassian (Jira/Confluence)",description:"Official Jira and Confluence integration",official:!1,homepage:"https://www.atlassian.com/platform/remote-mcp-server",config:{command:"npx",args:["-y","mcp-remote","https://mcp.atlassian.com/v1/sse"]},envVars:[]},{id:"aws",name:"AWS",description:"AWS services access and best-practice guidance",official:!1,homepage:"https://github.com/awslabs/mcp",config:{command:"uvx",args:["awslabs.core-mcp-server@latest"]},envVars:["AWS_PROFILE","AWS_REGION"]},{id:"obsidian",name:"Obsidian",description:"Read and search notes in an Obsidian vault",official:!1,homepage:"https://github.com/MarkusPfundstein/mcp-obsidian",config:{command:"uvx",args:["mcp-obsidian"]},envVars:["OBSIDIAN_API_KEY"]}],U=[{id:"pdf",name:"PDF",description:"Create, edit, and extract content from PDF documents",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/pdf"},{id:"docx",name:"DOCX",description:"Create and edit Microsoft Word documents",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/docx"},{id:"xlsx",name:"XLSX",description:"Create and edit Excel spreadsheets with formulas and formatting",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/xlsx"},{id:"pptx",name:"PPTX",description:"Create and edit PowerPoint presentations",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/pptx"},{id:"webapp-testing",name:"Webapp Testing",description:"Test web applications using Playwright-driven browser automation",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/webapp-testing"},{id:"playwright-e2e",name:"Playwright E2E",description:"End-to-end browser tests — navigation, forms, assertions, waiting strategies",official:!1,source:"local"},{id:"playwright-visual-testing",name:"Playwright Visual Testing",description:"Visual regression testing — screenshot comparison, pixel diffs, responsive layouts",official:!1,source:"local"},{id:"playwright-accessibility",name:"Playwright Accessibility",description:"Accessibility testing — WCAG compliance, axe-core scans, keyboard navigation",official:!1,source:"local"},{id:"playwright-api-testing",name:"Playwright API Testing",description:"API testing with Playwright request context — REST endpoints, auth flows, contracts",official:!1,source:"local"},{id:"playwright-debug",name:"Playwright Debug",description:"Debug failing tests — trace viewer, inspector, headed mode, flaky test fixes",official:!1,source:"local"},{id:"web-artifacts-builder",name:"Web Artifacts Builder",description:"Build polished interactive web artifacts and demos",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/web-artifacts-builder"},{id:"frontend-design",name:"Frontend Design",description:"Apply frontend UI/UX design patterns and visual polish",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/frontend-design"},{id:"canvas-design",name:"Canvas Design",description:"Canvas-based graphic design and composition techniques",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/canvas-design"},{id:"algorithmic-art",name:"Algorithmic Art",description:"Create generative and algorithmic art",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/algorithmic-art"},{id:"brand-guidelines",name:"Brand Guidelines",description:"Apply brand identity and style guideline specifications",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/brand-guidelines"},{id:"theme-factory",name:"Theme Factory",description:"Generate and customize visual themes",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/theme-factory"},{id:"slack-gif-creator",name:"Slack GIF Creator",description:"Create animated GIFs suitable for Slack",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/slack-gif-creator"},{id:"doc-coauthoring",name:"Doc Coauthoring",description:"Collaborative document authoring and editing workflows",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/doc-coauthoring"},{id:"internal-comms",name:"Internal Comms",description:"Internal communications templates and drafting",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/internal-comms"},{id:"claude-api",name:"Claude API",description:"Build apps with the Claude API and Anthropic SDKs",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/claude-api"},{id:"mcp-builder",name:"MCP Builder",description:"Scaffold and build new Model Context Protocol servers",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/mcp-builder"},{id:"skill-creator",name:"Skill Creator",description:"Scaffold and create new Claude Code skills",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/skill-creator"}],V=[{id:"session-manager-dev",name:"Session Manager Dev",description:"Default dev skillset: /develop (decompose into scheduler PRDs, track to a validated finish), /builder (npm release), /send-feedback (cross-project findings).",official:!1,source:"https://github.com/StanislavBG/claude-code-session-manager/tree/main/plugins/session-manager-dev",bundles:["skills"],marketplace:{add:"bundled",name:"session-manager"}},{id:"code-review",name:"Code Review",description:"Comprehensive code review with best practices and improvement suggestions",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/code-review",bundles:["commands","agents"]},{id:"pr-review-toolkit",name:"PR Review Toolkit",description:"Pull request review automation and workflows",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/pr-review-toolkit",bundles:["commands","agents"]},{id:"commit-commands",name:"Commit Commands",description:"Git commit workflow shortcuts with conventional commit formatting",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/commit-commands",bundles:["commands"]},{id:"feature-dev",name:"Feature Dev",description:"Feature development assistance from spec to implementation",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/feature-dev",bundles:["commands","agents"]},{id:"security-guidance",name:"Security Guidance",description:"Security best-practice review and enforcement",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/security-guidance",bundles:["commands","agents"]},{id:"agent-sdk-dev",name:"Agent SDK Dev",description:"Development tools for building with the Claude Agent SDK",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/agent-sdk-dev",bundles:["commands","skills"]},{id:"plugin-dev",name:"Plugin Dev",description:"Scaffolding and tooling for authoring Claude Code plugins",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/plugin-dev",bundles:["commands","skills"]},{id:"mcp-server-dev",name:"MCP Server Dev",description:"Develop and test Model Context Protocol servers",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/mcp-server-dev",bundles:["commands","skills"]},{id:"skill-creator",name:"Skill Creator",description:"Framework for creating and iterating on new skills",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/skill-creator",bundles:["commands","skills"]},{id:"claude-md-management",name:"CLAUDE.md Management",description:"Manage and maintain CLAUDE.md project memory files",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/claude-md-management",bundles:["commands"]},{id:"typescript-lsp",name:"TypeScript LSP",description:"TypeScript/JavaScript language server integration",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/typescript-lsp",bundles:["hooks","commands"]},{id:"pyright-lsp",name:"Pyright LSP",description:"Python language server integration via Pyright",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/pyright-lsp",bundles:["hooks","commands"]},{id:"rust-analyzer-lsp",name:"Rust Analyzer LSP",description:"Rust language server integration via rust-analyzer",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/rust-analyzer-lsp",bundles:["hooks","commands"]},{id:"gopls-lsp",name:"Go LSP (gopls)",description:"Go language server integration via gopls",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/gopls-lsp",bundles:["hooks","commands"]},{id:"code-simplifier",name:"Code Simplifier",description:"Review changed code for reuse, quality, and efficiency then fix issues",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/code-simplifier",bundles:["commands","agents"]},{id:"hookify",name:"Hookify",description:"Utilities and templates for authoring Claude Code hooks",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/hookify",bundles:["commands","skills"]},{id:"frontend-design-plugin",name:"Frontend Design Plugin",description:"Frontend design assistance and visual polish workflows",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/frontend-design",bundles:["commands","skills","agents"]},{id:"clangd-lsp",name:"clangd-lsp",description:"C/C++ diagnostics via clangd. Requires clangd on $PATH.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/clangd-lsp",bundles:["hooks","commands"]},{id:"csharp-lsp",name:"csharp-lsp",description:"C# diagnostics. Requires OmniSharp or Roslyn LSP on $PATH.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/csharp-lsp",bundles:["hooks","commands"]},{id:"jdtls-lsp",name:"jdtls-lsp",description:"Java diagnostics via Eclipse JDT LS. Requires jdtls on $PATH.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/jdtls-lsp",bundles:["hooks","commands"]},{id:"kotlin-lsp",name:"kotlin-lsp",description:"Kotlin diagnostics. Requires kotlin-language-server on $PATH.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/kotlin-lsp",bundles:["hooks","commands"]},{id:"lua-lsp",name:"lua-lsp",description:"Lua diagnostics. Requires lua-language-server on $PATH.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/lua-lsp",bundles:["hooks","commands"]},{id:"php-lsp",name:"php-lsp",description:"PHP diagnostics. Requires intelephense or phpactor on $PATH.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/php-lsp",bundles:["hooks","commands"]},{id:"swift-lsp",name:"swift-lsp",description:"Swift diagnostics via sourcekit-lsp. Requires sourcekit-lsp on $PATH.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/swift-lsp",bundles:["hooks","commands"]},{id:"github",name:"github",description:"GitHub PRs, issues, gh-style flows.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/github",bundles:["mcp"]},{id:"gitlab",name:"gitlab",description:"GitLab MRs, issues, pipelines.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/gitlab",bundles:["mcp"]},{id:"atlassian",name:"atlassian",description:"Jira / Confluence search and updates.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/atlassian",bundles:["mcp"]},{id:"asana",name:"asana",description:"Asana task and project ops.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/asana",bundles:["mcp"]},{id:"linear",name:"linear",description:"Linear issue tracking — pairs with the Tasks tab.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/linear",bundles:["mcp"]},{id:"notion",name:"notion",description:"Notion document lookup and edits.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/notion",bundles:["mcp"]},{id:"figma",name:"figma",description:"Figma file inspection for UI work.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/figma",bundles:["mcp"]},{id:"vercel",name:"vercel",description:"Vercel deploy diagnostics.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/vercel",bundles:["mcp"]},{id:"firebase",name:"firebase",description:"Firebase project + Firestore ops.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/firebase",bundles:["mcp"]},{id:"supabase",name:"supabase",description:"Supabase database operations.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/supabase",bundles:["mcp"]},{id:"slack",name:"slack",description:"Slack DM / channel posting from agents.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/slack",bundles:["mcp"]},{id:"sentry",name:"sentry",description:"Sentry bug triage and event lookup.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/sentry",bundles:["mcp"]}],K=[{id:"prettier-on-write",name:"Prettier on Write",description:"Auto-format JS/TS/JSON/MD files after edit via prettier",event:"PostToolUse",matcher:"Write|Edit",command:"jq -r '.tool_input.file_path // empty' | grep -E '\\.(js|jsx|ts|tsx|json|md|css|html|yaml|yml)$' | xargs -r -I{} npx --no-install prettier --write {} 2>/dev/null || true"},{id:"black-on-write",name:"Black on Write (Python)",description:"Auto-format Python files after edit via black",event:"PostToolUse",matcher:"Write|Edit",command:"jq -r '.tool_input.file_path // empty' | grep -E '\\.py$' | xargs -r black -q 2>/dev/null || true"},{id:"rustfmt-on-write",name:"rustfmt on Write",description:"Auto-format Rust files after edit via rustfmt",event:"PostToolUse",matcher:"Write|Edit",command:"jq -r '.tool_input.file_path // empty' | grep -E '\\.rs$' | xargs -r rustfmt 2>/dev/null || true"},{id:"gofmt-on-write",name:"gofmt on Write",description:"Auto-format Go files after edit via gofmt",event:"PostToolUse",matcher:"Write|Edit",command:"jq -r '.tool_input.file_path // empty' | grep -E '\\.go$' | xargs -r gofmt -w 2>/dev/null || true"},{id:"block-secret-writes",name:"Block Writes to Secrets",description:"Deny edits to .env, credentials, key files",event:"PreToolUse",matcher:"Write|Edit",command:`path=$(jq -r '.tool_input.file_path // empty'); echo "$path" | grep -qE '(^|/)(\\.env|\\.env\\..+|id_rsa|id_ed25519|.*\\.pem|.*\\.key|credentials\\.json|\\.aws/credentials)$' && { echo '{"decision":"block","reason":"refusing to edit secret file"}'; exit 2; } || true`},{id:"notify-on-stop",name:"Desktop Notify on Stop",description:"Send a desktop notification when Claude finishes a turn",event:"Stop",command:`command -v notify-send >/dev/null && notify-send "Claude Code" "Session ready" || (command -v osascript >/dev/null && osascript -e 'display notification "Session ready" with title "Claude Code"') || true`},{id:"bell-on-notification",name:"Terminal Bell on Notification",description:"Ring the terminal bell on permission prompts / idle notifications",event:"Notification",command:"printf '\\a'"},{id:"log-tool-calls",name:"Log Tool Calls (JSONL)",description:"Append every tool call to ~/.claude/logs/tool-calls.jsonl for audit",event:"PreToolUse",command:"mkdir -p ~/.claude/logs && cat >> ~/.claude/logs/tool-calls.jsonl"},{id:"auto-stage-edits",name:"Auto-stage Edited Files",description:"git add each file Claude edits (inside a repo)",event:"PostToolUse",matcher:"Write|Edit",command:`path=$(jq -r '.tool_input.file_path // empty'); [ -n "$path" ] && git -C "$(dirname "$path")" add "$path" 2>/dev/null || true`},{id:"block-dangerous-bash",name:"Block Dangerous Bash",description:"Refuse rm -rf /, fork bombs, curl|sh pipes",event:"PreToolUse",matcher:"Bash",command:`cmd=$(jq -r '.tool_input.command // empty'); echo "$cmd" | grep -qE '(rm -rf /|:\\(\\)\\{.*\\};|curl.*\\|\\s*(bash|sh)|wget.*\\|\\s*(bash|sh)|mkfs\\.|dd if=.*of=/dev/)' && { echo '{"decision":"block","reason":"dangerous command pattern"}'; exit 2; } || true`},{id:"prepend-cwd-to-prompt",name:"Prepend CWD to Prompt",description:"Add cwd context to every user prompt automatically",event:"UserPromptSubmit",command:'echo "{\\"additionalContext\\":\\"cwd: $(pwd)\\"}"'},{id:"archive-transcript",name:"Archive Transcript on SessionEnd",description:"Copy the session jsonl to ~/.claude/archive/ when done",event:"SessionEnd",command:`src=$(jq -r '.transcript_path // empty'); [ -n "$src" ] && mkdir -p ~/.claude/archive && cp "$src" ~/.claude/archive/ 2>/dev/null || true`}],P=(i,o,a,s)=>`---
|
|
1
|
+
import{b0 as B,aB as m,al as e,m as N,a as C,aW as D,a1 as X,aT as T}from"./index-BD0ufZqe.js";import{B as _}from"./Button-sA4lqAao.js";import{l as Z}from"./listSkills-C1aWKf0T.js";const z=[{id:"filesystem",name:"Filesystem",description:"Secure file operations with configurable access controls",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/filesystem",config:{command:"npx",args:["-y","@modelcontextprotocol/server-filesystem","<path>"]},envVars:[]},{id:"fetch",name:"Fetch",description:"Web content fetching and conversion for efficient LLM usage",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/fetch",config:{command:"uvx",args:["mcp-server-fetch"]},envVars:[]},{id:"memory",name:"Memory",description:"Knowledge graph-based persistent memory system",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/memory",config:{command:"npx",args:["-y","@modelcontextprotocol/server-memory"]},envVars:[]},{id:"sequential-thinking",name:"Sequential Thinking",description:"Dynamic and reflective problem-solving through thought sequences",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/sequentialthinking",config:{command:"npx",args:["-y","@modelcontextprotocol/server-sequential-thinking"]},envVars:[]},{id:"git",name:"Git",description:"Tools to read, search, and manipulate Git repositories",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/git",config:{command:"uvx",args:["mcp-server-git","--repository","<path>"]},envVars:[]},{id:"time",name:"Time",description:"Time and timezone conversion capabilities",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/time",config:{command:"uvx",args:["mcp-server-time"]},envVars:[]},{id:"everything",name:"Everything",description:"Reference/test server with prompts, resources, and tools",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/everything",config:{command:"npx",args:["-y","@modelcontextprotocol/server-everything"]},envVars:[]},{id:"github",name:"GitHub",description:"Official GitHub repository, issues, and PR management",official:!1,homepage:"https://github.com/github/github-mcp-server",config:{command:"docker",args:["run","-i","--rm","-e","GITHUB_PERSONAL_ACCESS_TOKEN","ghcr.io/github/github-mcp-server"]},envVars:["GITHUB_PERSONAL_ACCESS_TOKEN"]},{id:"gitlab",name:"GitLab",description:"GitLab API integration for projects, issues, and merge requests",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/gitlab",config:{command:"npx",args:["-y","@modelcontextprotocol/server-gitlab"]},envVars:["GITLAB_PERSONAL_ACCESS_TOKEN","GITLAB_API_URL"]},{id:"postgres",name:"PostgreSQL",description:"Read-only database access with schema inspection",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/postgres",config:{command:"npx",args:["-y","@modelcontextprotocol/server-postgres","<connection-string>"]},envVars:[]},{id:"sqlite",name:"SQLite",description:"Database interaction and business intelligence over SQLite",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/sqlite",config:{command:"uvx",args:["mcp-server-sqlite","--db-path","<path>"]},envVars:[]},{id:"slack",name:"Slack",description:"Channel management and messaging for Slack workspaces",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/slack",config:{command:"npx",args:["-y","@modelcontextprotocol/server-slack"]},envVars:["SLACK_BOT_TOKEN","SLACK_TEAM_ID"]},{id:"google-drive",name:"Google Drive",description:"File access and search for Google Drive",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/gdrive",config:{command:"npx",args:["-y","@modelcontextprotocol/server-gdrive"]},envVars:["GDRIVE_CREDENTIALS_PATH"]},{id:"google-maps",name:"Google Maps",description:"Location services, directions, and place details",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/google-maps",config:{command:"npx",args:["-y","@modelcontextprotocol/server-google-maps"]},envVars:["GOOGLE_MAPS_API_KEY"]},{id:"puppeteer",name:"Puppeteer",description:"Browser automation and web scraping via Puppeteer",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/puppeteer",config:{command:"npx",args:["-y","@modelcontextprotocol/server-puppeteer"]},envVars:[]},{id:"playwright",name:"Playwright",description:"Cross-browser automation for navigation, screenshots, and data extraction",official:!1,homepage:"https://github.com/microsoft/playwright-mcp",config:{command:"npx",args:["-y","@playwright/mcp@latest"]},envVars:[]},{id:"brave-search",name:"Brave Search",description:"Web and local search using the Brave Search API",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/brave-search",config:{command:"npx",args:["-y","@modelcontextprotocol/server-brave-search"]},envVars:["BRAVE_API_KEY"]},{id:"redis",name:"Redis",description:"Interact with Redis key-value stores",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/redis",config:{command:"npx",args:["-y","@modelcontextprotocol/server-redis","<redis-url>"]},envVars:[]},{id:"sentry",name:"Sentry",description:"Retrieve and analyze Sentry error tracking issues",official:!1,homepage:"https://github.com/getsentry/sentry-mcp",config:{command:"npx",args:["-y","@sentry/mcp-server@latest"]},envVars:["SENTRY_AUTH_TOKEN"]},{id:"linear",name:"Linear",description:"Issue tracking and project management for Linear",official:!1,homepage:"https://linear.app/docs/mcp",config:{command:"npx",args:["-y","mcp-remote","https://mcp.linear.app/sse"]},envVars:[]},{id:"notion",name:"Notion",description:"Notion workspace page and database management",official:!1,homepage:"https://github.com/makenotion/notion-mcp-server",config:{command:"npx",args:["-y","@notionhq/notion-mcp-server"]},envVars:["NOTION_API_KEY"]},{id:"stripe",name:"Stripe",description:"Payment processing, customers, and invoices via Stripe API",official:!1,homepage:"https://github.com/stripe/agent-toolkit",config:{command:"npx",args:["-y","@stripe/mcp","--tools=all"]},envVars:["STRIPE_SECRET_KEY"]},{id:"cloudflare",name:"Cloudflare",description:"Manage Cloudflare Workers, KV, R2, D1, and Workers AI",official:!1,homepage:"https://github.com/cloudflare/mcp-server-cloudflare",config:{command:"npx",args:["-y","mcp-remote","https://observability.mcp.cloudflare.com/sse"]},envVars:[]},{id:"context7",name:"Context7",description:"Up-to-date version-specific library docs injected into prompts",official:!1,homepage:"https://github.com/upstash/context7",config:{command:"npx",args:["-y","@upstash/context7-mcp@latest"]},envVars:[]},{id:"tavily",name:"Tavily",description:"AI-optimized web search with clean structured results",official:!1,homepage:"https://github.com/tavily-ai/tavily-mcp",config:{command:"npx",args:["-y","tavily-mcp@latest"]},envVars:["TAVILY_API_KEY"]},{id:"perplexity",name:"Perplexity",description:"Answer-engine search with deep research and reasoning",official:!1,homepage:"https://github.com/ppl-ai/modelcontextprotocol",config:{command:"npx",args:["-y","server-perplexity-ask"]},envVars:["PERPLEXITY_API_KEY"]},{id:"figma",name:"Figma Dev Mode",description:"First-party Figma design-to-code bridge exposing node tree",official:!1,homepage:"https://help.figma.com/hc/en-us/articles/32132100833559",config:{url:"http://127.0.0.1:3845/sse"},envVars:[]},{id:"supabase",name:"Supabase",description:"Manage Supabase projects, tables, and SQL queries",official:!1,homepage:"https://github.com/supabase-community/supabase-mcp",config:{command:"npx",args:["-y","@supabase/mcp-server-supabase@latest"]},envVars:["SUPABASE_ACCESS_TOKEN"]},{id:"atlassian",name:"Atlassian (Jira/Confluence)",description:"Official Jira and Confluence integration",official:!1,homepage:"https://www.atlassian.com/platform/remote-mcp-server",config:{command:"npx",args:["-y","mcp-remote","https://mcp.atlassian.com/v1/sse"]},envVars:[]},{id:"aws",name:"AWS",description:"AWS services access and best-practice guidance",official:!1,homepage:"https://github.com/awslabs/mcp",config:{command:"uvx",args:["awslabs.core-mcp-server@latest"]},envVars:["AWS_PROFILE","AWS_REGION"]},{id:"obsidian",name:"Obsidian",description:"Read and search notes in an Obsidian vault",official:!1,homepage:"https://github.com/MarkusPfundstein/mcp-obsidian",config:{command:"uvx",args:["mcp-obsidian"]},envVars:["OBSIDIAN_API_KEY"]}],U=[{id:"pdf",name:"PDF",description:"Create, edit, and extract content from PDF documents",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/pdf"},{id:"docx",name:"DOCX",description:"Create and edit Microsoft Word documents",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/docx"},{id:"xlsx",name:"XLSX",description:"Create and edit Excel spreadsheets with formulas and formatting",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/xlsx"},{id:"pptx",name:"PPTX",description:"Create and edit PowerPoint presentations",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/pptx"},{id:"webapp-testing",name:"Webapp Testing",description:"Test web applications using Playwright-driven browser automation",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/webapp-testing"},{id:"playwright-e2e",name:"Playwright E2E",description:"End-to-end browser tests — navigation, forms, assertions, waiting strategies",official:!1,source:"local"},{id:"playwright-visual-testing",name:"Playwright Visual Testing",description:"Visual regression testing — screenshot comparison, pixel diffs, responsive layouts",official:!1,source:"local"},{id:"playwright-accessibility",name:"Playwright Accessibility",description:"Accessibility testing — WCAG compliance, axe-core scans, keyboard navigation",official:!1,source:"local"},{id:"playwright-api-testing",name:"Playwright API Testing",description:"API testing with Playwright request context — REST endpoints, auth flows, contracts",official:!1,source:"local"},{id:"playwright-debug",name:"Playwright Debug",description:"Debug failing tests — trace viewer, inspector, headed mode, flaky test fixes",official:!1,source:"local"},{id:"web-artifacts-builder",name:"Web Artifacts Builder",description:"Build polished interactive web artifacts and demos",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/web-artifacts-builder"},{id:"frontend-design",name:"Frontend Design",description:"Apply frontend UI/UX design patterns and visual polish",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/frontend-design"},{id:"canvas-design",name:"Canvas Design",description:"Canvas-based graphic design and composition techniques",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/canvas-design"},{id:"algorithmic-art",name:"Algorithmic Art",description:"Create generative and algorithmic art",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/algorithmic-art"},{id:"brand-guidelines",name:"Brand Guidelines",description:"Apply brand identity and style guideline specifications",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/brand-guidelines"},{id:"theme-factory",name:"Theme Factory",description:"Generate and customize visual themes",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/theme-factory"},{id:"slack-gif-creator",name:"Slack GIF Creator",description:"Create animated GIFs suitable for Slack",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/slack-gif-creator"},{id:"doc-coauthoring",name:"Doc Coauthoring",description:"Collaborative document authoring and editing workflows",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/doc-coauthoring"},{id:"internal-comms",name:"Internal Comms",description:"Internal communications templates and drafting",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/internal-comms"},{id:"claude-api",name:"Claude API",description:"Build apps with the Claude API and Anthropic SDKs",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/claude-api"},{id:"mcp-builder",name:"MCP Builder",description:"Scaffold and build new Model Context Protocol servers",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/mcp-builder"},{id:"skill-creator",name:"Skill Creator",description:"Scaffold and create new Claude Code skills",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/skill-creator"}],V=[{id:"session-manager-dev",name:"Session Manager Dev",description:"Default dev skillset: /develop (decompose into scheduler PRDs, track to a validated finish), /builder (npm release), /send-feedback (cross-project findings).",official:!1,source:"https://github.com/StanislavBG/claude-code-session-manager/tree/main/plugins/session-manager-dev",bundles:["skills"],marketplace:{add:"bundled",name:"session-manager"}},{id:"code-review",name:"Code Review",description:"Comprehensive code review with best practices and improvement suggestions",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/code-review",bundles:["commands","agents"]},{id:"pr-review-toolkit",name:"PR Review Toolkit",description:"Pull request review automation and workflows",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/pr-review-toolkit",bundles:["commands","agents"]},{id:"commit-commands",name:"Commit Commands",description:"Git commit workflow shortcuts with conventional commit formatting",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/commit-commands",bundles:["commands"]},{id:"feature-dev",name:"Feature Dev",description:"Feature development assistance from spec to implementation",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/feature-dev",bundles:["commands","agents"]},{id:"security-guidance",name:"Security Guidance",description:"Security best-practice review and enforcement",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/security-guidance",bundles:["commands","agents"]},{id:"agent-sdk-dev",name:"Agent SDK Dev",description:"Development tools for building with the Claude Agent SDK",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/agent-sdk-dev",bundles:["commands","skills"]},{id:"plugin-dev",name:"Plugin Dev",description:"Scaffolding and tooling for authoring Claude Code plugins",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/plugin-dev",bundles:["commands","skills"]},{id:"mcp-server-dev",name:"MCP Server Dev",description:"Develop and test Model Context Protocol servers",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/mcp-server-dev",bundles:["commands","skills"]},{id:"skill-creator",name:"Skill Creator",description:"Framework for creating and iterating on new skills",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/skill-creator",bundles:["commands","skills"]},{id:"claude-md-management",name:"CLAUDE.md Management",description:"Manage and maintain CLAUDE.md project memory files",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/claude-md-management",bundles:["commands"]},{id:"typescript-lsp",name:"TypeScript LSP",description:"TypeScript/JavaScript language server integration",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/typescript-lsp",bundles:["hooks","commands"]},{id:"pyright-lsp",name:"Pyright LSP",description:"Python language server integration via Pyright",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/pyright-lsp",bundles:["hooks","commands"]},{id:"rust-analyzer-lsp",name:"Rust Analyzer LSP",description:"Rust language server integration via rust-analyzer",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/rust-analyzer-lsp",bundles:["hooks","commands"]},{id:"gopls-lsp",name:"Go LSP (gopls)",description:"Go language server integration via gopls",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/gopls-lsp",bundles:["hooks","commands"]},{id:"code-simplifier",name:"Code Simplifier",description:"Review changed code for reuse, quality, and efficiency then fix issues",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/code-simplifier",bundles:["commands","agents"]},{id:"hookify",name:"Hookify",description:"Utilities and templates for authoring Claude Code hooks",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/hookify",bundles:["commands","skills"]},{id:"frontend-design-plugin",name:"Frontend Design Plugin",description:"Frontend design assistance and visual polish workflows",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/frontend-design",bundles:["commands","skills","agents"]},{id:"clangd-lsp",name:"clangd-lsp",description:"C/C++ diagnostics via clangd. Requires clangd on $PATH.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/clangd-lsp",bundles:["hooks","commands"]},{id:"csharp-lsp",name:"csharp-lsp",description:"C# diagnostics. Requires OmniSharp or Roslyn LSP on $PATH.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/csharp-lsp",bundles:["hooks","commands"]},{id:"jdtls-lsp",name:"jdtls-lsp",description:"Java diagnostics via Eclipse JDT LS. Requires jdtls on $PATH.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/jdtls-lsp",bundles:["hooks","commands"]},{id:"kotlin-lsp",name:"kotlin-lsp",description:"Kotlin diagnostics. Requires kotlin-language-server on $PATH.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/kotlin-lsp",bundles:["hooks","commands"]},{id:"lua-lsp",name:"lua-lsp",description:"Lua diagnostics. Requires lua-language-server on $PATH.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/lua-lsp",bundles:["hooks","commands"]},{id:"php-lsp",name:"php-lsp",description:"PHP diagnostics. Requires intelephense or phpactor on $PATH.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/php-lsp",bundles:["hooks","commands"]},{id:"swift-lsp",name:"swift-lsp",description:"Swift diagnostics via sourcekit-lsp. Requires sourcekit-lsp on $PATH.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/swift-lsp",bundles:["hooks","commands"]},{id:"github",name:"github",description:"GitHub PRs, issues, gh-style flows.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/github",bundles:["mcp"]},{id:"gitlab",name:"gitlab",description:"GitLab MRs, issues, pipelines.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/gitlab",bundles:["mcp"]},{id:"atlassian",name:"atlassian",description:"Jira / Confluence search and updates.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/atlassian",bundles:["mcp"]},{id:"asana",name:"asana",description:"Asana task and project ops.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/asana",bundles:["mcp"]},{id:"linear",name:"linear",description:"Linear issue tracking — pairs with the Tasks tab.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/linear",bundles:["mcp"]},{id:"notion",name:"notion",description:"Notion document lookup and edits.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/notion",bundles:["mcp"]},{id:"figma",name:"figma",description:"Figma file inspection for UI work.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/figma",bundles:["mcp"]},{id:"vercel",name:"vercel",description:"Vercel deploy diagnostics.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/vercel",bundles:["mcp"]},{id:"firebase",name:"firebase",description:"Firebase project + Firestore ops.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/firebase",bundles:["mcp"]},{id:"supabase",name:"supabase",description:"Supabase database operations.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/supabase",bundles:["mcp"]},{id:"slack",name:"slack",description:"Slack DM / channel posting from agents.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/slack",bundles:["mcp"]},{id:"sentry",name:"sentry",description:"Sentry bug triage and event lookup.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/sentry",bundles:["mcp"]}],K=[{id:"prettier-on-write",name:"Prettier on Write",description:"Auto-format JS/TS/JSON/MD files after edit via prettier",event:"PostToolUse",matcher:"Write|Edit",command:"jq -r '.tool_input.file_path // empty' | grep -E '\\.(js|jsx|ts|tsx|json|md|css|html|yaml|yml)$' | xargs -r -I{} npx --no-install prettier --write {} 2>/dev/null || true"},{id:"black-on-write",name:"Black on Write (Python)",description:"Auto-format Python files after edit via black",event:"PostToolUse",matcher:"Write|Edit",command:"jq -r '.tool_input.file_path // empty' | grep -E '\\.py$' | xargs -r black -q 2>/dev/null || true"},{id:"rustfmt-on-write",name:"rustfmt on Write",description:"Auto-format Rust files after edit via rustfmt",event:"PostToolUse",matcher:"Write|Edit",command:"jq -r '.tool_input.file_path // empty' | grep -E '\\.rs$' | xargs -r rustfmt 2>/dev/null || true"},{id:"gofmt-on-write",name:"gofmt on Write",description:"Auto-format Go files after edit via gofmt",event:"PostToolUse",matcher:"Write|Edit",command:"jq -r '.tool_input.file_path // empty' | grep -E '\\.go$' | xargs -r gofmt -w 2>/dev/null || true"},{id:"block-secret-writes",name:"Block Writes to Secrets",description:"Deny edits to .env, credentials, key files",event:"PreToolUse",matcher:"Write|Edit",command:`path=$(jq -r '.tool_input.file_path // empty'); echo "$path" | grep -qE '(^|/)(\\.env|\\.env\\..+|id_rsa|id_ed25519|.*\\.pem|.*\\.key|credentials\\.json|\\.aws/credentials)$' && { echo '{"decision":"block","reason":"refusing to edit secret file"}'; exit 2; } || true`},{id:"notify-on-stop",name:"Desktop Notify on Stop",description:"Send a desktop notification when Claude finishes a turn",event:"Stop",command:`command -v notify-send >/dev/null && notify-send "Claude Code" "Session ready" || (command -v osascript >/dev/null && osascript -e 'display notification "Session ready" with title "Claude Code"') || true`},{id:"bell-on-notification",name:"Terminal Bell on Notification",description:"Ring the terminal bell on permission prompts / idle notifications",event:"Notification",command:"printf '\\a'"},{id:"log-tool-calls",name:"Log Tool Calls (JSONL)",description:"Append every tool call to ~/.claude/logs/tool-calls.jsonl for audit",event:"PreToolUse",command:"mkdir -p ~/.claude/logs && cat >> ~/.claude/logs/tool-calls.jsonl"},{id:"auto-stage-edits",name:"Auto-stage Edited Files",description:"git add each file Claude edits (inside a repo)",event:"PostToolUse",matcher:"Write|Edit",command:`path=$(jq -r '.tool_input.file_path // empty'); [ -n "$path" ] && git -C "$(dirname "$path")" add "$path" 2>/dev/null || true`},{id:"block-dangerous-bash",name:"Block Dangerous Bash",description:"Refuse rm -rf /, fork bombs, curl|sh pipes",event:"PreToolUse",matcher:"Bash",command:`cmd=$(jq -r '.tool_input.command // empty'); echo "$cmd" | grep -qE '(rm -rf /|:\\(\\)\\{.*\\};|curl.*\\|\\s*(bash|sh)|wget.*\\|\\s*(bash|sh)|mkfs\\.|dd if=.*of=/dev/)' && { echo '{"decision":"block","reason":"dangerous command pattern"}'; exit 2; } || true`},{id:"prepend-cwd-to-prompt",name:"Prepend CWD to Prompt",description:"Add cwd context to every user prompt automatically",event:"UserPromptSubmit",command:'echo "{\\"additionalContext\\":\\"cwd: $(pwd)\\"}"'},{id:"archive-transcript",name:"Archive Transcript on SessionEnd",description:"Copy the session jsonl to ~/.claude/archive/ when done",event:"SessionEnd",command:`src=$(jq -r '.transcript_path // empty'); [ -n "$src" ] && mkdir -p ~/.claude/archive && cp "$src" ~/.claude/archive/ 2>/dev/null || true`}],P=(i,o,a,s)=>`---
|
|
2
2
|
name: ${i}
|
|
3
3
|
description: ${o}
|
|
4
4
|
tools: ${a}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{al as e}from"./index-
|
|
1
|
+
import{al as e}from"./index-BD0ufZqe.js";function o({sidebar:r,detail:s,sidebarWidth:l="18rem"}){return e.jsxs("div",{className:"h-full flex",children:[e.jsx("div",{className:"shrink-0 border-r border-line overflow-y-auto",style:{width:l},children:r}),e.jsx("div",{className:"flex-1 min-w-0 overflow-auto",children:s})]})}export{o as L};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{al as e,aB as c,b0 as xe,aU as ue,b2 as pe,aW as S,m as B,a as z,bb as fe,aT as G}from"./index-
|
|
1
|
+
import{al as e,aB as c,b0 as xe,aU as ue,b2 as pe,aW as S,m as B,a as z,bb as fe,aT as G}from"./index-BD0ufZqe.js";import{P as J}from"./Panel-DIyJXHfp.js";import{L as me}from"./ListDetail-B3goE3Wc.js";import{S as he}from"./SaveBar-CeL4vXRp.js";import{S as H}from"./ScopeSwitcher-BMiHySnz.js";import{P as W}from"./ProvenanceBadge-BSI_2wAv.js";import{M as ge,V as I,g as Z}from"./Library-XA9osRfi.js";import"./monaco-editor-BsIlgG7c.js";import"./Button-sA4lqAao.js";import"./listSkills-C1aWKf0T.js";const be={live:"bg-emerald-400",idle:"bg-amber-400",offline:"bg-fg-faint",attention:"bg-accent",paused:"bg-zinc-500"},je={sm:"w-1.5 h-1.5",md:"w-2 h-2"},ve={on:"live",off:"offline",warn:"attention",live:"live",idle:"idle"};function te({state:l,kind:t,pulse:a=!1,size:d="sm",className:f="",title:b,"aria-label":o}){const j=l??(t?ve[t]:"idle"),r=be[j],g=je[d],x=a?"animate-pulse":"",u=o??b??j;return e.jsx("span",{role:"img","aria-label":u,className:`inline-block rounded-full ${g} ${r} ${x} ${f}`.trim(),title:b})}const ye={failed:"Failed","needs-auth":"Needs auth",pending:"Pending approval"};function Q(l,t){const a=t!=null&&t.ok?t.servers.find(d=>d.name===l):void 0;return!a||a.status==="unknown"?{state:"unprobed",label:"Not checked",probeStatus:(a==null?void 0:a.status)??null,badgeTone:"dim",dotState:"offline"}:a.status==="connected"?{state:"ready",label:"Ready",probeStatus:a.status,badgeTone:"good",dotState:"live"}:{state:"not-ready",label:ye[a.status],probeStatus:a.status,badgeTone:"warn",dotState:"attention"}}const X=(l,t)=>({type:"mcp",name:l,command:t.command,args:t.args,url:t.url}),Ne=["stdio","http","streamable-http","sse","ws"],we=new Set(["workspace"]),Se=new Set(["ide","tasks"]);function Ce(l,t,a){return l==="user"?`${t}/.claude.json`:a?`${a}/.mcp.json`:null}function ke(l){if(l.trim()==="")return{full:{},servers:{},err:null};try{const t=JSON.parse(l),a=t.mcpServers??{};return{full:t,servers:a,err:null}}catch(t){return{full:{},servers:{},err:t.message}}}function Ee(l,t){return JSON.stringify({...l,mcpServers:t},null,2)+`
|
|
2
2
|
`}function Te(l){let t=Object.keys(l).length+1,a=`server-${t}`;for(;l[a];)t+=1,a=`server-${t}`;return a}function Re(){const l=xe(),t=ue(),a=(t==null?void 0:t.cwd)??null,d=pe(s=>s.navFace),f=c.useRef(!1),b=c.useRef(d),[o,j]=c.useState(()=>d==="project"&&a?"project":"user"),[r,g]=c.useState(null),[x,u]=c.useState("installed"),[C,_]=c.useState("");c.useEffect(()=>{if(b.current!==d){if(b.current=d,f.current){f.current=!1;return}j(d==="project"&&a?"project":"user")}},[d,a]);const p=c.useMemo(()=>l?Ce(o,l,a):null,[l,o,a]),k=S(s=>s.files),n=S(s=>s.loadJson),v=S(s=>s.setDraft),m=S(s=>s.saveJson),K=S(s=>s.revert),R=S(s=>s.watchFile),se=S(s=>s.unwatchFile);c.useEffect(()=>{if(p)return k[p]||n(p),R(p),()=>se(p)},[p]);const[ae,F]=c.useState(null),[q,U]=c.useState(null),[D,Y]=c.useState(!1),A=c.useRef(0),L=c.useRef(!0);c.useEffect(()=>()=>{L.current=!1},[]);const V=async()=>{const s=++A.current;Y(!0);try{const i=await window.api.mcp.status();if(!L.current||s!==A.current)return;U(i),i.ok||G.error(i.error??"MCP status probe failed")}catch(i){if(!L.current||s!==A.current)return;U(null),G.error(i.message||"MCP status probe failed")}finally{L.current&&s===A.current&&Y(!1)}};if(c.useEffect(()=>{V()},[]),!l)return e.jsx(B,{title:"loading…"});if(x==="library")return e.jsx(J,{toolbar:e.jsx(I,{active:x,onChange:u}),children:e.jsx(ge,{})});if(o==="project"&&!a)return e.jsx(J,{toolbar:e.jsxs(e.Fragment,{children:[e.jsx(I,{active:x,onChange:u}),e.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),e.jsx(H,{scopes:["user","project"],active:o,onChange:s=>{f.current=!0,j(s)}})]}),children:e.jsx(B,{title:"no active project"})});if(!p)return e.jsx(B,{title:"loading…"});const w=k[p],{full:ne,servers:h,err:le}=w?ke(w.draftRaw):{full:{},servers:{},err:null},M=Object.keys(h).sort(),O=r?h[r]:null,P=s=>{F(null),v(p,Ee(ne,s))},re=()=>{const s=Te(h);P({...h,[s]:{type:"stdio",command:"",args:[]}}),g(s)},oe=s=>{const i={...h};delete i[s],P(i),r===s&&g(null)},ie=(s,i)=>{if(!i||i===s||h[i])return;const y={};for(const N of Object.keys(h))y[N===s?i:N]=h[N];P(y),g(i)},ce=(s,i)=>{P({...h,[s]:i})};return e.jsx(J,{toolbar:e.jsxs(e.Fragment,{children:[e.jsx(I,{active:x,onChange:u}),e.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),e.jsx(H,{scopes:["user","project"],active:o,onChange:s=>{f.current=!0,j(s)}}),e.jsxs("span",{className:"ml-3 px-1.5 py-0.5 text-[10px] rounded border border-line text-fg-faint",children:[M.length," server",M.length===1?"":"s"]}),e.jsx("span",{className:"ml-2 text-fg-faint truncate",children:p}),e.jsx("div",{className:"flex-1"}),r&&O&&e.jsx(W,{scope:o,input:X(r,O),className:"mr-2"}),e.jsx("button",{onClick:V,disabled:D,className:"px-2 py-0.5 text-xs border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi disabled:opacity-50 mr-2",children:D?"checking…":"⟳ test connections"}),e.jsx("button",{onClick:re,className:"px-2 py-0.5 text-xs border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi",children:"+ new server"})]}),footer:w?e.jsx(he,{dirty:w.dirty,busy:w.busy,parseError:ae||le||w.parseError,lastSavedAt:w.lastSavedAt,onSave:async()=>{var y;F(null);const s=((y=w.diskData)==null?void 0:y.mcpServers)??{};for(const[N,E]of Object.entries(h)){if(JSON.stringify(E)===JSON.stringify(s[N]))continue;const $=Z(E);if($.length>0){fe.getState().show("error",`Not saved: "${N}" still contains placeholder ${$.map(de=>de.token).join(", ")} — replace it with a real value`);return}}const i=await m(p);i.ok||F(i.error??"save failed")},onRevert:()=>{F(null),K(p)}}):null,children:e.jsx(me,{sidebar:e.jsxs("div",{className:"py-2",children:[e.jsx("div",{className:"px-2 pb-1",children:e.jsx("input",{value:C,onChange:s=>_(s.target.value),placeholder:"filter…",className:"w-full bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"})}),M.length===0?e.jsx("div",{className:"px-3 py-1 text-xs text-fg-faint italic",children:"no servers"}):M.filter(s=>!C||s.toLowerCase().includes(C.toLowerCase())).map(s=>{var N;const i=Q(s,q),y=(N=h[s].description)==null?void 0:N.trim();return e.jsxs("button",{onClick:()=>g(s),className:`w-full text-left px-3 py-1 text-xs flex flex-col gap-0.5 ${r===s?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:[e.jsxs("span",{className:"flex items-center gap-2 justify-between w-full",children:[e.jsxs("span",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(te,{state:i.dotState,title:i.label}),e.jsx("span",{className:"truncate",children:s})]}),e.jsxs("span",{className:"ml-2 flex items-center gap-2 shrink-0",children:[(()=>{const E=Z(h[s]);return E.length>0?e.jsxs(z,{tone:"warn",title:`${o} scope · ${p}`,children:["unconfigured placeholder: ",E.map($=>$.token).join(", ")]}):null})(),e.jsx(z,{tone:i.badgeTone,children:i.label}),e.jsx(W,{interactive:!1,scope:o,input:X(s,h[s])}),e.jsx("span",{className:"text-fg-faint",children:h[s].type??"stdio"})]})]}),y?e.jsx("span",{className:"pl-5 text-fg-faint truncate",title:y,children:y}):null]},s)})]}),detail:r&&O?e.jsx(Fe,{name:r,server:O,connection:Q(r,q),onTestConnection:V,testing:D,onRename:s=>ie(r,s),onChange:s=>ce(r,s),onRemove:()=>oe(r)}):e.jsx(B,{title:"select a server or click + new"})})})}const Je=c.memo(Re);function Fe({name:l,server:t,connection:a,onTestConnection:d,testing:f,onRename:b,onChange:o,onRemove:j}){var k;const r=t.type??"stdio",g=we.has(l),x=Se.has(l),u=(k=t.permissions)==null?void 0:k.tools,C=u===void 0?"inherit":u==="allow"?"allow":u==="deny"?"deny":"list",_=Array.isArray(u)?u:[],p=(t.disabledTools??[]).join(", ");return e.jsxs("div",{className:"p-4 space-y-4 max-w-2xl",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(te,{state:a.dotState,size:"md",title:a.label}),e.jsx(z,{tone:a.badgeTone,children:a.label}),e.jsx("button",{onClick:d,disabled:f,className:"ml-auto px-2 py-0.5 text-xs border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi disabled:opacity-50",children:f?"checking…":"test connection"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{className:"text-xs text-fg-faint w-20",children:"name"}),e.jsx("input",{defaultValue:l,onBlur:n=>b(n.target.value.trim()),className:"flex-1 bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg font-mono"}),e.jsx("button",{onClick:j,className:"text-xs text-fg-faint hover:text-red-400 px-2 py-1 border border-line rounded",children:"delete"})]}),e.jsx(T,{label:"description",value:t.description??"",onChange:n=>o({...t,description:n||void 0}),placeholder:"what this server does…"}),g?e.jsxs("div",{className:"text-xs px-2 py-1 border border-red-500/50 rounded text-red-300 bg-red-500/5",children:["⚠ ",e.jsx("span",{className:"font-mono",children:l})," is a reserved name — Claude Code will refuse to load this server (v2.1.128+)."]}):x?e.jsxs("div",{className:"text-xs px-2 py-1 border border-yellow-600/50 rounded text-yellow-200 bg-yellow-500/5",children:["⚠ ",e.jsx("span",{className:"font-mono",children:l})," collides with a commonly-bundled MCP name; expect surprises in other tools."]}):null,e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{className:"text-xs text-fg-faint w-20",children:"type"}),e.jsx("select",{value:r,onChange:n=>o({...t,type:n.target.value}),className:"bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg",children:Ne.map(n=>e.jsx("option",{value:n,children:n},n))}),r==="sse"?e.jsx("span",{className:"text-xs text-yellow-400/80",children:"sse is deprecated — prefer streamable-http"}):null]}),r==="stdio"?e.jsxs(e.Fragment,{children:[e.jsx(T,{label:"command",value:t.command??"",onChange:n=>o({...t,command:n}),placeholder:"npx / node / python …"}),e.jsx(T,{label:"args",value:(t.args??[]).join(" "),onChange:n=>o({...t,args:n.split(/\s+/).filter(Boolean)}),placeholder:"space-separated args"}),e.jsx(ee,{label:"env",value:t.env??{},onChange:n=>o({...t,env:n})})]}):e.jsxs(e.Fragment,{children:[e.jsx(T,{label:"url",value:t.url??"",onChange:n=>o({...t,url:n}),placeholder:"https://…"}),e.jsx(ee,{label:"headers",value:t.headers??{},onChange:n=>o({...t,headers:n})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{className:"text-xs text-fg-faint w-20",children:"alwaysLoad"}),e.jsxs("label",{className:"flex items-center gap-2 text-xs text-fg",children:[e.jsx("input",{type:"checkbox",checked:t.alwaysLoad===!0,onChange:n=>o({...t,alwaysLoad:n.target.checked||void 0})}),e.jsx("span",{className:"text-fg-dim",children:"bypass tool-search deferral (v2.1.121+)"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{className:"text-xs text-fg-faint w-20",children:"enabled"}),e.jsxs("label",{className:"flex items-center gap-2 text-xs text-fg",children:[e.jsx("input",{type:"checkbox",checked:t.enabled!==!1,onChange:n=>o({...t,enabled:n.target.checked?void 0:!1})}),e.jsx("span",{className:"text-fg-dim",children:"load this server in new sessions"})]})]}),e.jsx(T,{label:"disabledTools",value:p,onChange:n=>{const v=n.split(",").map(m=>m.trim()).filter(Boolean);o({...t,disabledTools:v.length?v:void 0})},placeholder:"comma-separated tool names to hide"}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("label",{className:"text-xs text-fg-faint w-20 pt-1",children:"permissions"}),e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsxs("select",{value:C,onChange:n=>{const v=n.target.value,m={...t};if(v==="inherit"){if(m.permissions){const{tools:K,...R}=m.permissions;m.permissions=Object.keys(R).length?R:void 0}}else v==="list"?m.permissions={...m.permissions??{},tools:[]}:m.permissions={...m.permissions??{},tools:v};o(m)},className:"bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg",children:[e.jsx("option",{value:"inherit",children:"inherit (default)"}),e.jsx("option",{value:"allow",children:"allow all tools"}),e.jsx("option",{value:"deny",children:"deny all tools"}),e.jsx("option",{value:"list",children:"allowlist…"})]}),C==="list"?e.jsx("input",{value:_.join(", "),onChange:n=>{const v=n.target.value.split(",").map(m=>m.trim()).filter(Boolean);o({...t,permissions:{...t.permissions??{},tools:v}})},placeholder:"comma-separated tool names",className:"w-full bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg font-mono"}):null]})]})]})}function T({label:l,value:t,onChange:a,placeholder:d}){return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{className:"text-xs text-fg-faint w-20",children:l}),e.jsx("input",{value:t,onChange:f=>a(f.target.value),placeholder:d,className:"flex-1 bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg font-mono"})]})}function ee({label:l,value:t,onChange:a}){const[d,f]=c.useState(""),[b,o]=c.useState(""),j=Object.entries(t);return e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("label",{className:"text-xs text-fg-faint w-20 pt-1",children:l}),e.jsxs("div",{className:"flex-1 space-y-1",children:[j.map(([r,g])=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{value:r,onChange:x=>{const u={...t};delete u[r],u[x.target.value]=g,a(u)},className:"w-32 bg-bg-elev border border-line rounded px-2 py-0.5 text-xs text-fg font-mono"}),e.jsx("input",{value:g,onChange:x=>a({...t,[r]:x.target.value}),className:"flex-1 bg-bg-elev border border-line rounded px-2 py-0.5 text-xs text-fg font-mono"}),e.jsx("button",{onClick:()=>{const x={...t};delete x[r],a(x)},className:"text-fg-faint hover:text-red-400 text-xs px-1",children:"×"})]},r)),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{value:d,onChange:r=>f(r.target.value),placeholder:"key",className:"w-32 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg-dim font-mono"}),e.jsx("input",{value:b,onChange:r=>o(r.target.value),placeholder:"value",className:"flex-1 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg-dim font-mono"}),e.jsx("button",{onClick:()=>{d.trim()&&(a({...t,[d.trim()]:b}),f(""),o(""))},className:"px-2 text-xs border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi",children:"+"})]})]})]})}export{Je as McpServers,Te as nextServerName};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aB as i,aT as E,al as e,Z as K,aa as vt,aG as kt,Y as Nt,a9 as wt,L as jt,b0 as Ct,aU as St,m as $t}from"./index-
|
|
1
|
+
import{aB as i,aT as E,al as e,Z as K,aa as vt,aG as kt,Y as Nt,a9 as wt,L as jt,b0 as Ct,aU as St,m as $t}from"./index-BD0ufZqe.js";import"./monaco-editor-BsIlgG7c.js";function Mt(s){return!s||!s.trim()?"default":s.replace(/[^a-zA-Z0-9]/g,"-")}const De=["bg-accent","bg-sage-dark","bg-honey","bg-fg-dim","bg-fg-faint","bg-hive-teal","bg-butter","bg-delta-bad"],Ye=864e5,Et="MEMORY.md",Te=2e3,we=s=>s.replace(/\.md$/,"");function At(s,t,n,l){var v,k,f;const x=new Map(((t==null?void 0:t.entries)??[]).map(o=>[o.name,o])),a=new Set(((v=t==null?void 0:t.index)==null?void 0:v.orphans)??[]),p=new Map;for(const o of(n==null?void 0:n.clusters)??[])for(const b of o.memberSlugs)p.has(b)||p.set(b,o.id);const m=s.filter(o=>o.name!==Et),c=new Map;for(const o of m){const b=we(o.name),u=((k=x.get(o.name))==null?void 0:k.outLinks)??((f=x.get(b))==null?void 0:f.outLinks)??[];for(const j of u){const M=we(j),y=c.get(M)??[];y.includes(b)||y.push(b),c.set(M,y)}}return m.map(o=>{const b=we(o.name),u=x.get(o.name)??x.get(b),j=(u==null?void 0:u.deadRefs)??[],M=(u==null?void 0:u.danglingLinks)??[],y=(u==null?void 0:u.stale)??!1;return{name:o.name,slug:b,path:o.path,description:(u==null?void 0:u.description)??"",bytes:o.bytes,mtimeMs:o.mtimeMs,ageDays:Math.floor((l-o.mtimeMs)/Ye),stale:y,staleReasons:(u==null?void 0:u.reasons)??[],ageOnlyStale:y&&j.length===0,deadRefs:j,broken:j.length>0||M.length>0,danglingLinks:M,outLinks:(u==null?void 0:u.outLinks)??[],inLinks:c.get(b)??[],notIndexed:a.has(o.name)||a.has(b),clusterId:p.get(b)??null,type:(u==null?void 0:u.type)??null,originSessionId:(u==null?void 0:u.originSessionId)??null}})}function Lt(s,t){const n=new Set(t.filter(l=>l.stale).map(l=>l.slug));return((s==null?void 0:s.clusters)??[]).map((l,x)=>({id:l.id,name:l.name,summary:l.summary,memberSlugs:l.memberSlugs,linkCount:l.links.length,retireCount:l.links.filter(a=>/retire/i.test(a.label??"")).length,staleCount:l.memberSlugs.filter(a=>n.has(a)).length,dotClass:De[x%De.length]}))}function ze(s,t,n){const l=t.trim().toLowerCase(),x=l?s.filter(a=>a.slug.toLowerCase().includes(l)||a.description.toLowerCase().includes(l)):s;return n===void 0?x:x.slice(0,n)}function de(s,t,n){let l;return t==="ask"||t==="clusters"||t==="archived"?[]:(t==="all"?l=s:t==="stale"?l=s.filter(x=>x.stale):t==="broken"?l=s.filter(x=>x.broken):t==="recent"?l=s.filter(x=>Date.now()-x.mtimeMs<=7*Ye):t==="unindexed"?l=s.filter(x=>x.notIndexed):t==="cluster:unclustered"?l=s.filter(x=>x.clusterId===null):t.startsWith("cluster:")?l=s.filter(x=>x.clusterId===t.slice(8)):l=s,ze(l,n))}function qe(s,t){const n=[...s];return t==="recent"?n.sort((l,x)=>x.mtimeMs-l.mtimeMs):t==="name"?n.sort((l,x)=>l.slug<x.slug?-1:l.slug>x.slug?1:0):n.sort((l,x)=>x.bytes-l.bytes),n}function Rt(s){return{all:s.length,stale:de(s,"stale","").length,broken:de(s,"broken","").length,recent:de(s,"recent","").length,unindexed:de(s,"unindexed","").length}}function Xe(s){return s.toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")||"untitled_memory"}function Dt(s,t){const n=s===""?[]:s.split(`
|
|
2
2
|
`),l=t===""?[]:t.split(`
|
|
3
3
|
`);if(n.length>Te||l.length>Te)return[...n.map(k=>({sign:"−",text:k})),...l.map(k=>({sign:"+",text:k}))];const x=n.length,a=l.length,p=Array.from({length:x+1},()=>new Array(a+1).fill(0));for(let k=x-1;k>=0;k--)for(let f=a-1;f>=0;f--)p[k][f]=n[k]===l[f]?p[k+1][f+1]+1:Math.max(p[k+1][f],p[k][f+1]);const m=[];let c=0,v=0;for(;c<x&&v<a;)n[c]===l[v]?(c++,v++):p[c+1][v]>=p[c][v+1]?m.push({sign:"−",text:n[c++]}):m.push({sign:"+",text:l[v++]});for(;c<x;)m.push({sign:"−",text:n[c++]});for(;v<a;)m.push({sign:"+",text:l[v++]});return m}const B=s=>s instanceof Error?s.message:String(s);function Ie(s){const t=/^---\r?\n[\s\S]*?\r?\n---[ \t]*(?:\r?\n|$)/.exec(s);return t?{front:t[0],body:s.slice(t[0].length)}:{front:"",body:s}}function Tt(s){return s.split(`
|
|
4
4
|
`).map(t=>t.trim()).find(t=>t.length>0)??""}function It(s,t){const n=s.kind==="agent"?s.agent:null,l=n?`${n.name}|${n.memoryScope??""}`:"",x=n!==null&&n.memoryScope===null,a=i.useMemo(()=>x?null:n&&n.memoryScope?{agent:{name:n.name,scope:n.memoryScope},...t?{cwd:t}:{}}:{workspace:Mt(t),...t?{cwd:t}:{}},[l,x,t]),p=n===null,[m,c]=i.useState(!0),[v,k]=i.useState([]),[f,o]=i.useState(null),[b,u]=i.useState(null),[j,M]=i.useState(!1),[y,C]=i.useState(""),[T,W]=i.useState(!0),[ee,xe]=i.useState([]),[q,A]=i.useState([]),[U,L]=i.useState({}),[me,ye]=i.useState(()=>Date.now()),X=i.useRef(a);X.current=a;const I=i.useCallback(async()=>{if(!a){k([]),o(null),u(null),xe([]),C(""),c(!1);return}try{const h=await window.api.memory.list(a);if(X.current!==a)return;k(h.entries??[]),C(h.dir??""),W(h.autoMemoryEnabled!==!1),h.error&&E.error(`Memory list failed: ${h.error}`);const[d,N]=await Promise.all([window.api.memory.stale(a).catch(w=>(E.error(`Memory staleness check failed: ${B(w)}`),null)),window.api.memory.listArchived(a).catch(()=>({names:[],error:null}))]);if(X.current!==a)return;o(d),xe(N.names??[]),ye(Date.now())}catch(h){E.error(`Memory list failed: ${B(h)}`)}finally{c(!1)}},[a]);i.useEffect(()=>{c(!0),u(null),I(),a&&p&&a.workspace&&window.api.memory.aggregate(a.workspace,!1,t??void 0).then(h=>{X.current===a&&u(h)}).catch(h=>E.error(`Memory clusters failed: ${B(h)}`))},[I]),i.useEffect(()=>{let h=!1;return(async()=>{try{const{agents:d}=await window.api.memory.agents(t??void 0);if(h)return;A(d);const N={};await Promise.all(d.filter(w=>w.memoryScope).map(async w=>{const Y=await window.api.memory.list({agent:{name:w.name,scope:w.memoryScope},...t?{cwd:t}:{}});N[w.name]=(Y.entries??[]).filter(O=>O.name!=="MEMORY.md").length})),h||L(N)}catch(d){h||E.error(`Memory agents failed: ${B(d)}`)}})(),()=>{h=!0}},[t]),i.useEffect(()=>{if(!y)return;const h=y;window.api.config.watch([h]);const d=window.api.config.onChanged(({path:N})=>{(N===h||N.startsWith(h+"/"))&&I()});return()=>{d(),window.api.config.unwatch([h])}},[y,I]);const _=i.useMemo(()=>At(v,f,b,me),[v,f,b,me]),te=i.useMemo(()=>Lt(b,_),[b,_]),ve=i.useMemo(()=>({generatedAt:(b==null?void 0:b.generatedAt)??null,running:j}),[b,j]),R=i.useCallback(async h=>{if(!a)return null;try{const d=await window.api.memory.read(h,a);return d.error?(E.error(`Memory read failed: ${d.error}`),null):d.content}catch(d){return E.error(`Memory read failed: ${B(d)}`),null}},[a]),$=i.useCallback(async(h,d)=>{try{const N=await d();return N.ok?(await I(),!0):(E.error(`${h} failed: ${N.error??"unknown error"}`),!1)}catch(N){return E.error(`${h} failed: ${B(N)}`),!1}},[I]),Q=i.useCallback(async(h,d)=>{if(!a)return!1;const N=await R(h);if(N===null)return!1;const{front:w}=Ie(N);return $("Memory save",()=>window.api.memory.write(h,w+d,a))},[a,R,$]),V=i.useCallback(async(h,d)=>{if(!a)return null;const N=Xe(h),w=Tt(d);if(!await $("Memory create",()=>window.api.memory.create(N,w,a)))return null;const O=`---
|