monomind 1.18.13 → 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.
Files changed (218) hide show
  1. package/.claude/agents/core/researcher.md +29 -24
  2. package/.claude/agents/github/code-review-swarm.md +1 -1
  3. package/.claude/agents/github/github-modes.md +1 -1
  4. package/.claude/agents/github/issue-tracker.md +1 -1
  5. package/.claude/agents/github/multi-repo-swarm.md +1 -1
  6. package/.claude/agents/github/pr-manager.md +1 -1
  7. package/.claude/agents/github/project-board-sync.md +1 -1
  8. package/.claude/agents/github/release-manager.md +1 -1
  9. package/.claude/agents/github/repo-architect.md +1 -1
  10. package/.claude/agents/github/swarm-issue.md +1 -1
  11. package/.claude/agents/github/swarm-pr.md +1 -1
  12. package/.claude/agents/github/sync-coordinator.md +1 -1
  13. package/.claude/agents/github/workflow-automation.md +1 -1
  14. package/.claude/agents/goal/goal-planner.md +1 -1
  15. package/.claude/agents/specialized/specialized-workflow-architect.md +11 -14
  16. package/.claude/agents/testing/production-validator.md +8 -7
  17. package/.claude/agents/testing/testing-evidence-collector.md +3 -1
  18. package/.claude/commands/mastermind/_repeat.md +22 -3
  19. package/.claude/commands/mastermind/architect.md +1 -1
  20. package/.claude/commands/mastermind/autodev.md +1 -1
  21. package/.claude/commands/mastermind/build.md +1 -1
  22. package/.claude/commands/mastermind/code-review.md +5 -5
  23. package/.claude/commands/mastermind/debug.md +1 -1
  24. package/.claude/commands/mastermind/help.md +2 -2
  25. package/.claude/commands/mastermind/idea.md +1 -1
  26. package/.claude/commands/mastermind/improve.md +1 -1
  27. package/.claude/commands/mastermind/okf-export.md +14 -0
  28. package/.claude/commands/mastermind/okf-import.md +15 -0
  29. package/.claude/commands/mastermind/plan.md +1 -1
  30. package/.claude/commands/mastermind/research.md +1 -1
  31. package/.claude/commands/mastermind/review.md +12 -1
  32. package/.claude/commands/mastermind/runorg.md +1 -1
  33. package/.claude/commands/mastermind/taskdev.md +1 -1
  34. package/.claude/commands/mastermind/tdd.md +1 -1
  35. package/.claude/commands/mastermind/verify.md +1 -1
  36. package/.claude/helpers/graphify-freshen.cjs +16 -20
  37. package/.claude/helpers/handlers/agent-start-handler.cjs +11 -36
  38. package/.claude/helpers/handlers/capture-handler.cjs +110 -0
  39. package/.claude/helpers/handlers/route-handler.cjs +180 -256
  40. package/.claude/helpers/handlers/session-handler.cjs +139 -142
  41. package/.claude/helpers/handlers/session-restore-handler.cjs +15 -10
  42. package/.claude/helpers/handlers/task-handler.cjs +8 -155
  43. package/.claude/helpers/hook-handler.cjs +89 -5
  44. package/.claude/helpers/intelligence.cjs +164 -15
  45. package/.claude/helpers/learning-service.mjs +1 -0
  46. package/.claude/helpers/mastermind-activate.cjs +33 -51
  47. package/.claude/helpers/monolean-activate.cjs +13 -3
  48. package/.claude/helpers/monolean-propagate.cjs +7 -3
  49. package/.claude/helpers/router.cjs +47 -9
  50. package/.claude/helpers/utils/monograph.cjs +37 -20
  51. package/.claude/settings.json +0 -20
  52. package/.claude/skills/mastermind-skills/_repeat.md +29 -4
  53. package/.claude/skills/mastermind-skills/architect.md +5 -6
  54. package/.claude/skills/mastermind-skills/autodev.md +8 -5
  55. package/.claude/skills/mastermind-skills/review.md +25 -11
  56. package/.claude/skills/mastermind-skills/techport.md +37 -3
  57. package/.claude/skills/monodesign/document.md +9 -6
  58. package/.claude/skills/monodesign/extract.md +1 -1
  59. package/.claude/skills/monodesign/reference/document.md +1 -1
  60. package/.claude/skills/monodesign/reference/live.md +1 -1
  61. package/.claude/skills/monolean/SKILL.md +1 -1
  62. package/package.json +1 -1
  63. package/packages/@monomind/cli/.claude/agents/core/researcher.md +29 -24
  64. package/packages/@monomind/cli/.claude/agents/github/code-review-swarm.md +1 -1
  65. package/packages/@monomind/cli/.claude/agents/github/github-modes.md +1 -1
  66. package/packages/@monomind/cli/.claude/agents/github/issue-tracker.md +1 -1
  67. package/packages/@monomind/cli/.claude/agents/github/multi-repo-swarm.md +1 -1
  68. package/packages/@monomind/cli/.claude/agents/github/pr-manager.md +1 -1
  69. package/packages/@monomind/cli/.claude/agents/github/project-board-sync.md +1 -1
  70. package/packages/@monomind/cli/.claude/agents/github/release-manager.md +1 -1
  71. package/packages/@monomind/cli/.claude/agents/github/repo-architect.md +1 -1
  72. package/packages/@monomind/cli/.claude/agents/github/swarm-issue.md +1 -1
  73. package/packages/@monomind/cli/.claude/agents/github/swarm-pr.md +1 -1
  74. package/packages/@monomind/cli/.claude/agents/github/sync-coordinator.md +1 -1
  75. package/packages/@monomind/cli/.claude/agents/github/workflow-automation.md +1 -1
  76. package/packages/@monomind/cli/.claude/agents/goal/goal-planner.md +1 -1
  77. package/packages/@monomind/cli/.claude/agents/specialized/specialized-workflow-architect.md +11 -14
  78. package/packages/@monomind/cli/.claude/agents/testing/production-validator.md +8 -7
  79. package/packages/@monomind/cli/.claude/agents/testing/testing-evidence-collector.md +3 -1
  80. package/packages/@monomind/cli/.claude/commands/mastermind/_repeat.md +22 -3
  81. package/packages/@monomind/cli/.claude/commands/mastermind/architect.md +1 -1
  82. package/packages/@monomind/cli/.claude/commands/mastermind/autodev.md +1 -1
  83. package/packages/@monomind/cli/.claude/commands/mastermind/build.md +1 -1
  84. package/packages/@monomind/cli/.claude/commands/mastermind/code-review.md +5 -5
  85. package/packages/@monomind/cli/.claude/commands/mastermind/debug.md +1 -1
  86. package/packages/@monomind/cli/.claude/commands/mastermind/help.md +2 -2
  87. package/packages/@monomind/cli/.claude/commands/mastermind/idea.md +1 -1
  88. package/packages/@monomind/cli/.claude/commands/mastermind/improve.md +1 -1
  89. package/packages/@monomind/cli/.claude/commands/mastermind/okf-export.md +14 -0
  90. package/packages/@monomind/cli/.claude/commands/mastermind/okf-import.md +15 -0
  91. package/packages/@monomind/cli/.claude/commands/mastermind/plan.md +1 -1
  92. package/packages/@monomind/cli/.claude/commands/mastermind/research.md +1 -1
  93. package/packages/@monomind/cli/.claude/commands/mastermind/review.md +12 -1
  94. package/packages/@monomind/cli/.claude/commands/mastermind/runorg.md +1 -1
  95. package/packages/@monomind/cli/.claude/commands/mastermind/taskdev.md +1 -1
  96. package/packages/@monomind/cli/.claude/commands/mastermind/tdd.md +1 -1
  97. package/packages/@monomind/cli/.claude/commands/mastermind/verify.md +1 -1
  98. package/packages/@monomind/cli/.claude/helpers/graphify-freshen.cjs +16 -20
  99. package/packages/@monomind/cli/.claude/helpers/handlers/agent-start-handler.cjs +11 -36
  100. package/packages/@monomind/cli/.claude/helpers/handlers/capture-handler.cjs +110 -0
  101. package/packages/@monomind/cli/.claude/helpers/handlers/route-handler.cjs +180 -256
  102. package/packages/@monomind/cli/.claude/helpers/handlers/session-handler.cjs +139 -142
  103. package/packages/@monomind/cli/.claude/helpers/handlers/session-restore-handler.cjs +15 -10
  104. package/packages/@monomind/cli/.claude/helpers/handlers/task-handler.cjs +8 -155
  105. package/packages/@monomind/cli/.claude/helpers/hook-handler.cjs +89 -5
  106. package/packages/@monomind/cli/.claude/helpers/intelligence.cjs +164 -15
  107. package/packages/@monomind/cli/.claude/helpers/learning-service.mjs +1 -0
  108. package/packages/@monomind/cli/.claude/helpers/mastermind-activate.cjs +33 -51
  109. package/packages/@monomind/cli/.claude/helpers/monolean-activate.cjs +13 -3
  110. package/packages/@monomind/cli/.claude/helpers/monolean-propagate.cjs +7 -3
  111. package/packages/@monomind/cli/.claude/helpers/router.cjs +47 -9
  112. package/packages/@monomind/cli/.claude/helpers/utils/monograph.cjs +37 -20
  113. package/packages/@monomind/cli/.claude/skills/mastermind-skills/_repeat.md +29 -4
  114. package/packages/@monomind/cli/.claude/skills/mastermind-skills/architect.md +5 -6
  115. package/packages/@monomind/cli/.claude/skills/mastermind-skills/autodev.md +8 -5
  116. package/packages/@monomind/cli/.claude/skills/mastermind-skills/review.md +25 -11
  117. package/packages/@monomind/cli/.claude/skills/mastermind-skills/techport.md +37 -3
  118. package/packages/@monomind/cli/.claude/skills/monodesign/document.md +9 -6
  119. package/packages/@monomind/cli/.claude/skills/monodesign/extract.md +1 -1
  120. package/packages/@monomind/cli/.claude/skills/monodesign/reference/document.md +1 -1
  121. package/packages/@monomind/cli/.claude/skills/monodesign/reference/live.md +1 -1
  122. package/packages/@monomind/cli/.claude/skills/monolean/SKILL.md +1 -1
  123. package/packages/@monomind/cli/bin/mcp-server.js +11 -1
  124. package/packages/@monomind/cli/dist/src/commands/agent-ops.d.ts +1 -2
  125. package/packages/@monomind/cli/dist/src/commands/agent-ops.js +1 -59
  126. package/packages/@monomind/cli/dist/src/commands/agent.js +2 -3
  127. package/packages/@monomind/cli/dist/src/commands/analyze-diff.js +1 -1
  128. package/packages/@monomind/cli/dist/src/commands/browse-action.js +94 -2
  129. package/packages/@monomind/cli/dist/src/commands/completions.js +11 -56
  130. package/packages/@monomind/cli/dist/src/commands/doctor-project-checks.d.ts +1 -1
  131. package/packages/@monomind/cli/dist/src/commands/doctor-project-checks.js +1 -1
  132. package/packages/@monomind/cli/dist/src/commands/hive-mind-helpers.js +2 -2
  133. package/packages/@monomind/cli/dist/src/commands/hive-mind-ops.d.ts +1 -3
  134. package/packages/@monomind/cli/dist/src/commands/hive-mind-ops.js +2 -116
  135. package/packages/@monomind/cli/dist/src/commands/hive-mind.js +2 -5
  136. package/packages/@monomind/cli/dist/src/commands/hooks-coverage-commands.js +8 -7
  137. package/packages/@monomind/cli/dist/src/commands/hooks-coverage-gaps.js +1 -1
  138. package/packages/@monomind/cli/dist/src/commands/hooks-coverage-routing.js +2 -2
  139. package/packages/@monomind/cli/dist/src/commands/hooks-extended-commands.d.ts +0 -3
  140. package/packages/@monomind/cli/dist/src/commands/hooks-extended-commands.js +0 -307
  141. package/packages/@monomind/cli/dist/src/commands/hooks.js +1 -12
  142. package/packages/@monomind/cli/dist/src/commands/index.d.ts +3 -51
  143. package/packages/@monomind/cli/dist/src/commands/index.js +36 -184
  144. package/packages/@monomind/cli/dist/src/commands/init-wizard.js +2 -4
  145. package/packages/@monomind/cli/dist/src/commands/mcp.js +32 -4
  146. package/packages/@monomind/cli/dist/src/commands/memory-admin.d.ts +1 -2
  147. package/packages/@monomind/cli/dist/src/commands/memory-admin.js +1 -118
  148. package/packages/@monomind/cli/dist/src/commands/memory-transfer.d.ts +1 -2
  149. package/packages/@monomind/cli/dist/src/commands/memory-transfer.js +5 -171
  150. package/packages/@monomind/cli/dist/src/commands/memory.js +3 -6
  151. package/packages/@monomind/cli/dist/src/commands/neural-core.d.ts +3 -1
  152. package/packages/@monomind/cli/dist/src/commands/neural-core.js +145 -6
  153. package/packages/@monomind/cli/dist/src/commands/neural-optimize.js +4 -4
  154. package/packages/@monomind/cli/dist/src/commands/neural-registry.d.ts +1 -1
  155. package/packages/@monomind/cli/dist/src/commands/neural-registry.js +4 -4
  156. package/packages/@monomind/cli/dist/src/commands/neural.d.ts +1 -1
  157. package/packages/@monomind/cli/dist/src/commands/neural.js +6 -6
  158. package/packages/@monomind/cli/dist/src/commands/performance.js +68 -58
  159. package/packages/@monomind/cli/dist/src/commands/providers.js +2 -131
  160. package/packages/@monomind/cli/dist/src/commands/security-misc.d.ts +0 -1
  161. package/packages/@monomind/cli/dist/src/commands/security-misc.js +69 -45
  162. package/packages/@monomind/cli/dist/src/commands/security.js +2 -4
  163. package/packages/@monomind/cli/dist/src/commands/session.js +1 -285
  164. package/packages/@monomind/cli/dist/src/commands/start.js +2 -41
  165. package/packages/@monomind/cli/dist/src/commands/status.js +18 -29
  166. package/packages/@monomind/cli/dist/src/commands/swarm.js +1 -1
  167. package/packages/@monomind/cli/dist/src/commands/task.js +2 -49
  168. package/packages/@monomind/cli/dist/src/commands/workflow.js +2 -104
  169. package/packages/@monomind/cli/dist/src/index.js +7 -0
  170. package/packages/@monomind/cli/dist/src/init/executor.js +3 -14
  171. package/packages/@monomind/cli/dist/src/init/helpers-generator.js +2 -22
  172. package/packages/@monomind/cli/dist/src/init/settings-generator.js +0 -1
  173. package/packages/@monomind/cli/dist/src/init/types.d.ts +1 -3
  174. package/packages/@monomind/cli/dist/src/init/types.js +0 -2
  175. package/packages/@monomind/cli/dist/src/mcp-client.js +0 -6
  176. package/packages/@monomind/cli/dist/src/mcp-server.js +16 -0
  177. package/packages/@monomind/cli/dist/src/mcp-tools/agent-tools.js +0 -17
  178. package/packages/@monomind/cli/dist/src/mcp-tools/coherence/causal-infer.d.ts +5 -5
  179. package/packages/@monomind/cli/dist/src/mcp-tools/coherence/causal-infer.js +32 -46
  180. package/packages/@monomind/cli/dist/src/mcp-tools/coherence/consensus-verify.d.ts +2 -3
  181. package/packages/@monomind/cli/dist/src/mcp-tools/coherence/consensus-verify.js +22 -20
  182. package/packages/@monomind/cli/dist/src/mcp-tools/coherence/memory-gate.d.ts +3 -2
  183. package/packages/@monomind/cli/dist/src/mcp-tools/coherence/memory-gate.js +32 -19
  184. package/packages/@monomind/cli/dist/src/mcp-tools/coherence/quantum-topology.d.ts +4 -4
  185. package/packages/@monomind/cli/dist/src/mcp-tools/coherence/quantum-topology.js +11 -17
  186. package/packages/@monomind/cli/dist/src/mcp-tools/coherence/spectral-analyze.d.ts +2 -3
  187. package/packages/@monomind/cli/dist/src/mcp-tools/coherence/spectral-analyze.js +51 -32
  188. package/packages/@monomind/cli/dist/src/mcp-tools/coherence/types.d.ts +5 -9
  189. package/packages/@monomind/cli/dist/src/mcp-tools/guidance-tools.js +2 -2
  190. package/packages/@monomind/cli/dist/src/mcp-tools/hive-mind-tools.js +25 -3
  191. package/packages/@monomind/cli/dist/src/mcp-tools/hooks-routing.d.ts +0 -3
  192. package/packages/@monomind/cli/dist/src/mcp-tools/hooks-routing.js +45 -159
  193. package/packages/@monomind/cli/dist/src/mcp-tools/hooks-tools.js +1 -4
  194. package/packages/@monomind/cli/dist/src/mcp-tools/index.d.ts +0 -2
  195. package/packages/@monomind/cli/dist/src/mcp-tools/index.js +0 -3
  196. package/packages/@monomind/cli/dist/src/mcp-tools/memory-tools.js +24 -0
  197. package/packages/@monomind/cli/dist/src/mcp-tools/monograph-tools.js +452 -7
  198. package/packages/@monomind/cli/dist/src/mcp-tools/neural-tools.d.ts +4 -10
  199. package/packages/@monomind/cli/dist/src/mcp-tools/neural-tools.js +28 -54
  200. package/packages/@monomind/cli/dist/src/mcp-tools/performance-tools.js +5 -17
  201. package/packages/@monomind/cli/dist/src/mcp-tools/quality/coverage-analysis/prioritize-gaps.js +2 -2
  202. package/packages/@monomind/cli/dist/src/mcp-tools/quality/security-compliance/detect-secrets.d.ts +4 -4
  203. package/packages/@monomind/cli/dist/src/mcp-tools/quality-tools.d.ts +7 -2
  204. package/packages/@monomind/cli/dist/src/mcp-tools/quality-tools.js +7 -257
  205. package/packages/@monomind/cli/dist/src/memory/intelligence.d.ts +7 -8
  206. package/packages/@monomind/cli/dist/src/memory/intelligence.js +15 -16
  207. package/packages/@monomind/cli/dist/src/memory/memory-bridge.d.ts +1 -0
  208. package/packages/@monomind/cli/dist/src/memory/memory-bridge.js +37 -0
  209. package/packages/@monomind/cli/dist/src/services/worker-daemon.d.ts +3 -21
  210. package/packages/@monomind/cli/dist/src/services/worker-daemon.js +13 -80
  211. package/packages/@monomind/cli/dist/src/suggest.js +0 -5
  212. package/packages/@monomind/cli/package.json +1 -1
  213. package/packages/@monomind/guidance/README.md +49 -1153
  214. package/packages/@monomind/guidance/package.json +1 -74
  215. package/.claude/helpers/auto-memory-hook.mjs +0 -503
  216. package/packages/@monomind/cli/.claude/helpers/auto-memory-hook.mjs +0 -503
  217. package/packages/@monomind/cli/dist/src/commands/deployment.d.ts +0 -10
  218. package/packages/@monomind/cli/dist/src/commands/deployment.js +0 -706
