cullit 0.3.0 → 0.5.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 (2) hide show
  1. package/dist/index.js +43 -4
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -1,12 +1,16 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/index.ts
4
- import { runPipeline, VERSION, createLogger, analyzeReleaseReadiness, resolveLicense } from "@cullit/core";
4
+ import { runPipeline, VERSION, createLogger, analyzeReleaseReadiness, resolveLicense, AI_PROVIDERS, AUDIENCES, TONES, SOURCE_TYPES } from "@cullit/core";
5
5
  import { loadConfig } from "@cullit/config";
6
6
  import { getRecentTags } from "@cullit/core";
7
7
  import { writeFileSync, readFileSync, existsSync } from "fs";
8
8
  import { resolve } from "path";
9
9
  import { createInterface } from "readline";
10
+ try {
11
+ await import("@cullit/pro");
12
+ } catch {
13
+ }
10
14
  function loadEnv() {
11
15
  const envPath = resolve(process.cwd(), ".env");
12
16
  if (!existsSync(envPath)) return;
@@ -127,9 +131,9 @@ async function runGenerate(from, to, opts) {
127
131
  process.exitCode = 1;
128
132
  return;
129
133
  }
130
- const VALID_PROVIDERS = ["anthropic", "openai", "gemini", "ollama", "openclaw", "none"];
131
- const VALID_AUDIENCES = ["developer", "end-user", "executive"];
132
- const VALID_SOURCES = ["local", "jira", "linear"];
134
+ const VALID_PROVIDERS = AI_PROVIDERS;
135
+ const VALID_AUDIENCES = AUDIENCES;
136
+ const VALID_SOURCES = SOURCE_TYPES;
133
137
  if (opts.provider) {
134
138
  if (!VALID_PROVIDERS.includes(opts.provider)) {
135
139
  console.error(`
@@ -252,14 +256,49 @@ function ask(rl, question) {
252
256
  }
253
257
  async function interactiveInit() {
254
258
  const rl = createInterface({ input: process.stdin, output: process.stdout });
259
+ const VALID_PROVIDERS = AI_PROVIDERS;
260
+ const VALID_SOURCES = SOURCE_TYPES;
261
+ const VALID_AUDIENCES = AUDIENCES;
262
+ const VALID_TONES = TONES;
263
+ const VALID_ENRICHMENTS = ["jira", "linear", "both", "none"];
255
264
  console.log("\n Cullit \u2014 Project Setup\n");
256
265
  const provider = await ask(rl, " AI provider (anthropic/openai/gemini/ollama/openclaw/none) [anthropic]: ") || "anthropic";
266
+ if (!VALID_PROVIDERS.includes(provider)) {
267
+ console.error(`
268
+ \u2717 Invalid provider: ${provider}. Must be one of: ${VALID_PROVIDERS.join(", ")}`);
269
+ rl.close();
270
+ process.exit(1);
271
+ }
257
272
  const source = await ask(rl, " Source type (local/jira/linear) [local]: ") || "local";
273
+ if (!VALID_SOURCES.includes(source)) {
274
+ console.error(`
275
+ \u2717 Invalid source: ${source}. Must be one of: ${VALID_SOURCES.join(", ")}`);
276
+ rl.close();
277
+ process.exit(1);
278
+ }
258
279
  const audience = await ask(rl, " Audience (developer/end-user/executive) [developer]: ") || "developer";
280
+ if (!VALID_AUDIENCES.includes(audience)) {
281
+ console.error(`
282
+ \u2717 Invalid audience: ${audience}. Must be one of: ${VALID_AUDIENCES.join(", ")}`);
283
+ rl.close();
284
+ process.exit(1);
285
+ }
259
286
  const tone = await ask(rl, " Tone (professional/casual/terse) [professional]: ") || "professional";
287
+ if (!VALID_TONES.includes(tone)) {
288
+ console.error(`
289
+ \u2717 Invalid tone: ${tone}. Must be one of: ${VALID_TONES.join(", ")}`);
290
+ rl.close();
291
+ process.exit(1);
292
+ }
260
293
  let enrichment = "";
261
294
  if (source === "local") {
262
295
  enrichment = await ask(rl, " Enrich from (jira/linear/both/none) [none]: ") || "none";
296
+ if (!VALID_ENRICHMENTS.includes(enrichment)) {
297
+ console.error(`
298
+ \u2717 Invalid enrichment: ${enrichment}. Must be one of: ${VALID_ENRICHMENTS.join(", ")}`);
299
+ rl.close();
300
+ process.exit(1);
301
+ }
263
302
  }
264
303
  rl.close();
265
304
  const enrichmentLine = enrichment === "both" ? "\n enrichment: [jira, linear]" : enrichment === "jira" || enrichment === "linear" ? `
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cullit",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "type": "module",
5
5
  "description": "Cull the noise from your releases. AI-powered release notes from the CLI.",
6
6
  "license": "MIT",
@@ -29,8 +29,8 @@
29
29
  "node": ">=18"
30
30
  },
31
31
  "dependencies": {
32
- "@cullit/core": "0.3.0",
33
- "@cullit/config": "0.3.0"
32
+ "@cullit/core": "0.5.0",
33
+ "@cullit/config": "0.5.0"
34
34
  },
35
35
  "scripts": {
36
36
  "build": "tsup src/index.ts --format esm --clean",