fraim-framework 2.0.52 → 2.0.54
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/dist/registry/scripts/profile-server.js +2 -1
- package/dist/src/ai-manager/ai-manager.js +49 -1
- package/dist/src/ai-manager/phase-flow.js +68 -0
- package/dist/tests/test-debug-session.js +6 -2
- package/dist/tests/test-enhanced-session-init.js +6 -2
- package/dist/tests/test-mcp-lifecycle-methods.js +1 -2
- package/dist/tests/test-mcp-template-processing.js +6 -2
- package/dist/tests/test-modular-issue-tracking.js +6 -2
- package/dist/tests/test-node-compatibility.js +4 -2
- package/dist/tests/test-npm-install.js +4 -2
- package/dist/tests/test-productivity-integration.js +157 -0
- package/dist/tests/test-session-rehydration.js +1 -2
- package/dist/tests/test-telemetry.js +1 -2
- package/dist/tests/test-users-to-target-workflow.js +256 -0
- package/package.json +1 -1
- package/registry/agent-guardrails.md +62 -62
- package/registry/scripts/detect-tautological-tests.sh +38 -38
- package/registry/scripts/productivity/build-productivity-csv.mjs +242 -0
- package/registry/scripts/productivity/fetch-pr-details.mjs +144 -0
- package/registry/scripts/productivity/productivity-report.sh +147 -0
- package/registry/scripts/profile-server.ts +1 -1
- package/registry/scripts/validate-openapi-limits.ts +366 -366
- package/registry/scripts/validate-test-coverage.ts +280 -280
- package/registry/stubs/workflows/customer-development/ai-coach-phases/phase1-customer-profiling.md +11 -0
- package/registry/stubs/workflows/customer-development/ai-coach-phases/phase1-survey-scoping.md +11 -0
- package/registry/stubs/workflows/customer-development/ai-coach-phases/phase2-platform-discovery.md +11 -0
- package/registry/stubs/workflows/customer-development/ai-coach-phases/phase2-survey-build-linkedin.md +11 -0
- package/registry/stubs/workflows/customer-development/ai-coach-phases/phase3-prospect-qualification.md +11 -0
- package/registry/stubs/workflows/customer-development/ai-coach-phases/phase3-survey-build-reddit.md +11 -0
- package/registry/stubs/workflows/customer-development/ai-coach-phases/phase4-inventory-compilation.md +11 -0
- package/registry/stubs/workflows/customer-development/ai-coach-phases/phase4-survey-build-x.md +11 -0
- package/registry/stubs/workflows/customer-development/ai-coach-phases/phase5-survey-build-facebook.md +11 -0
- package/registry/stubs/workflows/customer-development/ai-coach-phases/phase6-survey-build-custom.md +11 -0
- package/registry/stubs/workflows/customer-development/ai-coach-phases/phase7-survey-dispatch.md +11 -0
- package/registry/stubs/workflows/customer-development/templates/customer-persona-template.md +11 -0
- package/registry/stubs/workflows/customer-development/templates/search-strategy-template.md +11 -0
- package/registry/stubs/workflows/customer-development/user-survey-dispatch.md +11 -0
- package/registry/stubs/workflows/customer-development/users-to-target.md +11 -0
- package/registry/stubs/workflows/productivity-report/productivity-report.md +11 -0
- package/bin/fraim.js +0 -8
- package/dist/registry/ai-manager-rules/design-phases/design.md +0 -108
- package/dist/registry/ai-manager-rules/design-phases/finalize.md +0 -60
- package/dist/registry/ai-manager-rules/design-phases/validate.md +0 -125
- package/dist/registry/ai-manager-rules/design.json +0 -97
- package/dist/registry/ai-manager-rules/implement-phases/code.md +0 -323
- package/dist/registry/ai-manager-rules/implement-phases/completeness-review.md +0 -94
- package/dist/registry/ai-manager-rules/implement-phases/finalize.md +0 -177
- package/dist/registry/ai-manager-rules/implement-phases/quality-review.md +0 -304
- package/dist/registry/ai-manager-rules/implement-phases/regression.md +0 -159
- package/dist/registry/ai-manager-rules/implement-phases/repro.md +0 -101
- package/dist/registry/ai-manager-rules/implement-phases/scoping.md +0 -93
- package/dist/registry/ai-manager-rules/implement-phases/smoke.md +0 -225
- package/dist/registry/ai-manager-rules/implement-phases/spike.md +0 -118
- package/dist/registry/ai-manager-rules/implement-phases/validate.md +0 -347
- package/dist/registry/ai-manager-rules/implement.json +0 -153
- package/dist/registry/ai-manager-rules/shared-phases/finalize.md +0 -169
- package/dist/registry/ai-manager-rules/spec-phases/finalize.md +0 -60
- package/dist/registry/ai-manager-rules/spec-phases/spec.md +0 -102
- package/dist/registry/ai-manager-rules/spec-phases/validate.md +0 -118
- package/dist/registry/ai-manager-rules/spec.json +0 -112
- package/dist/registry/ai-manager-rules/test.json +0 -98
- package/dist/registry/scripts/build-scripts-generator.js +0 -205
- package/dist/registry/scripts/fraim-config.js +0 -61
- package/dist/registry/scripts/generic-issues-api.js +0 -100
- package/dist/registry/scripts/openapi-generator.js +0 -664
- package/dist/registry/scripts/performance/profile-server.js +0 -390
- package/dist/src/ai-manager/evidence-validator.js +0 -309
- package/dist/src/fraim/issue-tracking/ado-provider.js +0 -304
- package/dist/src/fraim/issue-tracking/factory.js +0 -63
- package/dist/src/fraim/issue-tracking/github-provider.js +0 -200
- package/dist/src/fraim/issue-tracking/types.js +0 -7
- package/dist/src/fraim/issue-tracking-config.js +0 -83
- package/dist/src/static-website-middleware.js +0 -75
- package/dist/test-utils.js +0 -96
- package/dist/tests/esm-compat.js +0 -11
- package/dist/tests/test-ai-manager-phase-protocol.js +0 -147
- package/dist/tests/test-ai-manager.js +0 -118
- package/dist/tests/test-chalk-esm-issue.js +0 -159
- package/dist/tests/test-chalk-real-world.js +0 -265
- package/dist/tests/test-chalk-regression.js +0 -377
- package/dist/tests/test-chalk-resolution-issue.js +0 -304
- package/dist/tests/test-evidence-validation.js +0 -221
- package/dist/tests/test-first-run-interactive.js +0 -1
- package/dist/tests/test-fraim-install-chalk-issue.js +0 -254
- package/dist/tests/test-markdown-to-pdf.js +0 -454
- package/dist/tests/test-npm-resolution-diagnostic.js +0 -140
- package/dist/tests/test-pr-review-integration.js +0 -1
- package/dist/website/.nojekyll +0 -0
- package/dist/website/404.html +0 -101
- package/dist/website/CNAME +0 -1
- package/dist/website/README.md +0 -22
- package/dist/website/demo.html +0 -604
- package/dist/website/images/.gitkeep +0 -1
- package/dist/website/images/fraim-logo.png +0 -0
- package/dist/website/index.html +0 -290
- package/dist/website/pricing.html +0 -414
- package/dist/website/script.js +0 -55
- package/dist/website/styles.css +0 -2647
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"workflowType": "spec",
|
|
3
|
-
"description": "Specification phase validation ensures that feature specifications are complete, follow the correct template structure, and include all necessary components including high-fidelity mocks for UI changes.",
|
|
4
|
-
"validationRules": [
|
|
5
|
-
{
|
|
6
|
-
"step": 1,
|
|
7
|
-
"description": "Verify issue is labeled with phase:spec",
|
|
8
|
-
"passCriteria": "Issue has 'phase:spec' label applied in GitHub",
|
|
9
|
-
"weight": "blocking",
|
|
10
|
-
"category": "process"
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"step": 2,
|
|
14
|
-
"description": "Verify spec document exists in correct location",
|
|
15
|
-
"command": "find \"docs/feature specs\" -name \"*{issue_number}*\" -type f",
|
|
16
|
-
"passCriteria": "Spec document exists at docs/feature specs/{issue_number}-{kebab-title}.md with substantial content (>1000 characters)",
|
|
17
|
-
"weight": "blocking",
|
|
18
|
-
"category": "completeness"
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"step": 3,
|
|
22
|
-
"description": "Check spec follows FEATURESPEC template structure",
|
|
23
|
-
"passCriteria": "Spec includes all required sections: Customer, Customer's Desired Outcome, Customer Problem, User Experience, Validation Plan, Alternatives, Competitive Landscape",
|
|
24
|
-
"weight": "blocking",
|
|
25
|
-
"category": "structure"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"step": 4,
|
|
29
|
-
"description": "Validate Customer section is complete",
|
|
30
|
-
"passCriteria": "Customer section clearly identifies who will use this feature with specific details",
|
|
31
|
-
"weight": "blocking",
|
|
32
|
-
"category": "customer-focus"
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
"step": 5,
|
|
36
|
-
"description": "Validate Customer's Desired Outcome is specific",
|
|
37
|
-
"passCriteria": "Desired outcome is clear, measurable, and describes the end goal the customer wants to achieve",
|
|
38
|
-
"weight": "blocking",
|
|
39
|
-
"category": "customer-focus"
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
"step": 6,
|
|
43
|
-
"description": "Validate Customer Problem is well-defined",
|
|
44
|
-
"passCriteria": "Problem statement is specific and explains why current state is insufficient for the customer",
|
|
45
|
-
"weight": "blocking",
|
|
46
|
-
"category": "problem-definition"
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
"step": 7,
|
|
50
|
-
"description": "Check User Experience section has detailed workflow",
|
|
51
|
-
"passCriteria": "User Experience includes specific step-by-step workflow (start in X, click Y, see Z, etc.) that shows exactly how the user will interact with the feature",
|
|
52
|
-
"weight": "blocking",
|
|
53
|
-
"category": "user-experience"
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
"step": 8,
|
|
57
|
-
"description": "Verify high-fidelity mocks are created if issue requires mocks",
|
|
58
|
-
"command": "find \"docs/feature specs/mocks\" -name \"*{issue_number}*\" -type f",
|
|
59
|
-
"passCriteria": "If feature involves UI changes, high-fidelity mocks (HTML/CSS files) are included in docs/feature specs/mocks folder and linked in spec. Markdown code blocks are NOT sufficient.",
|
|
60
|
-
"weight": "blocking",
|
|
61
|
-
"category": "user-experience"
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
"step": 9,
|
|
65
|
-
"description": "Validate Validation Plan is actionable",
|
|
66
|
-
"passCriteria": "Validation Plan includes specific, executable steps to verify the feature works (browser tests, API calls, user scenarios, etc.)",
|
|
67
|
-
"weight": "blocking",
|
|
68
|
-
"category": "validation"
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
"step": 10,
|
|
72
|
-
"description": "Check Alternatives section is complete",
|
|
73
|
-
"passCriteria": "Alternatives section includes table with alternative solutions and clear reasons for not choosing them",
|
|
74
|
-
"weight": "warning",
|
|
75
|
-
"category": "thoroughness"
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
"step": 11,
|
|
79
|
-
"description": "Verify Competitive Landscape analysis",
|
|
80
|
-
"passCriteria": "Competitive Landscape section includes table with competitors, their solutions, and customer feedback or market research",
|
|
81
|
-
"weight": "warning",
|
|
82
|
-
"category": "market-awareness"
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
"step": 12,
|
|
86
|
-
"description": "Check all requirements from original issue are addressed",
|
|
87
|
-
"passCriteria": "All requirements and acceptance criteria from the original GitHub issue are covered in the spec document",
|
|
88
|
-
"weight": "blocking",
|
|
89
|
-
"category": "completeness"
|
|
90
|
-
}
|
|
91
|
-
],
|
|
92
|
-
"gradingCriteria": {
|
|
93
|
-
"passRequirements": [
|
|
94
|
-
"ALL blocking validation steps must pass",
|
|
95
|
-
"At least 80% of warning validation steps should pass",
|
|
96
|
-
"Spec demonstrates clear understanding of customer needs",
|
|
97
|
-
"Quality standards are met consistently",
|
|
98
|
-
"No placeholder text or incomplete sections remain"
|
|
99
|
-
],
|
|
100
|
-
"failRequirements": [
|
|
101
|
-
"ANY blocking validation step fails",
|
|
102
|
-
"Multiple warning validation steps fail indicating quality issues",
|
|
103
|
-
"Spec appears incomplete or rushed",
|
|
104
|
-
"Requirements not properly addressed",
|
|
105
|
-
"Template structure not followed"
|
|
106
|
-
]
|
|
107
|
-
},
|
|
108
|
-
"reportingFormat": {
|
|
109
|
-
"requiredFields": ["pass", "reasons"],
|
|
110
|
-
"instructions": "Evaluate each validation step honestly. If ANY blocking step fails, you must report pass=false. Provide specific reasons for failure in the reasons array. Be thorough and honest in your self-assessment."
|
|
111
|
-
}
|
|
112
|
-
}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"workflowType": "test",
|
|
3
|
-
"description": "Testing phase validation ensures comprehensive test coverage, proper test implementation, and validation of all functionality.",
|
|
4
|
-
"validationRules": [
|
|
5
|
-
{
|
|
6
|
-
"step": 1,
|
|
7
|
-
"description": "Verify issue is labeled with phase:test",
|
|
8
|
-
"passCriteria": "Issue has 'phase:test' label applied",
|
|
9
|
-
"weight": "blocking",
|
|
10
|
-
"category": "process"
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"step": 2,
|
|
14
|
-
"description": "Check all tests pass",
|
|
15
|
-
"command": "npm test",
|
|
16
|
-
"passCriteria": "All tests pass without errors or failures",
|
|
17
|
-
"weight": "blocking",
|
|
18
|
-
"category": "test-execution"
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"step": 3,
|
|
22
|
-
"description": "Verify test coverage is adequate",
|
|
23
|
-
"command": "npm run test:coverage",
|
|
24
|
-
"passCriteria": "Test coverage meets project standards (typically >80% for new code)",
|
|
25
|
-
"weight": "blocking",
|
|
26
|
-
"category": "test-coverage"
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"step": 4,
|
|
30
|
-
"description": "Check unit tests for new functionality",
|
|
31
|
-
"passCriteria": "All new functions/methods have corresponding unit tests with edge cases",
|
|
32
|
-
"weight": "blocking",
|
|
33
|
-
"category": "unit-testing"
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"step": 5,
|
|
37
|
-
"description": "Verify integration tests exist",
|
|
38
|
-
"passCriteria": "Integration tests cover API endpoints, database interactions, and component integration",
|
|
39
|
-
"weight": "blocking",
|
|
40
|
-
"category": "integration-testing"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
"step": 6,
|
|
44
|
-
"description": "Check error scenario testing",
|
|
45
|
-
"passCriteria": "Tests cover error conditions, invalid inputs, and failure scenarios",
|
|
46
|
-
"weight": "blocking",
|
|
47
|
-
"category": "error-testing"
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
"step": 7,
|
|
51
|
-
"description": "Validate test data and mocking",
|
|
52
|
-
"passCriteria": "Proper test data setup, appropriate mocking of external dependencies",
|
|
53
|
-
"weight": "warning",
|
|
54
|
-
"category": "test-setup"
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
"step": 8,
|
|
58
|
-
"description": "Check test performance",
|
|
59
|
-
"passCriteria": "Tests run efficiently, no unnecessarily slow tests, proper test isolation",
|
|
60
|
-
"weight": "warning",
|
|
61
|
-
"category": "test-performance"
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
"step": 9,
|
|
65
|
-
"description": "Verify end-to-end tests (if applicable)",
|
|
66
|
-
"passCriteria": "E2E tests cover critical user workflows and system interactions",
|
|
67
|
-
"weight": "warning",
|
|
68
|
-
"category": "e2e-testing"
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
"step": 10,
|
|
72
|
-
"description": "Check test documentation",
|
|
73
|
-
"passCriteria": "Test cases are well-documented, test setup instructions are clear",
|
|
74
|
-
"weight": "warning",
|
|
75
|
-
"category": "test-documentation"
|
|
76
|
-
}
|
|
77
|
-
],
|
|
78
|
-
"gradingCriteria": {
|
|
79
|
-
"passRequirements": [
|
|
80
|
-
"ALL blocking validation steps must pass",
|
|
81
|
-
"At least 80% of warning validation steps should pass",
|
|
82
|
-
"Comprehensive test coverage for all new functionality",
|
|
83
|
-
"Tests are reliable and maintainable",
|
|
84
|
-
"All edge cases and error scenarios covered"
|
|
85
|
-
],
|
|
86
|
-
"failRequirements": [
|
|
87
|
-
"ANY blocking validation step fails",
|
|
88
|
-
"Tests are failing or missing",
|
|
89
|
-
"Inadequate test coverage",
|
|
90
|
-
"Poor test quality or reliability",
|
|
91
|
-
"Critical scenarios not tested"
|
|
92
|
-
]
|
|
93
|
-
},
|
|
94
|
-
"reportingFormat": {
|
|
95
|
-
"requiredFields": ["pass", "reasons"],
|
|
96
|
-
"instructions": "Evaluate each validation step honestly. Run all test commands and verify coverage reports. If ANY blocking step fails, you must report pass=false. Focus on test quality, coverage, and reliability."
|
|
97
|
-
}
|
|
98
|
-
}
|
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
/**
|
|
4
|
-
* FRAIM Build Scripts Generator
|
|
5
|
-
*
|
|
6
|
-
* Generates generic build scripts and validation patterns.
|
|
7
|
-
* These are generic enough to apply to any project.
|
|
8
|
-
*
|
|
9
|
-
* Usage:
|
|
10
|
-
* npx tsx scripts/build-scripts-generator.ts
|
|
11
|
-
*/
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.generatePackageScripts = generatePackageScripts;
|
|
14
|
-
exports.generateCodeQualityScript = generateCodeQualityScript;
|
|
15
|
-
exports.generateCopyScripts = generateCopyScripts;
|
|
16
|
-
exports.generateBuildScripts = generateBuildScripts;
|
|
17
|
-
const fs_1 = require("fs");
|
|
18
|
-
const path_1 = require("path");
|
|
19
|
-
const config_loader_js_1 = require("../../src/fraim/config-loader.js");
|
|
20
|
-
/**
|
|
21
|
-
* Generate package.json scripts section
|
|
22
|
-
*/
|
|
23
|
-
function generatePackageScripts(config) {
|
|
24
|
-
return {
|
|
25
|
-
"build": "tsc && npm run validate:openapi",
|
|
26
|
-
"validate:openapi": "npx tsx " + "reg" + "istry/scripts/validate-openapi-limits.ts",
|
|
27
|
-
"start": "node dist/src/server.js",
|
|
28
|
-
"start:mcp": "node dist/src/mcp-server.js",
|
|
29
|
-
"dev": "npx tsx --watch src/server.ts",
|
|
30
|
-
"dev:mcp": "tsx src/mcp-server.ts",
|
|
31
|
-
"generate:openapi": "npx tsx " + "reg" + "istry/scripts/openapi-generator.ts",
|
|
32
|
-
"test": "npx tsx --test test*.ts",
|
|
33
|
-
"lint": "eslint *.ts",
|
|
34
|
-
"lint:fix": "eslint *.ts --fix"
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Generate code quality check script (generic version)
|
|
39
|
-
*/
|
|
40
|
-
function generateCodeQualityScript(outputDir) {
|
|
41
|
-
if (!(0, fs_1.existsSync)(outputDir)) {
|
|
42
|
-
(0, fs_1.mkdirSync)(outputDir, { recursive: true });
|
|
43
|
-
}
|
|
44
|
-
const scriptContent = `#!/bin/bash
|
|
45
|
-
|
|
46
|
-
# FRAIM Generic Code Quality Check
|
|
47
|
-
# Validates code quality, build, and ChatGPT limits
|
|
48
|
-
|
|
49
|
-
set -e
|
|
50
|
-
|
|
51
|
-
MODE=\${1:-full}
|
|
52
|
-
FAILED=0
|
|
53
|
-
WARNINGS=0
|
|
54
|
-
|
|
55
|
-
echo "================================================"
|
|
56
|
-
echo "🔍 CODE QUALITY CHECK ($MODE mode)"
|
|
57
|
-
echo "================================================"
|
|
58
|
-
echo ""
|
|
59
|
-
|
|
60
|
-
# Build check
|
|
61
|
-
if [ "$MODE" = "full" ] || [ "$MODE" = "build" ]; then
|
|
62
|
-
echo "📦 Building project..."
|
|
63
|
-
if npm run build; then
|
|
64
|
-
echo "✅ Build passed"
|
|
65
|
-
else
|
|
66
|
-
echo "❌ Build failed"
|
|
67
|
-
FAILED=1
|
|
68
|
-
fi
|
|
69
|
-
echo ""
|
|
70
|
-
fi
|
|
71
|
-
|
|
72
|
-
# Lint check
|
|
73
|
-
if [ "$MODE" = "full" ] || [ "$MODE" = "lint" ]; then
|
|
74
|
-
echo "🔍 Linting code..."
|
|
75
|
-
if npm run lint; then
|
|
76
|
-
echo "✅ Lint passed"
|
|
77
|
-
else
|
|
78
|
-
echo "⚠️ Lint warnings (non-blocking)"
|
|
79
|
-
WARNINGS=1
|
|
80
|
-
fi
|
|
81
|
-
echo ""
|
|
82
|
-
fi
|
|
83
|
-
|
|
84
|
-
# OpenAPI validation (ChatGPT limits)
|
|
85
|
-
if [ "$MODE" = "full" ] || [ "$MODE" = "openapi" ]; then
|
|
86
|
-
echo "📋 Validating OpenAPI and ChatGPT limits..."
|
|
87
|
-
if npm run validate:openapi; then
|
|
88
|
-
echo "✅ OpenAPI validation passed"
|
|
89
|
-
else
|
|
90
|
-
echo "❌ OpenAPI validation failed"
|
|
91
|
-
FAILED=1
|
|
92
|
-
fi
|
|
93
|
-
echo ""
|
|
94
|
-
fi
|
|
95
|
-
|
|
96
|
-
# Summary
|
|
97
|
-
echo "================================================"
|
|
98
|
-
echo "📊 QUALITY CHECK SUMMARY ($MODE mode)"
|
|
99
|
-
echo "================================================"
|
|
100
|
-
echo ""
|
|
101
|
-
|
|
102
|
-
if [ $FAILED -eq 1 ]; then
|
|
103
|
-
echo "❌ CHECKS FAILED"
|
|
104
|
-
echo ""
|
|
105
|
-
echo "Fix the errors above before proceeding."
|
|
106
|
-
exit 1
|
|
107
|
-
elif [ $WARNINGS -eq 1 ]; then
|
|
108
|
-
echo "⚠️ CHECKS PASSED WITH WARNINGS"
|
|
109
|
-
echo ""
|
|
110
|
-
echo "Review warnings above."
|
|
111
|
-
exit 0
|
|
112
|
-
else
|
|
113
|
-
echo "✅ ALL CHECKS PASSED"
|
|
114
|
-
echo ""
|
|
115
|
-
exit 0
|
|
116
|
-
fi
|
|
117
|
-
`;
|
|
118
|
-
const scriptPath = (0, path_1.join)(outputDir, 'code-quality-check.sh');
|
|
119
|
-
(0, fs_1.writeFileSync)(scriptPath, scriptContent);
|
|
120
|
-
// Make executable (Unix)
|
|
121
|
-
if (process.platform !== 'win32') {
|
|
122
|
-
const { execSync } = require('child_process');
|
|
123
|
-
execSync(`chmod +x ${scriptPath}`);
|
|
124
|
-
}
|
|
125
|
-
console.log(`✅ Generated code quality check script at ${scriptPath}`);
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Generate build copy scripts (generic)
|
|
129
|
-
*/
|
|
130
|
-
function generateCopyScripts(outputDir) {
|
|
131
|
-
if (!(0, fs_1.existsSync)(outputDir)) {
|
|
132
|
-
(0, fs_1.mkdirSync)(outputDir, { recursive: true });
|
|
133
|
-
}
|
|
134
|
-
// Copy AI agents script (if .fraim exists)
|
|
135
|
-
const copyAiAgents = `#!/usr/bin/env node
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Copy registry directory to dist
|
|
139
|
-
* Generic build script for FRAIM projects
|
|
140
|
-
*/
|
|
141
|
-
|
|
142
|
-
const fs = require('fs');
|
|
143
|
-
const path = require('path');
|
|
144
|
-
|
|
145
|
-
const sourceDir = path.join(__dirname, '..', '..', 'registry');
|
|
146
|
-
const destDir = path.join(__dirname, '..', '..', 'dist', 'registry');
|
|
147
|
-
|
|
148
|
-
if (fs.existsSync(sourceDir)) {
|
|
149
|
-
// Recursive copy
|
|
150
|
-
function copyRecursive(src, dest) {
|
|
151
|
-
if (!fs.existsSync(dest)) {
|
|
152
|
-
fs.mkdirSync(dest, { recursive: true });
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
const entries = fs.readdirSync(src, { withFileTypes: true });
|
|
156
|
-
|
|
157
|
-
for (const entry of entries) {
|
|
158
|
-
const srcPath = path.join(src, entry.name);
|
|
159
|
-
const destPath = path.join(dest, entry.name);
|
|
160
|
-
|
|
161
|
-
if (entry.isDirectory()) {
|
|
162
|
-
copyRecursive(srcPath, destPath);
|
|
163
|
-
} else {
|
|
164
|
-
fs.copyFileSync(srcPath, destPath);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
copyRecursive(sourceDir, destDir);
|
|
170
|
-
console.log('✅ Copied registry to dist/registry');
|
|
171
|
-
} else {
|
|
172
|
-
console.log('ℹ️ registry directory not found, skipping');
|
|
173
|
-
}
|
|
174
|
-
`;
|
|
175
|
-
(0, fs_1.writeFileSync)((0, path_1.join)(outputDir, 'copy-ai-agents.js'), copyAiAgents);
|
|
176
|
-
console.log(`✅ Generated copy-ai-agents.js`);
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* Main generator function
|
|
180
|
-
*/
|
|
181
|
-
function generateBuildScripts(config, outputDir = "scr" + "ipts/build") {
|
|
182
|
-
console.log('🚀 FRAIM Build Scripts Generator\n');
|
|
183
|
-
console.log(`📁 Output directory: ${outputDir}\n`);
|
|
184
|
-
// Ensure output directory exists
|
|
185
|
-
if (!(0, fs_1.existsSync)(outputDir)) {
|
|
186
|
-
(0, fs_1.mkdirSync)(outputDir, { recursive: true });
|
|
187
|
-
}
|
|
188
|
-
// Generate code quality check
|
|
189
|
-
console.log('📝 Generating code quality check script...');
|
|
190
|
-
generateCodeQualityScript(outputDir);
|
|
191
|
-
// Generate build scripts
|
|
192
|
-
console.log('\n📝 Generating build scripts...');
|
|
193
|
-
generateCopyScripts(outputDir);
|
|
194
|
-
console.log('\n✅ Build scripts generation complete!');
|
|
195
|
-
console.log('\n📋 Next steps:');
|
|
196
|
-
console.log('1. Add scripts to package.json');
|
|
197
|
-
console.log('2. Run: npm run validate:openapi');
|
|
198
|
-
console.log('3. Run: ./scripts/build/code-quality-check.sh');
|
|
199
|
-
}
|
|
200
|
-
// Run if executed directly
|
|
201
|
-
// @ts-ignore
|
|
202
|
-
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
203
|
-
const config = (0, config_loader_js_1.loadFraimConfig)();
|
|
204
|
-
generateBuildScripts(config);
|
|
205
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fraimConfig = void 0;
|
|
4
|
-
exports.formatExecutiveDisplayName = formatExecutiveDisplayName;
|
|
5
|
-
exports.formatPersonaSignature = formatPersonaSignature;
|
|
6
|
-
const config_loader_1 = require("../../src/fraim/config-loader");
|
|
7
|
-
const config = (0, config_loader_1.loadFraimConfig)();
|
|
8
|
-
const envOr = (keys, fallback) => {
|
|
9
|
-
for (const key of keys) {
|
|
10
|
-
const value = process.env[key];
|
|
11
|
-
if (value && value.length) {
|
|
12
|
-
return value;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
return fallback;
|
|
16
|
-
};
|
|
17
|
-
const personaName = config.persona.name;
|
|
18
|
-
const personaDisplayNameDefault = config.persona.displayNamePattern.replace('{executiveName}', 'Your');
|
|
19
|
-
exports.fraimConfig = {
|
|
20
|
-
repoOwner: config.git.repoOwner || 'mathursrus',
|
|
21
|
-
repoName: config.git.repoName || 'fraim-repo',
|
|
22
|
-
projectName: config.project.name,
|
|
23
|
-
personaName,
|
|
24
|
-
personaPronouns: envOr(['FRAIM_PERSONA_PRONOUNS'], 'they/them'), // Could add to config if needed
|
|
25
|
-
personaDisplayName: envOr(['FRAIM_PERSONA_DISPLAY_NAME'], personaDisplayNameDefault),
|
|
26
|
-
personaDisplayNamePattern: config.persona.displayNamePattern,
|
|
27
|
-
personaThankYouSignature: config.persona.emailSignature,
|
|
28
|
-
defaultEmail: envOr(['FRAIM_DEFAULT_EMAIL'], 'agent@example.com'),
|
|
29
|
-
prodDefaultEmail: envOr(['PROD_FRAIM_DEFAULT_EMAIL'], 'agent@example.com'),
|
|
30
|
-
defaultAccessToken: envOr(['FRAIM_DEFAULT_ACCESS_TOKEN'], ''),
|
|
31
|
-
defaultRefreshToken: envOr(['FRAIM_DEFAULT_REFRESH_TOKEN'], ''),
|
|
32
|
-
prodAccessToken: envOr(['PROD_FRAIM_DEFAULT_ACCESS_TOKEN'], ''),
|
|
33
|
-
prodRefreshToken: envOr(['PROD_FRAIM_DEFAULT_REFRESH_TOKEN'], ''),
|
|
34
|
-
defaultOAuthClientId: envOr(['FRAIM_DEFAULT_OAUTH_CLIENT_ID'], ''),
|
|
35
|
-
defaultOAuthClientSecret: envOr(['FRAIM_DEFAULT_OAUTH_CLIENT_SECRET'], ''),
|
|
36
|
-
prodOAuthClientId: envOr(['PROD_FRAIM_DEFAULT_OAUTH_CLIENT_ID'], ''),
|
|
37
|
-
prodOAuthClientSecret: envOr(['PROD_FRAIM_DEFAULT_OAUTH_CLIENT_SECRET'], ''),
|
|
38
|
-
identityCollection: config.database?.identityCollection || 'Identity',
|
|
39
|
-
executiveCollection: config.database?.executiveCollection || 'Executive',
|
|
40
|
-
newsletterTitle: config.marketing?.newsletterTitle || 'Weekly Update',
|
|
41
|
-
newsletterCtaText: config.marketing?.newsletterCtaText || 'Learn More',
|
|
42
|
-
newsletterUrl: config.marketing?.newsletterUrl || envOr(['FRAIM_NEWSLETTER_URL'], ''),
|
|
43
|
-
issueRepoUrl: config.git.url || `https://github.com/${config.git.repoOwner}/${config.git.repoName}.git`,
|
|
44
|
-
identityTokensCollection: config.database?.tokensCollection || 'Tokens',
|
|
45
|
-
webAppUrl: config.marketing?.websiteUrl || envOr(['FRAIM_WEB_APP_URL'], 'http://localhost:3000'),
|
|
46
|
-
chatUrl: config.marketing?.chatUrl || envOr(['FRAIM_CHAT_URL'], ''),
|
|
47
|
-
azure: {
|
|
48
|
-
prodAppName: envOr(['FRAIM_AZURE_PROD_APP_NAME'], 'fraim-app-prod'),
|
|
49
|
-
prodResourceGroup: envOr(['FRAIM_AZURE_PROD_RESOURCE_GROUP'], 'fraim-prod-rg'),
|
|
50
|
-
preprodAppName: envOr(['FRAIM_AZURE_PREPROD_APP_NAME'], 'fraim-app-pre-prod'),
|
|
51
|
-
preprodResourceGroup: envOr(['FRAIM_AZURE_PREPROD_RESOURCE_GROUP'], 'fraim-pre-prod-rg'),
|
|
52
|
-
localAppName: envOr(['FRAIM_AZURE_LOCAL_APP_NAME'], 'local'),
|
|
53
|
-
localResourceGroup: envOr(['FRAIM_AZURE_LOCAL_RESOURCE_GROUP'], 'local')
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
function formatExecutiveDisplayName(executiveName) {
|
|
57
|
-
return config.persona.displayNamePattern.replace('{executiveName}', executiveName);
|
|
58
|
-
}
|
|
59
|
-
function formatPersonaSignature() {
|
|
60
|
-
return `With gratitude,\n${exports.fraimConfig.personaThankYouSignature}\n${personaName} - Your AI Executive Assistant\n\n`;
|
|
61
|
-
}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* FRAIM Generic Issues API
|
|
4
|
-
*
|
|
5
|
-
* Generic issue filing endpoint that works for any project.
|
|
6
|
-
* Can be invoked through ChatGPT OpenAPI or MCP.
|
|
7
|
-
*
|
|
8
|
-
* Usage:
|
|
9
|
-
* 1. Import this file
|
|
10
|
-
* 2. Mount the router in your Express app
|
|
11
|
-
* 3. Configure GitHub repository in .fraim/config.json
|
|
12
|
-
*/
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.issuesRouter = void 0;
|
|
15
|
-
const express_1 = require("express");
|
|
16
|
-
const issues_js_1 = require("../../src/fraim/issues.js");
|
|
17
|
-
const config_loader_js_1 = require("../../src/fraim/config-loader.js");
|
|
18
|
-
const issuesRouter = (0, express_1.Router)();
|
|
19
|
-
exports.issuesRouter = issuesRouter;
|
|
20
|
-
/**
|
|
21
|
-
* POST /issues/create - Create a GitHub issue
|
|
22
|
-
*
|
|
23
|
-
* Generic endpoint that works for any FRAIM project.
|
|
24
|
-
* Repository owner and name are read from .fraim/config.json
|
|
25
|
-
*/
|
|
26
|
-
issuesRouter.post('/create', async (req, res) => {
|
|
27
|
-
try {
|
|
28
|
-
// Load project configuration
|
|
29
|
-
const config = (0, config_loader_js_1.loadFraimConfig)();
|
|
30
|
-
const repoOwner = config.git?.repoOwner || process.env.GITHUB_OWNER || 'your-org';
|
|
31
|
-
const repoName = config.git?.repoName || process.env.GITHUB_REPO || 'your-repo';
|
|
32
|
-
// Get user context (if available - project-specific)
|
|
33
|
-
// Projects can customize this based on their auth system
|
|
34
|
-
const userId = req.userContext?.userId ||
|
|
35
|
-
req.executiveContext?.executiveId ||
|
|
36
|
-
req.headers['x-user-id'];
|
|
37
|
-
const userEmail = req.userContext?.email ||
|
|
38
|
-
req.executiveContext?.executiveEmail ||
|
|
39
|
-
req.headers['x-user-email'];
|
|
40
|
-
const userName = req.userContext?.name ||
|
|
41
|
-
req.executiveContext?.executiveName ||
|
|
42
|
-
req.headers['x-user-name'];
|
|
43
|
-
const { title, body, labels } = req.body;
|
|
44
|
-
if (!title || !body) {
|
|
45
|
-
return res.status(400).json({
|
|
46
|
-
success: false,
|
|
47
|
-
error: 'Missing required fields: title, body'
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
// Check if GitHub token is configured
|
|
51
|
-
if (!process.env.GITHUB_TOKEN && !process.env.GIT_TOKEN && !process.env.GITHUB_PAT) {
|
|
52
|
-
return res.status(500).json({
|
|
53
|
-
success: false,
|
|
54
|
-
error: 'GitHub integration not configured. Please set GITHUB_TOKEN environment variable.'
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
// Build issue body with user context (if available)
|
|
58
|
-
let issueBody = body;
|
|
59
|
-
if (userName || userEmail || userId) {
|
|
60
|
-
issueBody = `**Reported by:** ${userName || 'Unknown'}${userEmail ? ` (${userEmail})` : ''}${userId ? `\n**User ID:** ${userId}` : ''}\n\n**Issue Details:**\n${body}\n\n---\n*This issue was automatically created through the API.*`;
|
|
61
|
-
}
|
|
62
|
-
// Create the issue using shared function
|
|
63
|
-
const result = await (0, issues_js_1.fileFraimIssue)({
|
|
64
|
-
title: title,
|
|
65
|
-
body: issueBody,
|
|
66
|
-
labels: labels || ['user-reported']
|
|
67
|
-
});
|
|
68
|
-
if (!result.success) {
|
|
69
|
-
return res.status(500).json({
|
|
70
|
-
success: false,
|
|
71
|
-
error: result.message
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
return res.json({
|
|
75
|
-
success: true,
|
|
76
|
-
message: 'Issue created successfully',
|
|
77
|
-
issueNumber: result.issueNumber,
|
|
78
|
-
issueUrl: result.htmlUrl,
|
|
79
|
-
title: title
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
catch (error) {
|
|
83
|
-
console.error('❌ Unexpected error creating Git issue:', error);
|
|
84
|
-
return res.status(500).json({
|
|
85
|
-
success: false,
|
|
86
|
-
error: error.message || 'Failed to create Git issue'
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
/**
|
|
91
|
-
* GET /issues/list - List issues
|
|
92
|
-
*
|
|
93
|
-
* Not implemented in this generic version.
|
|
94
|
-
*/
|
|
95
|
-
issuesRouter.get('/list', async (req, res) => {
|
|
96
|
-
return res.status(501).json({
|
|
97
|
-
success: false,
|
|
98
|
-
error: 'Listing issues is not supported in this generic API version yet.'
|
|
99
|
-
});
|
|
100
|
-
});
|