claude-code-session-manager 0.131.0 → 0.132.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-CYXre0J-.js → AgentLibrary-C09MlPFx.js} +1 -1
- package/dist/assets/{AppSettings-xNSfCj8e.js → AppSettings-DvDKsCnD.js} +2 -2
- package/dist/assets/{Button-BWljh5IK.js → Button-BzG_KdBC.js} +1 -1
- package/dist/assets/{DocumentEditorPane-FUC2hZlp.js → DocumentEditorPane-fm6zsnLM.js} +1 -1
- package/dist/assets/{Extensions-CsyUoklz.js → Extensions-DgxKT_OZ.js} +2 -2
- package/dist/assets/{History-BvNmY9OQ.js → History-Nd3bKjBq.js} +1 -1
- package/dist/assets/{Library-DVXk77zA.js → Library-R71t6VAB.js} +1 -1
- package/dist/assets/{ListDetail-DAAx__24.js → ListDetail-CG50Ul7c.js} +1 -1
- package/dist/assets/{Panel-g2D-e-RM.js → Panel-C7EFG4eU.js} +1 -1
- package/dist/assets/{ProjectClaudeConfig-BDuHJwaO.js → ProjectClaudeConfig-J92iNEGC.js} +1 -1
- package/dist/assets/{ProvenanceBadge-wew4_nf3.js → ProvenanceBadge-C3KB3ILO.js} +1 -1
- package/dist/assets/{Scheduler-CbeUIqD-.js → Scheduler-DeYBA7uc.js} +1 -1
- package/dist/assets/{Settings-B23RsRfm.js → Settings-B6r7N4v-.js} +1 -1
- package/dist/assets/{SkillReferenceGraph-BxQPCfsg.js → SkillReferenceGraph-D7bt3fyB.js} +1 -1
- package/dist/assets/{Skills-4AR2FQrI.js → Skills-GpxtUrFP.js} +1 -1
- package/dist/assets/{SourceChip-jrC0vjfw.js → SourceChip-uyVMCZc7.js} +1 -1
- package/dist/assets/{SystemPrompt-hHoBEnYb.js → SystemPrompt-Cv25uFSM.js} +1 -1
- package/dist/assets/{TiptapBody-FkUqxO9u.js → TiptapBody-uP8fJkbM.js} +1 -1
- package/dist/assets/{Toggle-DQMNWZKT.js → Toggle-DRs80cX-.js} +1 -1
- package/dist/assets/{ViewTabs-DGU0ZuxB.js → ViewTabs-BDkvvzJ8.js} +1 -1
- package/dist/assets/{VoiceButton-BPPvDllh.js → VoiceButton-Cmtz2sQt.js} +1 -1
- package/dist/assets/{historyTotals-D8Oc3wUK.js → historyTotals-DHwAXunq.js} +1 -1
- package/dist/assets/{index-9ajPMXBg.js → index-CBCdyHbZ.js} +287 -287
- package/dist/index.html +1 -1
- package/dist-web/app.js +345 -345
- package/package.json +1 -1
- package/scripts/scheduler-mcp-server.cjs +12 -4
- package/src/main/build-info.json +4 -4
- package/src/main/index.cjs +2 -0
- package/src/main/lib/feedback-remote/macroAdminRoutes.cjs +36 -13
- package/src/main/lib/mcpToolCatalog.cjs +15 -6
- package/src/main/lib/persona-macro/builtinMacros.cjs +17 -0
- package/src/main/lib/persona-macro/macroJobIpc.cjs +57 -11
- package/src/main/lib/persona-macro/macroLibrary.cjs +40 -10
- package/src/main/projectPages.cjs +5 -1
- package/src/main/promptSessionEvents.cjs +10 -6
- package/src/preload/api.d.ts +3 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aN as f,ax as s,a6 as Bt,ac as Kt,b4 as q,ai as Wt,b as Ht,ab as Ut,ay as jt,be as yt,b5 as wt,b8 as T,l as ne,br as Jt,F as Yt,P as Vt,ae as zt,aR as qt,aU as Gt,b9 as Nt}from"./index-9ajPMXBg.js";import{P as Te}from"./Panel-g2D-e-RM.js";import{L as St}from"./ListDetail-DAAx__24.js";import{f as rt,S as $t,m as Qt}from"./Library-DVXk77zA.js";import{a as Qe,u as lt,p as Zt,c as Xt,P as es}from"./ProvenanceBadge-wew4_nf3.js";import{T as ts}from"./Toggle-DQMNWZKT.js";function Ct({filter:e,onFilterChange:t,placeholder:n,summary:a,children:l,primary:r}){const[i,o]=f.useState(!1),h=f.useRef(null),m=f.useRef(null),g=f.useId();return f.useEffect(()=>{if(!i)return;const u=v=>{var b,w;const p=v.target;(b=h.current)!=null&&b.contains(p)||(w=m.current)!=null&&w.contains(p)||o(!1)},x=v=>{v.key==="Escape"&&o(!1)};return window.addEventListener("mousedown",u),window.addEventListener("keydown",x),()=>{window.removeEventListener("mousedown",u),window.removeEventListener("keydown",x)}},[i]),s.jsxs("div",{"data-testid":"extensions-toolbar",className:"relative shrink-0 h-11 flex items-center gap-3 px-3 bg-bg-elev border-b border-line text-xs",children:[s.jsxs("div",{className:"relative shrink-0",children:[s.jsxs("svg",{"aria-hidden":"true",className:"pointer-events-none absolute left-[9px] top-1/2 -translate-y-1/2 text-fg-faint/80",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("circle",{cx:"11",cy:"11",r:"8"}),s.jsx("path",{d:"m21 21-4.3-4.3"})]}),s.jsx("input",{type:"text","data-testid":"extensions-toolbar-filter",value:e,onChange:u=>t(u.target.value),placeholder:n,"aria-label":n,spellCheck:!1,className:"w-[276px] h-7 pl-[29px] pr-[9px] bg-bg-hi border border-line rounded-md text-xs text-fg placeholder:text-fg-faint/80 focus:outline-none focus:border-fg-faint"})]}),s.jsx("span",{"data-testid":"extensions-toolbar-summary",className:"min-w-0 truncate text-fg-faint",children:a}),l,s.jsxs("button",{ref:h,type:"button","data-testid":r.testId,"aria-haspopup":"menu","aria-expanded":i,"aria-controls":i?g:void 0,onClick:()=>o(u=>!u),className:"ml-auto shrink-0 h-7 inline-flex items-center gap-1.5 pl-3 pr-2.5 rounded-md bg-accent text-bg-hi text-[12.5px] font-semibold shadow-sm hover:bg-accent/90",children:[r.label,s.jsx("svg",{"aria-hidden":"true",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"m6 9 6 6 6-6"})})]}),i&&s.jsx("div",{ref:m,id:g,role:"menu","aria-label":r.label,"data-testid":`${r.testId}-menu`,className:`absolute ${Bt.dialog} right-3 top-[42px] min-w-[210px] p-[5px] flex flex-col bg-bg-hi border border-line rounded-lg shadow-lg text-[12.5px] text-fg`,children:r.items.map(u=>s.jsx("button",{type:"button",role:"menuitem","data-testid":u.testId,onClick:()=>{o(!1),u.onSelect()},className:"px-2.5 py-[7px] rounded-[5px] text-left whitespace-nowrap hover:bg-bg-elev",children:u.label},u.testId))})]})}const ss=2;function be(e){return`${e.source}:${e.pluginKey??e.cwd??""}:${e.name}`}const He=new Map,ns=e=>e instanceof Error?e.message:String(e);async function as(e){try{return await window.api.mcp.checkServer(e)}catch(t){const n=ns(t);return q.error(`MCP check of ${e.name} failed: ${n}`),{ok:!1,status:"failed",error:n,checkedAt:Date.now()}}}const ve=Kt((e,t)=>({results:{},checking:{},check:n=>{const a=be(n),l=He.get(a);if(l)return l;e(i=>({checking:{...i.checking,[a]:!0}}));const r=as(n).then(i=>(He.delete(a),e(o=>{const h={...o.checking};return delete h[a],{results:{...o.results,[a]:i},checking:h}}),i));return He.set(a,r),r},checkAll:async n=>{const a=[...new Map(n.map(i=>[be(i),i])).values()];let l=0;const r=async()=>{for(;l<a.length;)await t().check(a[l++])};await Promise.all(Array.from({length:Math.min(ss,a.length)},r))}})),rs=e=>e.results,ls=e=>e.checking,qe={unchecked:"Not checked",connected:"Connected",failed:"Failed","needs-auth":"Needs auth"},Et={unchecked:"border-[1.5px] border-fg-faint/60",connected:"bg-sage",failed:"bg-red-500","needs-auth":"bg-honey"},is={unchecked:"bg-bg-elev text-fg-dim",connected:"bg-sage/15 text-sage-dark",failed:"bg-red-500/10 text-red-700","needs-auth":"bg-honey/15 text-honey-dark"},os={user:"User scope",project:"Project scope",local:"Local scope"},cs=3e4,ds="••••••••",us=/^[A-Za-z0-9_@%+=:,./-]+$/;function ms(e){return us.test(e)?e:`'${e.replace(/'/g,"'\\''")}'`}function Ze(e){return(e.type??"stdio")!=="stdio"}function ps(e){return Ze(e)?e.url??"":e.command?[e.command,...e.args??[]].map(ms).join(" "):""}const it=e=>e.replace(/[^A-Za-z0-9_-]/g,"_");function fs(e,t){return`mcp__${it(e)}__${it(t)}`}const Ue="h-7 inline-flex items-center whitespace-nowrap px-[11px] bg-bg-hi border border-line rounded-md text-[12.5px] text-fg hover:border-rule disabled:opacity-50 disabled:hover:border-line",Xe="text-[11px] font-semibold tracking-[.06em] uppercase text-fg-faint",Je="px-3 py-2.5 border border-dashed border-rule rounded-md text-[12.5px] text-fg-faint";function ot({name:e,server:t,scope:n,fileLabel:a,plugin:l,checkRequest:r,provenance:i,onChange:o,editing:h=!1,onEditingChange:m,editor:g}){const u=l!==void 0,x=!u&&h,v=r?be(r):null,p=ve(P=>v===null?void 0:P.results[v]),b=ve(P=>v===null?!1:P.checking[v]===!0),w=ve(P=>P.check);xs(cs,p!==void 0);const C=(p==null?void 0:p.status)??"unchecked",A=Date.now(),J=Ze(t);return s.jsxs("div",{"data-testid":"mcp-detail",className:"flex flex-col gap-[18px] px-6 py-[18px]",children:[s.jsxs("div",{className:"flex items-start gap-4",children:[s.jsxs("div",{className:"min-w-0 flex flex-col gap-2",children:[s.jsxs("div",{className:"min-w-0 flex items-center gap-3",children:[s.jsx("h2",{"data-testid":"mcp-detail-name",className:"min-w-0 truncate text-[22px] leading-tight font-semibold tracking-[-.01em] text-fg",children:e}),s.jsxs("span",{"data-testid":"mcp-detail-status","data-status":C,title:p&&!p.ok?p.error:void 0,className:`shrink-0 inline-flex items-center gap-1.5 h-[22px] px-[9px] rounded-full text-xs font-semibold ${is[C]}`,children:[s.jsx("span",{"aria-hidden":"true",className:`w-1.5 h-1.5 shrink-0 box-border rounded-full ${Et[C]}${b?" animate-pulse":""}`}),qe[C]]}),b?s.jsx("span",{"data-testid":"mcp-detail-checked",className:"shrink-0 text-xs text-fg-faint",children:"checking…"}):p?s.jsxs("span",{"data-testid":"mcp-detail-checked",title:new Date(p.checkedAt).toLocaleString(),className:"shrink-0 text-xs text-fg-faint",children:["checked ",Wt(Math.min(p.checkedAt,A),A)]}):null]}),s.jsxs("div",{"data-testid":"mcp-detail-meta",className:"flex flex-wrap items-center gap-2 text-xs text-fg-faint",children:[s.jsx(Qe,{scope:n,input:i,interactive:!1}),s.jsx("span",{"data-testid":"mcp-detail-transport",className:"inline-flex",children:s.jsx(Ht,{tone:"dim",children:u?"plugin":t.type??"stdio"})}),u?s.jsxs(s.Fragment,{children:[s.jsxs("span",{"data-testid":"mcp-detail-plugin",children:["via the ",l," plugin"]}),s.jsx("span",{"aria-hidden":"true",className:"text-fg-faint/60",children:"·"}),s.jsx("span",{"data-testid":"mcp-detail-readonly",children:"read-only"})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{"data-testid":"mcp-detail-scope",children:os[n]}),s.jsx("span",{"aria-hidden":"true",className:"text-fg-faint/60",children:"·"}),s.jsxs("span",{"data-testid":"mcp-detail-keypath",className:"min-w-0 font-mono text-[11.5px] text-fg-dim break-words",children:[a," › mcpServers › ",e]})]})]})]}),s.jsxs("div",{className:"ml-auto shrink-0 flex items-center gap-2",children:[s.jsx("button",{type:"button","data-testid":"mcp-check-again",onClick:()=>{r&&w(r)},disabled:r===null||b,className:Ue,children:b?"Checking…":"Check again"}),u?null:x?s.jsx("button",{type:"button","data-testid":"mcp-edit-done",onClick:()=>m==null?void 0:m(!1),className:Ue,children:"Done"}):s.jsx("button",{type:"button","data-testid":"mcp-edit-json",onClick:()=>m==null?void 0:m(!0),className:Ue,children:"Edit JSON"})]})]}),x?g:s.jsxs(s.Fragment,{children:[s.jsx(hs,{server:t,readOnly:u}),u?null:J?s.jsx(ct,{testId:"mcp-headers",label:"Headers",noun:"header",separator:":",emptyText:"No headers set",values:t.headers??{},onAdd:(P,B)=>o==null?void 0:o({...t,headers:{...t.headers??{},[P]:B}})}):s.jsx(ct,{testId:"mcp-env",label:"Environment",noun:"variable",separator:"=",emptyText:"No variables set",values:t.env??{},onAdd:(P,B)=>o==null?void 0:o({...t,env:{...t.env??{},[P]:B}})}),s.jsx(gs,{serverName:e,result:p})]})]})}function xs(e,t){const[,n]=f.useState(0);f.useEffect(()=>{if(!t)return;const a=window.setInterval(()=>n(l=>l+1),e);return()=>window.clearInterval(a)},[e,t])}function hs({server:e,readOnly:t}){const n=Ze(e),a=ps(e),l=async()=>{await Ut(a)?q.success(n?"URL copied":"Command copied"):q.error(n?"Copy failed — the URL was not copied":"Copy failed — the command was not copied")};return s.jsxs("section",{className:"flex flex-col gap-[7px]",children:[s.jsx("h3",{className:Xe,children:"Command"}),s.jsxs("div",{"data-testid":"mcp-command-box",className:"flex items-center gap-2.5 px-3 py-2.5 bg-bg-hi border border-line rounded-md font-mono text-[13px] text-fg",children:[n?null:s.jsx("span",{"aria-hidden":"true",className:"shrink-0 text-fg-faint/60",children:"$"}),a?s.jsx("span",{"data-testid":"mcp-command",className:"min-w-0 break-words",children:a}):s.jsx("span",{"data-testid":"mcp-command-empty",className:"min-w-0 font-sans text-[12.5px] text-fg-faint",children:t?n?"No URL set.":"No command set.":n?"No URL set — Edit JSON to add one.":"No command set — Edit JSON to add one."}),s.jsx("button",{type:"button","data-testid":"mcp-command-copy",onClick:()=>void l(),disabled:!a,className:"ml-auto shrink-0 font-sans text-xs text-fg-faint hover:text-fg disabled:opacity-50 disabled:hover:text-fg-faint",children:"Copy"})]})]})}function ct({testId:e,label:t,noun:n,separator:a,emptyText:l,values:r,onAdd:i}){const[o,h]=f.useState(()=>new Set),[m,g]=f.useState(!1),[u,x]=f.useState(""),v=f.useRef(null),p=Object.keys(r),b=u.trim(),w=b!==""&&!/\s/.test(b)&&!b.includes(a),C=N=>h(L=>{const G=new Set(L);return G.has(N)?G.delete(N):G.add(N),G}),A=()=>{g(!1),x("")},J=()=>{var N;w&&(i(b,((N=v.current)==null?void 0:N.value)??""),A())},P=N=>{N.key==="Enter"?(N.preventDefault(),J()):N.key==="Escape"&&(N.preventDefault(),A())},B=s.jsxs("button",{type:"button","data-testid":`${e}-add`,onClick:()=>g(!0),className:"shrink-0 text-[12.5px] font-semibold text-accent hover:text-accent-dark",children:["+ Add ",n]});return s.jsxs("section",{"data-testid":e,className:"flex flex-col gap-[7px]",children:[s.jsx("h3",{className:Xe,children:t}),p.length===0&&!m?s.jsxs("div",{"data-testid":`${e}-empty`,className:"flex items-center gap-2.5 px-3 py-2.5 border border-dashed border-rule rounded-md text-[12.5px] text-fg-faint",children:[l,s.jsx("span",{className:"ml-auto",children:B})]}):null,p.length>0?s.jsx("div",{className:"bg-bg-hi border border-line rounded-md divide-y divide-line",children:p.map(N=>{const L=o.has(N);return s.jsxs("div",{"data-testid":`${e}-row-${N}`,className:"flex items-center gap-2.5 px-3 py-2 font-mono text-[12.5px]",children:[s.jsx("span",{className:"shrink-0 font-semibold text-fg",children:N}),s.jsx("span",{"aria-hidden":"true",className:"shrink-0 text-fg-faint/60",children:a}),s.jsx("span",{"data-testid":`${e}-value-${N}`,title:L?void 0:"Hidden — Show reveals it",className:`min-w-0 break-words ${L?"text-fg-dim":"text-fg-faint tracking-wider"}`,children:L?r[N]:ds}),s.jsx("button",{type:"button","data-testid":`${e}-reveal-${N}`,"aria-pressed":L,"aria-label":`${L?"Hide":"Show"} the value of ${N}`,onClick:()=>C(N),className:"ml-auto shrink-0 font-sans text-xs text-fg-faint hover:text-fg",children:L?"Hide":"Show"})]},N)})}):null,m?s.jsxs("div",{"data-testid":`${e}-add-form`,className:"flex items-center gap-2 px-3 py-2 bg-bg-hi border border-line rounded-md",children:[s.jsx("input",{"data-testid":`${e}-new-key`,"aria-label":`New ${n} name`,value:u,onChange:N=>x(N.target.value),onKeyDown:P,placeholder:n==="variable"?"KEY":"Header-Name",spellCheck:!1,autoFocus:!0,className:"w-44 h-7 px-2 bg-bg border border-line rounded font-mono text-xs text-fg"}),s.jsx("span",{"aria-hidden":"true",className:"font-mono text-xs text-fg-faint",children:a}),s.jsx("input",{ref:v,type:"password",autoComplete:"off","data-testid":`${e}-new-value`,"aria-label":`New ${n} value`,onKeyDown:P,placeholder:"value",spellCheck:!1,className:"flex-1 min-w-0 h-7 px-2 bg-bg border border-line rounded font-mono text-xs text-fg"}),s.jsx("button",{type:"button","data-testid":`${e}-add-confirm`,onClick:J,disabled:!w,className:"shrink-0 h-7 px-2.5 rounded-md bg-accent text-bg-hi text-xs font-semibold hover:bg-accent/90 disabled:opacity-50 disabled:hover:bg-accent",children:"Add"}),s.jsx("button",{type:"button","data-testid":`${e}-add-cancel`,onClick:A,className:"shrink-0 h-7 px-2 text-xs text-fg-faint hover:text-fg",children:"Cancel"})]}):p.length>0?s.jsx("div",{children:B}):null]})}function gs({serverName:e,result:t}){return s.jsxs("section",{"data-testid":"mcp-tools",className:"flex flex-col gap-[7px]",children:[s.jsxs("h3",{className:`flex items-baseline gap-2 ${Xe}`,children:["Tools",t!=null&&t.ok?s.jsxs(s.Fragment,{children:[s.jsx("span",{"data-testid":"mcp-tools-count",className:"font-mono font-medium tracking-normal text-fg-faint/60",children:t.tools.length}),s.jsx("span",{className:"font-normal tracking-normal normal-case text-fg-faint/80",children:"from the last check"})]}):null]}),t?t.ok?t.tools.length===0?s.jsx("div",{"data-testid":"mcp-tools-empty",className:Je,children:"The last check listed no tools."}):s.jsx("div",{className:"bg-bg-hi border border-line rounded-md divide-y divide-line",children:t.tools.map((n,a)=>s.jsxs("div",{"data-testid":`mcp-tool-row-${n.name}`,className:"grid grid-cols-[120px_minmax(0,1fr)_auto] items-baseline gap-4 px-3 py-2.5",children:[s.jsx("span",{title:n.name,className:"truncate font-mono text-[12.5px] font-semibold text-fg",children:n.name}),s.jsx("span",{title:n.description||void 0,className:"line-clamp-2 text-[12.5px] text-fg-dim",children:n.description??""}),s.jsx("span",{className:"font-mono text-[11px] text-fg-faint/80",children:fs(e,n.name)})]},`${a}:${n.name}`))}):s.jsxs("div",{"data-testid":"mcp-tools-empty",className:Je,children:[t.status==="needs-auth"?"The last check needs auth":"The last check failed",": ",t.error]}):s.jsx("div",{"data-testid":"mcp-tools-empty",className:Je,children:"Check this server to list its tools."})]})}const et=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/,Ye="disable-model-invocation",At=/^\s*disable-model-invocation\s*:/;function bs(e){const t=e.match(et);if(!t)return!1;for(const n of t[1].split(/\r?\n/)){if(!At.test(n))continue;const a=n.slice(n.indexOf(":")+1).trim().toLowerCase();return a==="true"||a==="yes"}return!1}function vs(e){const t=e.trim();return t.length>=2&&(t[0]==='"'&&t[t.length-1]==='"'||t[0]==="'"&&t[t.length-1]==="'")?t.slice(1,-1):t}function de(e){return e.length-e.trimStart().length}function Oe(e){const t=e.match(et);if(!t)return{name:null,description:null,body:e};const n=t[1].split(/\r?\n/),a=t[2]??"";let l=null,r=null;for(let i=0;i<n.length;i++){const o=n[i],h=o.match(/^(\s*)(name|description)\s*:(.*)$/);if(!h)continue;const[,,m,g]=h,u=g.trim(),x=de(o);let v;if(u===""||u===">-"||u===">"||u==="|-"||u==="|"){const p=[];let b=i+1;for(;b<n.length&&n[b].trim()!==""&&de(n[b])>x;)p.push(n[b].trim()),b++;v=p.join(" ")}else v=vs(u);m==="name"?l=v:r=v}return{name:l,description:r,body:a}}function ks(e,t){const n=e.match(et);if(!n){if(!t)return e;const i=e.startsWith(`
|
|
1
|
+
import{aN as f,ax as s,a6 as Bt,ac as Kt,b4 as q,ai as Wt,b as Ht,ab as Ut,ay as jt,be as yt,b5 as wt,b8 as T,l as ne,br as Jt,F as Yt,P as Vt,ae as zt,aR as qt,aU as Gt,b9 as Nt}from"./index-CBCdyHbZ.js";import{P as Te}from"./Panel-C7EFG4eU.js";import{L as St}from"./ListDetail-CG50Ul7c.js";import{f as rt,S as $t,m as Qt}from"./Library-R71t6VAB.js";import{a as Qe,u as lt,p as Zt,c as Xt,P as es}from"./ProvenanceBadge-C3KB3ILO.js";import{T as ts}from"./Toggle-DRs80cX-.js";function Ct({filter:e,onFilterChange:t,placeholder:n,summary:a,children:l,primary:r}){const[i,o]=f.useState(!1),h=f.useRef(null),m=f.useRef(null),g=f.useId();return f.useEffect(()=>{if(!i)return;const u=v=>{var b,w;const p=v.target;(b=h.current)!=null&&b.contains(p)||(w=m.current)!=null&&w.contains(p)||o(!1)},x=v=>{v.key==="Escape"&&o(!1)};return window.addEventListener("mousedown",u),window.addEventListener("keydown",x),()=>{window.removeEventListener("mousedown",u),window.removeEventListener("keydown",x)}},[i]),s.jsxs("div",{"data-testid":"extensions-toolbar",className:"relative shrink-0 h-11 flex items-center gap-3 px-3 bg-bg-elev border-b border-line text-xs",children:[s.jsxs("div",{className:"relative shrink-0",children:[s.jsxs("svg",{"aria-hidden":"true",className:"pointer-events-none absolute left-[9px] top-1/2 -translate-y-1/2 text-fg-faint/80",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("circle",{cx:"11",cy:"11",r:"8"}),s.jsx("path",{d:"m21 21-4.3-4.3"})]}),s.jsx("input",{type:"text","data-testid":"extensions-toolbar-filter",value:e,onChange:u=>t(u.target.value),placeholder:n,"aria-label":n,spellCheck:!1,className:"w-[276px] h-7 pl-[29px] pr-[9px] bg-bg-hi border border-line rounded-md text-xs text-fg placeholder:text-fg-faint/80 focus:outline-none focus:border-fg-faint"})]}),s.jsx("span",{"data-testid":"extensions-toolbar-summary",className:"min-w-0 truncate text-fg-faint",children:a}),l,s.jsxs("button",{ref:h,type:"button","data-testid":r.testId,"aria-haspopup":"menu","aria-expanded":i,"aria-controls":i?g:void 0,onClick:()=>o(u=>!u),className:"ml-auto shrink-0 h-7 inline-flex items-center gap-1.5 pl-3 pr-2.5 rounded-md bg-accent text-bg-hi text-[12.5px] font-semibold shadow-sm hover:bg-accent/90",children:[r.label,s.jsx("svg",{"aria-hidden":"true",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"m6 9 6 6 6-6"})})]}),i&&s.jsx("div",{ref:m,id:g,role:"menu","aria-label":r.label,"data-testid":`${r.testId}-menu`,className:`absolute ${Bt.dialog} right-3 top-[42px] min-w-[210px] p-[5px] flex flex-col bg-bg-hi border border-line rounded-lg shadow-lg text-[12.5px] text-fg`,children:r.items.map(u=>s.jsx("button",{type:"button",role:"menuitem","data-testid":u.testId,onClick:()=>{o(!1),u.onSelect()},className:"px-2.5 py-[7px] rounded-[5px] text-left whitespace-nowrap hover:bg-bg-elev",children:u.label},u.testId))})]})}const ss=2;function be(e){return`${e.source}:${e.pluginKey??e.cwd??""}:${e.name}`}const He=new Map,ns=e=>e instanceof Error?e.message:String(e);async function as(e){try{return await window.api.mcp.checkServer(e)}catch(t){const n=ns(t);return q.error(`MCP check of ${e.name} failed: ${n}`),{ok:!1,status:"failed",error:n,checkedAt:Date.now()}}}const ve=Kt((e,t)=>({results:{},checking:{},check:n=>{const a=be(n),l=He.get(a);if(l)return l;e(i=>({checking:{...i.checking,[a]:!0}}));const r=as(n).then(i=>(He.delete(a),e(o=>{const h={...o.checking};return delete h[a],{results:{...o.results,[a]:i},checking:h}}),i));return He.set(a,r),r},checkAll:async n=>{const a=[...new Map(n.map(i=>[be(i),i])).values()];let l=0;const r=async()=>{for(;l<a.length;)await t().check(a[l++])};await Promise.all(Array.from({length:Math.min(ss,a.length)},r))}})),rs=e=>e.results,ls=e=>e.checking,qe={unchecked:"Not checked",connected:"Connected",failed:"Failed","needs-auth":"Needs auth"},Et={unchecked:"border-[1.5px] border-fg-faint/60",connected:"bg-sage",failed:"bg-red-500","needs-auth":"bg-honey"},is={unchecked:"bg-bg-elev text-fg-dim",connected:"bg-sage/15 text-sage-dark",failed:"bg-red-500/10 text-red-700","needs-auth":"bg-honey/15 text-honey-dark"},os={user:"User scope",project:"Project scope",local:"Local scope"},cs=3e4,ds="••••••••",us=/^[A-Za-z0-9_@%+=:,./-]+$/;function ms(e){return us.test(e)?e:`'${e.replace(/'/g,"'\\''")}'`}function Ze(e){return(e.type??"stdio")!=="stdio"}function ps(e){return Ze(e)?e.url??"":e.command?[e.command,...e.args??[]].map(ms).join(" "):""}const it=e=>e.replace(/[^A-Za-z0-9_-]/g,"_");function fs(e,t){return`mcp__${it(e)}__${it(t)}`}const Ue="h-7 inline-flex items-center whitespace-nowrap px-[11px] bg-bg-hi border border-line rounded-md text-[12.5px] text-fg hover:border-rule disabled:opacity-50 disabled:hover:border-line",Xe="text-[11px] font-semibold tracking-[.06em] uppercase text-fg-faint",Je="px-3 py-2.5 border border-dashed border-rule rounded-md text-[12.5px] text-fg-faint";function ot({name:e,server:t,scope:n,fileLabel:a,plugin:l,checkRequest:r,provenance:i,onChange:o,editing:h=!1,onEditingChange:m,editor:g}){const u=l!==void 0,x=!u&&h,v=r?be(r):null,p=ve(P=>v===null?void 0:P.results[v]),b=ve(P=>v===null?!1:P.checking[v]===!0),w=ve(P=>P.check);xs(cs,p!==void 0);const C=(p==null?void 0:p.status)??"unchecked",A=Date.now(),J=Ze(t);return s.jsxs("div",{"data-testid":"mcp-detail",className:"flex flex-col gap-[18px] px-6 py-[18px]",children:[s.jsxs("div",{className:"flex items-start gap-4",children:[s.jsxs("div",{className:"min-w-0 flex flex-col gap-2",children:[s.jsxs("div",{className:"min-w-0 flex items-center gap-3",children:[s.jsx("h2",{"data-testid":"mcp-detail-name",className:"min-w-0 truncate text-[22px] leading-tight font-semibold tracking-[-.01em] text-fg",children:e}),s.jsxs("span",{"data-testid":"mcp-detail-status","data-status":C,title:p&&!p.ok?p.error:void 0,className:`shrink-0 inline-flex items-center gap-1.5 h-[22px] px-[9px] rounded-full text-xs font-semibold ${is[C]}`,children:[s.jsx("span",{"aria-hidden":"true",className:`w-1.5 h-1.5 shrink-0 box-border rounded-full ${Et[C]}${b?" animate-pulse":""}`}),qe[C]]}),b?s.jsx("span",{"data-testid":"mcp-detail-checked",className:"shrink-0 text-xs text-fg-faint",children:"checking…"}):p?s.jsxs("span",{"data-testid":"mcp-detail-checked",title:new Date(p.checkedAt).toLocaleString(),className:"shrink-0 text-xs text-fg-faint",children:["checked ",Wt(Math.min(p.checkedAt,A),A)]}):null]}),s.jsxs("div",{"data-testid":"mcp-detail-meta",className:"flex flex-wrap items-center gap-2 text-xs text-fg-faint",children:[s.jsx(Qe,{scope:n,input:i,interactive:!1}),s.jsx("span",{"data-testid":"mcp-detail-transport",className:"inline-flex",children:s.jsx(Ht,{tone:"dim",children:u?"plugin":t.type??"stdio"})}),u?s.jsxs(s.Fragment,{children:[s.jsxs("span",{"data-testid":"mcp-detail-plugin",children:["via the ",l," plugin"]}),s.jsx("span",{"aria-hidden":"true",className:"text-fg-faint/60",children:"·"}),s.jsx("span",{"data-testid":"mcp-detail-readonly",children:"read-only"})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{"data-testid":"mcp-detail-scope",children:os[n]}),s.jsx("span",{"aria-hidden":"true",className:"text-fg-faint/60",children:"·"}),s.jsxs("span",{"data-testid":"mcp-detail-keypath",className:"min-w-0 font-mono text-[11.5px] text-fg-dim break-words",children:[a," › mcpServers › ",e]})]})]})]}),s.jsxs("div",{className:"ml-auto shrink-0 flex items-center gap-2",children:[s.jsx("button",{type:"button","data-testid":"mcp-check-again",onClick:()=>{r&&w(r)},disabled:r===null||b,className:Ue,children:b?"Checking…":"Check again"}),u?null:x?s.jsx("button",{type:"button","data-testid":"mcp-edit-done",onClick:()=>m==null?void 0:m(!1),className:Ue,children:"Done"}):s.jsx("button",{type:"button","data-testid":"mcp-edit-json",onClick:()=>m==null?void 0:m(!0),className:Ue,children:"Edit JSON"})]})]}),x?g:s.jsxs(s.Fragment,{children:[s.jsx(hs,{server:t,readOnly:u}),u?null:J?s.jsx(ct,{testId:"mcp-headers",label:"Headers",noun:"header",separator:":",emptyText:"No headers set",values:t.headers??{},onAdd:(P,B)=>o==null?void 0:o({...t,headers:{...t.headers??{},[P]:B}})}):s.jsx(ct,{testId:"mcp-env",label:"Environment",noun:"variable",separator:"=",emptyText:"No variables set",values:t.env??{},onAdd:(P,B)=>o==null?void 0:o({...t,env:{...t.env??{},[P]:B}})}),s.jsx(gs,{serverName:e,result:p})]})]})}function xs(e,t){const[,n]=f.useState(0);f.useEffect(()=>{if(!t)return;const a=window.setInterval(()=>n(l=>l+1),e);return()=>window.clearInterval(a)},[e,t])}function hs({server:e,readOnly:t}){const n=Ze(e),a=ps(e),l=async()=>{await Ut(a)?q.success(n?"URL copied":"Command copied"):q.error(n?"Copy failed — the URL was not copied":"Copy failed — the command was not copied")};return s.jsxs("section",{className:"flex flex-col gap-[7px]",children:[s.jsx("h3",{className:Xe,children:"Command"}),s.jsxs("div",{"data-testid":"mcp-command-box",className:"flex items-center gap-2.5 px-3 py-2.5 bg-bg-hi border border-line rounded-md font-mono text-[13px] text-fg",children:[n?null:s.jsx("span",{"aria-hidden":"true",className:"shrink-0 text-fg-faint/60",children:"$"}),a?s.jsx("span",{"data-testid":"mcp-command",className:"min-w-0 break-words",children:a}):s.jsx("span",{"data-testid":"mcp-command-empty",className:"min-w-0 font-sans text-[12.5px] text-fg-faint",children:t?n?"No URL set.":"No command set.":n?"No URL set — Edit JSON to add one.":"No command set — Edit JSON to add one."}),s.jsx("button",{type:"button","data-testid":"mcp-command-copy",onClick:()=>void l(),disabled:!a,className:"ml-auto shrink-0 font-sans text-xs text-fg-faint hover:text-fg disabled:opacity-50 disabled:hover:text-fg-faint",children:"Copy"})]})]})}function ct({testId:e,label:t,noun:n,separator:a,emptyText:l,values:r,onAdd:i}){const[o,h]=f.useState(()=>new Set),[m,g]=f.useState(!1),[u,x]=f.useState(""),v=f.useRef(null),p=Object.keys(r),b=u.trim(),w=b!==""&&!/\s/.test(b)&&!b.includes(a),C=N=>h(L=>{const G=new Set(L);return G.has(N)?G.delete(N):G.add(N),G}),A=()=>{g(!1),x("")},J=()=>{var N;w&&(i(b,((N=v.current)==null?void 0:N.value)??""),A())},P=N=>{N.key==="Enter"?(N.preventDefault(),J()):N.key==="Escape"&&(N.preventDefault(),A())},B=s.jsxs("button",{type:"button","data-testid":`${e}-add`,onClick:()=>g(!0),className:"shrink-0 text-[12.5px] font-semibold text-accent hover:text-accent-dark",children:["+ Add ",n]});return s.jsxs("section",{"data-testid":e,className:"flex flex-col gap-[7px]",children:[s.jsx("h3",{className:Xe,children:t}),p.length===0&&!m?s.jsxs("div",{"data-testid":`${e}-empty`,className:"flex items-center gap-2.5 px-3 py-2.5 border border-dashed border-rule rounded-md text-[12.5px] text-fg-faint",children:[l,s.jsx("span",{className:"ml-auto",children:B})]}):null,p.length>0?s.jsx("div",{className:"bg-bg-hi border border-line rounded-md divide-y divide-line",children:p.map(N=>{const L=o.has(N);return s.jsxs("div",{"data-testid":`${e}-row-${N}`,className:"flex items-center gap-2.5 px-3 py-2 font-mono text-[12.5px]",children:[s.jsx("span",{className:"shrink-0 font-semibold text-fg",children:N}),s.jsx("span",{"aria-hidden":"true",className:"shrink-0 text-fg-faint/60",children:a}),s.jsx("span",{"data-testid":`${e}-value-${N}`,title:L?void 0:"Hidden — Show reveals it",className:`min-w-0 break-words ${L?"text-fg-dim":"text-fg-faint tracking-wider"}`,children:L?r[N]:ds}),s.jsx("button",{type:"button","data-testid":`${e}-reveal-${N}`,"aria-pressed":L,"aria-label":`${L?"Hide":"Show"} the value of ${N}`,onClick:()=>C(N),className:"ml-auto shrink-0 font-sans text-xs text-fg-faint hover:text-fg",children:L?"Hide":"Show"})]},N)})}):null,m?s.jsxs("div",{"data-testid":`${e}-add-form`,className:"flex items-center gap-2 px-3 py-2 bg-bg-hi border border-line rounded-md",children:[s.jsx("input",{"data-testid":`${e}-new-key`,"aria-label":`New ${n} name`,value:u,onChange:N=>x(N.target.value),onKeyDown:P,placeholder:n==="variable"?"KEY":"Header-Name",spellCheck:!1,autoFocus:!0,className:"w-44 h-7 px-2 bg-bg border border-line rounded font-mono text-xs text-fg"}),s.jsx("span",{"aria-hidden":"true",className:"font-mono text-xs text-fg-faint",children:a}),s.jsx("input",{ref:v,type:"password",autoComplete:"off","data-testid":`${e}-new-value`,"aria-label":`New ${n} value`,onKeyDown:P,placeholder:"value",spellCheck:!1,className:"flex-1 min-w-0 h-7 px-2 bg-bg border border-line rounded font-mono text-xs text-fg"}),s.jsx("button",{type:"button","data-testid":`${e}-add-confirm`,onClick:J,disabled:!w,className:"shrink-0 h-7 px-2.5 rounded-md bg-accent text-bg-hi text-xs font-semibold hover:bg-accent/90 disabled:opacity-50 disabled:hover:bg-accent",children:"Add"}),s.jsx("button",{type:"button","data-testid":`${e}-add-cancel`,onClick:A,className:"shrink-0 h-7 px-2 text-xs text-fg-faint hover:text-fg",children:"Cancel"})]}):p.length>0?s.jsx("div",{children:B}):null]})}function gs({serverName:e,result:t}){return s.jsxs("section",{"data-testid":"mcp-tools",className:"flex flex-col gap-[7px]",children:[s.jsxs("h3",{className:`flex items-baseline gap-2 ${Xe}`,children:["Tools",t!=null&&t.ok?s.jsxs(s.Fragment,{children:[s.jsx("span",{"data-testid":"mcp-tools-count",className:"font-mono font-medium tracking-normal text-fg-faint/60",children:t.tools.length}),s.jsx("span",{className:"font-normal tracking-normal normal-case text-fg-faint/80",children:"from the last check"})]}):null]}),t?t.ok?t.tools.length===0?s.jsx("div",{"data-testid":"mcp-tools-empty",className:Je,children:"The last check listed no tools."}):s.jsx("div",{className:"bg-bg-hi border border-line rounded-md divide-y divide-line",children:t.tools.map((n,a)=>s.jsxs("div",{"data-testid":`mcp-tool-row-${n.name}`,className:"grid grid-cols-[120px_minmax(0,1fr)_auto] items-baseline gap-4 px-3 py-2.5",children:[s.jsx("span",{title:n.name,className:"truncate font-mono text-[12.5px] font-semibold text-fg",children:n.name}),s.jsx("span",{title:n.description||void 0,className:"line-clamp-2 text-[12.5px] text-fg-dim",children:n.description??""}),s.jsx("span",{className:"font-mono text-[11px] text-fg-faint/80",children:fs(e,n.name)})]},`${a}:${n.name}`))}):s.jsxs("div",{"data-testid":"mcp-tools-empty",className:Je,children:[t.status==="needs-auth"?"The last check needs auth":"The last check failed",": ",t.error]}):s.jsx("div",{"data-testid":"mcp-tools-empty",className:Je,children:"Check this server to list its tools."})]})}const et=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/,Ye="disable-model-invocation",At=/^\s*disable-model-invocation\s*:/;function bs(e){const t=e.match(et);if(!t)return!1;for(const n of t[1].split(/\r?\n/)){if(!At.test(n))continue;const a=n.slice(n.indexOf(":")+1).trim().toLowerCase();return a==="true"||a==="yes"}return!1}function vs(e){const t=e.trim();return t.length>=2&&(t[0]==='"'&&t[t.length-1]==='"'||t[0]==="'"&&t[t.length-1]==="'")?t.slice(1,-1):t}function de(e){return e.length-e.trimStart().length}function Oe(e){const t=e.match(et);if(!t)return{name:null,description:null,body:e};const n=t[1].split(/\r?\n/),a=t[2]??"";let l=null,r=null;for(let i=0;i<n.length;i++){const o=n[i],h=o.match(/^(\s*)(name|description)\s*:(.*)$/);if(!h)continue;const[,,m,g]=h,u=g.trim(),x=de(o);let v;if(u===""||u===">-"||u===">"||u==="|-"||u==="|"){const p=[];let b=i+1;for(;b<n.length&&n[b].trim()!==""&&de(n[b])>x;)p.push(n[b].trim()),b++;v=p.join(" ")}else v=vs(u);m==="name"?l=v:r=v}return{name:l,description:r,body:a}}function ks(e,t){const n=e.match(et);if(!n){if(!t)return e;const i=e.startsWith(`
|
|
2
2
|
`)?"":`
|
|
3
3
|
`;return`---
|
|
4
4
|
${Ye}: true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{be as p,aN as d,an as g,ax as o,bc as b}from"./index-
|
|
1
|
+
import{be as p,aN as d,an as g,ax as o,bc as b}from"./index-CBCdyHbZ.js";function h(e,t){return t&&(e===t||e.startsWith(t+"/"))?"~"+e.slice(t.length):e}function w({path:e,keyPath:t,note:l}){const u=p(),[n,r]=d.useState(void 0);d.useEffect(()=>{let i=!0;const c=()=>{window.api.config.readText(e,{maxBytes:1}).then(s=>{i&&r(s.exists?s.mtimeMs:null)}).catch(()=>{i&&r(void 0)})};c();const x=window.api.config.onChanged(s=>{s.path===e&&c()});return()=>{i=!1,x()}},[e]);const f=h(e,u)+(t&&t.length?` › ${t.join(".")}`:""),a=n===void 0?"":n===null?"created on first save":g(n),m=()=>{b.getState().openFile(e),window.dispatchEvent(new CustomEvent("sm:open-editor"))};return o.jsxs("button",{type:"button","data-testid":"source-chip",title:l??`Open ${e} in the editor`,onClick:m,className:"inline-flex items-center gap-1.5 max-w-full text-[11px] px-2 py-0.5 rounded border border-line bg-bg-elev text-fg-dim hover:bg-bg-hi",children:[o.jsx("span",{className:"font-mono truncate","data-testid":"source-chip-path",children:f}),a&&o.jsxs("span",{className:"text-fg-dim/70 shrink-0","data-testid":"source-chip-age",children:["· ",a]})]})}export{w as S,h as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aN as i,b8 as d,ax as e,a8 as E,b4 as O,be as _,C as B,l as C,ag as P}from"./index-
|
|
1
|
+
import{aN as i,b8 as d,ax as e,a8 as E,b4 as O,be as _,C as B,l as C,ag as P}from"./index-CBCdyHbZ.js";import{P as $}from"./Panel-C7EFG4eU.js";import{S as z,I as H}from"./Library-R71t6VAB.js";import{D as W}from"./DocumentEditorPane-fm6zsnLM.js";import{S as q}from"./SourceChip-uyVMCZc7.js";import"./monaco-editor-BsIlgG7c.js";import"./Button-BzG_KdBC.js";const G=300;function J({activePath:o,selectedPath:r,onSelect:s}){const[f,n]=i.useState([]),x=i.useRef(0),j=i.useRef(s);j.current=s;const h=d(a=>{var l;return o?(l=a.files[o])==null?void 0:l.diskRaw:void 0}),u=i.useRef(null);if(i.useEffect(()=>{j.current(null)},[o]),i.useEffect(()=>{if(x.current+=1,!o){u.current=null,n([]);return}const a=u.current!==o;u.current=o;let l=!1;const m=()=>{x.current+=1;const y=x.current;window.api.config.parseImports(o).then(p=>{l||x.current!==y||(p.ok?n(p.imports):(n([]),O.error(p.error||"failed to parse @-imports")))})},v=a?null:setTimeout(m,G);return a&&m(),()=>{l=!0,v&&clearTimeout(v)}},[o,h]),f.length===0||!o)return null;const b=r===o||r===null;return e.jsxs("div",{className:"w-64 shrink-0 border-r border-line bg-bg-elev overflow-auto","data-testid":"referenced-files-rail",children:[e.jsxs("div",{className:"px-3 py-2 text-[10px] uppercase tracking-wide text-fg-faint border-b border-line",children:["Documents · ",f.length+1]}),e.jsxs("button",{type:"button",onClick:()=>s(null),"aria-current":b,"data-testid":"referenced-file-root",className:`w-full text-left px-3 py-2 border-b border-line ${b?"bg-bg-hi text-fg":"text-fg-dim hover:bg-bg"}`,children:[e.jsx("div",{className:"text-[11.5px] font-medium truncate",children:E(o)}),e.jsx("div",{className:"text-[10px] text-fg-faint truncate",title:o,children:"this system prompt"})]}),f.map(a=>{const l=!a.ok||!a.exists,m=r===a.path;return e.jsxs("button",{type:"button",onClick:()=>s(a),"aria-current":m,"data-testid":"referenced-file-row",className:`w-full text-left px-3 py-2 border-b border-line last:border-b-0 ${m?"bg-bg-hi text-fg":"text-fg-dim hover:bg-bg"}`,children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[11.5px] font-medium truncate flex-1",children:E(a.path)}),l&&e.jsx("span",{className:"shrink-0 px-1.5 py-0.5 rounded text-[9px] uppercase tracking-wide text-amber-400/90 border border-amber-400/30","data-testid":"referenced-file-missing",children:"missing"})]}),e.jsx("div",{className:"text-[10px] text-fg-faint truncate",title:a.path,children:a.path}),e.jsxs("div",{className:"text-[10px] text-fg-faint",children:[a.sizeBytes.toLocaleString()," bytes · ~",a.tokenEstimate.toLocaleString()," tokens"]})]},a.path)})]})}const R={title:"User system prompt",body:"This is the real ~/.claude/CLAUDE.md on disk — the instructions the claude CLI loads into every session it starts on this machine, in every project. A project's own CLAUDE.md / CLAUDE.local.md are read from that project's directory when a session launches there; they are not edited here."};function K(){const o=_(),r=i.useMemo(()=>o?B.resolve("user",o,null):null,[o]),[s,f]=i.useState(null),n=(s==null?void 0:s.path)??r,[x,j]=i.useState({});i.useEffect(()=>{const t=s==null?void 0:s.path;if(!t||!s.ok||!s.exists)return;let k=!0;return Promise.resolve().then(()=>window.api.config.canWrite(t)).then(I=>{k&&j(M=>({...M,[t]:I===!1}))}).catch(()=>{}),()=>{k=!1}},[s]);const h=!!s&&x[s.path]===!0,u=!!s&&(!s.ok||!s.exists||h),b=d(t=>t.files),a=d(t=>t.loadText),l=d(t=>t.setDraft),m=d(t=>t.saveText),v=d(t=>t.revert),y=d(t=>t.watchFile),p=d(t=>t.unwatchFile);i.useEffect(()=>{if(r)return a(r,!0),y(r),()=>{p(r)}},[r]),i.useEffect(()=>{if(!(!n||n===r))return a(n,!0),y(n),()=>{p(n)}},[n,r]);const[D,g]=i.useState(null),T=i.useCallback(t=>{g(null),f(t)},[]);if(!o)return e.jsx(C,{title:"loading…"});const L=r?b[r]:null,c=n?b[n]:null,N=(c==null?void 0:c.draftRaw)??"",U=P(N),A=N.length,F=u&&!h,S=u,w=async()=>{if(!n)return;g(null);const t=await m(n);t.ok||g(t.error??"save failed")};return e.jsx($,{toolbar:e.jsxs(e.Fragment,{children:[r&&e.jsx(H,{path:r,disabled:!!s}),e.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),e.jsx("span",{className:"text-fg-dim",children:"User scope"}),e.jsx("span",{className:"ml-3 text-fg-faint truncate",children:n??"—"}),r&&e.jsx("span",{className:"ml-3",children:e.jsx(q,{path:r})}),e.jsx("div",{className:"flex-1"}),e.jsxs("span",{className:"text-fg-faint",children:[A.toLocaleString()," chars · ~",U.toLocaleString()," tokens"]})]}),footer:n&&c&&!S?e.jsx(z,{dirty:c.dirty,busy:c.busy,parseError:D,lastSavedAt:c.lastSavedAt,leading:c.exists?s?e.jsx("span",{children:"editing an imported file"}):null:e.jsx("span",{children:"file will be created on save"}),onSave:w,onRevert:()=>{g(null),v(n)}}):null,children:r&&L?e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{"data-testid":"system-prompt-scope-note",className:"shrink-0 border-b border-line bg-bg-elev px-3 py-2 text-[11.5px] leading-snug",children:[e.jsx("span",{className:"font-semibold text-fg",children:R.title}),e.jsx("span",{className:"mx-1.5 text-fg-faint",children:"·"}),e.jsx("span",{className:"text-fg-dim",children:R.body}),e.jsx("span",{className:"ml-1.5 font-mono text-fg-faint",children:r})]}),e.jsxs("div",{className:"flex-1 min-h-0 flex",children:[e.jsx(J,{activePath:r,selectedPath:n,onSelect:T}),e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col",children:[F&&e.jsx("div",{"data-testid":"system-prompt-missing-note",className:"shrink-0 border-b border-line bg-bg-elev px-3 py-1.5 text-[11px] text-amber-400/90",children:"This import does not resolve to a readable file — the CLI will skip it."}),h&&s&&e.jsxs("div",{"data-testid":"system-prompt-readonly-note",className:"shrink-0 border-b border-line bg-bg-elev px-3 py-1.5 text-[11px] text-amber-400/90",children:["Read-only: ",e.jsx("span",{className:"font-mono",children:s.path})," is outside the folders Session Manager may write to."]}),n&&e.jsx("div",{className:"flex-1 min-h-0",children:e.jsx(W,{path:n,value:N,readOnly:S,defaultMode:"split",onChange:t=>{g(null),l(n,t)},onSave:()=>{w()}},n)})]})]})]}):e.jsx(C,{title:"resolving…"})})}const se=i.memo(K);export{se as SystemPrompt};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aS as aa,aN as G,R as Pt,ax as R,N as Nf,at as If,a6 as Rf}from"./index-
|
|
1
|
+
import{aS as aa,aN as G,R as Pt,ax as R,N as Nf,at as If,a6 as Rf}from"./index-CBCdyHbZ.js";import"./monaco-editor-BsIlgG7c.js";var zi={exports:{}},$i={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* use-sync-external-store-shim.production.js
|
|
4
4
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ax as r}from"./index-
|
|
1
|
+
import{ax as r}from"./index-CBCdyHbZ.js";function a({checked:t,onChange:e,label:n,disabled:s}){return r.jsxs("label",{className:`inline-flex items-center gap-2 text-xs ${s?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:[r.jsx("button",{type:"button",role:"switch","aria-checked":t,disabled:s,onClick:()=>!s&&e(!t),className:`relative w-7 h-4 rounded-full transition-colors ${t?"bg-accent":"bg-bg-hi border border-line"}`,children:r.jsx("span",{className:`absolute top-0.5 w-3 h-3 rounded-full bg-fg transition-transform ${t?"translate-x-3.5":"translate-x-0.5"}`})}),n&&r.jsx("span",{className:"text-fg-dim",children:n})]})}export{a as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ax as r}from"./index-
|
|
1
|
+
import{ax as r}from"./index-CBCdyHbZ.js";function n({options:t,active:o,onChange:i}){return r.jsx("div",{className:"flex rounded border border-line overflow-hidden",children:t.map(({key:e,label:x})=>r.jsx("button",{onClick:()=>i(e),className:`px-2 py-0.5 text-xs ${o===e?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:x},e))})}export{n as V};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bs as o,bq as m,aa as j,ax as e,aX as l,bp as b,aA as R}from"./index-
|
|
1
|
+
import{bs as o,bq as m,aa as j,ax as e,aX as l,bp as b,aA as R}from"./index-CBCdyHbZ.js";let u=0;const T=1e3;function w(n){const s=performance.now();s-u<T||(u=s,R.debug("voice","mic.gate.click_rejected",{reason:n}))}function k(){const n=o(t=>t.isRecording),s=o(t=>t.error),i=o(t=>t.loadingProgress),r=o(m(l)),x=()=>{const t=o.getState(),{canRecord:h,reason:a}=l(t);if(t.isRecording)return t.stopRecording();if(t.wizardArmed&&!t.wizardOpen){t.openWizard();return}if(a==="error"||a==="load-timeout"){t.resetAndRetryModel();return}if(!h)return w(a);const c=b.getState().activeTabId;c&&t.startRecording(c)},d=j(r.reason,{loadingPct:i,errorMessage:s,isRecording:n}),g=r.reason==="unsupported",p=!r.canRecord,f=r.reason==="loading"?"text-fg-faint animate-pulse cursor-wait":r.reason==="error"||r.reason==="load-timeout"?"text-red-400 cursor-pointer":r.reason==="permission-denied"?"text-amber-400 cursor-pointer":r.reason==="idle"?"text-fg-faint cursor-pointer":r.reason==="unsupported"?"text-fg-faint cursor-not-allowed":n?"text-red-400 ring-2 ring-red-400 animate-pulse":"text-fg-dim hover:text-fg";return e.jsx("button",{onClick:x,disabled:g,"aria-disabled":p,"aria-label":d,title:d,"data-testid":"mic-button","data-state":r.reason,className:`p-1.5 rounded transition-colors ${f}`,children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"9",y:"1",width:"6",height:"12",rx:"3"}),e.jsx("path",{d:"M5 10a7 7 0 0 0 14 0"}),e.jsx("line",{x1:"12",y1:"17",x2:"12",y2:"21"}),e.jsx("line",{x1:"8",y1:"21",x2:"16",y2:"21"})]})})}function v(){const n=o(i=>i.ttsEnabled),s=o(i=>i.toggleTTS);return e.jsxs("button",{onClick:s,title:n?"Read Claude replies aloud: ON":"Read Claude replies aloud: OFF",className:`px-1.5 py-1 rounded transition-colors flex items-center gap-1 ${n?"text-accent":"text-fg-dim hover:text-fg"}`,children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"}),n?e.jsxs(e.Fragment,{children:[e.jsx("path",{d:"M15.54 8.46a5 5 0 0 1 0 7.07"}),e.jsx("path",{d:"M19.07 4.93a10 10 0 0 1 0 14.14"})]}):e.jsxs(e.Fragment,{children:[e.jsx("line",{x1:"23",y1:"9",x2:"17",y2:"15"}),e.jsx("line",{x1:"17",y1:"9",x2:"23",y2:"15"})]})]}),e.jsx("span",{className:"text-[10px] font-medium tracking-wide",children:"TTS"})]})}export{v as T,k as V};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bv as s}from"./index-
|
|
1
|
+
import{bv as s}from"./index-CBCdyHbZ.js";function a(t){const e=Number.isFinite(t)?t:0,r=Math.abs(e)<1?4:2;return`$${e.toFixed(r)}`}function u(t){const e=Number.isFinite(t)?t:0,r=Math.abs(e);return r>=1e9?`${(e/1e9).toFixed(1)}B`:r>=1e6?`${(e/1e6).toFixed(1)}M`:r>=1e3?`${(e/1e3).toFixed(1)}K`:`${Math.round(e)}`}function f(t){const e=Number.isFinite(t)?t:0;return Math.round(e).toLocaleString("en-US")}function m(t){const e=Math.max(0,Math.round(Number.isFinite(t)?t:0));if(e<60)return`${e}m`;const r=Math.floor(e/60),n=e%60;return n===0?`${r}h`:`${r}h ${n}m`}function h(t){return Number.isFinite(t)?t>0&&t<1?"<1%":`${t.toFixed(1)}%`:"0.0%"}async function l(t,e=5e3){try{return{ok:!0,data:await s(Promise.resolve().then(()=>window.api.history.dashboard({rangeDays:t})),e,"history.dashboard")}}catch(r){return{ok:!1,error:r instanceof Error?r.message:String(r)}}}function c(t){return`${a(t.costUsd)} · ${u(t.tokens)} tok`}function b(t,e){const r=e!=null&&e.day?t.days.filter(o=>o.date===e.day).flatMap(o=>Object.values(o.byProject)):[t.totals];let n=0,i=0;for(const o of r)n+=o.estimatedCostUsd,i+=o.inputTokens+o.outputTokens+o.cacheReadTokens+o.cacheCreationTokens;return{costUsd:n,tokens:i,label:c({costUsd:n,tokens:i})}}export{c as a,l as f,f as i,m,h as p,b as s,u as t,a as u};
|