infernoflow 0.44.13 → 0.44.14

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,11 +1,11 @@
1
- import*as v from"node:fs";import*as m from"node:path";import"node:os";import{execSync as T}from"node:child_process";import{bold as K,cyan as O,gray as rt,green as ct,yellow as X,red as ht}from"../ui/output.mjs";import{ampPaths as dt,readEntries as gt,appendEntry as mt,readDetail as yt}from"../amp/io.mjs";const b="inferno";function R(){return dt(process.cwd())}const wt=m.join(b,"HANDOFF.md"),Ft=m.join(b,"sessions.jsonl"),q=m.join(b,"context-state.json"),Q=m.join(b,"contract.json"),Y=m.join(b,"theme.json"),Z=m.join(b,"adoption_profile.json");function u(o){try{return JSON.parse(v.readFileSync(o,"utf8"))}catch{return null}}function lt(o){try{return v.readFileSync(o,"utf8")}catch{return null}}function U(o){return o?new Date(o).toLocaleString("en-GB",{day:"2-digit",month:"short",hour:"2-digit",minute:"2-digit"}):"unknown"}function tt(o){if(o<0)return"unknown";const i=Math.floor(o/36e5),a=Math.floor(o%36e5/6e4);return i>0?`${i}h ${a}m`:`${a}m`}function et(){return gt(process.cwd())}function ot(o,i,a){if(a)return new Date(0);if(i){const r=i.match(/^(\d+)h$/i),h=i.match(/^(\d+)d$/i);if(r)return new Date(Date.now()-parseInt(r[1])*36e5);if(h)return new Date(Date.now()-parseInt(h[1])*864e5);const E=new Date(i);if(!isNaN(E.getTime()))return E}const n=new Date(Date.now()-864e5),c=[];for(const r of o)if(r.type==="handoff"){const h=new Date(r.ts||0);isNaN(h.getTime())||c.push(h)}if(c.length===0)return n;const s=300*1e3,y=c[c.length-1];if(Date.now()-y.getTime()<s){if(c.length>=2){const r=c[c.length-2];return r>n?r:n}return n}return y>n?y:n}function St(o){try{const i=process.platform;if(i==="win32")T("clip",{input:o});else if(i==="darwin")T("pbcopy",{input:o});else try{T("xclip -selection clipboard",{input:o})}catch{T("xsel --clipboard --input",{input:o})}return!0}catch{return!1}}function nt(){if(process.env.CURSOR_SESSION)return"Cursor";if(process.env.COPILOT_SESSION)return"GitHub Copilot";if(process.env.CLAUDE_CODE_SESSION)return"Claude Code";if(process.env.WINDSURF_SESSION)return"Windsurf";if(process.env.TERM_PROGRAM==="vscode")return"VS Code";const o=u(Z);return o?.ide?o.ide:null}function $t(){try{const o=T("git diff --stat HEAD 2>/dev/null || git diff --cached --stat 2>/dev/null",{encoding:"utf8",stdio:["pipe","pipe","pipe"]}).trim();return o||T("git log --stat -1 --pretty= 2>/dev/null",{encoding:"utf8",stdio:["pipe","pipe","pipe"]}).trim()||null}catch{return null}}function at(o){try{const i=o&&o.getTime()>0?`--after="${o.toISOString()}"`:"-10",a=T(`git log ${i} --name-only --pretty=format: 2>/dev/null`,{encoding:"utf8",stdio:["pipe","pipe","pipe"]}).trim();if(!a)return[];const n={};for(const c of a.split(`
2
- `)){const s=c.trim();s&&(n[s]=(n[s]||0)+1)}return Object.entries(n).sort((c,s)=>s[1]-c[1]).slice(0,5).map(([c,s])=>({file:c,edits:s}))}catch{return[]}}function st(o){try{const i=o?`--after="${o.toISOString()}"`:"-5",a=T(`git log ${i} --pretty=format:"%h %s" 2>/dev/null`,{encoding:"utf8",stdio:["pipe","pipe","pipe"]}).trim();return a?a.split(`
3
- `).filter(Boolean):[]}catch{return[]}}function ft(o){const i=[],a=o.filter(n=>n.type==="attempt"&&(n.result==="failed"||n.result==="partial"||!n.result));for(const n of a)o.find(s=>s.type==="attempt"&&s.result==="worked"&&new Date(s.ts)>new Date(n.ts)&&s.summary.toLowerCase().includes(n.summary.split(" ")[0].toLowerCase()))||i.push({text:n.summary,ts:n.ts,kind:"unresolved-attempt"});for(const n of o)/\b(TODO|WIP|FIXME|BLOCKED|pending)\b/i.test(n.summary)&&(i.find(c=>c.text===n.summary)||i.push({text:n.summary,ts:n.ts,kind:"flagged"}));return i.slice(0,8)}function Dt(o,i,a){const n=u(q)||{},c=u(Q)||{},s=u(Y),y=u(Z),$=et(),r=ot($,i,a),h=$.filter(e=>new Date(e.ts||0)>r),E=$.slice(-5),F=new Date,d=F.toLocaleString("en-GB",{day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"}),k=c.policyId||m.basename(process.cwd()),A=c.policyVersion||"?",j=(c.capabilities||[]).slice(0,20),G=nt(),B=r.getTime()>0?F.getTime()-r.getTime():-1,H=tt(B),x=r.getTime()>0?r.getTime().toString(16).slice(-6).toUpperCase():"ALL",N=st(r.getTime()>0?r:null),L=$t(),P=at(r.getTime()>0?r:null),w=h.length>0?h:E,D=w.filter(e=>e.type==="gotcha"),l=w.filter(e=>e.type==="decision"),g=w.filter(e=>e.type==="attempt").filter(e=>e.result==="failed"||e.result==="partial"),W=w.filter(e=>e.type==="preference"),_=w.filter(e=>Array.isArray(e.tags)&&e.tags.includes("bookmark")),V=w.slice(-8),S=ft(w),it=r.getTime()===0?"all time":r.toLocaleString("en-GB",{day:"2-digit",month:"short",hour:"2-digit",minute:"2-digit"}),I=["sessions.jsonl"];(n.working||n.intent)&&I.push("context-state.json"),s&&I.push("theme.json"),c.capabilities?.length&&I.push("contract.json"),y&&I.push("adoption_profile.json"),N.length&&I.push("git log");const J=D.length,z=l.length,pt=g.length;let C=Math.min(J*20,40)+Math.min(z*15,30)+Math.min(pt*15,20);C=Math.min(C,100);const ut=C>=80?"A":C>=60?"B":C>=40?"C":C>=20?"D":"F",t=[`# \u{1F525} infernoflow Handoff \u2014 ${k}`,`> Generated: ${d}${o?` | Handing off to: **${o}**`:""}`,`> Session: **#${x}** \xB7 ${H} \xB7 **${h.length} entries** \xB7 Health: **${ut}** (${C}/100)`,`> Sources: ${I.join(" \xB7 ")}${G?` \xB7 IDE: ${G}`:""}`,"","---",""];if((n.working||n.intent)&&(t.push("## \u{1F3AF} Working on",""),n.working&&t.push(`**${n.working}** _(${U(n.workingUpdated)})_`),n.intent&&t.push(`Intent: ${n.intent} _(${U(n.intentUpdated)})_`),t.push("")),_.length){t.push(`## \u{1F516} Bookmarks \u2014 Resume Points (${_.length})`,""),_.forEach((f,M)=>t.push(`${M+1}. **${f.summary}** _(${U(f.ts)})_`));const e=_[_.length-1],p=e?yt(process.cwd(),e):null;p&&p.trim()&&t.push("",`<details><summary>\u{1F4CE} Context for "${e.summary}"</summary>`,"",p.trim(),"","</details>"),t.push("")}if(D.length&&(t.push(`## \u26A0\uFE0F STOP \u2014 Read These Before Doing Anything (${D.length} gotcha${D.length===1?"":"s"})`,""),D.forEach((e,p)=>{t.push(`${p+1}. **${e.summary}**`);const f=e.file||e.source;if(f&&/[\\/.]/.test(f)){const M=e.line?`${f}:${e.line}`:f;t.push(` \u2192 File: \`${M}\``)}}),t.push("")),l.length&&(t.push("## \u2713 Decisions In Effect \u2014 Follow These",""),l.forEach((e,p)=>{const f=e.result?` \u2192 **${e.result}**`:"";t.push(`${p+1}. ${e.summary}${f}`)}),t.push("")),g.length&&(t.push("## \u274C Already Tried \u2014 Don't Repeat",""),g.forEach((e,p)=>{const f=e.file||e.source,M=f&&/[\\/.]/.test(f)?` (\`${f}\`)`:"";t.push(`${p+1}. ${e.summary}${M} _(${U(e.ts)})_`)}),t.push("")),P.length){t.push("## \u{1F4C1} Hot Files This Session","");for(const{file:e,edits:p}of P)t.push(`- \`${e}\` \u2014 ${p} edit${p!==1?"s":""}`);t.push("")}if(W.length){t.push("## Developer preferences","");for(const e of W)t.push(`- ${e.summary}`);t.push("")}if(N.length||L){if(t.push("## Git activity this session",""),N.length){t.push("**Commits:**");for(const e of N)t.push(`- \`${e}\``);t.push("")}L&&(t.push("**Uncommitted changes:**"),t.push("```"),t.push(L.split(`
1
+ import*as A from"node:fs";import*as m from"node:path";import"node:os";import{execSync as T}from"node:child_process";import{bold as z,cyan as O,gray as rt,green as ct,yellow as K,red as ut}from"../ui/output.mjs";import{ampPaths as ht,readEntries as dt,appendEntry as gt}from"../amp/io.mjs";const _="inferno";function M(){return ht(process.cwd())}const mt=m.join(_,"HANDOFF.md"),Ot=m.join(_,"sessions.jsonl"),X=m.join(_,"context-state.json"),q=m.join(_,"contract.json"),Q=m.join(_,"theme.json"),Y=m.join(_,"adoption_profile.json");function u(t){try{return JSON.parse(A.readFileSync(t,"utf8"))}catch{return null}}function lt(t){try{return A.readFileSync(t,"utf8")}catch{return null}}function Z(t){return t?new Date(t).toLocaleString("en-GB",{day:"2-digit",month:"short",hour:"2-digit",minute:"2-digit"}):"unknown"}function tt(t){if(t<0)return"unknown";const i=Math.floor(t/36e5),a=Math.floor(t%36e5/6e4);return i>0?`${i}h ${a}m`:`${a}m`}function et(){return dt(process.cwd())}function ot(t,i,a){if(a)return new Date(0);if(i){const r=i.match(/^(\d+)h$/i),h=i.match(/^(\d+)d$/i);if(r)return new Date(Date.now()-parseInt(r[1])*36e5);if(h)return new Date(Date.now()-parseInt(h[1])*864e5);const F=new Date(i);if(!isNaN(F.getTime()))return F}const o=new Date(Date.now()-864e5),c=[];for(const r of t)if(r.type==="handoff"){const h=new Date(r.ts||0);isNaN(h.getTime())||c.push(h)}if(c.length===0)return o;const s=300*1e3,y=c[c.length-1];if(Date.now()-y.getTime()<s){if(c.length>=2){const r=c[c.length-2];return r>o?r:o}return o}return y>o?y:o}function yt(t){try{const i=process.platform;if(i==="win32")T("clip",{input:t});else if(i==="darwin")T("pbcopy",{input:t});else try{T("xclip -selection clipboard",{input:t})}catch{T("xsel --clipboard --input",{input:t})}return!0}catch{return!1}}function nt(){if(process.env.CURSOR_SESSION)return"Cursor";if(process.env.COPILOT_SESSION)return"GitHub Copilot";if(process.env.CLAUDE_CODE_SESSION)return"Claude Code";if(process.env.WINDSURF_SESSION)return"Windsurf";if(process.env.TERM_PROGRAM==="vscode")return"VS Code";const t=u(Y);return t?.ide?t.ide:null}function wt(){try{const t=T("git diff --stat HEAD 2>/dev/null || git diff --cached --stat 2>/dev/null",{encoding:"utf8",stdio:["pipe","pipe","pipe"]}).trim();return t||T("git log --stat -1 --pretty= 2>/dev/null",{encoding:"utf8",stdio:["pipe","pipe","pipe"]}).trim()||null}catch{return null}}function at(t){try{const i=t&&t.getTime()>0?`--after="${t.toISOString()}"`:"-10",a=T(`git log ${i} --name-only --pretty=format: 2>/dev/null`,{encoding:"utf8",stdio:["pipe","pipe","pipe"]}).trim();if(!a)return[];const o={};for(const c of a.split(`
2
+ `)){const s=c.trim();s&&(o[s]=(o[s]||0)+1)}return Object.entries(o).sort((c,s)=>s[1]-c[1]).slice(0,5).map(([c,s])=>({file:c,edits:s}))}catch{return[]}}function st(t){try{const i=t?`--after="${t.toISOString()}"`:"-5",a=T(`git log ${i} --pretty=format:"%h %s" 2>/dev/null`,{encoding:"utf8",stdio:["pipe","pipe","pipe"]}).trim();return a?a.split(`
3
+ `).filter(Boolean):[]}catch{return[]}}function ft(t){const i=[],a=t.filter(o=>o.type==="attempt"&&(o.result==="failed"||o.result==="partial"||!o.result));for(const o of a)t.find(s=>s.type==="attempt"&&s.result==="worked"&&new Date(s.ts)>new Date(o.ts)&&s.summary.toLowerCase().includes(o.summary.split(" ")[0].toLowerCase()))||i.push({text:o.summary,ts:o.ts,kind:"unresolved-attempt"});for(const o of t)/\b(TODO|WIP|FIXME|BLOCKED|pending)\b/i.test(o.summary)&&(i.find(c=>c.text===o.summary)||i.push({text:o.summary,ts:o.ts,kind:"flagged"}));return i.slice(0,8)}function St(t,i,a){const o=u(X)||{},c=u(q)||{},s=u(Q),y=u(Y),S=et(),r=ot(S,i,a),h=S.filter(n=>new Date(n.ts||0)>r),F=S.slice(-5),E=new Date,d=E.toLocaleString("en-GB",{day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"}),b=c.policyId||m.basename(process.cwd()),N=c.policyVersion||"?",j=(c.capabilities||[]).slice(0,20),x=nt(),R=r.getTime()>0?E.getTime()-r.getTime():-1,v=tt(R),H=r.getTime()>0?r.getTime().toString(16).slice(-6).toUpperCase():"ALL",k=st(r.getTime()>0?r:null),L=wt(),G=at(r.getTime()>0?r:null),$=h.length>0?h:F,D=$.filter(n=>n.type==="gotcha"),l=$.filter(n=>n.type==="decision"),g=$.filter(n=>n.type==="attempt").filter(n=>n.result==="failed"||n.result==="partial"),W=$.filter(n=>n.type==="preference"),it=$.slice(-8),B=ft($),w=r.getTime()===0?"all time":r.toLocaleString("en-GB",{day:"2-digit",month:"short",hour:"2-digit",minute:"2-digit"}),I=["sessions.jsonl"];(o.working||o.intent)&&I.push("context-state.json"),s&&I.push("theme.json"),c.capabilities?.length&&I.push("contract.json"),y&&I.push("adoption_profile.json"),k.length&&I.push("git log");const P=D.length,U=l.length,V=g.length;let C=Math.min(P*20,40)+Math.min(U*15,30)+Math.min(V*15,20);C=Math.min(C,100);const pt=C>=80?"A":C>=60?"B":C>=40?"C":C>=20?"D":"F",e=[`# \u{1F525} infernoflow Handoff \u2014 ${b}`,`> Generated: ${d}${t?` | Handing off to: **${t}**`:""}`,`> Session: **#${H}** \xB7 ${v} \xB7 **${h.length} entries** \xB7 Health: **${pt}** (${C}/100)`,`> Sources: ${I.join(" \xB7 ")}${x?` \xB7 IDE: ${x}`:""}`,"","---",""];if((o.working||o.intent)&&(e.push("## \u{1F3AF} Working on",""),o.working&&e.push(`**${o.working}** _(${Z(o.workingUpdated)})_`),o.intent&&e.push(`Intent: ${o.intent} _(${Z(o.intentUpdated)})_`),e.push("")),D.length&&(e.push(`## \u26A0\uFE0F STOP \u2014 Read These Before Doing Anything (${D.length} gotcha${D.length===1?"":"s"})`,""),D.forEach((n,p)=>{e.push(`${p+1}. **${n.summary}**`);const f=n.file||n.source;if(f&&/[\\/.]/.test(f)){const J=n.line?`${f}:${n.line}`:f;e.push(` \u2192 File: \`${J}\``)}}),e.push("")),l.length&&(e.push("## \u2713 Decisions In Effect \u2014 Follow These",""),l.forEach((n,p)=>{const f=n.result?` \u2192 **${n.result}**`:"";e.push(`${p+1}. ${n.summary}${f}`)}),e.push("")),g.length&&(e.push("## \u274C Already Tried \u2014 Don't Repeat",""),g.forEach((n,p)=>{const f=n.file||n.source,J=f&&/[\\/.]/.test(f)?` (\`${f}\`)`:"";e.push(`${p+1}. ${n.summary}${J} _(${Z(n.ts)})_`)}),e.push("")),G.length){e.push("## \u{1F4C1} Hot Files This Session","");for(const{file:n,edits:p}of G)e.push(`- \`${n}\` \u2014 ${p} edit${p!==1?"s":""}`);e.push("")}if(W.length){e.push("## Developer preferences","");for(const n of W)e.push(`- ${n.summary}`);e.push("")}if(k.length||L){if(e.push("## Git activity this session",""),k.length){e.push("**Commits:**");for(const n of k)e.push(`- \`${n}\``);e.push("")}L&&(e.push("**Uncommitted changes:**"),e.push("```"),e.push(L.split(`
4
4
  `).slice(0,15).join(`
5
- `)),t.push("```"),t.push(""))}if(s){if(t.push("## Design system",""),s.fonts?.primary&&t.push(`- **Font:** ${s.fonts.primary}${s.fonts.mono?` \xB7 mono: ${s.fonts.mono}`:""}`),s.colors?.mode&&t.push(`- **Mode:** ${s.colors.mode}`),s.colors?.palette){const e=Object.entries(s.colors.palette).map(([p,f])=>`${p}=${f}`).join(" ");t.push(`- **Palette:** ${e}`)}if(s.cssVars&&Object.keys(s.cssVars).length){const e=Object.entries(s.cssVars).slice(0,6).map(([p,f])=>`${p}: ${f}`).join(" | ");t.push(`- **CSS vars:** ${e}`)}s.framework&&t.push(`- **Framework:** ${s.framework}`),t.push("","> \u26A0 Always match these exactly. Do not introduce new colors or fonts.","")}return j.length&&(t.push("## Capability contract",""),t.push(`Project: **${k}** v${A}`),t.push(`Capabilities: ${j.join(", ")}`),t.push("")),t.push("---"),t.push(`_Session #${x} \xB7 ${H} \xB7 Generated by infernoflow._`),t.join(`
6
- `)}async function jt(o){const i=l=>o.includes(l),a=l=>{const g=o.indexOf(l);return g!==-1&&o[g+1]?o[g+1]:null},n=i("--show")||i("-s"),c=i("--copy")||i("-c"),s=i("--json"),y=i("--all"),$=a("--since"),r=a("--to")||o.find(l=>!l.startsWith("-")&&!["switch"].includes(l))||null;console.log(`
7
- `+K("\u{1F525} infernoflow \u2014 switch")),console.log(" "+"\u2500".repeat(50)+`
8
- `);const h=m.join(process.cwd(),".ai-memory");if(!v.existsSync(b)&&!v.existsSync(h)&&(console.error(ht(` \u2718 not initialized \u2014 run: infernoflow init
9
- `)),process.exit(1)),n){const l=lt(R().handoff)||lt(wt);if(!l){console.log(X(` \u26A0 No handoff yet \u2014 run: infernoflow switch
10
- `));return}console.log(l);return}const E=Dt(r,$,y);if(s){const l=u(q)||{},g=u(Q)||{},W=u(Y),_=u(Z),V=et(),S=ot(V,$,y),it=V.filter(z=>new Date(z.ts||0)>S),I=st(S.getTime()>0?S:null),J=nt();console.log(JSON.stringify({state:l,contract:{policyId:g.policyId,policyVersion:g.policyVersion,capabilities:g.capabilities},theme:W,adoption:_,sessions:it,commits:I,ide:J,sessionStart:S.toISOString(),sessionId:S.getTime()>0?S.getTime().toString(16).slice(-6).toUpperCase():"ALL",sessionDuration:tt(S.getTime()>0?Date.now()-S.getTime():-1),generatedAt:new Date().toISOString()},null,2));return}v.writeFileSync(R().handoff,E,"utf8"),console.log(ct(" \u2714 Written \u2192 "+m.relative(process.cwd(),R().handoff)+`
11
- `));const F=et(),d=ot(F,$,y),k=F.filter(l=>new Date(l.ts||0)>d),A=u(q)||{},j=u(Y),G=u(Q)||{},B=st(d.getTime()>0?d:null),H=at(d.getTime()>0?d:null),x=nt(),N=k.length>0?k:F.slice(-5),L=ft(N),P=tt(d.getTime()>0?Date.now()-d.getTime():-1),w=d.getTime()>0?d.getTime().toString(16).slice(-6).toUpperCase():"ALL";console.log(" "+K("Handoff ready")),console.log(" "+"\u2500".repeat(50)),console.log(" "+rt("Session #"+w+" \xB7 "+P)),A.working&&console.log(" Working on "+O(A.working)),A.intent&&console.log(" Intent "+O(A.intent)),console.log(" Memory "+k.length+" entries this session (total: "+F.length+")"),L.length&&console.log(" Open threads "+X(L.length+" unresolved")),B.length&&console.log(" Git commits "+B.length+" this session"),H.length&&console.log(" Hot files "+H.map(l=>O(l.file)).join(", ")),console.log(" Capabilities "+(G.capabilities||[]).length+" registered"),j?.fonts?.primary&&console.log(" Font "+j.fonts.primary),j?.colors?.mode&&console.log(" Color mode "+j.colors.mode),x&&console.log(" IDE "+x),r&&console.log(" Handing off \u2192 "+O(r)),console.log();const D=m.relative(process.cwd(),R().handoff)||".ai-memory/handoff.md";if(c){const l=St(E);console.log(l?ct(" \u2714 Copied to clipboard \u2014 paste at the start of your next AI session"):X(" \u26A0 Clipboard failed \u2014 open "+D+" manually"))}else console.log(" "+K("Ready to use:")),console.log(" "+O("1.")+" Open "+O(D)),console.log(" "+O("2.")+" Copy all"),console.log(" "+O("3.")+" Paste at the start of your next AI session"),console.log(" "+rt(" tip: use --copy to skip steps 1-2 automatically"));if(console.log(),v.existsSync(R().sessions)){const l={ts:new Date().toISOString(),agent:"infernoflow",type:"handoff",summary:r?`Handed off to ${r}`:"Handoff generated"};mt(process.cwd(),l)}}export{jt as switchCommand};
5
+ `)),e.push("```"),e.push(""))}if(s){if(e.push("## Design system",""),s.fonts?.primary&&e.push(`- **Font:** ${s.fonts.primary}${s.fonts.mono?` \xB7 mono: ${s.fonts.mono}`:""}`),s.colors?.mode&&e.push(`- **Mode:** ${s.colors.mode}`),s.colors?.palette){const n=Object.entries(s.colors.palette).map(([p,f])=>`${p}=${f}`).join(" ");e.push(`- **Palette:** ${n}`)}if(s.cssVars&&Object.keys(s.cssVars).length){const n=Object.entries(s.cssVars).slice(0,6).map(([p,f])=>`${p}: ${f}`).join(" | ");e.push(`- **CSS vars:** ${n}`)}s.framework&&e.push(`- **Framework:** ${s.framework}`),e.push("","> \u26A0 Always match these exactly. Do not introduce new colors or fonts.","")}return j.length&&(e.push("## Capability contract",""),e.push(`Project: **${b}** v${N}`),e.push(`Capabilities: ${j.join(", ")}`),e.push("")),e.push("---"),e.push(`_Session #${H} \xB7 ${v} \xB7 Generated by infernoflow._`),e.join(`
6
+ `)}async function Ft(t){const i=l=>t.includes(l),a=l=>{const g=t.indexOf(l);return g!==-1&&t[g+1]?t[g+1]:null},o=i("--show")||i("-s"),c=i("--copy")||i("-c"),s=i("--json"),y=i("--all"),S=a("--since"),r=a("--to")||t.find(l=>!l.startsWith("-")&&!["switch"].includes(l))||null;console.log(`
7
+ `+z("\u{1F525} infernoflow \u2014 switch")),console.log(" "+"\u2500".repeat(50)+`
8
+ `);const h=m.join(process.cwd(),".ai-memory");if(!A.existsSync(_)&&!A.existsSync(h)&&(console.error(ut(` \u2718 not initialized \u2014 run: infernoflow init
9
+ `)),process.exit(1)),o){const l=lt(M().handoff)||lt(mt);if(!l){console.log(K(` \u26A0 No handoff yet \u2014 run: infernoflow switch
10
+ `));return}console.log(l);return}const F=St(r,S,y);if(s){const l=u(X)||{},g=u(q)||{},W=u(Q),it=u(Y),B=et(),w=ot(B,S,y),I=B.filter(V=>new Date(V.ts||0)>w),P=st(w.getTime()>0?w:null),U=nt();console.log(JSON.stringify({state:l,contract:{policyId:g.policyId,policyVersion:g.policyVersion,capabilities:g.capabilities},theme:W,adoption:it,sessions:I,commits:P,ide:U,sessionStart:w.toISOString(),sessionId:w.getTime()>0?w.getTime().toString(16).slice(-6).toUpperCase():"ALL",sessionDuration:tt(w.getTime()>0?Date.now()-w.getTime():-1),generatedAt:new Date().toISOString()},null,2));return}A.writeFileSync(M().handoff,F,"utf8"),console.log(ct(" \u2714 Written \u2192 "+m.relative(process.cwd(),M().handoff)+`
11
+ `));const E=et(),d=ot(E,S,y),b=E.filter(l=>new Date(l.ts||0)>d),N=u(X)||{},j=u(Q),x=u(q)||{},R=st(d.getTime()>0?d:null),v=at(d.getTime()>0?d:null),H=nt(),k=b.length>0?b:E.slice(-5),L=ft(k),G=tt(d.getTime()>0?Date.now()-d.getTime():-1),$=d.getTime()>0?d.getTime().toString(16).slice(-6).toUpperCase():"ALL";console.log(" "+z("Handoff ready")),console.log(" "+"\u2500".repeat(50)),console.log(" "+rt("Session #"+$+" \xB7 "+G)),N.working&&console.log(" Working on "+O(N.working)),N.intent&&console.log(" Intent "+O(N.intent)),console.log(" Memory "+b.length+" entries this session (total: "+E.length+")"),L.length&&console.log(" Open threads "+K(L.length+" unresolved")),R.length&&console.log(" Git commits "+R.length+" this session"),v.length&&console.log(" Hot files "+v.map(l=>O(l.file)).join(", ")),console.log(" Capabilities "+(x.capabilities||[]).length+" registered"),j?.fonts?.primary&&console.log(" Font "+j.fonts.primary),j?.colors?.mode&&console.log(" Color mode "+j.colors.mode),H&&console.log(" IDE "+H),r&&console.log(" Handing off \u2192 "+O(r)),console.log();const D=m.relative(process.cwd(),M().handoff)||".ai-memory/handoff.md";if(c){const l=yt(F);console.log(l?ct(" \u2714 Copied to clipboard \u2014 paste at the start of your next AI session"):K(" \u26A0 Clipboard failed \u2014 open "+D+" manually"))}else console.log(" "+z("Ready to use:")),console.log(" "+O("1.")+" Open "+O(D)),console.log(" "+O("2.")+" Copy all"),console.log(" "+O("3.")+" Paste at the start of your next AI session"),console.log(" "+rt(" tip: use --copy to skip steps 1-2 automatically"));if(console.log(),A.existsSync(M().sessions)){const l={ts:new Date().toISOString(),agent:"infernoflow",type:"handoff",summary:r?`Handed off to ${r}`:"Handoff generated"};gt(process.cwd(),l)}}export{Ft as switchCommand};
@@ -1 +1 @@
1
- import*as c from"node:fs";import*as t from"node:path";const d=["package.json","Cargo.toml","pyproject.toml","go.mod","Gemfile","composer.json","deno.json","deno.jsonc","build.gradle","build.gradle.kts","pom.xml","mix.exs"],j=[/\.sln$/i,/\.csproj$/i,/\.fsproj$/i,/\.vbproj$/i],u=new Map;function h(o){for(const n of d)if(c.existsSync(t.join(o,n)))return!0;return!1}function y(o){try{for(const n of c.readdirSync(o))for(const i of j)if(i.test(n))return!0}catch{}return!1}function x(o=process.cwd()){const n=t.resolve(o);if(u.has(n))return u.get(n);const i=r=>t.dirname(r)===r;let e=n;for(;;){if(!i(e)&&(c.existsSync(t.join(e,".ai-memory"))||c.existsSync(t.join(e,"inferno"))))return f(n,e);const r=t.dirname(e);if(r===e)break;e=r}for(e=n;;){if(!i(e)&&(c.existsSync(t.join(e,".git"))||h(e)||y(e)))return f(n,e);const r=t.dirname(e);if(r===e)break;e=r}return f(n,n)}function f(o,n){return u.set(o,n),n}function S(){u.clear()}function g(o,n=6){const i=[],e=new Set,r=new Set(["node_modules",".git","dist","build","out","bin","obj",".next",".nuxt",".angular",".svelte-kit","coverage","vendor","target",".venv","venv","__pycache__",".pytest_cache"]);function m(a,l){if(l>n||e.has(a))return;e.add(a);let p;try{p=c.readdirSync(a,{withFileTypes:!0})}catch{return}for(const s of p)s.isDirectory()&&(r.has(s.name)||(s.name===".ai-memory"&&i.push({kind:"amp",path:t.join(a,s.name)}),s.name==="inferno"&&i.push({kind:"legacy",path:t.join(a,s.name)}),m(t.join(a,s.name),l+1)))}return m(t.resolve(o),0),i}export{S as _resetProjectRootCache,g as findAllMemoryDirs,x as findProjectRoot};
1
+ import*as a from"node:fs";import*as t from"node:path";const d=["package.json","Cargo.toml","pyproject.toml","go.mod","Gemfile","composer.json","deno.json","deno.jsonc","build.gradle","build.gradle.kts","pom.xml","mix.exs"],j=[/\.sln$/i,/\.csproj$/i,/\.fsproj$/i,/\.vbproj$/i],f=new Map;function h(r){for(const n of d)if(a.existsSync(t.join(r,n)))return!0;return!1}function y(r){try{for(const n of a.readdirSync(r))for(const e of j)if(e.test(n))return!0}catch{}return!1}function x(r=process.cwd()){const n=t.resolve(r);if(f.has(n))return f.get(n);let e=n;for(;;){if(a.existsSync(t.join(e,".ai-memory"))||a.existsSync(t.join(e,"inferno")))return c(n,e);const o=t.dirname(e);if(o===e)break;e=o}for(e=n;;){if(a.existsSync(t.join(e,".git"))||h(e)||y(e))return c(n,e);const o=t.dirname(e);if(o===e)break;e=o}return c(n,n)}function c(r,n){return f.set(r,n),n}function S(){f.clear()}function g(r,n=6){const e=[],o=new Set,p=new Set(["node_modules",".git","dist","build","out","bin","obj",".next",".nuxt",".angular",".svelte-kit","coverage","vendor","target",".venv","venv","__pycache__",".pytest_cache"]);function u(s,m){if(m>n||o.has(s))return;o.add(s);let l;try{l=a.readdirSync(s,{withFileTypes:!0})}catch{return}for(const i of l)i.isDirectory()&&(p.has(i.name)||(i.name===".ai-memory"&&e.push({kind:"amp",path:t.join(s,i.name)}),i.name==="inferno"&&e.push({kind:"legacy",path:t.join(s,i.name)}),u(t.join(s,i.name),m+1)))}return u(t.resolve(r),0),e}export{S as _resetProjectRootCache,g as findAllMemoryDirs,x as findProjectRoot};
@@ -1,14 +1,13 @@
1
- import*as u from"node:fs";import*as y from"node:path";import{execSync as j}from"node:child_process";import{readEntries as v,readConfig as x}from"./amp/io.mjs";const g="<!-- infernoflow:start -->",m="<!-- infernoflow:end -->",w=[".cursorrules","CLAUDE.md",y.join(".github","copilot-instructions.md")],k=4,C=5,S=200;function A(e){const o=e&&e.config||{},t=o.injection&&typeof o.injection=="object"?o.injection:{},n=Array.isArray(o.inject)&&!o.inject.includes("all")?o.inject:null,r=["full","compact","off"].includes(t.protocolStyle)?t.protocolStyle:"compact",s=t.includeProtocol===!1?"off":r;return{maxEntries:Number.isInteger(t.maxEntries)&&t.maxEntries>=0?t.maxEntries:k,maxCommits:Number.isInteger(t.maxCommits)&&t.maxCommits>=0?t.maxCommits:C,maxEntryChars:Number.isInteger(t.maxEntryChars)&&t.maxEntryChars>0?t.maxEntryChars:S,targets:Array.isArray(t.targets)&&t.targets.length?t.targets:n||w,protocolStyle:s,includeProtocol:s!=="off"}}function T(e){if(!u.existsSync(e))return{stripped:!1};const o=u.readFileSync(e,"utf8"),t=o.indexOf(g),n=o.indexOf(m);if(t===-1||n===-1||n<=t)return{stripped:!1};const r=o.slice(0,t).replace(/\s+$/,""),s=o.slice(n+m.length).replace(/^\s+/,""),i=r&&s?r+`
1
+ import*as l from"node:fs";import*as d from"node:path";import{execSync as I}from"node:child_process";import{readEntries as j,readConfig as _}from"./amp/io.mjs";const y="<!-- infernoflow:start -->",f="<!-- infernoflow:end -->",x=[".cursorrules","CLAUDE.md",d.join(".github","copilot-instructions.md")],b=4,A=5,C=200;function v(e){const n=e&&e.config||{},t=n.injection&&typeof n.injection=="object"?n.injection:{},o=Array.isArray(n.inject)&&!n.inject.includes("all")?n.inject:null;return{maxEntries:Number.isInteger(t.maxEntries)&&t.maxEntries>=0?t.maxEntries:b,maxCommits:Number.isInteger(t.maxCommits)&&t.maxCommits>=0?t.maxCommits:A,maxEntryChars:Number.isInteger(t.maxEntryChars)&&t.maxEntryChars>0?t.maxEntryChars:C,targets:Array.isArray(t.targets)&&t.targets.length?t.targets:o||x,includeProtocol:t.includeProtocol!==!1}}function k(e){if(!l.existsSync(e))return{stripped:!1};const n=l.readFileSync(e,"utf8"),t=n.indexOf(y),o=n.indexOf(f);if(t===-1||o===-1||o<=t)return{stripped:!1};const r=n.slice(0,t).replace(/\s+$/,""),s=n.slice(o+f.length).replace(/^\s+/,""),i=r&&s?r+`
2
2
 
3
- `+s:r||s;return u.writeFileSync(e,i?i.replace(/\s*$/,"")+`
4
- `:"","utf8"),{stripped:!0}}function E(e="compact"){return e==="off"?"":e==="full"?M():F()}function F(){return["### Memory protocol","",'Use the `amp_write` and `amp_bookmark` MCP tools **proactively** (without being asked): log a one-sentence entry when the user hits frustration (`!!` / "not working" / "retry" \u2192 `attempt`), a `decision` is made, or you learn a non-obvious `gotcha`; drop a bookmark on "bookmark this". Don\'t log what\'s re-derivable from the code. The full trigger list and field shapes are in the tool descriptions \u2014 if the `amp_*` tools aren\'t visible, load them first (Claude Code: `ToolSearch` with query `infernoflow`).'].join(`
5
- `)}function M(){const e=[];return e.push("### Memory protocol \u2014 capture as you go"),e.push(""),e.push("You have the `amp_write` MCP tool. **Use it proactively** (without the user asking) whenever you detect any of these moments. Capture the lesson in one sentence so the next AI session inherits it."),e.push(""),e.push("**If `amp_write` is not in your visible tools**, your client uses deferred MCP loading \u2014 call your tool-discovery mechanism (Claude Code: `ToolSearch` with query `infernoflow`) to load the `amp_*` tools BEFORE proceeding. Don't silently skip the protocol because the tool isn't visible yet."),e.push(""),e.push("| When you see\u2026 | Call `amp_write` with\u2026 |"),e.push("|---|---|"),e.push("| User types `!!`, `!!!`, `not working`, `still broken`, `no change`, `same error`, `retry` / `retrying`, repeated frustration | `{type: 'attempt', msg: '<one-line: what was tried and how it failed>', file: '<active file>'}` |"),e.push("| You generate a plan, numbered steps, or `Plan:` / `Approach:` block | `{type: 'note', msg: 'Plan: <one-line summary>', file: '<focus file>'}` |"),e.push("| User picks X over Y, decides an architectural approach, or you both agree on a direction | `{type: 'decision', msg: '<X> chosen over <Y> because <reason>', file: '<file>'}` |"),e.push("| Discovered non-obvious behavior, API quirk, or `aha \u2014 turns out\u2026` moment | `{type: 'gotcha', msg: '<one-line>', file: '<file>', line: <line if known>}` |"),e.push("| User says `switching` / `back to X`, or ~30 min passed without logging | `{type: 'note', msg: 'Session snapshot \u2014 worked on: <X>. Open threads: <Y>.'}` |"),e.push(""),e.push("**Do NOT log:** typos, syntax errors, obvious bugs visible in the code, anything the next AI can infer by re-reading the file."),e.push("**Do log:** anything that taught you something non-derivable from code."),e.push("**Be concise:** entries should be one sentence. Future-you will skim them."),e.push("**Bookmark resume points:** when the user says `bookmark this` / `mark this point`, or the context window is filling up while work is mid-flight, call `amp_bookmark` with a short `label` (omit `note` to auto-capture the session transcript) \u2014 so they can jump back to that exact point in the next session."),e.push("**When you use a \u{1F525} memory entry in your reply, briefly cite it** \u2014 e.g. `\u{1F525} (from infernoflow memory) gotcha at src/api.js:42: ...` \u2014 so the user can see which guidance came from project memory vs. your own inference."),e.join(`
6
- `)}function D(e="compact"){const o=E(e);return[g,"<!-- Auto-managed by infernoflow. Don't edit between these markers. -->","## Project memory (infernoflow)","",...o?[o,""]:[],'_No entries yet. They\'ll appear here as you and your AI tools log them \u2014 run `infernoflow log "..."` or call `amp_write` from any MCP-aware AI._',m].join(`
7
- `)}function R(e){const o=e.indexOf("<!-- AMP:START -->"),t=e.indexOf("<!-- AMP:END -->");if(o===-1||t===-1||t<=o)return e;const n=e.slice(0,o).replace(/\s+$/,""),r=e.slice(t+16).replace(/^\s+/,"");return(n?n+(r?`
3
+ `+s:r||s;return l.writeFileSync(e,i?i.replace(/\s*$/,"")+`
4
+ `:"","utf8"),{stripped:!0}}function E(){const e=[];return e.push("### Memory protocol \u2014 capture as you go"),e.push(""),e.push("You have the `amp_write` MCP tool. **Use it proactively** (without the user asking) whenever you detect any of these moments. Capture the lesson in one sentence so the next AI session inherits it."),e.push(""),e.push("**If `amp_write` is not in your visible tools**, your client uses deferred MCP loading \u2014 call your tool-discovery mechanism (Claude Code: `ToolSearch` with query `infernoflow`) to load the `amp_*` tools BEFORE proceeding. Don't silently skip the protocol because the tool isn't visible yet."),e.push(""),e.push("| When you see\u2026 | Call `amp_write` with\u2026 |"),e.push("|---|---|"),e.push("| User types `!!`, `!!!`, `not working`, `still broken`, `no change`, `same error`, `retry` / `retrying`, repeated frustration | `{type: 'attempt', msg: '<one-line: what was tried and how it failed>', file: '<active file>'}` |"),e.push("| You generate a plan, numbered steps, or `Plan:` / `Approach:` block | `{type: 'note', msg: 'Plan: <one-line summary>', file: '<focus file>'}` |"),e.push("| User picks X over Y, decides an architectural approach, or you both agree on a direction | `{type: 'decision', msg: '<X> chosen over <Y> because <reason>', file: '<file>'}` |"),e.push("| Discovered non-obvious behavior, API quirk, or `aha \u2014 turns out\u2026` moment | `{type: 'gotcha', msg: '<one-line>', file: '<file>', line: <line if known>}` |"),e.push("| User says `switching` / `back to X`, or ~30 min passed without logging | `{type: 'note', msg: 'Session snapshot \u2014 worked on: <X>. Open threads: <Y>.'}` |"),e.push(""),e.push("**Do NOT log:** typos, syntax errors, obvious bugs visible in the code, anything the next AI can infer by re-reading the file."),e.push("**Do log:** anything that taught you something non-derivable from code."),e.push("**Be concise:** entries should be one sentence. Future-you will skim them."),e.push("**When you use a \u{1F525} memory entry in your reply, briefly cite it** \u2014 e.g. `\u{1F525} (from infernoflow memory) gotcha at src/api.js:42: ...` \u2014 so the user can see which guidance came from project memory vs. your own inference."),e.join(`
5
+ `)}function T(){return[y,"<!-- Auto-managed by infernoflow. Don't edit between these markers. -->","## Project memory (infernoflow)","",E(),"",'_No entries yet. They\'ll appear here as you and your AI tools log them \u2014 run `infernoflow log "..."` or call `amp_write` from any MCP-aware AI._',f].join(`
6
+ `)}function F(e){const n=e.indexOf("<!-- AMP:START -->"),t=e.indexOf("<!-- AMP:END -->");if(n===-1||t===-1||t<=n)return e;const o=e.slice(0,n).replace(/\s+$/,""),r=e.slice(t+16).replace(/^\s+/,"");return(o?o+(r?`
8
7
 
9
- `:""):"")+r}function I(e,o){const t=y.dirname(e);if(u.existsSync(t)||u.mkdirSync(t,{recursive:!0}),!u.existsSync(e))return u.writeFileSync(e,o+`
10
- `,"utf8"),{created:!0,updated:!1};let n=u.readFileSync(e,"utf8");n=R(n);const r=n.indexOf(g),s=n.indexOf(m);if(r===-1||s===-1){const d=o+`
8
+ `:""):"")+r}function S(e,n){const t=d.dirname(e);if(l.existsSync(t)||l.mkdirSync(t,{recursive:!0}),!l.existsSync(e))return l.writeFileSync(e,n+`
9
+ `,"utf8"),{created:!0,updated:!1};let o=l.readFileSync(e,"utf8");o=F(o);const r=o.indexOf(y),s=o.indexOf(f);if(r===-1||s===-1){const g=n+`
11
10
 
12
- `+n;return u.writeFileSync(e,d,"utf8"),{created:!1,updated:!0}}const i=n.slice(0,r),p=n.slice(s+m.length),l=i+o+p;return l===n?{created:!1,updated:!1}:(u.writeFileSync(e,l,"utf8"),{created:!1,updated:!0})}function B(e){const{protocolStyle:o}=A(x(e)),t=D(o),n=[];for(const r of w){const s=y.join(e,r);try{const i=I(s,t);n.push({rel:r,...i})}catch(i){n.push({rel:r,error:i.message})}}return n}function N(e){return v(e)}function P(e,o=10){try{return j(`git log --pretty=format:"%h%x09%ad%x09%s" --date=short -n ${o}`,{cwd:e,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).split(`
13
- `).filter(Boolean).map(n=>{const[r,s,i]=n.split(" ");return{hash:(r||"").slice(0,7),date:s||"",subject:i||""}})}catch{return[]}}function O(e,o={}){const{maxEntries:t=k,maxCommits:n=C,maxEntryChars:r=S,protocolStyle:s="compact",includeProtocol:i=!0}=o,p=N(e),l=P(e,n);p.sort((a,h)=>{const f=typeof a.ts=="number"?a.ts:Date.parse(a.ts||0);return(typeof h.ts=="number"?h.ts:Date.parse(h.ts||0))-f});const d=p.slice(0,t),_={gotcha:"\u26A0",decision:"\u2713",attempt:"\u2717",note:"\xB7",detection:"\u25CB",pattern:"\u25C7"},c=[];if(c.push(g),c.push("<!-- Auto-managed by infernoflow. Don't edit between these markers. -->"),c.push("## Project memory (infernoflow)"),c.push(""),i&&s!=="off"&&(c.push(E(s)),c.push("")),l.length>0){c.push("### Recent commits");for(const a of l)c.push(`- \`${a.hash}\` _${a.date}_ ${a.subject}`);c.push("")}if(d.length>0){c.push("### Recent memory");for(const a of d){const h=a.file?` (\`${a.file}${a.line?":"+a.line:""}\`)`:"",f=(a.msg||a.summary||"").replace(/\n/g," "),b=r&&f.length>r?f.slice(0,r).trimEnd()+"\u2026":f;c.push(`- \u{1F525} ${_[a.type]||"\xB7"} **${a.type||"note"}**${h}: ${b}`)}c.push("")}return p.length===0&&l.length===0&&c.push('_No entries yet. They\'ll appear here as you and your AI tools log them \u2014 run `infernoflow log "..."` or call `amp_write` from any MCP-aware AI._'),c.push(m),c.join(`
14
- `)}function L(e){const o=A(x(e)),t=O(e,o),n=i=>String(i).replace(/\\/g,"/"),r=new Set(o.targets.map(n)),s=[];for(const i of w){const p=y.join(e,i);try{if(r.has(n(i))){const l=I(p,t);s.push({rel:i,...l})}else T(p).stripped&&s.push({rel:i,stripped:!0})}catch(l){s.push({rel:i,error:l.message})}}return s}export{L as refreshRuleFilesFromMemory,A as resolveInjectionSettings,B as writeInitRuleFiles};
11
+ `+o;return l.writeFileSync(e,g,"utf8"),{created:!1,updated:!0}}const i=o.slice(0,r),p=o.slice(s+f.length),u=i+n+p;return u===o?{created:!1,updated:!1}:(l.writeFileSync(e,u,"utf8"),{created:!1,updated:!0})}function $(e){const n=T(),t=[];for(const o of x){const r=d.join(e,o);try{const s=S(r,n);t.push({rel:o,...s})}catch(s){t.push({rel:o,error:s.message})}}return t}function D(e){return j(e)}function M(e,n=10){try{return I(`git log --pretty=format:"%h%x09%ad%x09%s" --date=short -n ${n}`,{cwd:e,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).split(`
12
+ `).filter(Boolean).map(o=>{const[r,s,i]=o.split(" ");return{hash:(r||"").slice(0,7),date:s||"",subject:i||""}})}catch{return[]}}function R(e,n={}){const{maxEntries:t=b,maxCommits:o=A,maxEntryChars:r=C,includeProtocol:s=!0}=n,i=D(e),p=M(e,o);i.sort((c,m)=>{const h=typeof c.ts=="number"?c.ts:Date.parse(c.ts||0);return(typeof m.ts=="number"?m.ts:Date.parse(m.ts||0))-h});const u=i.slice(0,t),g={gotcha:"\u26A0",decision:"\u2713",attempt:"\u2717",note:"\xB7",detection:"\u25CB",pattern:"\u25C7"},a=[];if(a.push(y),a.push("<!-- Auto-managed by infernoflow. Don't edit between these markers. -->"),a.push("## Project memory (infernoflow)"),a.push(""),s&&(a.push(E()),a.push("")),p.length>0){a.push("### Recent commits");for(const c of p)a.push(`- \`${c.hash}\` _${c.date}_ ${c.subject}`);a.push("")}if(u.length>0){a.push("### Recent memory");for(const c of u){const m=c.file?` (\`${c.file}${c.line?":"+c.line:""}\`)`:"",h=(c.msg||c.summary||"").replace(/\n/g," "),w=r&&h.length>r?h.slice(0,r).trimEnd()+"\u2026":h;a.push(`- \u{1F525} ${g[c.type]||"\xB7"} **${c.type||"note"}**${m}: ${w}`)}a.push("")}return i.length===0&&p.length===0&&a.push('_No entries yet. They\'ll appear here as you and your AI tools log them \u2014 run `infernoflow log "..."` or call `amp_write` from any MCP-aware AI._'),a.push(f),a.join(`
13
+ `)}function P(e){const n=v(_(e)),t=R(e,n),o=i=>String(i).replace(/\\/g,"/"),r=new Set(n.targets.map(o)),s=[];for(const i of x){const p=d.join(e,i);try{if(r.has(o(i))){const u=S(p,t);s.push({rel:i,...u})}else k(p).stripped&&s.push({rel:i,stripped:!0})}catch(u){s.push({rel:i,error:u.message})}}return s}export{P as refreshRuleFilesFromMemory,v as resolveInjectionSettings,$ as writeInitRuleFiles};
@@ -1,6 +1,6 @@
1
- function i(){return process.platform==="win32"?!!(process.env.WT_SESSION||process.env.ConEmuPID||process.env.TERM_PROGRAM==="vscode"):!0}const t=i()?{h:"\u2500",v:"\u2502",tl:"\u250C",tr:"\u2510",bl:"\u2514",br:"\u2518",dot:"\xB7",arrow:"\u2192",check:"\u2714",cross:"\u2718",warn:"\u26A0",fire:"\u{1F525}"}:{h:"-",v:"|",tl:"+",tr:"+",bl:"+",br:"+",dot:"*",arrow:"->",check:"[OK]",cross:"[X]",warn:"[!]",fire:"**"},f=t.h.repeat(50),e={reset:"\x1B[0m",bold:"\x1B[1m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",cyan:"\x1B[36m",white:"\x1B[37m",gray:"\x1B[90m",orange:"\x1B[38;5;208m"},u=!process.stdout.isTTY||process.env.NO_COLOR;function n(o,r){return u?r:`${o}${r}${e.reset}`}const l=o=>n(e.bold,o),s=o=>n(e.red,o),b=o=>n(e.green,o),p=o=>n(e.yellow,o),a=o=>n(e.cyan,o),c=o=>n(e.gray,o),g=o=>n(e.white,o),y=o=>n(e.orange,o),d=o=>n(e.bold+e.red,o),w=o=>n(e.bold+e.green,o),h=o=>n(e.bold+e.yellow,o),m=o=>n(e.bold+e.orange,o);function v(o){return o.replace(/\x1b\[[0-9;]*m/g,"")}function O(o){const r=m(t.fire+" infernoflow")+c(" \u2014 "+o);console.log(`
1
+ function i(){return process.platform==="win32"?!!(process.env.WT_SESSION||process.env.ConEmuPID||process.env.TERM_PROGRAM==="vscode"):!0}const t=i()?{h:"\u2500",v:"\u2502",tl:"\u250C",tr:"\u2510",bl:"\u2514",br:"\u2518",dot:"\xB7",arrow:"\u2192",check:"\u2714",cross:"\u2718",warn:"\u26A0",fire:"\u{1F525}"}:{h:"-",v:"|",tl:"+",tr:"+",bl:"+",br:"+",dot:"*",arrow:"->",check:"[OK]",cross:"[X]",warn:"[!]",fire:"**"},f=t.h.repeat(50),e={reset:"\x1B[0m",bold:"\x1B[1m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",cyan:"\x1B[36m",white:"\x1B[37m",gray:"\x1B[90m",orange:"\x1B[38;5;208m"};function u(){return!process.stdout.isTTY||!!process.env.NO_COLOR}function n(o,r){return u()?r:`${o}${r}${e.reset}`}const l=o=>n(e.bold,o),s=o=>n(e.red,o),b=o=>n(e.green,o),p=o=>n(e.yellow,o),a=o=>n(e.cyan,o),c=o=>n(e.gray,o),g=o=>n(e.white,o),y=o=>n(e.orange,o),d=o=>n(e.bold+e.red,o),w=o=>n(e.bold+e.green,o),h=o=>n(e.bold+e.yellow,o),m=o=>n(e.bold+e.orange,o);function v(o){return o.replace(/\x1b\[[0-9;]*m/g,"")}function O(o){const r=m(t.fire+" infernoflow")+c(" \u2014 "+o);console.log(`
2
2
  `+r),console.log(c(f))}function R(o){console.log(" "+b(t.check)+" "+o)}function E(o,r){console.log(" "+s(t.cross)+" "+s(o)),r&&console.log(" "+c(t.arrow+" "+r))}function S(o){console.log(" "+p(t.warn)+" "+p(o))}function k(o){console.log(" "+a("\u2139")+" "+o)}function C(o){console.log(`
3
3
  `+l(g(o)))}function T(o){console.log(`
4
4
  `+w("\u2728 "+o)+`
5
5
  `)}function A(o){console.log(l("Next steps:")),o.forEach((r,x)=>{console.log(" "+c(x+1+".")+" "+r)}),console.log()}function N(o,r){console.error(`
6
- `+d("Error: ")+s(o)),r&&console.error(c(" \u2192 "+r)),console.error(),process.exit(1)}export{t as CHARS,f as HR,l as bold,w as boldGreen,m as boldOrange,d as boldRed,h as boldYellow,a as cyan,T as done,N as errorAndExit,E as fail,c as gray,b as green,O as header,k as info,A as nextSteps,R as ok,y as orange,s as red,C as section,S as warn,g as white,p as yellow};
6
+ `+d("Error: ")+s(o)),r&&console.error(c(" \u2192 "+r)),console.error(),process.exit(1)}export{t as CHARS,f as HR,l as bold,w as boldGreen,m as boldOrange,d as boldRed,h as boldYellow,a as cyan,T as done,N as errorAndExit,E as fail,c as gray,b as green,O as header,k as info,A as nextSteps,u as noColor,R as ok,y as orange,s as red,C as section,S as warn,g as white,p as yellow};