@powerformer/refly-cli 0.1.11 → 0.1.13

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.js CHANGED
@@ -4560,7 +4560,7 @@ var ConfigSchema = external_exports.object({
4560
4560
  installedAt: external_exports.string().optional()
4561
4561
  }).optional()
4562
4562
  });
4563
- var DEFAULT_API_ENDPOINT = "https://staging-api.refly.ai";
4563
+ var DEFAULT_API_ENDPOINT = "https://api.refly.ai";
4564
4564
  var DEFAULT_CONFIG = {
4565
4565
  version: 1,
4566
4566
  api: {
@@ -4909,16 +4909,22 @@ var path5 = __toESM(require("path"));
4909
4909
  function getPackageSkillDir() {
4910
4910
  const possiblePaths = [
4911
4911
  path5.join(__dirname, "..", "..", "skill"),
4912
- // Built package
4913
- path5.join(__dirname, "..", "..", "..", "skill")
4914
- // Development
4912
+ // Built package: dist/bin/../../skill
4913
+ path5.join(__dirname, "..", "..", "..", "skill"),
4914
+ // Development: dist/bin/../../../skill
4915
+ path5.join(__dirname, "..", "skill")
4916
+ // Alternative: dist/../skill
4915
4917
  ];
4918
+ logger.debug("Looking for skill files, __dirname:", __dirname);
4916
4919
  for (const p of possiblePaths) {
4917
- if (fs5.existsSync(p)) {
4918
- return p;
4920
+ const resolved = path5.resolve(p);
4921
+ const exists = fs5.existsSync(resolved);
4922
+ logger.debug(` Checking path: ${resolved} - exists: ${exists}`);
4923
+ if (exists) {
4924
+ return resolved;
4919
4925
  }
4920
4926
  }
4921
- throw new Error("Skill files not found in package");
4927
+ throw new Error(`Skill files not found in package. Searched paths from __dirname=${__dirname}`);
4922
4928
  }
4923
4929
  function installSkill() {
4924
4930
  const result = {
@@ -4929,31 +4935,50 @@ function installSkill() {
4929
4935
  version: getSkillVersion()
4930
4936
  };
4931
4937
  const sourceDir = getPackageSkillDir();
4938
+ logger.debug("Source skill directory:", sourceDir);
4932
4939
  const targetDir = getClaudeSkillDir();
4933
- ensureDir(targetDir);
4934
- ensureDir(path5.join(targetDir, "references"));
4940
+ logger.debug("Target skill directory:", targetDir);
4941
+ try {
4942
+ ensureDir(targetDir);
4943
+ ensureDir(path5.join(targetDir, "references"));
4944
+ logger.debug("Created target directories");
4945
+ } catch (err) {
4946
+ logger.error("Failed to create target directories:", err);
4947
+ throw err;
4948
+ }
4935
4949
  const skillSource = path5.join(sourceDir, "SKILL.md");
4936
4950
  const skillTarget = path5.join(targetDir, "SKILL.md");
4951
+ logger.debug(`Copying SKILL.md: ${skillSource} -> ${skillTarget}`);
4937
4952
  if (fs5.existsSync(skillSource)) {
4938
4953
  fs5.copyFileSync(skillSource, skillTarget);
4939
4954
  result.skillInstalled = true;
4940
4955
  result.skillPath = targetDir;
4956
+ logger.debug("SKILL.md copied successfully");
4957
+ } else {
4958
+ logger.warn("SKILL.md source not found:", skillSource);
4941
4959
  }
4942
4960
  const refsSource = path5.join(sourceDir, "references");
4943
4961
  const refsTarget = path5.join(targetDir, "references");
4944
4962
  if (fs5.existsSync(refsSource)) {
4945
4963
  const files = fs5.readdirSync(refsSource);
4964
+ logger.debug(`Copying ${files.length} reference files`);
4946
4965
  for (const file of files) {
4947
4966
  fs5.copyFileSync(path5.join(refsSource, file), path5.join(refsTarget, file));
4948
4967
  }
4949
4968
  }
4950
4969
  const commandsDir = getClaudeCommandsDir();
4970
+ logger.debug("Commands directory:", commandsDir);
4951
4971
  ensureDir(commandsDir);
4952
4972
  result.commandsInstalled = installSlashCommands(sourceDir, commandsDir);
4953
4973
  if (result.commandsInstalled) {
4954
4974
  result.commandsPath = commandsDir;
4955
4975
  }
4976
+ logger.debug("Commands installed:", result.commandsInstalled);
4956
4977
  updateSkillInfo(result.version);
4978
+ logger.info("Skill installation complete:", {
4979
+ skillInstalled: result.skillInstalled,
4980
+ commandsInstalled: result.commandsInstalled
4981
+ });
4957
4982
  return result;
4958
4983
  }
4959
4984
  function installSlashCommands(sourceDir, targetDir) {