@@ -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 { tokenOptimizeCommand, modelRouteCommand, modelOutcomeCommand, modelStatsCommand, teammateIdleCommand, taskCompletedCommand, notifyCommand, } from './hooks-extended-commands.js';
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');
@@ -1,12 +1,6 @@
1
1
  /**
2
2
  * CLI Commands Index
3
3
  * Central registry for all CLI commands
4
- *
5
- * NOTE: All commands are synchronously imported at module load time (lines below).
6
- * The commandLoaders/loadCommand infrastructure provides an async fallback for
7
- * commands looked up via getCommandAsync() but does NOT reduce startup time since
8
- * all modules are already imported synchronously for the commands array and
9
- * commandsByCategory exports.
10
4
  */
11
5
  import type { Command } from '../types.js';
12
6
  export { initCommand } from './init.js';
@@ -21,7 +15,6 @@ export { mcpCommand } from './mcp.js';
21
15
  export { hooksCommand } from './hooks.js';
22
16
  export { daemonCommand } from './daemon.js';
23
17
  export { doctorCommand } from './doctor.js';
24
- export { neuralCommand } from './neural.js';
25
18
  export { performanceCommand } from './performance.js';
26
19
  export { securityCommand } from './security.js';
27
20
  export { hiveMindCommand } from './hive-mind.js';
