fraim-framework 2.0.67 → 2.0.69
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/bin/fraim.js +1 -1
- package/dist/src/cli/commands/doctor.js +1 -1
- package/dist/src/cli/commands/init-project.js +6 -12
- package/dist/src/cli/commands/list.js +1 -1
- package/dist/src/cli/commands/setup.js +15 -29
- package/dist/src/cli/commands/sync.js +36 -143
- package/dist/src/cli/fraim.js +0 -4
- package/dist/src/cli/setup/first-run.js +4 -4
- package/dist/src/cli/setup/ide-detector.js +15 -5
- package/dist/src/fraim/template-processor.js +7 -35
- package/dist/src/local-mcp-server/stdio-server.js +170 -181
- package/dist/src/utils/git-utils.js +2 -2
- package/dist/src/utils/object-utils.js +11 -0
- package/dist/src/utils/provider-utils.js +14 -0
- package/dist/src/utils/request-utils.js +23 -0
- package/dist/src/utils/workflow-parser.js +7 -7
- package/package.json +7 -5
- 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/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/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/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/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/finalize.md +0 -169
- 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/finalize.md +0 -60
- 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/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/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/delivery/address-feedback.md +0 -83
- package/dist/registry/delivery/retrospective.md +0 -78
- package/dist/registry/delivery/submit.md +0 -79
- package/dist/registry/providers/ado.json +0 -19
- package/dist/registry/providers/delivery-conversation.json +0 -9
- package/dist/registry/providers/delivery-pr.json +0 -9
- package/dist/registry/providers/github.json +0 -19
- package/dist/registry/rules/agent-success-criteria.md +0 -101
- package/dist/registry/rules/agent-testing-guidelines.md +0 -502
- package/dist/registry/rules/architecture.md +0 -126
- package/dist/registry/rules/communication.md +0 -122
- package/dist/registry/rules/continuous-learning.md +0 -55
- package/dist/registry/rules/debugging-multitenancy-issues.md +0 -85
- package/dist/registry/rules/ephemeral-execution.md +0 -54
- package/dist/registry/rules/git-safe-commands.md +0 -34
- package/dist/registry/rules/hitl-ppe-record-analysis.md +0 -302
- package/dist/registry/rules/integrity-and-test-ethics.md +0 -275
- package/dist/registry/rules/local-development.md +0 -275
- package/dist/registry/rules/mandatory-pre-completion-reflection.md +0 -193
- package/dist/registry/rules/merge-requirements.md +0 -238
- package/dist/registry/rules/simplicity.md +0 -118
- package/dist/registry/rules/software-development-lifecycle.md +0 -105
- package/dist/registry/rules/spike-first-development.md +0 -205
- package/dist/registry/rules/successful-debugging-patterns.md +0 -488
- package/dist/registry/scripts/build-scripts-generator.js +0 -205
- 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/fraim-config.js +0 -61
- package/dist/registry/scripts/generate-engagement-emails.js +0 -705
- package/dist/registry/scripts/generic-issues-api.js +0 -100
- package/dist/registry/scripts/newsletter-helpers.js +0 -671
- package/dist/registry/scripts/openapi-generator.js +0 -664
- package/dist/registry/scripts/performance/profile-server.js +0 -390
- package/dist/registry/scripts/profile-server.js +0 -389
- 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/stubs/workflows/azure/cost-optimization.md +0 -11
- package/dist/registry/stubs/workflows/bootstrap/create-architecture.md +0 -11
- package/dist/registry/stubs/workflows/bootstrap/detect-broken-windows.md +0 -11
- package/dist/registry/stubs/workflows/bootstrap/evaluate-code-quality.md +0 -11
- package/dist/registry/stubs/workflows/bootstrap/verify-test-coverage.md +0 -11
- package/dist/registry/stubs/workflows/brainstorming/blue-sky-brainstorming.md +0 -11
- package/dist/registry/stubs/workflows/brainstorming/codebase-brainstorming.md +0 -11
- package/dist/registry/stubs/workflows/business-development/create-business-plan.md +0 -11
- package/dist/registry/stubs/workflows/business-development/ideate-business-opportunity.md +0 -11
- package/dist/registry/stubs/workflows/business-development/price-product.md +0 -18
- package/dist/registry/stubs/workflows/compliance/detect-compliance-requirements.md +0 -11
- package/dist/registry/stubs/workflows/compliance/generate-audit-evidence.md +0 -11
- package/dist/registry/stubs/workflows/compliance/soc2-evidence-generator.md +0 -11
- package/dist/registry/stubs/workflows/customer-development/insight-analysis.md +0 -11
- package/dist/registry/stubs/workflows/customer-development/insight-triage.md +0 -11
- package/dist/registry/stubs/workflows/customer-development/interview-preparation.md +0 -11
- package/dist/registry/stubs/workflows/customer-development/linkedin-outreach.md +0 -11
- package/dist/registry/stubs/workflows/customer-development/strategic-brainstorming.md +0 -11
- package/dist/registry/stubs/workflows/customer-development/thank-customers.md +0 -11
- package/dist/registry/stubs/workflows/customer-development/user-survey-dispatch.md +0 -11
- package/dist/registry/stubs/workflows/customer-development/users-to-target.md +0 -11
- package/dist/registry/stubs/workflows/customer-development/weekly-newsletter.md +0 -11
- package/dist/registry/stubs/workflows/deploy/cloud-deployment.md +0 -11
- package/dist/registry/stubs/workflows/improve-fraim/contribute.md +0 -11
- package/dist/registry/stubs/workflows/improve-fraim/file-issue.md +0 -11
- package/dist/registry/stubs/workflows/learning/build-skillset.md +0 -11
- package/dist/registry/stubs/workflows/learning/synthesize-learnings.md +0 -11
- package/dist/registry/stubs/workflows/legal/contract-review-analysis.md +0 -11
- package/dist/registry/stubs/workflows/legal/nda.md +0 -11
- package/dist/registry/stubs/workflows/legal/patent-filing.md +0 -11
- package/dist/registry/stubs/workflows/legal/saas-contract-development.md +0 -11
- package/dist/registry/stubs/workflows/legal/trademark-filing.md +0 -11
- package/dist/registry/stubs/workflows/marketing/content-creation.md +0 -11
- package/dist/registry/stubs/workflows/marketing/convert-to-pdf.md +0 -11
- package/dist/registry/stubs/workflows/marketing/create-modern-website.md +0 -11
- package/dist/registry/stubs/workflows/marketing/domain-registration.md +0 -11
- package/dist/registry/stubs/workflows/marketing/evangelize.md +0 -11
- package/dist/registry/stubs/workflows/marketing/hbr-article.md +0 -11
- package/dist/registry/stubs/workflows/marketing/launch-checklist.md +0 -11
- package/dist/registry/stubs/workflows/marketing/marketing-strategy.md +0 -11
- package/dist/registry/stubs/workflows/marketing/storytelling.md +0 -11
- package/dist/registry/stubs/workflows/performance/analyze-performance.md +0 -11
- package/dist/registry/stubs/workflows/product-building/design.md +0 -11
- package/dist/registry/stubs/workflows/product-building/implement.md +0 -11
- package/dist/registry/stubs/workflows/product-building/iterate-on-pr-comments.md +0 -11
- package/dist/registry/stubs/workflows/product-building/prep-issue.md +0 -11
- package/dist/registry/stubs/workflows/product-building/prototype.md +0 -11
- package/dist/registry/stubs/workflows/product-building/resolve.md +0 -11
- package/dist/registry/stubs/workflows/product-building/retrospect.md +0 -11
- package/dist/registry/stubs/workflows/product-building/spec.md +0 -11
- package/dist/registry/stubs/workflows/product-building/test.md +0 -11
- package/dist/registry/stubs/workflows/productivity-report/productivity-report.md +0 -11
- package/dist/registry/stubs/workflows/quality-assurance/browser-validation.md +0 -11
- package/dist/registry/stubs/workflows/quality-assurance/iterative-improvement-cycle.md +0 -11
- package/dist/registry/stubs/workflows/replicate/replicate-discovery.md +0 -11
- package/dist/registry/stubs/workflows/replicate/replicate-to-issues.md +0 -11
- package/dist/registry/stubs/workflows/reviewer/review-implementation-vs-design-spec.md +0 -11
- package/dist/registry/stubs/workflows/reviewer/review-implementation-vs-feature-spec.md +0 -11
- package/dist/registry/stubs/workflows/startup-credits/aws-activate-application.md +0 -11
- package/dist/registry/stubs/workflows/startup-credits/google-cloud-application.md +0 -11
- package/dist/registry/stubs/workflows/startup-credits/microsoft-azure-application.md +0 -11
- 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 -122
- package/dist/registry/templates/evidence/Implementation-FeatureEvidence.md +0 -160
- 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/EVANGELIZE-TEMPLATE.md +0 -102
- 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/azure/cost-optimization.md +0 -772
- package/dist/registry/workflows/bootstrap/create-architecture.md +0 -37
- 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 -159
- 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 -80
- package/dist/registry/workflows/compliance/generate-audit-evidence.md +0 -80
- 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 -933
- package/dist/registry/workflows/customer-development/interview-preparation.md +0 -452
- package/dist/registry/workflows/customer-development/linkedin-outreach.md +0 -599
- 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 -312
- package/dist/registry/workflows/customer-development/users-to-target.md +0 -427
- 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 -369
- 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 -204
- package/dist/registry/workflows/legal/trademark-filing.md +0 -77
- package/dist/registry/workflows/marketing/content-creation.md +0 -40
- package/dist/registry/workflows/marketing/convert-to-pdf.md +0 -265
- 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/evangelize.md +0 -426
- 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 -263
- package/dist/registry/workflows/product-building/implement.md +0 -771
- 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 -60
- package/dist/registry/workflows/product-building/resolve.md +0 -175
- package/dist/registry/workflows/product-building/retrospect.md +0 -86
- package/dist/registry/workflows/product-building/spec.md +0 -303
- 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 -319
- package/dist/registry/workflows/reviewer/review-implementation-vs-design-spec.md +0 -694
- package/dist/registry/workflows/reviewer/review-implementation-vs-feature-spec.md +0 -734
- 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/src/cli/commands/init.js +0 -148
- package/dist/src/cli/commands/mcp.js +0 -65
- package/dist/src/cli/commands/wizard.js +0 -35
- 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/fraim/retrospective-learner.js +0 -301
- package/dist/src/fraim/setup-wizard.js +0 -99
|
@@ -18,13 +18,157 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
18
18
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
19
|
};
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.FraimLocalMCPServer = void 0;
|
|
21
|
+
exports.FraimLocalMCPServer = exports.FraimTemplateEngine = void 0;
|
|
22
22
|
const fs_1 = require("fs");
|
|
23
23
|
const path_1 = require("path");
|
|
24
24
|
const os_1 = require("os");
|
|
25
25
|
const child_process_1 = require("child_process");
|
|
26
26
|
const crypto_1 = require("crypto");
|
|
27
27
|
const axios_1 = __importDefault(require("axios"));
|
|
28
|
+
const provider_utils_1 = require("../utils/provider-utils");
|
|
29
|
+
const object_utils_1 = require("../utils/object-utils");
|
|
30
|
+
/**
|
|
31
|
+
* Handle template substitution logic separately for better testability
|
|
32
|
+
*/
|
|
33
|
+
class FraimTemplateEngine {
|
|
34
|
+
constructor(opts) {
|
|
35
|
+
this.deliveryTemplatesCache = null;
|
|
36
|
+
this.providerTemplatesCache = {};
|
|
37
|
+
this.config = opts.config;
|
|
38
|
+
this.repoInfo = opts.repoInfo;
|
|
39
|
+
this.workingStyle = opts.workingStyle;
|
|
40
|
+
this.projectRoot = opts.projectRoot;
|
|
41
|
+
this.logFn = opts.logFn || (() => { });
|
|
42
|
+
}
|
|
43
|
+
substituteTemplates(content) {
|
|
44
|
+
let result = content;
|
|
45
|
+
// First, substitute config variables with fallback support
|
|
46
|
+
if (this.config) {
|
|
47
|
+
result = result.replace(/\{\{config\.([^}|]+)(?:\s*\|\s*"([^"]+)")?\}\}/g, (match, path, fallback) => {
|
|
48
|
+
try {
|
|
49
|
+
const value = (0, object_utils_1.getNestedValue)(this.config, path.trim());
|
|
50
|
+
if (value !== undefined) {
|
|
51
|
+
return typeof value === 'object'
|
|
52
|
+
? JSON.stringify(value)
|
|
53
|
+
: String(value);
|
|
54
|
+
}
|
|
55
|
+
if (fallback !== undefined) {
|
|
56
|
+
return fallback;
|
|
57
|
+
}
|
|
58
|
+
return match;
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
return fallback !== undefined ? fallback : match;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
// Second, substitute {{delivery.*}} templates
|
|
66
|
+
const deliveryValues = this.loadDeliveryTemplates();
|
|
67
|
+
if (deliveryValues) {
|
|
68
|
+
result = result.replace(/\{\{delivery\.([^}]+)\}\}/g, (match, key) => {
|
|
69
|
+
const value = deliveryValues[`delivery.${key.trim()}`];
|
|
70
|
+
return value !== undefined ? value : match;
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
// Third, substitute platform-specific action templates
|
|
74
|
+
result = this.substitutePlatformActions(result);
|
|
75
|
+
return result;
|
|
76
|
+
}
|
|
77
|
+
loadDeliveryTemplates() {
|
|
78
|
+
if (this.deliveryTemplatesCache)
|
|
79
|
+
return this.deliveryTemplatesCache;
|
|
80
|
+
const filename = this.workingStyle === 'Conversation' ? 'delivery-conversation.json' : 'delivery-pr.json';
|
|
81
|
+
try {
|
|
82
|
+
let content = null;
|
|
83
|
+
if (this.projectRoot) {
|
|
84
|
+
const deliveryPath = (0, path_1.join)(this.projectRoot, 'registry', 'providers', filename);
|
|
85
|
+
if ((0, fs_1.existsSync)(deliveryPath)) {
|
|
86
|
+
content = (0, fs_1.readFileSync)(deliveryPath, 'utf-8');
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
if (!content) {
|
|
90
|
+
const nodeModulesPath = (0, path_1.join)(process.cwd(), 'node_modules', '@fraim', 'framework', 'registry', 'providers', filename);
|
|
91
|
+
if ((0, fs_1.existsSync)(nodeModulesPath)) {
|
|
92
|
+
content = (0, fs_1.readFileSync)(nodeModulesPath, 'utf-8');
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
if (content) {
|
|
96
|
+
this.deliveryTemplatesCache = JSON.parse(content);
|
|
97
|
+
return this.deliveryTemplatesCache;
|
|
98
|
+
}
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
this.logFn(`⚠️ Failed to load delivery templates: ${error.message}`);
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
substitutePlatformActions(content) {
|
|
107
|
+
const provider = (0, provider_utils_1.detectProvider)(this.repoInfo?.url);
|
|
108
|
+
const templates = this.loadProviderTemplates(provider);
|
|
109
|
+
if (!templates)
|
|
110
|
+
return content;
|
|
111
|
+
let result = content;
|
|
112
|
+
for (const [action, template] of Object.entries(templates)) {
|
|
113
|
+
const regex = new RegExp(`\\{\\{${action}\\}\\}`, 'g');
|
|
114
|
+
const renderedTemplate = this.renderActionTemplate(template);
|
|
115
|
+
result = result.replace(regex, renderedTemplate);
|
|
116
|
+
}
|
|
117
|
+
return result;
|
|
118
|
+
}
|
|
119
|
+
loadProviderTemplates(provider) {
|
|
120
|
+
if (this.providerTemplatesCache[provider])
|
|
121
|
+
return this.providerTemplatesCache[provider];
|
|
122
|
+
try {
|
|
123
|
+
let content = null;
|
|
124
|
+
if (this.projectRoot) {
|
|
125
|
+
const providerPath = (0, path_1.join)(this.projectRoot, 'registry', 'providers', `${provider}.json`);
|
|
126
|
+
if ((0, fs_1.existsSync)(providerPath)) {
|
|
127
|
+
content = (0, fs_1.readFileSync)(providerPath, 'utf-8');
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
if (!content) {
|
|
131
|
+
const nodeModulesPath = (0, path_1.join)(process.cwd(), 'node_modules', '@fraim', 'framework', 'registry', 'providers', `${provider}.json`);
|
|
132
|
+
if ((0, fs_1.existsSync)(nodeModulesPath)) {
|
|
133
|
+
content = (0, fs_1.readFileSync)(nodeModulesPath, 'utf-8');
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
if (content) {
|
|
137
|
+
const templates = JSON.parse(content);
|
|
138
|
+
this.providerTemplatesCache[provider] = templates;
|
|
139
|
+
return templates;
|
|
140
|
+
}
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
catch (error) {
|
|
144
|
+
this.logFn(`⚠️ Failed to load provider templates: ${error.message}`);
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
renderActionTemplate(template) {
|
|
149
|
+
if (!this.repoInfo && !this.config?.repository) {
|
|
150
|
+
return template;
|
|
151
|
+
}
|
|
152
|
+
return template.replace(/\{\{([^}]+)\}\}/g, (match, path) => {
|
|
153
|
+
const trimmedPath = path.trim();
|
|
154
|
+
if (trimmedPath.startsWith('repository.')) {
|
|
155
|
+
const repoPath = trimmedPath.substring('repository.'.length);
|
|
156
|
+
if (this.repoInfo) {
|
|
157
|
+
const value = (0, object_utils_1.getNestedValue)(this.repoInfo, repoPath);
|
|
158
|
+
if (value !== undefined)
|
|
159
|
+
return String(value);
|
|
160
|
+
}
|
|
161
|
+
if (this.config?.repository) {
|
|
162
|
+
const value = (0, object_utils_1.getNestedValue)(this.config.repository, repoPath);
|
|
163
|
+
if (value !== undefined)
|
|
164
|
+
return String(value);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
return match;
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
exports.FraimTemplateEngine = FraimTemplateEngine;
|
|
28
172
|
class FraimLocalMCPServer {
|
|
29
173
|
constructor() {
|
|
30
174
|
this.config = null;
|
|
@@ -33,6 +177,7 @@ class FraimLocalMCPServer {
|
|
|
33
177
|
this.pendingRootsRequest = false;
|
|
34
178
|
this.machineInfo = null;
|
|
35
179
|
this.repoInfo = null;
|
|
180
|
+
this.engine = null;
|
|
36
181
|
this.remoteUrl = process.env.FRAIM_REMOTE_URL || 'https://fraim.wellnessatwork.me';
|
|
37
182
|
this.apiKey = process.env.FRAIM_API_KEY || '';
|
|
38
183
|
this.localVersion = this.detectLocalVersion();
|
|
@@ -40,7 +185,7 @@ class FraimLocalMCPServer {
|
|
|
40
185
|
this.logError('❌ FRAIM_API_KEY environment variable is required');
|
|
41
186
|
process.exit(1);
|
|
42
187
|
}
|
|
43
|
-
this.log('🚀 FRAIM Local MCP Server starting...');
|
|
188
|
+
this.log('🚀 FRAIM Local MCP Server starting... [DEBUG-PROXY-V3]');
|
|
44
189
|
this.log(`📡 Remote server: ${this.remoteUrl}`);
|
|
45
190
|
this.log(`🔑 API key: ${this.apiKey.substring(0, 10)}...`);
|
|
46
191
|
this.log(`Local MCP version: ${this.localVersion}`);
|
|
@@ -307,183 +452,17 @@ class FraimLocalMCPServer {
|
|
|
307
452
|
}
|
|
308
453
|
return 'PR';
|
|
309
454
|
}
|
|
310
|
-
/**
|
|
311
|
-
* Substitute template variables in content
|
|
312
|
-
* Supports:
|
|
313
|
-
* 1. {{config.path.to.value}} - Config substitution
|
|
314
|
-
* 2. {{config.path.to.value | "fallback instruction"}} - With fallback
|
|
315
|
-
* 3. {{delivery.*}} - Working-style-specific delivery templates (from registry/providers/delivery-*.json)
|
|
316
|
-
* 4. Platform-specific action templates (GitHub vs ADO, from registry/providers/*.json)
|
|
317
|
-
*/
|
|
318
455
|
substituteTemplates(content) {
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
// Config value exists - substitute it
|
|
327
|
-
return typeof value === 'object'
|
|
328
|
-
? JSON.stringify(value)
|
|
329
|
-
: String(value);
|
|
330
|
-
}
|
|
331
|
-
if (fallback !== undefined) {
|
|
332
|
-
// Config value missing - use fallback instruction
|
|
333
|
-
return fallback;
|
|
334
|
-
}
|
|
335
|
-
// No fallback provided - keep placeholder
|
|
336
|
-
return match;
|
|
337
|
-
}
|
|
338
|
-
catch (error) {
|
|
339
|
-
// On error, use fallback if provided, otherwise keep placeholder
|
|
340
|
-
return fallback !== undefined ? fallback : match;
|
|
341
|
-
}
|
|
342
|
-
});
|
|
343
|
-
}
|
|
344
|
-
// Second, substitute {{delivery.*}} templates based on workingStyle
|
|
345
|
-
// Loaded from registry/providers/delivery-{mode}.json (same pattern as platform templates)
|
|
346
|
-
const deliveryValues = this.loadDeliveryTemplates();
|
|
347
|
-
if (deliveryValues) {
|
|
348
|
-
result = result.replace(/\{\{delivery\.([^}]+)\}\}/g, (match, key) => {
|
|
349
|
-
const value = deliveryValues[`delivery.${key.trim()}`];
|
|
350
|
-
return value !== undefined ? value : match;
|
|
456
|
+
if (!this.engine) {
|
|
457
|
+
this.engine = new FraimTemplateEngine({
|
|
458
|
+
config: this.config,
|
|
459
|
+
repoInfo: this.detectRepoInfo(),
|
|
460
|
+
workingStyle: this.getWorkingStyle(),
|
|
461
|
+
projectRoot: this.findProjectRoot(),
|
|
462
|
+
logFn: (msg) => this.log(msg)
|
|
351
463
|
});
|
|
352
464
|
}
|
|
353
|
-
|
|
354
|
-
// This works independently of config - only needs repo info
|
|
355
|
-
result = this.substitutePlatformActions(result);
|
|
356
|
-
return result;
|
|
357
|
-
}
|
|
358
|
-
/**
|
|
359
|
-
* Load delivery templates from registry based on workingStyle.
|
|
360
|
-
* Follows the same pattern as loadProviderTemplates (registry/providers/*.json).
|
|
361
|
-
*/
|
|
362
|
-
loadDeliveryTemplates() {
|
|
363
|
-
const workingStyle = this.getWorkingStyle();
|
|
364
|
-
const filename = workingStyle === 'Conversation' ? 'delivery-conversation.json' : 'delivery-pr.json';
|
|
365
|
-
try {
|
|
366
|
-
const projectRoot = this.findProjectRoot();
|
|
367
|
-
if (projectRoot) {
|
|
368
|
-
const deliveryPath = (0, path_1.join)(projectRoot, 'registry', 'providers', filename);
|
|
369
|
-
if ((0, fs_1.existsSync)(deliveryPath)) {
|
|
370
|
-
return JSON.parse((0, fs_1.readFileSync)(deliveryPath, 'utf-8'));
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
// Fallback: Try node_modules/@fraim/framework
|
|
374
|
-
const nodeModulesPath = (0, path_1.join)(process.cwd(), 'node_modules', '@fraim', 'framework', 'registry', 'providers', filename);
|
|
375
|
-
if ((0, fs_1.existsSync)(nodeModulesPath)) {
|
|
376
|
-
return JSON.parse((0, fs_1.readFileSync)(nodeModulesPath, 'utf-8'));
|
|
377
|
-
}
|
|
378
|
-
this.log(`⚠️ Could not find delivery templates: ${filename}`);
|
|
379
|
-
return null;
|
|
380
|
-
}
|
|
381
|
-
catch (error) {
|
|
382
|
-
this.log(`⚠️ Failed to load delivery templates: ${error.message}`);
|
|
383
|
-
return null;
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
/**
|
|
387
|
-
* Substitute platform-specific action templates
|
|
388
|
-
* Replaces {{action}} with provider-specific MCP tool calls
|
|
389
|
-
*/
|
|
390
|
-
substitutePlatformActions(content) {
|
|
391
|
-
// Detect provider from repo info
|
|
392
|
-
const provider = this.detectProvider();
|
|
393
|
-
// Load provider templates
|
|
394
|
-
const templates = this.loadProviderTemplates(provider);
|
|
395
|
-
if (!templates) {
|
|
396
|
-
return content; // No templates available, return unchanged
|
|
397
|
-
}
|
|
398
|
-
let result = content;
|
|
399
|
-
// Replace {{action}} with provider-specific implementations
|
|
400
|
-
for (const [action, template] of Object.entries(templates)) {
|
|
401
|
-
const regex = new RegExp(`\\{\\{${action}\\}\\}`, 'g');
|
|
402
|
-
// Substitute repository variables in the template
|
|
403
|
-
const renderedTemplate = this.renderActionTemplate(template, provider);
|
|
404
|
-
result = result.replace(regex, renderedTemplate);
|
|
405
|
-
}
|
|
406
|
-
return result;
|
|
407
|
-
}
|
|
408
|
-
/**
|
|
409
|
-
* Detect provider from repository info
|
|
410
|
-
*/
|
|
411
|
-
detectProvider() {
|
|
412
|
-
if (!this.repoInfo) {
|
|
413
|
-
return 'github'; // Default
|
|
414
|
-
}
|
|
415
|
-
const url = this.repoInfo.url || '';
|
|
416
|
-
if (url.includes('dev.azure.com') || url.includes('visualstudio.com')) {
|
|
417
|
-
return 'ado';
|
|
418
|
-
}
|
|
419
|
-
// Check config for explicit provider
|
|
420
|
-
if (this.config?.repository?.provider) {
|
|
421
|
-
return this.config.repository.provider;
|
|
422
|
-
}
|
|
423
|
-
return 'github'; // Default
|
|
424
|
-
}
|
|
425
|
-
/**
|
|
426
|
-
* Load provider templates from registry
|
|
427
|
-
*/
|
|
428
|
-
loadProviderTemplates(provider) {
|
|
429
|
-
try {
|
|
430
|
-
// Try to load from project root first
|
|
431
|
-
const projectRoot = this.findProjectRoot();
|
|
432
|
-
if (projectRoot) {
|
|
433
|
-
const providerPath = (0, path_1.join)(projectRoot, 'registry', 'providers', `${provider}.json`);
|
|
434
|
-
if ((0, fs_1.existsSync)(providerPath)) {
|
|
435
|
-
return JSON.parse((0, fs_1.readFileSync)(providerPath, 'utf-8'));
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
// Fallback: Try to load from node_modules/@fraim/framework
|
|
439
|
-
const nodeModulesPath = (0, path_1.join)(process.cwd(), 'node_modules', '@fraim', 'framework', 'registry', 'providers', `${provider}.json`);
|
|
440
|
-
if ((0, fs_1.existsSync)(nodeModulesPath)) {
|
|
441
|
-
return JSON.parse((0, fs_1.readFileSync)(nodeModulesPath, 'utf-8'));
|
|
442
|
-
}
|
|
443
|
-
this.log(`⚠️ Could not find provider templates for: ${provider}`);
|
|
444
|
-
return null;
|
|
445
|
-
}
|
|
446
|
-
catch (error) {
|
|
447
|
-
this.log(`⚠️ Failed to load provider templates: ${error.message}`);
|
|
448
|
-
return null;
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
/**
|
|
452
|
-
* Render action template with repository variables
|
|
453
|
-
*/
|
|
454
|
-
renderActionTemplate(template, provider) {
|
|
455
|
-
if (!this.repoInfo && !this.config?.repository) {
|
|
456
|
-
return template; // No repo info available
|
|
457
|
-
}
|
|
458
|
-
return template.replace(/\{\{([^}]+)\}\}/g, (match, path) => {
|
|
459
|
-
const trimmedPath = path.trim();
|
|
460
|
-
// Handle repository.* variables
|
|
461
|
-
if (trimmedPath.startsWith('repository.')) {
|
|
462
|
-
const repoPath = trimmedPath.substring('repository.'.length);
|
|
463
|
-
// Try repoInfo first (from git detection)
|
|
464
|
-
if (this.repoInfo) {
|
|
465
|
-
const value = this.getNestedValue(this.repoInfo, repoPath);
|
|
466
|
-
if (value !== undefined)
|
|
467
|
-
return String(value);
|
|
468
|
-
}
|
|
469
|
-
// Fallback to config
|
|
470
|
-
if (this.config?.repository) {
|
|
471
|
-
const value = this.getNestedValue(this.config.repository, repoPath);
|
|
472
|
-
if (value !== undefined)
|
|
473
|
-
return String(value);
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
// Keep original placeholder if not found
|
|
477
|
-
return match;
|
|
478
|
-
});
|
|
479
|
-
}
|
|
480
|
-
/**
|
|
481
|
-
* Get nested value from object using dot notation
|
|
482
|
-
*/
|
|
483
|
-
getNestedValue(obj, path) {
|
|
484
|
-
return path.split('.').reduce((current, key) => {
|
|
485
|
-
return current && current[key] !== undefined ? current[key] : undefined;
|
|
486
|
-
}, obj);
|
|
465
|
+
return this.engine.substituteTemplates(content);
|
|
487
466
|
}
|
|
488
467
|
/**
|
|
489
468
|
* Process template substitution in MCP response
|
|
@@ -595,14 +574,15 @@ class FraimLocalMCPServer {
|
|
|
595
574
|
}
|
|
596
575
|
return {
|
|
597
576
|
jsonrpc: '2.0',
|
|
598
|
-
id: request.id,
|
|
577
|
+
id: request.id || null,
|
|
599
578
|
error: {
|
|
600
|
-
code: -32603,
|
|
601
|
-
message: `Remote server error: ${error.message}`,
|
|
579
|
+
code: status === 401 ? -32001 : -32603,
|
|
580
|
+
message: `Remote server error (${status || 'unknown status'}): ${error.message}`,
|
|
602
581
|
data: {
|
|
603
582
|
fraimRequestId: requestId,
|
|
604
583
|
remoteStatus: status ?? null,
|
|
605
|
-
localMcpVersion: this.localVersion
|
|
584
|
+
localMcpVersion: this.localVersion,
|
|
585
|
+
remoteError: remoteData
|
|
606
586
|
}
|
|
607
587
|
}
|
|
608
588
|
};
|
|
@@ -741,6 +721,14 @@ class FraimLocalMCPServer {
|
|
|
741
721
|
}
|
|
742
722
|
else {
|
|
743
723
|
this.logError(`Unknown message type: ${JSON.stringify(message)}`);
|
|
724
|
+
process.stdout.write(JSON.stringify({
|
|
725
|
+
jsonrpc: '2.0',
|
|
726
|
+
error: {
|
|
727
|
+
code: -32600,
|
|
728
|
+
message: 'Invalid Request: Unknown message type'
|
|
729
|
+
},
|
|
730
|
+
id: message.id || null
|
|
731
|
+
}) + '\n');
|
|
744
732
|
}
|
|
745
733
|
}
|
|
746
734
|
catch (error) {
|
|
@@ -751,7 +739,8 @@ class FraimLocalMCPServer {
|
|
|
751
739
|
error: {
|
|
752
740
|
code: -32700,
|
|
753
741
|
message: `Parse error: ${error.message}`
|
|
754
|
-
}
|
|
742
|
+
},
|
|
743
|
+
id: null
|
|
755
744
|
};
|
|
756
745
|
process.stdout.write(JSON.stringify(errorResponse) + '\n');
|
|
757
746
|
}
|
|
@@ -8,7 +8,7 @@ exports.getDefaultBranch = getDefaultBranch;
|
|
|
8
8
|
const child_process_1 = require("child_process");
|
|
9
9
|
/**
|
|
10
10
|
* Gets a unique port based on the current git branch name (if it's an issue branch)
|
|
11
|
-
* Default to
|
|
11
|
+
* Default to 15302 if not on an issue branch
|
|
12
12
|
*/
|
|
13
13
|
function getPort() {
|
|
14
14
|
try {
|
|
@@ -24,7 +24,7 @@ function getPort() {
|
|
|
24
24
|
catch (e) {
|
|
25
25
|
// Silently fail and use default
|
|
26
26
|
}
|
|
27
|
-
return Number(process.env.PORT) || Number(process.env.WEBSITES_PORT) || Number(process.env.FRAIM_MCP_PORT) ||
|
|
27
|
+
return Number(process.env.PORT) || Number(process.env.WEBSITES_PORT) || Number(process.env.FRAIM_MCP_PORT) || 15302;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* Determines the database name based on the git branch
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getNestedValue = getNestedValue;
|
|
4
|
+
/**
|
|
5
|
+
* Safely get a nested value from an object using a dot-path
|
|
6
|
+
*/
|
|
7
|
+
function getNestedValue(obj, path) {
|
|
8
|
+
if (!obj)
|
|
9
|
+
return undefined;
|
|
10
|
+
return path.split('.').reduce((current, key) => current && current[key] !== undefined ? current[key] : undefined, obj);
|
|
11
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.detectProvider = detectProvider;
|
|
4
|
+
/**
|
|
5
|
+
* Detect git provider from URL
|
|
6
|
+
*/
|
|
7
|
+
function detectProvider(url) {
|
|
8
|
+
if (!url)
|
|
9
|
+
return 'github';
|
|
10
|
+
if (url.includes('dev.azure.com') || url.includes('visualstudio.com')) {
|
|
11
|
+
return 'ado';
|
|
12
|
+
}
|
|
13
|
+
return 'github';
|
|
14
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EMAIL_REGEX = void 0;
|
|
4
|
+
exports.validateEmail = validateEmail;
|
|
5
|
+
exports.getRequestMeta = getRequestMeta;
|
|
6
|
+
/**
|
|
7
|
+
* Standard email validation regex
|
|
8
|
+
*/
|
|
9
|
+
exports.EMAIL_REGEX = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
10
|
+
/**
|
|
11
|
+
* Validate an email address
|
|
12
|
+
*/
|
|
13
|
+
function validateEmail(email) {
|
|
14
|
+
return exports.EMAIL_REGEX.test(email);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Extract IP and UserAgent from an Express Request
|
|
18
|
+
*/
|
|
19
|
+
function getRequestMeta(req) {
|
|
20
|
+
const ip = req.headers['x-forwarded-for'] || req.ip || 'unknown';
|
|
21
|
+
const userAgent = req.headers['user-agent'] || 'unknown';
|
|
22
|
+
return { ip, userAgent };
|
|
23
|
+
}
|
|
@@ -87,6 +87,13 @@ class WorkflowParser {
|
|
|
87
87
|
isSimple: true
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* Get just the overview for an agent starting a workflow
|
|
92
|
+
*/
|
|
93
|
+
static getOverview(filePath) {
|
|
94
|
+
const wf = this.parse(filePath);
|
|
95
|
+
return wf ? wf.overview : null;
|
|
96
|
+
}
|
|
90
97
|
/**
|
|
91
98
|
* Extract description for listing workflows (intent or first para of overview)
|
|
92
99
|
*/
|
|
@@ -102,12 +109,5 @@ class WorkflowParser {
|
|
|
102
109
|
const firstPara = wf.overview.split(/\r?\n/).find(l => l.trim() !== '' && !l.startsWith('#'));
|
|
103
110
|
return firstPara ? firstPara.trim() : '';
|
|
104
111
|
}
|
|
105
|
-
/**
|
|
106
|
-
* Get just the overview for an agent starting a workflow
|
|
107
|
-
*/
|
|
108
|
-
static getOverview(filePath) {
|
|
109
|
-
const wf = this.parse(filePath);
|
|
110
|
-
return wf ? wf.overview : null;
|
|
111
|
-
}
|
|
112
112
|
}
|
|
113
113
|
exports.WorkflowParser = WorkflowParser;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fraim-framework",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.69",
|
|
4
4
|
"description": "FRAIM v2: Framework for Rigor-based AI Management - Transform from solo developer to AI manager orchestrating production-ready code with enterprise-grade discipline",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"scripts": {
|
|
11
11
|
"dev": "tsx --watch src/fraim-mcp-server.ts > server.log 2>&1",
|
|
12
12
|
"dev:prod": "npm run build && node dist/src/fraim-mcp-server.js > server.log 2>&1",
|
|
13
|
-
"build": "tsc && node scripts/copy-ai-manager-rules.js && npm run
|
|
13
|
+
"build": "tsc && npm run build:stubs && node scripts/copy-ai-manager-rules.js && npm run validate:registry",
|
|
14
14
|
"build:stubs": "tsx scripts/build-stub-registry.ts",
|
|
15
15
|
"test": "node scripts/test-with-server.js",
|
|
16
16
|
"start:fraim": "tsx src/fraim-mcp-server.ts",
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
"manage-keys": "tsx scripts/fraim/manage-keys.ts",
|
|
21
21
|
"view-signups": "tsx scripts/view-signups.ts",
|
|
22
22
|
"fraim:init": "npm run build && node index.js init",
|
|
23
|
-
"fraim:sync": "node index.js sync",
|
|
23
|
+
"fraim:sync": "node index.js sync --local",
|
|
24
24
|
"postinstall": "fraim sync --skip-updates || echo 'FRAIM setup skipped.'",
|
|
25
25
|
"prepublishOnly": "npm run build",
|
|
26
26
|
"release": "npm version patch && npm publish",
|
|
27
|
-
"test-smoke-ci": "tsx --test tests/test-genericization.ts tests/test-cli.ts tests/test-stub-registry.ts
|
|
27
|
+
"test-smoke-ci": "tsx --test tests/test-genericization.ts tests/test-cli.ts tests/test-stub-registry.ts",
|
|
28
28
|
"test-all-ci": "tsx --test tests/test-*.ts",
|
|
29
29
|
"validate:registry": "tsx scripts/verify-registry-paths.ts && npm run validate:workflows && npm run validate:platform-agnostic",
|
|
30
30
|
"validate:workflows": "tsx scripts/validate-workflows.ts",
|
|
@@ -67,6 +67,8 @@
|
|
|
67
67
|
"@types/node": "^20.0.0",
|
|
68
68
|
"@types/prompts": "^2.4.9",
|
|
69
69
|
"fast-glob": "^3.3.3",
|
|
70
|
+
"pptxgenjs": "^4.0.1",
|
|
71
|
+
"qrcode": "^1.5.4",
|
|
70
72
|
"tsx": "^4.0.0",
|
|
71
73
|
"typescript": "^5.0.0"
|
|
72
74
|
},
|
|
@@ -75,7 +77,6 @@
|
|
|
75
77
|
"dist/src/cli/",
|
|
76
78
|
"dist/src/fraim/",
|
|
77
79
|
"dist/src/utils/",
|
|
78
|
-
"dist/registry/",
|
|
79
80
|
"bin/fraim.js",
|
|
80
81
|
"bin/fraim-mcp.js",
|
|
81
82
|
"index.js",
|
|
@@ -94,6 +95,7 @@
|
|
|
94
95
|
"cors": "^2.8.5",
|
|
95
96
|
"dotenv": "^16.4.7",
|
|
96
97
|
"express": "^5.2.1",
|
|
98
|
+
"html-to-docx": "^1.8.0",
|
|
97
99
|
"markdown-it": "^14.1.0",
|
|
98
100
|
"markdown-it-highlightjs": "^4.2.0",
|
|
99
101
|
"mongodb": "^7.0.0",
|
package/dist/registry/ai-manager-rules/customer-development-phases/phase1-customer-profiling.md
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
# Phase 1: Customer Profiling
|
|
2
|
-
|
|
3
|
-
## Objective
|
|
4
|
-
Define target customer characteristics and search criteria to guide systematic prospect discovery across multiple platforms.
|
|
5
|
-
|
|
6
|
-
## Key Questions to Ask
|
|
7
|
-
|
|
8
|
-
### Understanding the Business
|
|
9
|
-
1. "What specific problem does your product or service solve?"
|
|
10
|
-
2. "How do customers currently solve this problem without your solution?"
|
|
11
|
-
3. "What makes your solution different from existing alternatives?"
|
|
12
|
-
4. "What's the cost of not solving this problem for your customers?"
|
|
13
|
-
5. "How urgent is this problem for your target customers?"
|
|
14
|
-
|
|
15
|
-
### Defining the Target Customer
|
|
16
|
-
6. "Who experiences this problem most acutely in their daily work?"
|
|
17
|
-
7. "What job titles would typically have this problem?"
|
|
18
|
-
8. "What industries or sectors are most affected by this problem?"
|
|
19
|
-
9. "What size companies (startup, SMB, enterprise) are your ideal customers?"
|
|
20
|
-
10. "What geographic regions should we focus on?"
|
|
21
|
-
|
|
22
|
-
### Identifying Pain Points
|
|
23
|
-
11. "What specific symptoms or frustrations do customers experience?"
|
|
24
|
-
12. "What keywords or phrases would customers use to describe their problem?"
|
|
25
|
-
13. "How do customers currently search for solutions to this problem?"
|
|
26
|
-
14. "What triggers customers to actively seek a solution?"
|
|
27
|
-
15. "What objections or concerns do customers typically have?"
|
|
28
|
-
|
|
29
|
-
### Platform Behavior
|
|
30
|
-
16. "Where do your target customers spend time online professionally?"
|
|
31
|
-
17. "What communities, forums, or groups do they participate in?"
|
|
32
|
-
18. "What type of content do they share or engage with?"
|
|
33
|
-
19. "How do they prefer to be contacted or approached?"
|
|
34
|
-
20. "What social proof or credibility signals matter to them?"
|
|
35
|
-
|
|
36
|
-
## Validation Criteria
|
|
37
|
-
|
|
38
|
-
### Customer Persona Completeness
|
|
39
|
-
- [ ] Clear problem statement defined
|
|
40
|
-
- [ ] Target demographics specified (job titles, industries, company size)
|
|
41
|
-
- [ ] Pain points articulated with specific language customers use
|
|
42
|
-
- [ ] Geographic and market constraints identified
|
|
43
|
-
- [ ] Behavioral patterns and preferences documented
|
|
44
|
-
|
|
45
|
-
### Search Strategy Readiness
|
|
46
|
-
- [ ] Platform-specific keywords identified for each channel
|
|
47
|
-
- [ ] Search terms validated against how customers actually describe problems
|
|
48
|
-
- [ ] Qualification criteria established (scoring system 1-10)
|
|
49
|
-
- [ ] Success metrics defined (quantity and quality targets)
|
|
50
|
-
|
|
51
|
-
## Evidence Required
|
|
52
|
-
|
|
53
|
-
### Customer Persona Document
|
|
54
|
-
Create: `docs/customer-development/customer-persona-{timestamp}.md`
|
|
55
|
-
|
|
56
|
-
**Required Sections:**
|
|
57
|
-
- Problem statement and solution overview
|
|
58
|
-
- Target customer demographics
|
|
59
|
-
- Pain points and symptoms
|
|
60
|
-
- Search keywords by platform
|
|
61
|
-
- Qualification criteria
|
|
62
|
-
- Success metrics
|
|
63
|
-
|
|
64
|
-
### Search Strategy Document
|
|
65
|
-
Create: `docs/customer-development/search-strategy-{timestamp}.md`
|
|
66
|
-
|
|
67
|
-
**Required Sections:**
|
|
68
|
-
- Platform-specific search terms
|
|
69
|
-
- Qualification scoring rubric
|
|
70
|
-
- Target prospect quantities per platform
|
|
71
|
-
- Quality thresholds and filters
|
|
72
|
-
|
|
73
|
-
## Common Pitfalls
|
|
74
|
-
|
|
75
|
-
### Vague Problem Definition
|
|
76
|
-
- **Problem**: "We help businesses be more efficient"
|
|
77
|
-
- **Better**: "We help SaaS companies reduce customer churn by identifying at-risk accounts 30 days before they cancel"
|
|
78
|
-
|
|
79
|
-
### Too Broad Target Market
|
|
80
|
-
- **Problem**: "Anyone who uses software"
|
|
81
|
-
- **Better**: "VP of Customer Success at B2B SaaS companies with 50-500 employees and $10M+ ARR"
|
|
82
|
-
|
|
83
|
-
### Generic Pain Points
|
|
84
|
-
- **Problem**: "Customers want to save time and money"
|
|
85
|
-
- **Better**: "Customer Success teams spend 15+ hours per week manually analyzing usage data to identify churn risk, often missing early warning signs"
|
|
86
|
-
|
|
87
|
-
## Next Steps
|
|
88
|
-
|
|
89
|
-
Once validation criteria are met:
|
|
90
|
-
1. **Proceed to Phase 2**: Multi-Platform Discovery
|
|
91
|
-
2. **Use validated persona** to guide platform searches
|
|
92
|
-
3. **Apply qualification criteria** consistently across all prospects
|
|
93
|
-
4. **Track metrics** against defined success criteria
|
|
94
|
-
|
|
95
|
-
## Success Indicators
|
|
96
|
-
|
|
97
|
-
- Customer persona resonates with founder's deep understanding of the market
|
|
98
|
-
- Search keywords reflect actual language customers use
|
|
99
|
-
- Qualification criteria are specific and measurable
|
|
100
|
-
- Success metrics are realistic and achievable
|
|
101
|
-
- Founder feels confident about who they're looking for and where to find them
|