@l4yercak3/cli 1.3.1 → 2.0.0-alpha.0

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 (357) hide show
  1. package/README.md +10 -220
  2. package/dist/api/client.d.ts +12 -0
  3. package/dist/api/client.d.ts.map +1 -0
  4. package/dist/api/client.js +37 -0
  5. package/dist/api/client.js.map +1 -0
  6. package/dist/api/platform.d.ts +161 -0
  7. package/dist/api/platform.d.ts.map +1 -0
  8. package/dist/api/platform.js +70 -0
  9. package/dist/api/platform.js.map +1 -0
  10. package/dist/bin/sevenlayers.d.ts +3 -0
  11. package/dist/bin/sevenlayers.d.ts.map +1 -0
  12. package/dist/bin/sevenlayers.js +198 -0
  13. package/dist/bin/sevenlayers.js.map +1 -0
  14. package/dist/commands/agent/catalog.d.ts +5 -0
  15. package/dist/commands/agent/catalog.d.ts.map +1 -0
  16. package/dist/commands/agent/catalog.js +142 -0
  17. package/dist/commands/agent/catalog.js.map +1 -0
  18. package/dist/commands/agent/drift.d.ts +5 -0
  19. package/dist/commands/agent/drift.d.ts.map +1 -0
  20. package/dist/commands/agent/drift.js +113 -0
  21. package/dist/commands/agent/drift.js.map +1 -0
  22. package/dist/commands/agent/init.d.ts +5 -0
  23. package/dist/commands/agent/init.d.ts.map +1 -0
  24. package/dist/commands/agent/init.js +75 -0
  25. package/dist/commands/agent/init.js.map +1 -0
  26. package/dist/commands/agent/permissions.d.ts +5 -0
  27. package/dist/commands/agent/permissions.d.ts.map +1 -0
  28. package/dist/commands/agent/permissions.js +88 -0
  29. package/dist/commands/agent/permissions.js.map +1 -0
  30. package/dist/commands/agent/runner.d.ts +14 -0
  31. package/dist/commands/agent/runner.d.ts.map +1 -0
  32. package/dist/commands/agent/runner.js +59 -0
  33. package/dist/commands/agent/runner.js.map +1 -0
  34. package/dist/commands/agent/shared.d.ts +13 -0
  35. package/dist/commands/agent/shared.d.ts.map +1 -0
  36. package/dist/commands/agent/shared.js +31 -0
  37. package/dist/commands/agent/shared.js.map +1 -0
  38. package/dist/commands/agent/template.d.ts +5 -0
  39. package/dist/commands/agent/template.d.ts.map +1 -0
  40. package/dist/commands/agent/template.js +104 -0
  41. package/dist/commands/agent/template.js.map +1 -0
  42. package/dist/commands/app/connect.d.ts +7 -0
  43. package/dist/commands/app/connect.d.ts.map +1 -0
  44. package/dist/commands/app/connect.js +12 -0
  45. package/dist/commands/app/connect.js.map +1 -0
  46. package/dist/commands/app/init.d.ts +7 -0
  47. package/dist/commands/app/init.d.ts.map +1 -0
  48. package/dist/commands/app/init.js +12 -0
  49. package/dist/commands/app/init.js.map +1 -0
  50. package/dist/commands/app/link.d.ts +3 -0
  51. package/dist/commands/app/link.d.ts.map +1 -0
  52. package/dist/commands/app/link.js +92 -0
  53. package/dist/commands/app/link.js.map +1 -0
  54. package/dist/commands/app/pages.d.ts +15 -0
  55. package/dist/commands/app/pages.d.ts.map +1 -0
  56. package/dist/commands/app/pages.js +180 -0
  57. package/dist/commands/app/pages.js.map +1 -0
  58. package/dist/commands/app/register.d.ts +3 -0
  59. package/dist/commands/app/register.d.ts.map +1 -0
  60. package/dist/commands/app/register.js +120 -0
  61. package/dist/commands/app/register.js.map +1 -0
  62. package/dist/commands/app/remote.d.ts +14 -0
  63. package/dist/commands/app/remote.d.ts.map +1 -0
  64. package/dist/commands/app/remote.js +44 -0
  65. package/dist/commands/app/remote.js.map +1 -0
  66. package/dist/commands/app/setup.d.ts +3 -0
  67. package/dist/commands/app/setup.d.ts.map +1 -0
  68. package/dist/commands/app/setup.js +299 -0
  69. package/dist/commands/app/setup.js.map +1 -0
  70. package/dist/commands/app/shared.d.ts +9 -0
  71. package/dist/commands/app/shared.d.ts.map +1 -0
  72. package/dist/commands/app/shared.js +122 -0
  73. package/dist/commands/app/shared.js.map +1 -0
  74. package/dist/commands/app/sync.d.ts +7 -0
  75. package/dist/commands/app/sync.d.ts.map +1 -0
  76. package/dist/commands/app/sync.js +107 -0
  77. package/dist/commands/app/sync.js.map +1 -0
  78. package/dist/commands/booking/check.d.ts +3 -0
  79. package/dist/commands/booking/check.d.ts.map +1 -0
  80. package/dist/commands/booking/check.js +68 -0
  81. package/dist/commands/booking/check.js.map +1 -0
  82. package/dist/commands/booking/setup.d.ts +3 -0
  83. package/dist/commands/booking/setup.d.ts.map +1 -0
  84. package/dist/commands/booking/setup.js +95 -0
  85. package/dist/commands/booking/setup.js.map +1 -0
  86. package/dist/commands/booking/shared.d.ts +31 -0
  87. package/dist/commands/booking/shared.d.ts.map +1 -0
  88. package/dist/commands/booking/shared.js +112 -0
  89. package/dist/commands/booking/shared.js.map +1 -0
  90. package/dist/commands/booking/smoke.d.ts +3 -0
  91. package/dist/commands/booking/smoke.d.ts.map +1 -0
  92. package/dist/commands/booking/smoke.js +101 -0
  93. package/dist/commands/booking/smoke.js.map +1 -0
  94. package/dist/commands/cms/bind.d.ts +3 -0
  95. package/dist/commands/cms/bind.d.ts.map +1 -0
  96. package/dist/commands/cms/bind.js +212 -0
  97. package/dist/commands/cms/bind.js.map +1 -0
  98. package/dist/commands/cms/content.d.ts +40 -0
  99. package/dist/commands/cms/content.d.ts.map +1 -0
  100. package/dist/commands/cms/content.js +169 -0
  101. package/dist/commands/cms/content.js.map +1 -0
  102. package/dist/commands/cms/doctor.d.ts +3 -0
  103. package/dist/commands/cms/doctor.d.ts.map +1 -0
  104. package/dist/commands/cms/doctor.js +69 -0
  105. package/dist/commands/cms/doctor.js.map +1 -0
  106. package/dist/commands/cms/migrate.d.ts +3 -0
  107. package/dist/commands/cms/migrate.d.ts.map +1 -0
  108. package/dist/commands/cms/migrate.js +78 -0
  109. package/dist/commands/cms/migrate.js.map +1 -0
  110. package/dist/commands/cms/registry.d.ts +3 -0
  111. package/dist/commands/cms/registry.d.ts.map +1 -0
  112. package/dist/commands/cms/registry.js +161 -0
  113. package/dist/commands/cms/registry.js.map +1 -0
  114. package/dist/commands/cms/seed.d.ts +3 -0
  115. package/dist/commands/cms/seed.d.ts.map +1 -0
  116. package/dist/commands/cms/seed.js +102 -0
  117. package/dist/commands/cms/seed.js.map +1 -0
  118. package/dist/commands/cms/shared.d.ts +22 -0
  119. package/dist/commands/cms/shared.d.ts.map +1 -0
  120. package/dist/commands/cms/shared.js +82 -0
  121. package/dist/commands/cms/shared.js.map +1 -0
  122. package/dist/commands/doctor/target.d.ts +3 -0
  123. package/dist/commands/doctor/target.d.ts.map +1 -0
  124. package/dist/commands/doctor/target.js +46 -0
  125. package/dist/commands/doctor/target.js.map +1 -0
  126. package/dist/commands/env/list.d.ts +3 -0
  127. package/dist/commands/env/list.d.ts.map +1 -0
  128. package/dist/commands/env/list.js +28 -0
  129. package/dist/commands/env/list.js.map +1 -0
  130. package/dist/commands/env/set.d.ts +3 -0
  131. package/dist/commands/env/set.d.ts.map +1 -0
  132. package/dist/commands/env/set.js +36 -0
  133. package/dist/commands/env/set.js.map +1 -0
  134. package/dist/commands/env/use.d.ts +3 -0
  135. package/dist/commands/env/use.d.ts.map +1 -0
  136. package/dist/commands/env/use.js +15 -0
  137. package/dist/commands/env/use.js.map +1 -0
  138. package/dist/commands/legacy/connect.d.ts +3 -0
  139. package/dist/commands/legacy/connect.d.ts.map +1 -0
  140. package/dist/commands/legacy/connect.js +8 -0
  141. package/dist/commands/legacy/connect.js.map +1 -0
  142. package/dist/commands/legacy/pages.d.ts +3 -0
  143. package/dist/commands/legacy/pages.d.ts.map +1 -0
  144. package/dist/commands/legacy/pages.js +16 -0
  145. package/dist/commands/legacy/pages.js.map +1 -0
  146. package/dist/commands/legacy/spread.d.ts +3 -0
  147. package/dist/commands/legacy/spread.d.ts.map +1 -0
  148. package/dist/commands/legacy/spread.js +8 -0
  149. package/dist/commands/legacy/spread.js.map +1 -0
  150. package/dist/commands/legacy/sync.d.ts +3 -0
  151. package/dist/commands/legacy/sync.d.ts.map +1 -0
  152. package/dist/commands/legacy/sync.js +8 -0
  153. package/dist/commands/legacy/sync.js.map +1 -0
  154. package/dist/config/env-diff.d.ts +10 -0
  155. package/dist/config/env-diff.d.ts.map +1 -0
  156. package/dist/config/env-diff.js +24 -0
  157. package/dist/config/env-diff.js.map +1 -0
  158. package/dist/config/env-parser.d.ts +20 -0
  159. package/dist/config/env-parser.d.ts.map +1 -0
  160. package/dist/config/env-parser.js +70 -0
  161. package/dist/config/env-parser.js.map +1 -0
  162. package/dist/config/env-writer.d.ts +22 -0
  163. package/dist/config/env-writer.d.ts.map +1 -0
  164. package/dist/config/env-writer.js +172 -0
  165. package/dist/config/env-writer.js.map +1 -0
  166. package/dist/config/profile-store.d.ts +29 -0
  167. package/dist/config/profile-store.d.ts.map +1 -0
  168. package/dist/config/profile-store.js +257 -0
  169. package/dist/config/profile-store.js.map +1 -0
  170. package/dist/core/args.d.ts +11 -0
  171. package/dist/core/args.d.ts.map +1 -0
  172. package/dist/core/args.js +106 -0
  173. package/dist/core/args.js.map +1 -0
  174. package/dist/core/colors.d.ts +6 -0
  175. package/dist/core/colors.d.ts.map +1 -0
  176. package/dist/core/colors.js +29 -0
  177. package/dist/core/colors.js.map +1 -0
  178. package/dist/safety/target-guard.d.ts +16 -0
  179. package/dist/safety/target-guard.d.ts.map +1 -0
  180. package/dist/safety/target-guard.js +55 -0
  181. package/dist/safety/target-guard.js.map +1 -0
  182. package/dist/testing/booking-smoke.d.ts +17 -0
  183. package/dist/testing/booking-smoke.d.ts.map +1 -0
  184. package/dist/testing/booking-smoke.js +43 -0
  185. package/dist/testing/booking-smoke.js.map +1 -0
  186. package/dist/tests/agent-commands.test.d.ts +2 -0
  187. package/dist/tests/agent-commands.test.d.ts.map +1 -0
  188. package/dist/tests/agent-commands.test.js +180 -0
  189. package/dist/tests/agent-commands.test.js.map +1 -0
  190. package/dist/tests/agent-governance.test.d.ts +2 -0
  191. package/dist/tests/agent-governance.test.d.ts.map +1 -0
  192. package/dist/tests/agent-governance.test.js +233 -0
  193. package/dist/tests/agent-governance.test.js.map +1 -0
  194. package/dist/tests/app-commands.test.d.ts +2 -0
  195. package/dist/tests/app-commands.test.d.ts.map +1 -0
  196. package/dist/tests/app-commands.test.js +462 -0
  197. package/dist/tests/app-commands.test.js.map +1 -0
  198. package/dist/tests/booking-commands.test.d.ts +2 -0
  199. package/dist/tests/booking-commands.test.d.ts.map +1 -0
  200. package/dist/tests/booking-commands.test.js +204 -0
  201. package/dist/tests/booking-commands.test.js.map +1 -0
  202. package/dist/tests/booking-smoke.test.d.ts +2 -0
  203. package/dist/tests/booking-smoke.test.d.ts.map +1 -0
  204. package/dist/tests/booking-smoke.test.js +183 -0
  205. package/dist/tests/booking-smoke.test.js.map +1 -0
  206. package/dist/tests/cms-commands.test.d.ts +2 -0
  207. package/dist/tests/cms-commands.test.d.ts.map +1 -0
  208. package/dist/tests/cms-commands.test.js +254 -0
  209. package/dist/tests/cms-commands.test.js.map +1 -0
  210. package/dist/tests/cms-ops.test.d.ts +2 -0
  211. package/dist/tests/cms-ops.test.d.ts.map +1 -0
  212. package/dist/tests/cms-ops.test.js +125 -0
  213. package/dist/tests/cms-ops.test.js.map +1 -0
  214. package/dist/tests/env-writer.test.d.ts +2 -0
  215. package/dist/tests/env-writer.test.d.ts.map +1 -0
  216. package/dist/tests/env-writer.test.js +90 -0
  217. package/dist/tests/env-writer.test.js.map +1 -0
  218. package/dist/tests/profile-store.test.d.ts +2 -0
  219. package/dist/tests/profile-store.test.d.ts.map +1 -0
  220. package/dist/tests/profile-store.test.js +88 -0
  221. package/dist/tests/profile-store.test.js.map +1 -0
  222. package/dist/tests/target-guard.test.d.ts +2 -0
  223. package/dist/tests/target-guard.test.d.ts.map +1 -0
  224. package/dist/tests/target-guard.test.js +132 -0
  225. package/dist/tests/target-guard.test.js.map +1 -0
  226. package/dist/ui/logo.d.ts +2 -0
  227. package/dist/ui/logo.d.ts.map +1 -0
  228. package/dist/ui/logo.js +22 -0
  229. package/dist/ui/logo.js.map +1 -0
  230. package/package.json +17 -53
  231. package/.claude/settings.local.json +0 -36
  232. package/.cursor/rules.md +0 -203
  233. package/.eslintrc.js +0 -31
  234. package/CLAUDE.md +0 -100
  235. package/bin/cli.js +0 -116
  236. package/docs/ADDING_FRAMEWORK_DETECTORS.md +0 -391
  237. package/docs/ADDING_NEW_PROJECT_TYPE.md +0 -156
  238. package/docs/ARCHITECTURE_RELATIONSHIPS.md +0 -411
  239. package/docs/CLI_AUTHENTICATION.md +0 -214
  240. package/docs/CLI_PAGE_DETECTION_REQUIREMENTS.md +0 -519
  241. package/docs/CRM-PIPELINES-SEQUENCES-SPEC.md +0 -429
  242. package/docs/DETECTOR_ARCHITECTURE.md +0 -326
  243. package/docs/DEVELOPMENT.md +0 -194
  244. package/docs/IMPLEMENTATION_PHASES.md +0 -468
  245. package/docs/INTEGRATION_PATHS_ARCHITECTURE.md +0 -1543
  246. package/docs/OAUTH_CLARIFICATION.md +0 -258
  247. package/docs/OAUTH_SETUP_GUIDE_TEMPLATE.md +0 -211
  248. package/docs/PHASE_0_PROGRESS.md +0 -120
  249. package/docs/PHASE_1_COMPLETE.md +0 -366
  250. package/docs/PHASE_SUMMARY.md +0 -149
  251. package/docs/PLAN.md +0 -511
  252. package/docs/README.md +0 -56
  253. package/docs/STRIPE_INTEGRATION.md +0 -447
  254. package/docs/SUMMARY.md +0 -230
  255. package/docs/UPDATED_PLAN.md +0 -447
  256. package/docs/mcp_server/MCP_EXTENSION_GUIDE.md +0 -1313
  257. package/docs/mcp_server/MCP_SERVER_ARCHITECTURE.md +0 -1481
  258. package/docs/mcp_server/applicationOntology.ts +0 -817
  259. package/docs/mcp_server/cliApplications.ts +0 -639
  260. package/docs/mcp_server/crmOntology.ts +0 -1063
  261. package/docs/mcp_server/eventOntology.ts +0 -1183
  262. package/docs/mcp_server/formsOntology.ts +0 -1401
  263. package/docs/mcp_server/ontologySchemas.ts +0 -185
  264. package/docs/mcp_server/schema.ts +0 -250
  265. package/docs/microsass_production_machine/CLI_API_REFERENCE.md +0 -1197
  266. package/docs/microsass_production_machine/CLI_PRODUCT_VISION.md +0 -676
  267. package/docs/microsass_production_machine/CLI_REQUIREMENTS.md +0 -606
  268. package/docs/microsass_production_machine/CONNECTED_APPLICATIONS_SPEC.md +0 -390
  269. package/docs/microsass_production_machine/IMPLEMENTATION_ROADMAP.md +0 -725
  270. package/docs/microsass_production_machine/OBJECT_MAPPINGS.md +0 -808
  271. package/docs/microsass_production_machine/REFERENCE_IMPLEMENTATION.md +0 -532
  272. package/src/api/backend-client.js +0 -449
  273. package/src/commands/api-keys.js +0 -119
  274. package/src/commands/connect.js +0 -243
  275. package/src/commands/login.js +0 -332
  276. package/src/commands/logout.js +0 -30
  277. package/src/commands/mcp-server.js +0 -85
  278. package/src/commands/mcp-setup.js +0 -686
  279. package/src/commands/pages.js +0 -317
  280. package/src/commands/scaffold.js +0 -409
  281. package/src/commands/spread.js +0 -861
  282. package/src/commands/status.js +0 -62
  283. package/src/commands/sync.js +0 -169
  284. package/src/commands/upgrade.js +0 -48
  285. package/src/config/config-manager.js +0 -206
  286. package/src/detectors/api-client-detector.js +0 -85
  287. package/src/detectors/base-detector.js +0 -77
  288. package/src/detectors/database-detector.js +0 -245
  289. package/src/detectors/expo-detector.js +0 -166
  290. package/src/detectors/github-detector.js +0 -74
  291. package/src/detectors/index.js +0 -106
  292. package/src/detectors/mapping-suggestor.js +0 -119
  293. package/src/detectors/model-detector.js +0 -318
  294. package/src/detectors/nextjs-detector.js +0 -139
  295. package/src/detectors/oauth-detector.js +0 -122
  296. package/src/detectors/page-detector.js +0 -480
  297. package/src/detectors/registry.js +0 -121
  298. package/src/generators/api-client-generator.js +0 -223
  299. package/src/generators/api-only/client.js +0 -683
  300. package/src/generators/api-only/index.js +0 -96
  301. package/src/generators/api-only/types.js +0 -618
  302. package/src/generators/api-only/webhooks.js +0 -377
  303. package/src/generators/env-generator.js +0 -191
  304. package/src/generators/expo-auth-generator.js +0 -1009
  305. package/src/generators/gitignore-generator.js +0 -92
  306. package/src/generators/index.js +0 -166
  307. package/src/generators/manifest-generator.js +0 -154
  308. package/src/generators/mcp-guide-generator.js +0 -256
  309. package/src/generators/nextauth-generator.js +0 -247
  310. package/src/generators/oauth-guide-generator.js +0 -277
  311. package/src/generators/quickstart/components/index.js +0 -1699
  312. package/src/generators/quickstart/components-mobile/index.js +0 -1440
  313. package/src/generators/quickstart/database/convex.js +0 -1257
  314. package/src/generators/quickstart/database/index.js +0 -34
  315. package/src/generators/quickstart/database/supabase.js +0 -1132
  316. package/src/generators/quickstart/hooks/index.js +0 -1065
  317. package/src/generators/quickstart/index.js +0 -191
  318. package/src/generators/quickstart/pages/index.js +0 -1466
  319. package/src/generators/quickstart/screens/index.js +0 -1498
  320. package/src/logo.js +0 -116
  321. package/src/mcp/auth.js +0 -127
  322. package/src/mcp/registry/domains/applications.js +0 -516
  323. package/src/mcp/registry/domains/benefits.js +0 -798
  324. package/src/mcp/registry/domains/codegen.js +0 -894
  325. package/src/mcp/registry/domains/core.js +0 -324
  326. package/src/mcp/registry/domains/crm.js +0 -591
  327. package/src/mcp/registry/domains/events.js +0 -649
  328. package/src/mcp/registry/domains/forms.js +0 -696
  329. package/src/mcp/registry/index.js +0 -164
  330. package/src/mcp/server.js +0 -116
  331. package/src/utils/file-utils.js +0 -117
  332. package/src/utils/init-helpers.js +0 -243
  333. package/src/utils/prompt-utils.js +0 -195
  334. package/templates/CLAUDE.md +0 -86
  335. package/tests/api-client-detector.test.js +0 -214
  336. package/tests/api-client-generator.test.js +0 -176
  337. package/tests/backend-client.test.js +0 -640
  338. package/tests/base-detector.test.js +0 -101
  339. package/tests/commands/login.test.js +0 -143
  340. package/tests/commands/logout.test.js +0 -84
  341. package/tests/commands/status.test.js +0 -167
  342. package/tests/config-manager.test.js +0 -321
  343. package/tests/database-detector.test.js +0 -221
  344. package/tests/detector-index.test.js +0 -209
  345. package/tests/detector-registry.test.js +0 -93
  346. package/tests/env-generator.test.js +0 -278
  347. package/tests/expo-detector.test.js +0 -263
  348. package/tests/file-utils.test.js +0 -194
  349. package/tests/generators-index.test.js +0 -454
  350. package/tests/github-detector.test.js +0 -145
  351. package/tests/gitignore-generator.test.js +0 -109
  352. package/tests/logo.test.js +0 -96
  353. package/tests/nextauth-generator.test.js +0 -255
  354. package/tests/nextjs-detector.test.js +0 -235
  355. package/tests/oauth-detector.test.js +0 -264
  356. package/tests/oauth-guide-generator.test.js +0 -273
  357. package/tests/page-detector.test.js +0 -371
