fraim-framework 2.0.56 → 2.0.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/bin/fraim-mcp.js +14 -0
  3. package/bin/fraim.js +23 -0
  4. package/dist/src/cli/commands/init-project.js +10 -4
  5. package/dist/src/cli/commands/mcp.js +65 -0
  6. package/dist/src/cli/setup/mcp-config-generator.js +19 -16
  7. package/dist/src/fraim/issue-tracking/ado-provider.js +304 -0
  8. package/dist/src/fraim/issue-tracking/factory.js +63 -0
  9. package/dist/src/fraim/issue-tracking/github-provider.js +200 -0
  10. package/dist/src/fraim/issue-tracking/types.js +7 -0
  11. package/dist/src/fraim/issue-tracking-config.js +83 -0
  12. package/dist/src/local-mcp-server/stdio-server.js +207 -0
  13. package/dist/src/utils/workflow-parser.js +81 -0
  14. package/package.json +17 -12
  15. package/registry/scripts/pdf-styles.css +172 -0
  16. package/registry/scripts/prep-issue.sh +46 -4
  17. package/registry/scripts/profile-server.ts +131 -130
  18. package/registry/stubs/workflows/customer-development/user-survey-dispatch.md +1 -1
  19. package/registry/stubs/workflows/customer-development/users-to-target.md +1 -1
  20. package/registry/stubs/workflows/product-building/design.md +1 -1
  21. package/registry/stubs/workflows/product-building/implement.md +1 -1
  22. package/Claude.md +0 -1
  23. package/dist/registry/ai-manager-rules/customer-development-phases/phase1-customer-profiling.md +0 -101
  24. package/dist/registry/ai-manager-rules/customer-development-phases/phase2-platform-discovery.md +0 -235
  25. package/dist/registry/ai-manager-rules/customer-development-phases/phase3-prospect-qualification.md +0 -243
  26. package/dist/registry/ai-manager-rules/customer-development-phases/phase4-inventory-compilation.md +0 -206
  27. package/dist/registry/ai-manager-rules/design-phases/design-completeness-review.md +0 -73
  28. package/dist/registry/ai-manager-rules/design-phases/design-design.md +0 -145
  29. package/dist/registry/ai-manager-rules/implement-phases/implement-code.md +0 -283
  30. package/dist/registry/ai-manager-rules/implement-phases/implement-completeness-review.md +0 -120
  31. package/dist/registry/ai-manager-rules/implement-phases/implement-regression.md +0 -173
  32. package/dist/registry/ai-manager-rules/implement-phases/implement-repro.md +0 -104
  33. package/dist/registry/ai-manager-rules/implement-phases/implement-scoping.md +0 -100
  34. package/dist/registry/ai-manager-rules/implement-phases/implement-smoke.md +0 -237
  35. package/dist/registry/ai-manager-rules/implement-phases/implement-spike.md +0 -121
  36. package/dist/registry/ai-manager-rules/implement-phases/implement-validate.md +0 -375
  37. package/dist/registry/ai-manager-rules/retrospective.md +0 -116
  38. package/dist/registry/ai-manager-rules/shared-phases/address-pr-feedback.md +0 -188
  39. package/dist/registry/ai-manager-rules/shared-phases/submit-pr.md +0 -202
  40. package/dist/registry/ai-manager-rules/shared-phases/wait-for-pr-review.md +0 -170
  41. package/dist/registry/ai-manager-rules/spec-phases/spec-competitor-analysis.md +0 -105
  42. package/dist/registry/ai-manager-rules/spec-phases/spec-completeness-review.md +0 -66
  43. package/dist/registry/ai-manager-rules/spec-phases/spec-spec.md +0 -139
  44. package/dist/registry/ai-manager-rules/user-survey-phases/phase1-survey-scoping.md +0 -60
  45. package/dist/registry/ai-manager-rules/user-survey-phases/phase2-survey-build-linkedin.md +0 -23
  46. package/dist/registry/ai-manager-rules/user-survey-phases/phase3-survey-build-reddit.md +0 -22
  47. package/dist/registry/ai-manager-rules/user-survey-phases/phase4-survey-build-x.md +0 -21
  48. package/dist/registry/ai-manager-rules/user-survey-phases/phase5-survey-build-facebook.md +0 -19
  49. package/dist/registry/ai-manager-rules/user-survey-phases/phase6-survey-build-custom.md +0 -15
  50. package/dist/registry/ai-manager-rules/user-survey-phases/phase7-survey-dispatch.md +0 -45
  51. package/dist/registry/providers/ado.json +0 -19
  52. package/dist/registry/providers/github.json +0 -19
  53. package/dist/registry/scripts/cleanup-branch.js +0 -287
  54. package/dist/registry/scripts/evaluate-code-quality.js +0 -66
  55. package/dist/registry/scripts/exec-with-timeout.js +0 -142
  56. package/dist/registry/scripts/generate-engagement-emails.js +0 -705
  57. package/dist/registry/scripts/newsletter-helpers.js +0 -671
  58. package/dist/registry/scripts/profile-server.js +0 -388
  59. package/dist/registry/scripts/run-thank-you-workflow.js +0 -92
  60. package/dist/registry/scripts/send-newsletter-simple.js +0 -85
  61. package/dist/registry/scripts/send-thank-you-emails.js +0 -54
  62. package/dist/registry/scripts/validate-openapi-limits.js +0 -311
  63. package/dist/registry/scripts/validate-test-coverage.js +0 -262
  64. package/dist/registry/scripts/verify-test-coverage.js +0 -66
  65. package/dist/registry/templates/bootstrap/ARCHITECTURE-TEMPLATE.md +0 -53
  66. package/dist/registry/templates/bootstrap/CODE-QUALITY-REPORT-TEMPLATE.md +0 -37
  67. package/dist/registry/templates/bootstrap/TEST-COVERAGE-REPORT-TEMPLATE.md +0 -35
  68. package/dist/registry/templates/business-development/IDEATION-REPORT-TEMPLATE.md +0 -29
  69. package/dist/registry/templates/business-development/PRICING-STRATEGY-TEMPLATE.md +0 -126
  70. package/dist/registry/templates/customer-development/customer-interview-template.md +0 -99
  71. package/dist/registry/templates/customer-development/customer-persona-template.md +0 -69
  72. package/dist/registry/templates/customer-development/follow-up-email-templates.md +0 -132
  73. package/dist/registry/templates/customer-development/insight-analysis-template.md +0 -74
  74. package/dist/registry/templates/customer-development/prospect-inventory-template.csv +0 -3
  75. package/dist/registry/templates/customer-development/search-strategy-template.md +0 -123
  76. package/dist/registry/templates/customer-development/strategic-recommendations-template.md +0 -53
  77. package/dist/registry/templates/customer-development/thank-you-email-template.html +0 -124
  78. package/dist/registry/templates/customer-development/thank-you-note-template.md +0 -16
  79. package/dist/registry/templates/customer-development/triage-log-template.md +0 -278
  80. package/dist/registry/templates/customer-development/weekly-newsletter-template.html +0 -204
  81. package/dist/registry/templates/evidence/Design-Evidence.md +0 -30
  82. package/dist/registry/templates/evidence/Implementation-BugEvidence.md +0 -94
  83. package/dist/registry/templates/evidence/Implementation-FeatureEvidence.md +0 -129
  84. package/dist/registry/templates/evidence/Spec-Evidence.md +0 -19
  85. package/dist/registry/templates/help/HelpNeeded.md +0 -14
  86. package/dist/registry/templates/legal/NDA-TEMPLATE.md +0 -170
  87. package/dist/registry/templates/legal/PATENT-TEMPLATE.md +0 -372
  88. package/dist/registry/templates/legal/TRADEMARK-TEMPLATE.md +0 -339
  89. package/dist/registry/templates/legal/contract-review-checklist.md +0 -193
  90. package/dist/registry/templates/legal/review-report-template.md +0 -198
  91. package/dist/registry/templates/legal/saas-terms-template.md +0 -174
  92. package/dist/registry/templates/legal/sow-template.md +0 -117
  93. package/dist/registry/templates/legal/template-variables.md +0 -131
  94. package/dist/registry/templates/marketing/DOMAIN-REGISTRATION-TEMPLATE.md +0 -194
  95. package/dist/registry/templates/marketing/HBR-ARTICLE-TEMPLATE.md +0 -66
  96. package/dist/registry/templates/marketing/STORYTELLING-TEMPLATE.md +0 -130
  97. package/dist/registry/templates/marketing/WEBSITE-TEMPLATE.md +0 -262
  98. package/dist/registry/templates/marketing/github-pages-workflow.yml +0 -64
  99. package/dist/registry/templates/replicate/implementation-checklist.md +0 -39
  100. package/dist/registry/templates/replicate/use-cases-template.md +0 -88
  101. package/dist/registry/templates/retrospective/RETROSPECTIVE-TEMPLATE.md +0 -55
  102. package/dist/registry/templates/specs/BUGSPEC-TEMPLATE.md +0 -37
  103. package/dist/registry/templates/specs/FEATURESPEC-TEMPLATE.md +0 -66
  104. package/dist/registry/templates/specs/TECHSPEC-TEMPLATE.md +0 -39
  105. package/dist/registry/workflows/bootstrap/create-architecture.md +0 -38
  106. package/dist/registry/workflows/bootstrap/detect-broken-windows.md +0 -300
  107. package/dist/registry/workflows/bootstrap/evaluate-code-quality.md +0 -35
  108. package/dist/registry/workflows/bootstrap/verify-test-coverage.md +0 -36
  109. package/dist/registry/workflows/brainstorming/blue-sky-brainstorming.md +0 -211
  110. package/dist/registry/workflows/brainstorming/codebase-brainstorming.md +0 -165
  111. package/dist/registry/workflows/business-development/create-business-plan.md +0 -737
  112. package/dist/registry/workflows/business-development/ideate-business-opportunity.md +0 -55
  113. package/dist/registry/workflows/business-development/price-product.md +0 -325
  114. package/dist/registry/workflows/compliance/detect-compliance-requirements.md +0 -78
  115. package/dist/registry/workflows/compliance/generate-audit-evidence.md +0 -75
  116. package/dist/registry/workflows/compliance/soc2-evidence-generator.md +0 -332
  117. package/dist/registry/workflows/customer-development/insight-analysis.md +0 -156
  118. package/dist/registry/workflows/customer-development/insight-triage.md +0 -938
  119. package/dist/registry/workflows/customer-development/interview-preparation.md +0 -452
  120. package/dist/registry/workflows/customer-development/linkedin-outreach.md +0 -593
  121. package/dist/registry/workflows/customer-development/strategic-brainstorming.md +0 -146
  122. package/dist/registry/workflows/customer-development/thank-customers.md +0 -203
  123. package/dist/registry/workflows/customer-development/user-survey-dispatch.md +0 -60
  124. package/dist/registry/workflows/customer-development/users-to-target.md +0 -112
  125. package/dist/registry/workflows/customer-development/weekly-newsletter.md +0 -366
  126. package/dist/registry/workflows/deploy/cloud-deployment.md +0 -310
  127. package/dist/registry/workflows/improve-fraim/contribute.md +0 -32
  128. package/dist/registry/workflows/improve-fraim/file-issue.md +0 -32
  129. package/dist/registry/workflows/learning/build-skillset.md +0 -212
  130. package/dist/registry/workflows/learning/synthesize-learnings.md +0 -284
  131. package/dist/registry/workflows/legal/contract-review-analysis.md +0 -382
  132. package/dist/registry/workflows/legal/nda.md +0 -69
  133. package/dist/registry/workflows/legal/patent-filing.md +0 -76
  134. package/dist/registry/workflows/legal/saas-contract-development.md +0 -213
  135. package/dist/registry/workflows/legal/trademark-filing.md +0 -77
  136. package/dist/registry/workflows/marketing/content-creation.md +0 -37
  137. package/dist/registry/workflows/marketing/convert-to-pdf.md +0 -235
  138. package/dist/registry/workflows/marketing/create-modern-website.md +0 -456
  139. package/dist/registry/workflows/marketing/domain-registration.md +0 -323
  140. package/dist/registry/workflows/marketing/hbr-article.md +0 -73
  141. package/dist/registry/workflows/marketing/launch-checklist.md +0 -37
  142. package/dist/registry/workflows/marketing/marketing-strategy.md +0 -45
  143. package/dist/registry/workflows/marketing/storytelling.md +0 -65
  144. package/dist/registry/workflows/performance/analyze-performance.md +0 -65
  145. package/dist/registry/workflows/product-building/design.md +0 -103
  146. package/dist/registry/workflows/product-building/implement.md +0 -74
  147. package/dist/registry/workflows/product-building/iterate-on-pr-comments.md +0 -70
  148. package/dist/registry/workflows/product-building/prep-issue.md +0 -41
  149. package/dist/registry/workflows/product-building/prototype.md +0 -65
  150. package/dist/registry/workflows/product-building/resolve.md +0 -168
  151. package/dist/registry/workflows/product-building/retrospect.md +0 -86
  152. package/dist/registry/workflows/product-building/spec.md +0 -181
  153. package/dist/registry/workflows/product-building/test.md +0 -125
  154. package/dist/registry/workflows/productivity-report/productivity-report.md +0 -263
  155. package/dist/registry/workflows/quality-assurance/browser-validation.md +0 -221
  156. package/dist/registry/workflows/quality-assurance/iterative-improvement-cycle.md +0 -562
  157. package/dist/registry/workflows/replicate/replicate-discovery.md +0 -336
  158. package/dist/registry/workflows/replicate/replicate-to-issues.md +0 -324
  159. package/dist/registry/workflows/reviewer/review-implementation-vs-design-spec.md +0 -638
  160. package/dist/registry/workflows/reviewer/review-implementation-vs-feature-spec.md +0 -675
  161. package/dist/registry/workflows/startup-credits/aws-activate-application.md +0 -535
  162. package/dist/registry/workflows/startup-credits/google-cloud-application.md +0 -647
  163. package/dist/registry/workflows/startup-credits/microsoft-azure-application.md +0 -538
  164. package/dist/scripts/build-stub-registry.js +0 -108
  165. package/dist/src/ai-manager/ai-manager.js +0 -480
  166. package/dist/src/ai-manager/phase-flow.js +0 -357
  167. package/dist/src/ai-manager/types.js +0 -5
  168. package/dist/src/fraim-mcp-server.js +0 -1885
  169. package/dist/tests/debug-tools.js +0 -80
  170. package/dist/tests/shared-server-utils.js +0 -57
  171. package/dist/tests/test-add-ide.js +0 -283
  172. package/dist/tests/test-ai-coach-edge-cases.js +0 -420
  173. package/dist/tests/test-ai-coach-mcp-integration.js +0 -450
  174. package/dist/tests/test-ai-coach-performance.js +0 -328
  175. package/dist/tests/test-ai-coach-phase-content.js +0 -264
  176. package/dist/tests/test-ai-coach-workflows.js +0 -514
  177. package/dist/tests/test-cli.js +0 -228
  178. package/dist/tests/test-client-scripts-validation.js +0 -167
  179. package/dist/tests/test-complete-setup-flow.js +0 -110
  180. package/dist/tests/test-config-system.js +0 -279
  181. package/dist/tests/test-debug-session.js +0 -134
  182. package/dist/tests/test-end-to-end-hybrid-validation.js +0 -328
  183. package/dist/tests/test-enhanced-session-init.js +0 -188
  184. package/dist/tests/test-first-run-journey.js +0 -368
  185. package/dist/tests/test-fraim-issues.js +0 -59
  186. package/dist/tests/test-genericization.js +0 -44
  187. package/dist/tests/test-hybrid-script-execution.js +0 -340
  188. package/dist/tests/test-ide-detector.js +0 -46
  189. package/dist/tests/test-improved-setup.js +0 -121
  190. package/dist/tests/test-mcp-config-generator.js +0 -99
  191. package/dist/tests/test-mcp-connection.js +0 -107
  192. package/dist/tests/test-mcp-issue-integration.js +0 -156
  193. package/dist/tests/test-mcp-lifecycle-methods.js +0 -240
  194. package/dist/tests/test-mcp-shared-server.js +0 -308
  195. package/dist/tests/test-mcp-template-processing.js +0 -160
  196. package/dist/tests/test-modular-issue-tracking.js +0 -165
  197. package/dist/tests/test-node-compatibility.js +0 -95
  198. package/dist/tests/test-npm-install.js +0 -68
  199. package/dist/tests/test-package-size.js +0 -108
  200. package/dist/tests/test-pr-review-workflow.js +0 -307
  201. package/dist/tests/test-prep-issue.js +0 -129
  202. package/dist/tests/test-productivity-integration.js +0 -157
  203. package/dist/tests/test-script-location-independence.js +0 -198
  204. package/dist/tests/test-script-sync.js +0 -557
  205. package/dist/tests/test-server-utils.js +0 -32
  206. package/dist/tests/test-session-rehydration.js +0 -148
  207. package/dist/tests/test-setup-integration.js +0 -98
  208. package/dist/tests/test-setup-scenarios.js +0 -322
  209. package/dist/tests/test-standalone.js +0 -143
  210. package/dist/tests/test-stub-registry.js +0 -136
  211. package/dist/tests/test-sync-stubs.js +0 -143
  212. package/dist/tests/test-sync-version-update.js +0 -93
  213. package/dist/tests/test-telemetry.js +0 -193
  214. package/dist/tests/test-token-validator.js +0 -30
  215. package/dist/tests/test-user-journey.js +0 -236
  216. package/dist/tests/test-users-to-target-workflow.js +0 -253
  217. package/dist/tests/test-utils.js +0 -109
  218. package/dist/tests/test-wizard.js +0 -71
  219. package/dist/tests/test-workflow-discovery.js +0 -242
  220. package/labels.json +0 -52
  221. package/registry/agent-guardrails.md +0 -63
  222. package/registry/fraim.md +0 -48
  223. package/setup.js +0 -171
  224. package/tsconfig.json +0 -23