@@ -37,29 +30,9 @@ export { scanCommand } from './scan.js';
37
30
  export { reportCrashCommand } from './report-crash.js';
38
31
  export { crashReportingCommand } from './crash-reporting.js';
39
32
  export { docCommand } from './doc.js';
40
- export declare function getConfigCommand(): Promise<Command | undefined>;
41
- export declare function getWorkflowCommand(): Promise<Command | undefined>;
42
- export declare function getHiveMindCommand(): Promise<Command | undefined>;
43
- export declare function getProcessCommand(): Promise<Command | undefined>;
44
- export declare function getTaskCommand(): Promise<Command | undefined>;
45
- export declare function getSessionCommand(): Promise<Command | undefined>;
46
- export declare function getNeuralCommand(): Promise<Command | undefined>;
47
- export declare function getSecurityCommand(): Promise<Command | undefined>;
48
- export declare function getPerformanceCommand(): Promise<Command | undefined>;
49
- export declare function getProvidersCommand(): Promise<Command | undefined>;
50
- export declare function getDeploymentCommand(): Promise<Command | undefined>;
51
- export declare function getClaimsCommand(): Promise<Command | undefined>;
52
- export declare function getCompletionsCommand(): Promise<Command | undefined>;
53
- export declare function getAnalyzeCommand(): Promise<Command | undefined>;
54
- export declare function getRouteCommand(): Promise<Command | undefined>;
55
- export declare function getIssuesCommand(): Promise<Command | undefined>;
56
- export declare function getGuidanceCommand(): Promise<Command | undefined>;
57
- export declare function getCleanupCommand(): Promise<Command | undefined>;
58
- export declare function getAutopilotCommand(): Promise<Command | undefined>;
59
- export declare function getMonographCommand(): Promise<Command | undefined>;
33
+ export { neuralCommand } from './neural.js';
60
34
  /**
61
- * Core commands loaded synchronously (available immediately)
62
- * Advanced commands loaded on-demand for faster startup
35
+ * All registered commands
63
36
  */
