@chimerai/cli 0.2.77 β†’ 0.2.79

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.
@@ -1 +1 @@
1
- {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAYH,UAAU,aAAa;IACrB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAsDD,wBAAsB,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,iBA0G9E"}
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAmBH,UAAU,aAAa;IACrB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AA+CD,wBAAsB,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,iBAuH9E"}
@@ -50,53 +50,47 @@ const child_process_1 = require("child_process");
50
50
  const templates = __importStar(require("../templates/index.js"));
51
51
  const index_js_1 = require("../templates/index.js");
52
52
  const utils_js_1 = require("../utils.js");
53
+ const license_js_1 = require("../license.js");
54
+ /** Canonical feature definitions for `chimerai create` */
53
55
  const AVAILABLE_FEATURES = [
54
- {
55
- name: 'πŸ” Authentication (NextAuth)',
56
- value: 'auth',
57
- checked: true,
58
- },
59
- {
60
- name: 'πŸ‘₯ RBAC System (Users, Roles, Permissions)',
61
- value: 'rbac',
62
- checked: true,
63
- },
64
- {
65
- name: 'πŸ”Œ Model Providers Management',
66
- value: 'model-providers',
67
- checked: true,
68
- },
69
- {
70
- name: 'πŸ“ Prompt Template Management',
71
- value: 'prompts',
72
- checked: true,
73
- },
74
- {
75
- name: 'πŸ’¬ AI Chat Interface',
76
- value: 'chat',
77
- checked: false,
78
- },
79
- {
80
- name: 'πŸ” RAG / Vector Store (FAISS)',
81
- value: 'rag',
82
- checked: false,
83
- },
84
- {
85
- name: 'πŸ’³ Billing System (Stripe)',
86
- value: 'billing',
87
- checked: false,
88
- },
89
- {
90
- name: 'πŸ“Š API Usage Analytics',
91
- value: 'analytics',
92
- checked: true,
93
- },
94
- {
95
- name: '🎨 Admin Dashboard',
96
- value: 'admin',
97
- checked: true,
98
- },
56
+ { name: 'πŸ” Authentication (NextAuth)', value: 'auth', licenseKey: 'auth', checked: true },
57
+ { name: 'πŸ‘₯ RBAC System (Users, Roles, Permissions)', value: 'rbac', licenseKey: 'rbac', checked: true },
58
+ { name: 'πŸ”Œ Model Providers Management', value: 'model-providers', licenseKey: 'model-providers', checked: true },
59
+ { name: 'πŸ“ Prompt Template Management', value: 'prompt-management', licenseKey: 'prompt-management', checked: true },
60
+ { name: 'πŸ’¬ AI Chat Interface', value: 'ai-chat', licenseKey: 'ai-chat', checked: false },
61
+ { name: 'πŸ” RAG / Vector Store (FAISS)', value: 'rag', licenseKey: 'rag', checked: false },
62
+ { name: 'πŸ’³ Billing System (Stripe)', value: 'billing', licenseKey: 'billing', checked: false },
63
+ { name: 'πŸ“Š API Usage Analytics', value: 'analytics', licenseKey: 'analytics', checked: true },
64
+ { name: '🎨 Admin Dashboard', value: 'admin-dashboard', licenseKey: 'admin-dashboard', checked: true },
99
65
  ];
66
+ function getRequiredTierLabel(licenseKey) {
67
+ if (license_js_1.FREE_COMPONENTS.has(licenseKey))
68
+ return null;
69
+ if (license_js_1.ENTERPRISE_PRO_COMPONENTS[licenseKey])
70
+ return 'Enterprise Pro';
71
+ if (license_js_1.ENTERPRISE_COMPONENTS[licenseKey])
72
+ return 'Enterprise';
73
+ return null;
74
+ }
75
+ function buildChoices(edition) {
76
+ return AVAILABLE_FEATURES.map((f) => {
77
+ const tier = getRequiredTierLabel(f.licenseKey);
78
+ const locked = tier === 'Enterprise Pro'
79
+ ? !(0, license_js_1.meetsRequirement)(edition, 'enterprise-pro')
80
+ : tier === 'Enterprise'
81
+ ? !(0, license_js_1.meetsRequirement)(edition, 'enterprise')
82
+ : false;
83
+ if (locked) {
84
+ return {
85
+ name: chalk_1.default.gray(`${f.name} πŸ”’ ${tier} β€” chimerai.dev/pricing`),
86
+ value: f.value,
87
+ checked: false,
88
+ disabled: 'Requires license',
89
+ };
90
+ }
91
+ return { name: f.name, value: f.value, checked: f.checked };
92
+ });
93
+ }
100
94
  async function createCommand(projectName, options) {
101
95
  console.log(chalk_1.default.bold.cyan('\nπŸš€ Create New ChimerAI Project\n'));
102
96
  // Validate project name
@@ -108,10 +102,19 @@ async function createCommand(projectName, options) {
108
102
  if (fs_extra_1.default.existsSync(targetDir)) {
109
103
  (0, utils_js_1.handleCliError)(`Directory "${projectName}" already exists`);
110
104
  }
105
+ const edition = (0, license_js_1.getEdition)();
106
+ const choices = buildChoices(edition);
107
+ // Show license status hint
108
+ if (edition === 'free') {
109
+ console.log(chalk_1.default.yellow('β„Ή Free tier active β€” Enterprise features are shown but locked.') +
110
+ chalk_1.default.gray(' Run `chimerai activate <KEY>` to unlock.\n'));
111
+ }
111
112
  let selectedFeatures;
112
113
  if (options.yes) {
113
- // Use defaults
114
- selectedFeatures = AVAILABLE_FEATURES.filter((f) => f.checked).map((f) => f.value);
114
+ // Use defaults β€” only features the current license allows
115
+ selectedFeatures = choices
116
+ .filter((c) => !('disabled' in c) && c.checked)
117
+ .map((c) => c.value);
115
118
  console.log(chalk_1.default.cyan('Using default feature set...'));
116
119
  }
117
120
  else {
@@ -121,7 +124,7 @@ async function createCommand(projectName, options) {
121
124
  type: 'checkbox',
122
125
  name: 'features',
123
126
  message: 'Select features to include:',
124
- choices: AVAILABLE_FEATURES,
127
+ choices,
125
128
  pageSize: 15,
126
129
  },
127
130
  ]);
package/dist/license.d.ts CHANGED
@@ -20,6 +20,7 @@ export interface LicenseFile {
20
20
  activatedAt: string;
21
21
  lastChecked?: string;
22
22
  }
23
+ export declare function meetsRequirement(actual: Edition, required: Edition): boolean;
23
24
  /** Free-Komponenten β€” immer verfΓΌgbar, kein Gate */
24
25
  export declare const FREE_COMPONENTS: Set<string>;
25
26
  /** Enterprise-Komponenten (Enterprise + Enterprise Pro) */
@@ -1 +1 @@
1
- {"version":3,"file":"license.d.ts","sourceRoot":"","sources":["../src/license.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAQH,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,YAAY,GAAG,gBAAgB,CAAC;AAE/D,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AA8BD,oDAAoD;AACpD,eAAO,MAAM,eAAe,aAQ1B,CAAC;AAEH,2DAA2D;AAC3D,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAUxD,CAAC;AAEF,sDAAsD;AACtD,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAK5D,CAAC;AAIF,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAKpE;AAID,wBAAgB,WAAW,IAAI,WAAW,GAAG,IAAI,CAQhD;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAGvD;AAED,wBAAgB,YAAY,IAAI,IAAI,CAInC;AAID,wBAAgB,UAAU,IAAI,OAAO,CAcpC;AAED,oEAAoE;AACpE,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,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D,CAAC;AAIF,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAKpE;AAID,wBAAgB,WAAW,IAAI,WAAW,GAAG,IAAI,CAQhD;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAGvD;AAED,wBAAgB,YAAY,IAAI,IAAI,CAInC;AAID,wBAAgB,UAAU,IAAI,OAAO,CAcpC;AAED,oEAAoE;AACpE,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,CAWrD;AAED,wGAAwG;AACxG,wBAAsB,qBAAqB,CACzC,GAAG,EAAE,MAAM,GACV,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CA8BjF;AAED,wBAAgB,oBAAoB,IAAI,OAAO,CAE9C;AAED,wBAAgB,sBAAsB,IAAI,OAAO,CAEhD;AAID;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CA6D7D;AAUD,wBAAgB,kBAAkB,IAAI,IAAI,CAuBzC"}
package/dist/license.js CHANGED
@@ -16,6 +16,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
16
16
  };
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.ENTERPRISE_PRO_COMPONENTS = exports.ENTERPRISE_COMPONENTS = exports.FREE_COMPONENTS = void 0;
19
+ exports.meetsRequirement = meetsRequirement;
19
20
  exports.getRequiredEdition = getRequiredEdition;
20
21
  exports.readLicense = readLicense;
21
22
  exports.writeLicense = writeLicense;
@@ -66,6 +67,7 @@ exports.FREE_COMPONENTS = new Set([
66
67
  /** Enterprise-Komponenten (Enterprise + Enterprise Pro) */
67
68
  exports.ENTERPRISE_COMPONENTS = {
68
69
  auth: 'NextAuth Authentication + Session Management',
70
+ rbac: 'RBAC System (Users, Roles, Permissions)',
69
71
  billing: 'Stripe Billing & Subscriptions',
70
72
  'admin-dashboard': 'Admin Dashboard Overview',
71
73
  'users-table': 'User Management CRUD',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chimerai/cli",
3
- "version": "0.2.77",
3
+ "version": "0.2.79",
4
4
  "description": "CLI wizard for ChimerAI starter kit β€” scaffold auth, RBAC, AI chat, billing and more into any Next.js project",
5
5
  "main": "./dist/index.js",
6
6
  "bin": {