@link-assistant/hive-mind 1.5.0 → 1.6.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/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/src/claude.lib.mjs +13 -9
- package/src/claude.prompts.lib.mjs +25 -0
- package/src/solve.config.lib.mjs +5 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @link-assistant/hive-mind
|
|
2
2
|
|
|
3
|
+
## 1.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 56d95bd: Add `--prompt-subagents-via-agent-commander` option to guide Claude to use agent-commander CLI for subagent delegation instead of native Task tool. This allows using any supported agent type (claude, opencode, codex, agent) with a unified API and saves main agent context. The prompt guidance is only included when agent-commander (start-agent) is actually installed on the system.
|
|
8
|
+
|
|
3
9
|
## 1.5.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/package.json
CHANGED
package/src/claude.lib.mjs
CHANGED
|
@@ -25,21 +25,13 @@ const showResumeCommand = async (sessionId, tempDir, claudePath, model, log) =>
|
|
|
25
25
|
await log(` ${cmd}\n`);
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
/**
|
|
29
|
-
* Format numbers with spaces as thousands separator (no commas)
|
|
30
|
-
* Per issue #667: Use spaces for thousands, . for decimals
|
|
31
|
-
* @param {number|null|undefined} num - Number to format
|
|
32
|
-
* @returns {string} Formatted number string
|
|
33
|
-
*/
|
|
28
|
+
/** Format numbers with spaces as thousands separator (no commas) */
|
|
34
29
|
export const formatNumber = num => {
|
|
35
30
|
if (num === null || num === undefined) return 'N/A';
|
|
36
|
-
// Convert to string and split on decimal point
|
|
37
31
|
const parts = num.toString().split('.');
|
|
38
32
|
const integerPart = parts[0];
|
|
39
33
|
const decimalPart = parts[1];
|
|
40
|
-
// Add spaces every 3 digits from the right
|
|
41
34
|
const formattedInteger = integerPart.replace(/\B(?=(\d{3})+(?!\d))/g, ' ');
|
|
42
|
-
// Return with decimal part if it exists
|
|
43
35
|
return decimalPart !== undefined ? `${formattedInteger}.${decimalPart}` : formattedInteger;
|
|
44
36
|
};
|
|
45
37
|
// Available model configurations
|
|
@@ -414,6 +406,18 @@ export const checkPlaywrightMcpAvailability = async () => {
|
|
|
414
406
|
*/
|
|
415
407
|
export const executeClaude = async params => {
|
|
416
408
|
const { issueUrl, issueNumber, prNumber, prUrl, branchName, tempDir, workspaceTmpDir, isContinueMode, mergeStateStatus, forkedRepo, feedbackLines, forkActionsUrl, owner, repo, argv, log, setLogFile, getLogFile, formatAligned, getResourceSnapshot, claudePath, $ } = params;
|
|
409
|
+
|
|
410
|
+
// Check if agent-commander is installed when the option is enabled
|
|
411
|
+
if (argv.promptSubagentsViaAgentCommander) {
|
|
412
|
+
try {
|
|
413
|
+
await $`which start-agent`;
|
|
414
|
+
argv.agentCommanderInstalled = true;
|
|
415
|
+
} catch {
|
|
416
|
+
argv.agentCommanderInstalled = false;
|
|
417
|
+
await log('⚠️ agent-commander not installed; prompt guidance will be skipped (npm i -g @link-assistant/agent-commander)');
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
|
|
417
421
|
// Import prompt building functions from claude.prompts.lib.mjs
|
|
418
422
|
const { buildUserPrompt, buildSystemPrompt } = await import('./claude.prompts.lib.mjs');
|
|
419
423
|
// Build the user prompt
|
|
@@ -282,6 +282,31 @@ Plan sub-agent usage.
|
|
|
282
282
|
- When using the Plan sub-agent, you can add it as the first item in your todo list.
|
|
283
283
|
- When you delegate planning, use the Task tool with subagent_type="Plan" before starting implementation work.`
|
|
284
284
|
: ''
|
|
285
|
+
}${
|
|
286
|
+
argv && argv.promptSubagentsViaAgentCommander && argv.agentCommanderInstalled
|
|
287
|
+
? `
|
|
288
|
+
|
|
289
|
+
Agent Commander usage (unified subagent delegation).
|
|
290
|
+
- When you need to delegate tasks to subagents, use the agent-commander CLI tool (start-agent) instead of the native Task tool.
|
|
291
|
+
- Agent Commander provides a unified API for different agent types (claude, opencode, codex, agent) and supports various isolation modes.
|
|
292
|
+
- To delegate a task, use the Bash tool to run start-agent with appropriate parameters:
|
|
293
|
+
\`\`\`bash
|
|
294
|
+
start-agent --tool claude --working-directory "$(pwd)" --prompt "Your task description here"
|
|
295
|
+
\`\`\`
|
|
296
|
+
- Common start-agent parameters:
|
|
297
|
+
--tool <name>: Agent to use (claude, opencode, codex, agent)
|
|
298
|
+
--working-directory <path>: Execution directory (use current directory for context)
|
|
299
|
+
--prompt <text>: The task to delegate
|
|
300
|
+
--model <name>: Model to use (sonnet, opus, haiku, grok, etc.)
|
|
301
|
+
--isolation <mode>: Execution context (none, screen, docker)
|
|
302
|
+
--detached: Run in background mode
|
|
303
|
+
- Examples:
|
|
304
|
+
Explore codebase: start-agent --tool claude --working-directory "$(pwd)" --prompt "Explore the codebase structure and find how authentication is implemented"
|
|
305
|
+
Run with specific model: start-agent --tool claude --working-directory "$(pwd)" --model opus --prompt "Review this complex algorithm"
|
|
306
|
+
Use different agent: start-agent --tool opencode --working-directory "$(pwd)" --model grok --prompt "Analyze performance issues"
|
|
307
|
+
- Benefits: Saves main agent context, supports any agent type, provides unified API across different AI tools.
|
|
308
|
+
- Note: The subagent will have access to the same working directory and can read/write files as needed.`
|
|
309
|
+
: ''
|
|
285
310
|
}${ciExamples}${getArchitectureCareSubPrompt(argv)}`;
|
|
286
311
|
};
|
|
287
312
|
|
package/src/solve.config.lib.mjs
CHANGED
|
@@ -326,6 +326,11 @@ export const createYargsConfig = yargsInstance => {
|
|
|
326
326
|
description: 'Automatically repair git configuration using gh-setup-git-identity --repair when git identity is not configured. Requires gh-setup-git-identity to be installed.',
|
|
327
327
|
default: false,
|
|
328
328
|
})
|
|
329
|
+
.option('prompt-subagents-via-agent-commander', {
|
|
330
|
+
type: 'boolean',
|
|
331
|
+
description: 'Guide Claude to use agent-commander CLI (start-agent) instead of native Task tool for subagent delegation. Allows using any supported agent type (claude, opencode, codex, agent) with unified API. Only works with --tool claude and requires agent-commander to be installed.',
|
|
332
|
+
default: false,
|
|
333
|
+
})
|
|
329
334
|
.parserConfiguration({
|
|
330
335
|
'boolean-negation': true,
|
|
331
336
|
})
|