@@ -1,92 +0,0 @@
1
- /**
2
- * Gitignore Generator
3
- * Updates .gitignore to ensure sensitive files are not committed
4
- */
5
-
6
- const fs = require('fs');
7
- const path = require('path');
8
-
9
- class GitignoreGenerator {
10
- /**
11
- * Update .gitignore file
12
- */
13
- generate(options) {
14
- const { projectPath } = options;
15
- const gitignorePath = path.join(projectPath, '.gitignore');
16
-
17
- // Required entries to ensure are present
18
- const requiredEntries = [
19
- '# L4YERCAK3 Configuration',
20
- '.env.local',
21
- '.env*.local',
22
- '.l4yercak3/',
23
- ];
24
-
25
- let gitignoreContent = '';
26
- let needsUpdate = false;
27
-
28
- // Read existing .gitignore if it exists
29
- if (fs.existsSync(gitignorePath)) {
30
- gitignoreContent = fs.readFileSync(gitignorePath, 'utf8');
31
- }
32
-
33
- // Check if required entries are missing
34
- for (const entry of requiredEntries) {
35
- // Skip comment lines for checking
36
- if (entry.startsWith('#')) {
37
- if (!gitignoreContent.includes(entry)) {
38
- needsUpdate = true;
39
- }
40
- } else {
41
- // Check for the actual entry (with or without leading/trailing whitespace)
42
- const entryRegex = new RegExp(`^\\s*${entry.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}\\s*$`, 'm');
43
- if (!entryRegex.test(gitignoreContent)) {
44
- needsUpdate = true;
45
- }
46
- }
47
- }
48
-
49
- // If no update needed, return null
50
- if (!needsUpdate && gitignoreContent) {
51
- return null;
52
- }
53
-
54
- // Append required entries if they're missing
55
- if (needsUpdate) {
56
- if (gitignoreContent && !gitignoreContent.endsWith('\n')) {
57
- gitignoreContent += '\n';
58
- }
59
-
60
- // Add section header if not present
61
- if (!gitignoreContent.includes('# L4YERCAK3 Configuration')) {
62
- gitignoreContent += '\n# L4YERCAK3 Configuration\n';
63
- gitignoreContent += '# Auto-generated by @l4yercak3/cli\n';
64
- gitignoreContent += '# DO NOT commit sensitive configuration files\n\n';
65
- }
66
-
67
- // Add entries if missing
68
- const entriesToAdd = [
69
- '.env.local',
70
- '.env*.local',
71
- '.l4yercak3/',
72
- ];
73
-
74
- for (const entry of entriesToAdd) {
75
- const entryRegex = new RegExp(`^\\s*${entry.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}\\s*$`, 'm');
76
- if (!entryRegex.test(gitignoreContent)) {
77
- gitignoreContent += `${entry}\n`;
78
- }
79
- }
80
- }
81
-
82
- // Write updated .gitignore
83
- fs.writeFileSync(gitignorePath, gitignoreContent, 'utf8');
84
- return gitignorePath;
85
- }
86
- }
87
-
88
- module.exports = new GitignoreGenerator();
89
-
90
-
91
-
92
-
@@ -1,166 +0,0 @@
1
- /**
2
- * File Generators
3
- * Main entry point for all file generation
4
- *
5
- * Supports multiple frameworks:
6
- * - nextjs: Next.js (App Router and Pages Router)
7
- * - expo: Expo/React Native
8
- *
9
- * Supports multiple integration paths:
10
- * - quickstart: Full-stack with UI components & database
11
- * - api-only: Just the typed API client
12
- * - mcp-assisted: AI-powered custom generation
13
- */
14
-
15
- const apiClientGenerator = require('./api-client-generator');
16
- const envGenerator = require('./env-generator');
17
- const nextauthGenerator = require('./nextauth-generator');
18
- const oauthGuideGenerator = require('./oauth-guide-generator');
19
- const gitignoreGenerator = require('./gitignore-generator');
20
- const apiOnlyGenerator = require('./api-only');
21
- const mcpGuideGenerator = require('./mcp-guide-generator');
22
- const quickstartGenerator = require('./quickstart');
23
-
24
- class FileGenerator {
25
- /**
26
- * Check if framework is a mobile platform
27
- */
28
- isMobileFramework(frameworkType) {
29
- return ['expo', 'react-native'].includes(frameworkType);
30
- }
31
-
32
- /**
33
- * Check if framework is Next.js
34
- */
35
- isNextJs(frameworkType) {
36
- return frameworkType === 'nextjs';
37
- }
38
-
39
- /**
40
- * Generate all files based on configuration
41
- */
42
- async generate(options) {
43
- const integrationPath = options.integrationPath || 'api-only';
44
-
45
- // Route to the appropriate generator based on integration path
46
- switch (integrationPath) {
47
- case 'api-only':
48
- return this.generateApiOnly(options);
49
- case 'mcp-assisted':
50
- return this.generateMcpAssisted(options);
51
- case 'quickstart':
52
- return this.generateQuickStart(options);
53
- default:
54
- return this.generateLegacy(options);
55
- }
56
- }
57
-
58
- /**
59
- * API-Only path: Generate typed API client and types
60
- */
61
- async generateApiOnly(options) {
62
- const results = {
63
- apiClient: null,
64
- types: null,
65
- webhooks: null,
66
- index: null,
67
- envFile: null,
68
- gitignore: null,
69
- };
70
-
71
- // Generate the full typed API client package
72
- const apiOnlyResults = await apiOnlyGenerator.generate(options);
73
- results.apiClient = apiOnlyResults.client;
74
- results.types = apiOnlyResults.types;
75
- results.webhooks = apiOnlyResults.webhooks;
76
- results.index = apiOnlyResults.index;
77
-
78
- // Generate environment file
79
- results.envFile = envGenerator.generate(options);
80
-
81
- // Update .gitignore
82
- results.gitignore = gitignoreGenerator.generate(options);
83
-
84
- return results;
85
- }
86
-
87
- /**
88
- * MCP-Assisted path: Generate MCP config and guide
89
- */
90
- async generateMcpAssisted(options) {
91
- const results = {
92
- mcpConfig: null,
93
- mcpGuide: null,
94
- envFile: null,
95
- gitignore: null,
96
- };
97
-
98
- // Generate MCP configuration and guide
99
- const mcpResults = await mcpGuideGenerator.generate(options);
100
- results.mcpConfig = mcpResults.config;
101
- results.mcpGuide = mcpResults.guide;
102
-
103
- // Generate environment file
104
- results.envFile = envGenerator.generate(options);
105
-
106
- // Update .gitignore
107
- results.gitignore = gitignoreGenerator.generate(options);
108
-
109
- return results;
110
- }
111
-
112
- /**
113
- * Quick Start path: Full-stack generation with database, hooks, and components
114
- */
115
- async generateQuickStart(options) {
116
- return quickstartGenerator.generate(options);
117
- }
118
-
119
- /**
120
- * Legacy generation (backward compatibility)
121
- */
122
- async generateLegacy(options) {
123
- const results = {
124
- apiClient: null,
125
- envFile: null,
126
- nextauth: null,
127
- oauthGuide: null,
128
- gitignore: null,
129
- };
130
-
131
- const frameworkType = options.frameworkType || 'unknown';
132
- const isMobile = this.isMobileFramework(frameworkType);
133
- const isNextJs = this.isNextJs(frameworkType);
134
-
135
- // Generate API client (async - checks for file overwrites)
136
- if (options.features && options.features.length > 0) {
137
- results.apiClient = await apiClientGenerator.generate(options);
138
- }
139
-
140
- // Generate environment file
141
- results.envFile = envGenerator.generate(options);
142
-
143
- // Generate NextAuth.js config if OAuth is enabled (Next.js only)
144
- if (options.features && options.features.includes('oauth') && options.oauthProviders) {
145
- if (isNextJs) {
146
- results.nextauth = await nextauthGenerator.generate(options);
147
- }
148
- }
149
-
150
- // Generate OAuth guide if OAuth is enabled
151
- if (options.features && options.features.includes('oauth') && options.oauthProviders) {
152
- results.oauthGuide = oauthGuideGenerator.generate({
153
- ...options,
154
- isMobile,
155
- isNextJs,
156
- });
157
- }
158
-
159
- // Update .gitignore
160
- results.gitignore = gitignoreGenerator.generate(options);
161
-
162
- return results;
163
- }
164
- }
165
-
166
- module.exports = new FileGenerator();
@@ -1,154 +0,0 @@
1
- /**
2
- * Manifest Generator
3
- * Generates and manages the .l4yercak3.json project manifest file
4
- *
5
- * The manifest captures the project's structure (framework, models, routes)
6
- * and is used by the platform to understand and integrate with the app.
7
- */
8
-
9
- const fs = require('fs');
10
- const path = require('path');
11
-
12
- const MANIFEST_FILENAME = '.l4yercak3.json';
13
- const MANIFEST_VERSION = '1.0.0';
14
-
15
- class ManifestGenerator {
16
- /**
17
- * Generate or update the .l4yercak3.json manifest
18
- * @param {object} options
19
- * @param {string} options.projectPath - Project root directory
20
- * @param {object} options.detection - Detection results from ProjectDetector
21
- * @param {Array} options.models - Detected models from model-detector
22
- * @param {Array} options.routes - Detected routes from page-detector (with methods)
23
- * @param {Array} options.mappings - Suggested mappings from mapping-suggestor
24
- * @returns {string} Path to the generated manifest file
25
- */
26
- generate(options) {
27
- const { projectPath, detection, models, routes, mappings } = options;
28
- const manifestPath = path.join(projectPath, MANIFEST_FILENAME);
29
-
30
- // Read existing manifest to preserve user overrides
31
- const existing = this.loadManifest(projectPath);
32
-
33
- const manifest = {
34
- version: MANIFEST_VERSION,
35
- framework: detection?.framework?.type || 'unknown',
36
- routerType: detection?.framework?.metadata?.routerType || null,
37
- typescript: detection?.framework?.metadata?.hasTypeScript || false,
38
- database: detection?.database?.primary?.type || null,
39
- detectedModels: (models || []).map(m => ({
40
- name: m.name,
41
- source: m.source,
42
- fields: m.fields || [],
43
- })),
44
- detectedRoutes: (routes || [])
45
- .filter(r => r.pageType === 'api_route')
46
- .map(r => ({
47
- path: r.path,
48
- methods: r.methods || ['GET', 'POST'],
49
- })),
50
- suggestedMappings: (mappings || []).map(m => ({
51
- localModel: m.localModel,
52
- platformType: m.platformType,
53
- confidence: m.confidence,
54
- })),
55
- lastSyncedAt: new Date().toISOString(),
56
- };
57
-
58
- // Preserve user overrides from existing manifest
59
- if (existing && existing.userOverrides) {
60
- manifest.userOverrides = existing.userOverrides;
61
- }
62
-
63
- // Preserve confirmed mappings from existing manifest
64
- if (existing && existing.confirmedMappings) {
65
- manifest.confirmedMappings = existing.confirmedMappings;
66
- }
67
-
68
- fs.writeFileSync(manifestPath, `${JSON.stringify(manifest, null, 2)}\n`, 'utf8');
69
- return manifestPath;
70
- }
71
-
72
- /**
73
- * Load an existing manifest from a project
74
- * @param {string} projectPath - Project root directory
75
- * @returns {object|null} Parsed manifest or null if not found
76
- */
77
- loadManifest(projectPath) {
78
- const manifestPath = path.join(projectPath, MANIFEST_FILENAME);
79
- try {
80
- if (!fs.existsSync(manifestPath)) {
81
- return null;
82
- }
83
- const content = fs.readFileSync(manifestPath, 'utf8');
84
- return JSON.parse(content);
85
- } catch {
86
- return null;
87
- }
88
- }
89
-
90
- /**
91
- * Check if a manifest exists in the project
92
- * @param {string} projectPath
93
- * @returns {boolean}
94
- */
95
- hasManifest(projectPath) {
96
- return fs.existsSync(path.join(projectPath, MANIFEST_FILENAME));
97
- }
98
-
99
- /**
100
- * Compute a diff between old and new manifest data
101
- * @param {object} oldManifest - Previous manifest
102
- * @param {object} newManifest - New manifest data
103
- * @returns {object} Diff summary
104
- */
105
- diff(oldManifest, newManifest) {
106
- const result = {
107
- modelsAdded: [],
108
- modelsRemoved: [],
109
- routesAdded: [],
110
- routesRemoved: [],
111
- mappingsChanged: [],
112
- hasChanges: false,
113
- };
114
-
115
- if (!oldManifest) {
116
- result.modelsAdded = newManifest.detectedModels || [];
117
- result.routesAdded = newManifest.detectedRoutes || [];
118
- result.hasChanges = result.modelsAdded.length > 0 || result.routesAdded.length > 0;
119
- return result;
120
- }
121
-
122
- // Compare models
123
- const oldModelNames = new Set((oldManifest.detectedModels || []).map(m => m.name));
124
- const newModelNames = new Set((newManifest.detectedModels || []).map(m => m.name));
125
-
126
- for (const m of (newManifest.detectedModels || [])) {
127
- if (!oldModelNames.has(m.name)) result.modelsAdded.push(m);
128
- }
129
- for (const m of (oldManifest.detectedModels || [])) {
130
- if (!newModelNames.has(m.name)) result.modelsRemoved.push(m);
131
- }
132
-
133
- // Compare routes
134
- const oldRoutePaths = new Set((oldManifest.detectedRoutes || []).map(r => r.path));
135
- const newRoutePaths = new Set((newManifest.detectedRoutes || []).map(r => r.path));
136
-
137
- for (const r of (newManifest.detectedRoutes || [])) {
138
- if (!oldRoutePaths.has(r.path)) result.routesAdded.push(r);
139
- }
140
- for (const r of (oldManifest.detectedRoutes || [])) {
141
- if (!newRoutePaths.has(r.path)) result.routesRemoved.push(r);
142
- }
143
-
144
- result.hasChanges =
145
- result.modelsAdded.length > 0 ||
146
- result.modelsRemoved.length > 0 ||
147
- result.routesAdded.length > 0 ||
148
- result.routesRemoved.length > 0;
149
-
150
- return result;
151
- }
152
- }
153
-
154
- module.exports = new ManifestGenerator();
@@ -1,256 +0,0 @@
1
- /**
2
- * MCP Guide Generator
3
- * Generates MCP configuration and guide for AI-powered development
4
- */
5
-
6
- const fs = require('fs');
7
- const path = require('path');
8
- const { ensureDir, writeFileWithBackup, checkFileOverwrite } = require('../utils/file-utils');
9
-
10
- class McpGuideGenerator {
11
- /**
12
- * Generate MCP configuration and guide files
13
- * @param {Object} options - Generation options
14
- * @returns {Promise<Object>} - Generated file paths
15
- */
16
- async generate(options) {
17
- const results = {
18
- config: null,
19
- guide: null,
20
- };
21
-
22
- results.config = await this.generateConfig(options);
23
- results.guide = await this.generateGuide(options);
24
-
25
- return results;
26
- }
27
-
28
- /**
29
- * Generate .claude/mcp.json configuration
30
- */
31
- async generateConfig(options) {
32
- const { projectPath } = options;
33
-
34
- const claudeDir = path.join(projectPath, '.claude');
35
- ensureDir(claudeDir);
36
-
37
- const outputPath = path.join(claudeDir, 'mcp.json');
38
-
39
- // Check if file exists
40
- let existingConfig = {};
41
- if (fs.existsSync(outputPath)) {
42
- try {
43
- existingConfig = JSON.parse(fs.readFileSync(outputPath, 'utf8'));
44
- } catch {
45
- // Ignore parse errors
46
- }
47
- }
48
-
49
- // Merge with existing config
50
- const config = {
51
- ...existingConfig,
52
- mcpServers: {
53
- ...existingConfig.mcpServers,
54
- l4yercak3: {
55
- command: 'npx',
56
- args: ['@l4yercak3/cli', 'mcp', 'start'],
57
- env: {
58
- L4YERCAK3_CONFIG_PATH: '${workspaceFolder}/.l4yercak3',
59
- },
60
- },
61
- },
62
- };
63
-
64
- const action = await checkFileOverwrite(outputPath);
65
- if (action === 'skip') {
66
- return null;
67
- }
68
-
69
- return writeFileWithBackup(outputPath, JSON.stringify(config, null, 2), action);
70
- }
71
-
72
- /**
73
- * Generate MCP integration guide
74
- */
75
- async generateGuide(options) {
76
- const {
77
- projectPath,
78
- organizationName,
79
- features,
80
- } = options;
81
-
82
- const docsDir = path.join(projectPath, 'docs');
83
- ensureDir(docsDir);
84
-
85
- const outputPath = path.join(docsDir, 'L4YERCAK3_MCP_GUIDE.md');
86
-
87
- const action = await checkFileOverwrite(outputPath);
88
- if (action === 'skip') {
89
- return null;
90
- }
91
-
92
- const content = this.generateGuideContent({
93
- organizationName,
94
- features,
95
- });
96
-
97
- return writeFileWithBackup(outputPath, content, action);
98
- }
99
-
100
- generateGuideContent({ organizationName, features }) {
101
- const featureList = features || ['crm'];
102
-
103
- return `# L4YERCAK3 MCP Integration Guide
104
-
105
- Your project is connected to L4YERCAK3! You can now use Claude Code to build
106
- custom integrations using natural language.
107
-
108
- ## Getting Started
109
-
110
- The L4YERCAK3 MCP server has been configured in \`.claude/mcp.json\`. When you
111
- use Claude Code in this project, it will have access to L4YERCAK3 tools.
112
-
113
- ## Available MCP Tools
114
-
115
- ### CRM Tools (contacts:read, contacts:write)
116
- ${featureList.includes('crm') ? `
117
- - \`l4yercak3_crm_list_contacts\` - List and search contacts
118
- - \`l4yercak3_crm_create_contact\` - Create new contacts
119
- - \`l4yercak3_crm_get_contact\` - Get contact details
120
- - \`l4yercak3_crm_update_contact\` - Update contacts
121
- - \`l4yercak3_crm_delete_contact\` - Delete contacts
122
- - \`l4yercak3_crm_add_tags\` - Add tags to contacts
123
- - \`l4yercak3_crm_list_organizations\` - List organizations
124
- - \`l4yercak3_crm_create_organization\` - Create organizations
125
- ` : '*Not enabled*'}
126
-
127
- ### Events Tools (events:read, events:write)
128
- ${featureList.includes('events') ? `
129
- - \`l4yercak3_events_list\` - List events
130
- - \`l4yercak3_events_create\` - Create events
131
- - \`l4yercak3_events_get\` - Get event details with products/sponsors
132
- - \`l4yercak3_events_get_attendees\` - List attendees
133
- - \`l4yercak3_events_check_in\` - Check in attendees
134
- ` : '*Not enabled*'}
135
-
136
- ### Forms Tools (forms:read, forms:write)
137
- ${featureList.includes('forms') ? `
138
- - \`l4yercak3_forms_list\` - List forms
139
- - \`l4yercak3_forms_get\` - Get form with fields
140
- - \`l4yercak3_forms_submit\` - Submit form responses
141
- - \`l4yercak3_forms_get_responses\` - Get form submissions
142
- ` : '*Not enabled*'}
143
-
144
- ### Products Tools (products:read)
145
- ${featureList.includes('products') ? `
146
- - \`l4yercak3_products_list\` - List products
147
- - \`l4yercak3_products_get\` - Get product details
148
- ` : '*Not enabled*'}
149
-
150
- ### Checkout Tools (checkout:write)
151
- ${featureList.includes('checkout') ? `
152
- - \`l4yercak3_checkout_create_session\` - Create checkout session
153
- - \`l4yercak3_checkout_get_session\` - Get checkout status
154
- - \`l4yercak3_orders_list\` - List orders
155
- - \`l4yercak3_orders_get\` - Get order details
156
- ` : '*Not enabled*'}
157
-
158
- ### Invoicing Tools (invoices:read, invoices:write)
159
- ${featureList.includes('invoicing') ? `
160
- - \`l4yercak3_invoices_list\` - List invoices
161
- - \`l4yercak3_invoices_create\` - Create invoices
162
- - \`l4yercak3_invoices_get\` - Get invoice details
163
- - \`l4yercak3_invoices_send\` - Send invoice to customer
164
- - \`l4yercak3_invoices_mark_paid\` - Mark invoice as paid
165
- - \`l4yercak3_invoices_get_pdf\` - Get invoice PDF URL
166
- ` : '*Not enabled*'}
167
-
168
- ### Benefits Tools (benefits:read, benefits:write)
169
- ${featureList.includes('benefits') ? `
170
- - \`l4yercak3_benefits_list_claims\` - List benefit claims
171
- - \`l4yercak3_benefits_create_claim\` - Submit a benefit claim
172
- - \`l4yercak3_benefits_approve_claim\` - Approve a claim
173
- - \`l4yercak3_benefits_reject_claim\` - Reject a claim
174
- - \`l4yercak3_benefits_list_commissions\` - List commission payouts
175
- ` : '*Not enabled*'}
176
-
177
- ### Code Generation Tools
178
- - \`l4yercak3_generate_api_client\` - Generate typed API client
179
- - \`l4yercak3_generate_component\` - Generate React components
180
- - \`l4yercak3_generate_hook\` - Generate React hooks
181
- - \`l4yercak3_generate_page\` - Generate Next.js pages
182
-
183
- ## Example Prompts
184
-
185
- Here are some things you can ask Claude Code to do:
186
-
187
- ### CRM & Contacts
188
- 1. "Create a contact management page with search, filtering by tags, and the ability to add notes"
189
- 2. "Build a contact detail view that shows all activities and related organizations"
190
- 3. "Generate a contact import feature that reads from CSV"
191
-
192
- ### Events & Registrations
193
- 4. "Build an event registration flow with ticket selection and Stripe checkout"
194
- 5. "Create an event listing page with filters for date, location, and category"
195
- 6. "Build a mobile-friendly check-in scanner for event attendees"
196
-
197
- ### Forms
198
- 7. "Generate a form builder that lets admins create custom forms and view submissions"
199
- 8. "Create a contact form that saves to L4YERCAK3 CRM"
200
- 9. "Build a survey results dashboard with charts"
201
-
202
- ### E-commerce
203
- 10. "Create a product catalog with categories and search"
204
- 11. "Build a shopping cart with quantity controls"
205
- 12. "Generate an order history page for customers"
206
-
207
- ### Invoicing
208
- 13. "Create an invoice dashboard showing pending, paid, and overdue invoices"
209
- 14. "Build a send invoice flow with email preview"
210
- 15. "Generate an invoice PDF viewer component"
211
-
212
- ### Dashboard & Analytics
213
- 16. "Create a dashboard showing CRM contacts, recent events, and pending invoices"
214
- 17. "Build a revenue analytics chart from order data"
215
- 18. "Generate a customer lifetime value report"
216
-
217
- ## Your Configuration
218
-
219
- - **Organization:** ${organizationName || 'Your Organization'}
220
- - **Features Enabled:** ${featureList.join(', ')}
221
- - **API Key:** Stored in .env.local
222
-
223
- ## Tips for Best Results
224
-
225
- 1. **Be specific about your UI framework** - Tell Claude if you're using Tailwind, shadcn/ui, Material UI, etc.
226
-
227
- 2. **Reference existing patterns** - Say "match the style of my existing components" so Claude reads your code first.
228
-
229
- 3. **Start with data** - Ask Claude to show what data is available from the API before designing UI.
230
-
231
- 4. **Iterate incrementally** - Start simple and add features one at a time.
232
-
233
- 5. **Ask for explanations** - Claude can explain what MCP tools are available and how they work.
234
-
235
- ## Webhook Integration
236
-
237
- You can also ask Claude to set up webhooks for real-time updates:
238
-
239
- - "Set up a webhook handler for new contact creation"
240
- - "Create a webhook endpoint that syncs orders to our local database"
241
- - "Build a notification system triggered by invoice.paid webhooks"
242
-
243
- ## Need Help?
244
-
245
- - Ask Claude: "What L4YERCAK3 MCP tools are available?"
246
- - Ask Claude: "Show me an example of using the contacts API"
247
- - Ask Claude: "Help me debug this L4YERCAK3 integration"
248
-
249
- ---
250
-
251
- Generated by @l4yercak3/cli
252
- `;
253
- }
254
- }
255
-
256
- module.exports = new McpGuideGenerator();