@c15t/cli 1.8.3 → 2.0.0-rc.1

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 (187) hide show
  1. package/dist/760.mjs +1720 -0
  2. package/dist/__tests__/auth/config-store.test.d.ts +2 -0
  3. package/dist/__tests__/auth/config-store.test.d.ts.map +1 -0
  4. package/dist/__tests__/constants.test.d.ts +2 -0
  5. package/dist/__tests__/constants.test.d.ts.map +1 -0
  6. package/dist/__tests__/detection/layout.test.d.ts +2 -0
  7. package/dist/__tests__/detection/layout.test.d.ts.map +1 -0
  8. package/dist/__tests__/mocks/prompts.d.ts +25 -0
  9. package/dist/__tests__/mocks/prompts.d.ts.map +1 -0
  10. package/dist/__tests__/utils/validation.test.d.ts +2 -0
  11. package/dist/__tests__/utils/validation.test.d.ts.map +1 -0
  12. package/dist/auth/config-store.d.ts +63 -0
  13. package/dist/auth/config-store.d.ts.map +1 -0
  14. package/dist/auth/device-flow.d.ts +41 -0
  15. package/dist/auth/device-flow.d.ts.map +1 -0
  16. package/dist/auth/index.d.ts +7 -0
  17. package/dist/auth/index.d.ts.map +1 -0
  18. package/dist/auth/types.d.ts +90 -0
  19. package/dist/auth/types.d.ts.map +1 -0
  20. package/dist/commands/auth/index.d.ts +21 -0
  21. package/dist/commands/auth/index.d.ts.map +1 -0
  22. package/dist/commands/generate/index.d.ts +23 -2
  23. package/dist/commands/generate/index.d.ts.map +1 -1
  24. package/dist/commands/generate/options/c15t-mode.d.ts.map +1 -1
  25. package/dist/commands/generate/options/custom-mode.d.ts +3 -1
  26. package/dist/commands/generate/options/custom-mode.d.ts.map +1 -1
  27. package/dist/commands/generate/options/offline-mode.d.ts.map +1 -1
  28. package/dist/commands/generate/options/self-hosted-mode.d.ts.map +1 -1
  29. package/dist/commands/generate/options/shared/backend-options.d.ts +26 -0
  30. package/dist/commands/generate/options/shared/backend-options.d.ts.map +1 -0
  31. package/dist/commands/generate/options/shared/dev-tools.d.ts +9 -0
  32. package/dist/commands/generate/options/shared/dev-tools.d.ts.map +1 -0
  33. package/dist/commands/generate/options/shared/frontend-ui-options.d.ts +44 -0
  34. package/dist/commands/generate/options/shared/frontend-ui-options.d.ts.map +1 -0
  35. package/dist/commands/generate/options/shared/index.d.ts +9 -0
  36. package/dist/commands/generate/options/shared/index.d.ts.map +1 -0
  37. package/dist/commands/generate/options/shared/ssr.d.ts +21 -0
  38. package/dist/commands/generate/options/shared/ssr.d.ts.map +1 -0
  39. package/dist/commands/generate/options/utils/generate-files.d.ts +10 -2
  40. package/dist/commands/generate/options/utils/generate-files.d.ts.map +1 -1
  41. package/dist/commands/generate/preflight.d.ts +31 -0
  42. package/dist/commands/generate/preflight.d.ts.map +1 -0
  43. package/dist/commands/generate/prompts/expanded-theme.d.ts +46 -0
  44. package/dist/commands/generate/prompts/expanded-theme.d.ts.map +1 -0
  45. package/dist/commands/generate/prompts/index.d.ts +10 -0
  46. package/dist/commands/generate/prompts/index.d.ts.map +1 -0
  47. package/dist/commands/generate/prompts/instance.d.ts +33 -0
  48. package/dist/commands/generate/prompts/instance.d.ts.map +1 -0
  49. package/dist/commands/generate/prompts/mode-select.d.ts +42 -0
  50. package/dist/commands/generate/prompts/mode-select.d.ts.map +1 -0
  51. package/dist/commands/generate/prompts/scripts.d.ts +66 -0
  52. package/dist/commands/generate/prompts/scripts.d.ts.map +1 -0
  53. package/dist/commands/generate/prompts/theme.d.ts +46 -0
  54. package/dist/commands/generate/prompts/theme.d.ts.map +1 -0
  55. package/dist/commands/generate/prompts/ui-style.d.ts +36 -0
  56. package/dist/commands/generate/prompts/ui-style.d.ts.map +1 -0
  57. package/dist/commands/generate/summary.d.ts +37 -0
  58. package/dist/commands/generate/summary.d.ts.map +1 -0
  59. package/dist/commands/generate/templates/config.d.ts +7 -6
  60. package/dist/commands/generate/templates/config.d.ts.map +1 -1
  61. package/dist/commands/generate/templates/css.d.ts +12 -0
  62. package/dist/commands/generate/templates/css.d.ts.map +1 -0
  63. package/dist/commands/generate/templates/index.d.ts +1 -1
  64. package/dist/commands/generate/templates/index.d.ts.map +1 -1
  65. package/dist/commands/generate/templates/layout.d.ts +7 -0
  66. package/dist/commands/generate/templates/layout.d.ts.map +1 -1
  67. package/dist/commands/generate/templates/next/app/layout.d.ts +9 -2
  68. package/dist/commands/generate/templates/next/app/layout.d.ts.map +1 -1
  69. package/dist/commands/generate/templates/next/index.d.ts +7 -0
  70. package/dist/commands/generate/templates/next/index.d.ts.map +1 -1
  71. package/dist/commands/generate/templates/next/pages/layout.d.ts +3 -1
  72. package/dist/commands/generate/templates/next/pages/layout.d.ts.map +1 -1
  73. package/dist/commands/generate/templates/shared/components.d.ts +69 -0
  74. package/dist/commands/generate/templates/shared/components.d.ts.map +1 -0
  75. package/dist/commands/generate/templates/shared/directory.d.ts +71 -0
  76. package/dist/commands/generate/templates/shared/directory.d.ts.map +1 -0
  77. package/dist/commands/generate/templates/shared/expanded-components.d.ts +50 -0
  78. package/dist/commands/generate/templates/shared/expanded-components.d.ts.map +1 -0
  79. package/dist/commands/generate/templates/shared/framework-config.d.ts +18 -0
  80. package/dist/commands/generate/templates/shared/framework-config.d.ts.map +1 -0
  81. package/dist/commands/generate/templates/shared/layout-pipeline.d.ts +47 -0
  82. package/dist/commands/generate/templates/shared/layout-pipeline.d.ts.map +1 -0
  83. package/dist/commands/generate/templates/shared/module-specifier.d.ts +68 -0
  84. package/dist/commands/generate/templates/shared/module-specifier.d.ts.map +1 -0
  85. package/dist/commands/generate/templates/shared/options.d.ts +37 -20
  86. package/dist/commands/generate/templates/shared/options.d.ts.map +1 -1
  87. package/dist/commands/generate/templates/shared/scripts.d.ts +62 -0
  88. package/dist/commands/generate/templates/shared/scripts.d.ts.map +1 -0
  89. package/dist/commands/generate/templates/shared/server-components.d.ts +38 -0
  90. package/dist/commands/generate/templates/shared/server-components.d.ts.map +1 -0
  91. package/dist/commands/index.d.ts +8 -0
  92. package/dist/commands/index.d.ts.map +1 -0
  93. package/dist/commands/instances/index.d.ts +22 -0
  94. package/dist/commands/instances/index.d.ts.map +1 -0
  95. package/dist/commands/self-host/migrate/migrator-result.d.ts +1 -1
  96. package/dist/commands/self-host/migrate/migrator-result.d.ts.map +1 -1
  97. package/dist/commands/self-host/migrate/orm-result.d.ts +1 -1
  98. package/dist/commands/self-host/migrate/orm-result.d.ts.map +1 -1
  99. package/dist/commands/self-host/migrate/read-config.d.ts +1 -1
  100. package/dist/commands/self-host/migrate/read-config.d.ts.map +1 -1
  101. package/dist/constants.d.ts +101 -0
  102. package/dist/constants.d.ts.map +1 -0
  103. package/dist/context/framework-detection.d.ts +1 -0
  104. package/dist/context/framework-detection.d.ts.map +1 -1
  105. package/dist/context/types.d.ts +3 -3
  106. package/dist/context/types.d.ts.map +1 -1
  107. package/dist/core/context.d.ts +24 -0
  108. package/dist/core/context.d.ts.map +1 -0
  109. package/dist/core/errors.d.ts +214 -0
  110. package/dist/core/errors.d.ts.map +1 -0
  111. package/dist/core/index.d.ts +9 -0
  112. package/dist/core/index.d.ts.map +1 -0
  113. package/dist/core/logger.d.ts +50 -0
  114. package/dist/core/logger.d.ts.map +1 -0
  115. package/dist/core/parser.d.ts +35 -0
  116. package/dist/core/parser.d.ts.map +1 -0
  117. package/dist/core/telemetry.d.ts +78 -0
  118. package/dist/core/telemetry.d.ts.map +1 -0
  119. package/dist/detection/framework.d.ts +31 -0
  120. package/dist/detection/framework.d.ts.map +1 -0
  121. package/dist/detection/index.d.ts +7 -0
  122. package/dist/detection/index.d.ts.map +1 -0
  123. package/dist/detection/layout.d.ts +36 -0
  124. package/dist/detection/layout.d.ts.map +1 -0
  125. package/dist/detection/package-manager.d.ts +31 -0
  126. package/dist/detection/package-manager.d.ts.map +1 -0
  127. package/dist/index.d.ts +9 -0
  128. package/dist/index.d.ts.map +1 -1
  129. package/dist/index.mjs +2066 -1836
  130. package/dist/machines/generate/actions.d.ts +116 -0
  131. package/dist/machines/generate/actions.d.ts.map +1 -0
  132. package/dist/machines/generate/actors/dependencies.d.ts +43 -0
  133. package/dist/machines/generate/actors/dependencies.d.ts.map +1 -0
  134. package/dist/machines/generate/actors/file-generation.d.ts +54 -0
  135. package/dist/machines/generate/actors/file-generation.d.ts.map +1 -0
  136. package/dist/machines/generate/actors/preflight.d.ts +46 -0
  137. package/dist/machines/generate/actors/preflight.d.ts.map +1 -0
  138. package/dist/machines/generate/actors/prompts.d.ts +122 -0
  139. package/dist/machines/generate/actors/prompts.d.ts.map +1 -0
  140. package/dist/machines/generate/guards.d.ts +180 -0
  141. package/dist/machines/generate/guards.d.ts.map +1 -0
  142. package/dist/machines/generate/machine.d.ts +250 -0
  143. package/dist/machines/generate/machine.d.ts.map +1 -0
  144. package/dist/machines/generate/runner.d.ts +40 -0
  145. package/dist/machines/generate/runner.d.ts.map +1 -0
  146. package/dist/machines/generate/types.d.ts +189 -0
  147. package/dist/machines/generate/types.d.ts.map +1 -0
  148. package/dist/machines/index.d.ts +20 -0
  149. package/dist/machines/index.d.ts.map +1 -0
  150. package/dist/machines/persistence.d.ts +65 -0
  151. package/dist/machines/persistence.d.ts.map +1 -0
  152. package/dist/machines/telemetry-plugin.d.ts +54 -0
  153. package/dist/machines/telemetry-plugin.d.ts.map +1 -0
  154. package/dist/machines/types.d.ts +104 -0
  155. package/dist/machines/types.d.ts.map +1 -0
  156. package/dist/mcp/client.d.ts +61 -0
  157. package/dist/mcp/client.d.ts.map +1 -0
  158. package/dist/mcp/index.d.ts +6 -0
  159. package/dist/mcp/index.d.ts.map +1 -0
  160. package/dist/mcp/types.d.ts +84 -0
  161. package/dist/mcp/types.d.ts.map +1 -0
  162. package/dist/types.d.ts +238 -0
  163. package/dist/types.d.ts.map +1 -0
  164. package/dist/utils/formatter.d.ts +71 -0
  165. package/dist/utils/formatter.d.ts.map +1 -0
  166. package/dist/utils/fs.d.ts +80 -0
  167. package/dist/utils/fs.d.ts.map +1 -0
  168. package/dist/utils/index.d.ts +8 -0
  169. package/dist/utils/index.d.ts.map +1 -0
  170. package/dist/utils/spinner.d.ts +60 -0
  171. package/dist/utils/spinner.d.ts.map +1 -0
  172. package/dist/utils/telemetry.d.ts +4 -0
  173. package/dist/utils/telemetry.d.ts.map +1 -1
  174. package/dist/utils/validation.d.ts +68 -0
  175. package/dist/utils/validation.d.ts.map +1 -0
  176. package/package.json +63 -64
  177. package/LICENSE.md +0 -595
  178. package/dist/commands/generate/options/utils/shared-frontend.d.ts +0 -14
  179. package/dist/commands/generate/options/utils/shared-frontend.d.ts.map +0 -1
  180. package/dist/commands/generate/templates/backend.d.ts +0 -10
  181. package/dist/commands/generate/templates/backend.d.ts.map +0 -1
  182. package/dist/commands/generate/templates/next/app/components.d.ts +0 -44
  183. package/dist/commands/generate/templates/next/app/components.d.ts.map +0 -1
  184. package/dist/commands/generate/templates/next/pages/components.d.ts +0 -22
  185. package/dist/commands/generate/templates/next/pages/components.d.ts.map +0 -1
  186. package/dist/commands/generate/templates/react/components.d.ts +0 -21
  187. package/dist/commands/generate/templates/react/components.d.ts.map +0 -1
