claude-code-session-manager 0.128.0 → 0.130.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.
Files changed (108) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/README.md +2 -0
  3. package/dist/assets/AgentLibrary-ctvNes4y.js +2 -0
  4. package/dist/assets/AppSettings-C03qTDSi.js +2 -0
  5. package/dist/assets/Button-fOCJry21.js +1 -0
  6. package/dist/assets/Extensions-BWiDwigT.js +13 -0
  7. package/dist/assets/{History-4rrDdWNP.js → History-BIQFPXM8.js} +2 -2
  8. package/dist/assets/Library-BGmD-xZN.js +32 -0
  9. package/dist/assets/ListDetail-BeO3lY8t.js +1 -0
  10. package/dist/assets/{Memory-DgQlvQrO.js → Memory-BeXuYIcE.js} +8 -8
  11. package/dist/assets/{Panel-DZHiD8Ar.js → Panel-OUbLHNsS.js} +1 -1
  12. package/dist/assets/ProvenanceBadge-kr7arZqu.js +1 -0
  13. package/dist/assets/Scheduler-DycegnjH.js +16 -0
  14. package/dist/assets/Settings-BSq6VASG.js +2 -0
  15. package/dist/assets/{SkillReferenceGraph-C5lKqf5y.js → SkillReferenceGraph-CvPdxg56.js} +1 -1
  16. package/dist/assets/SourceChip-C2YMnlV8.js +1 -0
  17. package/dist/assets/SystemPrompt-fpXEK_Rm.js +1 -0
  18. package/dist/assets/{TiptapBody-C2Iu6rZd.js → TiptapBody-DusJg0je.js} +1 -1
  19. package/dist/assets/{Toggle-C-oD66BG.js → Toggle-BnJF4V6k.js} +1 -1
  20. package/dist/assets/ViewTabs-BYrRSHb6.js +1 -0
  21. package/dist/assets/VoiceButton-Bk66E-fP.js +1 -0
  22. package/dist/assets/{historyTotals-CbRSLD8f.js → historyTotals-DnuVADtI.js} +1 -1
  23. package/dist/assets/{index-DtdWBGrI.css → index-Bp8XE9A6.css} +1 -1
  24. package/dist/assets/index-DfWJO7nP.js +3086 -0
  25. package/dist/index.html +2 -2
  26. package/dist-web/app.css +1 -1
  27. package/dist-web/app.js +391 -405
  28. package/package.json +1 -1
  29. package/plugins/CLAUDE.md +2 -2
  30. package/plugins/session-manager-dev/.claude-plugin/plugin.json +2 -2
  31. package/plugins/session-manager-dev/skills/builder/4-manual/SKILL.md +2 -2
  32. package/plugins/session-manager-dev/skills/develop/SKILL.md +7 -5
  33. package/plugins/session-manager-dev/skills/maintaining-md-network/SKILL.md +62 -0
  34. package/plugins/session-manager-dev/skills/maintaining-md-network/audit.md +169 -0
  35. package/plugins/session-manager-dev/skills/maintaining-md-network/drift-check.md +183 -0
  36. package/plugins/session-manager-dev/skills/maintaining-md-network/placement.md +39 -0
  37. package/plugins/session-manager-dev/skills/maintaining-md-network/plan.md +79 -0
  38. package/plugins/session-manager-dev/skills/maintaining-md-network/scripts/drift-check.cjs +400 -0
  39. package/scripts/hooks/lib/guard-inline-implementation-policy.cjs +10 -0
  40. package/scripts/scheduler-mcp-server.cjs +25 -6
  41. package/src/main/agentLibrary.cjs +36 -10
  42. package/src/main/build-info.json +4 -4
  43. package/src/main/chatRunner.cjs +8 -0
  44. package/src/main/config.cjs +15 -0
  45. package/src/main/health.cjs +49 -22
  46. package/src/main/index.cjs +32 -3
  47. package/src/main/ipcSchemas.cjs +39 -4
  48. package/src/main/lib/claude/agentModelResolve.cjs +5 -3
  49. package/src/main/lib/claude/effectiveModelInfo.cjs +14 -4
  50. package/src/main/lib/claude/modelCatalog.cjs +26 -15
  51. package/src/main/lib/claudeConfig.cjs +156 -0
  52. package/src/main/lib/effectiveSettings.cjs +120 -0
  53. package/src/main/lib/epic/delegationReadiness.cjs +3 -3
  54. package/src/main/lib/epic/developLoopSpawn.cjs +18 -0
  55. package/src/main/lib/epic/epicMint.cjs +4 -2
  56. package/src/main/lib/epic/promptSessionsCreateEpic.cjs +4 -3
  57. package/src/main/lib/feedback-remote/crossProjectFeedback.cjs +21 -21
  58. package/src/main/lib/feedback-remote/macroAdminRoutes.cjs +84 -11
  59. package/src/main/lib/git/gitWorktree.cjs +400 -9
  60. package/src/main/lib/git/runtimeStateUntrack.cjs +124 -0
  61. package/src/main/lib/mcpToolCatalog.cjs +8 -2
  62. package/src/main/lib/memoryDirResolve.cjs +2 -8
  63. package/src/main/lib/opsOwnership.cjs +63 -2
  64. package/src/main/lib/persona-macro/builtinMacros.cjs +30 -0
  65. package/src/main/lib/persona-macro/macroLibrary.cjs +34 -6
  66. package/src/main/lib/persona-macro/shippedPersonaSeeds.cjs +46 -0
  67. package/src/main/lib/prd/prdCreate.cjs +15 -0
  68. package/src/main/lib/promptSessionSchema.cjs +8 -0
  69. package/src/main/lib/updateCheck.cjs +6 -1
  70. package/src/main/pluginInstall.cjs +100 -1
  71. package/src/main/scheduler.cjs +12 -2
  72. package/src/main/seedDevPlugin.cjs +2 -1
  73. package/src/main/templates/PRD_AUTHORING.md +3 -3
  74. package/src/main/updaterIpc.cjs +5 -1
  75. package/src/main/usage.cjs +5 -20
  76. package/src/main/voiceHotkey.cjs +16 -0
  77. package/src/main/voiceSettings.cjs +24 -0
  78. package/src/main/voiceWizard.cjs +27 -36
  79. package/src/preload/api.d.ts +59 -3
  80. package/src/preload/apiSurface.json +70 -7
  81. package/src/preload/index.cjs +17 -1
  82. package/src/seed/agents/architect.md +8 -8
  83. package/src/seed/agents/demo-video-builder.md +2 -2
  84. package/src/seed/agents/validator.md +2 -2
  85. package/dist/assets/AgentLibrary-cNQU5YWy.js +0 -2
  86. package/dist/assets/Button-9dIPAOBg.js +0 -1
  87. package/dist/assets/DataModel-DrDJ6ysw.js +0 -1
  88. package/dist/assets/Hooks-Bj_jF5Pa.js +0 -3
  89. package/dist/assets/Library-D-Wsxrh7.js +0 -46
  90. package/dist/assets/ListDetail-D7Om0H8j.js +0 -1
  91. package/dist/assets/McpServers-CbIbSd5o.js +0 -2
  92. package/dist/assets/Permissions-CfzduF4B.js +0 -3
  93. package/dist/assets/Plugins-D-AG5nAo.js +0 -2
  94. package/dist/assets/ProvenanceBadge-B9JSEjll.js +0 -1
  95. package/dist/assets/SaveBar-mVKig6hL.js +0 -1
  96. package/dist/assets/Scheduler-DFTCnh60.js +0 -16
  97. package/dist/assets/ScopeSwitcher-s8J-yr7Z.js +0 -1
  98. package/dist/assets/Settings-BTmxRMaP.js +0 -4
  99. package/dist/assets/Skills-CxOacq0k.js +0 -2
  100. package/dist/assets/SystemPrompt-BCWg5FAz.js +0 -1
  101. package/dist/assets/TagLibrary-BnF0_PkG.js +0 -1
  102. package/dist/assets/ViewTabs-Cs4v7vLY.js +0 -1
  103. package/dist/assets/index-DzY_GXYY.js +0 -3081
  104. package/dist/assets/listSkills-C1aWKf0T.js +0 -1
  105. package/dist/assets/settingsSchema-bSBfHuan.js +0 -1
  106. package/dist/assets/skillFrontmatter-BEseWm8r.js +0 -10
  107. package/dist/assets/useAgentsDirWatch-CdyHxKCI.js +0 -1
  108. package/src/main/lib/epic/epicStandingInstructions.cjs +0 -73
