claude-code-session-manager 0.75.0 → 0.75.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/assets/{AgentLibrary-SpzptNyq.js → AgentLibrary-CGplUKxY.js} +1 -1
  2. package/dist/assets/{DataModel-C4M9xVLC.js → DataModel-DQ15KxVb.js} +1 -1
  3. package/dist/assets/{History-92FYrZKS.js → History-v2TSC_6A.js} +1 -1
  4. package/dist/assets/{Hooks-DlnavO1l.js → Hooks-Co7s6BNB.js} +1 -1
  5. package/dist/assets/{HostBilko-CKI7jt1z.js → HostBilko-DJj8FWPK.js} +1 -1
  6. package/dist/assets/{Library-Brhxe7xa.js → Library-DQaC9VQ1.js} +1 -1
  7. package/dist/assets/{ListDetail-DmIweYTN.js → ListDetail-BwFRfAZm.js} +1 -1
  8. package/dist/assets/{MarkdownEditor-DA4xqWWi.js → MarkdownEditor-C155gNpc.js} +1 -1
  9. package/dist/assets/{McpServers-DWXQGzVc.js → McpServers-BmLgE_gS.js} +1 -1
  10. package/dist/assets/{Memory-HCx9Arao.js → Memory-ISwNcS5j.js} +1 -1
  11. package/dist/assets/{Panel-B20C6kN8.js → Panel-1adjEpj-.js} +1 -1
  12. package/dist/assets/{Permissions-C4sPgLpA.js → Permissions-FrCz5cGa.js} +1 -1
  13. package/dist/assets/{Plugins-CaRenCBg.js → Plugins-zUssKp_b.js} +2 -2
  14. package/dist/assets/{ProvenanceBadge-DfrXzTeh.js → ProvenanceBadge-CAXqA_HX.js} +1 -1
  15. package/dist/assets/{SaveBar-BmpUx2Yh.js → SaveBar-D9cqms3Y.js} +1 -1
  16. package/dist/assets/{Scheduler-xUD8pQ6q.js → Scheduler-dNNc9S11.js} +1 -1
  17. package/dist/assets/{ScopeSwitcher-DVlKMck5.js → ScopeSwitcher-1wBTne7S.js} +1 -1
  18. package/dist/assets/{Settings-C457mxOK.js → Settings-BT_expIg.js} +1 -1
  19. package/dist/assets/{SkillReferenceGraph-D3dDc5X7.js → SkillReferenceGraph-CVccq4Cu.js} +1 -1
  20. package/dist/assets/{Skills-BNDlbftC.js → Skills-xFpRY0ld.js} +1 -1
  21. package/dist/assets/{SystemPrompt-d-ykNRec.js → SystemPrompt-CEk_71th.js} +1 -1
  22. package/dist/assets/{TagLibrary-D3JWkQK-.js → TagLibrary-C2zhihQG.js} +1 -1
  23. package/dist/assets/{TiptapBody-B1Ox6D6E.js → TiptapBody-CQKcHKaD.js} +1 -1
  24. package/dist/assets/{Toggle-CaYw6Lrj.js → Toggle-CQ-IBb8m.js} +1 -1
  25. package/dist/assets/{index-CEeLxNCz.js → index-BgbV3sKX.js} +3 -3
  26. package/dist/assets/{settingsSchema-DUkd45M5.js → settingsSchema-D6ccSKqm.js} +1 -1
  27. package/dist/index.html +1 -1
  28. package/package.json +1 -1
  29. package/src/main/__tests__/scheduler-autofix-outcome.test.cjs +116 -0
  30. package/src/main/__tests__/scheduler-autofix-select.test.cjs +113 -7
  31. package/src/main/__tests__/scheduler-fix-plan-path.test.cjs +119 -0
  32. package/src/main/scheduler.cjs +136 -27
