opencode-swarm-plugin 0.56.0 → 0.57.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/README.md +21 -0
- package/claude-plugin/.claude-plugin/plugin.json +1 -4
- package/claude-plugin/agents/background-worker.md +1 -0
- package/claude-plugin/agents/coordinator.md +1 -0
- package/claude-plugin/agents/worker.md +1 -0
- package/claude-plugin/bin/swarm-mcp-server.ts +47 -8
- package/claude-plugin/commands/hive.md +1 -1
- package/claude-plugin/commands/swarm.md +5 -1
- package/claude-plugin/dist/agent-mail.d.ts +480 -0
- package/claude-plugin/dist/agent-mail.d.ts.map +1 -0
- package/claude-plugin/dist/anti-patterns.d.ts +257 -0
- package/claude-plugin/dist/anti-patterns.d.ts.map +1 -0
- package/claude-plugin/dist/bin/swarm.js +373128 -0
- package/claude-plugin/dist/cass-tools.d.ts +74 -0
- package/claude-plugin/dist/cass-tools.d.ts.map +1 -0
- package/claude-plugin/dist/claude-plugin/claude-plugin-assets.d.ts +10 -0
- package/claude-plugin/dist/claude-plugin/claude-plugin-assets.d.ts.map +1 -0
- package/claude-plugin/dist/compaction-hook.d.ts +178 -0
- package/claude-plugin/dist/compaction-hook.d.ts.map +1 -0
- package/claude-plugin/dist/compaction-observability.d.ts +173 -0
- package/claude-plugin/dist/compaction-observability.d.ts.map +1 -0
- package/claude-plugin/dist/compaction-prompt-scoring.d.ts +125 -0
- package/claude-plugin/dist/compaction-prompt-scoring.d.ts.map +1 -0
- package/claude-plugin/dist/compaction-prompt-scoring.js +139 -0
- package/claude-plugin/dist/contributor-tools.d.ts +42 -0
- package/claude-plugin/dist/contributor-tools.d.ts.map +1 -0
- package/claude-plugin/dist/coordinator-guard.d.ts +79 -0
- package/claude-plugin/dist/coordinator-guard.d.ts.map +1 -0
- package/claude-plugin/dist/dashboard.d.ts +82 -0
- package/claude-plugin/dist/dashboard.d.ts.map +1 -0
- package/claude-plugin/dist/decision-trace-integration.d.ts +204 -0
- package/claude-plugin/dist/decision-trace-integration.d.ts.map +1 -0
- package/claude-plugin/dist/error-enrichment.d.ts +49 -0
- package/claude-plugin/dist/error-enrichment.d.ts.map +1 -0
- package/claude-plugin/dist/eval-capture.d.ts +494 -0
- package/claude-plugin/dist/eval-capture.d.ts.map +1 -0
- package/claude-plugin/dist/eval-capture.js +12844 -0
- package/claude-plugin/dist/eval-gates.d.ts +84 -0
- package/claude-plugin/dist/eval-gates.d.ts.map +1 -0
- package/claude-plugin/dist/eval-history.d.ts +117 -0
- package/claude-plugin/dist/eval-history.d.ts.map +1 -0
- package/claude-plugin/dist/eval-learning.d.ts +216 -0
- package/claude-plugin/dist/eval-learning.d.ts.map +1 -0
- package/claude-plugin/dist/eval-runner.d.ts +134 -0
- package/claude-plugin/dist/eval-runner.d.ts.map +1 -0
- package/claude-plugin/dist/examples/plugin-wrapper-template.ts +3341 -0
- package/claude-plugin/dist/export-tools.d.ts +76 -0
- package/claude-plugin/dist/export-tools.d.ts.map +1 -0
- package/claude-plugin/dist/hive.d.ts +949 -0
- package/claude-plugin/dist/hive.d.ts.map +1 -0
- package/claude-plugin/dist/hive.js +15009 -0
- package/claude-plugin/dist/hivemind-tools.d.ts +479 -0
- package/claude-plugin/dist/hivemind-tools.d.ts.map +1 -0
- package/claude-plugin/dist/hooks/atomic-write.d.ts +21 -0
- package/claude-plugin/dist/hooks/atomic-write.d.ts.map +1 -0
- package/claude-plugin/dist/hooks/constants.d.ts +28 -0
- package/claude-plugin/dist/hooks/constants.d.ts.map +1 -0
- package/claude-plugin/dist/hooks/index.d.ts +16 -0
- package/claude-plugin/dist/hooks/index.d.ts.map +1 -0
- package/claude-plugin/dist/hooks/session-start.d.ts +30 -0
- package/claude-plugin/dist/hooks/session-start.d.ts.map +1 -0
- package/claude-plugin/dist/hooks/tool-complete.d.ts +54 -0
- package/claude-plugin/dist/hooks/tool-complete.d.ts.map +1 -0
- package/claude-plugin/dist/index.d.ts +2017 -0
- package/claude-plugin/dist/index.d.ts.map +1 -0
- package/claude-plugin/dist/index.js +73453 -0
- package/claude-plugin/dist/learning.d.ts +700 -0
- package/claude-plugin/dist/learning.d.ts.map +1 -0
- package/claude-plugin/dist/logger.d.ts +38 -0
- package/claude-plugin/dist/logger.d.ts.map +1 -0
- package/claude-plugin/dist/mandate-promotion.d.ts +93 -0
- package/claude-plugin/dist/mandate-promotion.d.ts.map +1 -0
- package/claude-plugin/dist/mandate-storage.d.ts +209 -0
- package/claude-plugin/dist/mandate-storage.d.ts.map +1 -0
- package/claude-plugin/dist/mandates.d.ts +230 -0
- package/claude-plugin/dist/mandates.d.ts.map +1 -0
- package/claude-plugin/dist/memory-tools.d.ts +281 -0
- package/claude-plugin/dist/memory-tools.d.ts.map +1 -0
- package/claude-plugin/dist/memory.d.ts +164 -0
- package/claude-plugin/dist/memory.d.ts.map +1 -0
- package/claude-plugin/dist/model-selection.d.ts +37 -0
- package/claude-plugin/dist/model-selection.d.ts.map +1 -0
- package/claude-plugin/dist/observability-health.d.ts +87 -0
- package/claude-plugin/dist/observability-health.d.ts.map +1 -0
- package/claude-plugin/dist/observability-tools.d.ts +184 -0
- package/claude-plugin/dist/observability-tools.d.ts.map +1 -0
- package/claude-plugin/dist/output-guardrails.d.ts +125 -0
- package/claude-plugin/dist/output-guardrails.d.ts.map +1 -0
- package/claude-plugin/dist/pattern-maturity.d.ts +246 -0
- package/claude-plugin/dist/pattern-maturity.d.ts.map +1 -0
- package/claude-plugin/dist/planning-guardrails.d.ts +183 -0
- package/claude-plugin/dist/planning-guardrails.d.ts.map +1 -0
- package/claude-plugin/dist/plugin.d.ts +22 -0
- package/claude-plugin/dist/plugin.d.ts.map +1 -0
- package/claude-plugin/dist/plugin.js +72295 -0
- package/claude-plugin/dist/post-compaction-tracker.d.ts +133 -0
- package/claude-plugin/dist/post-compaction-tracker.d.ts.map +1 -0
- package/claude-plugin/dist/query-tools.d.ts +90 -0
- package/claude-plugin/dist/query-tools.d.ts.map +1 -0
- package/claude-plugin/dist/rate-limiter.d.ts +218 -0
- package/claude-plugin/dist/rate-limiter.d.ts.map +1 -0
- package/claude-plugin/dist/regression-detection.d.ts +58 -0
- package/claude-plugin/dist/regression-detection.d.ts.map +1 -0
- package/claude-plugin/dist/replay-tools.d.ts +28 -0
- package/claude-plugin/dist/replay-tools.d.ts.map +1 -0
- package/claude-plugin/dist/repo-crawl.d.ts +146 -0
- package/claude-plugin/dist/repo-crawl.d.ts.map +1 -0
- package/claude-plugin/dist/schemas/cell-events.d.ts +1352 -0
- package/claude-plugin/dist/schemas/cell-events.d.ts.map +1 -0
- package/claude-plugin/dist/schemas/cell.d.ts +413 -0
- package/claude-plugin/dist/schemas/cell.d.ts.map +1 -0
- package/claude-plugin/dist/schemas/evaluation.d.ts +161 -0
- package/claude-plugin/dist/schemas/evaluation.d.ts.map +1 -0
- package/claude-plugin/dist/schemas/index.d.ts +46 -0
- package/claude-plugin/dist/schemas/index.d.ts.map +1 -0
- package/claude-plugin/dist/schemas/mandate.d.ts +336 -0
- package/claude-plugin/dist/schemas/mandate.d.ts.map +1 -0
- package/claude-plugin/dist/schemas/swarm-context.d.ts +131 -0
- package/claude-plugin/dist/schemas/swarm-context.d.ts.map +1 -0
- package/claude-plugin/dist/schemas/task.d.ts +189 -0
- package/claude-plugin/dist/schemas/task.d.ts.map +1 -0
- package/claude-plugin/dist/schemas/worker-handoff.d.ts +78 -0
- package/claude-plugin/dist/schemas/worker-handoff.d.ts.map +1 -0
- package/claude-plugin/dist/sessions/agent-discovery.d.ts +59 -0
- package/claude-plugin/dist/sessions/agent-discovery.d.ts.map +1 -0
- package/claude-plugin/dist/sessions/index.d.ts +10 -0
- package/claude-plugin/dist/sessions/index.d.ts.map +1 -0
- package/claude-plugin/dist/skills.d.ts +490 -0
- package/claude-plugin/dist/skills.d.ts.map +1 -0
- package/claude-plugin/dist/storage.d.ts +260 -0
- package/claude-plugin/dist/storage.d.ts.map +1 -0
- package/claude-plugin/dist/structured.d.ts +206 -0
- package/claude-plugin/dist/structured.d.ts.map +1 -0
- package/claude-plugin/dist/swarm-adversarial-review.d.ts +104 -0
- package/claude-plugin/dist/swarm-adversarial-review.d.ts.map +1 -0
- package/claude-plugin/dist/swarm-decompose.d.ts +297 -0
- package/claude-plugin/dist/swarm-decompose.d.ts.map +1 -0
- package/claude-plugin/dist/swarm-insights.d.ts +390 -0
- package/claude-plugin/dist/swarm-insights.d.ts.map +1 -0
- package/claude-plugin/dist/swarm-mail.d.ts +274 -0
- package/claude-plugin/dist/swarm-mail.d.ts.map +1 -0
- package/claude-plugin/dist/swarm-orchestrate.d.ts +924 -0
- package/claude-plugin/dist/swarm-orchestrate.d.ts.map +1 -0
- package/claude-plugin/dist/swarm-prompts.d.ts +467 -0
- package/claude-plugin/dist/swarm-prompts.d.ts.map +1 -0
- package/claude-plugin/dist/swarm-prompts.js +45283 -0
- package/claude-plugin/dist/swarm-research.d.ts +125 -0
- package/claude-plugin/dist/swarm-research.d.ts.map +1 -0
- package/claude-plugin/dist/swarm-review.d.ts +214 -0
- package/claude-plugin/dist/swarm-review.d.ts.map +1 -0
- package/claude-plugin/dist/swarm-signature.d.ts +106 -0
- package/claude-plugin/dist/swarm-signature.d.ts.map +1 -0
- package/claude-plugin/dist/swarm-strategies.d.ts +113 -0
- package/claude-plugin/dist/swarm-strategies.d.ts.map +1 -0
- package/claude-plugin/dist/swarm-validation.d.ts +127 -0
- package/claude-plugin/dist/swarm-validation.d.ts.map +1 -0
- package/claude-plugin/dist/swarm-worktree.d.ts +185 -0
- package/claude-plugin/dist/swarm-worktree.d.ts.map +1 -0
- package/claude-plugin/dist/swarm.d.ts +590 -0
- package/claude-plugin/dist/swarm.d.ts.map +1 -0
- package/claude-plugin/dist/tool-availability.d.ts +91 -0
- package/claude-plugin/dist/tool-availability.d.ts.map +1 -0
- package/claude-plugin/dist/utils/tree-renderer.d.ts +61 -0
- package/claude-plugin/dist/utils/tree-renderer.d.ts.map +1 -0
- package/claude-plugin/dist/validators/index.d.ts +7 -0
- package/claude-plugin/dist/validators/index.d.ts.map +1 -0
- package/claude-plugin/dist/validators/schema-validator.d.ts +58 -0
- package/claude-plugin/dist/validators/schema-validator.d.ts.map +1 -0
- package/claude-plugin/skills/always-on-guidance/SKILL.md +44 -0
- package/dist/agent-mail.d.ts +4 -4
- package/dist/agent-mail.d.ts.map +1 -1
- package/dist/bin/swarm.js +477 -22
- package/dist/claude-plugin/claude-plugin-assets.d.ts +10 -0
- package/dist/claude-plugin/claude-plugin-assets.d.ts.map +1 -0
- package/dist/compaction-hook.d.ts +1 -1
- package/dist/compaction-hook.d.ts.map +1 -1
- package/dist/index.js +375 -265
- package/dist/plugin.js +374 -264
- package/dist/skills.d.ts +15 -0
- package/dist/skills.d.ts.map +1 -1
- package/dist/swarm-mail.d.ts.map +1 -1
- package/dist/swarm-prompts.d.ts +4 -2
- package/dist/swarm-prompts.d.ts.map +1 -1
- package/dist/swarm-prompts.js +84 -7
- package/global-skills/swarm-coordination/SKILL.md +21 -20
- package/package.json +2 -1
|
@@ -0,0 +1,479 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hivemind Tools - Unified Memory System
|
|
3
|
+
*
|
|
4
|
+
* Unifies semantic-memory and CASS tools under the hivemind namespace.
|
|
5
|
+
* Sessions and learnings are both memories with different sources.
|
|
6
|
+
*
|
|
7
|
+
* Key design decisions (ADR-011):
|
|
8
|
+
* - 8 tools instead of 15 (merged duplicates)
|
|
9
|
+
* - Collection filter: "default" for learnings, "claude" for Claude sessions, etc.
|
|
10
|
+
* - Unified search across learnings + sessions
|
|
11
|
+
* - No more naming collision with external semantic-memory MCP
|
|
12
|
+
*
|
|
13
|
+
* Tool mapping:
|
|
14
|
+
* - semantic-memory_store → hivemind_store
|
|
15
|
+
* - semantic-memory_find + cass_search → hivemind_find
|
|
16
|
+
* - semantic-memory_get + cass_view → hivemind_get
|
|
17
|
+
* - semantic-memory_remove → hivemind_remove
|
|
18
|
+
* - semantic-memory_validate → hivemind_validate
|
|
19
|
+
* - semantic-memory_stats + cass_stats + cass_health → hivemind_stats
|
|
20
|
+
* - cass_index → hivemind_index
|
|
21
|
+
* - NEW: hivemind_sync (sync to .hive/memories.jsonl)
|
|
22
|
+
*/
|
|
23
|
+
import { type MemoryAdapter, type StoreArgs, type FindArgs, type IdArgs, type StoreResult, type FindResult, type StatsResult, type OperationResult } from "./memory";
|
|
24
|
+
export type { MemoryAdapter, StoreArgs, FindArgs, IdArgs, StoreResult, FindResult, StatsResult, OperationResult, };
|
|
25
|
+
/**
|
|
26
|
+
* Get or create memory adapter for the current project
|
|
27
|
+
*/
|
|
28
|
+
declare function getMemoryAdapter(projectPath?: string): Promise<MemoryAdapter>;
|
|
29
|
+
/**
|
|
30
|
+
* Get or create hivemind adapter (alias for getMemoryAdapter)
|
|
31
|
+
*/
|
|
32
|
+
export declare const getHivemindAdapter: typeof getMemoryAdapter;
|
|
33
|
+
/**
|
|
34
|
+
* Reset adapter cache (for testing)
|
|
35
|
+
*/
|
|
36
|
+
export declare function resetHivemindCache(): void;
|
|
37
|
+
/**
|
|
38
|
+
* hivemind_store - Store a memory with semantic embedding
|
|
39
|
+
*/
|
|
40
|
+
export declare const hivemind_store: {
|
|
41
|
+
description: string;
|
|
42
|
+
args: {
|
|
43
|
+
information: import("zod").ZodString;
|
|
44
|
+
collection: import("zod").ZodOptional<import("zod").ZodString>;
|
|
45
|
+
tags: import("zod").ZodOptional<import("zod").ZodString>;
|
|
46
|
+
metadata: import("zod").ZodOptional<import("zod").ZodString>;
|
|
47
|
+
confidence: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
48
|
+
autoTag: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
49
|
+
autoLink: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
50
|
+
extractEntities: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
51
|
+
};
|
|
52
|
+
execute(args: {
|
|
53
|
+
information: string;
|
|
54
|
+
collection?: string | undefined;
|
|
55
|
+
tags?: string | undefined;
|
|
56
|
+
metadata?: string | undefined;
|
|
57
|
+
confidence?: number | undefined;
|
|
58
|
+
autoTag?: boolean | undefined;
|
|
59
|
+
autoLink?: boolean | undefined;
|
|
60
|
+
extractEntities?: boolean | undefined;
|
|
61
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* hivemind_find - Search all memories (learnings + sessions)
|
|
65
|
+
*/
|
|
66
|
+
export declare const hivemind_find: {
|
|
67
|
+
description: string;
|
|
68
|
+
args: {
|
|
69
|
+
query: import("zod").ZodString;
|
|
70
|
+
limit: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
71
|
+
collection: import("zod").ZodOptional<import("zod").ZodString>;
|
|
72
|
+
expand: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
73
|
+
fts: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
74
|
+
};
|
|
75
|
+
execute(args: {
|
|
76
|
+
query: string;
|
|
77
|
+
limit?: number | undefined;
|
|
78
|
+
collection?: string | undefined;
|
|
79
|
+
expand?: boolean | undefined;
|
|
80
|
+
fts?: boolean | undefined;
|
|
81
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* hivemind_get - Get a specific memory by ID
|
|
85
|
+
*/
|
|
86
|
+
export declare const hivemind_get: {
|
|
87
|
+
description: string;
|
|
88
|
+
args: {
|
|
89
|
+
id: import("zod").ZodString;
|
|
90
|
+
};
|
|
91
|
+
execute(args: {
|
|
92
|
+
id: string;
|
|
93
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* hivemind_remove - Delete a memory
|
|
97
|
+
*/
|
|
98
|
+
export declare const hivemind_remove: {
|
|
99
|
+
description: string;
|
|
100
|
+
args: {
|
|
101
|
+
id: import("zod").ZodString;
|
|
102
|
+
};
|
|
103
|
+
execute(args: {
|
|
104
|
+
id: string;
|
|
105
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* hivemind_validate - Validate a memory (reset decay timer)
|
|
109
|
+
*/
|
|
110
|
+
export declare const hivemind_validate: {
|
|
111
|
+
description: string;
|
|
112
|
+
args: {
|
|
113
|
+
id: import("zod").ZodString;
|
|
114
|
+
};
|
|
115
|
+
execute(args: {
|
|
116
|
+
id: string;
|
|
117
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* hivemind_stats - Combined statistics and health check
|
|
121
|
+
*/
|
|
122
|
+
export declare const hivemind_stats: {
|
|
123
|
+
description: string;
|
|
124
|
+
args: {};
|
|
125
|
+
execute(args: Record<string, never>, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* hivemind_index - Index AI session directories
|
|
129
|
+
*/
|
|
130
|
+
export declare const hivemind_index: {
|
|
131
|
+
description: string;
|
|
132
|
+
args: {
|
|
133
|
+
full: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
134
|
+
};
|
|
135
|
+
execute(args: {
|
|
136
|
+
full?: boolean | undefined;
|
|
137
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* hivemind_sync - Sync memories to .hive/memories.jsonl
|
|
141
|
+
*/
|
|
142
|
+
export declare const hivemind_sync: {
|
|
143
|
+
description: string;
|
|
144
|
+
args: {};
|
|
145
|
+
execute(args: Record<string, never>, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
146
|
+
};
|
|
147
|
+
declare const semantic_memory_store: any;
|
|
148
|
+
declare const semantic_memory_find: any;
|
|
149
|
+
declare const semantic_memory_get: any;
|
|
150
|
+
declare const semantic_memory_remove: any;
|
|
151
|
+
declare const semantic_memory_validate: any;
|
|
152
|
+
declare const semantic_memory_list: any;
|
|
153
|
+
declare const semantic_memory_stats: any;
|
|
154
|
+
declare const semantic_memory_check: any;
|
|
155
|
+
declare const semantic_memory_upsert: any;
|
|
156
|
+
declare const cass_search: any;
|
|
157
|
+
declare const cass_view: any;
|
|
158
|
+
declare const cass_expand: any;
|
|
159
|
+
declare const cass_health: any;
|
|
160
|
+
declare const cass_index: any;
|
|
161
|
+
declare const cass_stats: any;
|
|
162
|
+
/**
|
|
163
|
+
* All hivemind tools + deprecation aliases
|
|
164
|
+
*
|
|
165
|
+
* Register these in the plugin with spread operator: { ...hivemindTools }
|
|
166
|
+
*/
|
|
167
|
+
export declare const hivemindTools: {
|
|
168
|
+
readonly hivemind_store: {
|
|
169
|
+
description: string;
|
|
170
|
+
args: {
|
|
171
|
+
information: import("zod").ZodString;
|
|
172
|
+
collection: import("zod").ZodOptional<import("zod").ZodString>;
|
|
173
|
+
tags: import("zod").ZodOptional<import("zod").ZodString>;
|
|
174
|
+
metadata: import("zod").ZodOptional<import("zod").ZodString>;
|
|
175
|
+
confidence: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
176
|
+
autoTag: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
177
|
+
autoLink: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
178
|
+
extractEntities: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
179
|
+
};
|
|
180
|
+
execute(args: {
|
|
181
|
+
information: string;
|
|
182
|
+
collection?: string | undefined;
|
|
183
|
+
tags?: string | undefined;
|
|
184
|
+
metadata?: string | undefined;
|
|
185
|
+
confidence?: number | undefined;
|
|
186
|
+
autoTag?: boolean | undefined;
|
|
187
|
+
autoLink?: boolean | undefined;
|
|
188
|
+
extractEntities?: boolean | undefined;
|
|
189
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
190
|
+
};
|
|
191
|
+
readonly hivemind_find: {
|
|
192
|
+
description: string;
|
|
193
|
+
args: {
|
|
194
|
+
query: import("zod").ZodString;
|
|
195
|
+
limit: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
196
|
+
collection: import("zod").ZodOptional<import("zod").ZodString>;
|
|
197
|
+
expand: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
198
|
+
fts: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
199
|
+
};
|
|
200
|
+
execute(args: {
|
|
201
|
+
query: string;
|
|
202
|
+
limit?: number | undefined;
|
|
203
|
+
collection?: string | undefined;
|
|
204
|
+
expand?: boolean | undefined;
|
|
205
|
+
fts?: boolean | undefined;
|
|
206
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
207
|
+
};
|
|
208
|
+
readonly hivemind_get: {
|
|
209
|
+
description: string;
|
|
210
|
+
args: {
|
|
211
|
+
id: import("zod").ZodString;
|
|
212
|
+
};
|
|
213
|
+
execute(args: {
|
|
214
|
+
id: string;
|
|
215
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
216
|
+
};
|
|
217
|
+
readonly hivemind_remove: {
|
|
218
|
+
description: string;
|
|
219
|
+
args: {
|
|
220
|
+
id: import("zod").ZodString;
|
|
221
|
+
};
|
|
222
|
+
execute(args: {
|
|
223
|
+
id: string;
|
|
224
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
225
|
+
};
|
|
226
|
+
readonly hivemind_validate: {
|
|
227
|
+
description: string;
|
|
228
|
+
args: {
|
|
229
|
+
id: import("zod").ZodString;
|
|
230
|
+
};
|
|
231
|
+
execute(args: {
|
|
232
|
+
id: string;
|
|
233
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
234
|
+
};
|
|
235
|
+
readonly hivemind_stats: {
|
|
236
|
+
description: string;
|
|
237
|
+
args: {};
|
|
238
|
+
execute(args: Record<string, never>, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
239
|
+
};
|
|
240
|
+
readonly hivemind_index: {
|
|
241
|
+
description: string;
|
|
242
|
+
args: {
|
|
243
|
+
full: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
244
|
+
};
|
|
245
|
+
execute(args: {
|
|
246
|
+
full?: boolean | undefined;
|
|
247
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
248
|
+
};
|
|
249
|
+
readonly hivemind_sync: {
|
|
250
|
+
description: string;
|
|
251
|
+
args: {};
|
|
252
|
+
execute(args: Record<string, never>, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
253
|
+
};
|
|
254
|
+
readonly "semantic-memory_store": any;
|
|
255
|
+
readonly "semantic-memory_find": any;
|
|
256
|
+
readonly "semantic-memory_get": any;
|
|
257
|
+
readonly "semantic-memory_remove": any;
|
|
258
|
+
readonly "semantic-memory_validate": any;
|
|
259
|
+
readonly "semantic-memory_list": any;
|
|
260
|
+
readonly "semantic-memory_stats": any;
|
|
261
|
+
readonly "semantic-memory_check": any;
|
|
262
|
+
readonly "semantic-memory_upsert": any;
|
|
263
|
+
readonly cass_search: any;
|
|
264
|
+
readonly cass_view: any;
|
|
265
|
+
readonly cass_expand: any;
|
|
266
|
+
readonly cass_health: any;
|
|
267
|
+
readonly cass_index: any;
|
|
268
|
+
readonly cass_stats: any;
|
|
269
|
+
};
|
|
270
|
+
export { semantic_memory_store, semantic_memory_find, semantic_memory_get, semantic_memory_remove, semantic_memory_validate, semantic_memory_list, semantic_memory_stats, semantic_memory_check, semantic_memory_upsert, cass_search, cass_view, cass_expand, cass_health, cass_index, cass_stats, };
|
|
271
|
+
export { createMemoryAdapter } from "./memory";
|
|
272
|
+
export declare const memoryTools: {
|
|
273
|
+
readonly hivemind_store: {
|
|
274
|
+
description: string;
|
|
275
|
+
args: {
|
|
276
|
+
information: import("zod").ZodString;
|
|
277
|
+
collection: import("zod").ZodOptional<import("zod").ZodString>;
|
|
278
|
+
tags: import("zod").ZodOptional<import("zod").ZodString>;
|
|
279
|
+
metadata: import("zod").ZodOptional<import("zod").ZodString>;
|
|
280
|
+
confidence: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
281
|
+
autoTag: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
282
|
+
autoLink: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
283
|
+
extractEntities: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
284
|
+
};
|
|
285
|
+
execute(args: {
|
|
286
|
+
information: string;
|
|
287
|
+
collection?: string | undefined;
|
|
288
|
+
tags?: string | undefined;
|
|
289
|
+
metadata?: string | undefined;
|
|
290
|
+
confidence?: number | undefined;
|
|
291
|
+
autoTag?: boolean | undefined;
|
|
292
|
+
autoLink?: boolean | undefined;
|
|
293
|
+
extractEntities?: boolean | undefined;
|
|
294
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
295
|
+
};
|
|
296
|
+
readonly hivemind_find: {
|
|
297
|
+
description: string;
|
|
298
|
+
args: {
|
|
299
|
+
query: import("zod").ZodString;
|
|
300
|
+
limit: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
301
|
+
collection: import("zod").ZodOptional<import("zod").ZodString>;
|
|
302
|
+
expand: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
303
|
+
fts: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
304
|
+
};
|
|
305
|
+
execute(args: {
|
|
306
|
+
query: string;
|
|
307
|
+
limit?: number | undefined;
|
|
308
|
+
collection?: string | undefined;
|
|
309
|
+
expand?: boolean | undefined;
|
|
310
|
+
fts?: boolean | undefined;
|
|
311
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
312
|
+
};
|
|
313
|
+
readonly hivemind_get: {
|
|
314
|
+
description: string;
|
|
315
|
+
args: {
|
|
316
|
+
id: import("zod").ZodString;
|
|
317
|
+
};
|
|
318
|
+
execute(args: {
|
|
319
|
+
id: string;
|
|
320
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
321
|
+
};
|
|
322
|
+
readonly hivemind_remove: {
|
|
323
|
+
description: string;
|
|
324
|
+
args: {
|
|
325
|
+
id: import("zod").ZodString;
|
|
326
|
+
};
|
|
327
|
+
execute(args: {
|
|
328
|
+
id: string;
|
|
329
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
330
|
+
};
|
|
331
|
+
readonly hivemind_validate: {
|
|
332
|
+
description: string;
|
|
333
|
+
args: {
|
|
334
|
+
id: import("zod").ZodString;
|
|
335
|
+
};
|
|
336
|
+
execute(args: {
|
|
337
|
+
id: string;
|
|
338
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
339
|
+
};
|
|
340
|
+
readonly hivemind_stats: {
|
|
341
|
+
description: string;
|
|
342
|
+
args: {};
|
|
343
|
+
execute(args: Record<string, never>, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
344
|
+
};
|
|
345
|
+
readonly hivemind_index: {
|
|
346
|
+
description: string;
|
|
347
|
+
args: {
|
|
348
|
+
full: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
349
|
+
};
|
|
350
|
+
execute(args: {
|
|
351
|
+
full?: boolean | undefined;
|
|
352
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
353
|
+
};
|
|
354
|
+
readonly hivemind_sync: {
|
|
355
|
+
description: string;
|
|
356
|
+
args: {};
|
|
357
|
+
execute(args: Record<string, never>, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
358
|
+
};
|
|
359
|
+
readonly "semantic-memory_store": any;
|
|
360
|
+
readonly "semantic-memory_find": any;
|
|
361
|
+
readonly "semantic-memory_get": any;
|
|
362
|
+
readonly "semantic-memory_remove": any;
|
|
363
|
+
readonly "semantic-memory_validate": any;
|
|
364
|
+
readonly "semantic-memory_list": any;
|
|
365
|
+
readonly "semantic-memory_stats": any;
|
|
366
|
+
readonly "semantic-memory_check": any;
|
|
367
|
+
readonly "semantic-memory_upsert": any;
|
|
368
|
+
readonly cass_search: any;
|
|
369
|
+
readonly cass_view: any;
|
|
370
|
+
readonly cass_expand: any;
|
|
371
|
+
readonly cass_health: any;
|
|
372
|
+
readonly cass_index: any;
|
|
373
|
+
readonly cass_stats: any;
|
|
374
|
+
};
|
|
375
|
+
export declare const cassTools: {
|
|
376
|
+
readonly hivemind_store: {
|
|
377
|
+
description: string;
|
|
378
|
+
args: {
|
|
379
|
+
information: import("zod").ZodString;
|
|
380
|
+
collection: import("zod").ZodOptional<import("zod").ZodString>;
|
|
381
|
+
tags: import("zod").ZodOptional<import("zod").ZodString>;
|
|
382
|
+
metadata: import("zod").ZodOptional<import("zod").ZodString>;
|
|
383
|
+
confidence: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
384
|
+
autoTag: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
385
|
+
autoLink: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
386
|
+
extractEntities: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
387
|
+
};
|
|
388
|
+
execute(args: {
|
|
389
|
+
information: string;
|
|
390
|
+
collection?: string | undefined;
|
|
391
|
+
tags?: string | undefined;
|
|
392
|
+
metadata?: string | undefined;
|
|
393
|
+
confidence?: number | undefined;
|
|
394
|
+
autoTag?: boolean | undefined;
|
|
395
|
+
autoLink?: boolean | undefined;
|
|
396
|
+
extractEntities?: boolean | undefined;
|
|
397
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
398
|
+
};
|
|
399
|
+
readonly hivemind_find: {
|
|
400
|
+
description: string;
|
|
401
|
+
args: {
|
|
402
|
+
query: import("zod").ZodString;
|
|
403
|
+
limit: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
404
|
+
collection: import("zod").ZodOptional<import("zod").ZodString>;
|
|
405
|
+
expand: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
406
|
+
fts: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
407
|
+
};
|
|
408
|
+
execute(args: {
|
|
409
|
+
query: string;
|
|
410
|
+
limit?: number | undefined;
|
|
411
|
+
collection?: string | undefined;
|
|
412
|
+
expand?: boolean | undefined;
|
|
413
|
+
fts?: boolean | undefined;
|
|
414
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
415
|
+
};
|
|
416
|
+
readonly hivemind_get: {
|
|
417
|
+
description: string;
|
|
418
|
+
args: {
|
|
419
|
+
id: import("zod").ZodString;
|
|
420
|
+
};
|
|
421
|
+
execute(args: {
|
|
422
|
+
id: string;
|
|
423
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
424
|
+
};
|
|
425
|
+
readonly hivemind_remove: {
|
|
426
|
+
description: string;
|
|
427
|
+
args: {
|
|
428
|
+
id: import("zod").ZodString;
|
|
429
|
+
};
|
|
430
|
+
execute(args: {
|
|
431
|
+
id: string;
|
|
432
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
433
|
+
};
|
|
434
|
+
readonly hivemind_validate: {
|
|
435
|
+
description: string;
|
|
436
|
+
args: {
|
|
437
|
+
id: import("zod").ZodString;
|
|
438
|
+
};
|
|
439
|
+
execute(args: {
|
|
440
|
+
id: string;
|
|
441
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
442
|
+
};
|
|
443
|
+
readonly hivemind_stats: {
|
|
444
|
+
description: string;
|
|
445
|
+
args: {};
|
|
446
|
+
execute(args: Record<string, never>, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
447
|
+
};
|
|
448
|
+
readonly hivemind_index: {
|
|
449
|
+
description: string;
|
|
450
|
+
args: {
|
|
451
|
+
full: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
452
|
+
};
|
|
453
|
+
execute(args: {
|
|
454
|
+
full?: boolean | undefined;
|
|
455
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
456
|
+
};
|
|
457
|
+
readonly hivemind_sync: {
|
|
458
|
+
description: string;
|
|
459
|
+
args: {};
|
|
460
|
+
execute(args: Record<string, never>, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
461
|
+
};
|
|
462
|
+
readonly "semantic-memory_store": any;
|
|
463
|
+
readonly "semantic-memory_find": any;
|
|
464
|
+
readonly "semantic-memory_get": any;
|
|
465
|
+
readonly "semantic-memory_remove": any;
|
|
466
|
+
readonly "semantic-memory_validate": any;
|
|
467
|
+
readonly "semantic-memory_list": any;
|
|
468
|
+
readonly "semantic-memory_stats": any;
|
|
469
|
+
readonly "semantic-memory_check": any;
|
|
470
|
+
readonly "semantic-memory_upsert": any;
|
|
471
|
+
readonly cass_search: any;
|
|
472
|
+
readonly cass_view: any;
|
|
473
|
+
readonly cass_expand: any;
|
|
474
|
+
readonly cass_health: any;
|
|
475
|
+
readonly cass_index: any;
|
|
476
|
+
readonly cass_stats: any;
|
|
477
|
+
};
|
|
478
|
+
export declare const resetMemoryCache: typeof resetHivemindCache;
|
|
479
|
+
//# sourceMappingURL=hivemind-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hivemind-tools.d.ts","sourceRoot":"","sources":["../src/hivemind-tools.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface AtomicWriteOptions {
|
|
2
|
+
append?: boolean;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Writes content to a file atomically using a temp file + rename pattern.
|
|
6
|
+
*
|
|
7
|
+
* @param path - Target file path
|
|
8
|
+
* @param content - Content to write
|
|
9
|
+
* @param options - Write options (append mode)
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* // Basic write
|
|
14
|
+
* await writeFileAtomic("output.txt", "Hello, World!");
|
|
15
|
+
*
|
|
16
|
+
* // Append mode
|
|
17
|
+
* await writeFileAtomic("log.txt", "New entry\n", { append: true });
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare function writeFileAtomic(path: string, content: string, options?: AtomicWriteOptions): Promise<void>;
|
|
21
|
+
//# sourceMappingURL=atomic-write.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atomic-write.d.ts","sourceRoot":"","sources":["../../src/hooks/atomic-write.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,IAAI,CAAC,CAqBf"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook Constants
|
|
3
|
+
*
|
|
4
|
+
* Defines which OpenCode tools are hooked for observability.
|
|
5
|
+
* Used by the plugin to identify tool calls that should trigger
|
|
6
|
+
* tool.execute.after hooks for logging, learning, and analytics.
|
|
7
|
+
*/
|
|
8
|
+
export declare const HIVE_TOOLS: readonly ["hive_create", "hive_update", "hive_close", "hive_start", "hive_ready", "hive_query", "hive_sync", "hive_cells", "hive_create_epic"];
|
|
9
|
+
export declare const SWARM_TOOLS: readonly ["swarm_spawn_subtask", "swarm_complete", "swarm_progress", "swarm_status", "swarm_record_outcome"];
|
|
10
|
+
export declare const SWARMMAIL_TOOLS: readonly ["swarmmail_init", "swarmmail_send", "swarmmail_reserve", "swarmmail_release", "swarmmail_release_all", "swarmmail_release_agent", "swarmmail_inbox"];
|
|
11
|
+
export declare const ALL_HOOKED_TOOLS: readonly ["hive_create", "hive_update", "hive_close", "hive_start", "hive_ready", "hive_query", "hive_sync", "hive_cells", "hive_create_epic", "swarm_spawn_subtask", "swarm_complete", "swarm_progress", "swarm_status", "swarm_record_outcome", "swarmmail_init", "swarmmail_send", "swarmmail_reserve", "swarmmail_release", "swarmmail_release_all", "swarmmail_release_agent", "swarmmail_inbox"];
|
|
12
|
+
export type HookedTool = (typeof ALL_HOOKED_TOOLS)[number];
|
|
13
|
+
/**
|
|
14
|
+
* Type guard to check if a tool name is a hooked tool.
|
|
15
|
+
*
|
|
16
|
+
* @param name - The tool name to check
|
|
17
|
+
* @returns true if the tool is hooked, false otherwise
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* if (isHookedTool(toolName)) {
|
|
22
|
+
* // toolName is narrowed to HookedTool
|
|
23
|
+
* recordToolExecution(toolName);
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare function isHookedTool(name: string): name is HookedTool;
|
|
28
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/hooks/constants.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,UAAU,gJAUb,CAAC;AAEX,eAAO,MAAM,WAAW,8GAMd,CAAC;AAEX,eAAO,MAAM,eAAe,gKAQlB,CAAC;AAEX,eAAO,MAAM,gBAAgB,wYAInB,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,UAAU,CAE7D"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hooks Index
|
|
3
|
+
*
|
|
4
|
+
* Re-exports all hook functionality for integration into the main plugin.
|
|
5
|
+
*
|
|
6
|
+
* @module hooks
|
|
7
|
+
*/
|
|
8
|
+
export { HIVE_TOOLS, SWARM_TOOLS, SWARMMAIL_TOOLS, ALL_HOOKED_TOOLS, isHookedTool } from "./constants";
|
|
9
|
+
export type { HookedTool } from "./constants";
|
|
10
|
+
export { handleToolComplete } from "./tool-complete";
|
|
11
|
+
export type { ToolHookInput, ToolHookOutput } from "./tool-complete";
|
|
12
|
+
export { injectSessionContext } from "./session-start";
|
|
13
|
+
export type { SessionContext } from "./session-start";
|
|
14
|
+
export { writeFileAtomic } from "./atomic-write";
|
|
15
|
+
export type { AtomicWriteOptions } from "./atomic-write";
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACvG,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAErE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,YAAY,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface SessionContext {
|
|
2
|
+
inProgressCells: Array<{
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
}>;
|
|
6
|
+
activeSwarms: Array<{
|
|
7
|
+
epicId: string;
|
|
8
|
+
title: string;
|
|
9
|
+
}>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Injects session context by querying hive for in-progress work.
|
|
13
|
+
* Called on session.created event.
|
|
14
|
+
*
|
|
15
|
+
* Note: Can't inject into OpenCode context yet (limitation), just logs for now.
|
|
16
|
+
*
|
|
17
|
+
* @param sessionID - The OpenCode session ID
|
|
18
|
+
* @param projectKey - The project key (directory path)
|
|
19
|
+
* @returns Session context with in-progress cells and active swarms, or null on error
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* const context = await injectSessionContext("session-123", "/path/to/project");
|
|
24
|
+
* if (context) {
|
|
25
|
+
* console.log(`Found ${context.inProgressCells.length} in-progress cells`);
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare function injectSessionContext(sessionID: string, projectKey: string): Promise<SessionContext | null>;
|
|
30
|
+
//# sourceMappingURL=session-start.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-start.d.ts","sourceRoot":"","sources":["../../src/hooks/session-start.ts"],"names":[],"mappings":"AAmBA,MAAM,WAAW,cAAc;IAC7B,eAAe,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACtD,YAAY,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACxD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,oBAAoB,CACxC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAkChC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool Complete Hook Handler
|
|
3
|
+
*
|
|
4
|
+
* Dispatches PostToolUse hooks for hooked tools.
|
|
5
|
+
* Provides observability into tool execution without blocking the main flow.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Input data for tool hook handlers.
|
|
9
|
+
*/
|
|
10
|
+
export interface ToolHookInput {
|
|
11
|
+
/** Name of the tool that was executed */
|
|
12
|
+
tool: string;
|
|
13
|
+
/** OpenCode session ID */
|
|
14
|
+
sessionID: string;
|
|
15
|
+
/** Unique identifier for this tool call */
|
|
16
|
+
callID: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Output data from tool execution.
|
|
20
|
+
*/
|
|
21
|
+
export interface ToolHookOutput {
|
|
22
|
+
/** Human-readable title for the result */
|
|
23
|
+
title?: string;
|
|
24
|
+
/** Raw output from the tool (often JSON) */
|
|
25
|
+
output?: string;
|
|
26
|
+
/** Additional metadata about the execution */
|
|
27
|
+
metadata?: Record<string, unknown>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Main handler for tool completion hooks.
|
|
31
|
+
* Dispatches to specific handlers based on tool name.
|
|
32
|
+
*
|
|
33
|
+
* @param toolName - Name of the tool that was executed
|
|
34
|
+
* @param input - Input data for the hook
|
|
35
|
+
* @param output - Output data from the tool
|
|
36
|
+
*
|
|
37
|
+
* @remarks
|
|
38
|
+
* - Non-hooked tools are ignored (returns immediately)
|
|
39
|
+
* - Hooked tools without specific handlers get default logging
|
|
40
|
+
* - Errors are caught and logged but never thrown (hooks shouldn't break tool execution)
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```typescript
|
|
44
|
+
* await handleToolComplete("hive_create", {
|
|
45
|
+
* tool: "hive_create",
|
|
46
|
+
* sessionID: "abc123",
|
|
47
|
+
* callID: "call-456"
|
|
48
|
+
* }, {
|
|
49
|
+
* output: JSON.stringify({ id: "cell-789", title: "New Task" })
|
|
50
|
+
* });
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
export declare function handleToolComplete(toolName: string, input: ToolHookInput, output: ToolHookOutput): Promise<void>;
|
|
54
|
+
//# sourceMappingURL=tool-complete.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-complete.d.ts","sourceRoot":"","sources":["../../src/hooks/tool-complete.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAyBH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,0BAA0B;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,2CAA2C;IAC3C,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAoFD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,aAAa,EACpB,MAAM,EAAE,cAAc,GACrB,OAAO,CAAC,IAAI,CAAC,CAqBf"}
|