fraim-framework 2.0.56 → 2.0.58

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 (224) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/bin/fraim-mcp.js +14 -0
  3. package/bin/fraim.js +23 -0
  4. package/dist/src/cli/commands/init-project.js +10 -4
  5. package/dist/src/cli/commands/mcp.js +65 -0
  6. package/dist/src/cli/setup/mcp-config-generator.js +19 -16
  7. package/dist/src/fraim/issue-tracking/ado-provider.js +304 -0
  8. package/dist/src/fraim/issue-tracking/factory.js +63 -0
  9. package/dist/src/fraim/issue-tracking/github-provider.js +200 -0
  10. package/dist/src/fraim/issue-tracking/types.js +7 -0
  11. package/dist/src/fraim/issue-tracking-config.js +83 -0
  12. package/dist/src/local-mcp-server/stdio-server.js +207 -0
  13. package/dist/src/utils/workflow-parser.js +81 -0
  14. package/package.json +17 -12
  15. package/registry/scripts/pdf-styles.css +172 -0
  16. package/registry/scripts/prep-issue.sh +46 -4
  17. package/registry/scripts/profile-server.ts +131 -130
  18. package/registry/stubs/workflows/customer-development/user-survey-dispatch.md +1 -1
  19. package/registry/stubs/workflows/customer-development/users-to-target.md +1 -1
  20. package/registry/stubs/workflows/product-building/design.md +1 -1
  21. package/registry/stubs/workflows/product-building/implement.md +1 -1
  22. package/Claude.md +0 -1
  23. package/dist/registry/ai-manager-rules/customer-development-phases/phase1-customer-profiling.md +0 -101
  24. package/dist/registry/ai-manager-rules/customer-development-phases/phase2-platform-discovery.md +0 -235
  25. package/dist/registry/ai-manager-rules/customer-development-phases/phase3-prospect-qualification.md +0 -243
  26. package/dist/registry/ai-manager-rules/customer-development-phases/phase4-inventory-compilation.md +0 -206
  27. package/dist/registry/ai-manager-rules/design-phases/design-completeness-review.md +0 -73
  28. package/dist/registry/ai-manager-rules/design-phases/design-design.md +0 -145
  29. package/dist/registry/ai-manager-rules/implement-phases/implement-code.md +0 -283
  30. package/dist/registry/ai-manager-rules/implement-phases/implement-completeness-review.md +0 -120
  31. package/dist/registry/ai-manager-rules/implement-phases/implement-regression.md +0 -173
  32. package/dist/registry/ai-manager-rules/implement-phases/implement-repro.md +0 -104
  33. package/dist/registry/ai-manager-rules/implement-phases/implement-scoping.md +0 -100
  34. package/dist/registry/ai-manager-rules/implement-phases/implement-smoke.md +0 -237
  35. package/dist/registry/ai-manager-rules/implement-phases/implement-spike.md +0 -121
  36. package/dist/registry/ai-manager-rules/implement-phases/implement-validate.md +0 -375
  37. package/dist/registry/ai-manager-rules/retrospective.md +0 -116
  38. package/dist/registry/ai-manager-rules/shared-phases/address-pr-feedback.md +0 -188
  39. package/dist/registry/ai-manager-rules/shared-phases/submit-pr.md +0 -202
  40. package/dist/registry/ai-manager-rules/shared-phases/wait-for-pr-review.md +0 -170
  41. package/dist/registry/ai-manager-rules/spec-phases/spec-competitor-analysis.md +0 -105
  42. package/dist/registry/ai-manager-rules/spec-phases/spec-completeness-review.md +0 -66
  43. package/dist/registry/ai-manager-rules/spec-phases/spec-spec.md +0 -139
  44. package/dist/registry/ai-manager-rules/user-survey-phases/phase1-survey-scoping.md +0 -60
  45. package/dist/registry/ai-manager-rules/user-survey-phases/phase2-survey-build-linkedin.md +0 -23
  46. package/dist/registry/ai-manager-rules/user-survey-phases/phase3-survey-build-reddit.md +0 -22
  47. package/dist/registry/ai-manager-rules/user-survey-phases/phase4-survey-build-x.md +0 -21
  48. package/dist/registry/ai-manager-rules/user-survey-phases/phase5-survey-build-facebook.md +0 -19
  49. package/dist/registry/ai-manager-rules/user-survey-phases/phase6-survey-build-custom.md +0 -15
  50. package/dist/registry/ai-manager-rules/user-survey-phases/phase7-survey-dispatch.md +0 -45
  51. package/dist/registry/providers/ado.json +0 -19
  52. package/dist/registry/providers/github.json +0 -19
  53. package/dist/registry/scripts/cleanup-branch.js +0 -287
  54. package/dist/registry/scripts/evaluate-code-quality.js +0 -66
  55. package/dist/registry/scripts/exec-with-timeout.js +0 -142
  56. package/dist/registry/scripts/generate-engagement-emails.js +0 -705
  57. package/dist/registry/scripts/newsletter-helpers.js +0 -671
  58. package/dist/registry/scripts/profile-server.js +0 -388
  59. package/dist/registry/scripts/run-thank-you-workflow.js +0 -92
  60. package/dist/registry/scripts/send-newsletter-simple.js +0 -85
  61. package/dist/registry/scripts/send-thank-you-emails.js +0 -54
  62. package/dist/registry/scripts/validate-openapi-limits.js +0 -311
  63. package/dist/registry/scripts/validate-test-coverage.js +0 -262
  64. package/dist/registry/scripts/verify-test-coverage.js +0 -66
  65. package/dist/registry/templates/bootstrap/ARCHITECTURE-TEMPLATE.md +0 -53
  66. package/dist/registry/templates/bootstrap/CODE-QUALITY-REPORT-TEMPLATE.md +0 -37
  67. package/dist/registry/templates/bootstrap/TEST-COVERAGE-REPORT-TEMPLATE.md +0 -35
  68. package/dist/registry/templates/business-development/IDEATION-REPORT-TEMPLATE.md +0 -29
  69. package/dist/registry/templates/business-development/PRICING-STRATEGY-TEMPLATE.md +0 -126
  70. package/dist/registry/templates/customer-development/customer-interview-template.md +0 -99
  71. package/dist/registry/templates/customer-development/customer-persona-template.md +0 -69
  72. package/dist/registry/templates/customer-development/follow-up-email-templates.md +0 -132
  73. package/dist/registry/templates/customer-development/insight-analysis-template.md +0 -74
  74. package/dist/registry/templates/customer-development/prospect-inventory-template.csv +0 -3
  75. package/dist/registry/templates/customer-development/search-strategy-template.md +0 -123
  76. package/dist/registry/templates/customer-development/strategic-recommendations-template.md +0 -53
  77. package/dist/registry/templates/customer-development/thank-you-email-template.html +0 -124
  78. package/dist/registry/templates/customer-development/thank-you-note-template.md +0 -16
  79. package/dist/registry/templates/customer-development/triage-log-template.md +0 -278
  80. package/dist/registry/templates/customer-development/weekly-newsletter-template.html +0 -204
  81. package/dist/registry/templates/evidence/Design-Evidence.md +0 -30
  82. package/dist/registry/templates/evidence/Implementation-BugEvidence.md +0 -94
  83. package/dist/registry/templates/evidence/Implementation-FeatureEvidence.md +0 -129
  84. package/dist/registry/templates/evidence/Spec-Evidence.md +0 -19
  85. package/dist/registry/templates/help/HelpNeeded.md +0 -14
  86. package/dist/registry/templates/legal/NDA-TEMPLATE.md +0 -170
  87. package/dist/registry/templates/legal/PATENT-TEMPLATE.md +0 -372
  88. package/dist/registry/templates/legal/TRADEMARK-TEMPLATE.md +0 -339
  89. package/dist/registry/templates/legal/contract-review-checklist.md +0 -193
  90. package/dist/registry/templates/legal/review-report-template.md +0 -198
  91. package/dist/registry/templates/legal/saas-terms-template.md +0 -174
  92. package/dist/registry/templates/legal/sow-template.md +0 -117
  93. package/dist/registry/templates/legal/template-variables.md +0 -131
  94. package/dist/registry/templates/marketing/DOMAIN-REGISTRATION-TEMPLATE.md +0 -194
  95. package/dist/registry/templates/marketing/HBR-ARTICLE-TEMPLATE.md +0 -66
  96. package/dist/registry/templates/marketing/STORYTELLING-TEMPLATE.md +0 -130
  97. package/dist/registry/templates/marketing/WEBSITE-TEMPLATE.md +0 -262
  98. package/dist/registry/templates/marketing/github-pages-workflow.yml +0 -64
  99. package/dist/registry/templates/replicate/implementation-checklist.md +0 -39
  100. package/dist/registry/templates/replicate/use-cases-template.md +0 -88
  101. package/dist/registry/templates/retrospective/RETROSPECTIVE-TEMPLATE.md +0 -55
  102. package/dist/registry/templates/specs/BUGSPEC-TEMPLATE.md +0 -37
  103. package/dist/registry/templates/specs/FEATURESPEC-TEMPLATE.md +0 -66
  104. package/dist/registry/templates/specs/TECHSPEC-TEMPLATE.md +0 -39
  105. package/dist/registry/workflows/bootstrap/create-architecture.md +0 -38
  106. package/dist/registry/workflows/bootstrap/detect-broken-windows.md +0 -300
  107. package/dist/registry/workflows/bootstrap/evaluate-code-quality.md +0 -35
  108. package/dist/registry/workflows/bootstrap/verify-test-coverage.md +0 -36
  109. package/dist/registry/workflows/brainstorming/blue-sky-brainstorming.md +0 -211
  110. package/dist/registry/workflows/brainstorming/codebase-brainstorming.md +0 -165
  111. package/dist/registry/workflows/business-development/create-business-plan.md +0 -737
  112. package/dist/registry/workflows/business-development/ideate-business-opportunity.md +0 -55
  113. package/dist/registry/workflows/business-development/price-product.md +0 -325
  114. package/dist/registry/workflows/compliance/detect-compliance-requirements.md +0 -78
  115. package/dist/registry/workflows/compliance/generate-audit-evidence.md +0 -75
  116. package/dist/registry/workflows/compliance/soc2-evidence-generator.md +0 -332
  117. package/dist/registry/workflows/customer-development/insight-analysis.md +0 -156
  118. package/dist/registry/workflows/customer-development/insight-triage.md +0 -938
  119. package/dist/registry/workflows/customer-development/interview-preparation.md +0 -452
  120. package/dist/registry/workflows/customer-development/linkedin-outreach.md +0 -593
  121. package/dist/registry/workflows/customer-development/strategic-brainstorming.md +0 -146
  122. package/dist/registry/workflows/customer-development/thank-customers.md +0 -203
  123. package/dist/registry/workflows/customer-development/user-survey-dispatch.md +0 -60
  124. package/dist/registry/workflows/customer-development/users-to-target.md +0 -112
  125. package/dist/registry/workflows/customer-development/weekly-newsletter.md +0 -366
  126. package/dist/registry/workflows/deploy/cloud-deployment.md +0 -310
  127. package/dist/registry/workflows/improve-fraim/contribute.md +0 -32
  128. package/dist/registry/workflows/improve-fraim/file-issue.md +0 -32
  129. package/dist/registry/workflows/learning/build-skillset.md +0 -212
  130. package/dist/registry/workflows/learning/synthesize-learnings.md +0 -284
  131. package/dist/registry/workflows/legal/contract-review-analysis.md +0 -382
  132. package/dist/registry/workflows/legal/nda.md +0 -69
  133. package/dist/registry/workflows/legal/patent-filing.md +0 -76
  134. package/dist/registry/workflows/legal/saas-contract-development.md +0 -213
  135. package/dist/registry/workflows/legal/trademark-filing.md +0 -77
  136. package/dist/registry/workflows/marketing/content-creation.md +0 -37
  137. package/dist/registry/workflows/marketing/convert-to-pdf.md +0 -235
  138. package/dist/registry/workflows/marketing/create-modern-website.md +0 -456
  139. package/dist/registry/workflows/marketing/domain-registration.md +0 -323
  140. package/dist/registry/workflows/marketing/hbr-article.md +0 -73
  141. package/dist/registry/workflows/marketing/launch-checklist.md +0 -37
  142. package/dist/registry/workflows/marketing/marketing-strategy.md +0 -45
  143. package/dist/registry/workflows/marketing/storytelling.md +0 -65
  144. package/dist/registry/workflows/performance/analyze-performance.md +0 -65
  145. package/dist/registry/workflows/product-building/design.md +0 -103
  146. package/dist/registry/workflows/product-building/implement.md +0 -74
  147. package/dist/registry/workflows/product-building/iterate-on-pr-comments.md +0 -70
  148. package/dist/registry/workflows/product-building/prep-issue.md +0 -41
  149. package/dist/registry/workflows/product-building/prototype.md +0 -65
  150. package/dist/registry/workflows/product-building/resolve.md +0 -168
  151. package/dist/registry/workflows/product-building/retrospect.md +0 -86
  152. package/dist/registry/workflows/product-building/spec.md +0 -181
  153. package/dist/registry/workflows/product-building/test.md +0 -125
  154. package/dist/registry/workflows/productivity-report/productivity-report.md +0 -263
  155. package/dist/registry/workflows/quality-assurance/browser-validation.md +0 -221
  156. package/dist/registry/workflows/quality-assurance/iterative-improvement-cycle.md +0 -562
  157. package/dist/registry/workflows/replicate/replicate-discovery.md +0 -336
  158. package/dist/registry/workflows/replicate/replicate-to-issues.md +0 -324
  159. package/dist/registry/workflows/reviewer/review-implementation-vs-design-spec.md +0 -638
  160. package/dist/registry/workflows/reviewer/review-implementation-vs-feature-spec.md +0 -675
  161. package/dist/registry/workflows/startup-credits/aws-activate-application.md +0 -535
  162. package/dist/registry/workflows/startup-credits/google-cloud-application.md +0 -647
  163. package/dist/registry/workflows/startup-credits/microsoft-azure-application.md +0 -538
  164. package/dist/scripts/build-stub-registry.js +0 -108
  165. package/dist/src/ai-manager/ai-manager.js +0 -480
  166. package/dist/src/ai-manager/phase-flow.js +0 -357
  167. package/dist/src/ai-manager/types.js +0 -5
  168. package/dist/src/fraim-mcp-server.js +0 -1885
  169. package/dist/tests/debug-tools.js +0 -80
  170. package/dist/tests/shared-server-utils.js +0 -57
  171. package/dist/tests/test-add-ide.js +0 -283
  172. package/dist/tests/test-ai-coach-edge-cases.js +0 -420
  173. package/dist/tests/test-ai-coach-mcp-integration.js +0 -450
  174. package/dist/tests/test-ai-coach-performance.js +0 -328
  175. package/dist/tests/test-ai-coach-phase-content.js +0 -264
  176. package/dist/tests/test-ai-coach-workflows.js +0 -514
  177. package/dist/tests/test-cli.js +0 -228
  178. package/dist/tests/test-client-scripts-validation.js +0 -167
  179. package/dist/tests/test-complete-setup-flow.js +0 -110
  180. package/dist/tests/test-config-system.js +0 -279
  181. package/dist/tests/test-debug-session.js +0 -134
  182. package/dist/tests/test-end-to-end-hybrid-validation.js +0 -328
  183. package/dist/tests/test-enhanced-session-init.js +0 -188
  184. package/dist/tests/test-first-run-journey.js +0 -368
  185. package/dist/tests/test-fraim-issues.js +0 -59
  186. package/dist/tests/test-genericization.js +0 -44
  187. package/dist/tests/test-hybrid-script-execution.js +0 -340
  188. package/dist/tests/test-ide-detector.js +0 -46
  189. package/dist/tests/test-improved-setup.js +0 -121
  190. package/dist/tests/test-mcp-config-generator.js +0 -99
  191. package/dist/tests/test-mcp-connection.js +0 -107
  192. package/dist/tests/test-mcp-issue-integration.js +0 -156
  193. package/dist/tests/test-mcp-lifecycle-methods.js +0 -240
  194. package/dist/tests/test-mcp-shared-server.js +0 -308
  195. package/dist/tests/test-mcp-template-processing.js +0 -160
  196. package/dist/tests/test-modular-issue-tracking.js +0 -165
  197. package/dist/tests/test-node-compatibility.js +0 -95
  198. package/dist/tests/test-npm-install.js +0 -68
  199. package/dist/tests/test-package-size.js +0 -108
  200. package/dist/tests/test-pr-review-workflow.js +0 -307
  201. package/dist/tests/test-prep-issue.js +0 -129
  202. package/dist/tests/test-productivity-integration.js +0 -157
  203. package/dist/tests/test-script-location-independence.js +0 -198
  204. package/dist/tests/test-script-sync.js +0 -557
  205. package/dist/tests/test-server-utils.js +0 -32
  206. package/dist/tests/test-session-rehydration.js +0 -148
  207. package/dist/tests/test-setup-integration.js +0 -98
  208. package/dist/tests/test-setup-scenarios.js +0 -322
  209. package/dist/tests/test-standalone.js +0 -143
  210. package/dist/tests/test-stub-registry.js +0 -136
  211. package/dist/tests/test-sync-stubs.js +0 -143
  212. package/dist/tests/test-sync-version-update.js +0 -93
  213. package/dist/tests/test-telemetry.js +0 -193
  214. package/dist/tests/test-token-validator.js +0 -30
  215. package/dist/tests/test-user-journey.js +0 -236
  216. package/dist/tests/test-users-to-target-workflow.js +0 -253
  217. package/dist/tests/test-utils.js +0 -109
  218. package/dist/tests/test-wizard.js +0 -71
  219. package/dist/tests/test-workflow-discovery.js +0 -242
  220. package/labels.json +0 -52
  221. package/registry/agent-guardrails.md +0 -63
  222. package/registry/fraim.md +0 -48
  223. package/setup.js +0 -171
  224. package/tsconfig.json +0 -23