64
37
  export declare const commands: Command[];
65
38
  /**
@@ -74,34 +47,13 @@ export declare const commandsByCategory: {
74
47
  };
75
48
  /**
76
49
  * Command registry map for quick lookup
77
- * Supports both sync (core commands) and async (lazy-loaded) commands
78
50
  */
79
51
  export declare const commandRegistry: Map<string, Command>;
80
- /**
81
- * Get command by name (sync for core commands, returns undefined for lazy commands)
82
- * Use getCommandAsync for lazy-loaded commands
83
- */
84
52
  export declare function getCommand(name: string): Command | undefined;
85
- /**
86
- * Get command by name (async - supports lazy loading)
87
- */
88
53
  export declare function getCommandAsync(name: string): Promise<Command | undefined>;
89
- /**
90
- * Check if command exists (sync check for core commands)
91
- */
92
54
  export declare function hasCommand(name: string): boolean;
93
- /**
94
- * Get all command names (including aliases and lazy-loadable)
95
- */
96
55
  export declare function getCommandNames(): string[];
97
- /**
98
- * Get all unique commands (excluding aliases)
99
- */
100
56
  export declare function getUniqueCommands(): Command[];
101
- /**
102
- * Load all commands (populates lazy-loaded commands)
103
- * Use this when you need all commands available synchronously
104
- */
105
57
  export declare function loadAllCommands(): Promise<Command[]>;
106
58
  /**
107
59
  * Setup commands in a CLI instance
@@ -110,7 +62,7 @@ export declare function setupCommands(cli: {
110
62
  command: (cmd: Command) => void;
111
63
  }): void;
112
64
  /**
113
- * Setup all commands including lazy-loaded (async)
65
+ * Setup all commands (async variant)
114
66
  */
115
67
  export declare function setupAllCommands(cli: {
116
68
  command: (cmd: Command) => void;