@@ -0,0 +1,101 @@
1
+ /**
2
+ * Centralized constants for the c15t CLI
3
+ *
4
+ * All magic strings, URLs, and regex patterns should be defined here
5
+ * to maintain consistency and make updates easier.
6
+ */
7
+ export declare const URLS: {
8
+ /** Default c15t cloud platform URL */
9
+ readonly CONSENT_IO: "https://consent.io";
10
+ /** Documentation website */
11
+ readonly DOCS: "https://c15t.dev/docs";
12
+ /** GitHub repository */
13
+ readonly GITHUB: "https://github.com/c15t/c15t";
14
+ /** Discord community */
15
+ readonly DISCORD: "https://c15t.dev/discord";
16
+ /** API documentation */
17
+ readonly API_DOCS: "https://c15t.dev/docs/api";
18
+ /** CLI documentation */
19
+ readonly CLI_DOCS: "https://c15t.dev/docs/cli";
20
+ };
21
+ export declare const PATHS: {
22
+ /** c15t config directory name (in home dir) */
23
+ readonly CONFIG_DIR: ".c15t";
24
+ /** Config file name */
25
+ readonly CONFIG_FILE: "config.json";
26
+ /** Project config file name */
27
+ readonly PROJECT_CONFIG: "c15t.config.ts";
28
+ /** Alternative project config file name */
29
+ readonly PROJECT_CONFIG_JS: "c15t.config.js";
30
+ /** Environment file */
31
+ readonly ENV_FILE: ".env";
32
+ /** Local environment file */
33
+ readonly ENV_LOCAL: ".env.local";
34
+ };
35
+ export declare const REGEX: {
36
+ /** Generic URL pattern */
37
+ readonly URL: RegExp;
38
+ /** c15t platform URL pattern */
39
+ readonly C15T_URL: RegExp;
40
+ /** Dynamic route segment pattern (e.g., [locale]) */
41
+ readonly DYNAMIC_SEGMENT: RegExp;
42
+ /** Semantic version pattern */
43
+ readonly SEMVER: RegExp;
44
+ /** Package name pattern */
45
+ readonly PACKAGE_NAME: RegExp;
46
+ };
47
+ export declare const CLI_INFO: {
48
+ /** CLI name */
49
+ readonly NAME: "c15t";
50
+ /** CLI binary name */
51
+ readonly BIN: "c15t";
52
+ /** MCP client name */
53
+ readonly MCP_CLIENT_NAME: "c15t-cli";
54
+ /** Current version (updated during build) */
55
+ readonly VERSION: "2.0.0";
56
+ };
57
+ export declare const TIMEOUTS: {
58
+ /** Device flow polling interval (seconds) */
59
+ readonly DEVICE_FLOW_POLL_INTERVAL: 5;
60
+ /** Device flow expiration (seconds) */
61
+ readonly DEVICE_FLOW_EXPIRY: 900;
62
+ /** HTTP request timeout (ms) */
63
+ readonly HTTP_REQUEST: 10000;
64
+ /** MCP connection timeout (ms) */
65
+ readonly MCP_CONNECTION: 30000;
66
+ };
67
+ export declare const ENV_VARS: {
68
+ /** Disable telemetry */
69
+ readonly TELEMETRY_DISABLED: "C15T_TELEMETRY_DISABLED";
70
+ /** c15t backend URL */
71
+ readonly BACKEND_URL: "C15T_URL";
72
+ /** c15t API key */
73
+ readonly API_KEY: "C15T_API_KEY";
74
+ /** Debug mode */
75
+ readonly DEBUG: "C15T_DEBUG";
76
+ };
77
+ export declare const STORAGE_MODES: {
78
+ readonly C15T: "c15t";
79
+ readonly OFFLINE: "offline";
80
+ readonly SELF_HOSTED: "self-hosted";
81
+ readonly CUSTOM: "custom";
82
+ };
83
+ export type StorageMode = (typeof STORAGE_MODES)[keyof typeof STORAGE_MODES];
84
+ export declare const PACKAGES: {
85
+ readonly CORE: "c15t";
86
+ readonly REACT: "@c15t/react";
87
+ readonly NEXTJS: "@c15t/nextjs";
88
+ readonly BACKEND: "@c15t/backend";
89
+ };
90
+ export type AvailablePackage = (typeof PACKAGES)[keyof typeof PACKAGES];
91
+ export declare const FRAMEWORK_KEYS: {
92
+ readonly NEXT: "next";
93
+ readonly REMIX: "@remix-run/react";
94
+ readonly VITE_REACT: "@vitejs/plugin-react";
95
+ readonly VITE_REACT_SWC: "@vitejs/plugin-react-swc";
96
+ readonly GATSBY: "gatsby";
97
+ readonly REACT: "react";
98
+ };
99
+ export declare const LAYOUT_PATTERNS: readonly ["app/layout.tsx", "app/layout.ts", "app/layout.jsx", "app/layout.js", "src/app/layout.tsx", "src/app/layout.ts", "src/app/layout.jsx", "src/app/layout.js", "app/*/layout.tsx", "app/*/layout.ts", "app/*/layout.jsx", "app/*/layout.js", "src/app/*/layout.tsx", "src/app/*/layout.ts", "src/app/*/layout.jsx", "src/app/*/layout.js", "app/*/*/layout.tsx", "app/*/*/layout.ts", "src/app/*/*/layout.tsx", "src/app/*/*/layout.ts"];
100
+ export declare const PAGES_APP_PATTERNS: readonly ["pages/_app.tsx", "pages/_app.ts", "pages/_app.jsx", "pages/_app.js", "src/pages/_app.tsx", "src/pages/_app.ts", "src/pages/_app.jsx", "src/pages/_app.js"];
101
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,eAAO,MAAM,IAAI;IAChB,sCAAsC;;IAEtC,4BAA4B;;IAE5B,wBAAwB;;IAExB,wBAAwB;;IAExB,wBAAwB;;IAExB,wBAAwB;;CAEf,CAAC;AAGX,eAAO,MAAM,KAAK;IACjB,+CAA+C;;IAE/C,uBAAuB;;IAEvB,+BAA+B;;IAE/B,2CAA2C;;IAE3C,uBAAuB;;IAEvB,6BAA6B;;CAEpB,CAAC;AAGX,eAAO,MAAM,KAAK;IACjB,0BAA0B;;IAE1B,gCAAgC;;IAEhC,qDAAqD;;IAErD,+BAA+B;;IAE/B,2BAA2B;;CAElB,CAAC;AAGX,eAAO,MAAM,QAAQ;IACpB,eAAe;;IAEf,sBAAsB;;IAEtB,sBAAsB;;IAEtB,6CAA6C;;CAEpC,CAAC;AAGX,eAAO,MAAM,QAAQ;IACpB,6CAA6C;;IAE7C,uCAAuC;;IAEvC,gCAAgC;;IAEhC,kCAAkC;;CAEzB,CAAC;AAGX,eAAO,MAAM,QAAQ;IACpB,wBAAwB;;IAExB,uBAAuB;;IAEvB,mBAAmB;;IAEnB,iBAAiB;;CAER,CAAC;AAGX,eAAO,MAAM,aAAa;;;;;CAKhB,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAG7E,eAAO,MAAM,QAAQ;;;;;CAKX,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,OAAO,QAAQ,CAAC,CAAC;AAGxE,eAAO,MAAM,cAAc;;;;;;;CAOjB,CAAC;AAGX,eAAO,MAAM,eAAe,ibAwBlB,CAAC;AAGX,eAAO,MAAM,kBAAkB,uKASrB,CAAC"}
@@ -12,6 +12,7 @@ export interface FrameworkDetectionResult {
12
12
  pkg: AvailablePackages;
13
13
  hasReact: boolean;
14
14
  reactVersion: string | null;
15
+ tailwindVersion: string | null;
15
16
  }
