@hung319/opencode-hive 1.4.1 → 1.4.3
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 +99 -0
- package/dist/hooks/smart-title.d.ts +18 -0
- package/dist/index.js +1379 -196
- package/dist/services/vector-memory.d.ts +85 -0
- package/dist/tools/agent-booster.d.ts +48 -0
- package/dist/tools/memory.d.ts +12 -0
- package/dist/tools/vector-memory.d.ts +10 -0
- package/package.json +4 -2
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vector Memory Service
|
|
3
|
+
*
|
|
4
|
+
* Enhanced memory system using @sparkleideas/memory for:
|
|
5
|
+
* - HNSW indexing for fast similarity search
|
|
6
|
+
* - Vector embeddings for semantic search
|
|
7
|
+
* - Hybrid SQLite + AgentDB backend
|
|
8
|
+
*
|
|
9
|
+
* Falls back to simple file-based storage if @sparkleideas/memory unavailable.
|
|
10
|
+
*/
|
|
11
|
+
export interface MemoryMetadata {
|
|
12
|
+
type?: 'decision' | 'learning' | 'preference' | 'blocker' | 'context' | 'pattern';
|
|
13
|
+
scope?: string;
|
|
14
|
+
tags?: string[];
|
|
15
|
+
source?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface VectorMemoryEntry {
|
|
18
|
+
id: string;
|
|
19
|
+
content: string;
|
|
20
|
+
embedding?: number[];
|
|
21
|
+
metadata: MemoryMetadata;
|
|
22
|
+
createdAt: string;
|
|
23
|
+
updatedAt: string;
|
|
24
|
+
}
|
|
25
|
+
export interface SearchResult {
|
|
26
|
+
id: string;
|
|
27
|
+
content: string;
|
|
28
|
+
score: number;
|
|
29
|
+
metadata: MemoryMetadata;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Initialize vector memory with lazy loading
|
|
33
|
+
*/
|
|
34
|
+
declare function initMemory(options?: {
|
|
35
|
+
indexPath?: string;
|
|
36
|
+
dimensions?: number;
|
|
37
|
+
}): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Add a memory entry to the vector index
|
|
40
|
+
*/
|
|
41
|
+
export declare function addMemory(content: string, metadata?: MemoryMetadata): Promise<{
|
|
42
|
+
id: string;
|
|
43
|
+
success: boolean;
|
|
44
|
+
fallback?: boolean;
|
|
45
|
+
}>;
|
|
46
|
+
/**
|
|
47
|
+
* Search memories using vector similarity
|
|
48
|
+
*/
|
|
49
|
+
export declare function searchMemories(query: string, options?: {
|
|
50
|
+
limit?: number;
|
|
51
|
+
type?: string;
|
|
52
|
+
scope?: string;
|
|
53
|
+
minScore?: number;
|
|
54
|
+
}): Promise<{
|
|
55
|
+
results: SearchResult[];
|
|
56
|
+
fallback?: boolean;
|
|
57
|
+
}>;
|
|
58
|
+
/**
|
|
59
|
+
* Get a memory entry by ID
|
|
60
|
+
*/
|
|
61
|
+
export declare function getMemory(id: string): Promise<VectorMemoryEntry | null>;
|
|
62
|
+
/**
|
|
63
|
+
* Delete a memory entry
|
|
64
|
+
*/
|
|
65
|
+
export declare function deleteMemory(id: string): Promise<boolean>;
|
|
66
|
+
/**
|
|
67
|
+
* Get vector memory status
|
|
68
|
+
*/
|
|
69
|
+
export declare function getMemoryStatus(): Promise<{
|
|
70
|
+
available: boolean;
|
|
71
|
+
type: 'vector' | 'fallback';
|
|
72
|
+
stats?: {
|
|
73
|
+
total: number;
|
|
74
|
+
byType?: Record<string, number>;
|
|
75
|
+
};
|
|
76
|
+
}>;
|
|
77
|
+
export declare const VectorMemoryService: {
|
|
78
|
+
init: typeof initMemory;
|
|
79
|
+
add: typeof addMemory;
|
|
80
|
+
search: typeof searchMemories;
|
|
81
|
+
get: typeof getMemory;
|
|
82
|
+
delete: typeof deleteMemory;
|
|
83
|
+
status: typeof getMemoryStatus;
|
|
84
|
+
};
|
|
85
|
+
export default VectorMemoryService;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type ToolDefinition } from "@opencode-ai/plugin";
|
|
2
|
+
/**
|
|
3
|
+
* Agent Booster Tool
|
|
4
|
+
*
|
|
5
|
+
* Ultra-fast code editing engine using @sparkleideas/agent-booster.
|
|
6
|
+
* - 52x faster than Morph LLM
|
|
7
|
+
* - FREE (no API key required)
|
|
8
|
+
* - Rust+WASM powered
|
|
9
|
+
*
|
|
10
|
+
* Uses lazy loading - only initializes when first called.
|
|
11
|
+
*/
|
|
12
|
+
export interface AgentBoosterEdit {
|
|
13
|
+
path: string;
|
|
14
|
+
oldContent: string;
|
|
15
|
+
newContent: string;
|
|
16
|
+
}
|
|
17
|
+
export interface AgentBoosterResult {
|
|
18
|
+
success: boolean;
|
|
19
|
+
path: string;
|
|
20
|
+
applied?: string;
|
|
21
|
+
error?: string;
|
|
22
|
+
fallback?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Apply edit with fallback to native implementation
|
|
26
|
+
*/
|
|
27
|
+
export declare function applyCodeEdit(edit: AgentBoosterEdit): Promise<AgentBoosterResult>;
|
|
28
|
+
/**
|
|
29
|
+
* Check if agent-booster is available
|
|
30
|
+
*/
|
|
31
|
+
export declare function isBoosterAvailable(): Promise<boolean>;
|
|
32
|
+
/**
|
|
33
|
+
* Get booster status
|
|
34
|
+
*/
|
|
35
|
+
export declare function getBoosterStatus(): Promise<{
|
|
36
|
+
available: boolean;
|
|
37
|
+
version?: string;
|
|
38
|
+
}>;
|
|
39
|
+
export declare const hiveCodeEditTool: ToolDefinition;
|
|
40
|
+
/**
|
|
41
|
+
* Lazy edit marker tool - uses agent-booster's special marker syntax
|
|
42
|
+
* Allows partial code snippets with // ... existing code ... placeholders
|
|
43
|
+
*/
|
|
44
|
+
export declare const hiveLazyEditTool: ToolDefinition;
|
|
45
|
+
/**
|
|
46
|
+
* Tool to check agent-booster status
|
|
47
|
+
*/
|
|
48
|
+
export declare const hiveBoosterStatusTool: ToolDefinition;
|
package/dist/tools/memory.d.ts
CHANGED
|
@@ -33,3 +33,15 @@ export declare const hiveMemoryReplaceTool: ToolDefinition;
|
|
|
33
33
|
export declare const hiveJournalWriteTool: ToolDefinition;
|
|
34
34
|
export declare const hiveJournalSearchTool: ToolDefinition;
|
|
35
35
|
export declare function buildMemoryInjection(projectRoot: string): Promise<string>;
|
|
36
|
+
export type MemoryType = 'decision' | 'learning' | 'preference' | 'blocker' | 'context' | 'pattern';
|
|
37
|
+
export interface TypedMemory {
|
|
38
|
+
ts: string;
|
|
39
|
+
type: MemoryType;
|
|
40
|
+
scope: string;
|
|
41
|
+
content: string;
|
|
42
|
+
issue?: string;
|
|
43
|
+
tags?: string[];
|
|
44
|
+
}
|
|
45
|
+
export declare const hiveMemoryRecallTool: ToolDefinition;
|
|
46
|
+
export declare const hiveMemoryUpdateTool: ToolDefinition;
|
|
47
|
+
export declare const hiveMemoryForgetTool: ToolDefinition;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ToolDefinition } from "@opencode-ai/plugin";
|
|
2
|
+
/**
|
|
3
|
+
* Vector Memory Tools
|
|
4
|
+
*
|
|
5
|
+
* Enhanced memory search using vector embeddings and HNSW indexing.
|
|
6
|
+
* Falls back to simple text search if @sparkleideas/memory unavailable.
|
|
7
|
+
*/
|
|
8
|
+
export declare const hiveVectorSearchTool: ToolDefinition;
|
|
9
|
+
export declare const hiveVectorAddTool: ToolDefinition;
|
|
10
|
+
export declare const hiveVectorStatusTool: ToolDefinition;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hung319/opencode-hive",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.3",
|
|
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",
|
|
@@ -42,7 +42,9 @@
|
|
|
42
42
|
"grep-mcp": "^1.1.0",
|
|
43
43
|
"@notprolands/ast-grep-mcp": "^1.1.1",
|
|
44
44
|
"@upstash/context7-mcp": "^2.1.0",
|
|
45
|
-
"exa-mcp-server": "^3.1.5"
|
|
45
|
+
"exa-mcp-server": "^3.1.5",
|
|
46
|
+
"@sparkleideas/agent-booster": "^0.2.3",
|
|
47
|
+
"@sparkleideas/memory": "^3.5.2"
|
|
46
48
|
},
|
|
47
49
|
"devDependencies": {
|
|
48
50
|
"hive-core": "workspace:*",
|