infernoflow 0.37.1 → 0.37.4
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 +71 -0
- package/dist/bin/infernoflow.mjs +29 -277
- package/dist/lib/adopters/angular.mjs +1 -128
- package/dist/lib/adopters/css.mjs +1 -111
- package/dist/lib/adopters/react.mjs +1 -104
- package/dist/lib/ai/ideDetection.mjs +1 -31
- package/dist/lib/ai/localProvider.mjs +1 -88
- package/dist/lib/ai/providerRouter.mjs +2 -295
- package/dist/lib/commands/adopt.mjs +20 -869
- package/dist/lib/commands/adoptWizard.mjs +9 -320
- package/dist/lib/commands/agent.mjs +5 -191
- package/dist/lib/commands/ai.mjs +2 -407
- package/dist/lib/commands/ask.mjs +4 -299
- package/dist/lib/commands/audit.mjs +13 -300
- package/dist/lib/commands/changelog.mjs +26 -594
- package/dist/lib/commands/check.mjs +3 -184
- package/dist/lib/commands/ci.mjs +3 -208
- package/dist/lib/commands/claudeMd.mjs +30 -135
- package/dist/lib/commands/cloud.mjs +10 -773
- package/dist/lib/commands/context.mjs +34 -346
- package/dist/lib/commands/coverage.mjs +2 -282
- package/dist/lib/commands/dashboard.mjs +123 -635
- package/dist/lib/commands/demo.mjs +8 -465
- package/dist/lib/commands/diff.mjs +5 -274
- package/dist/lib/commands/docGate.mjs +2 -81
- package/dist/lib/commands/doctor.mjs +3 -321
- package/dist/lib/commands/explain.mjs +8 -438
- package/dist/lib/commands/export.mjs +10 -239
- package/dist/lib/commands/feedback.mjs +12 -216
- package/dist/lib/commands/generateSkills.mjs +38 -163
- package/dist/lib/commands/graph.mjs +11 -378
- package/dist/lib/commands/health.mjs +2 -309
- package/dist/lib/commands/impact.mjs +2 -325
- package/dist/lib/commands/implement.mjs +7 -103
- package/dist/lib/commands/init.mjs +45 -631
- package/dist/lib/commands/installCursorHooks.mjs +1 -36
- package/dist/lib/commands/installVsCodeCopilotHooks.mjs +1 -37
- package/dist/lib/commands/link.mjs +2 -342
- package/dist/lib/commands/log.mjs +18 -248
- package/dist/lib/commands/monorepo.mjs +4 -428
- package/dist/lib/commands/notify.mjs +4 -258
- package/dist/lib/commands/onboard.mjs +4 -296
- package/dist/lib/commands/prComment.mjs +2 -361
- package/dist/lib/commands/prImpact.mjs +2 -157
- package/dist/lib/commands/publish.mjs +15 -316
- package/dist/lib/commands/recap.mjs +6 -380
- package/dist/lib/commands/report.mjs +28 -272
- package/dist/lib/commands/review.mjs +9 -223
- package/dist/lib/commands/run.mjs +8 -336
- package/dist/lib/commands/scaffold.mjs +54 -419
- package/dist/lib/commands/scan.mjs +11 -1118
- package/dist/lib/commands/scout.mjs +2 -291
- package/dist/lib/commands/setup.mjs +5 -310
- package/dist/lib/commands/share.mjs +13 -196
- package/dist/lib/commands/snapshot.mjs +3 -383
- package/dist/lib/commands/stability.mjs +2 -293
- package/dist/lib/commands/stats.mjs +5 -402
- package/dist/lib/commands/status.mjs +4 -172
- package/dist/lib/commands/suggest.mjs +21 -563
- package/dist/lib/commands/switch.mjs +13 -520
- package/dist/lib/commands/syncAuto.mjs +1 -96
- package/dist/lib/commands/synthesize.mjs +10 -228
- package/dist/lib/commands/teamSync.mjs +2 -388
- package/dist/lib/commands/test.mjs +6 -363
- package/dist/lib/commands/theme.mjs +18 -195
- package/dist/lib/commands/uninstall.mjs +13 -406
- package/dist/lib/commands/upgrade.mjs +20 -153
- package/dist/lib/commands/version.mjs +2 -282
- package/dist/lib/commands/vibe.mjs +7 -357
- package/dist/lib/commands/watch.mjs +4 -203
- package/dist/lib/commands/why.mjs +4 -358
- package/dist/lib/cursorHooksInstall.mjs +1 -60
- package/dist/lib/draftToolingInstall.mjs +7 -68
- package/dist/lib/git/detect-drift.mjs +4 -208
- package/dist/lib/learning/adapt.mjs +6 -101
- package/dist/lib/learning/observe.mjs +1 -119
- package/dist/lib/learning/patternDetector.mjs +1 -298
- package/dist/lib/learning/profile.mjs +2 -279
- package/dist/lib/learning/skillSynthesizer.mjs +24 -145
- package/dist/lib/telemetry.mjs +19 -269
- package/dist/lib/templates/index.mjs +1 -131
- package/dist/lib/theme/scanner.mjs +4 -343
- package/dist/lib/ui/errors.mjs +1 -142
- package/dist/lib/ui/output.mjs +6 -95
- package/dist/lib/ui/prompts.mjs +6 -147
- package/dist/lib/vsCodeCopilotHooksInstall.mjs +1 -42
- package/package.json +2 -4
- package/scripts/postinstall.js +2 -2
|
@@ -1,248 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
* Auto-capture flags (for git hooks / automation):
|
|
20
|
-
* infernoflow log "..." --auto Mark as auto-captured; silent exit if no inferno/
|
|
21
|
-
* infernoflow log "..." --quiet Suppress all output
|
|
22
|
-
* infernoflow log "..." --source git-hook Tag the origin of this log entry
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
import * as fs from "node:fs";
|
|
26
|
-
import * as path from "node:path";
|
|
27
|
-
import * as os from "node:os";
|
|
28
|
-
import { bold, cyan, gray, green, yellow, red } from "../ui/output.mjs";
|
|
29
|
-
|
|
30
|
-
const INFERNO_DIR = "inferno";
|
|
31
|
-
const SESSIONS_FILE = path.join(INFERNO_DIR, "sessions.jsonl");
|
|
32
|
-
|
|
33
|
-
/** Silently regenerate CLAUDE.md, .cursorrules, and copilot-instructions.md
|
|
34
|
-
* after every log entry so AI agents always have fresh context. */
|
|
35
|
-
function autoUpdateContextFiles() {
|
|
36
|
-
try {
|
|
37
|
-
const sessionsRaw = fs.existsSync(SESSIONS_FILE)
|
|
38
|
-
? fs.readFileSync(SESSIONS_FILE, "utf8").split("\n").filter(Boolean)
|
|
39
|
-
.map(l => { try { return JSON.parse(l); } catch { return null; } }).filter(Boolean)
|
|
40
|
-
: [];
|
|
41
|
-
|
|
42
|
-
const gotchas = sessionsRaw.filter(e => e.type === "gotcha");
|
|
43
|
-
const decisions = sessionsRaw.filter(e => e.type === "decision");
|
|
44
|
-
const attempts = sessionsRaw.filter(e => e.type === "attempt" && (e.result === "failed" || e.result === "partial"));
|
|
45
|
-
|
|
46
|
-
const lines = [
|
|
47
|
-
`# Project Context (auto-generated by infernoflow)`,
|
|
48
|
-
``,
|
|
49
|
-
`> Last updated: ${new Date().toISOString()}`,
|
|
50
|
-
``,
|
|
51
|
-
];
|
|
52
|
-
|
|
53
|
-
if (gotchas.length) {
|
|
54
|
-
lines.push(`## ⚠️ Known Gotchas (Read These First)`, ``);
|
|
55
|
-
for (const g of gotchas) lines.push(`- ${g.summary}`);
|
|
56
|
-
lines.push(``);
|
|
57
|
-
}
|
|
58
|
-
if (decisions.length) {
|
|
59
|
-
lines.push(`## ✓ Decisions In Effect`, ``);
|
|
60
|
-
for (const d of decisions) lines.push(`- ${d.summary}`);
|
|
61
|
-
lines.push(``);
|
|
62
|
-
}
|
|
63
|
-
if (attempts.length) {
|
|
64
|
-
lines.push(`## ❌ Things That Don't Work (Don't Try These)`, ``);
|
|
65
|
-
for (const a of attempts) lines.push(`- ${a.summary}`);
|
|
66
|
-
lines.push(``);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const content = lines.join("\n");
|
|
70
|
-
const cwd = process.cwd();
|
|
71
|
-
|
|
72
|
-
// Update CLAUDE.md if it already exists (don't create unsolicited)
|
|
73
|
-
const claudeMd = path.join(cwd, "CLAUDE.md");
|
|
74
|
-
if (fs.existsSync(claudeMd)) {
|
|
75
|
-
fs.writeFileSync(claudeMd, content, "utf8");
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// Update .cursorrules if Cursor is detected
|
|
79
|
-
const cursorrules = path.join(cwd, ".cursorrules");
|
|
80
|
-
if (fs.existsSync(cursorrules) || fs.existsSync(path.join(cwd, ".cursor"))) {
|
|
81
|
-
fs.writeFileSync(cursorrules, content, "utf8");
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// Update copilot-instructions.md if .github exists
|
|
85
|
-
const copilotInstructions = path.join(cwd, ".github", "copilot-instructions.md");
|
|
86
|
-
if (fs.existsSync(path.join(cwd, ".github"))) {
|
|
87
|
-
fs.writeFileSync(copilotInstructions, content, "utf8");
|
|
88
|
-
}
|
|
89
|
-
} catch {
|
|
90
|
-
// Never surface errors to the user — this is background infrastructure
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
const VALID_TYPES = ["note","attempt","decision","gotcha","preference","theme","handoff","error"];
|
|
95
|
-
const VALID_RESULTS = ["worked","failed","partial","unknown"];
|
|
96
|
-
|
|
97
|
-
function readEntries() {
|
|
98
|
-
if (!fs.existsSync(SESSIONS_FILE)) return [];
|
|
99
|
-
return fs.readFileSync(SESSIONS_FILE, "utf8")
|
|
100
|
-
.split("\n")
|
|
101
|
-
.filter(Boolean)
|
|
102
|
-
.map(l => { try { return JSON.parse(l); } catch { return null; } })
|
|
103
|
-
.filter(Boolean);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
function appendEntry(entry, { auto = false, quiet = false } = {}) {
|
|
107
|
-
if (!fs.existsSync(INFERNO_DIR)) {
|
|
108
|
-
if (auto) return false; // silently skip — hook running in non-inferno project
|
|
109
|
-
if (!quiet) console.error(red(" ✘ inferno/ not found — run: infernoflow init\n"));
|
|
110
|
-
process.exit(1);
|
|
111
|
-
}
|
|
112
|
-
fs.appendFileSync(SESSIONS_FILE, JSON.stringify(entry) + "\n", "utf8");
|
|
113
|
-
return true;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
function detectAgent() {
|
|
117
|
-
// Try to detect which AI agent is running this
|
|
118
|
-
if (process.env.CURSOR_SESSION) return "cursor";
|
|
119
|
-
if (process.env.COPILOT_SESSION) return "copilot";
|
|
120
|
-
if (process.env.CLAUDE_CODE_SESSION) return "claude";
|
|
121
|
-
if (process.env.WINDSURF_SESSION) return "windsurf";
|
|
122
|
-
if (process.env.INFERNOFLOW_AGENT) return process.env.INFERNOFLOW_AGENT;
|
|
123
|
-
return "human";
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
function formatEntry(e, i) {
|
|
127
|
-
const ts = new Date(e.ts).toLocaleString("en-GB", { day:"2-digit", month:"short", hour:"2-digit", minute:"2-digit" });
|
|
128
|
-
const type = e.type || "note";
|
|
129
|
-
const color = type === "gotcha" ? "\x1b[33m" // yellow
|
|
130
|
-
: type === "decision" ? "\x1b[36m" // cyan
|
|
131
|
-
: type === "theme" ? "\x1b[35m" // magenta
|
|
132
|
-
: type === "preference" ? "\x1b[34m" // blue
|
|
133
|
-
: type === "attempt" ? "\x1b[90m" // dark gray
|
|
134
|
-
: type === "error" ? "\x1b[31m" // red
|
|
135
|
-
: "\x1b[0m";
|
|
136
|
-
const reset = "\x1b[0m";
|
|
137
|
-
const result = e.result ? ` [${e.result}]` : "";
|
|
138
|
-
const agent = e.agent && e.agent !== "human" ? gray(` (${e.agent})`) : "";
|
|
139
|
-
return ` ${gray(String(i+1).padStart(3))} ${gray(ts)} ${color}${type}${reset}${result} ${e.summary}${agent}`;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
export async function logCommand(args) {
|
|
143
|
-
const has = (f) => args.includes(f);
|
|
144
|
-
const flag = (f, def) => { const i = args.indexOf(f); return i !== -1 && args[i+1] ? args[i+1] : def; };
|
|
145
|
-
|
|
146
|
-
const showFlag = has("--show");
|
|
147
|
-
const clearFlag = has("--clear");
|
|
148
|
-
const jsonFlag = has("--json");
|
|
149
|
-
const autoFlag = has("--auto"); // auto-captured; silent exit if no inferno/
|
|
150
|
-
const quietFlag = has("--quiet"); // suppress all console output
|
|
151
|
-
const source = flag("--source", null); // origin tag, e.g. "git-hook"
|
|
152
|
-
|
|
153
|
-
// ── Show mode ───────────────────────────────────────────────────────────────
|
|
154
|
-
if (showFlag || jsonFlag) {
|
|
155
|
-
const entries = readEntries();
|
|
156
|
-
const countArg = args[args.indexOf("--show") + 1];
|
|
157
|
-
const count = countArg && /^\d+$/.test(countArg) ? parseInt(countArg) : 20;
|
|
158
|
-
const recent = entries.slice(-count);
|
|
159
|
-
|
|
160
|
-
if (jsonFlag) {
|
|
161
|
-
console.log(JSON.stringify(recent, null, 2));
|
|
162
|
-
return;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
console.log("\n " + bold("🔥 infernoflow — session memory"));
|
|
166
|
-
console.log(" " + "─".repeat(50));
|
|
167
|
-
if (!recent.length) {
|
|
168
|
-
console.log(gray("\n No entries yet. Start logging with: infernoflow log \"<what happened>\"\n"));
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
console.log(gray(` Showing last ${recent.length} of ${entries.length} entries\n`));
|
|
172
|
-
recent.forEach((e, i) => console.log(formatEntry(e, entries.length - recent.length + i)));
|
|
173
|
-
console.log();
|
|
174
|
-
return;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
// ── Clear mode ──────────────────────────────────────────────────────────────
|
|
178
|
-
if (clearFlag) {
|
|
179
|
-
if (!fs.existsSync(SESSIONS_FILE)) {
|
|
180
|
-
console.log(gray(" Nothing to clear.\n"));
|
|
181
|
-
return;
|
|
182
|
-
}
|
|
183
|
-
const archive = SESSIONS_FILE.replace(".jsonl", `-archive-${Date.now()}.jsonl`);
|
|
184
|
-
fs.renameSync(SESSIONS_FILE, archive);
|
|
185
|
-
console.log(green(` ✔ Session log archived → ${path.basename(archive)}\n`));
|
|
186
|
-
return;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
// ── Append mode ─────────────────────────────────────────────────────────────
|
|
190
|
-
// Collect the message — everything that's not a flag or a flag value
|
|
191
|
-
const flagValues = new Set([
|
|
192
|
-
flag("--type",""), flag("--result",""), flag("--agent",""), flag("--source","")
|
|
193
|
-
].filter(Boolean));
|
|
194
|
-
const messageTokens = args.filter(a => !a.startsWith("--") && !flagValues.has(a));
|
|
195
|
-
const summary = messageTokens.join(" ").trim();
|
|
196
|
-
|
|
197
|
-
if (!summary) {
|
|
198
|
-
console.log("\n " + bold("🔥 infernoflow log") + " — append to session memory\n");
|
|
199
|
-
console.log(gray(" Usage:"));
|
|
200
|
-
console.log(gray(' infernoflow log "what happened"'));
|
|
201
|
-
console.log(gray(' infernoflow log "tried X, failed because Y" --type attempt --result failed'));
|
|
202
|
-
console.log(gray(' infernoflow log "always use multipart/form-data" --type gotcha'));
|
|
203
|
-
console.log(gray(' infernoflow log "switched to dark mode" --type theme'));
|
|
204
|
-
console.log(gray(' infernoflow log --show Print last 20 entries'));
|
|
205
|
-
console.log(gray(' infernoflow log --json Print as JSON'));
|
|
206
|
-
console.log();
|
|
207
|
-
console.log(gray(" Types: note · attempt · decision · gotcha · preference · theme · handoff · error"));
|
|
208
|
-
console.log(gray(" Results: worked · failed · partial · unknown"));
|
|
209
|
-
console.log(gray(" Auto-capture: --auto (silent skip if no inferno/) · --quiet · --source <name>\n"));
|
|
210
|
-
return;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
const type = flag("--type", "note");
|
|
214
|
-
const result = flag("--result", null);
|
|
215
|
-
const agent = flag("--agent", detectAgent());
|
|
216
|
-
|
|
217
|
-
if (!VALID_TYPES.includes(type)) {
|
|
218
|
-
if (!quietFlag) console.error(red(` ✘ Invalid type: ${type}. Valid: ${VALID_TYPES.join(", ")}\n`));
|
|
219
|
-
process.exit(1);
|
|
220
|
-
}
|
|
221
|
-
if (result && !VALID_RESULTS.includes(result)) {
|
|
222
|
-
if (!quietFlag) console.error(red(` ✘ Invalid result: ${result}. Valid: ${VALID_RESULTS.join(", ")}\n`));
|
|
223
|
-
process.exit(1);
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
const entry = {
|
|
227
|
-
ts: new Date().toISOString(),
|
|
228
|
-
agent,
|
|
229
|
-
type,
|
|
230
|
-
summary,
|
|
231
|
-
...(result ? { result } : {}),
|
|
232
|
-
...(source ? { source } : {}),
|
|
233
|
-
...(autoFlag ? { auto: true } : {}),
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
const written = appendEntry(entry, { auto: autoFlag, quiet: quietFlag });
|
|
237
|
-
if (!written) return; // auto mode, no inferno/ — skip silently
|
|
238
|
-
|
|
239
|
-
// Silently regenerate CLAUDE.md / .cursorrules / copilot-instructions.md
|
|
240
|
-
autoUpdateContextFiles();
|
|
241
|
-
|
|
242
|
-
if (!quietFlag) {
|
|
243
|
-
const typeLabel = type !== "note" ? cyan(` [${type}]`) : "";
|
|
244
|
-
const resultLabel = result ? gray(` → ${result}`) : "";
|
|
245
|
-
const sourceLabel = source ? gray(` (via ${source})`) : "";
|
|
246
|
-
console.log(green(` ✔ Logged${typeLabel}${resultLabel}${sourceLabel}: `) + summary + "\n");
|
|
247
|
-
}
|
|
248
|
-
}
|
|
1
|
+
import*as r from"node:fs";import*as y from"node:path";import"node:os";import{bold as E,cyan as v,gray as n,green as I,red as O}from"../ui/output.mjs";const N="inferno",g=y.join(N,"sessions.jsonl");function R(){try{const e=r.existsSync(g)?r.readFileSync(g,"utf8").split(`
|
|
2
|
+
`).filter(Boolean).map(o=>{try{return JSON.parse(o)}catch{return null}}).filter(Boolean):[],l=e.filter(o=>o.type==="gotcha"),t=e.filter(o=>o.type==="decision"),c=e.filter(o=>o.type==="attempt"&&(o.result==="failed"||o.result==="partial")),i=["# Project Context (auto-generated by infernoflow)","",`> Last updated: ${new Date().toISOString()}`,""];if(l.length){i.push("## \u26A0\uFE0F Known Gotchas (Read These First)","");for(const o of l)i.push(`- ${o.summary}`);i.push("")}if(t.length){i.push("## \u2713 Decisions In Effect","");for(const o of t)i.push(`- ${o.summary}`);i.push("")}if(c.length){i.push("## \u274C Things That Don't Work (Don't Try These)","");for(const o of c)i.push(`- ${o.summary}`);i.push("")}const f=i.join(`
|
|
3
|
+
`),a=process.cwd(),u=y.join(a,"CLAUDE.md");r.existsSync(u)&&r.writeFileSync(u,f,"utf8");const p=y.join(a,".cursorrules");(r.existsSync(p)||r.existsSync(y.join(a,".cursor")))&&r.writeFileSync(p,f,"utf8");const $=y.join(a,".github","copilot-instructions.md");r.existsSync(y.join(a,".github"))&&r.writeFileSync($,f,"utf8")}catch{}}const F=["note","attempt","decision","gotcha","preference","theme","handoff","error"],b=["worked","failed","partial","unknown"];function _(){return r.existsSync(g)?r.readFileSync(g,"utf8").split(`
|
|
4
|
+
`).filter(Boolean).map(e=>{try{return JSON.parse(e)}catch{return null}}).filter(Boolean):[]}function k(e,{auto:l=!1,quiet:t=!1}={}){if(!r.existsSync(N)){if(l)return!1;t||console.error(O(` \u2718 inferno/ not found \u2014 run: infernoflow init
|
|
5
|
+
`)),process.exit(1)}return r.appendFileSync(g,JSON.stringify(e)+`
|
|
6
|
+
`,"utf8"),!0}function A(){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 C(e,l){const t=new Date(e.ts).toLocaleString("en-GB",{day:"2-digit",month:"short",hour:"2-digit",minute:"2-digit"}),c=e.type||"note",i=c==="gotcha"?"\x1B[33m":c==="decision"?"\x1B[36m":c==="theme"?"\x1B[35m":c==="preference"?"\x1B[34m":c==="attempt"?"\x1B[90m":c==="error"?"\x1B[31m":"\x1B[0m",f="\x1B[0m",a=e.result?` [${e.result}]`:"",u=e.agent&&e.agent!=="human"?n(` (${e.agent})`):"";return` ${n(String(l+1).padStart(3))} ${n(t)} ${i}${c}${f}${a} ${e.summary}${u}`}async function V(e){const l=s=>e.includes(s),t=(s,d)=>{const m=e.indexOf(s);return m!==-1&&e[m+1]?e[m+1]:d},c=l("--show"),i=l("--clear"),f=l("--json"),a=l("--auto"),u=l("--quiet"),p=t("--source",null);if(c||f){const s=_(),d=e[e.indexOf("--show")+1],m=d&&/^\d+$/.test(d)?parseInt(d):20,w=s.slice(-m);if(f){console.log(JSON.stringify(w,null,2));return}if(console.log(`
|
|
7
|
+
`+E("\u{1F525} infernoflow \u2014 session memory")),console.log(" "+"\u2500".repeat(50)),!w.length){console.log(n(`
|
|
8
|
+
No entries yet. Start logging with: infernoflow log "<what happened>"
|
|
9
|
+
`));return}console.log(n(` Showing last ${w.length} of ${s.length} entries
|
|
10
|
+
`)),w.forEach((D,T)=>console.log(C(D,s.length-w.length+T))),console.log();return}if(i){if(!r.existsSync(g)){console.log(n(` Nothing to clear.
|
|
11
|
+
`));return}const s=g.replace(".jsonl",`-archive-${Date.now()}.jsonl`);r.renameSync(g,s),console.log(I(` \u2714 Session log archived \u2192 ${y.basename(s)}
|
|
12
|
+
`));return}const $=new Set([t("--type",""),t("--result",""),t("--agent",""),t("--source","")].filter(Boolean)),x=e.filter(s=>!s.startsWith("--")&&!$.has(s)).join(" ").trim();if(!x){console.log(`
|
|
13
|
+
`+E("\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=t("--type","note"),h=t("--result",null),j=t("--agent",A());F.includes(S)||(u||console.error(O(` \u2718 Invalid type: ${S}. Valid: ${F.join(", ")}
|
|
16
|
+
`)),process.exit(1)),h&&!b.includes(h)&&(u||console.error(O(` \u2718 Invalid result: ${h}. Valid: ${b.join(", ")}
|
|
17
|
+
`)),process.exit(1));const L={ts:new Date().toISOString(),agent:j,type:S,summary:x,...h?{result:h}:{},...p?{source:p}:{},...a?{auto:!0}:{}};if(k(L,{auto:a,quiet:u})&&(R(),!u)){const s=S!=="note"?v(` [${S}]`):"",d=h?n(` \u2192 ${h}`):"",m=p?n(` (via ${p})`):"";console.log(I(` \u2714 Logged${s}${d}${m}: `)+x+`
|
|
18
|
+
`)}}export{V as logCommand};
|