16
17
  /**
17
18
  * Detects the framework and React usage in the project
@@ -1 +1 @@
1
- {"version":3,"file":"framework-detection.d.ts","sourceRoot":"","sources":["../../src/context/framework-detection.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,cAAc,GAAG,aAAa,GAAG,MAAM,CAAC;AAExE;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,GAAG,EAAE,iBAAiB,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC;IAClB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED;;;;;;GAMG;AACH,wBAAsB,eAAe,CACpC,WAAW,EAAE,MAAM,EACnB,MAAM,CAAC,EAAE,SAAS,GAChB,OAAO,CAAC,wBAAwB,CAAC,CA2DnC;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACtC,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,SAAS,GAChB,OAAO,CAAC,MAAM,CAAC,CAqDjB"}
1
+ {"version":3,"file":"framework-detection.d.ts","sourceRoot":"","sources":["../../src/context/framework-detection.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,cAAc,GAAG,aAAa,GAAG,MAAM,CAAC;AAExE;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,GAAG,EAAE,iBAAiB,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC;IAClB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED;;;;;;GAMG;AACH,wBAAsB,eAAe,CACpC,WAAW,EAAE,MAAM,EACnB,MAAM,CAAC,EAAE,SAAS,GAChB,OAAO,CAAC,wBAAwB,CAAC,CAwEnC;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACtC,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,SAAS,GAChB,OAAO,CAAC,MAAM,CAAC,CAqDjB"}
@@ -1,4 +1,4 @@
1
- import type { C15TOptions, C15TPlugin } from '@c15t/backend';
1
+ import type { C15TOptions } from '@c15t/backend';
2
2
  import type { CliLogger } from '../utils/logger';
3
3
  import type { Telemetry } from '../utils/telemetry';
4
4
  import type { FrameworkDetectionResult } from './framework-detection';
@@ -35,8 +35,8 @@ export interface ErrorHandlers {
35
35
  }) => never;
36
36
  }
37
37
  export interface ConfigManagement {
38
- loadConfig: () => Promise<C15TOptions<C15TPlugin[]> | null>;
39
- requireConfig: () => Promise<C15TOptions<C15TPlugin[]>>;
38
+ loadConfig: () => Promise<C15TOptions | null>;
39
+ requireConfig: () => Promise<C15TOptions>;
40
40
  getPathAliases: (configPath?: string) => Record<string, string> | null;
41
41
  }
42
42
  export interface FileSystemUtils {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/context/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAGxE,MAAM,WAAW,UAAU;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IAEpB,MAAM,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/C;AAGD,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,S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AAa,CAAC;IACrB,MAAM,EAAE,gBAAgB,CAAC;IACzB,EAAE,EAAE,eAAe,CAAC;IAGpB,SAAS,EAAE,SAAS,CAAC;IAGrB,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAEtE,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,wBAAwB,CAAC;IACpC,cAAc,EAAE,oBAAoB,CAAC;CACrC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * CLI Context Creation
3
+ *
4
+ * Creates the main CLI context object that is passed to all commands.
5
+ * Contains logger, telemetry, error handlers, and detected environment info.
6
+ */
7
+ import type { CliContext, ParsedArgs } from '../types';
8
+ export interface CreateContextOptions {
9
+ /** Raw CLI arguments */
10
+ args: ParsedArgs;
11
+ /** Current working directory */
12
+ cwd?: string;
13
+ /** Skip environment detection (for testing) */
14
+ skipDetection?: boolean;
15
+ }
16
+ /**
17
+ * Create the CLI context
18
+ */
19
+ export declare function createCliContext(options: CreateContextOptions): Promise<CliContext>;
20
+ /**
21
+ * Create a minimal context for testing
22
+ */
23
+ export declare function createTestContext(overrides?: Partial<CliContext>): CliContext;
24
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/core/context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,OAAO,KAAK,EAAE,UAAU,EAAe,UAAU,EAAE,MAAM,UAAU,CAAC;AAMpE,MAAM,WAAW,oBAAoB;IACpC,wBAAwB;IACxB,IAAI,EAAE,UAAU,CAAC;IACjB,gCAAgC;IAChC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C,aAAa,CAAC,EAAE,OAAO,CAAC;CACxB;AAwED;;GAEG;AACH,wBAAsB,gBAAgB,CACrC,OAAO,EAAE,oBAAoB,GAC3B,OAAO,CAAC,UAAU,CAAC,CAyIrB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAChC,SAAS,GAAE,OAAO,CAAC,UAAU,CAAM,GACjC,UAAU,CA8CZ"}
@@ -0,0 +1,214 @@
1
+ /**
2
+ * Error catalog and error handling utilities for the c15t CLI
3
+ *
4
+ * All CLI errors should use the CliError class with a code from ERROR_CATALOG.
5
+ * This ensures consistent, actionable error messages with helpful hints.
6
+ */
7
+ import type { CliLogger } from '../types';
8
+ export declare const ERROR_CATALOG: {
9
+ readonly AUTH_FAILED: {
10
+ readonly code: "AUTH_FAILED";
11
+ readonly message: "Authentication failed";
12
+ readonly hint: "Try running `c15t login` again";
13
+ readonly docs: "https://c15t.dev/docs/cli/auth";
14
+ };
15
+ readonly AUTH_EXPIRED: {
16
+ readonly code: "AUTH_EXPIRED";
17
+ readonly message: "Session expired";
18
+ readonly hint: "Run `c15t login` to refresh your session";
19
+ };
20
+ readonly AUTH_NOT_LOGGED_IN: {
21
+ readonly code: "AUTH_NOT_LOGGED_IN";
22
+ readonly message: "Not logged in";
23
+ readonly hint: "Run `c15t login` to authenticate";
24
+ };
25
+ readonly AUTH_TOKEN_INVALID: {
26
+ readonly code: "AUTH_TOKEN_INVALID";
27
+ readonly message: "Invalid authentication token";
28
+ readonly hint: "Try logging out with `c15t logout` and logging in again";
29
+ };
30
+ readonly DEVICE_FLOW_TIMEOUT: {
31
+ readonly code: "DEVICE_FLOW_TIMEOUT";
32
+ readonly message: "Authentication timed out";
33
+ readonly hint: "The login request expired. Run `c15t login` to try again";
34
+ };
35
+ readonly DEVICE_FLOW_DENIED: {
36
+ readonly code: "DEVICE_FLOW_DENIED";
37
+ readonly message: "Authentication denied";
38
+ readonly hint: "The login request was denied. Run `c15t login` to try again";
39
+ };
40
+ readonly DEVICE_FLOW_PENDING: {
41
+ readonly code: "DEVICE_FLOW_PENDING";
42
+ readonly message: "Waiting for authentication";
43
+ readonly hint: "Please complete the login in your browser";
44
+ };
45
+ readonly NOT_A_PROJECT: {
46
+ readonly code: "NOT_A_PROJECT";
47
+ readonly message: "No package.json found";
48
+ readonly hint: "Make sure you are in a JavaScript/TypeScript project directory";
49
+ };
50
+ readonly FRAMEWORK_NOT_DETECTED: {
51
+ readonly code: "FRAMEWORK_NOT_DETECTED";
52
+ readonly message: "Could not detect framework";
53
+ readonly hint: "Supported frameworks: Next.js, React, Remix, Vite";
54
+ readonly docs: "https://c15t.dev/docs/cli/frameworks";
55
+ };
56
+ readonly LAYOUT_NOT_FOUND: {
57
+ readonly code: "LAYOUT_NOT_FOUND";
58
+ readonly message: "Could not find layout file";
59
+ readonly hint: "Make sure you have app/layout.tsx or pages/_app.tsx";
60
+ };
61
+ readonly CONFIG_EXISTS: {
62
+ readonly code: "CONFIG_EXISTS";
63
+ readonly message: "c15t configuration already exists";
64
+ readonly hint: "Use --force to overwrite existing configuration";
65
+ };
66
+ readonly CONFIG_NOT_FOUND: {
67
+ readonly code: "CONFIG_NOT_FOUND";
68
+ readonly message: "c15t configuration not found";
69
+ readonly hint: "Run `c15t generate` to create a configuration";
70
+ };
71
+ readonly CONFIG_INVALID: {
72
+ readonly code: "CONFIG_INVALID";
73
+ readonly message: "Invalid c15t configuration";
74
+ readonly hint: "Check your c15t.config.ts file for errors";
75
+ readonly docs: "https://c15t.dev/docs/configuration";
76
+ };
77
+ readonly NETWORK_ERROR: {
78
+ readonly code: "NETWORK_ERROR";
79
+ readonly message: "Network request failed";
80
+ readonly hint: "Check your internet connection";
81
+ };
82
+ readonly MCP_CONNECTION_FAILED: {
83
+ readonly code: "MCP_CONNECTION_FAILED";
84
+ readonly message: "Could not connect to consent.io";
85
+ readonly hint: "Check if https://consent.io is accessible";
86
+ };
87
+ readonly MCP_REQUEST_FAILED: {
88
+ readonly code: "MCP_REQUEST_FAILED";
89
+ readonly message: "MCP request failed";
90
+ readonly hint: "Try again or check your network connection";
91
+ };
92
+ readonly API_ERROR: {
93
+ readonly code: "API_ERROR";
94
+ readonly message: "API request failed";
95
+ readonly hint: "Check the error details and try again";
96
+ };
97
+ readonly URL_INVALID: {
98
+ readonly code: "URL_INVALID";
99
+ readonly message: "Invalid URL format";
100
+ readonly hint: "Expected format: https://your-instance.c15t.dev";
101
+ };
102
+ readonly INSTANCE_NOT_FOUND: {
103
+ readonly code: "INSTANCE_NOT_FOUND";
104
+ readonly message: "Instance not found";
105
+ readonly hint: "Run `c15t instances list` to see available instances";
106
+ };
107
+ readonly INSTANCE_NAME_INVALID: {
108
+ readonly code: "INSTANCE_NAME_INVALID";
109
+ readonly message: "Invalid instance name";
110
+ readonly hint: "Instance names must be alphanumeric with hyphens";
111
+ };
112
+ readonly FILE_NOT_FOUND: {
113
+ readonly code: "FILE_NOT_FOUND";
114
+ readonly message: "File not found";
115
+ };
116
+ readonly FILE_READ_ERROR: {
117
+ readonly code: "FILE_READ_ERROR";
118
+ readonly message: "Could not read file";
119
+ readonly hint: "Check file permissions";
120
+ };
121
+ readonly FILE_WRITE_ERROR: {
122
+ readonly code: "FILE_WRITE_ERROR";
123
+ readonly message: "Could not write file";
124
+ readonly hint: "Check file permissions and disk space";
125
+ };
126
+ readonly DIRECTORY_NOT_FOUND: {
127
+ readonly code: "DIRECTORY_NOT_FOUND";
128
+ readonly message: "Directory not found";
129
+ };
130
+ readonly COMMAND_NOT_FOUND: {
131
+ readonly code: "COMMAND_NOT_FOUND";
132
+ readonly message: "Unknown command";
133
+ readonly hint: "Run `c15t --help` to see available commands";
134
+ };
135
+ readonly SUBCOMMAND_REQUIRED: {
136
+ readonly code: "SUBCOMMAND_REQUIRED";
137
+ readonly message: "Subcommand required";
138
+ readonly hint: "Run the command with --help to see available subcommands";
139
+ };
140
+ readonly FLAG_VALUE_REQUIRED: {
141
+ readonly code: "FLAG_VALUE_REQUIRED";
142
+ readonly message: "Flag requires a value";
143
+ };
144
+ readonly INSTALL_FAILED: {
145
+ readonly code: "INSTALL_FAILED";
146
+ readonly message: "Package installation failed";
147
+ readonly hint: "Try running the install command manually";
148
+ };
149
+ readonly PACKAGE_MANAGER_NOT_FOUND: {
150
+ readonly code: "PACKAGE_MANAGER_NOT_FOUND";
151
+ readonly message: "Could not detect package manager";
152
+ readonly hint: "Make sure npm, yarn, pnpm, or bun is installed";
153
+ };
154
+ readonly MIGRATION_FAILED: {
155
+ readonly code: "MIGRATION_FAILED";
156
+ readonly message: "Database migration failed";
157
+ readonly hint: "Check the error details and database connection";
158
+ };
159
+ readonly MIGRATION_CONFIG_MISSING: {
160
+ readonly code: "MIGRATION_CONFIG_MISSING";
161
+ readonly message: "Migration configuration missing";
162
+ readonly hint: "Make sure your c15t.config.ts includes database configuration";
163
+ };
164
+ readonly UNKNOWN_ERROR: {
165
+ readonly code: "UNKNOWN_ERROR";
166
+ readonly message: "An unexpected error occurred";
167
+ readonly hint: "Please report this issue at https://github.com/c15t/c15t/issues";
168
+ };
169
+ readonly CANCELLED: {
170
+ readonly code: "CANCELLED";
171
+ readonly message: "Operation cancelled";
172
+ };
173
+ };
174
+ export type ErrorCode = keyof typeof ERROR_CATALOG;
175
+ export declare class CliError extends Error {
176
+ /** Error code from the catalog */
177
+ readonly code: ErrorCode;
178
+ /** Additional context for the error */
179
+ readonly context?: Record<string, unknown>;
180
+ /** The error catalog entry */
181
+ readonly entry: (typeof ERROR_CATALOG)[ErrorCode];
182
+ constructor(code: ErrorCode, context?: Record<string, unknown>);
183
+ /**
184
+ * Display the error with hints and documentation links
185
+ */
186
+ display(logger: CliLogger): void;
187
+ /**
188
+ * Create a CliError from an unknown error
189
+ */
190
+ static from(error: unknown, fallbackCode?: ErrorCode): CliError;
191
+ }
192
+ /**
193
+ * Check if an error is a CliError with a specific code
194
+ */
195
+ export declare function isCliError(error: unknown, code?: ErrorCode): error is CliError;
196
+ /**
197
+ * Create error handlers for the CLI context
198
+ */
199
+ export declare function createErrorHandlers(logger: CliLogger, telemetry?: {
200
+ trackError: (error: Error, command?: string) => void;
201
+ }): {
202
+ handleError: (error: unknown, message: string) => never;
203
+ handleCancel: (message?: string, context?: {
204
+ command?: string;
205
+ stage?: string;
206
+ }) => never;
207
+ };
208
+ /**
209
+ * Wrap an async function with error handling
210
+ */
211
+ export declare function withErrorHandling<T extends (...args: unknown[]) => Promise<unknown>>(fn: T, logger: CliLogger, context?: {
212
+ command?: string;
213
+ }): T;
214
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/core/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAG1C,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwLhB,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,aAAa,CAAC;AAGnD,qBAAa,QAAS,SAAQ,KAAK;IAClC,kCAAkC;IAClC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,uCAAuC;IACvC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3C,8BAA8B;IAC9B,QAAQ,CAAC,KAAK,EAAE,CAAC,OAAO,aAAa,CAAC,CAAC,SAAS,CAAC,CAAC;gBAEtC,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAc9D;;OAEG;IACH,OAAO,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI;IAoBhC;;OAEG;IACH,MAAM,CAAC,IAAI,CACV,KAAK,EAAE,OAAO,EACd,YAAY,GAAE,SAA2B,GACvC,QAAQ;CAWX;AAID;;GAEG;AACH,wBAAgB,UAAU,CACzB,KAAK,EAAE,OAAO,EACd,IAAI,CAAC,EAAE,SAAS,GACd,KAAK,IAAI,QAAQ,CAKnB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAClC,MAAM,EAAE,SAAS,EACjB,SAAS,CAAC,EAAE;IAAE,UAAU,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE;yBAG9C,OAAO,WAAW,MAAM,KAAG,KAAK;6BAe1C,MAAM,YACN;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,KAC5C,KAAK;EAWT;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAChC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,OAAO,CAAC,EACjD,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,CAAC,CAa7D"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Core module exports
3
+ */
4
+ export { type CreateContextOptions, createCliContext, createTestContext, } from './context';
5
+ export { CliError, createErrorHandlers, ERROR_CATALOG, type ErrorCode, isCliError, withErrorHandling, } from './errors';
6
+ export { color, colors, createCliLogger, createSpinner, formatLogMessage, formatStep, LOG_LEVELS, type LogLevel, type Spinner, withSpinner, } from './logger';
7
+ export { formatFlagHelp, generateFlagsHelp, getFlagValue, globalFlags, hasFlag, parseCliArgs, parseSubcommand, } from './parser';
8
+ export { createDisabledTelemetry, createTelemetry, TelemetryEventName, type TelemetryEventNameType, type TelemetryOptions, } from './telemetry';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EACN,KAAK,oBAAoB,EACzB,gBAAgB,EAChB,iBAAiB,GACjB,MAAM,WAAW,CAAC;AAEnB,OAAO,EACN,QAAQ,EACR,mBAAmB,EACnB,aAAa,EACb,KAAK,SAAS,EACd,UAAU,EACV,iBAAiB,GACjB,MAAM,UAAU,CAAC;AAElB,OAAO,EACN,KAAK,EACL,MAAM,EACN,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,KAAK,QAAQ,EACb,KAAK,OAAO,EACZ,WAAW,GACX,MAAM,UAAU,CAAC;AAElB,OAAO,EACN,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,OAAO,EACP,YAAY,EACZ,eAAe,GACf,MAAM,UAAU,CAAC;AAGlB,OAAO,EACN,uBAAuB,EACvB,eAAe,EACf,kBAAkB,EAClB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,GACrB,MAAM,aAAa,CAAC"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * CLI Logger utilities
3
+ *
4
+ * Provides a consistent logging interface with CLI-specific formatting
5
+ * using @clack/prompts for styled output.
6
+ */
7
+ import color from 'picocolors';
8
+ import type { CliLogger } from '../types';
9
+ export type LogLevel = 'error' | 'warn' | 'info' | 'debug';
10
+ export declare const LOG_LEVELS: LogLevel[];
11
+ /**
12
+ * Format a log message with appropriate styling based on log level
13
+ */
14
+ export declare function formatLogMessage(logLevel: LogLevel | 'success' | 'failed', message: unknown, args?: unknown[]): string;
15
+ /**
16
+ * Format a step progress indicator
17
+ */
18
+ export declare function formatStep(current: number, total: number, label: string): string;
19
+ /**
20
+ * Create a CLI logger instance
21
+ */
22
+ export declare function createCliLogger(level?: LogLevel): CliLogger;
23
+ export interface Spinner {
24
+ start(message?: string): void;
25
+ stop(message?: string): void;
26
+ message(message: string): void;
27
+ }
28
+ /**
29
+ * Create a spinner for long-running operations
30
+ */
31
+ export declare function createSpinner(initialMessage?: string): Spinner;
32
+ /**
33
+ * Run an async task with a spinner
34
+ */
35
+ export declare function withSpinner<T>(message: string, task: () => Promise<T>, options?: {
36
+ successMessage?: string;
37
+ errorMessage?: string;
38
+ }): Promise<T>;
39
+ export { color };
40
+ export declare const colors: {
41
+ readonly success: import("picocolors/types").Formatter;
42
+ readonly error: import("picocolors/types").Formatter;
43
+ readonly warning: import("picocolors/types").Formatter;
44
+ readonly info: import("picocolors/types").Formatter;
45
+ readonly muted: import("picocolors/types").Formatter;
46
+ readonly highlight: import("picocolors/types").Formatter;
47
+ readonly bold: import("picocolors/types").Formatter;
48
+ readonly underline: import("picocolors/types").Formatter;
49
+ };
50
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/core/logger.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAG1C,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAE3D,eAAO,MAAM,UAAU,EAAE,QAAQ,EAAuC,CAAC;AAqBzE;;GAEG;AACH,wBAAgB,gBAAgB,CAC/B,QAAQ,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,EACzC,OAAO,EAAE,OAAO,EAChB,IAAI,GAAE,OAAO,EAAO,GAClB,MAAM,CAoBR;AAkCD;;GAEG;AACH,wBAAgB,UAAU,CACzB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACX,MAAM,CAIR;AAID;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,GAAE,QAAiB,GAAG,SAAS,CA8DnE;AAID,MAAM,WAAW,OAAO;IACvB,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,IAAI,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAgB9D;AAED;;GAEG;AACH,wBAAsB,WAAW,CAAC,CAAC,EAClC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACtB,OAAO,CAAC,EAAE;IACT,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB,GACC,OAAO,CAAC,CAAC,CAAC,CAYZ;AAID,OAAO,EAAE,KAAK,EAAE,CAAC;AAEjB,eAAO,MAAM,MAAM;;;;;;;;;CAST,CAAC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * CLI Argument Parser
3
+ *
4
+ * Parses command line arguments into structured flags, command name, and command args.
5
+ */
6
+ import type { CliCommand, CliFlag, ParsedArgs } from '../types';
7
+ export declare const globalFlags: CliFlag[];
8
+ /**
9
+ * Parse raw command line arguments into structured format
10
+ */
11
+ export declare function parseCliArgs(rawArgs: string[], commands: CliCommand[]): ParsedArgs;
12
+ /**
13
+ * Format help text for a flag
14
+ */
15
+ export declare function formatFlagHelp(flag: CliFlag): string;
16
+ /**
17
+ * Generate help text for all global flags
18
+ */
19
+ export declare function generateFlagsHelp(): string;
20
+ /**
21
+ * Check if a specific flag is set
22
+ */
23
+ export declare function hasFlag(flags: ParsedArgs['parsedFlags'], name: string): boolean;
24
+ /**
25
+ * Get a flag value
26
+ */
27
+ export declare function getFlagValue(flags: ParsedArgs['parsedFlags'], name: string): string | undefined;
28
+ /**
29
+ * Parse subcommand from command args
30
+ */
31
+ export declare function parseSubcommand(args: string[], subcommands: CliCommand[]): {
32
+ subcommand: CliCommand | undefined;
33
+ remainingArgs: string[];
34
+ };
35
+ //# sourceMappingURL=parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/core/parser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAIhE,eAAO,MAAM,WAAW,EAAE,OAAO,EAsDhC,CAAC;AAUF;;GAEG;AACH,wBAAgB,YAAY,CAC3B,OAAO,EAAE,MAAM,EAAE,EACjB,QAAQ,EAAE,UAAU,EAAE,GACpB,UAAU,CA2EZ;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAIpD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED;;GAEG;AACH,wBAAgB,OAAO,CACtB,KAAK,EAAE,UAAU,CAAC,aAAa,CAAC,EAChC,IAAI,EAAE,MAAM,GACV,OAAO,CAET;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC3B,KAAK,EAAE,UAAU,CAAC,aAAa,CAAC,EAChC,IAAI,EAAE,MAAM,GACV,MAAM,GAAG,SAAS,CAGpB;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC9B,IAAI,EAAE,MAAM,EAAE,EACd,WAAW,EAAE,UAAU,EAAE,GACvB;IAAE,UAAU,EAAE,UAAU,GAAG,SAAS,CAAC;IAAC,aAAa,EAAE,MAAM,EAAE,CAAA;CAAE,CAejE"}
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Telemetry module for the c15t CLI
3
+ *
4
+ * Provides anonymous usage tracking to help improve the CLI.
5
+ * Respects user preferences and can be disabled via --no-telemetry flag
6
+ * or C15T_TELEMETRY_DISABLED environment variable.
7
+ */
8
+ import { PostHog } from 'posthog-node';
9
+ import type { CliLogger, Telemetry } from '../types';
10
+ export declare const TelemetryEventName: {
11
+ readonly CLI_INVOKED: "cli.invoked";
12
+ readonly CLI_COMPLETED: "cli.completed";
13
+ readonly CLI_EXITED: "cli.exited";
14
+ readonly CLI_ENVIRONMENT_DETECTED: "cli.environment_detected";
15
+ readonly COMMAND_EXECUTED: "command.executed";
16
+ readonly COMMAND_SUCCEEDED: "command.succeeded";
17
+ readonly COMMAND_FAILED: "command.failed";
18
+ readonly COMMAND_UNKNOWN: "command.unknown";
19
+ readonly INTERACTIVE_MENU_OPENED: "ui.menu.opened";
20
+ readonly INTERACTIVE_MENU_EXITED: "ui.menu.exited";
21
+ readonly AUTH_LOGIN_STARTED: "auth.login.started";
22
+ readonly AUTH_LOGIN_SUCCEEDED: "auth.login.succeeded";
23
+ readonly AUTH_LOGIN_FAILED: "auth.login.failed";
24
+ readonly AUTH_LOGOUT: "auth.logout";
25
+ readonly CONFIG_LOADED: "config.loaded";
26
+ readonly CONFIG_ERROR: "config.error";
27
+ readonly CONFIG_UPDATED: "config.updated";
28
+ readonly HELP_DISPLAYED: "help.displayed";
29
+ readonly VERSION_DISPLAYED: "version.displayed";
30
+ readonly ONBOARDING_STARTED: "onboarding.started";
31
+ readonly ONBOARDING_COMPLETED: "onboarding.completed";
32
+ readonly ONBOARDING_EXITED: "onboarding.exited";
33
+ readonly ONBOARDING_STORAGE_MODE_SELECTED: "onboarding.storage_mode_selected";
34
+ readonly ONBOARDING_C15T_MODE_CONFIGURED: "onboarding.c15t_mode_configured";
35
+ readonly ONBOARDING_OFFLINE_MODE_CONFIGURED: "onboarding.offline_mode_configured";
36
+ readonly ONBOARDING_SELF_HOSTED_CONFIGURED: "onboarding.self_hosted_configured";
37
+ readonly ONBOARDING_CUSTOM_MODE_CONFIGURED: "onboarding.custom_mode_configured";
38
+ readonly ONBOARDING_DEPENDENCIES_CHOICE: "onboarding.dependencies_choice";
39
+ readonly ONBOARDING_DEPENDENCIES_INSTALLED: "onboarding.dependencies_installed";
40
+ readonly ONBOARDING_GITHUB_STAR: "onboarding.github_star";
41
+ readonly INSTANCES_LISTED: "instances.listed";
42
+ readonly INSTANCE_SELECTED: "instance.selected";
43
+ readonly INSTANCE_CREATED: "instance.created";
44
+ readonly ERROR_OCCURRED: "error.occurred";
45
+ readonly MIGRATION_STARTED: "migration.started";
46
+ readonly MIGRATION_PLANNED: "migration.planned";
47
+ readonly MIGRATION_EXECUTED: "migration.executed";
48
+ readonly MIGRATION_COMPLETED: "migration.completed";
49
+ readonly MIGRATION_FAILED: "migration.failed";
50
+ readonly GENERATE_STARTED: "generate.started";
51
+ readonly GENERATE_COMPLETED: "generate.completed";
52
+ readonly GENERATE_FAILED: "generate.failed";
53
+ readonly SELF_HOST_STARTED: "self-host.started";
54
+ readonly SELF_HOST_COMPLETED: "self-host.completed";
55
+ readonly SELF_HOST_FAILED: "self-host.failed";
56
+ };
57
+ export type TelemetryEventNameType = (typeof TelemetryEventName)[keyof typeof TelemetryEventName];
58
+ export interface TelemetryOptions {
59
+ /** Custom PostHog client instance */
60
+ client?: PostHog;
61
+ /** Disable telemetry */
62
+ disabled?: boolean;
63
+ /** Enable debug mode */
64
+ debug?: boolean;
65
+ /** Default properties for all events */
66
+ defaultProperties?: Record<string, string | number | boolean>;
67
+ /** Logger instance */
68
+ logger?: CliLogger;
69
+ }
70
+ /**
71
+ * Create a telemetry instance
72
+ */
73
+ export declare function createTelemetry(options?: TelemetryOptions): Telemetry;
74
+ /**
75
+ * Create a disabled telemetry instance (for testing)
76
+ */
77
+ export declare function createDisabledTelemetry(): Telemetry;
78
+ //# sourceMappingURL=telemetry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../src/core/telemetry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAGrD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqErB,CAAC;AAEX,MAAM,MAAM,sBAAsB,GACjC,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,OAAO,kBAAkB,CAAC,CAAC;AAG9D,MAAM,WAAW,gBAAgB;IAChC,qCAAqC;IACrC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,wBAAwB;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wBAAwB;IACxB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,wCAAwC;IACxC,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;IAC9D,sBAAsB;IACtB,MAAM,CAAC,EAAE,SAAS,CAAC;CACnB;AAoOD;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAErE;AAED;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,SAAS,CAEnD"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Framework detection module
3
+ *
4
+ * Detects the framework being used in a project by analyzing package.json
5
+ */
6
+ import type { CliLogger, FrameworkDetectionResult } from '../types';
7
+ /**
8
+ * Detect the framework and React usage in the project
9
+ */
10
+ export declare function detectFramework(projectRoot: string, logger?: CliLogger): Promise<FrameworkDetectionResult>;
11
+ /**
12
+ * Detect the project root by finding the package.json file
13
+ */
14
+ export declare function detectProjectRoot(cwd: string, logger?: CliLogger): Promise<string>;
15
+ /**
16
+ * Check if a framework is Next.js
17
+ */
18
+ export declare function isNextJs(framework: FrameworkDetectionResult): boolean;
19
+ /**
20
+ * Check if a framework is React-based
21
+ */
22
+ export declare function isReactBased(framework: FrameworkDetectionResult): boolean;
23
+ /**
24
+ * Get the display name for a framework
25
+ */
26
+ export declare function getFrameworkDisplayName(framework: FrameworkDetectionResult): string;
27
+ /**
28
+ * Get the recommended package for a framework
29
+ */
30
+ export declare function getRecommendedPackage(framework: FrameworkDetectionResult): string;
31
+ //# sourceMappingURL=framework.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"framework.d.ts","sourceRoot":"","sources":["../../src/detection/framework.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,SAAS,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAEpE;;GAEG;AACH,wBAAsB,eAAe,CACpC,WAAW,EAAE,MAAM,EACnB,MAAM,CAAC,EAAE,SAAS,GAChB,OAAO,CAAC,wBAAwB,CAAC,CAkFnC;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CACtC,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,SAAS,GAChB,OAAO,CAAC,MAAM,CAAC,CAkDjB;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,SAAS,EAAE,wBAAwB,GAAG,OAAO,CAErE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,wBAAwB,GAAG,OAAO,CAEzE;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACtC,SAAS,EAAE,wBAAwB,GACjC,MAAM,CAER;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACpC,SAAS,EAAE,wBAAwB,GACjC,MAAM,CAER"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Detection module exports
3
+ */
4
+ export { detectFramework, detectProjectRoot, getFrameworkDisplayName, getRecommendedPackage, isNextJs, isReactBased, } from './framework';
5
+ export { findLayoutFile, getComponentsDirectory, getProvidersDirectory, isAppRouter, isPagesRouter, } from './layout';
6
+ export { detectPackageManager, getExecCommand, getInstallCommand, getRunCommand, isPackageInstalled, } from './package-manager';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/detection/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EACN,eAAe,EACf,iBAAiB,EACjB,uBAAuB,EACvB,qBAAqB,EACrB,QAAQ,EACR,YAAY,GACZ,MAAM,aAAa,CAAC;AAErB,OAAO,EACN,cAAc,EACd,sBAAsB,EACtB,qBAAqB,EACrB,WAAW,EACX,aAAa,GACb,MAAM,UAAU,CAAC;AAElB,OAAO,EACN,oBAAoB,EACpB,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,kBAAkB,GAClB,MAAM,mBAAmB,CAAC"}