@plune-ai/cli 0.15.0 → 0.17.0
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/README.md +25 -3
- package/dist/cli.cjs +467 -257
- package/dist/index.cjs +34 -3
- package/dist/index.js +34 -3
- package/dist/reporter-core.cjs +270 -169
- package/dist/reporter-core.d.cts +68 -7
- package/dist/reporter-core.d.ts +68 -7
- package/dist/reporter-core.js +267 -167
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -414,11 +414,25 @@ async function withRetry(fn, options) {
|
|
|
414
414
|
|
|
415
415
|
// src/providers/prices.ts
|
|
416
416
|
var PRICE_TABLE = {
|
|
417
|
-
// Anthropic
|
|
417
|
+
// Anthropic, current models. Source: platform.claude.com/docs/en/about-claude/pricing — base
|
|
418
|
+
// input and output tokens per million, read on 2026-09-29, kept here per thousand.
|
|
419
|
+
"claude-fable-5-1": { input_per_1k_usd: 0.01, output_per_1k_usd: 0.05 },
|
|
420
|
+
"claude-opus-5-5": { input_per_1k_usd: 4e-3, output_per_1k_usd: 0.02 },
|
|
421
|
+
"claude-sonnet-5-5": { input_per_1k_usd: 2e-3, output_per_1k_usd: 0.01 },
|
|
422
|
+
"claude-haiku-4-5": { input_per_1k_usd: 1e-3, output_per_1k_usd: 5e-3 },
|
|
423
|
+
// The dated id of the same model; a config may name either.
|
|
424
|
+
"claude-haiku-4-5-20251001": { input_per_1k_usd: 1e-3, output_per_1k_usd: 5e-3 },
|
|
425
|
+
// Anthropic, older ids: unchanged, so a config that still names one prices as it did. Anthropic has
|
|
426
|
+
// retired these models — a new project should not start on them.
|
|
418
427
|
"claude-3-5-haiku-latest": { input_per_1k_usd: 8e-4, output_per_1k_usd: 4e-3 },
|
|
419
428
|
"claude-3-5-sonnet-latest": { input_per_1k_usd: 3e-3, output_per_1k_usd: 0.015 },
|
|
420
429
|
"claude-3-opus-latest": { input_per_1k_usd: 0.015, output_per_1k_usd: 0.075 },
|
|
421
|
-
// OpenAI
|
|
430
|
+
// OpenAI, current models. Source: developers.openai.com/api/docs/pricing — standard tier, the
|
|
431
|
+
// short-context rates (a long-context request costs more), read on 2026-09-29.
|
|
432
|
+
"gpt-6-astra": { input_per_1k_usd: 0.01, output_per_1k_usd: 0.05 },
|
|
433
|
+
"gpt-6.1-sol": { input_per_1k_usd: 2e-3, output_per_1k_usd: 0.01 },
|
|
434
|
+
"gpt-6-luna": { input_per_1k_usd: 1e-4, output_per_1k_usd: 5e-4 },
|
|
435
|
+
// OpenAI, older ids: unchanged (the same rates the page above still lists for both).
|
|
422
436
|
"gpt-4o": { input_per_1k_usd: 25e-4, output_per_1k_usd: 0.01 },
|
|
423
437
|
"gpt-4o-mini": { input_per_1k_usd: 15e-5, output_per_1k_usd: 6e-4 },
|
|
424
438
|
// OpenAI via OpenRouter (namespaced ids). OpenRouter passes OpenAI list price through for
|
|
@@ -607,6 +621,18 @@ function getProvider(config, env, pricing) {
|
|
|
607
621
|
return createDefaultRegistry().resolve(config.type, config, env, pricing);
|
|
608
622
|
}
|
|
609
623
|
|
|
624
|
+
// src/providers/estimate.ts
|
|
625
|
+
function makeEstimateProvider(config, pricing) {
|
|
626
|
+
return {
|
|
627
|
+
complete: () => Promise.reject(
|
|
628
|
+
new Error("The --dry-run provider only estimates cost; it never calls a model.")
|
|
629
|
+
),
|
|
630
|
+
estimateCost: (usage, reportedCostUsd) => ({
|
|
631
|
+
cost_usd: resolveCost(usage, config.model, reportedCostUsd, pricing)
|
|
632
|
+
})
|
|
633
|
+
};
|
|
634
|
+
}
|
|
635
|
+
|
|
610
636
|
// src/providers/mock.ts
|
|
611
637
|
function makeMockProvider() {
|
|
612
638
|
return {
|
|
@@ -1473,11 +1499,16 @@ var NOOP_CACHE = { get: () => void 0, set: () => {
|
|
|
1473
1499
|
function isMockMode(env) {
|
|
1474
1500
|
return env["PLUNE_MOCK_PROVIDER"] === "1";
|
|
1475
1501
|
}
|
|
1502
|
+
function resolveProviderFor(config, dryRun) {
|
|
1503
|
+
if (isMockMode(process.env)) return () => makeMockProvider();
|
|
1504
|
+
if (dryRun) return (cfg) => makeEstimateProvider(cfg, config.pricing);
|
|
1505
|
+
return (cfg) => getProvider(cfg, process.env, config.pricing);
|
|
1506
|
+
}
|
|
1476
1507
|
function buildRealDeps(config, baseDir, dryRun) {
|
|
1477
1508
|
const dir = path4.join(baseDir, ".plune");
|
|
1478
1509
|
fs5.mkdirSync(dir, { recursive: true });
|
|
1479
1510
|
return {
|
|
1480
|
-
resolveProvider:
|
|
1511
|
+
resolveProvider: resolveProviderFor(config, dryRun),
|
|
1481
1512
|
embedder: getDefaultEmbedder(),
|
|
1482
1513
|
cache: dryRun ? NOOP_CACHE : openCache(path4.join(dir, "cache.db")),
|
|
1483
1514
|
now: Date.now,
|
package/dist/index.js
CHANGED
|
@@ -361,11 +361,25 @@ async function withRetry(fn, options) {
|
|
|
361
361
|
|
|
362
362
|
// src/providers/prices.ts
|
|
363
363
|
var PRICE_TABLE = {
|
|
364
|
-
// Anthropic
|
|
364
|
+
// Anthropic, current models. Source: platform.claude.com/docs/en/about-claude/pricing — base
|
|
365
|
+
// input and output tokens per million, read on 2026-09-29, kept here per thousand.
|
|
366
|
+
"claude-fable-5-1": { input_per_1k_usd: 0.01, output_per_1k_usd: 0.05 },
|
|
367
|
+
"claude-opus-5-5": { input_per_1k_usd: 4e-3, output_per_1k_usd: 0.02 },
|
|
368
|
+
"claude-sonnet-5-5": { input_per_1k_usd: 2e-3, output_per_1k_usd: 0.01 },
|
|
369
|
+
"claude-haiku-4-5": { input_per_1k_usd: 1e-3, output_per_1k_usd: 5e-3 },
|
|
370
|
+
// The dated id of the same model; a config may name either.
|
|
371
|
+
"claude-haiku-4-5-20251001": { input_per_1k_usd: 1e-3, output_per_1k_usd: 5e-3 },
|
|
372
|
+
// Anthropic, older ids: unchanged, so a config that still names one prices as it did. Anthropic has
|
|
373
|
+
// retired these models — a new project should not start on them.
|
|
365
374
|
"claude-3-5-haiku-latest": { input_per_1k_usd: 8e-4, output_per_1k_usd: 4e-3 },
|
|
366
375
|
"claude-3-5-sonnet-latest": { input_per_1k_usd: 3e-3, output_per_1k_usd: 0.015 },
|
|
367
376
|
"claude-3-opus-latest": { input_per_1k_usd: 0.015, output_per_1k_usd: 0.075 },
|
|
368
|
-
// OpenAI
|
|
377
|
+
// OpenAI, current models. Source: developers.openai.com/api/docs/pricing — standard tier, the
|
|
378
|
+
// short-context rates (a long-context request costs more), read on 2026-09-29.
|
|
379
|
+
"gpt-6-astra": { input_per_1k_usd: 0.01, output_per_1k_usd: 0.05 },
|
|
380
|
+
"gpt-6.1-sol": { input_per_1k_usd: 2e-3, output_per_1k_usd: 0.01 },
|
|
381
|
+
"gpt-6-luna": { input_per_1k_usd: 1e-4, output_per_1k_usd: 5e-4 },
|
|
382
|
+
// OpenAI, older ids: unchanged (the same rates the page above still lists for both).
|
|
369
383
|
"gpt-4o": { input_per_1k_usd: 25e-4, output_per_1k_usd: 0.01 },
|
|
370
384
|
"gpt-4o-mini": { input_per_1k_usd: 15e-5, output_per_1k_usd: 6e-4 },
|
|
371
385
|
// OpenAI via OpenRouter (namespaced ids). OpenRouter passes OpenAI list price through for
|
|
@@ -554,6 +568,18 @@ function getProvider(config, env, pricing) {
|
|
|
554
568
|
return createDefaultRegistry().resolve(config.type, config, env, pricing);
|
|
555
569
|
}
|
|
556
570
|
|
|
571
|
+
// src/providers/estimate.ts
|
|
572
|
+
function makeEstimateProvider(config, pricing) {
|
|
573
|
+
return {
|
|
574
|
+
complete: () => Promise.reject(
|
|
575
|
+
new Error("The --dry-run provider only estimates cost; it never calls a model.")
|
|
576
|
+
),
|
|
577
|
+
estimateCost: (usage, reportedCostUsd) => ({
|
|
578
|
+
cost_usd: resolveCost(usage, config.model, reportedCostUsd, pricing)
|
|
579
|
+
})
|
|
580
|
+
};
|
|
581
|
+
}
|
|
582
|
+
|
|
557
583
|
// src/providers/mock.ts
|
|
558
584
|
function makeMockProvider() {
|
|
559
585
|
return {
|
|
@@ -1420,11 +1446,16 @@ var NOOP_CACHE = { get: () => void 0, set: () => {
|
|
|
1420
1446
|
function isMockMode(env) {
|
|
1421
1447
|
return env["PLUNE_MOCK_PROVIDER"] === "1";
|
|
1422
1448
|
}
|
|
1449
|
+
function resolveProviderFor(config, dryRun) {
|
|
1450
|
+
if (isMockMode(process.env)) return () => makeMockProvider();
|
|
1451
|
+
if (dryRun) return (cfg) => makeEstimateProvider(cfg, config.pricing);
|
|
1452
|
+
return (cfg) => getProvider(cfg, process.env, config.pricing);
|
|
1453
|
+
}
|
|
1423
1454
|
function buildRealDeps(config, baseDir, dryRun) {
|
|
1424
1455
|
const dir = path4.join(baseDir, ".plune");
|
|
1425
1456
|
fs5.mkdirSync(dir, { recursive: true });
|
|
1426
1457
|
return {
|
|
1427
|
-
resolveProvider:
|
|
1458
|
+
resolveProvider: resolveProviderFor(config, dryRun),
|
|
1428
1459
|
embedder: getDefaultEmbedder(),
|
|
1429
1460
|
cache: dryRun ? NOOP_CACHE : openCache(path4.join(dir, "cache.db")),
|
|
1430
1461
|
now: Date.now,
|