claude-code-session-manager 0.82.0 → 0.84.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-pwlkAFb3.js → AgentLibrary-CCVIpoSz.js} +1 -1
- package/dist/assets/{DataModel-BZK9PXFD.js → DataModel-BltREYde.js} +1 -1
- package/dist/assets/{History-BVRjxJjS.js → History-BZxFkOp6.js} +2 -2
- package/dist/assets/{Hooks-CNuwHeGx.js → Hooks-Bznlfaaa.js} +1 -1
- package/dist/assets/{HostBilko-cjwNodhV.js → HostBilko-DUG5YHA_.js} +1 -1
- package/dist/assets/{Library-YPNm9W92.js → Library-Bi2Fn3w9.js} +1 -1
- package/dist/assets/{ListDetail-CY4GM1Om.js → ListDetail-4VBvXKrz.js} +1 -1
- package/dist/assets/{MarkdownEditor-BF4y2Jiz.js → MarkdownEditor-D2ft_v5j.js} +1 -1
- package/dist/assets/{McpServers-CmBdWtX_.js → McpServers-FDekKkyE.js} +1 -1
- package/dist/assets/{Memory-CvkIXNl1.js → Memory-Dkl80uj_.js} +6 -6
- package/dist/assets/{Panel-D93o-sxe.js → Panel-LurG5VfD.js} +1 -1
- package/dist/assets/{Permissions-DQipg16I.js → Permissions-D2wHBCFA.js} +1 -1
- package/dist/assets/{Plugins-B6NwzPfK.js → Plugins-CTw_wwbI.js} +2 -2
- package/dist/assets/{ProvenanceBadge-DACVJhrB.js → ProvenanceBadge-CW6HNUv6.js} +1 -1
- package/dist/assets/{SaveBar-Cg4lbChb.js → SaveBar-alDHG6cP.js} +1 -1
- package/dist/assets/{Scheduler-Dr5ZcBLe.js → Scheduler-DxiPcaiW.js} +7 -7
- package/dist/assets/{ScopeSwitcher-C-locvy0.js → ScopeSwitcher-DzFXUKLZ.js} +1 -1
- package/dist/assets/Settings-B6H3v2am.js +3 -0
- package/dist/assets/{SkillReferenceGraph-DDzuYgSK.js → SkillReferenceGraph-B8EZalpN.js} +1 -1
- package/dist/assets/{Skills-DFvhiOAQ.js → Skills-DwuHuA08.js} +2 -2
- package/dist/assets/SystemPrompt-CMMqpGYn.js +1 -0
- package/dist/assets/{TagLibrary-DruUYaAc.js → TagLibrary-C2N5C1n9.js} +1 -1
- package/dist/assets/{TiptapBody-Dr4a--42.js → TiptapBody-btlID-dQ.js} +1 -1
- package/dist/assets/{Toggle-B_EH2TFb.js → Toggle-BGOn3DZj.js} +1 -1
- package/dist/assets/{index-DApB4DHS.js → index-QLRf0epp.js} +316 -314
- package/dist/assets/{index-CYhdtisq.css → index-mnjNDpb1.css} +1 -1
- package/dist/assets/{settingsSchema-BKa-xk8g.js → settingsSchema-DA3N2Up3.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +4 -1
- package/scripts/hooks/guard-destructive-git.cjs +514 -0
- package/scripts/hooks/guard-inline-implementation.cjs +219 -0
- package/scripts/hooks/guard-prd-writes.cjs +200 -0
- package/src/main/__tests__/epicMintTelemetryTap.test.cjs +64 -0
- package/src/main/__tests__/health-delegation-chain.test.cjs +2 -1
- package/src/main/__tests__/health-queue-dispatch.test.cjs +84 -0
- package/src/main/__tests__/health-usage-poller.test.cjs +97 -0
- package/src/main/__tests__/health-worktree-cap-blocked.test.cjs +65 -0
- package/src/main/__tests__/opsErrorLogTelemetryTap.test.cjs +143 -0
- package/src/main/__tests__/pollLoop-dispatch-on-failure.test.cjs +120 -0
- package/src/main/__tests__/promptSessionTranscript.test.cjs +0 -0
- package/src/main/__tests__/queue-starvation-dispatch-driver.test.cjs +143 -0
- package/src/main/__tests__/rateLimitPollerStreak.test.cjs +79 -0
- package/src/main/__tests__/scheduleJobTransitionsTelemetryTap.test.cjs +72 -0
- package/src/main/__tests__/scheduler-inplace-salvage.test.cjs +74 -0
- package/src/main/__tests__/scheduler-job-overrun.test.cjs +58 -0
- package/src/main/__tests__/scheduler-notify-originating-tab-transcript.test.cjs +1 -0
- package/src/main/__tests__/scheduler-periodic-reverify-guard.test.cjs +134 -2
- package/src/main/__tests__/scheduler-reap-dead-running-jobs.test.cjs +33 -0
- package/src/main/__tests__/scheduler-stuck-failed-escalation.test.cjs +136 -0
- package/src/main/__tests__/telemetryClient.test.cjs +810 -0
- package/src/main/__tests__/telemetryContract.test.cjs +883 -0
- package/src/main/crashDiagnostics.cjs +29 -1
- package/src/main/health.cjs +197 -3
- package/src/main/index.cjs +65 -6
- package/src/main/ipcSchemas.cjs +19 -2
- package/src/main/lib/__tests__/crashTelemetry.test.cjs +97 -0
- package/src/main/lib/__tests__/delegationReadiness.test.cjs +302 -4
- package/src/main/lib/__tests__/fixtures/scheduler-machine.json.corrupt-1789147548 +34 -0
- package/src/main/lib/__tests__/gitWorktree.test.cjs +413 -1
- package/src/main/lib/__tests__/jobWorktreeBootLive.test.cjs +71 -0
- package/src/main/lib/__tests__/queueStoreAtomicWrite.test.cjs +88 -0
- package/src/main/lib/__tests__/queueStoreMachineStateRecovery.test.cjs +123 -0
- package/src/main/lib/__tests__/reaperHelpers.test.cjs +58 -0
- package/src/main/lib/__tests__/telemetryBacklog.test.cjs +620 -0
- package/src/main/lib/__tests__/telemetryBoot.test.cjs +125 -0
- package/src/main/lib/__tests__/telemetryConsent.test.cjs +130 -0
- package/src/main/lib/__tests__/telemetryCounters.test.cjs +57 -0
- package/src/main/lib/__tests__/telemetryCountersMetadataColumn.test.cjs +89 -0
- package/src/main/lib/crashTelemetry.cjs +37 -0
- package/src/main/lib/delegationReadiness.cjs +119 -1
- package/src/main/lib/epicMint.cjs +2 -0
- package/src/main/lib/gitWorktree.cjs +427 -17
- package/src/main/lib/jobWorktree.cjs +2 -1
- package/src/main/lib/jobWorktreeBootLive.cjs +51 -0
- package/src/main/lib/jobWorktreeTerminalOrphanLive.cjs +68 -0
- package/src/main/lib/opsErrorLog.cjs +78 -25
- package/src/main/lib/queueStore.cjs +233 -20
- package/src/main/lib/reaperHelpers.cjs +23 -1
- package/src/main/lib/scheduleJobSchema.cjs +7 -0
- package/src/main/lib/scheduleJobTransitions.cjs +12 -0
- package/src/main/lib/telemetryBacklog.cjs +601 -0
- package/src/main/lib/telemetryBoot.cjs +71 -0
- package/src/main/lib/telemetryClient.cjs +653 -0
- package/src/main/lib/telemetryConsent.cjs +34 -0
- package/src/main/lib/telemetryCounters.cjs +45 -0
- package/src/main/promptSessionTranscript.cjs +0 -0
- package/src/main/pty.cjs +2 -0
- package/src/main/scheduler.cjs +481 -33
- package/src/preload/api.d.ts +84 -4
- package/src/preload/index.cjs +9 -0
- package/dist/assets/Settings-BVrAle90.js +0 -3
- package/dist/assets/SystemPrompt-8PiTyUyL.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ai as Q,t as bo,a6 as wo,a9 as tr}from"./index-QLRf0epp.js";import"./monaco-editor-BW5C4Iv1.js";function ko(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,o,a,s,u=[],l=!0,f=!1;try{if(a=(r=r.call(e)).next,n===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(i=a.call(r)).done)&&(u.push(i.value),u.length!==n);l=!0);}catch(h){f=!0,o=h}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(f)throw o}}return u}}function Ao(e,n,r){return n=Ro(n),n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function er(e,n){return Mo(e)||ko(e,n)||fi(e,n)||Oo()}function Co(e){return So(e)||To(e)||fi(e)||Po()}function So(e){if(Array.isArray(e))return gn(e)}function Mo(e){if(Array.isArray(e))return e}function To(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function fi(e,n){if(e){if(typeof e=="string")return gn(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return gn(e,n)}}function gn(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=new Array(n);r<n;r++)i[r]=e[r];return i}function Po(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Oo(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Eo(e,n){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function Ro(e){var n=Eo(e,"string");return typeof n=="symbol"?n:String(n)}var zo=function(n,r){var i=new Set(r);return Object.assign.apply(Object,[{}].concat(Co(Object.entries(n).filter(function(o){var a=er(o,1),s=a[0];return!i.has(s)}).map(function(o){var a=er(o,2),s=a[0],u=a[1];return Ao({},s,u)}))))};function yn(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function No(e){if(Array.isArray(e))return e}function Io(e){if(Array.isArray(e))return yn(e)}function $o(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Do(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,o,a,s,u=[],l=!0,f=!1;try{if(a=(r=r.call(e)).next,n!==0)for(;!(l=(i=a.call(r)).done)&&(u.push(i.value),u.length!==n);l=!0);}catch(h){f=!0,o=h}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(f)throw o}}return u}}function jo(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
4
4
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Fo(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ai as l,ay as K,at as Q,aA as U,av as u,a9 as t,j as R,as as L}from"./index-QLRf0epp.js";import{P as D}from"./Panel-LurG5VfD.js";import{L as X}from"./ListDetail-4VBvXKrz.js";import{M as Y}from"./MarkdownEditor-D2ft_v5j.js";import{S as Z}from"./SaveBar-alDHG6cP.js";import{S as V}from"./ScopeSwitcher-DzFXUKLZ.js";import{T as _}from"./Toggle-BGOn3DZj.js";import{P as B}from"./ProvenanceBadge-CW6HNUv6.js";import{l as ee}from"./listSkills-QORduPIk.js";import{S as te,V as F}from"./Library-Bi2Fn3w9.js";import{p as se,r as ae,s as ne}from"./skillFrontmatter-Dif5JIg7.js";import"./monaco-editor-BW5C4Iv1.js";function re(d,m){return{user:{skills:`${d}/.claude/skills`,commands:`${d}/.claude/commands`},project:m?{skills:`${m}/.claude/skills`,commands:`${m}/.claude/commands`}:null}}function le(){const d=K(),m=Q(),h=(m==null?void 0:m.cwd)??null,x=U(e=>e.navFace),j=l.useRef(!1),T=l.useRef(x),[p,N]=l.useState(()=>x==="project"&&h?"project":"user"),[v,k]=l.useState([]),[r,C]=l.useState(null),[w,E]=l.useState("installed"),[$,I]=l.useState(""),b=l.useMemo(()=>d?re(d,h):null,[d,h]);l.useEffect(()=>{if(T.current!==x){if(T.current=x,j.current){j.current=!1;return}N(x==="project"&&h?"project":"user")}},[x,h]),l.useEffect(()=>{if(!b)return;let e=!1;const i=p==="user"?b.user:b.project;if(!i){k([]);return}return(async()=>{var c;const n=[],s=await ee(i.skills);for(const a of s)n.push({kind:"skills",scope:p,name:a.name,path:a.path,dir:a.dir,disabled:ae(a.text),description:se(a.text).description??void 0});const o=await window.api.config.listDir(i.commands,{filesOnly:!0});for(const a of o.entries)a.name.endsWith(".md")&&n.push({kind:"commands",scope:p,name:a.name.replace(/\.md$/,""),path:a.path,dir:null,disabled:!1});e||(n.sort((a,M)=>a.kind===M.kind?a.name.localeCompare(M.name):a.kind==="skills"?-1:1),k(n),n.find(a=>a.path===r)||C(((c=n[0])==null?void 0:c.path)??null))})(),()=>{e=!0}},[p,b]);const y=u(e=>e.files),P=u(e=>e.loadText),H=u(e=>e.setDraft),O=u(e=>e.saveText),W=u(e=>e.revert),q=u(e=>e.watchFile),A=u(e=>e.unwatchFile);async function z(e,i){const n=await window.api.config.readText(e.path);if(!n.exists)return;const s=ne(n.text,i);if(s===n.text)return;const o=await window.api.config.writeText(e.path,s);if(!o.ok){L.error(o.error??"failed to update skill");return}k(c=>c.map(a=>a.path===e.path?{...a,disabled:i}:a)),y[e.path]&&P(e.path)}async function G(e){if(!e.dir||!window.confirm(`Remove skill "${e.name}"?
|
|
2
2
|
|
|
3
|
-
Its folder moves to the trash (recoverable); reinstall any time from the Library.`))return;const i=await window.api.files.delete(e.dir);if(!i.ok){L.error(i.error??"failed to remove skill");return}L.info(`Removed "${e.name}" — moved to trash`),
|
|
3
|
+
Its folder moves to the trash (recoverable); reinstall any time from the Library.`))return;const i=await window.api.files.delete(e.dir);if(!i.ok){L.error(i.error??"failed to remove skill");return}L.info(`Removed "${e.name}" — moved to trash`),A(e.path),k(n=>n.filter(s=>s.path!==e.path)),C(n=>{var o;return n!==e.path?n:((o=v.filter(c=>c.path!==e.path)[0])==null?void 0:o.path)??null})}l.useEffect(()=>{if(r)return y[r]||P(r),q(r),()=>A(r)},[r]);const[J,S]=l.useState(null);if(!d)return t.jsx(R,{title:"loading…"});if(w==="library")return t.jsx(D,{toolbar:t.jsx(F,{active:w,onChange:E,installedLabel:"Installed",libraryLabel:"Library"}),children:t.jsx(te,{})});if(p==="project"&&!h)return t.jsx(D,{toolbar:t.jsxs(t.Fragment,{children:[t.jsx(F,{active:w,onChange:E}),t.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),t.jsx(V,{scopes:["user","project"],active:p,onChange:e=>{j.current=!0,N(e)}})]}),children:t.jsx(R,{title:"no active project",hint:"open a tab in a project directory to view project skills & commands"})});const f=v.find(e=>e.path===r)??null,g=r?y[r]:null;return t.jsx(D,{toolbar:t.jsxs(t.Fragment,{children:[t.jsx(F,{active:w,onChange:E}),t.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),t.jsx(V,{scopes:["user","project"],active:p,onChange:e=>{j.current=!0,N(e)}}),t.jsxs("span",{className:"ml-3 text-fg-faint",children:[v.length," ",v.length===1?"item":"items"]}),t.jsx("div",{className:"flex-1"}),f&&t.jsx(B,{scope:f.scope,input:{type:f.kind==="commands"?"command":"skill",name:f.name}}),t.jsx("span",{className:"ml-2 text-fg-faint truncate",children:(f==null?void 0:f.path)??""})]}),footer:r&&g?t.jsx(Z,{dirty:g.dirty,busy:g.busy,parseError:J,lastSavedAt:g.lastSavedAt,onSave:async()=>{S(null);const e=await O(r);e.ok||S(e.error??"save failed")},onRevert:()=>{S(null),W(r)}}):null,children:t.jsx(X,{sidebar:t.jsxs("div",{className:"py-1",children:[t.jsx("div",{className:"px-2 pb-1",children:t.jsx("input",{value:$,onChange:e=>I(e.target.value),placeholder:"filter…",className:"w-full bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"})}),["skills","commands"].map(e=>{const i=$.toLowerCase(),n=v.filter(s=>s.kind===e&&(!i||s.name.toLowerCase().includes(i)));return t.jsxs("div",{className:"mb-3",children:[t.jsx("div",{className:"px-3 py-1 text-xs uppercase tracking-wider text-fg-faint",children:e==="skills"?"Skills":"Slash Commands"}),n.length===0?t.jsx("div",{className:"px-3 py-1 text-xs text-fg-faint italic",children:"none"}):n.map(s=>{var c;const o=s.kind==="skills";return t.jsxs("div",{className:`w-full px-3 py-1 text-xs flex items-center justify-between gap-2 ${r===s.path?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:[t.jsxs("button",{onClick:()=>C(s.path),className:"flex-1 min-w-0 text-left",children:[t.jsxs("div",{className:`truncate ${s.disabled?"line-through opacity-50":""}`,title:s.disabled?"Disabled — Claude will not auto-invoke this skill":void 0,children:[s.kind==="commands"?"/":"",s.name]}),s.description&&t.jsx("div",{className:"truncate text-fg-faint",children:s.description})]}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[t.jsx(B,{interactive:!1,scope:s.scope,input:{type:s.kind==="commands"?"command":"skill",name:s.name}}),((c=y[s.path])==null?void 0:c.dirty)&&t.jsx("span",{className:"w-1 h-1 rounded-full bg-accent"}),o&&t.jsx(_,{checked:!s.disabled,onChange:a=>void z(s,!a)}),s.kind==="skills"&&t.jsx("button",{onClick:a=>{a.stopPropagation(),G(s)},title:"Remove skill — moves the folder to trash; reinstall from the Library","aria-label":`Remove ${s.name}`,className:"text-fg-faint hover:text-red-400 leading-none px-0.5",children:"✕"})]})]},s.path)})]},e)})]}),detail:r&&g?t.jsx("div",{className:"h-full",children:t.jsx(Y,{path:r,value:g.draftRaw,onChange:e=>{S(null),H(r,e)}})}):t.jsx(R,{title:v.length===0?"no skills or commands":"select an item"})})})}const je=l.memo(le);export{je as Skills};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ai as l,as as $,a9 as e,ax as B,a7 as I,a8 as V,ao as _,Q as z,c as H,e as L,o as M,M as D,h as Q,X,ay as q,C as G,av as h,j as P}from"./index-QLRf0epp.js";import{P as T}from"./Panel-LurG5VfD.js";import{S as J}from"./SaveBar-alDHG6cP.js";import{f as K,V as A}from"./Library-Bi2Fn3w9.js";import"./monaco-editor-BW5C4Iv1.js";function F(t){return t.split("/").pop()||t}function W({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([]),$.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=B(),x=I(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(H,{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(Q,{text:o,cursor:p,language:X(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=q(),[o,f]=l.useState("installed"),n=l.useMemo(()=>t?G.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(K,{})});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(J,{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(W,{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{
|
|
1
|
+
import{ai as o,T as g,a9 as e,j as w,ar as v,as as u,H as y}from"./index-QLRf0epp.js";import{P as T}from"./Panel-LurG5VfD.js";import{L as k}from"./ListDetail-4VBvXKrz.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{
|
|
1
|
+
import{al as aa,ai as G,t as Pt,a9 as R,u as Nf,a6 as If,Z as Rf}from"./index-QLRf0epp.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{
|
|
1
|
+
import{a9 as r}from"./index-QLRf0epp.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};
|