@devness/useai-cli 0.5.46 → 0.5.48

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 +62 -13
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -30,7 +30,7 @@ var SYSTEMD_SERVICE_PATH = join(homedir(), ".config", "systemd", "user", "useai-
30
30
  var WINDOWS_STARTUP_SCRIPT_PATH = join(process.env["APPDATA"] ?? join(homedir(), "AppData", "Roaming"), "Microsoft", "Windows", "Start Menu", "Programs", "Startup", "useai-daemon.vbs");
31
31
 
32
32
  // ../shared/dist/constants/version.js
33
- var VERSION = "0.5.46";
33
+ var VERSION = "0.5.48";
34
34
 
35
35
  // ../shared/dist/constants/defaults.js
36
36
  var DEFAULT_CONFIG = {
@@ -4481,7 +4481,10 @@ var coerce = {
4481
4481
  var NEVER = INVALID;
4482
4482
 
4483
4483
  // ../shared/dist/validation/schemas.js
4484
- var taskTypeSchema = external_exports.enum([
4484
+ function enumWithAliases(values, aliases) {
4485
+ return external_exports.preprocess((val) => typeof val === "string" ? aliases[val] ?? val : val, external_exports.enum(values));
4486
+ }
4487
+ var taskTypeSchema = enumWithAliases([
4485
4488
  "coding",
4486
4489
  "debugging",
4487
4490
  "testing",
@@ -4497,7 +4500,7 @@ var taskTypeSchema = external_exports.enum([
4497
4500
  "data",
4498
4501
  "security",
4499
4502
  "configuration",
4500
- // aliases models commonly try
4503
+ // aliases accepted directly in enum (visible in JSON Schema)
4501
4504
  "code_review",
4502
4505
  "code-review",
4503
4506
  "investigation",
@@ -4507,8 +4510,23 @@ var taskTypeSchema = external_exports.enum([
4507
4510
  "setup",
4508
4511
  "refactoring",
4509
4512
  "other"
4510
- ]);
4511
- var milestoneCategorySchema = external_exports.enum([
4513
+ ], {
4514
+ // verb/truncated forms → canonical gerund/noun
4515
+ review: "reviewing",
4516
+ document: "documenting",
4517
+ debug: "debugging",
4518
+ test: "testing",
4519
+ code: "coding",
4520
+ learn: "learning",
4521
+ deploy: "deployment",
4522
+ plan: "planning",
4523
+ migrate: "migration",
4524
+ refactor: "refactoring",
4525
+ investigate: "investigation",
4526
+ configure: "configuration",
4527
+ designing: "design"
4528
+ });
4529
+ var milestoneCategorySchema = enumWithAliases([
4512
4530
  "feature",
4513
4531
  "bugfix",
4514
4532
  "refactor",
@@ -4516,7 +4534,7 @@ var milestoneCategorySchema = external_exports.enum([
4516
4534
  "docs",
4517
4535
  "setup",
4518
4536
  "deployment",
4519
- // aliases models commonly try
4537
+ // aliases accepted directly in enum (visible in JSON Schema)
4520
4538
  "fix",
4521
4539
  "bug_fix",
4522
4540
  "testing",
@@ -4534,12 +4552,22 @@ var milestoneCategorySchema = external_exports.enum([
4534
4552
  "design",
4535
4553
  "devops",
4536
4554
  "other"
4537
- ]);
4538
- var complexitySchema = external_exports.enum([
4555
+ ], {
4556
+ // common model shorthand → canonical
4557
+ bug: "bugfix",
4558
+ "bug-fix": "bugfix",
4559
+ doc: "docs",
4560
+ document: "docs",
4561
+ documenting: "docs",
4562
+ feat: "feature",
4563
+ perf: "performance",
4564
+ refactoring: "refactor"
4565
+ });
4566
+ var complexitySchema = enumWithAliases([
4539
4567
  "simple",
4540
4568
  "medium",
4541
4569
  "complex",
4542
- // aliases models commonly try
4570
+ // aliases accepted directly in enum (visible in JSON Schema)
4543
4571
  "low",
4544
4572
  "high",
4545
4573
  "trivial",
@@ -4547,7 +4575,11 @@ var complexitySchema = external_exports.enum([
4547
4575
  "moderate",
4548
4576
  "hard",
4549
4577
  "difficult"
4550
- ]);
4578
+ ], {
4579
+ basic: "simple",
4580
+ intermediate: "medium",
4581
+ advanced: "complex"
4582
+ });
4551
4583
  var milestoneInputSchema = external_exports.object({
4552
4584
  title: external_exports.string().min(1).max(500),
4553
4585
  category: milestoneCategorySchema,
@@ -4603,13 +4635,28 @@ var KNOWN_PATHS = isWindows ? [] : [
4603
4635
  join2(homedir2(), ".bun", "bin", "npx")
4604
4636
  ];
4605
4637
  function resolveNpxPath() {
4606
- const whichCmd = isWindows ? "where npx" : "which npx";
4638
+ const whichCmd = isWindows ? "where npx.cmd" : "which npx";
4607
4639
  try {
4608
4640
  const result = execSync(whichCmd, { stdio: ["pipe", "pipe", "ignore"], encoding: "utf-8" }).trim();
4609
4641
  if (result)
4610
4642
  return result.split("\n")[0].trim();
4611
4643
  } catch {
4612
4644
  }
4645
+ if (isWindows) {
4646
+ try {
4647
+ const result = execSync("where npx", { stdio: ["pipe", "pipe", "ignore"], encoding: "utf-8" }).trim();
4648
+ if (result) {
4649
+ const first = result.split("\n")[0].trim();
4650
+ if (!first.toLowerCase().endsWith(".cmd")) {
4651
+ const cmdPath = first + ".cmd";
4652
+ if (existsSync3(cmdPath))
4653
+ return cmdPath;
4654
+ }
4655
+ return first;
4656
+ }
4657
+ } catch {
4658
+ }
4659
+ }
4613
4660
  if (!isWindows && process.env["SHELL"]) {
4614
4661
  try {
4615
4662
  const result = execSync(`${process.env["SHELL"]} -lc "which npx"`, {
@@ -4775,7 +4822,8 @@ async function ensureDaemon(options) {
4775
4822
  npxArgs.push("@devness/useai@latest", "daemon", "--port", String(DAEMON_PORT));
4776
4823
  const child = spawn(npxPath, npxArgs, {
4777
4824
  detached: true,
4778
- stdio: "ignore"
4825
+ stdio: "ignore",
4826
+ shell: process.platform === "win32"
4779
4827
  });
4780
4828
  child.unref();
4781
4829
  const start = Date.now();
@@ -6490,7 +6538,8 @@ var startCommand = new Command8("start").description("Start the UseAI daemon").o
6490
6538
  }
6491
6539
  if (opts.foreground) {
6492
6540
  const child = spawn2("npx", ["-y", "@devness/useai@latest", "daemon", "--port", String(port)], {
6493
- stdio: "inherit"
6541
+ stdio: "inherit",
6542
+ shell: process.platform === "win32"
6494
6543
  });
6495
6544
  child.on("exit", (code) => {
6496
6545
  process.exit(code ?? 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devness/useai-cli",
3
- "version": "0.5.46",
3
+ "version": "0.5.48",
4
4
  "description": "CLI tool for useai.dev — stats, sync, publish your AI development workflow",
5
5
  "author": "nabeelkausari",
6
6
  "license": "MIT",