@cullit/core 2.0.2 → 2.0.4

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.
package/dist/index.d.ts CHANGED
@@ -71,7 +71,7 @@ interface PipelineResult {
71
71
  duration: number;
72
72
  }
73
73
 
74
- declare const VERSION = "2.0.2";
74
+ declare const VERSION = "2.0.4";
75
75
  declare const DEFAULT_CATEGORIES: string[];
76
76
  declare const DEFAULT_MODELS: Record<string, string>;
77
77
  declare const AI_PROVIDERS: readonly ["anthropic", "openai", "gemini", "ollama", "none"];
@@ -263,8 +263,10 @@ declare function isEnrichmentAllowed(license: LicenseStatus): boolean;
263
263
  declare function isAudienceToneAllowed(license: LicenseStatus): boolean;
264
264
  /**
265
265
  * Build a human-readable upgrade message for a gated feature.
266
+ * @param feature - The feature name to include in the message.
267
+ * @param minTier - Optional minimum tier required (e.g. 'pro', 'team').
266
268
  */
267
- declare function upgradeMessage(feature: string): string;
269
+ declare function upgradeMessage(feature: string, minTier?: string): string;
268
270
  interface UsageLimits {
269
271
  generationsPerMonth: number;
270
272
  maxProjects: number;
@@ -277,7 +279,7 @@ type TeamFeature = 'drafts' | 'approvals' | 'shared_history' | 'project_template
277
279
  /**
278
280
  * Check whether a license tier grants access to a Team/Enterprise feature.
279
281
  */
280
- declare function isFeatureAllowed(feature: TeamFeature, tier: string): boolean;
282
+ declare function isFeatureAllowed(feature: TeamFeature, tier: string, valid?: boolean): boolean;
281
283
  /**
282
284
  * Build a gating summary for a tier — which features are unlocked.
283
285
  */
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/constants.ts
2
- var VERSION = "2.0.2";
2
+ var VERSION = "2.0.4";
3
3
  var DEFAULT_CATEGORIES = ["features", "fixes", "breaking", "improvements", "chores"];
4
4
  var DEFAULT_MODELS = {
5
5
  anthropic: "claude-sonnet-4-20250514",
@@ -843,8 +843,9 @@ function isEnrichmentAllowed(license) {
843
843
  function isAudienceToneAllowed(license) {
844
844
  return (license.tier === "pro" || license.tier === "team" || license.tier === "enterprise") && license.valid;
845
845
  }
846
- function upgradeMessage(feature) {
847
- return `\u{1F512} ${feature} requires a paid Cullit plan.
846
+ function upgradeMessage(feature, minTier) {
847
+ const tierLabel = minTier === "team" ? "a Team plan or above" : minTier === "pro" ? "a Pro plan or above" : minTier === "basic" ? "a Basic plan or above" : minTier === "enterprise" ? "an Enterprise plan" : "a paid Cullit plan";
848
+ return `\u{1F512} ${feature} requires ${tierLabel}.
848
849
  Upgrade at https://cullit.io/pricing
849
850
  Then set CULLIT_API_KEY in your environment.`;
850
851
  }
@@ -870,7 +871,8 @@ var FEATURE_TIERS = {
870
871
  audit_logs: /* @__PURE__ */ new Set(["enterprise"]),
871
872
  sso: /* @__PURE__ */ new Set(["enterprise"])
872
873
  };
873
- function isFeatureAllowed(feature, tier) {
874
+ function isFeatureAllowed(feature, tier, valid = true) {
875
+ if (!valid) return false;
874
876
  const allowed = FEATURE_TIERS[feature];
875
877
  return allowed ? allowed.has(tier) : false;
876
878
  }
@@ -1134,7 +1136,7 @@ async function runPipeline(from, to, config, options = {}) {
1134
1136
  log.warn(`\u26A0 ${license.message || "Invalid CULLIT_API_KEY \u2014 running in free mode."}`);
1135
1137
  }
1136
1138
  if (!isProviderAllowed(config.ai.provider, license)) {
1137
- throw new CullitError(CoreErrorCode.LICENSE_TIER_INSUFFICIENT, upgradeMessage(`AI provider "${config.ai.provider}"`));
1139
+ throw new CullitError(CoreErrorCode.LICENSE_TIER_INSUFFICIENT, upgradeMessage(`AI provider "${config.ai.provider}"`, "pro"));
1138
1140
  }
1139
1141
  const collectorFactory = getCollector(config.source.type);
1140
1142
  if (!collectorFactory) {
@@ -1157,7 +1159,7 @@ async function runPipeline(from, to, config, options = {}) {
1157
1159
  const enrichmentSources = config.source.enrichment || [];
1158
1160
  for (const source of enrichmentSources) {
1159
1161
  if (!isEnrichmentAllowed(license)) {
1160
- log.info(`\xBB Skipping ${source} enrichment \u2014 ${upgradeMessage(`${source} enrichment`)}`);
1162
+ log.info(`\xBB Skipping ${source} enrichment \u2014 ${upgradeMessage(`${source} enrichment`, "pro")}`);
1161
1163
  continue;
1162
1164
  }
1163
1165
  const enricherFactory = getEnricher(source);
@@ -1167,9 +1169,13 @@ async function runPipeline(from, to, config, options = {}) {
1167
1169
  }
1168
1170
  log.info(`\xBB Enriching from ${source}...`);
1169
1171
  const enricher = enricherFactory(config);
1170
- const enrichedTickets = await enricher.enrich(diff);
1171
- tickets.push(...enrichedTickets);
1172
- log.info(`\xBB ${source}: found ${enrichedTickets.length} ${source === "jira" ? "tickets" : "issues"}`);
1172
+ try {
1173
+ const enrichedTickets = await enricher.enrich(diff);
1174
+ tickets.push(...enrichedTickets);
1175
+ log.info(`\xBB ${source}: found ${enrichedTickets.length} ${source === "jira" ? "tickets" : "issues"}`);
1176
+ } catch (err) {
1177
+ log.warn(`\u26A0 ${source} enrichment failed: ${err.message || err} \u2014 continuing without it`);
1178
+ }
1173
1179
  }
1174
1180
  const context = { diff, tickets };
1175
1181
  const providerNames = {
@@ -1206,7 +1212,7 @@ async function runPipeline(from, to, config, options = {}) {
1206
1212
  for (const target of config.publish) {
1207
1213
  try {
1208
1214
  if (!isPublisherAllowed(target.type, license)) {
1209
- log.info(`\xBB Skipping ${target.type} \u2014 ${upgradeMessage(`${target.type} publishing`)}`);
1215
+ log.info(`\xBB Skipping ${target.type} \u2014 ${upgradeMessage(`${target.type} publishing`, "pro")}`);
1210
1216
  continue;
1211
1217
  }
1212
1218
  const publisherFactory = getPublisher(target.type);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cullit/core",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "type": "module",
5
5
  "description": "Core engine for Cullit — AI-powered release note generation.",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -38,7 +38,7 @@
38
38
  "access": "public"
39
39
  },
40
40
  "dependencies": {
41
- "@cullit/config": "2.0.2"
41
+ "@cullit/config": "2.0.4"
42
42
  },
43
43
  "scripts": {
44
44
  "build": "tsup src/index.ts --format esm --dts --clean",