@@ -1 +1 @@
1
- import{ad as l,an as I,a4 as e,as as $,a2 as B,a3 as V,aj as _,I as z,c as q,e as L,m as M,M as D,h as H,O as G,at as J,C as K,aq as h,j as P}from"./index-CEeLxNCz.js";import{P as T}from"./Panel-B20C6kN8.js";import{S as Q}from"./SaveBar-BmpUx2Yh.js";import{f as W,V as A}from"./Library-Brhxe7xa.js";import"./monaco-editor-BW5C4Iv1.js";function F(t){return t.split("/").pop()||t}function X({activePath:t,selectedPath:o,onSelect:f}){const[n,i]=l.useState([]),m=l.useRef(0),r=l.useRef(f);if(r.current=f,l.useEffect(()=>{if(m.current+=1,r.current(null),!t){i([]);return}const a=m.current;let x=!1;return window.api.config.parseImports(t).then(c=>{x||m.current!==a||(c.ok?i(c.imports):(i([]),I.error(c.error||"failed to parse @-imports")))}),()=>{x=!0}},[t]),n.length===0||!t)return null;const b=o===t||o===null;return e.jsxs("div",{className:"w-64 shrink-0 border-r border-line bg-bg-elev overflow-auto","data-testid":"referenced-files-rail",children:[e.jsxs("div",{className:"px-3 py-2 text-[10px] uppercase tracking-wide text-fg-faint border-b border-line",children:["Documents · ",n.length+1]}),e.jsxs("button",{type:"button",onClick:()=>f(null),"aria-current":b,"data-testid":"referenced-file-root",className:`w-full text-left px-3 py-2 border-b border-line ${b?"bg-bg-hi text-fg":"text-fg-dim hover:bg-bg"}`,children:[e.jsx("div",{className:"text-[11.5px] font-medium truncate",children:F(t)}),e.jsx("div",{className:"text-[10px] text-fg-faint truncate",title:t,children:"this system prompt"})]}),n.map(a=>{const x=!a.ok||!a.exists,c=o===a.path;return e.jsxs("button",{type:"button",onClick:()=>f(a),"aria-current":c,"data-testid":"referenced-file-row",className:`w-full text-left px-3 py-2 border-b border-line last:border-b-0 ${c?"bg-bg-hi text-fg":"text-fg-dim hover:bg-bg"}`,children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[11.5px] font-medium truncate flex-1",children:F(a.path)}),x&&e.jsx("span",{className:"shrink-0 px-1.5 py-0.5 rounded text-[9px] uppercase tracking-wide text-amber-400/90 border border-amber-400/30","data-testid":"referenced-file-missing",children:"missing"})]}),e.jsx("div",{className:"text-[10px] text-fg-faint truncate",title:a.path,children:a.path}),e.jsxs("div",{className:"text-[10px] text-fg-faint",children:[a.sizeBytes.toLocaleString()," bytes · ~",a.tokenEstimate.toLocaleString()," tokens"]})]},a.path)})]})}function U(t){return t.split("/").filter(Boolean).pop()||t}function Y({path:t,value:o,onChange:f,onSave:n,readOnly:i,defaultMode:m,headerRight:r,hideStatusBar:b}){const a=$(),x=B(t),c=V(t),S=_(t),[E,w]=l.useState(()=>i&&c?"preview":m??z(t)),[g,C]=l.useState(!0),[p,R]=l.useState(null),N=l.useRef(null),d=l.useRef(null),v=l.useCallback(s=>{N.current=s},[]),y=l.useCallback(()=>N.current,[]),k=i?c?["preview","edit"]:[]:S?["edit","preview","split"]:c?["edit","preview"]:[],u=c?E:"edit",j=e.jsx(q,{path:t,name:U(t),value:o,onChange:f,onSave:()=>n==null?void 0:n(),onReady:v,onCursor:R,readOnly:i});return e.jsxs("div",{className:"flex flex-col h-full min-h-0","data-testid":"document-editor-pane",children:[e.jsxs("div",{className:"flex items-center gap-1 px-2 h-7 shrink-0 border-b border-line bg-bg-elev",children:[e.jsx("span",{className:"text-[11px] font-medium text-fg truncate",children:U(t)}),i&&e.jsx("span",{className:"ml-1 px-1.5 py-0.5 rounded text-[9px] uppercase tracking-wide text-fg-faint border border-line",children:"read-only"}),e.jsx("div",{className:"flex-1"}),r,x&&(u==="preview"||u==="split")&&e.jsx("button",{onClick:()=>C(s=>!s),"data-testid":"document-outline-toggle",className:`px-2 py-0.5 text-[10px] border border-line rounded ${g?"bg-bg-hi text-fg":"text-fg-faint hover:text-fg"}`,title:"Toggle document outline",children:"Outline"}),k.length>0&&e.jsx("div",{className:"flex items-center ml-1 rounded border border-line overflow-hidden","data-testid":"document-mode-toggle",children:k.map(s=>e.jsx("button",{onClick:()=>w(s),className:`px-2 py-0.5 text-[10px] capitalize transition-colors ${u===s?"bg-bg-hi text-fg":"text-fg-faint hover:text-fg"}`,children:s},s))})]}),e.jsx("div",{className:"flex-1 min-h-0",children:u==="split"&&x?e.jsxs("div",{className:"flex h-full",children:[g&&e.jsx(L,{text:o,scrollRef:d}),e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col border-r border-line",children:[!i&&e.jsx(M,{getEditor:y}),e.jsx("div",{className:"flex-1 min-h-0",children:j})]}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(D,{ref:d,text:o,flush:!0,wideMeasure:a.wideMeasure})})]}):u==="preview"&&x?e.jsxs("div",{className:"flex h-full",children:[g&&e.jsx(L,{text:o,scrollRef:d}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(D,{ref:d,text:o,wideMeasure:a.wideMeasure})})]}):x?e.jsxs("div",{className:"flex flex-col h-full",children:[!i&&e.jsx(M,{getEditor:y}),e.jsx("div",{className:"flex-1 min-h-0",children:j})]}):j}),!b&&e.jsx(H,{text:o,cursor:p,language:G(t)||void 0})]})}const O={title:"User system prompt",body:"This is the real ~/.claude/CLAUDE.md on disk — the instructions the claude CLI loads into every session it starts on this machine, in every project. A project's own CLAUDE.md / CLAUDE.local.md are read from that project's directory when a session launches there; they are not edited here."};function Z(t){return Math.round(t.length/4)}function ee(){const t=J(),[o,f]=l.useState("installed"),n=l.useMemo(()=>t?K.resolve("user",t,null):null,[t]),[i,m]=l.useState(null),r=(i==null?void 0:i.path)??n,b=!!i&&(!i.ok||!i.exists),a=h(s=>s.files),x=h(s=>s.loadText),c=h(s=>s.setDraft),S=h(s=>s.saveText),E=h(s=>s.revert),w=h(s=>s.watchFile),g=h(s=>s.unwatchFile);l.useEffect(()=>{if(n)return x(n,!0),w(n),()=>{g(n)}},[n]),l.useEffect(()=>{if(!(!r||r===n))return x(r,!0),w(r),()=>{g(r)}},[r,n]);const[C,p]=l.useState(null),R=l.useCallback(s=>{p(null),m(s)},[]);if(!t)return e.jsx(P,{title:"loading…"});if(o==="library")return e.jsx(T,{toolbar:e.jsx(A,{active:o,onChange:f,installedLabel:"Editor",libraryLabel:"Presets"}),children:e.jsx(W,{})});const N=n?a[n]:null,d=r?a[r]:null,v=(d==null?void 0:d.draftRaw)??"",y=Z(v),k=v.length,u=b,j=async()=>{if(!r)return;p(null);const s=await S(r);s.ok||p(s.error??"save failed")};return e.jsx(T,{toolbar:e.jsxs(e.Fragment,{children:[e.jsx(A,{active:o,onChange:f,installedLabel:"Editor",libraryLabel:"Presets"}),e.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),e.jsx("span",{className:"text-fg-dim",children:"User scope"}),e.jsx("span",{className:"ml-3 text-fg-faint truncate",children:r??"—"}),e.jsx("div",{className:"flex-1"}),e.jsxs("span",{className:"text-fg-faint",children:[k.toLocaleString()," chars · ~",y.toLocaleString()," tokens"]})]}),footer:r&&d&&!u?e.jsx(Q,{dirty:d.dirty,busy:d.busy,parseError:C,lastSavedAt:d.lastSavedAt,leading:d.exists?i?e.jsx("span",{children:"editing an imported file"}):null:e.jsx("span",{children:"file will be created on save"}),onSave:j,onRevert:()=>{p(null),E(r)}}):null,children:n&&N?e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{"data-testid":"system-prompt-scope-note",className:"shrink-0 border-b border-line bg-bg-elev px-3 py-2 text-[11.5px] leading-snug",children:[e.jsx("span",{className:"font-semibold text-fg",children:O.title}),e.jsx("span",{className:"mx-1.5 text-fg-faint",children:"·"}),e.jsx("span",{className:"text-fg-dim",children:O.body}),e.jsx("span",{className:"ml-1.5 font-mono text-fg-faint",children:n})]}),e.jsxs("div",{className:"flex-1 min-h-0 flex",children:[e.jsx(X,{activePath:n,selectedPath:r,onSelect:R}),e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col",children:[u&&e.jsx("div",{"data-testid":"system-prompt-missing-note",className:"shrink-0 border-b border-line bg-bg-elev px-3 py-1.5 text-[11px] text-amber-400/90",children:"This import does not resolve to a readable file — the CLI will skip it."}),r&&e.jsx("div",{className:"flex-1 min-h-0",children:e.jsx(Y,{path:r,value:v,readOnly:u,defaultMode:"split",onChange:s=>{p(null),c(r,s)},onSave:()=>{j()}},r)})]})]})]}):e.jsx(P,{title:"resolving…"})})}const ie=l.memo(ee);export{ie as SystemPrompt};
1
+ import{ad as l,an as I,a4 as e,as as $,a2 as B,a3 as V,aj as _,I as z,c as q,e as L,m as M,M as D,h as H,O as G,at as J,C as K,aq as h,j as P}from"./index-BgbV3sKX.js";import{P as T}from"./Panel-1adjEpj-.js";import{S as Q}from"./SaveBar-D9cqms3Y.js";import{f as W,V as A}from"./Library-DQaC9VQ1.js";import"./monaco-editor-BW5C4Iv1.js";function F(t){return t.split("/").pop()||t}function X({activePath:t,selectedPath:o,onSelect:f}){const[n,i]=l.useState([]),m=l.useRef(0),r=l.useRef(f);if(r.current=f,l.useEffect(()=>{if(m.current+=1,r.current(null),!t){i([]);return}const a=m.current;let x=!1;return window.api.config.parseImports(t).then(c=>{x||m.current!==a||(c.ok?i(c.imports):(i([]),I.error(c.error||"failed to parse @-imports")))}),()=>{x=!0}},[t]),n.length===0||!t)return null;const b=o===t||o===null;return e.jsxs("div",{className:"w-64 shrink-0 border-r border-line bg-bg-elev overflow-auto","data-testid":"referenced-files-rail",children:[e.jsxs("div",{className:"px-3 py-2 text-[10px] uppercase tracking-wide text-fg-faint border-b border-line",children:["Documents · ",n.length+1]}),e.jsxs("button",{type:"button",onClick:()=>f(null),"aria-current":b,"data-testid":"referenced-file-root",className:`w-full text-left px-3 py-2 border-b border-line ${b?"bg-bg-hi text-fg":"text-fg-dim hover:bg-bg"}`,children:[e.jsx("div",{className:"text-[11.5px] font-medium truncate",children:F(t)}),e.jsx("div",{className:"text-[10px] text-fg-faint truncate",title:t,children:"this system prompt"})]}),n.map(a=>{const x=!a.ok||!a.exists,c=o===a.path;return e.jsxs("button",{type:"button",onClick:()=>f(a),"aria-current":c,"data-testid":"referenced-file-row",className:`w-full text-left px-3 py-2 border-b border-line last:border-b-0 ${c?"bg-bg-hi text-fg":"text-fg-dim hover:bg-bg"}`,children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[11.5px] font-medium truncate flex-1",children:F(a.path)}),x&&e.jsx("span",{className:"shrink-0 px-1.5 py-0.5 rounded text-[9px] uppercase tracking-wide text-amber-400/90 border border-amber-400/30","data-testid":"referenced-file-missing",children:"missing"})]}),e.jsx("div",{className:"text-[10px] text-fg-faint truncate",title:a.path,children:a.path}),e.jsxs("div",{className:"text-[10px] text-fg-faint",children:[a.sizeBytes.toLocaleString()," bytes · ~",a.tokenEstimate.toLocaleString()," tokens"]})]},a.path)})]})}function U(t){return t.split("/").filter(Boolean).pop()||t}function Y({path:t,value:o,onChange:f,onSave:n,readOnly:i,defaultMode:m,headerRight:r,hideStatusBar:b}){const a=$(),x=B(t),c=V(t),S=_(t),[E,w]=l.useState(()=>i&&c?"preview":m??z(t)),[g,C]=l.useState(!0),[p,R]=l.useState(null),N=l.useRef(null),d=l.useRef(null),v=l.useCallback(s=>{N.current=s},[]),y=l.useCallback(()=>N.current,[]),k=i?c?["preview","edit"]:[]:S?["edit","preview","split"]:c?["edit","preview"]:[],u=c?E:"edit",j=e.jsx(q,{path:t,name:U(t),value:o,onChange:f,onSave:()=>n==null?void 0:n(),onReady:v,onCursor:R,readOnly:i});return e.jsxs("div",{className:"flex flex-col h-full min-h-0","data-testid":"document-editor-pane",children:[e.jsxs("div",{className:"flex items-center gap-1 px-2 h-7 shrink-0 border-b border-line bg-bg-elev",children:[e.jsx("span",{className:"text-[11px] font-medium text-fg truncate",children:U(t)}),i&&e.jsx("span",{className:"ml-1 px-1.5 py-0.5 rounded text-[9px] uppercase tracking-wide text-fg-faint border border-line",children:"read-only"}),e.jsx("div",{className:"flex-1"}),r,x&&(u==="preview"||u==="split")&&e.jsx("button",{onClick:()=>C(s=>!s),"data-testid":"document-outline-toggle",className:`px-2 py-0.5 text-[10px] border border-line rounded ${g?"bg-bg-hi text-fg":"text-fg-faint hover:text-fg"}`,title:"Toggle document outline",children:"Outline"}),k.length>0&&e.jsx("div",{className:"flex items-center ml-1 rounded border border-line overflow-hidden","data-testid":"document-mode-toggle",children:k.map(s=>e.jsx("button",{onClick:()=>w(s),className:`px-2 py-0.5 text-[10px] capitalize transition-colors ${u===s?"bg-bg-hi text-fg":"text-fg-faint hover:text-fg"}`,children:s},s))})]}),e.jsx("div",{className:"flex-1 min-h-0",children:u==="split"&&x?e.jsxs("div",{className:"flex h-full",children:[g&&e.jsx(L,{text:o,scrollRef:d}),e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col border-r border-line",children:[!i&&e.jsx(M,{getEditor:y}),e.jsx("div",{className:"flex-1 min-h-0",children:j})]}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(D,{ref:d,text:o,flush:!0,wideMeasure:a.wideMeasure})})]}):u==="preview"&&x?e.jsxs("div",{className:"flex h-full",children:[g&&e.jsx(L,{text:o,scrollRef:d}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(D,{ref:d,text:o,wideMeasure:a.wideMeasure})})]}):x?e.jsxs("div",{className:"flex flex-col h-full",children:[!i&&e.jsx(M,{getEditor:y}),e.jsx("div",{className:"flex-1 min-h-0",children:j})]}):j}),!b&&e.jsx(H,{text:o,cursor:p,language:G(t)||void 0})]})}const O={title:"User system prompt",body:"This is the real ~/.claude/CLAUDE.md on disk — the instructions the claude CLI loads into every session it starts on this machine, in every project. A project's own CLAUDE.md / CLAUDE.local.md are read from that project's directory when a session launches there; they are not edited here."};function Z(t){return Math.round(t.length/4)}function ee(){const t=J(),[o,f]=l.useState("installed"),n=l.useMemo(()=>t?K.resolve("user",t,null):null,[t]),[i,m]=l.useState(null),r=(i==null?void 0:i.path)??n,b=!!i&&(!i.ok||!i.exists),a=h(s=>s.files),x=h(s=>s.loadText),c=h(s=>s.setDraft),S=h(s=>s.saveText),E=h(s=>s.revert),w=h(s=>s.watchFile),g=h(s=>s.unwatchFile);l.useEffect(()=>{if(n)return x(n,!0),w(n),()=>{g(n)}},[n]),l.useEffect(()=>{if(!(!r||r===n))return x(r,!0),w(r),()=>{g(r)}},[r,n]);const[C,p]=l.useState(null),R=l.useCallback(s=>{p(null),m(s)},[]);if(!t)return e.jsx(P,{title:"loading…"});if(o==="library")return e.jsx(T,{toolbar:e.jsx(A,{active:o,onChange:f,installedLabel:"Editor",libraryLabel:"Presets"}),children:e.jsx(W,{})});const N=n?a[n]:null,d=r?a[r]:null,v=(d==null?void 0:d.draftRaw)??"",y=Z(v),k=v.length,u=b,j=async()=>{if(!r)return;p(null);const s=await S(r);s.ok||p(s.error??"save failed")};return e.jsx(T,{toolbar:e.jsxs(e.Fragment,{children:[e.jsx(A,{active:o,onChange:f,installedLabel:"Editor",libraryLabel:"Presets"}),e.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),e.jsx("span",{className:"text-fg-dim",children:"User scope"}),e.jsx("span",{className:"ml-3 text-fg-faint truncate",children:r??"—"}),e.jsx("div",{className:"flex-1"}),e.jsxs("span",{className:"text-fg-faint",children:[k.toLocaleString()," chars · ~",y.toLocaleString()," tokens"]})]}),footer:r&&d&&!u?e.jsx(Q,{dirty:d.dirty,busy:d.busy,parseError:C,lastSavedAt:d.lastSavedAt,leading:d.exists?i?e.jsx("span",{children:"editing an imported file"}):null:e.jsx("span",{children:"file will be created on save"}),onSave:j,onRevert:()=>{p(null),E(r)}}):null,children:n&&N?e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{"data-testid":"system-prompt-scope-note",className:"shrink-0 border-b border-line bg-bg-elev px-3 py-2 text-[11.5px] leading-snug",children:[e.jsx("span",{className:"font-semibold text-fg",children:O.title}),e.jsx("span",{className:"mx-1.5 text-fg-faint",children:"·"}),e.jsx("span",{className:"text-fg-dim",children:O.body}),e.jsx("span",{className:"ml-1.5 font-mono text-fg-faint",children:n})]}),e.jsxs("div",{className:"flex-1 min-h-0 flex",children:[e.jsx(X,{activePath:n,selectedPath:r,onSelect:R}),e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col",children:[u&&e.jsx("div",{"data-testid":"system-prompt-missing-note",className:"shrink-0 border-b border-line bg-bg-elev px-3 py-1.5 text-[11px] text-amber-400/90",children:"This import does not resolve to a readable file — the CLI will skip it."}),r&&e.jsx("div",{className:"flex-1 min-h-0",children:e.jsx(Y,{path:r,value:v,readOnly:u,defaultMode:"split",onChange:s=>{p(null),c(r,s)},onSave:()=>{j()}},r)})]})]})]}):e.jsx(P,{title:"resolving…"})})}const ie=l.memo(ee);export{ie as SystemPrompt};
@@ -1 +1 @@
1
- import{ad as o,T as g,a4 as e,j as w,am as v,an as u,y}from"./index-CEeLxNCz.js";import{P as T}from"./Panel-B20C6kN8.js";import{L as k}from"./ListDetail-DmIweYTN.js";import"./monaco-editor-BW5C4Iv1.js";const E=new Set(g.map(a=>a.tag));function j(a){return a.filter(n=>E.has(n))}function P(){const[a,n]=o.useState(g[0].tag),[l,x]=o.useState(null),[h,m]=o.useState(!1),r=o.useRef(!0);o.useEffect(()=>()=>{r.current=!1},[]);const c=async()=>{try{const t=await window.api.agents.listPersonas();r.current&&x(t)}catch(t){if(!r.current)return;x([]),u.error(t.message||"failed to load agent personas")}};o.useEffect(()=>{c()},[]),o.useEffect(()=>window.api.agents.onChanged(()=>c()),[]);const f=g.find(t=>t.tag===a)??null,p=async(t,i)=>{try{await window.api.agents.savePersona({name:t.name,originalName:t.name,description:t.description??"",tools:t.tools,model:t.model??"inherit",color:t.color??"",tags:j([...t.tags,i]),body:t.body}),m(!1),await c()}catch(d){u.error(d.message||"failed to assign tag")}},s=async(t,i)=>{try{await window.api.agents.savePersona({name:t.name,originalName:t.name,description:t.description??"",tools:t.tools,model:t.model??"inherit",color:t.color??"",tags:j(t.tags.filter(d=>d!==i)),body:t.body}),await c()}catch(d){u.error(d.message||"failed to remove tag")}};return e.jsx(T,{toolbar:e.jsxs("span",{className:"text-fg-faint",children:[g.length," tag",g.length===1?"":"s"]}),children:e.jsx(k,{sidebar:e.jsx("div",{className:"py-1",children:g.map(t=>{const i=v(t.tag),d=a===t.tag,b=(l==null?void 0:l.filter(N=>N.tags.includes(t.tag)).length)??0;return e.jsxs("button",{onClick:()=>{n(t.tag),m(!1)},className:`w-full text-left px-3 py-1.5 text-xs flex items-center gap-2 border-l-2 ${d?"bg-bg-hi text-fg border-accent":"text-fg-dim hover:text-fg hover:bg-bg-hi border-transparent"}`,children:[e.jsxs("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-mono font-semibold ${i.bg} ${i.text} ${i.border?"border border-current/30":""}`,children:["#",t.tag]}),e.jsx("span",{className:"truncate",children:t.label}),b>0&&e.jsx("span",{className:"ml-auto text-[10.5px] text-fg-faint font-mono shrink-0",children:b})]},t.tag)})}),detail:f?e.jsx(S,{entry:f,personas:l,adding:h,setAdding:m,onAssign:p,onUnassign:s}):e.jsx(w,{title:"select a tag"})})})}const A=o.memo(P);function S({entry:a,personas:n,adding:l,setAdding:x,onAssign:h,onUnassign:m}){const r=v(a.tag),c=y(a.tag),f=(n==null?void 0:n.filter(s=>s.tags.includes(a.tag)))??[],p=(n==null?void 0:n.filter(s=>!s.tags.includes(a.tag)))??[];return e.jsxs("div",{className:"p-4 space-y-4 max-w-3xl",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsxs("span",{className:`px-2 py-1 rounded text-xs font-mono font-semibold ${r.bg} ${r.text} ${r.border?"border border-current/30":""}`,children:["#",a.tag]}),e.jsx("span",{className:"text-sm font-semibold text-fg",children:a.label})]}),e.jsx("div",{className:"text-xs text-fg-dim leading-relaxed",children:a.description}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10.5px] uppercase tracking-wide text-fg-faint mb-1.5 font-mono",children:"/develop eagerness"}),e.jsx("span",{className:"px-1.5 py-0.5 text-[10px] rounded border border-line text-fg-dim font-mono",children:a.developEagerness})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10.5px] uppercase tracking-wide text-fg-faint mb-1.5 font-mono",children:"develops via"}),e.jsx("span",{className:"px-1.5 py-0.5 text-[10px] rounded border border-line text-fg-dim font-mono",children:a.developsVia})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10.5px] uppercase tracking-wide text-fg-faint mb-1.5 font-mono",children:"agents carrying this tag"}),n===null?e.jsx("div",{className:"text-xs text-fg-faint italic",children:"loading…"}):e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[f.map(s=>e.jsxs("span",{className:"inline-flex items-center gap-1.5 bg-bg-elev border border-line rounded px-2 py-0.5 text-[11px] font-mono text-fg-dim",children:[s.name,e.jsx("button",{onClick:()=>m(s,a.tag),title:"Remove this tag from the agent",className:"text-fg-faint hover:text-fg",children:"×"})]},s.name)),f.length===0&&!l&&e.jsx("span",{className:"text-xs text-fg-faint italic mr-1",children:"no agent carries this tag yet."}),l?p.length>0?e.jsxs("select",{autoFocus:!0,defaultValue:"",onChange:s=>{const t=n.find(i=>i.name===s.target.value);t&&h(t,a.tag)},onBlur:()=>x(!1),className:"bg-bg border border-line rounded px-2 py-0.5 text-[11px] text-fg font-mono",children:[e.jsx("option",{value:"",disabled:!0,children:"pick an agent…"}),p.map(s=>e.jsx("option",{value:s.name,children:s.name},s.name))]}):e.jsx("span",{className:"text-xs text-fg-faint italic",children:"every agent already carries this tag."}):e.jsx("button",{onClick:()=>x(!0),className:"px-2 py-0.5 rounded-full text-[11px] font-mono border border-line text-fg-faint hover:text-fg hover:bg-bg-hi",children:"+ assign agent"})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10.5px] uppercase tracking-wide text-fg-faint mb-1.5 font-mono",children:"opening framing — sent before the human's goal"}),e.jsx("pre",{className:"text-xs text-fg-dim whitespace-pre-wrap bg-bg-elev border border-line rounded p-3 leading-relaxed font-sans",children:c.initialPromptTemplate})]})]})}export{A as TagLibrary};
1
+ import{ad as o,T as g,a4 as e,j as w,am as v,an as u,y}from"./index-BgbV3sKX.js";import{P as T}from"./Panel-1adjEpj-.js";import{L as k}from"./ListDetail-BwFRfAZm.js";import"./monaco-editor-BW5C4Iv1.js";const E=new Set(g.map(a=>a.tag));function j(a){return a.filter(n=>E.has(n))}function P(){const[a,n]=o.useState(g[0].tag),[l,x]=o.useState(null),[h,m]=o.useState(!1),r=o.useRef(!0);o.useEffect(()=>()=>{r.current=!1},[]);const c=async()=>{try{const t=await window.api.agents.listPersonas();r.current&&x(t)}catch(t){if(!r.current)return;x([]),u.error(t.message||"failed to load agent personas")}};o.useEffect(()=>{c()},[]),o.useEffect(()=>window.api.agents.onChanged(()=>c()),[]);const f=g.find(t=>t.tag===a)??null,p=async(t,i)=>{try{await window.api.agents.savePersona({name:t.name,originalName:t.name,description:t.description??"",tools:t.tools,model:t.model??"inherit",color:t.color??"",tags:j([...t.tags,i]),body:t.body}),m(!1),await c()}catch(d){u.error(d.message||"failed to assign tag")}},s=async(t,i)=>{try{await window.api.agents.savePersona({name:t.name,originalName:t.name,description:t.description??"",tools:t.tools,model:t.model??"inherit",color:t.color??"",tags:j(t.tags.filter(d=>d!==i)),body:t.body}),await c()}catch(d){u.error(d.message||"failed to remove tag")}};return e.jsx(T,{toolbar:e.jsxs("span",{className:"text-fg-faint",children:[g.length," tag",g.length===1?"":"s"]}),children:e.jsx(k,{sidebar:e.jsx("div",{className:"py-1",children:g.map(t=>{const i=v(t.tag),d=a===t.tag,b=(l==null?void 0:l.filter(N=>N.tags.includes(t.tag)).length)??0;return e.jsxs("button",{onClick:()=>{n(t.tag),m(!1)},className:`w-full text-left px-3 py-1.5 text-xs flex items-center gap-2 border-l-2 ${d?"bg-bg-hi text-fg border-accent":"text-fg-dim hover:text-fg hover:bg-bg-hi border-transparent"}`,children:[e.jsxs("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-mono font-semibold ${i.bg} ${i.text} ${i.border?"border border-current/30":""}`,children:["#",t.tag]}),e.jsx("span",{className:"truncate",children:t.label}),b>0&&e.jsx("span",{className:"ml-auto text-[10.5px] text-fg-faint font-mono shrink-0",children:b})]},t.tag)})}),detail:f?e.jsx(S,{entry:f,personas:l,adding:h,setAdding:m,onAssign:p,onUnassign:s}):e.jsx(w,{title:"select a tag"})})})}const A=o.memo(P);function S({entry:a,personas:n,adding:l,setAdding:x,onAssign:h,onUnassign:m}){const r=v(a.tag),c=y(a.tag),f=(n==null?void 0:n.filter(s=>s.tags.includes(a.tag)))??[],p=(n==null?void 0:n.filter(s=>!s.tags.includes(a.tag)))??[];return e.jsxs("div",{className:"p-4 space-y-4 max-w-3xl",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsxs("span",{className:`px-2 py-1 rounded text-xs font-mono font-semibold ${r.bg} ${r.text} ${r.border?"border border-current/30":""}`,children:["#",a.tag]}),e.jsx("span",{className:"text-sm font-semibold text-fg",children:a.label})]}),e.jsx("div",{className:"text-xs text-fg-dim leading-relaxed",children:a.description}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10.5px] uppercase tracking-wide text-fg-faint mb-1.5 font-mono",children:"/develop eagerness"}),e.jsx("span",{className:"px-1.5 py-0.5 text-[10px] rounded border border-line text-fg-dim font-mono",children:a.developEagerness})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10.5px] uppercase tracking-wide text-fg-faint mb-1.5 font-mono",children:"develops via"}),e.jsx("span",{className:"px-1.5 py-0.5 text-[10px] rounded border border-line text-fg-dim font-mono",children:a.developsVia})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10.5px] uppercase tracking-wide text-fg-faint mb-1.5 font-mono",children:"agents carrying this tag"}),n===null?e.jsx("div",{className:"text-xs text-fg-faint italic",children:"loading…"}):e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[f.map(s=>e.jsxs("span",{className:"inline-flex items-center gap-1.5 bg-bg-elev border border-line rounded px-2 py-0.5 text-[11px] font-mono text-fg-dim",children:[s.name,e.jsx("button",{onClick:()=>m(s,a.tag),title:"Remove this tag from the agent",className:"text-fg-faint hover:text-fg",children:"×"})]},s.name)),f.length===0&&!l&&e.jsx("span",{className:"text-xs text-fg-faint italic mr-1",children:"no agent carries this tag yet."}),l?p.length>0?e.jsxs("select",{autoFocus:!0,defaultValue:"",onChange:s=>{const t=n.find(i=>i.name===s.target.value);t&&h(t,a.tag)},onBlur:()=>x(!1),className:"bg-bg border border-line rounded px-2 py-0.5 text-[11px] text-fg font-mono",children:[e.jsx("option",{value:"",disabled:!0,children:"pick an agent…"}),p.map(s=>e.jsx("option",{value:s.name,children:s.name},s.name))]}):e.jsx("span",{className:"text-xs text-fg-faint italic",children:"every agent already carries this tag."}):e.jsx("button",{onClick:()=>x(!0),className:"px-2 py-0.5 rounded-full text-[11px] font-mono border border-line text-fg-faint hover:text-fg hover:bg-bg-hi",children:"+ assign agent"})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10.5px] uppercase tracking-wide text-fg-faint mb-1.5 font-mono",children:"opening framing — sent before the human's goal"}),e.jsx("pre",{className:"text-xs text-fg-dim whitespace-pre-wrap bg-bg-elev border border-line rounded p-3 leading-relaxed font-sans",children:c.initialPromptTemplate})]})]})}export{A as TagLibrary};
@@ -1,4 +1,4 @@
1
- import{ag as aa,ad as G,r as Pt,a4 as R,s as Nf,a1 as If,Z as Rf}from"./index-CEeLxNCz.js";import"./monaco-editor-BW5C4Iv1.js";var zi={exports:{}},$i={};/**
1
+ import{ag as aa,ad as G,r as Pt,a4 as R,s as Nf,a1 as If,Z as Rf}from"./index-BgbV3sKX.js";import"./monaco-editor-BW5C4Iv1.js";var zi={exports:{}},$i={};/**
2
2
  * @license React
3
3
  * use-sync-external-store-shim.production.js
4
4
  *
@@ -1 +1 @@
1
- import{a4 as r}from"./index-CEeLxNCz.js";function a({checked:t,onChange:e,label:n,disabled:s}){return r.jsxs("label",{className:`inline-flex items-center gap-2 text-xs ${s?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:[r.jsx("button",{type:"button",role:"switch","aria-checked":t,disabled:s,onClick:()=>!s&&e(!t),className:`relative w-7 h-4 rounded-full transition-colors ${t?"bg-accent":"bg-bg-hi border border-line"}`,children:r.jsx("span",{className:`absolute top-0.5 w-3 h-3 rounded-full bg-fg transition-transform ${t?"translate-x-3.5":"translate-x-0.5"}`})}),n&&r.jsx("span",{className:"text-fg-dim",children:n})]})}export{a as T};
1
+ import{a4 as r}from"./index-BgbV3sKX.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};