fathom-cli 0.2.1 → 0.2.2

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/dist/index.js CHANGED
@@ -15804,7 +15804,7 @@ var VERSION = "0.1.0";
15804
15804
 
15805
15805
  // src/commands/go.ts
15806
15806
  import { Command as Command3 } from "commander";
15807
- import { existsSync as existsSync6 } from "fs";
15807
+ import { existsSync as existsSync6, readFileSync as readFileSync6 } from "fs";
15808
15808
  import { resolve as resolve7, basename as basename2 } from "path";
15809
15809
  import { spawn } from "child_process";
15810
15810
  import chalk4 from "chalk";
@@ -17284,7 +17284,8 @@ async function executeBuildMode(mode, promptPath, state) {
17284
17284
  }
17285
17285
  function launchClaude(promptPath, cwd) {
17286
17286
  return new Promise((resolve18) => {
17287
- const child = spawn("claude", ["--prompt-file", promptPath], {
17287
+ const promptContent = readFileSync6(promptPath, "utf-8");
17288
+ const child = spawn("claude", ["--append-system-prompt", promptContent], {
17288
17289
  stdio: "inherit",
17289
17290
  cwd: cwd ?? process.cwd()
17290
17291
  });
@@ -17323,7 +17324,7 @@ function printStatus(state) {
17323
17324
 
17324
17325
  // src/commands/analyze.ts
17325
17326
  import { Command as Command4 } from "commander";
17326
- import { readFileSync as readFileSync6, writeFileSync as writeFileSync6, mkdirSync as mkdirSync6, existsSync as existsSync7 } from "fs";
17327
+ import { readFileSync as readFileSync7, writeFileSync as writeFileSync6, mkdirSync as mkdirSync6, existsSync as existsSync7 } from "fs";
17327
17328
  import { resolve as resolve8 } from "path";
17328
17329
  import chalk5 from "chalk";
17329
17330
  import Table2 from "cli-table3";
@@ -17333,7 +17334,7 @@ var analyzeCommand = new Command4("analyze").description("Analyze a spec and gen
17333
17334
  console.error(chalk5.red(`Spec file not found: ${fullPath}`));
17334
17335
  process.exit(1);
17335
17336
  }
17336
- const content3 = readFileSync6(fullPath, "utf-8");
17337
+ const content3 = readFileSync7(fullPath, "utf-8");
17337
17338
  const data = loadData();
17338
17339
  console.log(chalk5.dim("Parsing spec..."));
17339
17340
  const spec = parseSpec(content3);
@@ -17503,7 +17504,7 @@ var pricingCommand = new Command5("pricing").description("Show current model pri
17503
17504
 
17504
17505
  // src/commands/status.ts
17505
17506
  import { Command as Command6 } from "commander";
17506
- import { readFileSync as readFileSync7, existsSync as existsSync8 } from "fs";
17507
+ import { readFileSync as readFileSync8, existsSync as existsSync8 } from "fs";
17507
17508
  import { resolve as resolve9 } from "path";
17508
17509
  import chalk7 from "chalk";
17509
17510
  import Table4 from "cli-table3";
@@ -17517,7 +17518,7 @@ var statusCommand = new Command6("status").description("Show project status from
17517
17518
  );
17518
17519
  return;
17519
17520
  }
17520
- const registry = JSON.parse(readFileSync7(registryPath, "utf-8"));
17521
+ const registry = JSON.parse(readFileSync8(registryPath, "utf-8"));
17521
17522
  const projectName = options.project ?? registry.project ?? getProjectName();
17522
17523
  const summaryPath = resolve9(
17523
17524
  process.cwd(),
@@ -17529,7 +17530,7 @@ var statusCommand = new Command6("status").description("Show project status from
17529
17530
  const hasTracking = existsSync8(summaryPath);
17530
17531
  const actuals = /* @__PURE__ */ new Map();
17531
17532
  if (hasTracking) {
17532
- const summary = JSON.parse(readFileSync7(summaryPath, "utf-8"));
17533
+ const summary = JSON.parse(readFileSync8(summaryPath, "utf-8"));
17533
17534
  for (const s of summary.sessions) {
17534
17535
  if (!s.featureId || s.status === "untagged") continue;
17535
17536
  const existing = actuals.get(s.featureId) ?? { tokens: 0, sessions: 0 };
@@ -17592,13 +17593,13 @@ Total estimated: ${totalEstimated.toLocaleString()} tokens`));
17592
17593
 
17593
17594
  // src/commands/track.ts
17594
17595
  import { Command as Command7 } from "commander";
17595
- import { readFileSync as readFileSync9, existsSync as existsSync10, writeFileSync as writeFileSync7, mkdirSync as mkdirSync7 } from "fs";
17596
+ import { readFileSync as readFileSync10, existsSync as existsSync10, writeFileSync as writeFileSync7, mkdirSync as mkdirSync7 } from "fs";
17596
17597
  import { resolve as resolve10 } from "path";
17597
17598
  import chalk8 from "chalk";
17598
17599
  import Table5 from "cli-table3";
17599
17600
 
17600
17601
  // ../tracker/dist/index.js
17601
- import { readFileSync as readFileSync8, readdirSync as readdirSync2, existsSync as existsSync9 } from "fs";
17602
+ import { readFileSync as readFileSync9, readdirSync as readdirSync2, existsSync as existsSync9 } from "fs";
17602
17603
  import { join, basename as basename3 } from "path";
17603
17604
  import { homedir } from "os";
17604
17605
  import { countTokens } from "@anthropic-ai/tokenizer";
@@ -17658,7 +17659,7 @@ var Registry = external_exports.object({
17658
17659
  generatedAt: external_exports.string()
17659
17660
  });
17660
17661
  function parseSessionFile(filePath) {
17661
- const content3 = readFileSync8(filePath, "utf-8");
17662
+ const content3 = readFileSync9(filePath, "utf-8");
17662
17663
  const lines = content3.trim().split("\n").filter(Boolean);
17663
17664
  if (lines.length === 0) return null;
17664
17665
  let inputTokens = 0;
@@ -18007,7 +18008,7 @@ var trackCommand = new Command7("track").description("Import Claude Code session
18007
18008
  return;
18008
18009
  }
18009
18010
  const registry = JSON.parse(
18010
- readFileSync9(registryPath, "utf-8")
18011
+ readFileSync10(registryPath, "utf-8")
18011
18012
  );
18012
18013
  const projectName = options.project ?? registry.project ?? getProjectName();
18013
18014
  console.log(chalk8.dim("Scanning for sessions..."));
@@ -18034,7 +18035,7 @@ var trackCommand = new Command7("track").description("Import Claude Code session
18034
18035
  );
18035
18036
  const trackedIds = /* @__PURE__ */ new Set();
18036
18037
  if (!options.backfill && existsSync10(summaryPath)) {
18037
- const summary = JSON.parse(readFileSync9(summaryPath, "utf-8"));
18038
+ const summary = JSON.parse(readFileSync10(summaryPath, "utf-8"));
18038
18039
  for (const s of summary.sessions ?? []) {
18039
18040
  trackedIds.add(s.sessionId);
18040
18041
  }
@@ -18134,7 +18135,7 @@ Total: ${totalTokens.toLocaleString()} tokens across ${results.length} sessions`
18134
18135
  }));
18135
18136
  let existing = { sessions: [] };
18136
18137
  if (existsSync10(summaryPath)) {
18137
- existing = JSON.parse(readFileSync9(summaryPath, "utf-8"));
18138
+ existing = JSON.parse(readFileSync10(summaryPath, "utf-8"));
18138
18139
  }
18139
18140
  existing.sessions.push(...sessionRecords);
18140
18141
  writeFileSync7(
@@ -18187,7 +18188,7 @@ Tracking saved: ${summaryPath}`));
18187
18188
 
18188
18189
  // src/commands/reconcile.ts
18189
18190
  import { Command as Command8 } from "commander";
18190
- import { readFileSync as readFileSync10, existsSync as existsSync11 } from "fs";
18191
+ import { readFileSync as readFileSync11, existsSync as existsSync11 } from "fs";
18191
18192
  import { resolve as resolve11 } from "path";
18192
18193
  import chalk9 from "chalk";
18193
18194
  import Table6 from "cli-table3";
@@ -18216,8 +18217,8 @@ var reconcileCommand = new Command8("reconcile").description("Compare estimates
18216
18217
  );
18217
18218
  return;
18218
18219
  }
18219
- const registry = JSON.parse(readFileSync10(registryPath, "utf-8"));
18220
- const summary = JSON.parse(readFileSync10(summaryPath, "utf-8"));
18220
+ const registry = JSON.parse(readFileSync11(registryPath, "utf-8"));
18221
+ const summary = JSON.parse(readFileSync11(summaryPath, "utf-8"));
18221
18222
  const projectName = options.project ?? registry.project ?? getProjectName();
18222
18223
  const data = loadData();
18223
18224
  const actuals = /* @__PURE__ */ new Map();
@@ -18392,7 +18393,7 @@ Overall: ${totalActual.toLocaleString()} / ${totalEstimated.toLocaleString()} to
18392
18393
 
18393
18394
  // src/commands/calibrate.ts
18394
18395
  import { Command as Command9 } from "commander";
18395
- import { readFileSync as readFileSync11, existsSync as existsSync12 } from "fs";
18396
+ import { readFileSync as readFileSync12, existsSync as existsSync12 } from "fs";
18396
18397
  import { resolve as resolve12 } from "path";
18397
18398
  import chalk10 from "chalk";
18398
18399
  import Table7 from "cli-table3";
@@ -18413,8 +18414,8 @@ var calibrateCommand = new Command9("calibrate").description("Show calibration d
18413
18414
  );
18414
18415
  return;
18415
18416
  }
18416
- const registry = JSON.parse(readFileSync11(registryPath, "utf-8"));
18417
- const summary = JSON.parse(readFileSync11(summaryPath, "utf-8"));
18417
+ const registry = JSON.parse(readFileSync12(registryPath, "utf-8"));
18418
+ const summary = JSON.parse(readFileSync12(summaryPath, "utf-8"));
18418
18419
  const projectName = options.project ?? registry.project ?? getProjectName();
18419
18420
  const actuals = /* @__PURE__ */ new Map();
18420
18421
  for (const session of summary.sessions) {
@@ -18608,7 +18609,7 @@ var estimateCommand = new Command10("estimate").description("Quick single-featur
18608
18609
 
18609
18610
  // src/commands/validate.ts
18610
18611
  import { Command as Command11 } from "commander";
18611
- import { readFileSync as readFileSync12, existsSync as existsSync13 } from "fs";
18612
+ import { readFileSync as readFileSync13, existsSync as existsSync13 } from "fs";
18612
18613
  import { resolve as resolve13 } from "path";
18613
18614
  import chalk12 from "chalk";
18614
18615
  var validateCommand = new Command11("validate").description("Validate a spec file format without running full analysis").argument("<spec>", "Path to the spec markdown file").action((specPath) => {
@@ -18617,7 +18618,7 @@ var validateCommand = new Command11("validate").description("Validate a spec fil
18617
18618
  console.error(chalk12.red(`Spec file not found: ${fullPath}`));
18618
18619
  process.exit(1);
18619
18620
  }
18620
- const content3 = readFileSync12(fullPath, "utf-8");
18621
+ const content3 = readFileSync13(fullPath, "utf-8");
18621
18622
  console.log(chalk12.bold("\nFathom \u2014 Validate Spec"));
18622
18623
  console.log(chalk12.dim("\u2500".repeat(50)));
18623
18624
  console.log(chalk12.dim(`File: ${fullPath}`));
@@ -18686,7 +18687,7 @@ var validateCommand = new Command11("validate").description("Validate a spec fil
18686
18687
 
18687
18688
  // src/commands/velocity.ts
18688
18689
  import { Command as Command12 } from "commander";
18689
- import { readFileSync as readFileSync13, existsSync as existsSync14 } from "fs";
18690
+ import { readFileSync as readFileSync14, existsSync as existsSync14 } from "fs";
18690
18691
  import { resolve as resolve14 } from "path";
18691
18692
  import chalk13 from "chalk";
18692
18693
  import Table8 from "cli-table3";
@@ -19009,8 +19010,8 @@ var velocityCommand = new Command12("velocity").description("Show velocity metri
19009
19010
  );
19010
19011
  return;
19011
19012
  }
19012
- const registry = JSON.parse(readFileSync13(registryPath, "utf-8"));
19013
- const summary = JSON.parse(readFileSync13(summaryPath, "utf-8"));
19013
+ const registry = JSON.parse(readFileSync14(registryPath, "utf-8"));
19014
+ const summary = JSON.parse(readFileSync14(summaryPath, "utf-8"));
19014
19015
  const projectName = options.project ?? registry.project ?? getProjectName();
19015
19016
  const data = loadData();
19016
19017
  const featureDataMap = /* @__PURE__ */ new Map();
@@ -19197,7 +19198,7 @@ var initCommand = new Command13("init").description("Initialize Fathom global co
19197
19198
 
19198
19199
  // src/commands/rename.ts
19199
19200
  import { Command as Command14 } from "commander";
19200
- import { readFileSync as readFileSync14, writeFileSync as writeFileSync9, existsSync as existsSync16 } from "fs";
19201
+ import { readFileSync as readFileSync15, writeFileSync as writeFileSync9, existsSync as existsSync16 } from "fs";
19201
19202
  import { resolve as resolve16 } from "path";
19202
19203
  import chalk15 from "chalk";
19203
19204
  var renameCommand = new Command14("rename").description("Rename the project in all .claude/te/ config files").argument("<name>", "New project name").action((name) => {
@@ -19218,7 +19219,7 @@ var renameCommand = new Command14("rename").description("Rename the project in a
19218
19219
  let updated = 0;
19219
19220
  for (const filePath of jsonFiles) {
19220
19221
  if (!existsSync16(filePath)) continue;
19221
- const data = JSON.parse(readFileSync14(filePath, "utf-8"));
19222
+ const data = JSON.parse(readFileSync15(filePath, "utf-8"));
19222
19223
  if (data.project) {
19223
19224
  oldName = data.project;
19224
19225
  data.project = name;
@@ -19228,7 +19229,7 @@ var renameCommand = new Command14("rename").description("Rename the project in a
19228
19229
  }
19229
19230
  const skillPath = resolve16(baseDir, ".claude", "skills", "fathom", "SKILL.md");
19230
19231
  if (existsSync16(skillPath)) {
19231
- const content3 = readFileSync14(skillPath, "utf-8");
19232
+ const content3 = readFileSync15(skillPath, "utf-8");
19232
19233
  const newContent = content3.replaceAll(oldName, name);
19233
19234
  if (newContent !== content3) {
19234
19235
  writeFileSync9(skillPath, newContent);
@@ -19237,7 +19238,7 @@ var renameCommand = new Command14("rename").description("Rename the project in a
19237
19238
  }
19238
19239
  const hookPath = resolve16(baseDir, ".claude", "hooks", "te-session-sync.sh");
19239
19240
  if (existsSync16(hookPath)) {
19240
- const content3 = readFileSync14(hookPath, "utf-8");
19241
+ const content3 = readFileSync15(hookPath, "utf-8");
19241
19242
  const newContent = content3.replaceAll(oldName, name);
19242
19243
  if (newContent !== content3) {
19243
19244
  writeFileSync9(hookPath, newContent);