@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,429 +0,0 @@
1
- # CRM Pipelines & Sequences Integration Spec
2
-
3
- ## Executive Summary
4
-
5
- **Current State:** The L4YERCAK3 CRM integration supports contacts, organizations, notes, and activities. However, **pipelines are mentioned in documentation but not implemented**, and **sequences do not exist at all**.
6
-
7
- **Gap Analysis:**
8
- - Pipelines referenced in [crm.js:5](src/mcp/registry/domains/crm.js#L5) and [core.js:30](src/mcp/registry/domains/core.js#L30) but no tools exist
9
- - No sequence infrastructure anywhere in the codebase
10
- - No API endpoints for pipelines or sequences
11
- - No UI components, hooks, or pages for pipeline/sequence management
12
-
13
- ---
14
-
15
- ## Part 1: Backend API Requirements
16
-
17
- ### 1.1 Pipeline Endpoints (Priority: HIGH)
18
-
19
- The backend team needs to implement these endpoints:
20
-
21
- | Method | Endpoint | Description |
22
- |--------|----------|-------------|
23
- | `GET` | `/api/v1/crm/pipelines` | List all pipelines for organization |
24
- | `POST` | `/api/v1/crm/pipelines` | Create a new pipeline |
25
- | `GET` | `/api/v1/crm/pipelines/{pipelineId}` | Get pipeline with stages |
26
- | `PATCH` | `/api/v1/crm/pipelines/{pipelineId}` | Update pipeline |
27
- | `DELETE` | `/api/v1/crm/pipelines/{pipelineId}` | Archive/delete pipeline |
28
- | `GET` | `/api/v1/crm/pipelines/{pipelineId}/stages` | List stages in pipeline |
29
- | `POST` | `/api/v1/crm/pipelines/{pipelineId}/stages` | Create stage |
30
- | `PATCH` | `/api/v1/crm/pipelines/{pipelineId}/stages/{stageId}` | Update stage |
31
- | `DELETE` | `/api/v1/crm/pipelines/{pipelineId}/stages/{stageId}` | Delete stage |
32
- | `POST` | `/api/v1/crm/pipelines/{pipelineId}/stages/reorder` | Reorder stages |
33
-
34
- #### Pipeline Data Model
35
-
36
- **Note to Backend Team:** Use the existing ontology-based object system (like contacts/organizations use with `subtype` and `customProperties`). The fields below are conceptual - implement using the standard L4YERCAK3 object pattern.
37
-
38
- **Pipeline object should support:**
39
- - Name, description, type (sales/support/onboarding/custom)
40
- - Linked stages (ordered)
41
- - Default stage reference
42
- - Active/archived status
43
-
44
- **Stage object should support:**
45
- - Name, description, order, color
46
- - Probability (0-100 for sales forecasting)
47
- - Rotten after days (stale deal threshold)
48
- - Automation triggers (notify, assign, tag, webhook, sequence)
49
-
50
- ### 1.2 Deal/Opportunity Endpoints (Priority: HIGH)
51
-
52
- Deals link contacts to pipeline stages:
53
-
54
- | Method | Endpoint | Description |
55
- |--------|----------|-------------|
56
- | `GET` | `/api/v1/crm/deals` | List deals (filterable by pipeline, stage, owner) |
57
- | `POST` | `/api/v1/crm/deals` | Create deal |
58
- | `GET` | `/api/v1/crm/deals/{dealId}` | Get deal details |
59
- | `PATCH` | `/api/v1/crm/deals/{dealId}` | Update deal |
60
- | `DELETE` | `/api/v1/crm/deals/{dealId}` | Archive deal |
61
- | `POST` | `/api/v1/crm/deals/{dealId}/move` | Move deal to different stage |
62
- | `GET` | `/api/v1/crm/deals/{dealId}/history` | Get stage movement history |
63
-
64
- #### Deal Data Model
65
-
66
- **Note to Backend Team:** Use the existing ontology-based object system. Deals are objects that link contacts to pipeline stages.
67
-
68
- **Deal object should support:**
69
- - Name, value, currency
70
- - Pipeline reference, current stage reference
71
- - Contact reference, organization reference (optional)
72
- - Owner (assigned team member)
73
- - Priority (low/medium/high)
74
- - Expected close date
75
- - Status (open/won/lost) with won/lost timestamps
76
- - Lost reason (when applicable)
77
- - Tags and custom fields via standard `customProperties`
78
-
79
- **Deal Stage History** - Track stage movements:
80
- - From/to stage references
81
- - Who moved it, when
82
- - Time spent in previous stage (for velocity metrics)
83
-
84
- ### 1.3 Sequence Endpoints (Priority: MEDIUM - Future Feature)
85
-
86
- Sequences automate outreach based on triggers:
87
-
88
- | Method | Endpoint | Description |
89
- |--------|----------|-------------|
90
- | `GET` | `/api/v1/crm/sequences` | List sequences |
91
- | `POST` | `/api/v1/crm/sequences` | Create sequence |
92
- | `GET` | `/api/v1/crm/sequences/{sequenceId}` | Get sequence with steps |
93
- | `PATCH` | `/api/v1/crm/sequences/{sequenceId}` | Update sequence |
94
- | `DELETE` | `/api/v1/crm/sequences/{sequenceId}` | Archive sequence |
95
- | `POST` | `/api/v1/crm/sequences/{sequenceId}/steps` | Add step to sequence |
96
- | `PATCH` | `/api/v1/crm/sequences/{sequenceId}/steps/{stepId}` | Update step |
97
- | `DELETE` | `/api/v1/crm/sequences/{sequenceId}/steps/{stepId}` | Remove step |
98
- | `POST` | `/api/v1/crm/sequences/{sequenceId}/enroll` | Enroll contact(s) |
99
- | `POST` | `/api/v1/crm/sequences/{sequenceId}/unenroll` | Remove contact(s) |
100
- | `GET` | `/api/v1/crm/sequences/{sequenceId}/enrollments` | List enrolled contacts |
101
- | `GET` | `/api/v1/crm/contacts/{contactId}/sequences` | Get contact's sequences |
102
-
103
- #### Sequence Data Model
104
-
105
- **Note to Backend Team:** Use the existing ontology-based object system. Sequences are automation workflows.
106
-
107
- **Sequence object should support:**
108
- - Name, description
109
- - Trigger type (manual, stage_enter, tag_added, form_submit, api) with config
110
- - Linked steps (ordered)
111
- - Exit conditions
112
- - Enrollment limit, timezone, sending schedule
113
- - Status (draft/active/paused/archived)
114
- - Stats (enrolled, completed, replied, bounced counts)
115
-
116
- **Sequence Step object should support:**
117
- - Order, type (email, sms, wait, task, webhook, condition)
118
- - Delay (days/hours)
119
- - Type-specific config (email subject/body with template vars, etc.)
120
-
121
- **Sequence Enrollment object should support:**
122
- - Contact reference, sequence reference
123
- - Current step index
124
- - Status (active/completed/exited/paused)
125
- - Enrolled by, enrolled at, completed at
126
- - Exit reason (if applicable)
127
- - Step results history
128
-
129
- ### 1.4 Permissions Required
130
-
131
- Add these to the existing permission system:
132
-
133
- ```typescript
134
- // Pipeline permissions
135
- 'pipelines:read' // View pipelines and stages
136
- 'pipelines:write' // Create/edit pipelines
137
- 'pipelines:delete' // Archive/delete pipelines
138
-
139
- // Deal permissions
140
- 'deals:read' // View deals
141
- 'deals:write' // Create/edit deals
142
- 'deals:delete' // Archive deals
143
- 'deals:move' // Move deals between stages
144
-
145
- // Sequence permissions (future)
146
- 'sequences:read' // View sequences
147
- 'sequences:write' // Create/edit sequences
148
- 'sequences:delete' // Archive sequences
149
- 'sequences:enroll' // Enroll/unenroll contacts
150
- ```
151
-
152
- ---
153
-
154
- ## Part 2: CLI Implementation Requirements
155
-
156
- ### 2.1 MCP Tool Additions
157
-
158
- **File:** [src/mcp/registry/domains/crm.js](src/mcp/registry/domains/crm.js)
159
-
160
- Add these MCP tools after the existing contact/organization tools:
161
-
162
- #### Pipeline Tools
163
-
164
- ```javascript
165
- // List pipelines
166
- {
167
- name: 'l4yercak3_crm_list_pipelines',
168
- description: 'List CRM pipelines with their stages',
169
- handler: async (args, context) => {
170
- return context.apiClient.request('GET', '/api/v1/crm/pipelines', {
171
- params: { type: args.type, status: args.status || 'active' }
172
- });
173
- },
174
- parameters: {
175
- type: { type: 'string', enum: ['sales', 'support', 'onboarding', 'custom'] },
176
- status: { type: 'string', enum: ['active', 'archived'], default: 'active' }
177
- },
178
- requiresAuth: true,
179
- permissions: ['pipelines:read']
180
- }
181
-
182
- // Create pipeline
183
- {
184
- name: 'l4yercak3_crm_create_pipeline',
185
- description: 'Create a new CRM pipeline with stages',
186
- handler: async (args, context) => { /* ... */ },
187
- parameters: {
188
- name: { type: 'string', required: true },
189
- type: { type: 'string', enum: ['sales', 'support', 'onboarding', 'custom'], required: true },
190
- stages: { type: 'array', items: { type: 'object' }, description: 'Initial stages' }
191
- },
192
- requiresAuth: true,
193
- permissions: ['pipelines:write']
194
- }
195
-
196
- // Get pipeline
197
- // Update pipeline
198
- // Delete pipeline
199
- // Add stage
200
- // Update stage
201
- // Reorder stages
202
- ```
203
-
204
- #### Deal Tools
205
-
206
- ```javascript
207
- // List deals
208
- {
209
- name: 'l4yercak3_crm_list_deals',
210
- description: 'List deals with filtering by pipeline, stage, status',
211
- parameters: {
212
- pipelineId: { type: 'string' },
213
- stageId: { type: 'string' },
214
- status: { type: 'string', enum: ['open', 'won', 'lost'] },
215
- ownerId: { type: 'string' },
216
- contactId: { type: 'string' }
217
- }
218
- }
219
-
220
- // Create deal
221
- // Get deal
222
- // Update deal
223
- // Move deal (change stage)
224
- // Get deal history
225
- ```
226
-
227
- #### Sequence Tools (Future)
228
-
229
- ```javascript
230
- // List sequences
231
- // Create sequence
232
- // Get sequence
233
- // Update sequence
234
- // Add step
235
- // Enroll contact
236
- // Unenroll contact
237
- // Get enrollments
238
- ```
239
-
240
- ### 2.2 Quickstart Generator Updates
241
-
242
- **Files to modify:**
243
-
244
- 1. **[src/generators/quickstart/hooks/index.js](src/generators/quickstart/hooks/index.js)**
245
- - Add `usePipelines()` hook
246
- - Add `useDeals()` hook
247
- - Add `usePipelineBoard()` hook for Kanban view
248
- - Future: Add `useSequences()` hook
249
-
250
- 2. **[src/generators/quickstart/components/index.js](src/generators/quickstart/components/index.js)**
251
- - Add `PipelineBoard` - Kanban-style deal board
252
- - Add `PipelineSelector` - Dropdown to switch pipelines
253
- - Add `DealCard` - Individual deal display
254
- - Add `DealForm` - Create/edit deal modal
255
- - Add `StageColumn` - Column in Kanban board
256
-
257
- 3. **[src/generators/quickstart/pages/index.js](src/generators/quickstart/pages/index.js)**
258
- - Add `/crm/pipelines` - Pipeline management
259
- - Add `/crm/deals` - Deal board (Kanban view)
260
- - Add `/crm/deals/[id]` - Deal detail page
261
-
262
- ### 2.3 Feature Detection Update
263
-
264
- **File:** [src/commands/spread.js](src/commands/spread.js)
265
-
266
- Update feature selection to clarify CRM includes pipelines:
267
-
268
- ```javascript
269
- {
270
- name: 'CRM (contacts, organizations, pipelines)',
271
- value: 'crm',
272
- checked: true
273
- }
274
- ```
275
-
276
- ### 2.4 Environment Variables
277
-
278
- No additional env vars needed - pipelines use same auth as other CRM features.
279
-
280
- ---
281
-
282
- ## Part 3: Implementation Checklist
283
-
284
- ### Backend Team
285
-
286
- - [ ] Create `pipelines` table/collection in Convex
287
- - [ ] Create `stages` table/collection
288
- - [ ] Create `deals` table/collection
289
- - [ ] Create `dealStageHistory` table/collection
290
- - [ ] Implement pipeline CRUD endpoints
291
- - [ ] Implement stage management endpoints
292
- - [ ] Implement deal CRUD endpoints
293
- - [ ] Implement deal stage movement with history tracking
294
- - [ ] Add pipeline/deal permissions to auth system
295
- - [ ] Write API documentation for new endpoints
296
- - [ ] **Future:** Create `sequences` table
297
- - [ ] **Future:** Create `sequenceSteps` table
298
- - [ ] **Future:** Create `sequenceEnrollments` table
299
- - [ ] **Future:** Implement sequence execution engine
300
- - [ ] **Future:** Implement sequence API endpoints
301
-
302
- ### CLI Team
303
-
304
- - [ ] Add pipeline MCP tools to [crm.js](src/mcp/registry/domains/crm.js)
305
- - [ ] Add deal MCP tools to [crm.js](src/mcp/registry/domains/crm.js)
306
- - [ ] Create `usePipelines()` hook generator
307
- - [ ] Create `useDeals()` hook generator
308
- - [ ] Create `PipelineBoard` component generator
309
- - [ ] Create `DealCard` component generator
310
- - [ ] Create `DealForm` component generator
311
- - [ ] Create pipeline pages generator
312
- - [ ] Update feature description in spread command
313
- - [ ] Write tests for new MCP tools
314
- - [ ] Update CLAUDE.md with pipeline commands
315
- - [ ] **Future:** Add sequence MCP tools
316
- - [ ] **Future:** Create sequence hooks/components
317
-
318
- ---
319
-
320
- ## Part 4: API Examples
321
-
322
- ### Create a Sales Pipeline
323
-
324
- ```bash
325
- # Request
326
- POST /api/v1/crm/pipelines
327
- {
328
- "name": "Enterprise Sales",
329
- "type": "sales",
330
- "stages": [
331
- { "name": "Lead", "order": 0, "probability": 10 },
332
- { "name": "Qualified", "order": 1, "probability": 25 },
333
- { "name": "Demo", "order": 2, "probability": 50 },
334
- { "name": "Proposal", "order": 3, "probability": 75 },
335
- { "name": "Negotiation", "order": 4, "probability": 90 },
336
- { "name": "Closed Won", "order": 5, "probability": 100 },
337
- { "name": "Closed Lost", "order": 6, "probability": 0 }
338
- ]
339
- }
340
-
341
- # Response
342
- {
343
- "_id": "pipeline_abc123",
344
- "name": "Enterprise Sales",
345
- "type": "sales",
346
- "stages": [...],
347
- "isDefault": true,
348
- "status": "active",
349
- "createdAt": 1736700000000
350
- }
351
- ```
352
-
353
- ### Create a Deal
354
-
355
- ```bash
356
- # Request
357
- POST /api/v1/crm/deals
358
- {
359
- "pipelineId": "pipeline_abc123",
360
- "stageId": "stage_lead",
361
- "contactId": "contact_xyz789",
362
- "name": "Acme Corp - Enterprise License",
363
- "value": 50000,
364
- "currency": "USD",
365
- "expectedCloseDate": 1739000000000,
366
- "priority": "high"
367
- }
368
- ```
369
-
370
- ### Move Deal to Next Stage
371
-
372
- ```bash
373
- # Request
374
- POST /api/v1/crm/deals/deal_123/move
375
- {
376
- "stageId": "stage_qualified",
377
- "note": "Initial call completed, they're interested"
378
- }
379
-
380
- # Response includes updated deal + history entry
381
- ```
382
-
383
- ### Enroll Contact in Sequence (Future)
384
-
385
- ```bash
386
- # Request
387
- POST /api/v1/crm/sequences/seq_456/enroll
388
- {
389
- "contactIds": ["contact_xyz789", "contact_abc123"],
390
- "skipWeekends": true
391
- }
392
- ```
393
-
394
- ---
395
-
396
- ## Part 5: Timeline Recommendation
397
-
398
- ### Phase 1: Pipelines Foundation
399
- - Backend: Pipeline & Stage CRUD
400
- - Backend: Basic deal management
401
- - CLI: Pipeline MCP tools
402
-
403
- ### Phase 2: Pipelines UI
404
- - CLI: Deal MCP tools
405
- - CLI: Hooks & components
406
- - CLI: Pages generator
407
-
408
- ### Phase 3: Sequences (Future)
409
- - Backend: Sequence data model
410
- - Backend: Enrollment logic
411
- - Backend: Execution engine
412
- - CLI: Sequence MCP tools
413
- - CLI: Sequence UI components
414
-
415
- ---
416
-
417
- ## Questions for Backend Team
418
-
419
- 1. **Default Pipeline:** Should new organizations get a default sales pipeline automatically?
420
- 2. **Stage Limits:** Should we limit the number of stages per pipeline?
421
- 3. **Deal Limits:** Any limits on deals per pipeline or organization?
422
- 4. **Webhooks:** Should stage transitions trigger webhooks?
423
- 5. **Sequence Execution:** Will sequences run on Convex scheduled functions or separate workers?
424
- 6. **Email Provider:** What email service will sequences use (SendGrid, Resend, etc.)?
425
-
426
- ---
427
-
428
- *Generated: January 2026*
429
- *CLI Version: 1.2.18*