@@ -0,0 +1,200 @@
1
+ "use strict";
2
+ /**
3
+ * GitHub Issue Tracking Provider
4
+ *
5
+ * Implements the IssueTrackingProvider interface for GitHub Issues
6
+ */
7
+ var __importDefault = (this && this.__importDefault) || function (mod) {
8
+ return (mod && mod.__esModule) ? mod : { "default": mod };
9
+ };
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.GitHubIssueProvider = void 0;
12
+ const axios_1 = __importDefault(require("axios"));
13
+ class GitHubIssueProvider {
14
+ constructor(config) {
15
+ this.config = config;
16
+ this.baseUrl = `https://api.github.com/repos/${config.owner}/${config.repo}`;
17
+ }
18
+ async createIssue(params) {
19
+ const { title, body, labels, assignee, dryRun } = params;
20
+ const payload = {
21
+ title,
22
+ body
23
+ };
24
+ if (labels && labels.length > 0) {
25
+ payload.labels = labels;
26
+ }
27
+ if (assignee) {
28
+ payload.assignee = assignee;
29
+ }
30
+ if (dryRun) {
31
+ return {
32
+ success: true,
33
+ dryRun: true,
34
+ provider: 'github',
35
+ message: `[DRY RUN] Would create GitHub issue: "${title}" in ${this.config.owner}/${this.config.repo}`
36
+ };
37
+ }
38
+ try {
39
+ const response = await axios_1.default.post(`${this.baseUrl}/issues`, payload, {
40
+ headers: {
41
+ 'Authorization': `Bearer ${this.config.token}`,
42
+ 'Accept': 'application/vnd.github.v3+json',
43
+ 'Content-Type': 'application/json',
44
+ },
45
+ });
46
+ return {
47
+ success: true,
48
+ issueNumber: response.data.number,
49
+ issueId: response.data.number,
50
+ htmlUrl: response.data.html_url,
51
+ provider: 'github'
52
+ };
53
+ }
54
+ catch (error) {
55
+ return {
56
+ success: false,
57
+ provider: 'github',
58
+ message: this.formatError(error)
59
+ };
60
+ }
61
+ }
62
+ async getIssue(issueId) {
63
+ try {
64
+ const response = await axios_1.default.get(`${this.baseUrl}/issues/${issueId}`, {
65
+ headers: {
66
+ 'Authorization': `Bearer ${this.config.token}`,
67
+ 'Accept': 'application/vnd.github.v3+json',
68
+ },
69
+ });
70
+ const issue = response.data;
71
+ return {
72
+ id: issue.number,
73
+ title: issue.title,
74
+ body: issue.body || '',
75
+ state: issue.state === 'open' ? 'open' : 'closed',
76
+ assignee: issue.assignee?.login,
77
+ labels: issue.labels.map((label) => label.name),
78
+ createdAt: new Date(issue.created_at),
79
+ updatedAt: new Date(issue.updated_at),
80
+ htmlUrl: issue.html_url
81
+ };
82
+ }
83
+ catch (error) {
84
+ if (error.response?.status === 404) {
85
+ return null;
86
+ }
87
+ throw new Error(this.formatError(error));
88
+ }
89
+ }
90
+ async updateIssue(issueId, updates) {
91
+ const payload = {};
92
+ if (updates.title)
93
+ payload.title = updates.title;
94
+ if (updates.body)
95
+ payload.body = updates.body;
96
+ if (updates.labels)
97
+ payload.labels = updates.labels;
98
+ if (updates.assignee)
99
+ payload.assignee = updates.assignee;
100
+ if (updates.dryRun) {
101
+ return {
102
+ success: true,
103
+ dryRun: true,
104
+ provider: 'github',
105
+ message: `[DRY RUN] Would update GitHub issue #${issueId} in ${this.config.owner}/${this.config.repo}`
106
+ };
107
+ }
108
+ try {
109
+ const response = await axios_1.default.patch(`${this.baseUrl}/issues/${issueId}`, payload, {
110
+ headers: {
111
+ 'Authorization': `Bearer ${this.config.token}`,
112
+ 'Accept': 'application/vnd.github.v3+json',
113
+ 'Content-Type': 'application/json',
114
+ },
115
+ });
116
+ return {
117
+ success: true,
118
+ issueNumber: response.data.number,
119
+ issueId: response.data.number,
120
+ htmlUrl: response.data.html_url,
121
+ provider: 'github'
122
+ };
123
+ }
124
+ catch (error) {
125
+ return {
126
+ success: false,
127
+ provider: 'github',
128
+ message: this.formatError(error)
129
+ };
130
+ }
131
+ }
132
+ async listIssues(filters) {
133
+ const params = {
134
+ per_page: filters?.limit || 30
135
+ };
136
+ if (filters?.state && filters.state !== 'all') {
137
+ params.state = filters.state;
138
+ }
139
+ if (filters?.assignee) {
140
+ params.assignee = filters.assignee;
141
+ }
142
+ if (filters?.labels && filters.labels.length > 0) {
143
+ params.labels = filters.labels.join(',');
144
+ }
145
+ try {
146
+ const response = await axios_1.default.get(`${this.baseUrl}/issues`, {
147
+ headers: {
148
+ 'Authorization': `Bearer ${this.config.token}`,
149
+ 'Accept': 'application/vnd.github.v3+json',
150
+ },
151
+ params
152
+ });
153
+ return response.data.map((issue) => ({
154
+ id: issue.number,
155
+ title: issue.title,
156
+ body: issue.body || '',
157
+ state: issue.state === 'open' ? 'open' : 'closed',
158
+ assignee: issue.assignee?.login,
159
+ labels: issue.labels.map((label) => label.name),
160
+ createdAt: new Date(issue.created_at),
161
+ updatedAt: new Date(issue.updated_at),
162
+ htmlUrl: issue.html_url
163
+ }));
164
+ }
165
+ catch (error) {
166
+ throw new Error(this.formatError(error));
167
+ }
168
+ }
169
+ async validateConfig() {
170
+ try {
171
+ // Test by getting repository info
172
+ const response = await axios_1.default.get(this.baseUrl, {
173
+ headers: {
174
+ 'Authorization': `Bearer ${this.config.token}`,
175
+ 'Accept': 'application/vnd.github.v3+json',
176
+ },
177
+ });
178
+ return {
179
+ valid: true,
180
+ message: `Connected to ${response.data.full_name}`
181
+ };
182
+ }
183
+ catch (error) {
184
+ return {
185
+ valid: false,
186
+ message: this.formatError(error)
187
+ };
188
+ }
189
+ }
190
+ formatError(error) {
191
+ if (axios_1.default.isAxiosError(error)) {
192
+ return `GitHub API Error: ${error.response?.status} - ${JSON.stringify(error.response?.data)}`;
193
+ }
194
+ else if (error instanceof Error) {
195
+ return `GitHub Error: ${error.message}`;
196
+ }
197
+ return 'Unknown GitHub error';
198
+ }
199
+ }
200
+ exports.GitHubIssueProvider = GitHubIssueProvider;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * Issue Tracking System Types
4
+ *
5
+ * Defines the common interface for all issue tracking systems (GitHub, ADO, etc.)
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ /**
3
+ * Issue Tracking Configuration Helper
4
+ *
5
+ * Provides guidance on which MCP tools to use based on configuration.
6
+ * This replaces custom providers with MCP tool recommendations.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.getIssueTrackingGuidance = getIssueTrackingGuidance;
10
+ exports.getRepositoryInfo = getRepositoryInfo;
11
+ const config_loader_1 = require("./config-loader");
12
+ /**
13
+ * Get guidance on which MCP tools to use for issue tracking
14
+ */
15
+ function getIssueTrackingGuidance() {
16
+ const config = (0, config_loader_1.loadFraimConfig)();
17
+ // Check for ADO configuration
18
+ if (config.repository?.provider === 'ado') {
19
+ return {
20
+ provider: 'ado',
21
+ mcpTools: {
22
+ createIssue: 'mcp_ado_create_work_item',
23
+ getIssue: 'mcp_ado_get_work_item',
24
+ updateIssue: 'mcp_ado_update_work_item',
25
+ listIssues: 'mcp_ado_list_work_items',
26
+ createPR: 'mcp_ado_create_pull_request',
27
+ getPR: 'mcp_ado_get_pull_request',
28
+ mergePR: 'mcp_ado_merge_pull_request'
29
+ },
30
+ config: {
31
+ organization: config.repository.organization,
32
+ project: config.repository.project
33
+ },
34
+ environmentVars: ['ADO_TOKEN', 'AZURE_DEVOPS_TOKEN'],
35
+ setupInstructions: `Configure ADO MCP server in your IDE with:
36
+ - Organization: ${config.repository.organization}
37
+ - Project: ${config.repository.project}
38
+ - Token: Set ADO_TOKEN or AZURE_DEVOPS_TOKEN environment variable`
39
+ };
40
+ }
41
+ // Default to GitHub
42
+ const owner = config.repository?.owner || config.git?.repoOwner || 'mathursrus';
43
+ const repo = config.repository?.name || config.git?.repoName || 'FRAIM';
44
+ return {
45
+ provider: 'github',
46
+ mcpTools: {
47
+ createIssue: 'mcp_github_issue_write',
48
+ getIssue: 'mcp_github_issue_read',
49
+ updateIssue: 'mcp_github_issue_write',
50
+ listIssues: 'mcp_github_list_issues',
51
+ createPR: 'mcp_github_create_pull_request',
52
+ getPR: 'mcp_github_pull_request_read',
53
+ mergePR: 'mcp_github_merge_pull_request'
54
+ },
55
+ config: {
56
+ owner,
57
+ repo
58
+ },
59
+ environmentVars: ['GITHUB_TOKEN'],
60
+ setupInstructions: `GitHub MCP tools are configured for:
61
+ - Repository: ${owner}/${repo}
62
+ - Token: Set GITHUB_TOKEN environment variable
63
+ - MCP Server: Ensure GitHub MCP server is configured in your IDE`
64
+ };
65
+ }
66
+ /**
67
+ * Get repository information from .fraim/config.json
68
+ */
69
+ function getRepositoryInfo() {
70
+ try {
71
+ const config = (0, config_loader_1.loadFraimConfig)();
72
+ const owner = config.repository?.owner || config.git?.repoOwner;
73
+ const repo = config.repository?.name || config.git?.repoName;
74
+ return {
75
+ owner,
76
+ repo,
77
+ url: owner && repo ? `https://github.com/${owner}/${repo}.git` : undefined
78
+ };
79
+ }
80
+ catch (e) {
81
+ return {};
82
+ }
83
+ }
@@ -0,0 +1,207 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ /**
4
+ * FRAIM Local MCP Server - STDIO Version
5
+ *
6
+ * Simple proxy that:
7
+ * 1. Accepts MCP requests via stdin/stdout
8
+ * 2. Proxies to remote FRAIM server
9
+ * 3. Performs template substitution using local .fraim/config.json
10
+ * 4. Returns processed content to agent
11
+ */
12
+ var __importDefault = (this && this.__importDefault) || function (mod) {
13
+ return (mod && mod.__esModule) ? mod : { "default": mod };
14
+ };
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.FraimLocalMCPServer = void 0;
17
+ const fs_1 = require("fs");
18
+ const path_1 = require("path");
19
+ const axios_1 = __importDefault(require("axios"));
20
+ class FraimLocalMCPServer {
21
+ constructor() {
22
+ this.config = null;
23
+ this.remoteUrl = process.env.FRAIM_REMOTE_URL || 'https://fraim.wellnessatwork.me';
24
+ this.apiKey = process.env.FRAIM_API_KEY || '';
25
+ if (!this.apiKey) {
26
+ this.logError('❌ FRAIM_API_KEY environment variable is required');
27
+ process.exit(1);
28
+ }
29
+ this.loadConfig();
30
+ this.log('🚀 FRAIM Local MCP Server starting...');
31
+ this.log(`📡 Remote server: ${this.remoteUrl}`);
32
+ this.log(`🔑 API key: ${this.apiKey.substring(0, 10)}...`);
33
+ }
34
+ log(message) {
35
+ // Log to stderr (stdout is reserved for MCP protocol)
36
+ console.error(`[FRAIM] ${message}`);
37
+ }
38
+ logError(message) {
39
+ console.error(`[FRAIM ERROR] ${message}`);
40
+ }
41
+ loadConfig() {
42
+ try {
43
+ const configPath = (0, path_1.join)(process.cwd(), '.fraim', 'config.json');
44
+ if ((0, fs_1.existsSync)(configPath)) {
45
+ const configContent = (0, fs_1.readFileSync)(configPath, 'utf8');
46
+ this.config = JSON.parse(configContent);
47
+ this.log('✅ Loaded local .fraim/config.json');
48
+ }
49
+ else {
50
+ this.log('⚠️ No .fraim/config.json found - template substitution disabled');
51
+ }
52
+ }
53
+ catch (error) {
54
+ this.logError(`Failed to load config: ${error}`);
55
+ this.config = null;
56
+ }
57
+ }
58
+ /**
59
+ * Substitute template variables in content
60
+ * Replaces {{config.path.to.value}} with actual values from config
61
+ */
62
+ substituteTemplates(content) {
63
+ if (!this.config)
64
+ return content;
65
+ return content.replace(/\{\{config\.([^}]+)\}\}/g, (match, path) => {
66
+ try {
67
+ const keys = path.split('.');
68
+ let value = this.config;
69
+ for (const key of keys) {
70
+ if (value && typeof value === 'object' && key in value) {
71
+ value = value[key];
72
+ }
73
+ else {
74
+ // Keep original placeholder if path not found
75
+ return match;
76
+ }
77
+ }
78
+ return String(value);
79
+ }
80
+ catch (error) {
81
+ // Keep original placeholder on error
82
+ return match;
83
+ }
84
+ });
85
+ }
86
+ /**
87
+ * Process template substitution in MCP response
88
+ */
89
+ processResponse(response) {
90
+ if (!response.result)
91
+ return response;
92
+ // Process content fields that might contain templates
93
+ const processValue = (value) => {
94
+ if (typeof value === 'string') {
95
+ return this.substituteTemplates(value);
96
+ }
97
+ else if (Array.isArray(value)) {
98
+ return value.map(processValue);
99
+ }
100
+ else if (value && typeof value === 'object') {
101
+ const processed = {};
102
+ for (const [key, val] of Object.entries(value)) {
103
+ processed[key] = processValue(val);
104
+ }
105
+ return processed;
106
+ }
107
+ return value;
108
+ };
109
+ return {
110
+ ...response,
111
+ result: processValue(response.result)
112
+ };
113
+ }
114
+ /**
115
+ * Proxy request to remote FRAIM server
116
+ */
117
+ async proxyToRemote(request) {
118
+ try {
119
+ const response = await axios_1.default.post(`${this.remoteUrl}/mcp`, request, {
120
+ headers: {
121
+ 'Content-Type': 'application/json',
122
+ 'x-api-key': this.apiKey
123
+ },
124
+ timeout: 30000
125
+ });
126
+ return response.data;
127
+ }
128
+ catch (error) {
129
+ this.logError(`Remote request failed: ${error.message}`);
130
+ return {
131
+ jsonrpc: '2.0',
132
+ id: request.id,
133
+ error: {
134
+ code: -32603,
135
+ message: `Remote server error: ${error.message}`
136
+ }
137
+ };
138
+ }
139
+ }
140
+ /**
141
+ * Handle incoming MCP request
142
+ */
143
+ async handleRequest(request) {
144
+ this.log(`📥 ${request.method}`);
145
+ // Proxy to remote server
146
+ const response = await this.proxyToRemote(request);
147
+ // Process template substitution
148
+ const processedResponse = this.processResponse(response);
149
+ this.log(`📤 ${request.method} → ${processedResponse.error ? 'ERROR' : 'OK'}`);
150
+ return processedResponse;
151
+ }
152
+ /**
153
+ * Start STDIO server
154
+ */
155
+ start() {
156
+ let buffer = '';
157
+ process.stdin.setEncoding('utf8');
158
+ process.stdin.on('data', async (chunk) => {
159
+ buffer += chunk;
160
+ // Process complete JSON-RPC messages (newline-delimited)
161
+ let newlineIndex;
162
+ while ((newlineIndex = buffer.indexOf('\n')) !== -1) {
163
+ const line = buffer.slice(0, newlineIndex).trim();
164
+ buffer = buffer.slice(newlineIndex + 1);
165
+ if (line) {
166
+ try {
167
+ const request = JSON.parse(line);
168
+ const response = await this.handleRequest(request);
169
+ // Send response to stdout
170
+ process.stdout.write(JSON.stringify(response) + '\n');
171
+ }
172
+ catch (error) {
173
+ this.logError(`Request processing failed: ${error.message}`);
174
+ // Send error response
175
+ const errorResponse = {
176
+ jsonrpc: '2.0',
177
+ error: {
178
+ code: -32700,
179
+ message: `Parse error: ${error.message}`
180
+ }
181
+ };
182
+ process.stdout.write(JSON.stringify(errorResponse) + '\n');
183
+ }
184
+ }
185
+ }
186
+ });
187
+ process.stdin.on('end', () => {
188
+ this.log('🛑 Stdin closed, shutting down...');
189
+ process.exit(0);
190
+ });
191
+ process.on('SIGTERM', () => {
192
+ this.log('🛑 SIGTERM received, shutting down...');
193
+ process.exit(0);
194
+ });
195
+ process.on('SIGINT', () => {
196
+ this.log('🛑 SIGINT received, shutting down...');
197
+ process.exit(0);
198
+ });
199
+ this.log('✅ FRAIM Local MCP Server ready');
200
+ }
201
+ }
202
+ exports.FraimLocalMCPServer = FraimLocalMCPServer;
203
+ // Start server if run directly
204
+ if (require.main === module) {
205
+ const server = new FraimLocalMCPServer();
206
+ server.start();
207
+ }
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WorkflowParser = void 0;
4
+ const fs_1 = require("fs");
5
+ class WorkflowParser {
6
+ /**
7
+ * Parse a workflow markdown file into a structured definition
8
+ */
9
+ static parse(filePath) {
10
+ if (!(0, fs_1.existsSync)(filePath))
11
+ return null;
12
+ const content = (0, fs_1.readFileSync)(filePath, 'utf-8');
13
+ // 1. Extract JSON Metadata
14
+ const metadataMatch = content.match(/^---\r?\n([\s\S]+?)\r?\n---/);
15
+ if (!metadataMatch)
16
+ return null;
17
+ let metadata;
18
+ try {
19
+ metadata = JSON.parse(metadataMatch[1]);
20
+ }
21
+ catch (e) {
22
+ console.error(`❌ Failed to parse JSON metadata in ${filePath}:`, e);
23
+ return null;
24
+ }
25
+ // 2. Extract Overview (Content after metadata but before first phase header)
26
+ const contentAfterMetadata = content.substring(metadataMatch[0].length).trim();
27
+ const firstPhaseIndex = contentAfterMetadata.search(/^##\s+Phase:/m);
28
+ let overview = '';
29
+ let restOfContent = '';
30
+ if (firstPhaseIndex !== -1) {
31
+ overview = contentAfterMetadata.substring(0, firstPhaseIndex).trim();
32
+ restOfContent = contentAfterMetadata.substring(firstPhaseIndex);
33
+ }
34
+ else {
35
+ overview = contentAfterMetadata;
36
+ }
37
+ // 3. Extract Phases (id -> content)
38
+ const phases = new Map();
39
+ const phaseSections = restOfContent.split(/^##\s+Phase:\s+/m);
40
+ // Skip the first part (empty or overview overlap)
41
+ for (let i = 1; i < phaseSections.length; i++) {
42
+ const section = phaseSections[i];
43
+ const sectionLines = section.split('\n');
44
+ const firstLine = sectionLines[0].trim();
45
+ // Extract phase ID (slug before any (Phase X) or space)
46
+ const id = firstLine.split(/[ (]/)[0].trim().toLowerCase();
47
+ // The content includes the header (we'll reconstruct it for the agent or just return the body)
48
+ // But usually, the agent wants the whole section including the Phase ID header.
49
+ // We'll store the whole section but prepend the header because split removed it.
50
+ phases.set(id, `## Phase: ${section.trim()}`);
51
+ }
52
+ return {
53
+ metadata,
54
+ overview,
55
+ phases
56
+ };
57
+ }
58
+ /**
59
+ * Extract description for listing workflows (intent or first para of overview)
60
+ */
61
+ static extractDescription(filePath) {
62
+ const wf = this.parse(filePath);
63
+ if (!wf)
64
+ return '';
65
+ // Try to find Intent section in overview
66
+ const intentMatch = wf.overview.match(/## Intent\s+([\s\S]+?)(?:\r?\n##|$)/);
67
+ if (intentMatch)
68
+ return intentMatch[1].trim().split(/\r?\n/)[0];
69
+ // Fallback to first non-header line
70
+ const firstPara = wf.overview.split(/\r?\n/).find(l => l.trim() !== '' && !l.startsWith('#'));
71
+ return firstPara ? firstPara.trim() : '';
72
+ }
73
+ /**
74
+ * Get just the overview for an agent starting a workflow
75
+ */
76
+ static getOverview(filePath) {
77
+ const wf = this.parse(filePath);
78
+ return wf ? wf.overview : null;
79
+ }
80
+ }
81
+ exports.WorkflowParser = WorkflowParser;
package/package.json CHANGED
@@ -1,15 +1,14 @@
1
1
  {
2
2
  "name": "fraim-framework",
3
- "version": "2.0.56",
3
+ "version": "2.0.58",
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": {
7
7
  "fraim": "./index.js",
8
- "fraim-setup": "./index.js"
8
+ "fraim-mcp": "./bin/fraim-mcp.js"
9
9
  },
10
10
  "scripts": {
11
- "setup": "node setup.js",
12
- "dev": "tsx --watch src/fraim-mcp-server.ts",
11
+ "dev": "tsx --watch src/fraim-mcp-server.ts > server.log 2>&1",
13
12
  "build": "tsc && node scripts/copy-ai-manager-rules.js && npm run build:stubs && npm run validate:registry",
14
13
  "build:stubs": "tsx scripts/build-stub-registry.ts",
15
14
  "test": "node scripts/test-with-server.js",
@@ -26,7 +25,8 @@
26
25
  "release": "npm version patch && npm publish",
27
26
  "test-smoke-ci": "tsx --test tests/test-genericization.ts tests/test-cli.ts tests/test-stub-registry.ts tests/test-sync-stubs.ts",
28
27
  "test-all-ci": "tsx --test tests/test-*.ts",
29
- "validate:registry": "tsx scripts/verify-registry-paths.ts"
28
+ "validate:registry": "tsx scripts/verify-registry-paths.ts && npm run validate:workflows",
29
+ "validate:workflows": "tsx scripts/validate-workflows.ts"
30
30
  },
31
31
  "repository": {
32
32
  "type": "git",
@@ -69,14 +69,19 @@
69
69
  "typescript": "^5.0.0"
70
70
  },
71
71
  "files": [
72
- "dist/",
72
+ "dist/src/local-mcp-server/",
73
+ "dist/src/cli/",
74
+ "dist/src/fraim/",
75
+ "dist/src/utils/",
73
76
  "registry/stubs/",
74
77
  "registry/scripts/",
75
- "bin/",
76
- "*.js",
77
- "*.ts",
78
- "*.md",
79
- "*.json"
78
+ "bin/fraim.js",
79
+ "bin/fraim-mcp.js",
80
+ "index.js",
81
+ "README.md",
82
+ "CHANGELOG.md",
83
+ "LICENSE",
84
+ "package.json"
80
85
  ],
81
86
  "publishConfig": {
82
87
  "access": "public"
@@ -92,7 +97,7 @@
92
97
  "markdown-it-highlightjs": "^4.2.0",
93
98
  "mongodb": "^7.0.0",
94
99
  "prompts": "^2.4.2",
95
- "puppeteer": "^24.35.0",
100
+ "puppeteer": "^24.36.1",
96
101
  "sharp": "^0.34.5",
97
102
  "tree-kill": "^1.2.2"
98
103
  }