@link-assistant/hive-mind 0.39.0 → 0.40.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,19 @@
1
1
  # @link-assistant/hive-mind
2
2
 
3
+ ## 0.40.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 1ee78c9: fix: prefer Anthropic provider for public price calculation
8
+
9
+ When calculating public pricing for Claude models, fetchModelInfo now checks the Anthropic provider first instead of using the first match from the models.dev API (which was Helicone). This ensures pricing calculations show "Provider: Anthropic" as expected.
10
+
11
+ ## 0.40.0
12
+
13
+ ### Minor Changes
14
+
15
+ - 9115337: Add --prompt-plan-sub-agent option to encourage Plan sub-agent usage. When enabled, the AI receives suggestive instructions to consider using the Plan sub-agent for initial research and planning, improving solution quality through better upfront analysis.
16
+
3
17
  ## 0.39.0
4
18
 
5
19
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@link-assistant/hive-mind",
3
- "version": "0.39.0",
3
+ "version": "0.40.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",
@@ -493,7 +493,15 @@ export const fetchModelInfo = async (modelId) => {
493
493
  res.on('end', () => {
494
494
  try {
495
495
  const apiData = JSON.parse(data);
496
- // Search for the model across all providers
496
+ // For public pricing calculation, prefer Anthropic provider for Claude models
497
+ // Check Anthropic provider first
498
+ if (apiData.anthropic?.models?.[modelId]) {
499
+ const modelInfo = apiData.anthropic.models[modelId];
500
+ modelInfo.provider = apiData.anthropic.name || 'Anthropic';
501
+ resolve(modelInfo);
502
+ return;
503
+ }
504
+ // Search for the model across all other providers
497
505
  for (const provider of Object.values(apiData)) {
498
506
  if (provider.models && provider.models[modelId]) {
499
507
  const modelInfo = provider.models[modelId];
@@ -193,7 +193,7 @@ Self review.
193
193
  - When you check your solution draft, run all tests locally.
194
194
  - When you check your solution draft, verify git status shows a clean working tree with no uncommitted changes.
195
195
  - When you compare with repo style, use gh pr diff [number].
196
- - When you finalize, confirm code, tests, and description are consistent.`;
196
+ - When you finalize, confirm code, tests, and description are consistent.${argv && argv.promptPlanSubAgent ? '\n\nPlan sub-agent usage.\n - When you start working on a task, consider using the Plan sub-agent to research the codebase and create an implementation plan.\n - When using the Plan sub-agent, you can add it as the first item in your todo list.\n - When you delegate planning, use the Task tool with subagent_type="Plan" before starting implementation work.' : ''}`;
197
197
  };
198
198
 
199
199
  // Export all functions as default object too
@@ -208,6 +208,11 @@ export const createYargsConfig = (yargsInstance) => {
208
208
  choices: ['low', 'medium', 'high', 'max'],
209
209
  default: undefined
210
210
  })
211
+ .option('prompt-plan-sub-agent', {
212
+ type: 'boolean',
213
+ description: 'Encourage AI to use Plan sub-agent for initial planning (only works with --tool claude)',
214
+ default: false
215
+ })
211
216
  .option('sentry', {
212
217
  type: 'boolean',
213
218
  description: 'Enable Sentry error tracking and monitoring (use --no-sentry to disable)',
package/src/hive.mjs CHANGED
@@ -133,7 +133,6 @@ const { tryFetchIssuesWithGraphQL } = graphqlLib;
133
133
  const commandName = process.argv[1] ? process.argv[1].split('/').pop() : '';
134
134
  const isLocalScript = commandName.endsWith('.mjs');
135
135
  const solveCommand = isLocalScript ? './solve.mjs' : 'solve';
136
-
137
136
  /**
138
137
  * Fallback function to fetch issues from organization/user repositories
139
138
  * when search API hits rate limits
@@ -755,6 +754,7 @@ async function worker(workerId) {
755
754
  const toolFlag = argv.tool ? ` --tool ${argv.tool}` : '';
756
755
  const autoContinueFlag = argv.autoContinue ? ' --auto-continue' : '';
757
756
  const thinkFlag = argv.think ? ` --think ${argv.think}` : '';
757
+ const promptPlanSubAgentFlag = argv.promptPlanSubAgent ? ' --prompt-plan-sub-agent' : '';
758
758
  const noSentryFlag = !argv.sentry ? ' --no-sentry' : '';
759
759
  const watchFlag = argv.watch ? ' --watch' : '';
760
760
  const prefixForkNameWithOwnerNameFlag = argv.prefixForkNameWithOwnerName ? ' --prefix-fork-name-with-owner-name' : '';
@@ -799,6 +799,7 @@ async function worker(workerId) {
799
799
  if (argv.think) {
800
800
  args.push('--think', argv.think);
801
801
  }
802
+ if (argv.promptPlanSubAgent) args.push('--prompt-plan-sub-agent');
802
803
  if (!argv.sentry) {
803
804
  args.push('--no-sentry');
804
805
  }
@@ -808,11 +809,10 @@ async function worker(workerId) {
808
809
  if (argv.promptExploreSubAgent) args.push('--prompt-explore-sub-agent');
809
810
 
810
811
  // Log the actual command being executed so users can investigate/reproduce
811
- const command = `${solveCommand} "${issueUrl}" --model ${argv.model}${toolFlag}${forkFlag}${autoForkFlag}${verboseFlag}${attachLogsFlag}${targetBranchFlag}${logDirFlag}${dryRunFlag}${skipToolConnectionCheckFlag}${autoContinueFlag}${thinkFlag}${noSentryFlag}${watchFlag}${prefixForkNameWithOwnerNameFlag}${interactiveModeFlag}${promptExploreSubAgentFlag}`;
812
+ const command = `${solveCommand} "${issueUrl}" --model ${argv.model}${toolFlag}${forkFlag}${autoForkFlag}${verboseFlag}${attachLogsFlag}${targetBranchFlag}${logDirFlag}${dryRunFlag}${skipToolConnectionCheckFlag}${autoContinueFlag}${thinkFlag}${promptPlanSubAgentFlag}${noSentryFlag}${watchFlag}${prefixForkNameWithOwnerNameFlag}${interactiveModeFlag}${promptExploreSubAgentFlag}`;
812
813
  await log(` 📋 Command: ${command}`);
813
814
 
814
815
  let exitCode = 0;
815
-
816
816
  // Create promise to handle async spawn process
817
817
  await new Promise((resolve) => {
818
818
  const child = spawn(solveCommand, args, {
@@ -194,6 +194,11 @@ export const createYargsConfig = (yargsInstance) => {
194
194
  choices: ['low', 'medium', 'high', 'max'],
195
195
  default: undefined
196
196
  })
197
+ .option('prompt-plan-sub-agent', {
198
+ type: 'boolean',
199
+ description: 'Encourage AI to use Plan sub-agent for initial planning (only works with --tool claude)',
200
+ default: false
201
+ })
197
202
  .option('base-branch', {
198
203
  type: 'string',
199
204
  description: 'Target branch for the pull request (defaults to repository default branch)',