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,368 +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_child_process_1 = require("node:child_process");
|
|
40
|
-
const test_utils_1 = require("./test-utils");
|
|
41
|
-
const node_assert_1 = __importDefault(require("node:assert"));
|
|
42
|
-
const fs_1 = __importDefault(require("fs"));
|
|
43
|
-
const path_1 = __importDefault(require("path"));
|
|
44
|
-
const os_1 = __importDefault(require("os"));
|
|
45
|
-
/**
|
|
46
|
-
* Helper to run init with TEST_MODE to avoid hanging on prompts
|
|
47
|
-
*/
|
|
48
|
-
async function runNonInteractiveInit(cwd) {
|
|
49
|
-
const cliScript = (0, test_utils_1.resolveProjectPath)('dist/src/cli/fraim.js');
|
|
50
|
-
return new Promise(resolve => {
|
|
51
|
-
const ps = (0, node_child_process_1.spawn)('node', [cliScript, 'init'], {
|
|
52
|
-
cwd,
|
|
53
|
-
env: { ...process.env, TEST_MODE: 'true' }, // Use TEST_MODE to skip prompts
|
|
54
|
-
shell: false,
|
|
55
|
-
stdio: 'pipe'
|
|
56
|
-
});
|
|
57
|
-
let stdout = '';
|
|
58
|
-
let stderr = '';
|
|
59
|
-
const timeout = setTimeout(() => {
|
|
60
|
-
ps.kill('SIGTERM');
|
|
61
|
-
resolve({ stdout, stderr, code: -1 });
|
|
62
|
-
}, 10000);
|
|
63
|
-
ps.stdout.on('data', d => stdout += d.toString());
|
|
64
|
-
ps.stderr.on('data', d => stderr += d.toString());
|
|
65
|
-
ps.on('close', code => {
|
|
66
|
-
clearTimeout(timeout);
|
|
67
|
-
resolve({ stdout, stderr, code });
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Helper to run first-run experience directly to test configuration detection
|
|
73
|
-
*/
|
|
74
|
-
async function runFirstRunExperience(cwd, clearGlobalConfig = false) {
|
|
75
|
-
const globalConfigPath = path_1.default.join(os_1.default.homedir(), '.fraim', 'config.json');
|
|
76
|
-
const backupPath = globalConfigPath + '.backup-test';
|
|
77
|
-
let configMoved = false;
|
|
78
|
-
// Temporarily move global config if needed
|
|
79
|
-
if (clearGlobalConfig && fs_1.default.existsSync(globalConfigPath)) {
|
|
80
|
-
try {
|
|
81
|
-
fs_1.default.renameSync(globalConfigPath, backupPath);
|
|
82
|
-
configMoved = true;
|
|
83
|
-
}
|
|
84
|
-
catch (e) {
|
|
85
|
-
// Ignore if we can't move it
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
return new Promise(resolve => {
|
|
89
|
-
// Import and run the first-run experience directly
|
|
90
|
-
const { runFirstRunExperience } = require((0, test_utils_1.resolveProjectPath)('dist/src/cli/setup/first-run.js'));
|
|
91
|
-
// Capture console output
|
|
92
|
-
let stdout = '';
|
|
93
|
-
const originalLog = console.log;
|
|
94
|
-
const originalWarn = console.warn;
|
|
95
|
-
console.log = (...args) => {
|
|
96
|
-
stdout += args.join(' ') + '\n';
|
|
97
|
-
originalLog(...args);
|
|
98
|
-
};
|
|
99
|
-
console.warn = (...args) => {
|
|
100
|
-
stdout += args.join(' ') + '\n';
|
|
101
|
-
originalWarn(...args);
|
|
102
|
-
};
|
|
103
|
-
const timeout = setTimeout(() => {
|
|
104
|
-
console.log = originalLog;
|
|
105
|
-
console.warn = originalWarn;
|
|
106
|
-
resolve({ stdout, stderr: '', code: -1 });
|
|
107
|
-
}, 5000);
|
|
108
|
-
// Set TEST_MODE to avoid interactive prompts
|
|
109
|
-
const originalTestMode = process.env.TEST_MODE;
|
|
110
|
-
process.env.TEST_MODE = 'true';
|
|
111
|
-
runFirstRunExperience()
|
|
112
|
-
.then(() => {
|
|
113
|
-
clearTimeout(timeout);
|
|
114
|
-
console.log = originalLog;
|
|
115
|
-
console.warn = originalWarn;
|
|
116
|
-
process.env.TEST_MODE = originalTestMode;
|
|
117
|
-
// Restore global config if we moved it
|
|
118
|
-
if (configMoved && fs_1.default.existsSync(backupPath)) {
|
|
119
|
-
try {
|
|
120
|
-
fs_1.default.renameSync(backupPath, globalConfigPath);
|
|
121
|
-
}
|
|
122
|
-
catch (e) {
|
|
123
|
-
// Ignore restore errors
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
resolve({ stdout, stderr: '', code: 0 });
|
|
127
|
-
})
|
|
128
|
-
.catch((error) => {
|
|
129
|
-
clearTimeout(timeout);
|
|
130
|
-
console.log = originalLog;
|
|
131
|
-
console.warn = originalWarn;
|
|
132
|
-
process.env.TEST_MODE = originalTestMode;
|
|
133
|
-
// Restore global config if we moved it
|
|
134
|
-
if (configMoved && fs_1.default.existsSync(backupPath)) {
|
|
135
|
-
try {
|
|
136
|
-
fs_1.default.renameSync(backupPath, globalConfigPath);
|
|
137
|
-
}
|
|
138
|
-
catch (e) {
|
|
139
|
-
// Ignore restore errors
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
resolve({ stdout, stderr: error.message, code: 1 });
|
|
143
|
-
});
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
const testCases = [
|
|
147
|
-
{
|
|
148
|
-
name: 'Journey: Non-Interactive Init Works',
|
|
149
|
-
testFunction: async () => {
|
|
150
|
-
const tempDir = fs_1.default.mkdtempSync(path_1.default.join(os_1.default.tmpdir(), 'fraim-jour-1-'));
|
|
151
|
-
try {
|
|
152
|
-
// Set up git repository with remote (required for new init logic)
|
|
153
|
-
const { execSync } = await Promise.resolve().then(() => __importStar(require('child_process')));
|
|
154
|
-
execSync('git init', { cwd: tempDir, stdio: 'ignore' });
|
|
155
|
-
execSync('git remote add origin https://github.com/test-owner/test-repo.git', { cwd: tempDir, stdio: 'ignore' });
|
|
156
|
-
// Create a dummy commit and set up the remote HEAD
|
|
157
|
-
try {
|
|
158
|
-
execSync('git config user.email "test@example.com"', { cwd: tempDir, stdio: 'ignore' });
|
|
159
|
-
execSync('git config user.name "Test User"', { cwd: tempDir, stdio: 'ignore' });
|
|
160
|
-
execSync('echo "# Test" > README.md', { cwd: tempDir, stdio: 'ignore' });
|
|
161
|
-
execSync('git add README.md', { cwd: tempDir, stdio: 'ignore' });
|
|
162
|
-
execSync('git commit -m "Initial commit"', { cwd: tempDir, stdio: 'ignore' });
|
|
163
|
-
execSync('git branch -M master', { cwd: tempDir, stdio: 'ignore' });
|
|
164
|
-
}
|
|
165
|
-
catch (e) {
|
|
166
|
-
// Ignore git setup errors for test
|
|
167
|
-
}
|
|
168
|
-
const res = await runNonInteractiveInit(tempDir);
|
|
169
|
-
node_assert_1.default.strictEqual(res.code, 0, `Init failed with code ${res.code}. Stdout: ${res.stdout}. Stderr: ${res.stderr}`);
|
|
170
|
-
node_assert_1.default.ok(res.stdout.includes('FRAIM initialized successfully'), 'Expected success message');
|
|
171
|
-
// VERIFY CONFIG EXISTS
|
|
172
|
-
const configPath = path_1.default.join(tempDir, '.fraim', 'config.json');
|
|
173
|
-
node_assert_1.default.ok(fs_1.default.existsSync(configPath), 'Config file missing');
|
|
174
|
-
const config = JSON.parse(fs_1.default.readFileSync(configPath, 'utf8'));
|
|
175
|
-
node_assert_1.default.strictEqual(config.repository.owner, 'test-owner', 'Owner not detected correctly');
|
|
176
|
-
node_assert_1.default.strictEqual(config.repository.name, 'test-repo', 'Repo name not detected correctly');
|
|
177
|
-
// VERIFY WORKFLOWS EXIST
|
|
178
|
-
const workflowsDir = path_1.default.join(tempDir, '.fraim', 'workflows');
|
|
179
|
-
node_assert_1.default.ok(fs_1.default.existsSync(workflowsDir), 'Workflows dir missing');
|
|
180
|
-
const stubs = fs_1.default.readdirSync(workflowsDir);
|
|
181
|
-
node_assert_1.default.ok(stubs.length > 0, 'No workflow stubs created');
|
|
182
|
-
return true;
|
|
183
|
-
}
|
|
184
|
-
finally {
|
|
185
|
-
// Better cleanup for Windows
|
|
186
|
-
try {
|
|
187
|
-
if (fs_1.default.existsSync(tempDir)) {
|
|
188
|
-
// Try to remove read-only attributes on Windows
|
|
189
|
-
if (process.platform === 'win32') {
|
|
190
|
-
const { execSync } = await Promise.resolve().then(() => __importStar(require('child_process')));
|
|
191
|
-
try {
|
|
192
|
-
execSync(`attrib -R "${tempDir}\\*.*" /S /D`, { stdio: 'ignore' });
|
|
193
|
-
}
|
|
194
|
-
catch (e) {
|
|
195
|
-
// Ignore attrib errors
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
fs_1.default.rmSync(tempDir, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 });
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
catch (e) {
|
|
202
|
-
console.warn(`Warning: Could not clean up temp dir ${tempDir}:`, e instanceof Error ? e.message : String(e));
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
},
|
|
206
|
-
tags: ['cli', 'journey', 'init']
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
name: 'Journey: Config Structure is Clean',
|
|
210
|
-
testFunction: async () => {
|
|
211
|
-
const tempDir = fs_1.default.mkdtempSync(path_1.default.join(os_1.default.tmpdir(), 'fraim-jour-2-'));
|
|
212
|
-
try {
|
|
213
|
-
// Set up git repository with remote (required for new init logic)
|
|
214
|
-
const { execSync } = await Promise.resolve().then(() => __importStar(require('child_process')));
|
|
215
|
-
execSync('git init', { cwd: tempDir, stdio: 'ignore' });
|
|
216
|
-
execSync('git remote add origin https://github.com/test-owner/test-repo.git', { cwd: tempDir, stdio: 'ignore' });
|
|
217
|
-
// Create a dummy commit and set up the remote HEAD
|
|
218
|
-
try {
|
|
219
|
-
execSync('git config user.email "test@example.com"', { cwd: tempDir, stdio: 'ignore' });
|
|
220
|
-
execSync('git config user.name "Test User"', { cwd: tempDir, stdio: 'ignore' });
|
|
221
|
-
execSync('echo "# Test" > README.md', { cwd: tempDir, stdio: 'ignore' });
|
|
222
|
-
execSync('git add README.md', { cwd: tempDir, stdio: 'ignore' });
|
|
223
|
-
execSync('git commit -m "Initial commit"', { cwd: tempDir, stdio: 'ignore' });
|
|
224
|
-
execSync('git branch -M master', { cwd: tempDir, stdio: 'ignore' });
|
|
225
|
-
}
|
|
226
|
-
catch (e) {
|
|
227
|
-
// Ignore git setup errors for test
|
|
228
|
-
}
|
|
229
|
-
const res = await runNonInteractiveInit(tempDir);
|
|
230
|
-
node_assert_1.default.strictEqual(res.code, 0, `Init failed with code ${res.code}. Stdout: ${res.stdout}. Stderr: ${res.stderr}`);
|
|
231
|
-
const configPath = path_1.default.join(tempDir, '.fraim', 'config.json');
|
|
232
|
-
node_assert_1.default.ok(fs_1.default.existsSync(configPath), 'Config file missing');
|
|
233
|
-
const config = JSON.parse(fs_1.default.readFileSync(configPath, 'utf8'));
|
|
234
|
-
// Verify clean structure
|
|
235
|
-
node_assert_1.default.ok(config.version, 'Version missing');
|
|
236
|
-
node_assert_1.default.ok(config.project, 'Project section missing');
|
|
237
|
-
node_assert_1.default.ok(config.repository, 'Repository section missing');
|
|
238
|
-
node_assert_1.default.ok(config.customizations, 'Customizations section missing');
|
|
239
|
-
// Verify no optional fields are present unless needed
|
|
240
|
-
node_assert_1.default.strictEqual(config.persona, undefined, 'Persona should not be present in clean config');
|
|
241
|
-
node_assert_1.default.strictEqual(config.marketing, undefined, 'Marketing should not be present in clean config');
|
|
242
|
-
node_assert_1.default.strictEqual(config.database, undefined, 'Database should not be present in clean config');
|
|
243
|
-
return true;
|
|
244
|
-
}
|
|
245
|
-
finally {
|
|
246
|
-
// Better cleanup for Windows
|
|
247
|
-
try {
|
|
248
|
-
if (fs_1.default.existsSync(tempDir)) {
|
|
249
|
-
// Try to remove read-only attributes on Windows
|
|
250
|
-
if (process.platform === 'win32') {
|
|
251
|
-
const { execSync } = await Promise.resolve().then(() => __importStar(require('child_process')));
|
|
252
|
-
try {
|
|
253
|
-
execSync(`attrib -R "${tempDir}\\*.*" /S /D`, { stdio: 'ignore' });
|
|
254
|
-
}
|
|
255
|
-
catch (e) {
|
|
256
|
-
// Ignore attrib errors
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
fs_1.default.rmSync(tempDir, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 });
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
catch (e) {
|
|
263
|
-
console.warn(`Warning: Could not clean up temp dir ${tempDir}:`, e instanceof Error ? e.message : String(e));
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
},
|
|
267
|
-
tags: ['cli', 'journey', 'init']
|
|
268
|
-
},
|
|
269
|
-
{
|
|
270
|
-
name: 'Journey: First Run Detects Existing Global Config',
|
|
271
|
-
testFunction: async () => {
|
|
272
|
-
// This test verifies that when a global FRAIM config exists,
|
|
273
|
-
// the first-run experience detects it and skips key setup
|
|
274
|
-
const res = await runFirstRunExperience('', false); // Don't clear global config
|
|
275
|
-
node_assert_1.default.strictEqual(res.code, 0, `First-run failed with code ${res.code}. Stdout: ${res.stdout}. Stderr: ${res.stderr}`);
|
|
276
|
-
// Should detect existing configuration
|
|
277
|
-
node_assert_1.default.ok(res.stdout.includes('Found existing FRAIM configuration') ||
|
|
278
|
-
res.stdout.includes('Found FRAIM MCP configuration') ||
|
|
279
|
-
res.stdout.includes('Skipping interactive first-run experience'), 'Should detect existing configuration');
|
|
280
|
-
// Should NOT ask for FRAIM key
|
|
281
|
-
node_assert_1.default.ok(!res.stdout.includes('Do you have a FRAIM key?'), 'Should not ask for FRAIM key when config exists');
|
|
282
|
-
return true;
|
|
283
|
-
},
|
|
284
|
-
tags: ['cli', 'journey', 'first-run', 'config-detection']
|
|
285
|
-
},
|
|
286
|
-
{
|
|
287
|
-
name: 'Journey: First Run From Scratch (No Existing Config)',
|
|
288
|
-
testFunction: async () => {
|
|
289
|
-
// This test verifies the first-run experience when no configuration exists
|
|
290
|
-
const res = await runFirstRunExperience('', true); // Clear global config
|
|
291
|
-
node_assert_1.default.strictEqual(res.code, 0, `First-run failed with code ${res.code}. Stdout: ${res.stdout}. Stderr: ${res.stderr}`);
|
|
292
|
-
// In TEST_MODE, should skip interactive setup
|
|
293
|
-
node_assert_1.default.ok(res.stdout.includes('Skipping interactive first-run experience'), 'Should skip interactive setup in TEST_MODE');
|
|
294
|
-
return true;
|
|
295
|
-
},
|
|
296
|
-
tags: ['cli', 'journey', 'first-run', 'fresh-install']
|
|
297
|
-
},
|
|
298
|
-
{
|
|
299
|
-
name: 'Journey: First Run Detects MCP Configuration',
|
|
300
|
-
testFunction: async () => {
|
|
301
|
-
// This test verifies that MCP configuration detection works
|
|
302
|
-
const kiroConfigPath = path_1.default.join(os_1.default.homedir(), '.kiro', 'settings', 'mcp.json');
|
|
303
|
-
// Check if Kiro MCP config exists (it should in this environment)
|
|
304
|
-
if (fs_1.default.existsSync(kiroConfigPath)) {
|
|
305
|
-
const res = await runFirstRunExperience('', true); // Clear global config but keep MCP
|
|
306
|
-
node_assert_1.default.strictEqual(res.code, 0, `First-run failed with code ${res.code}. Stdout: ${res.stdout}. Stderr: ${res.stderr}`);
|
|
307
|
-
// In TEST_MODE, should skip but we can verify the detection logic works
|
|
308
|
-
// by checking that the function completes without errors
|
|
309
|
-
node_assert_1.default.ok(res.stdout.includes('Skipping interactive first-run experience'), 'Should skip interactive setup in TEST_MODE');
|
|
310
|
-
}
|
|
311
|
-
return true;
|
|
312
|
-
},
|
|
313
|
-
tags: ['cli', 'journey', 'first-run', 'mcp-detection']
|
|
314
|
-
},
|
|
315
|
-
{
|
|
316
|
-
name: 'Journey: Default Branch Detection Works',
|
|
317
|
-
testFunction: async () => {
|
|
318
|
-
const tempDir = fs_1.default.mkdtempSync(path_1.default.join(os_1.default.tmpdir(), 'fraim-jour-branch-'));
|
|
319
|
-
try {
|
|
320
|
-
// Set up git repository with master branch (not main)
|
|
321
|
-
const { execSync } = await Promise.resolve().then(() => __importStar(require('child_process')));
|
|
322
|
-
execSync('git init', { cwd: tempDir, stdio: 'ignore' });
|
|
323
|
-
execSync('git remote add origin https://github.com/test-owner/test-repo.git', { cwd: tempDir, stdio: 'ignore' });
|
|
324
|
-
try {
|
|
325
|
-
execSync('git config user.email "test@example.com"', { cwd: tempDir, stdio: 'ignore' });
|
|
326
|
-
execSync('git config user.name "Test User"', { cwd: tempDir, stdio: 'ignore' });
|
|
327
|
-
execSync('echo "# Test" > README.md', { cwd: tempDir, stdio: 'ignore' });
|
|
328
|
-
execSync('git add README.md', { cwd: tempDir, stdio: 'ignore' });
|
|
329
|
-
execSync('git commit -m "Initial commit"', { cwd: tempDir, stdio: 'ignore' });
|
|
330
|
-
execSync('git branch -M master', { cwd: tempDir, stdio: 'ignore' });
|
|
331
|
-
}
|
|
332
|
-
catch (e) {
|
|
333
|
-
// Ignore git setup errors for test
|
|
334
|
-
}
|
|
335
|
-
const res = await runNonInteractiveInit(tempDir);
|
|
336
|
-
node_assert_1.default.strictEqual(res.code, 0, `Init failed with code ${res.code}. Stdout: ${res.stdout}. Stderr: ${res.stderr}`);
|
|
337
|
-
const configPath = path_1.default.join(tempDir, '.fraim', 'config.json');
|
|
338
|
-
node_assert_1.default.ok(fs_1.default.existsSync(configPath), 'Config file missing');
|
|
339
|
-
const config = JSON.parse(fs_1.default.readFileSync(configPath, 'utf8'));
|
|
340
|
-
// Should detect master as default branch (not main)
|
|
341
|
-
node_assert_1.default.strictEqual(config.repository.defaultBranch, 'master', 'Should detect master as default branch');
|
|
342
|
-
return true;
|
|
343
|
-
}
|
|
344
|
-
finally {
|
|
345
|
-
// Better cleanup for Windows
|
|
346
|
-
try {
|
|
347
|
-
if (fs_1.default.existsSync(tempDir)) {
|
|
348
|
-
if (process.platform === 'win32') {
|
|
349
|
-
const { execSync } = await Promise.resolve().then(() => __importStar(require('child_process')));
|
|
350
|
-
try {
|
|
351
|
-
execSync(`attrib -R "${tempDir}\\*.*" /S /D`, { stdio: 'ignore' });
|
|
352
|
-
}
|
|
353
|
-
catch (e) {
|
|
354
|
-
// Ignore attrib errors
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
fs_1.default.rmSync(tempDir, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 });
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
catch (e) {
|
|
361
|
-
console.warn(`Warning: Could not clean up temp dir ${tempDir}:`, e instanceof Error ? e.message : String(e));
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
},
|
|
365
|
-
tags: ['cli', 'journey', 'git', 'branch-detection']
|
|
366
|
-
}
|
|
367
|
-
];
|
|
368
|
-
(0, test_utils_1.runTests)(testCases, (tc) => tc.testFunction(), 'Fraim Setup Journeys');
|
|
@@ -1,59 +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 test_utils_1 = require("./test-utils");
|
|
7
|
-
const node_assert_1 = __importDefault(require("node:assert"));
|
|
8
|
-
const issues_1 = require("../src/fraim/issues");
|
|
9
|
-
async function testDryRun() {
|
|
10
|
-
console.log(' Testing dry-run issue creation...');
|
|
11
|
-
const result = await (0, issues_1.fileFraimIssue)({
|
|
12
|
-
title: 'Test Issue',
|
|
13
|
-
body: 'Test Body',
|
|
14
|
-
dryRun: true
|
|
15
|
-
});
|
|
16
|
-
node_assert_1.default.strictEqual(result.success, true, 'Dry run should succeed');
|
|
17
|
-
node_assert_1.default.strictEqual(result.dryRun, true, 'Result should indicate dry run');
|
|
18
|
-
node_assert_1.default.ok(result.message && result.message.includes('[DRY RUN]'), 'Message should indicate dry run');
|
|
19
|
-
return true;
|
|
20
|
-
}
|
|
21
|
-
async function testMissingToken() {
|
|
22
|
-
console.log(' Testing missing GITHUB_TOKEN...');
|
|
23
|
-
// Save original token
|
|
24
|
-
const originalToken = process.env.GITHUB_TOKEN;
|
|
25
|
-
delete process.env.GITHUB_TOKEN;
|
|
26
|
-
try {
|
|
27
|
-
const result = await (0, issues_1.fileFraimIssue)({
|
|
28
|
-
title: 'Test Issue',
|
|
29
|
-
body: 'Test Body'
|
|
30
|
-
});
|
|
31
|
-
node_assert_1.default.strictEqual(result.success, false, 'Should fail without token');
|
|
32
|
-
node_assert_1.default.ok(result.message && result.message.includes('GitHub integration requires GITHUB_TOKEN environment variable'), 'Should return correct error message');
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
finally {
|
|
36
|
-
// Restore token
|
|
37
|
-
if (originalToken) {
|
|
38
|
-
process.env.GITHUB_TOKEN = originalToken;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
async function runIssueTest(testCase) {
|
|
43
|
-
return await testCase.testFunction();
|
|
44
|
-
}
|
|
45
|
-
const testCases = [
|
|
46
|
-
{
|
|
47
|
-
name: 'Dry Run Issue Creation',
|
|
48
|
-
description: 'Verifies that dry-run mode works and returns correct structure',
|
|
49
|
-
testFunction: testDryRun,
|
|
50
|
-
tags: ['issues', 'core']
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
name: 'Missing Token Validation',
|
|
54
|
-
description: 'Verifies that missing GITHUB_TOKEN causes failure',
|
|
55
|
-
testFunction: testMissingToken,
|
|
56
|
-
tags: ['issues', 'core']
|
|
57
|
-
}
|
|
58
|
-
];
|
|
59
|
-
(0, test_utils_1.runTests)(testCases, runIssueTest, 'Fraim Issue Logic Tests');
|
|
@@ -1,44 +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 test_utils_1 = require("./test-utils");
|
|
7
|
-
const node_assert_1 = __importDefault(require("node:assert"));
|
|
8
|
-
const types_1 = require("../src/fraim/types");
|
|
9
|
-
async function testConfigDefaults() {
|
|
10
|
-
console.log(' 🧪 Testing DEFAULT_FRAIM_CONFIG placeholders...');
|
|
11
|
-
try {
|
|
12
|
-
node_assert_1.default.ok(types_1.DEFAULT_FRAIM_CONFIG.customizations?.workflowsPath, 'workflowsPath should exist');
|
|
13
|
-
// Architecture and Testing sections removed
|
|
14
|
-
return true;
|
|
15
|
-
}
|
|
16
|
-
catch (e) {
|
|
17
|
-
console.error(' ❌ Default configuration verification failed:', e);
|
|
18
|
-
return false;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
async function testTemplateProcessor() {
|
|
22
|
-
console.log(' 🧪 Testing Template Processor (removed - no longer needed)...');
|
|
23
|
-
// Template processing has been removed since no workflows use {{config.*}} variables
|
|
24
|
-
// and personalization happens when agents read .fraim/config.json directly
|
|
25
|
-
return true;
|
|
26
|
-
}
|
|
27
|
-
const testCases = [
|
|
28
|
-
{
|
|
29
|
-
name: 'Config Defaults',
|
|
30
|
-
description: 'Verify DEFAULT_FRAIM_CONFIG has empty placeholders',
|
|
31
|
-
testFunction: testConfigDefaults,
|
|
32
|
-
tags: ['config', 'genericization']
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
name: 'Template Processor',
|
|
36
|
-
description: 'Verify template processing has been simplified (no longer processes config variables)',
|
|
37
|
-
testFunction: testTemplateProcessor,
|
|
38
|
-
tags: ['templates', 'genericization']
|
|
39
|
-
}
|
|
40
|
-
];
|
|
41
|
-
async function runGenericizationTests(testCase) {
|
|
42
|
-
return await testCase.testFunction();
|
|
43
|
-
}
|
|
44
|
-
(0, test_utils_1.runTests)(testCases, runGenericizationTests, 'FRAIM Genericization');
|