@nerviq/cli 0.0.1 → 0.9.0-beta.1

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 (148) hide show
  1. package/CHANGELOG.md +181 -0
  2. package/LICENSE +21 -0
  3. package/README.md +447 -0
  4. package/bin/cli.js +749 -0
  5. package/content/case-study-template.md +91 -0
  6. package/content/claims-governance.md +37 -0
  7. package/content/claude-code/audit-repo/SKILL.md +20 -0
  8. package/content/claude-native-integration.md +60 -0
  9. package/content/devto-article.json +9 -0
  10. package/content/launch-posts.md +226 -0
  11. package/content/pilot-rollout-kit.md +30 -0
  12. package/content/release-checklist.md +31 -0
  13. package/package.json +53 -4
  14. package/src/activity.js +529 -0
  15. package/src/aider/activity.js +226 -0
  16. package/src/aider/config-parser.js +166 -0
  17. package/src/aider/context.js +158 -0
  18. package/src/aider/deep-review.js +316 -0
  19. package/src/aider/domain-packs.js +278 -0
  20. package/src/aider/freshness.js +168 -0
  21. package/src/aider/governance.js +253 -0
  22. package/src/aider/interactive.js +334 -0
  23. package/src/aider/mcp-packs.js +98 -0
  24. package/src/aider/patch.js +214 -0
  25. package/src/aider/plans.js +186 -0
  26. package/src/aider/premium.js +360 -0
  27. package/src/aider/setup.js +404 -0
  28. package/src/aider/techniques.js +1323 -0
  29. package/src/analyze.js +821 -0
  30. package/src/audit.js +1003 -0
  31. package/src/badge.js +13 -0
  32. package/src/benchmark.js +339 -0
  33. package/src/claudex-sync.json +7 -0
  34. package/src/codex/activity.js +324 -0
  35. package/src/codex/config-parser.js +183 -0
  36. package/src/codex/context.js +221 -0
  37. package/src/codex/deep-review.js +493 -0
  38. package/src/codex/domain-packs.js +372 -0
  39. package/src/codex/freshness.js +167 -0
  40. package/src/codex/governance.js +192 -0
  41. package/src/codex/interactive.js +618 -0
  42. package/src/codex/mcp-packs.js +660 -0
  43. package/src/codex/patch.js +209 -0
  44. package/src/codex/plans.js +251 -0
  45. package/src/codex/premium.js +614 -0
  46. package/src/codex/setup.js +603 -0
  47. package/src/codex/techniques.js +2649 -0
  48. package/src/context.js +272 -0
  49. package/src/copilot/activity.js +309 -0
  50. package/src/copilot/config-parser.js +226 -0
  51. package/src/copilot/context.js +197 -0
  52. package/src/copilot/deep-review.js +346 -0
  53. package/src/copilot/domain-packs.js +350 -0
  54. package/src/copilot/freshness.js +197 -0
  55. package/src/copilot/governance.js +222 -0
  56. package/src/copilot/interactive.js +406 -0
  57. package/src/copilot/mcp-packs.js +572 -0
  58. package/src/copilot/patch.js +238 -0
  59. package/src/copilot/plans.js +253 -0
  60. package/src/copilot/premium.js +450 -0
  61. package/src/copilot/setup.js +488 -0
  62. package/src/copilot/techniques.js +1822 -0
  63. package/src/cursor/activity.js +301 -0
  64. package/src/cursor/config-parser.js +265 -0
  65. package/src/cursor/context.js +236 -0
  66. package/src/cursor/deep-review.js +334 -0
  67. package/src/cursor/domain-packs.js +346 -0
  68. package/src/cursor/freshness.js +214 -0
  69. package/src/cursor/governance.js +229 -0
  70. package/src/cursor/interactive.js +391 -0
  71. package/src/cursor/mcp-packs.js +571 -0
  72. package/src/cursor/patch.js +243 -0
  73. package/src/cursor/plans.js +254 -0
  74. package/src/cursor/premium.js +468 -0
  75. package/src/cursor/setup.js +488 -0
  76. package/src/cursor/techniques.js +1786 -0
  77. package/src/deep-review.js +345 -0
  78. package/src/domain-packs.js +364 -0
  79. package/src/formatters/sarif.js +115 -0
  80. package/src/gemini/activity.js +402 -0
  81. package/src/gemini/config-parser.js +275 -0
  82. package/src/gemini/context.js +221 -0
  83. package/src/gemini/deep-review.js +559 -0
  84. package/src/gemini/domain-packs.js +371 -0
  85. package/src/gemini/freshness.js +204 -0
  86. package/src/gemini/governance.js +201 -0
  87. package/src/gemini/interactive.js +860 -0
  88. package/src/gemini/mcp-packs.js +658 -0
  89. package/src/gemini/patch.js +229 -0
  90. package/src/gemini/plans.js +269 -0
  91. package/src/gemini/premium.js +759 -0
  92. package/src/gemini/setup.js +692 -0
  93. package/src/gemini/techniques.js +2084 -0
  94. package/src/governance.js +523 -0
  95. package/src/harmony/advisor.js +383 -0
  96. package/src/harmony/audit.js +303 -0
  97. package/src/harmony/canon.js +444 -0
  98. package/src/harmony/cli.js +331 -0
  99. package/src/harmony/drift.js +401 -0
  100. package/src/harmony/governance.js +313 -0
  101. package/src/harmony/memory.js +238 -0
  102. package/src/harmony/sync.js +458 -0
  103. package/src/harmony/watch.js +336 -0
  104. package/src/index.js +256 -0
  105. package/src/insights.js +119 -0
  106. package/src/interactive.js +118 -0
  107. package/src/mcp-packs.js +597 -0
  108. package/src/opencode/activity.js +286 -0
  109. package/src/opencode/config-parser.js +109 -0
  110. package/src/opencode/context.js +247 -0
  111. package/src/opencode/deep-review.js +313 -0
  112. package/src/opencode/domain-packs.js +240 -0
  113. package/src/opencode/freshness.js +158 -0
  114. package/src/opencode/governance.js +159 -0
  115. package/src/opencode/interactive.js +392 -0
  116. package/src/opencode/mcp-packs.js +474 -0
  117. package/src/opencode/patch.js +184 -0
  118. package/src/opencode/plans.js +231 -0
  119. package/src/opencode/premium.js +413 -0
  120. package/src/opencode/setup.js +449 -0
  121. package/src/opencode/techniques.js +1713 -0
  122. package/src/plans.js +655 -0
  123. package/src/secret-patterns.js +30 -0
  124. package/src/setup.js +1274 -0
  125. package/src/synergy/adaptive.js +261 -0
  126. package/src/synergy/compensation.js +156 -0
  127. package/src/synergy/evidence.js +193 -0
  128. package/src/synergy/learning.js +184 -0
  129. package/src/synergy/patterns.js +227 -0
  130. package/src/synergy/ranking.js +83 -0
  131. package/src/synergy/report.js +163 -0
  132. package/src/synergy/routing.js +152 -0
  133. package/src/techniques.js +1354 -0
  134. package/src/watch.js +229 -0
  135. package/src/windsurf/activity.js +302 -0
  136. package/src/windsurf/config-parser.js +267 -0
  137. package/src/windsurf/context.js +249 -0
  138. package/src/windsurf/deep-review.js +337 -0
  139. package/src/windsurf/domain-packs.js +348 -0
  140. package/src/windsurf/freshness.js +215 -0
  141. package/src/windsurf/governance.js +231 -0
  142. package/src/windsurf/interactive.js +388 -0
  143. package/src/windsurf/mcp-packs.js +535 -0
  144. package/src/windsurf/patch.js +231 -0
  145. package/src/windsurf/plans.js +247 -0
  146. package/src/windsurf/premium.js +467 -0
  147. package/src/windsurf/setup.js +471 -0
  148. package/src/windsurf/techniques.js +1758 -0
