olympus-ai 2.6.2 → 2.6.3

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.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  // Olympus Hooks Bundle - Generated by esbuild
3
- "use strict";var ws=Object.create;var Se=Object.defineProperty;var vs=Object.getOwnPropertyDescriptor;var Ps=Object.getOwnPropertyNames;var bs=Object.getPrototypeOf,Ds=Object.prototype.hasOwnProperty;var Ls=(e,t)=>{for(var n in t)Se(e,n,{get:t[n],enumerable:!0})},gn=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Ps(t))!Ds.call(e,r)&&r!==n&&Se(e,r,{get:()=>t[r],enumerable:!(o=vs(t,r))||o.enumerable});return e};var M=(e,t,n)=>(n=e!=null?ws(bs(e)):{},gn(t||!e||!e.__esModule?Se(n,"default",{value:e,enumerable:!0}):n,e)),Ms=e=>gn(Se({},"__esModule",{value:!0}),e);var rc={};Ls(rc,{main:()=>Ns});module.exports=Ms(rc);var Qe=new Map;function m(e){let t=Qe.get(e.event)||[];t.push(e),t.sort((n,o)=>(n.priority??100)-(o.priority??100)),Qe.set(e.event,t)}function hn(e){return Qe.get(e)||[]}var Us={ultrawork:/\b(ultrawork|ulw)\b/i,ultrathink:/\b(ultrathink|think)\b/i,olympus:/\b(olympus|orchestrate|coordinate|multi-?agent|conductor)\b/i,search:/\b(search|find|locate|lookup|explore|discover|scan|grep|query|browse|detect|trace|seek|track|pinpoint|hunt)\b|where\s+is|show\s+me|list\s+all/i,analyze:/\b(analyze|analyse|investigate|examine|research|study|deep.?dive|inspect|audit|evaluate|assess|review|diagnose|scrutinize|dissect|debug|comprehend|interpret|breakdown|understand)\b|why\s+is|how\s+does|how\s+to/i},$s=["ultrawork","ultrathink","olympus","search","analyze"];function Tn(e){let t=e.replace(/```[\s\S]*?```/g,"");return t=t.replace(/~~~[\s\S]*?~~~/g,""),t=t.replace(/`[^`]+`/g,""),t}function En(e,t){let n=[];for(let o of $s){let r=Us[o],s=e.match(r);s&&s.index!==void 0&&n.push({type:o,keyword:s[0],position:s.index})}return n}var Sn="auto-slash-command",ke="<auto-slash-command>",ye="</auto-slash-command>",kn=/^\/([a-zA-Z][\w-]*)\s*(.*)/,yn=new Set(["ascent","cancel-ascent","help","clear","history","exit","quit"]);var js=/```[\s\S]*?```/g;function On(e){return e.replace(js,"")}function Rn(e){let t=e.trim();if(!t.startsWith("/"))return null;let n=t.match(kn);if(!n)return null;let[o,r,s]=n;return{command:r.toLowerCase(),args:s.trim(),raw:o}}function In(e){return yn.has(e.toLowerCase())}function Ze(e){let n=On(e).trim();if(!n.startsWith("/"))return null;let o=Rn(n);return!o||In(o.command)?null:o}function et(e){return e.filter(t=>t.type==="text").map(t=>t.text||"").join(" ")}var D=require("fs"),U=require("path"),An=require("os"),Cn=(0,U.join)((0,An.homedir)(),".claude");function Nn(e){let t=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/,n=e.match(t);if(!n)return{data:{},body:e};let[,o,r]=n,s={};for(let i of o.split(`
4
- `)){let a=i.indexOf(":");if(a===-1)continue;let c=i.slice(0,a).trim(),u=i.slice(a+1).trim();(u.startsWith('"')&&u.endsWith('"')||u.startsWith("'")&&u.endsWith("'"))&&(u=u.slice(1,-1)),s[c]=u}return{data:s,body:r}}function _n(e,t){if(!(0,D.existsSync)(e))return[];let n;try{n=(0,D.readdirSync)(e,{withFileTypes:!0})}catch{return[]}let o=[];for(let r of n){if(!r.isFile()||!r.name.endsWith(".md"))continue;let s=(0,U.join)(e,r.name),i=(0,U.basename)(r.name,".md");try{let a=(0,D.readFileSync)(s,"utf-8"),{data:c,body:u}=Nn(a),l={name:i,description:c.description||"",argumentHint:c["argument-hint"],model:c.model,agent:c.agent};o.push({name:i,path:s,metadata:l,content:u,scope:t})}catch{continue}}return o}function tt(){let e=(0,U.join)(Cn,"commands"),t=(0,U.join)(process.cwd(),".claude","commands"),n=(0,U.join)(Cn,"skills"),o=_n(e,"user"),r=_n(t,"project"),s=[];if((0,D.existsSync)(n))try{let i=(0,D.readdirSync)(n,{withFileTypes:!0});for(let a of i){if(!a.isDirectory())continue;let c=(0,U.join)(n,a.name,"SKILL.md");if((0,D.existsSync)(c))try{let u=(0,D.readFileSync)(c,"utf-8"),{data:l,body:d}=Nn(u),p={name:l.name||a.name,description:l.description||"",argumentHint:l["argument-hint"],model:l.model,agent:l.agent};s.push({name:l.name||a.name,path:c,metadata:p,content:d,scope:"skill"})}catch{continue}}}catch{}return[...r,...o,...s]}function Oe(e){return tt().find(n=>n.name.toLowerCase()===e.toLowerCase())??null}function Fs(e,t){return e.replace(/\$ARGUMENTS/g,t||"(no arguments provided)")}function Hs(e,t){let n=[];n.push(`<command-name>/${e.name}</command-name>
3
+ "use strict";var ws=Object.create;var Se=Object.defineProperty;var vs=Object.getOwnPropertyDescriptor;var Ps=Object.getOwnPropertyNames;var bs=Object.getPrototypeOf,Ds=Object.prototype.hasOwnProperty;var Ls=(e,t)=>{for(var n in t)Se(e,n,{get:t[n],enumerable:!0})},gn=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Ps(t))!Ds.call(e,r)&&r!==n&&Se(e,r,{get:()=>t[r],enumerable:!(o=vs(t,r))||o.enumerable});return e};var b=(e,t,n)=>(n=e!=null?ws(bs(e)):{},gn(t||!e||!e.__esModule?Se(n,"default",{value:e,enumerable:!0}):n,e)),Ms=e=>gn(Se({},"__esModule",{value:!0}),e);var rc={};Ls(rc,{main:()=>Ns});module.exports=Ms(rc);var Qe=new Map;function m(e){let t=Qe.get(e.event)||[];t.push(e),t.sort((n,o)=>(n.priority??100)-(o.priority??100)),Qe.set(e.event,t)}function hn(e){return Qe.get(e)||[]}var Us={ultrawork:/\b(ultrawork|ulw)\b/i,ultrathink:/\b(ultrathink|think)\b/i,olympus:/\b(olympus|orchestrate|coordinate|multi-?agent|conductor)\b/i,search:/\b(search|find|locate|lookup|explore|discover|scan|grep|query|browse|detect|trace|seek|track|pinpoint|hunt)\b|where\s+is|show\s+me|list\s+all/i,analyze:/\b(analyze|analyse|investigate|examine|research|study|deep.?dive|inspect|audit|evaluate|assess|review|diagnose|scrutinize|dissect|debug|comprehend|interpret|breakdown|understand)\b|why\s+is|how\s+does|how\s+to/i},$s=["ultrawork","ultrathink","olympus","search","analyze"];function Tn(e){let t=e.replace(/```[\s\S]*?```/g,"");return t=t.replace(/~~~[\s\S]*?~~~/g,""),t=t.replace(/`[^`]+`/g,""),t}function En(e,t){let n=[];for(let o of $s){let r=Us[o],s=e.match(r);s&&s.index!==void 0&&n.push({type:o,keyword:s[0],position:s.index})}return n}var Sn="auto-slash-command",ke="<auto-slash-command>",ye="</auto-slash-command>",kn=/^\/([a-zA-Z][\w-]*)\s*(.*)/,yn=new Set(["ascent","cancel-ascent","help","clear","history","exit","quit"]);var js=/```[\s\S]*?```/g;function On(e){return e.replace(js,"")}function Rn(e){let t=e.trim();if(!t.startsWith("/"))return null;let n=t.match(kn);if(!n)return null;let[o,r,s]=n;return{command:r.toLowerCase(),args:s.trim(),raw:o}}function In(e){return yn.has(e.toLowerCase())}function Ze(e){let n=On(e).trim();if(!n.startsWith("/"))return null;let o=Rn(n);return!o||In(o.command)?null:o}function et(e){return e.filter(t=>t.type==="text").map(t=>t.text||"").join(" ")}var P=require("fs"),D=require("path"),An=require("os"),Cn=(0,D.join)((0,An.homedir)(),".claude");function Nn(e){let t=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/,n=e.match(t);if(!n)return{data:{},body:e};let[,o,r]=n,s={};for(let i of o.split(`
4
+ `)){let a=i.indexOf(":");if(a===-1)continue;let c=i.slice(0,a).trim(),u=i.slice(a+1).trim();(u.startsWith('"')&&u.endsWith('"')||u.startsWith("'")&&u.endsWith("'"))&&(u=u.slice(1,-1)),s[c]=u}return{data:s,body:r}}function _n(e,t){if(!(0,P.existsSync)(e))return[];let n;try{n=(0,P.readdirSync)(e,{withFileTypes:!0})}catch{return[]}let o=[];for(let r of n){if(!r.isFile()||!r.name.endsWith(".md"))continue;let s=(0,D.join)(e,r.name),i=(0,D.basename)(r.name,".md");try{let a=(0,P.readFileSync)(s,"utf-8"),{data:c,body:u}=Nn(a),l={name:i,description:c.description||"",argumentHint:c["argument-hint"],model:c.model,agent:c.agent};o.push({name:i,path:s,metadata:l,content:u,scope:t})}catch{continue}}return o}function tt(){let e=(0,D.join)(Cn,"commands"),t=(0,D.join)(process.cwd(),".claude","commands"),n=(0,D.join)(Cn,"skills"),o=_n(e,"user"),r=_n(t,"project"),s=[];if((0,P.existsSync)(n))try{let i=(0,P.readdirSync)(n,{withFileTypes:!0});for(let a of i){if(!a.isDirectory())continue;let c=(0,D.join)(n,a.name,"SKILL.md");if((0,P.existsSync)(c))try{let u=(0,P.readFileSync)(c,"utf-8"),{data:l,body:d}=Nn(u),p={name:l.name||a.name,description:l.description||"",argumentHint:l["argument-hint"],model:l.model,agent:l.agent};s.push({name:l.name||a.name,path:c,metadata:p,content:d,scope:"skill"})}catch{continue}}}catch{}return[...r,...o,...s]}function Oe(e){return tt().find(n=>n.name.toLowerCase()===e.toLowerCase())??null}function Fs(e,t){return e.replace(/\$ARGUMENTS/g,t||"(no arguments provided)")}function Hs(e,t){let n=[];n.push(`<command-name>/${e.name}</command-name>
5
5
  `),e.metadata.description&&n.push(`**Description**: ${e.metadata.description}
6
6
  `),t&&n.push(`**Arguments**: ${t}
7
7
  `),e.metadata.model&&n.push(`**Model**: ${e.metadata.model}
@@ -20,7 +20,7 @@ ${ye}`;return{detected:!0,parsedCommand:o,injectedMessage:a}}let i=`${ke}
20
20
  ${s.error}
21
21
 
22
22
  Original input: ${o.raw}
23
- ${ye}`;return{detected:!0,parsedCommand:o,injectedMessage:i}},listCommands:()=>ot(),findCommand:e=>Oe(e),clearSession:e=>{let t=[];for(let n of Re)n.startsWith(`${e}:`)&&t.push(n);for(let n of t)Re.delete(n)}}}var Gs=[/\bultrathink\b/i,/\bthink\b/i],Bs=["\uC0DD\uAC01","\uACE0\uBBFC","\uAC80\uD1A0","\uC81C\uB300\uB85C","\u601D\u8003","\u8003\u8651","\u8003\u616E","\u8003\u3048","\u719F\u8003","\u0938\u094B\u091A","\u0935\u093F\u091A\u093E\u0930","\u062A\u0641\u0643\u064A\u0631","\u062A\u0623\u0645\u0644","\u099A\u09BF\u09A8\u09CD\u09A4\u09BE","\u09AD\u09BE\u09AC\u09A8\u09BE","\u0434\u0443\u043C\u0430\u0442\u044C","\u0434\u0443\u043C\u0430\u0439","\u0440\u0430\u0437\u043C\u044B\u0448\u043B\u044F\u0442\u044C","\u0440\u0430\u0437\u043C\u044B\u0448\u043B\u044F\u0439","pensar","pense","refletir","reflita","piensa","reflexionar","reflexiona","penser","r\xE9fl\xE9chir","r\xE9fl\xE9chis","denken","denk","nachdenken","suy ngh\u0129","c\xE2n nh\u1EAFc","d\xFC\u015F\xFCn","d\xFC\u015F\xFCnmek","pensare","pensa","riflettere","rifletti","\u0E04\u0E34\u0E14","\u0E1E\u0E34\u0E08\u0E32\u0E23\u0E13\u0E32","my\u015Bl","my\u015Ble\u0107","zastan\xF3w","nadenken","berpikir","pikir","pertimbangkan","\u0434\u0443\u043C\u0430\u0442\u0438","\u0440\u043E\u0437\u0434\u0443\u043C\u0443\u0432\u0430\u0442\u0438","\u03C3\u03BA\u03AD\u03C8\u03BF\u03C5","\u03C3\u03BA\u03AD\u03C6\u03C4\u03BF\u03BC\u03B1\u03B9","myslet","mysli","p\u0159em\xFD\u0161let","g\xE2nde\u0219te","g\xE2ndi","reflect\u0103","t\xE4nka","t\xE4nk","fundera","gondolkodj","gondolkodni","ajattele","ajatella","pohdi","t\xE6nk","t\xE6nke","overvej","tenk","tenke","gruble","\u05D7\u05E9\u05D5\u05D1","\u05DC\u05D7\u05E9\u05D5\u05D1","\u05DC\u05D4\u05E8\u05D4\u05E8"],Ys=Bs.map(e=>new RegExp(e,"i")),Ws=[...Gs,...Ys],Ks=/```[\s\S]*?```/g,Vs=/`[^`]+`/g;function qs(e){return e.replace(Ks,"").replace(Vs,"")}function wn(e){let t=qs(e);return Ws.some(n=>n.test(t))}function vn(e){return e.filter(t=>t.type==="text").map(t=>t.text||"").join("")}function rt(e){let t=e.indexOf("/");return t===-1?{prefix:"",base:e}:{prefix:e.slice(0,t+1),base:e.slice(t+1)}}function st(e){return e.replace(/\.(\d+)/g,"-$1")}var Pn={"claude-sonnet-4-5":"claude-sonnet-4-5-high","claude-opus-4-5":"claude-opus-4-5-high","claude-3-5-sonnet":"claude-3-5-sonnet-high","claude-3-opus":"claude-3-opus-high","gpt-4":"gpt-4-high","gpt-4-turbo":"gpt-4-turbo-high","gpt-4o":"gpt-4o-high","gpt-5":"gpt-5-high","gpt-5-mini":"gpt-5-mini-high","gemini-2-pro":"gemini-2-pro-high","gemini-3-pro":"gemini-3-pro-high","gemini-3-flash":"gemini-3-flash-high"},bn=new Set(Object.values(Pn)),Dn={anthropic:{thinking:{type:"enabled",budgetTokens:64e3},maxTokens:128e3},"amazon-bedrock":{reasoningConfig:{type:"enabled",budgetTokens:32e3},maxTokens:64e3},google:{providerOptions:{google:{thinkingConfig:{thinkingLevel:"HIGH"}}}},openai:{reasoning_effort:"high"}},Js={anthropic:["claude-sonnet-4","claude-opus-4","claude-3"],"amazon-bedrock":["claude","anthropic"],google:["gemini-2","gemini-3"],openai:["gpt-4","gpt-5","o1","o3"]};function Ln(e){let t=st(e),{prefix:n,base:o}=rt(t);if(bn.has(o)||o.endsWith("-high"))return null;let r=Pn[o];return r?n+r:null}function it(e){let t=st(e),{base:n}=rt(t);return bn.has(n)||n.endsWith("-high")}function zs(e,t){if(e==="github-copilot"){let n=t.toLowerCase();if(n.includes("claude"))return"anthropic";if(n.includes("gemini"))return"google";if(n.includes("gpt")||n.includes("o1")||n.includes("o3"))return"openai"}return e}function Xs(e){return e in Dn}function Mn(e,t){let n=st(t),{base:o}=rt(n);if(it(n))return null;let r=zs(e,t);if(!Xs(r))return null;let s=Dn[r],i=Js[r];if(!i)return null;let a=o.toLowerCase();return i.some(u=>a.includes(u.toLowerCase()))?s:null}var H=new Map;function Qs(e){H.delete(e)}function Un(){return{processChatParams:(e,t)=>{let n=vn(t.parts),o={requested:!1,modelSwitched:!1,thinkingConfigInjected:!1};if(!wn(n))return H.set(e,o),o;o.requested=!0;let r=t.message.model;if(!r||(o.providerId=r.providerId,o.modelId=r.modelId,it(r.modelId)))return H.set(e,o),o;let s=Ln(r.modelId),i=Mn(r.providerId,r.modelId);return s&&(t.message.model={providerId:r.providerId,modelId:s},o.modelSwitched=!0),i&&(Object.assign(t.message,i),o.thinkingConfigInjected=!0),H.set(e,o),o},onSessionDeleted:e=>{H.delete(e)},isRequested:e=>H.get(e)?.requested??!1,getState:e=>H.get(e),clear:Qs}}var h=require("fs"),z=require("path"),at=require("os");function ct(e){let t=e||process.cwd(),n=(0,z.join)(t,".olympus");return(0,z.join)(n,"ultrawork-state.json")}function ut(){return(0,z.join)((0,at.homedir)(),".claude","ultrawork-state.json")}function Zs(e){let t=e||process.cwd(),n=(0,z.join)(t,".olympus");(0,h.existsSync)(n)||(0,h.mkdirSync)(n,{recursive:!0})}function ei(){let e=(0,z.join)((0,at.homedir)(),".claude");(0,h.existsSync)(e)||(0,h.mkdirSync)(e,{recursive:!0})}function Y(e){let t=ct(e);if((0,h.existsSync)(t))try{let o=(0,h.readFileSync)(t,"utf-8");return JSON.parse(o)}catch{}let n=ut();if((0,h.existsSync)(n))try{let o=(0,h.readFileSync)(n,"utf-8");return JSON.parse(o)}catch{return null}return null}function $n(e,t){try{Zs(t);let n=ct(t);(0,h.writeFileSync)(n,JSON.stringify(e,null,2)),ei();let o=ut();return(0,h.writeFileSync)(o,JSON.stringify(e,null,2)),!0}catch{return!1}}function jn(e,t,n){let o={active:!0,started_at:new Date().toISOString(),original_prompt:e,session_id:t,reinforcement_count:0,last_checked_at:new Date().toISOString()};return $n(o,n)}function Fn(e){let t=ct(e);if((0,h.existsSync)(t))try{(0,h.unlinkSync)(t)}catch{}let n=ut();if((0,h.existsSync)(n))try{return(0,h.unlinkSync)(n),!0}catch{return!1}return!0}function Hn(e){let t=Y(e);return!t||!t.active?null:(t.reinforcement_count+=1,t.last_checked_at=new Date().toISOString(),$n(t,e)?t:null)}function Gn(e){return`<ultrawork-persistence>
23
+ ${ye}`;return{detected:!0,parsedCommand:o,injectedMessage:i}},listCommands:()=>ot(),findCommand:e=>Oe(e),clearSession:e=>{let t=[];for(let n of Re)n.startsWith(`${e}:`)&&t.push(n);for(let n of t)Re.delete(n)}}}var Gs=[/\bultrathink\b/i,/\bthink\b/i],Bs=["\uC0DD\uAC01","\uACE0\uBBFC","\uAC80\uD1A0","\uC81C\uB300\uB85C","\u601D\u8003","\u8003\u8651","\u8003\u616E","\u8003\u3048","\u719F\u8003","\u0938\u094B\u091A","\u0935\u093F\u091A\u093E\u0930","\u062A\u0641\u0643\u064A\u0631","\u062A\u0623\u0645\u0644","\u099A\u09BF\u09A8\u09CD\u09A4\u09BE","\u09AD\u09BE\u09AC\u09A8\u09BE","\u0434\u0443\u043C\u0430\u0442\u044C","\u0434\u0443\u043C\u0430\u0439","\u0440\u0430\u0437\u043C\u044B\u0448\u043B\u044F\u0442\u044C","\u0440\u0430\u0437\u043C\u044B\u0448\u043B\u044F\u0439","pensar","pense","refletir","reflita","piensa","reflexionar","reflexiona","penser","r\xE9fl\xE9chir","r\xE9fl\xE9chis","denken","denk","nachdenken","suy ngh\u0129","c\xE2n nh\u1EAFc","d\xFC\u015F\xFCn","d\xFC\u015F\xFCnmek","pensare","pensa","riflettere","rifletti","\u0E04\u0E34\u0E14","\u0E1E\u0E34\u0E08\u0E32\u0E23\u0E13\u0E32","my\u015Bl","my\u015Ble\u0107","zastan\xF3w","nadenken","berpikir","pikir","pertimbangkan","\u0434\u0443\u043C\u0430\u0442\u0438","\u0440\u043E\u0437\u0434\u0443\u043C\u0443\u0432\u0430\u0442\u0438","\u03C3\u03BA\u03AD\u03C8\u03BF\u03C5","\u03C3\u03BA\u03AD\u03C6\u03C4\u03BF\u03BC\u03B1\u03B9","myslet","mysli","p\u0159em\xFD\u0161let","g\xE2nde\u0219te","g\xE2ndi","reflect\u0103","t\xE4nka","t\xE4nk","fundera","gondolkodj","gondolkodni","ajattele","ajatella","pohdi","t\xE6nk","t\xE6nke","overvej","tenk","tenke","gruble","\u05D7\u05E9\u05D5\u05D1","\u05DC\u05D7\u05E9\u05D5\u05D1","\u05DC\u05D4\u05E8\u05D4\u05E8"],Ys=Bs.map(e=>new RegExp(e,"i")),Ws=[...Gs,...Ys],Ks=/```[\s\S]*?```/g,Vs=/`[^`]+`/g;function qs(e){return e.replace(Ks,"").replace(Vs,"")}function wn(e){let t=qs(e);return Ws.some(n=>n.test(t))}function vn(e){return e.filter(t=>t.type==="text").map(t=>t.text||"").join("")}function rt(e){let t=e.indexOf("/");return t===-1?{prefix:"",base:e}:{prefix:e.slice(0,t+1),base:e.slice(t+1)}}function st(e){return e.replace(/\.(\d+)/g,"-$1")}var Pn={"claude-sonnet-4-5":"claude-sonnet-4-5-high","claude-opus-4-5":"claude-opus-4-5-high","claude-3-5-sonnet":"claude-3-5-sonnet-high","claude-3-opus":"claude-3-opus-high","gpt-4":"gpt-4-high","gpt-4-turbo":"gpt-4-turbo-high","gpt-4o":"gpt-4o-high","gpt-5":"gpt-5-high","gpt-5-mini":"gpt-5-mini-high","gemini-2-pro":"gemini-2-pro-high","gemini-3-pro":"gemini-3-pro-high","gemini-3-flash":"gemini-3-flash-high"},bn=new Set(Object.values(Pn)),Dn={anthropic:{thinking:{type:"enabled",budgetTokens:64e3},maxTokens:128e3},"amazon-bedrock":{reasoningConfig:{type:"enabled",budgetTokens:32e3},maxTokens:64e3},google:{providerOptions:{google:{thinkingConfig:{thinkingLevel:"HIGH"}}}},openai:{reasoning_effort:"high"}},Js={anthropic:["claude-sonnet-4","claude-opus-4","claude-3"],"amazon-bedrock":["claude","anthropic"],google:["gemini-2","gemini-3"],openai:["gpt-4","gpt-5","o1","o3"]};function Ln(e){let t=st(e),{prefix:n,base:o}=rt(t);if(bn.has(o)||o.endsWith("-high"))return null;let r=Pn[o];return r?n+r:null}function it(e){let t=st(e),{base:n}=rt(t);return bn.has(n)||n.endsWith("-high")}function zs(e,t){if(e==="github-copilot"){let n=t.toLowerCase();if(n.includes("claude"))return"anthropic";if(n.includes("gemini"))return"google";if(n.includes("gpt")||n.includes("o1")||n.includes("o3"))return"openai"}return e}function Xs(e){return e in Dn}function Mn(e,t){let n=st(t),{base:o}=rt(n);if(it(n))return null;let r=zs(e,t);if(!Xs(r))return null;let s=Dn[r],i=Js[r];if(!i)return null;let a=o.toLowerCase();return i.some(u=>a.includes(u.toLowerCase()))?s:null}var j=new Map;function Qs(e){j.delete(e)}function Un(){return{processChatParams:(e,t)=>{let n=vn(t.parts),o={requested:!1,modelSwitched:!1,thinkingConfigInjected:!1};if(!wn(n))return j.set(e,o),o;o.requested=!0;let r=t.message.model;if(!r||(o.providerId=r.providerId,o.modelId=r.modelId,it(r.modelId)))return j.set(e,o),o;let s=Ln(r.modelId),i=Mn(r.providerId,r.modelId);return s&&(t.message.model={providerId:r.providerId,modelId:s},o.modelSwitched=!0),i&&(Object.assign(t.message,i),o.thinkingConfigInjected=!0),j.set(e,o),o},onSessionDeleted:e=>{j.delete(e)},isRequested:e=>j.get(e)?.requested??!1,getState:e=>j.get(e),clear:Qs}}var h=require("fs"),q=require("path"),at=require("os");function ct(e){let t=e||process.cwd(),n=(0,q.join)(t,".olympus");return(0,q.join)(n,"ultrawork-state.json")}function ut(){return(0,q.join)((0,at.homedir)(),".claude","ultrawork-state.json")}function Zs(e){let t=e||process.cwd(),n=(0,q.join)(t,".olympus");(0,h.existsSync)(n)||(0,h.mkdirSync)(n,{recursive:!0})}function ei(){let e=(0,q.join)((0,at.homedir)(),".claude");(0,h.existsSync)(e)||(0,h.mkdirSync)(e,{recursive:!0})}function G(e){let t=ct(e);if((0,h.existsSync)(t))try{let o=(0,h.readFileSync)(t,"utf-8");return JSON.parse(o)}catch{}let n=ut();if((0,h.existsSync)(n))try{let o=(0,h.readFileSync)(n,"utf-8");return JSON.parse(o)}catch{return null}return null}function $n(e,t){try{Zs(t);let n=ct(t);(0,h.writeFileSync)(n,JSON.stringify(e,null,2)),ei();let o=ut();return(0,h.writeFileSync)(o,JSON.stringify(e,null,2)),!0}catch{return!1}}function jn(e,t,n){let o={active:!0,started_at:new Date().toISOString(),original_prompt:e,session_id:t,reinforcement_count:0,last_checked_at:new Date().toISOString()};return $n(o,n)}function Fn(e){let t=ct(e);if((0,h.existsSync)(t))try{(0,h.unlinkSync)(t)}catch{}let n=ut();if((0,h.existsSync)(n))try{return(0,h.unlinkSync)(n),!0}catch{return!1}return!0}function Hn(e){let t=G(e);return!t||!t.active?null:(t.reinforcement_count+=1,t.last_checked_at=new Date().toISOString(),$n(t,e)?t:null)}function Gn(e){return`<ultrawork-persistence>
24
24
 
