@luquimbo/bi-superpowers 3.1.1 → 4.1.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 (186) hide show
  1. package/.claude-plugin/marketplace.json +5 -3
  2. package/.claude-plugin/plugin.json +28 -2
  3. package/.claude-plugin/skill-manifest.json +22 -6
  4. package/.plugin/plugin.json +1 -1
  5. package/AGENTS.md +52 -36
  6. package/CHANGELOG.md +295 -0
  7. package/README.md +75 -26
  8. package/bin/build-plugin.js +17 -10
  9. package/bin/cli.js +278 -322
  10. package/bin/commands/build-desktop.js +35 -16
  11. package/bin/commands/diff.js +31 -13
  12. package/bin/commands/install.js +93 -72
  13. package/bin/commands/lint.js +40 -26
  14. package/bin/commands/mcp-setup.js +3 -10
  15. package/bin/commands/update-check.js +389 -0
  16. package/bin/lib/agents.js +19 -0
  17. package/bin/lib/generators/claude-plugin.js +144 -6
  18. package/bin/lib/generators/shared.js +29 -33
  19. package/bin/lib/mcp-config.js +191 -16
  20. package/bin/lib/skills.js +115 -27
  21. package/bin/postinstall.js +4 -2
  22. package/bin/utils/mcp-detect.js +2 -2
  23. package/commands/bi-start.md +218 -0
  24. package/commands/pbi-connect.md +43 -65
  25. package/commands/project-kickoff.md +393 -673
  26. package/commands/report-design.md +403 -0
  27. package/desktop-extension/manifest.json +5 -12
  28. package/desktop-extension/server.js +34 -25
  29. package/package.json +6 -10
  30. package/skills/bi-start/SKILL.md +220 -0
  31. package/skills/bi-start/scripts/update-check.js +389 -0
  32. package/skills/pbi-connect/SKILL.md +45 -67
  33. package/skills/pbi-connect/scripts/update-check.js +389 -0
  34. package/skills/project-kickoff/SKILL.md +395 -675
  35. package/skills/project-kickoff/scripts/update-check.js +389 -0
  36. package/skills/report-design/SKILL.md +405 -0
  37. package/skills/report-design/references/cli-commands.md +184 -0
  38. package/skills/report-design/references/cli-setup.md +101 -0
  39. package/skills/report-design/references/close-write-open-pattern.md +80 -0
  40. package/skills/report-design/references/layouts/finance.md +65 -0
  41. package/skills/report-design/references/layouts/generic.md +46 -0
  42. package/skills/report-design/references/layouts/hr.md +48 -0
  43. package/skills/report-design/references/layouts/marketing.md +45 -0
  44. package/skills/report-design/references/layouts/operations.md +44 -0
  45. package/skills/report-design/references/layouts/sales.md +50 -0
  46. package/skills/report-design/references/native-visuals.md +341 -0
  47. package/skills/report-design/references/pbi-desktop-installation.md +87 -0
  48. package/skills/report-design/references/pbir-preview-activation.md +40 -0
  49. package/skills/report-design/references/slicer.md +89 -0
  50. package/skills/report-design/references/textbox.md +101 -0
  51. package/skills/report-design/references/themes/BISuperpowers.json +915 -0
  52. package/skills/report-design/references/troubleshooting.md +135 -0
  53. package/skills/report-design/references/visual-types.md +78 -0
  54. package/skills/report-design/scripts/apply-theme.js +243 -0
  55. package/skills/report-design/scripts/create-visual.js +878 -0
  56. package/skills/report-design/scripts/ensure-pbi-cli.sh +41 -0
  57. package/skills/report-design/scripts/update-check.js +389 -0
  58. package/skills/report-design/scripts/validate-pbir.js +322 -0
  59. package/src/content/base.md +12 -68
  60. package/src/content/mcp-requirements.json +0 -25
  61. package/src/content/routing.md +19 -74
  62. package/src/content/skills/bi-start.md +191 -0
  63. package/src/content/skills/pbi-connect.md +22 -65
  64. package/src/content/skills/project-kickoff.md +372 -673
  65. package/src/content/skills/report-design/SKILL.md +376 -0
  66. package/src/content/skills/report-design/references/cli-commands.md +184 -0
  67. package/src/content/skills/report-design/references/cli-setup.md +101 -0
  68. package/src/content/skills/report-design/references/close-write-open-pattern.md +80 -0
  69. package/src/content/skills/report-design/references/layouts/finance.md +65 -0
  70. package/src/content/skills/report-design/references/layouts/generic.md +46 -0
  71. package/src/content/skills/report-design/references/layouts/hr.md +48 -0
  72. package/src/content/skills/report-design/references/layouts/marketing.md +45 -0
  73. package/src/content/skills/report-design/references/layouts/operations.md +44 -0
  74. package/src/content/skills/report-design/references/layouts/sales.md +50 -0
  75. package/src/content/skills/report-design/references/native-visuals.md +341 -0
  76. package/src/content/skills/report-design/references/pbi-desktop-installation.md +87 -0
  77. package/src/content/skills/report-design/references/pbir-preview-activation.md +40 -0
  78. package/src/content/skills/report-design/references/slicer.md +89 -0
  79. package/src/content/skills/report-design/references/textbox.md +101 -0
  80. package/src/content/skills/report-design/references/themes/BISuperpowers.json +915 -0
  81. package/src/content/skills/report-design/references/troubleshooting.md +135 -0
  82. package/src/content/skills/report-design/references/visual-types.md +78 -0
  83. package/src/content/skills/report-design/scripts/apply-theme.js +243 -0
  84. package/src/content/skills/report-design/scripts/create-visual.js +878 -0
  85. package/src/content/skills/report-design/scripts/ensure-pbi-cli.sh +41 -0
  86. package/src/content/skills/report-design/scripts/validate-pbir.js +322 -0
  87. package/bin/commands/add.js +0 -533
  88. package/bin/commands/add.test.js +0 -77
  89. package/bin/commands/changelog.js +0 -443
  90. package/bin/commands/install.test.js +0 -289
  91. package/bin/commands/lint.test.js +0 -103
  92. package/bin/commands/pull.js +0 -287
  93. package/bin/commands/pull.test.js +0 -36
  94. package/bin/commands/push.js +0 -231
  95. package/bin/commands/push.test.js +0 -14
  96. package/bin/commands/search.js +0 -344
  97. package/bin/commands/search.test.js +0 -115
  98. package/bin/commands/setup.js +0 -545
  99. package/bin/commands/setup.test.js +0 -46
  100. package/bin/commands/sync-profile.js +0 -405
  101. package/bin/commands/sync-profile.test.js +0 -14
  102. package/bin/commands/sync-source.js +0 -418
  103. package/bin/commands/sync-source.test.js +0 -14
  104. package/bin/lib/generators/claude-plugin.test.js +0 -111
  105. package/bin/lib/mcp-config.test.js +0 -310
  106. package/bin/lib/microsoft-mcp.test.js +0 -115
  107. package/bin/utils/errors.js +0 -159
  108. package/bin/utils/git.js +0 -298
  109. package/bin/utils/logger.js +0 -142
  110. package/bin/utils/mcp-detect.test.js +0 -81
  111. package/bin/utils/pbix.js +0 -305
  112. package/bin/utils/pbix.test.js +0 -37
  113. package/bin/utils/profiles.js +0 -312
  114. package/bin/utils/projects.js +0 -169
  115. package/bin/utils/readline.js +0 -206
  116. package/bin/utils/readline.test.js +0 -47
  117. package/bin/utils/tui.test.js +0 -127
  118. package/docs/openrouter-free-models.md +0 -92
  119. package/library/examples/README.md +0 -151
  120. package/library/examples/finance-reporting/README.md +0 -351
  121. package/library/examples/finance-reporting/data-model.md +0 -267
  122. package/library/examples/finance-reporting/measures.dax +0 -557
  123. package/library/examples/hr-analytics/README.md +0 -371
  124. package/library/examples/hr-analytics/data-model.md +0 -315
  125. package/library/examples/hr-analytics/measures.dax +0 -460
  126. package/library/examples/marketing-analytics/README.md +0 -37
  127. package/library/examples/marketing-analytics/data-model.md +0 -62
  128. package/library/examples/marketing-analytics/measures.dax +0 -110
  129. package/library/examples/retail-analytics/README.md +0 -439
  130. package/library/examples/retail-analytics/data-model.md +0 -288
  131. package/library/examples/retail-analytics/measures.dax +0 -481
  132. package/library/examples/supply-chain/README.md +0 -37
  133. package/library/examples/supply-chain/data-model.md +0 -69
  134. package/library/examples/supply-chain/measures.dax +0 -77
  135. package/library/examples/udf-library/README.md +0 -228
  136. package/library/examples/udf-library/functions.dax +0 -571
  137. package/library/snippets/dax/README.md +0 -292
  138. package/library/snippets/dax/business-domains.md +0 -576
  139. package/library/snippets/dax/calculate-patterns.md +0 -276
  140. package/library/snippets/dax/calculation-groups.md +0 -489
  141. package/library/snippets/dax/error-handling.md +0 -495
  142. package/library/snippets/dax/iterators-and-aggregations.md +0 -474
  143. package/library/snippets/dax/kpis-and-metrics.md +0 -293
  144. package/library/snippets/dax/rankings-and-topn.md +0 -235
  145. package/library/snippets/dax/security-patterns.md +0 -413
  146. package/library/snippets/dax/text-and-formatting.md +0 -316
  147. package/library/snippets/dax/time-intelligence.md +0 -196
  148. package/library/snippets/dax/user-defined-functions.md +0 -477
  149. package/library/snippets/dax/virtual-tables.md +0 -546
  150. package/library/snippets/excel-formulas/README.md +0 -84
  151. package/library/snippets/excel-formulas/aggregations.md +0 -330
  152. package/library/snippets/excel-formulas/dates-and-times.md +0 -361
  153. package/library/snippets/excel-formulas/dynamic-arrays.md +0 -314
  154. package/library/snippets/excel-formulas/lookups.md +0 -169
  155. package/library/snippets/excel-formulas/text-functions.md +0 -363
  156. package/library/snippets/governance/naming-conventions.md +0 -97
  157. package/library/snippets/governance/review-checklists.md +0 -107
  158. package/library/snippets/power-query/README.md +0 -389
  159. package/library/snippets/power-query/api-integration.md +0 -707
  160. package/library/snippets/power-query/connections.md +0 -434
  161. package/library/snippets/power-query/data-cleaning.md +0 -298
  162. package/library/snippets/power-query/error-handling.md +0 -526
  163. package/library/snippets/power-query/parameters.md +0 -350
  164. package/library/snippets/power-query/performance.md +0 -506
  165. package/library/snippets/power-query/transformations.md +0 -330
  166. package/library/snippets/report-design/accessibility.md +0 -78
  167. package/library/snippets/report-design/chart-selection.md +0 -54
  168. package/library/snippets/report-design/layout-patterns.md +0 -87
  169. package/library/templates/data-models/README.md +0 -93
  170. package/library/templates/data-models/finance-model.md +0 -627
  171. package/library/templates/data-models/retail-star-schema.md +0 -473
  172. package/library/templates/excel/README.md +0 -83
  173. package/library/templates/excel/budget-tracker.md +0 -432
  174. package/library/templates/excel/data-entry-form.md +0 -533
  175. package/library/templates/power-bi/README.md +0 -72
  176. package/library/templates/power-bi/finance-report.md +0 -449
  177. package/library/templates/power-bi/kpi-scorecard.md +0 -461
  178. package/library/templates/power-bi/sales-dashboard.md +0 -281
  179. package/library/themes/excel/README.md +0 -436
  180. package/library/themes/power-bi/README.md +0 -271
  181. package/library/themes/power-bi/accessible.json +0 -307
  182. package/library/themes/power-bi/bi-superpowers-default.json +0 -858
  183. package/library/themes/power-bi/corporate-blue.json +0 -291
  184. package/library/themes/power-bi/dark-mode.json +0 -291
  185. package/library/themes/power-bi/minimal.json +0 -292
  186. package/library/themes/power-bi/print-friendly.json +0 -309
