fathom-cli 0.1.2 → 0.1.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/dist/index.js +111 -54
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -127,7 +127,7 @@ var require_extend = __commonJS({
|
|
|
127
127
|
});
|
|
128
128
|
|
|
129
129
|
// src/index.ts
|
|
130
|
-
import { Command as
|
|
130
|
+
import { Command as Command15 } from "commander";
|
|
131
131
|
|
|
132
132
|
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/external.js
|
|
133
133
|
var external_exports = {};
|
|
@@ -5170,7 +5170,7 @@ var Processor = class _Processor extends CallableInstance {
|
|
|
5170
5170
|
assertParser("process", this.parser || this.Parser);
|
|
5171
5171
|
assertCompiler("process", this.compiler || this.Compiler);
|
|
5172
5172
|
return done ? executor(void 0, done) : new Promise(executor);
|
|
5173
|
-
function executor(
|
|
5173
|
+
function executor(resolve14, reject) {
|
|
5174
5174
|
const realFile = vfile(file);
|
|
5175
5175
|
const parseTree = (
|
|
5176
5176
|
/** @type {HeadTree extends undefined ? Node : HeadTree} */
|
|
@@ -5201,8 +5201,8 @@ var Processor = class _Processor extends CallableInstance {
|
|
|
5201
5201
|
function realDone(error, file2) {
|
|
5202
5202
|
if (error || !file2) {
|
|
5203
5203
|
reject(error);
|
|
5204
|
-
} else if (
|
|
5205
|
-
|
|
5204
|
+
} else if (resolve14) {
|
|
5205
|
+
resolve14(file2);
|
|
5206
5206
|
} else {
|
|
5207
5207
|
ok(done, "`done` is defined if `resolve` is not");
|
|
5208
5208
|
done(void 0, file2);
|
|
@@ -5304,7 +5304,7 @@ var Processor = class _Processor extends CallableInstance {
|
|
|
5304
5304
|
file = void 0;
|
|
5305
5305
|
}
|
|
5306
5306
|
return done ? executor(void 0, done) : new Promise(executor);
|
|
5307
|
-
function executor(
|
|
5307
|
+
function executor(resolve14, reject) {
|
|
5308
5308
|
ok(
|
|
5309
5309
|
typeof file !== "function",
|
|
5310
5310
|
"`file` can\u2019t be a `done` anymore, we checked"
|
|
@@ -5318,8 +5318,8 @@ var Processor = class _Processor extends CallableInstance {
|
|
|
5318
5318
|
);
|
|
5319
5319
|
if (error) {
|
|
5320
5320
|
reject(error);
|
|
5321
|
-
} else if (
|
|
5322
|
-
|
|
5321
|
+
} else if (resolve14) {
|
|
5322
|
+
resolve14(resultingTree);
|
|
5323
5323
|
} else {
|
|
5324
5324
|
ok(done, "`done` is defined if `resolve` is not");
|
|
5325
5325
|
done(void 0, resultingTree, file2);
|
|
@@ -8147,10 +8147,10 @@ function resolveAll(constructs2, events, context) {
|
|
|
8147
8147
|
const called = [];
|
|
8148
8148
|
let index2 = -1;
|
|
8149
8149
|
while (++index2 < constructs2.length) {
|
|
8150
|
-
const
|
|
8151
|
-
if (
|
|
8152
|
-
events =
|
|
8153
|
-
called.push(
|
|
8150
|
+
const resolve14 = constructs2[index2].resolveAll;
|
|
8151
|
+
if (resolve14 && !called.includes(resolve14)) {
|
|
8152
|
+
events = resolve14(events, context);
|
|
8153
|
+
called.push(resolve14);
|
|
8154
8154
|
}
|
|
8155
8155
|
}
|
|
8156
8156
|
return events;
|
|
@@ -18051,11 +18051,67 @@ var initCommand = new Command12("init").description("Initialize Fathom global co
|
|
|
18051
18051
|
);
|
|
18052
18052
|
});
|
|
18053
18053
|
|
|
18054
|
-
// src/commands/
|
|
18054
|
+
// src/commands/rename.ts
|
|
18055
18055
|
import { Command as Command13 } from "commander";
|
|
18056
|
-
import { writeFileSync as writeFileSync5, existsSync as existsSync12 } from "fs";
|
|
18056
|
+
import { readFileSync as readFileSync12, writeFileSync as writeFileSync5, existsSync as existsSync12 } from "fs";
|
|
18057
18057
|
import { resolve as resolve12 } from "path";
|
|
18058
18058
|
import chalk14 from "chalk";
|
|
18059
|
+
var renameCommand = new Command13("rename").description("Rename the project in all .claude/te/ config files").argument("<name>", "New project name").action((name) => {
|
|
18060
|
+
const baseDir = process.cwd();
|
|
18061
|
+
const teDir = resolve12(baseDir, ".claude", "te");
|
|
18062
|
+
if (!existsSync12(teDir)) {
|
|
18063
|
+
console.error(
|
|
18064
|
+
chalk14.red("\n Error: .claude/te/ not found. Run `fathom setup` first.\n")
|
|
18065
|
+
);
|
|
18066
|
+
process.exit(1);
|
|
18067
|
+
}
|
|
18068
|
+
const jsonFiles = [
|
|
18069
|
+
resolve12(teDir, "config.json"),
|
|
18070
|
+
resolve12(teDir, "registry.json"),
|
|
18071
|
+
resolve12(teDir, "tracking", "summary.json")
|
|
18072
|
+
];
|
|
18073
|
+
let oldName = "unnamed";
|
|
18074
|
+
let updated = 0;
|
|
18075
|
+
for (const filePath of jsonFiles) {
|
|
18076
|
+
if (!existsSync12(filePath)) continue;
|
|
18077
|
+
const data = JSON.parse(readFileSync12(filePath, "utf-8"));
|
|
18078
|
+
if (data.project) {
|
|
18079
|
+
oldName = data.project;
|
|
18080
|
+
data.project = name;
|
|
18081
|
+
writeFileSync5(filePath, JSON.stringify(data, null, 2) + "\n");
|
|
18082
|
+
updated++;
|
|
18083
|
+
}
|
|
18084
|
+
}
|
|
18085
|
+
const skillPath = resolve12(baseDir, ".claude", "skills", "fathom", "SKILL.md");
|
|
18086
|
+
if (existsSync12(skillPath)) {
|
|
18087
|
+
const content3 = readFileSync12(skillPath, "utf-8");
|
|
18088
|
+
const newContent = content3.replaceAll(oldName, name);
|
|
18089
|
+
if (newContent !== content3) {
|
|
18090
|
+
writeFileSync5(skillPath, newContent);
|
|
18091
|
+
updated++;
|
|
18092
|
+
}
|
|
18093
|
+
}
|
|
18094
|
+
const hookPath = resolve12(baseDir, ".claude", "hooks", "te-session-sync.sh");
|
|
18095
|
+
if (existsSync12(hookPath)) {
|
|
18096
|
+
const content3 = readFileSync12(hookPath, "utf-8");
|
|
18097
|
+
const newContent = content3.replaceAll(oldName, name);
|
|
18098
|
+
if (newContent !== content3) {
|
|
18099
|
+
writeFileSync5(hookPath, newContent);
|
|
18100
|
+
updated++;
|
|
18101
|
+
}
|
|
18102
|
+
}
|
|
18103
|
+
console.log(
|
|
18104
|
+
chalk14.bold(`
|
|
18105
|
+
Renamed "${oldName}" \u2192 "${name}" (${updated} files updated)
|
|
18106
|
+
`)
|
|
18107
|
+
);
|
|
18108
|
+
});
|
|
18109
|
+
|
|
18110
|
+
// src/commands/research.ts
|
|
18111
|
+
import { Command as Command14 } from "commander";
|
|
18112
|
+
import { writeFileSync as writeFileSync6, existsSync as existsSync13 } from "fs";
|
|
18113
|
+
import { resolve as resolve13 } from "path";
|
|
18114
|
+
import chalk15 from "chalk";
|
|
18059
18115
|
|
|
18060
18116
|
// src/fetchers/types.ts
|
|
18061
18117
|
var RemoteManifest = external_exports.object({
|
|
@@ -18355,19 +18411,19 @@ function generateAgentsYaml(recommendations) {
|
|
|
18355
18411
|
|
|
18356
18412
|
// src/commands/research.ts
|
|
18357
18413
|
function findDataDir2() {
|
|
18358
|
-
const bundled =
|
|
18359
|
-
if (
|
|
18360
|
-
return
|
|
18414
|
+
const bundled = resolve13(import.meta.dirname ?? __dirname, "data");
|
|
18415
|
+
if (existsSync13(resolve13(bundled, "models.yaml"))) return bundled;
|
|
18416
|
+
return resolve13(import.meta.dirname ?? __dirname, "../../../../data");
|
|
18361
18417
|
}
|
|
18362
|
-
var researchCommand = new
|
|
18363
|
-
console.log(
|
|
18364
|
-
console.log(
|
|
18418
|
+
var researchCommand = new Command14("research").description("Check and update model pricing data (fetches live data)").option("--update", "Update local data files with latest pricing").option("--sync", "Also sync updated pricing to Convex").option("--check", "Check for differences without updating (default)").option("--offline", "Skip remote fetches, use local data only").option("--verbose", "Show fetch sources and timing details").action(async (options) => {
|
|
18419
|
+
console.log(chalk15.bold("\nFathom \u2014 Research: Model Pricing"));
|
|
18420
|
+
console.log(chalk15.dim("\u2500".repeat(55)));
|
|
18365
18421
|
const startTime = Date.now();
|
|
18366
18422
|
let localData;
|
|
18367
18423
|
try {
|
|
18368
18424
|
localData = loadData();
|
|
18369
18425
|
} catch {
|
|
18370
|
-
console.log(
|
|
18426
|
+
console.log(chalk15.yellow(" Warning: could not load local data files"));
|
|
18371
18427
|
localData = { models: [], recommendations: {} };
|
|
18372
18428
|
}
|
|
18373
18429
|
const [pricingResult, intelligenceResult] = await Promise.all([
|
|
@@ -18379,18 +18435,18 @@ var researchCommand = new Command13("research").description("Check and update mo
|
|
|
18379
18435
|
]);
|
|
18380
18436
|
if (options.verbose) {
|
|
18381
18437
|
const elapsed = Date.now() - startTime;
|
|
18382
|
-
console.log(
|
|
18438
|
+
console.log(chalk15.dim(`
|
|
18383
18439
|
Fetch time: ${elapsed}ms`));
|
|
18384
|
-
console.log(
|
|
18440
|
+
console.log(chalk15.dim(` Pricing source: ${pricingResult.source}`));
|
|
18385
18441
|
if (intelligenceResult) {
|
|
18386
|
-
console.log(
|
|
18442
|
+
console.log(chalk15.dim(` Intelligence source: ${intelligenceResult.source}`));
|
|
18387
18443
|
}
|
|
18388
18444
|
}
|
|
18389
18445
|
if (pricingResult.stale) {
|
|
18390
|
-
console.log(
|
|
18446
|
+
console.log(chalk15.yellow(`
|
|
18391
18447
|
\u26A0 Using local data (${pricingResult.error ?? "stale"})`));
|
|
18392
18448
|
} else {
|
|
18393
|
-
console.log(
|
|
18449
|
+
console.log(chalk15.green(`
|
|
18394
18450
|
Pricing: live data (manifest v${pricingResult.data.manifestVersion}, ${pricingResult.data.manifestDate})`));
|
|
18395
18451
|
}
|
|
18396
18452
|
const mergeResult = mergePricingData(
|
|
@@ -18407,20 +18463,20 @@ var researchCommand = new Command13("research").description("Check and update mo
|
|
|
18407
18463
|
displayRecommendations(mergeResult);
|
|
18408
18464
|
if (options.update) {
|
|
18409
18465
|
const dataDir = findDataDir2();
|
|
18410
|
-
const modelsPath =
|
|
18411
|
-
const agentsPath =
|
|
18412
|
-
|
|
18413
|
-
console.log(
|
|
18466
|
+
const modelsPath = resolve13(dataDir, "models.yaml");
|
|
18467
|
+
const agentsPath = resolve13(dataDir, "agents.yaml");
|
|
18468
|
+
writeFileSync6(modelsPath, generateModelsYaml(mergeResult.models.merged));
|
|
18469
|
+
console.log(chalk15.green(`
|
|
18414
18470
|
Updated: ${modelsPath}`));
|
|
18415
|
-
|
|
18416
|
-
console.log(
|
|
18471
|
+
writeFileSync6(agentsPath, generateAgentsYaml(mergeResult.recommendations.merged));
|
|
18472
|
+
console.log(chalk15.green(` Updated: ${agentsPath}`));
|
|
18417
18473
|
}
|
|
18418
18474
|
if (options.sync) {
|
|
18419
18475
|
await syncToConvex(mergeResult);
|
|
18420
18476
|
}
|
|
18421
18477
|
if (options.verbose) {
|
|
18422
18478
|
const totalElapsed = Date.now() - startTime;
|
|
18423
|
-
console.log(
|
|
18479
|
+
console.log(chalk15.dim(`
|
|
18424
18480
|
Total time: ${totalElapsed}ms`));
|
|
18425
18481
|
}
|
|
18426
18482
|
console.log();
|
|
@@ -18428,29 +18484,29 @@ var researchCommand = new Command13("research").description("Check and update mo
|
|
|
18428
18484
|
function displayPricingReport(result) {
|
|
18429
18485
|
const { models } = result;
|
|
18430
18486
|
if (models.added === 0 && models.updated === 0) {
|
|
18431
|
-
console.log(
|
|
18432
|
-
console.log(
|
|
18487
|
+
console.log(chalk15.green(` All model pricing is up to date.`));
|
|
18488
|
+
console.log(chalk15.dim(` ${models.merged.length} models checked.`));
|
|
18433
18489
|
} else {
|
|
18434
18490
|
if (models.updated > 0) {
|
|
18435
|
-
console.log(
|
|
18491
|
+
console.log(chalk15.yellow(`
|
|
18436
18492
|
${models.updated} pricing change(s) found:`));
|
|
18437
18493
|
for (const change of models.changes) {
|
|
18438
18494
|
if (change.status === "updated" && change.fields) {
|
|
18439
18495
|
for (const f of change.fields) {
|
|
18440
|
-
console.log(
|
|
18496
|
+
console.log(chalk15.dim(` ${change.name}: ${f.field} ${f.old} \u2192 ${f.new}`));
|
|
18441
18497
|
}
|
|
18442
18498
|
}
|
|
18443
18499
|
}
|
|
18444
18500
|
}
|
|
18445
18501
|
if (models.added > 0) {
|
|
18446
|
-
console.log(
|
|
18502
|
+
console.log(chalk15.yellow(`
|
|
18447
18503
|
${models.added} new model(s) found:`));
|
|
18448
18504
|
for (const change of models.changes) {
|
|
18449
18505
|
if (change.status === "added") {
|
|
18450
18506
|
const m = models.merged.find((x) => x.id === change.id);
|
|
18451
18507
|
if (m) {
|
|
18452
18508
|
console.log(
|
|
18453
|
-
|
|
18509
|
+
chalk15.dim(` ${m.name} (${m.tier}): $${m.input_per_mtok}/$${m.output_per_mtok} per MTok`)
|
|
18454
18510
|
);
|
|
18455
18511
|
}
|
|
18456
18512
|
}
|
|
@@ -18460,39 +18516,39 @@ function displayPricingReport(result) {
|
|
|
18460
18516
|
}
|
|
18461
18517
|
function displayIntelligence(intelligence) {
|
|
18462
18518
|
if (intelligence.suggestions.length === 0) {
|
|
18463
|
-
console.log(
|
|
18519
|
+
console.log(chalk15.dim(`
|
|
18464
18520
|
Intelligence: ${intelligence.summary}`));
|
|
18465
18521
|
return;
|
|
18466
18522
|
}
|
|
18467
|
-
console.log(
|
|
18523
|
+
console.log(chalk15.cyan(`
|
|
18468
18524
|
Intelligence suggestions (${intelligence.suggestions.length}):`));
|
|
18469
18525
|
for (const s of intelligence.suggestions) {
|
|
18470
|
-
const badge = s.confidence === "high" ?
|
|
18471
|
-
const model = s.model ?
|
|
18526
|
+
const badge = s.confidence === "high" ? chalk15.red("HIGH") : s.confidence === "medium" ? chalk15.yellow("MED") : chalk15.dim("LOW");
|
|
18527
|
+
const model = s.model ? chalk15.dim(` [${s.model}]`) : "";
|
|
18472
18528
|
console.log(` ${badge} ${s.description}${model}`);
|
|
18473
18529
|
}
|
|
18474
|
-
console.log(
|
|
18475
|
-
console.log(
|
|
18530
|
+
console.log(chalk15.dim(` Summary: ${intelligence.summary}`));
|
|
18531
|
+
console.log(chalk15.dim(` Note: Task profiles are team-calibrated and shown as suggestions only.`));
|
|
18476
18532
|
}
|
|
18477
18533
|
function displayRecommendations(result) {
|
|
18478
18534
|
const { recommendations } = result;
|
|
18479
18535
|
if (recommendations.updated > 0 || recommendations.added > 0) {
|
|
18480
|
-
console.log(
|
|
18536
|
+
console.log(chalk15.yellow(`
|
|
18481
18537
|
Recommendation changes:`));
|
|
18482
18538
|
for (const change of recommendations.changes) {
|
|
18483
18539
|
if (change.status === "updated") {
|
|
18484
|
-
console.log(
|
|
18540
|
+
console.log(chalk15.dim(` ${change.category}: ${change.oldModel} \u2192 ${change.newModel}`));
|
|
18485
18541
|
} else if (change.status === "added") {
|
|
18486
|
-
console.log(
|
|
18542
|
+
console.log(chalk15.dim(` ${change.category}: ${change.newModel} (new)`));
|
|
18487
18543
|
}
|
|
18488
18544
|
}
|
|
18489
18545
|
}
|
|
18490
|
-
console.log(
|
|
18491
|
-
console.log(
|
|
18492
|
-
console.log(
|
|
18493
|
-
console.log(
|
|
18546
|
+
console.log(chalk15.dim("\n Current model recommendations:"));
|
|
18547
|
+
console.log(chalk15.dim(" S/M complexity \u2192 Haiku 4.5 ($1/$5 per MTok) \u2014 fast, cheap"));
|
|
18548
|
+
console.log(chalk15.dim(" L complexity \u2192 Sonnet 4.6 ($3/$15 per MTok) \u2014 balanced"));
|
|
18549
|
+
console.log(chalk15.dim(" XL complexity \u2192 Opus 4.6 ($15/$75 per MTok) \u2014 highest quality"));
|
|
18494
18550
|
console.log(
|
|
18495
|
-
|
|
18551
|
+
chalk15.dim("\n Tip: Enable prompt caching to save 90% on input tokens for repeated context.")
|
|
18496
18552
|
);
|
|
18497
18553
|
}
|
|
18498
18554
|
async function syncToConvex(result) {
|
|
@@ -18518,12 +18574,12 @@ async function syncToConvex(result) {
|
|
|
18518
18574
|
}
|
|
18519
18575
|
logConvexStatus(synced > 0);
|
|
18520
18576
|
if (synced > 0) {
|
|
18521
|
-
console.log(
|
|
18577
|
+
console.log(chalk15.dim(` ${synced} models synced to Convex.`));
|
|
18522
18578
|
}
|
|
18523
18579
|
}
|
|
18524
18580
|
|
|
18525
18581
|
// src/index.ts
|
|
18526
|
-
var program = new
|
|
18582
|
+
var program = new Command15();
|
|
18527
18583
|
program.name("fathom").description("Workflow intelligence platform for AI-augmented development").version(VERSION);
|
|
18528
18584
|
program.addCommand(analyzeCommand);
|
|
18529
18585
|
program.addCommand(pricingCommand);
|
|
@@ -18537,6 +18593,7 @@ program.addCommand(validateCommand);
|
|
|
18537
18593
|
program.addCommand(velocityCommand);
|
|
18538
18594
|
program.addCommand(intakeCommand);
|
|
18539
18595
|
program.addCommand(initCommand);
|
|
18596
|
+
program.addCommand(renameCommand);
|
|
18540
18597
|
program.addCommand(researchCommand);
|
|
18541
18598
|
program.parse();
|
|
18542
18599
|
/*! Bundled license information:
|