chofex-cli 0.1.187 → 0.1.189

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 +28 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -63291,6 +63291,8 @@ import { tmpdir as tmpdir2 } from "node:os";
63291
63291
  import { dirname as dirname2, isAbsolute, join as join3, relative, sep } from "node:path";
63292
63292
  var cliPackageName = "chofex-cli";
63293
63293
  var upgradeVersion = "latest";
63294
+ var skillName = "chofex-hackathon";
63295
+ var skillRepository = "https://github.com/crafter-station/hack-the-andes";
63294
63296
  var npmRegistryUrl = `https://registry.npmjs.org/${cliPackageName}/latest`;
63295
63297
  var npmUpgradeArguments = (cacheDirectory, version) => [
63296
63298
  "install",
@@ -63344,6 +63346,10 @@ var runNpm = (arguments_) => {
63344
63346
  const executable = process.platform === "win32" ? "npm.cmd" : "npm";
63345
63347
  return runProcess(executable, arguments_);
63346
63348
  };
63349
+ var runSkillInstaller = (arguments_) => {
63350
+ const executable = process.platform === "win32" ? "npx.cmd" : "npx";
63351
+ return runProcess(executable, arguments_);
63352
+ };
63347
63353
  var installerUrl = "https://hacktheandes.com/install";
63348
63354
  var runInstaller = async (installDirectory, version) => {
63349
63355
  const response = await fetch(installerUrl);
@@ -63372,7 +63378,7 @@ var assertSuccessful = (result3, program) => {
63372
63378
  let detail = "";
63373
63379
  if (result3.stderr)
63374
63380
  detail = `: ${result3.stderr}`;
63375
- throw new Error(`${program} exited with code ${result3.exitCode}${detail}`);
63381
+ throw new Error(`${program} terminó con código ${result3.exitCode}${detail}`);
63376
63382
  };
63377
63383
  var upgradeCli = async (options = {}) => {
63378
63384
  const version = options.version ?? upgradeVersion;
@@ -63392,6 +63398,21 @@ var upgradeCli = async (options = {}) => {
63392
63398
  await rm2(cacheDirectory, { recursive: true, force: true });
63393
63399
  }
63394
63400
  };
63401
+ var updateChofex = async (options = {}) => {
63402
+ await upgradeCli(options);
63403
+ const runner = options.skillRunner ?? runSkillInstaller;
63404
+ const result3 = await runner([
63405
+ "--yes",
63406
+ "skills",
63407
+ "add",
63408
+ skillRepository,
63409
+ "--skill",
63410
+ skillName,
63411
+ "-g",
63412
+ "-y"
63413
+ ]);
63414
+ assertSuccessful(result3, "instalador de skills");
63415
+ };
63395
63416
  var parseVersion = (version) => {
63396
63417
  const match9 = version.match(/^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/);
63397
63418
  if (match9 === null)
@@ -63765,21 +63786,22 @@ var makeUpgradeCommand = (name) => exports_Command.make(name, {}, exports_Effect
63765
63786
  const options = yield* root;
63766
63787
  const operation = exports_Effect.tryPromise({
63767
63788
  try: async () => {
63768
- await upgradeCli();
63789
+ await updateChofex();
63769
63790
  return {
63770
63791
  version: 1,
63771
63792
  ok: true,
63772
63793
  requestId: crypto.randomUUID(),
63773
63794
  data: {
63774
63795
  packageName: cliPackageName,
63775
- requestedVersion: upgradeVersion
63796
+ requestedVersion: upgradeVersion,
63797
+ skillName
63776
63798
  }
63777
63799
  };
63778
63800
  },
63779
- catch: (error2) => cliError("UPGRADE_FAILED", `Could not update ${cliPackageName}`, false, String(error2))
63801
+ catch: (error2) => cliError("UPGRADE_FAILED", `No se pudieron actualizar ${cliPackageName} y ${skillName}`, false, String(error2))
63780
63802
  });
63781
- yield* execute(options.output, operation, () => `Updated ${cliPackageName} to the ${upgradeVersion} version.`);
63782
- })).pipe(exports_Command.withDescription("Update chofex-cli to the latest version"));
63803
+ yield* execute(options.output, operation, () => `Se actualizó ${cliPackageName} a la versión ${upgradeVersion} y se refrescó ${skillName}.`);
63804
+ })).pipe(exports_Command.withDescription("Actualiza chofex-cli y su skill de agente a la última versión"));
63783
63805
  var updateCommand = makeUpgradeCommand("update");
63784
63806
  var upgradeCommand = makeUpgradeCommand("upgrade");
63785
63807
  var inputValidation = (stage, path4) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chofex-cli",
3
- "version": "0.1.187",
3
+ "version": "0.1.189",
4
4
  "description": "Command-line client for Hack the Andes",
5
5
  "type": "module",
6
6
  "bin": {