package/bin/utils/git.js DELETED
@@ -1,298 +0,0 @@
1
- /**
2
- * Git Utilities for BI Agent Superpowers
3
- * =======================================
4
- *
5
- * Provides Git operations for the multi-project repo system.
6
- * Uses simple-git for robust cross-platform Git operations.
7
- *
8
- * @module utils/git
9
- */
10
-
11
- const { execSync, spawnSync } = require('child_process');
12
-
13
- /**
14
- * Check if Git is installed on the system
15
- * @returns {boolean} True if Git is available
16
- */
17
- function isGitInstalled() {
18
- try {
19
- execSync('git --version', { stdio: 'pipe' });
20
- return true;
21
- } catch (e) {
22
- return false;
23
- }
24
- }
25
-
26
- /**
27
- * Check if a directory is a Git repository
28
- * @param {string} dir - Directory path to check
29
- * @returns {boolean} True if directory is a Git repo
30
- */
31
- function isGitRepo(dir) {
32
- try {
33
- const result = spawnSync('git', ['rev-parse', '--git-dir'], {
34
- cwd: dir,
35
- stdio: 'pipe',
36
- });
37
- return result.status === 0;
38
- } catch (e) {
39
- return false;
40
- }
41
- }
42
-
43
- /**
44
- * Initialize a new Git repository
45
- * @param {string} dir - Directory to initialize
46
- * @returns {boolean} True if successful
47
- */
48
- function initRepo(dir) {
49
- try {
50
- const result = spawnSync('git', ['init'], {
51
- cwd: dir,
52
- stdio: 'pipe',
53
- });
54
- return result.status === 0;
55
- } catch (e) {
56
- return false;
57
- }
58
- }
59
-
60
- /**
61
- * Stage files in Git
62
- * @param {string} dir - Repository directory
63
- * @param {string|string[]} files - Files to stage (use '.' for all)
64
- * @returns {boolean} True if successful
65
- */
66
- function stageFiles(dir, files = '.') {
67
- try {
68
- const fileArgs = Array.isArray(files) ? files : [files];
69
- const result = spawnSync('git', ['add', ...fileArgs], {
70
- cwd: dir,
71
- stdio: 'pipe',
72
- });
73
- return result.status === 0;
74
- } catch (e) {
75
- return false;
76
- }
77
- }
78
-
79
- /**
80
- * Create a Git commit
81
- * @param {string} dir - Repository directory
82
- * @param {string} message - Commit message
83
- * @returns {boolean} True if successful
84
- */
85
- function commit(dir, message) {
86
- try {
87
- const result = spawnSync('git', ['commit', '-m', message], {
88
- cwd: dir,
89
- stdio: 'pipe',
90
- });
91
- return result.status === 0;
92
- } catch (e) {
93
- return false;
94
- }
95
- }
96
-
97
- /**
98
- * Get the current branch name
99
- * @param {string} dir - Repository directory
100
- * @returns {string|null} Branch name or null if not in a repo
101
- */
102
- function getCurrentBranch(dir) {
103
- try {
104
- const result = spawnSync('git', ['branch', '--show-current'], {
105
- cwd: dir,
106
- stdio: 'pipe',
107
- });
108
- if (result.status === 0) {
109
- return result.stdout.toString().trim();
110
- }
111
- return null;
112
- } catch (e) {
113
- return null;
114
- }
115
- }
116
-
117
- /**
118
- * Get the status of the repository
119
- * @param {string} dir - Repository directory
120
- * @returns {Object} Status object with modified, staged, untracked files
121
- */
122
- function getStatus(dir) {
123
- try {
124
- const result = spawnSync('git', ['status', '--porcelain'], {
125
- cwd: dir,
126
- stdio: 'pipe',
127
- });
128
-
129
- if (result.status !== 0) {
130
- return { modified: [], staged: [], untracked: [] };
131
- }
132
-
133
- const lines = result.stdout.toString().trim().split('\n').filter(Boolean);
134
- const status = { modified: [], staged: [], untracked: [] };
135
-
136
- for (const line of lines) {
137
- const code = line.substring(0, 2);
138
- const file = line.substring(3);
139
-
140
- if (code.includes('?')) {
141
- status.untracked.push(file);
142
- } else if (code[0] !== ' ') {
143
- status.staged.push(file);
144
- } else if (code[1] !== ' ') {
145
- status.modified.push(file);
146
- }
147
- }
148
-
149
- return status;
150
- } catch (e) {
151
- return { modified: [], staged: [], untracked: [] };
152
- }
153
- }
154
-
155
- /**
156
- * Get commit log
157
- * @param {string} dir - Repository directory
158
- * @param {number} count - Number of commits to retrieve
159
- * @returns {Array} Array of commit objects
160
- */
161
- function getLog(dir, count = 10) {
162
- try {
163
- const result = spawnSync(
164
- 'git',
165
- ['log', `--max-count=${count}`, '--pretty=format:%H|%s|%ai|%an'],
166
- {
167
- cwd: dir,
168
- stdio: 'pipe',
169
- }
170
- );
171
-
172
- if (result.status !== 0) {
173
- return [];
174
- }
175
-
176
- const lines = result.stdout.toString().trim().split('\n').filter(Boolean);
177
- return lines.map((line) => {
178
- const [hash, subject, date, author] = line.split('|');
179
- return { hash, subject, date, author };
180
- });
181
- } catch (e) {
182
- return [];
183
- }
184
- }
185
-
186
- /**
187
- * Check if there are uncommitted changes
188
- * @param {string} dir - Repository directory
189
- * @returns {boolean} True if there are uncommitted changes
190
- */
191
- function hasUncommittedChanges(dir) {
192
- const status = getStatus(dir);
193
- return status.modified.length > 0 || status.staged.length > 0 || status.untracked.length > 0;
194
- }
195
-
196
- /**
197
- * Checkout a specific commit or branch
198
- * @param {string} dir - Repository directory
199
- * @param {string} ref - Reference to checkout (commit hash, branch, tag)
200
- * @returns {boolean} True if successful
201
- */
202
- function checkout(dir, ref) {
203
- try {
204
- const result = spawnSync('git', ['checkout', ref], {
205
- cwd: dir,
206
- stdio: 'pipe',
207
- });
208
- return result.status === 0;
209
- } catch (e) {
210
- return false;
211
- }
212
- }
213
-
214
- /**
215
- * Get diff between two commits or current changes
216
- * @param {string} dir - Repository directory
217
- * @param {string} from - Starting reference (optional)
218
- * @param {string} to - Ending reference (optional)
219
- * @returns {string} Diff output
220
- */
221
- function getDiff(dir, from = null, to = null) {
222
- try {
223
- const args = ['diff'];
224
- if (from) args.push(from);
225
- if (to) args.push(to);
226
-
227
- const result = spawnSync('git', args, {
228
- cwd: dir,
229
- stdio: 'pipe',
230
- });
231
-
232
- return result.stdout.toString();
233
- } catch (e) {
234
- return '';
235
- }
236
- }
237
-
238
- /**
239
- * Execute a raw Git command and return output
240
- * @param {string} dir - Repository directory
241
- * @param {string[]} args - Git command arguments
242
- * @returns {string|null} Command output or null on failure
243
- */
244
- function execGitCommand(dir, args) {
245
- try {
246
- const result = spawnSync('git', args, {
247
- cwd: dir,
248
- stdio: 'pipe',
249
- maxBuffer: 1024 * 1024 * 10, // 10MB buffer for large outputs
250
- });
251
-
252
- if (result.status === 0) {
253
- return result.stdout.toString();
254
- }
255
- return null;
256
- } catch (e) {
257
- return null;
258
- }
259
- }
260
-
261
- /**
262
- * Get file modification date from last commit
263
- * @param {string} dir - Repository directory
264
- * @param {string} filePath - Path to file relative to repo root
265
- * @returns {Date|null} Last modification date or null
266
- */
267
- function getFileLastModified(dir, filePath) {
268
- try {
269
- const result = spawnSync('git', ['log', '-1', '--format=%ai', '--', filePath], {
270
- cwd: dir,
271
- stdio: 'pipe',
272
- });
273
-
274
- if (result.status === 0) {
275
- const dateStr = result.stdout.toString().trim();
276
- return dateStr ? new Date(dateStr) : null;
277
- }
278
- return null;
279
- } catch (e) {
280
- return null;
281
- }
282
- }
283
-
284
- module.exports = {
285
- isGitInstalled,
286
- isGitRepo,
287
- initRepo,
288
- stageFiles,
289
- commit,
290
- getCurrentBranch,
291
- getStatus,
292
- getLog,
293
- hasUncommittedChanges,
294
- checkout,
295
- getDiff,
296
- execGitCommand,
297
- getFileLastModified,
298
- };
@@ -1,142 +0,0 @@
1
- /**
2
- * Logger Utility
3
- * ===============
4
- *
5
- * Standardized logging for the CLI with log levels.
6
- * Respects LOG_LEVEL environment variable.
7
- *
8
- * Usage:
9
- * const logger = require('./utils/logger');
10
- * logger.debug('Debug message', { context: 'optional' });
11
- * logger.info('Info message');
12
- * logger.warn('Warning message');
13
- * logger.error('Error message');
14
- *
15
- * Environment:
16
- * LOG_LEVEL=debug|info|warn|error (default: info)
17
- * DEBUG=true (shorthand for LOG_LEVEL=debug)
18
- *
19
- * @module utils/logger
20
- */
21
-
22
- const LOG_LEVELS = {
23
- debug: 0,
24
- info: 1,
25
- warn: 2,
26
- error: 3,
27
- silent: 4,
28
- };
29
-
30
- /**
31
- * Get current log level from environment
32
- * @returns {string} Current log level
33
- */
34
- function getCurrentLevel() {
35
- if (process.env.DEBUG === 'true') {
36
- return 'debug';
37
- }
38
- return process.env.LOG_LEVEL || 'info';
39
- }
40
-
41
- /**
42
- * Check if a log level should be shown
43
- * @param {string} level - Level to check
44
- * @returns {boolean} Whether to show this level
45
- */
46
- function shouldLog(level) {
47
- const currentLevel = getCurrentLevel();
48
- return LOG_LEVELS[level] >= LOG_LEVELS[currentLevel];
49
- }
50
-
51
- /**
52
- * Format a log message with optional context
53
- * @param {string} prefix - Log level prefix
54
- * @param {string} message - Log message
55
- * @param {Object|null} context - Optional context object
56
- * @returns {string} Formatted message
57
- */
58
- function formatMessage(prefix, message, context) {
59
- let formatted = `[${prefix}] ${message}`;
60
- if (context !== null && context !== undefined) {
61
- if (typeof context === 'object') {
62
- formatted += ` ${JSON.stringify(context)}`;
63
- } else {
64
- formatted += ` ${context}`;
65
- }
66
- }
67
- return formatted;
68
- }
69
-
70
- /**
71
- * Debug level logging
72
- * Only shown when LOG_LEVEL=debug or DEBUG=true
73
- * @param {string} message - Log message
74
- * @param {Object|null} context - Optional context
75
- */
76
- function debug(message, context = null) {
77
- if (shouldLog('debug')) {
78
- console.log(formatMessage('DEBUG', message, context));
79
- }
80
- }
81
-
82
- /**
83
- * Info level logging
84
- * Standard informational messages
85
- * @param {string} message - Log message
86
- * @param {Object|null} context - Optional context
87
- */
88
- function info(message, context = null) {
89
- if (shouldLog('info')) {
90
- console.log(formatMessage('INFO', message, context));
91
- }
92
- }
93
-
94
- /**
95
- * Warning level logging
96
- * Non-critical issues that should be noticed
97
- * @param {string} message - Log message
98
- * @param {Object|null} context - Optional context
99
- */
100
- function warn(message, context = null) {
101
- if (shouldLog('warn')) {
102
- console.warn(formatMessage('WARN', message, context));
103
- }
104
- }
105
-
106
- /**
107
- * Error level logging
108
- * Critical errors that affect operation
109
- * @param {string} message - Log message
110
- * @param {Object|null} context - Optional context
111
- */
112
- function error(message, context = null) {
113
- if (shouldLog('error')) {
114
- console.error(formatMessage('ERROR', message, context));
115
- }
116
- }
117
-
118
- /**
119
- * Create a child logger with a prefix
120
- * Useful for module-specific logging
121
- * @param {string} prefix - Prefix for all messages
122
- * @returns {Object} Logger instance with prefix
123
- */
124
- function createLogger(prefix) {
125
- return {
126
- debug: (msg, ctx) => debug(`[${prefix}] ${msg}`, ctx),
127
- info: (msg, ctx) => info(`[${prefix}] ${msg}`, ctx),
128
- warn: (msg, ctx) => warn(`[${prefix}] ${msg}`, ctx),
129
- error: (msg, ctx) => error(`[${prefix}] ${msg}`, ctx),
130
- };
131
- }
132
-
133
- module.exports = {
134
- LOG_LEVELS,
135
- debug,
136
- info,
137
- warn,
138
- error,
139
- createLogger,
140
- getCurrentLevel,
141
- shouldLog,
142
- };
@@ -1,81 +0,0 @@
1
- /**
2
- * Tests for MCP Detection Utilities
3
- * @module utils/mcp-detect.test
4
- */
5
-
6
- const { test, describe } = require('node:test');
7
- const assert = require('node:assert');
8
-
9
- const mcpDetect = require('./mcp-detect');
10
-
11
- describe('MCP Detection Utilities', () => {
12
- test('exports expected functions', () => {
13
- assert.strictEqual(typeof mcpDetect.findLocalMcp, 'function');
14
- assert.strictEqual(typeof mcpDetect.getMcpVersion, 'function');
15
- assert.strictEqual(typeof mcpDetect.getMcpStatus, 'function');
16
- assert.strictEqual(typeof mcpDetect.getInstallInstructions, 'function');
17
- assert.strictEqual(typeof mcpDetect.generateMcpConfig, 'function');
18
- assert.strictEqual(typeof mcpDetect.getExplicitMcpPath, 'function');
19
- assert.strictEqual(typeof mcpDetect.getModelingMcpError, 'function');
20
- });
21
-
22
- test('exports env vars for local MCP path override', () => {
23
- assert.ok(Array.isArray(mcpDetect.MODELING_MCP_ENV_VARS));
24
- assert.ok(mcpDetect.MODELING_MCP_ENV_VARS.includes('BI_SUPERPOWERS_POWERBI_MODELING_MCP_PATH'));
25
- });
26
- });
27
-
28
- describe('getMcpStatus', () => {
29
- test('returns expected structure for the local MCP only', () => {
30
- const status = mcpDetect.getMcpStatus();
31
-
32
- assert.ok(status.local);
33
- assert.ok('installed' in status.local);
34
- assert.ok('path' in status.local);
35
- assert.ok('version' in status.local);
36
- assert.ok('platform' in status.local);
37
- assert.ok('available' in status.local);
38
- assert.ok(Array.isArray(status.local.envVars));
39
- });
40
- });
41
-
42
- describe('getInstallInstructions', () => {
43
- test('returns expected structure', () => {
44
- const instructions = mcpDetect.getInstallInstructions();
45
-
46
- assert.ok(instructions.title);
47
- assert.ok(Array.isArray(instructions.options));
48
- assert.ok(instructions.options.length > 0);
49
-
50
- instructions.options.forEach((option) => {
51
- assert.ok(option.name);
52
- assert.ok(Array.isArray(option.steps));
53
- assert.ok(option.link);
54
- });
55
- });
56
- });
57
-
58
- describe('generateMcpConfig', () => {
59
- test('generates plugin format with 2 official Microsoft MCPs', () => {
60
- const config = mcpDetect.generateMcpConfig({}, 'plugin');
61
-
62
- assert.ok(config['powerbi-modeling-mcp']);
63
- assert.ok(config['microsoft-learn']);
64
- assert.strictEqual(Object.keys(config).length, 2);
65
-
66
- assert.strictEqual(config['powerbi-modeling-mcp'].type, 'stdio');
67
- assert.strictEqual(config['powerbi-modeling-mcp'].command, 'node');
68
- assert.ok(config['powerbi-modeling-mcp'].args[0].includes('powerbi-modeling-launcher.js'));
69
-
70
- assert.strictEqual(config['microsoft-learn'].type, 'http');
71
- assert.strictEqual(config['microsoft-learn'].url, 'https://learn.microsoft.com/api/mcp');
72
- });
73
-
74
- test('generates claude format with nested mcpServers object', () => {
75
- const config = mcpDetect.generateMcpConfig({}, 'claude');
76
-
77
- assert.ok(config.mcpServers);
78
- assert.ok(config.mcpServers['powerbi-modeling-mcp']);
79
- assert.ok(config.mcpServers['microsoft-learn']);
80
- });
81
- });