@hung319/opencode-hive
Advanced tools
| /** | ||
| * Auto-Summary Utility | ||
| * | ||
| * Automatically summarizes task completion and suggests next actions. | ||
| * Uses pattern learning to predict next steps. | ||
| */ | ||
| import { type PatternLearned } from './pattern-learner'; | ||
| export interface TaskSummary { | ||
| summary: string; | ||
| keyChanges: string[]; | ||
| suggestions: string[]; | ||
| patterns: PatternLearned[]; | ||
| } | ||
| export interface DiffAnalysis { | ||
| addedFeatures: string[]; | ||
| bugFixes: string[]; | ||
| refactors: string[]; | ||
| testsAdded: number; | ||
| filesChanged: number; | ||
| } | ||
| /** | ||
| * Extract meaningful changes from git diff | ||
| */ | ||
| export declare function extractKeyChanges(diff: string): DiffAnalysis; | ||
| /** | ||
| * Generate a concise summary from diff analysis | ||
| */ | ||
| export declare function generateSummary(analysis: DiffAnalysis): string; | ||
| /** | ||
| * Suggest next tasks based on patterns and completed tasks | ||
| */ | ||
| export declare function suggestNextTasks(completedTasks: string[], projectContext?: string): string[]; | ||
| /** | ||
| * Learn from task completion | ||
| */ | ||
| export declare function learnFromCompletion(taskName: string, taskContext: string, success: boolean, diff?: string): void; | ||
| /** | ||
| * Get comprehensive task summary | ||
| */ | ||
| export declare function getTaskSummary(completedTasks: string[], projectContext?: string, recentDiff?: string): TaskSummary; |
| /** | ||
| * Background Sync | ||
| * | ||
| * Non-blocking background synchronization for: | ||
| * - Memory persistence | ||
| * - Pattern learning | ||
| * - Context files | ||
| */ | ||
| export interface SyncConfig { | ||
| enabled: boolean; | ||
| interval: number; | ||
| items: SyncItem[]; | ||
| onSync?: (item: SyncItem, success: boolean) => void; | ||
| } | ||
| export type SyncItem = 'memory' | 'patterns' | 'context'; | ||
| export interface SyncStats { | ||
| lastSync: string | null; | ||
| itemsSynced: number; | ||
| totalSyncs: number; | ||
| errors: number; | ||
| } | ||
| export declare class BackgroundSync { | ||
| private config; | ||
| private timer; | ||
| private stats; | ||
| private running; | ||
| constructor(config?: Partial<SyncConfig>); | ||
| /** | ||
| * Start background sync | ||
| */ | ||
| start(): void; | ||
| /** | ||
| * Stop background sync | ||
| */ | ||
| stop(): void; | ||
| /** | ||
| * Run sync now (blocking) | ||
| */ | ||
| syncNow(): Promise<void>; | ||
| /** | ||
| * Get sync statistics | ||
| */ | ||
| getStats(): SyncStats & { | ||
| running: boolean; | ||
| }; | ||
| /** | ||
| * Update configuration | ||
| */ | ||
| updateConfig(config: Partial<SyncConfig>): void; | ||
| /** | ||
| * Add item to sync list | ||
| */ | ||
| addItem(item: SyncItem): void; | ||
| /** | ||
| * Remove item from sync list | ||
| */ | ||
| removeItem(item: SyncItem): void; | ||
| private syncItem; | ||
| } | ||
| export declare function getBackgroundSync(config?: Partial<SyncConfig>): BackgroundSync; |
| /** | ||
| * Incremental Loader | ||
| * | ||
| * Lazy loading with LRU cache for efficient resource management. | ||
| * Used for skills, context files, and other resources. | ||
| */ | ||
| export interface LoaderConfig { | ||
| maxCache: number; | ||
| ttl?: number; | ||
| onEvict?: (key: string, value: unknown) => void; | ||
| } | ||
| /** | ||
| * Generic incremental loader with LRU cache | ||
| */ | ||
| export declare class IncrementalLoader<T> { | ||
| private loader; | ||
| private cache; | ||
| private accessOrder; | ||
| private config; | ||
| constructor(loader: (key: string) => Promise<T> | T, config?: Partial<LoaderConfig>); | ||
| /** | ||
| * Get a value, loading if not cached | ||
| */ | ||
| get(key: string): Promise<T>; | ||
| /** | ||
| * Check if key is cached (without loading) | ||
| */ | ||
| has(key: string): boolean; | ||
| /** | ||
| * Invalidate a specific key | ||
| */ | ||
| invalidate(key: string): void; | ||
| /** | ||
| * Clear all cached values | ||
| */ | ||
| clear(): void; | ||
| /** | ||
| * Preload multiple keys | ||
| */ | ||
| preload(keys: string[]): Promise<void>; | ||
| /** | ||
| * Get cache statistics | ||
| */ | ||
| getStats(): { | ||
| size: number; | ||
| maxSize: number; | ||
| cachedKeys: string[]; | ||
| }; | ||
| private updateAccessOrder; | ||
| private evictOldest; | ||
| } | ||
| /** | ||
| * Skill template loader with incremental loading | ||
| */ | ||
| export declare class SkillLoader extends IncrementalLoader<string> { | ||
| constructor(); | ||
| } | ||
| /** | ||
| * Context file loader with incremental loading | ||
| */ | ||
| export declare class ContextLoader extends IncrementalLoader<string> { | ||
| constructor(projectRoot: string); | ||
| } | ||
| /** | ||
| * MCP tool loader with incremental loading | ||
| */ | ||
| export declare class McpToolLoader extends IncrementalLoader<unknown> { | ||
| constructor(); | ||
| } |
| /** | ||
| * Pattern Learning System | ||
| * | ||
| * Learns patterns from task execution to improve future suggestions. | ||
| * Stores patterns in `.hive/patterns.json`. | ||
| * | ||
| * Features: | ||
| * - Track action sequences (what follows what) | ||
| * - Calculate success rate per pattern | ||
| * - Predict next actions based on context | ||
| */ | ||
| export interface PatternLearned { | ||
| id: string; | ||
| pattern: string; | ||
| trigger: string; | ||
| action: string; | ||
| frequency: number; | ||
| successCount: number; | ||
| lastSeen: string; | ||
| examples: string[]; | ||
| } | ||
| export interface PatternConfig { | ||
| enabled: boolean; | ||
| maxPatterns: number; | ||
| minConfidence: number; | ||
| dataDir: string; | ||
| } | ||
| export declare class PatternLearner { | ||
| private patterns; | ||
| private config; | ||
| private dataPath; | ||
| private loaded; | ||
| constructor(config?: Partial<PatternConfig>, projectRoot?: string); | ||
| /** | ||
| * Load patterns from disk | ||
| */ | ||
| load(): void; | ||
| /** | ||
| * Save patterns to disk | ||
| */ | ||
| private save; | ||
| /** | ||
| * Learn a new pattern | ||
| */ | ||
| learn(trigger: string, action: string, success: boolean, context?: string): void; | ||
| /** | ||
| * Predict next actions based on context | ||
| */ | ||
| predict(context: string): PatternLearned[]; | ||
| /** | ||
| * Get the most successful patterns | ||
| */ | ||
| getTopPatterns(limit?: number): PatternLearned[]; | ||
| /** | ||
| * Export all patterns for AGENTS.md sync | ||
| */ | ||
| exportPatterns(): PatternLearned[]; | ||
| /** | ||
| * Import patterns (for team sharing) | ||
| */ | ||
| importPatterns(patterns: PatternLearned[]): void; | ||
| /** | ||
| * Get statistics | ||
| */ | ||
| getStats(): { | ||
| totalPatterns: number; | ||
| avgConfidence: number; | ||
| mostSuccessful: PatternLearned | null; | ||
| recentPatterns: PatternLearned[]; | ||
| }; | ||
| /** | ||
| * Clear all patterns | ||
| */ | ||
| clear(): void; | ||
| private generateId; | ||
| private evictOldestPattern; | ||
| } | ||
| export declare function getPatternLearner(projectRoot?: string): PatternLearner; |
+1
-1
@@ -510,3 +510,3 @@ #!/usr/bin/env bun | ||
| status: 'ready', | ||
| version: '1.8.0', | ||
| version: '1.9.0', | ||
| summary: getSystemInfo(), | ||
@@ -513,0 +513,0 @@ checks: { |
@@ -6,4 +6,4 @@ import type { LocalMcpConfig } from './types'; | ||
| * Privacy-respecting meta-search engine aggregator | ||
| * - Can use public SearXNG instances or self-hosted | ||
| * - Good for privacy-conscious searches | ||
| * - REQUIRES: SEARXNG_URL environment variable | ||
| * - Without it, MCP will error (-32000) | ||
| * | ||
@@ -10,0 +10,0 @@ * https://github.com/ihor-sokoliuk/mcp-searxng |
+1
-1
| { | ||
| "name": "@hung319/opencode-hive", | ||
| "version": "1.8.0", | ||
| "version": "1.9.0", | ||
| "type": "module", | ||
@@ -5,0 +5,0 @@ "description": "OpenCode plugin for Agent Hive - from vibe coding to hive coding", |
+1
-1
@@ -57,3 +57,3 @@ # @hung319/opencode-hive | ||
| - For **free web search**: `npm install @oevortex/ddg_search` | ||
| - For **privacy search**: `npm install mcp-searxng` | ||
| - For **privacy search**: `npm install mcp-searxng` (requires `SEARXNG_URL` env var) | ||
@@ -60,0 +60,0 @@ Or use the quick install command: |
Sorry, the diff of this file is too big to display
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
1187540
0.53%76
5.56%30231
0.83%83
1.22%