@@ -1,340 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- var __importDefault = (this && this.__importDefault) || function (mod) {
36
- return (mod && mod.__esModule) ? mod : { "default": mod };
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- const test_utils_1 = require("./test-utils");
40
- const node_assert_1 = __importDefault(require("node:assert"));
41
- const fs_1 = __importDefault(require("fs"));
42
- const path_1 = __importDefault(require("path"));
43
- const os_1 = __importDefault(require("os"));
44
- async function testSelfContainedScriptDetection() {
45
- console.log(' 🚀 Testing Self-Contained Script Detection...');
46
- const tempDir = fs_1.default.mkdtempSync(path_1.default.join(os_1.default.tmpdir(), 'fraim-hybrid-test-'));
47
- const scriptsDir = path_1.default.join(tempDir, 'scripts');
48
- fs_1.default.mkdirSync(scriptsDir, { recursive: true });
49
- try {
50
- // Create a self-contained shell script
51
- const shellScript = `#!/bin/bash
52
- set -e
53
- echo "This is a self-contained shell script"
54
- echo "Working directory: $(pwd)"
55
- `;
56
- fs_1.default.writeFileSync(path_1.default.join(scriptsDir, 'self-contained.sh'), shellScript);
57
- // Create a self-contained TypeScript script (no relative imports)
58
- const selfContainedTS = `#!/usr/bin/env node
59
- console.log('This is a self-contained TypeScript script');
60
- console.log('Working directory:', process.cwd());
61
- `;
62
- fs_1.default.writeFileSync(path_1.default.join(scriptsDir, 'self-contained.ts'), selfContainedTS);
63
- // Create a dependent TypeScript script (has relative imports to src/)
64
- const dependentTS = `#!/usr/bin/env node
65
- import { loadFraimConfig } from '../../src/fraim/config-loader';
66
- import { someUtility } from '../../src/utils/helper';
67
-
68
- const config = loadFraimConfig();
69
- console.log('This script depends on FRAIM source code');
70
- `;
71
- fs_1.default.writeFileSync(path_1.default.join(scriptsDir, 'dependent.ts'), dependentTS);
72
- // Create another dependent script with require syntax
73
- const dependentJS = `#!/usr/bin/env node
74
- const { loadFraimConfig } = require('../../src/fraim/config-loader');
75
- const helper = require('../../src/utils/helper');
76
-
77
- console.log('This script also depends on FRAIM source code');
78
- `;
79
- fs_1.default.writeFileSync(path_1.default.join(scriptsDir, 'dependent.js'), dependentJS);
80
- // Test the sync logic - all scripts should be synced now
81
- const { getRegistryScripts } = await Promise.resolve().then(() => __importStar(require('../src/utils/script-sync-utils')));
82
- // Test batch detection - should get all scripts
83
- const allScripts = getRegistryScripts(tempDir);
84
- node_assert_1.default.strictEqual(allScripts.length, 4, 'Should find all 4 scripts');
85
- // Verify all scripts are included
86
- const scriptNames = allScripts.map(p => path_1.default.basename(p)).sort();
87
- node_assert_1.default.deepStrictEqual(scriptNames, ['dependent.js', 'dependent.ts', 'self-contained.sh', 'self-contained.ts'], 'All scripts should be included');
88
- console.log(' ✅ Script sync detection verified!');
89
- return true;
90
- }
91
- catch (error) {
92
- console.error(' ❌ Script detection test failed:', error);
93
- return false;
94
- }
95
- finally {
96
- try {
97
- fs_1.default.rmSync(tempDir, { recursive: true, force: true });
98
- }
99
- catch (e) { }
100
- }
101
- }
102
- async function testHybridSyncBehavior() {
103
- console.log(' 🚀 Testing Hybrid Sync Behavior...');
104
- const tempDir = fs_1.default.mkdtempSync(path_1.default.join(os_1.default.tmpdir(), 'fraim-hybrid-sync-test-'));
105
- const userFraimDir = path_1.default.join(os_1.default.homedir(), '.fraim-hybrid-test');
106
- const userScriptsDir = path_1.default.join(userFraimDir, 'scripts');
107
- try {
108
- // Clean up any existing test user directory
109
- if (fs_1.default.existsSync(userFraimDir)) {
110
- fs_1.default.rmSync(userFraimDir, { recursive: true, force: true });
111
- }
112
- // Set up test registry with mixed scripts
113
- const registryDir = path_1.default.join(tempDir, 'registry');
114
- const scriptsDir = path_1.default.join(registryDir, 'scripts');
115
- fs_1.default.mkdirSync(scriptsDir, { recursive: true });
116
- // Create self-contained scripts
117
- const shellScript = `#!/bin/bash
118
- echo "Self-contained shell script"
119
- `;
120
- fs_1.default.writeFileSync(path_1.default.join(scriptsDir, 'shell-script.sh'), shellScript);
121
- const selfContainedTS = `#!/usr/bin/env node
122
- console.log('Self-contained TypeScript script');
123
- `;
124
- fs_1.default.writeFileSync(path_1.default.join(scriptsDir, 'self-contained.ts'), selfContainedTS);
125
- // Create dependent scripts
126
- const dependentTS = `#!/usr/bin/env node
127
- import { loadFraimConfig } from '../../src/fraim/config-loader';
128
- console.log('Dependent TypeScript script');
129
- `;
130
- fs_1.default.writeFileSync(path_1.default.join(scriptsDir, 'dependent.ts'), dependentTS);
131
- // Test sync behavior
132
- const { syncScriptsToUserDirectory } = await Promise.resolve().then(() => __importStar(require('../src/utils/script-sync-utils')));
133
- // Override user directory for testing
134
- process.env.FRAIM_USER_DIR = userFraimDir;
135
- const syncResult = syncScriptsToUserDirectory(registryDir);
136
- // Verify sync results - now all scripts are synced
137
- node_assert_1.default.strictEqual(syncResult.synced, 3, 'Should sync all 3 scripts');
138
- node_assert_1.default.strictEqual(syncResult.ephemeral, 0, 'No ephemeral scripts (all are synced)');
139
- // Verify all scripts were copied
140
- node_assert_1.default.ok(fs_1.default.existsSync(path_1.default.join(userScriptsDir, 'shell-script.sh')), 'Shell script should be synced');
141
- node_assert_1.default.ok(fs_1.default.existsSync(path_1.default.join(userScriptsDir, 'self-contained.ts')), 'Self-contained TS should be synced');
142
- node_assert_1.default.ok(fs_1.default.existsSync(path_1.default.join(userScriptsDir, 'dependent.ts')), 'Dependent TS should also be synced');
143
- // Verify executable permissions on Unix
144
- if (process.platform !== 'win32') {
145
- const shellScriptPath = path_1.default.join(userScriptsDir, 'shell-script.sh');
146
- const stats = fs_1.default.statSync(shellScriptPath);
147
- node_assert_1.default.ok(stats.mode & 0o111, 'Shell script should be executable');
148
- }
149
- console.log(' ✅ Hybrid sync behavior verified!');
150
- return true;
151
- }
152
- catch (error) {
153
- console.error(' ❌ Hybrid sync test failed:', error);
154
- return false;
155
- }
156
- finally {
157
- try {
158
- fs_1.default.rmSync(tempDir, { recursive: true, force: true });
159
- if (fs_1.default.existsSync(userFraimDir)) {
160
- fs_1.default.rmSync(userFraimDir, { recursive: true, force: true });
161
- }
162
- }
163
- catch (e) { }
164
- delete process.env.FRAIM_USER_DIR;
165
- }
166
- }
167
- async function testActualRegistryScriptCategorization() {
168
- console.log(' 🚀 Testing Actual Registry Script Categorization...');
169
- try {
170
- const registryPath = path_1.default.resolve(__dirname, '../../registry');
171
- if (!fs_1.default.existsSync(registryPath)) {
172
- console.log(' ⚠️ Registry not found, skipping actual script categorization test');
173
- return true;
174
- }
175
- const { getRegistryScripts } = await Promise.resolve().then(() => __importStar(require('../src/utils/script-sync-utils')));
176
- const allScripts = getRegistryScripts(registryPath);
177
- console.log(` 📊 Found ${allScripts.length} scripts to sync:`);
178
- for (const script of allScripts) {
179
- console.log(` ✅ ${path_1.default.basename(script)}`);
180
- }
181
- // Verify expected scripts are included
182
- const scriptNames = allScripts.map(p => path_1.default.basename(p));
183
- // prep-issue.sh should be included
184
- node_assert_1.default.ok(scriptNames.includes('prep-issue.sh'), 'prep-issue.sh should be included');
185
- // Python scripts should be included
186
- const expectedPythonScripts = [
187
- 'comprehensive-explorer.py',
188
- 'interactive-explorer.py',
189
- 'scrape-site.py'
190
- ];
191
- for (const expectedScript of expectedPythonScripts) {
192
- if (fs_1.default.existsSync(path_1.default.join(registryPath, 'scripts', expectedScript))) {
193
- node_assert_1.default.ok(scriptNames.includes(expectedScript), `${expectedScript} should be included`);
194
- }
195
- }
196
- console.log(' ✅ Actual registry script sync verified!');
197
- return true;
198
- }
199
- catch (error) {
200
- console.error(' ❌ Registry script sync test failed:', error);
201
- return false;
202
- }
203
- }
204
- async function testSelfContainedScriptExecution() {
205
- console.log(' 🚀 Testing Self-Contained Script Execution...');
206
- const tempProjectDir = fs_1.default.mkdtempSync(path_1.default.join(os_1.default.tmpdir(), 'fraim-self-contained-test-'));
207
- const userFraimDir = path_1.default.join(os_1.default.homedir(), '.fraim-self-contained-test');
208
- const userScriptsDir = path_1.default.join(userFraimDir, 'scripts');
209
- try {
210
- // Clean up and setup
211
- if (fs_1.default.existsSync(userFraimDir)) {
212
- fs_1.default.rmSync(userFraimDir, { recursive: true, force: true });
213
- }
214
- fs_1.default.mkdirSync(userScriptsDir, { recursive: true });
215
- // Create a self-contained script that mimics prep-issue.sh behavior
216
- const selfContainedScript = `#!/bin/bash
217
- set -e
218
-
219
- echo "=== Self-Contained Script Test ==="
220
-
221
- # Validate we can find .fraim/config.json in working directory
222
- if [ ! -f ".fraim/config.json" ]; then
223
- echo "ERROR: Cannot find .fraim/config.json in working directory"
224
- exit 1
225
- fi
226
-
227
- # Read project name from config using node
228
- PROJECT_NAME=$(node -e "
229
- const fs = require('fs');
230
- const config = JSON.parse(fs.readFileSync('.fraim/config.json', 'utf8'));
231
- console.log(config.project.name);
232
- ")
233
-
234
- echo "Project name from config: $PROJECT_NAME"
235
-
236
- # Validate we can create files in working directory
237
- echo "test content" > self-contained-test-output.txt
238
- if [ -f "self-contained-test-output.txt" ]; then
239
- echo "File creation: SUCCESS"
240
- rm self-contained-test-output.txt
241
- else
242
- echo "File creation: FAILED"
243
- exit 1
244
- fi
245
-
246
- echo "Working directory: $(pwd)"
247
- echo "Script directory: $(dirname "$0")"
248
-
249
- # Validate they are different
250
- if [ "$(pwd)" = "$(dirname "$0")" ]; then
251
- echo "ERROR: Working directory should not be same as script directory"
252
- exit 1
253
- fi
254
-
255
- echo "Self-contained script execution: SUCCESS"
256
- `;
257
- const scriptPath = path_1.default.join(userScriptsDir, 'self-contained-test.sh');
258
- fs_1.default.writeFileSync(scriptPath, selfContainedScript);
259
- if (process.platform !== 'win32') {
260
- fs_1.default.chmodSync(scriptPath, 0o755);
261
- }
262
- // Set up project directory
263
- const projectFraimDir = path_1.default.join(tempProjectDir, '.fraim');
264
- fs_1.default.mkdirSync(projectFraimDir, { recursive: true });
265
- const testConfig = {
266
- project: { name: 'self-contained-test' },
267
- git: { repoOwner: 'test', repoName: 'self-contained-test' }
268
- };
269
- fs_1.default.writeFileSync(path_1.default.join(projectFraimDir, 'config.json'), JSON.stringify(testConfig, null, 2));
270
- // Execute script from project directory
271
- console.log(' Executing self-contained script...');
272
- const { execSync } = await Promise.resolve().then(() => __importStar(require('child_process')));
273
- const bashCommand = process.platform === 'win32'
274
- ? `"C:\\Program Files\\Git\\bin\\bash.exe" "${scriptPath}"`
275
- : `"${scriptPath}"`;
276
- let output;
277
- try {
278
- output = execSync(bashCommand, {
279
- cwd: tempProjectDir,
280
- encoding: 'utf-8'
281
- });
282
- }
283
- catch (error) {
284
- if (process.platform === 'win32' && error.message.includes('not recognized')) {
285
- console.log(' ⚠️ Git Bash not found on Windows, skipping self-contained script test');
286
- return true;
287
- }
288
- throw error;
289
- }
290
- // Validate output
291
- node_assert_1.default.ok(output.includes('Self-contained script execution: SUCCESS'), 'Script should execute successfully');
292
- node_assert_1.default.ok(output.includes('Project name from config: self-contained-test'), 'Should read config correctly');
293
- node_assert_1.default.ok(output.includes('File creation: SUCCESS'), 'Should be able to create files in working directory');
294
- console.log(' ✅ Self-contained script execution verified!');
295
- return true;
296
- }
297
- catch (error) {
298
- console.error(' ❌ Self-contained script execution test failed:', error);
299
- return false;
300
- }
301
- finally {
302
- try {
303
- fs_1.default.rmSync(tempProjectDir, { recursive: true, force: true });
304
- if (fs_1.default.existsSync(userFraimDir)) {
305
- fs_1.default.rmSync(userFraimDir, { recursive: true, force: true });
306
- }
307
- }
308
- catch (e) { }
309
- }
310
- }
311
- async function runHybridScriptTest(testCase) {
312
- return await testCase.testFunction();
313
- }
314
- const testCases = [
315
- {
316
- name: 'Self-Contained Script Detection',
317
- description: 'Tests the logic that determines which scripts are self-contained vs dependent',
318
- testFunction: testSelfContainedScriptDetection,
319
- tags: ['hybrid', 'detection']
320
- },
321
- {
322
- name: 'Hybrid Sync Behavior',
323
- description: 'Tests that sync only copies self-contained scripts to user directory',
324
- testFunction: testHybridSyncBehavior,
325
- tags: ['hybrid', 'sync']
326
- },
327
- {
328
- name: 'Actual Registry Script Categorization',
329
- description: 'Tests categorization of real scripts in the registry',
330
- testFunction: testActualRegistryScriptCategorization,
331
- tags: ['hybrid', 'registry']
332
- },
333
- {
334
- name: 'Self-Contained Script Execution',
335
- description: 'Tests that self-contained scripts work correctly when executed from user directory',
336
- testFunction: testSelfContainedScriptExecution,
337
- tags: ['hybrid', 'execution']
338
- }
339
- ];
340
- (0, test_utils_1.runTests)(testCases, runHybridScriptTest, 'Hybrid Script Execution Tests');
@@ -1,46 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const node_test_1 = require("node:test");
7
- const node_assert_1 = __importDefault(require("node:assert"));
8
- const ide_detector_1 = require("../src/cli/setup/ide-detector");
9
- const path_1 = __importDefault(require("path"));
10
- const os_1 = __importDefault(require("os"));
11
- (0, node_test_1.test)('expandPath should expand tilde to home directory', () => {
12
- const result = (0, ide_detector_1.expandPath)('~/.fraim/config.json');
13
- const expected = path_1.default.join(os_1.default.homedir(), '.fraim/config.json');
14
- node_assert_1.default.strictEqual(result, expected);
15
- });
16
- (0, node_test_1.test)('expandPath should return absolute paths unchanged', () => {
17
- const absolutePath = '/usr/local/bin/fraim';
18
- const result = (0, ide_detector_1.expandPath)(absolutePath);
19
- node_assert_1.default.strictEqual(result, absolutePath);
20
- });
21
- (0, node_test_1.test)('IDE_CONFIGS should contain all expected IDEs', () => {
22
- const expectedIDEs = ['Claude', 'Antigravity', 'Kiro', 'Cursor', 'VSCode', 'Codex', 'Windsurf'];
23
- const actualIDEs = ide_detector_1.IDE_CONFIGS.map(ide => ide.name);
24
- expectedIDEs.forEach(expectedIDE => {
25
- (0, node_assert_1.default)(actualIDEs.includes(expectedIDE), `Missing IDE: ${expectedIDE}`);
26
- });
27
- });
28
- (0, node_test_1.test)('IDE_CONFIGS should have valid config types', () => {
29
- const validConfigTypes = ['standard', 'kiro', 'codex', 'windsurf', 'claude'];
30
- ide_detector_1.IDE_CONFIGS.forEach(ide => {
31
- (0, node_assert_1.default)(validConfigTypes.includes(ide.configType), `Invalid config type for ${ide.name}: ${ide.configType}`);
32
- });
33
- });
34
- (0, node_test_1.test)('IDE_CONFIGS should have valid config formats', () => {
35
- const validFormats = ['json', 'toml'];
36
- ide_detector_1.IDE_CONFIGS.forEach(ide => {
37
- (0, node_assert_1.default)(validFormats.includes(ide.configFormat), `Invalid config format for ${ide.name}: ${ide.configFormat}`);
38
- });
39
- });
40
- (0, node_test_1.test)('detectInstalledIDEs should return empty array when no IDEs installed', () => {
41
- // This test assumes no IDEs are installed in the test environment
42
- // In a real environment, this might return actual IDEs
43
- const result = (0, ide_detector_1.detectInstalledIDEs)();
44
- (0, node_assert_1.default)(Array.isArray(result), 'Should return an array');
45
- // We can't assert the exact length since it depends on the test environment
46
- });
@@ -1,121 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const node_test_1 = require("node:test");
7
- const node_assert_1 = __importDefault(require("node:assert"));
8
- const fs_1 = __importDefault(require("fs"));
9
- const path_1 = __importDefault(require("path"));
10
- const os_1 = __importDefault(require("os"));
11
- const ide_detector_1 = require("../src/cli/setup/ide-detector");
12
- const mcp_config_generator_1 = require("../src/cli/setup/mcp-config-generator");
13
- (0, node_test_1.describe)('Improved Setup System', () => {
14
- (0, node_test_1.it)('should detect IDEs with improved detection methods', () => {
15
- const detectedIDEs = (0, ide_detector_1.detectInstalledIDEs)();
16
- const allIDEs = (0, ide_detector_1.getAllSupportedIDEs)();
17
- // Should have all IDE configs defined
18
- (0, node_assert_1.default)(allIDEs.length >= 7, 'Should have at least 7 IDE configurations');
19
- // Each IDE should have required properties
20
- allIDEs.forEach(ide => {
21
- (0, node_assert_1.default)(ide.name, 'IDE should have a name');
22
- (0, node_assert_1.default)(ide.configPath, 'IDE should have a config path');
23
- (0, node_assert_1.default)(ide.configFormat, 'IDE should have a config format');
24
- (0, node_assert_1.default)(ide.configType, 'IDE should have a config type');
25
- (0, node_assert_1.default)(typeof ide.detectMethod === 'function', 'IDE should have a detect method');
26
- });
27
- console.log(`✅ Found ${detectedIDEs.length} installed IDEs out of ${allIDEs.length} supported`);
28
- });
29
- (0, node_test_1.it)('should find IDEs by name correctly', () => {
30
- const claude = (0, ide_detector_1.findIDEByName)('claude');
31
- const cursor = (0, ide_detector_1.findIDEByName)('cursor');
32
- const vscode = (0, ide_detector_1.findIDEByName)('vscode');
33
- (0, node_assert_1.default)(claude?.name === 'Claude', 'Should find Claude');
34
- (0, node_assert_1.default)(cursor?.name === 'Cursor', 'Should find Cursor');
35
- (0, node_assert_1.default)(vscode?.name === 'VSCode', 'Should find VSCode');
36
- // Test partial matching
37
- const claudePartial = (0, ide_detector_1.findIDEByName)('clau');
38
- (0, node_assert_1.default)(claudePartial?.name === 'Claude', 'Should find Claude with partial name');
39
- console.log('✅ IDE name matching works correctly');
40
- });
41
- (0, node_test_1.it)('should expand paths correctly across platforms', () => {
42
- const homePath = (0, ide_detector_1.expandPath)('~/test');
43
- const expectedPath = path_1.default.join(os_1.default.homedir(), 'test');
44
- node_assert_1.default.strictEqual(homePath, expectedPath, 'Should expand tilde to home directory');
45
- const absolutePath = (0, ide_detector_1.expandPath)('/absolute/path');
46
- node_assert_1.default.strictEqual(absolutePath, '/absolute/path', 'Should leave absolute paths unchanged');
47
- console.log('✅ Path expansion works correctly');
48
- });
49
- (0, node_test_1.it)('should generate intelligent MCP configs for all IDE types', () => {
50
- const testKey = 'fraim_test123';
51
- const testToken = 'ghp_test123';
52
- // Test all config types
53
- const standardConfig = (0, mcp_config_generator_1.generateMCPConfig)('standard', testKey, testToken);
54
- const kiroConfig = (0, mcp_config_generator_1.generateMCPConfig)('kiro', testKey, testToken);
55
- const codexConfig = (0, mcp_config_generator_1.generateMCPConfig)('codex', testKey, testToken);
56
- const windsurfConfig = (0, mcp_config_generator_1.generateMCPConfig)('windsurf', testKey, testToken);
57
- // Standard config should use serverUrl
58
- if (typeof standardConfig === 'object') {
59
- (0, node_assert_1.default)(standardConfig.mcpServers, 'Standard config should have mcpServers');
60
- (0, node_assert_1.default)(standardConfig.mcpServers.fraim.serverUrl, 'Standard config should use serverUrl');
61
- }
62
- // Kiro config should use url
63
- if (typeof kiroConfig === 'object') {
64
- (0, node_assert_1.default)(kiroConfig.mcpServers, 'Kiro config should have mcpServers');
65
- (0, node_assert_1.default)(kiroConfig.mcpServers.fraim.url, 'Kiro config should use url');
66
- }
67
- // Codex config should be TOML string
68
- (0, node_assert_1.default)(typeof codexConfig === 'string', 'Codex config should be TOML string');
69
- (0, node_assert_1.default)(codexConfig.includes('[mcp_servers.fraim]'), 'Codex config should have TOML sections');
70
- // Windsurf config should use command/args pattern
71
- if (typeof windsurfConfig === 'object') {
72
- (0, node_assert_1.default)(windsurfConfig.mcpServers, 'Windsurf config should have mcpServers');
73
- (0, node_assert_1.default)(windsurfConfig.mcpServers.fraim.command, 'Windsurf config should use command');
74
- }
75
- console.log('✅ All MCP config types generate correctly');
76
- });
77
- (0, node_test_1.it)('should handle config merging intelligently', () => {
78
- const testKey = 'fraim_test123';
79
- const testToken = 'ghp_test123';
80
- // Simulate existing config
81
- const existingConfig = {
82
- mcpServers: {
83
- existing: {
84
- command: 'existing-command'
85
- }
86
- },
87
- otherSettings: {
88
- theme: 'dark'
89
- }
90
- };
91
- const newConfig = (0, mcp_config_generator_1.generateMCPConfig)('kiro', testKey, testToken);
92
- // Merge configs (simulating what happens in setup)
93
- const mergedConfig = {
94
- ...existingConfig,
95
- ...newConfig,
96
- mcpServers: {
97
- ...existingConfig.mcpServers,
98
- ...newConfig.mcpServers
99
- }
100
- };
101
- // Should preserve existing servers
102
- (0, node_assert_1.default)(mergedConfig.mcpServers.existing, 'Should preserve existing MCP servers');
103
- (0, node_assert_1.default)(mergedConfig.mcpServers.fraim, 'Should add new FRAIM server');
104
- (0, node_assert_1.default)(mergedConfig.otherSettings, 'Should preserve other settings');
105
- console.log('✅ Config merging preserves existing settings');
106
- });
107
- (0, node_test_1.it)('should validate setup requirements', () => {
108
- // Test that we can detect missing global setup
109
- const globalConfigPath = path_1.default.join(os_1.default.homedir(), '.fraim', 'config.json');
110
- const hasGlobalSetup = fs_1.default.existsSync(globalConfigPath);
111
- // This is informational - setup may or may not exist
112
- console.log(`ℹ️ Global setup ${hasGlobalSetup ? 'exists' : 'not found'}`);
113
- // Test that we can create temp directories for testing
114
- const tempDir = path_1.default.join(os_1.default.tmpdir(), 'fraim-test-' + Date.now());
115
- fs_1.default.mkdirSync(tempDir, { recursive: true });
116
- (0, node_assert_1.default)(fs_1.default.existsSync(tempDir), 'Should be able to create temp directories');
117
- // Cleanup
118
- fs_1.default.rmSync(tempDir, { recursive: true, force: true });
119
- console.log('✅ Setup validation works correctly');
120
- });
121
- });
@@ -1,99 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const node_test_1 = require("node:test");
7
- const node_assert_1 = __importDefault(require("node:assert"));
8
- const mcp_config_generator_1 = require("../src/cli/setup/mcp-config-generator");
9
- const testFraimKey = 'fraim_test123456789';
10
- const testGithubToken = 'ghp_test123456789';
11
- (0, node_test_1.test)('generateStandardMCPServers should create correct config', () => {
12
- const config = (0, mcp_config_generator_1.generateStandardMCPServers)(testFraimKey, testGithubToken);
13
- (0, node_assert_1.default)(config.mcpServers, 'Should have mcpServers property');
14
- (0, node_assert_1.default)(config.mcpServers.fraim, 'Should have fraim server');
15
- (0, node_assert_1.default)(config.mcpServers.git, 'Should have git server');
16
- (0, node_assert_1.default)(config.mcpServers.github, 'Should have github server');
17
- (0, node_assert_1.default)(config.mcpServers.playwright, 'Should have playwright server');
18
- // Check fraim server config (standard uses serverUrl, no type)
19
- node_assert_1.default.strictEqual(config.mcpServers.fraim.serverUrl, 'https://fraim.wellnessatwork.me');
20
- node_assert_1.default.strictEqual(config.mcpServers.fraim.headers['x-api-key'], testFraimKey);
21
- node_assert_1.default.strictEqual(config.mcpServers.fraim.type, undefined);
22
- // Check github server config (standard uses serverUrl, no type)
23
- node_assert_1.default.strictEqual(config.mcpServers.github.serverUrl, 'https://api.githubcopilot.com/mcp/');
24
- node_assert_1.default.strictEqual(config.mcpServers.github.headers.Authorization, `Bearer ${testGithubToken}`);
25
- node_assert_1.default.strictEqual(config.mcpServers.github.type, undefined);
26
- // Check command-based servers don't have type field
27
- node_assert_1.default.strictEqual(config.mcpServers.git.type, undefined);
28
- node_assert_1.default.strictEqual(config.mcpServers.playwright.type, undefined);
29
- });
30
- (0, node_test_1.test)('generateClaudeMCPServers should create correct config', () => {
31
- const config = (0, mcp_config_generator_1.generateClaudeMCPServers)(testFraimKey, testGithubToken);
32
- (0, node_assert_1.default)(config.mcpServers, 'Should have mcpServers property');
33
- (0, node_assert_1.default)(config.mcpServers.fraim, 'Should have fraim server');
34
- (0, node_assert_1.default)(config.mcpServers.git, 'Should have git server');
35
- (0, node_assert_1.default)(config.mcpServers.github, 'Should have github server');
36
- (0, node_assert_1.default)(config.mcpServers.playwright, 'Should have playwright server');
37
- // Check fraim server config (Claude uses url and type)
38
- node_assert_1.default.strictEqual(config.mcpServers.fraim.type, 'http');
39
- node_assert_1.default.strictEqual(config.mcpServers.fraim.url, 'https://fraim.wellnessatwork.me');
40
- node_assert_1.default.strictEqual(config.mcpServers.fraim.headers['x-api-key'], testFraimKey);
41
- // Check github server config (Claude uses url and type)
42
- node_assert_1.default.strictEqual(config.mcpServers.github.type, 'http');
43
- node_assert_1.default.strictEqual(config.mcpServers.github.url, 'https://api.githubcopilot.com/mcp/');
44
- node_assert_1.default.strictEqual(config.mcpServers.github.headers.Authorization, `Bearer ${testGithubToken}`);
45
- // Check command-based servers don't have type field
46
- node_assert_1.default.strictEqual(config.mcpServers.git.type, undefined);
47
- node_assert_1.default.strictEqual(config.mcpServers.playwright.type, undefined);
48
- });
49
- (0, node_test_1.test)('generateKiroMCPServers should create correct config', () => {
50
- const config = (0, mcp_config_generator_1.generateKiroMCPServers)(testFraimKey, testGithubToken);
51
- (0, node_assert_1.default)(config.mcpServers, 'Should have mcpServers property');
52
- // Check that Kiro uses 'url' instead of 'serverUrl'
53
- (0, node_assert_1.default)(config.mcpServers.fraim.url, 'Fraim should use url property');
54
- (0, node_assert_1.default)(config.mcpServers.github.url, 'GitHub should use url property');
55
- (0, node_assert_1.default)(!config.mcpServers.fraim.serverUrl, 'Fraim should not have serverUrl property');
56
- (0, node_assert_1.default)(!config.mcpServers.github.serverUrl, 'GitHub should not have serverUrl property');
57
- // Check that Kiro HTTP servers don't have type field
58
- node_assert_1.default.strictEqual(config.mcpServers.fraim.type, undefined);
59
- node_assert_1.default.strictEqual(config.mcpServers.github.type, undefined);
60
- node_assert_1.default.strictEqual(config.mcpServers.fraim.url, 'https://fraim.wellnessatwork.me');
61
- node_assert_1.default.strictEqual(config.mcpServers.github.url, 'https://api.githubcopilot.com/mcp/');
62
- });
63
- (0, node_test_1.test)('generateCodexMCPServers should create correct TOML config', () => {
64
- const config = (0, mcp_config_generator_1.generateCodexMCPServers)(testFraimKey, testGithubToken);
65
- (0, node_assert_1.default)(typeof config === 'string', 'Should return a string for TOML');
66
- (0, node_assert_1.default)(config.includes('[mcp_servers.fraim]'), 'Should contain fraim server section');
67
- (0, node_assert_1.default)(config.includes('[mcp_servers.git]'), 'Should contain git server section');
68
- (0, node_assert_1.default)(config.includes('[mcp_servers.github]'), 'Should contain github server section');
69
- (0, node_assert_1.default)(config.includes('[mcp_servers.playwright]'), 'Should contain playwright server section');
70
- (0, node_assert_1.default)(config.includes(testFraimKey), 'Should contain the FRAIM key');
71
- });
72
- (0, node_test_1.test)('generateWindsurfMCPServers should create correct config', () => {
73
- const config = (0, mcp_config_generator_1.generateWindsurfMCPServers)(testFraimKey, testGithubToken);
74
- (0, node_assert_1.default)(config.mcpServers, 'Should have mcpServers property');
75
- // Check that Windsurf uses command/args pattern
76
- (0, node_assert_1.default)(config.mcpServers.fraim.command, 'Fraim should have command property');
77
- (0, node_assert_1.default)(config.mcpServers.fraim.args, 'Fraim should have args property');
78
- (0, node_assert_1.default)(config.mcpServers.fraim.env, 'Fraim should have env property');
79
- node_assert_1.default.strictEqual(config.mcpServers.fraim.command, 'npx');
80
- (0, node_assert_1.default)(config.mcpServers.fraim.args.includes('@modelcontextprotocol/server-fetch'), 'Should use fetch server');
81
- node_assert_1.default.strictEqual(config.mcpServers.fraim.env.FRAIM_API_KEY, testFraimKey);
82
- });
83
- (0, node_test_1.test)('generateMCPConfig should route to correct generator', () => {
84
- const standardConfig = (0, mcp_config_generator_1.generateMCPConfig)('standard', testFraimKey, testGithubToken);
85
- const claudeConfig = (0, mcp_config_generator_1.generateMCPConfig)('claude', testFraimKey, testGithubToken);
86
- const kiroConfig = (0, mcp_config_generator_1.generateMCPConfig)('kiro', testFraimKey, testGithubToken);
87
- const codexConfig = (0, mcp_config_generator_1.generateMCPConfig)('codex', testFraimKey, testGithubToken);
88
- const windsurfConfig = (0, mcp_config_generator_1.generateMCPConfig)('windsurf', testFraimKey, testGithubToken);
89
- (0, node_assert_1.default)(standardConfig.mcpServers.fraim.serverUrl, 'Standard should use serverUrl');
90
- (0, node_assert_1.default)(claudeConfig.mcpServers.fraim.url, 'Claude should use url');
91
- (0, node_assert_1.default)(kiroConfig.mcpServers.fraim.url, 'Kiro should use url');
92
- (0, node_assert_1.default)(typeof codexConfig === 'string', 'Codex should return TOML string');
93
- (0, node_assert_1.default)(windsurfConfig.mcpServers.fraim.command, 'Windsurf should use command');
94
- });
95
- (0, node_test_1.test)('generateMCPConfig should throw for invalid config type', () => {
96
- node_assert_1.default.throws(() => {
97
- (0, mcp_config_generator_1.generateMCPConfig)('invalid', testFraimKey, testGithubToken);
98
- }, /Unsupported config type/);
99
- });