infernoflow 0.33.0 → 0.33.1

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,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{readFileSync as d}from"node:fs";import{dirname as m,join as u}from"node:path";import{fileURLToPath as h}from"node:url";import{bold as t,gray as a,red as s}from"../lib/ui/output.mjs";const f=m(h(import.meta.url)),y=JSON.parse(d(u(f,"..","..","package.json"),"utf8")),r=y.version||"0.0.0",c={publish:"Bump version, update changelog, build, npm publish, git commit + push in one shot",diff:"Show what capabilities changed since the last git tag (or any ref)",changelog:"Draft a changelog entry from commits since the last tag",setup:"One command to get fully operational \u2014 detects IDE, inits, installs hooks + MCP",init:"Scaffold inferno/ in your project (or adopt existing project)","install-cursor-hooks":"Install Cursor hooks: draft agent replies to inferno/CONTEXT.draft.md","install-vscode-copilot-hooks":"Install VS Code + Copilot agent hooks (Preview): draft to inferno/CONTEXT.draft.md",check:"Validate contract, capabilities, scenarios, changelog",status:"Show contract health at a glance","pr-impact":"Summarize PR impact on capabilities and docs",sync:"Run deterministic inferno sync flow",run:"One-command detect/propose/apply/validate flow","doc-gate":"Fail if code changed but docs were not updated",suggest:"Generate AI prompt + apply capability updates",implement:"Generate code-agent implementation prompt(s)",context:"Generate AI-ready context for new sessions","generate-skills":"Generate personalised Cursor rules + skill files from your developer profile",synthesize:"Auto-detect workflow patterns and synthesize reusable skills + agents",agent:"Manage and run auto-synthesized agents (list | run | show | delete)",version:"Smart semver bump recommendation based on capability changes (--apply to write)","pr-comment":"Post capability drift analysis as a GitHub PR comment (works in CI automatically)",dashboard:"Launch local web dashboard on localhost:7337 \u2014 live contract health, capabilities, agents","team-sync":"Sync capability contract across a team via a shared git branch (push | pull | status | init)",onboard:"Interactive onboarding wizard for new developers \u2014 explains infernoflow in 5 minutes",cloud:"Sync capability contracts via infernoflow cloud (init | push | pull | status | dashboard)",share:"Generate a public read-only HTML snapshot of your capability contract",watch:"Watch source files and run suggest automatically on save",ci:"CI-native check: GitHub Actions annotations, GitLab code quality, exit codes",notify:"Post capability drift summary to Slack or Discord",report:"Generate a weekly/monthly HTML or Markdown report of capability activity",monorepo:"Manage infernoflow across monorepo packages (init | list | status | diff | sync)",link:"Link capabilities to Jira, Linear, or GitHub Issues tickets",audit:"Classify capabilities by sensitivity (auth, payment, PII, admin) and generate security surface map",scout:"Scan source files for undocumented capabilities not yet in the contract",export:"Export contract to OpenAPI, Backstage catalog-info.yaml, CSV, or Markdown",snapshot:"Save/diff/restore named snapshots of the capability contract",health:"Compute a 0\u2013100 health score across coverage, docs, freshness, completeness, drift",vibe:"Vibe coding mode \u2014 watches files, auto-syncs contract, regenerates context on every save",adopt:"Interactive wizard to adopt infernoflow in an existing project (detect \u2192 review \u2192 wire up)",doctor:"Diagnose your infernoflow setup \u2014 checks Node, git, contract, AI providers, MCP, hooks",coverage:"Map test files to capabilities \u2014 show which caps have test coverage and which don't",review:"AI-powered capability impact review for staged or recent git changes",scan:"Deep AST scan \u2014 reads actual function bodies, extracts calls, DB ops, external services",graph:"Build capability dependency graph \u2014 shows which caps call which, detects breaking changes",stability:"Show solid/liquid stability level for every capability (frozen/stable/experimental)",freeze:"Mark a capability as frozen (solid) \u2014 AI will not modify it without explicit instruction",thaw:"Reset a capability to experimental (liquid) \u2014 free to evolve",why:"Given a file or function name \u2014 show which capability it serves, scenarios, stability, and git history",impact:"Blast radius analysis \u2014 see every cap, scenario, and risk level affected before you change anything",scaffold:"Generate a new capability \u2014 source skeleton, contract registration, and placeholder scenario in one command",explain:"AI narrative about a capability \u2014 what it does, why it exists, what's risky, and what to test",test:"Run registered scenarios for a capability \u2014 auto-generates a smoke harness if no test runner is configured",ai:"Manage AI providers \u2014 setup, status, test connection (subcommands: setup | status | test | clear)",demo:"Interactive walkthrough \u2014 scaffolds a sample project and runs the full capability chain end-to-end",log:"Append to session memory (decisions, gotchas, failed attempts, theme changes) \u2014 what AI can't infer from code",theme:"Scan fonts, colors, and CSS variables \u2014 write inferno/theme.json so AI always matches the design system"},l={publish:async e=>(await import("../lib/commands/publish.mjs")).publishCommand(e),diff:async e=>(await import("../lib/commands/diff.mjs")).diffCommand(e),changelog:async e=>(await import("../lib/commands/changelog.mjs")).changelogCommand(e),setup:async e=>(await import("../lib/commands/setup.mjs")).setupCommand(e),init:async e=>(await import("../lib/commands/init.mjs")).initCommand(e),"install-cursor-hooks":async e=>(await import("../lib/commands/installCursorHooks.mjs")).installCursorHooksCommand(e),"install-vscode-copilot-hooks":async e=>(await import("../lib/commands/installVsCodeCopilotHooks.mjs")).installVsCodeCopilotHooksCommand(e),check:async e=>(await import("../lib/commands/check.mjs")).checkCommand(e),status:async e=>(await import("../lib/commands/status.mjs")).statusCommand(e),"pr-impact":async e=>(await import("../lib/commands/prImpact.mjs")).prImpactCommand(e),sync:async e=>(await import("../lib/commands/syncAuto.mjs")).syncCommand(e),run:async e=>(await import("../lib/commands/run.mjs")).runCommand(e),suggest:async e=>(await import("../lib/commands/suggest.mjs")).suggestCommand(e),implement:async e=>(await import("../lib/commands/implement.mjs")).implementCommand(e),context:async e=>(await import("../lib/commands/context.mjs")).contextCommand(e),"doc-gate":async e=>(await import("../lib/commands/docGate.mjs")).docGateCommand(e),"generate-skills":async e=>(await import("../lib/commands/generateSkills.mjs")).generateSkillsCommand(e),synthesize:async e=>(await import("../lib/commands/synthesize.mjs")).synthesizeCommand(e),agent:async e=>(await import("../lib/commands/agent.mjs")).agentCommand(e),version:async e=>(await import("../lib/commands/version.mjs")).versionCommand(e),"pr-comment":async e=>(await import("../lib/commands/prComment.mjs")).prCommentCommand(e),dashboard:async e=>(await import("../lib/commands/dashboard.mjs")).dashboardCommand(e),"team-sync":async e=>(await import("../lib/commands/teamSync.mjs")).teamSyncCommand(e),onboard:async e=>(await import("../lib/commands/onboard.mjs")).onboardCommand(e),cloud:async e=>(await import("../lib/commands/cloud.mjs")).cloudCommand(e),share:async e=>(await import("../lib/commands/share.mjs")).shareCommand(e),watch:async e=>(await import("../lib/commands/watch.mjs")).watchCommand(e),ci:async e=>(await import("../lib/commands/ci.mjs")).ciCommand(e),notify:async e=>(await import("../lib/commands/notify.mjs")).notifyCommand(e),report:async e=>(await import("../lib/commands/report.mjs")).reportCommand(e),monorepo:async e=>(await import("../lib/commands/monorepo.mjs")).monorepoCommand(e),link:async e=>(await import("../lib/commands/link.mjs")).linkCommand(e),audit:async e=>(await import("../lib/commands/audit.mjs")).auditCommand(e),scout:async e=>(await import("../lib/commands/scout.mjs")).scoutCommand(e),export:async e=>(await import("../lib/commands/export.mjs")).exportCommand(e),snapshot:async e=>(await import("../lib/commands/snapshot.mjs")).snapshotCommand(e),health:async e=>(await import("../lib/commands/health.mjs")).healthCommand(e),vibe:async e=>(await import("../lib/commands/vibe.mjs")).vibeCommand(e),adopt:async e=>(await import("../lib/commands/adoptWizard.mjs")).adoptWizardCommand(e),doctor:async e=>(await import("../lib/commands/doctor.mjs")).doctorCommand(e),coverage:async e=>(await import("../lib/commands/coverage.mjs")).coverageCommand(e),review:async e=>(await import("../lib/commands/review.mjs")).reviewCommand(e),scan:async e=>(await import("../lib/commands/scan.mjs")).scanCommand(e),graph:async e=>(await import("../lib/commands/graph.mjs")).graphCommand(e),stability:async e=>(await import("../lib/commands/stability.mjs")).stabilityCommand(e),freeze:async e=>(await import("../lib/commands/stability.mjs")).freezeCommand(e),thaw:async e=>(await import("../lib/commands/stability.mjs")).thawCommand(e),why:async e=>(await import("../lib/commands/why.mjs")).whyCommand(e),impact:async e=>(await import("../lib/commands/impact.mjs")).impactCommand(e),scaffold:async e=>(await import("../lib/commands/scaffold.mjs")).scaffoldCommand(e),explain:async e=>(await import("../lib/commands/explain.mjs")).explainCommand(e),test:async e=>(await import("../lib/commands/test.mjs")).testCommand(e),ai:async e=>(await import("../lib/commands/ai.mjs")).aiCommand(e),demo:async e=>(await import("../lib/commands/demo.mjs")).demoCommand(e),log:async e=>(await import("../lib/commands/log.mjs")).logCommand(e),theme:async e=>(await import("../lib/commands/theme.mjs")).themeCommand(e)};function w(){const e=Object.keys(c),n=Math.max(...e.map(i=>i.length),8)+1;return Object.entries(c).map(([i,p])=>` ${i.padEnd(n," ")}${p}`).join(`
2
+ import{readFileSync as d}from"node:fs";import{dirname as m,join as u}from"node:path";import{fileURLToPath as h}from"node:url";import{bold as t,gray as a,red as s}from"../lib/ui/output.mjs";const f=m(h(import.meta.url)),y=JSON.parse(d(u(f,"..","..","package.json"),"utf8")),r=y.version||"0.0.0",c={publish:"Bump version, update changelog, build, npm publish, git commit + push in one shot",diff:"Show what capabilities changed since the last git tag (or any ref)",changelog:"Draft a changelog entry from commits since the last tag",setup:"One command to get fully operational \u2014 detects IDE, inits, installs hooks + MCP",init:"Scaffold inferno/ in your project (or adopt existing project)","install-cursor-hooks":"Install Cursor hooks: draft agent replies to inferno/CONTEXT.draft.md","install-vscode-copilot-hooks":"Install VS Code + Copilot agent hooks (Preview): draft to inferno/CONTEXT.draft.md",check:"Validate contract, capabilities, scenarios, changelog",status:"Show contract health at a glance","pr-impact":"Summarize PR impact on capabilities and docs",sync:"Run deterministic inferno sync flow",run:"One-command detect/propose/apply/validate flow","doc-gate":"Fail if code changed but docs were not updated",suggest:"Generate AI prompt + apply capability updates",implement:"Generate code-agent implementation prompt(s)",context:"Generate AI-ready context for new sessions","generate-skills":"Generate personalised Cursor rules + skill files from your developer profile",synthesize:"Auto-detect workflow patterns and synthesize reusable skills + agents",agent:"Manage and run auto-synthesized agents (list | run | show | delete)",version:"Smart semver bump recommendation based on capability changes (--apply to write)","pr-comment":"Post capability drift analysis as a GitHub PR comment (works in CI automatically)",dashboard:"Launch local web dashboard on localhost:7337 \u2014 live contract health, capabilities, agents","team-sync":"Sync capability contract across a team via a shared git branch (push | pull | status | init)",onboard:"Interactive onboarding wizard for new developers \u2014 explains infernoflow in 5 minutes",cloud:"Sync capability contracts via infernoflow cloud (init | push | pull | status | dashboard)",share:"Generate a public read-only HTML snapshot of your capability contract",watch:"Watch source files and run suggest automatically on save",ci:"CI-native check: GitHub Actions annotations, GitLab code quality, exit codes",notify:"Post capability drift summary to Slack or Discord",report:"Generate a weekly/monthly HTML or Markdown report of capability activity",monorepo:"Manage infernoflow across monorepo packages (init | list | status | diff | sync)",link:"Link capabilities to Jira, Linear, or GitHub Issues tickets",audit:"Classify capabilities by sensitivity (auth, payment, PII, admin) and generate security surface map",scout:"Scan source files for undocumented capabilities not yet in the contract",export:"Export contract to OpenAPI, Backstage catalog-info.yaml, CSV, or Markdown",snapshot:"Save/diff/restore named snapshots of the capability contract",health:"Compute a 0\u2013100 health score across coverage, docs, freshness, completeness, drift",vibe:"Vibe coding mode \u2014 watches files, auto-syncs contract, regenerates context on every save",adopt:"Interactive wizard to adopt infernoflow in an existing project (detect \u2192 review \u2192 wire up)",doctor:"Diagnose your infernoflow setup \u2014 checks Node, git, contract, AI providers, MCP, hooks",coverage:"Map test files to capabilities \u2014 show which caps have test coverage and which don't",review:"AI-powered capability impact review for staged or recent git changes",scan:"Deep AST scan \u2014 reads actual function bodies, extracts calls, DB ops, external services",graph:"Build capability dependency graph \u2014 shows which caps call which, detects breaking changes",stability:"Show solid/liquid stability level for every capability (frozen/stable/experimental)",freeze:"Mark a capability as frozen (solid) \u2014 AI will not modify it without explicit instruction",thaw:"Reset a capability to experimental (liquid) \u2014 free to evolve",why:"Given a file or function name \u2014 show which capability it serves, scenarios, stability, and git history",impact:"Blast radius analysis \u2014 see every cap, scenario, and risk level affected before you change anything",scaffold:"Generate a new capability \u2014 source skeleton, contract registration, and placeholder scenario in one command",explain:"AI narrative about a capability \u2014 what it does, why it exists, what's risky, and what to test",test:"Run registered scenarios for a capability \u2014 auto-generates a smoke harness if no test runner is configured",ai:"Manage AI providers \u2014 setup, status, test connection (subcommands: setup | status | test | clear)",demo:"Interactive walkthrough \u2014 scaffolds a sample project and runs the full capability chain end-to-end",log:"Append to session memory (decisions, gotchas, failed attempts, theme changes) \u2014 what AI can't infer from code",theme:"Scan fonts, colors, and CSS variables \u2014 write inferno/theme.json so AI always matches the design system",switch:"Generate a handoff summary when switching AI agents \u2014 paste into the next session so nothing is lost"},l={publish:async e=>(await import("../lib/commands/publish.mjs")).publishCommand(e),diff:async e=>(await import("../lib/commands/diff.mjs")).diffCommand(e),changelog:async e=>(await import("../lib/commands/changelog.mjs")).changelogCommand(e),setup:async e=>(await import("../lib/commands/setup.mjs")).setupCommand(e),init:async e=>(await import("../lib/commands/init.mjs")).initCommand(e),"install-cursor-hooks":async e=>(await import("../lib/commands/installCursorHooks.mjs")).installCursorHooksCommand(e),"install-vscode-copilot-hooks":async e=>(await import("../lib/commands/installVsCodeCopilotHooks.mjs")).installVsCodeCopilotHooksCommand(e),check:async e=>(await import("../lib/commands/check.mjs")).checkCommand(e),status:async e=>(await import("../lib/commands/status.mjs")).statusCommand(e),"pr-impact":async e=>(await import("../lib/commands/prImpact.mjs")).prImpactCommand(e),sync:async e=>(await import("../lib/commands/syncAuto.mjs")).syncCommand(e),run:async e=>(await import("../lib/commands/run.mjs")).runCommand(e),suggest:async e=>(await import("../lib/commands/suggest.mjs")).suggestCommand(e),implement:async e=>(await import("../lib/commands/implement.mjs")).implementCommand(e),context:async e=>(await import("../lib/commands/context.mjs")).contextCommand(e),"doc-gate":async e=>(await import("../lib/commands/docGate.mjs")).docGateCommand(e),"generate-skills":async e=>(await import("../lib/commands/generateSkills.mjs")).generateSkillsCommand(e),synthesize:async e=>(await import("../lib/commands/synthesize.mjs")).synthesizeCommand(e),agent:async e=>(await import("../lib/commands/agent.mjs")).agentCommand(e),version:async e=>(await import("../lib/commands/version.mjs")).versionCommand(e),"pr-comment":async e=>(await import("../lib/commands/prComment.mjs")).prCommentCommand(e),dashboard:async e=>(await import("../lib/commands/dashboard.mjs")).dashboardCommand(e),"team-sync":async e=>(await import("../lib/commands/teamSync.mjs")).teamSyncCommand(e),onboard:async e=>(await import("../lib/commands/onboard.mjs")).onboardCommand(e),cloud:async e=>(await import("../lib/commands/cloud.mjs")).cloudCommand(e),share:async e=>(await import("../lib/commands/share.mjs")).shareCommand(e),watch:async e=>(await import("../lib/commands/watch.mjs")).watchCommand(e),ci:async e=>(await import("../lib/commands/ci.mjs")).ciCommand(e),notify:async e=>(await import("../lib/commands/notify.mjs")).notifyCommand(e),report:async e=>(await import("../lib/commands/report.mjs")).reportCommand(e),monorepo:async e=>(await import("../lib/commands/monorepo.mjs")).monorepoCommand(e),link:async e=>(await import("../lib/commands/link.mjs")).linkCommand(e),audit:async e=>(await import("../lib/commands/audit.mjs")).auditCommand(e),scout:async e=>(await import("../lib/commands/scout.mjs")).scoutCommand(e),export:async e=>(await import("../lib/commands/export.mjs")).exportCommand(e),snapshot:async e=>(await import("../lib/commands/snapshot.mjs")).snapshotCommand(e),health:async e=>(await import("../lib/commands/health.mjs")).healthCommand(e),vibe:async e=>(await import("../lib/commands/vibe.mjs")).vibeCommand(e),adopt:async e=>(await import("../lib/commands/adoptWizard.mjs")).adoptWizardCommand(e),doctor:async e=>(await import("../lib/commands/doctor.mjs")).doctorCommand(e),coverage:async e=>(await import("../lib/commands/coverage.mjs")).coverageCommand(e),review:async e=>(await import("../lib/commands/review.mjs")).reviewCommand(e),scan:async e=>(await import("../lib/commands/scan.mjs")).scanCommand(e),graph:async e=>(await import("../lib/commands/graph.mjs")).graphCommand(e),stability:async e=>(await import("../lib/commands/stability.mjs")).stabilityCommand(e),freeze:async e=>(await import("../lib/commands/stability.mjs")).freezeCommand(e),thaw:async e=>(await import("../lib/commands/stability.mjs")).thawCommand(e),why:async e=>(await import("../lib/commands/why.mjs")).whyCommand(e),impact:async e=>(await import("../lib/commands/impact.mjs")).impactCommand(e),scaffold:async e=>(await import("../lib/commands/scaffold.mjs")).scaffoldCommand(e),explain:async e=>(await import("../lib/commands/explain.mjs")).explainCommand(e),test:async e=>(await import("../lib/commands/test.mjs")).testCommand(e),ai:async e=>(await import("../lib/commands/ai.mjs")).aiCommand(e),demo:async e=>(await import("../lib/commands/demo.mjs")).demoCommand(e),log:async e=>(await import("../lib/commands/log.mjs")).logCommand(e),theme:async e=>(await import("../lib/commands/theme.mjs")).themeCommand(e),switch:async e=>(await import("../lib/commands/switch.mjs")).switchCommand(e)};function w(){const e=Object.keys(c),n=Math.max(...e.map(i=>i.length),8)+1;return Object.entries(c).map(([i,p])=>` ${i.padEnd(n," ")}${p}`).join(`
3
3
  `)}const g=`
4
4
  ${t("\u{1F525} infernoflow")} ${a("v"+r)}
5
5
  ${a("The forge for liquid code \u2014 keep every AI session in sync")}
@@ -0,0 +1,9 @@
1
+ import*as f from"node:fs";import*as m from"node:path";import{execSync as O}from"node:child_process";import{bold as k,cyan as d,gray as R,green as x,yellow as E,red as T}from"../ui/output.mjs";const y="inferno",L=m.join(y,"HANDOFF.md"),_=m.join(y,"sessions.jsonl"),N=m.join(y,"context-state.json"),D=m.join(y,"contract.json"),A=m.join(y,"theme.json");function r(t){try{return JSON.parse(f.readFileSync(t,"utf8"))}catch{return null}}function V(t){try{return f.readFileSync(t,"utf8")}catch{return null}}function g(t){return t?new Date(t).toLocaleString("en-GB",{day:"2-digit",month:"short",hour:"2-digit",minute:"2-digit"}):"unknown"}function C(t=8){return f.existsSync(_)?f.readFileSync(_,"utf8").split(`
2
+ `).filter(Boolean).map(e=>{try{return JSON.parse(e)}catch{return null}}).filter(Boolean).slice(-t):[]}function G(t){try{const e=process.platform;if(e==="win32")O("clip",{input:t});else if(e==="darwin")O("pbcopy",{input:t});else try{O("xclip -selection clipboard",{input:t})}catch{O("xsel --clipboard --input",{input:t})}return!0}catch{return!1}}function J(t){const e=r(N)||{},w=r(D)||{},i=r(A),c=C(8),b=new Date().toLocaleString("en-GB",{day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"}),l=w.policyId||m.basename(process.cwd()),$=w.policyVersion||"?",F=(w.capabilities||[]).slice(0,20),p=c.filter(n=>n.type==="gotcha"),u=c.filter(n=>n.type==="decision"),j=c.filter(n=>n.type==="attempt"),s=c.filter(n=>n.type==="preference"),a=c.filter(n=>n.type==="theme"),S=c.slice(-5),o=[`# \u{1F525} infernoflow Handoff \u2014 ${l}`,`> Generated: ${b}${t?` | Handing off to: **${t}**`:""}`,"","---","","## Pick up here",""];if(e.working||e.intent?(e.working&&o.push(`**Working on:** ${e.working} _(${g(e.workingUpdated)})_`),e.intent&&o.push(`**Intent:** ${e.intent} _(${g(e.intentUpdated)})_`),o.push("")):o.push('_No working state set. Run: `infernoflow context --working "..."` to set it._',""),p.length){o.push("## \u26A0 Gotchas \u2014 read these first","");for(const n of p)o.push(`- ${n.summary} _(${g(n.ts)})_`);o.push("")}if(u.length){o.push("## Decisions made","");for(const n of u){const h=n.result?` \u2192 **${n.result}**`:"";o.push(`- ${n.summary}${h} _(${g(n.ts)})_`)}o.push("")}const H=j.filter(n=>n.result==="failed"||n.result==="partial");if(H.length){o.push("## \u2717 Already tried \u2014 don't repeat","");for(const n of H)o.push(`- ${n.summary} _(${g(n.ts)})_`);o.push("")}if(s.length){o.push("## Developer preferences","");for(const n of s)o.push(`- ${n.summary}`);o.push("")}if(i){if(o.push("## Design system",""),i.fonts?.primary&&o.push(`- **Font:** ${i.fonts.primary}${i.fonts.mono?` \xB7 mono: ${i.fonts.mono}`:""}`),i.colors?.mode&&o.push(`- **Mode:** ${i.colors.mode}`),i.colors?.palette){const n=Object.entries(i.colors.palette).map(([h,I])=>`${h}=${I}`).join(" ");o.push(`- **Palette:** ${n}`)}if(i.cssVars&&Object.keys(i.cssVars).length){const n=Object.entries(i.cssVars).slice(0,6).map(([h,I])=>`${h}: ${I}`).join(" | ");o.push(`- **CSS vars:** ${n}`)}i.framework&&o.push(`- **Framework:** ${i.framework}`),o.push("","> \u26A0 Always match these exactly. Do not introduce new colors or fonts.","")}if(F.length&&(o.push("## Capability contract",""),o.push(`Project: **${l}** v${$}`),o.push(`Capabilities: ${F.join(", ")}`),o.push("")),S.length){o.push("## Recent session log","");for(const n of S){const h=n.result?` [${n.result}]`:"";o.push(`- **${n.type}**${h}: ${n.summary} _(${g(n.ts)})_`)}o.push("")}return o.push("---"),o.push("_Paste this at the start of your next AI session. Generated by infernoflow._"),o.join(`
3
+ `)}async function B(t){const e=s=>t.includes(s),w=s=>{const a=t.indexOf(s);return a!==-1&&t[a+1]?t[a+1]:null},i=e("--show")||e("-s"),c=e("--copy")||e("-c"),b=e("--json"),l=w("--to")||t.find(s=>!s.startsWith("-")&&!["switch"].includes(s))||null;if(console.log(`
4
+ `+k("\u{1F525} infernoflow \u2014 switch")),console.log(" "+"\u2500".repeat(50)+`
5
+ `),f.existsSync(y)||(console.error(T(` \u2718 inferno/ not found \u2014 run: infernoflow init
6
+ `)),process.exit(1)),i){const s=V(L);if(!s){console.log(E(` \u26A0 No HANDOFF.md yet \u2014 run: infernoflow switch
7
+ `));return}console.log(s);return}const $=J(l);if(b){const s=r(N)||{},a=r(D)||{},S=r(A),o=C(8);console.log(JSON.stringify({state:s,contract:{policyId:a.policyId,policyVersion:a.policyVersion,capabilities:a.capabilities},theme:S,sessions:o,generatedAt:new Date().toISOString()},null,2));return}if(f.writeFileSync(L,$,"utf8"),console.log(x(` \u2714 Written \u2192 inferno/HANDOFF.md
8
+ `)),f.existsSync(_)){const s={ts:new Date().toISOString(),agent:"infernoflow",type:"handoff",summary:l?`Handed off to ${l}`:"Handoff generated"};f.appendFileSync(_,JSON.stringify(s)+`
9
+ `,"utf8")}const F=C(100).length,p=r(N)||{},u=r(A),j=r(D)||{};if(console.log(" "+k("Handoff summary")),console.log(" "+"\u2500".repeat(50)),p.working&&console.log(" Working on "+d(p.working)),p.intent&&console.log(" Intent "+d(p.intent)),console.log(" Sessions "+F+" entries in memory"),console.log(" Capabilities "+(j.capabilities||[]).length+" registered"),u?.fonts?.primary&&console.log(" Font "+u.fonts.primary),u?.colors?.mode&&console.log(" Color mode "+u.colors.mode),l&&console.log(" Handing off \u2192 "+d(l)),console.log(),c){const s=G($);console.log(s?x(" \u2714 Copied to clipboard \u2014 paste at the start of your next AI session"):E(" \u26A0 Clipboard failed \u2014 open inferno/HANDOFF.md manually"))}else console.log(" "+k("Ready to use:")),console.log(" "+d("1.")+" Open "+d("inferno/HANDOFF.md")),console.log(" "+d("2.")+" Copy all"),console.log(" "+d("3.")+" Paste at the start of your next AI session"),console.log(" "+R(" tip: use --copy to skip steps 1-2 automatically"));console.log()}export{B as switchCommand};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "infernoflow",
3
- "version": "0.33.0",
3
+ "version": "0.33.1",
4
4
  "description": "The forge for liquid code - keep capabilities, contracts, and docs in sync.",
5
5
  "type": "module",
6
6
  "bin": {