@link-assistant/hive-mind 1.48.0 → 1.48.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @link-assistant/hive-mind
2
2
 
3
+ ## 1.48.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 6d385ab: Simplified cost display when public and Anthropic costs match, removed USD suffix from Anthropic cost line
8
+
3
9
  ## 1.48.0
4
10
 
5
11
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@link-assistant/hive-mind",
3
- "version": "1.48.0",
3
+ "version": "1.48.1",
4
4
  "description": "AI-powered issue solver and hive mind for collaborative problem solving",
5
5
  "main": "src/hive.mjs",
6
6
  "type": "module",
@@ -118,15 +118,23 @@ export const displayModelUsage = async (usage, log) => {
118
118
 
119
119
  /**
120
120
  * Display cost comparison between public pricing and Anthropic's official cost
121
+ * Issue #1557: Show simplified format when costs match, remove USD suffix
121
122
  * @param {number|null} publicCost - Public pricing estimate
122
123
  * @param {number|null} anthropicCost - Anthropic's official cost
123
124
  * @param {Function} log - Logging function
124
125
  */
125
126
  export const displayCostComparison = async (publicCost, anthropicCost, log) => {
127
+ const hasPublic = publicCost !== null && publicCost !== undefined;
128
+ const hasAnthropic = anthropicCost !== null && anthropicCost !== undefined;
129
+ // Issue #1557: When both costs match, show simplified format
130
+ if (hasPublic && hasAnthropic && publicCost.toFixed(6) === anthropicCost.toFixed(6)) {
131
+ await log(`\n 💰 Cost: $${anthropicCost.toFixed(6)}`);
132
+ return;
133
+ }
126
134
  await log('\n 💰 Cost estimation:');
127
- await log(` Public pricing estimate: ${publicCost !== null && publicCost !== undefined ? `$${publicCost.toFixed(6)} USD` : 'unknown'}`);
128
- await log(` Calculated by Anthropic: ${anthropicCost !== null && anthropicCost !== undefined ? `$${anthropicCost.toFixed(6)} USD` : 'unknown'}`);
129
- if (publicCost !== null && publicCost !== undefined && anthropicCost !== null && anthropicCost !== undefined) {
135
+ await log(` Public pricing estimate: ${hasPublic ? `$${publicCost.toFixed(6)}` : 'unknown'}`);
136
+ await log(` Calculated by Anthropic: ${hasAnthropic ? `$${anthropicCost.toFixed(6)}` : 'unknown'}`);
137
+ if (hasPublic && hasAnthropic) {
130
138
  const difference = anthropicCost - publicCost;
131
139
  const percentDiff = publicCost > 0 ? (difference / publicCost) * 100 : 0;
132
140
  await log(` Difference: $${difference.toFixed(6)} (${percentDiff > 0 ? '+' : ''}${percentDiff.toFixed(2)}%)`);
@@ -15,13 +15,15 @@ import { getToolDisplayName, getModelInfoForComment } from './models/index.mjs';
15
15
  export { getToolDisplayName }; // Re-export for use by other modules
16
16
  import { buildBudgetStatsString } from './claude.budget-stats.lib.mjs';
17
17
 
18
- /** Build cost estimation string for log comments (Issue #1250) */
18
+ /** Build cost estimation string for log comments (Issue #1250, Issue #1557) */
19
19
  const buildCostInfoString = (totalCostUSD, anthropicTotalCostUSD, pricingInfo) => {
20
20
  const hasPublic = totalCostUSD !== null && totalCostUSD !== undefined;
21
21
  const hasAnthropic = anthropicTotalCostUSD !== null && anthropicTotalCostUSD !== undefined;
22
22
  const hasPricing = pricingInfo && (pricingInfo.modelName || pricingInfo.tokenUsage || pricingInfo.isFreeModel || pricingInfo.isOpencodeFreeModel);
23
23
  const hasOpencodeCost = pricingInfo?.opencodeCost !== null && pricingInfo?.opencodeCost !== undefined;
24
24
  if (!hasPublic && !hasAnthropic && !hasPricing && !hasOpencodeCost) return '';
25
+ // Issue #1557: Simplified display when public and Anthropic costs match
26
+ if (hasPublic && hasAnthropic && totalCostUSD.toFixed(6) === anthropicTotalCostUSD.toFixed(6)) return `\n\n### 💰 Cost: **$${anthropicTotalCostUSD.toFixed(6)}**`;
25
27
  let costInfo = '\n\n### 💰 **Cost estimation:**';
26
28
  if (pricingInfo?.modelName) {
27
29
  costInfo += `\n- Model: ${pricingInfo.modelName}`;
@@ -57,7 +59,7 @@ const buildCostInfoString = (totalCostUSD, anthropicTotalCostUSD, pricingInfo) =
57
59
  costInfo += tokenInfo;
58
60
  }
59
61
  if (hasAnthropic) {
60
- costInfo += `\n- Calculated by Anthropic: $${anthropicTotalCostUSD.toFixed(6)} USD`;
62
+ costInfo += `\n- Calculated by Anthropic: $${anthropicTotalCostUSD.toFixed(6)}`;
61
63
  if (hasPublic) {
62
64
  const diff = anthropicTotalCostUSD - totalCostUSD;
63
65
  const pct = totalCostUSD > 0 ? (diff / totalCostUSD) * 100 : 0;
@@ -66,12 +68,8 @@ const buildCostInfoString = (totalCostUSD, anthropicTotalCostUSD, pricingInfo) =
66
68
  }
67
69
  return costInfo;
68
70
  };
69
-
70
- // Helper function to mask GitHub tokens (alias for backward compatibility)
71
- export const maskGitHubToken = maskToken;
72
- // Escape ``` in logs for safe markdown embedding (replaces with \`\`\` to prevent code block closure)
73
- export const escapeCodeBlocksInLog = logContent => logContent.replace(/```/g, '\\`\\`\\`');
74
- // Helper function to check if a file exists in a GitHub branch
71
+ export const maskGitHubToken = maskToken; // Alias for backward compatibility
72
+ export const escapeCodeBlocksInLog = logContent => logContent.replace(/```/g, '\\`\\`\\`'); // Escape ``` in logs
75
73
  export const checkFileInBranch = async (owner, repo, fileName, branchName) => {
76
74
  const { $ } = await use('command-stream');
77
75