infernoflow 0.38.4 → 0.38.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -239,6 +239,17 @@
239
239
  - v0.37.3 — remove Scarf, zero-dep install, no more Windows hang
240
240
  - v0.37.3 — remove @scarf/scarf to fix Windows install hang
241
241
 
242
+ - v0.38.5 — fix cloud push: use anon key + user_token
243
+ - v0.38.4 — login via GitHub Device Flow, no redirects
244
+ - v0.38.3 — fix login: use implicit flow
245
+ - v0.38.2 — fix login PKCE flow
246
+ - v0.38.1
247
+ - v0.38.0 — cloud login + auto-push to Supabase on every log
248
+ - v0.38.0 — cloud login, auto-push to Supabase on every log
249
+ - v0.37.4
250
+ - v0.37.3 — remove Scarf, zero-dep install, no more Windows hang
251
+ - v0.37.3 — remove @scarf/scarf to fix Windows install hang
252
+
242
253
  ## 0.10.25 — 2026-04-22
243
254
 
244
255
  ### Added
@@ -1 +1 @@
1
- import*as m from"node:https";const n=process.env.INFERNOFLOW_SUPABASE_URL||"https://vscesbbtmrsctfroigyx.supabase.co",f=process.env.INFERNOFLOW_SUPABASE_ANON_KEY||"sb_publishable_yThoZzOisgqLxrH8BOli-Q_yHVqEhUk";function i(t,e,r,s){return new Promise((h,l)=>{const c=new URL(e),a=r?JSON.stringify(r):null,y={hostname:c.hostname,port:443,path:c.pathname+c.search,method:t,headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":"infernoflow-cli",apikey:f,...s,...a?{"Content-Length":Buffer.byteLength(a)}:{}}},o=m.request(y,u=>{let p="";u.on("data",d=>p+=d),u.on("end",()=>{try{h({status:u.statusCode,body:JSON.parse(p)})}catch{h({status:u.statusCode,body:p})}})});o.on("error",l),o.setTimeout(8e3,()=>{o.destroy(new Error("timeout"))}),a&&o.write(a),o.end()})}async function A(t,e,r){try{const s={project_id:r,ts:t.ts,type:t.type||"note",summary:t.summary,result:t.result||null,source:t.source||null,auto:t.auto||!1,agent:t.agent||null};await i("POST",`${n}/rest/v1/entries`,s,{Authorization:`Bearer ${e}`,Prefer:"return=minimal"})}catch{}}async function S(t){return await i("POST",`${n}/auth/v1/token?grant_type=pkce`,{auth_code:t},{})}function _(t,e){const r=new URLSearchParams({provider:"github",redirect_to:e,state:t});return`${n}/auth/v1/authorize?${r.toString()}`}async function g(t){const e=await i("GET",`${n}/auth/v1/user`,null,{Authorization:`Bearer ${t}`});return e.status===200?e.body:null}async function E(t,e){const r=new URLSearchParams({project_id:`eq.${e}`,order:"ts.asc",limit:"10000"}),s=await i("GET",`${n}/rest/v1/entries?${r.toString()}`,null,{Authorization:`Bearer ${t}`});return s.status===200&&Array.isArray(s.body)?s.body:[]}export{f as SUPABASE_ANON_KEY,n as SUPABASE_URL,S as exchangeCodeForSession,_ as getOAuthUrl,g as getUser,E as pullEntries,A as pushEntry};
1
+ import*as f from"node:https";const n=process.env.INFERNOFLOW_SUPABASE_URL||"https://vscesbbtmrsctfroigyx.supabase.co",h=process.env.INFERNOFLOW_SUPABASE_ANON_KEY||"sb_publishable_yThoZzOisgqLxrH8BOli-Q_yHVqEhUk";function i(t,e,r,s){return new Promise((l,y)=>{const c=new URL(e),a=r?JSON.stringify(r):null,d={hostname:c.hostname,port:443,path:c.pathname+c.search,method:t,headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":"infernoflow-cli",apikey:h,...s,...a?{"Content-Length":Buffer.byteLength(a)}:{}}},o=f.request(d,u=>{let p="";u.on("data",m=>p+=m),u.on("end",()=>{try{l({status:u.statusCode,body:JSON.parse(p)})}catch{l({status:u.statusCode,body:p})}})});o.on("error",y),o.setTimeout(8e3,()=>{o.destroy(new Error("timeout"))}),a&&o.write(a),o.end()})}async function A(t,e,r){try{const s={project_id:r,user_token:e,ts:t.ts,type:t.type||"note",summary:t.summary,result:t.result||null,source:t.source||null,auto:t.auto||!1,agent:t.agent||null};await i("POST",`${n}/rest/v1/entries`,s,{Authorization:`Bearer ${h}`,apikey:h,Prefer:"return=minimal"})}catch{}}async function S(t){return await i("POST",`${n}/auth/v1/token?grant_type=pkce`,{auth_code:t},{})}function _(t,e){const r=new URLSearchParams({provider:"github",redirect_to:e,state:t});return`${n}/auth/v1/authorize?${r.toString()}`}async function g(t){const e=await i("GET",`${n}/auth/v1/user`,null,{Authorization:`Bearer ${t}`});return e.status===200?e.body:null}async function E(t,e){const r=new URLSearchParams({project_id:`eq.${e}`,order:"ts.asc",limit:"10000"}),s=await i("GET",`${n}/rest/v1/entries?${r.toString()}`,null,{Authorization:`Bearer ${t}`});return s.status===200&&Array.isArray(s.body)?s.body:[]}export{h as SUPABASE_ANON_KEY,n as SUPABASE_URL,S as exchangeCodeForSession,_ as getOAuthUrl,g as getUser,E as pullEntries,A as pushEntry};
@@ -1,18 +1,18 @@
1
- import*as s from"node:fs";import*as f from"node:path";import"node:os";import{bold as N,cyan as v,gray as n,green as j,red as I}from"../ui/output.mjs";import{readCredentials as _,isLoggedIn as R}from"../cloud/credentials.mjs";import{pushEntry as k}from"../cloud/supabase.mjs";const O="inferno",h=f.join(O,"sessions.jsonl");function A(){try{const e=s.existsSync(h)?s.readFileSync(h,"utf8").split(`
2
- `).filter(Boolean).map(t=>{try{return JSON.parse(t)}catch{return null}}).filter(Boolean):[],c=e.filter(t=>t.type==="gotcha"),r=e.filter(t=>t.type==="decision"),l=e.filter(t=>t.type==="attempt"&&(t.result==="failed"||t.result==="partial")),i=["# Project Context (auto-generated by infernoflow)","",`> Last updated: ${new Date().toISOString()}`,""];if(c.length){i.push("## \u26A0\uFE0F Known Gotchas (Read These First)","");for(const t of c)i.push(`- ${t.summary}`);i.push("")}if(r.length){i.push("## \u2713 Decisions In Effect","");for(const t of r)i.push(`- ${t.summary}`);i.push("")}if(l.length){i.push("## \u274C Things That Don't Work (Don't Try These)","");for(const t of l)i.push(`- ${t.summary}`);i.push("")}const p=i.join(`
3
- `),a=process.cwd(),u=f.join(a,"CLAUDE.md");s.existsSync(u)&&s.writeFileSync(u,p,"utf8");const m=f.join(a,".cursorrules");(s.existsSync(m)||s.existsSync(f.join(a,".cursor")))&&s.writeFileSync(m,p,"utf8");const $=f.join(a,".github","copilot-instructions.md");s.existsSync(f.join(a,".github"))&&s.writeFileSync($,p,"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(`
1
+ import*as s from"node:fs";import*as u from"node:path";import"node:os";import{bold as N,cyan as v,gray as o,green as j,red as I}from"../ui/output.mjs";import{readCredentials as _,isLoggedIn as k}from"../cloud/credentials.mjs";import{pushEntry as R}from"../cloud/supabase.mjs";const O="inferno",h=u.join(O,"sessions.jsonl");function A(){try{const e=s.existsSync(h)?s.readFileSync(h,"utf8").split(`
2
+ `).filter(Boolean).map(t=>{try{return JSON.parse(t)}catch{return null}}).filter(Boolean):[],c=e.filter(t=>t.type==="gotcha"),r=e.filter(t=>t.type==="decision"),l=e.filter(t=>t.type==="attempt"&&(t.result==="failed"||t.result==="partial")),i=["# Project Context (auto-generated by infernoflow)","",`> Last updated: ${new Date().toISOString()}`,""];if(c.length){i.push("## \u26A0\uFE0F Known Gotchas (Read These First)","");for(const t of c)i.push(`- ${t.summary}`);i.push("")}if(r.length){i.push("## \u2713 Decisions In Effect","");for(const t of r)i.push(`- ${t.summary}`);i.push("")}if(l.length){i.push("## \u274C Things That Don't Work (Don't Try These)","");for(const t of l)i.push(`- ${t.summary}`);i.push("")}const d=i.join(`
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",p="\x1B[0m",a=e.result?` [${e.result}]`:"",u=e.agent&&e.agent!=="human"?n(` (${e.agent})`):"";return` ${n(String(c+1).padStart(3))} ${n(r)} ${i}${l}${p}${a} ${e.summary}${u}`}async function K(e){const c=o=>e.includes(o),r=(o,g)=>{const d=e.indexOf(o);return d!==-1&&e[d+1]?e[d+1]:g},l=c("--show"),i=c("--clear"),p=c("--json"),a=c("--auto"),u=c("--quiet"),m=r("--source",null);if(l||p){const o=C(),g=e[e.indexOf("--show")+1],d=g&&/^\d+$/.test(g)?parseInt(g):20,w=o.slice(-d);if(p){console.log(JSON.stringify(w,null,2));return}if(console.log(`
7
- `+N("\u{1F525} infernoflow \u2014 session memory")),console.log(" "+"\u2500".repeat(50)),!w.length){console.log(n(`
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(`
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
- `));return}console.log(n(` Showing last ${w.length} of ${o.length} entries
10
- `)),w.forEach((D,T)=>console.log(J(D,o.length-w.length+T))),console.log();return}if(i){if(!s.existsSync(h)){console.log(n(` Nothing to clear.
11
- `));return}const o=h.replace(".jsonl",`-archive-${Date.now()}.jsonl`);s.renameSync(h,o),console.log(j(` \u2714 Session log archived \u2192 ${f.basename(o)}
12
- `));return}const $=new Set([r("--type",""),r("--result",""),r("--agent",""),r("--source","")].filter(Boolean)),x=e.filter(o=>!o.startsWith("--")&&!$.has(o)).join(" ").trim();if(!x){console.log(`
9
+ `));return}console.log(o(` Showing last ${S.length} of ${n.length} entries
10
+ `)),S.forEach((D,T)=>console.log(J(D,n.length-S.length+T))),console.log();return}if(i){if(!s.existsSync(h)){console.log(o(` Nothing to clear.
11
+ `));return}const n=h.replace(".jsonl",`-archive-${Date.now()}.jsonl`);s.renameSync(h,n),console.log(j(` \u2714 Session log archived \u2192 ${u.basename(n)}
12
+ `));return}const $=new Set([r("--type",""),r("--result",""),r("--agent",""),r("--source","")].filter(Boolean)),x=e.filter(n=>!n.startsWith("--")&&!$.has(n)).join(" ").trim();if(!x){console.log(`
13
13
  `+N("\u{1F525} infernoflow log")+` \u2014 append to session memory
14
- `),console.log(n(" Usage:")),console.log(n(' infernoflow log "what happened"')),console.log(n(' infernoflow log "tried X, failed because Y" --type attempt --result failed')),console.log(n(' infernoflow log "always use multipart/form-data" --type gotcha')),console.log(n(' infernoflow log "switched to dark mode" --type theme')),console.log(n(" infernoflow log --show Print last 20 entries")),console.log(n(" infernoflow log --json Print as JSON")),console.log(),console.log(n(" Types: note \xB7 attempt \xB7 decision \xB7 gotcha \xB7 preference \xB7 theme \xB7 handoff \xB7 error")),console.log(n(" Results: worked \xB7 failed \xB7 partial \xB7 unknown")),console.log(n(` Auto-capture: --auto (silent skip if no inferno/) \xB7 --quiet \xB7 --source <name>
15
- `));return}const S=r("--type","note"),y=r("--result",null),L=r("--agent",B());F.includes(S)||(u||console.error(I(` \u2718 Invalid type: ${S}. Valid: ${F.join(", ")}
16
- `)),process.exit(1)),y&&!b.includes(y)&&(u||console.error(I(` \u2718 Invalid result: ${y}. Valid: ${b.join(", ")}
17
- `)),process.exit(1));const E={ts:new Date().toISOString(),agent:L,type:S,summary:x,...y?{result:y}:{},...m?{source:m}:{},...a?{auto:!0}:{}};if(U(E,{auto:a,quiet:u})){A();try{if(R()){const o=_(),g=(()=>{try{return JSON.parse(s.readFileSync(f.join(O,"config.json"),"utf8")).projectId||f.basename(process.cwd())}catch{return f.basename(process.cwd())}})();k(E,o.access_token,g).catch(()=>{})}}catch{}if(!u){const o=S!=="note"?v(` [${S}]`):"",g=y?n(` \u2192 ${y}`):"",d=m?n(` (via ${m})`):"";console.log(j(` \u2714 Logged${o}${g}${d}: `)+x+`
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
+ `));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
+ `)),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())}})();R(E,g,p).catch(()=>{})}}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.4",
3
+ "version": "0.38.5",
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": {