@hung319/opencode-hive 1.4.3 → 1.5.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/README.md +82 -1
- package/dist/ast-grep-napi.linux-x64-gnu-qdwfscvp.node +0 -0
- package/dist/ast-grep-napi.linux-x64-musl-qnd01z8b.node +0 -0
- package/dist/index.js +2562 -335
- package/dist/mcp/mcp-info.d.ts +37 -0
- package/dist/mcp/pare-search.d.ts +13 -0
- package/dist/mcp/veil.d.ts +12 -0
- package/dist/tools/ast-grep-native.d.ts +18 -0
- package/dist/tools/auto-cr.d.ts +5 -0
- package/dist/tools/dora.d.ts +7 -0
- package/dist/tools/hive-doctor.d.ts +6 -0
- package/dist/tools/lsp-manager.d.ts +52 -0
- package/dist/tools/lsp.d.ts +10 -0
- package/dist/utils/dep-installer.d.ts +80 -0
- package/dist/utils/model-selector.d.ts +68 -0
- package/package.json +7 -2
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get the MCP guide content
|
|
3
|
+
*/
|
|
4
|
+
export declare function getMcpGuide(): string;
|
|
5
|
+
/**
|
|
6
|
+
* Get MCP info for a specific agent type
|
|
7
|
+
*/
|
|
8
|
+
export declare function getMcpGuideForAgent(agentName: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* MCP Tool Information
|
|
11
|
+
*/
|
|
12
|
+
export interface McpTool {
|
|
13
|
+
name: string;
|
|
14
|
+
mcp: string;
|
|
15
|
+
description: string;
|
|
16
|
+
category: 'search' | 'analysis' | 'discovery' | 'docs';
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* List of all MCP tools with descriptions
|
|
20
|
+
*/
|
|
21
|
+
export declare const MCP_TOOLS: McpTool[];
|
|
22
|
+
/**
|
|
23
|
+
* Get MCP tool info
|
|
24
|
+
*/
|
|
25
|
+
export declare function getMcpToolInfo(toolName: string): McpTool | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Get MCP tools by category
|
|
28
|
+
*/
|
|
29
|
+
export declare function getMcpToolsByCategory(category: McpTool['category']): McpTool[];
|
|
30
|
+
/**
|
|
31
|
+
* Get all MCP names
|
|
32
|
+
*/
|
|
33
|
+
export declare function getMcpNames(): string[];
|
|
34
|
+
/**
|
|
35
|
+
* Format MCP tools as XML for system prompts
|
|
36
|
+
*/
|
|
37
|
+
export declare function formatMcpToolsXml(): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { LocalMcpConfig } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* @paretools/search MCP for structured code search
|
|
4
|
+
*
|
|
5
|
+
* Wraps ripgrep and fd with typed JSON output.
|
|
6
|
+
* Part of the Pare suite of MCP servers.
|
|
7
|
+
*
|
|
8
|
+
* Features:
|
|
9
|
+
* - 65-95% token reduction vs raw CLI output
|
|
10
|
+
* - Structured, schema-validated JSON
|
|
11
|
+
* - search, find, count tools
|
|
12
|
+
*/
|
|
13
|
+
export declare const pareSearchMcp: LocalMcpConfig;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { LocalMcpConfig } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* @ushiradineth/veil MCP for code discovery
|
|
4
|
+
*
|
|
5
|
+
* Veil helps coding agents find the right code fast.
|
|
6
|
+
* - discover: Get files, symbols, and code chunks in one step
|
|
7
|
+
* - lookup: Get the most relevant context for the task
|
|
8
|
+
* - files, symbols, search: Focused follow-up
|
|
9
|
+
*
|
|
10
|
+
* https://github.com/ushiradineth/veil
|
|
11
|
+
*/
|
|
12
|
+
export declare const veilMcp: LocalMcpConfig;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ToolDefinition } from "@opencode-ai/plugin";
|
|
2
|
+
/**
|
|
3
|
+
* Check if ast-grep is available
|
|
4
|
+
*/
|
|
5
|
+
export declare function isAstGrepAvailable(): Promise<boolean>;
|
|
6
|
+
/**
|
|
7
|
+
* Get ast-grep status
|
|
8
|
+
*/
|
|
9
|
+
export declare function getAstGrepStatus(): Promise<{
|
|
10
|
+
available: boolean;
|
|
11
|
+
version?: string;
|
|
12
|
+
}>;
|
|
13
|
+
export declare const astGrepDumpSyntaxTreeTool: ToolDefinition;
|
|
14
|
+
export declare const astGrepTestMatchCodeRuleTool: ToolDefinition;
|
|
15
|
+
export declare const astGrepFindCodeTool: ToolDefinition;
|
|
16
|
+
export declare const astGrepScanCodeTool: ToolDefinition;
|
|
17
|
+
export declare const astGrepRewriteCodeTool: ToolDefinition;
|
|
18
|
+
export declare const astGrepAnalyzeImportsTool: ToolDefinition;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type ToolDefinition } from "@opencode-ai/plugin";
|
|
2
|
+
export declare const autoCrStatusTool: ToolDefinition;
|
|
3
|
+
export declare const autoCrScanTool: ToolDefinition;
|
|
4
|
+
export declare const autoCrDiffTool: ToolDefinition;
|
|
5
|
+
export declare const autoCrRulesTool: ToolDefinition;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ToolDefinition } from "@opencode-ai/plugin";
|
|
2
|
+
export declare const doraStatusTool: ToolDefinition;
|
|
3
|
+
export declare const doraSymbolTool: ToolDefinition;
|
|
4
|
+
export declare const doraFileTool: ToolDefinition;
|
|
5
|
+
export declare const doraReferencesTool: ToolDefinition;
|
|
6
|
+
export declare const doraCyclesTool: ToolDefinition;
|
|
7
|
+
export declare const doraUnusedTool: ToolDefinition;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get language from file extension
|
|
3
|
+
*/
|
|
4
|
+
export declare function getLanguageFromPath(filePath: string): string | null;
|
|
5
|
+
/**
|
|
6
|
+
* Install LSP server with fallbacks
|
|
7
|
+
*/
|
|
8
|
+
export declare function ensureLspInstalled(language: string): Promise<{
|
|
9
|
+
success: boolean;
|
|
10
|
+
installed: string | null;
|
|
11
|
+
error?: string;
|
|
12
|
+
}>;
|
|
13
|
+
/**
|
|
14
|
+
* LSP Status Report
|
|
15
|
+
*/
|
|
16
|
+
export interface LspStatus {
|
|
17
|
+
language: string;
|
|
18
|
+
installed: boolean;
|
|
19
|
+
primary: string | null;
|
|
20
|
+
alternatives: string[];
|
|
21
|
+
canInstall: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare function getLspStatus(filePath?: string): Promise<LspStatus | LspStatus[]>;
|
|
24
|
+
/**
|
|
25
|
+
* LSP Manager Class for actual LSP communication
|
|
26
|
+
*/
|
|
27
|
+
export declare class LspManager {
|
|
28
|
+
private connections;
|
|
29
|
+
/**
|
|
30
|
+
* Check LSP status and optionally auto-install
|
|
31
|
+
*/
|
|
32
|
+
checkAndInstall(filePath: string): Promise<{
|
|
33
|
+
language: string;
|
|
34
|
+
ready: boolean;
|
|
35
|
+
installed: boolean;
|
|
36
|
+
message: string;
|
|
37
|
+
}>;
|
|
38
|
+
/**
|
|
39
|
+
* Get available LSP languages
|
|
40
|
+
*/
|
|
41
|
+
getAvailableLanguages(): string[];
|
|
42
|
+
/**
|
|
43
|
+
* Get LSP info for a file
|
|
44
|
+
*/
|
|
45
|
+
getLspInfo(filePath: string): {
|
|
46
|
+
language: string;
|
|
47
|
+
extensions: string[];
|
|
48
|
+
primaryCommand: string;
|
|
49
|
+
alternativeCommands: string[];
|
|
50
|
+
} | null;
|
|
51
|
+
}
|
|
52
|
+
export declare const lspManager: LspManager;
|
package/dist/tools/lsp.d.ts
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import { type ToolDefinition } from "@opencode-ai/plugin";
|
|
2
|
+
/**
|
|
3
|
+
* LSP Tools for IDE-like functionality
|
|
4
|
+
*
|
|
5
|
+
* Features:
|
|
6
|
+
* - Auto-detect language and install LSP if needed
|
|
7
|
+
* - Fallback to alternative LSPs when primary fails
|
|
8
|
+
* - Full LSP protocol support (rename, goto, references, etc.)
|
|
9
|
+
*/
|
|
2
10
|
export declare const lspRenameTool: ToolDefinition;
|
|
3
11
|
export declare const lspGotoDefinitionTool: ToolDefinition;
|
|
4
12
|
export declare const lspFindReferencesTool: ToolDefinition;
|
|
5
13
|
export declare const lspDiagnosticsTool: ToolDefinition;
|
|
6
14
|
export declare const lspHoverTool: ToolDefinition;
|
|
7
15
|
export declare const lspCodeActionsTool: ToolDefinition;
|
|
16
|
+
export declare const lspStatusTool: ToolDefinition;
|
|
17
|
+
export declare const lspInstallTool: ToolDefinition;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Dependencies that can be auto-installed
|
|
3
|
+
*/
|
|
4
|
+
interface ToolConfig {
|
|
5
|
+
name: string;
|
|
6
|
+
npmPackage: string;
|
|
7
|
+
installCommand: string[];
|
|
8
|
+
verifyCommand: string;
|
|
9
|
+
description: string;
|
|
10
|
+
required: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Dependency Installer for plugin tools
|
|
14
|
+
*/
|
|
15
|
+
export declare class DependencyInstaller {
|
|
16
|
+
private installDir;
|
|
17
|
+
private cache;
|
|
18
|
+
private cacheTimeout;
|
|
19
|
+
constructor(installDir?: string);
|
|
20
|
+
/**
|
|
21
|
+
* Get the bin directory for installed tools
|
|
22
|
+
*/
|
|
23
|
+
getBinDir(): string;
|
|
24
|
+
/**
|
|
25
|
+
* Check if a command exists
|
|
26
|
+
*/
|
|
27
|
+
commandExists(cmd: string): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Verify a tool is installed and working
|
|
30
|
+
*/
|
|
31
|
+
verifyTool(config: ToolConfig): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Install a single tool
|
|
34
|
+
*/
|
|
35
|
+
install(config: ToolConfig): Promise<{
|
|
36
|
+
success: boolean;
|
|
37
|
+
output?: string;
|
|
38
|
+
error?: string;
|
|
39
|
+
}>;
|
|
40
|
+
/**
|
|
41
|
+
* Check if a tool is installed (with caching)
|
|
42
|
+
*/
|
|
43
|
+
isInstalled(toolName: string): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Get status of all tools
|
|
46
|
+
*/
|
|
47
|
+
getStatus(): Array<{
|
|
48
|
+
name: string;
|
|
49
|
+
installed: boolean;
|
|
50
|
+
description: string;
|
|
51
|
+
required: boolean;
|
|
52
|
+
}>;
|
|
53
|
+
/**
|
|
54
|
+
* Ensure all required tools are installed
|
|
55
|
+
*/
|
|
56
|
+
ensureRequired(): Promise<{
|
|
57
|
+
installed: string[];
|
|
58
|
+
missing: string[];
|
|
59
|
+
errors: Record<string, string>;
|
|
60
|
+
}>;
|
|
61
|
+
/**
|
|
62
|
+
* Install all optional tools (for full functionality)
|
|
63
|
+
*/
|
|
64
|
+
installAll(): Promise<{
|
|
65
|
+
success: string[];
|
|
66
|
+
failed: Record<string, string>;
|
|
67
|
+
}>;
|
|
68
|
+
/**
|
|
69
|
+
* Install specific tool by name
|
|
70
|
+
*/
|
|
71
|
+
installTool(toolName: string): Promise<{
|
|
72
|
+
success: boolean;
|
|
73
|
+
output?: string;
|
|
74
|
+
error?: string;
|
|
75
|
+
}>;
|
|
76
|
+
}
|
|
77
|
+
export declare const dependencyInstaller: DependencyInstaller;
|
|
78
|
+
export declare function ensurePluginDeps(): Promise<void>;
|
|
79
|
+
export declare function getInstalledTools(): string[];
|
|
80
|
+
export {};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model Selector - Prioritize free models for non-essential tools
|
|
3
|
+
*
|
|
4
|
+
* This utility helps select the appropriate model for different operations:
|
|
5
|
+
* - Free models for simple tasks (auto-name, btca control)
|
|
6
|
+
* - Premium models for complex operations (planning, code review)
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* OpenCode free model names (when available)
|
|
10
|
+
*/
|
|
11
|
+
export declare const FREE_MODELS: readonly ["opencode/free", "openai/gpt-4o-mini", "openai/gpt-4o", "google/gemini-flash"];
|
|
12
|
+
/**
|
|
13
|
+
* Check if OpenCode has free model quota available
|
|
14
|
+
*/
|
|
15
|
+
export declare function isFreeModelAvailable(): Promise<boolean>;
|
|
16
|
+
/**
|
|
17
|
+
* Get the appropriate model for a tool
|
|
18
|
+
*
|
|
19
|
+
* @param toolName - The tool name to get model for
|
|
20
|
+
* @param currentModel - The current model being used
|
|
21
|
+
* @returns The model to use for this tool
|
|
22
|
+
*/
|
|
23
|
+
export declare function getModelForTool(toolName: string, currentModel?: string): string;
|
|
24
|
+
/**
|
|
25
|
+
* Model configuration for different operation types
|
|
26
|
+
*/
|
|
27
|
+
export interface ModelConfig {
|
|
28
|
+
model: string;
|
|
29
|
+
temperature: number;
|
|
30
|
+
maxTokens?: number;
|
|
31
|
+
description: string;
|
|
32
|
+
}
|
|
33
|
+
export declare const MODEL_PROFILES: Record<string, ModelConfig>;
|
|
34
|
+
/**
|
|
35
|
+
* Get model profile for an operation type
|
|
36
|
+
*/
|
|
37
|
+
export declare function getModelProfile(operationType: 'free' | 'standard' | 'premium' | 'reasoning'): ModelConfig;
|
|
38
|
+
/**
|
|
39
|
+
* Tool categorization by operation complexity
|
|
40
|
+
*/
|
|
41
|
+
export declare const TOOL_CATEGORIES: Record<string, 'free' | 'standard' | 'premium'>;
|
|
42
|
+
/**
|
|
43
|
+
* Get the appropriate model profile for a tool
|
|
44
|
+
*/
|
|
45
|
+
export declare function getModelForToolCategory(toolName: string): ModelConfig;
|
|
46
|
+
/**
|
|
47
|
+
* Check if a tool should use a free model
|
|
48
|
+
*/
|
|
49
|
+
export declare function shouldUseFreeModel(toolName: string): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Model Selector class for managing model selection
|
|
52
|
+
*/
|
|
53
|
+
export declare class ModelSelector {
|
|
54
|
+
private freeModelCache;
|
|
55
|
+
/**
|
|
56
|
+
* Check if free model is available
|
|
57
|
+
*/
|
|
58
|
+
isFreeModelAvailable(): Promise<boolean>;
|
|
59
|
+
/**
|
|
60
|
+
* Get model for a specific tool
|
|
61
|
+
*/
|
|
62
|
+
getModelForTool(toolName: string, currentModel?: string): Promise<string>;
|
|
63
|
+
/**
|
|
64
|
+
* Clear the free model cache
|
|
65
|
+
*/
|
|
66
|
+
clearCache(): void;
|
|
67
|
+
}
|
|
68
|
+
export declare const modelSelector: ModelSelector;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hung319/opencode-hive",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "OpenCode plugin for Agent Hive - from vibe coding to hive coding",
|
|
6
6
|
"license": "MIT WITH Commons-Clause",
|
|
@@ -44,7 +44,12 @@
|
|
|
44
44
|
"@upstash/context7-mcp": "^2.1.0",
|
|
45
45
|
"exa-mcp-server": "^3.1.5",
|
|
46
46
|
"@sparkleideas/agent-booster": "^0.2.3",
|
|
47
|
-
"@sparkleideas/memory": "^3.5.2"
|
|
47
|
+
"@sparkleideas/memory": "^3.5.2",
|
|
48
|
+
"@ast-grep/napi": "^0.41.1",
|
|
49
|
+
"@paretools/search": "^0.15.0",
|
|
50
|
+
"@ushiradineth/veil": "^0.4.1",
|
|
51
|
+
"@butttons/dora": "^0.1.0",
|
|
52
|
+
"auto-cr-cmd": "^2.0.112"
|
|
48
53
|
},
|
|
49
54
|
"devDependencies": {
|
|
50
55
|
"hive-core": "workspace:*",
|