@@ -1 +0,0 @@
1
- const p=a=>a instanceof Error?a.message:String(a);async function y(a,w={}){const d=w.nested??!0,s=[],c=async t=>{try{const r=await window.api.config.listDir(t,{dirsOnly:!0});return r.ok?r.entries:(s.push({path:t,error:r.error??"failed to list directory"}),[])}catch(r){return s.push({path:t,error:p(r)}),[]}};let o=0;const l=[],u=async t=>{var r;o>=6&&await new Promise(n=>l.push(n)),o++;try{return await window.api.config.readText(t)}catch(n){return s.push({path:t,error:p(n)}),null}finally{o--,(r=l.shift())==null||r()}};return{entries:(await Promise.all((await c(a)).map(async t=>{const r=`${t.path}/SKILL.md`,n=await u(r);return n!=null&&n.exists?[{name:t.name,path:r,dir:t.path,text:n.text}]:d?(await Promise.all((await c(t.path)).map(async e=>{const f=`${e.path}/SKILL.md`,i=await u(f);return i!=null&&i.exists?{name:e.name,path:f,dir:e.path,text:i.text}:null}))).filter(e=>e!==null):[]}))).flat(),errors:s}}export{y as l};
@@ -1 +0,0 @@
1
- import{aB as b,al as n,S as N,aW as O}from"./index-DzY_GXYY.js";import{r as K}from"./claude-settings-schema-COigsajx.js";function G({node:e,targetScope:r,onOverride:s,schema:a,rootLabel:m}){const[f,x]=b.useState(""),[u,o]=b.useState(!0),g=[],d=e.kind==="object"&&Object.keys(e.children).length===0,y=((a==null?void 0:a.rootKeys())??[]).length>0;return n.jsxs("div",{className:"h-full flex flex-col",children:[n.jsxs("div",{className:"shrink-0 border-b border-line bg-bg-elev px-3 py-1.5 flex items-center gap-2 text-xs",children:[n.jsxs("span",{className:"text-fg-faint",children:["merged · overrides → ",n.jsx("span",{className:"text-fg-dim",children:N[r].label})]}),y&&n.jsxs("label",{className:"flex items-center gap-1 text-fg-faint cursor-pointer",children:[n.jsx("input",{type:"checkbox",checked:u,onChange:t=>o(t.target.checked),className:"accent-accent"}),"show unset keys"]}),n.jsx("div",{className:"flex-1"}),n.jsx("input",{value:f,onChange:t=>x(t.target.value),placeholder:"filter keys or descriptions…",className:"bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg w-56"})]}),n.jsx("div",{className:"flex-1 overflow-auto px-3 py-2 font-mono text-xs",children:d&&!u?n.jsx("div",{className:"text-fg-faint italic px-2 py-4",children:"no settings resolved — all scope files empty or missing"}):n.jsx(E,{node:e,path:g,label:m??"(root)",targetScope:r,onOverride:s,filter:f,depth:0,schema:a,showGhosts:u,defaultOpen:!0})})]})}function E(e){return e.node.kind==="object"?n.jsx(P,{...e,node:e.node}):e.node.kind==="array"?n.jsx(J,{...e,node:e.node}):n.jsx(R,{...e,node:e.node})}function A(e,r){return r.trim()?e.toLowerCase().includes(r.toLowerCase()):!0}function w(e,r,s){return!!(!s.trim()||e.some(a=>A(a,s))||r!=null&&r.description&&A(r.description,s))}function P({node:e,path:r,label:s,targetScope:a,onOverride:m,filter:f,depth:x,schema:u,showGhosts:o,defaultOpen:g}){const[d,h]=b.useState(g??x<2),y=(u==null?void 0:u.at(r))??null,t=new Set(Object.keys(e.children)),i=o?(y==null?void 0:y.knownChildren)??[]:[],c=Array.from(new Set([...t,...i])).sort(),l=b.useMemo(()=>f.trim()?c.filter(p=>{const v=(u==null?void 0:u.at([...r,p]))??null;return w([...r,p],v,f)?!0:t.has(p)?L(e.children[p],[...r,p],f,u):!1}):c,[c.join(","),f,e,r.join("."),u]);if(f.trim()&&l.length===0&&!w(r,y,f))return null;if(r.length===0)return n.jsx("div",{children:l.map(p=>j(p))});return n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-1 py-0.5 hover:bg-bg-elev/50 rounded cursor-pointer",style:{paddingLeft:x*14},onClick:()=>h(!d),children:[n.jsx("span",{className:"text-fg-faint w-3 shrink-0",children:d?"▾":"▸"}),n.jsx("span",{className:"text-fg",children:s}),n.jsxs("span",{className:"text-fg-faint",children:[" {",t.size,i.length>t.size?`/${new Set([...t,...i]).size}`:"","}"]}),(y==null?void 0:y.description)&&n.jsxs("span",{className:"text-fg-faint truncate max-w-md",title:y.description,children:["— ",y.description]})]}),d&&l.map(p=>j(p))]});function j(p){if(t.has(p))return n.jsx(E,{node:e.children[p],path:[...r,p],label:p,targetScope:a,onOverride:m,filter:f,depth:x+1,schema:u,showGhosts:o},p);const v=(u==null?void 0:u.at([...r,p]))??null;return v?n.jsx(I,{path:[...r,p],label:p,info:v,targetScope:a,onSet:m,depth:x+1,filter:f},p):null}}function L(e,r,s,a){const m=(a==null?void 0:a.at(r))??null;if(w(r,m,s))return!0;if(e.kind!=="object")return!1;for(const f of Object.keys(e.children))if(L(e.children[f],[...r,f],s,a))return!0;return!1}function J({node:e,path:r,label:s,filter:a,depth:m,schema:f}){const[x,u]=b.useState(!0),o=(f==null?void 0:f.at(r))??null;return w(r,o,a)?n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-1 py-0.5 hover:bg-bg-elev/50 rounded cursor-pointer",style:{paddingLeft:m*14},onClick:()=>u(!x),children:[n.jsx("span",{className:"text-fg-faint w-3 shrink-0",children:x?"▾":"▸"}),n.jsx("span",{className:"text-fg",children:s}),n.jsxs("span",{className:"text-fg-faint",children:[" [",e.items.length,"]"]}),n.jsx(S,{tone:"warn",children:"accumulated"}),(o==null?void 0:o.description)&&n.jsxs("span",{className:"text-fg-faint truncate max-w-md",title:o.description,children:["— ",o.description]})]}),x&&e.items.map((g,d)=>n.jsxs("div",{className:"flex items-start gap-2 py-0.5",style:{paddingLeft:(m+1)*14},children:[n.jsx("span",{className:"text-fg-faint w-3 shrink-0"}),n.jsxs("span",{className:"text-fg-faint",children:[d,":"]}),n.jsx("span",{className:"text-fg-dim truncate max-w-xl",children:k(g.value)}),n.jsx(C,{scope:g.fromScope})]},d))]}):null}function R({node:e,path:r,label:s,targetScope:a,onOverride:m,filter:f,depth:x,schema:u}){const[o,g]=b.useState(!1),d=(u==null?void 0:u.at(r))??null;if(!w(r,d,f))return null;const h=e.winner!==a,y=e.shadowed.length>0;return n.jsxs("div",{children:[n.jsxs("div",{className:"group flex items-center gap-2 py-0.5 hover:bg-bg-elev/50 rounded",style:{paddingLeft:x*14},children:[n.jsx("span",{className:`w-3 shrink-0 ${y?"text-fg-faint cursor-pointer":""}`,onClick:()=>y&&g(!o),children:y?o?"▾":"▸":""}),n.jsxs("span",{className:"text-fg",children:[s,":"]}),n.jsx("span",{className:"text-fg-dim truncate max-w-md",children:k(e.value)}),n.jsx(C,{scope:e.winner}),(d==null?void 0:d.deprecated)&&n.jsx(S,{tone:"warn",children:"deprecated"}),(d==null?void 0:d.default)!==void 0&&_(e.value,d.default)&&n.jsx(S,{tone:"dim",children:"= default"}),e.typeMismatch&&n.jsx("span",{className:"text-yellow-500/80",title:"shadowed scopes have a different value type",children:"⚠"}),(d==null?void 0:d.description)&&n.jsxs("span",{className:"text-fg-faint truncate max-w-md",title:d.description,children:["— ",d.description]}),n.jsx("div",{className:"flex-1"}),(d==null?void 0:d.enum)&&n.jsx(F,{values:d.enum}),n.jsx("button",{disabled:!h,onClick:()=>m(r,e.value),className:`opacity-0 group-hover:opacity-100 px-1.5 py-0 text-[10px] border rounded transition-opacity ${h?"border-accent/50 text-accent hover:bg-accent hover:text-bg":"border-line text-fg-faint cursor-not-allowed"}`,title:h?`copy into ${N[a].label} draft`:`already winning in ${N[a].label}`,children:"override"})]}),o&&e.shadowed.map((t,i)=>n.jsxs("div",{className:"flex items-center gap-2 py-0.5 text-fg-faint line-through",style:{paddingLeft:(x+1)*14+12},children:[n.jsx("span",{children:"shadowed:"}),n.jsx("span",{className:"truncate max-w-xl",children:k(t.value)}),n.jsx(C,{scope:t.scope,dim:!0})]},i))]})}function I({path:e,label:r,info:s,targetScope:a,onSet:m,depth:f,filter:x}){if(!w(e,s,x))return null;const u=s.default!==void 0?s.default:B(s.type),o=Array.isArray(s.type)?s.type.join("|"):s.type??"?";return n.jsxs("div",{className:"group flex items-center gap-2 py-0.5 hover:bg-bg-elev/50 rounded opacity-60",style:{paddingLeft:f*14},children:[n.jsx("span",{className:"w-3 shrink-0"}),n.jsx("span",{className:"text-fg-dim",children:r}),n.jsx(S,{tone:"dim",children:o}),s.required&&n.jsx(S,{tone:"warn",children:"required"}),s.default!==void 0&&n.jsxs("span",{className:"text-fg-faint",children:["default: ",k(s.default)]}),s.description&&n.jsxs("span",{className:"text-fg-faint truncate max-w-md",title:s.description,children:["— ",s.description]}),n.jsx("div",{className:"flex-1"}),s.enum&&n.jsx(F,{values:s.enum}),n.jsx("button",{onClick:()=>m(e,u),className:"opacity-0 group-hover:opacity-100 px-1.5 py-0 text-[10px] border border-accent/50 rounded text-accent hover:bg-accent hover:text-bg transition-opacity",title:`write to ${N[a].label} draft`,children:"set"})]})}function _(e,r){return e===r?!0:typeof e!=typeof r?!1:e&&r&&typeof e=="object"?JSON.stringify(e)===JSON.stringify(r):!1}function B(e){switch(Array.isArray(e)?e[0]:e){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};case"null":return null;default:return null}}function k(e){if(typeof e=="string")return JSON.stringify(e);if(e===null)return"null";if(typeof e=="object"){const r=JSON.stringify(e);return r.length>100?r.slice(0,100)+"…":r}return String(e)}function C({scope:e,dim:r}){const s=e==="user"?"bg-bg-hi text-fg-dim border-line":e==="project"?"bg-blue-950/30 text-blue-400/80 border-blue-900/40":"bg-purple-950/30 text-purple-400/80 border-purple-900/40";return n.jsx("span",{className:`text-[10px] px-1 py-0 rounded border uppercase tracking-wide shrink-0 ${s} ${r?"opacity-60":""}`,children:N[e].label})}function S({children:e,tone:r="default"}){const s={default:"bg-bg-hi text-fg-dim border-line",warn:"bg-yellow-950/30 text-yellow-500/80 border-yellow-900/40",dim:"bg-bg-elev text-fg-faint border-line"}[r];return n.jsx("span",{className:`text-[10px] px-1 py-0 rounded border uppercase tracking-wide shrink-0 ${s}`,children:e})}function F({values:e}){const r=e.map(s=>String(s)).join(" | ");return n.jsxs("span",{className:"text-[10px] text-fg-faint truncate max-w-xs",title:`allowed: ${r}`,children:["∈ ",r.length>30?r.slice(0,30)+"…":r]})}function V(e,r,s){const a=O(o=>o.files),m=O(o=>o.loadJson),f=O(o=>o.watchFile),x=O(o=>o.unwatchFile),u=b.useMemo(()=>{const o={};for(const g of e.scopes){const d=e.resolve(g,r??"",s);d&&(o[g]=d)}return o},[e,r,s]);return b.useEffect(()=>{const o=Object.values(u).filter(Boolean);return o.forEach(g=>{a[g]||m(g),f(g)}),()=>{o.forEach(g=>x(g))}},[JSON.stringify(u)]),u}function M(e){const r=e??{},s={...r.$defs??{},...r.definitions??{}},a=t=>{if(!t)return{};if(!t.$ref)return x(t);const i=/^#\/(\$defs|definitions)\/(.+)$/.exec(t.$ref);if(!i)return x(t);const c=s[i[2]];return c?a({...c,...u(t)}):x(t)},m=new Set(["__proto__","constructor","prototype"]),f=t=>{if(!t)return{};const i={};for(const[c,l]of Object.entries(t))m.has(c)||(i[c]=l);return i},x=t=>{if(!t.allOf||t.allOf.length===0)return t;const i={...t};delete i.allOf;for(const c of t.allOf){const l=a(c);Object.assign(i,{properties:{...f(i.properties),...f(l.properties)},required:q([...i.required??[],...l.required??[]])}),!i.description&&l.description&&(i.description=l.description),i.default===void 0&&l.default!==void 0&&(i.default=l.default),!i.type&&l.type&&(i.type=l.type)}return i},u=t=>{const{$ref:i,...c}=t;return c},o=(t,i)=>{let c=a(t);for(const l of i){if(!c)return null;if(/^\d+$/.test(l)){const v=Array.isArray(c.items)?c.items[Number(l)]:c.items;c=v?a(v):null;continue}const j=c.properties;if(j&&!m.has(l)&&l in j){c=a(j[l]);continue}const p=c.additionalProperties;if(p&&typeof p=="object"){c=a(p);continue}return null}return c},g=(t,i,c)=>{if(!t)return null;const l={};if(t.description&&(l.description=t.description),t.type&&(l.type=t.type),t.default!==void 0&&(l.default=t.default),t.enum&&(l.enum=t.enum),t.const!==void 0&&(l.const=t.const),t.deprecated&&(l.deprecated=!0),t.examples&&(l.examples=t.examples),t.properties&&(l.knownChildren=Object.keys(t.properties)),c&&(i!=null&&i.includes(c))&&(l.required=!0),t.items&&!Array.isArray(t.items)){const j=a(t.items),p=g(j,void 0,null);p&&(l.itemsInfo=p)}return(t.additionalProperties===!0||typeof t.additionalProperties=="object")&&(l.open=!0),l},d=t=>i=>{if(i.length===0)return g(a(t),void 0,null);const c=o(t,i.slice(0,-1));if(!c)return null;const l=i[i.length-1],j=o(c,[l]);return g(j,c.required,l)},h=t=>{const i=a(t);return Object.keys(i.properties??{})},y=t=>({at:d(t),rootKeys:()=>h(t),rootedAt:i=>{const c=o(t,i);return y(c??{})}});return y(r)}function q(e){return Array.from(new Set(e))}let $=null;function D(){return $||($=M(K)),$}export{G as E,D as s,V as u};
@@ -1,10 +0,0 @@
1
- import{al as k,F as E}from"./index-DzY_GXYY.js";function M({value:t,onChange:n,path:e,readOnly:i}){return k.jsx(E,{path:`file://${e}`,defaultLanguage:"markdown",value:t,onChange:s=>n(s??""),theme:"vs-dark",options:{minimap:{enabled:!1},fontSize:13,fontFamily:"JetBrains Mono, ui-monospace, Menlo, monospace",lineNumbers:"on",renderLineHighlight:"line",scrollBeyondLastLine:!1,tabSize:2,wordWrap:"on",readOnly:i,automaticLayout:!0}})}const f=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/,u="disable-model-invocation",g=/^\s*disable-model-invocation\s*:/;function j(t){const n=t.match(f);if(!n)return!1;for(const e of n[1].split(/\r?\n/)){if(!g.test(e))continue;const i=e.slice(e.indexOf(":")+1).trim().toLowerCase();return i==="true"||i==="yes"}return!1}function S(t){const n=t.trim();return n.length>=2&&(n[0]==='"'&&n[n.length-1]==='"'||n[0]==="'"&&n[n.length-1]==="'")?n.slice(1,-1):n}function h(t){return t.length-t.trimStart().length}function v(t){const n=t.match(f);if(!n)return{name:null,description:null,body:t};const e=n[1].split(/\r?\n/),i=n[2]??"";let s=null,r=null;for(let o=0;o<e.length;o++){const m=e[o],d=m.match(/^(\s*)(name|description)\s*:(.*)$/);if(!d)continue;const[,,y,$]=d,l=$.trim(),b=h(m);let c;if(l===""||l===">-"||l===">"||l==="|-"||l==="|"){const p=[];let a=o+1;for(;a<e.length&&e[a].trim()!==""&&h(e[a])>b;)p.push(e[a].trim()),a++;c=p.join(" ")}else c=S(l);y==="name"?s=c:r=c}return{name:s,description:r,body:i}}function w(t,n){const e=t.match(f);if(!e){if(!n)return t;const o=t.startsWith(`
2
- `)?"":`
3
- `;return`---
4
- ${u}: true
5
- ---
6
- ${o}${t}`}const i=e[2]??"",s=e[1].split(/\r?\n/),r=s.findIndex(o=>g.test(o));if(n)r>=0?s[r]=`${u}: true`:s.push(`${u}: true`);else{if(r<0)return t;s.splice(r,1)}return`---
7
- ${s.join(`
8
- `)}
9
- ---
10
- ${i}`}export{M,v as p,j as r,w as s};
@@ -1 +0,0 @@
1
- import{V as e,b0 as a,aX as n}from"./index-DzY_GXYY.js";const c=new Set(e.map(t=>t.tag));function l(t){return t.filter(o=>c.has(o))}function s(t,o={}){return{name:t.name,originalName:t.name,description:t.description??"",tools:t.tools,model:t.model??"inherit",effort:t.effort??void 0,color:t.color??"",tags:l(t.tags),projects:t.projects,action:t.action??void 0,actionLabel:t.actionLabel??void 0,title:t.title??void 0,body:t.body,...o}}function d(t,o){const i=a();n([i?`${i}/.claude/agents`:null,t?`${t}/.claude/agents`:null],o)}export{s as a,l as t,d as u};
@@ -1,73 +0,0 @@
1
- 'use strict';
2
- /**
3
- * epicStandingInstructions.cjs — turns an Epic record into the text Session
4
- * Manager passes as --append-system-prompt on EVERY turn of that Epic, so the
5
- * Actor's operating rules survive later turns and compaction.
6
- *
7
- * buildEpicStandingInstructions is pure; the persona reader is injected.
8
- */
9
-
10
- const HEADER = 'Standing instructions for this Epic (re-sent every turn by Session Manager):';
11
- const MAX_CHARS = 12000;
12
- const TRUNCATION_NOTICE = '\n\n[…standing instructions truncated at 12000 characters]';
13
- const INCLUDED_KINDS = new Set(['actor', 'persona-body', 'injection', 'mission']);
14
-
15
- // Must equal CONTEXT_INJECTIONS['delegate-implementation'].text in
16
- // src/renderer/lib/contextInjections.ts (guarded by delegateTextDrift.test.ts).
17
- const DELEGATE_IMPLEMENTATION_TEXT =
18
- 'This interactive session plans and decides; it does not implement. Once scope is clear, ' +
19
- 'queue the implementation as scheduled PRDs via the /develop skill and let it run headless — ' +
20
- 'do not edit application source inline in this conversation. If the scheduler tools are ' +
21
- 'unavailable, say so explicitly rather than falling back to implementing the work yourself.';
22
-
23
- function cap(text) {
24
- if (text.length <= MAX_CHARS) return text;
25
- return text.slice(0, MAX_CHARS - TRUNCATION_NOTICE.length) + TRUNCATION_NOTICE;
26
- }
27
-
28
- function buildEpicStandingInstructions(epic, { readPersonaBody } = {}) {
29
- if (!epic || typeof epic !== 'object') return null;
30
- const sections = Array.isArray(epic.sections) ? epic.sections : [];
31
- const parts = [];
32
- if (sections.length > 0) {
33
- for (const s of sections) {
34
- if (!s || !INCLUDED_KINDS.has(s.kind)) continue;
35
- const t = typeof s.text === 'string' ? s.text.trim() : '';
36
- if (t) parts.push(t);
37
- }
38
- } else if (epic.agentType && typeof readPersonaBody === 'function') {
39
- let body = null;
40
- try { body = readPersonaBody(epic.agentType); } catch { body = null; }
41
- const t = typeof body === 'string' ? body.trim() : '';
42
- if (t) parts.push(t);
43
- }
44
-
45
- const wantsDelegate = epic.tag === 'feature' || epic.tag === 'bug' || epic.agentType === 'architect';
46
- const hasDelegate = sections.some(
47
- (s) => s && s.kind === 'injection' && s.source === 'delegate-implementation',
48
- );
49
- if (wantsDelegate && !hasDelegate) parts.push(DELEGATE_IMPLEMENTATION_TEXT);
50
-
51
- if (parts.length === 0) return null;
52
- return cap(`${HEADER}\n\n${parts.join('\n\n')}`);
53
- }
54
-
55
- /** Overlay-aware persona body (project .claude/agents wins over ~/.claude/agents), frontmatter stripped. */
56
- function defaultReadPersonaBody(cwd, name) {
57
- try {
58
- const { resolveMergedPersona } = require('../persona-macro/personaMerge.cjs');
59
- const merged = resolveMergedPersona(cwd, name);
60
- const body = merged && typeof merged.body === 'string' ? merged.body.trim() : '';
61
- return body || null;
62
- } catch {
63
- return null;
64
- }
65
- }
66
-
67
- module.exports = {
68
- buildEpicStandingInstructions,
69
- defaultReadPersonaBody,
70
- DELEGATE_IMPLEMENTATION_TEXT,
71
- HEADER,
72
- MAX_CHARS,
73
- };