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.
- package/CHANGELOG.md +10 -0
- package/bin/fraim-mcp.js +14 -0
- package/bin/fraim.js +23 -0
- package/dist/src/cli/commands/init-project.js +10 -4
- package/dist/src/cli/commands/mcp.js +65 -0
- package/dist/src/cli/setup/mcp-config-generator.js +19 -16
- package/dist/src/fraim/issue-tracking/ado-provider.js +304 -0
- package/dist/src/fraim/issue-tracking/factory.js +63 -0
- package/dist/src/fraim/issue-tracking/github-provider.js +200 -0
- package/dist/src/fraim/issue-tracking/types.js +7 -0
- package/dist/src/fraim/issue-tracking-config.js +83 -0
- package/dist/src/local-mcp-server/stdio-server.js +207 -0
- package/dist/src/utils/workflow-parser.js +81 -0
- package/package.json +17 -12
- package/registry/scripts/pdf-styles.css +172 -0
- package/registry/scripts/prep-issue.sh +46 -4
- package/registry/scripts/profile-server.ts +131 -130
- package/registry/stubs/workflows/customer-development/user-survey-dispatch.md +1 -1
- package/registry/stubs/workflows/customer-development/users-to-target.md +1 -1
- package/registry/stubs/workflows/product-building/design.md +1 -1
- package/registry/stubs/workflows/product-building/implement.md +1 -1
- package/Claude.md +0 -1
- package/dist/registry/ai-manager-rules/customer-development-phases/phase1-customer-profiling.md +0 -101
- package/dist/registry/ai-manager-rules/customer-development-phases/phase2-platform-discovery.md +0 -235
- package/dist/registry/ai-manager-rules/customer-development-phases/phase3-prospect-qualification.md +0 -243
- package/dist/registry/ai-manager-rules/customer-development-phases/phase4-inventory-compilation.md +0 -206
- package/dist/registry/ai-manager-rules/design-phases/design-completeness-review.md +0 -73
- package/dist/registry/ai-manager-rules/design-phases/design-design.md +0 -145
- package/dist/registry/ai-manager-rules/implement-phases/implement-code.md +0 -283
- package/dist/registry/ai-manager-rules/implement-phases/implement-completeness-review.md +0 -120
- package/dist/registry/ai-manager-rules/implement-phases/implement-regression.md +0 -173
- package/dist/registry/ai-manager-rules/implement-phases/implement-repro.md +0 -104
- package/dist/registry/ai-manager-rules/implement-phases/implement-scoping.md +0 -100
- package/dist/registry/ai-manager-rules/implement-phases/implement-smoke.md +0 -237
- package/dist/registry/ai-manager-rules/implement-phases/implement-spike.md +0 -121
- package/dist/registry/ai-manager-rules/implement-phases/implement-validate.md +0 -375
- package/dist/registry/ai-manager-rules/retrospective.md +0 -116
- package/dist/registry/ai-manager-rules/shared-phases/address-pr-feedback.md +0 -188
- package/dist/registry/ai-manager-rules/shared-phases/submit-pr.md +0 -202
- package/dist/registry/ai-manager-rules/shared-phases/wait-for-pr-review.md +0 -170
- package/dist/registry/ai-manager-rules/spec-phases/spec-competitor-analysis.md +0 -105
- package/dist/registry/ai-manager-rules/spec-phases/spec-completeness-review.md +0 -66
- package/dist/registry/ai-manager-rules/spec-phases/spec-spec.md +0 -139
- package/dist/registry/ai-manager-rules/user-survey-phases/phase1-survey-scoping.md +0 -60
- package/dist/registry/ai-manager-rules/user-survey-phases/phase2-survey-build-linkedin.md +0 -23
- package/dist/registry/ai-manager-rules/user-survey-phases/phase3-survey-build-reddit.md +0 -22
- package/dist/registry/ai-manager-rules/user-survey-phases/phase4-survey-build-x.md +0 -21
- package/dist/registry/ai-manager-rules/user-survey-phases/phase5-survey-build-facebook.md +0 -19
- package/dist/registry/ai-manager-rules/user-survey-phases/phase6-survey-build-custom.md +0 -15
- package/dist/registry/ai-manager-rules/user-survey-phases/phase7-survey-dispatch.md +0 -45
- package/dist/registry/providers/ado.json +0 -19
- package/dist/registry/providers/github.json +0 -19
- package/dist/registry/scripts/cleanup-branch.js +0 -287
- package/dist/registry/scripts/evaluate-code-quality.js +0 -66
- package/dist/registry/scripts/exec-with-timeout.js +0 -142
- package/dist/registry/scripts/generate-engagement-emails.js +0 -705
- package/dist/registry/scripts/newsletter-helpers.js +0 -671
- package/dist/registry/scripts/profile-server.js +0 -388
- package/dist/registry/scripts/run-thank-you-workflow.js +0 -92
- package/dist/registry/scripts/send-newsletter-simple.js +0 -85
- package/dist/registry/scripts/send-thank-you-emails.js +0 -54
- package/dist/registry/scripts/validate-openapi-limits.js +0 -311
- package/dist/registry/scripts/validate-test-coverage.js +0 -262
- package/dist/registry/scripts/verify-test-coverage.js +0 -66
- package/dist/registry/templates/bootstrap/ARCHITECTURE-TEMPLATE.md +0 -53
- package/dist/registry/templates/bootstrap/CODE-QUALITY-REPORT-TEMPLATE.md +0 -37
- package/dist/registry/templates/bootstrap/TEST-COVERAGE-REPORT-TEMPLATE.md +0 -35
- package/dist/registry/templates/business-development/IDEATION-REPORT-TEMPLATE.md +0 -29
- package/dist/registry/templates/business-development/PRICING-STRATEGY-TEMPLATE.md +0 -126
- package/dist/registry/templates/customer-development/customer-interview-template.md +0 -99
- package/dist/registry/templates/customer-development/customer-persona-template.md +0 -69
- package/dist/registry/templates/customer-development/follow-up-email-templates.md +0 -132
- package/dist/registry/templates/customer-development/insight-analysis-template.md +0 -74
- package/dist/registry/templates/customer-development/prospect-inventory-template.csv +0 -3
- package/dist/registry/templates/customer-development/search-strategy-template.md +0 -123
- package/dist/registry/templates/customer-development/strategic-recommendations-template.md +0 -53
- package/dist/registry/templates/customer-development/thank-you-email-template.html +0 -124
- package/dist/registry/templates/customer-development/thank-you-note-template.md +0 -16
- package/dist/registry/templates/customer-development/triage-log-template.md +0 -278
- package/dist/registry/templates/customer-development/weekly-newsletter-template.html +0 -204
- package/dist/registry/templates/evidence/Design-Evidence.md +0 -30
- package/dist/registry/templates/evidence/Implementation-BugEvidence.md +0 -94
- package/dist/registry/templates/evidence/Implementation-FeatureEvidence.md +0 -129
- package/dist/registry/templates/evidence/Spec-Evidence.md +0 -19
- package/dist/registry/templates/help/HelpNeeded.md +0 -14
- package/dist/registry/templates/legal/NDA-TEMPLATE.md +0 -170
- package/dist/registry/templates/legal/PATENT-TEMPLATE.md +0 -372
- package/dist/registry/templates/legal/TRADEMARK-TEMPLATE.md +0 -339
- package/dist/registry/templates/legal/contract-review-checklist.md +0 -193
- package/dist/registry/templates/legal/review-report-template.md +0 -198
- package/dist/registry/templates/legal/saas-terms-template.md +0 -174
- package/dist/registry/templates/legal/sow-template.md +0 -117
- package/dist/registry/templates/legal/template-variables.md +0 -131
- package/dist/registry/templates/marketing/DOMAIN-REGISTRATION-TEMPLATE.md +0 -194
- package/dist/registry/templates/marketing/HBR-ARTICLE-TEMPLATE.md +0 -66
- package/dist/registry/templates/marketing/STORYTELLING-TEMPLATE.md +0 -130
- package/dist/registry/templates/marketing/WEBSITE-TEMPLATE.md +0 -262
- package/dist/registry/templates/marketing/github-pages-workflow.yml +0 -64
- package/dist/registry/templates/replicate/implementation-checklist.md +0 -39
- package/dist/registry/templates/replicate/use-cases-template.md +0 -88
- package/dist/registry/templates/retrospective/RETROSPECTIVE-TEMPLATE.md +0 -55
- package/dist/registry/templates/specs/BUGSPEC-TEMPLATE.md +0 -37
- package/dist/registry/templates/specs/FEATURESPEC-TEMPLATE.md +0 -66
- package/dist/registry/templates/specs/TECHSPEC-TEMPLATE.md +0 -39
- package/dist/registry/workflows/bootstrap/create-architecture.md +0 -38
- package/dist/registry/workflows/bootstrap/detect-broken-windows.md +0 -300
- package/dist/registry/workflows/bootstrap/evaluate-code-quality.md +0 -35
- package/dist/registry/workflows/bootstrap/verify-test-coverage.md +0 -36
- package/dist/registry/workflows/brainstorming/blue-sky-brainstorming.md +0 -211
- package/dist/registry/workflows/brainstorming/codebase-brainstorming.md +0 -165
- package/dist/registry/workflows/business-development/create-business-plan.md +0 -737
- package/dist/registry/workflows/business-development/ideate-business-opportunity.md +0 -55
- package/dist/registry/workflows/business-development/price-product.md +0 -325
- package/dist/registry/workflows/compliance/detect-compliance-requirements.md +0 -78
- package/dist/registry/workflows/compliance/generate-audit-evidence.md +0 -75
- package/dist/registry/workflows/compliance/soc2-evidence-generator.md +0 -332
- package/dist/registry/workflows/customer-development/insight-analysis.md +0 -156
- package/dist/registry/workflows/customer-development/insight-triage.md +0 -938
- package/dist/registry/workflows/customer-development/interview-preparation.md +0 -452
- package/dist/registry/workflows/customer-development/linkedin-outreach.md +0 -593
- package/dist/registry/workflows/customer-development/strategic-brainstorming.md +0 -146
- package/dist/registry/workflows/customer-development/thank-customers.md +0 -203
- package/dist/registry/workflows/customer-development/user-survey-dispatch.md +0 -60
- package/dist/registry/workflows/customer-development/users-to-target.md +0 -112
- package/dist/registry/workflows/customer-development/weekly-newsletter.md +0 -366
- package/dist/registry/workflows/deploy/cloud-deployment.md +0 -310
- package/dist/registry/workflows/improve-fraim/contribute.md +0 -32
- package/dist/registry/workflows/improve-fraim/file-issue.md +0 -32
- package/dist/registry/workflows/learning/build-skillset.md +0 -212
- package/dist/registry/workflows/learning/synthesize-learnings.md +0 -284
- package/dist/registry/workflows/legal/contract-review-analysis.md +0 -382
- package/dist/registry/workflows/legal/nda.md +0 -69
- package/dist/registry/workflows/legal/patent-filing.md +0 -76
- package/dist/registry/workflows/legal/saas-contract-development.md +0 -213
- package/dist/registry/workflows/legal/trademark-filing.md +0 -77
- package/dist/registry/workflows/marketing/content-creation.md +0 -37
- package/dist/registry/workflows/marketing/convert-to-pdf.md +0 -235
- package/dist/registry/workflows/marketing/create-modern-website.md +0 -456
- package/dist/registry/workflows/marketing/domain-registration.md +0 -323
- package/dist/registry/workflows/marketing/hbr-article.md +0 -73
- package/dist/registry/workflows/marketing/launch-checklist.md +0 -37
- package/dist/registry/workflows/marketing/marketing-strategy.md +0 -45
- package/dist/registry/workflows/marketing/storytelling.md +0 -65
- package/dist/registry/workflows/performance/analyze-performance.md +0 -65
- package/dist/registry/workflows/product-building/design.md +0 -103
- package/dist/registry/workflows/product-building/implement.md +0 -74
- package/dist/registry/workflows/product-building/iterate-on-pr-comments.md +0 -70
- package/dist/registry/workflows/product-building/prep-issue.md +0 -41
- package/dist/registry/workflows/product-building/prototype.md +0 -65
- package/dist/registry/workflows/product-building/resolve.md +0 -168
- package/dist/registry/workflows/product-building/retrospect.md +0 -86
- package/dist/registry/workflows/product-building/spec.md +0 -181
- package/dist/registry/workflows/product-building/test.md +0 -125
- package/dist/registry/workflows/productivity-report/productivity-report.md +0 -263
- package/dist/registry/workflows/quality-assurance/browser-validation.md +0 -221
- package/dist/registry/workflows/quality-assurance/iterative-improvement-cycle.md +0 -562
- package/dist/registry/workflows/replicate/replicate-discovery.md +0 -336
- package/dist/registry/workflows/replicate/replicate-to-issues.md +0 -324
- package/dist/registry/workflows/reviewer/review-implementation-vs-design-spec.md +0 -638
- package/dist/registry/workflows/reviewer/review-implementation-vs-feature-spec.md +0 -675
- package/dist/registry/workflows/startup-credits/aws-activate-application.md +0 -535
- package/dist/registry/workflows/startup-credits/google-cloud-application.md +0 -647
- package/dist/registry/workflows/startup-credits/microsoft-azure-application.md +0 -538
- package/dist/scripts/build-stub-registry.js +0 -108
- package/dist/src/ai-manager/ai-manager.js +0 -480
- package/dist/src/ai-manager/phase-flow.js +0 -357
- package/dist/src/ai-manager/types.js +0 -5
- package/dist/src/fraim-mcp-server.js +0 -1885
- package/dist/tests/debug-tools.js +0 -80
- package/dist/tests/shared-server-utils.js +0 -57
- package/dist/tests/test-add-ide.js +0 -283
- package/dist/tests/test-ai-coach-edge-cases.js +0 -420
- package/dist/tests/test-ai-coach-mcp-integration.js +0 -450
- package/dist/tests/test-ai-coach-performance.js +0 -328
- package/dist/tests/test-ai-coach-phase-content.js +0 -264
- package/dist/tests/test-ai-coach-workflows.js +0 -514
- package/dist/tests/test-cli.js +0 -228
- package/dist/tests/test-client-scripts-validation.js +0 -167
- package/dist/tests/test-complete-setup-flow.js +0 -110
- package/dist/tests/test-config-system.js +0 -279
- package/dist/tests/test-debug-session.js +0 -134
- package/dist/tests/test-end-to-end-hybrid-validation.js +0 -328
- package/dist/tests/test-enhanced-session-init.js +0 -188
- package/dist/tests/test-first-run-journey.js +0 -368
- package/dist/tests/test-fraim-issues.js +0 -59
- package/dist/tests/test-genericization.js +0 -44
- package/dist/tests/test-hybrid-script-execution.js +0 -340
- package/dist/tests/test-ide-detector.js +0 -46
- package/dist/tests/test-improved-setup.js +0 -121
- package/dist/tests/test-mcp-config-generator.js +0 -99
- package/dist/tests/test-mcp-connection.js +0 -107
- package/dist/tests/test-mcp-issue-integration.js +0 -156
- package/dist/tests/test-mcp-lifecycle-methods.js +0 -240
- package/dist/tests/test-mcp-shared-server.js +0 -308
- package/dist/tests/test-mcp-template-processing.js +0 -160
- package/dist/tests/test-modular-issue-tracking.js +0 -165
- package/dist/tests/test-node-compatibility.js +0 -95
- package/dist/tests/test-npm-install.js +0 -68
- package/dist/tests/test-package-size.js +0 -108
- package/dist/tests/test-pr-review-workflow.js +0 -307
- package/dist/tests/test-prep-issue.js +0 -129
- package/dist/tests/test-productivity-integration.js +0 -157
- package/dist/tests/test-script-location-independence.js +0 -198
- package/dist/tests/test-script-sync.js +0 -557
- package/dist/tests/test-server-utils.js +0 -32
- package/dist/tests/test-session-rehydration.js +0 -148
- package/dist/tests/test-setup-integration.js +0 -98
- package/dist/tests/test-setup-scenarios.js +0 -322
- package/dist/tests/test-standalone.js +0 -143
- package/dist/tests/test-stub-registry.js +0 -136
- package/dist/tests/test-sync-stubs.js +0 -143
- package/dist/tests/test-sync-version-update.js +0 -93
- package/dist/tests/test-telemetry.js +0 -193
- package/dist/tests/test-token-validator.js +0 -30
- package/dist/tests/test-user-journey.js +0 -236
- package/dist/tests/test-users-to-target-workflow.js +0 -253
- package/dist/tests/test-utils.js +0 -109
- package/dist/tests/test-wizard.js +0 -71
- package/dist/tests/test-workflow-discovery.js +0 -242
- package/labels.json +0 -52
- package/registry/agent-guardrails.md +0 -63
- package/registry/fraim.md +0 -48
- package/setup.js +0 -171
- package/tsconfig.json +0 -23
|
@@ -1,80 +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_child_process_1 = require("node:child_process");
|
|
7
|
-
const axios_1 = __importDefault(require("axios"));
|
|
8
|
-
const db_service_js_1 = require("../src/fraim/db-service.js");
|
|
9
|
-
const test_utils_1 = require("./test-utils");
|
|
10
|
-
const tree_kill_1 = __importDefault(require("tree-kill"));
|
|
11
|
-
const test_server_utils_1 = require("./test-server-utils");
|
|
12
|
-
async function debugListTools() {
|
|
13
|
-
console.log(' 🔍 Debugging Available Tools...');
|
|
14
|
-
let fraimProcess;
|
|
15
|
-
let dbService;
|
|
16
|
-
const PORT = Math.floor(Math.random() * 1000) + 10000; // Random port to avoid conflicts
|
|
17
|
-
const TEST_API_KEY = 'debug-tools-key';
|
|
18
|
-
const BASE_URL = `http://localhost:${PORT}`;
|
|
19
|
-
try {
|
|
20
|
-
// 1. Seed API key
|
|
21
|
-
dbService = new db_service_js_1.FraimDbService();
|
|
22
|
-
await dbService.connect();
|
|
23
|
-
const db = dbService.db;
|
|
24
|
-
await db.collection('fraim_api_keys').updateOne({ key: TEST_API_KEY }, { $set: { userId: 'debug@test.com', orgId: 'debug-org', isActive: true, createdAt: new Date() } }, { upsert: true });
|
|
25
|
-
// 2. Start server
|
|
26
|
-
const npxCommand = process.platform === 'win32' ? 'npx.cmd' : 'npx';
|
|
27
|
-
const serverScript = (0, test_server_utils_1.getServerScriptPath)();
|
|
28
|
-
fraimProcess = (0, node_child_process_1.spawn)(npxCommand, ['node', `"${serverScript}"`], {
|
|
29
|
-
env: { ...process.env, FRAIM_MCP_PORT: PORT.toString(), FRAIM_SKIP_INDEX_ON_START: 'true' },
|
|
30
|
-
shell: true
|
|
31
|
-
});
|
|
32
|
-
// 3. Wait for start
|
|
33
|
-
let started = false;
|
|
34
|
-
for (let i = 0; i < 15; i++) {
|
|
35
|
-
try {
|
|
36
|
-
await axios_1.default.get(`${BASE_URL}/health`, { timeout: 1000 });
|
|
37
|
-
started = true;
|
|
38
|
-
break;
|
|
39
|
-
}
|
|
40
|
-
catch (e) {
|
|
41
|
-
await new Promise(r => setTimeout(r, 1000));
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
if (!started)
|
|
45
|
-
return false;
|
|
46
|
-
// 4. Call tools/list
|
|
47
|
-
const response = await axios_1.default.post(`${BASE_URL}/mcp`, {
|
|
48
|
-
jsonrpc: '2.0',
|
|
49
|
-
id: 1,
|
|
50
|
-
method: 'tools/list',
|
|
51
|
-
params: {}
|
|
52
|
-
}, { headers: { 'x-api-key': TEST_API_KEY } });
|
|
53
|
-
console.log(' 🛠️ Tools found:');
|
|
54
|
-
response.data.result.tools.forEach((t) => {
|
|
55
|
-
console.log(` - ${t.name}: ${t.description.split('\n')[0]}`);
|
|
56
|
-
});
|
|
57
|
-
const hasFraimConnect = response.data.result.tools.some((t) => t.name === 'fraim_connect');
|
|
58
|
-
console.log(` ❓ Has fraim_connect: ${hasFraimConnect}`);
|
|
59
|
-
return true;
|
|
60
|
-
}
|
|
61
|
-
catch (e) {
|
|
62
|
-
console.error(e);
|
|
63
|
-
return false;
|
|
64
|
-
}
|
|
65
|
-
finally {
|
|
66
|
-
if (dbService)
|
|
67
|
-
await dbService.close().catch(() => { });
|
|
68
|
-
if (fraimProcess && fraimProcess.pid) {
|
|
69
|
-
await new Promise((resolve) => (0, tree_kill_1.default)(fraimProcess.pid, 'SIGKILL', () => resolve()));
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
async function runTest(testCase) {
|
|
74
|
-
return await testCase.testFunction();
|
|
75
|
-
}
|
|
76
|
-
(0, test_utils_1.runTests)([{
|
|
77
|
-
name: 'Debug Tools List',
|
|
78
|
-
testFunction: debugListTools,
|
|
79
|
-
tags: ['debug']
|
|
80
|
-
}], runTest, 'Debug Tools');
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Shared server utilities for tests
|
|
4
|
-
* All tests should use these utilities instead of starting their own servers
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.getTestServerUrl = getTestServerUrl;
|
|
8
|
-
exports.getTestServerPort = getTestServerPort;
|
|
9
|
-
exports.getMcpEndpoint = getMcpEndpoint;
|
|
10
|
-
exports.getHealthEndpoint = getHealthEndpoint;
|
|
11
|
-
exports.isServerRunning = isServerRunning;
|
|
12
|
-
exports.waitForServer = waitForServer;
|
|
13
|
-
const SERVER_URL = process.env.FRAIM_TEST_SERVER_URL || 'http://localhost:12999';
|
|
14
|
-
const SERVER_PORT = parseInt(process.env.FRAIM_TEST_SERVER_PORT || '12999');
|
|
15
|
-
function getTestServerUrl() {
|
|
16
|
-
return SERVER_URL;
|
|
17
|
-
}
|
|
18
|
-
function getTestServerPort() {
|
|
19
|
-
return SERVER_PORT;
|
|
20
|
-
}
|
|
21
|
-
function getMcpEndpoint() {
|
|
22
|
-
return `${SERVER_URL}/mcp`;
|
|
23
|
-
}
|
|
24
|
-
function getHealthEndpoint() {
|
|
25
|
-
return `${SERVER_URL}/health`;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Check if the shared test server is running
|
|
29
|
-
*/
|
|
30
|
-
async function isServerRunning() {
|
|
31
|
-
try {
|
|
32
|
-
const axios = require('axios');
|
|
33
|
-
await axios.get(getHealthEndpoint(), { timeout: 1000 });
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
36
|
-
catch {
|
|
37
|
-
return false;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Wait for the shared server to be ready
|
|
42
|
-
* This is useful for tests that run early in the suite
|
|
43
|
-
*/
|
|
44
|
-
async function waitForServer(timeoutMs = 10000) {
|
|
45
|
-
const axios = require('axios');
|
|
46
|
-
const startTime = Date.now();
|
|
47
|
-
while (Date.now() - startTime < timeoutMs) {
|
|
48
|
-
try {
|
|
49
|
-
await axios.get(getHealthEndpoint(), { timeout: 1000 });
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
catch {
|
|
53
|
-
await new Promise(resolve => setTimeout(resolve, 500));
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
throw new Error(`Shared test server not ready after ${timeoutMs}ms`);
|
|
57
|
-
}
|
|
@@ -1,283 +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 node_test_1 = require("node:test");
|
|
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
|
-
// Test the add-ide command functionality without interactive prompts
|
|
45
|
-
(0, node_test_1.test)('add-ide command - list option shows supported IDEs', async () => {
|
|
46
|
-
// Import the module dynamically to avoid issues with mocking
|
|
47
|
-
const { runAddIDE } = await Promise.resolve().then(() => __importStar(require('../src/cli/commands/add-ide')));
|
|
48
|
-
let consoleOutput = [];
|
|
49
|
-
const originalConsoleLog = console.log;
|
|
50
|
-
console.log = (...args) => {
|
|
51
|
-
consoleOutput.push(args.join(' '));
|
|
52
|
-
};
|
|
53
|
-
try {
|
|
54
|
-
await runAddIDE({ list: true });
|
|
55
|
-
// Check that output contains supported IDEs
|
|
56
|
-
const output = consoleOutput.join('\n');
|
|
57
|
-
(0, node_assert_1.default)(output.includes('Supported IDEs'), 'Should show supported IDEs header');
|
|
58
|
-
(0, node_assert_1.default)(output.includes('Claude'), 'Should list Claude');
|
|
59
|
-
(0, node_assert_1.default)(output.includes('Antigravity'), 'Should list Antigravity');
|
|
60
|
-
(0, node_assert_1.default)(output.includes('Kiro'), 'Should list Kiro');
|
|
61
|
-
}
|
|
62
|
-
finally {
|
|
63
|
-
console.log = originalConsoleLog;
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
(0, node_test_1.test)('add-ide command - validates IDE names', async () => {
|
|
67
|
-
// Test the findIDEByName function directly to avoid interactive prompts
|
|
68
|
-
const { findIDEByName } = await Promise.resolve().then(() => __importStar(require('../src/cli/setup/ide-detector')));
|
|
69
|
-
// Test valid IDE names
|
|
70
|
-
(0, node_assert_1.default)(findIDEByName('claude'), 'Should find Claude');
|
|
71
|
-
(0, node_assert_1.default)(findIDEByName('antigravity'), 'Should find Antigravity');
|
|
72
|
-
(0, node_assert_1.default)(findIDEByName('kiro'), 'Should find Kiro');
|
|
73
|
-
(0, node_assert_1.default)(findIDEByName('cursor'), 'Should find Cursor');
|
|
74
|
-
// Test case insensitive matching
|
|
75
|
-
(0, node_assert_1.default)(findIDEByName('CLAUDE'), 'Should find Claude case insensitive');
|
|
76
|
-
(0, node_assert_1.default)(findIDEByName('AntiGravity'), 'Should find Antigravity case insensitive');
|
|
77
|
-
// Test invalid IDE name
|
|
78
|
-
(0, node_assert_1.default)(!findIDEByName('nonexistent-ide'), 'Should not find nonexistent IDE');
|
|
79
|
-
});
|
|
80
|
-
(0, node_test_1.test)('add-ide command - detects IDEs correctly', async () => {
|
|
81
|
-
const { detectInstalledIDEs, getAllSupportedIDEs } = await Promise.resolve().then(() => __importStar(require('../src/cli/setup/ide-detector')));
|
|
82
|
-
const allIDEs = getAllSupportedIDEs();
|
|
83
|
-
const detectedIDEs = detectInstalledIDEs();
|
|
84
|
-
// Should have all supported IDEs defined
|
|
85
|
-
(0, node_assert_1.default)(allIDEs.length >= 7, 'Should have at least 7 supported IDEs');
|
|
86
|
-
// Detected IDEs should be a subset of all IDEs
|
|
87
|
-
(0, node_assert_1.default)(detectedIDEs.length <= allIDEs.length, 'Detected IDEs should not exceed total supported');
|
|
88
|
-
// Each detected IDE should have required properties
|
|
89
|
-
detectedIDEs.forEach(ide => {
|
|
90
|
-
(0, node_assert_1.default)(ide.name, 'IDE should have a name');
|
|
91
|
-
(0, node_assert_1.default)(ide.configPath, 'IDE should have a config path');
|
|
92
|
-
(0, node_assert_1.default)(['json', 'toml'].includes(ide.configFormat), 'IDE should have valid config format');
|
|
93
|
-
});
|
|
94
|
-
});
|
|
95
|
-
(0, node_test_1.test)('add-ide command - loadGlobalConfig scenarios', async () => {
|
|
96
|
-
const { loadGlobalConfig } = await Promise.resolve().then(() => __importStar(require('../src/cli/commands/add-ide')));
|
|
97
|
-
const tempHomeDir = path_1.default.join(os_1.default.tmpdir(), '.fraim-test-add-ide-' + Date.now());
|
|
98
|
-
const originalHomedir = os_1.default.homedir;
|
|
99
|
-
os_1.default.homedir = () => tempHomeDir;
|
|
100
|
-
try {
|
|
101
|
-
// Test 1: No global config exists
|
|
102
|
-
const result1 = loadGlobalConfig();
|
|
103
|
-
node_assert_1.default.strictEqual(result1, null, 'Should return null when no config exists');
|
|
104
|
-
// Test 2: Valid config with both keys
|
|
105
|
-
const globalConfigDir = path_1.default.join(tempHomeDir, '.fraim');
|
|
106
|
-
const globalConfigPath = path_1.default.join(globalConfigDir, 'config.json');
|
|
107
|
-
fs_1.default.mkdirSync(globalConfigDir, { recursive: true });
|
|
108
|
-
const validConfig = {
|
|
109
|
-
version: '2.0.27',
|
|
110
|
-
apiKey: 'fraim_test_key',
|
|
111
|
-
githubToken: 'ghp_test_token',
|
|
112
|
-
configuredAt: new Date().toISOString()
|
|
113
|
-
};
|
|
114
|
-
fs_1.default.writeFileSync(globalConfigPath, JSON.stringify(validConfig, null, 2));
|
|
115
|
-
const result2 = loadGlobalConfig();
|
|
116
|
-
(0, node_assert_1.default)(result2, 'Should return config object');
|
|
117
|
-
node_assert_1.default.strictEqual(result2.fraimKey, 'fraim_test_key', 'Should extract FRAIM key');
|
|
118
|
-
node_assert_1.default.strictEqual(result2.githubToken, 'ghp_test_token', 'Should extract GitHub token');
|
|
119
|
-
// Test 3: Config missing GitHub token
|
|
120
|
-
const configWithoutGithub = {
|
|
121
|
-
version: '2.0.27',
|
|
122
|
-
apiKey: 'fraim_test_key_no_github',
|
|
123
|
-
configuredAt: new Date().toISOString()
|
|
124
|
-
};
|
|
125
|
-
fs_1.default.writeFileSync(globalConfigPath, JSON.stringify(configWithoutGithub, null, 2));
|
|
126
|
-
const result3 = loadGlobalConfig();
|
|
127
|
-
(0, node_assert_1.default)(result3, 'Should return config object even without GitHub token');
|
|
128
|
-
node_assert_1.default.strictEqual(result3.fraimKey, 'fraim_test_key_no_github', 'Should extract FRAIM key');
|
|
129
|
-
node_assert_1.default.strictEqual(result3.githubToken, undefined, 'GitHub token should be undefined');
|
|
130
|
-
}
|
|
131
|
-
finally {
|
|
132
|
-
// Cleanup
|
|
133
|
-
fs_1.default.rmSync(tempHomeDir, { recursive: true, force: true });
|
|
134
|
-
os_1.default.homedir = originalHomedir;
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
(0, node_test_1.test)('add-ide command - saveGitHubTokenToConfig functionality', async () => {
|
|
138
|
-
const { saveGitHubTokenToConfig } = await Promise.resolve().then(() => __importStar(require('../src/cli/commands/add-ide')));
|
|
139
|
-
const tempHomeDir = path_1.default.join(os_1.default.tmpdir(), '.fraim-test-save-token-' + Date.now());
|
|
140
|
-
const originalHomedir = os_1.default.homedir;
|
|
141
|
-
os_1.default.homedir = () => tempHomeDir;
|
|
142
|
-
try {
|
|
143
|
-
const globalConfigDir = path_1.default.join(tempHomeDir, '.fraim');
|
|
144
|
-
const globalConfigPath = path_1.default.join(globalConfigDir, 'config.json');
|
|
145
|
-
// Create initial config without GitHub token
|
|
146
|
-
fs_1.default.mkdirSync(globalConfigDir, { recursive: true });
|
|
147
|
-
const initialConfig = {
|
|
148
|
-
version: '2.0.27',
|
|
149
|
-
apiKey: 'fraim_test_key',
|
|
150
|
-
configuredAt: new Date().toISOString(),
|
|
151
|
-
userPreferences: {
|
|
152
|
-
autoSync: true,
|
|
153
|
-
backupConfigs: true
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
fs_1.default.writeFileSync(globalConfigPath, JSON.stringify(initialConfig, null, 2));
|
|
157
|
-
// Mock console.log to capture output
|
|
158
|
-
let consoleOutput = [];
|
|
159
|
-
const originalConsoleLog = console.log;
|
|
160
|
-
console.log = (...args) => {
|
|
161
|
-
consoleOutput.push(args.join(' '));
|
|
162
|
-
};
|
|
163
|
-
try {
|
|
164
|
-
// Save GitHub token
|
|
165
|
-
saveGitHubTokenToConfig('ghp_newly_saved_token');
|
|
166
|
-
// Verify token was saved
|
|
167
|
-
const updatedConfig = JSON.parse(fs_1.default.readFileSync(globalConfigPath, 'utf8'));
|
|
168
|
-
node_assert_1.default.strictEqual(updatedConfig.githubToken, 'ghp_newly_saved_token', 'GitHub token should be saved');
|
|
169
|
-
node_assert_1.default.strictEqual(updatedConfig.apiKey, 'fraim_test_key', 'FRAIM key should be preserved');
|
|
170
|
-
(0, node_assert_1.default)(updatedConfig.userPreferences, 'User preferences should be preserved');
|
|
171
|
-
// Check console output
|
|
172
|
-
const output = consoleOutput.join('\n');
|
|
173
|
-
(0, node_assert_1.default)(output.includes('GitHub token saved'), 'Should show success message');
|
|
174
|
-
}
|
|
175
|
-
finally {
|
|
176
|
-
console.log = originalConsoleLog;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
finally {
|
|
180
|
-
// Cleanup
|
|
181
|
-
fs_1.default.rmSync(tempHomeDir, { recursive: true, force: true });
|
|
182
|
-
os_1.default.homedir = originalHomedir;
|
|
183
|
-
}
|
|
184
|
-
});
|
|
185
|
-
(0, node_test_1.test)('add-ide command - error handling for missing setup', async () => {
|
|
186
|
-
const { runAddIDE } = await Promise.resolve().then(() => __importStar(require('../src/cli/commands/add-ide')));
|
|
187
|
-
const tempHomeDir = path_1.default.join(os_1.default.tmpdir(), '.fraim-test-no-setup-' + Date.now());
|
|
188
|
-
const originalHomedir = os_1.default.homedir;
|
|
189
|
-
// Mock process.exit to prevent actual exit
|
|
190
|
-
let exitCode = null;
|
|
191
|
-
const originalExit = process.exit;
|
|
192
|
-
process.exit = ((code) => {
|
|
193
|
-
exitCode = code || 0;
|
|
194
|
-
throw new Error(`Process exit called with code ${code}`);
|
|
195
|
-
});
|
|
196
|
-
// Mock console.log to capture output
|
|
197
|
-
let consoleOutput = [];
|
|
198
|
-
const originalConsoleLog = console.log;
|
|
199
|
-
console.log = (...args) => {
|
|
200
|
-
consoleOutput.push(args.join(' '));
|
|
201
|
-
};
|
|
202
|
-
os_1.default.homedir = () => tempHomeDir;
|
|
203
|
-
try {
|
|
204
|
-
// Try to run add-ide without any global config
|
|
205
|
-
await runAddIDE({});
|
|
206
|
-
node_assert_1.default.fail('Should have exited due to missing config');
|
|
207
|
-
}
|
|
208
|
-
catch (error) {
|
|
209
|
-
// Expected to throw due to process.exit mock
|
|
210
|
-
node_assert_1.default.strictEqual(exitCode, 1, 'Should exit with code 1');
|
|
211
|
-
const output = consoleOutput.join('\n');
|
|
212
|
-
(0, node_assert_1.default)(output.includes('No FRAIM configuration found'), 'Should show missing config error');
|
|
213
|
-
(0, node_assert_1.default)(output.includes('fraim setup'), 'Should suggest running setup');
|
|
214
|
-
}
|
|
215
|
-
finally {
|
|
216
|
-
// Restore mocks
|
|
217
|
-
process.exit = originalExit;
|
|
218
|
-
console.log = originalConsoleLog;
|
|
219
|
-
os_1.default.homedir = originalHomedir;
|
|
220
|
-
// Cleanup
|
|
221
|
-
fs_1.default.rmSync(tempHomeDir, { recursive: true, force: true });
|
|
222
|
-
}
|
|
223
|
-
});
|
|
224
|
-
(0, node_test_1.test)('add-ide command - handles invalid IDE name gracefully', async () => {
|
|
225
|
-
const { runAddIDE } = await Promise.resolve().then(() => __importStar(require('../src/cli/commands/add-ide')));
|
|
226
|
-
const tempHomeDir = path_1.default.join(os_1.default.tmpdir(), '.fraim-test-invalid-ide-' + Date.now());
|
|
227
|
-
const originalHomedir = os_1.default.homedir;
|
|
228
|
-
os_1.default.homedir = () => tempHomeDir;
|
|
229
|
-
// Mock process.exit to prevent actual exit
|
|
230
|
-
let exitCalled = false;
|
|
231
|
-
const originalExit = process.exit;
|
|
232
|
-
process.exit = ((code) => {
|
|
233
|
-
exitCalled = true;
|
|
234
|
-
throw new Error(`Process exit called with code ${code}`);
|
|
235
|
-
});
|
|
236
|
-
try {
|
|
237
|
-
// Create valid global config
|
|
238
|
-
const globalConfigDir = path_1.default.join(tempHomeDir, '.fraim');
|
|
239
|
-
const globalConfigPath = path_1.default.join(globalConfigDir, 'config.json');
|
|
240
|
-
fs_1.default.mkdirSync(globalConfigDir, { recursive: true });
|
|
241
|
-
const validConfig = {
|
|
242
|
-
version: '2.0.27',
|
|
243
|
-
apiKey: 'fraim_test_key',
|
|
244
|
-
githubToken: 'ghp_test_token',
|
|
245
|
-
configuredAt: new Date().toISOString()
|
|
246
|
-
};
|
|
247
|
-
fs_1.default.writeFileSync(globalConfigPath, JSON.stringify(validConfig, null, 2));
|
|
248
|
-
// Create fake IDE directory to make detectInstalledIDEs return at least one IDE
|
|
249
|
-
const fakeClaudeDir = path_1.default.join(tempHomeDir, '.claude.json');
|
|
250
|
-
fs_1.default.writeFileSync(fakeClaudeDir, '{}'); // Create fake Claude config file
|
|
251
|
-
// Mock console.log to capture output
|
|
252
|
-
let consoleOutput = [];
|
|
253
|
-
const originalConsoleLog = console.log;
|
|
254
|
-
console.log = (...args) => {
|
|
255
|
-
consoleOutput.push(args.join(' '));
|
|
256
|
-
};
|
|
257
|
-
try {
|
|
258
|
-
// Try to configure invalid IDE
|
|
259
|
-
await runAddIDE({ ide: 'nonexistent-ide' });
|
|
260
|
-
const output = consoleOutput.join('\n');
|
|
261
|
-
// Strip ANSI color codes for testing
|
|
262
|
-
const cleanOutput = output.replace(/\u001b\[[0-9;]*m/g, '');
|
|
263
|
-
(0, node_assert_1.default)(cleanOutput.includes('not supported.'), 'Should show IDE not supported error');
|
|
264
|
-
(0, node_assert_1.default)(cleanOutput.includes('fraim add-ide --list'), 'Should suggest list command');
|
|
265
|
-
}
|
|
266
|
-
catch (error) {
|
|
267
|
-
// If process.exit was called, that's not what we're testing
|
|
268
|
-
if (exitCalled) {
|
|
269
|
-
node_assert_1.default.fail('Process.exit was called - config loading failed');
|
|
270
|
-
}
|
|
271
|
-
throw error;
|
|
272
|
-
}
|
|
273
|
-
finally {
|
|
274
|
-
console.log = originalConsoleLog;
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
finally {
|
|
278
|
-
// Cleanup
|
|
279
|
-
process.exit = originalExit;
|
|
280
|
-
fs_1.default.rmSync(tempHomeDir, { recursive: true, force: true });
|
|
281
|
-
os_1.default.homedir = originalHomedir;
|
|
282
|
-
}
|
|
283
|
-
});
|