infernoflow 0.38.10 → 0.38.11
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.
|
@@ -3,7 +3,7 @@ import*as s from"node:fs";import*as u from"node:path";import"node:os";import{bol
|
|
|
3
3
|
`),a=process.cwd(),f=u.join(a,"CLAUDE.md");s.existsSync(f)&&s.writeFileSync(f,d,"utf8");const m=u.join(a,".cursorrules");(s.existsSync(m)||s.existsSync(u.join(a,".cursor")))&&s.writeFileSync(m,d,"utf8");const $=u.join(a,".github","copilot-instructions.md");s.existsSync(u.join(a,".github"))&&s.writeFileSync($,d,"utf8")}catch{}}const F=["note","attempt","decision","gotcha","preference","theme","handoff","error"],b=["worked","failed","partial","unknown"];function C(){return s.existsSync(h)?s.readFileSync(h,"utf8").split(`
|
|
4
4
|
`).filter(Boolean).map(e=>{try{return JSON.parse(e)}catch{return null}}).filter(Boolean):[]}function U(e,{auto:c=!1,quiet:r=!1}={}){if(!s.existsSync(O)){if(c)return!1;r||console.error(I(` \u2718 inferno/ not found \u2014 run: infernoflow init
|
|
5
5
|
`)),process.exit(1)}return s.appendFileSync(h,JSON.stringify(e)+`
|
|
6
|
-
`,"utf8"),!0}function B(){return process.env.CURSOR_SESSION?"cursor":process.env.COPILOT_SESSION?"copilot":process.env.CLAUDE_CODE_SESSION?"claude":process.env.WINDSURF_SESSION?"windsurf":process.env.INFERNOFLOW_AGENT?process.env.INFERNOFLOW_AGENT:"human"}function J(e,c){const r=new Date(e.ts).toLocaleString("en-GB",{day:"2-digit",month:"short",hour:"2-digit",minute:"2-digit"}),l=e.type||"note",i=l==="gotcha"?"\x1B[33m":l==="decision"?"\x1B[36m":l==="theme"?"\x1B[35m":l==="preference"?"\x1B[34m":l==="attempt"?"\x1B[90m":l==="error"?"\x1B[31m":"\x1B[0m",d="\x1B[0m",a=e.result?` [${e.result}]`:"",f=e.agent&&e.agent!=="human"?o(` (${e.agent})`):"";return` ${o(String(c+1).padStart(3))} ${o(r)} ${i}${l}${d}${a} ${e.summary}${f}`}async function K(e){const c=n=>e.includes(n),r=(n,g)=>{const p=e.indexOf(n);return p!==-1&&e[p+1]?e[p+1]:g},l=c("--show"),i=c("--clear"),d=c("--json"),a=c("--auto"),f=c("--quiet"),m=r("--source",null);if(l||d){const n=C(),g=e[e.indexOf("--show")+1],p=g&&/^\d+$/.test(g)?parseInt(g):20,S=n.slice(-p);if(d){console.log(JSON.stringify(S,null,2));return}if(console.log(`
|
|
6
|
+
`,"utf8"),!0}function B(){return process.env.CURSOR_SESSION?"cursor":process.env.COPILOT_SESSION?"copilot":process.env.CLAUDE_CODE_SESSION?"claude":process.env.WINDSURF_SESSION?"windsurf":process.env.INFERNOFLOW_AGENT?process.env.INFERNOFLOW_AGENT:"human"}function J(e,c){const r=new Date(e.ts).toLocaleString("en-GB",{day:"2-digit",month:"short",hour:"2-digit",minute:"2-digit"}),l=e.type||"note",i=l==="gotcha"?"\x1B[33m":l==="decision"?"\x1B[36m":l==="theme"?"\x1B[35m":l==="preference"?"\x1B[34m":l==="attempt"?"\x1B[90m":l==="error"?"\x1B[31m":"\x1B[0m",d="\x1B[0m",a=e.result?` [${e.result}]`:"",f=e.agent&&e.agent!=="human"?o(` (${e.agent})`):"";return` ${o(String(c+1).padStart(3))} ${o(r)} ${i}${l}${d}${a} ${e.summary}${f}`}async function K(e){if(e[0]==="log")e=e.slice(1);const c=n=>e.includes(n),r=(n,g)=>{const p=e.indexOf(n);return p!==-1&&e[p+1]?e[p+1]:g},l=c("--show"),i=c("--clear"),d=c("--json"),a=c("--auto"),f=c("--quiet"),m=r("--source",null);if(l||d){const n=C(),g=e[e.indexOf("--show")+1],p=g&&/^\d+$/.test(g)?parseInt(g):20,S=n.slice(-p);if(d){console.log(JSON.stringify(S,null,2));return}if(console.log(`
|
|
7
7
|
`+N("\u{1F525} infernoflow \u2014 session memory")),console.log(" "+"\u2500".repeat(50)),!S.length){console.log(o(`
|
|
8
8
|
No entries yet. Start logging with: infernoflow log "<what happened>"
|
|
9
9
|
`));return}console.log(o(` Showing last ${S.length} of ${n.length} entries
|
|
@@ -14,5 +14,5 @@ import*as s from"node:fs";import*as u from"node:path";import"node:os";import{bol
|
|
|
14
14
|
`),console.log(o(" Usage:")),console.log(o(' infernoflow log "what happened"')),console.log(o(' infernoflow log "tried X, failed because Y" --type attempt --result failed')),console.log(o(' infernoflow log "always use multipart/form-data" --type gotcha')),console.log(o(' infernoflow log "switched to dark mode" --type theme')),console.log(o(" infernoflow log --show Print last 20 entries")),console.log(o(" infernoflow log --json Print as JSON")),console.log(),console.log(o(" Types: note \xB7 attempt \xB7 decision \xB7 gotcha \xB7 preference \xB7 theme \xB7 handoff \xB7 error")),console.log(o(" Results: worked \xB7 failed \xB7 partial \xB7 unknown")),console.log(o(` Auto-capture: --auto (silent skip if no inferno/) \xB7 --quiet \xB7 --source <name>
|
|
15
15
|
`));return}const w=r("--type","note"),y=r("--result",null),L=r("--agent",B());F.includes(w)||(f||console.error(I(` \u2718 Invalid type: ${w}. Valid: ${F.join(", ")}
|
|
16
16
|
`)),process.exit(1)),y&&!b.includes(y)&&(f||console.error(I(` \u2718 Invalid result: ${y}. Valid: ${b.join(", ")}
|
|
17
|
-
`)),process.exit(1));const E={ts:new Date().toISOString(),agent:L,type:w,summary:x,...y?{result:y}:{},...m?{source:m}:{},...a?{auto:!0}:{}};if(U(E,{auto:a,quiet:f})){A();try{if(k()){const n=_(),g=n.user_token||n.user?.id||n.user?.login||"anonymous",p=(()=>{try{return JSON.parse(s.readFileSync(u.join(O,"config.json"),"utf8")).projectId||u.basename(process.cwd())}catch{return u.basename(process.cwd())}})();await R(E,g,p)}}catch{}if(!f){const n=w!=="note"?v(` [${w}]`):"",g=y?o(` \u2192 ${y}`):"",p=m?o(` (via ${m})`):"";console.log(j(` \u2714 Logged${n}${g}${p}: `)+x+`
|
|
17
|
+
`)),process.exit(1));const E={ts:new Date().toISOString(),agent:L,type:w,summary:x,...y?{result:y}:{},...m?{source:m}:{},...a?{auto:!0}:{}};if(U(E,{auto:a,quiet:f})){A();try{if(k()){const n=_(),g=n.user_token||n.user?.id||n.user?.login||"anonymous",p=(()=>{try{return JSON.parse(s.readFileSync(u.join(O,"config.json"),"utf8")).projectId||u.basename(process.cwd())}catch{return u.basename(process.cwd())}})();await R(E,g,p).then(()=>console.error("[cloud] pushed ok")).catch(err=>console.error("[cloud] push failed:",err?.message||err))}}catch{}if(!f){const n=w!=="note"?v(` [${w}]`):"",g=y?o(` \u2192 ${y}`):"",p=m?o(` (via ${m})`):"";console.log(j(` \u2714 Logged${n}${g}${p}: `)+x+`
|
|
18
18
|
`)}}}export{K as logCommand};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "infernoflow",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.11",
|
|
4
4
|
"description": "Persistent memory for AI coding sessions — captures what agents can't infer from code alone. Works with Copilot, Cursor, Claude, and Windsurf.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|