infernoflow 0.38.1 → 0.38.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.
package/CHANGELOG.md CHANGED
@@ -221,6 +221,14 @@
221
221
  - v0.37.3 — remove Scarf, zero-dep install, no more Windows hang
222
222
  - v0.37.3 — remove @scarf/scarf to fix Windows install hang
223
223
 
224
+ - v0.38.2 — fix login PKCE flow
225
+ - v0.38.1
226
+ - v0.38.0 — cloud login + auto-push to Supabase on every log
227
+ - v0.38.0 — cloud login, auto-push to Supabase on every log
228
+ - v0.37.4
229
+ - v0.37.3 — remove Scarf, zero-dep install, no more Windows hang
230
+ - v0.37.3 — remove @scarf/scarf to fix Windows install hang
231
+
224
232
  ## 0.10.25 — 2026-04-22
225
233
 
226
234
  ### Added
@@ -1,16 +1,16 @@
1
- import*as k from"node:http";import*as L from"node:crypto";import"node:fs";import"node:path";import{bold as i,cyan as r,gray as t,green as g,red as y,yellow as x}from"../ui/output.mjs";import{readCredentials as _,writeCredentials as A,deleteCredentials as O,isLoggedIn as $}from"../cloud/credentials.mjs";import{getOAuthUrl as C,getUser as P,SUPABASE_URL as T}from"../cloud/supabase.mjs";const u=9242,w="/auth/callback",v=`http://localhost:${u}${w}`;function E(e){try{const{execSync:s}=require("child_process"),l=process.platform==="win32"?`start "" "${e}"`:process.platform==="darwin"?`open "${e}"`:`xdg-open "${e}"`;s(l,{stdio:"ignore"})}catch{}}async function U(){if(T.includes("YOUR_PROJECT")&&(console.log(),console.log(` ${y("\u2718")} Supabase not configured yet.`),console.log(),console.log(" Set up your Supabase project first:"),console.log(` ${t("1.")} Create a project at ${r("https://supabase.com")}`),console.log(` ${t("2.")} Run ${r("scripts/supabase-schema.sql")} in the SQL editor`),console.log(` ${t("3.")} Enable GitHub OAuth in Authentication \u2192 Providers`),console.log(` ${t("4.")} Set ${r("INFERNOFLOW_SUPABASE_URL")} and ${r("INFERNOFLOW_SUPABASE_ANON_KEY")}`),console.log(" (or hardcode them in lib/cloud/supabase.mjs)"),console.log(),process.exit(1)),$()){const n=_()?.user;console.log(),console.log(` ${g("\u2714")} Already logged in as ${i(n?.email||n?.user_metadata?.user_name||"unknown")}`),console.log(` Run ${r("infernoflow logout")} to sign out.`),console.log();return}const e=L.randomBytes(16).toString("hex");console.log(),console.log(` ${i("\u{1F525} infernoflow login")}`),console.log();let s,l;const d=new Promise((o,n)=>{s=o,l=n}),a=k.createServer((o,n)=>{if(new URL(o.url,`http://localhost:${u}`).pathname!==w){n.writeHead(404),n.end("Not found");return}if(o.method==="GET"){n.writeHead(200,{"Content-Type":"text/html"}),n.end(`<!DOCTYPE html>
1
+ import*as S from"node:http";import"node:crypto";import"node:https";import"node:fs";import"node:path";import{bold as a,cyan as g,gray as s,green as d,red as h,yellow as L}from"../ui/output.mjs";import{readCredentials as y,writeCredentials as x,deleteCredentials as v,isLoggedIn as _}from"../cloud/credentials.mjs";import{getUser as T,SUPABASE_URL as w}from"../cloud/supabase.mjs";const m=9242,$="/auth/callback",C=`http://localhost:${m}${$}`;function P(n){try{const{execSync:t}=require("child_process"),c=process.platform==="win32"?`start "" "${n}"`:process.platform==="darwin"?`open "${n}"`:`xdg-open "${n}"`;t(c,{stdio:"ignore"})}catch{}}async function O(){if(w.includes("YOUR_PROJECT")&&(console.log(),console.log(` ${h("\u2718")} Supabase not configured yet.`),console.log(),process.exit(1)),_()){const e=y()?.user;console.log(),console.log(` ${d("\u2714")} Already logged in as ${a(e?.email||e?.user_metadata?.user_name||"unknown")}`),console.log(` Run ${g("infernoflow logout")} to sign out.`),console.log();return}console.log(),console.log(` ${a("\u{1F525} infernoflow login")}`),console.log();let n,t;const c=new Promise((o,e)=>{n=o,t=e}),l=S.createServer((o,e)=>{if(new URL(o.url,`http://localhost:${m}`).pathname!==$){e.writeHead(404),e.end("Not found");return}if(o.method==="GET"){e.writeHead(200,{"Content-Type":"text/html"}),e.end(`<!DOCTYPE html>
2
2
  <html>
3
3
  <head><meta charset="utf-8"><title>infernoflow login</title>
4
4
  <style>body{font-family:system-ui;display:flex;align-items:center;justify-content:center;height:100vh;margin:0;background:#0f172a;color:#f1f5f9}</style>
5
5
  </head>
6
6
  <body>
7
7
  <script>
8
- const hash = window.location.hash.slice(1);
8
+ const hash = window.location.hash.slice(1);
9
9
  const params = new URLSearchParams(hash);
10
- const access_token = params.get('access_token');
10
+ const access_token = params.get('access_token');
11
11
  const refresh_token = params.get('refresh_token');
12
- const expires_in = params.get('expires_in');
13
- const error = params.get('error_description') || params.get('error');
12
+ const expires_in = params.get('expires_in');
13
+ const error = params.get('error_description') || params.get('error');
14
14
  if (access_token) {
15
15
  fetch('/auth/callback', {
16
16
  method: 'POST',
@@ -27,4 +27,4 @@ import*as k from"node:http";import*as L from"node:crypto";import"node:fs";import
27
27
  }
28
28
  </script>
29
29
  </body>
30
- </html>`);return}if(o.method==="POST"){let h="";o.on("data",c=>h+=c),o.on("end",()=>{n.writeHead(200),n.end("ok"),a.close();try{const c=JSON.parse(h);c.error?l(new Error(c.error)):s(c)}catch(c){l(c)}})}});a.listen(u,"127.0.0.1",()=>{const o=C(e,v);console.log(" Opening browser for GitHub login\u2026"),console.log(),console.log(` ${t("If the browser doesn't open, visit:")}`),console.log(` ${r(o)}`),console.log(),E(o),console.log(` ${t("Waiting for login\u2026")} ${t("(Ctrl+C to cancel)")}`)});const m=setTimeout(()=>{a.close(),l(new Error("Login timed out after 3 minutes"))},180*1e3);try{const o=await d;clearTimeout(m);const n=await P(o.access_token),f={access_token:o.access_token,refresh_token:o.refresh_token||null,expires_at:o.expires_in?new Date(Date.now()+parseInt(o.expires_in)*1e3).toISOString():null,user:n,logged_in_at:new Date().toISOString()};A(f);const p=n?.user_metadata?.user_name||n?.email||"unknown";console.log(),console.log(` ${g("\u2714")} Logged in as ${i(p)}`),console.log(),console.log(` ${t("Session memory will now sync to the cloud on every")} ${r("infernoflow log")}`),console.log()}catch(o){clearTimeout(m),a.close(),console.log(),console.log(` ${y("\u2718")} Login failed: ${o.message}`),console.log(),process.exit(1)}}function S(){const e=O();console.log(),console.log(e?` ${g("\u2714")} Logged out. Local credentials removed.`:` ${t("Already logged out.")}`),console.log()}async function b(){const e=_();if(console.log(),!e?.access_token){console.log(` ${t("Not logged in.")} Run ${r("infernoflow login")}`),console.log();return}const s=e.user?.user_metadata?.user_name||e.user?.email||"unknown",l=e.user?.email||t("(no email)"),d=e.logged_in_at?new Date(e.logged_in_at).toLocaleDateString():"unknown",a=!$();console.log(` ${i("\u{1F525} infernoflow")} \u2014 logged in as:`),console.log(),console.log(` User: ${i(s)}`),console.log(` Email: ${l}`),console.log(` Since: ${t(d)}`),console.log(a?` Status: ${x("\u26A0 Token expired \u2014 run infernoflow login to refresh")}`:` Status: ${g("\u2714 Active")}`),console.log()}async function D(e){const s=e[1];return s==="logout"?S():s==="whoami"?b():U()}async function Y(){return S()}async function F(){return b()}export{D as loginCommand,Y as logoutCommand,F as whoamiCommand};
30
+ </html>`);return}if(o.method==="POST"){let p="";o.on("data",r=>p+=r),o.on("end",()=>{e.writeHead(200),e.end("ok"),l.close();try{const r=JSON.parse(p);r.error?t(new Error(r.error)):n(r)}catch(r){t(r)}})}});l.listen(m,"127.0.0.1",()=>{const o=new URLSearchParams({provider:"github",redirect_to:C}),e=`${w}/auth/v1/authorize?${o.toString()}`;console.log(" Opening browser for GitHub login\u2026"),console.log(),console.log(` ${s("If the browser doesn't open, visit:")}`),console.log(` ${g(e)}`),console.log(),P(e),console.log(` ${s("Waiting for login\u2026")} ${s("(Ctrl+C to cancel)")}`)});const i=setTimeout(()=>{l.close(),t(new Error("Login timed out after 3 minutes"))},180*1e3);try{const o=await c;clearTimeout(i);const e=await T(o.access_token),u={access_token:o.access_token,refresh_token:o.refresh_token||null,expires_at:o.expires_in?new Date(Date.now()+parseInt(o.expires_in)*1e3).toISOString():null,user:e,logged_in_at:new Date().toISOString()};x(u);const f=e?.user_metadata?.user_name||e?.email||"unknown";console.log(),console.log(` ${d("\u2714")} Logged in as ${a(f)}`),console.log(),console.log(` ${s("Session memory will now sync to the cloud on every")} ${g("infernoflow log")}`),console.log()}catch(o){clearTimeout(i);try{l.close()}catch{}console.log(),console.log(` ${h("\u2718")} Login failed: ${o.message}`),console.log(),process.exit(1)}}function k(){const n=v();console.log(),console.log(n?` ${d("\u2714")} Logged out. Local credentials removed.`:` ${s("Already logged out.")}`),console.log()}async function b(){const n=y();if(console.log(),!n?.access_token){console.log(` ${s("Not logged in.")} Run ${g("infernoflow login")}`),console.log();return}const t=n.user?.user_metadata?.user_name||n.user?.email||"unknown",c=n.user?.email||s("(no email)"),l=n.logged_in_at?new Date(n.logged_in_at).toLocaleDateString():"unknown",i=!_();console.log(` ${a("\u{1F525} infernoflow")} \u2014 logged in as:`),console.log(),console.log(` User: ${a(t)}`),console.log(` Email: ${c}`),console.log(` Since: ${s(l)}`),console.log(i?` Status: ${L("\u26A0 Token expired \u2014 run infernoflow login to refresh")}`:` Status: ${d("\u2714 Active")}`),console.log()}async function B(n){const t=n[1];return t==="logout"?k():t==="whoami"?b():O()}async function j(){return k()}async function J(){return b()}export{B as loginCommand,j as logoutCommand,J as whoamiCommand};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "infernoflow",
3
- "version": "0.38.1",
3
+ "version": "0.38.3",
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": {