@@ -0,0 +1,336 @@
1
+ /**
2
+ * H6. Harmony Watch - Continuous Adaptation Loop
3
+ *
4
+ * Monitors repo for changes across ALL platform config files and triggers
5
+ * cross-platform drift detection when changes occur.
6
+ *
7
+ * Extends the watch pattern from src/watch.js to cover all supported platforms.
8
+ * Zero external dependencies.
9
+ */
10
+
11
+ const fs = require('fs');
12
+ const path = require('path');
13
+
14
+ const COLORS = {
15
+ reset: '\x1b[0m', bold: '\x1b[1m', dim: '\x1b[2m',
16
+ green: '\x1b[32m', yellow: '\x1b[33m', blue: '\x1b[36m', red: '\x1b[31m',
17
+ };
18
+ const c = (text, color) => `${COLORS[color] || ''}${text}${COLORS.reset}`;
19
+
20
+ // ─── Platform config file paths to watch ──────────────────────────────────────
21
+
22
+ const PLATFORM_WATCH_FILES = [
23
+ // Claude
24
+ 'CLAUDE.md',
25
+ '.claude/settings.json',
26
+ '.claude/settings.local.json',
27
+ // Codex
28
+ 'AGENTS.md',
29
+ 'codex.toml',
30
+ '.codex/config.toml',
31
+ // Gemini
32
+ 'GEMINI.md',
33
+ '.gemini/settings.json',
34
+ // Copilot
35
+ '.github/copilot-instructions.md',
36
+ '.github/copilot-review-instructions.md',
37
+ // Cursor
38
+ '.cursorrules',
39
+ // Shared
40
+ '.gitignore',
41
+ 'package.json',
42
+ 'tsconfig.json',
43
+ ];
44
+
45
+ const PLATFORM_WATCH_DIRS = [
46
+ '.claude',
47
+ '.claude/commands',
48
+ '.claude/rules',
49
+ '.claude/agents',
50
+ '.claude/skills',
51
+ '.codex',
52
+ '.gemini',
53
+ '.github',
54
+ '.cursor',
55
+ '.cursor/rules',
56
+ ];
57
+
58
+ // ─── fs.watch helpers (mirror pattern from src/watch.js) ──────────────────────
59
+
60
+ function supportsNativeRecursiveWatch(platform) {
61
+ return (platform || process.platform) === 'win32' || (platform || process.platform) === 'darwin';
62
+ }
63
+
64
+ function statIfExists(fullPath) {
65
+ try {
66
+ return fs.statSync(fullPath);
67
+ } catch (_e) {
68
+ return null;
69
+ }
70
+ }
71
+
72
+ function listRecursiveDirectories(dir) {
73
+ const directories = [dir];
74
+ let entries = [];
75
+ try {
76
+ entries = fs.readdirSync(dir, { withFileTypes: true });
77
+ } catch (_e) {
78
+ return directories;
79
+ }
80
+ for (const entry of entries) {
81
+ if (entry.isDirectory()) {
82
+ directories.push(...listRecursiveDirectories(path.join(dir, entry.name)));
83
+ }
84
+ }
85
+ return directories;
86
+ }
87
+
88
+ /**
89
+ * Build a watch plan that covers all platform config files and directories.
90
+ */
91
+ function buildHarmonyWatchPlan(rootDir, platform) {
92
+ const plan = [];
93
+ const seen = new Set();
94
+ const recursiveSupported = supportsNativeRecursiveWatch(platform);
95
+
96
+ const addTarget = (fullPath, recursive, source) => {
97
+ const resolved = path.resolve(fullPath);
98
+ const key = `${resolved}|${recursive}`;
99
+ if (seen.has(key)) return;
100
+ seen.add(key);
101
+ plan.push({ path: resolved, recursive, source });
102
+ };
103
+
104
+ // Watch repo root for top-level file creations
105
+ addTarget(rootDir, false, 'repo-root');
106
+
107
+ // Watch individual platform config files
108
+ for (const watchPath of PLATFORM_WATCH_FILES) {
109
+ const fullPath = path.join(rootDir, watchPath);
110
+ const stat = statIfExists(fullPath);
111
+ if (stat && stat.isFile()) {
112
+ addTarget(fullPath, false, watchPath);
113
+ }
114
+ }
115
+
116
+ // Watch platform config directories
117
+ for (const watchPath of PLATFORM_WATCH_DIRS) {
118
+ const fullPath = path.join(rootDir, watchPath);
119
+ const stat = statIfExists(fullPath);
120
+ if (!stat || !stat.isDirectory()) continue;
121
+
122
+ if (recursiveSupported) {
123
+ addTarget(fullPath, true, watchPath);
124
+ } else {
125
+ for (const dir of listRecursiveDirectories(fullPath)) {
126
+ addTarget(dir, false, watchPath);
127
+ }
128
+ }
129
+ }
130
+
131
+ return plan;
132
+ }
133
+
134
+ // ─── Watcher registration ─────────────────────────────────────────────────────
135
+
136
+ function registerWatchers(rootDir, watchers, onChange, platform) {
137
+ const plan = buildHarmonyWatchPlan(rootDir, platform);
138
+
139
+ for (const item of plan) {
140
+ const key = `${item.path}|${item.recursive}`;
141
+ if (watchers.has(key)) continue;
142
+
143
+ try {
144
+ const watcher = fs.watch(item.path, { recursive: item.recursive }, (eventType, filename) => {
145
+ onChange(item, eventType, filename);
146
+ });
147
+ watchers.set(key, watcher);
148
+ } catch (_e) {
149
+ // Ignore unsupported or transient watch registration failures
150
+ }
151
+ }
152
+
153
+ return watchers.size;
154
+ }
155
+
156
+ function closeWatchers(watchers) {
157
+ for (const watcher of watchers.values()) {
158
+ try {
159
+ watcher.close();
160
+ } catch (_e) {
161
+ // Ignore close errors during shutdown
162
+ }
163
+ }
164
+ watchers.clear();
165
+ }
166
+
167
+ /**
168
+ * Identify which platform a changed file belongs to.
169
+ */
170
+ function identifyPlatform(filePath) {
171
+ const normalized = filePath.replace(/\\/g, '/').toLowerCase();
172
+ if (normalized.includes('.claude') || normalized.includes('claude.md')) return 'claude';
173
+ if (normalized.includes('.codex') || normalized.includes('agents.md') || normalized.includes('codex.toml')) return 'codex';
174
+ if (normalized.includes('.gemini') || normalized.includes('gemini.md')) return 'gemini';
175
+ if (normalized.includes('copilot') || normalized.includes('.github')) return 'copilot';
176
+ if (normalized.includes('.cursor') || normalized.includes('cursorrules')) return 'cursor';
177
+ return 'unknown';
178
+ }
179
+
180
+ // ─── Main watch loop ──────────────────────────────────────────────────────────
181
+
182
+ /**
183
+ * Start the harmony watch loop.
184
+ *
185
+ * @param {Object} options
186
+ * @param {string} options.dir - Root directory to watch
187
+ * @param {Function} [options.onDriftDetected] - Callback when drift increases: (platform, details) => void
188
+ * @param {Function} [options.onPlatformChange] - Callback on any platform config change: (platform, file) => void
189
+ * @param {Function} [options.runAudit] - Optional audit function to re-run on changes
190
+ * @param {number} [options.debounceMs=800] - Debounce interval in ms
191
+ */
192
+ async function startHarmonyWatch(options) {
193
+ const {
194
+ dir,
195
+ onDriftDetected,
196
+ onPlatformChange,
197
+ runAudit,
198
+ debounceMs = 800,
199
+ } = options;
200
+
201
+ const recursiveSupported = supportsNativeRecursiveWatch();
202
+
203
+ console.log('');
204
+ console.log(c(' nerviq harmony watch', 'bold'));
205
+ console.log(c(' ═══════════════════════════════════════', 'dim'));
206
+ console.log(c(` Watching: ${dir}`, 'dim'));
207
+ console.log(c(` Platforms: Claude, Codex, Gemini, Copilot, Cursor`, 'dim'));
208
+ console.log(c(` Mode: ${recursiveSupported ? 'native recursive' : 'expanded directory fallback'}`, 'dim'));
209
+ console.log(c(' Press Ctrl+C to stop', 'dim'));
210
+ console.log('');
211
+
212
+ // Initial audit if provided
213
+ let lastScores = {};
214
+ if (runAudit) {
215
+ try {
216
+ const results = await runAudit(dir);
217
+ if (results && typeof results === 'object') {
218
+ for (const [platform, result] of Object.entries(results)) {
219
+ lastScores[platform] = result.score || 0;
220
+ }
221
+ }
222
+ console.log(c(' Initial scores:', 'bold'));
223
+ for (const [platform, score] of Object.entries(lastScores)) {
224
+ console.log(` ${platform}: ${scoreColor(score)}`);
225
+ }
226
+ console.log('');
227
+ } catch (e) {
228
+ console.log(c(` Initial audit skipped: ${e.message}`, 'dim'));
229
+ }
230
+ }
231
+
232
+ const watchers = new Map();
233
+ let debounceTimer = null;
234
+ let shuttingDown = false;
235
+
236
+ const cleanupAndExit = () => {
237
+ if (shuttingDown) return;
238
+ shuttingDown = true;
239
+ clearTimeout(debounceTimer);
240
+ closeWatchers(watchers);
241
+ console.log('');
242
+ console.log(c(' Harmony watch stopped.', 'dim'));
243
+ process.exit(0);
244
+ };
245
+
246
+ const handleChange = (item, _eventType, filename) => {
247
+ clearTimeout(debounceTimer);
248
+ debounceTimer = setTimeout(async () => {
249
+ const changedLabel = filename
250
+ ? String(filename)
251
+ : path.relative(dir, item.path) || path.basename(item.path);
252
+
253
+ const platform = identifyPlatform(changedLabel);
254
+ const timestamp = new Date().toLocaleTimeString();
255
+
256
+ console.log(c(` [${timestamp}] Change: ${changedLabel} (${platform})`, 'dim'));
257
+
258
+ // Notify callback
259
+ if (onPlatformChange) {
260
+ try {
261
+ onPlatformChange(platform, changedLabel);
262
+ } catch (_e) {
263
+ // Ignore callback errors
264
+ }
265
+ }
266
+
267
+ // Re-register to pick up new dirs/files
268
+ registerWatchers(dir, watchers, handleChange);
269
+
270
+ // Re-audit if possible
271
+ if (runAudit) {
272
+ try {
273
+ const results = await runAudit(dir);
274
+ if (results && typeof results === 'object') {
275
+ for (const [p, result] of Object.entries(results)) {
276
+ const newScore = result.score || 0;
277
+ const oldScore = lastScores[p] || 0;
278
+ const delta = newScore - oldScore;
279
+
280
+ if (delta !== 0) {
281
+ const arrow = delta > 0
282
+ ? c(`+${delta}`, 'green')
283
+ : c(String(delta), 'yellow');
284
+ console.log(` ${p}: ${scoreColor(newScore)} ${arrow}`);
285
+ }
286
+
287
+ // Drift detection
288
+ if (delta < 0 && onDriftDetected) {
289
+ try {
290
+ onDriftDetected(p, { oldScore, newScore, delta, changedFile: changedLabel });
291
+ } catch (_e) {
292
+ // Ignore callback errors
293
+ }
294
+ }
295
+
296
+ lastScores[p] = newScore;
297
+ }
298
+ }
299
+ } catch (_e) {
300
+ // Ignore transient errors during file saves
301
+ }
302
+ }
303
+
304
+ console.log('');
305
+ }, debounceMs);
306
+ };
307
+
308
+ registerWatchers(dir, watchers, handleChange);
309
+
310
+ if (watchers.size === 0) {
311
+ console.log(c(' Could not register any filesystem watchers.', 'yellow'));
312
+ return { watchers, close: () => {} };
313
+ }
314
+
315
+ process.once('SIGINT', cleanupAndExit);
316
+ process.once('SIGTERM', cleanupAndExit);
317
+
318
+ console.log(c(` Watching ${watchers.size} targets for changes...`, 'dim'));
319
+ console.log('');
320
+
321
+ // Keep alive
322
+ await new Promise(() => {});
323
+ }
324
+
325
+ function scoreColor(score) {
326
+ const color = score >= 70 ? 'green' : score >= 40 ? 'yellow' : 'dim';
327
+ return c(`${score}/100`, color);
328
+ }
329
+
330
+ module.exports = {
331
+ startHarmonyWatch,
332
+ buildHarmonyWatchPlan,
333
+ PLATFORM_WATCH_FILES,
334
+ PLATFORM_WATCH_DIRS,
335
+ identifyPlatform,
336
+ };
package/src/index.js ADDED
@@ -0,0 +1,256 @@
1
+ const { audit } = require('./audit');
2
+ const { setup } = require('./setup');
3
+ const { analyzeProject } = require('./analyze');
4
+ const { buildProposalBundle, applyProposalBundle } = require('./plans');
5
+ const { getGovernanceSummary } = require('./governance');
6
+ const { runBenchmark } = require('./benchmark');
7
+ const { DOMAIN_PACKS, detectDomainPacks } = require('./domain-packs');
8
+ const { MCP_PACKS, getMcpPack, mergeMcpServers, getMcpPackPreflight, recommendMcpPacks } = require('./mcp-packs');
9
+ const { recordRecommendationOutcome, getRecommendationOutcomeSummary, formatRecommendationOutcomeSummary } = require('./activity');
10
+ const { CodexProjectContext, detectCodexVersion } = require('./codex/context');
11
+ const { formatSarif } = require('./formatters/sarif');
12
+ const { CODEX_MCP_PACKS, recommendCodexMcpPacks, getCodexMcpPreflight, mergeCodexMcpToml } = require('./codex/mcp-packs');
13
+ const { buildCodexProposalBundle } = require('./codex/plans');
14
+ const { setupCodex } = require('./codex/setup');
15
+ const {
16
+ getCodexHistory, formatCodexHistory, compareCodexLatest,
17
+ exportCodexTrendReport, recordCodexFeedback, formatCodexFeedback,
18
+ generateCodexInsights, formatCodexInsights,
19
+ } = require('./codex/activity');
20
+ const { getCodexGovernanceSummary } = require('./codex/governance');
21
+ const {
22
+ patchAgentsMd, patchConfigToml, detectMixedAgentRepo, applyPatch,
23
+ } = require('./codex/patch');
24
+ const { checkReleaseGate, formatReleaseGate, getPropagationTargets } = require('./codex/freshness');
25
+ const { runCodexDeepReview, collectCodexConfig, buildCodexReviewPayload } = require('./codex/deep-review');
26
+ const { codexInteractive } = require('./codex/interactive');
27
+ const { composePacks, getCiTemplate, CI_TEMPLATES, checkAdoptionGate } = require('./codex/premium');
28
+ // Gemini CLI modules
29
+ const { GeminiProjectContext, detectGeminiVersion } = require('./gemini/context');
30
+ const { GEMINI_MCP_PACKS, recommendGeminiMcpPacks, getGeminiMcpPreflight, mergeGeminiMcpJson } = require('./gemini/mcp-packs');
31
+ const { GEMINI_DOMAIN_PACKS, detectGeminiDomainPacks } = require('./gemini/domain-packs');
32
+ const { buildGeminiProposalBundle } = require('./gemini/plans');
33
+ const { setupGemini } = require('./gemini/setup');
34
+ const { getGeminiGovernanceSummary } = require('./gemini/governance');
35
+ const {
36
+ getGeminiHistory, formatGeminiHistory, compareGeminiLatest,
37
+ exportGeminiTrendReport, recordGeminiFeedback, formatGeminiFeedback,
38
+ generateGeminiInsights, formatGeminiInsights,
39
+ } = require('./gemini/activity');
40
+ const { patchGeminiMd, patchSettingsJson, detectMixedAgentRepo: detectMixedAgentRepoGemini } = require('./gemini/patch');
41
+ const { checkReleaseGate: checkGeminiReleaseGate, formatReleaseGate: formatGeminiReleaseGate } = require('./gemini/freshness');
42
+ const { runGeminiDeepReview, collectGeminiConfig } = require('./gemini/deep-review');
43
+ const { geminiInteractive } = require('./gemini/interactive');
44
+ const { composePacks: composeGeminiPacks, getCiTemplate: getGeminiCiTemplate, CI_TEMPLATES: GEMINI_CI_TEMPLATES, checkAdoptionGate: checkGeminiAdoptionGate } = require('./gemini/premium');
45
+ // Copilot modules
46
+ const { CopilotProjectContext } = require('./copilot/context');
47
+ const { COPILOT_MCP_PACKS, recommendCopilotMcpPacks, getCopilotMcpPreflight } = require('./copilot/mcp-packs');
48
+ const { COPILOT_DOMAIN_PACKS, detectCopilotDomainPacks } = require('./copilot/domain-packs');
49
+ const { buildCopilotProposalBundle } = require('./copilot/plans');
50
+ const { setupCopilot } = require('./copilot/setup');
51
+ const { getCopilotGovernanceSummary } = require('./copilot/governance');
52
+ const { getCopilotHistory, formatCopilotHistory, compareCopilotLatest, exportCopilotTrendReport, generateCopilotInsights } = require('./copilot/activity');
53
+ const { runCopilotDeepReview } = require('./copilot/deep-review');
54
+ const { copilotInteractive } = require('./copilot/interactive');
55
+ const { composePacks: composeCopilotPacks, getCiTemplate: getCopilotCiTemplate, CI_TEMPLATES: COPILOT_CI_TEMPLATES, checkAdoptionGate: checkCopilotAdoptionGate } = require('./copilot/premium');
56
+ // Cursor modules
57
+ const { CursorProjectContext } = require('./cursor/context');
58
+ const { CURSOR_MCP_PACKS, recommendCursorMcpPacks } = require('./cursor/mcp-packs');
59
+ const { CURSOR_DOMAIN_PACKS, detectCursorDomainPacks } = require('./cursor/domain-packs');
60
+ const { buildCursorProposalBundle } = require('./cursor/plans');
61
+ const { setupCursor } = require('./cursor/setup');
62
+ const { getCursorGovernanceSummary } = require('./cursor/governance');
63
+ const { getCursorHistory, compareCursorLatest, generateCursorInsights } = require('./cursor/activity');
64
+ const { runCursorDeepReview } = require('./cursor/deep-review');
65
+ const { cursorInteractive } = require('./cursor/interactive');
66
+ const { composePacks: composeCursorPacks, CI_TEMPLATES: CURSOR_CI_TEMPLATES, checkAdoptionGate: checkCursorAdoptionGate } = require('./cursor/premium');
67
+ // Windsurf
68
+ const { WindsurfProjectContext } = require('./windsurf/context');
69
+ const { WINDSURF_DOMAIN_PACKS, detectWindsurfDomainPacks } = require('./windsurf/domain-packs');
70
+ const { WINDSURF_MCP_PACKS } = require('./windsurf/mcp-packs');
71
+ const { setupWindsurf } = require('./windsurf/setup');
72
+ const { getWindsurfGovernanceSummary } = require('./windsurf/governance');
73
+ const { runWindsurfDeepReview } = require('./windsurf/deep-review');
74
+ const { windsurfInteractive } = require('./windsurf/interactive');
75
+ // Aider
76
+ const { AiderProjectContext } = require('./aider/context');
77
+ const { AIDER_DOMAIN_PACKS, detectAiderDomainPacks } = require('./aider/domain-packs');
78
+ const { setupAider } = require('./aider/setup');
79
+ const { getAiderGovernanceSummary } = require('./aider/governance');
80
+ const { runAiderDeepReview } = require('./aider/deep-review');
81
+ const { aiderInteractive } = require('./aider/interactive');
82
+ // OpenCode
83
+ const { OpenCodeProjectContext } = require('./opencode/context');
84
+ const { OPENCODE_DOMAIN_PACKS, detectOpenCodeDomainPacks } = require('./opencode/domain-packs');
85
+ const { OPENCODE_MCP_PACKS } = require('./opencode/mcp-packs');
86
+ const { setupOpenCode } = require('./opencode/setup');
87
+ const { getOpenCodeGovernanceSummary } = require('./opencode/governance');
88
+ const { runOpenCodeDeepReview } = require('./opencode/deep-review');
89
+ const { opencodeInteractive } = require('./opencode/interactive');
90
+
91
+ module.exports = {
92
+ audit,
93
+ setup,
94
+ analyzeProject,
95
+ buildProposalBundle,
96
+ applyProposalBundle,
97
+ getGovernanceSummary,
98
+ runBenchmark,
99
+ DOMAIN_PACKS,
100
+ detectDomainPacks,
101
+ MCP_PACKS,
102
+ getMcpPack,
103
+ mergeMcpServers,
104
+ getMcpPackPreflight,
105
+ recommendMcpPacks,
106
+ recordRecommendationOutcome,
107
+ getRecommendationOutcomeSummary,
108
+ formatRecommendationOutcomeSummary,
109
+ CodexProjectContext,
110
+ detectCodexVersion,
111
+ formatSarif,
112
+ // Codex CP-03: MCP Packs
113
+ CODEX_MCP_PACKS,
114
+ recommendCodexMcpPacks,
115
+ getCodexMcpPreflight,
116
+ mergeCodexMcpToml,
117
+ // Codex CP-05: Proposal Families
118
+ buildCodexProposalBundle,
119
+ // Codex CP-04: Setup Breadth
120
+ setupCodex,
121
+ // Codex CP-06: Repeat-Usage
122
+ getCodexHistory,
123
+ formatCodexHistory,
124
+ compareCodexLatest,
125
+ exportCodexTrendReport,
126
+ recordCodexFeedback,
127
+ formatCodexFeedback,
128
+ generateCodexInsights,
129
+ formatCodexInsights,
130
+ // Codex CP-09: Patch Intelligence
131
+ patchAgentsMd,
132
+ patchConfigToml,
133
+ detectMixedAgentRepo,
134
+ applyPatch,
135
+ // Codex CP-10: Governance
136
+ getCodexGovernanceSummary,
137
+ // Codex CP-12: Freshness
138
+ checkReleaseGate,
139
+ formatReleaseGate,
140
+ getPropagationTargets,
141
+ // Codex CP-13: Deep Review
142
+ runCodexDeepReview,
143
+ collectCodexConfig,
144
+ buildCodexReviewPayload,
145
+ // Codex CP-14: Interactive
146
+ codexInteractive,
147
+ // Codex CP-15: Premium
148
+ composePacks,
149
+ getCiTemplate,
150
+ CI_TEMPLATES,
151
+ checkAdoptionGate,
152
+ // Gemini CLI
153
+ GeminiProjectContext,
154
+ detectGeminiVersion,
155
+ GEMINI_MCP_PACKS,
156
+ recommendGeminiMcpPacks,
157
+ getGeminiMcpPreflight,
158
+ mergeGeminiMcpJson,
159
+ GEMINI_DOMAIN_PACKS,
160
+ detectGeminiDomainPacks,
161
+ buildGeminiProposalBundle,
162
+ setupGemini,
163
+ getGeminiGovernanceSummary,
164
+ getGeminiHistory,
165
+ formatGeminiHistory,
166
+ compareGeminiLatest,
167
+ exportGeminiTrendReport,
168
+ recordGeminiFeedback,
169
+ formatGeminiFeedback,
170
+ generateGeminiInsights,
171
+ formatGeminiInsights,
172
+ patchGeminiMd,
173
+ patchSettingsJson,
174
+ detectMixedAgentRepoGemini,
175
+ checkGeminiReleaseGate,
176
+ formatGeminiReleaseGate,
177
+ runGeminiDeepReview,
178
+ collectGeminiConfig,
179
+ geminiInteractive,
180
+ composeGeminiPacks,
181
+ getGeminiCiTemplate,
182
+ GEMINI_CI_TEMPLATES,
183
+ checkGeminiAdoptionGate,
184
+ // Copilot
185
+ CopilotProjectContext,
186
+ COPILOT_MCP_PACKS,
187
+ recommendCopilotMcpPacks,
188
+ getCopilotMcpPreflight,
189
+ COPILOT_DOMAIN_PACKS,
190
+ detectCopilotDomainPacks,
191
+ buildCopilotProposalBundle,
192
+ setupCopilot,
193
+ getCopilotGovernanceSummary,
194
+ getCopilotHistory,
195
+ formatCopilotHistory,
196
+ compareCopilotLatest,
197
+ exportCopilotTrendReport,
198
+ generateCopilotInsights,
199
+ runCopilotDeepReview,
200
+ copilotInteractive,
201
+ composeCopilotPacks,
202
+ getCopilotCiTemplate,
203
+ COPILOT_CI_TEMPLATES,
204
+ checkCopilotAdoptionGate,
205
+ // Cursor
206
+ CursorProjectContext, CURSOR_MCP_PACKS, recommendCursorMcpPacks,
207
+ CURSOR_DOMAIN_PACKS, detectCursorDomainPacks, buildCursorProposalBundle,
208
+ setupCursor, getCursorGovernanceSummary, getCursorHistory,
209
+ compareCursorLatest, generateCursorInsights, runCursorDeepReview,
210
+ cursorInteractive, composeCursorPacks, CURSOR_CI_TEMPLATES, checkCursorAdoptionGate,
211
+ // Windsurf
212
+ WindsurfProjectContext, WINDSURF_DOMAIN_PACKS, detectWindsurfDomainPacks, WINDSURF_MCP_PACKS,
213
+ setupWindsurf, getWindsurfGovernanceSummary, runWindsurfDeepReview, windsurfInteractive,
214
+ // Aider
215
+ AiderProjectContext, AIDER_DOMAIN_PACKS, detectAiderDomainPacks,
216
+ setupAider, getAiderGovernanceSummary, runAiderDeepReview, aiderInteractive,
217
+ // OpenCode
218
+ OpenCodeProjectContext, OPENCODE_DOMAIN_PACKS, detectOpenCodeDomainPacks, OPENCODE_MCP_PACKS,
219
+ setupOpenCode, getOpenCodeGovernanceSummary, runOpenCodeDeepReview, opencodeInteractive,
220
+ // Harmony (cross-platform)
221
+ ...(() => {
222
+ const { buildCanonicalModel, detectActivePlatforms } = require('./harmony/canon');
223
+ const { detectDrift, formatDriftReport } = require('./harmony/drift');
224
+ const { harmonyAudit, formatHarmonyAuditReport } = require('./harmony/audit');
225
+ const { generateHarmonySync, applyHarmonySync, previewHarmonySync } = require('./harmony/sync');
226
+ const { generateStrategicAdvice, PLATFORM_STRENGTHS } = require('./harmony/advisor');
227
+ const { startHarmonyWatch } = require('./harmony/watch');
228
+ const { saveHarmonyState, loadHarmonyState, getHarmonyHistory } = require('./harmony/memory');
229
+ const { getHarmonyGovernanceSummary, formatHarmonyGovernanceReport } = require('./harmony/governance');
230
+ return {
231
+ buildCanonicalModel, detectActivePlatforms, detectDrift, formatDriftReport,
232
+ harmonyAudit, formatHarmonyAuditReport,
233
+ generateHarmonySync, applyHarmonySync, previewHarmonySync,
234
+ generateStrategicAdvice, PLATFORM_STRENGTHS,
235
+ startHarmonyWatch, saveHarmonyState, loadHarmonyState, getHarmonyHistory,
236
+ getHarmonyGovernanceSummary, formatHarmonyGovernanceReport,
237
+ };
238
+ })(),
239
+ // Synergy (cross-platform amplification)
240
+ ...(() => {
241
+ const { propagateInsight, getCrossLearnings } = require('./synergy/learning');
242
+ const { routeTask, classifyTaskType, PLATFORM_CAPABILITIES } = require('./synergy/routing');
243
+ const { compoundAudit, calculateAmplification } = require('./synergy/evidence');
244
+ const { analyzeCompensation, getUncoveredGaps } = require('./synergy/compensation');
245
+ const { discoverPatterns } = require('./synergy/patterns');
246
+ const { rankRecommendations, calculateSynergyScore } = require('./synergy/ranking');
247
+ const { generateSynergyReport } = require('./synergy/report');
248
+ const { detectProjectChanges, generateAdaptiveUpdates } = require('./synergy/adaptive');
249
+ return {
250
+ propagateInsight, getCrossLearnings, routeTask, classifyTaskType, PLATFORM_CAPABILITIES,
251
+ compoundAudit, calculateAmplification, analyzeCompensation, getUncoveredGaps,
252
+ discoverPatterns, rankRecommendations, calculateSynergyScore,
253
+ generateSynergyReport, detectProjectChanges, generateAdaptiveUpdates,
254
+ };
255
+ })(),
256
+ };