@nomad-e/bluma-cli 0.1.34 → 0.1.35

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/main.js +43 -16
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -333,7 +333,7 @@ import { render } from "ink";
333
333
  import { EventEmitter as EventEmitter3 } from "events";
334
334
  import fs17 from "fs";
335
335
  import path21 from "path";
336
- import { fileURLToPath as fileURLToPath4 } from "url";
336
+ import { fileURLToPath as fileURLToPath5 } from "url";
337
337
  import { v4 as uuidv46 } from "uuid";
338
338
 
339
339
  // src/app/ui/App.tsx
@@ -5020,6 +5020,7 @@ import { execSync } from "child_process";
5020
5020
  import fs14 from "fs";
5021
5021
  import path16 from "path";
5022
5022
  import os10 from "os";
5023
+ import { fileURLToPath as fileURLToPath3 } from "node:url";
5023
5024
  var SkillLoader = class _SkillLoader {
5024
5025
  bundledSkillsDir;
5025
5026
  projectSkillsDir;
@@ -5040,31 +5041,57 @@ var SkillLoader = class _SkillLoader {
5040
5041
  return path16.join(process.cwd(), "dist", "config", "skills");
5041
5042
  }
5042
5043
  const candidates = [];
5044
+ const push = (p) => {
5045
+ const abs = path16.resolve(p);
5046
+ if (!candidates.includes(abs)) {
5047
+ candidates.push(abs);
5048
+ }
5049
+ };
5050
+ try {
5051
+ const bundleDir = path16.dirname(fileURLToPath3(import.meta.url));
5052
+ push(path16.join(bundleDir, "config", "skills"));
5053
+ } catch {
5054
+ }
5043
5055
  const argv1 = process.argv[1];
5044
5056
  if (argv1 && !argv1.startsWith("-")) {
5045
5057
  try {
5046
- const scriptDir = path16.dirname(path16.resolve(argv1));
5047
- candidates.push(path16.join(scriptDir, "config", "skills"));
5058
+ let resolved = argv1;
5059
+ if (path16.isAbsolute(argv1) && fs14.existsSync(argv1)) {
5060
+ resolved = fs14.realpathSync(argv1);
5061
+ } else if (!path16.isAbsolute(argv1)) {
5062
+ resolved = path16.resolve(process.cwd(), argv1);
5063
+ }
5064
+ const scriptDir = path16.dirname(resolved);
5065
+ push(path16.join(scriptDir, "config", "skills"));
5048
5066
  } catch {
5049
5067
  }
5050
5068
  }
5051
- candidates.push(
5052
- path16.join(process.cwd(), "dist", "config", "skills"),
5053
- path16.join(process.cwd(), "node_modules", "@nomad-e", "bluma-cli", "dist", "config", "skills")
5069
+ push(path16.join(process.cwd(), "dist", "config", "skills"));
5070
+ push(
5071
+ path16.join(
5072
+ process.cwd(),
5073
+ "node_modules",
5074
+ "@nomad-e",
5075
+ "bluma-cli",
5076
+ "dist",
5077
+ "config",
5078
+ "skills"
5079
+ )
5054
5080
  );
5055
5081
  if (typeof __dirname !== "undefined") {
5056
- candidates.push(
5057
- path16.join(__dirname, "config", "skills"),
5058
- path16.join(__dirname, "..", "..", "..", "config", "skills")
5059
- );
5082
+ push(path16.join(__dirname, "config", "skills"));
5083
+ push(path16.join(__dirname, "..", "..", "..", "config", "skills"));
5060
5084
  }
5061
- for (const c of candidates) {
5062
- const abs = path16.resolve(c);
5085
+ for (const abs of candidates) {
5063
5086
  if (fs14.existsSync(abs)) {
5064
5087
  return abs;
5065
5088
  }
5066
5089
  }
5067
- return path16.join(process.cwd(), "dist", "config", "skills");
5090
+ try {
5091
+ return path16.join(path16.dirname(fileURLToPath3(import.meta.url)), "config", "skills");
5092
+ } catch {
5093
+ return path16.join(process.cwd(), "dist", "config", "skills");
5094
+ }
5068
5095
  }
5069
5096
  /**
5070
5097
  * Lista skills disponíveis de todas as fontes.
@@ -8980,7 +9007,7 @@ var SlashCommands_default = SlashCommands;
8980
9007
 
8981
9008
  // src/app/agent/utils/update_check.ts
8982
9009
  import updateNotifier from "update-notifier";
8983
- import { fileURLToPath as fileURLToPath3 } from "url";
9010
+ import { fileURLToPath as fileURLToPath4 } from "url";
8984
9011
  import path20 from "path";
8985
9012
  import fs16 from "fs";
8986
9013
  var BLUMA_PACKAGE_NAME = "@nomad-e/bluma-cli";
@@ -9015,7 +9042,7 @@ async function checkForUpdates() {
9015
9042
  pkg = findBlumaPackageJson(path20.dirname(binPath));
9016
9043
  }
9017
9044
  if (!pkg) {
9018
- const __filename = fileURLToPath3(import.meta.url);
9045
+ const __filename = fileURLToPath4(import.meta.url);
9019
9046
  const __dirname2 = path20.dirname(__filename);
9020
9047
  pkg = findBlumaPackageJson(__dirname2);
9021
9048
  }
@@ -10014,7 +10041,7 @@ async function runAgentMode() {
10014
10041
  }
10015
10042
  function readCliPackageVersion() {
10016
10043
  try {
10017
- const base = path21.dirname(fileURLToPath4(import.meta.url));
10044
+ const base = path21.dirname(fileURLToPath5(import.meta.url));
10018
10045
  const pkgPath = path21.join(base, "..", "package.json");
10019
10046
  const j = JSON.parse(fs17.readFileSync(pkgPath, "utf8"));
10020
10047
  return String(j.version || "0.0.0");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nomad-e/bluma-cli",
3
- "version": "0.1.34",
3
+ "version": "0.1.35",
4
4
  "description": "BluMa independent agent for automation and advanced software engineering.",
5
5
  "author": "Alex Fonseca",
6
6
  "license": "Apache-2.0",