monomind 1.18.15 → 1.19.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/.claude/agents/core/researcher.md +29 -24
- package/.claude/agents/github/code-review-swarm.md +1 -1
- package/.claude/agents/github/github-modes.md +1 -1
- package/.claude/agents/github/issue-tracker.md +1 -1
- package/.claude/agents/github/multi-repo-swarm.md +1 -1
- package/.claude/agents/github/pr-manager.md +1 -1
- package/.claude/agents/github/project-board-sync.md +1 -1
- package/.claude/agents/github/release-manager.md +1 -1
- package/.claude/agents/github/repo-architect.md +1 -1
- package/.claude/agents/github/swarm-issue.md +1 -1
- package/.claude/agents/github/swarm-pr.md +1 -1
- package/.claude/agents/github/sync-coordinator.md +1 -1
- package/.claude/agents/github/workflow-automation.md +1 -1
- package/.claude/agents/goal/goal-planner.md +1 -1
- package/.claude/agents/specialized/specialized-workflow-architect.md +11 -14
- package/.claude/agents/testing/production-validator.md +8 -7
- package/.claude/agents/testing/testing-evidence-collector.md +3 -1
- package/.claude/commands/mastermind/code-review.md +4 -4
- package/.claude/commands/mastermind/help.md +2 -2
- package/.claude/commands/mastermind/okf-export.md +14 -0
- package/.claude/commands/mastermind/okf-import.md +15 -0
- package/.claude/helpers/handlers/agent-start-handler.cjs +11 -36
- package/.claude/helpers/handlers/capture-handler.cjs +110 -0
- package/.claude/helpers/handlers/route-handler.cjs +174 -247
- package/.claude/helpers/handlers/session-handler.cjs +139 -142
- package/.claude/helpers/handlers/session-restore-handler.cjs +15 -10
- package/.claude/helpers/handlers/task-handler.cjs +8 -155
- package/.claude/helpers/hook-handler.cjs +89 -5
- package/.claude/helpers/intelligence.cjs +164 -15
- package/.claude/helpers/learning-service.mjs +1 -0
- package/.claude/helpers/mastermind-activate.cjs +33 -51
- package/.claude/helpers/monolean-activate.cjs +13 -3
- package/.claude/helpers/monolean-propagate.cjs +7 -3
- package/.claude/helpers/router.cjs +47 -9
- package/.claude/settings.json +0 -20
- package/.claude/skills/mastermind-skills/architect.md +5 -6
- package/.claude/skills/mastermind-skills/autodev.md +8 -5
- package/.claude/skills/mastermind-skills/review.md +8 -5
- package/.claude/skills/mastermind-skills/techport.md +37 -3
- package/.claude/skills/monodesign/document.md +9 -6
- package/.claude/skills/monodesign/extract.md +1 -1
- package/.claude/skills/monodesign/reference/document.md +1 -1
- package/.claude/skills/monodesign/reference/live.md +1 -1
- package/.claude/skills/monolean/SKILL.md +1 -1
- package/package.json +1 -1
- package/packages/@monomind/cli/.claude/agents/core/researcher.md +29 -24
- package/packages/@monomind/cli/.claude/agents/github/code-review-swarm.md +1 -1
- package/packages/@monomind/cli/.claude/agents/github/github-modes.md +1 -1
- package/packages/@monomind/cli/.claude/agents/github/issue-tracker.md +1 -1
- package/packages/@monomind/cli/.claude/agents/github/multi-repo-swarm.md +1 -1
- package/packages/@monomind/cli/.claude/agents/github/pr-manager.md +1 -1
- package/packages/@monomind/cli/.claude/agents/github/project-board-sync.md +1 -1
- package/packages/@monomind/cli/.claude/agents/github/release-manager.md +1 -1
- package/packages/@monomind/cli/.claude/agents/github/repo-architect.md +1 -1
- package/packages/@monomind/cli/.claude/agents/github/swarm-issue.md +1 -1
- package/packages/@monomind/cli/.claude/agents/github/swarm-pr.md +1 -1
- package/packages/@monomind/cli/.claude/agents/github/sync-coordinator.md +1 -1
- package/packages/@monomind/cli/.claude/agents/github/workflow-automation.md +1 -1
- package/packages/@monomind/cli/.claude/agents/goal/goal-planner.md +1 -1
- package/packages/@monomind/cli/.claude/agents/specialized/specialized-workflow-architect.md +11 -14
- package/packages/@monomind/cli/.claude/agents/testing/production-validator.md +8 -7
- package/packages/@monomind/cli/.claude/agents/testing/testing-evidence-collector.md +3 -1
- package/packages/@monomind/cli/.claude/commands/mastermind/code-review.md +4 -4
- package/packages/@monomind/cli/.claude/commands/mastermind/help.md +2 -2
- package/packages/@monomind/cli/.claude/commands/mastermind/okf-export.md +14 -0
- package/packages/@monomind/cli/.claude/commands/mastermind/okf-import.md +15 -0
- package/packages/@monomind/cli/.claude/helpers/handlers/agent-start-handler.cjs +11 -36
- package/packages/@monomind/cli/.claude/helpers/handlers/capture-handler.cjs +110 -0
- package/packages/@monomind/cli/.claude/helpers/handlers/route-handler.cjs +174 -247
- package/packages/@monomind/cli/.claude/helpers/handlers/session-handler.cjs +139 -142
- package/packages/@monomind/cli/.claude/helpers/handlers/session-restore-handler.cjs +15 -10
- package/packages/@monomind/cli/.claude/helpers/handlers/task-handler.cjs +8 -155
- package/packages/@monomind/cli/.claude/helpers/hook-handler.cjs +89 -5
- package/packages/@monomind/cli/.claude/helpers/intelligence.cjs +164 -15
- package/packages/@monomind/cli/.claude/helpers/learning-service.mjs +1 -0
- package/packages/@monomind/cli/.claude/helpers/mastermind-activate.cjs +33 -51
- package/packages/@monomind/cli/.claude/helpers/monolean-activate.cjs +13 -3
- package/packages/@monomind/cli/.claude/helpers/monolean-propagate.cjs +7 -3
- package/packages/@monomind/cli/.claude/helpers/router.cjs +47 -9
- package/packages/@monomind/cli/.claude/skills/mastermind-skills/architect.md +5 -6
- package/packages/@monomind/cli/.claude/skills/mastermind-skills/autodev.md +8 -5
- package/packages/@monomind/cli/.claude/skills/mastermind-skills/review.md +8 -5
- package/packages/@monomind/cli/.claude/skills/mastermind-skills/techport.md +37 -3
- package/packages/@monomind/cli/.claude/skills/monodesign/document.md +9 -6
- package/packages/@monomind/cli/.claude/skills/monodesign/extract.md +1 -1
- package/packages/@monomind/cli/.claude/skills/monodesign/reference/document.md +1 -1
- package/packages/@monomind/cli/.claude/skills/monodesign/reference/live.md +1 -1
- package/packages/@monomind/cli/.claude/skills/monolean/SKILL.md +1 -1
- package/packages/@monomind/cli/bin/mcp-server.js +11 -1
- package/packages/@monomind/cli/dist/src/commands/agent-ops.d.ts +1 -2
- package/packages/@monomind/cli/dist/src/commands/agent-ops.js +1 -59
- package/packages/@monomind/cli/dist/src/commands/agent.js +2 -3
- package/packages/@monomind/cli/dist/src/commands/analyze-diff.js +1 -1
- package/packages/@monomind/cli/dist/src/commands/browse-action.js +94 -2
- package/packages/@monomind/cli/dist/src/commands/completions.js +11 -56
- package/packages/@monomind/cli/dist/src/commands/doctor-project-checks.d.ts +1 -1
- package/packages/@monomind/cli/dist/src/commands/doctor-project-checks.js +1 -1
- package/packages/@monomind/cli/dist/src/commands/hive-mind-helpers.js +2 -2
- package/packages/@monomind/cli/dist/src/commands/hive-mind-ops.d.ts +1 -3
- package/packages/@monomind/cli/dist/src/commands/hive-mind-ops.js +2 -116
- package/packages/@monomind/cli/dist/src/commands/hive-mind.js +2 -5
- package/packages/@monomind/cli/dist/src/commands/hooks-coverage-commands.js +8 -7
- package/packages/@monomind/cli/dist/src/commands/hooks-coverage-gaps.js +1 -1
- package/packages/@monomind/cli/dist/src/commands/hooks-coverage-routing.js +2 -2
- package/packages/@monomind/cli/dist/src/commands/hooks-extended-commands.d.ts +0 -3
- package/packages/@monomind/cli/dist/src/commands/hooks-extended-commands.js +0 -307
- package/packages/@monomind/cli/dist/src/commands/hooks.js +1 -12
- package/packages/@monomind/cli/dist/src/commands/index.d.ts +3 -51
- package/packages/@monomind/cli/dist/src/commands/index.js +36 -184
- package/packages/@monomind/cli/dist/src/commands/init-wizard.js +2 -4
- package/packages/@monomind/cli/dist/src/commands/mcp.js +32 -4
- package/packages/@monomind/cli/dist/src/commands/memory-admin.d.ts +1 -2
- package/packages/@monomind/cli/dist/src/commands/memory-admin.js +1 -118
- package/packages/@monomind/cli/dist/src/commands/memory-transfer.d.ts +1 -2
- package/packages/@monomind/cli/dist/src/commands/memory-transfer.js +5 -171
- package/packages/@monomind/cli/dist/src/commands/memory.js +3 -6
- package/packages/@monomind/cli/dist/src/commands/neural-core.d.ts +3 -1
- package/packages/@monomind/cli/dist/src/commands/neural-core.js +145 -6
- package/packages/@monomind/cli/dist/src/commands/neural-optimize.js +4 -4
- package/packages/@monomind/cli/dist/src/commands/neural-registry.d.ts +1 -1
- package/packages/@monomind/cli/dist/src/commands/neural-registry.js +4 -4
- package/packages/@monomind/cli/dist/src/commands/neural.d.ts +1 -1
- package/packages/@monomind/cli/dist/src/commands/neural.js +6 -6
- package/packages/@monomind/cli/dist/src/commands/performance.js +68 -58
- package/packages/@monomind/cli/dist/src/commands/providers.js +2 -131
- package/packages/@monomind/cli/dist/src/commands/security-misc.d.ts +0 -1
- package/packages/@monomind/cli/dist/src/commands/security-misc.js +69 -45
- package/packages/@monomind/cli/dist/src/commands/security.js +2 -4
- package/packages/@monomind/cli/dist/src/commands/session.js +1 -285
- package/packages/@monomind/cli/dist/src/commands/start.js +2 -41
- package/packages/@monomind/cli/dist/src/commands/status.js +18 -29
- package/packages/@monomind/cli/dist/src/commands/swarm.js +1 -1
- package/packages/@monomind/cli/dist/src/commands/task.js +2 -49
- package/packages/@monomind/cli/dist/src/commands/workflow.js +2 -104
- package/packages/@monomind/cli/dist/src/index.js +7 -0
- package/packages/@monomind/cli/dist/src/init/executor.js +3 -14
- package/packages/@monomind/cli/dist/src/init/helpers-generator.js +2 -22
- package/packages/@monomind/cli/dist/src/init/settings-generator.js +0 -1
- package/packages/@monomind/cli/dist/src/init/types.d.ts +1 -3
- package/packages/@monomind/cli/dist/src/init/types.js +0 -2
- package/packages/@monomind/cli/dist/src/mcp-client.js +0 -6
- package/packages/@monomind/cli/dist/src/mcp-server.js +16 -0
- package/packages/@monomind/cli/dist/src/mcp-tools/agent-tools.js +0 -17
- package/packages/@monomind/cli/dist/src/mcp-tools/coherence/causal-infer.d.ts +5 -5
- package/packages/@monomind/cli/dist/src/mcp-tools/coherence/causal-infer.js +32 -46
- package/packages/@monomind/cli/dist/src/mcp-tools/coherence/consensus-verify.d.ts +2 -3
- package/packages/@monomind/cli/dist/src/mcp-tools/coherence/consensus-verify.js +22 -20
- package/packages/@monomind/cli/dist/src/mcp-tools/coherence/memory-gate.d.ts +3 -2
- package/packages/@monomind/cli/dist/src/mcp-tools/coherence/memory-gate.js +32 -19
- package/packages/@monomind/cli/dist/src/mcp-tools/coherence/quantum-topology.d.ts +4 -4
- package/packages/@monomind/cli/dist/src/mcp-tools/coherence/quantum-topology.js +11 -17
- package/packages/@monomind/cli/dist/src/mcp-tools/coherence/spectral-analyze.d.ts +2 -3
- package/packages/@monomind/cli/dist/src/mcp-tools/coherence/spectral-analyze.js +51 -32
- package/packages/@monomind/cli/dist/src/mcp-tools/coherence/types.d.ts +5 -9
- package/packages/@monomind/cli/dist/src/mcp-tools/guidance-tools.js +2 -2
- package/packages/@monomind/cli/dist/src/mcp-tools/hive-mind-tools.js +25 -3
- package/packages/@monomind/cli/dist/src/mcp-tools/hooks-routing.d.ts +0 -3
- package/packages/@monomind/cli/dist/src/mcp-tools/hooks-routing.js +45 -159
- package/packages/@monomind/cli/dist/src/mcp-tools/hooks-tools.js +1 -4
- package/packages/@monomind/cli/dist/src/mcp-tools/index.d.ts +0 -2
- package/packages/@monomind/cli/dist/src/mcp-tools/index.js +0 -3
- package/packages/@monomind/cli/dist/src/mcp-tools/memory-tools.js +24 -0
- package/packages/@monomind/cli/dist/src/mcp-tools/monograph-tools.js +428 -11
- package/packages/@monomind/cli/dist/src/mcp-tools/neural-tools.d.ts +4 -10
- package/packages/@monomind/cli/dist/src/mcp-tools/neural-tools.js +28 -54
- package/packages/@monomind/cli/dist/src/mcp-tools/performance-tools.js +5 -17
- package/packages/@monomind/cli/dist/src/mcp-tools/quality/coverage-analysis/prioritize-gaps.js +2 -2
- package/packages/@monomind/cli/dist/src/mcp-tools/quality/security-compliance/detect-secrets.d.ts +4 -4
- package/packages/@monomind/cli/dist/src/mcp-tools/quality-tools.d.ts +7 -2
- package/packages/@monomind/cli/dist/src/mcp-tools/quality-tools.js +7 -257
- package/packages/@monomind/cli/dist/src/memory/intelligence.d.ts +7 -8
- package/packages/@monomind/cli/dist/src/memory/intelligence.js +15 -16
- package/packages/@monomind/cli/dist/src/memory/memory-bridge.d.ts +1 -0
- package/packages/@monomind/cli/dist/src/memory/memory-bridge.js +37 -0
- package/packages/@monomind/cli/dist/src/services/worker-daemon.d.ts +3 -21
- package/packages/@monomind/cli/dist/src/services/worker-daemon.js +13 -80
- package/packages/@monomind/cli/dist/src/suggest.js +0 -5
- package/packages/@monomind/cli/package.json +1 -1
- package/packages/@monomind/guidance/package.json +1 -74
- package/.claude/helpers/auto-memory-hook.mjs +0 -503
- package/packages/@monomind/cli/.claude/helpers/auto-memory-hook.mjs +0 -503
- package/packages/@monomind/cli/dist/src/commands/deployment.d.ts +0 -10
- package/packages/@monomind/cli/dist/src/commands/deployment.js +0 -706
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Hive Mind operational subcommands — status
|
|
2
|
+
* Hive Mind operational subcommands — status
|
|
3
3
|
*/
|
|
4
4
|
import { output } from '../output.js';
|
|
5
|
-
import { input } from '../prompt.js';
|
|
6
5
|
import { callMCPTool, MCPClientError } from '../mcp-client.js';
|
|
7
|
-
import {
|
|
6
|
+
import { formatAgentStatus, formatHiveStatus, formatHealth, } from './hive-mind-helpers.js';
|
|
8
7
|
export const statusCommand = {
|
|
9
8
|
name: 'status',
|
|
10
9
|
description: 'Show hive mind status',
|
|
@@ -117,117 +116,4 @@ export const statusCommand = {
|
|
|
117
116
|
}
|
|
118
117
|
}
|
|
119
118
|
};
|
|
120
|
-
export const taskCommand = {
|
|
121
|
-
name: 'task',
|
|
122
|
-
description: 'Submit tasks to the hive',
|
|
123
|
-
options: [
|
|
124
|
-
{ name: 'description', short: 'd', description: 'Task description', type: 'string' },
|
|
125
|
-
{ name: 'priority', short: 'p', description: 'Task priority', type: 'string', choices: ['low', 'normal', 'high', 'critical'], default: 'normal' },
|
|
126
|
-
{ name: 'require-consensus', short: 'c', description: 'Require consensus for completion', type: 'boolean', default: false },
|
|
127
|
-
{ name: 'timeout', description: 'Task timeout in seconds', type: 'number', default: 300 }
|
|
128
|
-
],
|
|
129
|
-
examples: [
|
|
130
|
-
{ command: 'monomind hive-mind task -d "Implement auth module"', description: 'Submit task' },
|
|
131
|
-
{ command: 'monomind hive-mind task -d "Security review" -p critical -c', description: 'Critical task with consensus' }
|
|
132
|
-
],
|
|
133
|
-
action: async (ctx) => {
|
|
134
|
-
let description = (ctx.flags.description || ctx.args.join(' ')).slice(0, MAX_TASK_DESC_LEN);
|
|
135
|
-
if (!description && ctx.interactive) {
|
|
136
|
-
description = await input({
|
|
137
|
-
message: 'Task description:',
|
|
138
|
-
validate: (v) => v.length > 0 || 'Description is required'
|
|
139
|
-
});
|
|
140
|
-
description = description.slice(0, MAX_TASK_DESC_LEN);
|
|
141
|
-
}
|
|
142
|
-
if (!description) {
|
|
143
|
-
output.printError('Task description is required');
|
|
144
|
-
return { success: false, exitCode: 1 };
|
|
145
|
-
}
|
|
146
|
-
const priority = ctx.flags.priority;
|
|
147
|
-
const requireConsensus = ctx.flags['require-consensus'];
|
|
148
|
-
const timeout = ctx.flags.timeout;
|
|
149
|
-
output.printInfo('Submitting task to hive...');
|
|
150
|
-
try {
|
|
151
|
-
const result = await callMCPTool('hive-mind_task', { description, priority, requireConsensus, timeout });
|
|
152
|
-
if (ctx.flags.format === 'json') {
|
|
153
|
-
output.printJson(result);
|
|
154
|
-
return { success: true, data: result };
|
|
155
|
-
}
|
|
156
|
-
output.writeln();
|
|
157
|
-
output.printBox([
|
|
158
|
-
`Task ID: ${result.taskId}`,
|
|
159
|
-
`Status: ${formatAgentStatus(result.status)}`,
|
|
160
|
-
`Priority: ${formatPriority(priority)}`,
|
|
161
|
-
`Assigned: ${result.assignedTo.join(', ')}`,
|
|
162
|
-
`Consensus: ${result.requiresConsensus ? 'Yes' : 'No'}`,
|
|
163
|
-
`Est. Time: ${result.estimatedTime}`
|
|
164
|
-
].join('\n'), 'Task Submitted');
|
|
165
|
-
output.writeln();
|
|
166
|
-
output.printSuccess('Task submitted to hive');
|
|
167
|
-
output.writeln(output.dim(` Track with: monomind hive-mind task-status ${result.taskId}`));
|
|
168
|
-
return { success: true, data: result };
|
|
169
|
-
}
|
|
170
|
-
catch (error) {
|
|
171
|
-
if (error instanceof MCPClientError) {
|
|
172
|
-
output.printError(`Task submission error: ${error.message}`);
|
|
173
|
-
}
|
|
174
|
-
else {
|
|
175
|
-
output.printError(`Unexpected error: ${String(error)}`);
|
|
176
|
-
}
|
|
177
|
-
return { success: false, exitCode: 1 };
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
};
|
|
181
|
-
export const optimizeMemoryCommand = {
|
|
182
|
-
name: 'optimize-memory',
|
|
183
|
-
description: 'Optimize hive memory and patterns',
|
|
184
|
-
options: [
|
|
185
|
-
{ name: 'aggressive', short: 'a', description: 'Aggressive optimization', type: 'boolean', default: false },
|
|
186
|
-
{ name: 'threshold', description: 'Quality threshold for pattern retention', type: 'number', default: 0.7 }
|
|
187
|
-
],
|
|
188
|
-
action: async (ctx) => {
|
|
189
|
-
const aggressive = ctx.flags.aggressive;
|
|
190
|
-
const threshold = ctx.flags.threshold;
|
|
191
|
-
output.printInfo('Optimizing hive memory...');
|
|
192
|
-
const spinner = output.createSpinner({ text: 'Analyzing patterns...', spinner: 'dots' });
|
|
193
|
-
spinner.start();
|
|
194
|
-
try {
|
|
195
|
-
const result = await callMCPTool('hive-mind_optimize-memory', { aggressive, qualityThreshold: threshold });
|
|
196
|
-
spinner.succeed('Memory optimized');
|
|
197
|
-
if (ctx.flags.format === 'json') {
|
|
198
|
-
output.printJson(result);
|
|
199
|
-
return { success: true, data: result };
|
|
200
|
-
}
|
|
201
|
-
output.writeln();
|
|
202
|
-
output.printTable({
|
|
203
|
-
columns: [
|
|
204
|
-
{ key: 'metric', header: 'Metric', width: 20 },
|
|
205
|
-
{ key: 'before', header: 'Before', width: 15, align: 'right' },
|
|
206
|
-
{ key: 'after', header: 'After', width: 15, align: 'right' }
|
|
207
|
-
],
|
|
208
|
-
data: [
|
|
209
|
-
{ metric: 'Patterns', before: result.before.patterns, after: result.after.patterns },
|
|
210
|
-
{ metric: 'Memory', before: result.before.memory, after: result.after.memory }
|
|
211
|
-
]
|
|
212
|
-
});
|
|
213
|
-
output.writeln();
|
|
214
|
-
output.printList([
|
|
215
|
-
`Patterns removed: ${result.removed}`,
|
|
216
|
-
`Patterns consolidated: ${result.consolidated}`,
|
|
217
|
-
`Optimization time: ${result.timeMs}ms`
|
|
218
|
-
]);
|
|
219
|
-
return { success: true, data: result };
|
|
220
|
-
}
|
|
221
|
-
catch (error) {
|
|
222
|
-
spinner.fail('Optimization failed');
|
|
223
|
-
if (error instanceof MCPClientError) {
|
|
224
|
-
output.printError(`Optimization error: ${error.message}`);
|
|
225
|
-
}
|
|
226
|
-
else {
|
|
227
|
-
output.printError(`Unexpected error: ${String(error)}`);
|
|
228
|
-
}
|
|
229
|
-
return { success: false, exitCode: 1 };
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
};
|
|
233
119
|
//# sourceMappingURL=hive-mind-ops.js.map
|
|
@@ -10,7 +10,7 @@ import { select } from '../prompt.js';
|
|
|
10
10
|
import { callMCPTool, MCPClientError } from '../mcp-client.js';
|
|
11
11
|
import { TOPOLOGIES, CONSENSUS_STRATEGIES } from './hive-mind-helpers.js';
|
|
12
12
|
import { spawnCommand } from './hive-mind-spawn.js';
|
|
13
|
-
import { statusCommand
|
|
13
|
+
import { statusCommand } from './hive-mind-ops.js';
|
|
14
14
|
import { joinCommand, leaveCommand, consensusCommand, broadcastCommand, memorySubCommand, shutdownCommand } from './hive-mind-comms.js';
|
|
15
15
|
const initCommand = {
|
|
16
16
|
name: 'init',
|
|
@@ -93,13 +93,12 @@ export const hiveMindCommand = {
|
|
|
93
93
|
name: 'hive-mind',
|
|
94
94
|
aliases: ['hive'],
|
|
95
95
|
description: 'Queen-led consensus-based multi-agent coordination',
|
|
96
|
-
subcommands: [initCommand, spawnCommand, statusCommand,
|
|
96
|
+
subcommands: [initCommand, spawnCommand, statusCommand, joinCommand, leaveCommand, consensusCommand, broadcastCommand, memorySubCommand, shutdownCommand],
|
|
97
97
|
options: [],
|
|
98
98
|
examples: [
|
|
99
99
|
{ command: 'monomind hive-mind init -t hierarchical-mesh', description: 'Initialize hive' },
|
|
100
100
|
{ command: 'monomind hive-mind spawn -n 5', description: 'Spawn workers' },
|
|
101
101
|
{ command: 'monomind hive-mind spawn --claude -o "Build a feature"', description: 'Launch Claude Code with hive mind' },
|
|
102
|
-
{ command: 'monomind hive-mind task -d "Build feature"', description: 'Submit task' }
|
|
103
102
|
],
|
|
104
103
|
action: async () => {
|
|
105
104
|
output.writeln();
|
|
@@ -112,13 +111,11 @@ export const hiveMindCommand = {
|
|
|
112
111
|
`${output.highlight('init')} - Initialize hive mind`,
|
|
113
112
|
`${output.highlight('spawn')} - Spawn worker agents (use --claude to launch Claude Code)`,
|
|
114
113
|
`${output.highlight('status')} - Show hive status`,
|
|
115
|
-
`${output.highlight('task')} - Submit task to hive`,
|
|
116
114
|
`${output.highlight('join')} - Join an agent to the hive`,
|
|
117
115
|
`${output.highlight('leave')} - Remove an agent from the hive`,
|
|
118
116
|
`${output.highlight('consensus')} - Manage consensus proposals`,
|
|
119
117
|
`${output.highlight('broadcast')} - Broadcast message to workers`,
|
|
120
118
|
`${output.highlight('memory')} - Access shared memory`,
|
|
121
|
-
`${output.highlight('optimize-memory')} - Optimize patterns and memory`,
|
|
122
119
|
`${output.highlight('shutdown')} - Shutdown the hive`
|
|
123
120
|
]);
|
|
124
121
|
output.writeln();
|
|
@@ -54,7 +54,8 @@ export const statuslineCommand = {
|
|
|
54
54
|
try {
|
|
55
55
|
const stats = fs.statSync(dbPath);
|
|
56
56
|
const sizeKB = stats.size / 1024;
|
|
57
|
-
|
|
57
|
+
// Estimate: ~2KB per pattern entry on average
|
|
58
|
+
patterns = Math.floor(sizeKB / 2); // estimatedPatterns — derived from file size, not counted
|
|
58
59
|
sessions = Math.max(1, Math.floor(patterns / 10));
|
|
59
60
|
trajectories = Math.floor(patterns / 5);
|
|
60
61
|
break;
|
|
@@ -275,7 +276,7 @@ export const statuslineCommand = {
|
|
|
275
276
|
try {
|
|
276
277
|
const stats = fs.statSync(dbPath);
|
|
277
278
|
memoryStats.dbSizeKB = Math.round(stats.size / 1024);
|
|
278
|
-
memoryStats.vectorCount = Math.floor(memoryStats.dbSizeKB / 2);
|
|
279
|
+
memoryStats.vectorCount = Math.floor(memoryStats.dbSizeKB / 2); // estimated from file size
|
|
279
280
|
memoryStats.hasHnsw = memoryStats.vectorCount > 100;
|
|
280
281
|
break;
|
|
281
282
|
}
|
|
@@ -298,7 +299,7 @@ export const statuslineCommand = {
|
|
|
298
299
|
memoryStats.dbSizeKB += Math.round(fileStat.size / 1024);
|
|
299
300
|
}
|
|
300
301
|
}
|
|
301
|
-
memoryStats.vectorCount = Math.floor(memoryStats.dbSizeKB / 2);
|
|
302
|
+
memoryStats.vectorCount = Math.floor(memoryStats.dbSizeKB / 2); // estimated from file size
|
|
302
303
|
memoryStats.hasHnsw = memoryStats.vectorCount > 100;
|
|
303
304
|
if (memoryStats.vectorCount > 0)
|
|
304
305
|
break;
|
|
@@ -349,7 +350,7 @@ export const statuslineCommand = {
|
|
|
349
350
|
try {
|
|
350
351
|
const files = fs.readdirSync(fullPath, { recursive: true });
|
|
351
352
|
testStats.testFiles = files.filter((f) => /\.(test|spec)\.(ts|js|tsx|jsx)$/.test(f)).length;
|
|
352
|
-
testStats.testCases = testStats.testFiles * 28;
|
|
353
|
+
testStats.testCases = testStats.testFiles * 28; // rough estimate (~28 cases/file avg), not counted
|
|
353
354
|
}
|
|
354
355
|
catch { /* ignore */ }
|
|
355
356
|
}
|
|
@@ -373,7 +374,7 @@ export const statuslineCommand = {
|
|
|
373
374
|
}
|
|
374
375
|
else if (progress.patternsLearned > 0) {
|
|
375
376
|
const patternsK = progress.patternsLearned >= 1000 ? `${(progress.patternsLearned / 1000).toFixed(1)}k` : String(progress.patternsLearned);
|
|
376
|
-
perfIndicator = `${c.brightYellow}📚
|
|
377
|
+
perfIndicator = `${c.brightYellow}📚 ~${patternsK} patterns (est.)${c.reset}`;
|
|
377
378
|
}
|
|
378
379
|
const line1 = `${c.brightCyan}🏗️ DDD Domains${c.reset} ${progressBar(progress.domainsCompleted, progress.totalDomains)} ` +
|
|
379
380
|
`${domainsColor}${progress.domainsCompleted}${c.reset}/${c.brightWhite}${progress.totalDomains}${c.reset} ` +
|
|
@@ -400,9 +401,9 @@ export const statuslineCommand = {
|
|
|
400
401
|
const sizeDisplay = memoryStats.dbSizeKB >= 1024 ? `${(memoryStats.dbSizeKB / 1024).toFixed(1)}MB` : `${memoryStats.dbSizeKB}KB`;
|
|
401
402
|
const hnswIndicator = memoryStats.hasHnsw ? `${c.brightGreen}⚡${c.reset}` : '';
|
|
402
403
|
const line4 = `${c.brightCyan}📊 LanceDB${c.reset} ` +
|
|
403
|
-
`${c.cyan}Vectors${c.reset} ${vectorColor}
|
|
404
|
+
`${c.cyan}Vectors${c.reset} ${vectorColor}●~${memoryStats.vectorCount}${hnswIndicator}${c.reset} ${c.dim}│${c.reset} ` +
|
|
404
405
|
`${c.cyan}Size${c.reset} ${c.brightWhite}${sizeDisplay}${c.reset} ${c.dim}│${c.reset} ` +
|
|
405
|
-
`${c.cyan}Tests${c.reset} ${testColor}●${testStats.testFiles}${c.reset} ${c.dim}(
|
|
406
|
+
`${c.cyan}Tests${c.reset} ${testColor}●${testStats.testFiles}${c.reset} ${c.dim}(~${testStats.testCases} est.)${c.reset} ${c.dim}│${c.reset} ` +
|
|
406
407
|
`${c.cyan}MCP${c.reset} ${mcpColor}●${mcpStats.enabled}/${mcpStats.total}${c.reset}`;
|
|
407
408
|
output.writeln(header);
|
|
408
409
|
output.writeln(separator);
|
|
@@ -138,7 +138,7 @@ export const coverageGapsCommand = {
|
|
|
138
138
|
return { success: true, data: result };
|
|
139
139
|
}
|
|
140
140
|
try {
|
|
141
|
-
const result = await callMCPTool('
|
|
141
|
+
const result = await callMCPTool('coverage_gaps', { threshold, groupByAgent });
|
|
142
142
|
spinner.stop();
|
|
143
143
|
const gaps = criticalOnly
|
|
144
144
|
? result.gaps.filter(g => g.gapType === 'critical')
|
|
@@ -150,7 +150,7 @@ export const coverageRouteCommand = {
|
|
|
150
150
|
return { success: true, data: result };
|
|
151
151
|
}
|
|
152
152
|
try {
|
|
153
|
-
const result = await callMCPTool('
|
|
153
|
+
const result = await callMCPTool('coverage_route', { task, threshold, useMonovector });
|
|
154
154
|
spinner.stop();
|
|
155
155
|
if (ctx.flags.format === 'json') {
|
|
156
156
|
output.printJson(result);
|
|
@@ -337,7 +337,7 @@ export const coverageSuggestCommand = {
|
|
|
337
337
|
return { success: true, data: result };
|
|
338
338
|
}
|
|
339
339
|
try {
|
|
340
|
-
const result = await callMCPTool('
|
|
340
|
+
const result = await callMCPTool('coverage_suggest', { path: targetPath, threshold, limit });
|
|
341
341
|
spinner.stop();
|
|
342
342
|
if (ctx.flags.format === 'json') {
|
|
343
343
|
output.printJson(result);
|
|
@@ -4,11 +4,8 @@
|
|
|
4
4
|
* Extracted from hooks.ts to reduce file size.
|
|
5
5
|
*/
|
|
6
6
|
import type { Command } from '../types.js';
|
|
7
|
-
export declare const tokenOptimizeCommand: Command;
|
|
8
7
|
export declare const modelRouteCommand: Command;
|
|
9
8
|
export declare const modelOutcomeCommand: Command;
|
|
10
9
|
export declare const modelStatsCommand: Command;
|
|
11
|
-
export declare const teammateIdleCommand: Command;
|
|
12
|
-
export declare const taskCompletedCommand: Command;
|
|
13
10
|
export declare const notifyCommand: Command;
|
|
14
11
|
//# sourceMappingURL=hooks-extended-commands.d.ts.map
|
|
@@ -5,114 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { output } from '../output.js';
|
|
7
7
|
import { callMCPTool, MCPClientError } from '../mcp-client.js';
|
|
8
|
-
// Token Optimizer command
|
|
9
|
-
export const tokenOptimizeCommand = {
|
|
10
|
-
name: 'token-optimize',
|
|
11
|
-
description: 'Token optimization via memory-based context retrieval (30-50% savings)',
|
|
12
|
-
options: [
|
|
13
|
-
{ name: 'query', short: 'q', type: 'string', description: 'Query for compact context retrieval' },
|
|
14
|
-
{ name: 'agents', short: 'A', type: 'number', description: 'Agent count for optimal config', default: '6' },
|
|
15
|
-
{ name: 'report', short: 'r', type: 'boolean', description: 'Generate optimization report' },
|
|
16
|
-
{ name: 'stats', short: 's', type: 'boolean', description: 'Show token savings statistics' },
|
|
17
|
-
],
|
|
18
|
-
examples: [
|
|
19
|
-
{ command: 'monomind hooks token-optimize --stats', description: 'Show token savings stats' },
|
|
20
|
-
{ command: 'monomind hooks token-optimize -q "auth patterns"', description: 'Get compact context' },
|
|
21
|
-
{ command: 'monomind hooks token-optimize -A 8 --report', description: 'Config for 8 agents + report' },
|
|
22
|
-
],
|
|
23
|
-
action: async (ctx) => {
|
|
24
|
-
const query = ctx.flags['query'];
|
|
25
|
-
const agentCount = parseInt(ctx.flags['agents'] || '6', 10);
|
|
26
|
-
const showReport = ctx.flags['report'];
|
|
27
|
-
const showStats = ctx.flags['stats'];
|
|
28
|
-
const spinner = output.createSpinner({ text: 'Checking memory integration...', spinner: 'dots' });
|
|
29
|
-
spinner.start();
|
|
30
|
-
// Inline TokenOptimizer (self-contained, no external imports)
|
|
31
|
-
const stats = {
|
|
32
|
-
totalTokensSaved: 0,
|
|
33
|
-
editsOptimized: 0,
|
|
34
|
-
cacheHits: 0,
|
|
35
|
-
cacheMisses: 0,
|
|
36
|
-
memoriesRetrieved: 0,
|
|
37
|
-
};
|
|
38
|
-
try {
|
|
39
|
-
spinner.succeed('Memory-based token optimization active');
|
|
40
|
-
output.writeln();
|
|
41
|
-
// Anti-drift config (hardcoded optimal values from research)
|
|
42
|
-
const config = {
|
|
43
|
-
batchSize: 4,
|
|
44
|
-
cacheSizeMB: 50,
|
|
45
|
-
topology: 'hierarchical',
|
|
46
|
-
expectedSuccessRate: 0.95,
|
|
47
|
-
};
|
|
48
|
-
output.printBox(`Anti-Drift Swarm Config\n\n` +
|
|
49
|
-
`Agents: ${agentCount}\n` +
|
|
50
|
-
`Topology: ${config.topology}\n` +
|
|
51
|
-
`Batch Size: ${config.batchSize}\n` +
|
|
52
|
-
`Cache: ${config.cacheSizeMB}MB\n` +
|
|
53
|
-
`Success Rate: ${(config.expectedSuccessRate * 100)}%`);
|
|
54
|
-
if (query) {
|
|
55
|
-
output.writeln();
|
|
56
|
-
output.printInfo(`Context retrieval for: "${query}" — use monomind memory search`);
|
|
57
|
-
}
|
|
58
|
-
// Simulate some token savings for demo
|
|
59
|
-
stats.totalTokensSaved += 200;
|
|
60
|
-
stats.cacheHits = 2;
|
|
61
|
-
stats.cacheMisses = 1;
|
|
62
|
-
// Show stats
|
|
63
|
-
if (showStats || showReport) {
|
|
64
|
-
output.writeln();
|
|
65
|
-
const total = stats.cacheHits + stats.cacheMisses;
|
|
66
|
-
const hitRate = total > 0 ? (stats.cacheHits / total * 100).toFixed(1) : '0';
|
|
67
|
-
const savings = (stats.totalTokensSaved / 1000 * 0.01).toFixed(2);
|
|
68
|
-
output.printTable({
|
|
69
|
-
columns: [
|
|
70
|
-
{ key: 'metric', header: 'Metric', width: 25 },
|
|
71
|
-
{ key: 'value', header: 'Value', width: 20 },
|
|
72
|
-
],
|
|
73
|
-
data: [
|
|
74
|
-
{ metric: 'Tokens Saved', value: stats.totalTokensSaved.toLocaleString() },
|
|
75
|
-
{ metric: 'Edits Optimized', value: String(stats.editsOptimized) },
|
|
76
|
-
{ metric: 'Cache Hit Rate', value: `${hitRate}%` },
|
|
77
|
-
{ metric: 'Memories Retrieved', value: String(stats.memoriesRetrieved) },
|
|
78
|
-
{ metric: 'Est. Monthly Savings', value: `$${savings}` },
|
|
79
|
-
],
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
// Full report
|
|
83
|
-
if (showReport) {
|
|
84
|
-
output.writeln();
|
|
85
|
-
const total = stats.cacheHits + stats.cacheMisses;
|
|
86
|
-
const hitRate = total > 0 ? (stats.cacheHits / total * 100).toFixed(1) : '0';
|
|
87
|
-
const savings = (stats.totalTokensSaved / 1000 * 0.01).toFixed(2);
|
|
88
|
-
output.writeln(`## Token Optimization Report
|
|
89
|
-
|
|
90
|
-
| Metric | Value |
|
|
91
|
-
|--------|-------|
|
|
92
|
-
| Tokens Saved | ${stats.totalTokensSaved.toLocaleString()} |
|
|
93
|
-
| Edits Optimized | ${stats.editsOptimized} |
|
|
94
|
-
| Cache Hit Rate | ${hitRate}% |
|
|
95
|
-
| Memories Retrieved | ${stats.memoriesRetrieved} |
|
|
96
|
-
| Est. Monthly Savings | $${savings} |
|
|
97
|
-
| Memories Retrieved | ${stats.memoriesRetrieved} |`);
|
|
98
|
-
}
|
|
99
|
-
return { success: true, data: { config, stats } };
|
|
100
|
-
}
|
|
101
|
-
catch (error) {
|
|
102
|
-
spinner.fail('TokenOptimizer failed');
|
|
103
|
-
const err = error;
|
|
104
|
-
output.printError(`Error: ${err.message}`);
|
|
105
|
-
// Fallback info
|
|
106
|
-
output.writeln();
|
|
107
|
-
output.printInfo('Fallback anti-drift config:');
|
|
108
|
-
output.writeln(' topology: hierarchical');
|
|
109
|
-
output.writeln(' maxAgents: 8');
|
|
110
|
-
output.writeln(' strategy: specialized');
|
|
111
|
-
output.writeln(' batchSize: 4');
|
|
112
|
-
return { success: false, exitCode: 1 };
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
8
|
// Model Router command - intelligent model selection (haiku/sonnet/opus)
|
|
117
9
|
export const modelRouteCommand = {
|
|
118
10
|
name: 'model-route',
|
|
@@ -301,205 +193,6 @@ export const modelStatsCommand = {
|
|
|
301
193
|
}
|
|
302
194
|
}
|
|
303
195
|
};
|
|
304
|
-
// Teammate Idle command - Agent Teams integration
|
|
305
|
-
export const teammateIdleCommand = {
|
|
306
|
-
name: 'teammate-idle',
|
|
307
|
-
description: 'Handle idle teammate in Agent Teams - auto-assign tasks or notify lead',
|
|
308
|
-
options: [
|
|
309
|
-
{
|
|
310
|
-
name: 'auto-assign',
|
|
311
|
-
short: 'a',
|
|
312
|
-
description: 'Automatically assign pending tasks to idle teammate',
|
|
313
|
-
type: 'boolean',
|
|
314
|
-
default: true
|
|
315
|
-
},
|
|
316
|
-
{
|
|
317
|
-
name: 'check-task-list',
|
|
318
|
-
short: 'c',
|
|
319
|
-
description: 'Check shared task list for available work',
|
|
320
|
-
type: 'boolean',
|
|
321
|
-
default: true
|
|
322
|
-
},
|
|
323
|
-
{
|
|
324
|
-
name: 'teammate-id',
|
|
325
|
-
short: 't',
|
|
326
|
-
description: 'ID of the idle teammate',
|
|
327
|
-
type: 'string'
|
|
328
|
-
},
|
|
329
|
-
{
|
|
330
|
-
name: 'team-name',
|
|
331
|
-
description: 'Team name for context',
|
|
332
|
-
type: 'string'
|
|
333
|
-
}
|
|
334
|
-
],
|
|
335
|
-
examples: [
|
|
336
|
-
{ command: 'monomind hooks teammate-idle --auto-assign true', description: 'Auto-assign tasks to idle teammate' },
|
|
337
|
-
{ command: 'monomind hooks teammate-idle -t worker-1 --check-task-list', description: 'Check tasks for specific teammate' }
|
|
338
|
-
],
|
|
339
|
-
action: async (ctx) => {
|
|
340
|
-
const autoAssign = ctx.flags['auto-assign'] !== false;
|
|
341
|
-
const checkTaskList = ctx.flags['check-task-list'] !== false;
|
|
342
|
-
const teammateId = ctx.flags['teammate-id'];
|
|
343
|
-
const teamName = ctx.flags['team-name'];
|
|
344
|
-
if (ctx.flags.format !== 'json') {
|
|
345
|
-
output.printInfo(`Teammate idle hook triggered${teammateId ? ` for: ${output.highlight(teammateId)}` : ''}`);
|
|
346
|
-
}
|
|
347
|
-
try {
|
|
348
|
-
const result = await callMCPTool('hooks_teammate-idle', {
|
|
349
|
-
autoAssign,
|
|
350
|
-
checkTaskList,
|
|
351
|
-
teammateId,
|
|
352
|
-
teamName,
|
|
353
|
-
timestamp: Date.now(),
|
|
354
|
-
});
|
|
355
|
-
if (ctx.flags.format === 'json') {
|
|
356
|
-
output.printJson(result);
|
|
357
|
-
return { success: true, data: result };
|
|
358
|
-
}
|
|
359
|
-
output.writeln();
|
|
360
|
-
if (result.action === 'assigned' && result.taskAssigned) {
|
|
361
|
-
output.printSuccess(`Task assigned: ${result.taskAssigned.subject}`);
|
|
362
|
-
output.printList([
|
|
363
|
-
`Task ID: ${result.taskAssigned.taskId}`,
|
|
364
|
-
`Priority: ${result.taskAssigned.priority}`,
|
|
365
|
-
`Pending tasks remaining: ${result.pendingTasks}`
|
|
366
|
-
]);
|
|
367
|
-
}
|
|
368
|
-
else if (result.action === 'waiting') {
|
|
369
|
-
output.printInfo('No pending tasks available - teammate waiting for work');
|
|
370
|
-
}
|
|
371
|
-
else {
|
|
372
|
-
output.printInfo(`Team lead notified: ${result.message}`);
|
|
373
|
-
}
|
|
374
|
-
return { success: true, data: result };
|
|
375
|
-
}
|
|
376
|
-
catch (error) {
|
|
377
|
-
// Graceful fallback - don't fail hard, just report
|
|
378
|
-
if (ctx.flags.format === 'json') {
|
|
379
|
-
output.printJson({ success: true, action: 'waiting', message: 'Teammate idle - no MCP server' });
|
|
380
|
-
}
|
|
381
|
-
else {
|
|
382
|
-
output.printInfo('Teammate idle - awaiting task assignment');
|
|
383
|
-
}
|
|
384
|
-
return { success: true };
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
};
|
|
388
|
-
// Task Completed command - Agent Teams integration
|
|
389
|
-
export const taskCompletedCommand = {
|
|
390
|
-
name: 'task-completed',
|
|
391
|
-
description: 'Handle task completion in Agent Teams - train patterns and notify lead',
|
|
392
|
-
options: [
|
|
393
|
-
{
|
|
394
|
-
name: 'task-id',
|
|
395
|
-
short: 'i',
|
|
396
|
-
description: 'ID of the completed task',
|
|
397
|
-
type: 'string',
|
|
398
|
-
required: true
|
|
399
|
-
},
|
|
400
|
-
{
|
|
401
|
-
name: 'train-patterns',
|
|
402
|
-
short: 'p',
|
|
403
|
-
description: 'Train neural patterns from successful task',
|
|
404
|
-
type: 'boolean',
|
|
405
|
-
default: true
|
|
406
|
-
},
|
|
407
|
-
{
|
|
408
|
-
name: 'notify-lead',
|
|
409
|
-
short: 'n',
|
|
410
|
-
description: 'Notify team lead of task completion',
|
|
411
|
-
type: 'boolean',
|
|
412
|
-
default: true
|
|
413
|
-
},
|
|
414
|
-
{
|
|
415
|
-
name: 'success',
|
|
416
|
-
short: 's',
|
|
417
|
-
description: 'Whether the task succeeded',
|
|
418
|
-
type: 'boolean',
|
|
419
|
-
default: true
|
|
420
|
-
},
|
|
421
|
-
{
|
|
422
|
-
name: 'quality',
|
|
423
|
-
short: 'q',
|
|
424
|
-
description: 'Quality score (0-1)',
|
|
425
|
-
type: 'number'
|
|
426
|
-
},
|
|
427
|
-
{
|
|
428
|
-
name: 'teammate-id',
|
|
429
|
-
short: 't',
|
|
430
|
-
description: 'ID of the teammate that completed the task',
|
|
431
|
-
type: 'string'
|
|
432
|
-
}
|
|
433
|
-
],
|
|
434
|
-
examples: [
|
|
435
|
-
{ command: 'monomind hooks task-completed -i task-123 --train-patterns', description: 'Complete task and train patterns' },
|
|
436
|
-
{ command: 'monomind hooks task-completed -i task-456 --notify-lead --quality 0.95', description: 'Complete with quality score' }
|
|
437
|
-
],
|
|
438
|
-
action: async (ctx) => {
|
|
439
|
-
const taskId = ctx.args[0] || ctx.flags['task-id'];
|
|
440
|
-
const trainPatterns = ctx.flags['train-patterns'] !== false;
|
|
441
|
-
const notifyLead = ctx.flags['notify-lead'] !== false;
|
|
442
|
-
const success = ctx.flags.success !== false;
|
|
443
|
-
const quality = ctx.flags.quality;
|
|
444
|
-
const teammateId = ctx.flags['teammate-id'];
|
|
445
|
-
if (!taskId) {
|
|
446
|
-
output.printError('Task ID is required. Use --task-id or -i flag.');
|
|
447
|
-
return { success: false, exitCode: 1 };
|
|
448
|
-
}
|
|
449
|
-
if (ctx.flags.format !== 'json') {
|
|
450
|
-
output.printInfo(`Task completed: ${output.highlight(taskId)}`);
|
|
451
|
-
}
|
|
452
|
-
try {
|
|
453
|
-
const result = await callMCPTool('hooks_task-completed', {
|
|
454
|
-
taskId,
|
|
455
|
-
trainPatterns,
|
|
456
|
-
notifyLead,
|
|
457
|
-
success,
|
|
458
|
-
quality,
|
|
459
|
-
teammateId,
|
|
460
|
-
timestamp: Date.now(),
|
|
461
|
-
});
|
|
462
|
-
if (ctx.flags.format === 'json') {
|
|
463
|
-
output.printJson(result);
|
|
464
|
-
return { success: true, data: result };
|
|
465
|
-
}
|
|
466
|
-
output.writeln();
|
|
467
|
-
output.printSuccess(`Task ${taskId} marked complete`);
|
|
468
|
-
output.writeln();
|
|
469
|
-
output.writeln(output.bold('Completion Metrics'));
|
|
470
|
-
output.printTable({
|
|
471
|
-
columns: [
|
|
472
|
-
{ key: 'metric', header: 'Metric', width: 25 },
|
|
473
|
-
{ key: 'value', header: 'Value', width: 20, align: 'right' }
|
|
474
|
-
],
|
|
475
|
-
data: [
|
|
476
|
-
{ metric: 'Patterns Learned', value: result.patternsLearned },
|
|
477
|
-
{ metric: 'Quality Score', value: quality ? `${(quality * 100).toFixed(0)}%` : 'N/A' },
|
|
478
|
-
{ metric: 'Lead Notified', value: result.leadNotified ? 'Yes' : 'No' },
|
|
479
|
-
{ metric: 'Learning Updates', value: result.metrics?.learningUpdates || 0 }
|
|
480
|
-
]
|
|
481
|
-
});
|
|
482
|
-
if (result.nextTask) {
|
|
483
|
-
output.writeln();
|
|
484
|
-
output.printInfo(`Next available task: ${result.nextTask.subject}`);
|
|
485
|
-
}
|
|
486
|
-
return { success: true, data: result };
|
|
487
|
-
}
|
|
488
|
-
catch (error) {
|
|
489
|
-
// Graceful fallback
|
|
490
|
-
if (ctx.flags.format === 'json') {
|
|
491
|
-
output.printJson({ success: true, taskId, message: 'Task completed - patterns pending' });
|
|
492
|
-
}
|
|
493
|
-
else {
|
|
494
|
-
output.printSuccess(`Task ${taskId} completed`);
|
|
495
|
-
if (trainPatterns) {
|
|
496
|
-
output.printInfo('Pattern training queued for next sync');
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
return { success: true };
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
};
|
|
503
196
|
// Notify subcommand
|
|
504
197
|
export const notifyCommand = {
|
|
505
198
|
name: 'notify',
|
|
@@ -14,7 +14,7 @@ import { output } from '../output.js';
|
|
|
14
14
|
import { callMCPTool, MCPClientError } from '../mcp-client.js';
|
|
15
15
|
import { intelligenceCommand, workerCommand } from './hooks-workers.js';
|
|
16
16
|
import { coverageRouteCommand, coverageSuggestCommand, coverageGapsCommand, statuslineCommand, } from './hooks-coverage-commands.js';
|
|
17
|
-
import {
|
|
17
|
+
import { modelRouteCommand, modelOutcomeCommand, modelStatsCommand, notifyCommand, } from './hooks-extended-commands.js';
|
|
18
18
|
import { preEditCommand, postEditCommand, preCommandCommand, postCommandCommand, } from './hooks-core-commands.js';
|
|
19
19
|
import { routeCommand, explainCommand, pretrainCommand, buildAgentsCommand, metricsCommand, transferCommand, listCommand, } from './hooks-routing-commands.js';
|
|
20
20
|
// Pre-task subcommand
|
|
@@ -428,8 +428,6 @@ export const hooksCommand = {
|
|
|
428
428
|
coverageRouteCommand,
|
|
429
429
|
coverageSuggestCommand,
|
|
430
430
|
coverageGapsCommand,
|
|
431
|
-
// Token optimization
|
|
432
|
-
tokenOptimizeCommand,
|
|
433
431
|
// Model routing (tiny-dancer integration)
|
|
434
432
|
modelRouteCommand,
|
|
435
433
|
modelOutcomeCommand,
|
|
@@ -439,9 +437,6 @@ export const hooksCommand = {
|
|
|
439
437
|
sessionStartCommand,
|
|
440
438
|
preBashCommand,
|
|
441
439
|
postBashCommand,
|
|
442
|
-
// Agent Teams integration
|
|
443
|
-
teammateIdleCommand,
|
|
444
|
-
taskCompletedCommand,
|
|
445
440
|
],
|
|
446
441
|
options: [],
|
|
447
442
|
examples: [
|
|
@@ -476,19 +471,13 @@ export const hooksCommand = {
|
|
|
476
471
|
`${output.highlight('transfer')} - Transfer patterns from another project`,
|
|
477
472
|
`${output.highlight('list')} - List all registered hooks`,
|
|
478
473
|
`${output.highlight('worker')} - Background worker management (12 workers)`,
|
|
479
|
-
`${output.highlight('progress')} - Check implementation progress`,
|
|
480
474
|
`${output.highlight('statusline')} - Generate dynamic statusline display`,
|
|
481
475
|
`${output.highlight('coverage-route')} - Route tasks based on coverage gaps (monovector)`,
|
|
482
476
|
`${output.highlight('coverage-suggest')}- Suggest coverage improvements`,
|
|
483
477
|
`${output.highlight('coverage-gaps')} - List all coverage gaps with agents`,
|
|
484
|
-
`${output.highlight('token-optimize')} - Token optimization (30-50% savings)`,
|
|
485
478
|
`${output.highlight('model-route')} - Route to optimal model (haiku/sonnet/opus)`,
|
|
486
479
|
`${output.highlight('model-outcome')} - Record model routing outcome`,
|
|
487
480
|
`${output.highlight('model-stats')} - View model routing statistics`,
|
|
488
|
-
'',
|
|
489
|
-
output.bold('Agent Teams:'),
|
|
490
|
-
`${output.highlight('teammate-idle')} - Handle idle teammate (auto-assign tasks)`,
|
|
491
|
-
`${output.highlight('task-completed')} - Handle task completion (train patterns)`
|
|
492
481
|
]);
|
|
493
482
|
output.writeln();
|
|
494
483
|
output.writeln('Run "monomind hooks <subcommand> --help" for subcommand help');
|