25
25
  [ULTRAWORK MODE STILL ACTIVE - Reinforcement #${e.reinforcement_count+1}]
26
26
 
@@ -41,7 +41,7 @@ Original task: ${e.original_prompt}
41
41
 
42
42
  ---
43
43
 
44
- `}var Bn=require("os"),S=require("path");function L(){return process.platform==="win32"}function ti(){return(0,S.join)((0,Bn.homedir)(),".claude")}function y(){return(0,S.join)(ti(),"hooks")}var Yn=`<ultrawork-mode>
44
+ `}var Bn=require("os"),L=require("path");function z(){return process.platform==="win32"}function ti(){return(0,L.join)((0,Bn.homedir)(),".claude")}function J(){return(0,L.join)(ti(),"hooks")}var Yn=`<ultrawork-mode>
45
45
 
46
46
  **MANDATORY**: You MUST say "ULTRAWORK MODE ENABLED!" to the user as your first response when this mode activates. This is non-negotiable.
47
47
 
@@ -180,8 +180,8 @@ Incomplete tasks remain in your todo list. Continue working on the next pending
180
180
 
181
181
  - Proceed without asking for permission
182
182
  - Mark each task complete when finished
183
- - Do not stop until all tasks are done`;var vc={hooks:{UserPromptSubmit:[{hooks:[{type:"command",command:L()?'node "%USERPROFILE%\\.claude\\hooks\\keyword-detector.mjs"':'node "$HOME/.claude/hooks/keyword-detector.mjs"'}]}],SessionStart:[{hooks:[{type:"command",command:L()?'node "%USERPROFILE%\\.claude\\hooks\\session-start.mjs"':'node "$HOME/.claude/hooks/session-start.mjs"'}]}],Stop:[{hooks:[{type:"command",command:L()?'node "%USERPROFILE%\\.claude\\hooks\\persistent-mode.mjs"':'node "$HOME/.claude/hooks/persistent-mode.mjs"'}]}]}},Pc={hooks:{UserPromptSubmit:[{hooks:[{type:"command",command:L()?`node "${(0,S.join)(y(),"olympus-hooks.cjs")}" --event=UserPromptSubmit`:`node "${(0,S.join)(y(),"olympus-hooks.cjs")}" --event=UserPromptSubmit`}]}],SessionStart:[{hooks:[{type:"command",command:L()?`node "${(0,S.join)(y(),"olympus-hooks.cjs")}" --event=SessionStart`:`node "${(0,S.join)(y(),"olympus-hooks.cjs")}" --event=SessionStart`}]}],Stop:[{hooks:[{type:"command",command:L()?`node "${(0,S.join)(y(),"olympus-hooks.cjs")}" --event=Stop`:`node "${(0,S.join)(y(),"olympus-hooks.cjs")}" --event=Stop`}]}],PreToolUse:[{hooks:[{type:"command",command:L()?`node "${(0,S.join)(y(),"olympus-hooks.cjs")}" --event=PreToolUse`:`node "${(0,S.join)(y(),"olympus-hooks.cjs")}" --event=PreToolUse`}]}],PostToolUse:[{hooks:[{type:"command",command:L()?`node "${(0,S.join)(y(),"olympus-hooks.cjs")}" --event=PostToolUse`:`node "${(0,S.join)(y(),"olympus-hooks.cjs")}" --event=PostToolUse`}]}],Notification:[{hooks:[{type:"command",command:L()?`node "${(0,S.join)(y(),"olympus-hooks.cjs")}" --event=Notification`:`node "${(0,S.join)(y(),"olympus-hooks.cjs")}" --event=Notification`}]}],MessagesTransform:[{hooks:[{type:"command",command:L()?`node "${(0,S.join)(y(),"olympus-hooks.cjs")}" --event=MessagesTransform`:`node "${(0,S.join)(y(),"olympus-hooks.cjs")}" --event=MessagesTransform`}]}]}};var Zn=require("path");var Jn=require("os"),W=require("path"),k=require("fs");function K(){return(0,W.join)((0,Jn.homedir)(),".claude","olympus","learning")}function ce(e){return(0,W.join)(e,".olympus","learning")}function zn(e){let t=K();if((0,k.existsSync)(t)||(0,k.mkdirSync)(t,{recursive:!0}),e){let n=ce(e);(0,k.existsSync)(n)||(0,k.mkdirSync)(n,{recursive:!0})}}function X(e){zn();let t=(0,W.join)(K(),"feedback-log.jsonl");(0,k.appendFileSync)(t,JSON.stringify(e)+`
184
- `,"utf-8")}function Q(e,t){if(!(0,k.existsSync)(e))return t;try{return JSON.parse((0,k.readFileSync)(e,"utf-8"))}catch(n){return console.error(`[Olympus Learning] Failed to read ${e}:`,n),t}}function Xn(e,t){try{let n=(0,W.dirname)(e);n&&!(0,k.existsSync)(n)&&(0,k.mkdirSync)(n,{recursive:!0}),(0,k.writeFileSync)(e,JSON.stringify(t,null,2),"utf-8")}catch(n){console.error(`[Olympus Learning] Failed to write ${e}:`,n)}}var eo=require("crypto"),ni=10,oi=1800*1e3;function to(e){return(0,Zn.join)(e,".olympus","session-state.json")}function Qn(e){return{session_id:e||(0,eo.randomUUID)(),started_at:new Date().toISOString(),last_updated:new Date().toISOString(),recent_prompts:[],pending_completion:null,todo_snapshot:null}}function Z(e,t){let n=to(e),o=Q(n,null);if(!o)return Qn(t);let r=new Date(o.last_updated).getTime();return Date.now()-r>oi?Qn(t):o}function ee(e,t){let n=to(e);t.last_updated=new Date().toISOString(),Xn(n,t)}function no(e,t,n){let o={prompt:t,timestamp:new Date().toISOString(),detected_feedback:n};return e.recent_prompts=[o,...e.recent_prompts].slice(0,ni),e.last_updated=new Date().toISOString(),e}function oo(e){return e.pending_completion=null,e.last_updated=new Date().toISOString(),e}function Ie(e){if(!e.pending_completion?.claimed_at)return!1;let t=new Date(e.pending_completion.claimed_at).getTime();return Date.now()-t<300*1e3}var ro=require("crypto"),ri={correction:[{regex:/no[,.]?\s*(that's|thats)?\s*(not|wrong)/i,confidence:.9},{regex:/that's\s*(incorrect|not right|not what)/i,confidence:.9},{regex:/you\s*(misunderstood|got it wrong)/i,confidence:.85},{regex:/actually,?\s*(I|it|the)/i,confidence:.6}],rejection:[{regex:/\b(stop|cancel|abort|halt)\b/i,confidence:.95},{regex:/don't\s*(do|want|need)\s*(that|this)/i,confidence:.85},{regex:/never\s*mind/i,confidence:.9},{regex:/forget\s*(it|that|about)/i,confidence:.8}],clarification:[{regex:/I\s*(meant|wanted|asked for)/i,confidence:.85},{regex:/what I\s*(mean|want|need)/i,confidence:.8},{regex:/to clarify/i,confidence:.9},{regex:/let me\s*(rephrase|explain|be clearer)/i,confidence:.85}],explicit_preference:[{regex:/always\s+(use|do|include|add|prefer)/i,confidence:.95},{regex:/never\s+(use|do|include|add)/i,confidence:.95},{regex:/I\s*(prefer|like|want)\s*(you to)?/i,confidence:.7},{regex:/from now on/i,confidence:.9},{regex:/in the future,?\s*(please|always)/i,confidence:.85}],praise:[{regex:/\bperfect\b/i,confidence:.9},{regex:/exactly(\s+what I (wanted|needed))?/i,confidence:.85},{regex:/great(\s+job)?/i,confidence:.7},{regex:/\bthanks?\b/i,confidence:.5},{regex:/looks?\s+good/i,confidence:.75}],enhancement:[{regex:/also\s+(add|include|do)/i,confidence:.7},{regex:/can you (also|additionally)/i,confidence:.7},{regex:/one more thing/i,confidence:.75}]};function lt(e){let t=e.replace(/```[\s\S]*?```/g,"").replace(/`[^`]+`/g,""),n=null;for(let[o,r]of Object.entries(ri))for(let{regex:s,confidence:i}of r)s.test(t)&&(!n||i>n.confidence)&&(n={category:o,confidence:i});return n}async function so(e){let{prompt:t,directory:n,sessionId:o}=e;if(!t||!n)return;let r=Z(n,o),s=lt(t),i=no(r,t,s?.category);if(s&&Ie(r)){let a={id:(0,ro.randomUUID)(),timestamp:new Date().toISOString(),session_id:r.session_id,project_path:n,event_type:s.category==="explicit_preference"?"explicit_preference":"revision",original_task:r.pending_completion?.task_description,agent_used:r.pending_completion?.agent_used,user_message:t,feedback_category:s.category,confidence:s.confidence};X(a)}ee(n,i)}var io=require("crypto");async function ao(e){let{prompt:t,directory:n,sessionId:o}=e;if(!t||!n)return;let r=Z(n,o);if(!Ie(r))return;let s=lt(t),i=s?.category==="praise"&&s.confidence>.7,a=si(t,r.pending_completion?.task_description||"");if(i||a){let c={id:(0,io.randomUUID)(),timestamp:new Date().toISOString(),session_id:r.session_id,project_path:n,event_type:"success",original_task:r.pending_completion?.task_description,agent_used:r.pending_completion?.agent_used,user_message:t,feedback_category:i?"praise":"enhancement",confidence:i?s.confidence:.6};X(c);let u=oo(r);ee(n,u)}}function si(e,t){let n=c=>new Set(c.toLowerCase().replace(/[^\w\s]/g,"").split(/\s+/).filter(u=>u.length>3)),o=n(e),r=n(t),s=new Set([...o].filter(c=>r.has(c))),i=new Set([...o,...r]);return(i.size>0?s.size/i.size:0)<.2}function co(e){return e.prompt?e.prompt:e.message?.content?e.message.content:e.parts?e.parts.filter(t=>t.type==="text"&&t.text).map(t=>t.text).join(" "):""}function uo(){m({name:"keywordDetector",event:"UserPromptSubmit",priority:10,handler:e=>{let t=co(e);if(!t)return{continue:!0};let n=Tn(t),o=En(n);if(o.length===0)return{continue:!0};let r=o.some(c=>c.type==="ultrawork"),s=o.some(c=>c.type==="ultrathink"),i=o.some(c=>c.type==="search"),a=o.some(c=>c.type==="analyze");return r?(jn(t,e.sessionId,e.directory||process.cwd()),{continue:!0,message:Yn}):s?{continue:!0,message:Wn}:i?{continue:!0,message:Kn}:a?{continue:!0,message:Vn}:{continue:!0}}}),m({name:"autoSlashCommand",event:"UserPromptSubmit",priority:20,handler:e=>{if(!e.parts)return{continue:!0};let n=xn().processMessage({sessionId:e.sessionId||""},e.parts);return n.detected&&n.injectedMessage?{continue:!0,message:n.injectedMessage}:{continue:!0}}}),m({name:"thinkMode",event:"UserPromptSubmit",priority:30,handler:e=>{if(!e.message||!e.parts)return{continue:!0};let t=Un(),n=e.sessionId||"default",o={parts:e.parts,message:{model:e.message.model&&e.message.model.providerId&&e.message.model.modelId?{providerId:e.message.model.providerId,modelId:e.message.model.modelId}:void 0}},r=t.processChatParams(n,o);return r.requested&&r.modelSwitched?{continue:!0,message:"[Think Mode Activated] Switched to high-reasoning model variant."}:{continue:!0}}}),m({name:"learningFeedbackCapture",event:"UserPromptSubmit",priority:100,handler:async e=>{let t=co(e);return!t||!e.directory?{continue:!0}:(Promise.resolve().then(async()=>{try{await so({prompt:t,directory:e.directory,sessionId:e.sessionId}),await ao({prompt:t,directory:e.directory,sessionId:e.sessionId})}catch(n){console.error("[Olympus Learning]",n)}}),{continue:!0})}})}var V=require("fs"),G=require("path"),lo=require("os");function ii(e,t){let n=(0,G.join)((0,lo.homedir)(),".claude"),o=[];e&&(o.push((0,G.join)(n,"sessions",e,"todos.json")),o.push((0,G.join)(n,"todos",`${e}.json`))),t&&(o.push((0,G.join)(t,".olympus","todos.json")),o.push((0,G.join)(t,".claude","todos.json")));let r=(0,G.join)(n,"todos");if((0,V.existsSync)(r))try{let s=(0,V.readdirSync)(r);for(let i of s)i.endsWith(".json")&&o.push((0,G.join)(r,i))}catch{}return o}function ai(e){try{let t=(0,V.readFileSync)(e,"utf-8"),n=JSON.parse(t);return Array.isArray(n)?n.filter(o=>o&&typeof o.content=="string"&&typeof o.status=="string"):n.todos&&Array.isArray(n.todos)?n.todos.filter(o=>{let r=o;return r&&typeof r.content=="string"&&typeof r.status=="string"}):[]}catch{return[]}}function ci(e){return e.status!=="completed"&&e.status!=="cancelled"}async function ue(e,t){let n=ii(e,t),o=new Set,r=[],s=[];for(let i of n){if(!(0,V.existsSync)(i))continue;let a=ai(i);for(let c of a){let u=`${c.content}:${c.status}`;o.has(u)||(o.add(u),r.push(c),ci(c)&&s.push(c))}}return{count:s.length,todos:s,total:r.length}}function po(e){let t=e.todos.find(n=>n.status==="in_progress");return t||(e.todos.find(n=>n.status==="pending")??null)}var Ce=require("path");var mo=500;function fo(e){let t=Q((0,Ce.join)(K(),"user-preferences.json"),null),n=Q((0,Ce.join)(ce(e),"patterns.json"),null),o=Q((0,Ce.join)(K(),"agent-performance.json"),{}),r=[];t&&ui(t)&&r.push(li(t)),n&&n.conventions.length>0&&r.push(di(n)),t?.recurring_corrections&&t.recurring_corrections.length>0&&r.push(pi(t.recurring_corrections.slice(0,5)));let s=Object.values(o).filter(a=>a.weak_areas.length>0);if(s.length>0&&r.push(mi(s)),r.length===0)return"";let i=`<learned-context>
183
+ - Do not stop until all tasks are done`;var vc={hooks:{UserPromptSubmit:[{hooks:[{type:"command",command:z()?'node "%USERPROFILE%\\.claude\\hooks\\keyword-detector.mjs"':'node "$HOME/.claude/hooks/keyword-detector.mjs"'}]}],SessionStart:[{hooks:[{type:"command",command:z()?'node "%USERPROFILE%\\.claude\\hooks\\session-start.mjs"':'node "$HOME/.claude/hooks/session-start.mjs"'}]}],Stop:[{hooks:[{type:"command",command:z()?'node "%USERPROFILE%\\.claude\\hooks\\persistent-mode.mjs"':'node "$HOME/.claude/hooks/persistent-mode.mjs"'}]}]}},Pc={hooks:{UserPromptSubmit:[{hooks:[{type:"command",command:z()?`node "${(0,L.join)(J(),"olympus-hooks.cjs")}" --event=UserPromptSubmit`:`node "${(0,L.join)(J(),"olympus-hooks.cjs")}" --event=UserPromptSubmit`}]}],SessionStart:[{hooks:[{type:"command",command:z()?`node "${(0,L.join)(J(),"olympus-hooks.cjs")}" --event=SessionStart`:`node "${(0,L.join)(J(),"olympus-hooks.cjs")}" --event=SessionStart`}]}],Stop:[{hooks:[{type:"command",command:z()?`node "${(0,L.join)(J(),"olympus-hooks.cjs")}" --event=Stop`:`node "${(0,L.join)(J(),"olympus-hooks.cjs")}" --event=Stop`}]}]}};var Zn=require("path");var Jn=require("os"),B=require("path"),S=require("fs");function Y(){return(0,B.join)((0,Jn.homedir)(),".claude","olympus","learning")}function ce(e){return(0,B.join)(e,".olympus","learning")}function zn(e){let t=Y();if((0,S.existsSync)(t)||(0,S.mkdirSync)(t,{recursive:!0}),e){let n=ce(e);(0,S.existsSync)(n)||(0,S.mkdirSync)(n,{recursive:!0})}}function X(e){zn();let t=(0,B.join)(Y(),"feedback-log.jsonl");(0,S.appendFileSync)(t,JSON.stringify(e)+`
184
+ `,"utf-8")}function Q(e,t){if(!(0,S.existsSync)(e))return t;try{return JSON.parse((0,S.readFileSync)(e,"utf-8"))}catch(n){return console.error(`[Olympus Learning] Failed to read ${e}:`,n),t}}function Xn(e,t){try{let n=(0,B.dirname)(e);n&&!(0,S.existsSync)(n)&&(0,S.mkdirSync)(n,{recursive:!0}),(0,S.writeFileSync)(e,JSON.stringify(t,null,2),"utf-8")}catch(n){console.error(`[Olympus Learning] Failed to write ${e}:`,n)}}var eo=require("crypto"),ni=10,oi=1800*1e3;function to(e){return(0,Zn.join)(e,".olympus","session-state.json")}function Qn(e){return{session_id:e||(0,eo.randomUUID)(),started_at:new Date().toISOString(),last_updated:new Date().toISOString(),recent_prompts:[],pending_completion:null,todo_snapshot:null}}function Z(e,t){let n=to(e),o=Q(n,null);if(!o)return Qn(t);let r=new Date(o.last_updated).getTime();return Date.now()-r>oi?Qn(t):o}function ee(e,t){let n=to(e);t.last_updated=new Date().toISOString(),Xn(n,t)}function no(e,t,n){let o={prompt:t,timestamp:new Date().toISOString(),detected_feedback:n};return e.recent_prompts=[o,...e.recent_prompts].slice(0,ni),e.last_updated=new Date().toISOString(),e}function oo(e){return e.pending_completion=null,e.last_updated=new Date().toISOString(),e}function Ie(e){if(!e.pending_completion?.claimed_at)return!1;let t=new Date(e.pending_completion.claimed_at).getTime();return Date.now()-t<300*1e3}var ro=require("crypto"),ri={correction:[{regex:/no[,.]?\s*(that's|thats)?\s*(not|wrong)/i,confidence:.9},{regex:/that's\s*(incorrect|not right|not what)/i,confidence:.9},{regex:/you\s*(misunderstood|got it wrong)/i,confidence:.85},{regex:/actually,?\s*(I|it|the)/i,confidence:.6}],rejection:[{regex:/\b(stop|cancel|abort|halt)\b/i,confidence:.95},{regex:/don't\s*(do|want|need)\s*(that|this)/i,confidence:.85},{regex:/never\s*mind/i,confidence:.9},{regex:/forget\s*(it|that|about)/i,confidence:.8}],clarification:[{regex:/I\s*(meant|wanted|asked for)/i,confidence:.85},{regex:/what I\s*(mean|want|need)/i,confidence:.8},{regex:/to clarify/i,confidence:.9},{regex:/let me\s*(rephrase|explain|be clearer)/i,confidence:.85}],explicit_preference:[{regex:/always\s+(use|do|include|add|prefer)/i,confidence:.95},{regex:/never\s+(use|do|include|add)/i,confidence:.95},{regex:/I\s*(prefer|like|want)\s*(you to)?/i,confidence:.7},{regex:/from now on/i,confidence:.9},{regex:/in the future,?\s*(please|always)/i,confidence:.85}],praise:[{regex:/\bperfect\b/i,confidence:.9},{regex:/exactly(\s+what I (wanted|needed))?/i,confidence:.85},{regex:/great(\s+job)?/i,confidence:.7},{regex:/\bthanks?\b/i,confidence:.5},{regex:/looks?\s+good/i,confidence:.75}],enhancement:[{regex:/also\s+(add|include|do)/i,confidence:.7},{regex:/can you (also|additionally)/i,confidence:.7},{regex:/one more thing/i,confidence:.75}]};function lt(e){let t=e.replace(/```[\s\S]*?```/g,"").replace(/`[^`]+`/g,""),n=null;for(let[o,r]of Object.entries(ri))for(let{regex:s,confidence:i}of r)s.test(t)&&(!n||i>n.confidence)&&(n={category:o,confidence:i});return n}async function so(e){let{prompt:t,directory:n,sessionId:o}=e;if(!t||!n)return;let r=Z(n,o),s=lt(t),i=no(r,t,s?.category);if(s&&Ie(r)){let a={id:(0,ro.randomUUID)(),timestamp:new Date().toISOString(),session_id:r.session_id,project_path:n,event_type:s.category==="explicit_preference"?"explicit_preference":"revision",original_task:r.pending_completion?.task_description,agent_used:r.pending_completion?.agent_used,user_message:t,feedback_category:s.category,confidence:s.confidence};X(a)}ee(n,i)}var io=require("crypto");async function ao(e){let{prompt:t,directory:n,sessionId:o}=e;if(!t||!n)return;let r=Z(n,o);if(!Ie(r))return;let s=lt(t),i=s?.category==="praise"&&s.confidence>.7,a=si(t,r.pending_completion?.task_description||"");if(i||a){let c={id:(0,io.randomUUID)(),timestamp:new Date().toISOString(),session_id:r.session_id,project_path:n,event_type:"success",original_task:r.pending_completion?.task_description,agent_used:r.pending_completion?.agent_used,user_message:t,feedback_category:i?"praise":"enhancement",confidence:i?s.confidence:.6};X(c);let u=oo(r);ee(n,u)}}function si(e,t){let n=c=>new Set(c.toLowerCase().replace(/[^\w\s]/g,"").split(/\s+/).filter(u=>u.length>3)),o=n(e),r=n(t),s=new Set([...o].filter(c=>r.has(c))),i=new Set([...o,...r]);return(i.size>0?s.size/i.size:0)<.2}function co(e){return e.prompt?e.prompt:e.message?.content?e.message.content:e.parts?e.parts.filter(t=>t.type==="text"&&t.text).map(t=>t.text).join(" "):""}function uo(){m({name:"keywordDetector",event:"UserPromptSubmit",priority:10,handler:e=>{let t=co(e);if(!t)return{continue:!0};let n=Tn(t),o=En(n);if(o.length===0)return{continue:!0};let r=o.some(c=>c.type==="ultrawork"),s=o.some(c=>c.type==="ultrathink"),i=o.some(c=>c.type==="search"),a=o.some(c=>c.type==="analyze");return r?(jn(t,e.sessionId,e.directory||process.cwd()),{continue:!0,message:Yn}):s?{continue:!0,message:Wn}:i?{continue:!0,message:Kn}:a?{continue:!0,message:Vn}:{continue:!0}}}),m({name:"autoSlashCommand",event:"UserPromptSubmit",priority:20,handler:e=>{if(!e.parts)return{continue:!0};let n=xn().processMessage({sessionId:e.sessionId||""},e.parts);return n.detected&&n.injectedMessage?{continue:!0,message:n.injectedMessage}:{continue:!0}}}),m({name:"thinkMode",event:"UserPromptSubmit",priority:30,handler:e=>{if(!e.message||!e.parts)return{continue:!0};let t=Un(),n=e.sessionId||"default",o={parts:e.parts,message:{model:e.message.model&&e.message.model.providerId&&e.message.model.modelId?{providerId:e.message.model.providerId,modelId:e.message.model.modelId}:void 0}},r=t.processChatParams(n,o);return r.requested&&r.modelSwitched?{continue:!0,message:"[Think Mode Activated] Switched to high-reasoning model variant."}:{continue:!0}}}),m({name:"learningFeedbackCapture",event:"UserPromptSubmit",priority:100,handler:async e=>{let t=co(e);return!t||!e.directory?{continue:!0}:(Promise.resolve().then(async()=>{try{await so({prompt:t,directory:e.directory,sessionId:e.sessionId}),await ao({prompt:t,directory:e.directory,sessionId:e.sessionId})}catch(n){console.error("[Olympus Learning]",n)}}),{continue:!0})}})}var W=require("fs"),F=require("path"),lo=require("os");function ii(e,t){let n=(0,F.join)((0,lo.homedir)(),".claude"),o=[];e&&(o.push((0,F.join)(n,"sessions",e,"todos.json")),o.push((0,F.join)(n,"todos",`${e}.json`))),t&&(o.push((0,F.join)(t,".olympus","todos.json")),o.push((0,F.join)(t,".claude","todos.json")));let r=(0,F.join)(n,"todos");if((0,W.existsSync)(r))try{let s=(0,W.readdirSync)(r);for(let i of s)i.endsWith(".json")&&o.push((0,F.join)(r,i))}catch{}return o}function ai(e){try{let t=(0,W.readFileSync)(e,"utf-8"),n=JSON.parse(t);return Array.isArray(n)?n.filter(o=>o&&typeof o.content=="string"&&typeof o.status=="string"):n.todos&&Array.isArray(n.todos)?n.todos.filter(o=>{let r=o;return r&&typeof r.content=="string"&&typeof r.status=="string"}):[]}catch{return[]}}function ci(e){return e.status!=="completed"&&e.status!=="cancelled"}async function ue(e,t){let n=ii(e,t),o=new Set,r=[],s=[];for(let i of n){if(!(0,W.existsSync)(i))continue;let a=ai(i);for(let c of a){let u=`${c.content}:${c.status}`;o.has(u)||(o.add(u),r.push(c),ci(c)&&s.push(c))}}return{count:s.length,todos:s,total:r.length}}function po(e){let t=e.todos.find(n=>n.status==="in_progress");return t||(e.todos.find(n=>n.status==="pending")??null)}var Ce=require("path");var mo=500;function fo(e){let t=Q((0,Ce.join)(Y(),"user-preferences.json"),null),n=Q((0,Ce.join)(ce(e),"patterns.json"),null),o=Q((0,Ce.join)(Y(),"agent-performance.json"),{}),r=[];t&&ui(t)&&r.push(li(t)),n&&n.conventions.length>0&&r.push(di(n)),t?.recurring_corrections&&t.recurring_corrections.length>0&&r.push(pi(t.recurring_corrections.slice(0,5)));let s=Object.values(o).filter(a=>a.weak_areas.length>0);if(s.length>0&&r.push(mi(s)),r.length===0)return"";let i=`<learned-context>
185
185
 
186
186
  ${r.join(`
187
187
 
@@ -201,10 +201,10 @@ ${r.join(`
201
201
  `)}function pi(e){let t=["## Avoid These Mistakes"];for(let n of e)t.push(`- ${n.pattern} (${n.count}x)`);return t.join(`
202
202
  `)}function mi(e){let t=["## Agent Notes"];for(let n of e.slice(0,3))t.push(`- ${n.agent_name}: struggles with ${n.weak_areas.join(", ")}`);return t.join(`
203
203
  `)}function go(e){if(e.length===0)return"";let t=["## Agent Discoveries"];t.push(""),t.push("These insights were discovered during previous work:"),t.push("");for(let n of e.slice(0,5))t.push(`- **${n.category}**: ${n.summary}`),t.push(` ${n.details.substring(0,200)}`);return t.join(`
204
- `)}var _e=require("path"),q=require("fs");function fi(e){let t=(0,_e.join)(K(),"discoveries.jsonl"),n=ce(e),o=(0,_e.join)(n,"discoveries.jsonl"),r=ho(t),s=ho(o),i=[...r,...s],a={technical_insight:0,workaround:0,pattern:0,gotcha:0,performance:0,dependency:0,configuration:0};for(let u of i)a[u.category]++;let c=[...i].sort((u,l)=>l.verification_count-u.verification_count);return{project_discoveries:s,global_discoveries:r,total_discoveries:i.length,categories:a,most_useful:c.slice(0,5)}}function To(e,t=10){let n=fi(e),o=[...n.project_discoveries,...n.global_discoveries],r=new Date,i=o.filter(a=>a.expires_at?new Date(a.expires_at)>r:!0).map(a=>{let c=(r.getTime()-new Date(a.timestamp).getTime())/864e5,u=Math.max(.1,1-c/90),l=(a.verification_count+1)*u*a.confidence;return{discovery:a,score:l}});return i.sort((a,c)=>c.score-a.score),i.slice(0,t).map(a=>a.discovery)}function ho(e){if(!(0,q.existsSync)(e))return[];try{return(0,q.readFileSync)(e,"utf-8").split(`
204
+ `)}var _e=require("path"),K=require("fs");function fi(e){let t=(0,_e.join)(Y(),"discoveries.jsonl"),n=ce(e),o=(0,_e.join)(n,"discoveries.jsonl"),r=ho(t),s=ho(o),i=[...r,...s],a={technical_insight:0,workaround:0,pattern:0,gotcha:0,performance:0,dependency:0,configuration:0};for(let u of i)a[u.category]++;let c=[...i].sort((u,l)=>l.verification_count-u.verification_count);return{project_discoveries:s,global_discoveries:r,total_discoveries:i.length,categories:a,most_useful:c.slice(0,5)}}function To(e,t=10){let n=fi(e),o=[...n.project_discoveries,...n.global_discoveries],r=new Date,i=o.filter(a=>a.expires_at?new Date(a.expires_at)>r:!0).map(a=>{let c=(r.getTime()-new Date(a.timestamp).getTime())/864e5,u=Math.max(.1,1-c/90),l=(a.verification_count+1)*u*a.confidence;return{discovery:a,score:l}});return i.sort((a,c)=>c.score-a.score),i.slice(0,t).map(a=>a.discovery)}function ho(e){if(!(0,K.existsSync)(e))return[];try{return(0,K.readFileSync)(e,"utf-8").split(`
205
205
  `).filter(n=>n.trim()).map(n=>JSON.parse(n))}catch(t){return console.error(`[Olympus Learning] Failed to read discoveries: ${t}`),[]}}function Eo(){m({name:"learnedContextInjection",event:"SessionStart",priority:5,handler:e=>{if(!e.directory)return{continue:!0};try{let t=fo(e.directory),n=To(e.directory,5),o=go(n),r=t+(o?`
206
206
 
207
- `+o:"");if(r.trim())return{continue:!0,message:r}}catch(t){console.error("[Olympus Learning]",t)}return{continue:!0}}}),m({name:"sessionStart",event:"SessionStart",priority:10,handler:async e=>{let t=e.sessionId,n=e.directory||process.cwd(),o=[],r=Y(n);r?.active&&o.push(`<session-restore>
207
+ `+o:"");if(r.trim())return{continue:!0,message:r}}catch(t){console.error("[Olympus Learning]",t)}return{continue:!0}}}),m({name:"sessionStart",event:"SessionStart",priority:10,handler:async e=>{let t=e.sessionId,n=e.directory||process.cwd(),o=[],r=G(n);r?.active&&o.push(`<session-restore>
208
208
 
209
209
  [ULTRAWORK MODE RESTORED]
210
210
 
@@ -229,7 +229,7 @@ Please continue working on these tasks.
229
229
  ---
230
230
 
231
231
  `),o.length>0?{continue:!0,message:o.join(`
232
- `)}:{continue:!0}}})}var oe=require("fs"),$=require("path"),St=require("os");var O=require("fs"),B=require("path"),So=require("os");function dt(e){let t=(0,B.join)(e,".olympus");return(0,B.join)(t,"ascent-state.json")}function gi(e){let t=(0,B.join)(e,".olympus");(0,O.existsSync)(t)||(0,O.mkdirSync)(t,{recursive:!0})}function le(e){let t=dt(e);if(!(0,O.existsSync)(t))return null;try{let n=(0,O.readFileSync)(t,"utf-8");return JSON.parse(n)}catch{return null}}function hi(e,t){try{gi(e);let n=dt(e);return(0,O.writeFileSync)(n,JSON.stringify(t,null,2)),!0}catch{return!1}}function Ae(e){let t=dt(e);if(!(0,O.existsSync)(t))return!0;try{return(0,O.unlinkSync)(t),!0}catch{return!1}}function ko(e){let t=le(e);return!t||!t.active?null:(t.iteration+=1,hi(e,t)?t:null)}function yo(e,t){let n=(0,B.join)((0,So.homedir)(),".claude"),o=[(0,B.join)(n,"sessions",e,"transcript.md"),(0,B.join)(n,"sessions",e,"messages.json"),(0,B.join)(n,"transcripts",`${e}.md`)];for(let r of o)if((0,O.existsSync)(r))try{let s=(0,O.readFileSync)(r,"utf-8");if(new RegExp(`<promise>\\s*${Ti(t)}\\s*</promise>`,"is").test(s))return!0}catch{continue}return!1}function Ti(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var I=require("fs"),pt=require("path"),Ei=3;function mt(e){return(0,pt.join)(e,".olympus","ascent-verification.json")}function pe(e){let t=mt(e);if(!(0,I.existsSync)(t))return null;try{return JSON.parse((0,I.readFileSync)(t,"utf-8"))}catch{return null}}function Oo(e,t){let n=mt(e),o=(0,pt.join)(e,".olympus");if(!(0,I.existsSync)(o))try{(0,I.mkdirSync)(o,{recursive:!0})}catch{return!1}try{return(0,I.writeFileSync)(n,JSON.stringify(t,null,2)),!0}catch{return!1}}function de(e){let t=mt(e);if((0,I.existsSync)(t))try{return(0,I.unlinkSync)(t),!0}catch{return!1}return!0}function Ro(e,t,n){let o={pending:!0,completion_claim:t,verification_attempts:0,max_verification_attempts:Ei,requested_at:new Date().toISOString(),original_task:n};return Oo(e,o),o}function Io(e,t,n){let o=pe(e);return o?(o.verification_attempts+=1,o.oracle_approved=t,o.oracle_feedback=n,t?(de(e),{...o,pending:!1}):o.verification_attempts>=o.max_verification_attempts?(de(e),{...o,pending:!1}):(Oo(e,o),o)):null}function ft(e){return`<ascent-verification>
232
+ `)}:{continue:!0}}})}var oe=require("fs"),M=require("path"),St=require("os");var k=require("fs"),H=require("path"),So=require("os");function dt(e){let t=(0,H.join)(e,".olympus");return(0,H.join)(t,"ascent-state.json")}function gi(e){let t=(0,H.join)(e,".olympus");(0,k.existsSync)(t)||(0,k.mkdirSync)(t,{recursive:!0})}function le(e){let t=dt(e);if(!(0,k.existsSync)(t))return null;try{let n=(0,k.readFileSync)(t,"utf-8");return JSON.parse(n)}catch{return null}}function hi(e,t){try{gi(e);let n=dt(e);return(0,k.writeFileSync)(n,JSON.stringify(t,null,2)),!0}catch{return!1}}function Ae(e){let t=dt(e);if(!(0,k.existsSync)(t))return!0;try{return(0,k.unlinkSync)(t),!0}catch{return!1}}function ko(e){let t=le(e);return!t||!t.active?null:(t.iteration+=1,hi(e,t)?t:null)}function yo(e,t){let n=(0,H.join)((0,So.homedir)(),".claude"),o=[(0,H.join)(n,"sessions",e,"transcript.md"),(0,H.join)(n,"sessions",e,"messages.json"),(0,H.join)(n,"transcripts",`${e}.md`)];for(let r of o)if((0,k.existsSync)(r))try{let s=(0,k.readFileSync)(r,"utf-8");if(new RegExp(`<promise>\\s*${Ti(t)}\\s*</promise>`,"is").test(s))return!0}catch{continue}return!1}function Ti(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var O=require("fs"),pt=require("path"),Ei=3;function mt(e){return(0,pt.join)(e,".olympus","ascent-verification.json")}function pe(e){let t=mt(e);if(!(0,O.existsSync)(t))return null;try{return JSON.parse((0,O.readFileSync)(t,"utf-8"))}catch{return null}}function Oo(e,t){let n=mt(e),o=(0,pt.join)(e,".olympus");if(!(0,O.existsSync)(o))try{(0,O.mkdirSync)(o,{recursive:!0})}catch{return!1}try{return(0,O.writeFileSync)(n,JSON.stringify(t,null,2)),!0}catch{return!1}}function de(e){let t=mt(e);if((0,O.existsSync)(t))try{return(0,O.unlinkSync)(t),!0}catch{return!1}return!0}function Ro(e,t,n){let o={pending:!0,completion_claim:t,verification_attempts:0,max_verification_attempts:Ei,requested_at:new Date().toISOString(),original_task:n};return Oo(e,o),o}function Io(e,t,n){let o=pe(e);return o?(o.verification_attempts+=1,o.oracle_approved=t,o.oracle_feedback=n,t?(de(e),{...o,pending:!1}):o.verification_attempts>=o.max_verification_attempts?(de(e),{...o,pending:!1}):(Oo(e,o),o)):null}function ft(e){return`<ascent-verification>
233
233
 
234
234
  [ORACLE VERIFICATION REQUIRED - Attempt ${e.verification_attempts+1}/${e.max_verification_attempts}]
235
235
 
@@ -316,7 +316,7 @@ Original task: ${e.original_prompt}
316
316
 
317
317
  ---
318
318
 
319
- `}function Po(e){let t=(0,$.join)((0,St.homedir)(),".claude"),n=[(0,$.join)(t,"sessions",e,"transcript.md"),(0,$.join)(t,"sessions",e,"messages.json"),(0,$.join)(t,"transcripts",`${e}.md`)];for(let o of n)if((0,oe.existsSync)(o))try{let r=(0,oe.readFileSync)(o,"utf-8");if(_o(r))return!0}catch{continue}return!1}function yi(e){let t=(0,$.join)((0,St.homedir)(),".claude"),n=[(0,$.join)(t,"sessions",e,"transcript.md"),(0,$.join)(t,"sessions",e,"messages.json"),(0,$.join)(t,"transcripts",`${e}.md`)];for(let o of n)if((0,oe.existsSync)(o))try{let r=(0,oe.readFileSync)(o,"utf-8"),s=Ao(r);if(s.rejected)return s}catch{continue}return{rejected:!1,feedback:""}}async function Oi(e,t){let n=t||process.cwd(),o=le(n);if(!o||!o.active||o.session_id&&e&&o.session_id!==e)return null;let r=pe(n);if(r?.pending){if(e){if(Po(e))return de(n),Ae(n),{shouldBlock:!1,message:`[ASCENT LOOP VERIFIED COMPLETE] Oracle verified task completion after ${o.iteration} iteration(s). Excellent work!`,mode:"none"};let u=yi(e);if(u.rejected){Io(n,!1,u.feedback);let l=pe(n);if(l)return{shouldBlock:!0,message:Co(l),mode:"ascent",metadata:{iteration:o.iteration,maxIterations:o.max_iterations}}}}return{shouldBlock:!0,message:ft(r),mode:"ascent",metadata:{iteration:o.iteration,maxIterations:o.max_iterations}}}if(yo(e||"",o.completion_promise)){Ro(n,o.completion_promise,o.prompt);let c=pe(n);return c?{shouldBlock:!0,message:ft(c),mode:"ascent",metadata:{iteration:o.iteration,maxIterations:o.max_iterations}}:(Ae(n),{shouldBlock:!1,message:`[ASCENT LOOP COMPLETE] Task completed after ${o.iteration} iteration(s). Great work!`,mode:"none"})}if(o.iteration>=o.max_iterations)return Ae(n),de(n),{shouldBlock:!1,message:`[ASCENT LOOP STOPPED] Max iterations (${o.max_iterations}) reached without completion promise. Consider reviewing the task requirements.`,mode:"none"};let i=ko(n);return i?{shouldBlock:!0,message:`<ascent-continuation>
319
+ `}function Po(e){let t=(0,M.join)((0,St.homedir)(),".claude"),n=[(0,M.join)(t,"sessions",e,"transcript.md"),(0,M.join)(t,"sessions",e,"messages.json"),(0,M.join)(t,"transcripts",`${e}.md`)];for(let o of n)if((0,oe.existsSync)(o))try{let r=(0,oe.readFileSync)(o,"utf-8");if(_o(r))return!0}catch{continue}return!1}function yi(e){let t=(0,M.join)((0,St.homedir)(),".claude"),n=[(0,M.join)(t,"sessions",e,"transcript.md"),(0,M.join)(t,"sessions",e,"messages.json"),(0,M.join)(t,"transcripts",`${e}.md`)];for(let o of n)if((0,oe.existsSync)(o))try{let r=(0,oe.readFileSync)(o,"utf-8"),s=Ao(r);if(s.rejected)return s}catch{continue}return{rejected:!1,feedback:""}}async function Oi(e,t){let n=t||process.cwd(),o=le(n);if(!o||!o.active||o.session_id&&e&&o.session_id!==e)return null;let r=pe(n);if(r?.pending){if(e){if(Po(e))return de(n),Ae(n),{shouldBlock:!1,message:`[ASCENT LOOP VERIFIED COMPLETE] Oracle verified task completion after ${o.iteration} iteration(s). Excellent work!`,mode:"none"};let u=yi(e);if(u.rejected){Io(n,!1,u.feedback);let l=pe(n);if(l)return{shouldBlock:!0,message:Co(l),mode:"ascent",metadata:{iteration:o.iteration,maxIterations:o.max_iterations}}}}return{shouldBlock:!0,message:ft(r),mode:"ascent",metadata:{iteration:o.iteration,maxIterations:o.max_iterations}}}if(yo(e||"",o.completion_promise)){Ro(n,o.completion_promise,o.prompt);let c=pe(n);return c?{shouldBlock:!0,message:ft(c),mode:"ascent",metadata:{iteration:o.iteration,maxIterations:o.max_iterations}}:(Ae(n),{shouldBlock:!1,message:`[ASCENT LOOP COMPLETE] Task completed after ${o.iteration} iteration(s). Great work!`,mode:"none"})}if(o.iteration>=o.max_iterations)return Ae(n),de(n),{shouldBlock:!1,message:`[ASCENT LOOP STOPPED] Max iterations (${o.max_iterations}) reached without completion promise. Consider reviewing the task requirements.`,mode:"none"};let i=ko(n);return i?{shouldBlock:!0,message:`<ascent-continuation>
320
320
 
321
321
  [ASCENT LOOP - ITERATION ${i.iteration}/${i.max_iterations}]
322
322
 
@@ -335,7 +335,7 @@ ${i.prompt?`Original task: ${i.prompt}`:""}
335
335
 
336
336
  ---
337
337
 
338
- `,mode:"ascent",metadata:{iteration:i.iteration,maxIterations:i.max_iterations}}:null}async function Ri(e,t,n){let o=Y(t);if(!o||!o.active||o.session_id&&e&&o.session_id!==e)return null;if(!n)return Fn(t),{shouldBlock:!1,message:"[ULTRAWORK COMPLETE] All tasks finished. Ultrawork mode deactivated. Well done!",mode:"none"};let r=Hn(t);return r?{shouldBlock:!0,message:Gn(r),mode:"ultrawork",metadata:{reinforcementCount:r.reinforcement_count}}:null}async function Ii(e,t,n){let o=ne(t);if(!o||!o.active||o.session_id&&e&&o.session_id!==e)return null;if(!n&&o.oracle_approved)return Et(t),{shouldBlock:!1,message:"[OLYMPUS COMPLETE] All tasks finished and Oracle verified. Orchestration mode deactivated. Excellent work!",mode:"none"};if(!n&&!o.oracle_approved&&o.requires_oracle_verification)return e&&Po(e)?(wo(t),Et(t),{shouldBlock:!1,message:"[OLYMPUS VERIFIED COMPLETE] Oracle approved. Orchestration mode deactivated. Excellent work!",mode:"none"}):{shouldBlock:!0,message:`<olympus-verification-required>
338
+ `,mode:"ascent",metadata:{iteration:i.iteration,maxIterations:i.max_iterations}}:null}async function Ri(e,t,n){let o=G(t);if(!o||!o.active||o.session_id&&e&&o.session_id!==e)return null;if(!n)return Fn(t),{shouldBlock:!1,message:"[ULTRAWORK COMPLETE] All tasks finished. Ultrawork mode deactivated. Well done!",mode:"none"};let r=Hn(t);return r?{shouldBlock:!0,message:Gn(r),mode:"ultrawork",metadata:{reinforcementCount:r.reinforcement_count}}:null}async function Ii(e,t,n){let o=ne(t);if(!o||!o.active||o.session_id&&e&&o.session_id!==e)return null;if(!n&&o.oracle_approved)return Et(t),{shouldBlock:!1,message:"[OLYMPUS COMPLETE] All tasks finished and Oracle verified. Orchestration mode deactivated. Excellent work!",mode:"none"};if(!n&&!o.oracle_approved&&o.requires_oracle_verification)return e&&Po(e)?(wo(t),Et(t),{shouldBlock:!1,message:"[OLYMPUS VERIFIED COMPLETE] Oracle approved. Orchestration mode deactivated. Excellent work!",mode:"none"}):{shouldBlock:!0,message:`<olympus-verification-required>
339
339
 
340
340
  [OLYMPUS MODE - ORACLE VERIFICATION REQUIRED]
341
341
 
@@ -370,17 +370,17 @@ ${qn}
370
370
 
371
371
  ---
372
372
 
373
- `,mode:"todo-continuation",metadata:{todoCount:n.count}}}async function bo(e,t){let n=t||process.cwd(),r=(await ue(e,n)).count>0,s=await Oi(e,n);if(s?.shouldBlock)return s;let i=await Ri(e,n,r);if(i?.shouldBlock)return i;let a=await Ii(e,n,r);if(a?.shouldBlock)return a;if(r){let c=await Ci(e,n);if(c?.shouldBlock)return c}return{shouldBlock:!1,message:"",mode:"none"}}function Do(e){return e.shouldBlock?{continue:!1,reason:e.message}:{continue:!0,message:e.message||void 0}}var re=require("fs"),kt=require("path"),Lo=require("os");var Mo=require("crypto");function _i(){let e=(0,kt.join)((0,Lo.homedir)(),".claude","todos");if(!(0,re.existsSync)(e))return 0;let t=0;try{let n=(0,re.readdirSync)(e).filter(o=>o.endsWith(".json"));for(let o of n)try{let r=(0,re.readFileSync)((0,kt.join)(e,o),"utf-8"),s=JSON.parse(r);Array.isArray(s)&&(t+=s.filter(i=>i.status!=="completed"&&i.status!=="cancelled").length)}catch{}}catch{}return t}async function Uo(e){let{directory:t,sessionId:n}=e;if(!t)return;let o=Z(t,n),r=_i();if(r>0&&o.pending_completion){let s={id:(0,Mo.randomUUID)(),timestamp:new Date().toISOString(),session_id:o.session_id,project_path:t,event_type:"cancellation",original_task:o.pending_completion.task_description,agent_used:o.pending_completion.agent_used,user_message:`[Stopped with ${r} incomplete todos]`,feedback_category:"rejection",confidence:.7};X(s)}o.pending_completion=null,o.todo_snapshot={total:0,completed:0,pending:r},ee(t,o)}function $o(){m({name:"persistentMode",event:"Stop",priority:10,handler:async e=>{let t=e.sessionId,n=e.directory||process.cwd(),o=await bo(t,n),r=Do(o);return{continue:r.continue,message:r.message,reason:r.reason}}}),m({name:"learningCancellationCapture",event:"Stop",priority:100,handler:async e=>e.directory?(Promise.resolve().then(async()=>{try{await Uo({directory:e.directory,sessionId:e.sessionId})}catch(t){console.error("[Olympus Learning]",t)}}),{continue:!0}):{continue:!0}})}var wt=require("fs"),vt=require("os"),fe=require("path");var v=require("fs"),R=require("path");var yt=require("path"),jo=require("os"),Ai=(0,yt.join)((0,jo.homedir)(),".olympus"),Ne=(0,yt.join)(Ai,"rules-injector"),Fo=[".git","pyproject.toml","package.json","Cargo.toml","go.mod",".venv"],Ho=[[".github","instructions"],[".cursor","rules"],[".claude","rules"]],Go=[".github/copilot-instructions.md"],Bo=/\.instructions\.md$/,Yo=".claude/rules",Wo=[".md",".mdc"],Ot=["read","write","edit","multiedit"];function Ni(e){return e.includes(".github/instructions")||e.endsWith(".github/instructions")}function xi(e,t){return Ni(t)?Bo.test(e):Wo.some(n=>e.endsWith(n))}function Ct(e){let t;try{t=(0,v.statSync)(e).isDirectory()?e:(0,R.dirname)(e)}catch{t=(0,R.dirname)(e)}for(;;){for(let o of Fo){let r=(0,R.join)(t,o);if((0,v.existsSync)(r))return t}let n=(0,R.dirname)(t);if(n===t)return null;t=n}}function It(e,t){if((0,v.existsSync)(e))try{let n=(0,v.readdirSync)(e,{withFileTypes:!0});for(let o of n){let r=(0,R.join)(e,o.name);o.isDirectory()?It(r,t):o.isFile()&&xi(o.name,e)&&t.push(r)}}catch{}}function Rt(e){try{return(0,v.realpathSync)(e)}catch{return e}}function _t(e,t,n){let o=[],r=new Set,s=(0,R.dirname)(n),i=0;for(;;){for(let[l,d]of Ho){let p=(0,R.join)(s,l,d),f=[];It(p,f);for(let g of f){let E=Rt(g);r.has(E)||(r.add(E),o.push({path:g,realPath:E,isGlobal:!1,distance:i}))}}if(e&&s===e)break;let u=(0,R.dirname)(s);if(u===s)break;s=u,i++}if(e)for(let u of Go){let l=(0,R.join)(e,u);if((0,v.existsSync)(l))try{if((0,v.statSync)(l).isFile()){let p=Rt(l);r.has(p)||(r.add(p),o.push({path:l,realPath:p,isGlobal:!1,distance:0,isSingleFile:!0}))}}catch{}}let a=(0,R.join)(t,Yo),c=[];It(a,c);for(let u of c){let l=Rt(u);r.has(l)||(r.add(l),o.push({path:u,realPath:l,isGlobal:!0,distance:9999}))}return o.sort((u,l)=>u.isGlobal!==l.isGlobal?u.isGlobal?1:-1:u.distance-l.distance),o}var Ko=require("crypto"),Vo=require("path");function wi(e,t){let n=e.replace(/\./g,"\\.").replace(/\*\*/g,"<<<GLOBSTAR>>>").replace(/\*/g,"[^/]*").replace(/<<<GLOBSTAR>>>/g,".*").replace(/\?/g,".");return new RegExp(`^${n}$`).test(t)}function At(e,t,n){if(e.alwaysApply===!0)return{applies:!0,reason:"alwaysApply"};let o=e.globs;if(!o)return{applies:!1};let r=Array.isArray(o)?o:[o];if(r.length===0)return{applies:!1};let i=(n?(0,Vo.relative)(n,t):t).replace(/\\/g,"/");for(let a of r)if(wi(a,i))return{applies:!0,reason:`glob: ${a}`};return{applies:!1}}function qo(e,t){return t.has(e)}function Jo(e){return(0,Ko.createHash)("sha256").update(e).digest("hex").slice(0,16)}function zo(e,t){return t.has(e)}function Nt(e){let t=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/,n=e.match(t);if(!n)return{metadata:{},body:e};let o=n[1],r=n[2];try{return{metadata:vi(o),body:r}}catch{return{metadata:{},body:e}}}function vi(e){let t=e.split(`
374
- `),n={},o=0;for(;o<t.length;){let r=t[o],s=r.indexOf(":");if(s===-1){o++;continue}let i=r.slice(0,s).trim(),a=r.slice(s+1).trim();if(i==="description")n.description=me(a);else if(i==="alwaysApply")n.alwaysApply=a==="true";else if(i==="globs"||i==="paths"||i==="applyTo"){let{value:c,consumed:u}=Pi(a,t,o);n.globs=Di(n.globs,c),o+=u;continue}o++}return n}function me(e){return e?e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1):e:""}function Pi(e,t,n){if(e.startsWith("["))return{value:bi(e),consumed:1};if(!e||e===""){let r=[],s=1;for(let i=n+1;i<t.length;i++){let a=t[i],c=a.match(/^\s+-\s*(.*)$/);if(c){let u=me(c[1].trim());u&&r.push(u),s++}else if(a.trim()==="")s++;else break}if(r.length>0)return{value:r,consumed:s}}let o=me(e);return o.includes(",")?{value:o.split(",").map(s=>s.trim()).filter(s=>s.length>0),consumed:1}:{value:o,consumed:1}}function bi(e){let t=e.slice(1,e.lastIndexOf("]")).trim();if(!t)return[];let n=[],o="",r=!1,s="";for(let a=0;a<t.length;a++){let c=t[a];if(!r&&(c==='"'||c==="'"))r=!0,s=c;else if(r&&c===s)r=!1,s="";else if(!r&&c===","){let u=o.trim();u&&n.push(me(u)),o=""}else o+=c}let i=o.trim();return i&&n.push(me(i)),n}function Di(e,t){if(!e)return t;let n=Array.isArray(e)?e:[e],o=Array.isArray(t)?t:[t];return[...n,...o]}var C=require("fs"),Xo=require("path");function xt(e){return(0,Xo.join)(Ne,`${e}.json`)}function Qo(e){let t=xt(e);if(!(0,C.existsSync)(t))return{contentHashes:new Set,realPaths:new Set};try{let n=(0,C.readFileSync)(t,"utf-8"),o=JSON.parse(n);return{contentHashes:new Set(o.injectedHashes),realPaths:new Set(o.injectedRealPaths??[])}}catch{return{contentHashes:new Set,realPaths:new Set}}}function Zo(e,t){(0,C.existsSync)(Ne)||(0,C.mkdirSync)(Ne,{recursive:!0});let n={sessionId:e,injectedHashes:[...t.contentHashes],injectedRealPaths:[...t.realPaths],updatedAt:Date.now()};(0,C.writeFileSync)(xt(e),JSON.stringify(n,null,2))}function er(e){let t=xt(e);(0,C.existsSync)(t)&&(0,C.unlinkSync)(t)}function tr(e){let t=new Map;function n(i){return t.has(i)||t.set(i,Qo(i)),t.get(i)}function o(i){return i?i.startsWith("/")?i:(0,fe.resolve)(e,i):null}function r(i,a){let c=o(i);if(!c)return[];let u=Ct(c),l=n(a),d=(0,vt.homedir)(),p=_t(u,d,c),f=[];for(let g of p)if(!qo(g.realPath,l.realPaths))try{let E=(0,wt.readFileSync)(g.path,"utf-8"),{metadata:b,body:x}=Nt(E),w;if(g.isSingleFile)w="copilot-instructions (always apply)";else{let fn=At(b,c,u);if(!fn.applies)continue;w=fn.reason??"matched"}let mn=Jo(x);if(zo(mn,l.contentHashes))continue;let xs=u?(0,fe.relative)(u,g.path):g.path;f.push({relativePath:xs,matchReason:w,content:x,distance:g.distance}),l.realPaths.add(g.realPath),l.contentHashes.add(mn)}catch{}return f.length>0&&(f.sort((g,E)=>g.distance-E.distance),Zo(a,l)),f}function s(i){if(i.length===0)return"";let a="";for(let c of i)a+=`
373
+ `,mode:"todo-continuation",metadata:{todoCount:n.count}}}async function bo(e,t){let n=t||process.cwd(),r=(await ue(e,n)).count>0,s=await Oi(e,n);if(s?.shouldBlock)return s;let i=await Ri(e,n,r);if(i?.shouldBlock)return i;let a=await Ii(e,n,r);if(a?.shouldBlock)return a;if(r){let c=await Ci(e,n);if(c?.shouldBlock)return c}return{shouldBlock:!1,message:"",mode:"none"}}function Do(e){return e.shouldBlock?{continue:!1,reason:e.message}:{continue:!0,message:e.message||void 0}}var re=require("fs"),kt=require("path"),Lo=require("os");var Mo=require("crypto");function _i(){let e=(0,kt.join)((0,Lo.homedir)(),".claude","todos");if(!(0,re.existsSync)(e))return 0;let t=0;try{let n=(0,re.readdirSync)(e).filter(o=>o.endsWith(".json"));for(let o of n)try{let r=(0,re.readFileSync)((0,kt.join)(e,o),"utf-8"),s=JSON.parse(r);Array.isArray(s)&&(t+=s.filter(i=>i.status!=="completed"&&i.status!=="cancelled").length)}catch{}}catch{}return t}async function Uo(e){let{directory:t,sessionId:n}=e;if(!t)return;let o=Z(t,n),r=_i();if(r>0&&o.pending_completion){let s={id:(0,Mo.randomUUID)(),timestamp:new Date().toISOString(),session_id:o.session_id,project_path:t,event_type:"cancellation",original_task:o.pending_completion.task_description,agent_used:o.pending_completion.agent_used,user_message:`[Stopped with ${r} incomplete todos]`,feedback_category:"rejection",confidence:.7};X(s)}o.pending_completion=null,o.todo_snapshot={total:0,completed:0,pending:r},ee(t,o)}function $o(){m({name:"persistentMode",event:"Stop",priority:10,handler:async e=>{let t=e.sessionId,n=e.directory||process.cwd(),o=await bo(t,n),r=Do(o);return{continue:r.continue,message:r.message,reason:r.reason}}}),m({name:"learningCancellationCapture",event:"Stop",priority:100,handler:async e=>e.directory?(Promise.resolve().then(async()=>{try{await Uo({directory:e.directory,sessionId:e.sessionId})}catch(t){console.error("[Olympus Learning]",t)}}),{continue:!0}):{continue:!0}})}var wt=require("fs"),vt=require("os"),fe=require("path");var x=require("fs"),y=require("path");var yt=require("path"),jo=require("os"),Ai=(0,yt.join)((0,jo.homedir)(),".olympus"),Ne=(0,yt.join)(Ai,"rules-injector"),Fo=[".git","pyproject.toml","package.json","Cargo.toml","go.mod",".venv"],Ho=[[".github","instructions"],[".cursor","rules"],[".claude","rules"]],Go=[".github/copilot-instructions.md"],Bo=/\.instructions\.md$/,Yo=".claude/rules",Wo=[".md",".mdc"],Ot=["read","write","edit","multiedit"];function Ni(e){return e.includes(".github/instructions")||e.endsWith(".github/instructions")}function xi(e,t){return Ni(t)?Bo.test(e):Wo.some(n=>e.endsWith(n))}function Ct(e){let t;try{t=(0,x.statSync)(e).isDirectory()?e:(0,y.dirname)(e)}catch{t=(0,y.dirname)(e)}for(;;){for(let o of Fo){let r=(0,y.join)(t,o);if((0,x.existsSync)(r))return t}let n=(0,y.dirname)(t);if(n===t)return null;t=n}}function It(e,t){if((0,x.existsSync)(e))try{let n=(0,x.readdirSync)(e,{withFileTypes:!0});for(let o of n){let r=(0,y.join)(e,o.name);o.isDirectory()?It(r,t):o.isFile()&&xi(o.name,e)&&t.push(r)}}catch{}}function Rt(e){try{return(0,x.realpathSync)(e)}catch{return e}}function _t(e,t,n){let o=[],r=new Set,s=(0,y.dirname)(n),i=0;for(;;){for(let[l,d]of Ho){let p=(0,y.join)(s,l,d),f=[];It(p,f);for(let g of f){let E=Rt(g);r.has(E)||(r.add(E),o.push({path:g,realPath:E,isGlobal:!1,distance:i}))}}if(e&&s===e)break;let u=(0,y.dirname)(s);if(u===s)break;s=u,i++}if(e)for(let u of Go){let l=(0,y.join)(e,u);if((0,x.existsSync)(l))try{if((0,x.statSync)(l).isFile()){let p=Rt(l);r.has(p)||(r.add(p),o.push({path:l,realPath:p,isGlobal:!1,distance:0,isSingleFile:!0}))}}catch{}}let a=(0,y.join)(t,Yo),c=[];It(a,c);for(let u of c){let l=Rt(u);r.has(l)||(r.add(l),o.push({path:u,realPath:l,isGlobal:!0,distance:9999}))}return o.sort((u,l)=>u.isGlobal!==l.isGlobal?u.isGlobal?1:-1:u.distance-l.distance),o}var Ko=require("crypto"),Vo=require("path");function wi(e,t){let n=e.replace(/\./g,"\\.").replace(/\*\*/g,"<<<GLOBSTAR>>>").replace(/\*/g,"[^/]*").replace(/<<<GLOBSTAR>>>/g,".*").replace(/\?/g,".");return new RegExp(`^${n}$`).test(t)}function At(e,t,n){if(e.alwaysApply===!0)return{applies:!0,reason:"alwaysApply"};let o=e.globs;if(!o)return{applies:!1};let r=Array.isArray(o)?o:[o];if(r.length===0)return{applies:!1};let i=(n?(0,Vo.relative)(n,t):t).replace(/\\/g,"/");for(let a of r)if(wi(a,i))return{applies:!0,reason:`glob: ${a}`};return{applies:!1}}function qo(e,t){return t.has(e)}function Jo(e){return(0,Ko.createHash)("sha256").update(e).digest("hex").slice(0,16)}function zo(e,t){return t.has(e)}function Nt(e){let t=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/,n=e.match(t);if(!n)return{metadata:{},body:e};let o=n[1],r=n[2];try{return{metadata:vi(o),body:r}}catch{return{metadata:{},body:e}}}function vi(e){let t=e.split(`
374
+ `),n={},o=0;for(;o<t.length;){let r=t[o],s=r.indexOf(":");if(s===-1){o++;continue}let i=r.slice(0,s).trim(),a=r.slice(s+1).trim();if(i==="description")n.description=me(a);else if(i==="alwaysApply")n.alwaysApply=a==="true";else if(i==="globs"||i==="paths"||i==="applyTo"){let{value:c,consumed:u}=Pi(a,t,o);n.globs=Di(n.globs,c),o+=u;continue}o++}return n}function me(e){return e?e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1):e:""}function Pi(e,t,n){if(e.startsWith("["))return{value:bi(e),consumed:1};if(!e||e===""){let r=[],s=1;for(let i=n+1;i<t.length;i++){let a=t[i],c=a.match(/^\s+-\s*(.*)$/);if(c){let u=me(c[1].trim());u&&r.push(u),s++}else if(a.trim()==="")s++;else break}if(r.length>0)return{value:r,consumed:s}}let o=me(e);return o.includes(",")?{value:o.split(",").map(s=>s.trim()).filter(s=>s.length>0),consumed:1}:{value:o,consumed:1}}function bi(e){let t=e.slice(1,e.lastIndexOf("]")).trim();if(!t)return[];let n=[],o="",r=!1,s="";for(let a=0;a<t.length;a++){let c=t[a];if(!r&&(c==='"'||c==="'"))r=!0,s=c;else if(r&&c===s)r=!1,s="";else if(!r&&c===","){let u=o.trim();u&&n.push(me(u)),o=""}else o+=c}let i=o.trim();return i&&n.push(me(i)),n}function Di(e,t){if(!e)return t;let n=Array.isArray(e)?e:[e],o=Array.isArray(t)?t:[t];return[...n,...o]}var R=require("fs"),Xo=require("path");function xt(e){return(0,Xo.join)(Ne,`${e}.json`)}function Qo(e){let t=xt(e);if(!(0,R.existsSync)(t))return{contentHashes:new Set,realPaths:new Set};try{let n=(0,R.readFileSync)(t,"utf-8"),o=JSON.parse(n);return{contentHashes:new Set(o.injectedHashes),realPaths:new Set(o.injectedRealPaths??[])}}catch{return{contentHashes:new Set,realPaths:new Set}}}function Zo(e,t){(0,R.existsSync)(Ne)||(0,R.mkdirSync)(Ne,{recursive:!0});let n={sessionId:e,injectedHashes:[...t.contentHashes],injectedRealPaths:[...t.realPaths],updatedAt:Date.now()};(0,R.writeFileSync)(xt(e),JSON.stringify(n,null,2))}function er(e){let t=xt(e);(0,R.existsSync)(t)&&(0,R.unlinkSync)(t)}function tr(e){let t=new Map;function n(i){return t.has(i)||t.set(i,Qo(i)),t.get(i)}function o(i){return i?i.startsWith("/")?i:(0,fe.resolve)(e,i):null}function r(i,a){let c=o(i);if(!c)return[];let u=Ct(c),l=n(a),d=(0,vt.homedir)(),p=_t(u,d,c),f=[];for(let g of p)if(!qo(g.realPath,l.realPaths))try{let E=(0,wt.readFileSync)(g.path,"utf-8"),{metadata:v,body:A}=Nt(E),N;if(g.isSingleFile)N="copilot-instructions (always apply)";else{let fn=At(v,c,u);if(!fn.applies)continue;N=fn.reason??"matched"}let mn=Jo(A);if(zo(mn,l.contentHashes))continue;let xs=u?(0,fe.relative)(u,g.path):g.path;f.push({relativePath:xs,matchReason:N,content:A,distance:g.distance}),l.realPaths.add(g.realPath),l.contentHashes.add(mn)}catch{}return f.length>0&&(f.sort((g,E)=>g.distance-E.distance),Zo(a,l)),f}function s(i){if(i.length===0)return"";let a="";for(let c of i)a+=`
375
375
 
376
376
  [Rule: ${c.relativePath}]
377
377
  [Match: ${c.matchReason}]
378
- ${c.content}`;return a}return{processToolExecution:(i,a,c)=>{if(!Ot.includes(i.toLowerCase()))return"";let u=r(a,c);return s(u)},getRulesForFile:i=>{let a=o(i);if(!a)return[];let c=Ct(a),u=(0,vt.homedir)(),l=_t(c,u,a),d=[];for(let p of l)try{let f=(0,wt.readFileSync)(p.path,"utf-8"),{metadata:g,body:E}=Nt(f),b;if(p.isSingleFile)b="copilot-instructions (always apply)";else{let w=At(g,a,c);if(!w.applies)continue;b=w.reason??"matched"}let x=c?(0,fe.relative)(c,p.path):p.path;d.push({relativePath:x,matchReason:b,content:E,distance:p.distance})}catch{}return d.sort((p,f)=>p.distance-f.distance)},clearSession:i=>{t.delete(i),er(i)},isTrackedTool:i=>Ot.includes(i.toLowerCase())}}var we=require("node:fs"),j=require("node:path");var _=require("node:fs"),rr=require("node:path");var Pt=require("node:path"),nr=require("node:os"),Li=(0,Pt.join)((0,nr.homedir)(),".olympus"),xe=(0,Pt.join)(Li,"directory-readme"),or="README.md",bt=["read","write","edit","multiedit"];function Dt(e){return(0,rr.join)(xe,`${e}.json`)}function sr(e){let t=Dt(e);if(!(0,_.existsSync)(t))return new Set;try{let n=(0,_.readFileSync)(t,"utf-8"),o=JSON.parse(n);return new Set(o.injectedPaths)}catch{return new Set}}function ir(e,t){(0,_.existsSync)(xe)||(0,_.mkdirSync)(xe,{recursive:!0});let n={sessionID:e,injectedPaths:Array.from(t),updatedAt:Date.now()};(0,_.writeFileSync)(Dt(e),JSON.stringify(n,null,2))}function ar(e){let t=Dt(e);(0,_.existsSync)(t)&&(0,_.unlinkSync)(t)}var cr=4,Mi=5e3;function Ui(e,t=Mi){if(Math.ceil(e.length/cr)<=t)return{result:e,truncated:!1};let o=t*cr;return{result:e.slice(0,o),truncated:!0}}function ur(e){let t=new Map;function n(i){return t.has(i)||t.set(i,sr(i)),t.get(i)}function o(i){return i?i.startsWith("/")?i:(0,j.resolve)(e,i):null}function r(i){let a=[],c=i;for(;;){let u=(0,j.join)(c,or);if((0,we.existsSync)(u)&&a.push(u),c===e)break;let l=(0,j.dirname)(c);if(l===c||!l.startsWith(e))break;c=l}return a.reverse()}function s(i,a){let c=o(i);if(!c)return"";let u=(0,j.dirname)(c),l=n(a),d=r(u),p="";for(let f of d){let g=(0,j.dirname)(f);if(!l.has(g))try{let E=(0,we.readFileSync)(f,"utf-8"),{result:b,truncated:x}=Ui(E),w=x?`
378
+ ${c.content}`;return a}return{processToolExecution:(i,a,c)=>{if(!Ot.includes(i.toLowerCase()))return"";let u=r(a,c);return s(u)},getRulesForFile:i=>{let a=o(i);if(!a)return[];let c=Ct(a),u=(0,vt.homedir)(),l=_t(c,u,a),d=[];for(let p of l)try{let f=(0,wt.readFileSync)(p.path,"utf-8"),{metadata:g,body:E}=Nt(f),v;if(p.isSingleFile)v="copilot-instructions (always apply)";else{let N=At(g,a,c);if(!N.applies)continue;v=N.reason??"matched"}let A=c?(0,fe.relative)(c,p.path):p.path;d.push({relativePath:A,matchReason:v,content:E,distance:p.distance})}catch{}return d.sort((p,f)=>p.distance-f.distance)},clearSession:i=>{t.delete(i),er(i)},isTrackedTool:i=>Ot.includes(i.toLowerCase())}}var we=require("node:fs"),U=require("node:path");var I=require("node:fs"),rr=require("node:path");var Pt=require("node:path"),nr=require("node:os"),Li=(0,Pt.join)((0,nr.homedir)(),".olympus"),xe=(0,Pt.join)(Li,"directory-readme"),or="README.md",bt=["read","write","edit","multiedit"];function Dt(e){return(0,rr.join)(xe,`${e}.json`)}function sr(e){let t=Dt(e);if(!(0,I.existsSync)(t))return new Set;try{let n=(0,I.readFileSync)(t,"utf-8"),o=JSON.parse(n);return new Set(o.injectedPaths)}catch{return new Set}}function ir(e,t){(0,I.existsSync)(xe)||(0,I.mkdirSync)(xe,{recursive:!0});let n={sessionID:e,injectedPaths:Array.from(t),updatedAt:Date.now()};(0,I.writeFileSync)(Dt(e),JSON.stringify(n,null,2))}function ar(e){let t=Dt(e);(0,I.existsSync)(t)&&(0,I.unlinkSync)(t)}var cr=4,Mi=5e3;function Ui(e,t=Mi){if(Math.ceil(e.length/cr)<=t)return{result:e,truncated:!1};let o=t*cr;return{result:e.slice(0,o),truncated:!0}}function ur(e){let t=new Map;function n(i){return t.has(i)||t.set(i,sr(i)),t.get(i)}function o(i){return i?i.startsWith("/")?i:(0,U.resolve)(e,i):null}function r(i){let a=[],c=i;for(;;){let u=(0,U.join)(c,or);if((0,we.existsSync)(u)&&a.push(u),c===e)break;let l=(0,U.dirname)(c);if(l===c||!l.startsWith(e))break;c=l}return a.reverse()}function s(i,a){let c=o(i);if(!c)return"";let u=(0,U.dirname)(c),l=n(a),d=r(u),p="";for(let f of d){let g=(0,U.dirname)(f);if(!l.has(g))try{let E=(0,we.readFileSync)(f,"utf-8"),{result:v,truncated:A}=Ui(E),N=A?`
379
379
 
380
380
  [Note: Content was truncated to save context window space. For full context, please read the file directly: ${f}]`:"";p+=`
381
381
 
382
382
  [Project README: ${f}]
383
- ${b}${w}`,l.add(g)}catch{}}return p&&ir(a,l),p}return{processToolExecution:(i,a,c)=>bt.includes(i.toLowerCase())?s(a,c):"",getReadmesForFile:i=>{let a=o(i);if(!a)return[];let c=(0,j.dirname)(a);return r(c)},clearSession:i=>{t.delete(i),ar(i)},isTrackedTool:i=>bt.includes(i.toLowerCase())}}var lr="non-interactive-env",dr={CI:"true",DEBIAN_FRONTEND:"noninteractive",GIT_TERMINAL_PROMPT:"0",GCM_INTERACTIVE:"never",HOMEBREW_NO_AUTO_UPDATE:"1",GIT_EDITOR:":",EDITOR:":",VISUAL:"",GIT_SEQUENCE_EDITOR:":",GIT_MERGE_AUTOEDIT:"no",GIT_PAGER:"cat",PAGER:"cat",npm_config_yes:"true",PIP_NO_INPUT:"1",YARN_ENABLE_IMMUTABLE_INSTALLS:"false"},Lt={npm:{bad:["npm init","npm install (prompts)"],good:["npm init -y","npm install --yes"]},apt:{bad:["apt-get install pkg"],good:["apt-get install -y pkg","DEBIAN_FRONTEND=noninteractive apt-get install pkg"]},pip:{bad:["pip install pkg (with prompts)"],good:["pip install --no-input pkg","PIP_NO_INPUT=1 pip install pkg"]},git:{bad:["git commit","git merge branch","git add -p","git rebase -i"],good:["git commit -m 'msg'","git merge --no-edit branch","git add .","git rebase --no-edit"]},system:{bad:["rm file (prompts)","cp a b (prompts)","ssh host"],good:["rm -f file","cp -f a b","ssh -o BatchMode=yes host","unzip -o file.zip"]},banned:["vim","nano","vi","emacs","less","more","man","python (REPL)","node (REPL)","git add -p","git rebase -i"],workarounds:{yesPipe:"yes | ./script.sh",heredoc:`./script.sh <<EOF
383
+ ${v}${N}`,l.add(g)}catch{}}return p&&ir(a,l),p}return{processToolExecution:(i,a,c)=>bt.includes(i.toLowerCase())?s(a,c):"",getReadmesForFile:i=>{let a=o(i);if(!a)return[];let c=(0,U.dirname)(a);return r(c)},clearSession:i=>{t.delete(i),ar(i)},isTrackedTool:i=>bt.includes(i.toLowerCase())}}var lr="non-interactive-env",dr={CI:"true",DEBIAN_FRONTEND:"noninteractive",GIT_TERMINAL_PROMPT:"0",GCM_INTERACTIVE:"never",HOMEBREW_NO_AUTO_UPDATE:"1",GIT_EDITOR:":",EDITOR:":",VISUAL:"",GIT_SEQUENCE_EDITOR:":",GIT_MERGE_AUTOEDIT:"no",GIT_PAGER:"cat",PAGER:"cat",npm_config_yes:"true",PIP_NO_INPUT:"1",YARN_ENABLE_IMMUTABLE_INSTALLS:"false"},Lt={npm:{bad:["npm init","npm install (prompts)"],good:["npm init -y","npm install --yes"]},apt:{bad:["apt-get install pkg"],good:["apt-get install -y pkg","DEBIAN_FRONTEND=noninteractive apt-get install pkg"]},pip:{bad:["pip install pkg (with prompts)"],good:["pip install --no-input pkg","PIP_NO_INPUT=1 pip install pkg"]},git:{bad:["git commit","git merge branch","git add -p","git rebase -i"],good:["git commit -m 'msg'","git merge --no-edit branch","git add .","git rebase --no-edit"]},system:{bad:["rm file (prompts)","cp a b (prompts)","ssh host"],good:["rm -f file","cp -f a b","ssh -o BatchMode=yes host","unzip -o file.zip"]},banned:["vim","nano","vi","emacs","less","more","man","python (REPL)","node (REPL)","git add -p","git rebase -i"],workarounds:{yesPipe:"yes | ./script.sh",heredoc:`./script.sh <<EOF
384
384
  option1
385
385
  option2
386
386
  EOF`,expectAlternative:"Use environment variables or config files instead of expect"}};var pr=Lt.banned.filter(e=>!e.includes("(")).map(e=>new RegExp(`\\b${e}\\b`));function $i(e){for(let t=0;t<pr.length;t++)if(pr[t].test(e))return Lt.banned[t]}function ji(e){return e===""?"''":/[^a-zA-Z0-9_\-.:\/]/.test(e)?`'${e.replace(/'/g,"'\\''")}'`:e}function Fi(e){return`export ${Object.entries(e).map(([n,o])=>`${n}=${ji(o)}`).join(" ")};`}var Mt={name:lr,async beforeCommand(e){let t=$i(e),n=t?`Warning: '${t}' is an interactive command that may hang in non-interactive environments.`:void 0;return/\bgit\b/.test(e)?{command:`${Fi(dr)} ${e}`,warning:n}:{command:e,warning:n}}};var Ut=require("child_process");var mr="olympus-orchestrator",fr=".olympus/",gr=["Write","Edit","write","edit"],hr=`
@@ -502,7 +502,7 @@ If you were NOT given **exactly ONE atomic task**, you MUST:
502
502
  - Batch delegation = sloppy work = rework = wasted tokens
503
503
 
504
504
  **REFUSE multi-task requests. DEMAND single-task clarity.**
505
- `;var ge=".olympus",ve="quest.json",Hi=`${ge}/${ve}`,yr="notepads",Gi=`${ge}/${yr}`;var P=require("fs"),Pe=require("path");function Or(e){return(0,Pe.join)(e,ge,ve)}function be(e){let t=Or(e);if(!(0,P.existsSync)(t))return null;try{let n=(0,P.readFileSync)(t,"utf-8");return JSON.parse(n)}catch{return null}}function De(e){if(!(0,P.existsSync)(e))return{total:0,completed:0,isComplete:!0};try{let t=(0,P.readFileSync)(e,"utf-8"),n=t.match(/^[-*]\s*\[\s*\]/gm)||[],o=t.match(/^[-*]\s*\[[xX]\]/gm)||[],r=n.length+o.length,s=o.length;return{total:r,completed:s,isComplete:r===0||s===r}}catch{return{total:0,completed:0,isComplete:!0}}}function Rr(e){return e?e.includes(fr):!0}function Ir(e){return gr.includes(e)}function Wi(e){try{let t=(0,Ut.execSync)("git diff --numstat HEAD",{cwd:e,encoding:"utf-8",timeout:5e3}).trim();if(!t)return[];let n=(0,Ut.execSync)("git status --porcelain",{cwd:e,encoding:"utf-8",timeout:5e3}).trim(),o=new Map;for(let s of n.split(`
505
+ `;var ge=".olympus",ve="quest.json",Hi=`${ge}/${ve}`,yr="notepads",Gi=`${ge}/${yr}`;var w=require("fs"),Pe=require("path");function Or(e){return(0,Pe.join)(e,ge,ve)}function be(e){let t=Or(e);if(!(0,w.existsSync)(t))return null;try{let n=(0,w.readFileSync)(t,"utf-8");return JSON.parse(n)}catch{return null}}function De(e){if(!(0,w.existsSync)(e))return{total:0,completed:0,isComplete:!0};try{let t=(0,w.readFileSync)(e,"utf-8"),n=t.match(/^[-*]\s*\[\s*\]/gm)||[],o=t.match(/^[-*]\s*\[[xX]\]/gm)||[],r=n.length+o.length,s=o.length;return{total:r,completed:s,isComplete:r===0||s===r}}catch{return{total:0,completed:0,isComplete:!0}}}function Rr(e){return e?e.includes(fr):!0}function Ir(e){return gr.includes(e)}function Wi(e){try{let t=(0,Ut.execSync)("git diff --numstat HEAD",{cwd:e,encoding:"utf-8",timeout:5e3}).trim();if(!t)return[];let n=(0,Ut.execSync)("git status --porcelain",{cwd:e,encoding:"utf-8",timeout:5e3}).trim(),o=new Map;for(let s of n.split(`
506
506
  `)){if(!s)continue;let i=s.substring(0,2).trim(),a=s.substring(3);i==="A"||i==="??"?o.set(a,"added"):i==="D"?o.set(a,"deleted"):o.set(a,"modified")}let r=[];for(let s of t.split(`
507
507
  `)){let i=s.split(" ");if(i.length<3)continue;let[a,c,u]=i,l=a==="-"?0:parseInt(a,10),d=c==="-"?0:parseInt(c,10);r.push({path:u,added:l,removed:d,status:o.get(u)??"modified"})}return r}catch{return[]}}function Ki(e){if(e.length===0)return`[FILE CHANGES SUMMARY]
508
508
  No file changes detected.
@@ -543,7 +543,7 @@ You made an Edit mistake. STOP and do this NOW:
543
543
  4. CONTINUE with corrected action based on the real file content
544
544
 
545
545
  DO NOT attempt another edit until you've read and verified the file state.
546
- `;function ea(e){let t=e.toLowerCase();return Qi.some(n=>t.includes(n.toLowerCase()))}function Nr(){return{afterToolExecute:(e,t)=>e.tool.toLowerCase()!=="edit"?t:ea(t.output)?{...t,output:t.output+Zi}:t}}var vr=M(require("fs"),1),Ue=M(require("path"),1),Pr=require("os");var Me=new Set(["given","when","then","arrange","act","assert","when & then","when&then"]),$t=["type:","noqa","pyright:","ruff:","mypy:","pylint:","flake8:","pyre:","pytype:","eslint-disable","eslint-enable","eslint-ignore","prettier-ignore","ts-ignore","ts-expect-error","ts-nocheck","@ts-ignore","@ts-expect-error","@ts-nocheck","clippy::","allow(","deny(","warn(","forbid(","nolint","go:generate","go:build","go:embed","coverage:","c8 ignore","istanbul ignore","biome-ignore","region","endregion","#region","#endregion"],jt=`COMMENT/DOCSTRING DETECTED - IMMEDIATE ACTION REQUIRED
546
+ `;function ea(e){let t=e.toLowerCase();return Qi.some(n=>t.includes(n.toLowerCase()))}function Nr(){return{afterToolExecute:(e,t)=>e.tool.toLowerCase()!=="edit"?t:ea(t.output)?{...t,output:t.output+Zi}:t}}var vr=b(require("fs"),1),Ue=b(require("path"),1),Pr=require("os");var Me=new Set(["given","when","then","arrange","act","assert","when & then","when&then"]),$t=["type:","noqa","pyright:","ruff:","mypy:","pylint:","flake8:","pyre:","pytype:","eslint-disable","eslint-enable","eslint-ignore","prettier-ignore","ts-ignore","ts-expect-error","ts-nocheck","@ts-ignore","@ts-expect-error","@ts-nocheck","clippy::","allow(","deny(","warn(","forbid(","nolint","go:generate","go:build","go:embed","coverage:","c8 ignore","istanbul ignore","biome-ignore","region","endregion","#region","#endregion"],jt=`COMMENT/DOCSTRING DETECTED - IMMEDIATE ACTION REQUIRED
547
547
 
548
548
  Your recent changes contain comments or docstrings, which triggered this hook.
549
549
  You need to take immediate action. You must follow the conditions below.
@@ -581,13 +581,13 @@ MANDATORY REQUIREMENT: You must acknowledge this hook message and take one of th
581
581
  Review in the above priority order and take the corresponding action EVERY TIME this appears.
582
582
 
583
583
  Detected comments/docstrings:
584
- `,Ft={js:/\/\/.*$|\/\*[\s\S]*?\*\//gm,ts:/\/\/.*$|\/\*[\s\S]*?\*\//gm,jsx:/\/\/.*$|\/\*[\s\S]*?\*\//gm,tsx:/\/\/.*$|\/\*[\s\S]*?\*\//gm,java:/\/\/.*$|\/\*[\s\S]*?\*\//gm,c:/\/\/.*$|\/\*[\s\S]*?\*\//gm,cpp:/\/\/.*$|\/\*[\s\S]*?\*\//gm,cs:/\/\/.*$|\/\*[\s\S]*?\*\//gm,go:/\/\/.*$/gm,rust:/\/\/.*$|\/\*[\s\S]*?\*\//gm,swift:/\/\/.*$|\/\*[\s\S]*?\*\//gm,kotlin:/\/\/.*$|\/\*[\s\S]*?\*\//gm,py:/#.*$|'''[\s\S]*?'''|"""[\s\S]*?"""/gm,rb:/#.*$|=begin[\s\S]*?=end/gm,sh:/#.*$/gm,bash:/#.*$/gm,zsh:/#.*$/gm,yaml:/#.*$/gm,yml:/#.*$/gm,toml:/#.*$/gm,html:/<!--[\s\S]*?-->/gm,xml:/<!--[\s\S]*?-->/gm,vue:/<!--[\s\S]*?-->|\/\/.*$|\/\*[\s\S]*?\*\//gm,svelte:/<!--[\s\S]*?-->|\/\/.*$|\/\*[\s\S]*?\*\//gm,sql:/--.*$/gm,lua:/--.*$|--\[\[[\s\S]*?\]\]/gm},Ht={".js":"js",".mjs":"js",".cjs":"js",".ts":"ts",".mts":"ts",".cts":"ts",".jsx":"jsx",".tsx":"tsx",".java":"java",".c":"c",".h":"c",".cpp":"cpp",".cc":"cpp",".cxx":"cpp",".hpp":"cpp",".cs":"cs",".go":"go",".rs":"rust",".swift":"swift",".kt":"kotlin",".kts":"kotlin",".py":"py",".pyi":"py",".rb":"rb",".sh":"sh",".bash":"bash",".zsh":"zsh",".yaml":"yaml",".yml":"yml",".toml":"toml",".html":"html",".htm":"html",".xml":"xml",".vue":"vue",".svelte":"svelte",".sql":"sql",".lua":"lua"};function ta(e){return e.text.trim().startsWith("#!")&&e.lineNumber===1?{shouldSkip:!0,reason:"shebang"}:{shouldSkip:!1}}function na(e){if(e.isDocstring)return{shouldSkip:!1};let t=e.text.toLowerCase().trim();for(let n of Me){if(t.startsWith(`#${n}`)||t.startsWith(`// ${n}`))return{shouldSkip:!0,reason:`BDD keyword: ${n}`};if(t.includes(n)&&t.split(/\s+/).some(r=>Me.has(r.replace(/[^a-z&]/g,""))))return{shouldSkip:!0,reason:"BDD keyword detected"}}return{shouldSkip:!1}}function oa(e){let t=e.text.toLowerCase().trim();for(let n of $t)if(t.includes(n.toLowerCase()))return{shouldSkip:!0,reason:`directive: ${n}`};return{shouldSkip:!1}}function ra(e){return{shouldSkip:!1}}function sa(e){let t=e.text.toLowerCase(),n=["copyright","license","licensed under","spdx-license-identifier","all rights reserved","mit license","apache license","gnu general public","bsd license"];for(let o of n)if(t.includes(o))return{shouldSkip:!0,reason:"copyright/license"};return{shouldSkip:!1}}function ia(e){let t=e.text.toUpperCase(),n=["TODO","FIXME","HACK","XXX","NOTE","REVIEW"];for(let o of n)if(t.includes(o))return{shouldSkip:!0,reason:`todo marker: ${o}`};return{shouldSkip:!1}}var aa=[ta,na,oa,sa,ia,ra];function Gt(e){return e.filter(t=>{for(let n of aa)if(n(t).shouldSkip)return!1;return!0})}var ca=process.env.COMMENT_CHECKER_DEBUG==="1",ua=Ue.join((0,Pr.tmpdir)(),"comment-checker-debug.log");function J(...e){if(ca){let t=`[${new Date().toISOString()}] [comment-checker] ${e.map(n=>typeof n=="object"?JSON.stringify(n,null,2):String(n)).join(" ")}
585
- `;vr.appendFileSync(ua,t)}}function la(e){let t=Ue.extname(e).toLowerCase();return Ht[t]}function Bt(e,t){let n=la(t);if(!n)return J("unsupported language for:",t),[];let o=Ft[n];if(!o)return J("no pattern for language:",n),[];let r=[],s=e.split(`
584
+ `,Ft={js:/\/\/.*$|\/\*[\s\S]*?\*\//gm,ts:/\/\/.*$|\/\*[\s\S]*?\*\//gm,jsx:/\/\/.*$|\/\*[\s\S]*?\*\//gm,tsx:/\/\/.*$|\/\*[\s\S]*?\*\//gm,java:/\/\/.*$|\/\*[\s\S]*?\*\//gm,c:/\/\/.*$|\/\*[\s\S]*?\*\//gm,cpp:/\/\/.*$|\/\*[\s\S]*?\*\//gm,cs:/\/\/.*$|\/\*[\s\S]*?\*\//gm,go:/\/\/.*$/gm,rust:/\/\/.*$|\/\*[\s\S]*?\*\//gm,swift:/\/\/.*$|\/\*[\s\S]*?\*\//gm,kotlin:/\/\/.*$|\/\*[\s\S]*?\*\//gm,py:/#.*$|'''[\s\S]*?'''|"""[\s\S]*?"""/gm,rb:/#.*$|=begin[\s\S]*?=end/gm,sh:/#.*$/gm,bash:/#.*$/gm,zsh:/#.*$/gm,yaml:/#.*$/gm,yml:/#.*$/gm,toml:/#.*$/gm,html:/<!--[\s\S]*?-->/gm,xml:/<!--[\s\S]*?-->/gm,vue:/<!--[\s\S]*?-->|\/\/.*$|\/\*[\s\S]*?\*\//gm,svelte:/<!--[\s\S]*?-->|\/\/.*$|\/\*[\s\S]*?\*\//gm,sql:/--.*$/gm,lua:/--.*$|--\[\[[\s\S]*?\]\]/gm},Ht={".js":"js",".mjs":"js",".cjs":"js",".ts":"ts",".mts":"ts",".cts":"ts",".jsx":"jsx",".tsx":"tsx",".java":"java",".c":"c",".h":"c",".cpp":"cpp",".cc":"cpp",".cxx":"cpp",".hpp":"cpp",".cs":"cs",".go":"go",".rs":"rust",".swift":"swift",".kt":"kotlin",".kts":"kotlin",".py":"py",".pyi":"py",".rb":"rb",".sh":"sh",".bash":"bash",".zsh":"zsh",".yaml":"yaml",".yml":"yml",".toml":"toml",".html":"html",".htm":"html",".xml":"xml",".vue":"vue",".svelte":"svelte",".sql":"sql",".lua":"lua"};function ta(e){return e.text.trim().startsWith("#!")&&e.lineNumber===1?{shouldSkip:!0,reason:"shebang"}:{shouldSkip:!1}}function na(e){if(e.isDocstring)return{shouldSkip:!1};let t=e.text.toLowerCase().trim();for(let n of Me){if(t.startsWith(`#${n}`)||t.startsWith(`// ${n}`))return{shouldSkip:!0,reason:`BDD keyword: ${n}`};if(t.includes(n)&&t.split(/\s+/).some(r=>Me.has(r.replace(/[^a-z&]/g,""))))return{shouldSkip:!0,reason:"BDD keyword detected"}}return{shouldSkip:!1}}function oa(e){let t=e.text.toLowerCase().trim();for(let n of $t)if(t.includes(n.toLowerCase()))return{shouldSkip:!0,reason:`directive: ${n}`};return{shouldSkip:!1}}function ra(e){return{shouldSkip:!1}}function sa(e){let t=e.text.toLowerCase(),n=["copyright","license","licensed under","spdx-license-identifier","all rights reserved","mit license","apache license","gnu general public","bsd license"];for(let o of n)if(t.includes(o))return{shouldSkip:!0,reason:"copyright/license"};return{shouldSkip:!1}}function ia(e){let t=e.text.toUpperCase(),n=["TODO","FIXME","HACK","XXX","NOTE","REVIEW"];for(let o of n)if(t.includes(o))return{shouldSkip:!0,reason:`todo marker: ${o}`};return{shouldSkip:!1}}var aa=[ta,na,oa,sa,ia,ra];function Gt(e){return e.filter(t=>{for(let n of aa)if(n(t).shouldSkip)return!1;return!0})}var ca=process.env.COMMENT_CHECKER_DEBUG==="1",ua=Ue.join((0,Pr.tmpdir)(),"comment-checker-debug.log");function V(...e){if(ca){let t=`[${new Date().toISOString()}] [comment-checker] ${e.map(n=>typeof n=="object"?JSON.stringify(n,null,2):String(n)).join(" ")}
585
+ `;vr.appendFileSync(ua,t)}}function la(e){let t=Ue.extname(e).toLowerCase();return Ht[t]}function Bt(e,t){let n=la(t);if(!n)return V("unsupported language for:",t),[];let o=Ft[n];if(!o)return V("no pattern for language:",n),[];let r=[],s=e.split(`
586
586
  `);o.lastIndex=0;let i;for(;(i=o.exec(e))!==null;){let a=i.index,c=i[0],l=e.substring(0,a).split(`
587
587
  `).length,d="line",p=!1;c.startsWith("/*")||c.startsWith("<!--")?d="block":(c.startsWith("'''")||c.startsWith('"""')||c.startsWith("=begin"))&&(d="docstring",p=!0),r.push({text:c.trim(),lineNumber:l,filePath:t,commentType:d,isDocstring:p})}return r}function da(e,t){return Bt(e,t)}function xr(e,t,n){let o=Bt(e,t);if(n){let r=Bt(n,t),s=new Set(r.map(i=>i.text));return o.filter(i=>!s.has(i.text))}return o}function pa(e){if(e.length===0)return"";let t=new Map;for(let o of e){let r=t.get(o.filePath)||[];r.push(o),t.set(o.filePath,r)}let n=jt;for(let[o,r]of t){n+=`
588
588
  File: ${o}
589
589
  `;for(let s of r){let i=s.isDocstring?"docstring":s.commentType;n+=` Line ${s.lineNumber} (${i}): ${s.text.substring(0,100)}${s.text.length>100?"...":""}
590
- `}}return n}function ma(e,t,n,o,r){let s=[];if(t)s=da(t,e);else if(o)s=xr(o,e,n);else if(r&&r.length>0)for(let a of r){let c=xr(a.new_string,e,a.old_string);s.push(...c)}let i=Gt(s);return J(`found ${s.length} comments, ${i.length} flagged after filtering`),i.length===0?{hasComments:!1,count:0,comments:[]}:{hasComments:!0,count:i.length,message:pa(i),comments:i}}var he=new Map,fa=6e4;function ga(){let e=Date.now();for(let[t,n]of he)e-n.timestamp>fa&&he.delete(t)}var wr=!1;function br(e){return J("createCommentCheckerHook called",{config:e}),wr||(wr=!0,setInterval(ga,1e4)),{preToolUse:t=>{let n=t.tool_name.toLowerCase();if(n!=="write"&&n!=="edit"&&n!=="multiedit")return null;let o=t.tool_input.file_path??t.tool_input.filePath??t.tool_input.path,r=t.tool_input.content,s=t.tool_input.old_string??t.tool_input.oldString,i=t.tool_input.new_string??t.tool_input.newString,a=t.tool_input.edits;if(!o)return null;let c=`${t.session_id}-${Date.now()}-${Math.random().toString(36).slice(2)}`;return J("registering pendingCall:",{callId:c,filePath:o,tool:n}),he.set(c,{filePath:o,content:r,oldString:s,newString:i,edits:a,tool:n,sessionId:t.session_id,timestamp:Date.now()}),null},postToolUse:t=>{let n=t.tool_name.toLowerCase();if(n!=="write"&&n!=="edit"&&n!=="multiedit")return null;let o,r;for(let[i,a]of he)if(a.sessionId===t.session_id&&a.tool===n){o=a,r=i;break}if(!o){let i=t.tool_input.file_path??t.tool_input.filePath??t.tool_input.path;if(!i)return null;o={filePath:i,content:t.tool_input.content,oldString:t.tool_input.old_string??t.tool_input.oldString,newString:t.tool_input.new_string??t.tool_input.newString,edits:t.tool_input.edits,tool:n,sessionId:t.session_id,timestamp:Date.now()}}if(r&&he.delete(r),t.tool_response){let i=t.tool_response.toLowerCase();if(i.includes("error:")||i.includes("failed to")||i.includes("could not")||i.startsWith("error"))return J("skipping due to tool failure in response"),null}let s=ma(o.filePath,o.content,o.oldString,o.newString,o.edits);return s.hasComments&&s.message?(J("detected comments, returning message"),e?.customPrompt||s.message):null}}}var Fr=M(require("fs"),1),Hr=M(require("path"),1),Gr=require("os");var Lr=[/(\d+)\s*tokens?\s*>\s*(\d+)\s*maximum/i,/prompt.*?(\d+).*?tokens.*?exceeds.*?(\d+)/i,/(\d+).*?tokens.*?limit.*?(\d+)/i,/context.*?length.*?(\d+).*?maximum.*?(\d+)/i,/max.*?context.*?(\d+).*?but.*?(\d+)/i],Mr=["prompt is too long","is too long","context_length_exceeded","max_tokens","token limit","context length","too many tokens","non-empty content"],ha=[/thinking.*first block/i,/first block.*thinking/i,/must.*start.*thinking/i,/thinking.*redacted_thinking/i,/expected.*thinking.*found/i,/thinking.*disabled.*cannot.*contain/i],Ta=/messages\.(\d+)/;function Ea(e){return ha.some(t=>t.test(e))}function Yt(e){for(let t of Lr){let n=e.match(t);if(n){let o=parseInt(n[1],10),r=parseInt(n[2],10);return o>r?{current:o,max:r}:{current:r,max:o}}}return null}function Dr(e){let t=e.match(Ta);if(t)return parseInt(t[1],10)}function se(e){if(Ea(e))return!1;let t=e.toLowerCase();return Mr.some(n=>t.includes(n.toLowerCase()))}function $e(e){if(typeof e=="string"){if(e.toLowerCase().includes("non-empty content"))return{currentTokens:0,maxTokens:0,errorType:"non-empty content",messageIndex:Dr(e)};if(se(e)){let u=Yt(e);return{currentTokens:u?.current??0,maxTokens:u?.max??0,errorType:"token_limit_exceeded_string"}}return null}if(!e||typeof e!="object")return null;let t=e,n=[],o=t.data,r=o?.responseBody,s=t.message,i=t.error,a=i?.error;if(typeof r=="string"&&n.push(r),typeof s=="string"&&n.push(s),typeof i?.message=="string"&&n.push(i.message),typeof t.body=="string"&&n.push(t.body),typeof t.details=="string"&&n.push(t.details),typeof t.reason=="string"&&n.push(t.reason),typeof t.description=="string"&&n.push(t.description),typeof a?.message=="string"&&n.push(a.message),typeof o?.message=="string"&&n.push(o.message),typeof o?.error=="string"&&n.push(o.error),n.length===0)try{let u=JSON.stringify(t);se(u)&&n.push(u)}catch{}let c=n.join(" ");if(!se(c))return null;if(typeof r=="string")try{let u=[/data:\s*(\{[\s\S]*\})\s*$/m,/(\{"type"\s*:\s*"error"[\s\S]*\})/,/(\{[\s\S]*"error"[\s\S]*\})/];for(let d of u){let p=r.match(d);if(p)try{let f=JSON.parse(p[1]),g=f.error?.message||"",E=Yt(g);if(E)return{currentTokens:E.current,maxTokens:E.max,requestId:f.request_id,errorType:f.error?.type||"token_limit_exceeded"}}catch{}}let l=JSON.parse(r);if(typeof l.message=="string"&&se(l.message))return{currentTokens:0,maxTokens:0,errorType:"bedrock_input_too_long"}}catch{}for(let u of n){let l=Yt(u);if(l)return{currentTokens:l.current,maxTokens:l.max,errorType:"token_limit_exceeded"}}return c.toLowerCase().includes("non-empty content")?{currentTokens:0,maxTokens:0,errorType:"non-empty content",messageIndex:Dr(c)}:se(c)?{currentTokens:0,maxTokens:0,errorType:"token_limit_exceeded_unknown"}:null}function Wt(e){return se(e)}var Kt=`CONTEXT WINDOW LIMIT REACHED - IMMEDIATE ACTION REQUIRED
590
+ `}}return n}function ma(e,t,n,o,r){let s=[];if(t)s=da(t,e);else if(o)s=xr(o,e,n);else if(r&&r.length>0)for(let a of r){let c=xr(a.new_string,e,a.old_string);s.push(...c)}let i=Gt(s);return V(`found ${s.length} comments, ${i.length} flagged after filtering`),i.length===0?{hasComments:!1,count:0,comments:[]}:{hasComments:!0,count:i.length,message:pa(i),comments:i}}var he=new Map,fa=6e4;function ga(){let e=Date.now();for(let[t,n]of he)e-n.timestamp>fa&&he.delete(t)}var wr=!1;function br(e){return V("createCommentCheckerHook called",{config:e}),wr||(wr=!0,setInterval(ga,1e4)),{preToolUse:t=>{let n=t.tool_name.toLowerCase();if(n!=="write"&&n!=="edit"&&n!=="multiedit")return null;let o=t.tool_input.file_path??t.tool_input.filePath??t.tool_input.path,r=t.tool_input.content,s=t.tool_input.old_string??t.tool_input.oldString,i=t.tool_input.new_string??t.tool_input.newString,a=t.tool_input.edits;if(!o)return null;let c=`${t.session_id}-${Date.now()}-${Math.random().toString(36).slice(2)}`;return V("registering pendingCall:",{callId:c,filePath:o,tool:n}),he.set(c,{filePath:o,content:r,oldString:s,newString:i,edits:a,tool:n,sessionId:t.session_id,timestamp:Date.now()}),null},postToolUse:t=>{let n=t.tool_name.toLowerCase();if(n!=="write"&&n!=="edit"&&n!=="multiedit")return null;let o,r;for(let[i,a]of he)if(a.sessionId===t.session_id&&a.tool===n){o=a,r=i;break}if(!o){let i=t.tool_input.file_path??t.tool_input.filePath??t.tool_input.path;if(!i)return null;o={filePath:i,content:t.tool_input.content,oldString:t.tool_input.old_string??t.tool_input.oldString,newString:t.tool_input.new_string??t.tool_input.newString,edits:t.tool_input.edits,tool:n,sessionId:t.session_id,timestamp:Date.now()}}if(r&&he.delete(r),t.tool_response){let i=t.tool_response.toLowerCase();if(i.includes("error:")||i.includes("failed to")||i.includes("could not")||i.startsWith("error"))return V("skipping due to tool failure in response"),null}let s=ma(o.filePath,o.content,o.oldString,o.newString,o.edits);return s.hasComments&&s.message?(V("detected comments, returning message"),e?.customPrompt||s.message):null}}}var Fr=b(require("fs"),1),Hr=b(require("path"),1),Gr=require("os");var Lr=[/(\d+)\s*tokens?\s*>\s*(\d+)\s*maximum/i,/prompt.*?(\d+).*?tokens.*?exceeds.*?(\d+)/i,/(\d+).*?tokens.*?limit.*?(\d+)/i,/context.*?length.*?(\d+).*?maximum.*?(\d+)/i,/max.*?context.*?(\d+).*?but.*?(\d+)/i],Mr=["prompt is too long","is too long","context_length_exceeded","max_tokens","token limit","context length","too many tokens","non-empty content"],ha=[/thinking.*first block/i,/first block.*thinking/i,/must.*start.*thinking/i,/thinking.*redacted_thinking/i,/expected.*thinking.*found/i,/thinking.*disabled.*cannot.*contain/i],Ta=/messages\.(\d+)/;function Ea(e){return ha.some(t=>t.test(e))}function Yt(e){for(let t of Lr){let n=e.match(t);if(n){let o=parseInt(n[1],10),r=parseInt(n[2],10);return o>r?{current:o,max:r}:{current:r,max:o}}}return null}function Dr(e){let t=e.match(Ta);if(t)return parseInt(t[1],10)}function se(e){if(Ea(e))return!1;let t=e.toLowerCase();return Mr.some(n=>t.includes(n.toLowerCase()))}function $e(e){if(typeof e=="string"){if(e.toLowerCase().includes("non-empty content"))return{currentTokens:0,maxTokens:0,errorType:"non-empty content",messageIndex:Dr(e)};if(se(e)){let u=Yt(e);return{currentTokens:u?.current??0,maxTokens:u?.max??0,errorType:"token_limit_exceeded_string"}}return null}if(!e||typeof e!="object")return null;let t=e,n=[],o=t.data,r=o?.responseBody,s=t.message,i=t.error,a=i?.error;if(typeof r=="string"&&n.push(r),typeof s=="string"&&n.push(s),typeof i?.message=="string"&&n.push(i.message),typeof t.body=="string"&&n.push(t.body),typeof t.details=="string"&&n.push(t.details),typeof t.reason=="string"&&n.push(t.reason),typeof t.description=="string"&&n.push(t.description),typeof a?.message=="string"&&n.push(a.message),typeof o?.message=="string"&&n.push(o.message),typeof o?.error=="string"&&n.push(o.error),n.length===0)try{let u=JSON.stringify(t);se(u)&&n.push(u)}catch{}let c=n.join(" ");if(!se(c))return null;if(typeof r=="string")try{let u=[/data:\s*(\{[\s\S]*\})\s*$/m,/(\{"type"\s*:\s*"error"[\s\S]*\})/,/(\{[\s\S]*"error"[\s\S]*\})/];for(let d of u){let p=r.match(d);if(p)try{let f=JSON.parse(p[1]),g=f.error?.message||"",E=Yt(g);if(E)return{currentTokens:E.current,maxTokens:E.max,requestId:f.request_id,errorType:f.error?.type||"token_limit_exceeded"}}catch{}}let l=JSON.parse(r);if(typeof l.message=="string"&&se(l.message))return{currentTokens:0,maxTokens:0,errorType:"bedrock_input_too_long"}}catch{}for(let u of n){let l=Yt(u);if(l)return{currentTokens:l.current,maxTokens:l.max,errorType:"token_limit_exceeded"}}return c.toLowerCase().includes("non-empty content")?{currentTokens:0,maxTokens:0,errorType:"non-empty content",messageIndex:Dr(c)}:se(c)?{currentTokens:0,maxTokens:0,errorType:"token_limit_exceeded_unknown"}:null}function Wt(e){return se(e)}var Kt=`CONTEXT WINDOW LIMIT REACHED - IMMEDIATE ACTION REQUIRED
591
591
 
592
592
  The conversation has exceeded the model's context window limit. To continue working effectively, you must take one of these actions:
593
593
 
@@ -640,7 +640,7 @@ Token Details:
640
640
  - Current: ${e.currentTokens.toLocaleString()} tokens
641
641
  - Maximum: ${e.maxTokens.toLocaleString()} tokens
642
642
  - Over limit by: ${(e.currentTokens-e.maxTokens).toLocaleString()} tokens
643
- `),{message:o,errorType:e?.errorType||"token_limit_exceeded"}}return{message:Vt,errorType:e?.errorType||"token_limit_exceeded"}}var zr=M(require("fs"),1),Xr=M(require("path"),1),Qr=require("os");var Xt=process.env.ANTHROPIC_1M_CONTEXT==="true"||process.env.VERTEX_ANTHROPIC_1M_CONTEXT==="true"?1e6:2e5,He=4,Qt=`CONTEXT WINDOW WARNING - APPROACHING LIMIT
643
+ `),{message:o,errorType:e?.errorType||"token_limit_exceeded"}}return{message:Vt,errorType:e?.errorType||"token_limit_exceeded"}}var zr=b(require("fs"),1),Xr=b(require("path"),1),Qr=require("os");var Xt=process.env.ANTHROPIC_1M_CONTEXT==="true"||process.env.VERTEX_ANTHROPIC_1M_CONTEXT==="true"?1e6:2e5,He=4,Qt=`CONTEXT WINDOW WARNING - APPROACHING LIMIT
644
644
 
645
645
  Your context usage is getting high. Consider these actions to prevent hitting the limit:
646
646
 
@@ -680,7 +680,7 @@ Your context usage is critically high. Immediate action required:
680
680
  WARNING: Further messages may fail if context is not reduced.
681
681
  Action required: Run /compact now.
682
682
  `;var Oa=process.env.PREEMPTIVE_COMPACTION_DEBUG==="1",Ra=Xr.join((0,Qr.tmpdir)(),"preemptive-compaction-debug.log");function ie(...e){if(Oa){let t=`[${new Date().toISOString()}] [preemptive-compaction] ${e.map(n=>typeof n=="object"?JSON.stringify(n,null,2):String(n)).join(" ")}
683
- `;zr.appendFileSync(Ra,t)}}var Ge=new Map;function Ia(){let e=Date.now(),t=1800*1e3;for(let[n,o]of Ge)e-o.lastWarningTime>t&&Ge.delete(n)}var Wr=!1;function Zr(e){return Math.ceil(e.length/He)}function Ca(e,t){let n=t?.warningThreshold??.85,o=t?.criticalThreshold??.95,r=Xt,s=Zr(e),i=s/r,a=i>=n,c=i>=o,u="none";return c?u="compact":a&&(u="warn"),{totalTokens:s,usageRatio:i,isWarning:a,isCritical:c,action:u}}function Be(e){let t=Ge.get(e);return t||(t={lastWarningTime:0,warningCount:0,estimatedTokens:0},Ge.set(e,t)),t}function _a(e,t){let n=Be(e),o=t?.cooldownMs??6e4,r=t?.maxWarnings??3,s=Date.now();return s-n.lastWarningTime<o?(ie("skipping warning - cooldown active",{sessionId:e,elapsed:s-n.lastWarningTime,cooldown:o}),!1):n.warningCount>=r?(ie("skipping warning - max reached",{sessionId:e,warningCount:n.warningCount,maxWarnings:r}),!1):!0}function Aa(e){let t=Be(e);t.lastWarningTime=Date.now(),t.warningCount++}function es(e){return ie("createPreemptiveCompactionHook called",{config:e}),e?.enabled===!1?{postToolUse:()=>null,stop:()=>null}:(Wr||(Wr=!0,setInterval(Ia,300*1e3)),{postToolUse:t=>{if(!t.tool_response)return null;let n=t.tool_name.toLowerCase();if(!["read","grep","glob","bash","webfetch"].includes(n))return null;let r=Zr(t.tool_response),s=Be(t.session_id);s.estimatedTokens+=r,ie("tracking tool output",{tool:n,responseTokens:r,cumulativeTokens:s.estimatedTokens});let i=Ca("x".repeat(s.estimatedTokens*He),e);return!i.isWarning||!_a(t.session_id,e)?null:(Aa(t.session_id),ie("injecting context warning",{sessionId:t.session_id,usageRatio:i.usageRatio,isCritical:i.isCritical}),e?.customMessage?e.customMessage:i.isCritical?Zt:Qt)},stop:t=>{let n=Be(t.session_id);return n.warningCount>0&&(ie("resetting warning count on stop",{sessionId:t.session_id,previousCount:n.warningCount}),n.warningCount=0),null}})}var A=require("fs"),ns=require("path");var en=require("path"),ts=require("os"),Na=(0,en.join)((0,ts.homedir)(),".olympus"),Ye=(0,en.join)(Na,"agent-usage-reminder"),tn=new Set(["grep","safe_grep","glob","safe_glob","webfetch","context7_resolve-library-id","context7_query-docs","websearch_web_search_exa","context7_get-library-docs","grep_app_searchgithub"]),nn=new Set(["task","call_omo_agent","olympus_task"]),on=`
683
+ `;zr.appendFileSync(Ra,t)}}var Ge=new Map;function Ia(){let e=Date.now(),t=1800*1e3;for(let[n,o]of Ge)e-o.lastWarningTime>t&&Ge.delete(n)}var Wr=!1;function Zr(e){return Math.ceil(e.length/He)}function Ca(e,t){let n=t?.warningThreshold??.85,o=t?.criticalThreshold??.95,r=Xt,s=Zr(e),i=s/r,a=i>=n,c=i>=o,u="none";return c?u="compact":a&&(u="warn"),{totalTokens:s,usageRatio:i,isWarning:a,isCritical:c,action:u}}function Be(e){let t=Ge.get(e);return t||(t={lastWarningTime:0,warningCount:0,estimatedTokens:0},Ge.set(e,t)),t}function _a(e,t){let n=Be(e),o=t?.cooldownMs??6e4,r=t?.maxWarnings??3,s=Date.now();return s-n.lastWarningTime<o?(ie("skipping warning - cooldown active",{sessionId:e,elapsed:s-n.lastWarningTime,cooldown:o}),!1):n.warningCount>=r?(ie("skipping warning - max reached",{sessionId:e,warningCount:n.warningCount,maxWarnings:r}),!1):!0}function Aa(e){let t=Be(e);t.lastWarningTime=Date.now(),t.warningCount++}function es(e){return ie("createPreemptiveCompactionHook called",{config:e}),e?.enabled===!1?{postToolUse:()=>null,stop:()=>null}:(Wr||(Wr=!0,setInterval(Ia,300*1e3)),{postToolUse:t=>{if(!t.tool_response)return null;let n=t.tool_name.toLowerCase();if(!["read","grep","glob","bash","webfetch"].includes(n))return null;let r=Zr(t.tool_response),s=Be(t.session_id);s.estimatedTokens+=r,ie("tracking tool output",{tool:n,responseTokens:r,cumulativeTokens:s.estimatedTokens});let i=Ca("x".repeat(s.estimatedTokens*He),e);return!i.isWarning||!_a(t.session_id,e)?null:(Aa(t.session_id),ie("injecting context warning",{sessionId:t.session_id,usageRatio:i.usageRatio,isCritical:i.isCritical}),e?.customMessage?e.customMessage:i.isCritical?Zt:Qt)},stop:t=>{let n=Be(t.session_id);return n.warningCount>0&&(ie("resetting warning count on stop",{sessionId:t.session_id,previousCount:n.warningCount}),n.warningCount=0),null}})}var C=require("fs"),ns=require("path");var en=require("path"),ts=require("os"),Na=(0,en.join)((0,ts.homedir)(),".olympus"),Ye=(0,en.join)(Na,"agent-usage-reminder"),tn=new Set(["grep","safe_grep","glob","safe_glob","webfetch","context7_resolve-library-id","context7_query-docs","websearch_web_search_exa","context7_get-library-docs","grep_app_searchgithub"]),nn=new Set(["task","call_omo_agent","olympus_task"]),on=`
684
684
  [Agent Usage Reminder]
685
685
 
686
686
  You called a search/fetch tool directly without leveraging specialized agents.
@@ -704,7 +704,7 @@ WHY:
704
704
  - Reduces context window usage in main session
705
705
 
706
706
  ALWAYS prefer: Multiple parallel Task calls > Direct tool calls
707
- `;function rn(e){return(0,ns.join)(Ye,`${e}.json`)}function sn(e){let t=rn(e);if(!(0,A.existsSync)(t))return null;try{let n=(0,A.readFileSync)(t,"utf-8");return JSON.parse(n)}catch{return null}}function We(e){(0,A.existsSync)(Ye)||(0,A.mkdirSync)(Ye,{recursive:!0});let t=rn(e.sessionID);(0,A.writeFileSync)(t,JSON.stringify(e,null,2))}function an(e){let t=rn(e);(0,A.existsSync)(t)&&(0,A.unlinkSync)(t)}function xa(e){let t=e||process.cwd();return le(t)?.active?{active:!0,mode:"ascent"}:ne(t)?.active?{active:!0,mode:"olympus"}:Y(t)?.active?{active:!0,mode:"ultrawork"}:{active:!1,mode:"none"}}function wa(e){if(!e||typeof e!="object")return null;let t=e;return t.file_path||t.filePath||t.path}function va(e,t){if(e<3)return null;let n=e>=5?"CRITICAL":"WARNING";return`<conductor-violation severity="${n}">
707
+ `;function rn(e){return(0,ns.join)(Ye,`${e}.json`)}function sn(e){let t=rn(e);if(!(0,C.existsSync)(t))return null;try{let n=(0,C.readFileSync)(t,"utf-8");return JSON.parse(n)}catch{return null}}function We(e){(0,C.existsSync)(Ye)||(0,C.mkdirSync)(Ye,{recursive:!0});let t=rn(e.sessionID);(0,C.writeFileSync)(t,JSON.stringify(e,null,2))}function an(e){let t=rn(e);(0,C.existsSync)(t)&&(0,C.unlinkSync)(t)}function xa(e){let t=e||process.cwd();return le(t)?.active?{active:!0,mode:"ascent"}:ne(t)?.active?{active:!0,mode:"olympus"}:G(t)?.active?{active:!0,mode:"ultrawork"}:{active:!1,mode:"none"}}function wa(e){if(!e||typeof e!="object")return null;let t=e;return t.file_path||t.filePath||t.path}function va(e,t){if(e<3)return null;let n=e>=5?"CRITICAL":"WARNING";return`<conductor-violation severity="${n}">
708
708
 
709
709
  [${n}: CONDUCTOR MODE VIOLATION - ${t.toUpperCase()} ACTIVE]
710
710
 
@@ -730,7 +730,7 @@ ${e>=5?"**CRITICAL**: Too many direct operations. Your next action MUST be deleg
730
730
 
731
731
  ---
732
732
 
733
- `}function os(){let e=new Map,t=new Map;function n(c){if(!e.has(c)){let l=sn(c)??{sessionID:c,agentUsed:!1,reminderCount:0,updatedAt:Date.now()};e.set(c,l)}return e.get(c)}function o(c){let u=n(c);u.agentUsed=!0,u.updatedAt=Date.now(),We(u)}function r(c){e.delete(c),an(c),t.delete(c)}function s(c,u,l){let d=t.get(c)||{consecutiveCount:0,lastToolName:"",lastFilePath:"",sessionId:c};return u.toLowerCase()==="task"?(d.consecutiveCount=0,t.set(c,d),0):(["edit","write","multiedit"].includes(u.toLowerCase())&&(d.consecutiveCount++,d.lastToolName=u,d.lastFilePath=l,t.set(c,d)),d.consecutiveCount)}return{"tool.execute.after":async(c,u)=>{let{tool:l,sessionID:d}=c,p=l.toLowerCase();if(nn.has(p)){o(d),s(d,p,"");return}let f=c.properties||{},g=wa(f),E=s(d,p,g||""),b=xa();if(b.active){let w=va(E,b.mode);if(w){u.output=w+u.output;return}}if(!tn.has(p))return;let x=n(d);x.agentUsed||(u.output+=on,x.reminderCount++,x.updatedAt=Date.now(),We(x))},event:async({event:c})=>{let u=c.properties;if(c.type==="session.deleted"){let l=u?.info;l?.id&&r(l.id)}if(c.type==="session.compacted"){let l=u?.sessionID??u?.info?.id;l&&r(l)}}}}function rs(){let e=process.cwd(),t=Nr();m({name:"editErrorRecovery",event:"PostToolUse",matcher:/^edit$/i,priority:10,handler:async a=>{if(!a.toolName||!a.toolOutput)return{continue:!0};let c=t.afterToolExecute({tool:a.toolName,sessionId:a.sessionId||"",callId:""},{title:"",output:String(a.toolOutput),metadata:void 0});return c.output!==String(a.toolOutput)?{continue:!0,message:c.output.substring(String(a.toolOutput).length)}:{continue:!0}}});let n=br();m({name:"commentChecker",event:"PostToolUse",matcher:/^(write|edit|multiedit)$/i,priority:20,handler:async a=>{if(!a.toolName)return{continue:!0};let c=n.postToolUse({tool_name:a.toolName,session_id:a.sessionId||"",tool_input:a.toolInput||{},tool_response:a.toolOutput?String(a.toolOutput):void 0});return c?{continue:!0,message:c}:{continue:!0}}});let o=Yr();m({name:"contextWindowLimitRecovery",event:"PostToolUse",priority:30,handler:async a=>{if(!a.toolName)return{continue:!0};let c=o.postToolUse({tool_name:a.toolName,session_id:a.sessionId||"",tool_input:a.toolInput||{},tool_response:a.toolOutput?String(a.toolOutput):void 0});return c?{continue:!0,message:c}:{continue:!0}}});let r=es();m({name:"preemptiveCompaction",event:"PostToolUse",matcher:/^(read|grep|glob|bash|webfetch)$/i,priority:40,handler:async a=>{if(!a.toolName)return{continue:!0};let c=r.postToolUse({tool_name:a.toolName,session_id:a.sessionId||"",tool_input:a.toolInput||{},tool_response:a.toolOutput?String(a.toolOutput):void 0});return c?{continue:!0,message:c}:{continue:!0}}});let s=os();m({name:"agentUsageReminder",event:"PostToolUse",matcher:/^(read|grep|glob|edit|write)$/i,priority:50,handler:async a=>{if(!a.toolName)return{continue:!0};let c={title:"",output:a.toolOutput?String(a.toolOutput):"",metadata:void 0};await s["tool.execute.after"]({tool:a.toolName,sessionID:a.sessionId||"",callID:""},c);let u=a.toolOutput?String(a.toolOutput):"";return c.output!==u?{continue:!0,message:c.output.substring(u.length)}:{continue:!0}}});let i=Le(e);m({name:"olympusOrchestratorPost",event:"PostToolUse",matcher:/^(write|edit|bash|task)$/i,priority:60,handler:async a=>{if(!a.toolName)return{continue:!0};let c=i.postTool(a.toolName,a.toolInput||{},a.toolOutput?String(a.toolOutput):"");return c.continue?c.modifiedOutput?{continue:!0,message:c.modifiedOutput}:c.message?{continue:!0,message:c.message}:{continue:!0}:{continue:!1,reason:c.message}}})}var N=require("fs"),Ke=require("path"),ss=require("os");var Te=class{config;counts=new Map;queues=new Map;constructor(t){this.config=t}getConcurrencyLimit(t){let n=this.config?.modelConcurrency?.[t];if(n!==void 0)return n===0?1/0:n;let o=t.split("/")[0],r=this.config?.providerConcurrency?.[o];if(r!==void 0)return r===0?1/0:r;let s=this.config?.defaultConcurrency;return s!==void 0?s===0?1/0:s:5}async acquire(t){let n=this.getConcurrencyLimit(t);if(n===1/0)return;let o=this.counts.get(t)??0;if(o<n){this.counts.set(t,o+1);return}return new Promise(r=>{let s=this.queues.get(t)??[];s.push(r),this.queues.set(t,s)})}release(t){if(this.getConcurrencyLimit(t)===1/0)return;let o=this.queues.get(t);if(o&&o.length>0)o.shift()();else{let r=this.counts.get(t)??0;r>0&&this.counts.set(t,r-1)}}getCount(t){return this.counts.get(t)??0}getQueueLength(t){return this.queues.get(t)?.length??0}isAtCapacity(t){let n=this.getConcurrencyLimit(t);return n===1/0?!1:(this.counts.get(t)??0)>=n}getActiveCounts(){return new Map(this.counts)}clear(){this.counts.clear(),this.queues.clear()}};var Pa=1800*1e3,ae=(0,Ke.join)((0,ss.homedir)(),".claude",".olympus","background-tasks"),Ve=class{tasks=new Map;notifications=new Map;concurrencyManager;config;pruneInterval;constructor(t){this.config=t??{},this.concurrencyManager=new Te(t),this.ensureStorageDir(),this.loadPersistedTasks(),this.startPruning()}ensureStorageDir(){(0,N.existsSync)(ae)||(0,N.mkdirSync)(ae,{recursive:!0})}generateTaskId(){let t=Date.now().toString(36),n=Math.random().toString(36).substring(2,8);return`bg_${t}${n}`}getTaskPath(t){return(0,Ke.join)(ae,`${t}.json`)}persistTask(t){let n=this.getTaskPath(t.id);(0,N.writeFileSync)(n,JSON.stringify(t,null,2))}unpersistTask(t){let n=this.getTaskPath(t);(0,N.existsSync)(n)&&(0,N.unlinkSync)(n)}loadPersistedTasks(){if((0,N.existsSync)(ae))try{let{readdirSync:t}=require("fs"),n=t(ae);for(let o of n)if(o.endsWith(".json"))try{let r=(0,Ke.join)(ae,o),s=(0,N.readFileSync)(r,"utf-8"),i=JSON.parse(s);i.startedAt=new Date(i.startedAt),i.completedAt&&(i.completedAt=new Date(i.completedAt)),i.progress?.lastUpdate&&(i.progress.lastUpdate=new Date(i.progress.lastUpdate)),i.progress?.lastMessageAt&&(i.progress.lastMessageAt=new Date(i.progress.lastMessageAt)),this.tasks.set(i.id,i)}catch{}}catch{}}startPruning(){this.pruneInterval||(this.pruneInterval=setInterval(()=>{this.pruneStaleTasksAndNotifications()},6e4),this.pruneInterval.unref&&this.pruneInterval.unref())}stopPruning(){this.pruneInterval&&(clearInterval(this.pruneInterval),this.pruneInterval=void 0)}pruneStaleTasksAndNotifications(){let t=Date.now(),n=this.config.taskTimeoutMs??Pa;for(let[o,r]of this.tasks.entries())t-r.startedAt.getTime()>n&&r.status==="running"&&(r.status="error",r.error=`Task timed out after ${Math.round(n/6e4)} minutes`,r.completedAt=new Date,r.concurrencyKey&&this.concurrencyManager.release(r.concurrencyKey),this.clearNotificationsForTask(o),this.unpersistTask(o),this.tasks.delete(o));for(let[o,r]of this.notifications.entries()){let s=r.filter(i=>t-i.startedAt.getTime()<=n);s.length===0?this.notifications.delete(o):s.length!==r.length&&this.notifications.set(o,s)}}async launch(t){let n=t.agent,o=this.config.maxTotalTasks??10;if(Array.from(this.tasks.values()).filter(c=>c.status==="running").length>=o)throw new Error(`Maximum concurrent background tasks (${o}) reached. Wait for some tasks to complete.`);await this.concurrencyManager.acquire(n);let s=this.generateTaskId(),i=`ses_${this.generateTaskId()}`,a={id:s,sessionId:i,parentSessionId:t.parentSessionId,description:t.description,prompt:t.prompt,agent:t.agent,status:"running",startedAt:new Date,progress:{toolCalls:0,lastUpdate:new Date},concurrencyKey:n};return this.tasks.set(s,a),this.persistTask(a),a}async resume(t){let n=this.findBySession(t.sessionId);if(!n)throw new Error(`Task not found for session: ${t.sessionId}`);return n.status="running",n.completedAt=void 0,n.error=void 0,n.parentSessionId=t.parentSessionId,n.progress||(n.progress={toolCalls:0,lastUpdate:new Date}),n.progress.lastUpdate=new Date,this.persistTask(n),n}getTask(t){return this.tasks.get(t)}findBySession(t){for(let n of this.tasks.values())if(n.sessionId===t)return n}getTasksByParentSession(t){let n=[];for(let o of this.tasks.values())o.parentSessionId===t&&n.push(o);return n}getAllTasks(){return Array.from(this.tasks.values())}getRunningTasks(){return Array.from(this.tasks.values()).filter(t=>t.status==="running")}updateTaskStatus(t,n,o,r){let s=this.tasks.get(t);s&&(s.status=n,o&&(s.result=o),r&&(s.error=r),(n==="completed"||n==="error"||n==="cancelled")&&(s.completedAt=new Date,s.concurrencyKey&&this.concurrencyManager.release(s.concurrencyKey),this.markForNotification(s)),this.persistTask(s))}updateTaskProgress(t,n){let o=this.tasks.get(t);o&&(o.progress||(o.progress={toolCalls:0,lastUpdate:new Date}),Object.assign(o.progress,n,{lastUpdate:new Date}),this.persistTask(o))}markForNotification(t){let n=this.notifications.get(t.parentSessionId)??[];n.push(t),this.notifications.set(t.parentSessionId,n)}getPendingNotifications(t){return this.notifications.get(t)??[]}clearNotifications(t){this.notifications.delete(t)}clearNotificationsForTask(t){for(let[n,o]of this.notifications.entries()){let r=o.filter(s=>s.id!==t);r.length===0?this.notifications.delete(n):this.notifications.set(n,r)}}removeTask(t){let n=this.tasks.get(t);n?.concurrencyKey&&this.concurrencyManager.release(n.concurrencyKey),this.clearNotificationsForTask(t),this.unpersistTask(t),this.tasks.delete(t)}formatDuration(t,n){let o=(n??new Date).getTime()-t.getTime(),r=Math.floor(o/1e3),s=Math.floor(r/60),i=Math.floor(s/60);return i>0?`${i}h ${s%60}m ${r%60}s`:s>0?`${s}m ${r%60}s`:`${r}s`}getStatusSummary(){let t=this.getRunningTasks(),n=this.getAllTasks();if(n.length===0)return"No background tasks.";let o=[`Background Tasks: ${t.length} running, ${n.length} total`,""];for(let r of n){let s=this.formatDuration(r.startedAt,r.completedAt),i=r.status.toUpperCase(),a=r.progress?` (${r.progress.toolCalls} tools)`:"";o.push(` [${i}] ${r.description} - ${s}${a}`),r.error&&o.push(` Error: ${r.error}`)}return o.join(`
733
+ `}function os(){let e=new Map,t=new Map;function n(c){if(!e.has(c)){let l=sn(c)??{sessionID:c,agentUsed:!1,reminderCount:0,updatedAt:Date.now()};e.set(c,l)}return e.get(c)}function o(c){let u=n(c);u.agentUsed=!0,u.updatedAt=Date.now(),We(u)}function r(c){e.delete(c),an(c),t.delete(c)}function s(c,u,l){let d=t.get(c)||{consecutiveCount:0,lastToolName:"",lastFilePath:"",sessionId:c};return u.toLowerCase()==="task"?(d.consecutiveCount=0,t.set(c,d),0):(["edit","write","multiedit"].includes(u.toLowerCase())&&(d.consecutiveCount++,d.lastToolName=u,d.lastFilePath=l,t.set(c,d)),d.consecutiveCount)}return{"tool.execute.after":async(c,u)=>{let{tool:l,sessionID:d}=c,p=l.toLowerCase();if(nn.has(p)){o(d),s(d,p,"");return}let f=c.properties||{},g=wa(f),E=s(d,p,g||""),v=xa();if(v.active){let N=va(E,v.mode);if(N){u.output=N+u.output;return}}if(!tn.has(p))return;let A=n(d);A.agentUsed||(u.output+=on,A.reminderCount++,A.updatedAt=Date.now(),We(A))},event:async({event:c})=>{let u=c.properties;if(c.type==="session.deleted"){let l=u?.info;l?.id&&r(l.id)}if(c.type==="session.compacted"){let l=u?.sessionID??u?.info?.id;l&&r(l)}}}}function rs(){let e=process.cwd(),t=Nr();m({name:"editErrorRecovery",event:"PostToolUse",matcher:/^edit$/i,priority:10,handler:async a=>{if(!a.toolName||!a.toolOutput)return{continue:!0};let c=t.afterToolExecute({tool:a.toolName,sessionId:a.sessionId||"",callId:""},{title:"",output:String(a.toolOutput),metadata:void 0});return c.output!==String(a.toolOutput)?{continue:!0,message:c.output.substring(String(a.toolOutput).length)}:{continue:!0}}});let n=br();m({name:"commentChecker",event:"PostToolUse",matcher:/^(write|edit|multiedit)$/i,priority:20,handler:async a=>{if(!a.toolName)return{continue:!0};let c=n.postToolUse({tool_name:a.toolName,session_id:a.sessionId||"",tool_input:a.toolInput||{},tool_response:a.toolOutput?String(a.toolOutput):void 0});return c?{continue:!0,message:c}:{continue:!0}}});let o=Yr();m({name:"contextWindowLimitRecovery",event:"PostToolUse",priority:30,handler:async a=>{if(!a.toolName)return{continue:!0};let c=o.postToolUse({tool_name:a.toolName,session_id:a.sessionId||"",tool_input:a.toolInput||{},tool_response:a.toolOutput?String(a.toolOutput):void 0});return c?{continue:!0,message:c}:{continue:!0}}});let r=es();m({name:"preemptiveCompaction",event:"PostToolUse",matcher:/^(read|grep|glob|bash|webfetch)$/i,priority:40,handler:async a=>{if(!a.toolName)return{continue:!0};let c=r.postToolUse({tool_name:a.toolName,session_id:a.sessionId||"",tool_input:a.toolInput||{},tool_response:a.toolOutput?String(a.toolOutput):void 0});return c?{continue:!0,message:c}:{continue:!0}}});let s=os();m({name:"agentUsageReminder",event:"PostToolUse",matcher:/^(read|grep|glob|edit|write)$/i,priority:50,handler:async a=>{if(!a.toolName)return{continue:!0};let c={title:"",output:a.toolOutput?String(a.toolOutput):"",metadata:void 0};await s["tool.execute.after"]({tool:a.toolName,sessionID:a.sessionId||"",callID:""},c);let u=a.toolOutput?String(a.toolOutput):"";return c.output!==u?{continue:!0,message:c.output.substring(u.length)}:{continue:!0}}});let i=Le(e);m({name:"olympusOrchestratorPost",event:"PostToolUse",matcher:/^(write|edit|bash|task)$/i,priority:60,handler:async a=>{if(!a.toolName)return{continue:!0};let c=i.postTool(a.toolName,a.toolInput||{},a.toolOutput?String(a.toolOutput):"");return c.continue?c.modifiedOutput?{continue:!0,message:c.modifiedOutput}:c.message?{continue:!0,message:c.message}:{continue:!0}:{continue:!1,reason:c.message}}})}var _=require("fs"),Ke=require("path"),ss=require("os");var Te=class{config;counts=new Map;queues=new Map;constructor(t){this.config=t}getConcurrencyLimit(t){let n=this.config?.modelConcurrency?.[t];if(n!==void 0)return n===0?1/0:n;let o=t.split("/")[0],r=this.config?.providerConcurrency?.[o];if(r!==void 0)return r===0?1/0:r;let s=this.config?.defaultConcurrency;return s!==void 0?s===0?1/0:s:5}async acquire(t){let n=this.getConcurrencyLimit(t);if(n===1/0)return;let o=this.counts.get(t)??0;if(o<n){this.counts.set(t,o+1);return}return new Promise(r=>{let s=this.queues.get(t)??[];s.push(r),this.queues.set(t,s)})}release(t){if(this.getConcurrencyLimit(t)===1/0)return;let o=this.queues.get(t);if(o&&o.length>0)o.shift()();else{let r=this.counts.get(t)??0;r>0&&this.counts.set(t,r-1)}}getCount(t){return this.counts.get(t)??0}getQueueLength(t){return this.queues.get(t)?.length??0}isAtCapacity(t){let n=this.getConcurrencyLimit(t);return n===1/0?!1:(this.counts.get(t)??0)>=n}getActiveCounts(){return new Map(this.counts)}clear(){this.counts.clear(),this.queues.clear()}};var Pa=1800*1e3,ae=(0,Ke.join)((0,ss.homedir)(),".claude",".olympus","background-tasks"),Ve=class{tasks=new Map;notifications=new Map;concurrencyManager;config;pruneInterval;constructor(t){this.config=t??{},this.concurrencyManager=new Te(t),this.ensureStorageDir(),this.loadPersistedTasks(),this.startPruning()}ensureStorageDir(){(0,_.existsSync)(ae)||(0,_.mkdirSync)(ae,{recursive:!0})}generateTaskId(){let t=Date.now().toString(36),n=Math.random().toString(36).substring(2,8);return`bg_${t}${n}`}getTaskPath(t){return(0,Ke.join)(ae,`${t}.json`)}persistTask(t){let n=this.getTaskPath(t.id);(0,_.writeFileSync)(n,JSON.stringify(t,null,2))}unpersistTask(t){let n=this.getTaskPath(t);(0,_.existsSync)(n)&&(0,_.unlinkSync)(n)}loadPersistedTasks(){if((0,_.existsSync)(ae))try{let{readdirSync:t}=require("fs"),n=t(ae);for(let o of n)if(o.endsWith(".json"))try{let r=(0,Ke.join)(ae,o),s=(0,_.readFileSync)(r,"utf-8"),i=JSON.parse(s);i.startedAt=new Date(i.startedAt),i.completedAt&&(i.completedAt=new Date(i.completedAt)),i.progress?.lastUpdate&&(i.progress.lastUpdate=new Date(i.progress.lastUpdate)),i.progress?.lastMessageAt&&(i.progress.lastMessageAt=new Date(i.progress.lastMessageAt)),this.tasks.set(i.id,i)}catch{}}catch{}}startPruning(){this.pruneInterval||(this.pruneInterval=setInterval(()=>{this.pruneStaleTasksAndNotifications()},6e4),this.pruneInterval.unref&&this.pruneInterval.unref())}stopPruning(){this.pruneInterval&&(clearInterval(this.pruneInterval),this.pruneInterval=void 0)}pruneStaleTasksAndNotifications(){let t=Date.now(),n=this.config.taskTimeoutMs??Pa;for(let[o,r]of this.tasks.entries())t-r.startedAt.getTime()>n&&r.status==="running"&&(r.status="error",r.error=`Task timed out after ${Math.round(n/6e4)} minutes`,r.completedAt=new Date,r.concurrencyKey&&this.concurrencyManager.release(r.concurrencyKey),this.clearNotificationsForTask(o),this.unpersistTask(o),this.tasks.delete(o));for(let[o,r]of this.notifications.entries()){let s=r.filter(i=>t-i.startedAt.getTime()<=n);s.length===0?this.notifications.delete(o):s.length!==r.length&&this.notifications.set(o,s)}}async launch(t){let n=t.agent,o=this.config.maxTotalTasks??10;if(Array.from(this.tasks.values()).filter(c=>c.status==="running").length>=o)throw new Error(`Maximum concurrent background tasks (${o}) reached. Wait for some tasks to complete.`);await this.concurrencyManager.acquire(n);let s=this.generateTaskId(),i=`ses_${this.generateTaskId()}`,a={id:s,sessionId:i,parentSessionId:t.parentSessionId,description:t.description,prompt:t.prompt,agent:t.agent,status:"running",startedAt:new Date,progress:{toolCalls:0,lastUpdate:new Date},concurrencyKey:n};return this.tasks.set(s,a),this.persistTask(a),a}async resume(t){let n=this.findBySession(t.sessionId);if(!n)throw new Error(`Task not found for session: ${t.sessionId}`);return n.status="running",n.completedAt=void 0,n.error=void 0,n.parentSessionId=t.parentSessionId,n.progress||(n.progress={toolCalls:0,lastUpdate:new Date}),n.progress.lastUpdate=new Date,this.persistTask(n),n}getTask(t){return this.tasks.get(t)}findBySession(t){for(let n of this.tasks.values())if(n.sessionId===t)return n}getTasksByParentSession(t){let n=[];for(let o of this.tasks.values())o.parentSessionId===t&&n.push(o);return n}getAllTasks(){return Array.from(this.tasks.values())}getRunningTasks(){return Array.from(this.tasks.values()).filter(t=>t.status==="running")}updateTaskStatus(t,n,o,r){let s=this.tasks.get(t);s&&(s.status=n,o&&(s.result=o),r&&(s.error=r),(n==="completed"||n==="error"||n==="cancelled")&&(s.completedAt=new Date,s.concurrencyKey&&this.concurrencyManager.release(s.concurrencyKey),this.markForNotification(s)),this.persistTask(s))}updateTaskProgress(t,n){let o=this.tasks.get(t);o&&(o.progress||(o.progress={toolCalls:0,lastUpdate:new Date}),Object.assign(o.progress,n,{lastUpdate:new Date}),this.persistTask(o))}markForNotification(t){let n=this.notifications.get(t.parentSessionId)??[];n.push(t),this.notifications.set(t.parentSessionId,n)}getPendingNotifications(t){return this.notifications.get(t)??[]}clearNotifications(t){this.notifications.delete(t)}clearNotificationsForTask(t){for(let[n,o]of this.notifications.entries()){let r=o.filter(s=>s.id!==t);r.length===0?this.notifications.delete(n):this.notifications.set(n,r)}}removeTask(t){let n=this.tasks.get(t);n?.concurrencyKey&&this.concurrencyManager.release(n.concurrencyKey),this.clearNotificationsForTask(t),this.unpersistTask(t),this.tasks.delete(t)}formatDuration(t,n){let o=(n??new Date).getTime()-t.getTime(),r=Math.floor(o/1e3),s=Math.floor(r/60),i=Math.floor(s/60);return i>0?`${i}h ${s%60}m ${r%60}s`:s>0?`${s}m ${r%60}s`:`${r}s`}getStatusSummary(){let t=this.getRunningTasks(),n=this.getAllTasks();if(n.length===0)return"No background tasks.";let o=[`Background Tasks: ${t.length} running, ${n.length} total`,""];for(let r of n){let s=this.formatDuration(r.startedAt,r.completedAt),i=r.status.toUpperCase(),a=r.progress?` (${r.progress.toolCalls} tools)`:"";o.push(` [${i}] ${r.description} - ${s}${a}`),r.error&&o.push(` Error: ${r.error}`)}return o.join(`
734
734
  `)}cleanup(){this.stopPruning(),this.tasks.clear(),this.notifications.clear()}},cn;function un(e){return cn||(cn=new Ve(e)),cn}function ba(e){let t=e.status.toUpperCase(),n=Da(e.startedAt,e.completedAt),r=[`${e.status==="completed"?"\u2713":e.status==="error"?"\u2717":"\u25CB"} [${t}] ${e.description}`,` Agent: ${e.agent}`,` Duration: ${n}`];if(e.progress?.toolCalls&&r.push(` Tool calls: ${e.progress.toolCalls}`),e.result){let s=e.result.substring(0,200),i=e.result.length>200?"...":"";r.push(` Result: ${s}${i}`)}return e.error&&r.push(` Error: ${e.error}`),r.join(`
735
735
  `)}function Da(e,t){let n=(t??new Date).getTime()-e.getTime(),o=Math.floor(n/1e3),r=Math.floor(o/60),s=Math.floor(r/60);return s>0?`${s}h ${r%60}m ${o%60}s`:r>0?`${r}m ${o%60}s`:`${o}s`}function La(e){if(e.length===0)return"";let t=e.length===1?`
736
736
  [BACKGROUND TASK COMPLETED]
@@ -740,8 +740,8 @@ ${e>=5?"**CRITICAL**: Too many direct operations. Your next action MUST be deleg
740
740
 
741
741
  `);return`${t}
742
742
  ${n}
743
- `}function Ma(e,t,n){let o=t.getPendingNotifications(e);if(o.length===0)return{hasNotifications:!1,tasks:[]};let s=(n?.formatNotification??La)(o);return{hasNotifications:!0,tasks:o,message:s}}function is(e,t){let n=e.sessionId;if(!n)return{continue:!0};let o=un(),r=Ma(n,o,t);return r.hasNotifications?((t?.autoClear??!0)&&o.clearNotifications(n),{continue:!0,message:r.message,notificationCount:r.tasks.length}):{continue:!0}}function as(){m({name:"backgroundNotification",event:"Notification",priority:10,handler:async e=>{let t={sessionId:e.sessionId,directory:e.directory,event:e.event?{type:e.event.type,properties:e.event.properties}:void 0},n=await is(t);return{continue:n.continue,message:n.message}}})}var cs=M(require("fs"),1),us=M(require("path"),1),ls=require("os");var qe="[user interrupted]",ln=new Set(["tool","tool_use","tool_result"]),dn="empty-message-sanitizer",pn="[empty-message-sanitizer]";var Ua=process.env.EMPTY_MESSAGE_SANITIZER_DEBUG==="1",$a=us.join((0,ls.tmpdir)(),"empty-message-sanitizer-debug.log");function F(...e){if(Ua){let t=`[${new Date().toISOString()}] ${pn} ${e.map(n=>typeof n=="object"?JSON.stringify(n,null,2):String(n)).join(" ")}
744
- `;cs.appendFileSync($a,t)}}function ja(e){if(e.type==="text"){let t=e.text;return!!(t&&t.trim().length>0)}return!1}function ds(e){return ln.has(e.type)}function Fa(e){return e.some(t=>ja(t)||ds(t))}function Ha(e,t,n=qe){let o=e.info.role==="assistant";if(t&&o)return F("skipping final assistant message"),!1;let r=e.parts;if(!Fa(r)){F(`sanitizing message ${e.info.id}: no valid content`);let i=!1;for(let a of r)if(a.type==="text"&&(!a.text||!a.text.trim())){a.text=n,a.synthetic=!0,i=!0,F("replaced empty text in existing part");break}if(!i){let a=r.findIndex(u=>ds(u)),c={id:`synthetic_${Date.now()}`,messageID:e.info.id,sessionID:e.info.sessionID??"",type:"text",text:n,synthetic:!0};a===-1?(r.push(c),F("appended synthetic text part")):(r.splice(a,0,c),F("inserted synthetic text part before tool part"))}return!0}let s=!1;for(let i of r)i.type==="text"&&i.text!==void 0&&i.text.trim()===""&&(i.text=n,i.synthetic=!0,s=!0,F(`sanitized empty text part in message ${e.info.id}`));return s}function Ga(e,t){let{messages:n}=e,o=t?.placeholderText??qe;F("sanitizing messages",{count:n.length});let r=0;for(let s=0;s<n.length;s++){let i=n[s],a=s===n.length-1;Ha(i,a,o)&&r++}return F(`sanitized ${r} messages`),{messages:n,sanitizedCount:r,modified:r>0}}function ps(e){return F("createEmptyMessageSanitizerHook called",{config:e}),{sanitize:t=>Ga(t,e),getName:()=>dn}}var ms="thinking-block-validator",fs=["tool","tool_use","text"],gs=["thinking","reasoning"];var hs="[Continuing from previous reasoning]",Ts="prt_0000000000_synthetic_thinking";function Ba(e){return fs.includes(e)}function Es(e){return gs.includes(e)}function Ya(e){if(!e)return!1;let t=e.toLowerCase();return t.includes("thinking")||t.endsWith("-high")?!0:t.includes("claude-sonnet-4")||t.includes("claude-opus-4")||t.includes("claude-3")}function Wa(e){return!e||e.length===0?!1:e.some(t=>Ba(t.type))}function Ka(e){if(!e||e.length===0)return!1;let t=e[0];return Es(t.type)}function Va(e,t){for(let n=t-1;n>=0;n--){let o=e[n];if(o.info.role==="assistant"&&o.parts){for(let r of o.parts)if(Es(r.type)){let s=r.thinking||r.text;if(s&&typeof s=="string"&&s.trim().length>0)return s}}}return""}function qa(e,t){e.parts||(e.parts=[]);let n={type:"thinking",id:Ts,sessionID:e.info.sessionID||"",messageID:e.info.id,thinking:t,synthetic:!0};e.parts.unshift(n)}function Ss(){return{"experimental.chat.messages.transform":async(e,t)=>{let{messages:n}=t;if(!n||n.length===0)return;let o;for(let i=n.length-1;i>=0;i--)if(n[i].info.role==="user"){o=n[i];break}let r=o?.info?.modelID||"";if(!Ya(r))return;let s=0;for(let i=0;i<n.length;i++){let a=n[i];if(a.info.role==="assistant"&&Wa(a.parts)&&!Ka(a.parts)){let u=Va(n,i)||hs;qa(a,u),s++}}s>0&&process.env.DEBUG_THINKING_VALIDATOR&&console.log(`[${ms}] Fixed ${s} message(s) by prepending thinking blocks`)}}}function ks(){m({name:"thinkingBlockValidator",event:"MessagesTransform",priority:10,handler:async e=>{if(!e.messages||e.messages.length===0)return{continue:!0};let t=Ss(),o={messages:[...e.messages]},r=t["experimental.chat.messages.transform"];r&&await r({},o);let s=o.messages.filter(i=>i.parts.some(a=>a.synthetic&&a.type==="thinking")).length;return s>0?{continue:!0,modifiedMessages:o.messages,message:`[Thinking Block Validator] Fixed ${s} message(s) by adding thinking blocks`}:{continue:!0}}}),m({name:"emptyMessageSanitizer",event:"MessagesTransform",priority:20,handler:e=>{if(!e.messages||e.messages.length===0)return{continue:!0};let n=ps().sanitize({messages:e.messages});return n.modified?{continue:!0,modifiedMessages:n.messages,message:`[Empty Message Sanitizer] Fixed ${n.sanitizedCount} message(s) with empty content`}:{continue:!0}}})}var ys=!1;function Os(){ys||(uo(),Eo(),$o(),Ar(),rs(),as(),ks(),ys=!0)}var ze=require("fs"),Is=require("os"),Ee=require("path"),Cs=M(require("jsonc-parser"),1),Ja={agents:{olympus:{model:"claude-opus-4-5-20251101"},oracle:{model:"claude-opus-4-5-20251101",enabled:!0},librarian:{model:"claude-sonnet-4-5-20250929"},explore:{model:"claude-haiku-4-5-20251001"},frontendEngineer:{model:"claude-sonnet-4-5-20250929",enabled:!0},documentWriter:{model:"claude-haiku-4-5-20251001",enabled:!0},multimodalLooker:{model:"claude-sonnet-4-5-20250929",enabled:!0},momus:{model:"claude-opus-4-5-20251101",enabled:!0},metis:{model:"claude-opus-4-5-20251101",enabled:!0},orchestratorOlympus:{model:"claude-sonnet-4-5-20250929",enabled:!0},olympusJunior:{model:"claude-sonnet-4-5-20250929",enabled:!0},prometheus:{model:"claude-opus-4-5-20251101",enabled:!0}},features:{parallelExecution:!0,lspTools:!0,astTools:!0,continuationEnforcement:!0,autoContextInjection:!0},mcpServers:{exa:{enabled:!0},context7:{enabled:!0},grepApp:{enabled:!0}},permissions:{allowBash:!0,allowEdit:!0,allowWrite:!0,maxBackgroundTasks:5},magicKeywords:{ultrawork:["ultrawork","ulw","uw"],search:["search","find","locate"],analyze:["analyze","investigate","examine"],ultrathink:["ultrathink","think","reason","ponder"]},routing:{enabled:!0,defaultTier:"MEDIUM",escalationEnabled:!0,maxEscalations:2,tierModels:{LOW:"claude-haiku-4-5-20251001",MEDIUM:"claude-sonnet-4-5-20250929",HIGH:"claude-opus-4-5-20251101"},agentOverrides:{oracle:{tier:"HIGH",reason:"Advisory agent requires deep reasoning"},prometheus:{tier:"HIGH",reason:"Strategic planning requires deep reasoning"},momus:{tier:"HIGH",reason:"Critical review requires deep reasoning"},metis:{tier:"HIGH",reason:"Pre-planning analysis requires deep reasoning"},explore:{tier:"LOW",reason:"Exploration is search-focused"},"document-writer":{tier:"LOW",reason:"Documentation is straightforward"}},escalationKeywords:["critical","production","urgent","security","breaking","architecture","refactor","redesign","root cause"],simplificationKeywords:["find","list","show","where","search","locate","grep"]}};function za(){let e=process.env.XDG_CONFIG_HOME??(0,Ee.join)((0,Is.homedir)(),".config");return{user:(0,Ee.join)(e,"claude-olympus","config.jsonc"),project:(0,Ee.join)(process.cwd(),".claude","olympus.jsonc")}}function Rs(e){if(!(0,ze.existsSync)(e))return null;try{let t=(0,ze.readFileSync)(e,"utf-8"),n=[],o=Cs.parse(t,n,{allowTrailingComma:!0,allowEmptyContent:!0});return n.length>0&&console.warn(`Warning: Parse errors in ${e}:`,n),o}catch(t){return console.error(`Error loading config from ${e}:`,t),null}}function Je(e,t){let n={...e};for(let o of Object.keys(t)){let r=t[o],s=n[o];r!==void 0&&typeof r=="object"&&r!==null&&!Array.isArray(r)&&typeof s=="object"&&s!==null&&!Array.isArray(s)?n[o]=Je(s,r):r!==void 0&&(n[o]=r)}return n}function Xa(){let e={};if(process.env.EXA_API_KEY&&(e.mcpServers={...e.mcpServers,exa:{enabled:!0,apiKey:process.env.EXA_API_KEY}}),process.env.OLYMPUS_PARALLEL_EXECUTION!==void 0&&(e.features={...e.features,parallelExecution:process.env.OLYMPUS_PARALLEL_EXECUTION==="true"}),process.env.OLYMPUS_LSP_TOOLS!==void 0&&(e.features={...e.features,lspTools:process.env.OLYMPUS_LSP_TOOLS==="true"}),process.env.OLYMPUS_MAX_BACKGROUND_TASKS){let t=parseInt(process.env.OLYMPUS_MAX_BACKGROUND_TASKS,10);isNaN(t)||(e.permissions={...e.permissions,maxBackgroundTasks:t})}if(process.env.OLYMPUS_ROUTING_ENABLED!==void 0&&(e.routing={...e.routing,enabled:process.env.OLYMPUS_ROUTING_ENABLED==="true"}),process.env.OLYMPUS_ROUTING_DEFAULT_TIER){let t=process.env.OLYMPUS_ROUTING_DEFAULT_TIER.toUpperCase();(t==="LOW"||t==="MEDIUM"||t==="HIGH")&&(e.routing={...e.routing,defaultTier:t})}return process.env.OLYMPUS_ESCALATION_ENABLED!==void 0&&(e.routing={...e.routing,escalationEnabled:process.env.OLYMPUS_ESCALATION_ENABLED==="true"}),e}function _s(){let e=za(),t={...Ja},n=Rs(e.user);n&&(t=Je(t,n));let o=Rs(e.project);o&&(t=Je(t,o));let r=Xa();return t=Je(t,r),t}function Qa(e){let t=e.hooks;return t&&typeof t.timeoutMs=="number"?t.timeoutMs:100}function Za(e,t){let n=e.hooks;if(n&&typeof n.enabled=="boolean"&&!n.enabled)return!1;if(n&&t in n){let o=n[t];if(typeof o=="object"&&o!==null){let r=o.enabled;if(typeof r=="boolean")return r}}return!0}async function ec(e,t){return Promise.race([Promise.resolve(e()),new Promise(n=>setTimeout(()=>n(null),t))])}function tc(e,t){return!e||!t?!0:(typeof e=="string"?new RegExp(e,"i"):e).test(t)}async function As(e,t){let n=_s(),o=hn(e),r=Qa(n),s=!0,i=[],a,c=t.toolInput,u=t.messages;for(let l of o)if(Za(n,l.name)&&tc(l.matcher,t.toolName))try{let d=await ec(()=>l.handler({...t,toolInput:c,messages:u}),r);if(d===null){console.error(`[hook-router] ${l.name} timed out after ${r}ms`);continue}d.continue||(s=!1,a=d.reason),d.message&&i.push(d.message),d.modifiedInput!==void 0&&(c=d.modifiedInput),d.modifiedMessages!==void 0&&(u=d.modifiedMessages)}catch(d){console.error(`[hook-router] ${l.name} error:`,d)}return{continue:s,message:i.length>0?i.join(`
743
+ `}function Ma(e,t,n){let o=t.getPendingNotifications(e);if(o.length===0)return{hasNotifications:!1,tasks:[]};let s=(n?.formatNotification??La)(o);return{hasNotifications:!0,tasks:o,message:s}}function is(e,t){let n=e.sessionId;if(!n)return{continue:!0};let o=un(),r=Ma(n,o,t);return r.hasNotifications?((t?.autoClear??!0)&&o.clearNotifications(n),{continue:!0,message:r.message,notificationCount:r.tasks.length}):{continue:!0}}function as(){m({name:"backgroundNotification",event:"Notification",priority:10,handler:async e=>{let t={sessionId:e.sessionId,directory:e.directory,event:e.event?{type:e.event.type,properties:e.event.properties}:void 0},n=await is(t);return{continue:n.continue,message:n.message}}})}var cs=b(require("fs"),1),us=b(require("path"),1),ls=require("os");var qe="[user interrupted]",ln=new Set(["tool","tool_use","tool_result"]),dn="empty-message-sanitizer",pn="[empty-message-sanitizer]";var Ua=process.env.EMPTY_MESSAGE_SANITIZER_DEBUG==="1",$a=us.join((0,ls.tmpdir)(),"empty-message-sanitizer-debug.log");function $(...e){if(Ua){let t=`[${new Date().toISOString()}] ${pn} ${e.map(n=>typeof n=="object"?JSON.stringify(n,null,2):String(n)).join(" ")}
744
+ `;cs.appendFileSync($a,t)}}function ja(e){if(e.type==="text"){let t=e.text;return!!(t&&t.trim().length>0)}return!1}function ds(e){return ln.has(e.type)}function Fa(e){return e.some(t=>ja(t)||ds(t))}function Ha(e,t,n=qe){let o=e.info.role==="assistant";if(t&&o)return $("skipping final assistant message"),!1;let r=e.parts;if(!Fa(r)){$(`sanitizing message ${e.info.id}: no valid content`);let i=!1;for(let a of r)if(a.type==="text"&&(!a.text||!a.text.trim())){a.text=n,a.synthetic=!0,i=!0,$("replaced empty text in existing part");break}if(!i){let a=r.findIndex(u=>ds(u)),c={id:`synthetic_${Date.now()}`,messageID:e.info.id,sessionID:e.info.sessionID??"",type:"text",text:n,synthetic:!0};a===-1?(r.push(c),$("appended synthetic text part")):(r.splice(a,0,c),$("inserted synthetic text part before tool part"))}return!0}let s=!1;for(let i of r)i.type==="text"&&i.text!==void 0&&i.text.trim()===""&&(i.text=n,i.synthetic=!0,s=!0,$(`sanitized empty text part in message ${e.info.id}`));return s}function Ga(e,t){let{messages:n}=e,o=t?.placeholderText??qe;$("sanitizing messages",{count:n.length});let r=0;for(let s=0;s<n.length;s++){let i=n[s],a=s===n.length-1;Ha(i,a,o)&&r++}return $(`sanitized ${r} messages`),{messages:n,sanitizedCount:r,modified:r>0}}function ps(e){return $("createEmptyMessageSanitizerHook called",{config:e}),{sanitize:t=>Ga(t,e),getName:()=>dn}}var ms="thinking-block-validator",fs=["tool","tool_use","text"],gs=["thinking","reasoning"];var hs="[Continuing from previous reasoning]",Ts="prt_0000000000_synthetic_thinking";function Ba(e){return fs.includes(e)}function Es(e){return gs.includes(e)}function Ya(e){if(!e)return!1;let t=e.toLowerCase();return t.includes("thinking")||t.endsWith("-high")?!0:t.includes("claude-sonnet-4")||t.includes("claude-opus-4")||t.includes("claude-3")}function Wa(e){return!e||e.length===0?!1:e.some(t=>Ba(t.type))}function Ka(e){if(!e||e.length===0)return!1;let t=e[0];return Es(t.type)}function Va(e,t){for(let n=t-1;n>=0;n--){let o=e[n];if(o.info.role==="assistant"&&o.parts){for(let r of o.parts)if(Es(r.type)){let s=r.thinking||r.text;if(s&&typeof s=="string"&&s.trim().length>0)return s}}}return""}function qa(e,t){e.parts||(e.parts=[]);let n={type:"thinking",id:Ts,sessionID:e.info.sessionID||"",messageID:e.info.id,thinking:t,synthetic:!0};e.parts.unshift(n)}function Ss(){return{"experimental.chat.messages.transform":async(e,t)=>{let{messages:n}=t;if(!n||n.length===0)return;let o;for(let i=n.length-1;i>=0;i--)if(n[i].info.role==="user"){o=n[i];break}let r=o?.info?.modelID||"";if(!Ya(r))return;let s=0;for(let i=0;i<n.length;i++){let a=n[i];if(a.info.role==="assistant"&&Wa(a.parts)&&!Ka(a.parts)){let u=Va(n,i)||hs;qa(a,u),s++}}s>0&&process.env.DEBUG_THINKING_VALIDATOR&&console.log(`[${ms}] Fixed ${s} message(s) by prepending thinking blocks`)}}}function ks(){m({name:"thinkingBlockValidator",event:"MessagesTransform",priority:10,handler:async e=>{if(!e.messages||e.messages.length===0)return{continue:!0};let t=Ss(),o={messages:[...e.messages]},r=t["experimental.chat.messages.transform"];r&&await r({},o);let s=o.messages.filter(i=>i.parts.some(a=>a.synthetic&&a.type==="thinking")).length;return s>0?{continue:!0,modifiedMessages:o.messages,message:`[Thinking Block Validator] Fixed ${s} message(s) by adding thinking blocks`}:{continue:!0}}}),m({name:"emptyMessageSanitizer",event:"MessagesTransform",priority:20,handler:e=>{if(!e.messages||e.messages.length===0)return{continue:!0};let n=ps().sanitize({messages:e.messages});return n.modified?{continue:!0,modifiedMessages:n.messages,message:`[Empty Message Sanitizer] Fixed ${n.sanitizedCount} message(s) with empty content`}:{continue:!0}}})}var ys=!1;function Os(){ys||(uo(),Eo(),$o(),Ar(),rs(),as(),ks(),ys=!0)}var ze=require("fs"),Is=require("os"),Ee=require("path"),Cs=b(require("jsonc-parser"),1),Ja={agents:{olympus:{model:"claude-opus-4-5-20251101"},oracle:{model:"claude-opus-4-5-20251101",enabled:!0},librarian:{model:"claude-sonnet-4-5-20250929"},explore:{model:"claude-haiku-4-5-20251001"},frontendEngineer:{model:"claude-sonnet-4-5-20250929",enabled:!0},documentWriter:{model:"claude-haiku-4-5-20251001",enabled:!0},multimodalLooker:{model:"claude-sonnet-4-5-20250929",enabled:!0},momus:{model:"claude-opus-4-5-20251101",enabled:!0},metis:{model:"claude-opus-4-5-20251101",enabled:!0},orchestratorOlympus:{model:"claude-sonnet-4-5-20250929",enabled:!0},olympusJunior:{model:"claude-sonnet-4-5-20250929",enabled:!0},prometheus:{model:"claude-opus-4-5-20251101",enabled:!0}},features:{parallelExecution:!0,lspTools:!0,astTools:!0,continuationEnforcement:!0,autoContextInjection:!0},mcpServers:{exa:{enabled:!0},context7:{enabled:!0},grepApp:{enabled:!0}},permissions:{allowBash:!0,allowEdit:!0,allowWrite:!0,maxBackgroundTasks:5},magicKeywords:{ultrawork:["ultrawork","ulw","uw"],search:["search","find","locate"],analyze:["analyze","investigate","examine"],ultrathink:["ultrathink","think","reason","ponder"]},routing:{enabled:!0,defaultTier:"MEDIUM",escalationEnabled:!0,maxEscalations:2,tierModels:{LOW:"claude-haiku-4-5-20251001",MEDIUM:"claude-sonnet-4-5-20250929",HIGH:"claude-opus-4-5-20251101"},agentOverrides:{oracle:{tier:"HIGH",reason:"Advisory agent requires deep reasoning"},prometheus:{tier:"HIGH",reason:"Strategic planning requires deep reasoning"},momus:{tier:"HIGH",reason:"Critical review requires deep reasoning"},metis:{tier:"HIGH",reason:"Pre-planning analysis requires deep reasoning"},explore:{tier:"LOW",reason:"Exploration is search-focused"},"document-writer":{tier:"LOW",reason:"Documentation is straightforward"}},escalationKeywords:["critical","production","urgent","security","breaking","architecture","refactor","redesign","root cause"],simplificationKeywords:["find","list","show","where","search","locate","grep"]}};function za(){let e=process.env.XDG_CONFIG_HOME??(0,Ee.join)((0,Is.homedir)(),".config");return{user:(0,Ee.join)(e,"claude-olympus","config.jsonc"),project:(0,Ee.join)(process.cwd(),".claude","olympus.jsonc")}}function Rs(e){if(!(0,ze.existsSync)(e))return null;try{let t=(0,ze.readFileSync)(e,"utf-8"),n=[],o=Cs.parse(t,n,{allowTrailingComma:!0,allowEmptyContent:!0});return n.length>0&&console.warn(`Warning: Parse errors in ${e}:`,n),o}catch(t){return console.error(`Error loading config from ${e}:`,t),null}}function Je(e,t){let n={...e};for(let o of Object.keys(t)){let r=t[o],s=n[o];r!==void 0&&typeof r=="object"&&r!==null&&!Array.isArray(r)&&typeof s=="object"&&s!==null&&!Array.isArray(s)?n[o]=Je(s,r):r!==void 0&&(n[o]=r)}return n}function Xa(){let e={};if(process.env.EXA_API_KEY&&(e.mcpServers={...e.mcpServers,exa:{enabled:!0,apiKey:process.env.EXA_API_KEY}}),process.env.OLYMPUS_PARALLEL_EXECUTION!==void 0&&(e.features={...e.features,parallelExecution:process.env.OLYMPUS_PARALLEL_EXECUTION==="true"}),process.env.OLYMPUS_LSP_TOOLS!==void 0&&(e.features={...e.features,lspTools:process.env.OLYMPUS_LSP_TOOLS==="true"}),process.env.OLYMPUS_MAX_BACKGROUND_TASKS){let t=parseInt(process.env.OLYMPUS_MAX_BACKGROUND_TASKS,10);isNaN(t)||(e.permissions={...e.permissions,maxBackgroundTasks:t})}if(process.env.OLYMPUS_ROUTING_ENABLED!==void 0&&(e.routing={...e.routing,enabled:process.env.OLYMPUS_ROUTING_ENABLED==="true"}),process.env.OLYMPUS_ROUTING_DEFAULT_TIER){let t=process.env.OLYMPUS_ROUTING_DEFAULT_TIER.toUpperCase();(t==="LOW"||t==="MEDIUM"||t==="HIGH")&&(e.routing={...e.routing,defaultTier:t})}return process.env.OLYMPUS_ESCALATION_ENABLED!==void 0&&(e.routing={...e.routing,escalationEnabled:process.env.OLYMPUS_ESCALATION_ENABLED==="true"}),e}function _s(){let e=za(),t={...Ja},n=Rs(e.user);n&&(t=Je(t,n));let o=Rs(e.project);o&&(t=Je(t,o));let r=Xa();return t=Je(t,r),t}function Qa(e){let t=e.hooks;return t&&typeof t.timeoutMs=="number"?t.timeoutMs:100}function Za(e,t){let n=e.hooks;if(n&&typeof n.enabled=="boolean"&&!n.enabled)return!1;if(n&&t in n){let o=n[t];if(typeof o=="object"&&o!==null){let r=o.enabled;if(typeof r=="boolean")return r}}return!0}async function ec(e,t){return Promise.race([Promise.resolve(e()),new Promise(n=>setTimeout(()=>n(null),t))])}function tc(e,t){return!e||!t?!0:(typeof e=="string"?new RegExp(e,"i"):e).test(t)}async function As(e,t){let n=_s(),o=hn(e),r=Qa(n),s=!0,i=[],a,c=t.toolInput,u=t.messages;for(let l of o)if(Za(n,l.name)&&tc(l.matcher,t.toolName))try{let d=await ec(()=>l.handler({...t,toolInput:c,messages:u}),r);if(d===null){console.error(`[hook-router] ${l.name} timed out after ${r}ms`);continue}d.continue||(s=!1,a=d.reason),d.message&&i.push(d.message),d.modifiedInput!==void 0&&(c=d.modifiedInput),d.modifiedMessages!==void 0&&(u=d.modifiedMessages)}catch(d){console.error(`[hook-router] ${l.name} error:`,d)}return{continue:s,message:i.length>0?i.join(`
745
745
 
746
746
  ---
747
747
 
@@ -175,30 +175,6 @@ export declare const HOOKS_SETTINGS_CONFIG_BUNDLED: {
175
175
  command: string;
176
176
  }[];
177
177
  }[];
178
- PreToolUse: {
179
- hooks: {
180
- type: "command";
181
- command: string;
182
- }[];
183
- }[];
184
- PostToolUse: {
185
- hooks: {
186
- type: "command";
187
- command: string;
188
- }[];
189
- }[];
190
- Notification: {
191
- hooks: {
192
- type: "command";
193
- command: string;
194
- }[];
195
- }[];
196
- MessagesTransform: {
197
- hooks: {
198
- type: "command";
199
- command: string;
200
- }[];
201
- }[];
202
178
  };
203
179
  };
204
180
  /**
@@ -230,30 +206,6 @@ export declare function getBundledHooksSettingsConfig(): {
230
206
  command: string;
231
207
  }[];
232
208
  }[];
233
- PreToolUse: {
234
- hooks: {
235
- type: "command";
236
- command: string;
237
- }[];
238
- }[];
239
- PostToolUse: {
240
- hooks: {
241
- type: "command";
242
- command: string;
243
- }[];
244
- }[];
245
- Notification: {
246
- hooks: {
247
- type: "command";
248
- command: string;
249
- }[];
250
- }[];
251
- MessagesTransform: {
252
- hooks: {
253
- type: "command";
254
- command: string;
255
- }[];
256
- }[];
257
209
  };
258
210
  };
259
211
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/installer/hooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,iDAAiD;AACjD,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC,kCAAkC;AAClC,wBAAgB,SAAS,IAAI,OAAO,CAEnC;AAED,sEAAsE;AACtE,wBAAgB,kBAAkB,IAAI,OAAO,CAU5C;AAED,4DAA4D;AAC5D,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED,mCAAmC;AACnC,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AAED;;;GAGG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,woJA2F7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_SETTINGS_CONFIG_BUNDLED = {
1421
1421
  ? `node "${join(getHooksDir(), 'olympus-hooks.cjs')}" --event=Stop`
1422
1422
  : `node "${join(getHooksDir(), 'olympus-hooks.cjs')}" --event=Stop`
1423
1423
  }]
1424
- }],
1425
- PreToolUse: [{
1426
- hooks: [{
1427
- type: "command",
1428
- command: isWindows()
1429
- ? `node "${join(getHooksDir(), 'olympus-hooks.cjs')}" --event=PreToolUse`
1430
- : `node "${join(getHooksDir(), 'olympus-hooks.cjs')}" --event=PreToolUse`
1431
- }]
1432
- }],
1433
- PostToolUse: [{
1434
- hooks: [{
1435
- type: "command",
1436
- command: isWindows()
1437
- ? `node "${join(getHooksDir(), 'olympus-hooks.cjs')}" --event=PostToolUse`
1438
- : `node "${join(getHooksDir(), 'olympus-hooks.cjs')}" --event=PostToolUse`
1439
- }]
1440
- }],
1441
- Notification: [{
1442
- hooks: [{
1443
- type: "command",
1444
- command: isWindows()
1445
- ? `node "${join(getHooksDir(), 'olympus-hooks.cjs')}" --event=Notification`
1446
- : `node "${join(getHooksDir(), 'olympus-hooks.cjs')}" --event=Notification`
1447
- }]
1448
- }],
1449
- MessagesTransform: [{
1450
- hooks: [{
1451
- type: "command",
1452
- command: isWindows()
1453
- ? `node "${join(getHooksDir(), 'olympus-hooks.cjs')}" --event=MessagesTransform`
1454
- : `node "${join(getHooksDir(), 'olympus-hooks.cjs')}" --event=MessagesTransform`
1455
- }]
1456
1424
  }]
1457
1425
  }
1458
1426
  };
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/installer/hooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,iDAAiD;AACjD,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAEnC,kCAAkC;AAClC,MAAM,UAAU,SAA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C;IACD,OAAO,kBAAkB,EAAE,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,0BAA0B,CAAC;AACxF,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,0BAA0B,CAAC;AAEhE,gFAAgF;AAChF,wCAAwC;AACxC,gFAAgF;AAEhF;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAA2B;IACvD,qBAAqB,EAAE,uBAAuB;IAC9C,sBAAsB,EAAE,wBAAwB;IAChD,oBAAoB,EAAE,sBAAsB;IAC5C,kBAAkB,EAAE,oBAAoB;CACzC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAA2B;IACvD,sBAAsB,EAAE,4BAA4B;IACpD,uBAAuB,EAAE,6BAA6B;IACtD,qBAAqB,EAAE,2BAA2B;IAClD,mBAAmB,EAAE,yBAAyB;CAC/C,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,kBAAkB,EAAE,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,iBAAiB,CAAC;AACtE,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAA2B,iBAAiB,CAAC"}
@@ -24,7 +24,7 @@ export declare const HOOKS_DIR: string;
24
24
  export declare const SETTINGS_FILE: string;
25
25
  export declare const VERSION_FILE: string;
26
26
  /** Current version - MUST match package.json */
27
- export declare const VERSION = "2.6.2";
27
+ export declare const VERSION = "2.6.3";
28
28
  /** Installation result */
29
29
  export interface InstallResult {
30
30
  success: boolean;
@@ -29,7 +29,7 @@ export const HOOKS_DIR = join(CLAUDE_CONFIG_DIR, 'hooks');
29
29
  export const SETTINGS_FILE = join(CLAUDE_CONFIG_DIR, 'settings.json');
30
30
  export const VERSION_FILE = join(CLAUDE_CONFIG_DIR, '.olympus-version.json');
31
31
  /** Current version - MUST match package.json */
32
- export const VERSION = '2.6.2';
32
+ export const VERSION = '2.6.3';
33
33
  /**
34
34
  * Check if the current Node.js version meets the minimum requirement
35
35
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "olympus-ai",
3
- "version": "2.6.2",
3
+ "version": "2.6.3",
4
4
  "description": "Olympus: Multi-agent orchestration for Claude Code. Only the worthy ascend.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",